From: <tho...@fr...> - 2004-07-15 16:39:42
|
CVS Root: /cvs/gstreamer Module: gstreamer Changes by: thomasvs Date: Fri Jul 16 2004 02:21:02 EST Log message: debugging additions and style cleanups Modified files: . : ChangeLog gst : gstelement.c gstpad.c gststructure.c gstthread.c gstvalue.c gstvalue.h testsuite/parse : parse1.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.677&r2=1.678 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstelement.c.diff?r1=1.295&r2=1.296 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstpad.c.diff?r1=1.336&r2=1.337 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gststructure.c.diff?r1=1.32&r2=1.33 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstthread.c.diff?r1=1.128&r2=1.129 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstvalue.c.diff?r1=1.38&r2=1.39 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstvalue.h.diff?r1=1.23&r2=1.24 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/testsuite/parse/parse1.c.diff?r1=1.8&r2=1.9 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.677 retrieving revision 1.678 diff -u -d -r1.677 -r1.678 --- ChangeLog 15 Jul 2004 16:08:48 -0000 1.677 +++ ChangeLog 15 Jul 2004 16:20:50 -0000 1.678 @@ -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> * docs/manual/states.xml: Grammar fix @@ -26,7 +37,7 @@ 2004-07-15 Benjamin Otte <ot...@gn...> * 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. * gst/gstelement.c (gst_element_class_init): GError's are boxed, not objects Index: gstelement.c RCS file: /cvs/gstreamer/gstreamer/gst/gstelement.c,v retrieving revision 1.295 retrieving revision 1.296 diff -u -d -r1.295 -r1.296 --- gstelement.c 15 Jul 2004 02:26:48 -0000 1.295 +++ gstelement.c 15 Jul 2004 16:20:50 -0000 1.296 @@ -2726,6 +2726,8 @@ GstElementClass *klass = GST_ELEMENT_GET_CLASS (element); 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); /* a set_state function is mandatory */ g_return_val_if_fail (klass->set_state, GST_STATE_FAILURE); Index: gstpad.c RCS file: /cvs/gstreamer/gstreamer/gst/gstpad.c,v retrieving revision 1.336 retrieving revision 1.337 diff -u -d -r1.336 -r1.337 --- gstpad.c 14 Jul 2004 15:28:51 -0000 1.336 +++ gstpad.c 15 Jul 2004 16:20:50 -0000 1.337 @@ -1482,6 +1482,7 @@ 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 */ if (!gst_caps_is_fixed (caps)) { GST_CAT_INFO (GST_CAT_CAPS, Index: gststructure.c RCS file: /cvs/gstreamer/gstreamer/gst/gststructure.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- gststructure.c 12 Jul 2004 10:03:04 -0000 1.32 +++ gststructure.c 15 Jul 2004 16:20:50 -0000 1.33 @@ -984,7 +984,10 @@ {"f", G_TYPE_FLOAT}, {"double", G_TYPE_DOUBLE}, {"d", G_TYPE_DOUBLE}, +/* these are implemented with strcmp below */ +//{ "buffer", GST_TYPE_BUFFER }, //{ "fourcc", GST_TYPE_FOURCC }, +//{ "4", GST_TYPE_FOURCC }, {"boolean", G_TYPE_BOOLEAN}, {"bool", G_TYPE_BOOLEAN}, {"b", G_TYPE_BOOLEAN}, Index: gstthread.c RCS file: /cvs/gstreamer/gstreamer/gst/gstthread.c,v retrieving revision 1.128 retrieving revision 1.129 diff -u -d -r1.128 -r1.129 --- gstthread.c 9 Jul 2004 15:03:51 -0000 1.128 +++ gstthread.c 15 Jul 2004 16:20:50 -0000 1.129 @@ -540,7 +540,7 @@ gst_element_state_get_name (newstate)); if (parent_class->child_state_change) 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 the lock. But this doesn't cause any problems. */ if (newstate == GST_STATE_PLAYING) Index: gstvalue.c RCS file: /cvs/gstreamer/gstreamer/gst/gstvalue.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- gstvalue.c 13 Jul 2004 14:17:01 -0000 1.38 +++ gstvalue.c 15 Jul 2004 16:20:50 -0000 1.39 @@ -53,7 +53,6 @@ }; GType gst_type_fourcc; -GType gst_type_fourcc; GType gst_type_int_range; GType gst_type_double_range; GType gst_type_list; @@ -64,9 +63,9 @@ static GArray *gst_value_intersect_funcs; static GArray *gst_value_subtract_funcs; -/********/ -/* list */ +/******** + * list * + ********/ /* two helper functions to serialize/stringify any type of list * regular lists are done with { }, fixed lists with < > @@ -399,8 +398,9 @@ return FALSE; } -/*************************************/ -/* fourcc */ +/********** + * fourcc * + **********/ static void gst_value_init_fourcc (GValue * value) @@ -530,8 +530,9 @@ return ret; -/* int range */ +/************* + * int range * + *************/ gst_value_init_int_range (GValue * value) @@ -602,7 +603,7 @@ * * Gets the minimum of the range specified by @value. - * Returns: the minumum of the range + * Returns: the minimum of the range */ int gst_value_get_int_range_min (const GValue * value) @@ -659,8 +660,9 @@ -/* double range */ +/**************** + * double range * + ****************/ gst_value_init_double_range (GValue * value) @@ -795,8 +797,9 @@ -/* GstCaps */ +/*********** + * GstCaps * + ***********/ /** * gst_value_set_caps: @@ -830,8 +833,9 @@ return (GstCaps *) g_value_get_boxed (value); -/* GstBuffer */ + * GstBuffer * static int gst_value_compare_buffer (const GValue * value1, const GValue * value2) @@ -910,8 +914,9 @@ -/* boolean */ + * boolean * gst_value_compare_boolean (const GValue * value1, const GValue * value2) @@ -950,8 +955,9 @@ -/* ints */ +/******* + * int * + *******/ gst_strtoll (const char *s, char **end, int base) @@ -1102,8 +1108,9 @@ CREATE_USERIALIZATION (uint64, UINT64) CREATE_USERIALIZATION (ulong, ULONG) -/* double */ + * double * static int gst_value_compare_double (const GValue * value1, const GValue * value2) { @@ -1150,8 +1157,9 @@ -/* float */ +/********* + * float * + *********/ gst_value_compare_float (const GValue * value1, const GValue * value2) @@ -1201,8 +1209,9 @@ -/* string */ + * string * gst_value_compare_string (const GValue * value1, const GValue * value2) @@ -1283,8 +1292,9 @@ return TRUE; -/* enums */ + * enum * gst_value_compare_enum (const GValue * value1, const GValue * value2) @@ -1345,8 +1355,9 @@ -/* unions */ + * union * static gboolean gst_value_union_int_int_range (GValue * dest, const GValue * src1, @@ -1388,8 +1399,9 @@ -/* intersection */ + * intersection * gst_value_intersect_int_int_range (GValue * dest, const GValue * src1, @@ -1512,8 +1524,9 @@ -/* subtraction */ +/*************** + * subtraction * + ***************/ gst_value_subtract_int_int_range (GValue * dest, const GValue * minuend, @@ -1764,7 +1777,9 @@ +/************** + * comparison * + **************/ * gst_value_can_compare: Index: gstvalue.h RCS file: /cvs/gstreamer/gstreamer/gst/gstvalue.h,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- gstvalue.h 20 May 2004 17:03:02 -0000 1.23 +++ gstvalue.h 15 Jul 2004 16:20:50 -0000 1.24 @@ -84,91 +84,93 @@ extern GType gst_type_list; extern GType gst_type_fixed_list; -void gst_value_register (const GstValueTable *table); -void gst_value_init_and_copy (GValue *dest, - const GValue *src); +void gst_value_register (const GstValueTable *table); +void gst_value_init_and_copy (GValue *dest, + const GValue *src); -gchar * gst_value_serialize (const GValue *value); -gboolean gst_value_deserialize (GValue *dest, - const gchar *src); +gchar * gst_value_serialize (const GValue *value); +gboolean gst_value_deserialize (GValue *dest, + const gchar *src); /* list */ -void gst_value_list_append_value (GValue *value, - const GValue *append_value); -void gst_value_list_prepend_value (GValue *value, - const GValue *prepend_value); -void gst_value_list_concat (GValue *dest, - const GValue *value1, - const GValue *value2); -guint gst_value_list_get_size (const GValue *value); -G_CONST_RETURN GValue * gst_value_list_get_value (const GValue *value, - guint index); +void gst_value_list_append_value (GValue *value, + const GValue *append_value); +void gst_value_list_prepend_value (GValue *value, + const GValue *prepend_value); +void gst_value_list_concat (GValue *dest, + const GValue *value1, + const GValue *value2); +guint gst_value_list_get_size (const GValue *value); +G_CONST_RETURN GValue * + gst_value_list_get_value (const GValue *value, + guint index); /* fourcc */ -void gst_value_set_fourcc (GValue *value, - guint32 fourcc); -guint32 gst_value_get_fourcc (const GValue *value); +void gst_value_set_fourcc (GValue *value, + guint32 fourcc); +guint32 gst_value_get_fourcc (const GValue *value); /* int range */ -void gst_value_set_int_range (GValue *value, - int start, - int end); -int gst_value_get_int_range_min (const GValue *value); -int gst_value_get_int_range_max (const GValue *value); +void gst_value_set_int_range (GValue *value, + int start, + int end); +int gst_value_get_int_range_min (const GValue *value); +int gst_value_get_int_range_max (const GValue *value); /* double range */ -void gst_value_set_double_range (GValue *value, - double start, - double end); -double gst_value_get_double_range_min (const GValue *value); -double gst_value_get_double_range_max (const GValue *value); +void gst_value_set_double_range (GValue *value, + double start, + double end); +double gst_value_get_double_range_min (const GValue *value); +double gst_value_get_double_range_max (const GValue *value); /* caps */ -G_CONST_RETURN GstCaps * gst_value_get_caps (const GValue *value); -void gst_value_set_caps (GValue *value, - const GstCaps *caps); +G_CONST_RETURN GstCaps * + gst_value_get_caps (const GValue *value); +void gst_value_set_caps (GValue *value, + const GstCaps *caps); /* compare */ -int gst_value_compare (const GValue *value1, -gboolean gst_value_can_compare (const GValue *value1, - const GValue *value2); +int gst_value_compare (const GValue *value1, +gboolean gst_value_can_compare (const GValue *value1, /* union */ -gboolean gst_value_union (GValue *dest, -gboolean gst_value_can_union (const GValue *value1, -void gst_value_register_union_func (GType type1, - GType type2, - GstValueUnionFunc func); +gboolean gst_value_union (GValue *dest, + const GValue *value1, +gboolean gst_value_can_union (const GValue *value1, + const GValue *value2); +void gst_value_register_union_func (GType type1, + GType type2, + GstValueUnionFunc func); /* intersection */ -gboolean gst_value_intersect (GValue *dest, -gboolean gst_value_can_intersect (const GValue *value1, -void gst_value_register_intersect_func (GType type1, - GstValueIntersectFunc func); +gboolean gst_value_intersect (GValue *dest, +gboolean gst_value_can_intersect (const GValue *value1, +void gst_value_register_intersect_func (GType type1, + GType type2, + GstValueIntersectFunc func); /* subtraction */ -gboolean gst_value_subtract (GValue *dest, - const GValue *minuend, - const GValue *subtrahend); -gboolean gst_value_can_subtract (const GValue *minuend, -void gst_value_register_subtract_func (GType minuend_type, - GType subtrahend_type, - GstValueSubtractFunc func); +gboolean gst_value_subtract (GValue *dest, + const GValue *minuend, + const GValue *subtrahend); +gboolean gst_value_can_subtract (const GValue *minuend, +void gst_value_register_subtract_func (GType minuend_type, + GType subtrahend_type, + GstValueSubtractFunc func); /* fixation */ -gboolean gst_type_is_fixed (GType type); +gboolean gst_type_is_fixed (GType type); /* private */ -void _gst_value_initialize (void); +void _gst_value_initialize (void); G_END_DECLS Index: parse1.c RCS file: /cvs/gstreamer/gstreamer/testsuite/parse/parse1.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- parse1.c 18 May 2004 01:36:14 -0000 1.8 +++ parse1.c 15 Jul 2004 16:20:50 -0000 1.9 @@ -34,46 +34,58 @@ static gboolean b; static gchar *s; -#define TEST_CHECK_FAIL(condition) G_STMT_START{ \ - if (condition) { \ - g_print ("TEST %2d line %3d OK\n", test, __LINE__); \ - } else { \ - g_print ("TEST %2d line %3d FAILED : %s\n", test, __LINE__, #condition); \ - return -test; \ - } \ +#define TEST_CHECK_FAIL(condition) G_STMT_START{ \ + if (condition) { \ + g_print ("TEST %2d line %3d OK\n", test, __LINE__); \ + } else { \ + g_print ("TEST %2d line %3d FAILED : %s\n", test, __LINE__, \ + #condition); \ + return -test; \ + } \ }G_STMT_END -#define TEST_START(pipeline) G_STMT_START{ \ - g_print ("TEST %2d line %3d START : %s\n", ++test, __LINE__, pipeline); \ - cur = gst_parse_launch (pipeline, &error); \ - if (error == NULL) { \ - g_print ("TEST %2d line %3d CREATED\n", test, __LINE__); \ - g_print ("TEST %2d line %3d FAILED : %s\n", test, __LINE__, error->message); \ - g_error_free (error); \ +#define TEST_START(pipeline) G_STMT_START{ \ + g_print ("TEST %2d line %3d START : %s\n", ++test, __LINE__, \ + pipeline); \ + cur = gst_parse_launch (pipeline, &error); \ + if (error == NULL) { \ + g_print ("TEST %2d line %3d CREATED\n", test, __LINE__); \ + g_print ("TEST %2d line %3d FAILED : %s\n", test, __LINE__, \ + error->message); \ + g_error_free (error); \ -#define TEST_OK G_STMT_START{ \ - gst_object_unref (GST_OBJECT (cur)); \ - cur = NULL; \ - g_print ("TEST %2d line %3d COMPLETE\n", test, __LINE__); \ +#define TEST_OK G_STMT_START{ \ + gst_object_unref (GST_OBJECT (cur)); \ + cur = NULL; \ + g_print ("TEST %2d line %3d COMPLETE\n", test, __LINE__); \ -#define TEST_RUN G_STMT_START{ \ - alarm(10); \ - g_print ("TEST %2d line %3d RUN\n", test, __LINE__); \ - if (gst_element_set_state (cur, GST_STATE_PLAYING) == GST_STATE_FAILURE) { \ - g_print ("TEST %2d line %3d FAILED : pipeline could not be set to state PLAYING\n", test, __LINE__); \ - iterations = 0; \ - while (gst_bin_iterate (GST_BIN (cur))) iterations++; \ - 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__); \ - g_print ("TEST %2d line %3d STOPPED : %u iterations\n", test, __LINE__, iterations); \ - alarm(0); \ +#define TEST_RUN G_STMT_START{ \ + alarm(10); \ + g_print ("TEST %2d line %3d RUN\n", test, __LINE__); \ + if (gst_element_set_state (cur, GST_STATE_PLAYING) \ + == GST_STATE_FAILURE) { \ + g_print ("TEST %2d line %3d FAILED : " \ + "pipeline could not be set to PLAYING\n", test, __LINE__); \ + iterations = 0; \ + while (gst_bin_iterate (GST_BIN (cur))) iterations++; \ + if (gst_element_set_state (cur, GST_STATE_NULL) \ + "pipeline could not be reset to state NULL\n", test, __LINE__); \ + g_print ("TEST %2d line %3d STOPPED : %u iterations\n", \ + test, __LINE__, iterations); \ + alarm(0); \ #define PIPELINE1 "fakesrc" #define PIPELINE2 "fakesrc name=donald num-buffers= 27 silent =TruE sizetype = 3 eos = falSe data= Subbuffer\\ data" #define PIPELINE3 "fakesrc identity fakesink" @@ -89,7 +101,6 @@ #define PIPELINE10 "( fakesrc num-buffers=\"4\" ! ) identity ! fakesink" #define PIPELINE11 "fakesink name = sink identity name=id ( fakesrc num-buffers=\"4\" ! id. ) id. ! sink." - gint main (gint argc, gchar * argv[]) @@ -107,7 +118,8 @@ /** * checks: * - 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 */ TEST_START (PIPELINE2); |