From 47067f7d1edae0035248bbe93205a824cff5e306 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Tue, 29 Mar 2011 10:41:54 +0200 Subject: [PATCH] [MOVED FROM BAD 072/134] basevideodecoder: invoke subclass start method at state change and use set_format While this changes API slightly (e.g. actually uses set_format now), which is OK for unstable API, it has following merits: * symmetric w.r.t. stop at state change * in line with other base class practice * otherwise no subclass method at state change (global activation time) Moreover, subclassese are either unaffected or trivially adjusted accordingly. --- ext/vp8/gstvp8dec.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ext/vp8/gstvp8dec.c b/ext/vp8/gstvp8dec.c index 83a06b3cc6..9b24dbdfdc 100644 --- a/ext/vp8/gstvp8dec.c +++ b/ext/vp8/gstvp8dec.c @@ -98,6 +98,8 @@ static void gst_vp8_dec_get_property (GObject * object, guint prop_id, static gboolean gst_vp8_dec_start (GstBaseVideoDecoder * decoder); static gboolean gst_vp8_dec_stop (GstBaseVideoDecoder * decoder); +static gboolean gst_vp8_dec_set_format (GstBaseVideoDecoder * decoder, + GstVideoState * state); static gboolean gst_vp8_dec_reset (GstBaseVideoDecoder * decoder); static GstFlowReturn gst_vp8_dec_parse_data (GstBaseVideoDecoder * decoder, gboolean at_eos); @@ -175,6 +177,7 @@ gst_vp8_dec_class_init (GstVP8DecClass * klass) base_video_decoder_class->start = gst_vp8_dec_start; base_video_decoder_class->stop = gst_vp8_dec_stop; base_video_decoder_class->reset = gst_vp8_dec_reset; + base_video_decoder_class->set_format = gst_vp8_dec_set_format; base_video_decoder_class->parse_data = gst_vp8_dec_parse_data; base_video_decoder_class->handle_frame = gst_vp8_dec_handle_frame; @@ -274,6 +277,17 @@ gst_vp8_dec_stop (GstBaseVideoDecoder * base_video_decoder) return TRUE; } +static gboolean +gst_vp8_dec_set_format (GstBaseVideoDecoder * decoder, GstVideoState * state) +{ + GstVP8Dec *gst_vp8_dec = GST_VP8_DEC (decoder); + + GST_DEBUG_OBJECT (gst_vp8_dec, "set_format"); + gst_vp8_dec->decoder_inited = FALSE; + + return TRUE; +} + static gboolean gst_vp8_dec_reset (GstBaseVideoDecoder * base_video_decoder) {