mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
msdk: Remove all DMABuf caps features on Windows
Add new macro for sink/src pad template to ensure no DMABuf caps
features are exposed on Windows. Some DMABuf caps features
were not handled by the commit 9ec62418c3
This commit is contained in:
parent
eb3a117548
commit
54c5ebbd53
8 changed files with 33 additions and 59 deletions
|
@ -44,21 +44,10 @@
|
|||
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,
|
||||
GST_STATIC_CAPS ("video/x-raw, "
|
||||
"format = (string) { NV12 }, "
|
||||
"framerate = (fraction) [0, MAX], "
|
||||
"width = (int) [ 1, MAX ], height = (int) [ 1, MAX ],"
|
||||
"interlace-mode = (string) progressive;" DMABUF_CAPS_STR)
|
||||
GST_STATIC_CAPS (GST_MSDK_CAPS_STR ("NV12", "NV12"))
|
||||
);
|
||||
|
||||
#define PROP_HARDWARE_DEFAULT TRUE
|
||||
|
|
|
@ -76,21 +76,11 @@ 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,
|
||||
GST_STATIC_CAPS ("video/x-raw, "
|
||||
"format = (string) { NV12, I420, YV12, YUY2, UYVY, BGRA }, "
|
||||
"framerate = (fraction) [0, MAX], "
|
||||
"width = (int) [ 16, MAX ], height = (int) [ 16, MAX ],"
|
||||
"interlace-mode = (string) progressive" ";" DMABUF_CAPS_STR)
|
||||
GST_STATIC_CAPS (GST_MSDK_CAPS_STR
|
||||
("{ NV12, I420, YV12, YUY2, UYVY, BGRA }", "NV12"))
|
||||
);
|
||||
|
||||
#define PROP_HARDWARE_DEFAULT TRUE
|
||||
|
|
|
@ -41,6 +41,8 @@
|
|||
GST_DEBUG_CATEGORY_EXTERN (gst_msdkh265dec_debug);
|
||||
#define GST_CAT_DEFAULT gst_msdkh265dec_debug
|
||||
|
||||
#define COMMON_FORMAT "{ NV12, P010_10LE, YUY2, Y210, VUYA, Y410 }"
|
||||
|
||||
/* TODO: update both sink and src dynamically */
|
||||
static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
|
||||
GST_PAD_SINK,
|
||||
|
@ -53,13 +55,7 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
|
|||
static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
|
||||
GST_PAD_SRC,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS ("video/x-raw, "
|
||||
"format = (string) { NV12, P010_10LE, YUY2, Y210, VUYA, Y410 }, "
|
||||
"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, P010_10LE, YUY2, Y210, VUYA, Y410 }") ";")
|
||||
GST_STATIC_CAPS (GST_MSDK_CAPS_STR (COMMON_FORMAT, COMMON_FORMAT))
|
||||
);
|
||||
|
||||
#define gst_msdkh265dec_parent_class parent_class
|
||||
|
|
|
@ -49,16 +49,12 @@ enum
|
|||
|
||||
#define PROP_LOWPOWER_DEFAULT FALSE
|
||||
|
||||
#define COMMON_FORMAT "{ NV12, I420, YV12, YUY2, UYVY, BGRA, P010_10LE }"
|
||||
|
||||
static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
|
||||
GST_PAD_SINK,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS ("video/x-raw, "
|
||||
"format = (string) { NV12, I420, YV12, YUY2, UYVY, BGRA, P010_10LE }, "
|
||||
"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 }")));
|
||||
GST_STATIC_CAPS (GST_MSDK_CAPS_STR (COMMON_FORMAT, "NV12")));
|
||||
|
||||
static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
|
||||
GST_PAD_SRC,
|
||||
|
|
|
@ -54,13 +54,7 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
|
|||
static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
|
||||
GST_PAD_SRC,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS ("video/x-raw, "
|
||||
"format = (string) { NV12, YUY2 }, "
|
||||
"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, YUY2 }") ";")
|
||||
GST_STATIC_CAPS (GST_MSDK_CAPS_STR ("{ NV12, YUY2 }", "{ NV12, YUY2 }"))
|
||||
);
|
||||
|
||||
#define gst_msdkmjpegdec_parent_class parent_class
|
||||
|
|
|
@ -44,6 +44,8 @@
|
|||
GST_DEBUG_CATEGORY_EXTERN (gst_msdkvp9dec_debug);
|
||||
#define GST_CAT_DEFAULT gst_msdkvp9dec_debug
|
||||
|
||||
#define COMMON_FORMAT "{ NV12, P010_10LE, VUYA, Y410 }"
|
||||
|
||||
static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
|
||||
GST_PAD_SINK,
|
||||
GST_PAD_ALWAYS,
|
||||
|
@ -53,13 +55,7 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
|
|||
static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
|
||||
GST_PAD_SRC,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS ("video/x-raw, "
|
||||
"format = (string) { NV12, P010_10LE, VUYA, Y410 }, "
|
||||
"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, P010_10LE, VUYA, Y410 }") ";")
|
||||
GST_STATIC_CAPS (GST_MSDK_CAPS_STR (COMMON_FORMAT, COMMON_FORMAT))
|
||||
);
|
||||
|
||||
#define gst_msdkvp9dec_parent_class parent_class
|
||||
|
|
|
@ -42,16 +42,12 @@
|
|||
GST_DEBUG_CATEGORY_EXTERN (gst_msdkvp9enc_debug);
|
||||
#define GST_CAT_DEFAULT gst_msdkvp9enc_debug
|
||||
|
||||
#define COMMON_FORMAT "{ NV12, I420, YV12, YUY2, UYVY, BGRA, P010_10LE }"
|
||||
|
||||
static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
|
||||
GST_PAD_SINK,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS ("video/x-raw, "
|
||||
"format = (string) { NV12, I420, YV12, YUY2, UYVY, BGRA, P010_10LE }, "
|
||||
"framerate = (fraction) [0/1, 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 }")));
|
||||
GST_STATIC_CAPS (GST_MSDK_CAPS_STR (COMMON_FORMAT, "NV12")));
|
||||
|
||||
static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
|
||||
GST_PAD_SRC,
|
||||
|
|
|
@ -40,11 +40,28 @@
|
|||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/video/video.h>
|
||||
#include <gst/allocators/allocators.h>
|
||||
|
||||
#include <mfxvideo.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_MSDK_CAPS_MAKE(format) \
|
||||
GST_VIDEO_CAPS_MAKE (format) ", " \
|
||||
"interlace-mode = (string) progressive"
|
||||
|
||||
#ifndef _WIN32
|
||||
#define GST_MSDK_CAPS_MAKE_WITH_DMABUF_FEATURE(dmaformat) \
|
||||
GST_VIDEO_CAPS_MAKE_WITH_FEATURES(GST_CAPS_FEATURE_MEMORY_DMABUF, dmaformat) ", " \
|
||||
"interlace-mode = (string) progressive"
|
||||
#else
|
||||
#define GST_MSDK_CAPS_MAKE_WITH_DMABUF_FEATURE(dmaformat) ""
|
||||
#endif
|
||||
|
||||
#define GST_MSDK_CAPS_STR(format,dmaformat) \
|
||||
GST_MSDK_CAPS_MAKE (format) "; " \
|
||||
GST_MSDK_CAPS_MAKE_WITH_DMABUF_FEATURE (dmaformat)
|
||||
|
||||
mfxSession msdk_open_session (mfxIMPL impl);
|
||||
void msdk_close_session (mfxSession session);
|
||||
|
||||
|
|
Loading…
Reference in a new issue