Required for ffmpeg d3d12va decoder.
From: Biswapriyo Nath nathbappai@gmail.com
--- include/d3d12video.idl | 197 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 197 insertions(+)
diff --git a/include/d3d12video.idl b/include/d3d12video.idl index 1c75b4b3f06..8b4010afb27 100644 --- a/include/d3d12video.idl +++ b/include/d3d12video.idl @@ -21,12 +21,72 @@ import "ocidl.idl"; import "dxgicommon.idl"; import "d3d12.idl";
+typedef enum D3D12_VIDEO_FIELD_TYPE +{ + D3D12_VIDEO_FIELD_TYPE_NONE = 0, + D3D12_VIDEO_FIELD_TYPE_INTERLACED_TOP_FIELD_FIRST = 1, + D3D12_VIDEO_FIELD_TYPE_INTERLACED_BOTTOM_FIELD_FIRST = 2, +} D3D12_VIDEO_FIELD_TYPE; + +typedef enum D3D12_VIDEO_FRAME_STEREO_FORMAT +{ + D3D12_VIDEO_FRAME_STEREO_FORMAT_NONE = 0, + D3D12_VIDEO_FRAME_STEREO_FORMAT_MONO = 1, + D3D12_VIDEO_FRAME_STEREO_FORMAT_HORIZONTAL = 2, + D3D12_VIDEO_FRAME_STEREO_FORMAT_VERTICAL = 3, + D3D12_VIDEO_FRAME_STEREO_FORMAT_SEPARATE = 4, +} D3D12_VIDEO_FRAME_STEREO_FORMAT; + typedef enum D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE { D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE_NONE = 0, D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE_FIELD_BASED = 1, } D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE;
+typedef enum D3D12_FEATURE_VIDEO +{ + D3D12_FEATURE_VIDEO_DECODE_SUPPORT = 0, + D3D12_FEATURE_VIDEO_DECODE_PROFILES = 1, + D3D12_FEATURE_VIDEO_DECODE_FORMATS = 2, + D3D12_FEATURE_VIDEO_DECODE_CONVERSION_SUPPORT = 3, + D3D12_FEATURE_VIDEO_PROCESS_SUPPORT = 5, + D3D12_FEATURE_VIDEO_PROCESS_MAX_INPUT_STREAMS = 6, + D3D12_FEATURE_VIDEO_PROCESS_REFERENCE_INFO = 7, + D3D12_FEATURE_VIDEO_DECODER_HEAP_SIZE = 8, + D3D12_FEATURE_VIDEO_PROCESSOR_SIZE = 9, + D3D12_FEATURE_VIDEO_DECODE_PROFILE_COUNT = 10, + D3D12_FEATURE_VIDEO_DECODE_FORMAT_COUNT = 11, + D3D12_FEATURE_VIDEO_ARCHITECTURE = 17, + D3D12_FEATURE_VIDEO_DECODE_HISTOGRAM = 18, + D3D12_FEATURE_VIDEO_FEATURE_AREA_SUPPORT = 19, + D3D12_FEATURE_VIDEO_MOTION_ESTIMATOR = 20, + D3D12_FEATURE_VIDEO_MOTION_ESTIMATOR_SIZE = 21, + D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_COUNT = 22, + D3D12_FEATURE_VIDEO_EXTENSION_COMMANDS = 23, + D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_PARAMETER_COUNT = 24, + D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_PARAMETERS = 25, + D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_SUPPORT = 26, + D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_SIZE = 27, + D3D12_FEATURE_VIDEO_DECODE_PROTECTED_RESOURCES = 28, + D3D12_FEATURE_VIDEO_PROCESS_PROTECTED_RESOURCES = 29, + D3D12_FEATURE_VIDEO_MOTION_ESTIMATOR_PROTECTED_RESOURCES = 30, + D3D12_FEATURE_VIDEO_DECODER_HEAP_SIZE1 = 31, + D3D12_FEATURE_VIDEO_PROCESSOR_SIZE1 = 32, + D3D12_FEATURE_VIDEO_ENCODER_CODEC = 33, + D3D12_FEATURE_VIDEO_ENCODER_PROFILE_LEVEL = 34, + D3D12_FEATURE_VIDEO_ENCODER_OUTPUT_RESOLUTION_RATIOS_COUNT = 35, + D3D12_FEATURE_VIDEO_ENCODER_OUTPUT_RESOLUTION = 36, + D3D12_FEATURE_VIDEO_ENCODER_INPUT_FORMAT = 37, + D3D12_FEATURE_VIDEO_ENCODER_RATE_CONTROL_MODE = 38, + D3D12_FEATURE_VIDEO_ENCODER_INTRA_REFRESH_MODE = 39, + D3D12_FEATURE_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE = 40, + D3D12_FEATURE_VIDEO_ENCODER_HEAP_SIZE = 41, + D3D12_FEATURE_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT = 42, + D3D12_FEATURE_VIDEO_ENCODER_SUPPORT = 43, + D3D12_FEATURE_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT = 44, + D3D12_FEATURE_VIDEO_ENCODER_RESOURCE_REQUIREMENTS = 45, +} D3D12_FEATURE_VIDEO; + typedef enum D3D12_BITSTREAM_ENCRYPTION_TYPE { D3D12_BITSTREAM_ENCRYPTION_TYPE_NONE = 0, @@ -45,6 +105,143 @@ typedef struct D3D12_VIDEO_DECODER_DESC D3D12_VIDEO_DECODE_CONFIGURATION Configuration; } D3D12_VIDEO_DECODER_DESC;
+typedef struct D3D12_VIDEO_DECODER_HEAP_DESC +{ + UINT NodeMask; + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; + UINT DecodeWidth; + UINT DecodeHeight; + DXGI_FORMAT Format; + DXGI_RATIONAL FrameRate; + UINT BitRate; + UINT MaxDecodePictureBufferCount; +} D3D12_VIDEO_DECODER_HEAP_DESC; + +typedef struct D3D12_VIDEO_SIZE_RANGE +{ + UINT MaxWidth; + UINT MaxHeight; + UINT MinWidth; + UINT MinHeight; +} D3D12_VIDEO_SIZE_RANGE; + +typedef enum D3D12_VIDEO_PROCESS_FILTER +{ + D3D12_VIDEO_PROCESS_FILTER_BRIGHTNESS = 0, + D3D12_VIDEO_PROCESS_FILTER_CONTRAST = 1, + D3D12_VIDEO_PROCESS_FILTER_HUE = 2, + D3D12_VIDEO_PROCESS_FILTER_SATURATION = 3, + D3D12_VIDEO_PROCESS_FILTER_NOISE_REDUCTION = 4, + D3D12_VIDEO_PROCESS_FILTER_EDGE_ENHANCEMENT = 5, + D3D12_VIDEO_PROCESS_FILTER_ANAMORPHIC_SCALING = 6, + D3D12_VIDEO_PROCESS_FILTER_STEREO_ADJUSTMENT = 7, +} D3D12_VIDEO_PROCESS_FILTER; + +typedef enum D3D12_VIDEO_PROCESS_FILTER_FLAGS +{ + D3D12_VIDEO_PROCESS_FILTER_FLAG_NONE = 0x0, + D3D12_VIDEO_PROCESS_FILTER_FLAG_BRIGHTNESS = (1 << D3D12_VIDEO_PROCESS_FILTER_BRIGHTNESS), + D3D12_VIDEO_PROCESS_FILTER_FLAG_CONTRAST = (1 << D3D12_VIDEO_PROCESS_FILTER_CONTRAST), + D3D12_VIDEO_PROCESS_FILTER_FLAG_HUE = (1 << D3D12_VIDEO_PROCESS_FILTER_HUE), + D3D12_VIDEO_PROCESS_FILTER_FLAG_SATURATION = (1 << D3D12_VIDEO_PROCESS_FILTER_SATURATION), + D3D12_VIDEO_PROCESS_FILTER_FLAG_NOISE_REDUCTION = (1 << D3D12_VIDEO_PROCESS_FILTER_NOISE_REDUCTION), + D3D12_VIDEO_PROCESS_FILTER_FLAG_EDGE_ENHANCEMENT = (1 << D3D12_VIDEO_PROCESS_FILTER_EDGE_ENHANCEMENT), + D3D12_VIDEO_PROCESS_FILTER_FLAG_ANAMORPHIC_SCALING = (1 << D3D12_VIDEO_PROCESS_FILTER_ANAMORPHIC_SCALING), + D3D12_VIDEO_PROCESS_FILTER_FLAG_STEREO_ADJUSTMENT = (1 << D3D12_VIDEO_PROCESS_FILTER_STEREO_ADJUSTMENT), +} D3D12_VIDEO_PROCESS_FILTER_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_FILTER_FLAGS);") + +typedef enum D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS +{ + D3D12_VIDEO_PROCESS_DEINTERLACE_FLAG_NONE = 0x0, + D3D12_VIDEO_PROCESS_DEINTERLACE_FLAG_BOB = 0x1, + D3D12_VIDEO_PROCESS_DEINTERLACE_FLAG_CUSTOM = 0x80000000, +} D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS );") + +typedef struct D3D12_VIDEO_PROCESS_LUMA_KEY +{ + BOOL Enable; + FLOAT Lower; + FLOAT Upper; +} D3D12_VIDEO_PROCESS_LUMA_KEY; + +typedef struct D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC +{ + DXGI_FORMAT Format; + DXGI_COLOR_SPACE_TYPE ColorSpace; + DXGI_RATIONAL SourceAspectRatio; + DXGI_RATIONAL DestinationAspectRatio; + DXGI_RATIONAL FrameRate; + D3D12_VIDEO_SIZE_RANGE SourceSizeRange; + D3D12_VIDEO_SIZE_RANGE DestinationSizeRange; + BOOL EnableOrientation; + D3D12_VIDEO_PROCESS_FILTER_FLAGS FilterFlags; + D3D12_VIDEO_FRAME_STEREO_FORMAT StereoFormat; + D3D12_VIDEO_FIELD_TYPE FieldType; + D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS DeinterlaceMode; + BOOL EnableAlphaBlending; + D3D12_VIDEO_PROCESS_LUMA_KEY LumaKey; + UINT NumPastFrames; + UINT NumFutureFrames; + BOOL EnableAutoProcessing; +} D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC; + +typedef enum D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE +{ + D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_OPAQUE = 0, + D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_BACKGROUND = 1, + D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_DESTINATION = 2, + D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_SOURCE_STREAM = 3, +} D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE; + +typedef struct D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC +{ + DXGI_FORMAT Format; + DXGI_COLOR_SPACE_TYPE ColorSpace; + D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE AlphaFillMode; + UINT AlphaFillModeSourceStreamIndex; + FLOAT BackgroundColor[4]; + DXGI_RATIONAL FrameRate; + BOOL EnableStereo; +} D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC; + +[ + uuid(1f052807-0b46-4acc-8a89-364f793718a4), + object, + local, + pointer_default(unique) +] +interface ID3D12VideoDevice : IUnknown +{ + HRESULT CheckFeatureSupport( + D3D12_FEATURE_VIDEO feature_video, + [in, out] void *feature_support_data, + UINT feature_support_data_size + ); + + HRESULT CreateVideoDecoder( + [in] const D3D12_VIDEO_DECODER_DESC *desc, + [in] REFIID riid, + [out, iid_is(riid)] void **video_decoder + ); + + HRESULT CreateVideoDecoderHeap( + [in] const D3D12_VIDEO_DECODER_HEAP_DESC *video_decoder_heap_desc, + [in] REFIID riid, + [out, iid_is(riid)] void **video_decoder_heap + ); + + HRESULT CreateVideoProcessor( + UINT node_mask, + [in] const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *output_stream_desc, + [in] UINT input_stream_descs_count, + [in] const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *input_stream_descs, + [in] REFIID riid, + [out, iid_is(riid)] void **video_processor + ); +} + [ uuid(c59b6bdc-7720-4074-a136-17a156037470), object,
From: Biswapriyo Nath nathbappai@gmail.com
--- include/d3d12video.idl | 11 +++++++++++ 1 file changed, 11 insertions(+)
diff --git a/include/d3d12video.idl b/include/d3d12video.idl index 8b4010afb27..3f1b962f45f 100644 --- a/include/d3d12video.idl +++ b/include/d3d12video.idl @@ -206,6 +206,17 @@ typedef struct D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC BOOL EnableStereo; } D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC;
+[ + uuid(0946b7c9-ebf6-4047-bb73-8683e27dbb1f), + object, + local, + pointer_default(unique) +] +interface ID3D12VideoDecoderHeap : ID3D12Pageable +{ + D3D12_VIDEO_DECODER_HEAP_DESC GetDesc(); +} + [ uuid(1f052807-0b46-4acc-8a89-364f793718a4), object,
From: Biswapriyo Nath nathbappai@gmail.com
--- include/d3d12video.idl | 135 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+)
diff --git a/include/d3d12video.idl b/include/d3d12video.idl index 3f1b962f45f..394f974a7a1 100644 --- a/include/d3d12video.idl +++ b/include/d3d12video.idl @@ -263,3 +263,138 @@ interface ID3D12VideoDecoder : ID3D12Pageable { D3D12_VIDEO_DECODER_DESC GetDesc(); } + +typedef enum D3D12_VIDEO_DECODE_ARGUMENT_TYPE +{ + D3D12_VIDEO_DECODE_ARGUMENT_TYPE_PICTURE_PARAMETERS = 0, + D3D12_VIDEO_DECODE_ARGUMENT_TYPE_INVERSE_QUANTIZATION_MATRIX = 1, + D3D12_VIDEO_DECODE_ARGUMENT_TYPE_SLICE_CONTROL = 2, + D3D12_VIDEO_DECODE_ARGUMENT_TYPE_MAX_VALID = 3, +} D3D12_VIDEO_DECODE_ARGUMENT_TYPE; + +typedef struct D3D12_VIDEO_DECODE_FRAME_ARGUMENT +{ + D3D12_VIDEO_DECODE_ARGUMENT_TYPE Type; + UINT Size; + void *pData; +} D3D12_VIDEO_DECODE_FRAME_ARGUMENT; + +typedef struct D3D12_VIDEO_DECODE_REFERENCE_FRAMES +{ + UINT NumTexture2Ds; + ID3D12Resource **ppTexture2Ds; + UINT *pSubresources; + ID3D12VideoDecoderHeap **ppHeaps; +} D3D12_VIDEO_DECODE_REFERENCE_FRAMES; + +typedef struct D3D12_VIDEO_DECODE_COMPRESSED_BITSTREAM +{ + ID3D12Resource *pBuffer; + UINT64 Offset; + UINT64 Size; +} D3D12_VIDEO_DECODE_COMPRESSED_BITSTREAM; + +typedef struct D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS +{ + BOOL Enable; + ID3D12Resource *pReferenceTexture2D; + UINT ReferenceSubresource; + DXGI_COLOR_SPACE_TYPE OutputColorSpace; + DXGI_COLOR_SPACE_TYPE DecodeColorSpace; +} D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS; + +typedef struct D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS +{ + UINT NumFrameArguments; + D3D12_VIDEO_DECODE_FRAME_ARGUMENT FrameArguments[D3D12_VIDEO_DECODE_MAX_ARGUMENTS]; + D3D12_VIDEO_DECODE_REFERENCE_FRAMES ReferenceFrames; + D3D12_VIDEO_DECODE_COMPRESSED_BITSTREAM CompressedBitstream; + ID3D12VideoDecoderHeap *pHeap; +} D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS; + +typedef struct D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS +{ + ID3D12Resource *pOutputTexture2D; + UINT OutputSubresource; + D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS ConversionArguments; +} D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS; + +[ + uuid(3b60536e-ad29-4e64-a269-f853837e5e53), + object, + local, + pointer_default(unique) +] +interface ID3D12VideoDecodeCommandList : ID3D12CommandList +{ + HRESULT Close(); + + HRESULT Reset( + [in] ID3D12CommandAllocator *allocator + ); + + void ClearState(); + + void ResourceBarrier( + [in] UINT barriers_count, + [in] const D3D12_RESOURCE_BARRIER *barriers + ); + + void DiscardResource( + [in] ID3D12Resource *resource, + [in, optional] const D3D12_DISCARD_REGION *region + ); + + void BeginQuery( + [in] ID3D12QueryHeap *query_heap, + [in] D3D12_QUERY_TYPE type, + [in] UINT index + ); + + void EndQuery( + [in] ID3D12QueryHeap *query_heap, + [in] D3D12_QUERY_TYPE type, + [in] UINT index + ); + + void ResolveQueryData( + [in] ID3D12QueryHeap *query_heap, + [in] D3D12_QUERY_TYPE type, + [in] UINT start_index, + [in] UINT queries_count, + [in] ID3D12Resource *destination_buffer, + [in] UINT64 aligned_destination_buffer_offset + ); + + void SetPredication( + [in, optional] ID3D12Resource *buffer, + [in] UINT64 aligned_buffer_offset, + [in] D3D12_PREDICATION_OP operation + ); + + void SetMarker( + [in] UINT metadata, + [in] const void *data, + [in] UINT size + ); + + void BeginEvent( + [in] UINT metadata, + [in] const void *data, + [in] UINT size + ); + + void EndEvent(); + + void DecodeFrame( + [in] ID3D12VideoDecoder *decoder, + [in] const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS *output_arguments, + [in] const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *input_arguments + ); + + void WriteBufferImmediate( + [in] UINT count, + [in] const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *params, + [in, optional] const D3D12_WRITEBUFFERIMMEDIATE_MODE *modes + ); +}
From: Biswapriyo Nath nathbappai@gmail.com
--- include/d3d12video.idl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
diff --git a/include/d3d12video.idl b/include/d3d12video.idl index 394f974a7a1..2cf836f908a 100644 --- a/include/d3d12video.idl +++ b/include/d3d12video.idl @@ -398,3 +398,24 @@ interface ID3D12VideoDecodeCommandList : ID3D12CommandList [in, optional] const D3D12_WRITEBUFFERIMMEDIATE_MODE *modes ); } + +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG2, 0xee27417f, 0x5e28, 0x4e65, 0xbe, 0xea, 0x1d, 0x26, 0xb5, 0x08, 0xad, 0xc9);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG1_AND_MPEG2, 0x86695f12, 0x340e, 0x4f04, 0x9f, 0xd3, 0x92, 0x53, 0xdd, 0x32, 0x74, 0x60);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_H264, 0x1b81be68, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_H264_STEREO_PROGRESSIVE, 0xd79be8da, 0x0cf1, 0x4c81, 0xb8, 0x2a, 0x69, 0xa4, 0xe2, 0x36, 0xf4, 0x3d);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_H264_STEREO, 0xf9aaccbb, 0xc2b6, 0x4cfc, 0x87, 0x79, 0x57, 0x07, 0xb1, 0x76, 0x05, 0x52);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_H264_MULTIVIEW, 0x705b9d82, 0x76cf, 0x49d6, 0xb7, 0xe6, 0xac, 0x88, 0x72, 0xdb, 0x01, 0x3c);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VC1, 0x1b81beA3, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VC1_D2010, 0x1b81beA4, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG4PT2_SIMPLE, 0xefd64d74, 0xc9e8,0x41d7,0xa5,0xe9,0xe9,0xb0,0xe3,0x9f,0xa3,0x19);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG4PT2_ADVSIMPLE_NOGMC, 0xed418a9f, 0x010d, 0x4eda, 0x9a, 0xe3, 0x9a, 0x65, 0x35, 0x8d, 0x8d, 0x2e);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN, 0x5b11d51b, 0x2f4c, 0x4452, 0xbc, 0xc3, 0x09, 0xf2, 0xa1, 0x16, 0x0c, 0xc0);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN10, 0x107af0e0, 0xef1a, 0x4d19, 0xab, 0xa8, 0x67, 0xa1, 0x63, 0x07, 0x3d, 0x13);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VP9, 0x463707f8, 0xa1d0, 0x4585, 0x87, 0x6d, 0x83, 0xaa, 0x6d, 0x60, 0xb8, 0x9e);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VP9_10BIT_PROFILE2, 0xa4c749ef, 0x6ecf, 0x48aa, 0x84, 0x48, 0x50, 0xa7, 0xa1, 0x16, 0x5f, 0xf7);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VP8, 0x90b899ea, 0x3a62, 0x4705, 0x88, 0xb3, 0x8d, 0xf0, 0x4b, 0x27, 0x44, 0xe7);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_PROFILE0, 0xb8be4ccb, 0xcf53, 0x46ba, 0x8d, 0x59, 0xd6, 0xb8, 0xa6, 0xda, 0x5d, 0x2a);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_PROFILE1, 0x6936ff0f, 0x45b1, 0x4163, 0x9c, 0xc1, 0x64, 0x6e, 0xf6, 0x94, 0x61, 0x08);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_PROFILE2, 0x0c5f2aa1, 0xe541, 0x4089, 0xbb, 0x7b, 0x98, 0x11, 0x0a, 0x19, 0xd7, 0xc8);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_12BIT_PROFILE2, 0x17127009, 0xa00f, 0x4ce1, 0x99, 0x4e, 0xbf, 0x40, 0x81, 0xf6, 0xf3, 0xf0);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_12BIT_PROFILE2_420, 0x2d80bed6, 0x9cac, 0x4835, 0x9e, 0x91, 0x32, 0x7b, 0xbc, 0x4f, 0x9e, 0xe8);")
From: Biswapriyo Nath nathbappai@gmail.com
--- include/d3d12video.idl | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+)
diff --git a/include/d3d12video.idl b/include/d3d12video.idl index 2cf836f908a..0acd6890024 100644 --- a/include/d3d12video.idl +++ b/include/d3d12video.idl @@ -264,6 +264,31 @@ interface ID3D12VideoDecoder : ID3D12Pageable D3D12_VIDEO_DECODER_DESC GetDesc(); }
+typedef enum D3D12_VIDEO_DECODE_TIER +{ + D3D12_VIDEO_DECODE_TIER_NOT_SUPPORTED = 0, + D3D12_VIDEO_DECODE_TIER_1 = 1, + D3D12_VIDEO_DECODE_TIER_2 = 2, + D3D12_VIDEO_DECODE_TIER_3 = 3, +} D3D12_VIDEO_DECODE_TIER; + +typedef enum D3D12_VIDEO_DECODE_SUPPORT_FLAGS +{ + D3D12_VIDEO_DECODE_SUPPORT_FLAG_NONE = 0x0, + D3D12_VIDEO_DECODE_SUPPORT_FLAG_SUPPORTED = 0x1, +} D3D12_VIDEO_DECODE_SUPPORT_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_SUPPORT_FLAGS);") + +typedef enum D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS +{ + D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_NONE = 0x0, + D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_HEIGHT_ALIGNMENT_MULTIPLE_32_REQUIRED = 0x1, + D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_POST_PROCESSING_SUPPORTED = 0x2, + D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_REFERENCE_ONLY_ALLOCATIONS_REQUIRED = 0x4, + D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_ALLOW_RESOLUTION_CHANGE_ON_NON_KEY_FRAME = 0x8, +} D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS);") + typedef enum D3D12_VIDEO_DECODE_ARGUMENT_TYPE { D3D12_VIDEO_DECODE_ARGUMENT_TYPE_PICTURE_PARAMETERS = 0, @@ -272,6 +297,20 @@ typedef enum D3D12_VIDEO_DECODE_ARGUMENT_TYPE D3D12_VIDEO_DECODE_ARGUMENT_TYPE_MAX_VALID = 3, } D3D12_VIDEO_DECODE_ARGUMENT_TYPE;
+typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_SUPPORT +{ + UINT NodeIndex; + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; + UINT Width; + UINT Height; + DXGI_FORMAT DecodeFormat; + DXGI_RATIONAL FrameRate; + UINT BitRate; + D3D12_VIDEO_DECODE_SUPPORT_FLAGS SupportFlags; + D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS ConfigurationFlags; + D3D12_VIDEO_DECODE_TIER DecodeTier; +} D3D12_FEATURE_DATA_VIDEO_DECODE_SUPPORT; + typedef struct D3D12_VIDEO_DECODE_FRAME_ARGUMENT { D3D12_VIDEO_DECODE_ARGUMENT_TYPE Type;
From: Biswapriyo Nath nathbappai@gmail.com
--- include/d3d12video.idl | 52 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+)
diff --git a/include/d3d12video.idl b/include/d3d12video.idl index 0acd6890024..3864740394b 100644 --- a/include/d3d12video.idl +++ b/include/d3d12video.idl @@ -438,6 +438,58 @@ interface ID3D12VideoDecodeCommandList : ID3D12CommandList ); }
+typedef enum D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE +{ + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_8X8 = 0, + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_16X16 = 1, +} D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE; + +typedef enum D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION +{ + D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_QUARTER_PEL = 0, +} D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION; + +typedef struct D3D12_VIDEO_MOTION_ESTIMATOR_DESC +{ + UINT NodeMask; + DXGI_FORMAT InputFormat; + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE BlockSize; + D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION Precision; + D3D12_VIDEO_SIZE_RANGE SizeRange; +} D3D12_VIDEO_MOTION_ESTIMATOR_DESC; + +typedef struct D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC +{ + UINT NodeMask; + DXGI_FORMAT InputFormat; + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE BlockSize; + D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION Precision; + D3D12_VIDEO_SIZE_RANGE SizeRange; +} D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC; + +[ + uuid(981611ad-a144-4c83-9890-f30e26d658ab), + object, + local, + pointer_default(unique) +] +interface ID3D12VideoDevice1 : ID3D12VideoDevice +{ + HRESULT CreateVideoMotionEstimator( + [in] const D3D12_VIDEO_MOTION_ESTIMATOR_DESC *desc, + [in, optional] ID3D12ProtectedResourceSession *protected_resource_session, + [in] REFIID riid, + [out, iid_is(riid)] void **video_motion_estimator + ); + + HRESULT CreateVideoMotionVectorHeap( + [in] const D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC *desc, + [in, optional] ID3D12ProtectedResourceSession *protected_resource_session, + [in] REFIID riid, + [out, iid_is(riid)] void **video_motion_vector_heap + ); +} + cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG2, 0xee27417f, 0x5e28, 0x4e65, 0xbe, 0xea, 0x1d, 0x26, 0xb5, 0x08, 0xad, 0xc9);") cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG1_AND_MPEG2, 0x86695f12, 0x340e, 0x4f04, 0x9f, 0xd3, 0x92, 0x53, 0xdd, 0x32, 0x74, 0x60);") cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_H264, 0x1b81be68, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);")
From: Biswapriyo Nath nathbappai@gmail.com
--- include/d3d12video.idl | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
diff --git a/include/d3d12video.idl b/include/d3d12video.idl index 3864740394b..694cb60e33a 100644 --- a/include/d3d12video.idl +++ b/include/d3d12video.idl @@ -490,6 +490,28 @@ interface ID3D12VideoDevice1 : ID3D12VideoDevice ); }
+typedef struct D3D12_VIDEO_EXTENSION_COMMAND_DESC +{ + UINT NodeMask; + GUID CommandId; +} D3D12_VIDEO_EXTENSION_COMMAND_DESC; + +[ + uuid(554e41e8-ae8e-4a8c-b7d2-5b4f274a30e4), + object, + local, + pointer_default(unique) +] +interface ID3D12VideoExtensionCommand : ID3D12Pageable +{ + D3D12_VIDEO_EXTENSION_COMMAND_DESC GetDesc(); + + HRESULT GetProtectedResourceSession( + [in] REFIID riid, + [out, iid_is(riid)] void **protected_session + ); +} + cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG2, 0xee27417f, 0x5e28, 0x4e65, 0xbe, 0xea, 0x1d, 0x26, 0xb5, 0x08, 0xad, 0xc9);") cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG1_AND_MPEG2, 0x86695f12, 0x340e, 0x4f04, 0x9f, 0xd3, 0x92, 0x53, 0xdd, 0x32, 0x74, 0x60);") cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_H264, 0x1b81be68, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);")
From: Biswapriyo Nath nathbappai@gmail.com
--- include/d3d12video.idl | 50 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+)
diff --git a/include/d3d12video.idl b/include/d3d12video.idl index 694cb60e33a..3e65ed96fca 100644 --- a/include/d3d12video.idl +++ b/include/d3d12video.idl @@ -512,6 +512,56 @@ interface ID3D12VideoExtensionCommand : ID3D12Pageable ); }
+[ + uuid(f019ac49-f838-4a95-9b17-579437c8f513), + object, + local, + pointer_default(unique) +] +interface ID3D12VideoDevice2 : ID3D12VideoDevice1 +{ + HRESULT CreateVideoDecoder1( + [in] const D3D12_VIDEO_DECODER_DESC *desc, + [in, optional] ID3D12ProtectedResourceSession *protected_resource_session, + [in] REFIID riid, + [out, iid_is(riid)] void **video_decoder + ); + + HRESULT CreateVideoDecoderHeap1( + [in] const D3D12_VIDEO_DECODER_HEAP_DESC *video_decoder_heap_desc, + [in, optional] ID3D12ProtectedResourceSession *protected_resource_session, + [in] REFIID riid, + [out, iid_is(riid)] void **video_decoder_heap + ); + + HRESULT CreateVideoProcessor1( + [in] UINT node_mask, + [in] const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *output_stream_desc, + [in] UINT input_stream_descs_count, + [in] const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *input_stream_descs, + [in, optional] ID3D12ProtectedResourceSession *protected_resource_session, + [in] REFIID riid, + [out, iid_is(riid)] void **video_processor + ); + + HRESULT CreateVideoExtensionCommand( + [in] const D3D12_VIDEO_EXTENSION_COMMAND_DESC *desc, + [in] const void *creation_parameters, + [in] SIZE_T creation_parameters_data_size_in_bytes, + [in, optional] ID3D12ProtectedResourceSession *protected_resource_session, + [in] REFIID riid, + [out] void **video_extension_command + ); + + HRESULT ExecuteExtensionCommand( + [in] ID3D12VideoExtensionCommand *extension_command, + [in] const void *execution_parameters, + [in] SIZE_T execution_parameters_size_in_bytes, + [out] void *output_data, + [in] SIZE_T output_data_size_in_bytes + ); +} + cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG2, 0xee27417f, 0x5e28, 0x4e65, 0xbe, 0xea, 0x1d, 0x26, 0xb5, 0x08, 0xad, 0xc9);") cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG1_AND_MPEG2, 0x86695f12, 0x340e, 0x4f04, 0x9f, 0xd3, 0x92, 0x53, 0xdd, 0x32, 0x74, 0x60);") cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_H264, 0x1b81be68, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);")