Commit 16fbd4f8 authored by Thiago Santos's avatar Thiago Santos

videodecoders: use default pad accept-caps handling

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

Elements: jpegdec, pngdec, vp8dec, vp9dec
parent 65d2af64
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
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