summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorSeungha Yang <pudding8757@gmail.com>2018-04-07 00:05:46 +0900
committerJan Schmidt <jan@centricular.com>2018-04-25 01:59:30 +1000
commit5f95094f39813d0fd0a3c104fe4ab1be2750b556 (patch)
treef1e654a40c6b67633b5517c42cf1d89e724d09e9 /sys
parent6242dae832accc3a8392b67efee29c2779465924 (diff)
downloadgstreamer-plugins-bad-5f95094f39813d0fd0a3c104fe4ab1be2750b556.tar.gz
nvencbase: Define sinkpad template in subclass
https://bugzilla.gnome.org/show_bug.cgi?id=795037
Diffstat (limited to 'sys')
-rw-r--r--sys/nvenc/gstnvbaseenc.c19
-rw-r--r--sys/nvenc/gstnvh264enc.c18
2 files changed, 18 insertions, 19 deletions
diff --git a/sys/nvenc/gstnvbaseenc.c b/sys/nvenc/gstnvbaseenc.c
index 1862c8f4a..c890673d7 100644
--- a/sys/nvenc/gstnvbaseenc.c
+++ b/sys/nvenc/gstnvbaseenc.c
@@ -141,23 +141,6 @@ _rc_mode_to_nv (GstNvRCMode mode)
}
}
-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 }, " // TODO: YV12, Y444 support
- "width = (int) [ 16, 4096 ], height = (int) [ 16, 2160 ], "
- "framerate = (fraction) [0, MAX],"
- "interlace-mode = { progressive, mixed, interleaved } "
-#if HAVE_NVENC_GST_GL
- ";"
- "video/x-raw(memory:GLMemory), "
- "format = (string) { NV12, Y444 }, "
- "width = (int) [ 16, 4096 ], height = (int) [ 16, 2160 ], "
- "framerate = (fraction) [0, MAX],"
- "interlace-mode = { progressive, mixed, interleaved } "
-#endif
- ));
-
enum
{
PROP_0,
@@ -254,8 +237,6 @@ gst_nv_base_enc_class_init (GstNvBaseEncClass * klass)
videoenc_class->finish = GST_DEBUG_FUNCPTR (gst_nv_base_enc_finish);
videoenc_class->sink_query = GST_DEBUG_FUNCPTR (gst_nv_base_enc_sink_query);
- gst_element_class_add_static_pad_template (element_class, &sink_factory);
-
g_object_class_install_property (gobject_class, PROP_DEVICE_ID,
g_param_spec_uint ("cuda-device-id",
"Cuda Device ID",
diff --git a/sys/nvenc/gstnvh264enc.c b/sys/nvenc/gstnvh264enc.c
index f250bc0c0..c642b17b7 100644
--- a/sys/nvenc/gstnvh264enc.c
+++ b/sys/nvenc/gstnvh264enc.c
@@ -42,6 +42,23 @@ GST_DEBUG_CATEGORY_STATIC (gst_nv_h264_enc_debug);
G_DEFINE_TYPE (GstNvH264Enc, gst_nv_h264_enc, GST_TYPE_NV_BASE_ENC);
/* *INDENT-OFF* */
+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 }, " // TODO: YV12, Y444 support
+ "width = (int) [ 16, 4096 ], height = (int) [ 16, 2160 ], "
+ "framerate = (fraction) [0, MAX],"
+ "interlace-mode = { progressive, mixed, interleaved } "
+#if HAVE_NVENC_GST_GL
+ ";"
+ "video/x-raw(memory:GLMemory), "
+ "format = (string) { NV12, Y444 }, "
+ "width = (int) [ 16, 4096 ], height = (int) [ 16, 2160 ], "
+ "framerate = (fraction) [0, MAX],"
+ "interlace-mode = { progressive, mixed, interleaved } "
+#endif
+ ));
+
static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
@@ -92,6 +109,7 @@ gst_nv_h264_enc_class_init (GstNvH264EncClass * klass)
nvenc_class->set_src_caps = gst_nv_h264_enc_set_src_caps;
nvenc_class->set_pic_params = gst_nv_h264_enc_set_pic_params;
+ gst_element_class_add_static_pad_template (element_class, &sink_factory);
gst_element_class_add_static_pad_template (element_class, &src_factory);
gst_element_class_set_static_metadata (element_class,