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.
This commit is contained in:
Tim-Philipp Müller 2005-11-01 12:39:16 +00:00
parent 7d9dd13c6e
commit 7448422fe2
3 changed files with 31 additions and 8 deletions

View file

@ -1,3 +1,14 @@
2005-11-01 Tim-Philipp Müller <tim at centricular dot net>
* 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 <josef dot zlomek at xeris dot cz>
Reviewed by: Tim-Philipp Müller <tim at centricular dot net>

View file

@ -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;
}

View file

@ -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;
}