avviddec: let videodecoder call the default pad query handler

Avoids repeating the same handling in many decoders
This commit is contained in:
Thiago Santos 2015-08-15 07:18:07 -03:00
parent 83458d4769
commit 8cc2e1a76b

View file

@ -78,8 +78,6 @@ static gboolean gst_ffmpegviddec_decide_allocation (GstVideoDecoder * decoder,
GstQuery * query);
static gboolean gst_ffmpegviddec_propose_allocation (GstVideoDecoder * decoder,
GstQuery * query);
static gboolean gst_ffmpegviddec_sink_query (GstVideoDecoder * decoder,
GstQuery * query);
static void gst_ffmpegviddec_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec);
@ -252,7 +250,6 @@ gst_ffmpegviddec_class_init (GstFFMpegVidDecClass * klass)
viddec_class->drain = gst_ffmpegviddec_finish; /* drain and finish are the same to us */
viddec_class->decide_allocation = gst_ffmpegviddec_decide_allocation;
viddec_class->propose_allocation = gst_ffmpegviddec_propose_allocation;
viddec_class->sink_query = gst_ffmpegviddec_sink_query;
}
static void
@ -273,6 +270,8 @@ gst_ffmpegviddec_init (GstFFMpegVidDec * ffmpegdec)
ffmpegdec->output_corrupt = DEFAULT_OUTPUT_CORRUPT;
GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_DECODER_SINK_PAD (ffmpegdec));
gst_video_decoder_set_use_default_pad_acceptcaps (GST_VIDEO_DECODER_CAST
(ffmpegdec), TRUE);
gst_video_decoder_set_needs_format (GST_VIDEO_DECODER (ffmpegdec), TRUE);
}
@ -1579,25 +1578,6 @@ gst_ffmpegviddec_handle_frame (GstVideoDecoder * decoder,
return ret;
}
static gboolean
gst_ffmpegviddec_sink_query (GstVideoDecoder * decoder, GstQuery * query)
{
gboolean ret;
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_ACCEPT_CAPS:
/* resort to the default accept-caps query handling to skip the videodecoder handling */
ret =
gst_pad_query_default (GST_VIDEO_DECODER_SINK_PAD (decoder),
GST_OBJECT_CAST (decoder), query);
break;
default:
ret = gst_video_decoder_sink_query_default (decoder, query);
break;
}
return ret;
}
static gboolean
gst_ffmpegviddec_start (GstVideoDecoder * decoder)
{