mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
nvcodec: Specify documentation caps
... since produced caps will be different depending on OS and GPU model. Also adding Y444_16LE format to decoder's GL template caps Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8325>
This commit is contained in:
parent
06afe8aa8f
commit
1f481fe1d5
9 changed files with 295 additions and 50 deletions
|
@ -44,6 +44,26 @@
|
||||||
GST_DEBUG_CATEGORY_STATIC (gst_nv_av1_dec_debug);
|
GST_DEBUG_CATEGORY_STATIC (gst_nv_av1_dec_debug);
|
||||||
#define GST_CAT_DEFAULT gst_nv_av1_dec_debug
|
#define GST_CAT_DEFAULT gst_nv_av1_dec_debug
|
||||||
|
|
||||||
|
#define DOC_SINK_CAPS \
|
||||||
|
"video/x-av1, width = (int) [ 128, 8192 ], height = (int) [ 128, 8192 ], " \
|
||||||
|
"alignment= (string) frame, " \
|
||||||
|
"profile = (string) main"
|
||||||
|
|
||||||
|
#define DOC_SRC_CAPS_COMM \
|
||||||
|
"format = (string) { NV12, P010_10LE }, " \
|
||||||
|
"width = (int) [ 128, 8192 ], height = (int) [ 128, 8192 ]"
|
||||||
|
|
||||||
|
#define DOC_SRC_CAPS_D3D11 \
|
||||||
|
"format = (string) { I420, I420_10LE }, " \
|
||||||
|
"width = (int) [ 128, 8192 ], height = (int) [ 128, 8192 ]"
|
||||||
|
|
||||||
|
#define DOC_SRC_CAPS \
|
||||||
|
"video/x-raw(memory:CUDAMemory), " DOC_SRC_CAPS_COMM "; " \
|
||||||
|
"video/x-raw(memory:D3D12Memory), " DOC_SRC_CAPS_COMM "; " \
|
||||||
|
"video/x-raw(memory:D3D11Memory), " DOC_SRC_CAPS_D3D11 "; " \
|
||||||
|
"video/x-raw(memory:GLMemory), " DOC_SRC_CAPS_COMM "; " \
|
||||||
|
"video/x-raw, " DOC_SRC_CAPS_COMM
|
||||||
|
|
||||||
typedef struct _GstNvAV1Dec
|
typedef struct _GstNvAV1Dec
|
||||||
{
|
{
|
||||||
GstAV1Decoder parent;
|
GstAV1Decoder parent;
|
||||||
|
@ -229,12 +249,19 @@ gst_nv_av1_dec_class_init (GstNvAV1DecClass * klass,
|
||||||
"Codec/Decoder/Video/Hardware",
|
"Codec/Decoder/Video/Hardware",
|
||||||
"NVIDIA AV1 video decoder", "Seungha Yang <seungha@centricular.com>");
|
"NVIDIA AV1 video decoder", "Seungha Yang <seungha@centricular.com>");
|
||||||
|
|
||||||
gst_element_class_add_pad_template (element_class,
|
auto pad_templ = gst_pad_template_new ("sink",
|
||||||
gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
|
GST_PAD_SINK, GST_PAD_ALWAYS, cdata->sink_caps);
|
||||||
cdata->sink_caps));
|
auto doc_caps = gst_caps_from_string (DOC_SINK_CAPS);
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_pad_template_set_documentation_caps (pad_templ, doc_caps);
|
||||||
gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
|
gst_caps_unref (doc_caps);
|
||||||
cdata->src_caps));
|
gst_element_class_add_pad_template (element_class, pad_templ);
|
||||||
|
|
||||||
|
pad_templ = gst_pad_template_new ("src",
|
||||||
|
GST_PAD_SRC, GST_PAD_ALWAYS, cdata->src_caps);
|
||||||
|
doc_caps = gst_caps_from_string (DOC_SRC_CAPS);
|
||||||
|
gst_pad_template_set_documentation_caps (pad_templ, doc_caps);
|
||||||
|
gst_caps_unref (doc_caps);
|
||||||
|
gst_element_class_add_pad_template (element_class, pad_templ);
|
||||||
|
|
||||||
decoder_class->open = GST_DEBUG_FUNCPTR (gst_nv_av1_dec_open);
|
decoder_class->open = GST_DEBUG_FUNCPTR (gst_nv_av1_dec_open);
|
||||||
decoder_class->close = GST_DEBUG_FUNCPTR (gst_nv_av1_dec_close);
|
decoder_class->close = GST_DEBUG_FUNCPTR (gst_nv_av1_dec_close);
|
||||||
|
|
|
@ -30,6 +30,30 @@
|
||||||
GST_DEBUG_CATEGORY_STATIC (gst_nv_av1_encoder_debug);
|
GST_DEBUG_CATEGORY_STATIC (gst_nv_av1_encoder_debug);
|
||||||
#define GST_CAT_DEFAULT gst_nv_av1_encoder_debug
|
#define GST_CAT_DEFAULT gst_nv_av1_encoder_debug
|
||||||
|
|
||||||
|
#define DOC_SINK_CAPS_COMM \
|
||||||
|
"format = (string) { NV12, P010_10LE, VUYA, RGBA, RGBx, BGRA, BGRx, RGB10A2_LE }, " \
|
||||||
|
"width = (int) [ 192, 8192 ], height = (int) [ 128, 8192 ]"
|
||||||
|
|
||||||
|
#define DOC_SINK_CAPS \
|
||||||
|
"video/x-raw(memory:CUDAMemory), " DOC_SINK_CAPS_COMM "; " \
|
||||||
|
"video/x-raw(memory:D3D12Memory), " DOC_SINK_CAPS_COMM "; " \
|
||||||
|
"video/x-raw(memory:GLMemory), " DOC_SINK_CAPS_COMM "; " \
|
||||||
|
"video/x-raw, " DOC_SINK_CAPS_COMM
|
||||||
|
|
||||||
|
#define DOC_SINK_CAPS_D3D11 \
|
||||||
|
"video/x-raw(memory:D3D11Memory), " DOC_SINK_CAPS_COMM "; " \
|
||||||
|
"video/x-raw, " DOC_SINK_CAPS_COMM
|
||||||
|
|
||||||
|
#define DOC_SINK_CAPS_AUTOGPU \
|
||||||
|
"video/x-raw(memory:CUDAMemory), " DOC_SINK_CAPS_COMM "; " \
|
||||||
|
"video/x-raw(memory:D3D11Memory), " DOC_SINK_CAPS_COMM "; " \
|
||||||
|
"video/x-raw(memory:GLMemory), " DOC_SINK_CAPS_COMM "; " \
|
||||||
|
"video/x-raw, " DOC_SINK_CAPS_COMM
|
||||||
|
|
||||||
|
#define DOC_SRC_CAPS \
|
||||||
|
"video/x-av1, width = (int) [ 192, 8192 ], height = (int) [ 128, 8192 ], " \
|
||||||
|
"profile = (string) main, alignment = (string) tu, stream-format = (string) obu-stream"
|
||||||
|
|
||||||
static GTypeClass *parent_class = nullptr;
|
static GTypeClass *parent_class = nullptr;
|
||||||
|
|
||||||
enum
|
enum
|
||||||
|
@ -383,6 +407,9 @@ gst_nv_av1_encoder_class_init (GstNvAv1EncoderClass * klass, gpointer data)
|
||||||
"Target Constant Quality level for VBR mode (0 = automatic)",
|
"Target Constant Quality level for VBR mode (0 = automatic)",
|
||||||
0, 51, DEFAULT_CONST_QUALITY, param_flags));
|
0, 51, DEFAULT_CONST_QUALITY, param_flags));
|
||||||
|
|
||||||
|
GstPadTemplate *pad_templ = gst_pad_template_new ("sink",
|
||||||
|
GST_PAD_SINK, GST_PAD_ALWAYS, cdata->sink_caps);
|
||||||
|
GstCaps *doc_caps = nullptr;
|
||||||
switch (cdata->device_mode) {
|
switch (cdata->device_mode) {
|
||||||
case GST_NV_ENCODER_DEVICE_CUDA:
|
case GST_NV_ENCODER_DEVICE_CUDA:
|
||||||
gst_element_class_set_static_metadata (element_class,
|
gst_element_class_set_static_metadata (element_class,
|
||||||
|
@ -390,6 +417,7 @@ gst_nv_av1_encoder_class_init (GstNvAv1EncoderClass * klass, gpointer data)
|
||||||
"Codec/Encoder/Video/Hardware",
|
"Codec/Encoder/Video/Hardware",
|
||||||
"Encode AV1 video streams using NVCODEC API CUDA Mode",
|
"Encode AV1 video streams using NVCODEC API CUDA Mode",
|
||||||
"Seungha Yang <seungha@centricular.com>");
|
"Seungha Yang <seungha@centricular.com>");
|
||||||
|
doc_caps = gst_caps_from_string (DOC_SINK_CAPS);
|
||||||
break;
|
break;
|
||||||
case GST_NV_ENCODER_DEVICE_D3D11:
|
case GST_NV_ENCODER_DEVICE_D3D11:
|
||||||
gst_element_class_set_static_metadata (element_class,
|
gst_element_class_set_static_metadata (element_class,
|
||||||
|
@ -397,6 +425,7 @@ gst_nv_av1_encoder_class_init (GstNvAv1EncoderClass * klass, gpointer data)
|
||||||
"Codec/Encoder/Video/Hardware",
|
"Codec/Encoder/Video/Hardware",
|
||||||
"Encode AV1 video streams using NVCODEC API Direct3D11 Mode",
|
"Encode AV1 video streams using NVCODEC API Direct3D11 Mode",
|
||||||
"Seungha Yang <seungha@centricular.com>");
|
"Seungha Yang <seungha@centricular.com>");
|
||||||
|
doc_caps = gst_caps_from_string (DOC_SINK_CAPS_D3D11);
|
||||||
break;
|
break;
|
||||||
case GST_NV_ENCODER_DEVICE_AUTO_SELECT:
|
case GST_NV_ENCODER_DEVICE_AUTO_SELECT:
|
||||||
gst_element_class_set_static_metadata (element_class,
|
gst_element_class_set_static_metadata (element_class,
|
||||||
|
@ -404,18 +433,23 @@ gst_nv_av1_encoder_class_init (GstNvAv1EncoderClass * klass, gpointer data)
|
||||||
"Codec/Encoder/Video/Hardware",
|
"Codec/Encoder/Video/Hardware",
|
||||||
"Encode AV1 video streams using NVCODEC API auto GPU select Mode",
|
"Encode AV1 video streams using NVCODEC API auto GPU select Mode",
|
||||||
"Seungha Yang <seungha@centricular.com>");
|
"Seungha Yang <seungha@centricular.com>");
|
||||||
|
doc_caps = gst_caps_from_string (DOC_SINK_CAPS_AUTOGPU);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_pad_template_set_documentation_caps (pad_templ, doc_caps);
|
||||||
gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
|
gst_caps_unref (doc_caps);
|
||||||
cdata->sink_caps));
|
gst_element_class_add_pad_template (element_class, pad_templ);
|
||||||
gst_element_class_add_pad_template (element_class,
|
|
||||||
gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
|
pad_templ = gst_pad_template_new ("src",
|
||||||
cdata->src_caps));
|
GST_PAD_SRC, GST_PAD_ALWAYS, cdata->src_caps);
|
||||||
|
doc_caps = gst_caps_from_string (DOC_SRC_CAPS);
|
||||||
|
gst_pad_template_set_documentation_caps (pad_templ, doc_caps);
|
||||||
|
gst_caps_unref (doc_caps);
|
||||||
|
gst_element_class_add_pad_template (element_class, pad_templ);
|
||||||
|
|
||||||
nvenc_class->set_format = GST_DEBUG_FUNCPTR (gst_nv_av1_encoder_set_format);
|
nvenc_class->set_format = GST_DEBUG_FUNCPTR (gst_nv_av1_encoder_set_format);
|
||||||
nvenc_class->set_output_state =
|
nvenc_class->set_output_state =
|
||||||
|
|
|
@ -1547,6 +1547,7 @@ gst_nv_decoder_check_device_caps (GstCudaContext * context,
|
||||||
APPEND_STRING (format_str, formats, "P010_10LE");
|
APPEND_STRING (format_str, formats, "P010_10LE");
|
||||||
APPEND_STRING (format_str, formats, "P012_LE");
|
APPEND_STRING (format_str, formats, "P012_LE");
|
||||||
APPEND_STRING (format_str, formats, "Y444");
|
APPEND_STRING (format_str, formats, "Y444");
|
||||||
|
APPEND_STRING (format_str, formats, "Y444_16LE");
|
||||||
APPEND_STRING (format_str, formats, "GBR");
|
APPEND_STRING (format_str, formats, "GBR");
|
||||||
format_str += " }";
|
format_str += " }";
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,6 +97,27 @@
|
||||||
GST_DEBUG_CATEGORY_STATIC (gst_nv_h264_dec_debug);
|
GST_DEBUG_CATEGORY_STATIC (gst_nv_h264_dec_debug);
|
||||||
#define GST_CAT_DEFAULT gst_nv_h264_dec_debug
|
#define GST_CAT_DEFAULT gst_nv_h264_dec_debug
|
||||||
|
|
||||||
|
#define DOC_SINK_CAPS \
|
||||||
|
"video/x-h264, width = (int) [ 48, 4096 ], height = (int) [ 16, 4096 ], " \
|
||||||
|
"stream-format= (string) { avc, avc3, byte-stream }, " \
|
||||||
|
"alignment= (string) au, " \
|
||||||
|
"profile = (string) { high, main, constrained-high, constrained-baseline, baseline, progressive-high }"
|
||||||
|
|
||||||
|
#define DOC_SRC_CAPS_COMM \
|
||||||
|
"format = (string) NV12, " \
|
||||||
|
"width = (int) [ 48, 4096 ], height = (int) [ 16, 4096 ]"
|
||||||
|
|
||||||
|
#define DOC_SRC_CAPS_D3D11 \
|
||||||
|
"format = (string) NV12, " \
|
||||||
|
"width = (int) [ 48, 4096 ], height = (int) [ 16, 4096 ]"
|
||||||
|
|
||||||
|
#define DOC_SRC_CAPS \
|
||||||
|
"video/x-raw(memory:CUDAMemory), " DOC_SRC_CAPS_COMM "; " \
|
||||||
|
"video/x-raw(memory:D3D12Memory), " DOC_SRC_CAPS_COMM "; " \
|
||||||
|
"video/x-raw(memory:D3D11Memory), " DOC_SRC_CAPS_D3D11 "; " \
|
||||||
|
"video/x-raw(memory:GLMemory), " DOC_SRC_CAPS_COMM "; " \
|
||||||
|
"video/x-raw, " DOC_SRC_CAPS_COMM
|
||||||
|
|
||||||
typedef struct _GstNvH264Dec
|
typedef struct _GstNvH264Dec
|
||||||
{
|
{
|
||||||
GstH264Decoder parent;
|
GstH264Decoder parent;
|
||||||
|
@ -297,12 +318,19 @@ gst_nv_h264_dec_class_init (GstNvH264DecClass * klass,
|
||||||
"Codec/Decoder/Video/Hardware",
|
"Codec/Decoder/Video/Hardware",
|
||||||
"NVIDIA H.264 video decoder", "Seungha Yang <seungha@centricular.com>");
|
"NVIDIA H.264 video decoder", "Seungha Yang <seungha@centricular.com>");
|
||||||
|
|
||||||
gst_element_class_add_pad_template (element_class,
|
auto pad_templ = gst_pad_template_new ("sink",
|
||||||
gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
|
GST_PAD_SINK, GST_PAD_ALWAYS, cdata->sink_caps);
|
||||||
cdata->sink_caps));
|
auto doc_caps = gst_caps_from_string (DOC_SINK_CAPS);
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_pad_template_set_documentation_caps (pad_templ, doc_caps);
|
||||||
gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
|
gst_caps_unref (doc_caps);
|
||||||
cdata->src_caps));
|
gst_element_class_add_pad_template (element_class, pad_templ);
|
||||||
|
|
||||||
|
pad_templ = gst_pad_template_new ("src",
|
||||||
|
GST_PAD_SRC, GST_PAD_ALWAYS, cdata->src_caps);
|
||||||
|
doc_caps = gst_caps_from_string (DOC_SRC_CAPS);
|
||||||
|
gst_pad_template_set_documentation_caps (pad_templ, doc_caps);
|
||||||
|
gst_caps_unref (doc_caps);
|
||||||
|
gst_element_class_add_pad_template (element_class, pad_templ);
|
||||||
|
|
||||||
decoder_class->open = GST_DEBUG_FUNCPTR (gst_nv_h264_dec_open);
|
decoder_class->open = GST_DEBUG_FUNCPTR (gst_nv_h264_dec_open);
|
||||||
decoder_class->close = GST_DEBUG_FUNCPTR (gst_nv_h264_dec_close);
|
decoder_class->close = GST_DEBUG_FUNCPTR (gst_nv_h264_dec_close);
|
||||||
|
@ -1075,8 +1103,7 @@ gst_nv_h264_dec_register (GstPlugin * plugin, guint device_id,
|
||||||
cdata->sink_caps = gst_caps_from_string ("video/x-h264, "
|
cdata->sink_caps = gst_caps_from_string ("video/x-h264, "
|
||||||
"stream-format= (string) { avc, avc3, byte-stream }, "
|
"stream-format= (string) { avc, avc3, byte-stream }, "
|
||||||
"alignment= (string) au, "
|
"alignment= (string) au, "
|
||||||
"profile = (string) { high, main, constrained-high, constrained-baseline, baseline, progressive-high }, "
|
"profile = (string) { high, main, constrained-high, constrained-baseline, baseline, progressive-high }");
|
||||||
"framerate = " GST_VIDEO_FPS_RANGE);
|
|
||||||
|
|
||||||
s = gst_caps_get_structure (sink_caps, 0);
|
s = gst_caps_get_structure (sink_caps, 0);
|
||||||
value = gst_structure_get_value (s, "width");
|
value = gst_structure_get_value (s, "width");
|
||||||
|
|
|
@ -48,6 +48,32 @@
|
||||||
GST_DEBUG_CATEGORY_STATIC (gst_nv_h264_encoder_debug);
|
GST_DEBUG_CATEGORY_STATIC (gst_nv_h264_encoder_debug);
|
||||||
#define GST_CAT_DEFAULT gst_nv_h264_encoder_debug
|
#define GST_CAT_DEFAULT gst_nv_h264_encoder_debug
|
||||||
|
|
||||||
|
#define DOC_SINK_CAPS_COMM \
|
||||||
|
"format = (string) { NV12, Y444, VUYA, RGBA, RGBx, BGRA, BGRx }, " \
|
||||||
|
"width = (int) [ 160, 4096 ], height = (int) [ 64, 4096 ], " \
|
||||||
|
"interlace-mode = (string) progressive"
|
||||||
|
|
||||||
|
#define DOC_SINK_CAPS \
|
||||||
|
"video/x-raw(memory:CUDAMemory), " DOC_SINK_CAPS_COMM "; " \
|
||||||
|
"video/x-raw(memory:D3D12Memory), " DOC_SINK_CAPS_COMM "; " \
|
||||||
|
"video/x-raw(memory:GLMemory), " DOC_SINK_CAPS_COMM "; " \
|
||||||
|
"video/x-raw, " DOC_SINK_CAPS_COMM
|
||||||
|
|
||||||
|
#define DOC_SINK_CAPS_D3D11 \
|
||||||
|
"video/x-raw(memory:D3D11Memory), " DOC_SINK_CAPS_COMM "; " \
|
||||||
|
"video/x-raw, " DOC_SINK_CAPS_COMM
|
||||||
|
|
||||||
|
#define DOC_SINK_CAPS_AUTOGPU \
|
||||||
|
"video/x-raw(memory:CUDAMemory), " DOC_SINK_CAPS_COMM "; " \
|
||||||
|
"video/x-raw(memory:D3D11Memory), " DOC_SINK_CAPS_COMM "; " \
|
||||||
|
"video/x-raw(memory:GLMemory), " DOC_SINK_CAPS_COMM "; " \
|
||||||
|
"video/x-raw, " DOC_SINK_CAPS_COMM
|
||||||
|
|
||||||
|
#define DOC_SRC_CAPS \
|
||||||
|
"video/x-h264, width = (int) [ 160, 4096 ], height = (int) [ 64, 4096 ], " \
|
||||||
|
"profile = (string) { main, high, constrained-baseline, baseline, high-4:4:4 }, " \
|
||||||
|
"stream-format = (string) { byte-stream, avc }, alignment = (string) au"
|
||||||
|
|
||||||
static GTypeClass *parent_class = nullptr;
|
static GTypeClass *parent_class = nullptr;
|
||||||
|
|
||||||
enum
|
enum
|
||||||
|
@ -487,6 +513,9 @@ gst_nv_h264_encoder_class_init (GstNvH264EncoderClass * klass, gpointer data)
|
||||||
"Insert sequence headers (SPS/PPS) per IDR",
|
"Insert sequence headers (SPS/PPS) per IDR",
|
||||||
DEFAULT_REPEAT_SEQUENCE_HEADER, param_flags));
|
DEFAULT_REPEAT_SEQUENCE_HEADER, param_flags));
|
||||||
|
|
||||||
|
GstPadTemplate *pad_templ = gst_pad_template_new ("sink",
|
||||||
|
GST_PAD_SINK, GST_PAD_ALWAYS, cdata->sink_caps);
|
||||||
|
GstCaps *doc_caps = nullptr;
|
||||||
switch (cdata->device_mode) {
|
switch (cdata->device_mode) {
|
||||||
case GST_NV_ENCODER_DEVICE_CUDA:
|
case GST_NV_ENCODER_DEVICE_CUDA:
|
||||||
gst_element_class_set_static_metadata (element_class,
|
gst_element_class_set_static_metadata (element_class,
|
||||||
|
@ -494,6 +523,7 @@ gst_nv_h264_encoder_class_init (GstNvH264EncoderClass * klass, gpointer data)
|
||||||
"Codec/Encoder/Video/Hardware",
|
"Codec/Encoder/Video/Hardware",
|
||||||
"Encode H.264 video streams using NVCODEC API CUDA Mode",
|
"Encode H.264 video streams using NVCODEC API CUDA Mode",
|
||||||
"Seungha Yang <seungha@centricular.com>");
|
"Seungha Yang <seungha@centricular.com>");
|
||||||
|
doc_caps = gst_caps_from_string (DOC_SINK_CAPS);
|
||||||
break;
|
break;
|
||||||
case GST_NV_ENCODER_DEVICE_D3D11:
|
case GST_NV_ENCODER_DEVICE_D3D11:
|
||||||
gst_element_class_set_static_metadata (element_class,
|
gst_element_class_set_static_metadata (element_class,
|
||||||
|
@ -501,6 +531,7 @@ gst_nv_h264_encoder_class_init (GstNvH264EncoderClass * klass, gpointer data)
|
||||||
"Codec/Encoder/Video/Hardware",
|
"Codec/Encoder/Video/Hardware",
|
||||||
"Encode H.264 video streams using NVCODEC API Direct3D11 Mode",
|
"Encode H.264 video streams using NVCODEC API Direct3D11 Mode",
|
||||||
"Seungha Yang <seungha@centricular.com>");
|
"Seungha Yang <seungha@centricular.com>");
|
||||||
|
doc_caps = gst_caps_from_string (DOC_SINK_CAPS_D3D11);
|
||||||
break;
|
break;
|
||||||
case GST_NV_ENCODER_DEVICE_AUTO_SELECT:
|
case GST_NV_ENCODER_DEVICE_AUTO_SELECT:
|
||||||
gst_element_class_set_static_metadata (element_class,
|
gst_element_class_set_static_metadata (element_class,
|
||||||
|
@ -508,18 +539,23 @@ gst_nv_h264_encoder_class_init (GstNvH264EncoderClass * klass, gpointer data)
|
||||||
"Codec/Encoder/Video/Hardware",
|
"Codec/Encoder/Video/Hardware",
|
||||||
"Encode H.264 video streams using NVCODEC API auto GPU select Mode",
|
"Encode H.264 video streams using NVCODEC API auto GPU select Mode",
|
||||||
"Seungha Yang <seungha@centricular.com>");
|
"Seungha Yang <seungha@centricular.com>");
|
||||||
|
doc_caps = gst_caps_from_string (DOC_SINK_CAPS_AUTOGPU);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_pad_template_set_documentation_caps (pad_templ, doc_caps);
|
||||||
gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
|
gst_caps_unref (doc_caps);
|
||||||
cdata->sink_caps));
|
gst_element_class_add_pad_template (element_class, pad_templ);
|
||||||
gst_element_class_add_pad_template (element_class,
|
|
||||||
gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
|
pad_templ = gst_pad_template_new ("src",
|
||||||
cdata->src_caps));
|
GST_PAD_SRC, GST_PAD_ALWAYS, cdata->src_caps);
|
||||||
|
doc_caps = gst_caps_from_string (DOC_SRC_CAPS);
|
||||||
|
gst_pad_template_set_documentation_caps (pad_templ, doc_caps);
|
||||||
|
gst_caps_unref (doc_caps);
|
||||||
|
gst_element_class_add_pad_template (element_class, pad_templ);
|
||||||
|
|
||||||
videoenc_class->getcaps = GST_DEBUG_FUNCPTR (gst_nv_h264_encoder_getcaps);
|
videoenc_class->getcaps = GST_DEBUG_FUNCPTR (gst_nv_h264_encoder_getcaps);
|
||||||
videoenc_class->stop = GST_DEBUG_FUNCPTR (gst_nv_h264_encoder_stop);
|
videoenc_class->stop = GST_DEBUG_FUNCPTR (gst_nv_h264_encoder_stop);
|
||||||
|
|
|
@ -98,6 +98,31 @@
|
||||||
GST_DEBUG_CATEGORY_STATIC (gst_nv_h265_dec_debug);
|
GST_DEBUG_CATEGORY_STATIC (gst_nv_h265_dec_debug);
|
||||||
#define GST_CAT_DEFAULT gst_nv_h265_dec_debug
|
#define GST_CAT_DEFAULT gst_nv_h265_dec_debug
|
||||||
|
|
||||||
|
#define DOC_SINK_CAPS \
|
||||||
|
"video/x-h265, width = (int) [ 144, 8192 ], height = (int) [ 144, 8192 ], " \
|
||||||
|
"stream-format= (string) { hev1, hvc1, byte-stream }, " \
|
||||||
|
"alignment= (string) au, " \
|
||||||
|
"profile = (string) { main, main-10, main-12, main-444, main-444-10, main-444-12 }"
|
||||||
|
|
||||||
|
#define DOC_SRC_CAPS_COMM \
|
||||||
|
"format = (string) { NV12, P010_10LE, P012_LE, Y444, Y444_16LE, GBR, GBR_16LE }, " \
|
||||||
|
"width = (int) [ 144, 8192 ], height = (int) [ 144, 8192 ]"
|
||||||
|
|
||||||
|
#define DOC_SRC_CAPS_D3D11 \
|
||||||
|
"format = (string) { I420, I420_10LE, I420_12LE, Y444, Y444_16LE, GBR, GBR_16LE }, " \
|
||||||
|
"width = (int) [ 144, 8192 ], height = (int) [ 144, 8192 ]"
|
||||||
|
|
||||||
|
#define DOC_SRC_CAPS_GL \
|
||||||
|
"format = (string) { I420, I420_10LE, I420_12LE, Y444, Y444_16LE, GBR }, " \
|
||||||
|
"width = (int) [ 144, 8192 ], height = (int) [ 144, 8192 ]"
|
||||||
|
|
||||||
|
#define DOC_SRC_CAPS \
|
||||||
|
"video/x-raw(memory:CUDAMemory), " DOC_SRC_CAPS_COMM "; " \
|
||||||
|
"video/x-raw(memory:D3D12Memory), " DOC_SRC_CAPS_COMM "; " \
|
||||||
|
"video/x-raw(memory:D3D11Memory), " DOC_SRC_CAPS_D3D11 "; " \
|
||||||
|
"video/x-raw(memory:GLMemory), " DOC_SRC_CAPS_GL "; " \
|
||||||
|
"video/x-raw, " DOC_SRC_CAPS_COMM
|
||||||
|
|
||||||
typedef struct _GstNvH265Dec
|
typedef struct _GstNvH265Dec
|
||||||
{
|
{
|
||||||
GstH265Decoder parent;
|
GstH265Decoder parent;
|
||||||
|
@ -293,12 +318,19 @@ gst_nv_h265_dec_class_init (GstNvH265DecClass * klass,
|
||||||
"Codec/Decoder/Video/Hardware",
|
"Codec/Decoder/Video/Hardware",
|
||||||
"NVIDIA H.265 video decoder", "Seungha Yang <seungha@centricular.com>");
|
"NVIDIA H.265 video decoder", "Seungha Yang <seungha@centricular.com>");
|
||||||
|
|
||||||
gst_element_class_add_pad_template (element_class,
|
auto pad_templ = gst_pad_template_new ("sink",
|
||||||
gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
|
GST_PAD_SINK, GST_PAD_ALWAYS, cdata->sink_caps);
|
||||||
cdata->sink_caps));
|
auto doc_caps = gst_caps_from_string (DOC_SINK_CAPS);
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_pad_template_set_documentation_caps (pad_templ, doc_caps);
|
||||||
gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
|
gst_caps_unref (doc_caps);
|
||||||
cdata->src_caps));
|
gst_element_class_add_pad_template (element_class, pad_templ);
|
||||||
|
|
||||||
|
pad_templ = gst_pad_template_new ("src",
|
||||||
|
GST_PAD_SRC, GST_PAD_ALWAYS, cdata->src_caps);
|
||||||
|
doc_caps = gst_caps_from_string (DOC_SRC_CAPS);
|
||||||
|
gst_pad_template_set_documentation_caps (pad_templ, doc_caps);
|
||||||
|
gst_caps_unref (doc_caps);
|
||||||
|
gst_element_class_add_pad_template (element_class, pad_templ);
|
||||||
|
|
||||||
decoder_class->open = GST_DEBUG_FUNCPTR (gst_nv_h265_dec_open);
|
decoder_class->open = GST_DEBUG_FUNCPTR (gst_nv_h265_dec_open);
|
||||||
decoder_class->close = GST_DEBUG_FUNCPTR (gst_nv_h265_dec_close);
|
decoder_class->close = GST_DEBUG_FUNCPTR (gst_nv_h265_dec_close);
|
||||||
|
|
|
@ -48,6 +48,32 @@
|
||||||
GST_DEBUG_CATEGORY_STATIC (gst_nv_h265_encoder_debug);
|
GST_DEBUG_CATEGORY_STATIC (gst_nv_h265_encoder_debug);
|
||||||
#define GST_CAT_DEFAULT gst_nv_h265_encoder_debug
|
#define GST_CAT_DEFAULT gst_nv_h265_encoder_debug
|
||||||
|
|
||||||
|
#define DOC_SINK_CAPS_COMM \
|
||||||
|
"format = (string) { NV12, P010_10LE, Y444, Y444_16LE, GBR, GBR_16LE, VUYA, RGBA, RGBx, BGRA, BGRx, RGB10A2_LE }, " \
|
||||||
|
"width = (int) [ 144, 8192 ], height = (int) [ 48, 8192 ], " \
|
||||||
|
"interlace-mode = (string) progressive"
|
||||||
|
|
||||||
|
#define DOC_SINK_CAPS \
|
||||||
|
"video/x-raw(memory:CUDAMemory), " DOC_SINK_CAPS_COMM "; " \
|
||||||
|
"video/x-raw(memory:D3D12Memory), " DOC_SINK_CAPS_COMM "; " \
|
||||||
|
"video/x-raw(memory:GLMemory), " DOC_SINK_CAPS_COMM "; " \
|
||||||
|
"video/x-raw, " DOC_SINK_CAPS_COMM
|
||||||
|
|
||||||
|
#define DOC_SINK_CAPS_D3D11 \
|
||||||
|
"video/x-raw(memory:D3D11Memory), " DOC_SINK_CAPS_COMM "; " \
|
||||||
|
"video/x-raw, " DOC_SINK_CAPS_COMM
|
||||||
|
|
||||||
|
#define DOC_SINK_CAPS_AUTOGPU \
|
||||||
|
"video/x-raw(memory:CUDAMemory), " DOC_SINK_CAPS_COMM "; " \
|
||||||
|
"video/x-raw(memory:D3D11Memory), " DOC_SINK_CAPS_COMM "; " \
|
||||||
|
"video/x-raw(memory:GLMemory), " DOC_SINK_CAPS_COMM "; " \
|
||||||
|
"video/x-raw, " DOC_SINK_CAPS_COMM
|
||||||
|
|
||||||
|
#define DOC_SRC_CAPS \
|
||||||
|
"video/x-h265, width = (int) [ 144, 8192 ], height = (int) [ 48, 8192 ], " \
|
||||||
|
"profile = (string) { main, main-10, main-444, main-444-10 }, " \
|
||||||
|
"stream-format = (string) { byte-stream, hvc1, hev1 }, alignment = (string) au"
|
||||||
|
|
||||||
static GTypeClass *parent_class = NULL;
|
static GTypeClass *parent_class = NULL;
|
||||||
|
|
||||||
enum
|
enum
|
||||||
|
@ -488,6 +514,9 @@ gst_nv_h265_encoder_class_init (GstNvH265EncoderClass * klass, gpointer data)
|
||||||
"ignored if negotiated stream-format is \"hvc1\"",
|
"ignored if negotiated stream-format is \"hvc1\"",
|
||||||
DEFAULT_REPEAT_SEQUENCE_HEADER, param_flags));
|
DEFAULT_REPEAT_SEQUENCE_HEADER, param_flags));
|
||||||
|
|
||||||
|
GstPadTemplate *pad_templ = gst_pad_template_new ("sink",
|
||||||
|
GST_PAD_SINK, GST_PAD_ALWAYS, cdata->sink_caps);
|
||||||
|
GstCaps *doc_caps = nullptr;
|
||||||
switch (cdata->device_mode) {
|
switch (cdata->device_mode) {
|
||||||
case GST_NV_ENCODER_DEVICE_CUDA:
|
case GST_NV_ENCODER_DEVICE_CUDA:
|
||||||
gst_element_class_set_static_metadata (element_class,
|
gst_element_class_set_static_metadata (element_class,
|
||||||
|
@ -495,6 +524,7 @@ gst_nv_h265_encoder_class_init (GstNvH265EncoderClass * klass, gpointer data)
|
||||||
"Codec/Encoder/Video/Hardware",
|
"Codec/Encoder/Video/Hardware",
|
||||||
"Encode H.265 video streams using NVCODEC API CUDA Mode",
|
"Encode H.265 video streams using NVCODEC API CUDA Mode",
|
||||||
"Seungha Yang <seungha@centricular.com>");
|
"Seungha Yang <seungha@centricular.com>");
|
||||||
|
doc_caps = gst_caps_from_string (DOC_SINK_CAPS);
|
||||||
break;
|
break;
|
||||||
case GST_NV_ENCODER_DEVICE_D3D11:
|
case GST_NV_ENCODER_DEVICE_D3D11:
|
||||||
gst_element_class_set_static_metadata (element_class,
|
gst_element_class_set_static_metadata (element_class,
|
||||||
|
@ -502,6 +532,7 @@ gst_nv_h265_encoder_class_init (GstNvH265EncoderClass * klass, gpointer data)
|
||||||
"Codec/Encoder/Video/Hardware",
|
"Codec/Encoder/Video/Hardware",
|
||||||
"Encode H.265 video streams using NVCODEC API Direct3D11 Mode",
|
"Encode H.265 video streams using NVCODEC API Direct3D11 Mode",
|
||||||
"Seungha Yang <seungha@centricular.com>");
|
"Seungha Yang <seungha@centricular.com>");
|
||||||
|
doc_caps = gst_caps_from_string (DOC_SINK_CAPS_D3D11);
|
||||||
break;
|
break;
|
||||||
case GST_NV_ENCODER_DEVICE_AUTO_SELECT:
|
case GST_NV_ENCODER_DEVICE_AUTO_SELECT:
|
||||||
gst_element_class_set_static_metadata (element_class,
|
gst_element_class_set_static_metadata (element_class,
|
||||||
|
@ -509,18 +540,23 @@ gst_nv_h265_encoder_class_init (GstNvH265EncoderClass * klass, gpointer data)
|
||||||
"Codec/Encoder/Video/Hardware",
|
"Codec/Encoder/Video/Hardware",
|
||||||
"Encode H.265 video streams using NVCODEC API auto GPU select Mode",
|
"Encode H.265 video streams using NVCODEC API auto GPU select Mode",
|
||||||
"Seungha Yang <seungha@centricular.com>");
|
"Seungha Yang <seungha@centricular.com>");
|
||||||
|
doc_caps = gst_caps_from_string (DOC_SINK_CAPS_AUTOGPU);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_pad_template_set_documentation_caps (pad_templ, doc_caps);
|
||||||
gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
|
gst_caps_unref (doc_caps);
|
||||||
cdata->sink_caps));
|
gst_element_class_add_pad_template (element_class, pad_templ);
|
||||||
gst_element_class_add_pad_template (element_class,
|
|
||||||
gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
|
pad_templ = gst_pad_template_new ("src",
|
||||||
cdata->src_caps));
|
GST_PAD_SRC, GST_PAD_ALWAYS, cdata->src_caps);
|
||||||
|
doc_caps = gst_caps_from_string (DOC_SRC_CAPS);
|
||||||
|
gst_pad_template_set_documentation_caps (pad_templ, doc_caps);
|
||||||
|
gst_caps_unref (doc_caps);
|
||||||
|
gst_element_class_add_pad_template (element_class, pad_templ);
|
||||||
|
|
||||||
videoenc_class->getcaps = GST_DEBUG_FUNCPTR (gst_nv_h265_encoder_getcaps);
|
videoenc_class->getcaps = GST_DEBUG_FUNCPTR (gst_nv_h265_encoder_getcaps);
|
||||||
videoenc_class->stop = GST_DEBUG_FUNCPTR (gst_nv_h265_encoder_stop);
|
videoenc_class->stop = GST_DEBUG_FUNCPTR (gst_nv_h265_encoder_stop);
|
||||||
|
|
|
@ -44,6 +44,24 @@
|
||||||
GST_DEBUG_CATEGORY_STATIC (gst_nv_vp8_dec_debug);
|
GST_DEBUG_CATEGORY_STATIC (gst_nv_vp8_dec_debug);
|
||||||
#define GST_CAT_DEFAULT gst_nv_vp8_dec_debug
|
#define GST_CAT_DEFAULT gst_nv_vp8_dec_debug
|
||||||
|
|
||||||
|
#define DOC_SINK_CAPS \
|
||||||
|
"video/x-vp8, width = (int) [ 48, 4096 ], height = (int) [ 16, 4096 ]" \
|
||||||
|
|
||||||
|
#define DOC_SRC_CAPS_COMM \
|
||||||
|
"format = (string) NV12, " \
|
||||||
|
"width = (int) [ 48, 4096 ], height = (int) [ 16, 4096 ]"
|
||||||
|
|
||||||
|
#define DOC_SRC_CAPS_D3D11 \
|
||||||
|
"format = (string) NV12, " \
|
||||||
|
"width = (int) [ 48, 4096 ], height = (int) [ 16, 4096 ]"
|
||||||
|
|
||||||
|
#define DOC_SRC_CAPS \
|
||||||
|
"video/x-raw(memory:CUDAMemory), " DOC_SRC_CAPS_COMM "; " \
|
||||||
|
"video/x-raw(memory:D3D12Memory), " DOC_SRC_CAPS_COMM "; " \
|
||||||
|
"video/x-raw(memory:D3D11Memory), " DOC_SRC_CAPS_D3D11 "; " \
|
||||||
|
"video/x-raw(memory:GLMemory), " DOC_SRC_CAPS_COMM "; " \
|
||||||
|
"video/x-raw, " DOC_SRC_CAPS_COMM
|
||||||
|
|
||||||
typedef struct _GstNvVp8Dec
|
typedef struct _GstNvVp8Dec
|
||||||
{
|
{
|
||||||
GstVp8Decoder parent;
|
GstVp8Decoder parent;
|
||||||
|
@ -216,12 +234,19 @@ gst_nv_vp8_dec_class_init (GstNvVp8DecClass * klass,
|
||||||
"Codec/Decoder/Video/Hardware",
|
"Codec/Decoder/Video/Hardware",
|
||||||
"NVIDIA VP8 video decoder", "Seungha Yang <seungha@centricular.com>");
|
"NVIDIA VP8 video decoder", "Seungha Yang <seungha@centricular.com>");
|
||||||
|
|
||||||
gst_element_class_add_pad_template (element_class,
|
auto pad_templ = gst_pad_template_new ("sink",
|
||||||
gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
|
GST_PAD_SINK, GST_PAD_ALWAYS, cdata->sink_caps);
|
||||||
cdata->sink_caps));
|
auto doc_caps = gst_caps_from_string (DOC_SINK_CAPS);
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_pad_template_set_documentation_caps (pad_templ, doc_caps);
|
||||||
gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
|
gst_caps_unref (doc_caps);
|
||||||
cdata->src_caps));
|
gst_element_class_add_pad_template (element_class, pad_templ);
|
||||||
|
|
||||||
|
pad_templ = gst_pad_template_new ("src",
|
||||||
|
GST_PAD_SRC, GST_PAD_ALWAYS, cdata->src_caps);
|
||||||
|
doc_caps = gst_caps_from_string (DOC_SRC_CAPS);
|
||||||
|
gst_pad_template_set_documentation_caps (pad_templ, doc_caps);
|
||||||
|
gst_caps_unref (doc_caps);
|
||||||
|
gst_element_class_add_pad_template (element_class, pad_templ);
|
||||||
|
|
||||||
decoder_class->open = GST_DEBUG_FUNCPTR (gst_nv_vp8_dec_open);
|
decoder_class->open = GST_DEBUG_FUNCPTR (gst_nv_vp8_dec_open);
|
||||||
decoder_class->close = GST_DEBUG_FUNCPTR (gst_nv_vp8_dec_close);
|
decoder_class->close = GST_DEBUG_FUNCPTR (gst_nv_vp8_dec_close);
|
||||||
|
|
|
@ -44,6 +44,26 @@
|
||||||
GST_DEBUG_CATEGORY_STATIC (gst_nv_vp9_dec_debug);
|
GST_DEBUG_CATEGORY_STATIC (gst_nv_vp9_dec_debug);
|
||||||
#define GST_CAT_DEFAULT gst_nv_vp9_dec_debug
|
#define GST_CAT_DEFAULT gst_nv_vp9_dec_debug
|
||||||
|
|
||||||
|
#define DOC_SINK_CAPS \
|
||||||
|
"video/x-vp9, width = (int) [ 128, 8192 ], height = (int) [ 128, 8192 ], " \
|
||||||
|
"alignment= (string) frame, " \
|
||||||
|
"profile = (string) { 0, 2 }"
|
||||||
|
|
||||||
|
#define DOC_SRC_CAPS_COMM \
|
||||||
|
"format = (string) { NV12, P010_10LE, P012_LE }, " \
|
||||||
|
"width = (int) [ 128, 8192 ], height = (int) [ 128, 8192 ]"
|
||||||
|
|
||||||
|
#define DOC_SRC_CAPS_D3D11 \
|
||||||
|
"format = (string) { I420, I420_10LE, I420_12LE }, " \
|
||||||
|
"width = (int) [ 128, 8192 ], height = (int) [ 128, 8192 ]"
|
||||||
|
|
||||||
|
#define DOC_SRC_CAPS \
|
||||||
|
"video/x-raw(memory:CUDAMemory), " DOC_SRC_CAPS_COMM "; " \
|
||||||
|
"video/x-raw(memory:D3D12Memory), " DOC_SRC_CAPS_COMM "; " \
|
||||||
|
"video/x-raw(memory:D3D11Memory), " DOC_SRC_CAPS_D3D11 "; " \
|
||||||
|
"video/x-raw(memory:GLMemory), " DOC_SRC_CAPS_COMM "; " \
|
||||||
|
"video/x-raw, " DOC_SRC_CAPS_COMM
|
||||||
|
|
||||||
typedef struct _GstNvVp9Dec
|
typedef struct _GstNvVp9Dec
|
||||||
{
|
{
|
||||||
GstVp9Decoder parent;
|
GstVp9Decoder parent;
|
||||||
|
@ -219,12 +239,19 @@ gst_nv_vp9_dec_class_init (GstNvVp9DecClass * klass,
|
||||||
"Codec/Decoder/Video/Hardware",
|
"Codec/Decoder/Video/Hardware",
|
||||||
"NVIDIA VP9 video decoder", "Seungha Yang <seungha@centricular.com>");
|
"NVIDIA VP9 video decoder", "Seungha Yang <seungha@centricular.com>");
|
||||||
|
|
||||||
gst_element_class_add_pad_template (element_class,
|
auto pad_templ = gst_pad_template_new ("sink",
|
||||||
gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
|
GST_PAD_SINK, GST_PAD_ALWAYS, cdata->sink_caps);
|
||||||
cdata->sink_caps));
|
auto doc_caps = gst_caps_from_string (DOC_SINK_CAPS);
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_pad_template_set_documentation_caps (pad_templ, doc_caps);
|
||||||
gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
|
gst_caps_unref (doc_caps);
|
||||||
cdata->src_caps));
|
gst_element_class_add_pad_template (element_class, pad_templ);
|
||||||
|
|
||||||
|
pad_templ = gst_pad_template_new ("src",
|
||||||
|
GST_PAD_SRC, GST_PAD_ALWAYS, cdata->src_caps);
|
||||||
|
doc_caps = gst_caps_from_string (DOC_SRC_CAPS);
|
||||||
|
gst_pad_template_set_documentation_caps (pad_templ, doc_caps);
|
||||||
|
gst_caps_unref (doc_caps);
|
||||||
|
gst_element_class_add_pad_template (element_class, pad_templ);
|
||||||
|
|
||||||
decoder_class->open = GST_DEBUG_FUNCPTR (gst_nv_vp9_dec_open);
|
decoder_class->open = GST_DEBUG_FUNCPTR (gst_nv_vp9_dec_open);
|
||||||
decoder_class->close = GST_DEBUG_FUNCPTR (gst_nv_vp9_dec_close);
|
decoder_class->close = GST_DEBUG_FUNCPTR (gst_nv_vp9_dec_close);
|
||||||
|
|
Loading…
Reference in a new issue