mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-19 20:46:22 +00:00
vdpau: remove parse_codec_data from GstBaseVideoDecoder
This commit is contained in:
parent
8eed6f2ab9
commit
3826b3b57b
2 changed files with 15 additions and 26 deletions
|
@ -37,7 +37,7 @@ enum
|
||||||
|
|
||||||
|
|
||||||
static GstFlowReturn gst_base_video_decoder_drain (GstBaseVideoDecoder * dec,
|
static GstFlowReturn gst_base_video_decoder_drain (GstBaseVideoDecoder * dec,
|
||||||
gboolean at_eos, gboolean codec_data);
|
gboolean at_eos);
|
||||||
|
|
||||||
|
|
||||||
GST_BOILERPLATE (GstBaseVideoDecoder, gst_base_video_decoder,
|
GST_BOILERPLATE (GstBaseVideoDecoder, gst_base_video_decoder,
|
||||||
|
@ -229,7 +229,7 @@ gst_base_video_decoder_sink_event (GstPad * pad, GstEvent * event)
|
||||||
case GST_EVENT_EOS:
|
case GST_EVENT_EOS:
|
||||||
{
|
{
|
||||||
if (!base_video_decoder->packetized)
|
if (!base_video_decoder->packetized)
|
||||||
gst_base_video_decoder_drain (base_video_decoder, TRUE, FALSE);
|
gst_base_video_decoder_drain (base_video_decoder, TRUE);
|
||||||
|
|
||||||
ret =
|
ret =
|
||||||
gst_pad_push_event (GST_BASE_VIDEO_DECODER_SRC_PAD
|
gst_pad_push_event (GST_BASE_VIDEO_DECODER_SRC_PAD
|
||||||
|
@ -654,12 +654,10 @@ empty_caps:
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_base_video_decoder_drain (GstBaseVideoDecoder * dec, gboolean at_eos,
|
gst_base_video_decoder_drain (GstBaseVideoDecoder * dec, gboolean at_eos)
|
||||||
gboolean codec_data)
|
|
||||||
{
|
{
|
||||||
GstBaseVideoDecoderClass *klass;
|
GstBaseVideoDecoderClass *klass;
|
||||||
GstBaseVideoDecoderScanResult res;
|
GstBaseVideoDecoderScanResult res;
|
||||||
GstFlowReturn ret;
|
|
||||||
guint size;
|
guint size;
|
||||||
|
|
||||||
klass = GST_BASE_VIDEO_DECODER_GET_CLASS (dec);
|
klass = GST_BASE_VIDEO_DECODER_GET_CLASS (dec);
|
||||||
|
@ -737,23 +735,21 @@ lost_sync:
|
||||||
else
|
else
|
||||||
GST_BUFFER_FLAG_UNSET (buf, GST_BUFFER_FLAG_GAP);
|
GST_BUFFER_FLAG_UNSET (buf, GST_BUFFER_FLAG_GAP);
|
||||||
|
|
||||||
if (codec_data)
|
|
||||||
ret = klass->parse_codec_data (dec, buf);
|
|
||||||
else
|
|
||||||
ret = klass->parse_data (dec, buf, at_eos);
|
|
||||||
if (ret != GST_FLOW_OK)
|
|
||||||
break;
|
|
||||||
|
|
||||||
res = klass->scan_for_packet_end (dec, dec->input_adapter, &size, at_eos);
|
res = klass->scan_for_packet_end (dec, dec->input_adapter, &size, at_eos);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res == GST_BASE_VIDEO_DECODER_SCAN_RESULT_LOST_SYNC) {
|
switch (res) {
|
||||||
dec->have_sync = FALSE;
|
case GST_BASE_VIDEO_DECODER_SCAN_RESULT_LOST_SYNC:
|
||||||
goto lost_sync;
|
dec->have_sync = FALSE;
|
||||||
} else if (res == GST_BASE_VIDEO_DECODER_SCAN_RESULT_NEED_DATA)
|
goto lost_sync;
|
||||||
return GST_FLOW_OK;
|
|
||||||
|
|
||||||
return ret;
|
case GST_BASE_VIDEO_DECODER_SCAN_RESULT_NEED_DATA:
|
||||||
|
return GST_FLOW_OK;
|
||||||
|
|
||||||
|
default:
|
||||||
|
GST_ERROR_OBJECT (dec, "Subclass returned invalid scan result");
|
||||||
|
return GST_FLOW_ERROR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
|
@ -831,7 +827,7 @@ gst_base_video_decoder_chain (GstPad * pad, GstBuffer * buf)
|
||||||
|
|
||||||
gst_adapter_push (base_video_decoder->input_adapter, buf);
|
gst_adapter_push (base_video_decoder->input_adapter, buf);
|
||||||
|
|
||||||
ret = gst_base_video_decoder_drain (base_video_decoder, FALSE, FALSE);
|
ret = gst_base_video_decoder_drain (base_video_decoder, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_object_unref (base_video_decoder);
|
gst_object_unref (base_video_decoder);
|
||||||
|
@ -1312,11 +1308,6 @@ gst_base_video_decoder_class_init (GstBaseVideoDecoderClass * klass)
|
||||||
"Whether the incoming data is already packetized into suitable "
|
"Whether the incoming data is already packetized into suitable "
|
||||||
"packets", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
"packets", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class, PROP_PACKETIZED,
|
|
||||||
g_param_spec_boolean ("parse-codec-data", "Parse Codec Data",
|
|
||||||
"Whether the codec_data should be parsed", FALSE,
|
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class, PROP_PACKETIZED,
|
g_object_class_install_property (gobject_class, PROP_PACKETIZED,
|
||||||
g_param_spec_boolean ("sink-clipping", "Sink Clipping",
|
g_param_spec_boolean ("sink-clipping", "Sink Clipping",
|
||||||
"If enabled GstBaseVideoDecoder will clip outgoing frames", FALSE,
|
"If enabled GstBaseVideoDecoder will clip outgoing frames", FALSE,
|
||||||
|
|
|
@ -160,8 +160,6 @@ struct _GstBaseVideoDecoderClass
|
||||||
|
|
||||||
GstFlowReturn (*parse_data) (GstBaseVideoDecoder *decoder,
|
GstFlowReturn (*parse_data) (GstBaseVideoDecoder *decoder,
|
||||||
GstBuffer *buf, gboolean at_eos);
|
GstBuffer *buf, gboolean at_eos);
|
||||||
GstFlowReturn (*parse_codec_data) (GstBaseVideoDecoder *decoder,
|
|
||||||
GstBuffer *buf);
|
|
||||||
|
|
||||||
|
|
||||||
GstVideoFrame *(*create_frame) (GstBaseVideoDecoder *coder);
|
GstVideoFrame *(*create_frame) (GstBaseVideoDecoder *coder);
|
||||||
|
|
Loading…
Reference in a new issue