To create a video session object, call:
// Provided by VK_KHR_video_queue VkResult vkCreateVideoSessionKHR( VkDevice device, const VkVideoSessionCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkVideoSessionKHR* pVideoSession);
deviceis the logical device that creates the video session.
pCreateInfois a pointer to a VkVideoSessionCreateInfoKHR structure containing parameters to be used to create the video session.
pAllocatorcontrols host memory allocation as described in the Memory Allocation chapter.
pVideoSessionis a pointer to a VkVideoSessionKHR handle in which the resulting video session object is returned.
The resulting video session object is said to be created with the video
codec operation specified in
The name and version of the codec-specific Video Std header to be used with
the video session is specified by the VkExtensionProperties structure
pointed to by
If a non-existent or unsupported Video Std header version is specified in
pCreateInfo->pStdHeaderVersion->specVersion, then this command returns
Video session objects are created in uninitialized state.
In order to transition the video session into initial state, the
application must issue a vkCmdControlVideoCodingKHR command with
Video session objects also maintain the
state of the DPB.
The number of DPB slots usable with the created video session is specified
pCreateInfo->maxDpbSlots, and each slot is initially in the
In addition, if the
videoCodecOperation member of the
VkVideoProfileInfoKHR structure pointed to by
VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR and the
pictureLayout member of the VkVideoDecodeH264ProfileInfoKHR
structure provided in the VkVideoProfileInfoKHR::
pNext chain is
VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_PROGRESSIVE_KHR, then the
created video session supports interlaced frames and each DPB
slot maintained by the created video session can instead refer to
separate top field and bottom field reference pictures
that together can represent a full video frame.
In this case, it is up to the application, driven by the video content,
whether it associates any individual DPB slot with separate top and/or
bottom field pictures or a single picture representing a full frame.
The created video session can be used to perform video coding operations
using video frames up to the maximum size specified in
The minimum frame size allowed is implicitly derived from
minCodedExtent, as returned by
vkGetPhysicalDeviceVideoCapabilitiesKHR for the video profile
Accordingly, the created video session is said to be created with a
minCodedExtent equal to that.
In case of video session objects created with a video encode operation,
implementations may return the
VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR error if any of the
specified Video Std parameters do not adhere to the syntactic or semantic
requirements of the used video compression standard, or if values derived
from parameters according to the rules defined by the used video compression
standard do not adhere to the capabilities of the video compression standard
or the implementation.
Applications should not rely on the
For more information, see the Vulkan Specification
This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.