From: Haihao Xiang Date: Wed, 17 Apr 2019 01:12:52 +0000 (+0800) Subject: msdk: fix the build error with libva 2.4.0 X-Git-Tag: 1.19.3~507^2~3419 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5b369e6e9756801c60c9b19b8cbd2dd5f4fa5166;p=platform%2Fupstream%2Fgstreamer.git msdk: fix the build error with libva 2.4.0 This fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/949 --- diff --git a/sys/msdk/gstmsdkallocator_libva.c b/sys/msdk/gstmsdkallocator_libva.c index ef94bf7..16ba5ef 100644 --- a/sys/msdk/gstmsdkallocator_libva.c +++ b/sys/msdk/gstmsdkallocator_libva.c @@ -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; } diff --git a/sys/msdk/gstmsdkvpp.c b/sys/msdk/gstmsdkvpp.c index bc4fa34..d0e0a46 100644 --- a/sys/msdk/gstmsdkvpp.c +++ b/sys/msdk/gstmsdkvpp.c @@ -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 diff --git a/sys/msdk/msdk_libva.c b/sys/msdk/msdk_libva.c index 296e5a5..392a09a 100644 --- a/sys/msdk/msdk_libva.c +++ b/sys/msdk/msdk_libva.c @@ -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} };