mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
avviddec: let videodecoder call the default pad query handler
Avoids repeating the same handling in many decoders
This commit is contained in:
parent
83458d4769
commit
8cc2e1a76b
1 changed files with 2 additions and 22 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue