From: Tong Wu Date: Tue, 22 Mar 2022 02:37:59 +0000 (+0800) Subject: msdkenc: add macro definitions to avoid the gst-inspect error X-Git-Tag: 1.22.0~2073 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2a703678c03b32d6c54070470589d6dac3103dee;p=platform%2Fupstream%2Fgstreamer.git msdkenc: add macro definitions to avoid the gst-inspect error Since the strings are empty for GST_MSDK_CAPS_MAKE_WITH_DMABUF_FEATURE and GST_MSDK_CAPS_MAKE_WITH_VA_FEATURE, when excuting gst-inspect-1.0.exe msdkh265enc, there will be convert static caps error because of the extra semicolon between two empty strings. Now macro definitions are added to avoid this issue. Part-of: --- diff --git a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkenc.c b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkenc.c index 7ef0329..f8b3e6f 100644 --- a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkenc.c +++ b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkenc.c @@ -78,6 +78,14 @@ static void gst_msdkenc_close_encoder (GstMsdkEnc * thiz); GST_DEBUG_CATEGORY_EXTERN (gst_msdkenc_debug); #define GST_CAT_DEFAULT gst_msdkenc_debug +#ifdef _WIN32 +static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink", + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_STATIC_CAPS (GST_MSDK_CAPS_STR + ("{ NV12, I420, YV12, YUY2, UYVY, BGRA }", "NV12")) + ); +#else static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, @@ -85,6 +93,7 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink", ("{ NV12, I420, YV12, YUY2, UYVY, BGRA }", "NV12") "; " GST_MSDK_CAPS_MAKE_WITH_VA_FEATURE ("NV12")) ); +#endif #define PROP_HARDWARE_DEFAULT TRUE #define PROP_ASYNC_DEPTH_DEFAULT 4 diff --git a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkh265enc.c b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkh265enc.c index fe679e9..f0fda43 100644 --- a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkh265enc.c +++ b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkh265enc.c @@ -130,12 +130,20 @@ enum #define PRFOLIE_STR "{ " PROFILES_1032 " }" #endif +#ifdef _WIN32 +static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink", + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_STATIC_CAPS (GST_MSDK_CAPS_STR (COMMON_FORMAT, + "{ NV12, P010_10LE }"))); +#else static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_MSDK_CAPS_STR (COMMON_FORMAT, "{ NV12, P010_10LE }") "; " GST_MSDK_CAPS_MAKE_WITH_VA_FEATURE ("NV12"))); +#endif static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, diff --git a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkvp9enc.c b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkvp9enc.c index 8014666..da35769 100644 --- a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkvp9enc.c +++ b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkvp9enc.c @@ -67,12 +67,20 @@ GST_DEBUG_CATEGORY_EXTERN (gst_msdkvp9enc_debug); #define SRC_PROFILES "{ " PROFILES " }" #endif +#ifdef _WIN32 +static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink", + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_STATIC_CAPS (GST_MSDK_CAPS_STR (COMMON_FORMAT, + "{ NV12, P010_10LE }"))); +#else static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_MSDK_CAPS_STR (COMMON_FORMAT, "{ NV12, P010_10LE }") "; " GST_MSDK_CAPS_MAKE_WITH_VA_FEATURE ("NV12"))); +#endif static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC,