From: Thiago Santos Date: Sat, 15 Aug 2015 11:49:57 +0000 (-0300) Subject: videodecoders: use default pad accept-caps handling X-Git-Tag: 1.19.3~509^2~3322 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=16fbd4f86f3efc7030ce28413bfbfa62249ff4ca;p=platform%2Fupstream%2Fgstreamer.git videodecoders: use default pad accept-caps handling Avoids useless check of downstream caps when handling an accept-caps query Elements: jpegdec, pngdec, vp8dec, vp9dec --- diff --git a/ext/jpeg/gstjpegdec.c b/ext/jpeg/gstjpegdec.c index a1ba7c0c15..d67f1de77a 100644 --- a/ext/jpeg/gstjpegdec.c +++ b/ext/jpeg/gstjpegdec.c @@ -278,6 +278,10 @@ gst_jpeg_dec_init (GstJpegDec * dec) /* init properties */ dec->idct_method = JPEG_DEFAULT_IDCT_METHOD; dec->max_errors = JPEG_DEFAULT_MAX_ERRORS; + + 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 gboolean diff --git a/ext/libpng/gstpngdec.c b/ext/libpng/gstpngdec.c index 48543aa23f..7c98181ba1 100644 --- a/ext/libpng/gstpngdec.c +++ b/ext/libpng/gstpngdec.c @@ -112,6 +112,10 @@ gst_pngdec_init (GstPngDec * pngdec) pngdec->image_ready = FALSE; pngdec->read_data = 0; + + gst_video_decoder_set_use_default_pad_acceptcaps (GST_VIDEO_DECODER_CAST + (pngdec), TRUE); + GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_DECODER_SINK_PAD (pngdec)); } static void diff --git a/ext/vpx/gstvp8dec.c b/ext/vpx/gstvp8dec.c index 4b05f99697..c86cc4c9d5 100644 --- a/ext/vpx/gstvp8dec.c +++ b/ext/vpx/gstvp8dec.c @@ -207,6 +207,8 @@ gst_vp8_dec_init (GstVP8Dec * gst_vp8_dec) gst_vp8_dec->noise_level = DEFAULT_NOISE_LEVEL; gst_video_decoder_set_needs_format (decoder, TRUE); + gst_video_decoder_set_use_default_pad_acceptcaps (decoder, TRUE); + GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_DECODER_SINK_PAD (decoder)); } static void diff --git a/ext/vpx/gstvp9dec.c b/ext/vpx/gstvp9dec.c index a11c848109..3de5a64125 100644 --- a/ext/vpx/gstvp9dec.c +++ b/ext/vpx/gstvp9dec.c @@ -207,6 +207,8 @@ gst_vp9_dec_init (GstVP9Dec * gst_vp9_dec) gst_vp9_dec->noise_level = DEFAULT_NOISE_LEVEL; gst_video_decoder_set_needs_format (decoder, TRUE); + gst_video_decoder_set_use_default_pad_acceptcaps (decoder, TRUE); + GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_DECODER_SINK_PAD (decoder)); } static void