From 7448422fe23877056ce9822bef698283e77a56b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 1 Nov 2005 12:39:16 +0000 Subject: [PATCH] gst/autodetect/: Fix state change function and use GST_DEBUG_FUNCPTR in class_init. Original commit message from CVS: * gst/autodetect/gstautoaudiosink.c: (gst_auto_audio_sink_class_init), (gst_auto_audio_sink_change_state): * gst/autodetect/gstautovideosink.c: (gst_auto_video_sink_class_init), (gst_auto_video_sink_change_state): Fix state change function and use GST_DEBUG_FUNCPTR in class_init. --- ChangeLog | 11 +++++++++++ gst/autodetect/gstautoaudiosink.c | 14 ++++++++++---- gst/autodetect/gstautovideosink.c | 14 ++++++++++---- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4ff99774e9..a1ae81a98a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2005-11-01 Tim-Philipp Müller + + * gst/autodetect/gstautoaudiosink.c: + (gst_auto_audio_sink_class_init), + (gst_auto_audio_sink_change_state): + * gst/autodetect/gstautovideosink.c: + (gst_auto_video_sink_class_init), + (gst_auto_video_sink_change_state): + Fix state change function and use GST_DEBUG_FUNCPTR in + class_init. + 2005-11-01 Josef Zlomek Reviewed by: Tim-Philipp Müller diff --git a/gst/autodetect/gstautoaudiosink.c b/gst/autodetect/gstautoaudiosink.c index 334ae451bd..2becffcdb7 100644 --- a/gst/autodetect/gstautoaudiosink.c +++ b/gst/autodetect/gstautoaudiosink.c @@ -57,7 +57,7 @@ gst_auto_audio_sink_class_init (GstAutoAudioSinkClass * klass) { GstElementClass *eklass = GST_ELEMENT_CLASS (klass); - eklass->change_state = gst_auto_audio_sink_change_state; + eklass->change_state = GST_DEBUG_FUNCPTR (gst_auto_audio_sink_change_state); } /* @@ -237,15 +237,21 @@ static GstStateChangeReturn gst_auto_audio_sink_change_state (GstElement * element, GstStateChange transition) { + GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS; GstAutoAudioSink *sink = GST_AUTO_AUDIO_SINK (element); - GST_DEBUG_OBJECT (element, "Change state 0x%x", transition); - switch (transition) { case GST_STATE_CHANGE_NULL_TO_READY: if (!gst_auto_audio_sink_detect (sink)) return GST_STATE_CHANGE_FAILURE; break; + default: + break; + } + + ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); + + switch (transition) { case GST_STATE_CHANGE_READY_TO_NULL: gst_auto_audio_sink_reset (sink); break; @@ -253,5 +259,5 @@ gst_auto_audio_sink_change_state (GstElement * element, break; } - return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); + return ret; } diff --git a/gst/autodetect/gstautovideosink.c b/gst/autodetect/gstautovideosink.c index b4a861b9af..b9dfda81d5 100644 --- a/gst/autodetect/gstautovideosink.c +++ b/gst/autodetect/gstautovideosink.c @@ -57,7 +57,7 @@ gst_auto_video_sink_class_init (GstAutoVideoSinkClass * klass) { GstElementClass *eklass = GST_ELEMENT_CLASS (klass); - eklass->change_state = gst_auto_video_sink_change_state; + eklass->change_state = GST_DEBUG_FUNCPTR (gst_auto_video_sink_change_state); } /* @@ -205,15 +205,21 @@ static GstStateChangeReturn gst_auto_video_sink_change_state (GstElement * element, GstStateChange transition) { + GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS; GstAutoVideoSink *sink = GST_AUTO_VIDEO_SINK (element); - GST_DEBUG_OBJECT (element, "Change state 0x%x", transition); - switch (transition) { case GST_STATE_CHANGE_NULL_TO_READY: if (!gst_auto_video_sink_detect (sink)) return GST_STATE_CHANGE_FAILURE; break; + default: + break; + } + + ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); + + switch (transition) { case GST_STATE_CHANGE_READY_TO_NULL: gst_auto_video_sink_reset (sink); break; @@ -221,5 +227,5 @@ gst_auto_video_sink_change_state (GstElement * element, break; } - return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); + return ret; }