video{en,de}coder: Revert to old ::reset() behaviour and deprecate it

This commit is contained in:
Sebastian Dröge 2013-08-14 16:55:55 +02:00
parent 5640ba17c8
commit 9df036c216
4 changed files with 14 additions and 10 deletions

View file

@ -853,10 +853,17 @@ gst_video_decoder_finalize (GObject * object)
static GstFlowReturn
gst_video_decoder_flush (GstVideoDecoder * dec, gboolean hard)
{
GstVideoDecoderClass *klass = GST_VIDEO_DECODER_GET_CLASS (dec);
GstFlowReturn ret = GST_FLOW_OK;
GST_LOG_OBJECT (dec, "flush hard %d", hard);
/* Inform subclass */
if (klass->reset) {
GST_FIXME_OBJECT (dec, "GstVideoDecoder::reset() is deprecated");
klass->reset (dec, hard);
}
/* FIXME make some more distinction between hard and soft,
* but subclass may not be prepared for that */
/* FIXME perhaps also clear pending frames ?,
@ -1646,17 +1653,12 @@ gst_video_decoder_clear_queues (GstVideoDecoder * dec)
static void
gst_video_decoder_reset (GstVideoDecoder * decoder, gboolean full)
{
GstVideoDecoderClass *klass = GST_VIDEO_DECODER_GET_CLASS (decoder);
GstVideoDecoderPrivate *priv = decoder->priv;
GST_DEBUG_OBJECT (decoder, "reset full %d", full);
GST_VIDEO_DECODER_STREAM_LOCK (decoder);
/* Inform subclass */
if (klass->reset)
klass->reset (decoder, full);
if (full) {
gst_segment_init (&decoder->input_segment, GST_FORMAT_UNDEFINED);
gst_segment_init (&decoder->output_segment, GST_FORMAT_UNDEFINED);

View file

@ -211,6 +211,7 @@ struct _GstVideoDecoder
* for subsequent decoding.
* @reset: Optional.
* Allows subclass (decoder) to perform post-seek semantics reset.
* Deprecated.
* @handle_frame: Provides input data frame to subclass.
* @finish: Optional.
* Called to request subclass to dispatch any pending remaining

View file

@ -304,11 +304,6 @@ gst_video_encoder_reset (GstVideoEncoder * encoder, gboolean hard)
GST_VIDEO_ENCODER_STREAM_LOCK (encoder);
if (klass->reset) {
GST_DEBUG_OBJECT (encoder, "requesting subclass to reset");
ret = klass->reset (encoder, hard);
}
priv->presentation_frame_number = 0;
priv->distance_from_sync = 0;
@ -575,6 +570,11 @@ gst_video_encoder_setcaps (GstVideoEncoder * encoder, GstCaps * caps)
goto caps_not_changed;
}
if (encoder_class->reset) {
GST_FIXME_OBJECT (encoder, "GstVideoEncoder::reset() is deprecated");
ret = encoder_class->reset (encoder, TRUE);
}
/* and subclass should be ready to configure format at any time around */
ret = encoder_class->set_format (encoder, state);
if (ret) {

View file

@ -172,6 +172,7 @@ struct _GstVideoEncoder
* @handle_frame: Provides input frame to subclass.
* @reset: Optional.
* Allows subclass (encoder) to perform post-seek semantics reset.
* Deprecated.
* @finish: Optional.
* Called to request subclass to dispatch any pending remaining
* data (e.g. at EOS).