static void
process_entry_context_unlocked (GstTestClock * test_clock,
    GstClockEntryContext * ctx)
{
  GstTestClockPrivate *priv = GST_TEST_CLOCK_GET_PRIVATE (test_clock);
  GstClockEntry *entry = ctx->clock_entry;

  if (ctx->time_diff >= 0)
    GST_CLOCK_ENTRY_STATUS (entry) = GST_CLOCK_OK;
  else
    GST_CLOCK_ENTRY_STATUS (entry) = GST_CLOCK_EARLY;

  if (entry->func != NULL) {
    GST_OBJECT_UNLOCK (test_clock);
    entry->func (GST_CLOCK (test_clock), priv->internal_time, entry,
        entry->user_data);
    GST_OBJECT_LOCK (test_clock);
  }

  gst_test_clock_remove_entry (test_clock, entry);

  if (GST_CLOCK_ENTRY_TYPE (entry) == GST_CLOCK_ENTRY_PERIODIC) {
    GST_CLOCK_ENTRY_TIME (entry) += GST_CLOCK_ENTRY_INTERVAL (entry);

    if (entry->func != NULL)
      gst_test_clock_add_entry (test_clock, entry, NULL);
  }
}
Example #2
0
/* Method: periodic?
 * Returns: true if the entry is periodic, false otherwise.
 */
static VALUE
rg_periodic_p (VALUE self)
{
    return CBOOL2RVAL (GST_CLOCK_ENTRY_TYPE (RGST_CLOCK_ENTRY (self)) ==
                       GST_CLOCK_ENTRY_PERIODIC);
}
Example #3
0
/* Method: single_shot?
 * Returns: true if the entry is single-shot, false otherwise.
 */
static VALUE
rg_single_shot_p (VALUE self)
{
    return CBOOL2RVAL (GST_CLOCK_ENTRY_TYPE (RGST_CLOCK_ENTRY (self)) ==
                       GST_CLOCK_ENTRY_SINGLE);
}