Commit 1b27badc authored by Thiago Santos's avatar Thiago Santos

videoencoders: use template subset check for accept-caps

It is faster than doing a query that propagates downstream and
should be enough

Elements: jpegenc, pngenc, vp8enc, vp9enc, y4menc
parent a39bebb5
......@@ -283,6 +283,8 @@ gst_jpegenc_term_destination (j_compress_ptr cinfo)
static void
gst_jpegenc_init (GstJpegEnc * jpegenc)
{
GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_ENCODER_SINK_PAD (jpegenc));
/* setup jpeglib */
memset (&jpegenc->cinfo, 0, sizeof (jpegenc->cinfo));
memset (&jpegenc->jerr, 0, sizeof (jpegenc->jerr));
......
......@@ -199,6 +199,8 @@ done:
static void
gst_pngenc_init (GstPngEnc * pngenc)
{
GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_ENCODER_SINK_PAD (pngenc));
/* init settings */
pngenc->png_struct_ptr = NULL;
pngenc->png_info_ptr = NULL;
......
......@@ -726,6 +726,7 @@ gst_vp8_enc_init (GstVP8Enc * gst_vp8_enc)
vpx_codec_err_t status;
GST_DEBUG_OBJECT (gst_vp8_enc, "init");
GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_ENCODER_SINK_PAD (gst_vp8_enc));
status =
vpx_codec_enc_config_default (&vpx_codec_vp8_cx_algo, &gst_vp8_enc->cfg,
......
......@@ -698,6 +698,7 @@ gst_vp9_enc_init (GstVP9Enc * gst_vp9_enc)
vpx_codec_err_t status;
GST_DEBUG_OBJECT (gst_vp9_enc, "init");
GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_ENCODER_SINK_PAD (gst_vp9_enc));
status =
vpx_codec_enc_config_default (&vpx_codec_vp9_cx_algo, &gst_vp9_enc->cfg,
......
......@@ -114,6 +114,8 @@ gst_y4m_encode_class_init (GstY4mEncodeClass * klass)
static void
gst_y4m_encode_init (GstY4mEncode * filter)
{
GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_ENCODER_SINK_PAD (filter));
/* init properties */
gst_y4m_encode_reset (filter);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment