videodecoders: use default pad accept-caps handling

Avoids useless check of downstream caps when handling an
accept-caps query

Elements: daaladec, libde265dec, openjpegdec, rsvgdec, schrodec,
          webpdec, pnmdec, vmncdec, openexrdec
This commit is contained in:
Thiago Santos 2015-08-15 12:55:49 -03:00
parent 51dfa3b135
commit a5ed877783
9 changed files with 28 additions and 0 deletions

View file

@ -131,6 +131,9 @@ gst_daala_dec_init (GstDaalaDec * dec)
* but is not marked that way so data gets parsed and keyframes marked */
gst_video_decoder_set_packetized (GST_VIDEO_DECODER (dec), FALSE);
gst_video_decoder_set_needs_format (GST_VIDEO_DECODER (dec), TRUE);
gst_video_decoder_set_use_default_pad_acceptcaps (GST_VIDEO_DECODER_CAST
(dec), TRUE);
GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_DECODER_SINK_PAD (dec));
}
static void

View file

@ -200,6 +200,9 @@ gst_libde265_dec_init (GstLibde265Dec * dec)
dec->length_size = 4;
_gst_libde265_dec_reset_decoder (dec);
gst_video_decoder_set_packetized (GST_VIDEO_DECODER (dec), TRUE);
gst_video_decoder_set_use_default_pad_acceptcaps (GST_VIDEO_DECODER_CAST
(dec), TRUE);
GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_DECODER_SINK_PAD (dec));
}
static inline void

View file

@ -151,6 +151,9 @@ gst_openexr_dec_init (GstOpenEXRDec * self)
GstVideoDecoder *decoder = (GstVideoDecoder *) self;
gst_video_decoder_set_packetized (decoder, FALSE);
gst_video_decoder_set_use_default_pad_acceptcaps (GST_VIDEO_DECODER_CAST
(self), TRUE);
GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_DECODER_SINK_PAD (self));
}
static gboolean

View file

@ -109,6 +109,9 @@ gst_openjpeg_dec_init (GstOpenJPEGDec * self)
gst_video_decoder_set_packetized (decoder, TRUE);
gst_video_decoder_set_needs_format (decoder, TRUE);
gst_video_decoder_set_use_default_pad_acceptcaps (GST_VIDEO_DECODER_CAST
(self), TRUE);
GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_DECODER_SINK_PAD (self));
opj_set_default_decoder_parameters (&self->params);
#ifdef HAVE_OPENJPEG_1
self->params.cp_limit_decoding = NO_LIMITATION;

View file

@ -104,6 +104,9 @@ gst_rsvg_dec_init (GstRsvgDec * rsvg)
{
GstVideoDecoder *decoder = GST_VIDEO_DECODER (rsvg);
gst_video_decoder_set_packetized (decoder, FALSE);
gst_video_decoder_set_use_default_pad_acceptcaps (GST_VIDEO_DECODER_CAST
(rsvg), TRUE);
GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_DECODER_SINK_PAD (rsvg));
}
static void

View file

@ -155,6 +155,9 @@ gst_schro_dec_init (GstSchroDec * schro_dec)
schro_dec->decoder = schro_decoder_new ();
gst_video_decoder_set_packetized (GST_VIDEO_DECODER (schro_dec), FALSE);
gst_video_decoder_set_use_default_pad_acceptcaps (GST_VIDEO_DECODER_CAST
(schro_dec), TRUE);
GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_DECODER_SINK_PAD (schro_dec));
schro_dec->header_read = FALSE;
}

View file

@ -139,6 +139,9 @@ gst_webp_dec_init (GstWebPDec * dec)
dec->bypass_filtering = FALSE;
dec->no_fancy_upsampling = FALSE;
dec->use_threads = FALSE;
gst_video_decoder_set_use_default_pad_acceptcaps (GST_VIDEO_DECODER_CAST
(dec), TRUE);
GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_DECODER_SINK_PAD (dec));
}
static gboolean

View file

@ -108,6 +108,10 @@ gst_pnmdec_init (GstPnmdec * s)
/* Initialize decoder */
s->buf = NULL;
gst_pnmdec_flush (s);
gst_video_decoder_set_use_default_pad_acceptcaps (GST_VIDEO_DECODER_CAST
(s), TRUE);
GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_DECODER_SINK_PAD (s));
}
static GstFlowReturn

View file

@ -105,6 +105,9 @@ gst_vmnc_dec_class_init (GstVMncDecClass * klass)
static void
gst_vmnc_dec_init (GstVMncDec * dec)
{
gst_video_decoder_set_use_default_pad_acceptcaps (GST_VIDEO_DECODER_CAST
(dec), TRUE);
GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_DECODER_SINK_PAD (dec));
}
static gboolean