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
This commit is contained in:
Thiago Santos 2015-08-15 22:29:41 -03:00
parent a39bebb5fe
commit 1b27badcfd
5 changed files with 8 additions and 0 deletions

View file

@ -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));

View file

@ -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;

View file

@ -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,

View file

@ -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,

View file

@ -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);
}