autodetect: check if the kid has a sync property

previously autovideosrc did not have a sync property and v4l2src has none either.
This commit is contained in:
Stefan Sauer 2014-02-20 22:52:57 +01:00
parent bf6a2f9afd
commit 0566ea06e5
2 changed files with 6 additions and 2 deletions

View file

@ -349,7 +349,10 @@ gst_auto_detect_detect (GstAutoDetect * self)
if (!(kid = gst_auto_detect_find_best (self)))
goto no_sink;
g_object_set (G_OBJECT (kid), "sync", self->sync, NULL);
self->has_sync =
g_object_class_find_property (G_OBJECT_GET_CLASS (kid), "sync") != NULL;
if (self->has_sync)
g_object_set (G_OBJECT (kid), "sync", self->sync, NULL);
if (klass->configure) {
klass->configure (self, kid);
}
@ -432,7 +435,7 @@ gst_auto_detect_set_property (GObject * object, guint prop_id,
break;
case PROP_SYNC:
self->sync = g_value_get_boolean (value);
if (self->kid)
if (self->kid && self->has_sync)
g_object_set_property (G_OBJECT (self->kid), pspec->name, value);
break;
default:

View file

@ -51,6 +51,7 @@ typedef struct _GstAutoDetect {
/* < private > */
GstElement *kid;
gboolean has_sync;
const gchar *type_klass; /* Source/Sink */
const gchar *media_klass_lc, *type_klass_lc; /* lower case versions */