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.
This commit is contained in:
Ole André Vadla Ravnås 2008-09-10 12:05:39 +00:00
parent 0ff4dc306f
commit 61dee51291
3 changed files with 24 additions and 13 deletions

View file

@ -1,3 +1,13 @@
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,

View file

@ -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)

View file

@ -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);
}