summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--sys/winks/gstksclock.c17
-rw-r--r--sys/winks/gstksvideosrc.c10
3 files changed, 24 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 6c2d5391..9aff7775 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2008-09-10 Ole André Vadla Ravnås <ole.andre.ravnas@tandberg.com>
+ * 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.
+
+2008-09-10 Ole André Vadla Ravnås <ole.andre.ravnas@tandberg.com>
+
* sys/winks/gstksvideodevice.c (GST_DEBUG_IS_ENABLED, last_timestamp,
gst_ks_video_device_prepare_buffers, gst_ks_video_device_create_pin,
gst_ks_video_device_set_state, gst_ks_video_device_request_frame,
diff --git a/sys/winks/gstksclock.c b/sys/winks/gstksclock.c
index ad3b3ecb..7e6d8e90 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 9e8560ce..ed191622 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);
}