Switchable Graphics and Multiple Monitors#
The following sections discuss support for switchable graphics and multiple monitor configurations.
Switchable Graphics#
Switchable Graphics refers to the machine configuration that multiple graphic devices are available (integrated device for power saving and discrete devices for performance.) Usually at one time or instance, one of the graphic devices drives display and becomes the active device, and others become inactive. There are different variations of software or hardware mechanisms to switch between the graphic devices. In one of the switchable graphics variations, it is possible to register an application in an affinity list to certain graphic device so that the launch of the application automatically triggers a switch. The actual techniques to enable such a switch are outside the scope of this document. This section discusses the implication of switchable graphics to Intel® Media Software Development Kit and Intel® Media Software Development Kit applications.
As Intel® Media Software Development Kit performs hardware acceleration through graphic devices, it is critical that Intel® Media Software Development Kit can access the graphic device in the switchable graphics setting. It is recommended to add the application to the graphic device affinity list. If this is not possible, the application should handle the following cases:
By design, during legacy Intel® Media Software Development Kit library initialization, the
MFXInit()
function searches for graphic devices. If a Intel® Media Software Development Kit implementation is successfully loaded, theMFXInit()
function returnsmfxStatus::MFX_ERR_NONE
and theMFXQueryIMPL()
function returns the actual implementation type. If no Intel® Media Software Development Kit implementation is loaded, theMFXInit()
function returnsmfxStatus::MFX_ERR_UNSUPPORTED
. In the switchable graphics environment, if the application is not in the graphic device affinity list, it is possible that the graphic device will not be accessible during the library initialization. The fact that theMFXInit()
function returnsmfxStatus::MFX_ERR_UNSUPPORTED
does not mean that hardware acceleration is permanently impossible. The user may switch the graphics later and the graphic device will become accessible. It is recommended that the application initialize the library right before the actual decoding, video processing, and encoding operations to determine the hardware acceleration capability.During decoding, video processing, and encoding operations, if the application is not in the graphic device affinity list, the previously accessible graphic device may become inaccessible due to a switch event. The Intel® Media Software Development Kit functions will return
mfxStatus::MFX_ERR_DEVICE_LOST
ormfxStatus::MFX_ERR_DEVICE_FAILED
, depending on when the switch occurs and what stage the Intel® Media Software Development Kit functions operate. The application should handle these errors and exit gracefully.
Multiple Monitors#
Multiple monitors refer to the machine configuration that multiple graphic devices are available. Some graphic devices connect to a display and become active and accessible under the Microsoft* DirectX* infrastructure. Graphic devices that are not connected to a display are inactive. Using the Microsoft Direct3D* 9 infrastructure, devices that are not connected to a display are not accessible.
The legacy Intel® Media Software Development Kit uses the adapter number to access a specific graphic device. Usually, the graphic device driving the main desktop becomes the primary adapter. Other graphic devices take subsequent adapter numbers after the primary adapter. Under the Microsoft Direct3D 9 infrastructure, only active adapters are accessible and have an adapter number.
Intel® Media Software Development Kit extends the mfxIMPL
implementation type as shown in the
Intel® Media SDK mfxIMPL Implementation Type Definitions table:
Implementation Type |
Definition |
---|---|
Intel® Media Software Development Kit should initialize on the primary adapter |
|
Intel® Media Software Development Kit should initialize on the 2nd graphic adapter |
|
Intel® Media Software Development Kit should initialize on the 3rd graphic adapter |
|
Intel® Media Software Development Kit should initialize on the 4th graphic adapter |
|
Intel® Media Software Development Kit should initialize on any graphic adapter. |
|
Intel® Media Software Development Kit should initialize on any graphic adapter. If not successful, load the software implementation. |
The application can use the first four definitions shown in the
Intel® Media SDK mfxIMPL Implementation Type Definitions table
to instruct the legacy Intel® Media Software Development Kit library to initialize on a specific
graphic device. The application can use the definitions for
MFX_IMPL_HARDWARE_ANY
and
MFX_IMPL_AUTO_ANY
for automatic detection.
If the application uses the Microsoft DirectX surfaces for I/O, it is critical that the application and Intel® Media Software Development Kit work on the same graphic device. It is recommended that the application use the following procedure:
The application uses the
MFXInit()
function to initialize the legacy Intel® Media Software Development Kit, with optionMFX_IMPL_HARDWARE_ANY
orMFX_IMPL_AUTO_ANY
. TheMFXInit()
function returnsmfxStatus::MFX_ERR_NONE
if successful.The application uses the
MFXQueryIMPL()
function to check the actual implementation type. The implementation typeMFX_IMPL_HARDWARE
,MFX_IMPL_HARDWARE2
,MFX_IMPL_HARDWARE3
, orMFX_IMPL_HARDWARE4
indicates the graphic adapter the Intel® Media Software Development Kit works on.The application creates the Direct3D device on the respective graphic adapter and passes it to Intel® Media Software Development Kit through the
MFXVideoCORE_SetHandle()
function.
Similar to the switchable graphics cases, interruption may result if the user
disconnects monitors from the graphic devices or remaps the primary adapter. If
the interruption occurs during the Intel® Media Software Development Kit library initialization, the
MFXInit()
function may return mfxStatus::MFX_ERR_UNSUPPORTED
.
This means hardware acceleration is currently not available. It is recommended
that the application initialize Intel® Media Software Development Kit right before the actual decoding,
video processing, and encoding operations to determine the hardware acceleration
capability.
If the interruption occurs during decoding, video processing, or encoding
operations, Intel® VPL functions will return mfxStatus::MFX_ERR_DEVICE_LOST
or mfxStatus::MFX_ERR_DEVICE_FAILED
. The application should handle these
errors and exit gracefully.