mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
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.
This commit is contained in:
parent
b234d9b0f9
commit
9cadd004a8
3 changed files with 26 additions and 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>
|
2006-09-25 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
Patch by: Peter Kjellerstedt <pkj at axis com>
|
Patch by: Peter Kjellerstedt <pkj at axis com>
|
||||||
|
|
|
@ -57,6 +57,7 @@ GST_ELEMENT_DETAILS ("Auto audio sink",
|
||||||
"Sink/Audio",
|
"Sink/Audio",
|
||||||
"Wrapper audio sink for automatically detected audio sink",
|
"Wrapper audio sink for automatically detected audio sink",
|
||||||
"Ronald Bultje <rbultje@ronald.bitfreak.net>");
|
"Ronald Bultje <rbultje@ronald.bitfreak.net>");
|
||||||
|
|
||||||
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
|
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
|
||||||
GST_PAD_SINK,
|
GST_PAD_SINK,
|
||||||
GST_PAD_ALWAYS,
|
GST_PAD_ALWAYS,
|
||||||
|
@ -69,13 +70,16 @@ gst_auto_audio_sink_base_init (gpointer klass)
|
||||||
|
|
||||||
gst_element_class_add_pad_template (eklass,
|
gst_element_class_add_pad_template (eklass,
|
||||||
gst_static_pad_template_get (&sink_template));
|
gst_static_pad_template_get (&sink_template));
|
||||||
|
|
||||||
gst_element_class_set_details (eklass, &gst_auto_audio_sink_details);
|
gst_element_class_set_details (eklass, &gst_auto_audio_sink_details);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_auto_audio_sink_class_init (GstAutoAudioSinkClass * klass)
|
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);
|
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),
|
GST_ELEMENT_WARNING (sink, RESOURCE, NOT_FOUND, (NULL),
|
||||||
("Failed to find a usable audio sink"));
|
("Failed to find a usable audio sink"));
|
||||||
choice = gst_element_factory_make ("fakesink", "fake-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);
|
gst_element_set_state (choice, GST_STATE_READY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -212,11 +212,8 @@ gst_auto_video_sink_detect (GstAutoVideoSink * sink)
|
||||||
|
|
||||||
/* find element */
|
/* find element */
|
||||||
GST_DEBUG_OBJECT (sink, "Creating new kid");
|
GST_DEBUG_OBJECT (sink, "Creating new kid");
|
||||||
if (!(esink = gst_auto_video_sink_find_best (sink))) {
|
if (!(esink = gst_auto_video_sink_find_best (sink)))
|
||||||
GST_ELEMENT_ERROR (sink, LIBRARY, INIT, (NULL),
|
goto no_sink;
|
||||||
("Failed to find a supported video sink"));
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
sink->kid = esink;
|
sink->kid = esink;
|
||||||
gst_bin_add (GST_BIN (sink), 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");
|
GST_DEBUG_OBJECT (sink, "done changing auto video sink");
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
/* ERRORS */
|
||||||
|
no_sink:
|
||||||
|
{
|
||||||
|
GST_ELEMENT_ERROR (sink, LIBRARY, INIT, (NULL),
|
||||||
|
("Failed to find a supported video sink"));
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstStateChangeReturn
|
static GstStateChangeReturn
|
||||||
|
|
Loading…
Reference in a new issue