enum
{
PROP_0,
- PROP_START_TIME
+ PROP_START_TIME,
+ PROP_CLOCK_TYPE
};
typedef struct _GstClockEntryContext GstClockEntryContext;
struct _GstTestClockPrivate
{
+ GstClockType clock_type;
GstClockTime start_time;
GstClockTime internal_time;
GList *entry_contexts;
GCond entry_processed_cond;
};
+#define DEFAULT_CLOCK_TYPE GST_CLOCK_TYPE_MONOTONIC
+
#define GST_TEST_CLOCK_GET_PRIVATE(obj) ((GST_TEST_CLOCK_CAST (obj))->priv)
GST_DEBUG_CATEGORY_STATIC (test_clock_debug);
"Start Time of the Clock", 0, G_MAXUINT64, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY);
g_object_class_install_property (gobject_class, PROP_START_TIME, pspec);
+
+ g_object_class_install_property (gobject_class, PROP_CLOCK_TYPE,
+ g_param_spec_enum ("clock-type", "Clock type",
+ "The kind of clock implementation to be reported by this clock",
+ GST_TYPE_CLOCK_TYPE, DEFAULT_CLOCK_TYPE,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
}
static void
g_cond_init (&priv->entry_added_cond);
g_cond_init (&priv->entry_processed_cond);
+ priv->clock_type = DEFAULT_CLOCK_TYPE;
GST_OBJECT_FLAG_SET (test_clock,
GST_CLOCK_FLAG_CAN_DO_SINGLE_SYNC |
case PROP_START_TIME:
g_value_set_uint64 (value, priv->start_time);
break;
+ case PROP_CLOCK_TYPE:
+ g_value_set_enum (value, priv->clock_type);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
"test clock start time initialized at %" GST_TIME_FORMAT,
GST_TIME_ARGS (priv->start_time));
break;
+ case PROP_CLOCK_TYPE:
+ priv->clock_type = (GstClockType) g_value_get_enum (value);
+ GST_CAT_DEBUG (GST_CAT_TEST_CLOCK, "clock-type set to %d",
+ priv->clock_type);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;