gst_value_get_fraction_range_max
gst_value_set_fraction_range_full
-<SUBSECTION date>
-GST_VALUE_HOLDS_DATE
-GST_TYPE_DATE
-gst_value_set_date
-gst_value_get_date
-
<SUBSECTION datetime>
GST_VALUE_HOLDS_DATE_TIME
gst_registry_get_default() -> gst_registry_get()
gst_default_registry_*(...) -> gst_registry_*(gst_registry_get(), ...)
+
+* GstValue
+
+ GST_TYPE_DATE -> G_TYPE_DATE
+ GST_VALUE_HOLDS_DATE(value) -> G_VALUE_HOLDS(value,G_TYPE_DATE)
+ gst_value_set_date() -> g_value_set_boxed()
+ gst_value_get_date() -> g_value_get_boxed()
type = va_arg (varargs, GType);
- if (G_UNLIKELY (type == G_TYPE_DATE)) {
- g_warning ("Don't use G_TYPE_DATE, use GST_TYPE_DATE instead\n");
- type = GST_TYPE_DATE;
- }
G_VALUE_COLLECT_INIT (&value, type, varargs, 0, &err);
if (G_UNLIKELY (err)) {
g_critical ("%s", err);
type = va_arg (varargs, GType);
- if (G_UNLIKELY (type == G_TYPE_DATE)) {
- g_warning ("Don't use G_TYPE_DATE, use GST_TYPE_DATE instead\n");
- type = GST_TYPE_DATE;
- }
G_VALUE_COLLECT_INIT (&field.value, type, varargs, 0, &err);
if (G_UNLIKELY (err)) {
g_critical ("%s", err);
type = va_arg (varargs, GType);
- if (G_UNLIKELY (type == G_TYPE_DATE)) {
- g_warning ("Don't use G_TYPE_DATE, use GST_TYPE_DATE instead\n");
- type = GST_TYPE_DATE;
- }
#ifndef G_VALUE_COLLECT_INIT
g_value_init (&field.value, type);
G_VALUE_COLLECT (&field.value, varargs, 0, &err);
g_value_unset (&field->value);
return;
}
- } else if (G_UNLIKELY (GST_VALUE_HOLDS_DATE (&field->value))) {
+ } else if (G_UNLIKELY (G_VALUE_HOLDS (&field->value, G_TYPE_DATE))) {
const GDate *d;
- d = gst_value_get_date (&field->value);
+ d = g_value_get_boxed (&field->value);
/* only check for NULL GDates in taglists, as they might make sense
* in other, generic structs */
if (G_UNLIKELY ((IS_TAGLIST (structure) && d == NULL))) {
if (field == NULL)
return FALSE;
- if (!GST_VALUE_HOLDS_DATE (&field->value))
+ if (!G_VALUE_HOLDS (&field->value, G_TYPE_DATE))
return FALSE;
/* FIXME: 0.11 g_value_dup_boxed() -> g_value_get_boxed() */
,
{"structure", GST_TYPE_STRUCTURE}
,
- {"date", GST_TYPE_DATE}
+ {"date", G_TYPE_DATE}
,
{"datetime", GST_TYPE_DATE_TIME}
,
G_TYPE_STRING,
_("album artist sortname"),
_("The artist of the entire album, as it should be sorted"), NULL);
- gst_tag_register (GST_TAG_DATE, GST_TAG_FLAG_META, GST_TYPE_DATE,
+ gst_tag_register (GST_TAG_DATE, GST_TAG_FLAG_META, G_TYPE_DATE,
_("date"), _("date the data was created (as a GDate structure)"), NULL);
- gst_tag_register (GST_TAG_DATE_TIME, GST_TAG_FLAG_META, GST_TYPE_DATE_TIME,
+ gst_tag_register (GST_TAG_DATE_TIME, GST_TAG_FLAG_META, G_TYPE_DATE_TIME,
_("datetime"),
_("date and time the data was created (as a GstDateTime structure)"),
NULL);
* GDate *
*********/
-/**
- * gst_value_set_date:
- * @value: a GValue initialized to GST_TYPE_DATE
- * @date: the date to set the value to
- *
- * Sets the contents of @value to correspond to @date. The actual
- * #GDate structure is copied before it is used.
- */
-void
-gst_value_set_date (GValue * value, const GDate * date)
-{
- g_return_if_fail (G_VALUE_TYPE (value) == GST_TYPE_DATE);
- g_return_if_fail (g_date_valid (date));
-
- g_value_set_boxed (value, date);
-}
-
-/**
- * gst_value_get_date:
- * @value: a GValue initialized to GST_TYPE_DATE
- *
- * Gets the contents of @value.
- *
- * Returns: (transfer none): the contents of @value
- */
-const GDate *
-gst_value_get_date (const GValue * value)
-{
- g_return_val_if_fail (G_VALUE_TYPE (value) == GST_TYPE_DATE, NULL);
-
- return (const GDate *) g_value_get_boxed (value);
-}
-
-static gpointer
-gst_date_copy (gpointer boxed)
-{
- const GDate *date = (const GDate *) boxed;
-
- if (!g_date_valid (date)) {
- GST_WARNING ("invalid GDate");
- return NULL;
- }
-
- return g_date_new_julian (g_date_get_julian (date));
-}
-
static gint
gst_value_compare_date (const GValue * value1, const GValue * value2)
{
FUNC_VALUE_GET_TYPE (fraction, "GstFraction");
-
-GType
-gst_date_get_type (void)
-{
- static GType gst_date_type = 0;
-
- if (G_UNLIKELY (gst_date_type == 0)) {
- /* FIXME 0.11: we require GLib 2.8 already
- * Not using G_TYPE_DATE here on purpose, even if we could
- * if GLIB_CHECK_VERSION(2,8,0) was true: we don't want the
- * serialised strings to have different type strings depending
- * on what version is used, so FIXME when we require GLib-2.8 */
- gst_date_type = g_boxed_type_register_static ("GstDate",
- (GBoxedCopyFunc) gst_date_copy, (GBoxedFreeFunc) g_date_free);
- }
-
- return gst_date_type;
-}
-
GType
gst_date_time_get_type (void)
{
gst_value_deserialize_date,
};
- gst_value.type = gst_date_get_type ();
+ gst_value.type = G_TYPE_DATE;
gst_value_register (&gst_value);
}
{
gst_value_transform_double_fraction);
g_value_register_transform_func (G_TYPE_FLOAT, GST_TYPE_FRACTION,
gst_value_transform_float_fraction);
- g_value_register_transform_func (GST_TYPE_DATE, G_TYPE_STRING,
+ g_value_register_transform_func (G_TYPE_DATE, G_TYPE_STRING,
gst_value_transform_date_string);
- g_value_register_transform_func (G_TYPE_STRING, GST_TYPE_DATE,
+ g_value_register_transform_func (G_TYPE_STRING, G_TYPE_DATE,
gst_value_transform_string_date);
g_value_register_transform_func (GST_TYPE_OBJECT, G_TYPE_STRING,
gst_value_transform_object_string);
#define GST_VALUE_HOLDS_FRACTION(x) (G_VALUE_HOLDS((x), gst_fraction_get_type ()))
/**
- * GST_VALUE_HOLDS_DATE:
- * @x: the #GValue to check
- *
- * Checks if the given #GValue contains a #GST_TYPE_DATE value.
- */
-#define GST_VALUE_HOLDS_DATE(x) (G_VALUE_HOLDS((x), gst_date_get_type ()))
-
-/**
* GST_VALUE_HOLDS_DATE_TIME:
* @x: the #GValue to check
*
#define GST_TYPE_FRACTION gst_fraction_get_type ()
/**
- * GST_TYPE_DATE:
- *
- * a boxed #GValue type for #GDate that represents a date.
- *
- * Returns: the #GType of GstDate
- */
-
-#define GST_TYPE_DATE gst_date_get_type ()
-
-/**
* GST_TYPE_DATE_TIME:
*
* a boxed #GValue type for #GstDateTime that represents a date and time.
GType gst_value_array_get_type (void);
GType gst_bitmask_get_type (void);
-GType gst_date_get_type (void);
GType gst_date_time_get_type (void);
void gst_value_register (const GstValueTable *table);
const GValue *gst_value_get_fraction_range_min (const GValue *value);
const GValue *gst_value_get_fraction_range_max (const GValue *value);
-/* date */
-const GDate * gst_value_get_date (const GValue *value);
-void gst_value_set_date (GValue *value,
- const GDate *date);
-
-
/* bitmask */
guint64 gst_value_get_bitmask (const GValue *value);
void gst_value_set_bitmask (GValue *value,
date = g_date_new_dmy (22, 9, 2005);
- s = gst_structure_new ("media/x-type", "SOME_DATE_TAG", GST_TYPE_DATE,
+ s = gst_structure_new ("media/x-type", "SOME_DATE_TAG", G_TYPE_DATE,
date, NULL);
- fail_unless (gst_structure_has_field_typed (s, "SOME_DATE_TAG",
- GST_TYPE_DATE));
+ fail_unless (gst_structure_has_field_typed (s, "SOME_DATE_TAG", G_TYPE_DATE));
fail_unless (gst_structure_get_date (s, "SOME_DATE_TAG", &date2));
fail_unless (date2 != NULL);
fail_unless (g_date_valid (date2));
fail_unless (s != NULL);
fail_unless (gst_structure_has_name (s, "media/x-type"));
- fail_unless (gst_structure_has_field_typed (s, "SOME_DATE_TAG",
- GST_TYPE_DATE));
+ fail_unless (gst_structure_has_field_typed (s, "SOME_DATE_TAG", G_TYPE_DATE));
fail_unless (gst_structure_get_date (s, "SOME_DATE_TAG", &date));
fail_unless (date != NULL);
fail_unless (g_date_valid (date));
gst_control_source_get_value_array
gst_core_error_get_type
gst_core_error_quark
- gst_date_get_type
gst_date_time_get_day
gst_date_time_get_hour
gst_date_time_get_microsecond
gst_value_fraction_subtract
gst_value_get_bitmask
gst_value_get_caps
- gst_value_get_date
gst_value_get_double_range_max
gst_value_get_double_range_min
gst_value_get_fraction_denominator
gst_value_serialize
gst_value_set_bitmask
gst_value_set_caps
- gst_value_set_date
gst_value_set_double_range
gst_value_set_fraction
gst_value_set_fraction_range