BB FlashBack SDK: Base Classes |
Recording Movie Player Applications
Movie/Media player-type applications usually use 'overlays' to improve performance. This feature of DirectX allows them to write more directly to the screen, but images drawn in this way cannot be captured by the SDK, whichever record mode is used.
"Hardware acceleration" needs to be disabled during recording, to force the movie player application to use an alternative method of writing to the screen which can be captured successfully. This can be done via the Windows user interface or an API call.
To disable it via the Windows user interface: Go to the Control Panel, open Display, select the Settings tab, click the Advanced button, select the Troubleshoot tab and set Hardware Acceleration to None.
Disabling it via the Windows API requires
that you set a registry value "acceleration.level" for the used
display device, and use ChangeDisplaySettingsEx to force the change to
be applied to the display. The location of this value in the registry
varies, but the code below is an example of how it can be found and set:
//
Set the acceleration level to 'none' to disable h/w acceleration DEVMODE devMode; if
(EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS,
&devMode)) bool
SetCurrentVideoAccelerationLevel(DWORD dwValue) if
(!sPath.IsEmpty()) if
(RegOpenKeyEx(HKEY_LOCAL_MACHINE, sPath.c_str(), REG_OPTION_NON_VOLATILE,
KEY_SET_VALUE, &hKey) == ERROR_SUCCESS) if
(dwValue == 0) RegCloseKey(hKey); return
res; AnsiString
FindVideoAccelerationKey() if
(RegOpenKeyEx(HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\VIDEO",
REG_OPTION_NON_VOLATILE, KEY_READ, &hKey) == ERROR_SUCCESS) sTmp[0] = 0; if
(RegQueryValueEx(hKey, "\\Device\\Video0", 0, NULL, (LPBYTE)sTmp,
&dwDummy) == ERROR_SUCCESS) if
(sResult.LowerCase().Pos("\\registry\\machine\\") == 1) } return
sResult;
|