From c62deb6fe94cf106a9f6ba4c8e0a636ae92d8a3b Mon Sep 17 00:00:00 2001 From: Tong Wu Date: Fri, 19 Aug 2022 13:40:05 +0800 Subject: [PATCH] msdkenc: add D3D11 caps for msdkenc This patch adds D3D11 feature to sink factory for msdkenc. Part-of: --- subprojects/gst-plugins-bad/sys/msdk/gstmsdkenc.c | 3 ++- subprojects/gst-plugins-bad/sys/msdk/gstmsdkh265enc.c | 3 ++- subprojects/gst-plugins-bad/sys/msdk/gstmsdkvp9enc.c | 3 ++- subprojects/gst-plugins-bad/sys/msdk/msdk.h | 12 ++++++++---- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkenc.c b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkenc.c index 0c9c74f..e48e32b 100644 --- a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkenc.c +++ b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkenc.c @@ -83,7 +83,8 @@ 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")) + ("{ NV12, I420, YV12, YUY2, UYVY, BGRA }", "NV12") "; " + GST_MSDK_CAPS_MAKE_WITH_D3D11_FEATURE ("NV12")) ); #else static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink", diff --git a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkh265enc.c b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkh265enc.c index 33dfcfe..0a27e6d 100644 --- a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkh265enc.c +++ b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkh265enc.c @@ -141,7 +141,8 @@ 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 }"))); + "{ NV12, P010_10LE }") "; " + GST_MSDK_CAPS_MAKE_WITH_D3D11_FEATURE ("{ NV12, P010_10LE }"))); #else static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, diff --git a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkvp9enc.c b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkvp9enc.c index da35769..c2c0d00 100644 --- a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkvp9enc.c +++ b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkvp9enc.c @@ -72,7 +72,8 @@ 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 }"))); + "{ NV12, P010_10LE }") "; " + GST_MSDK_CAPS_MAKE_WITH_D3D11_FEATURE ("{ NV12, P010_10LE }"))); #else static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, diff --git a/subprojects/gst-plugins-bad/sys/msdk/msdk.h b/subprojects/gst-plugins-bad/sys/msdk/msdk.h index 2b197cc..9356330 100644 --- a/subprojects/gst-plugins-bad/sys/msdk/msdk.h +++ b/subprojects/gst-plugins-bad/sys/msdk/msdk.h @@ -78,14 +78,18 @@ G_BEGIN_DECLS #define GST_MSDK_CAPS_MAKE_WITH_VA_FEATURE(vaformat) \ GST_VIDEO_CAPS_MAKE_WITH_FEATURES("memory:VAMemory", vaformat) ", " \ "interlace-mode = (string) progressive" -#else -#define GST_MSDK_CAPS_MAKE_WITH_DMABUF_FEATURE(dmaformat) "" -#define GST_MSDK_CAPS_MAKE_WITH_VA_FEATURE(vaformat) "" -#endif #define GST_MSDK_CAPS_STR(format,dmaformat) \ GST_MSDK_CAPS_MAKE (format) "; " \ GST_MSDK_CAPS_MAKE_WITH_DMABUF_FEATURE (dmaformat) +#else +#define GST_MSDK_CAPS_MAKE_WITH_D3D11_FEATURE(d3d11format) \ + GST_VIDEO_CAPS_MAKE_WITH_FEATURES("memory:D3D11Memory", d3d11format) ", " \ + "interlace-mode = (string) progressive" + +#define GST_MSDK_CAPS_STR(format,dmaformat) \ + GST_MSDK_CAPS_MAKE (format) +#endif #if (MFX_VERSION < 2000) typedef void * mfxLoader; -- 2.7.4