diff --git a/sys/msdk/gstmsdkdec.c b/sys/msdk/gstmsdkdec.c index 54b4abaab5..e2f4852f91 100644 --- a/sys/msdk/gstmsdkdec.c +++ b/sys/msdk/gstmsdkdec.c @@ -44,6 +44,13 @@ GST_DEBUG_CATEGORY_EXTERN (gst_msdkdec_debug); #define GST_CAT_DEFAULT gst_msdkdec_debug +#ifndef _WIN32 +#define DMABUF_CAPS_STR \ + GST_VIDEO_CAPS_MAKE_WITH_FEATURES (GST_CAPS_FEATURE_MEMORY_DMABUF, "{ NV12 }") +#else +#define DMABUF_CAPS_STR "" +#endif + static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, @@ -51,9 +58,7 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src", "format = (string) { NV12 }, " "framerate = (fraction) [0, MAX], " "width = (int) [ 1, MAX ], height = (int) [ 1, MAX ]," - "interlace-mode = (string) progressive;" - GST_VIDEO_CAPS_MAKE_WITH_FEATURES (GST_CAPS_FEATURE_MEMORY_DMABUF, - "{ NV12 }") ";") + "interlace-mode = (string) progressive;" DMABUF_CAPS_STR) ); #define PROP_HARDWARE_DEFAULT TRUE diff --git a/sys/msdk/gstmsdkenc.c b/sys/msdk/gstmsdkenc.c index c5359d8d3f..49de8557da 100644 --- a/sys/msdk/gstmsdkenc.c +++ b/sys/msdk/gstmsdkenc.c @@ -76,6 +76,13 @@ static void gst_msdkenc_close_encoder (GstMsdkEnc * thiz); GST_DEBUG_CATEGORY_EXTERN (gst_msdkenc_debug); #define GST_CAT_DEFAULT gst_msdkenc_debug +#ifndef _WIN32 +#define DMABUF_CAPS_STR \ + GST_VIDEO_CAPS_MAKE_WITH_FEATURES (GST_CAPS_FEATURE_MEMORY_DMABUF, "{ NV12 }") +#else +#define DMABUF_CAPS_STR "" +#endif + static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, @@ -83,9 +90,8 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink", "format = (string) { NV12, I420, YV12, YUY2, UYVY, BGRA }, " "framerate = (fraction) [0, MAX], " "width = (int) [ 16, MAX ], height = (int) [ 16, MAX ]," - "interlace-mode = (string) progressive" ";" - GST_VIDEO_CAPS_MAKE_WITH_FEATURES (GST_CAPS_FEATURE_MEMORY_DMABUF, - "{ NV12 }"))); + "interlace-mode = (string) progressive" ";" DMABUF_CAPS_STR) + ); #define PROP_HARDWARE_DEFAULT TRUE #define PROP_ASYNC_DEPTH_DEFAULT 4 diff --git a/sys/msdk/gstmsdkvpp.c b/sys/msdk/gstmsdkvpp.c index 895141d0d5..e3417a01cc 100644 --- a/sys/msdk/gstmsdkvpp.c +++ b/sys/msdk/gstmsdkvpp.c @@ -69,23 +69,36 @@ GST_DEBUG_CATEGORY_EXTERN (gst_msdkvpp_debug); "{ NV12, BGRA, YUY2, UYVY, VUYA, P010_10LE}" #endif +#ifndef _WIN32 +#define DMABUF_SINK_CAPS_STR \ + GST_VIDEO_CAPS_MAKE_WITH_FEATURES (GST_CAPS_FEATURE_MEMORY_DMABUF, \ + SUPPORTED_DMABUF_FORMAT) +#else +#define DMABUF_SINK_CAPS_STR "" +#endif + +#ifndef _WIN32 +#define DMABUF_SRC_CAPS_STR \ + GST_VIDEO_CAPS_MAKE_WITH_FEATURES (GST_CAPS_FEATURE_MEMORY_DMABUF, \ + "{ BGRA, YUY2, UYVY, NV12, VUYA, BGRx, P010_10LE" EXT_FORMATS "}") ";" +#else +#define DMABUF_SRC_CAPS_STR "" +#endif + + static GstStaticPadTemplate gst_msdkvpp_sink_factory = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (SUPPORTED_SYSTEM_FORMAT) ", " "interlace-mode = (string){ progressive, interleaved, mixed }" ";" - GST_VIDEO_CAPS_MAKE_WITH_FEATURES (GST_CAPS_FEATURE_MEMORY_DMABUF, - SUPPORTED_DMABUF_FORMAT))); + DMABUF_SINK_CAPS_STR)); static GstStaticPadTemplate gst_msdkvpp_src_factory = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, 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" EXT_FORMATS "}") - ";" + GST_STATIC_CAPS (DMABUF_SRC_CAPS_STR GST_VIDEO_CAPS_MAKE ("{ BGRA, NV12, YUY2, UYVY, VUYA, BGRx, P010_10LE" EXT_FORMATS "}") ", " "interlace-mode = (string){ progressive, interleaved, mixed }" ";"));