Commit 5b369e6e authored by Haihao Xiang's avatar Haihao Xiang

msdk: fix the build error with libva 2.4.0

This fixes #949
parent d3ec0645
Pipeline #31559 passed with stages
in 72 minutes and 41 seconds
......@@ -98,8 +98,10 @@ gst_msdk_frame_alloc (mfxHDL pthis, mfxFrameAllocRequest * req,
if (format == VA_RT_FORMAT_YUV420 && va_fourcc == VA_FOURCC_P010)
format = VA_RT_FORMAT_YUV420_10;
#if VA_CHECK_VERSION(1, 4, 1)
if (format == VA_RT_FORMAT_YUV444 && va_fourcc == VA_FOURCC_A2R10G10B10)
format = VA_RT_FORMAT_RGB32_10;
#endif
va_status = vaCreateSurfaces (gst_msdk_context_get_handle (context),
format,
......@@ -331,6 +333,7 @@ gst_msdk_frame_lock (mfxHDL pthis, mfxMemId mid, mfxFrameData * data)
data->Y = data->V + 2;
data->A = data->V + 3;
break;
#if VA_CHECK_VERSION(1, 4, 1)
case VA_FOURCC_A2R10G10B10:
data->Pitch = mem_id->image.pitches[0];
data->R = buf + mem_id->image.offsets[0];
......@@ -338,6 +341,7 @@ gst_msdk_frame_lock (mfxHDL pthis, mfxMemId mid, mfxFrameData * data)
data->B = data->R;
data->A = data->R;
break;
#endif
default:
g_assert_not_reached ();
break;
......@@ -484,10 +488,12 @@ gst_msdk_export_dmabuf_to_vasurface (GstMsdkContext * context,
va_chroma = VA_RT_FORMAT_YUV444;
va_fourcc = VA_FOURCC_AYUV;
break;
#if VA_CHECK_VERSION(1, 4, 1)
case GST_VIDEO_FORMAT_BGR10A2_LE:
va_chroma = VA_RT_FORMAT_RGB32_10;
va_fourcc = VA_FOURCC_A2R10G10B10;
break;
#endif
default:
goto error_unsupported_format;
}
......
......@@ -44,8 +44,14 @@
#include "gstmsdkcontextutil.h"
#include "gstmsdkvpputil.h"
#define EXT_FORMATS ""
#ifndef _WIN32
#include "gstmsdkallocator_libva.h"
#if VA_CHECK_VERSION(1, 4, 1)
#undef EXT_FORMATS
#define EXT_FORMATS ", BGR10A2_LE"
#endif
#endif
GST_DEBUG_CATEGORY_EXTERN (gst_msdkvpp_debug);
......@@ -78,9 +84,10 @@ static GstStaticPadTemplate gst_msdkvpp_src_factory =
GST_PAD_ALWAYS,
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE_WITH_FEATURES
(GST_CAPS_FEATURE_MEMORY_DMABUF,
"{ BGRA, YUY2, UYVY, NV12, VUYA, BGRx, P010_10LE, BGR10A2_LE}") ";"
GST_VIDEO_CAPS_MAKE
("{ BGRA, NV12, YUY2, UYVY, VUYA, BGRx, P010_10LE, BGR10A2_LE }") ", "
"{ BGRA, YUY2, UYVY, NV12, VUYA, BGRx, P010_10LE" EXT_FORMATS "}")
";"
GST_VIDEO_CAPS_MAKE ("{ BGRA, NV12, YUY2, UYVY, VUYA, BGRx, P010_10LE"
EXT_FORMATS "}") ", "
"interlace-mode = (string){ progressive, interleaved, mixed }" ";"));
enum
......
......@@ -66,7 +66,9 @@ static const struct fourcc_map gst_msdk_fourcc_mfx_to_va[] = {
FOURCC_MFX_TO_VA (RGB565, RGB565),
#endif
FOURCC_MFX_TO_VA (AYUV, AYUV),
#if VA_CHECK_VERSION(1, 4, 1)
FOURCC_MFX_TO_VA (A2RGB10, A2R10G10B10),
#endif
{0, 0}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment