diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2006-09-25 13:55:44 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2006-09-25 13:55:44 +0000 |
commit | 9cadd004a874b3181f4994df6bf87268f3aa9ca3 (patch) | |
tree | 876eac3515ae7fac978d9ad432c210e04e4fce93 | |
parent | b234d9b0f9ccf0db1fdfeccef24feb7508eb2fa1 (diff) |
gst/autodetect/: Small cleanups. don't try to set "sync" property when it is not available.
Original commit message from CVS:
* gst/autodetect/gstautoaudiosink.c:
(gst_auto_audio_sink_base_init), (gst_auto_audio_sink_class_init),
(gst_auto_audio_sink_find_best):
* gst/autodetect/gstautovideosink.c: (gst_auto_video_sink_detect):
Small cleanups.
don't try to set "sync" property when it is not available.
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | gst/autodetect/gstautoaudiosink.c | 9 | ||||
-rw-r--r-- | gst/autodetect/gstautovideosink.c | 15 |
3 files changed, 26 insertions, 7 deletions
@@ -1,3 +1,12 @@ +2006-09-25 Wim Taymans <wim@fluendo.com> + + * gst/autodetect/gstautoaudiosink.c: + (gst_auto_audio_sink_base_init), (gst_auto_audio_sink_class_init), + (gst_auto_audio_sink_find_best): + * gst/autodetect/gstautovideosink.c: (gst_auto_video_sink_detect): + Small cleanups. + don't try to set "sync" property when it is not available. + 2006-09-25 Tim-Philipp Müller <tim at centricular dot net> Patch by: Peter Kjellerstedt <pkj at axis com> diff --git a/gst/autodetect/gstautoaudiosink.c b/gst/autodetect/gstautoaudiosink.c index 8e8f14fa..ccaa413a 100644 --- a/gst/autodetect/gstautoaudiosink.c +++ b/gst/autodetect/gstautoaudiosink.c @@ -57,6 +57,7 @@ GST_ELEMENT_DETAILS ("Auto audio sink", "Sink/Audio", "Wrapper audio sink for automatically detected audio sink", "Ronald Bultje <rbultje@ronald.bitfreak.net>"); + static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, @@ -69,13 +70,16 @@ gst_auto_audio_sink_base_init (gpointer klass) gst_element_class_add_pad_template (eklass, gst_static_pad_template_get (&sink_template)); + gst_element_class_set_details (eklass, &gst_auto_audio_sink_details); } static void gst_auto_audio_sink_class_init (GstAutoAudioSinkClass * klass) { - GstElementClass *eklass = GST_ELEMENT_CLASS (klass); + GstElementClass *eklass; + + eklass = GST_ELEMENT_CLASS (klass); eklass->change_state = GST_DEBUG_FUNCPTR (gst_auto_audio_sink_change_state); } @@ -235,7 +239,8 @@ gst_auto_audio_sink_find_best (GstAutoAudioSink * sink) GST_ELEMENT_WARNING (sink, RESOURCE, NOT_FOUND, (NULL), ("Failed to find a usable audio sink")); choice = gst_element_factory_make ("fakesink", "fake-audio-sink"); - g_object_set (choice, "sync", TRUE, NULL); + if (g_object_class_find_property (G_OBJECT_GET_CLASS (choice), "sync")) + g_object_set (choice, "sync", TRUE, NULL); gst_element_set_state (choice, GST_STATE_READY); } } diff --git a/gst/autodetect/gstautovideosink.c b/gst/autodetect/gstautovideosink.c index 6d5a9312..085dea1b 100644 --- a/gst/autodetect/gstautovideosink.c +++ b/gst/autodetect/gstautovideosink.c @@ -212,11 +212,8 @@ gst_auto_video_sink_detect (GstAutoVideoSink * sink) /* find element */ GST_DEBUG_OBJECT (sink, "Creating new kid"); - if (!(esink = gst_auto_video_sink_find_best (sink))) { - GST_ELEMENT_ERROR (sink, LIBRARY, INIT, (NULL), - ("Failed to find a supported video sink")); - return FALSE; - } + if (!(esink = gst_auto_video_sink_find_best (sink))) + goto no_sink; sink->kid = esink; gst_bin_add (GST_BIN (sink), esink); @@ -229,6 +226,14 @@ gst_auto_video_sink_detect (GstAutoVideoSink * sink) GST_DEBUG_OBJECT (sink, "done changing auto video sink"); return TRUE; + + /* ERRORS */ +no_sink: + { + GST_ELEMENT_ERROR (sink, LIBRARY, INIT, (NULL), + ("Failed to find a supported video sink")); + return FALSE; + } } static GstStateChangeReturn |