mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
videodecoder: Add drain() vfunc
drain() is a new vfunc which does what finish() does, while explicitly requiring the decoder be able to continue processing data afterward. https://bugzilla.gnome.org/show_bug.cgi?id=734617
This commit is contained in:
parent
ccee86a7dd
commit
af26201429
2 changed files with 24 additions and 6 deletions
|
@ -988,6 +988,12 @@ gst_video_decoder_drain_out (GstVideoDecoder * dec, gboolean at_eos)
|
||||||
if (at_eos) {
|
if (at_eos) {
|
||||||
if (decoder_class->finish)
|
if (decoder_class->finish)
|
||||||
ret = decoder_class->finish (dec);
|
ret = decoder_class->finish (dec);
|
||||||
|
} else {
|
||||||
|
if (decoder_class->drain) {
|
||||||
|
ret = decoder_class->drain (dec);
|
||||||
|
} else {
|
||||||
|
GST_FIXME_OBJECT (dec, "Sub-class should implement drain()");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Reverse playback mode */
|
/* Reverse playback mode */
|
||||||
|
@ -2115,10 +2121,17 @@ gst_video_decoder_flush_parse (GstVideoDecoder * dec, gboolean at_eos)
|
||||||
if (res != GST_FLOW_OK)
|
if (res != GST_FLOW_OK)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
/* We need to tell the subclass to drain now */
|
/* We need to tell the subclass to drain now.
|
||||||
GST_DEBUG_OBJECT (dec, "Finishing");
|
* We prefer the drain vfunc, but for backward-compat
|
||||||
if (decoder_class->finish)
|
* we use a finish() vfunc if drain isn't implemented */
|
||||||
|
if (decoder_class->drain) {
|
||||||
|
GST_DEBUG_OBJECT (dec, "Draining");
|
||||||
|
res = decoder_class->drain (dec);
|
||||||
|
} else if (decoder_class->finish) {
|
||||||
|
GST_FIXME_OBJECT (dec, "Sub-class should implement drain(). "
|
||||||
|
"Calling finish() for backwards-compat");
|
||||||
res = decoder_class->finish (dec);
|
res = decoder_class->finish (dec);
|
||||||
|
}
|
||||||
|
|
||||||
if (res != GST_FLOW_OK)
|
if (res != GST_FLOW_OK)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
|
@ -215,8 +215,12 @@ struct _GstVideoDecoder
|
||||||
* @handle_frame: Provides input data frame to subclass.
|
* @handle_frame: Provides input data frame to subclass.
|
||||||
* @finish: Optional.
|
* @finish: Optional.
|
||||||
* Called to request subclass to dispatch any pending remaining
|
* Called to request subclass to dispatch any pending remaining
|
||||||
* data (e.g. at EOS or segment end). Sub-classes should be prepared
|
* data at EOS. Sub-classes can refuse to decode new data after.
|
||||||
* to handle new data afterward, or seamless segment processing will break.
|
* @drain: Optional.
|
||||||
|
* Called to request subclass to decode any data it can at this
|
||||||
|
* point, but that more data may arrive after. (e.g. at segment end).
|
||||||
|
* Sub-classes should be prepared to handle new data afterward,
|
||||||
|
* or seamless segment processing will break. Since: 1.6
|
||||||
* @sink_event: Optional.
|
* @sink_event: Optional.
|
||||||
* Event handler on the sink pad. This function should return
|
* Event handler on the sink pad. This function should return
|
||||||
* TRUE if the event was handled and should be discarded
|
* TRUE if the event was handled and should be discarded
|
||||||
|
@ -320,9 +324,10 @@ struct _GstVideoDecoderClass
|
||||||
GstCaps* (*getcaps) (GstVideoDecoder *decoder,
|
GstCaps* (*getcaps) (GstVideoDecoder *decoder,
|
||||||
GstCaps *filter);
|
GstCaps *filter);
|
||||||
|
|
||||||
|
GstFlowReturn (*drain) (GstVideoDecoder *decoder);
|
||||||
|
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
void *padding[GST_PADDING_LARGE-4];
|
void *padding[GST_PADDING_LARGE-5];
|
||||||
};
|
};
|
||||||
|
|
||||||
GType gst_video_decoder_get_type (void);
|
GType gst_video_decoder_get_type (void);
|
||||||
|
|
Loading…
Reference in a new issue