Memory Structures#
Structures used for memory.
API#
mfxBitstream#
-
struct mfxBitstream#
Defines the buffer that holds compressed video data.
Public Members
-
mfxEncryptedData *EncryptedData#
Reserved and must be zero.
-
mfxExtBuffer **ExtParam#
Array of extended buffers for additional bitstream configuration. See the ExtendedBufferID enumerator for a complete list of extended buffers.
-
mfxU32 CodecId#
Specifies the codec format identifier in the FourCC code. See the CodecFormatFourCC enumerator for details. This optional parameter is required for the simplified decode initialization.
-
mfxI64 DecodeTimeStamp#
Decode time stamp of the compressed bitstream in units of 90KHz. A value of MFX_TIMESTAMP_UNKNOWN indicates that there is no time stamp.
This value is calculated by the encoder from the presentation time stamp provided by the application in the mfxFrameSurface1 structure and from the frame rate provided by the application during the encoder initialization.
-
mfxU64 TimeStamp#
Time stamp of the compressed bitstream in units of 90KHz. A value of MFX_TIMESTAMP_UNKNOWN indicates that there is no time stamp.
-
mfxEncryptedData *EncryptedData#
mfxFrameAllocator#
-
struct mfxFrameAllocator#
Describes the API callback functions Alloc, Lock, Unlock, GetHDL, and Free that the implementation might use for allocating internal frames. Applications that operate on OS-specific video surfaces must implement these API callback functions.
Using the default allocator implies that frame data passes in or out of functions through pointers, as opposed to using memory IDs.
Behavior is undefined when using an incompletely defined external allocator.
See the Memory Allocation and External Allocators section for additional information.
Public Members
-
mfxStatus (*Alloc)(mfxHDL pthis, mfxFrameAllocRequest *request, mfxFrameAllocResponse *response)#
Allocates surface frames. For decoders, MFXVideoDECODE_Init calls Alloc only once. That call includes all frame allocation requests. For encoders, MFXVideoENCODE_Init calls Alloc twice: once for the input surfaces and again for the internal reconstructed surfaces.
If two library components must share DirectX* surfaces, this function should pass the pre-allocated surface chain to the library instead of allocating new DirectX surfaces.
See the Surface Pool Allocation section for additional information.
- Param pthis:
[in] Pointer to the allocator object.
- Param request:
[in] Pointer to the mfxFrameAllocRequest structure that specifies the type and number of required frames.
- Param response:
[out] Pointer to the mfxFrameAllocResponse structure that retrieves frames actually allocated.
- Return:
MFX_ERR_NONE The function successfully allocated the memory block.
MFX_ERR_MEMORY_ALLOC The function failed to allocate the video frames.
MFX_ERR_UNSUPPORTED The function does not support allocating the specified type of memory.
-
mfxStatus (*Lock)(mfxHDL pthis, mfxMemId mid, mfxFrameData *ptr)#
Locks a frame and returns its pointer.
- Param pthis:
[in] Pointer to the allocator object.
- Param mid:
[in] Memory block ID.
- Param ptr:
[out] Pointer to the returned frame structure.
- Return:
MFX_ERR_NONE The function successfully locked the memory block.
MFX_ERR_LOCK_MEMORY This function failed to lock the frame.
-
mfxStatus (*Unlock)(mfxHDL pthis, mfxMemId mid, mfxFrameData *ptr)#
Unlocks a frame and invalidates the specified frame structure.
- Param pthis:
[in] Pointer to the allocator object.
- Param mid:
[in] Memory block ID.
- Param ptr:
[out] Pointer to the frame structure. This pointer can be NULL.
- Return:
MFX_ERR_NONE The function successfully locked the memory block.
-
mfxStatus (*GetHDL)(mfxHDL pthis, mfxMemId mid, mfxHDL *handle)#
Returns the OS-specific handle associated with a video frame. If the handle is a COM interface, the reference counter must increase. The library will release the interface afterward.
- Param pthis:
[in] Pointer to the allocator object.
- Param mid:
[in] Memory block ID.
- Param handle:
[out] Pointer to the returned OS-specific handle.
- Return:
MFX_ERR_NONE The function successfully returned the OS-specific handle.
MFX_ERR_UNSUPPORTED The function does not support obtaining OS-specific handle..
-
mfxStatus (*Free)(mfxHDL pthis, mfxFrameAllocResponse *response)#
De-allocates all allocated frames.
- Param pthis:
[in] Pointer to the allocator object.
- Param response:
[in] Pointer to the mfxFrameAllocResponse structure returned by the Alloc function.
- Return:
MFX_ERR_NONE The function successfully de-allocated the memory block.
-
mfxStatus (*Alloc)(mfxHDL pthis, mfxFrameAllocRequest *request, mfxFrameAllocResponse *response)#
mfxFrameAllocRequest#
-
struct mfxFrameAllocRequest#
Describes multiple frame allocations when initializing encoders, decoders, and video preprocessors. A range specifies the number of video frames. Applications are free to allocate additional frames. In all cases, the minimum number of frames must be at least NumFrameMin or the called API function will return an error.
Public Members
-
mfxFrameInfo Info#
Describes the properties of allocated frames.
-
mfxFrameInfo Info#
mfxFrameAllocResponse#
-
struct mfxFrameAllocResponse#
Describes the response to multiple frame allocations. The calling API function returns the number of video frames actually allocated and pointers to their memory IDs.
mfxFrameData#
-
struct mfxY410#
Specifies “pixel” in Y410 color format.
-
struct mfxY416#
Specifies “pixel” in Y416 color format.
-
struct mfxA2RGB10#
Specifies “pixel” in A2RGB10 color format
-
struct mfxFrameData#
Describes frame buffer pointers.
Extension Buffers
General members
-
mfxU16 MemType#
Allocated memory type. See the ExtMemFrameType enumerator for details. Used for better integration of 3rd party plugins into the pipeline.
-
mfxU64 TimeStamp#
Time stamp of the video frame in units of 90KHz. Divide TimeStamp by 90,000 (90 KHz) to obtain the time in seconds. A value of MFX_TIMESTAMP_UNKNOWN indicates that there is no time stamp.
Color Planes
Data pointers to corresponding color channels (planes). The frame buffer pointers must be 16-byte aligned. The application has to specify pointers to all color channels even for packed formats. For example, for YUY2 format the application must specify Y, U, and V pointers. For RGB32 format, the application must specify R, G, B, and A pointers.
Additional Flags
Public Members
-
mfxExtBuffer **ExtParam#
Points to an array of pointers to the extra configuration structures. See the ExtendedBufferID enumerator for a list of extended configurations.
-
mfxA2RGB10 *A2RGB10#
A2RGB10 channel for A2RGB10 format (merged ARGB).
-
mfxABGR16FP *ABGRFP16#
ABGRFP16 channel for half float ARGB format (use this merged one due to no separate FP16 Alpha Channel).
-
mfxU16 MemType#
mfxFrameInfo#
-
struct mfxFrameInfo#
Specifies properties of video frames. See also “Configuration Parameter Constraints” chapter.
FrameRate
Specify the frame rate with the following formula: FrameRateExtN / FrameRateExtD.
For encoding, frame rate must be specified. For decoding, frame rate may be unspecified (FrameRateExtN and FrameRateExtD are all zeros.) In this case, the frame rate is defaulted to 30 frames per second.
AspectRatio
AspectRatioW and AspectRatioH are used to specify the sample aspect ratio. If sample aspect ratio is explicitly defined by the standards (see Table 6-3 in the MPEG-2 specification or Table E-1 in the H.264 specification), AspectRatioW and AspectRatioH should be the defined values. Otherwise, the sample aspect ratio can be derived as follows:
AspectRatioW=display_aspect_ratio_width*display_height
AspectRatioH=display_aspect_ratio_height*display_width
If both parameters are zero, the encoder uses the default value of sample aspect ratio.
ROI
The region of interest of the frame. Specify the display width and height in mfxVideoParam.
-
mfxU16 CropX#
X coordinate. In case of fused operation of decode plus VPP it can be set to zero to signalize that cropping operation is not requested.
-
mfxU16 CropY#
Y coordinate. In case of fused operation of decode plus VPP it can be set to zero to signalize that cropping operation is not requested.
Public Members
-
mfxU16 ChannelId#
The unique ID of each VPP channel set by application. It’s required that during Init/Reset application fills ChannelId for each mfxVideoChannelParam provided by the application and the SDK sets it back to the correspondent mfxSurfaceArray::mfxFrameSurface1 to distinguish different channels. It’s expected that surfaces for some channels might be returned with some delay so application has to use mfxFrameInfo::ChannelId to distinguish what returned surface belongs to what VPP channel. Decoder’s initialization parameters are always sent through channel with mfxFrameInfo::ChannelId equals to zero. It’s allowed to skip setting of decoder’s parameters for simplified decoding procedure
-
mfxU16 BitDepthLuma#
Number of bits used to represent luma samples.
Note
Not all codecs and implementations support this value. Use the Query API function to check if this feature is supported.
-
mfxU16 BitDepthChroma#
Number of bits used to represent chroma samples.
Note
Not all codecs and implementations support this value. Use the Query API function to check if this feature is supported.
-
mfxU16 Shift#
When the value is not zero, indicates that values of luma and chroma samples are shifted. Use BitDepthLuma and BitDepthChroma to calculate shift size. Use zero value to indicate absence of shift. See example data alignment below.
Note
Not all codecs and implementations support this value. Use the Query API function to check if this feature is supported.
-
mfxFrameId FrameId#
Describes the view and layer of a frame picture.
-
mfxU16 Width#
Width of the video frame in pixels. Must be a multiple of 16. In case of fused operation of decode plus VPP it can be set to zero to signalize that scaling operation is not requested.
-
mfxU16 Height#
Height of the video frame in pixels. Must be a multiple of 16 for progressive frame sequence and a multiple of 32 otherwise. In case of fused operation of decode plus VPP it can be set to zero to signalize that scaling operation is not requested.
Note
Example data alignment for Shift = 0:
Example data alignment for Shift != 0:
mfxFrameSurface1#
-
struct mfxFrameSurface1#
Defines the uncompressed frames surface information and data buffers. The frame surface is in the frame or complementary field pairs of pixels up to four color-channels, in two parts: mfxFrameInfo and mfxFrameData.
Public Members
-
struct mfxFrameSurfaceInterface *FrameInterface#
Specifies interface to work with surface.
-
mfxStructVersion Version#
Specifies version of mfxFrameSurface1 structure.
-
mfxFrameInfo Info#
Specifies surface properties.
-
mfxFrameData Data#
Describes the actual frame buffer.
-
struct mfxFrameSurfaceInterface *FrameInterface#
mfxFrameSurfaceInterface#
-
struct mfxFrameSurfaceInterface#
Specifies frame surface interface.
Public Members
-
mfxHDL Context#
The context of the memory interface. User should not touch (change, set, null) this pointer.
-
mfxStructVersion Version#
The version of the structure.
-
mfxStatus (*AddRef)(mfxFrameSurface1 *surface)#
Increments the internal reference counter of the surface. The surface is not destroyed until the surface is released using the mfxFrameSurfaceInterface::Release function. mfxFrameSurfaceInterface::AddRef should be used each time a new link to the surface is created (for example, copy structure) for proper surface management.
- Param surface:
[in] Valid surface.
- Return:
MFX_ERR_NONE If no error.
MFX_ERR_NULL_PTR If surface is NULL.
MFX_ERR_INVALID_HANDLE If mfxFrameSurfaceInterface->Context is invalid (for example NULL).
MFX_ERR_UNKNOWN Any internal error.
-
mfxStatus (*Release)(mfxFrameSurface1 *surface)#
Decrements the internal reference counter of the surface. mfxFrameSurfaceInterface::Release should be called after using the mfxFrameSurfaceInterface::AddRef function to add a surface or when allocation logic requires it. For example, call mfxFrameSurfaceInterface::Release to release a surface obtained with the GetSurfaceForXXX function.
- Param surface:
[in] Valid surface.
- Return:
MFX_ERR_NONE If no error.
MFX_ERR_NULL_PTR If surface is NULL.
MFX_ERR_INVALID_HANDLE If mfxFrameSurfaceInterface->Context is invalid (for example NULL).
MFX_ERR_UNDEFINED_BEHAVIOR If Reference Counter of surface is zero before call.
MFX_ERR_UNKNOWN Any internal error.
-
mfxStatus (*GetRefCounter)(mfxFrameSurface1 *surface, mfxU32 *counter)#
Returns current reference counter of mfxFrameSurface1 structure.
- Param surface:
[in] Valid surface.
- Param counter:
[out] Sets counter to the current reference counter value.
- Return:
MFX_ERR_NONE If no error.
MFX_ERR_NULL_PTR If surface or counter is NULL.
MFX_ERR_INVALID_HANDLE If mfxFrameSurfaceInterface->Context is invalid (for example NULL).
MFX_ERR_UNKNOWN Any internal error.
-
mfxStatus (*Map)(mfxFrameSurface1 *surface, mfxU32 flags)#
Sets pointers of surface->Info.Data to actual pixel data, providing read-write access.
In case of video memory, the surface with data in video memory becomes mapped to system memory. An application can map a surface for read access with any value of mfxFrameSurface1::Data::Locked, but can map a surface for write access only when mfxFrameSurface1::Data::Locked equals to 0.
Note: A surface allows shared read access, but exclusive write access. Consider the following cases:
Map with Write or Read|Write flags. A request during active another read or write access returns MFX_ERR_LOCK_MEMORY error immediately, without waiting. MFX_MAP_NOWAIT does not impact behavior. This type of request does not lead to any implicit synchronizations.
Map with Read flag. A request during active write access will wait for resource to become free, or exits immediately with error if MFX_MAP_NOWAIT flag was set. This request may lead to the implicit synchronization (with same logic as Synchronize call) waiting for surface to become ready to use (all dependencies should be resolved and upstream components finished writing to this surface).
If MFX_MAP_NOWAIT was set and the surface is not ready yet (for example the surface has unresolved data dependencies or active processing), the read access request exits immediately with error.
Read-write access with MFX_MAP_READ_WRITE provides exclusive simultaneous reading and writing access.
Note
Bitwise copying of mfxFrameSurface1 object between map / unmap calls may result in having dangling data pointers in copies.
- Param surface:
[in] Valid surface.
- Param flags:
[out] Specify mapping mode.
- Param surface->Info.Data:
[out] Pointers set to actual pixel data.
- Return:
MFX_ERR_NONE If no error.
MFX_ERR_NULL_PTR If surface is NULL.
MFX_ERR_INVALID_HANDLE If mfxFrameSurfaceInterface->Context is invalid (for example NULL).
MFX_ERR_UNSUPPORTED If flags are invalid.
MFX_ERR_LOCK_MEMORY If user wants to map the surface for write and surface->Data.Locked does not equal to 0.
MFX_ERR_UNKNOWN Any internal error.
-
mfxStatus (*Unmap)(mfxFrameSurface1 *surface)#
Invalidates pointers of surface->Info.Data and sets them to NULL. In case of video memory, the underlying texture becomes unmapped after last reader or writer unmap.
- Param surface:
[in] Valid surface.
- Param surface->Info.Data:
[out] Pointers set to NULL.
- Return:
MFX_ERR_NONE If no error.
MFX_ERR_NULL_PTR If surface is NULL.
MFX_ERR_INVALID_HANDLE If mfxFrameSurfaceInterface->Context is invalid (for example NULL).
MFX_ERR_UNSUPPORTED If surface is already unmapped.
MFX_ERR_UNKNOWN Any internal error.
-
mfxStatus (*GetNativeHandle)(mfxFrameSurface1 *surface, mfxHDL *resource, mfxResourceType *resource_type)#
Returns a native resource’s handle and type. The handle is returned as-is, meaning that the reference counter of base resources is not incremented. The native resource is not detached from surface and the library still owns the resource. User must not destroy the native resource or assume that the resource will be alive after mfxFrameSurfaceInterface::Release.
- Param surface:
[in] Valid surface.
- Param resource:
[out] Pointer is set to the native handle of the resource.
- Param resource_type:
[out] Type of native resource. See mfxResourceType enumeration).
- Return:
MFX_ERR_NONE If no error.
MFX_ERR_NULL_PTR If any of surface, resource or resource_type is NULL.
MFX_ERR_INVALID_HANDLE If any of surface, resource or resource_type is not valid object (no native resource was allocated).
MFX_ERR_UNSUPPORTED If surface is in system memory.
MFX_ERR_UNKNOWN Any internal error.
-
mfxStatus (*GetDeviceHandle)(mfxFrameSurface1 *surface, mfxHDL *device_handle, mfxHandleType *device_type)#
Returns a device abstraction that was used to create that resource. The handle is returned as-is, meaning that the reference counter for the device abstraction is not incremented. The native resource is not detached from the surface and the library still has a reference to the resource. User must not destroy the device or assume that the device will be alive after mfxFrameSurfaceInterface::Release.
- Param surface:
[in] Valid surface.
- Param device_handle:
[out] Pointer is set to the device which created the resource
- Param device_type:
[out] Type of device (see mfxHandleType enumeration).
- Return:
MFX_ERR_NONE If no error.
MFX_ERR_NULL_PTR If any of surface, device_handle or device_type is NULL.
MFX_ERR_INVALID_HANDLE If any of surface, resource or resource_type is not valid object (no native resource was allocated).
MFX_ERR_UNSUPPORTED If surface is in system memory.
MFX_ERR_UNKNOWN Any internal error.
-
mfxStatus (*Synchronize)(mfxFrameSurface1 *surface, mfxU32 wait)#
Guarantees readiness of both the data (pixels) and any frame’s meta information (for example corruption flags) after a function completes.
Instead of MFXVideoCORE_SyncOperation, users may directly call the mfxFrameSurfaceInterface::Synchronize function after the corresponding Decode or VPP function calls (MFXVideoDECODE_DecodeFrameAsync or MFXVideoVPP_RunFrameVPPAsync). The prerequisites to call the functions are:
The main processing functions return MFX_ERR_NONE.
A valid mfxFrameSurface1 object.
- Param surface:
[in] Valid surface.
- Param wait:
[out] Wait time in milliseconds.
- Return:
MFX_ERR_NONE If no error.
MFX_ERR_NULL_PTR If surface is NULL.
MFX_ERR_INVALID_HANDLE If any of surface is not valid object .
MFX_WRN_IN_EXECUTION If the given timeout is expired and the surface is not ready.
MFX_ERR_ABORTED If the specified asynchronous function aborted due to data dependency on a previous asynchronous function that did not complete.
MFX_ERR_UNKNOWN Any internal error.
-
void (*OnComplete)(mfxStatus sts)#
The library calls the function after complete of associated video operation notifying the application that frame surface is ready.
It is expected that the function is low-intrusive designed otherwise it may impact performance.
- Attention
This is callback function and intended to be called by the library only.
Note
The library calls this callback only when this surface is used as the output surface.
- Param sts:
[in] The status of completed operation.
-
mfxStatus (*QueryInterface)(mfxFrameSurface1 *surface, mfxGUID guid, mfxHDL *iface)#
Returns an interface defined by the GUID. If the returned interface is a reference counted object the caller should release the obtained interface to avoid memory leaks.
- Param surface:
[in] Valid surface.
- Param guid:
[in] GUID of the requested interface.
- Param iface:
[out] Interface.
- Return:
MFX_ERR_NONE If no error.
MFX_ERR_NULL_PTR If interface or surface is NULL.
MFX_ERR_UNSUPPORTED If requested interface is not supported.
MFX_ERR_NOT_IMPLEMENTED If requested interface is not implemented.
MFX_ERR_NOT_INITIALIZED If requested interface is not available (not created or already deleted).
MFX_ERR_UNKNOWN Any internal error.
-
mfxStatus (*Export)(mfxFrameSurface1 *surface, mfxSurfaceHeader export_header, mfxSurfaceHeader **exported_surface)#
If successful returns an exported surface, which is a refcounted object allocated by runtime. It could be exported with or without copy, depending on export flags and the possibility of such export. Exported surface is valid throughout the session, as long as the original mfxFrameSurface1 object is not closed and the refcount of exported surface is not zero.
- Param surface:
[in] Valid surface.
- Param export_header:
[in] Description of export: caller should fill in SurfaceType (type to export to) and SurfaceFlags (allowed export modes).
- Param exported_surface:
[out] Exported surface, allocated by runtime, user needs to decrement refcount after usage for object release. After successful export, the value of mfxSurfaceHeader::SurfaceFlags will contain the actual export mode.
- Return:
MFX_ERR_NONE If no error.
MFX_ERR_NULL_PTR If export surface or surface is NULL.
MFX_ERR_UNSUPPORTED If requested export is not supported.
MFX_ERR_NOT_IMPLEMENTED If requested export is not implemented.
MFX_ERR_UNKNOWN Any internal error.
-
mfxHDL Context#
mfxSurfacePoolInterface#
-
struct mfxSurfacePoolInterface#
Specifies the surface pool interface.
Public Members
-
mfxHDL Context#
The context of the surface pool interface. User should not touch (change, set, null) this pointer.
-
mfxStatus (*AddRef)(struct mfxSurfacePoolInterface *pool)#
Increments the internal reference counter of the mfxSurfacePoolInterface. The mfxSurfacePoolInterface is not destroyed until the mfxSurfacePoolInterface is destroyed with mfxSurfacePoolInterface::Release function. mfxSurfacePoolInterface::AddRef should be used each time a new link to the mfxSurfacePoolInterface is created for proper management.
- Param pool:
[in] Valid pool.
- Return:
MFX_ERR_NONE If no error.
MFX_ERR_NULL_PTR If pool is NULL.
MFX_ERR_INVALID_HANDLE If mfxSurfacePoolInterface->Context is invalid (for example NULL).
MFX_ERR_UNKNOWN Any internal error.
-
mfxStatus (*Release)(struct mfxSurfacePoolInterface *pool)#
Decrements the internal reference counter of the mfxSurfacePoolInterface. mfxSurfacePoolInterface::Release should be called after using the mfxSurfacePoolInterface::AddRef function to add a mfxSurfacePoolInterface or when allocation logic requires it. For example, call mfxSurfacePoolInterface::Release to release a mfxSurfacePoolInterface obtained with the mfxFrameSurfaceInterface::QueryInterface function.
- Param pool:
[in] Valid pool.
- Return:
MFX_ERR_NONE If no error.
MFX_ERR_NULL_PTR If pool is NULL.
MFX_ERR_INVALID_HANDLE If mfxSurfacePoolInterface->Context is invalid (for example NULL).
MFX_ERR_UNDEFINED_BEHAVIOR If Reference Counter of
mfxSurfacePoolInterfaceis zero before call.
MFX_ERR_UNKNOWN Any internal error.
-
mfxStatus (*GetRefCounter)(struct mfxSurfacePoolInterface *pool, mfxU32 *counter)#
Returns current reference counter of mfxSurfacePoolInterface structure.
- Param pool:
[in] Valid pool.
- Param counter:
[out] Sets counter to the current reference counter value.
- Return:
MFX_ERR_NONE If no error.
MFX_ERR_NULL_PTR If pool or counter is NULL.
MFX_ERR_INVALID_HANDLE If mfxSurfacePoolInterface->Context is invalid (for example NULL).
MFX_ERR_UNKNOWN Any internal error.
-
mfxStatus (*SetNumSurfaces)(struct mfxSurfacePoolInterface *pool, mfxU32 num_surfaces)#
The function should be called by oneAPI Video Processing Library (oneVPL) components or application to specify how many surfaces it will use concurrently. Internally, oneVPL allocates surfaces in the shared pool according to the component’s policy set by mfxPoolAllocationPolicy. The exact moment of surfaces allocation is defined by the component and generally independent from that call.
- Param pool:
[in] Valid pool.
- Param num_surfaces:
[in] The number of surfaces required by the component.
- Return:
MFX_ERR_NONE If no error.
MFX_ERR_NULL_PTR If pool is NULL.
MFX_ERR_INVALID_HANDLE If mfxSurfacePoolInterface->Context is invalid (for example NULL).
MFX_WRN_INCOMPATIBLE_VIDEO_PARAM If pool has MFX_ALLOCATION_UNLIMITED or MFX_ALLOCATION_LIMITED policy.
MFX_ERR_UNKNOWN Any internal error.
-
mfxStatus (*RevokeSurfaces)(struct mfxSurfacePoolInterface *pool, mfxU32 num_surfaces)#
The function should be called by oneVPL components when component is closed or reset and doesn’t need to use pool more. It helps to manage memory accordingly and release redundant memory. Important to specify the same number of surfaces which is requested during SetNumSurfaces call, otherwise it may lead to the pipeline stalls.
- Param pool:
[in] Valid pool.
- Param num_surfaces:
[in] The number of surfaces used by the component.
- Return:
MFX_ERR_NONE If no error.
MFX_WRN_OUT_OF_RANGE If num_surfaces doesn’t equal to num_surfaces requested during SetNumSurfaces call.
MFX_ERR_NULL_PTR If pool is NULL.
MFX_ERR_INVALID_HANDLE If mfxSurfacePoolInterface->Context is invalid (for example NULL).
MFX_WRN_INCOMPATIBLE_VIDEO_PARAM If pool has MFX_ALLOCATION_UNLIMITED or MFX_ALLOCATION_LIMITED policy.
MFX_ERR_UNKNOWN Any internal error.
-
mfxStatus (*GetAllocationPolicy)(struct mfxSurfacePoolInterface *pool, mfxPoolAllocationPolicy *policy)#
Returns current allocation policy.
- Param pool:
[in] Valid pool.
- Param policy:
[out] Sets policy to the current allocation policy value.
- Return:
MFX_ERR_NONE If no error.
MFX_ERR_NULL_PTR If pool or policy is NULL.
MFX_ERR_INVALID_HANDLE If mfxSurfacePoolInterface->Context is invalid (for example NULL).
MFX_ERR_UNKNOWN Any internal error.
-
mfxStatus (*GetMaximumPoolSize)(struct mfxSurfacePoolInterface *pool, mfxU32 *size)#
Returns maximum pool size. In case of mfxPoolAllocationPolicy::MFX_ALLOCATION_UNLIMITED policy 0xFFFFFFFF will be returned.
- Param pool:
[in] Valid pool.
- Param size:
[out] Sets size to the maximum pool size value.
- Return:
MFX_ERR_NONE If no error.
MFX_ERR_NULL_PTR If pool or size is NULL.
MFX_ERR_INVALID_HANDLE If mfxSurfacePoolInterface->Context is invalid (for example NULL).
MFX_ERR_UNKNOWN Any internal error.
-
mfxStatus (*GetCurrentPoolSize)(struct mfxSurfacePoolInterface *pool, mfxU32 *size)#
Returns current pool size.
- Param pool:
[in] Valid pool.
- Param size:
[out] Sets size to the current pool size value.
- Return:
MFX_ERR_NONE If no error.
MFX_ERR_NULL_PTR If pool or size is NULL.
MFX_ERR_INVALID_HANDLE If mfxSurfacePoolInterface->Context is invalid (for example NULL).
MFX_ERR_UNKNOWN Any internal error.
-
mfxHDL Context#
mfxMemoryInterface#
-
struct mfxMemoryInterface#
Public Members
-
mfxHDL Context#
The context of the memory interface. User should not touch (change, set, null) this pointer.
-
mfxStructVersion Version#
The version of the structure.
-
mfxStatus (*ImportFrameSurface)(struct mfxMemoryInterface *memory_interface, mfxSurfaceComponent surf_component, mfxSurfaceHeader *external_surface, mfxFrameSurface1 **imported_surface)#
Imports an application-provided surface into mfxFrameSurface1 which may be used as input for encoding or video processing.
- Since
This function is available since API version 2.10.
- Param memory_interface:
[in] Valid memory interface.
- Param surf_component:
[in] Surface component type. Required for allocating new surfaces from the appropriate pool.
- Param external_surface:
[inout] Pointer to the mfxSurfaceXXX object describing the surface to be imported. All fields in mfxSurfaceHeader must be set by the application. mfxSurfaceHeader::SurfaceType is read by oneVPL runtime to determine which particular mfxSurfaceXXX structure is supplied. For example, if mfxSurfaceXXX::SurfaceType == MFX_SURFACE_TYPE_D3D11_TEX2D, then the handle will be interpreted as an object of type mfxSurfaceD3D11Tex2D. The application should set or clear other fields as specified in the corresponding structure description. After successful import, the value of mfxSurfaceHeader::SurfaceFlags will be replaced with the actual import type. It can be used to determine which import type (with or without copy) took place in the case of initial default setting, or if multiple import flags were OR’ed. All external sync operations on the ext_surface must be completed before calling this function.
- Param imported_surface:
[out] Pointer to a valid mfxFrameSurface1 object containing the imported frame. imported_surface may be passed as an input to Encode or VPP processing operations.
- Return:
MFX_ERR_NONE The function completed successfully.
MFX_ERR_NULL_PTR If ext_surface or imported_surface are NULL.
MFX_ERR_INVALID_HANDLE If the corresponding session was not initialized.
MFX_ERR_UNSUPPORTED If surf_component is not one of [MFX_SURFACE_COMPONENT_ENCODE, MFX_SURFACE_COMPONENT_VPP_INPUT], or if
mfxSurfaceHeader::SurfaceType is not supported by oneVPL runtime for this operation.
-
mfxHDL Context#
mfxSurfaceTypesSupported#
-
struct mfxSurfaceTypesSupported#
This structure describes the supported surface types and modes.
Public Members
-
mfxStructVersion Version#
Version of the structure.
-
mfxStructVersion Version#
mfxSurfaceHeader#
-
struct mfxSurfaceHeader#
Public Members
-
mfxSurfaceType SurfaceType#
Set to the MFX_SURFACE_TYPE enum corresponding to the specific structure.
-
mfxU32 SurfaceFlags#
Set to the MFX_SURFACE_FLAG enum (or combination) corresponding to the allowed import / export mode(s). Multiple flags may be combined with OR. Upon a successful Import or Export operation, this field will indicate the actual mode used.
-
mfxExtBuffer **ExtParam#
Points to an array of pointers to the extra configuration structures; see the ExtendedBufferID enumerator for a list of extended configurations.
-
mfxSurfaceType SurfaceType#
mfxSurfaceInterface#
-
struct mfxSurfaceInterface#
Contains mfxSurfaceHeader and the callback functions AddRef, Release and GetRefCounter that the application may use to manage access to exported surfaces. These interfaces are only valid for surfaces obtained by mfxFrameSurfaceInterface::Export. They are not used for surface descriptions passed to function mfxMemoryInterface::ImportFrameSurface.
Public Members
-
mfxSurfaceHeader Header#
Exported surface header. Contains description of current surface.
-
mfxStructVersion Version#
The version of the structure.
-
mfxHDL Context#
The context of the exported surface interface. User should not touch (change, set, null) this pointer.
-
mfxStatus (*AddRef)(struct mfxSurfaceInterface *surface)#
Increments the internal reference counter of the surface. The surface is not destroyed until the surface is released using the mfxSurfaceInterface::Release function. mfxSurfaceInterface::AddRef should be used each time a new link to the surface is created (for example, copy structure) for proper surface management.
- Param surface:
[in] Valid surface.
- Return:
MFX_ERR_NONE If no error.
MFX_ERR_NULL_PTR If surface is NULL.
MFX_ERR_INVALID_HANDLE If mfxSurfaceInterface->Context is invalid (for example NULL).
MFX_ERR_UNKNOWN Any internal error.
-
mfxStatus (*Release)(struct mfxSurfaceInterface *surface)#
Decrements the internal reference counter of the surface. mfxSurfaceInterface::Release should be called after using the mfxSurfaceInterface::AddRef function to add a surface or when allocation logic requires it. For example, call mfxSurfaceInterface::Release to release a surface obtained with the mfxFrameSurfaceInterface::Export function.
- Param surface:
[in] Valid surface.
- Return:
MFX_ERR_NONE If no error.
MFX_ERR_NULL_PTR If surface is NULL.
MFX_ERR_INVALID_HANDLE If mfxSurfaceInterface->Context is invalid (for example NULL).
MFX_ERR_UNDEFINED_BEHAVIOR If Reference Counter of surface is zero before call.
MFX_ERR_UNKNOWN Any internal error.
-
mfxStatus (*GetRefCounter)(struct mfxSurfaceInterface *surface, mfxU32 *counter)#
Returns current reference counter of exported surface.
- Param surface:
[in] Valid surface.
- Param counter:
[out] Sets counter to the current reference counter value.
- Return:
MFX_ERR_NONE If no error.
MFX_ERR_NULL_PTR If surface or counter is NULL.
MFX_ERR_INVALID_HANDLE If mfxSurfaceInterface->Context is invalid (for example NULL).
MFX_ERR_UNKNOWN Any internal error.
-
mfxStatus (*Synchronize)(struct mfxSurfaceInterface *surface, mfxU32 wait)#
This function is only valuable for surfaces which were exported in sharing mode (without a copy). Guarantees readiness of both the data (pixels) and any original mfxFrameSurface1 frame’s meta information (for example corruption flags) after a function completes.
Instead of MFXVideoCORE_SyncOperation, users may directly call the mfxSurfaceInterface::Synchronize function after the corresponding Decode or VPP function calls (MFXVideoDECODE_DecodeFrameAsync or MFXVideoVPP_RunFrameVPPAsync). The prerequisites to call the functions are:
The main processing functions return MFX_ERR_NONE.
A valid surface object.
- Param surface:
[in] Valid surface.
- Param wait:
[out] Wait time in milliseconds.
- Return:
MFX_ERR_NONE If no error.
MFX_ERR_NULL_PTR If surface is NULL.
MFX_ERR_INVALID_HANDLE If any of surface is not valid object .
MFX_WRN_IN_EXECUTION If the given timeout is expired and the surface is not ready.
MFX_ERR_ABORTED If the specified asynchronous function aborted due to data dependency on a previous asynchronous function that did not complete.
MFX_ERR_UNKNOWN Any internal error.
-
mfxSurfaceHeader Header#
mfxSurfaceD3D11Tex2D#
-
struct mfxSurfaceD3D11Tex2D#
mfxSurfaceVAAPI#
-
struct mfxSurfaceVAAPI#
mfxSurfaceOpenCLImg2D#
-
struct mfxSurfaceOpenCLImg2D#
mfxExtSurfaceOpenCLImg2DExportDescription#
-
struct mfxExtSurfaceOpenCLImg2DExportDescription#
Optional extension buffer, which can be attached to mfxSurfaceHeader::ExtParam (second parameter of mfxFrameSurfaceInterface::Export) in order to pass OCL parameters during mfxFrameSurface1 exporting to OCL surface. If buffer is not provided all resources will be created by oneAPI Video Processing Library (oneVPL) RT internally.
mfxSurfaceD3D12Tex2D#
-
struct mfxSurfaceD3D12Tex2D#
mfxExtSurfaceD3D12Tex2DExportDescription#
-
struct mfxExtSurfaceD3D12Tex2DExportDescription#
Optional extension buffer, which can be attached to mfxSurfaceHeader::ExtParam (second parameter of mfxFrameSurfaceInterface::Export) in order to pass D3D12 parameters during mfxFrameSurface1 exporting to D3D12 resource. If buffer is not provided all resources will be created by oneAPI Video Processing Library (oneVPL) RT internally.
Public Members
-
mfxExtBuffer Header#
Extension buffer header. Header.BufferId must be equal to MFX_EXTBUFF_EXPORT_SHARING_DESC_D3D12.
-
mfxExtBuffer Header#
mfxSurfaceVulkanImg2D#
-
struct mfxSurfaceVulkanImg2D#
Public Members
mfxExtSurfaceVulkanImg2DExportDescription#
-
struct mfxExtSurfaceVulkanImg2DExportDescription#
Optional extension buffer, which can be attached to mfxSurfaceHeader::ExtParam (second parameter of mfxFrameSurfaceInterface::Export) in order to pass Vulkan parameters during mfxFrameSurface1 exporting to Vulkan surface. If buffer is not provided all resources will be created by oneAPI Video Processing Library (oneVPL) RT internally.
Public Members
-
mfxExtBuffer Header#
Extension buffer header. Header.BufferId must be equal to MFX_EXTBUFF_EXPORT_SHARING_DESC_VULKAN.
-
mfxExtBuffer Header#