mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 11:41:09 +00:00
debugging additions and style cleanups
Original commit message from CVS: debugging additions and style cleanups
This commit is contained in:
parent
baa63d42e5
commit
1c5150d393
9 changed files with 232 additions and 174 deletions
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,14 @@
|
||||||
|
2004-07-15 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
|
* gst/gstelement.c: (gst_element_set_state):
|
||||||
|
* gst/gstpad.c: (gst_pad_try_set_caps):
|
||||||
|
* gst/gststructure.c:
|
||||||
|
* gst/gstthread.c: (gst_thread_child_state_change):
|
||||||
|
* gst/gstvalue.c: (gst_value_compare_double):
|
||||||
|
* gst/gstvalue.h:
|
||||||
|
* testsuite/parse/parse1.c: (main):
|
||||||
|
debugging additions and style cleanups
|
||||||
|
|
||||||
2004-07-15 Zaheer Abbas Merali <zaheerabbas at merali dot org>
|
2004-07-15 Zaheer Abbas Merali <zaheerabbas at merali dot org>
|
||||||
|
|
||||||
* docs/manual/states.xml: Grammar fix
|
* docs/manual/states.xml: Grammar fix
|
||||||
|
@ -26,7 +37,7 @@
|
||||||
2004-07-15 Benjamin Otte <otte@gnome.org>
|
2004-07-15 Benjamin Otte <otte@gnome.org>
|
||||||
|
|
||||||
* gst/gstelement.h:
|
* gst/gstelement.h:
|
||||||
Don't GST_ERROR_OBJECT smpty strings - Solaris doesn't like NULL
|
Don't GST_ERROR_OBJECT empty strings - Solaris doesn't like NULL
|
||||||
strings.
|
strings.
|
||||||
* gst/gstelement.c (gst_element_class_init):
|
* gst/gstelement.c (gst_element_class_init):
|
||||||
GError's are boxed, not objects
|
GError's are boxed, not objects
|
||||||
|
|
|
@ -2726,6 +2726,8 @@ gst_element_set_state (GstElement * element, GstElementState state)
|
||||||
GstElementClass *klass = GST_ELEMENT_GET_CLASS (element);
|
GstElementClass *klass = GST_ELEMENT_GET_CLASS (element);
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_ELEMENT (element), GST_STATE_FAILURE);
|
g_return_val_if_fail (GST_IS_ELEMENT (element), GST_STATE_FAILURE);
|
||||||
|
GST_DEBUG_OBJECT (element, "setting state to %s",
|
||||||
|
gst_element_state_get_name (state));
|
||||||
klass = GST_ELEMENT_GET_CLASS (element);
|
klass = GST_ELEMENT_GET_CLASS (element);
|
||||||
/* a set_state function is mandatory */
|
/* a set_state function is mandatory */
|
||||||
g_return_val_if_fail (klass->set_state, GST_STATE_FAILURE);
|
g_return_val_if_fail (klass->set_state, GST_STATE_FAILURE);
|
||||||
|
|
|
@ -1482,6 +1482,7 @@ gst_pad_try_set_caps (GstPad * pad, const GstCaps * caps)
|
||||||
return GST_PAD_LINK_OK;
|
return GST_PAD_LINK_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GST_CAT_INFO_OBJECT (GST_CAT_CAPS, pad, "caps %" GST_PTR_FORMAT, caps);
|
||||||
/* setting non-fixed caps on a pad is not allowed */
|
/* setting non-fixed caps on a pad is not allowed */
|
||||||
if (!gst_caps_is_fixed (caps)) {
|
if (!gst_caps_is_fixed (caps)) {
|
||||||
GST_CAT_INFO (GST_CAT_CAPS,
|
GST_CAT_INFO (GST_CAT_CAPS,
|
||||||
|
|
|
@ -984,7 +984,10 @@ static GstStructureAbbreviation gst_structure_abbrs[] = {
|
||||||
{"f", G_TYPE_FLOAT},
|
{"f", G_TYPE_FLOAT},
|
||||||
{"double", G_TYPE_DOUBLE},
|
{"double", G_TYPE_DOUBLE},
|
||||||
{"d", G_TYPE_DOUBLE},
|
{"d", G_TYPE_DOUBLE},
|
||||||
|
/* these are implemented with strcmp below */
|
||||||
|
//{ "buffer", GST_TYPE_BUFFER },
|
||||||
//{ "fourcc", GST_TYPE_FOURCC },
|
//{ "fourcc", GST_TYPE_FOURCC },
|
||||||
|
//{ "4", GST_TYPE_FOURCC },
|
||||||
{"boolean", G_TYPE_BOOLEAN},
|
{"boolean", G_TYPE_BOOLEAN},
|
||||||
{"bool", G_TYPE_BOOLEAN},
|
{"bool", G_TYPE_BOOLEAN},
|
||||||
{"b", G_TYPE_BOOLEAN},
|
{"b", G_TYPE_BOOLEAN},
|
||||||
|
|
|
@ -540,7 +540,7 @@ gst_thread_child_state_change (GstBin * bin, GstElementState oldstate,
|
||||||
gst_element_state_get_name (newstate));
|
gst_element_state_get_name (newstate));
|
||||||
if (parent_class->child_state_change)
|
if (parent_class->child_state_change)
|
||||||
parent_class->child_state_change (bin, oldstate, newstate, element);
|
parent_class->child_state_change (bin, oldstate, newstate, element);
|
||||||
/* We'll wake up the main thread now. Note that we can't lock the thread here,
|
/* We'll wake up the main thread now. Note that we can't lock the thread here,
|
||||||
because we might be called from inside gst_thread_change_state when holding
|
because we might be called from inside gst_thread_change_state when holding
|
||||||
the lock. But this doesn't cause any problems. */
|
the lock. But this doesn't cause any problems. */
|
||||||
if (newstate == GST_STATE_PLAYING)
|
if (newstate == GST_STATE_PLAYING)
|
||||||
|
|
|
@ -52,7 +52,6 @@ struct _GstValueSubtractInfo
|
||||||
GstValueSubtractFunc func;
|
GstValueSubtractFunc func;
|
||||||
};
|
};
|
||||||
|
|
||||||
GType gst_type_fourcc;
|
|
||||||
GType gst_type_fourcc;
|
GType gst_type_fourcc;
|
||||||
GType gst_type_int_range;
|
GType gst_type_int_range;
|
||||||
GType gst_type_double_range;
|
GType gst_type_double_range;
|
||||||
|
@ -64,9 +63,9 @@ static GArray *gst_value_union_funcs;
|
||||||
static GArray *gst_value_intersect_funcs;
|
static GArray *gst_value_intersect_funcs;
|
||||||
static GArray *gst_value_subtract_funcs;
|
static GArray *gst_value_subtract_funcs;
|
||||||
|
|
||||||
/********/
|
/********
|
||||||
/* list */
|
* list *
|
||||||
/********/
|
********/
|
||||||
|
|
||||||
/* two helper functions to serialize/stringify any type of list
|
/* two helper functions to serialize/stringify any type of list
|
||||||
* regular lists are done with { }, fixed lists with < >
|
* regular lists are done with { }, fixed lists with < >
|
||||||
|
@ -399,8 +398,9 @@ gst_value_deserialize_fixed_list (GValue * dest, const char *s)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************/
|
/**********
|
||||||
/* fourcc */
|
* fourcc *
|
||||||
|
**********/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_value_init_fourcc (GValue * value)
|
gst_value_init_fourcc (GValue * value)
|
||||||
|
@ -530,8 +530,9 @@ gst_value_deserialize_fourcc (GValue * dest, const char *s)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************/
|
/*************
|
||||||
/* int range */
|
* int range *
|
||||||
|
*************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_value_init_int_range (GValue * value)
|
gst_value_init_int_range (GValue * value)
|
||||||
|
@ -602,7 +603,7 @@ gst_value_set_int_range (GValue * value, int start, int end)
|
||||||
*
|
*
|
||||||
* Gets the minimum of the range specified by @value.
|
* Gets the minimum of the range specified by @value.
|
||||||
*
|
*
|
||||||
* Returns: the minumum of the range
|
* Returns: the minimum of the range
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
gst_value_get_int_range_min (const GValue * value)
|
gst_value_get_int_range_min (const GValue * value)
|
||||||
|
@ -659,8 +660,9 @@ gst_value_deserialize_int_range (GValue * dest, const char *s)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************/
|
/****************
|
||||||
/* double range */
|
* double range *
|
||||||
|
****************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_value_init_double_range (GValue * value)
|
gst_value_init_double_range (GValue * value)
|
||||||
|
@ -795,8 +797,9 @@ gst_value_deserialize_double_range (GValue * dest, const char *s)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************/
|
/***********
|
||||||
/* GstCaps */
|
* GstCaps *
|
||||||
|
***********/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_value_set_caps:
|
* gst_value_set_caps:
|
||||||
|
@ -830,8 +833,9 @@ gst_value_get_caps (const GValue * value)
|
||||||
return (GstCaps *) g_value_get_boxed (value);
|
return (GstCaps *) g_value_get_boxed (value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************/
|
/*************
|
||||||
/* GstBuffer */
|
* GstBuffer *
|
||||||
|
*************/
|
||||||
|
|
||||||
static int
|
static int
|
||||||
gst_value_compare_buffer (const GValue * value1, const GValue * value2)
|
gst_value_compare_buffer (const GValue * value1, const GValue * value2)
|
||||||
|
@ -910,8 +914,9 @@ gst_value_deserialize_buffer (GValue * dest, const char *s)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************/
|
/***********
|
||||||
/* boolean */
|
* boolean *
|
||||||
|
***********/
|
||||||
|
|
||||||
static int
|
static int
|
||||||
gst_value_compare_boolean (const GValue * value1, const GValue * value2)
|
gst_value_compare_boolean (const GValue * value1, const GValue * value2)
|
||||||
|
@ -950,8 +955,9 @@ gst_value_deserialize_boolean (GValue * dest, const char *s)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************/
|
/*******
|
||||||
/* ints */
|
* int *
|
||||||
|
*******/
|
||||||
|
|
||||||
static int
|
static int
|
||||||
gst_strtoll (const char *s, char **end, int base)
|
gst_strtoll (const char *s, char **end, int base)
|
||||||
|
@ -1102,8 +1108,9 @@ CREATE_USERIALIZATION (uint, UINT)
|
||||||
CREATE_USERIALIZATION (uint64, UINT64)
|
CREATE_USERIALIZATION (uint64, UINT64)
|
||||||
CREATE_USERIALIZATION (ulong, ULONG)
|
CREATE_USERIALIZATION (ulong, ULONG)
|
||||||
|
|
||||||
/*************************************/
|
/**********
|
||||||
/* double */
|
* double *
|
||||||
|
**********/
|
||||||
static int
|
static int
|
||||||
gst_value_compare_double (const GValue * value1, const GValue * value2)
|
gst_value_compare_double (const GValue * value1, const GValue * value2)
|
||||||
{
|
{
|
||||||
|
@ -1150,8 +1157,9 @@ gst_value_deserialize_double (GValue * dest, const char *s)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************/
|
/*********
|
||||||
/* float */
|
* float *
|
||||||
|
*********/
|
||||||
|
|
||||||
static int
|
static int
|
||||||
gst_value_compare_float (const GValue * value1, const GValue * value2)
|
gst_value_compare_float (const GValue * value1, const GValue * value2)
|
||||||
|
@ -1201,8 +1209,9 @@ gst_value_deserialize_float (GValue * dest, const char *s)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************/
|
/**********
|
||||||
/* string */
|
* string *
|
||||||
|
**********/
|
||||||
|
|
||||||
static int
|
static int
|
||||||
gst_value_compare_string (const GValue * value1, const GValue * value2)
|
gst_value_compare_string (const GValue * value1, const GValue * value2)
|
||||||
|
@ -1283,8 +1292,9 @@ gst_value_deserialize_string (GValue * dest, const char *s)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************/
|
/********
|
||||||
/* enums */
|
* enum *
|
||||||
|
********/
|
||||||
|
|
||||||
static int
|
static int
|
||||||
gst_value_compare_enum (const GValue * value1, const GValue * value2)
|
gst_value_compare_enum (const GValue * value1, const GValue * value2)
|
||||||
|
@ -1345,8 +1355,9 @@ gst_value_deserialize_enum (GValue * dest, const char *s)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************/
|
/*********
|
||||||
/* unions */
|
* union *
|
||||||
|
*********/
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_value_union_int_int_range (GValue * dest, const GValue * src1,
|
gst_value_union_int_int_range (GValue * dest, const GValue * src1,
|
||||||
|
@ -1388,8 +1399,9 @@ gst_value_union_int_range_int_range (GValue * dest, const GValue * src1,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************/
|
/****************
|
||||||
/* intersection */
|
* intersection *
|
||||||
|
****************/
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_value_intersect_int_int_range (GValue * dest, const GValue * src1,
|
gst_value_intersect_int_int_range (GValue * dest, const GValue * src1,
|
||||||
|
@ -1512,8 +1524,9 @@ gst_value_intersect_list (GValue * dest, const GValue * value1,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************/
|
/***************
|
||||||
/* subtraction */
|
* subtraction *
|
||||||
|
***************/
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_value_subtract_int_int_range (GValue * dest, const GValue * minuend,
|
gst_value_subtract_int_int_range (GValue * dest, const GValue * minuend,
|
||||||
|
@ -1764,7 +1777,9 @@ gst_value_subtract_list (GValue * dest, const GValue * minuend,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************/
|
/**************
|
||||||
|
* comparison *
|
||||||
|
**************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_value_can_compare:
|
* gst_value_can_compare:
|
||||||
|
|
126
gst/gstvalue.h
126
gst/gstvalue.h
|
@ -84,91 +84,93 @@ extern GType gst_type_double_range;
|
||||||
extern GType gst_type_list;
|
extern GType gst_type_list;
|
||||||
extern GType gst_type_fixed_list;
|
extern GType gst_type_fixed_list;
|
||||||
|
|
||||||
void gst_value_register (const GstValueTable *table);
|
void gst_value_register (const GstValueTable *table);
|
||||||
void gst_value_init_and_copy (GValue *dest,
|
void gst_value_init_and_copy (GValue *dest,
|
||||||
const GValue *src);
|
const GValue *src);
|
||||||
|
|
||||||
gchar * gst_value_serialize (const GValue *value);
|
gchar * gst_value_serialize (const GValue *value);
|
||||||
gboolean gst_value_deserialize (GValue *dest,
|
gboolean gst_value_deserialize (GValue *dest,
|
||||||
const gchar *src);
|
const gchar *src);
|
||||||
|
|
||||||
/* list */
|
/* list */
|
||||||
void gst_value_list_append_value (GValue *value,
|
void gst_value_list_append_value (GValue *value,
|
||||||
const GValue *append_value);
|
const GValue *append_value);
|
||||||
void gst_value_list_prepend_value (GValue *value,
|
void gst_value_list_prepend_value (GValue *value,
|
||||||
const GValue *prepend_value);
|
const GValue *prepend_value);
|
||||||
void gst_value_list_concat (GValue *dest,
|
void gst_value_list_concat (GValue *dest,
|
||||||
const GValue *value1,
|
const GValue *value1,
|
||||||
const GValue *value2);
|
const GValue *value2);
|
||||||
guint gst_value_list_get_size (const GValue *value);
|
guint gst_value_list_get_size (const GValue *value);
|
||||||
G_CONST_RETURN GValue * gst_value_list_get_value (const GValue *value,
|
G_CONST_RETURN GValue *
|
||||||
guint index);
|
gst_value_list_get_value (const GValue *value,
|
||||||
|
guint index);
|
||||||
|
|
||||||
/* fourcc */
|
/* fourcc */
|
||||||
void gst_value_set_fourcc (GValue *value,
|
void gst_value_set_fourcc (GValue *value,
|
||||||
guint32 fourcc);
|
guint32 fourcc);
|
||||||
guint32 gst_value_get_fourcc (const GValue *value);
|
guint32 gst_value_get_fourcc (const GValue *value);
|
||||||
|
|
||||||
/* int range */
|
/* int range */
|
||||||
void gst_value_set_int_range (GValue *value,
|
void gst_value_set_int_range (GValue *value,
|
||||||
int start,
|
int start,
|
||||||
int end);
|
int end);
|
||||||
int gst_value_get_int_range_min (const GValue *value);
|
int gst_value_get_int_range_min (const GValue *value);
|
||||||
int gst_value_get_int_range_max (const GValue *value);
|
int gst_value_get_int_range_max (const GValue *value);
|
||||||
|
|
||||||
/* double range */
|
/* double range */
|
||||||
void gst_value_set_double_range (GValue *value,
|
void gst_value_set_double_range (GValue *value,
|
||||||
double start,
|
double start,
|
||||||
double end);
|
double end);
|
||||||
double gst_value_get_double_range_min (const GValue *value);
|
double gst_value_get_double_range_min (const GValue *value);
|
||||||
double gst_value_get_double_range_max (const GValue *value);
|
double gst_value_get_double_range_max (const GValue *value);
|
||||||
|
|
||||||
/* caps */
|
/* caps */
|
||||||
G_CONST_RETURN GstCaps * gst_value_get_caps (const GValue *value);
|
G_CONST_RETURN GstCaps *
|
||||||
void gst_value_set_caps (GValue *value,
|
gst_value_get_caps (const GValue *value);
|
||||||
const GstCaps *caps);
|
void gst_value_set_caps (GValue *value,
|
||||||
|
const GstCaps *caps);
|
||||||
|
|
||||||
/* compare */
|
/* compare */
|
||||||
int gst_value_compare (const GValue *value1,
|
int gst_value_compare (const GValue *value1,
|
||||||
const GValue *value2);
|
const GValue *value2);
|
||||||
gboolean gst_value_can_compare (const GValue *value1,
|
gboolean gst_value_can_compare (const GValue *value1,
|
||||||
const GValue *value2);
|
const GValue *value2);
|
||||||
|
|
||||||
/* union */
|
/* union */
|
||||||
gboolean gst_value_union (GValue *dest,
|
gboolean gst_value_union (GValue *dest,
|
||||||
const GValue *value1,
|
const GValue *value1,
|
||||||
const GValue *value2);
|
const GValue *value2);
|
||||||
gboolean gst_value_can_union (const GValue *value1,
|
gboolean gst_value_can_union (const GValue *value1,
|
||||||
const GValue *value2);
|
const GValue *value2);
|
||||||
void gst_value_register_union_func (GType type1,
|
void gst_value_register_union_func (GType type1,
|
||||||
GType type2,
|
GType type2,
|
||||||
GstValueUnionFunc func);
|
GstValueUnionFunc func);
|
||||||
|
|
||||||
/* intersection */
|
/* intersection */
|
||||||
gboolean gst_value_intersect (GValue *dest,
|
gboolean gst_value_intersect (GValue *dest,
|
||||||
const GValue *value1,
|
const GValue *value1,
|
||||||
const GValue *value2);
|
const GValue *value2);
|
||||||
gboolean gst_value_can_intersect (const GValue *value1,
|
gboolean gst_value_can_intersect (const GValue *value1,
|
||||||
const GValue *value2);
|
const GValue *value2);
|
||||||
void gst_value_register_intersect_func (GType type1,
|
void gst_value_register_intersect_func (GType type1,
|
||||||
GType type2,
|
GType type2,
|
||||||
GstValueIntersectFunc func);
|
GstValueIntersectFunc func);
|
||||||
|
|
||||||
/* subtraction */
|
/* subtraction */
|
||||||
gboolean gst_value_subtract (GValue *dest,
|
gboolean gst_value_subtract (GValue *dest,
|
||||||
const GValue *minuend,
|
const GValue *minuend,
|
||||||
const GValue *subtrahend);
|
const GValue *subtrahend);
|
||||||
gboolean gst_value_can_subtract (const GValue *minuend,
|
gboolean gst_value_can_subtract (const GValue *minuend,
|
||||||
const GValue *subtrahend);
|
const GValue *subtrahend);
|
||||||
void gst_value_register_subtract_func (GType minuend_type,
|
void gst_value_register_subtract_func (GType minuend_type,
|
||||||
GType subtrahend_type,
|
GType subtrahend_type,
|
||||||
GstValueSubtractFunc func);
|
GstValueSubtractFunc func);
|
||||||
|
|
||||||
/* fixation */
|
/* fixation */
|
||||||
gboolean gst_type_is_fixed (GType type);
|
gboolean gst_type_is_fixed (GType type);
|
||||||
|
|
||||||
/* private */
|
/* private */
|
||||||
void _gst_value_initialize (void);
|
void _gst_value_initialize (void);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
|
|
@ -34,46 +34,58 @@ static gint i;
|
||||||
static gboolean b;
|
static gboolean b;
|
||||||
static gchar *s;
|
static gchar *s;
|
||||||
|
|
||||||
#define TEST_CHECK_FAIL(condition) G_STMT_START{ \
|
#define TEST_CHECK_FAIL(condition) G_STMT_START{ \
|
||||||
if (condition) { \
|
if (condition) { \
|
||||||
g_print ("TEST %2d line %3d OK\n", test, __LINE__); \
|
g_print ("TEST %2d line %3d OK\n", test, __LINE__); \
|
||||||
} else { \
|
} else { \
|
||||||
g_print ("TEST %2d line %3d FAILED : %s\n", test, __LINE__, #condition); \
|
g_print ("TEST %2d line %3d FAILED : %s\n", test, __LINE__, \
|
||||||
return -test; \
|
#condition); \
|
||||||
} \
|
return -test; \
|
||||||
|
} \
|
||||||
}G_STMT_END
|
}G_STMT_END
|
||||||
#define TEST_START(pipeline) G_STMT_START{ \
|
|
||||||
g_print ("TEST %2d line %3d START : %s\n", ++test, __LINE__, pipeline); \
|
#define TEST_START(pipeline) G_STMT_START{ \
|
||||||
cur = gst_parse_launch (pipeline, &error); \
|
g_print ("TEST %2d line %3d START : %s\n", ++test, __LINE__, \
|
||||||
if (error == NULL) { \
|
pipeline); \
|
||||||
g_print ("TEST %2d line %3d CREATED\n", test, __LINE__); \
|
cur = gst_parse_launch (pipeline, &error); \
|
||||||
} else { \
|
if (error == NULL) { \
|
||||||
g_print ("TEST %2d line %3d FAILED : %s\n", test, __LINE__, error->message); \
|
g_print ("TEST %2d line %3d CREATED\n", test, __LINE__); \
|
||||||
g_error_free (error); \
|
} else { \
|
||||||
return -test; \
|
g_print ("TEST %2d line %3d FAILED : %s\n", test, __LINE__, \
|
||||||
} \
|
error->message); \
|
||||||
|
g_error_free (error); \
|
||||||
|
return -test; \
|
||||||
|
} \
|
||||||
}G_STMT_END
|
}G_STMT_END
|
||||||
#define TEST_OK G_STMT_START{ \
|
|
||||||
gst_object_unref (GST_OBJECT (cur)); \
|
#define TEST_OK G_STMT_START{ \
|
||||||
cur = NULL; \
|
gst_object_unref (GST_OBJECT (cur)); \
|
||||||
g_print ("TEST %2d line %3d COMPLETE\n", test, __LINE__); \
|
cur = NULL; \
|
||||||
|
g_print ("TEST %2d line %3d COMPLETE\n", test, __LINE__); \
|
||||||
}G_STMT_END
|
}G_STMT_END
|
||||||
#define TEST_RUN G_STMT_START{ \
|
|
||||||
alarm(10); \
|
#define TEST_RUN G_STMT_START{ \
|
||||||
g_print ("TEST %2d line %3d RUN\n", test, __LINE__); \
|
alarm(10); \
|
||||||
if (gst_element_set_state (cur, GST_STATE_PLAYING) == GST_STATE_FAILURE) { \
|
g_print ("TEST %2d line %3d RUN\n", test, __LINE__); \
|
||||||
g_print ("TEST %2d line %3d FAILED : pipeline could not be set to state PLAYING\n", test, __LINE__); \
|
if (gst_element_set_state (cur, GST_STATE_PLAYING) \
|
||||||
return -test; \
|
== GST_STATE_FAILURE) { \
|
||||||
} \
|
g_print ("TEST %2d line %3d FAILED : " \
|
||||||
iterations = 0; \
|
"pipeline could not be set to PLAYING\n", test, __LINE__); \
|
||||||
while (gst_bin_iterate (GST_BIN (cur))) iterations++; \
|
return -test; \
|
||||||
if (gst_element_set_state (cur, GST_STATE_NULL) == GST_STATE_FAILURE) { \
|
} \
|
||||||
g_print ("TEST %2d line %3d FAILED : pipeline could not be reset to state NULL\n", test, __LINE__); \
|
iterations = 0; \
|
||||||
return -test; \
|
while (gst_bin_iterate (GST_BIN (cur))) iterations++; \
|
||||||
} \
|
if (gst_element_set_state (cur, GST_STATE_NULL) \
|
||||||
g_print ("TEST %2d line %3d STOPPED : %u iterations\n", test, __LINE__, iterations); \
|
== GST_STATE_FAILURE) { \
|
||||||
alarm(0); \
|
g_print ("TEST %2d line %3d FAILED : " \
|
||||||
|
"pipeline could not be reset to state NULL\n", test, __LINE__); \
|
||||||
|
return -test; \
|
||||||
|
} \
|
||||||
|
g_print ("TEST %2d line %3d STOPPED : %u iterations\n", \
|
||||||
|
test, __LINE__, iterations); \
|
||||||
|
alarm(0); \
|
||||||
}G_STMT_END
|
}G_STMT_END
|
||||||
|
|
||||||
#define PIPELINE1 "fakesrc"
|
#define PIPELINE1 "fakesrc"
|
||||||
#define PIPELINE2 "fakesrc name=donald num-buffers= 27 silent =TruE sizetype = 3 eos = falSe data= Subbuffer\\ data"
|
#define PIPELINE2 "fakesrc name=donald num-buffers= 27 silent =TruE sizetype = 3 eos = falSe data= Subbuffer\\ data"
|
||||||
#define PIPELINE3 "fakesrc identity fakesink"
|
#define PIPELINE3 "fakesrc identity fakesink"
|
||||||
|
@ -89,7 +101,6 @@ static gchar *s;
|
||||||
#define PIPELINE10 "( fakesrc num-buffers=\"4\" ! ) identity ! fakesink"
|
#define PIPELINE10 "( fakesrc num-buffers=\"4\" ! ) identity ! fakesink"
|
||||||
#define PIPELINE11 "fakesink name = sink identity name=id ( fakesrc num-buffers=\"4\" ! id. ) id. ! sink."
|
#define PIPELINE11 "fakesink name = sink identity name=id ( fakesrc num-buffers=\"4\" ! id. ) id. ! sink."
|
||||||
|
|
||||||
|
|
||||||
gint
|
gint
|
||||||
main (gint argc, gchar * argv[])
|
main (gint argc, gchar * argv[])
|
||||||
{
|
{
|
||||||
|
@ -107,7 +118,8 @@ main (gint argc, gchar * argv[])
|
||||||
/**
|
/**
|
||||||
* checks:
|
* checks:
|
||||||
* - properties works
|
* - properties works
|
||||||
* - string, int, boolean and enums can be properly set (note: eos should be false)
|
* - string, int, boolean and enums can be properly set
|
||||||
|
* (note: eos should be false)
|
||||||
* - first test of escaping strings
|
* - first test of escaping strings
|
||||||
*/
|
*/
|
||||||
TEST_START (PIPELINE2);
|
TEST_START (PIPELINE2);
|
||||||
|
|
|
@ -34,46 +34,58 @@ static gint i;
|
||||||
static gboolean b;
|
static gboolean b;
|
||||||
static gchar *s;
|
static gchar *s;
|
||||||
|
|
||||||
#define TEST_CHECK_FAIL(condition) G_STMT_START{ \
|
#define TEST_CHECK_FAIL(condition) G_STMT_START{ \
|
||||||
if (condition) { \
|
if (condition) { \
|
||||||
g_print ("TEST %2d line %3d OK\n", test, __LINE__); \
|
g_print ("TEST %2d line %3d OK\n", test, __LINE__); \
|
||||||
} else { \
|
} else { \
|
||||||
g_print ("TEST %2d line %3d FAILED : %s\n", test, __LINE__, #condition); \
|
g_print ("TEST %2d line %3d FAILED : %s\n", test, __LINE__, \
|
||||||
return -test; \
|
#condition); \
|
||||||
} \
|
return -test; \
|
||||||
|
} \
|
||||||
}G_STMT_END
|
}G_STMT_END
|
||||||
#define TEST_START(pipeline) G_STMT_START{ \
|
|
||||||
g_print ("TEST %2d line %3d START : %s\n", ++test, __LINE__, pipeline); \
|
#define TEST_START(pipeline) G_STMT_START{ \
|
||||||
cur = gst_parse_launch (pipeline, &error); \
|
g_print ("TEST %2d line %3d START : %s\n", ++test, __LINE__, \
|
||||||
if (error == NULL) { \
|
pipeline); \
|
||||||
g_print ("TEST %2d line %3d CREATED\n", test, __LINE__); \
|
cur = gst_parse_launch (pipeline, &error); \
|
||||||
} else { \
|
if (error == NULL) { \
|
||||||
g_print ("TEST %2d line %3d FAILED : %s\n", test, __LINE__, error->message); \
|
g_print ("TEST %2d line %3d CREATED\n", test, __LINE__); \
|
||||||
g_error_free (error); \
|
} else { \
|
||||||
return -test; \
|
g_print ("TEST %2d line %3d FAILED : %s\n", test, __LINE__, \
|
||||||
} \
|
error->message); \
|
||||||
|
g_error_free (error); \
|
||||||
|
return -test; \
|
||||||
|
} \
|
||||||
}G_STMT_END
|
}G_STMT_END
|
||||||
#define TEST_OK G_STMT_START{ \
|
|
||||||
gst_object_unref (GST_OBJECT (cur)); \
|
#define TEST_OK G_STMT_START{ \
|
||||||
cur = NULL; \
|
gst_object_unref (GST_OBJECT (cur)); \
|
||||||
g_print ("TEST %2d line %3d COMPLETE\n", test, __LINE__); \
|
cur = NULL; \
|
||||||
|
g_print ("TEST %2d line %3d COMPLETE\n", test, __LINE__); \
|
||||||
}G_STMT_END
|
}G_STMT_END
|
||||||
#define TEST_RUN G_STMT_START{ \
|
|
||||||
alarm(10); \
|
#define TEST_RUN G_STMT_START{ \
|
||||||
g_print ("TEST %2d line %3d RUN\n", test, __LINE__); \
|
alarm(10); \
|
||||||
if (gst_element_set_state (cur, GST_STATE_PLAYING) == GST_STATE_FAILURE) { \
|
g_print ("TEST %2d line %3d RUN\n", test, __LINE__); \
|
||||||
g_print ("TEST %2d line %3d FAILED : pipeline could not be set to state PLAYING\n", test, __LINE__); \
|
if (gst_element_set_state (cur, GST_STATE_PLAYING) \
|
||||||
return -test; \
|
== GST_STATE_FAILURE) { \
|
||||||
} \
|
g_print ("TEST %2d line %3d FAILED : " \
|
||||||
iterations = 0; \
|
"pipeline could not be set to PLAYING\n", test, __LINE__); \
|
||||||
while (gst_bin_iterate (GST_BIN (cur))) iterations++; \
|
return -test; \
|
||||||
if (gst_element_set_state (cur, GST_STATE_NULL) == GST_STATE_FAILURE) { \
|
} \
|
||||||
g_print ("TEST %2d line %3d FAILED : pipeline could not be reset to state NULL\n", test, __LINE__); \
|
iterations = 0; \
|
||||||
return -test; \
|
while (gst_bin_iterate (GST_BIN (cur))) iterations++; \
|
||||||
} \
|
if (gst_element_set_state (cur, GST_STATE_NULL) \
|
||||||
g_print ("TEST %2d line %3d STOPPED : %u iterations\n", test, __LINE__, iterations); \
|
== GST_STATE_FAILURE) { \
|
||||||
alarm(0); \
|
g_print ("TEST %2d line %3d FAILED : " \
|
||||||
|
"pipeline could not be reset to state NULL\n", test, __LINE__); \
|
||||||
|
return -test; \
|
||||||
|
} \
|
||||||
|
g_print ("TEST %2d line %3d STOPPED : %u iterations\n", \
|
||||||
|
test, __LINE__, iterations); \
|
||||||
|
alarm(0); \
|
||||||
}G_STMT_END
|
}G_STMT_END
|
||||||
|
|
||||||
#define PIPELINE1 "fakesrc"
|
#define PIPELINE1 "fakesrc"
|
||||||
#define PIPELINE2 "fakesrc name=donald num-buffers= 27 silent =TruE sizetype = 3 eos = falSe data= Subbuffer\\ data"
|
#define PIPELINE2 "fakesrc name=donald num-buffers= 27 silent =TruE sizetype = 3 eos = falSe data= Subbuffer\\ data"
|
||||||
#define PIPELINE3 "fakesrc identity fakesink"
|
#define PIPELINE3 "fakesrc identity fakesink"
|
||||||
|
@ -89,7 +101,6 @@ static gchar *s;
|
||||||
#define PIPELINE10 "( fakesrc num-buffers=\"4\" ! ) identity ! fakesink"
|
#define PIPELINE10 "( fakesrc num-buffers=\"4\" ! ) identity ! fakesink"
|
||||||
#define PIPELINE11 "fakesink name = sink identity name=id ( fakesrc num-buffers=\"4\" ! id. ) id. ! sink."
|
#define PIPELINE11 "fakesink name = sink identity name=id ( fakesrc num-buffers=\"4\" ! id. ) id. ! sink."
|
||||||
|
|
||||||
|
|
||||||
gint
|
gint
|
||||||
main (gint argc, gchar * argv[])
|
main (gint argc, gchar * argv[])
|
||||||
{
|
{
|
||||||
|
@ -107,7 +118,8 @@ main (gint argc, gchar * argv[])
|
||||||
/**
|
/**
|
||||||
* checks:
|
* checks:
|
||||||
* - properties works
|
* - properties works
|
||||||
* - string, int, boolean and enums can be properly set (note: eos should be false)
|
* - string, int, boolean and enums can be properly set
|
||||||
|
* (note: eos should be false)
|
||||||
* - first test of escaping strings
|
* - first test of escaping strings
|
||||||
*/
|
*/
|
||||||
TEST_START (PIPELINE2);
|
TEST_START (PIPELINE2);
|
||||||
|
|
Loading…
Reference in a new issue