mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 10:11:08 +00:00
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:
parent
7d9dd13c6e
commit
7448422fe2
3 changed files with 31 additions and 8 deletions
11
ChangeLog
11
ChangeLog
|
@ -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>
|
2005-11-01 Josef Zlomek <josef dot zlomek at xeris dot cz>
|
||||||
|
|
||||||
Reviewed by: Tim-Philipp Müller <tim at centricular dot net>
|
Reviewed by: Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
|
@ -57,7 +57,7 @@ gst_auto_audio_sink_class_init (GstAutoAudioSinkClass * klass)
|
||||||
{
|
{
|
||||||
GstElementClass *eklass = GST_ELEMENT_CLASS (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,
|
gst_auto_audio_sink_change_state (GstElement * element,
|
||||||
GstStateChange transition)
|
GstStateChange transition)
|
||||||
{
|
{
|
||||||
|
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
|
||||||
GstAutoAudioSink *sink = GST_AUTO_AUDIO_SINK (element);
|
GstAutoAudioSink *sink = GST_AUTO_AUDIO_SINK (element);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (element, "Change state 0x%x", transition);
|
|
||||||
|
|
||||||
switch (transition) {
|
switch (transition) {
|
||||||
case GST_STATE_CHANGE_NULL_TO_READY:
|
case GST_STATE_CHANGE_NULL_TO_READY:
|
||||||
if (!gst_auto_audio_sink_detect (sink))
|
if (!gst_auto_audio_sink_detect (sink))
|
||||||
return GST_STATE_CHANGE_FAILURE;
|
return GST_STATE_CHANGE_FAILURE;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
||||||
|
|
||||||
|
switch (transition) {
|
||||||
case GST_STATE_CHANGE_READY_TO_NULL:
|
case GST_STATE_CHANGE_READY_TO_NULL:
|
||||||
gst_auto_audio_sink_reset (sink);
|
gst_auto_audio_sink_reset (sink);
|
||||||
break;
|
break;
|
||||||
|
@ -253,5 +259,5 @@ gst_auto_audio_sink_change_state (GstElement * element,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ gst_auto_video_sink_class_init (GstAutoVideoSinkClass * klass)
|
||||||
{
|
{
|
||||||
GstElementClass *eklass = GST_ELEMENT_CLASS (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,
|
gst_auto_video_sink_change_state (GstElement * element,
|
||||||
GstStateChange transition)
|
GstStateChange transition)
|
||||||
{
|
{
|
||||||
|
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
|
||||||
GstAutoVideoSink *sink = GST_AUTO_VIDEO_SINK (element);
|
GstAutoVideoSink *sink = GST_AUTO_VIDEO_SINK (element);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (element, "Change state 0x%x", transition);
|
|
||||||
|
|
||||||
switch (transition) {
|
switch (transition) {
|
||||||
case GST_STATE_CHANGE_NULL_TO_READY:
|
case GST_STATE_CHANGE_NULL_TO_READY:
|
||||||
if (!gst_auto_video_sink_detect (sink))
|
if (!gst_auto_video_sink_detect (sink))
|
||||||
return GST_STATE_CHANGE_FAILURE;
|
return GST_STATE_CHANGE_FAILURE;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
||||||
|
|
||||||
|
switch (transition) {
|
||||||
case GST_STATE_CHANGE_READY_TO_NULL:
|
case GST_STATE_CHANGE_READY_TO_NULL:
|
||||||
gst_auto_video_sink_reset (sink);
|
gst_auto_video_sink_reset (sink);
|
||||||
break;
|
break;
|
||||||
|
@ -221,5 +227,5 @@ gst_auto_video_sink_change_state (GstElement * element,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue