diff options
author | Ole André Vadla Ravnås <ole.andre.ravnas@tandberg.com> | 2008-09-10 12:05:39 +0000 |
---|---|---|
committer | Ole André Vadla Ravnås <ole.andre.ravnas@tandberg.com> | 2008-09-10 12:05:39 +0000 |
commit | 61dee512910cd2c9e407cc0679a492cc57333194 (patch) | |
tree | 7d096eafde087ce7678350d5d95e7a9bddcaf52e /sys | |
parent | 0ff4dc306f16324f12889137400aeb0cd9949938 (diff) |
sys/winks/gstksclock.c (gst_ks_clock_worker_thread_func, gst_ks_clock_start):
Original commit message from CVS:
* sys/winks/gstksclock.c (gst_ks_clock_worker_thread_func,
gst_ks_clock_start):
Synchronize KS clock as a single-shot operation for now, there's not
much point in doing it periodically until we're actually using the
KS timestamps for anything else than just discarding old frames.
* sys/winks/gstksvideosrc.c (gst_ks_video_src_open_device):
Provide the GstClock when opening the device if we already have one.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/winks/gstksclock.c | 17 | ||||
-rw-r--r-- | sys/winks/gstksvideosrc.c | 10 |
2 files changed, 14 insertions, 13 deletions
diff --git a/sys/winks/gstksclock.c b/sys/winks/gstksclock.c index ad3b3ecb3..7e6d8e904 100644 --- a/sys/winks/gstksclock.c +++ b/sys/winks/gstksclock.c @@ -289,15 +289,17 @@ gst_ks_clock_worker_thread_func (gpointer data) gst_ks_clock_set_state_unlocked (self, KSSTATE_RUN); while (priv->worker_running) { - GTimeVal next_wakeup; - if (priv->master_clock != NULL) { GstClockTime now = gst_clock_get_time (priv->master_clock); now /= 100; - if (!ks_object_set_property (priv->clock_handle, KSPROPSETID_Clock, + if (ks_object_set_property (priv->clock_handle, KSPROPSETID_Clock, KSPROPERTY_CLOCK_TIME, &now, sizeof (now))) { - GST_WARNING ("Failed to sync clock"); + GST_DEBUG ("clock synchronized"); + gst_object_unref (priv->master_clock); + priv->master_clock = NULL; + } else { + GST_WARNING ("failed to synchronize clock"); } } @@ -306,9 +308,7 @@ gst_ks_clock_worker_thread_func (gpointer data) g_cond_signal (priv->client_cond); } - g_get_current_time (&next_wakeup); - next_wakeup.tv_sec += 1; - g_cond_timed_wait (priv->worker_cond, priv->mutex, &next_wakeup); + g_cond_wait (priv->worker_cond, priv->mutex); } priv->worker_initialized = FALSE; @@ -329,8 +329,7 @@ gst_ks_clock_start (GstKsClock * self) priv->worker_initialized = FALSE; priv->worker_thread = - g_thread_create_full (gst_ks_clock_worker_thread_func, self, 0, TRUE, - TRUE, G_THREAD_PRIORITY_HIGH, NULL); + g_thread_create (gst_ks_clock_worker_thread_func, self, TRUE, NULL); } while (!priv->worker_initialized) diff --git a/sys/winks/gstksvideosrc.c b/sys/winks/gstksvideosrc.c index 9e8560ce5..ed1916226 100644 --- a/sys/winks/gstksvideosrc.c +++ b/sys/winks/gstksvideosrc.c @@ -414,14 +414,16 @@ gst_ks_video_src_open_device (GstKsVideoSrc * self) if (match) { priv->ksclock = g_object_new (GST_TYPE_KS_CLOCK, NULL); - if (priv->ksclock != NULL && !gst_ks_clock_open (priv->ksclock)) { + if (priv->ksclock != NULL && gst_ks_clock_open (priv->ksclock)) { + GstClock *clock = GST_ELEMENT_CLOCK (self); + if (clock != NULL) + gst_ks_clock_provide_master_clock (priv->ksclock, clock); + } else { + GST_WARNING_OBJECT (self, "failed to create/open KsClock"); g_object_unref (priv->ksclock); priv->ksclock = NULL; } - if (priv->ksclock == NULL) - GST_WARNING_OBJECT (self, "Failed to create/open KsClock"); - device = g_object_new (GST_TYPE_KS_VIDEO_DEVICE, "clock", priv->ksclock, "device-path", entry->path, NULL); } |