From 9fdbb95191067c23cd1d1614a16a3ba96d9e5b5e Mon Sep 17 00:00:00 2001 From: weizhu-intel Date: Fri, 29 May 2020 22:32:20 +0800 Subject: [PATCH] Do not advertise support for nonexistent alpha channels in decode/encode Change decode/encode in YUV 4:4:4 formats to only support surfaces with no alpha channel, since there is no alpha support. Signed-off-by: Mark Thompson --- media_driver/linux/common/ddi/media_libva.cpp | 38 ++++++++-- .../linux/common/ddi/media_libva_caps.cpp | 26 +++++++ .../linux/common/ddi/media_libva_common.h | 3 + .../linux/common/ddi/media_libva_util.cpp | 3 + .../linux/common/os/mos_interface.cpp | 3 + .../linux/gen11/ddi/media_libva_caps_g11.cpp | 59 ++++++++++++++- .../linux/gen12/ddi/media_libva_caps_g12.cpp | 72 +++++++++++++++++++ 7 files changed, 197 insertions(+), 7 deletions(-) mode change 100644 => 100755 media_driver/linux/common/ddi/media_libva_common.h mode change 100644 => 100755 media_driver/linux/common/os/mos_interface.cpp mode change 100644 => 100755 media_driver/linux/gen12/ddi/media_libva_caps_g12.cpp diff --git a/media_driver/linux/common/ddi/media_libva.cpp b/media_driver/linux/common/ddi/media_libva.cpp index 16e1f9654a1..1b704d0e586 100755 --- a/media_driver/linux/common/ddi/media_libva.cpp +++ b/media_driver/linux/common/ddi/media_libva.cpp @@ -463,10 +463,16 @@ int32_t DdiMedia_MediaFormatToOsFormat(DDI_MEDIA_FORMAT format) return VA_FOURCC_Y216; case Media_Format_AYUV: return VA_FOURCC_AYUV; + case Media_Format_XYUV: + return VA_FOURCC_XYUV; case Media_Format_Y410: return VA_FOURCC_Y410; + case Media_Format_XV30: + return VA_FOURCC_XV30; case Media_Format_Y416: return VA_FOURCC_Y416; + case Media_Format_XV48: + return VA_FOURCC_XV48; case Media_Format_Y8: return VA_FOURCC_Y8; case Media_Format_Y16S: @@ -588,10 +594,16 @@ DDI_MEDIA_FORMAT DdiMedia_OsFormatToMediaFormat(int32_t fourcc, int32_t rtformat return Media_Format_Y216; case VA_FOURCC_AYUV: return Media_Format_AYUV; + case VA_FOURCC_XYUV: + return Media_Format_XYUV; case VA_FOURCC_Y410: return Media_Format_Y410; + case VA_FOURCC_XV30: + return Media_Format_XV30; case VA_FOURCC_Y416: return Media_Format_Y416; + case VA_FOURCC_XV48: + return Media_Format_XV48; case VA_FOURCC_Y8: return Media_Format_Y8; case VA_FOURCC_Y16: @@ -2266,6 +2278,9 @@ DdiMedia_CreateSurfaces2( case VA_RT_FORMAT_YUV420: expected_fourcc = VA_FOURCC_NV12; break; + case VA_RT_FORMAT_YUV420_10: + expected_fourcc = VA_FOURCC_P010; + break; case VA_RT_FORMAT_YUV420_12: expected_fourcc = VA_FOURCC_P016; break; @@ -2282,7 +2297,10 @@ DdiMedia_CreateSurfaces2( expected_fourcc = VA_FOURCC_444P; break; case VA_RT_FORMAT_YUV444_10: - expected_fourcc = VA_FOURCC_Y410; + expected_fourcc = VA_FOURCC_XV30; + break; + case VA_RT_FORMAT_YUV444_12: + expected_fourcc = VA_FOURCC_XV48; break; case VA_RT_FORMAT_YUV411: expected_fourcc = VA_FOURCC_411P; @@ -2290,9 +2308,6 @@ DdiMedia_CreateSurfaces2( case VA_RT_FORMAT_YUV400: expected_fourcc = VA_FOURCC('4','0','0','P'); break; - case VA_RT_FORMAT_YUV420_10BPP: - expected_fourcc = VA_FOURCC_P010; - break; case VA_RT_FORMAT_RGB16: expected_fourcc = VA_FOURCC_R5G6B5; break; @@ -2362,12 +2377,21 @@ DdiMedia_CreateSurfaces2( case VA_FOURCC_AYUV: expected_fourcc = VA_FOURCC_AYUV; break; + case VA_FOURCC_XYUV: + expected_fourcc = VA_FOURCC_XYUV; + break; case VA_FOURCC_Y410: expected_fourcc = VA_FOURCC_Y410; break; + case VA_FOURCC_XV30: + expected_fourcc = VA_FOURCC_XV30; + break; case VA_FOURCC_Y416: expected_fourcc = VA_FOURCC_Y416; break; + case VA_FOURCC_XV48: + expected_fourcc = VA_FOURCC_XV48; + break; case VA_FOURCC_I420: expected_fourcc = VA_FOURCC_I420; break; @@ -4110,10 +4134,13 @@ VAStatus DdiMedia_CreateImage( case VA_FOURCC_VYUY: case VA_FOURCC_YVYU: case VA_FOURCC_AYUV: + case VA_FOURCC_XYUV: case VA_FOURCC_Y210: case VA_FOURCC_Y216: case VA_FOURCC_Y410: + case VA_FOURCC_XV30: case VA_FOURCC_Y416: + case VA_FOURCC_XV48: case VA_FOURCC_Y800: vaimg->num_planes = 1; vaimg->pitches[0] = pitch; @@ -4434,7 +4461,9 @@ VAStatus DdiMedia_DeriveImage ( vaimg->offsets[2] = vaimg->offsets[1] + 2; break; case Media_Format_Y410: + case Media_Format_XV30: case Media_Format_AYUV: + case Media_Format_XYUV: case Media_Format_Y210: vaimg->format.bits_per_pixel = 32; vaimg->data_size = mediaSurface->iPitch * mediaSurface->iHeight; @@ -4443,6 +4472,7 @@ VAStatus DdiMedia_DeriveImage ( vaimg->offsets[0] = 0; break; case Media_Format_Y416: + case Media_Format_XV48: vaimg->format.bits_per_pixel = 64; // packed format [alpha, Y, U, V], 16 bits per channel vaimg->num_planes = 1; vaimg->pitches[0] = mediaSurface->iPitch; diff --git a/media_driver/linux/common/ddi/media_libva_caps.cpp b/media_driver/linux/common/ddi/media_libva_caps.cpp index 212722aa2a6..6cc49a961f2 100755 --- a/media_driver/linux/common/ddi/media_libva_caps.cpp +++ b/media_driver/linux/common/ddi/media_libva_caps.cpp @@ -2670,6 +2670,12 @@ VAStatus MediaLibvaCaps::QuerySurfaceAttributes( attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; attribs[i].value.value.i = VA_FOURCC_AYUV; i++; + + attribs[i].type = VASurfaceAttribPixelFormat; + attribs[i].value.type = VAGenericValueTypeInteger; + attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; + attribs[i].value.value.i = VA_FOURCC_XYUV; + i++; } else if(profile == VAProfileHEVCMain444_10 || profile == VAProfileVP9Profile3) { @@ -2679,6 +2685,12 @@ VAStatus MediaLibvaCaps::QuerySurfaceAttributes( attribs[i].value.value.i = VA_FOURCC_Y410; i++; + attribs[i].type = VASurfaceAttribPixelFormat; + attribs[i].value.type = VAGenericValueTypeInteger; + attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; + attribs[i].value.value.i = VA_FOURCC_XV30; + i++; + if(profile == VAProfileVP9Profile3) { attribs[i].type = VASurfaceAttribPixelFormat; @@ -2686,6 +2698,12 @@ VAStatus MediaLibvaCaps::QuerySurfaceAttributes( attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; attribs[i].value.value.i = VA_FOURCC_Y416; i++; + + attribs[i].type = VASurfaceAttribPixelFormat; + attribs[i].value.type = VAGenericValueTypeInteger; + attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; + attribs[i].value.value.i = VA_FOURCC_XV48; + i++; } } else if(profile == VAProfileHEVCMain444_12) @@ -2695,6 +2713,12 @@ VAStatus MediaLibvaCaps::QuerySurfaceAttributes( attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; attribs[i].value.value.i = VA_FOURCC_Y416; i++; + + attribs[i].type = VASurfaceAttribPixelFormat; + attribs[i].value.type = VAGenericValueTypeInteger; + attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; + attribs[i].value.value.i = VA_FOURCC_XV48; + i++; } else if (profile == VAProfileJPEGBaseline) { @@ -3289,6 +3313,7 @@ GMM_RESOURCE_FORMAT MediaLibvaCaps::ConvertFourccToGmmFmt(uint32_t fourcc) case VA_FOURCC_BGRP : return GMM_FORMAT_BGRP; case VA_FOURCC_RGB565 : return GMM_FORMAT_B5G6R5_UNORM_TYPE; case VA_FOURCC_AYUV : return GMM_FORMAT_AYUV_TYPE; + case VA_FOURCC_XYUV : return GMM_FORMAT_AYUV_TYPE; case VA_FOURCC_NV12 : return GMM_FORMAT_NV12_TYPE; case VA_FOURCC_NV21 : return GMM_FORMAT_NV21_TYPE; case VA_FOURCC_YUY2 : return GMM_FORMAT_YUY2; @@ -3306,6 +3331,7 @@ GMM_RESOURCE_FORMAT MediaLibvaCaps::ConvertFourccToGmmFmt(uint32_t fourcc) case VA_FOURCC_P016 : return GMM_FORMAT_P016_TYPE; case VA_FOURCC_Y210 : return GMM_FORMAT_Y210_TYPE; case VA_FOURCC_Y410 : return GMM_FORMAT_Y410_TYPE; + case VA_FOURCC_XV30 : return GMM_FORMAT_Y410_TYPE; case VA_FOURCC_Y800 : return GMM_FORMAT_GENERIC_8BIT; case VA_FOURCC_A2R10G10B10 : return GMM_FORMAT_R10G10B10A2_UNORM_TYPE; case VA_FOURCC_A2B10G10R10 : return GMM_FORMAT_B10G10R10A2_UNORM_TYPE; diff --git a/media_driver/linux/common/ddi/media_libva_common.h b/media_driver/linux/common/ddi/media_libva_common.h old mode 100644 new mode 100755 index 12783480fbb..33dd4df68f1 --- a/media_driver/linux/common/ddi/media_libva_common.h +++ b/media_driver/linux/common/ddi/media_libva_common.h @@ -182,8 +182,11 @@ typedef enum _DDI_MEDIA_FORMAT Media_Format_Y210 , Media_Format_Y216 , Media_Format_AYUV , + Media_Format_XYUV , Media_Format_Y410 , + Media_Format_XV30 , Media_Format_Y416 , + Media_Format_XV48 , Media_Format_Y8 , Media_Format_Y16S , Media_Format_Y16U , diff --git a/media_driver/linux/common/ddi/media_libva_util.cpp b/media_driver/linux/common/ddi/media_libva_util.cpp index 8117d3daf6e..665185c4d95 100755 --- a/media_driver/linux/common/ddi/media_libva_util.cpp +++ b/media_driver/linux/common/ddi/media_libva_util.cpp @@ -232,8 +232,11 @@ VAStatus DdiMediaUtil_AllocateSurface( case Media_Format_Y210: case Media_Format_Y216: case Media_Format_AYUV: + case Media_Format_XYUV: case Media_Format_Y410: + case Media_Format_XV30: case Media_Format_Y416: + case Media_Format_XV48: case Media_Format_Y8: case Media_Format_Y16S: case Media_Format_Y16U: diff --git a/media_driver/linux/common/os/mos_interface.cpp b/media_driver/linux/common/os/mos_interface.cpp old mode 100644 new mode 100755 index 1235275ab74..b25f31c0070 --- a/media_driver/linux/common/os/mos_interface.cpp +++ b/media_driver/linux/common/os/mos_interface.cpp @@ -902,12 +902,15 @@ MOS_STATUS MosInterface::ConvertResourceFromDdi( resource->Format = Format_Y216; break; case Media_Format_AYUV: + case Media_Format_XYUV: resource->Format = Format_AYUV; break; case Media_Format_Y410: + case Media_Format_XV30: resource->Format = Format_Y410; break; case Media_Format_Y416: + case Media_Format_XV48: resource->Format = Format_Y416; break; case Media_Format_Y8: diff --git a/media_driver/linux/gen11/ddi/media_libva_caps_g11.cpp b/media_driver/linux/gen11/ddi/media_libva_caps_g11.cpp index 14ebf6744bd..c7eea5332b1 100755 --- a/media_driver/linux/gen11/ddi/media_libva_caps_g11.cpp +++ b/media_driver/linux/gen11/ddi/media_libva_caps_g11.cpp @@ -49,6 +49,7 @@ const VAImageFormat m_supportedImageformatsG11[] = {VA_FOURCC_X2B10G10R10, VA_LSB_FIRST, 32, 30, 0x000003ff, 0x000ffc00, 0x3ff00000, 0}, /* [31:0] X:B:G:R 2:10:10:10 little endian */ {VA_FOURCC_RGB565, VA_LSB_FIRST, 16, 16, 0xf800, 0x07e0, 0x001f, 0}, /* [15:0] R:G:B 5:6:5 little endian */ {VA_FOURCC_AYUV, VA_LSB_FIRST, 32, 0,0,0,0,0}, + {VA_FOURCC_XYUV, VA_LSB_FIRST, 32, 0,0,0,0,0}, {VA_FOURCC_Y800, VA_LSB_FIRST, 8, 0,0,0,0,0}, {VA_FOURCC_NV12, VA_LSB_FIRST, 12, 0,0,0,0,0}, {VA_FOURCC_NV21, VA_LSB_FIRST, 12, 0,0,0,0,0}, @@ -63,7 +64,8 @@ const VAImageFormat m_supportedImageformatsG11[] = {VA_FOURCC_IMC3, VA_LSB_FIRST, 16, 0,0,0,0,0}, {VA_FOURCC_P010, VA_LSB_FIRST, 24, 0,0,0,0,0}, {VA_FOURCC_Y210, VA_LSB_FIRST, 32, 0,0,0,0,0}, - {VA_FOURCC_Y410, VA_LSB_FIRST, 32, 0,0,0,0,0} + {VA_FOURCC_Y410, VA_LSB_FIRST, 32, 0,0,0,0,0}, + {VA_FOURCC_XV30, VA_LSB_FIRST, 32, 0,0,0,0,0} }; const VAConfigAttribValEncRateControlExt MediaLibvaCapsG11::m_encVp9RateControlExt = @@ -819,8 +821,11 @@ GMM_RESOURCE_FORMAT MediaLibvaCapsG11::ConvertMediaFmtToGmmFmt( case Media_Format_B10G10R10X2: return GMM_FORMAT_B10G10R10A2_UNORM_TYPE; case Media_Format_Y210 : return GMM_FORMAT_Y210_TYPE; case Media_Format_AYUV : return GMM_FORMAT_AYUV_TYPE; + case Media_Format_XYUV : return GMM_FORMAT_AYUV_TYPE; case Media_Format_Y410 : return GMM_FORMAT_Y410_TYPE; + case Media_Format_XV30 : return GMM_FORMAT_Y410_TYPE; case Media_Format_Y416 : return GMM_FORMAT_Y416_TYPE; + case Media_Format_XV48 : return GMM_FORMAT_Y416_TYPE; default : return GMM_FORMAT_INVALID; } } @@ -969,6 +974,12 @@ VAStatus MediaLibvaCapsG11::QuerySurfaceAttributes( attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; attribs[i].value.value.i = VA_FOURCC_AYUV; i++; + + attribs[i].type = VASurfaceAttribPixelFormat; + attribs[i].value.type = VAGenericValueTypeInteger; + attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; + attribs[i].value.value.i = VA_FOURCC_XYUV; + i++; } else if(profile == VAProfileHEVCMain444_10 || profile == VAProfileVP9Profile3) { @@ -978,6 +989,12 @@ VAStatus MediaLibvaCapsG11::QuerySurfaceAttributes( attribs[i].value.value.i = VA_FOURCC_Y410; i++; + attribs[i].type = VASurfaceAttribPixelFormat; + attribs[i].value.type = VAGenericValueTypeInteger; + attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; + attribs[i].value.value.i = VA_FOURCC_XV30; + i++; + if(profile == VAProfileVP9Profile3) { attribs[i].type = VASurfaceAttribPixelFormat; @@ -985,6 +1002,12 @@ VAStatus MediaLibvaCapsG11::QuerySurfaceAttributes( attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; attribs[i].value.value.i = VA_FOURCC_Y416; i++; + + attribs[i].type = VASurfaceAttribPixelFormat; + attribs[i].value.type = VAGenericValueTypeInteger; + attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; + attribs[i].value.value.i = VA_FOURCC_XV48; + i++; } } else if(profile == VAProfileHEVCMain444_12) @@ -994,6 +1017,12 @@ VAStatus MediaLibvaCapsG11::QuerySurfaceAttributes( attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; attribs[i].value.value.i = VA_FOURCC_Y416; i++; + + attribs[i].type = VASurfaceAttribPixelFormat; + attribs[i].value.type = VAGenericValueTypeInteger; + attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; + attribs[i].value.value.i = VA_FOURCC_XV48; + i++; } else if (profile == VAProfileJPEGBaseline) { @@ -1081,6 +1110,12 @@ VAStatus MediaLibvaCapsG11::QuerySurfaceAttributes( attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; attribs[i].value.value.i = VA_FOURCC_AYUV; i++; + + attribs[i].type = VASurfaceAttribPixelFormat; + attribs[i].value.type = VAGenericValueTypeInteger; + attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; + attribs[i].value.value.i = VA_FOURCC_XYUV; + i++; } else if(profile == VAProfileHEVCMain444_10) { @@ -1089,6 +1124,12 @@ VAStatus MediaLibvaCapsG11::QuerySurfaceAttributes( attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; attribs[i].value.value.i = VA_FOURCC_Y410; i++; + + attribs[i].type = VASurfaceAttribPixelFormat; + attribs[i].value.type = VAGenericValueTypeInteger; + attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; + attribs[i].value.value.i = VA_FOURCC_XV30; + i++; } else if(profile == VAProfileHEVCMain422_10) { @@ -1109,7 +1150,13 @@ VAStatus MediaLibvaCapsG11::QuerySurfaceAttributes( attribs[i].type = VASurfaceAttribPixelFormat; attribs[i].value.type = VAGenericValueTypeInteger; attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; - attribs[i].value.value.i = VA_FOURCC('A', 'Y', 'U', 'V'); + attribs[i].value.value.i = VA_FOURCC_AYUV; + i++; + + attribs[i].type = VASurfaceAttribPixelFormat; + attribs[i].value.type = VAGenericValueTypeInteger; + attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; + attribs[i].value.value.i = VA_FOURCC_XYUV; i++; } else if (profile == VAProfileVP9Profile3) @@ -1117,7 +1164,13 @@ VAStatus MediaLibvaCapsG11::QuerySurfaceAttributes( attribs[i].type = VASurfaceAttribPixelFormat; attribs[i].value.type = VAGenericValueTypeInteger; attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; - attribs[i].value.value.i = VA_FOURCC('Y', '4', '1', '6'); + attribs[i].value.value.i = VA_FOURCC_Y416; + i++; + + attribs[i].type = VASurfaceAttribPixelFormat; + attribs[i].value.type = VAGenericValueTypeInteger; + attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; + attribs[i].value.value.i = VA_FOURCC_XV48; i++; attribs[i].type = VASurfaceAttribPixelFormat; diff --git a/media_driver/linux/gen12/ddi/media_libva_caps_g12.cpp b/media_driver/linux/gen12/ddi/media_libva_caps_g12.cpp old mode 100644 new mode 100755 index fd1efc4a4de..83e8dce9b42 --- a/media_driver/linux/gen12/ddi/media_libva_caps_g12.cpp +++ b/media_driver/linux/gen12/ddi/media_libva_caps_g12.cpp @@ -55,6 +55,7 @@ const VAImageFormat m_supportedImageformatsG12[] = {VA_FOURCC_X2B10G10R10, VA_LSB_FIRST, 32, 30, 0x000003ff, 0x000ffc00, 0x3ff00000, 0}, /* [31:0] X:B:G:R 2:10:10:10 little endian */ {VA_FOURCC_RGB565, VA_LSB_FIRST, 16, 16, 0xf800, 0x07e0, 0x001f, 0}, /* [15:0] R:G:B 5:6:5 little endian */ {VA_FOURCC_AYUV, VA_LSB_FIRST, 32, 0,0,0,0,0}, + {VA_FOURCC_XYUV, VA_LSB_FIRST, 32, 0,0,0,0,0}, {VA_FOURCC_Y800, VA_LSB_FIRST, 8, 0,0,0,0,0}, {VA_FOURCC_NV12, VA_LSB_FIRST, 12, 0,0,0,0,0}, {VA_FOURCC_NV21, VA_LSB_FIRST, 12, 0,0,0,0,0}, @@ -72,7 +73,9 @@ const VAImageFormat m_supportedImageformatsG12[] = {VA_FOURCC_Y210, VA_LSB_FIRST, 32, 0,0,0,0,0}, {VA_FOURCC_Y216, VA_LSB_FIRST, 32, 0,0,0,0,0}, {VA_FOURCC_Y410, VA_LSB_FIRST, 32, 0,0,0,0,0}, + {VA_FOURCC_XV30, VA_LSB_FIRST, 32, 0,0,0,0,0}, {VA_FOURCC_Y416, VA_LSB_FIRST, 64, 0,0,0,0,0}, + {VA_FOURCC_XV48, VA_LSB_FIRST, 64, 0,0,0,0,0} }; const VAConfigAttribValEncRateControlExt MediaLibvaCapsG12::m_encVp9RateControlExt = @@ -964,6 +967,12 @@ VAStatus MediaLibvaCapsG12::QuerySurfaceAttributes( attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; attribs[i].value.value.i = VA_FOURCC_AYUV; i++; + + attribs[i].type = VASurfaceAttribPixelFormat; + attribs[i].value.type = VAGenericValueTypeInteger; + attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; + attribs[i].value.value.i = VA_FOURCC_XYUV; + i++; } else if(profile == VAProfileHEVCMain444_10 || profile == VAProfileVP9Profile3) { @@ -973,6 +982,12 @@ VAStatus MediaLibvaCapsG12::QuerySurfaceAttributes( attribs[i].value.value.i = VA_FOURCC_Y410; i++; + attribs[i].type = VASurfaceAttribPixelFormat; + attribs[i].value.type = VAGenericValueTypeInteger; + attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; + attribs[i].value.value.i = VA_FOURCC_XV30; + i++; + if(profile == VAProfileVP9Profile3) { attribs[i].type = VASurfaceAttribPixelFormat; @@ -980,6 +995,12 @@ VAStatus MediaLibvaCapsG12::QuerySurfaceAttributes( attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; attribs[i].value.value.i = VA_FOURCC_Y416; i++; + + attribs[i].type = VASurfaceAttribPixelFormat; + attribs[i].value.type = VAGenericValueTypeInteger; + attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; + attribs[i].value.value.i = VA_FOURCC_XV48; + i++; } } else if(profile == VAProfileHEVCMain444_12) @@ -989,6 +1010,12 @@ VAStatus MediaLibvaCapsG12::QuerySurfaceAttributes( attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; attribs[i].value.value.i = VA_FOURCC_Y416; i++; + + attribs[i].type = VASurfaceAttribPixelFormat; + attribs[i].value.type = VAGenericValueTypeInteger; + attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; + attribs[i].value.value.i = VA_FOURCC_XV48; + i++; } else if(profile == VAProfileHEVCSccMain10) { @@ -1019,11 +1046,23 @@ VAStatus MediaLibvaCapsG12::QuerySurfaceAttributes( attribs[i].value.value.i = VA_FOURCC_AYUV; i++; + attribs[i].type = VASurfaceAttribPixelFormat; + attribs[i].value.type = VAGenericValueTypeInteger; + attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; + attribs[i].value.value.i = VA_FOURCC_XYUV; + i++; + attribs[i].type = VASurfaceAttribPixelFormat; attribs[i].value.type = VAGenericValueTypeInteger; attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; attribs[i].value.value.i = VA_FOURCC_Y410; i++; + + attribs[i].type = VASurfaceAttribPixelFormat; + attribs[i].value.type = VAGenericValueTypeInteger; + attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; + attribs[i].value.value.i = VA_FOURCC_XV30; + i++; } else if (profile == VAProfileJPEGBaseline) { @@ -1124,6 +1163,12 @@ VAStatus MediaLibvaCapsG12::QuerySurfaceAttributes( attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; attribs[i].value.value.i = VA_FOURCC_AYUV; i++; + + attribs[i].type = VASurfaceAttribPixelFormat; + attribs[i].value.type = VAGenericValueTypeInteger; + attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; + attribs[i].value.value.i = VA_FOURCC_XYUV; + i++; } else if (profile == VAProfileHEVCMain444_10) { @@ -1132,6 +1177,12 @@ VAStatus MediaLibvaCapsG12::QuerySurfaceAttributes( attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; attribs[i].value.value.i = VA_FOURCC_Y410; i++; + + attribs[i].type = VASurfaceAttribPixelFormat; + attribs[i].value.type = VAGenericValueTypeInteger; + attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; + attribs[i].value.value.i = VA_FOURCC_XV30; + i++; } else if(profile == VAProfileHEVCMain422_10) { @@ -1174,6 +1225,12 @@ VAStatus MediaLibvaCapsG12::QuerySurfaceAttributes( attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; attribs[i].value.value.i = VA_FOURCC_AYUV; i++; + + attribs[i].type = VASurfaceAttribPixelFormat; + attribs[i].value.type = VAGenericValueTypeInteger; + attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; + attribs[i].value.value.i = VA_FOURCC_XYUV; + i++; } else if (profile == VAProfileVP9Profile3) { @@ -1183,12 +1240,24 @@ VAStatus MediaLibvaCapsG12::QuerySurfaceAttributes( attribs[i].value.value.i = VA_FOURCC_Y410; i++; + attribs[i].type = VASurfaceAttribPixelFormat; + attribs[i].value.type = VAGenericValueTypeInteger; + attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; + attribs[i].value.value.i = VA_FOURCC_XV30; + i++; + attribs[i].type = VASurfaceAttribPixelFormat; attribs[i].value.type = VAGenericValueTypeInteger; attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; attribs[i].value.value.i = VA_FOURCC_Y416; i++; + attribs[i].type = VASurfaceAttribPixelFormat; + attribs[i].value.type = VAGenericValueTypeInteger; + attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; + attribs[i].value.value.i = VA_FOURCC_XV48; + i++; + attribs[i].type = VASurfaceAttribPixelFormat; attribs[i].value.type = VAGenericValueTypeInteger; attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE; @@ -2080,8 +2149,11 @@ GMM_RESOURCE_FORMAT MediaLibvaCapsG12::ConvertMediaFmtToGmmFmt( case Media_Format_Y210 : return GMM_FORMAT_Y210_TYPE; case Media_Format_Y216 : return GMM_FORMAT_Y216_TYPE; case Media_Format_AYUV : return GMM_FORMAT_AYUV_TYPE; + case Media_Format_XYUV : return GMM_FORMAT_AYUV_TYPE; case Media_Format_Y410 : return GMM_FORMAT_Y410_TYPE; + case Media_Format_XV30 : return GMM_FORMAT_Y410_TYPE; case Media_Format_Y416 : return GMM_FORMAT_Y416_TYPE; + case Media_Format_XV48 : return GMM_FORMAT_Y416_TYPE; case Media_Format_Y8 : return GMM_FORMAT_MEDIA_Y8_UNORM; case Media_Format_Y16S : return GMM_FORMAT_MEDIA_Y16_SNORM; case Media_Format_Y16U : return GMM_FORMAT_MEDIA_Y16_UNORM;