From: David S. <ds...@pd...> - 2003-12-22 01:57:53
|
CVS Root: /home/cvs/gstreamer Module: gstreamer Changes by: ds Date: Sun Dec 21 2003 17:58:32 PST Log message: rename gstcaps2.[ch] to gstcaps.[ch] Modified files: . : ChangeLog gst : Makefile.am gst.h gstcaps.c gstcaps.h gstpad.h gsttypefind.h gstvalue.h Removed files: gst : gstcaps2.c gstcaps2.h Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.35&r2=1.36 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/Makefile.am.diff?r1=1.149&r2=1.150 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gst.h.diff?r1=1.58&r2=1.59 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstcaps.c.diff?r1=1.76&r2=1.77 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstcaps.h.diff?r1=1.57&r2=1.58 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstcaps2.c http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstcaps2.h http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstpad.h.diff?r1=1.129&r2=1.130 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gsttypefind.h.diff?r1=1.19&r2=1.20 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstvalue.h.diff?r1=1.7&r2=1.8 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- ChangeLog 21 Dec 2003 18:59:06 -0000 1.35 +++ ChangeLog 22 Dec 2003 01:58:20 -0000 1.36 @@ -1,3 +1,16 @@ +2003-12-21 David Schleef <ds...@sc...> + + * many, many files: Merge CAPS branch. This includes: + - implemention of GstValue and several GstValue types + - implemention of GstStructure + - entire rewrite of GstCaps + - removal of GstProps + - many changes to GstPad to compensate for new caps paradigm + - removal of GstBufferpool + * gst/Makefile.am, gst/gst.h, gst/gstpad.h, gst/gsttypefind.h, + gstvalue.h, gst/gstcaps[2]*.[ch]: + - rename gstcaps2.[ch] to gstcaps.[ch] + 2003-12-21 Ronald Bultje <rb...@ro...> * gst/gstqueue.c: (gst_queue_handle_pending_events), Index: Makefile.am =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/Makefile.am,v retrieving revision 1.149 retrieving revision 1.150 diff -u -d -r1.149 -r1.150 --- Makefile.am 22 Dec 2003 01:39:34 -0000 1.149 +++ Makefile.am 22 Dec 2003 01:58:20 -0000 1.150 @@ -80,7 +80,7 @@ gstatomic.c \ gstbin.c \ gstbuffer.c \ - gstcaps2.c \ + gstcaps.c \ gstclock.c \ gstcpu.c \ gstdata.c \ @@ -141,7 +141,7 @@ gstobject.h \ gstbin.h \ gstbuffer.h \ - gstcaps2.h \ + gstcaps.h \ gstclock.h \ gstcompat.h \ gstcpu.h \ Index: gst.h =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gst.h,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- gst.h 22 Dec 2003 01:39:34 -0000 1.58 +++ gst.h 22 Dec 2003 01:58:20 -0000 1.59 @@ -33,7 +33,7 @@ #include <gst/gstbin.h> #include <gst/gstbuffer.h> -#include <gst/gstcaps2.h> +#include <gst/gstcaps.h> #include <gst/gstclock.h> #include <gst/gstcpu.h> #include <gst/gstelement.h> --- gstcaps2.c DELETED --- --- gstcaps2.h DELETED --- Index: gstpad.h =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstpad.h,v retrieving revision 1.129 retrieving revision 1.130 diff -u -d -r1.129 -r1.130 --- gstpad.h 22 Dec 2003 01:39:34 -0000 1.129 +++ gstpad.h 22 Dec 2003 01:58:20 -0000 1.130 @@ -28,7 +28,7 @@ #include <gst/gstobject.h> #include <gst/gstbuffer.h> -#include <gst/gstcaps2.h> +#include <gst/gstcaps.h> #include <gst/gstevent.h> #include <gst/gstprobe.h> #include <gst/gstquery.h> Index: gsttypefind.h =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gsttypefind.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- gsttypefind.h 22 Dec 2003 01:39:34 -0000 1.19 +++ gsttypefind.h 22 Dec 2003 01:58:20 -0000 1.20 @@ -24,7 +24,7 @@ #define __GST_TYPE_FIND_H__ #include <gst/gstbuffer.h> -#include <gst/gstcaps2.h> +#include <gst/gstcaps.h> #include <gst/gstplugin.h> #include <gst/gstpluginfeature.h> #include <gst/gsttypes.h> Index: gstvalue.h =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstvalue.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- gstvalue.h 22 Dec 2003 01:39:34 -0000 1.7 +++ gstvalue.h 22 Dec 2003 01:58:20 -0000 1.8 @@ -21,7 +21,7 @@ #define __GST_VALUE_H__ #include <gst/gstconfig.h> -#include <gst/gstcaps2.h> +#include <gst/gstcaps.h> G_BEGIN_DECLS |
From: David S. <ds...@pd...> - 2003-12-23 20:57:36
|
CVS Root: /home/cvs/gstreamer Module: gstreamer Changes by: ds Date: Tue Dec 23 2003 12:58:17 PST Log message: Rearrange lots of code. Change registration of compare function into registration of compare/serialize/deserialize functions. Modified files: . : ChangeLog gst : gstvalue.c gstvalue.h Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.43&r2=1.44 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstvalue.c.diff?r1=1.7&r2=1.8 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstvalue.h.diff?r1=1.9&r2=1.10 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- ChangeLog 23 Dec 2003 18:36:26 -0000 1.43 +++ ChangeLog 23 Dec 2003 20:58:05 -0000 1.44 @@ -1,3 +1,12 @@ +2003-12-23 David Schleef <ds...@sc...> + + * gst/gstvalue.c: + * gst/gstvalue.h: + Rearrange lots of code. Change registration of compare function + into registration of compare/serialize/deserialize functions. + Doesn't include implementation of gst_value_[de]serialize(), + but that should be easy. + 2003-12-23 Thomas Vander Stichele <thomas at apestaart dot org> * docs/gst/gstreamer-sections.txt: Index: gstvalue.c =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstvalue.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- gstvalue.c 22 Dec 2003 19:28:07 -0000 1.7 +++ gstvalue.c 23 Dec 2003 20:58:05 -0000 1.8 @@ -25,11 +25,6 @@ #include <gst/gst.h> #include <gobject/gvaluecollector.h> -typedef struct _GstValueCompareInfo GstValueCompareInfo; -struct _GstValueCompareInfo { - GType type; - GstValueCompareFunc func; -}; typedef struct _GstValueUnionInfo GstValueUnionInfo; struct _GstValueUnionInfo { [...1003 lines suppressed...] - - gst_value_register_compare_func (G_TYPE_BOOLEAN, gst_value_compare_boolean); - gst_value_register_compare_func (G_TYPE_INT, gst_value_compare_int); - gst_value_register_compare_func (G_TYPE_FLOAT, gst_value_compare_float); - gst_value_register_compare_func (G_TYPE_DOUBLE, gst_value_compare_double); - gst_value_register_compare_func (G_TYPE_STRING, gst_value_compare_string); - gst_value_register_compare_func (GST_TYPE_FOURCC, gst_value_compare_fourcc); - gst_value_register_compare_func (GST_TYPE_INT_RANGE, gst_value_compare_int_range); - gst_value_register_compare_func (GST_TYPE_DOUBLE_RANGE, gst_value_compare_double_range); - gst_value_register_compare_func (GST_TYPE_LIST, gst_value_compare_list); - - gst_value_union_funcs = g_array_new(FALSE, FALSE, - sizeof(GstValueUnionInfo)); - - gst_value_intersect_funcs = g_array_new(FALSE, FALSE, - sizeof(GstValueIntersectInfo)); - gst_value_register_intersect_func (G_TYPE_INT, GST_TYPE_INT_RANGE, gst_value_intersect_int_int_range); gst_value_register_intersect_func (GST_TYPE_INT_RANGE, GST_TYPE_INT_RANGE, Index: gstvalue.h =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstvalue.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- gstvalue.h 22 Dec 2003 06:56:27 -0000 1.9 +++ gstvalue.h 23 Dec 2003 20:58:05 -0000 1.10 @@ -27,11 +27,24 @@ typedef int (* GstValueCompareFunc) (const GValue *value1, const GValue *value2); +typedef char * (* GstValueSerializeFunc) (const GValue *value1); +typedef gboolean (* GstValueDeserializeFunc) (GValue *dest, const char *s); typedef int (* GstValueUnionFunc) (GValue *dest, const GValue *value1, const GValue *value2); typedef int (* GstValueIntersectFunc) (GValue *dest, const GValue *value1, const GValue *value2); +typedef struct _GstValueTable GstValueTable; +struct _GstValueTable { + GType type; + GstValueCompareFunc compare; + GstValueSerializeFunc serialize; + GstValueDeserializeFunc unserialize; + + void *_gst_paddding [GST_PADDING]; +}; + + #define GST_MAKE_FOURCC(a,b,c,d) (guint32)((a)|(b)<<8|(c)<<16|(d)<<24) #define GST_STR_FOURCC(f) (guint32)(((f)[0])|((f)[1]<<8)|((f)[2]<<16)|((f)[3]<<24)) @@ -63,32 +76,58 @@ extern GType gst_type_double_range; extern GType gst_type_list; +/* list */ + +void gst_value_list_prepend_value (GValue *value, const GValue *prepend_value); +void gst_value_list_append_value (GValue *value, const GValue *append_value); +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_concat (GValue *dest, const GValue *value1, const GValue *value2); + +/* fourcc */ + 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); +/* 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); +/* caps */ + G_CONST_RETURN GstCaps *gst_value_get_caps (const GValue *value); void gst_value_set_caps (GValue *calue, const GstCaps *caps); -void gst_value_list_prepend_value (GValue *value, const GValue *prepend_value); -void gst_value_list_append_value (GValue *value, const GValue *append_value); -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_concat (GValue *dest, const GValue *value1, const GValue *value2); +/* compare */ -void _gst_value_initialize (void); +gboolean gst_value_can_compare (const GValue *value1, const GValue *value2); +int gst_value_compare (const GValue *value1, const GValue *value2); + +/* union */ + +gboolean gst_value_can_union (const GValue *value1, const GValue *value2); +gboolean gst_value_union (GValue *dest, const GValue *value1, const GValue *value2); +void gst_value_register_union_func (GType type1, GType type2, GstValueUnionFunc func); + +/* intersection */ + +gboolean gst_value_can_intersect (const GValue *value1, const GValue *value2); +gboolean gst_value_intersect (GValue *dest, const GValue *value1, const GValue *value2); +void gst_value_register_intersect_func (GType type1, GType type2, GstValueIntersectFunc func); +/* */ + +void gst_value_register (const GstValueTable *table); void gst_value_init_and_copy (GValue *dest, const GValue *src); -int gst_value_compare (const GValue *src1, const GValue *src2); -gboolean gst_value_intersect (GValue *dest, const GValue *src1, const GValue *src2); -gboolean gst_value_union (GValue *dest, const GValue *src1, const GValue *src2); +void _gst_value_initialize (void); G_END_DECLS |
From: David S. <ds...@pd...> - 2003-12-23 21:39:06
|
CVS Root: /home/cvs/gstreamer Module: gstreamer Changes by: ds Date: Tue Dec 23 2003 13:39:47 PST Log message: * gst/gstpad.c: Rearrange/rewrite much of the pad negotiation code, since it resembled pasta. This actually changes the way some negotiation works, since the previous code was inconsistent depending on how it was invoked. Add (internal) structure GstPadLink, which is used to hold some information (more in the future) about the link between two pads. Fixes a number of bugs, including random lossage of filter caps when the initial negotiation is delayed. A few functions are still unimplemented. * gst/gstpad.h: Add GST_PAD_LINK_{SUCESSFUL|FAILED}() macros. Please use these when testing GstPadLinkReturn values instead of comparing directly. Modified files: . : ChangeLog gst : gstpad.c gstpad.h Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.44&r2=1.45 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstpad.c.diff?r1=1.240&r2=1.241 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstpad.h.diff?r1=1.130&r2=1.131 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- ChangeLog 23 Dec 2003 20:58:05 -0000 1.44 +++ ChangeLog 23 Dec 2003 21:39:35 -0000 1.45 @@ -1,5 +1,22 @@ 2003-12-23 David Schleef <ds...@sc...> + * gst/gstpad.c: + Rearrange/rewrite much of the pad negotiation code, since it + resembled pasta. This actually changes the way some + negotiation works, since the previous code was inconsistent + depending on how it was invoked. Add (internal) structure + GstPadLink, which is used to hold some information (more in + the future) about the link between two pads. Fixes a number + of bugs, including random lossage of filter caps when the + initial negotiation is delayed. A few functions are still + unimplemented. + * gst/gstpad.h: + Add GST_PAD_LINK_{SUCESSFUL|FAILED}() macros. Please use + these when testing GstPadLinkReturn values instead of comparing + directly. + +2003-12-23 David Schleef <ds...@sc...> + * gst/gstvalue.c: * gst/gstvalue.h: Rearrange lots of code. Change registration of compare function Index: gstpad.c =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstpad.c,v retrieving revision 1.240 retrieving revision 1.241 diff -u -d -r1.240 -r1.241 --- gstpad.c 22 Dec 2003 01:39:34 -0000 1.240 +++ gstpad.c 23 Dec 2003 21:39:35 -0000 1.241 @@ -31,6 +31,8 @@ #include "gstinfo.h" #include "gstvalue.h" +#define GST_CAT_DEFAULT GST_CAT_PADS + /* FIXME */ #define gst_caps_debug(a,b) GST_DEBUG_CAPS(b,a) @@ -51,10 +53,7 @@ static void gst_pad_init (GstPad *pad); static void gst_pad_dispose (GObject *object); [...1029 lines suppressed...] - mycaps = gst_caps_copy(caps); - - if (peer && gst_pad_try_set_caps_func (peer, mycaps, TRUE) < 0) - return GST_PAD_LINK_REFUSED; - if (gst_pad_try_set_caps_func (realpad, mycaps, FALSE) < 0) - return GST_PAD_LINK_REFUSED; - - return GST_PAD_LINK_OK; + return gst_pad_try_set_caps (pad, caps); } /** @@ -2442,6 +2239,7 @@ g_return_if_fail (GST_IS_PAD (pad)); g_return_if_fail (GST_PAD_DIRECTION (pad) == GST_PAD_SRC); + g_return_if_fail (data != NULL); if (!gst_probe_dispatcher_dispatch (&(GST_REAL_PAD (pad)->probedisp), &data)) return; Index: gstpad.h =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstpad.h,v retrieving revision 1.130 retrieving revision 1.131 diff -u -d -r1.130 -r1.131 --- gstpad.h 22 Dec 2003 01:58:20 -0000 1.130 +++ gstpad.h 23 Dec 2003 21:39:35 -0000 1.131 @@ -81,7 +81,7 @@ /*typedef struct _GstPadTemplate GstPadTemplate;*/ /*typedef struct _GstPadTemplateClass GstPadTemplateClass;*/ typedef struct _GstStaticPadTemplate GstStaticPadTemplate; - +typedef struct _GstPadLink GstPadLink; typedef enum { GST_PAD_LINK_REFUSED = -1, @@ -90,6 +90,9 @@ GST_PAD_LINK_DONE = 2 } GstPadLinkReturn; +#define GST_PAD_LINK_FAILED(ret) (ret < GST_PAD_LINK_OK) +#define GST_PAD_LINK_SUCCESSFUL(ret) (ret >= GST_PAD_LINK_OK) + /* convenience functions */ #ifdef G_HAVE_ISO_VARARGS #define GST_PAD_QUERY_TYPE_FUNCTION(functionname, ...) GST_QUERY_TYPE_FUNCTION (GstPad *, functionname, __VA_ARGS__); @@ -195,7 +198,9 @@ GstProbeDispatcher probedisp; - gpointer _gst_reserved[GST_PADDING]; + GstPadLink *link; + + gpointer _gst_reserved[GST_PADDING - 1]; }; struct _GstRealPadClass { @@ -255,6 +260,7 @@ #define GST_RPAD_GETCAPSFUNC(pad) (((GstRealPad *)(pad))->getcapsfunc) #define GST_RPAD_FIXATEFUNC(pad) (((GstRealPad *)(pad))->fixatefunc) #define GST_RPAD_BUFFERALLOCFUNC(pad) (((GstRealPad *)(pad))->bufferallocfunc) +#define GST_RPAD_LINK(pad) (((GstRealPad *)(pad))->link) /* GstGhostPad */ #define GST_GPAD_REALPAD(pad) (((GstGhostPad *)(pad))->realpad) |
From: David S. <ds...@pd...> - 2003-12-30 04:59:11
|
CVS Root: /home/cvs/gstreamer Module: gstreamer Changes by: ds Date: Mon Dec 29 2003 21:00:00 PST Log message: * gst/gstcaps.c: (gst_caps_normalize), (simplify_foreach), (gst_caps_structure_simplify), (gst_caps_simplify): * gst/gstcaps.h: Add simplify function * gst/gstpad.c: (gst_pad_link_try), (gst_pad_try_set_caps), (gst_pad_perform_negotiate), (gst_pad_is_negotiated): * gst/gstpad.h: Copy over srcnotify, sinknotify when calling old pad_link functions. Add new is_negotiated() function. * gst/gststructure.c: (gst_structure_copy): Fix an incredibly stupid bug that should have been noticed weeks ago. _copy() returned the argument, not the new copy. Modified files: . : ChangeLog gst : gstcaps.c gstcaps.h gstpad.c gstpad.h gststructure.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.56&r2=1.57 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstcaps.c.diff?r1=1.79&r2=1.80 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstcaps.h.diff?r1=1.59&r2=1.60 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstpad.c.diff?r1=1.248&r2=1.249 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstpad.h.diff?r1=1.133&r2=1.134 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gststructure.c.diff?r1=1.7&r2=1.8 ====Begin Diffs==== Index: gstcaps.c =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstcaps.c,v retrieving revision 1.79 retrieving revision 1.80 diff -u -d -r1.79 -r1.80 --- gstcaps.c 27 Dec 2003 13:51:31 -0000 1.79 +++ gstcaps.c 30 Dec 2003 04:59:48 -0000 1.80 @@ -568,10 +568,66 @@ GstCaps *gst_caps_normalize (const GstCaps *caps) { + g_critical ("unimplemented"); return NULL; } +static gboolean +simplify_foreach (GQuark field_id, GValue *value, gpointer user_data) +{ + GstStructure *s2 = (GstStructure *) user_data; + const GValue *v2; + + v2 = gst_structure_id_get_value (s2, field_id); + if (v2 == NULL) return FALSE; + + if (gst_value_compare (value, v2) == GST_VALUE_EQUAL) return TRUE; + return FALSE; +} + +static gboolean +gst_caps_structure_simplify (GstStructure *struct1, const GstStructure *struct2) +{ + /* FIXME this is just a simple compare. Better would be to merge + * the two structures */ + if (struct1->name != struct2->name) return FALSE; + if (struct1->fields->len != struct2->fields->len) return FALSE; + + return gst_structure_foreach (struct1, simplify_foreach, (void *)struct2); +} + +GstCaps *gst_caps_simplify (const GstCaps *caps) +{ + int i; + int j; + GstCaps *newcaps; + GstStructure *structure; + GstStructure *struct2; + + if (gst_caps_get_size (caps) < 2) { + return gst_caps_copy (caps); + } + + newcaps = gst_caps_new_empty (); + + for(i=0;i<gst_caps_get_size (caps);i++){ + structure = gst_caps_get_structure (caps, i); + + for(j=0;j<gst_caps_get_size (newcaps);j++){ + struct2 = gst_caps_get_structure (caps, i); + if (gst_caps_structure_simplify (struct2, structure)) { + break; + } + } + if (j==gst_caps_get_size (newcaps)) { + gst_caps_append_structure (newcaps, gst_structure_copy(structure)); + } + } + + return newcaps; +} + #ifndef GST_DISABLE_LOADSAVE xmlNodePtr gst_caps_save_thyself (const GstCaps *caps, xmlNodePtr parent) { Index: gstcaps.h =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstcaps.h,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- gstcaps.h 27 Dec 2003 13:51:31 -0000 1.59 +++ gstcaps.h 30 Dec 2003 04:59:48 -0000 1.60 @@ -101,6 +101,7 @@ GstCaps *gst_caps_intersect (const GstCaps *caps1, const GstCaps *caps2); GstCaps *gst_caps_union (const GstCaps *caps1, const GstCaps *caps2); GstCaps *gst_caps_normalize (const GstCaps *caps); +GstCaps *gst_caps_simplify (const GstCaps *caps); #ifndef GST_DISABLE_LOADSAVE xmlNodePtr gst_caps_save_thyself (const GstCaps *caps, xmlNodePtr parent); Index: gstpad.c =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstpad.c,v retrieving revision 1.248 retrieving revision 1.249 diff -u -d -r1.248 -r1.249 --- gstpad.c 27 Dec 2003 15:49:15 -0000 1.248 +++ gstpad.c 30 Dec 2003 04:59:48 -0000 1.249 @@ -1205,6 +1205,8 @@ ret = gst_pad_link_negotiate (link); if (ret == GST_PAD_LINK_REFUSED) { + oldlink->srcnotify = link->srcnotify; + oldlink->sinknotify = link->sinknotify; if (oldlink && oldlink->caps && !gst_pad_link_call_link_functions (oldlink)) g_warning ("pads don't accept old caps. We assume they did though"); gst_pad_link_free (link); @@ -1257,6 +1259,7 @@ gst_pad_try_set_caps (GstPad *pad, const GstCaps *caps) { GstPadLink *link; + GstPadLinkReturn ret; g_return_val_if_fail (pad != NULL, GST_PAD_LINK_REFUSED); g_return_val_if_fail (GST_IS_PAD (pad), GST_PAD_LINK_REFUSED); @@ -1306,7 +1309,9 @@ link->sinknotify = FALSE; } - return gst_pad_link_try (link); + ret = gst_pad_link_try (link); + + return ret; } @@ -1829,7 +1834,7 @@ gboolean gst_pad_perform_negotiate (GstPad *srcpad, GstPad *sinkpad) { - return gst_pad_renegotiate (srcpad) >= 0; + return GST_PAD_LINK_SUCCESSFUL (gst_pad_renegotiate (srcpad)); } void @@ -2021,6 +2026,25 @@ } /** + * gst_pad_is_negotiated: + * @pad: a #GstPad to get the negotiation status of + * + * Returns: TRUE if the pad has successfully negotiated caps. + */ +gboolean +gst_pad_is_negotiated (GstPad *pad) +{ + g_return_val_if_fail (GST_IS_PAD (pad), FALSE); + + if (!GST_PAD_REALIZE (pad)) + return FALSE; + if (!GST_RPAD_LINK (pad)) + return FALSE; + + return (GST_RPAD_LINK (pad)->caps != NULL); +} + +/** * gst_pad_get_negotiated_caps: * @pad: a #GstPad to get the negotiated capabilites of * Index: gstpad.h =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstpad.h,v retrieving revision 1.133 retrieving revision 1.134 diff -u -d -r1.133 -r1.134 --- gstpad.h 27 Dec 2003 13:51:31 -0000 1.133 +++ gstpad.h 30 Dec 2003 04:59:48 -0000 1.134 @@ -402,6 +402,7 @@ /* capsnego functions */ G_CONST_RETURN GstCaps* gst_pad_get_negotiated_caps (GstPad *pad); +gboolean gst_pad_is_negotiated (GstPad *pad); GstCaps* gst_pad_get_caps (GstPad *pad); G_CONST_RETURN GstCaps* gst_pad_get_pad_template_caps (GstPad *pad); GstPadLinkReturn gst_pad_try_set_caps (GstPad *pad, const GstCaps *caps); Index: gststructure.c =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gststructure.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- gststructure.c 22 Dec 2003 06:56:26 -0000 1.7 +++ gststructure.c 30 Dec 2003 04:59:48 -0000 1.8 @@ -211,8 +211,6 @@ g_return_val_if_fail(structure != NULL, NULL); new_structure = gst_structure_empty_new(g_quark_to_string(structure->name)); - new_structure->fields = g_array_set_size(new_structure->fields, - structure->fields->len); new_structure->name = structure->name; for(i=0;i<structure->fields->len;i++){ @@ -225,7 +223,7 @@ g_array_append_val(new_structure->fields, new_field); } - return structure; + return new_structure; } /** Index: ChangeLog =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- ChangeLog 29 Dec 2003 09:50:46 -0000 1.56 +++ ChangeLog 30 Dec 2003 04:59:48 -0000 1.57 @@ -1,3 +1,18 @@ +2003-12-29 David Schleef <ds...@sc...> + + * gst/gstcaps.c: (gst_caps_normalize), (simplify_foreach), + (gst_caps_structure_simplify), (gst_caps_simplify): + * gst/gstcaps.h: + Add simplify function + * gst/gstpad.c: (gst_pad_link_try), (gst_pad_try_set_caps), + (gst_pad_perform_negotiate), (gst_pad_is_negotiated): + * gst/gstpad.h: + Copy over srcnotify, sinknotify when calling old pad_link + functions. Add new is_negotiated() function. + * gst/gststructure.c: (gst_structure_copy): + Fix an incredibly stupid bug that should have been noticed + weeks ago. _copy() returned the argument, not the new copy. + 2003-12-27 Benjamin Otte <in...@pu...> * gst/gstcaps.c: (gst_caps_append): |
From: David S. <ds...@pd...> - 2003-12-30 19:10:25
|
CVS Root: /home/cvs/gstreamer Module: gstreamer Changes by: ds Date: Tue Dec 30 2003 11:11:15 PST Log message: Fix segfault caused by last checkin Modified files: . : ChangeLog gst : gstpad.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.57&r2=1.58 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstpad.c.diff?r1=1.249&r2=1.250 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- ChangeLog 30 Dec 2003 04:59:48 -0000 1.57 +++ ChangeLog 30 Dec 2003 19:11:03 -0000 1.58 @@ -1,3 +1,8 @@ +2003-12-30 David Schleef <ds...@sc...> + + * gst/gstpad.c: (gst_pad_link_try): + Fix segfault when attempting to return to old caps + 2003-12-29 David Schleef <ds...@sc...> * gst/gstcaps.c: (gst_caps_normalize), (simplify_foreach), Index: gstpad.c =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstpad.c,v retrieving revision 1.249 retrieving revision 1.250 diff -u -d -r1.249 -r1.250 --- gstpad.c 30 Dec 2003 04:59:48 -0000 1.249 +++ gstpad.c 30 Dec 2003 19:11:03 -0000 1.250 @@ -1205,10 +1205,13 @@ ret = gst_pad_link_negotiate (link); if (ret == GST_PAD_LINK_REFUSED) { - oldlink->srcnotify = link->srcnotify; - oldlink->sinknotify = link->sinknotify; - if (oldlink && oldlink->caps && !gst_pad_link_call_link_functions (oldlink)) - g_warning ("pads don't accept old caps. We assume they did though"); + if (oldlink && oldlink->caps) { + oldlink->srcnotify = link->srcnotify; + oldlink->sinknotify = link->sinknotify; + if (!gst_pad_link_call_link_functions (oldlink)) { + g_warning ("pads don't accept old caps. We assume they did though"); + } + } gst_pad_link_free (link); return ret; } |
From: David S. <ds...@pd...> - 2003-12-31 08:06:10
|
CVS Root: /home/cvs/gstreamer Module: gstreamer Changes by: ds Date: Wed Dec 31 2003 00:07:01 PST Log message: Add functions useful default pad_link and fixate functions. Modified files: . : ChangeLog gst : gstpad.c gstpad.h Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.58&r2=1.59 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstpad.c.diff?r1=1.250&r2=1.251 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstpad.h.diff?r1=1.134&r2=1.135 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- ChangeLog 30 Dec 2003 19:11:03 -0000 1.58 +++ ChangeLog 31 Dec 2003 08:06:49 -0000 1.59 @@ -1,3 +1,9 @@ +2003-12-31 David Schleef <ds...@sc...> + + * gst/gstpad.c: (gst_pad_proxy_pad_link), (gst_pad_proxy_fixate): + * gst/gstpad.h: Add functions that are useful as default pad + link and fixate functions for elements. + 2003-12-30 David Schleef <ds...@sc...> * gst/gstpad.c: (gst_pad_link_try): Index: gstpad.c =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstpad.c,v retrieving revision 1.250 retrieving revision 1.251 diff -u -d -r1.250 -r1.251 --- gstpad.c 30 Dec 2003 19:11:03 -0000 1.250 +++ gstpad.c 31 Dec 2003 08:06:49 -0000 1.251 @@ -2014,6 +2014,91 @@ } /** + * gst_pad_proxy_pad_link: + * @pad: a #GstPad to proxy. + * + * Calls gst_pad_try_set_caps() for every other pad belonging to the + * same element as @pad. If gst_pad_try_set_caps() fails on any pad, + * the proxy link fails. + * + * Returns: GST_PAD_LINK_OK if sucessful + */ +GstPadLinkReturn +gst_pad_proxy_pad_link (GstPad *pad, const GstCaps *caps) +{ + GstElement *element; + const GList *pads; + GstPadLinkReturn ret; + + GST_DEBUG ("proxying pad link for %s:%s\n", GST_DEBUG_PAD_NAME (pad)); + + element = gst_pad_get_parent (pad); + + pads = gst_element_get_pad_list (element); + + while (pads) { + GstPad *otherpad = GST_PAD (pads->data); + + if (otherpad != pad) { + ret = gst_pad_try_set_caps (otherpad, caps); + if (GST_PAD_LINK_FAILED (ret)) { + return ret; + } + } + pads = g_list_next (pads); + } + + return GST_PAD_LINK_OK; +} + +/** + * gst_pad_proxy_fixate: + * @pad: a #GstPad to proxy. + * + * Implements a default fixate function based on the caps set on the other + * pads in the element. This function should only be used if every pad + * has the same pad template caps. + * + * Returns: a fixated caps, or NULL if caps cannot be fixed + */ +GstCaps * +gst_pad_proxy_fixate (GstPad *pad, const GstCaps *caps, gpointer unused) +{ + GstElement *element; + const GList *pads; + const GstCaps *othercaps; + + GST_DEBUG ("proxying fixate for %s:%s\n", GST_DEBUG_PAD_NAME (pad)); + + element = gst_pad_get_parent (pad); + + pads = gst_element_get_pad_list (element); + + while (pads) { + GstPad *otherpad = GST_PAD (pads->data); + + /* FIXME check that each pad has the same pad template caps */ + + if (otherpad != pad) { + othercaps = gst_pad_get_negotiated_caps (otherpad); + + if (othercaps) { + GstCaps *icaps; + icaps = gst_caps_intersect (othercaps, caps); + if (!gst_caps_is_empty (icaps)) { + return icaps; + } else { + gst_caps_free (icaps); + } + } + } + pads = g_list_next (pads); + } + + return NULL; +} + +/** * gst_pad_proxy_link: * @pad: a #GstPad to proxy to. * @caps: the #GstCaps to use in proxying. Index: gstpad.h =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstpad.h,v retrieving revision 1.134 retrieving revision 1.135 diff -u -d -r1.134 -r1.135 --- gstpad.h 30 Dec 2003 04:59:48 -0000 1.134 +++ gstpad.h 31 Dec 2003 08:06:49 -0000 1.135 @@ -411,7 +411,11 @@ void gst_pad_set_getcaps_function (GstPad *pad, GstPadGetCapsFunction getcaps); void gst_pad_set_fixate_function (GstPad *pad, GstPadFixateFunction fixate); GstCaps * gst_pad_proxy_getcaps (GstPad *pad); +GstPadLinkReturn gst_pad_proxy_pad_link (GstPad *pad, const GstCaps *caps); +GstCaps * gst_pad_proxy_fixate (GstPad *pad, const GstCaps *caps, gpointer unused); +#ifndef GST_DISABLE_DEPRECATED GstPadLinkReturn gst_pad_proxy_link (GstPad *pad, const GstCaps *caps); +#endif gboolean gst_pad_relink_filtered (GstPad *srcpad, GstPad *sinkpad, const GstCaps *filtercaps); #ifndef GST_DISABLE_DEPRECATED gboolean gst_pad_perform_negotiate (GstPad *srcpad, GstPad *sinkpad); |
From: David S. <ds...@pd...> - 2004-01-02 07:02:01
|
CVS Root: /home/cvs/gstreamer Module: gstreamer Changes by: ds Date: Thu Jan 01 2004 23:02:55 PST Log message: Add new use_explicit_caps() and set_explicit_caps() functions. Modified files: . : ChangeLog gst : gstpad.c gstpad.h Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.63&r2=1.64 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstpad.c.diff?r1=1.251&r2=1.252 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstpad.h.diff?r1=1.135&r2=1.136 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- ChangeLog 1 Jan 2004 02:23:47 -0000 1.63 +++ ChangeLog 2 Jan 2004 07:02:43 -0000 1.64 @@ -1,3 +1,15 @@ +2004-01-01 David Schleef <ds...@sc...> + + * gst/gstpad.c: (gst_pad_set_explicit_caps), + (gst_pad_explicit_getcaps), (gst_pad_explicit_link), + (gst_pad_use_explicit_caps): + * gst/gstpad.h: + Add new functions. gst_pad_use_explicit_caps() sets up a pad + to use an internal getcaps and link fuction so that negotiation + always results in the explicitly set caps. + gst_pad_set_explicit_caps() sets the explicit caps. These functions + are particularly useful for decoders. + 2003-12-31 David Schleef <ds...@sc...> * gst/elements/gstidentity.c: (gst_identity_class_init), Index: gstpad.c =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstpad.c,v retrieving revision 1.251 retrieving revision 1.252 diff -u -d -r1.251 -r1.252 --- gstpad.c 31 Dec 2003 08:06:49 -0000 1.251 +++ gstpad.c 2 Jan 2004 07:02:43 -0000 1.252 @@ -2099,6 +2099,95 @@ } /** + * gst_pad_set_explicit_caps: + * @pad: a #GstPad to set the explicit caps of + * @caps: the #GstCaps to set + * + * If a pad has been told to use explicit caps, this function is used + * to set the explicit caps. If @caps is NULL, the explicit caps are + * unset. + * + * This function calls gst_pad_try_set_caps() on the pad. If that + * call fails, gst_element_error() is called to indicate a negotiation + * failure. + * + * Returns: TRUE if the caps were set correctly, otherwise FALSE + */ +gboolean +gst_pad_set_explicit_caps (GstPad *pad, GstCaps *caps) +{ + GstPadLinkReturn link_ret; + + g_return_val_if_fail (GST_IS_PAD (pad), FALSE); + + if (caps == NULL) { + gst_caps_replace (&GST_RPAD_EXPLICIT_CAPS (pad), NULL); + return TRUE; + } + + if (!GST_PAD_IS_LINKED (pad)) { + gst_caps_replace (&GST_RPAD_EXPLICIT_CAPS (pad), caps); + return TRUE; + } + link_ret = gst_pad_try_set_caps (pad, caps); + if (GST_PAD_LINK_FAILED (link_ret)) { + gst_element_error (gst_pad_get_parent (pad), "negotiation failed"); + return FALSE; + } + + gst_caps_replace (&GST_RPAD_EXPLICIT_CAPS (pad), caps); + + return TRUE; +} + +static GstCaps * +gst_pad_explicit_getcaps (GstPad *pad) +{ + g_return_val_if_fail (GST_IS_PAD (pad), NULL); + + if (GST_RPAD_EXPLICIT_CAPS (pad) == NULL) { + return gst_caps_copy (gst_pad_get_pad_template_caps (pad)); + } + return gst_caps_copy (GST_RPAD_EXPLICIT_CAPS (pad)); +} + +static GstPadLinkReturn +gst_pad_explicit_link (GstPad *pad, const GstCaps *caps) +{ + g_return_val_if_fail (GST_IS_PAD (pad), GST_PAD_LINK_REFUSED); + g_return_val_if_fail (caps != NULL, GST_PAD_LINK_REFUSED); + + if (GST_RPAD_EXPLICIT_CAPS (pad) == NULL) { + return GST_PAD_LINK_DELAYED; + } + + return GST_PAD_LINK_OK; +} + +/** + * gst_pad_use_explicit_caps: + * @pad: a #GstPad to set to use explicit caps + * + * This function handles negotiation for pads that need to be set + * to particular caps under complete control of the element, based + * on some state in the element. This is often the case with + * decoders and other elements whose caps is determined by the data + * stream. + * + * WARNING: This function is a hack and will be replaced with something + * better in gstreamer-0.9. + */ +void +gst_pad_use_explicit_caps (GstPad *pad) +{ + g_return_if_fail (GST_IS_PAD (pad)); + + gst_pad_set_getcaps_function (pad, gst_pad_explicit_getcaps); + gst_pad_set_link_function (pad, gst_pad_explicit_link); + gst_caps_replace (&GST_RPAD_EXPLICIT_CAPS (pad), NULL); +} + +/** * gst_pad_proxy_link: * @pad: a #GstPad to proxy to. * @caps: the #GstCaps to use in proxying. Index: gstpad.h =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstpad.h,v retrieving revision 1.135 retrieving revision 1.136 diff -u -d -r1.135 -r1.136 --- gstpad.h 31 Dec 2003 08:06:49 -0000 1.135 +++ gstpad.h 2 Jan 2004 07:02:43 -0000 1.136 @@ -199,8 +199,9 @@ GstProbeDispatcher probedisp; GstPadLink *link; + GstCaps *explicit_caps; - gpointer _gst_reserved[GST_PADDING - 1]; + gpointer _gst_reserved[GST_PADDING - 2]; }; struct _GstRealPadClass { @@ -261,6 +262,7 @@ #define GST_RPAD_FIXATEFUNC(pad) (((GstRealPad *)(pad))->fixatefunc) #define GST_RPAD_BUFFERALLOCFUNC(pad) (((GstRealPad *)(pad))->bufferallocfunc) #define GST_RPAD_LINK(pad) (((GstRealPad *)(pad))->link) +#define GST_RPAD_EXPLICIT_CAPS(pad) (((GstRealPad *)(pad))->explicit_caps) /* GstGhostPad */ #define GST_GPAD_REALPAD(pad) (((GstGhostPad *)(pad))->realpad) @@ -416,6 +418,8 @@ #ifndef GST_DISABLE_DEPRECATED GstPadLinkReturn gst_pad_proxy_link (GstPad *pad, const GstCaps *caps); #endif +gboolean gst_pad_set_explicit_caps (GstPad *pad, GstCaps *caps); +void gst_pad_use_explicit_caps (GstPad *pad); gboolean gst_pad_relink_filtered (GstPad *srcpad, GstPad *sinkpad, const GstCaps *filtercaps); #ifndef GST_DISABLE_DEPRECATED gboolean gst_pad_perform_negotiate (GstPad *srcpad, GstPad *sinkpad); |
From: David S. <ds...@pd...> - 2004-01-02 23:03:32
|
CVS Root: /home/cvs/gstreamer Module: gstreamer Changes by: ds Date: Fri Jan 02 2004 15:04:26 PST Log message: * gst/gstcaps.c: (_gst_structure_is_equal_foreach), (gst_caps_is_equal_fixed): Add new function. * gst/gstcaps.h: ditto. * gst/gstpad.c: (gst_real_pad_class_init), (gst_pad_link_call_link_functions), (gst_pad_try_set_caps), (gst_pad_set_explicit_caps), (gst_pad_get_caps): In try_set_caps, check new caps against existing caps -- if they're the same, return OK without renegotiating. caps-nego-failed signal fixed so that the marshaller isn't VOID__OBJECT. Also changed to G_TYPE_POINTER to save an extra caps copy. Don't complete negotiation if a pad link function returns DELAYED. Modified files: . : ChangeLog gst : gstcaps.c gstcaps.h gstpad.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.66&r2=1.67 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstcaps.c.diff?r1=1.82&r2=1.83 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstcaps.h.diff?r1=1.60&r2=1.61 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstpad.c.diff?r1=1.254&r2=1.255 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.66 retrieving revision 1.67 diff -u -d -r1.66 -r1.67 --- ChangeLog 2 Jan 2004 19:10:44 -0000 1.66 +++ ChangeLog 2 Jan 2004 23:04:14 -0000 1.67 @@ -1,3 +1,17 @@ +2004-01-02 David Schleef <ds...@sc...> + + * gst/gstcaps.c: (_gst_structure_is_equal_foreach), + (gst_caps_is_equal_fixed): Add new function. + * gst/gstcaps.h: ditto. + * gst/gstpad.c: (gst_real_pad_class_init), + (gst_pad_link_call_link_functions), (gst_pad_try_set_caps), + (gst_pad_set_explicit_caps), (gst_pad_get_caps): In try_set_caps, + check new caps against existing caps -- if they're the same, return + OK without renegotiating. caps-nego-failed signal fixed so that + the marshaller isn't VOID__OBJECT. Also changed to G_TYPE_POINTER + to save an extra caps copy. Don't complete negotiation if a pad + link function returns DELAYED. + 2004-01-02 Benjamin Otte <in...@pu...> * gst/gstpad.c: (gst_pad_try_relink_filtered): Index: gstcaps.c =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstcaps.c,v retrieving revision 1.82 retrieving revision 1.83 diff -u -d -r1.82 -r1.83 --- gstcaps.c 2 Jan 2004 06:58:17 -0000 1.82 +++ gstcaps.c 2 Jan 2004 23:04:14 -0000 1.83 @@ -347,6 +347,42 @@ } static gboolean +_gst_structure_is_equal_foreach (GQuark field_id, + GValue *val2, gpointer data) +{ + GstStructure *struct1 = (GstStructure *) data; + const GValue *val1 = gst_structure_id_get_value (struct1, field_id); + + if (val1 == NULL) return FALSE; + if (gst_value_compare (val1, val2) == GST_VALUE_EQUAL) { + return TRUE; + } + + return FALSE; +} + +gboolean gst_caps_is_equal_fixed (const GstCaps *caps1, const GstCaps *caps2) +{ + GstStructure *struct1, *struct2; + + g_return_val_if_fail (gst_caps_is_fixed(caps1), FALSE); + g_return_val_if_fail (gst_caps_is_fixed(caps2), FALSE); + + struct1 = gst_caps_get_structure (caps1, 0); + struct2 = gst_caps_get_structure (caps2, 0); + + if (struct1->name != struct2->name) { + return FALSE; + } + if (struct1->fields->len != struct2->fields->len) { + return FALSE; + } + + return gst_structure_foreach (struct1, _gst_structure_is_equal_foreach, + struct2); +} + +static gboolean _gst_structure_field_has_compatible (GQuark field_id, GValue *val2, gpointer data) { Index: gstcaps.h =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstcaps.h,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- gstcaps.h 30 Dec 2003 04:59:48 -0000 1.60 +++ gstcaps.h 2 Jan 2004 23:04:14 -0000 1.61 @@ -94,6 +94,7 @@ gboolean gst_caps_is_empty (const GstCaps *caps); gboolean gst_caps_is_chained (const GstCaps *caps); gboolean gst_caps_is_fixed (const GstCaps *caps); +gboolean gst_caps_is_equal_fixed (const GstCaps *caps1, const GstCaps *caps2); gboolean gst_caps_is_always_compatible (const GstCaps *caps1, const GstCaps *caps2); Index: gstpad.c =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstpad.c,v retrieving revision 1.254 retrieving revision 1.255 diff -u -d -r1.254 -r1.255 --- gstpad.c 2 Jan 2004 19:10:44 -0000 1.254 +++ gstpad.c 2 Jan 2004 23:04:14 -0000 1.255 @@ -178,8 +178,8 @@ gst_real_pad_signals[REAL_CAPS_NEGO_FAILED] = g_signal_new ("caps_nego_failed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRealPadClass, caps_nego_failed), NULL, NULL, - gst_marshal_VOID__OBJECT, G_TYPE_NONE, 1, - GST_TYPE_CAPS); + gst_marshal_VOID__POINTER, G_TYPE_NONE, 1, + G_TYPE_POINTER); gst_real_pad_signals[REAL_LINKED] = g_signal_new ("linked", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRealPadClass, linked), NULL, NULL, @@ -1116,7 +1116,7 @@ GST_DEBUG ("got reply %d from link function on pad %s:%s", res, GST_DEBUG_PAD_NAME (link->srcpad)); - if (res == GST_PAD_LINK_REFUSED) { + if (GST_PAD_LINK_FAILED (res)) { GST_CAT_INFO (GST_CAT_CAPS, "pad %s:%s doesn't accept caps", GST_DEBUG_PAD_NAME (link->srcpad)); return FALSE; @@ -1142,7 +1142,7 @@ GST_DEBUG ("got reply %d from link function on pad %s:%s", res, GST_DEBUG_PAD_NAME (link->sinkpad)); - if (res == GST_PAD_LINK_REFUSED) { + if (GST_PAD_LINK_FAILED (res)) { GST_CAT_INFO (GST_CAT_CAPS, "pad %s:%s doesn't accept caps", GST_DEBUG_PAD_NAME (link->sinkpad)); return FALSE; @@ -1286,6 +1286,12 @@ return GST_PAD_LINK_OK; } + /* if the desired caps are already there, it's trivially ok */ + if (GST_PAD_CAPS (pad) && gst_caps_is_equal_fixed (caps, + GST_PAD_CAPS (pad))) { + return GST_PAD_LINK_OK; + } + g_return_val_if_fail (GST_PAD_LINK_SRC (pad), GST_PAD_LINK_REFUSED); g_return_val_if_fail (GST_PAD_LINK_SINK (pad), GST_PAD_LINK_REFUSED); @@ -2281,14 +2287,27 @@ return caps; } else if (GST_PAD_PAD_TEMPLATE (realpad)) { GstPadTemplate *templ = GST_PAD_PAD_TEMPLATE (realpad); + const GstCaps *caps; + GST_CAT_DEBUG (GST_CAT_CAPS, "using pad template %p with caps %p", templ, GST_PAD_TEMPLATE_CAPS (templ)); + + caps = GST_PAD_TEMPLATE_CAPS (templ); +#if 0 + /* FIXME we should enable something like this someday, but this is + * a bit buggy */ + if (!gst_caps_is_fixed (caps)) { + g_warning("pad %s:%s (%p) has no getcaps function and the pad template returns non-fixed caps. Element is probably broken.\n", + GST_DEBUG_PAD_NAME (realpad), realpad); + } +#endif + return gst_caps_copy (GST_PAD_TEMPLATE_CAPS (templ)); } GST_CAT_DEBUG (GST_CAT_CAPS, "pad has no caps"); #if 0 - /* FIXME this should be enabled some day */ + /* FIXME enable */ g_warning("pad %s:%s (%p) has no pad template\n", GST_DEBUG_PAD_NAME (realpad), realpad); #endif |
From: David S. <ds...@pd...> - 2004-01-03 01:24:19
|
CVS Root: /home/cvs/gstreamer Module: gstreamer Changes by: ds Date: Fri Jan 02 2004 17:25:13 PST Log message: Move padtemplate clearing from class_init to base_init Modified files: . : ChangeLog gst : gstelement.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.68&r2=1.69 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstelement.c.diff?r1=1.230&r2=1.231 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.68 retrieving revision 1.69 diff -u -d -r1.68 -r1.69 --- ChangeLog 2 Jan 2004 23:52:59 -0000 1.68 +++ ChangeLog 3 Jan 2004 01:25:01 -0000 1.69 @@ -1,3 +1,13 @@ +2004-01-02 David Schleef <ds...@sc...> + + * gst/gstelement.c: (gst_element_class_init), + (gst_element_base_class_init): ->padtemplates should be cleared + in base_init, since we need to have a fresh list for every + class. (Alternately, we chould copy the list and share the + actual pad templates (not the list), but that would require + changing every plugin to move pad template registration from + base_init to class_init.) + 2004-01-03 Ronald Bultje <rb...@ro...> * gst/gstelement.c: (gst_element_class_add_pad_template): Index: gstelement.c =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstelement.c,v retrieving revision 1.230 retrieving revision 1.231 diff -u -d -r1.230 -r1.231 --- gstelement.c 2 Jan 2004 23:52:59 -0000 1.230 +++ gstelement.c 3 Jan 2004 01:25:01 -0000 1.231 @@ -154,7 +154,6 @@ klass->change_state = GST_DEBUG_FUNCPTR (gst_element_change_state); klass->error = GST_DEBUG_FUNCPTR (gst_element_error_func); klass->found_tag = GST_DEBUG_FUNCPTR (gst_element_found_tag_func); - klass->padtemplates = NULL; klass->numpadtemplates = 0; klass->elementfactory = NULL; @@ -164,9 +163,13 @@ gst_element_base_class_init (gpointer g_class) { GObjectClass *gobject_class = G_OBJECT_CLASS (g_class); + GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); + gobject_class->set_property = GST_DEBUG_FUNCPTR(gst_element_real_set_property); gobject_class->get_property = GST_DEBUG_FUNCPTR(gst_element_real_get_property); + + element_class->padtemplates = NULL; } static void |
From: David S. <ds...@pd...> - 2004-01-03 09:24:22
|
CVS Root: /home/cvs/gstreamer Module: gstreamer Changes by: ds Date: Sat Jan 03 2004 01:25:16 PST Log message: * gst/gstelement.c: (gst_element_link_pads_filtered), (gst_element_negotiate_pads): Fix to allow DELAYED to indicate that linking was successful. * gst/gstpad.c: (gst_pad_link_free), (gst_pad_link_call_link_functions), (gst_pad_link_negotiate), (gst_pad_link_try), (gst_pad_link_unnegotiate), (gst_pad_unnegotiate), (gst_pad_set_explicit_caps): Pass GstPadLinkReturn correctly between functions, and don't fail when DELAYED is used (DELAYED is very important). Better cleanup on unlinking and unnegotiation. Should fix some spider bugs. Modified files: . : ChangeLog gst : gstelement.c gstpad.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.69&r2=1.70 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstelement.c.diff?r1=1.231&r2=1.232 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstpad.c.diff?r1=1.255&r2=1.256 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.69 retrieving revision 1.70 diff -u -d -r1.69 -r1.70 --- ChangeLog 3 Jan 2004 01:25:01 -0000 1.69 +++ ChangeLog 3 Jan 2004 09:25:04 -0000 1.70 @@ -1,3 +1,17 @@ +2004-01-03 David Schleef <ds...@sc...> + + * gst/gstelement.c: (gst_element_link_pads_filtered), + (gst_element_negotiate_pads): Fix to allow DELAYED to indicate + that linking was successful. + * gst/gstpad.c: (gst_pad_link_free), + (gst_pad_link_call_link_functions), (gst_pad_link_negotiate), + (gst_pad_link_try), (gst_pad_link_unnegotiate), + (gst_pad_unnegotiate), (gst_pad_set_explicit_caps): Pass + GstPadLinkReturn correctly between functions, and don't fail + when DELAYED is used (DELAYED is very important). Better + cleanup on unlinking and unnegotiation. Should fix some spider + bugs. + 2004-01-02 David Schleef <ds...@sc...> * gst/gstelement.c: (gst_element_class_init), Index: gstelement.c =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstelement.c,v retrieving revision 1.231 retrieving revision 1.232 diff -u -d -r1.231 -r1.232 --- gstelement.c 3 Jan 2004 01:25:01 -0000 1.231 +++ gstelement.c 3 Jan 2004 09:25:04 -0000 1.232 @@ -1595,7 +1595,7 @@ if (srcpadname && destpadname) { /* two explicitly specified pads */ - return gst_pad_link_filtered (srcpad, destpad, filtercaps); + return gst_pad_link_filtered (srcpad, destpad, filtercaps); } if (srcpad) { /* loop through the allowed pads in the source, trying to find a @@ -2500,7 +2500,7 @@ "perform negotiate for %s:%s and %s:%s", GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad)); - if (!gst_pad_renegotiate (pad)) + if (gst_pad_renegotiate (pad) == GST_PAD_LINK_REFUSED) return FALSE; } else { Index: gstpad.c =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstpad.c,v retrieving revision 1.255 retrieving revision 1.256 diff -u -d -r1.255 -r1.256 --- gstpad.c 2 Jan 2004 23:04:14 -0000 1.255 +++ gstpad.c 3 Jan 2004 09:25:04 -0000 1.256 @@ -993,6 +993,11 @@ if (link->sinkcaps) gst_caps_free (link->sinkcaps); if (link->filtercaps) gst_caps_free (link->filtercaps); if (link->caps) gst_caps_free (link->caps); + GST_RPAD_LINK (link->srcpad) = NULL; + GST_RPAD_LINK (link->sinkpad) = NULL; +#ifdef USE_POISONING + memset(link,0xff, sizeof(*link)); +#endif g_free (link); } @@ -1091,7 +1096,7 @@ link->caps = caps; } -static gboolean +static GstPadLinkReturn gst_pad_link_call_link_functions (GstPadLink *link) { gboolean negotiating; @@ -1119,7 +1124,7 @@ if (GST_PAD_LINK_FAILED (res)) { GST_CAT_INFO (GST_CAT_CAPS, "pad %s:%s doesn't accept caps", GST_DEBUG_PAD_NAME (link->srcpad)); - return FALSE; + return res; } } @@ -1145,11 +1150,11 @@ if (GST_PAD_LINK_FAILED (res)) { GST_CAT_INFO (GST_CAT_CAPS, "pad %s:%s doesn't accept caps", GST_DEBUG_PAD_NAME (link->sinkpad)); - return FALSE; + return res; } } - return TRUE; + return GST_PAD_LINK_OK; } static GstPadLinkReturn @@ -1170,11 +1175,7 @@ if (gst_caps_is_empty (link->caps)) return GST_PAD_LINK_REFUSED; - if (!gst_pad_link_call_link_functions (link)) { - return GST_PAD_LINK_REFUSED; - } - - return GST_PAD_LINK_OK; + return gst_pad_link_call_link_functions (link); } /** @@ -1204,17 +1205,20 @@ g_assert (oldlink == GST_RPAD_LINK (sinkpad)); ret = gst_pad_link_negotiate (link); - if (ret == GST_PAD_LINK_REFUSED) { - if (oldlink && oldlink->caps) { - oldlink->srcnotify = link->srcnotify; - oldlink->sinknotify = link->sinknotify; - if (!gst_pad_link_call_link_functions (oldlink)) { - g_warning ("pads don't accept old caps. We assume they did though"); - } + if (GST_PAD_LINK_FAILED (ret) && oldlink && oldlink->caps) { + oldlink->srcnotify = link->srcnotify; + oldlink->sinknotify = link->sinknotify; + if (GST_PAD_LINK_FAILED (gst_pad_link_call_link_functions (oldlink))) { + g_warning ("pads don't accept old caps. We assume they did though"); } + } + if (ret == GST_PAD_LINK_REFUSED) { gst_pad_link_free (link); return ret; } + if (ret == GST_PAD_LINK_DELAYED) { + gst_caps_replace (&link->caps, NULL); + } GST_RPAD_PEER (srcpad) = GST_REAL_PAD(link->sinkpad); GST_RPAD_PEER (sinkpad) = GST_REAL_PAD(link->srcpad); @@ -1222,8 +1226,10 @@ gst_pad_link_free (oldlink); GST_RPAD_LINK (srcpad) = link; GST_RPAD_LINK (sinkpad) = link; - g_object_notify (G_OBJECT (srcpad), "caps"); - g_object_notify (G_OBJECT (sinkpad), "caps"); + if (ret == GST_PAD_LINK_OK) { + g_object_notify (G_OBJECT (srcpad), "caps"); + g_object_notify (G_OBJECT (sinkpad), "caps"); + } return ret; } @@ -1849,6 +1855,8 @@ void gst_pad_link_unnegotiate (GstPadLink *link) { + g_return_if_fail (link != NULL); + if (link->caps) { gst_caps_free (link->caps); link->caps = NULL; @@ -1875,10 +1883,13 @@ void gst_pad_unnegotiate (GstPad *pad) { + GstPadLink *link; + g_return_if_fail (GST_IS_PAD (pad)); - if (GST_RPAD_LINK (pad)) - gst_pad_link_unnegotiate (GST_RPAD_LINK (pad)); + link = GST_RPAD_LINK (GST_PAD_REALIZE (pad)); + if (link) + gst_pad_link_unnegotiate (link); } /** @@ -2132,7 +2143,13 @@ gst_caps_replace (&GST_RPAD_EXPLICIT_CAPS (pad), caps); - if (caps == NULL || !GST_PAD_IS_LINKED (pad)) { + if (caps == NULL) { + GST_CAT_DEBUG (GST_CAT_PADS, "caps is NULL"); + return TRUE; + } + + if (!GST_PAD_IS_LINKED (pad)) { + GST_CAT_DEBUG (GST_CAT_PADS, "pad is not linked"); return TRUE; } link_ret = gst_pad_try_set_caps (pad, caps); |
From: David S. <ds...@pd...> - 2004-01-11 22:36:13
|
CVS Root: /home/cvs/gstreamer Module: gstreamer Changes by: ds Date: Sun Jan 11 2004 14:37:15 PST Log message: Inherit some of parent's buffer flags. Modified files: . : ChangeLog gst : gstbuffer.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.82&r2=1.83 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstbuffer.c.diff?r1=1.76&r2=1.77 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.82 retrieving revision 1.83 diff -u -d -r1.82 -r1.83 --- ChangeLog 11 Jan 2004 22:11:34 -0000 1.82 +++ ChangeLog 11 Jan 2004 22:37:03 -0000 1.83 @@ -1,5 +1,10 @@ 2004-01-11 David Schleef <ds...@sc...> + * gst/gstbuffer.c: (gst_buffer_create_sub): Subbuffers should + inherit correct flags (READONLY and DONTKEEP). + +2004-01-11 David Schleef <ds...@sc...> + * gst/elements/gstfilesrc.c: (gst_filesrc_free_parent_mmap), (gst_filesrc_map_region): * gst/gstbuffer.c: (_gst_buffer_initialize), Index: gstbuffer.c =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstbuffer.c,v retrieving revision 1.76 retrieving revision 1.77 diff -u -d -r1.76 -r1.77 --- gstbuffer.c 11 Jan 2004 22:11:35 -0000 1.76 +++ gstbuffer.c 11 Jan 2004 22:37:03 -0000 1.77 @@ -295,9 +295,13 @@ GST_BUFFER_DURATION (buffer) = GST_CLOCK_TIME_NONE; GST_BUFFER_OFFSET_END (buffer) = GST_BUFFER_OFFSET_NONE; - /* make sure nobody overwrites data as it would overwrite in the parent. - * data in parent cannot be overwritten because we hold a ref */ - GST_DATA_FLAG_SET (parent, GST_DATA_READONLY); + + if (GST_BUFFER_FLAG_IS_SET (parent, GST_BUFFER_DONTKEEP)) { + GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_DONTKEEP); + } + if (GST_BUFFER_FLAG_IS_SET (parent, GST_BUFFER_READONLY)) { + GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_READONLY); + } return buffer; } |
From: David S. <ds...@pd...> - 2004-01-11 23:24:07
|
CVS Root: /home/cvs/gstreamer Module: gstreamer Changes by: ds Date: Sun Jan 11 2004 15:25:14 PST Log message: Add gst_strtoi(). Modified files: . : ChangeLog gst : gststructure.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.84&r2=1.85 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gststructure.c.diff?r1=1.9&r2=1.10 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.84 retrieving revision 1.85 diff -u -d -r1.84 -r1.85 --- ChangeLog 11 Jan 2004 22:39:00 -0000 1.84 +++ ChangeLog 11 Jan 2004 23:25:02 -0000 1.85 @@ -1,3 +1,8 @@ +2004-01-11 David Schleef,,, <set EMAIL_ADDRESS environment variable> + + * gst/gststructure.c: (gst_strtoi), (gst_value_from_string): Add + a function to parse integers in ways that strto[u]l() does not. + 2004-01-11 Benjamin Otte <in...@pu...> * tools/gst-inspect.c: (print_caps): Index: gststructure.c =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gststructure.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- gststructure.c 7 Jan 2004 13:13:02 -0000 1.9 +++ gststructure.c 11 Jan 2004 23:25:02 -0000 1.10 @@ -1109,6 +1109,20 @@ return TRUE; } +static int +gst_strtoi (const char *s, char **end, int base) +{ + int i; + + if (s[0] == '-') { + i = - (int) strtoul (s + 1, end, base); + } else { + i = strtoul (s, end, base); + } + + return i; +} + static gboolean gst_value_from_string (GValue *value, const char *s) { @@ -1122,7 +1136,7 @@ case G_TYPE_INT: { int x; - x = strtol (s, &end, 0); + x = gst_strtoi (s, &end, 0); if (*end == 0) { ret = TRUE; } else { |
From: David S. <ds...@pd...> - 2004-01-15 09:02:43
|
CVS Root: /home/cvs/gstreamer Module: gstreamer Changes by: ds Date: Thu Jan 15 2004 01:03:54 PST Log message: * gst/gstcaps.c: Add lots of documentation. * gst/gstcaps.h: Deprecate a few functions. * gst/gstpad.c: Removed use of deprecated functions. Modified files: . : ChangeLog gst : gstcaps.c gstcaps.h gstpad.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.100&r2=1.101 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstcaps.c.diff?r1=1.86&r2=1.87 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstcaps.h.diff?r1=1.61&r2=1.62 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstpad.c.diff?r1=1.262&r2=1.263 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.100 retrieving revision 1.101 diff -u -d -r1.100 -r1.101 --- ChangeLog 15 Jan 2004 03:03:15 -0000 1.100 +++ ChangeLog 15 Jan 2004 09:03:41 -0000 1.101 @@ -1,3 +1,12 @@ +2004-01-15 David Schleef <ds...@sc...> + + * gst/gstcaps.c: + Add lots of documentation. + * gst/gstcaps.h: + Deprecate a few functions. + * gst/gstpad.c: + Removed use of deprecated functions. + 2004-01-15 Benjamin Otte <in...@pu...> * gst/gstpad.c: (gst_pad_is_linked): Index: gstcaps.c =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstcaps.c,v retrieving revision 1.86 retrieving revision 1.87 diff -u -d -r1.86 -r1.87 --- gstcaps.c 6 Jan 2004 21:39:52 -0000 1.86 +++ gstcaps.c 15 Jan 2004 09:03:41 -0000 1.87 @@ -86,6 +86,15 @@ } /* creation/deletion */ + +/** + * gst_caps_new_empty: + * + * Creates a new #GstCaps that is empty. That is, the returned + * #GstCaps contains no media formats. + * + * Returns: the new #GstCaps + */ GstCaps *gst_caps_new_empty (void) { GstCaps *caps = g_new0(GstCaps, 1); @@ -96,6 +105,14 @@ return caps; } +/** + * gst_caps_new_empty: + * + * Creates a new #GstCaps that indicates that it is compatible with + * any media format. + * + * Returns: the new #GstCaps + */ GstCaps *gst_caps_new_any (void) { GstCaps *caps = g_new0(GstCaps, 1); @@ -107,6 +124,17 @@ return caps; } +/** + * gst_caps_new_simple: + * @media_type: the media type of the structure + * @...: additional arguments + * + * Creates a new #GstCaps that contains one #GstStructure. The + * structure is defined by the arguments, which have the same format + * as @gst_structure_new(). + * + * Returns: the new #GstCaps + */ GstCaps *gst_caps_new_simple (const char *media_type, const char *fieldname, ...) { @@ -127,6 +155,17 @@ return caps; } +/** + * gst_caps_new_full: + * @struct1: the first structure to add + * @...: additional structures to add + * + * Creates a new #GstCaps and adds all the structures listed as + * arguments. The list must be NULL-terminated. The structures + * are not copied; the returned #GstCaps owns the structures. + * + * Returns: the new #GstCaps + */ GstCaps *gst_caps_new_full (GstStructure *struct1, ...) { GstCaps *caps; @@ -139,6 +178,17 @@ return caps; } +/** + * gst_caps_new_full_valist: + * @struct1: the first structure to add + * @var_args: additional structures to add + * + * Creates a new #GstCaps and adds all the structures listed as + * arguments. The list must be NULL-terminated. The structures + * are not copied; the returned #GstCaps owns the structures. + * + * Returns: the new #GstCaps + */ GstCaps *gst_caps_new_full_valist (GstStructure *structure, va_list var_args) { @@ -156,6 +206,15 @@ return caps; } +/** + * gst_caps_copy: + * @caps: the #GstCaps to copy + * + * Deeply copies a #GstCaps, including all structures and all the + * structures' values. + * + * Returns: the new #GstCaps + */ GstCaps *gst_caps_copy (const GstCaps *caps) { GstCaps *newcaps; @@ -177,6 +236,13 @@ return newcaps; } +/** + * gst_caps_free: + * @caps: the #GstCaps to free + * + * Frees a #GstCaps and all its structures and the structures' + * values. + */ void gst_caps_free (GstCaps *caps) { GstStructure *structure; @@ -195,6 +261,14 @@ g_free(caps); } +/** + * gst_static_caps_get: + * @static_caps: the #GstStaticCaps to convert + * + * Converts a #GstStaticCaps to a #GstCaps. + * + * Returns: the new #GstCaps + */ const GstCaps *gst_static_caps_get (GstStaticCaps *static_caps) { GstCaps *caps = (GstCaps *)static_caps; @@ -214,6 +288,16 @@ } /* manipulation */ + +/** + * gst_caps_append: + * @caps1: the #GstCaps that will be appended to + * @caps2: the #GstCaps to append + * + * Appends the structures contained in @caps2 to @caps1. The structures + * in @caps2 are not copied -- they are transferred to @caps1, and then + * @caps2 is freed. + */ void gst_caps_append (GstCaps *caps1, GstCaps *caps2) { GstStructure *structure; @@ -236,12 +320,20 @@ g_free(caps2); } +/** + * gst_caps_append_structure: + * @caps: the #GstCaps that will be appended to + * @structure: the #GstStructure to append + * + * Appends @structure to @caps1. The structure is not copied; @caps1 + * becomes the owner of @structure. + */ void gst_caps_append_structure (GstCaps *caps, GstStructure *structure) { g_return_if_fail(caps != NULL); if (structure){ -#if 0 /* disable this, since too many plugins rely on undefined behavior */ +#if 0 #ifdef USE_POISONING STRUCTURE_POISON (structure); #endif @@ -250,6 +342,12 @@ } } +/** + * gst_caps_split_one: + * @caps: + * + * Returns: + */ GstCaps *gst_caps_split_one (GstCaps *caps) { /* FIXME */ @@ -258,6 +356,12 @@ return NULL; } +/** + * gst_caps_split_one: + * @caps: a #GstCaps + * + * Returns: the number of structures that @caps contains + */ int gst_caps_get_size (const GstCaps *caps) { g_return_val_if_fail (caps != NULL, 0); @@ -265,6 +369,21 @@ return caps->structs->len; } +/** + * gst_caps_get_structure: + * @caps: a #GstCaps + * @index: the index of the structure + * + * Finds the structure in @caps that has the index @index, and + * returns it. + * + * WARNING: This function takes a const GstCaps *, but returns a + * non-const GstStructure *. This is for programming convenience -- + * the caller should be aware that structures inside a constant + * @GstCaps should not be modified. + * + * Returns: a pointer to the #GstStructure corresponding to @index + */ GstStructure *gst_caps_get_structure (const GstCaps *caps, int index) { g_return_val_if_fail (caps != NULL, NULL); @@ -274,6 +393,15 @@ return g_ptr_array_index(caps->structs, index); } +/** + * gst_caps_copy_1: + * @caps: the @GstCaps to copy + * + * Creates a new @GstCaps and appends a copy of the first structure + * contained in @caps. + * + * Returns: the new @GstCaps + */ GstCaps *gst_caps_copy_1 (const GstCaps *caps) { GstCaps *newcaps; @@ -294,6 +422,16 @@ return newcaps; } +/** + * gst_caps_set_simple: + * @caps: the @GstCaps to set + * @field: first field to set + * @...: additional parameters + * + * Sets fields in a simple #GstCaps. A simple #GstCaps is one that + * only has one structure. The arguments must be passed in the same + * manner as @gst_structure_set(), and be NULL-terminated. + */ void gst_caps_set_simple (GstCaps *caps, char *field, ...) { GstStructure *structure; @@ -309,6 +447,16 @@ va_end(var_args); } +/** + * gst_caps_set_simple_valist: + * @caps: the @GstCaps to copy + * @field: first field to set + * @varargs: additional parameters + * + * Sets fields in a simple #GstCaps. A simple #GstCaps is one that + * only has one structure. The arguments must be passed in the same + * manner as @gst_structure_set(), and be NULL-terminated. + */ void gst_caps_set_simple_valist (GstCaps *caps, char *field, va_list varargs) { GstStructure *structure; @@ -322,6 +470,13 @@ } /* tests */ + +/** + * gst_caps_is_any: + * @caps: the @GstCaps to test + * + * Returns: TRUE if @caps represents any format. + */ gboolean gst_caps_is_any (const GstCaps *caps) { g_return_val_if_fail(caps != NULL, FALSE); @@ -329,6 +484,12 @@ return (caps->flags & GST_CAPS_FLAGS_ANY); } +/** + * gst_caps_is_empty: + * @caps: the @GstCaps to test + * + * Returns: TRUE if @caps represents no formats. + */ gboolean gst_caps_is_empty (const GstCaps *caps) { g_return_val_if_fail(caps != NULL, FALSE); @@ -338,6 +499,12 @@ return (caps->structs == NULL) || (caps->structs->len == 0); } +/** + * gst_caps_is_chained: + * @caps: the @GstCaps to test + * + * Returns: TRUE if @caps contains more than one structure + */ gboolean gst_caps_is_chained (const GstCaps *caps) { g_return_val_if_fail(caps != NULL, FALSE); @@ -354,6 +521,16 @@ return FALSE; } +/** + * gst_caps_is_fixed: + * @caps: the @GstCaps to test + * + * Fixed @GstCaps describe exactly one format, that is, they have exactly + * one structure, and each field in the structure describes a fixed type. + * Examples of non-fixed types are GST_TYPE_INT_RANGE and GST_TYPE_LIST. + * + * Returns: TRUE if @caps is fixed + */ gboolean gst_caps_is_fixed (const GstCaps *caps) { GstStructure *structure; @@ -382,6 +559,16 @@ return FALSE; } +/** + * gst_caps_is_equal_fixed: + * @caps1: the #GstCaps to test + * @caps2: the #GstCaps to test + * + * Tests if two #GstCaps are equal. This function only works on fixed + * #GstCaps. + * + * Returns: TRUE if the arguments represent the same format + */ gboolean gst_caps_is_equal_fixed (const GstCaps *caps1, const GstCaps *caps2) { GstStructure *struct1, *struct2; @@ -450,6 +637,13 @@ return FALSE; } +/** + * gst_caps_is_always_compatible + * @caps1: the #GstCaps to test + * @caps2: the #GstCaps to test + * + * Returns: TRUE if @caps1 is a subset of @caps2. + */ gboolean gst_caps_is_always_compatible (const GstCaps *caps1, const GstCaps *caps2) { @@ -574,6 +768,17 @@ #endif /* operations */ + +/** + * gst_caps_intersect: + * @caps1: a #GstCaps to intersect + * @caps2: a #GstCaps to intersect + * + * Creates a new #GstCaps that contains all the formats that are common + * to both @caps1 and @caps2. + * + * Returns: the new #GstCaps + */ GstCaps *gst_caps_intersect (const GstCaps *caps1, const GstCaps *caps2) { int i,j; @@ -616,6 +821,16 @@ #endif } +/** + * gst_caps_union: + * @caps1: a #GstCaps to union + * @caps2: a #GstCaps to union + * + * Creates a new #GstCaps that contains all the formats that are in + * either @caps1 and @caps2. + * + * Returns: the new #GstCaps + */ GstCaps *gst_caps_union (const GstCaps *caps1, const GstCaps *caps2) { GstCaps *dest1; @@ -625,7 +840,6 @@ dest2 = gst_caps_copy (caps2); gst_caps_append (dest1, dest2); - /* FIXME: need a simplify function */ return dest1; @@ -661,6 +875,16 @@ return TRUE; } +/** + * gst_caps_normalize: + * @caps: a #GstCaps to normalize + * + * Creates a new #GstCaps that represents the same set of formats as + * @caps, but contains no lists. Each list is expanded into separate + * @GstStructures. + * + * Returns: the new #GstCaps + */ GstCaps *gst_caps_normalize (const GstCaps *caps) { NormalizeForeach nf; @@ -706,6 +930,17 @@ return gst_structure_foreach (struct1, simplify_foreach, (void *)struct2); } +/** + * gst_caps_simplify: + * @caps: a #GstCaps to simplify + * + * Creates a new #GstCaps that represents the same set of formats as + * @caps, but simpler. Component structures that are identical are + * merged. Component structures that have ranges or lists that can + * be merged are also merged. + * + * Returns: the new #GstCaps + */ GstCaps *gst_caps_simplify (const GstCaps *caps) { int i; @@ -752,6 +987,16 @@ #endif /* utility */ + +/** + * gst_caps_replace: + * @caps: a pointer to #GstCaps + * @newcaps: a #GstCaps to replace *caps + * + * Replaces *caps with @newcaps. Frees the #GstCaps in the location + * pointed to by @caps, if applicable, then modifies @caps to point to + * @newcaps. + */ void gst_caps_replace (GstCaps **caps, GstCaps *newcaps) { #if 0 /* disable this, since too many plugins rely on undefined behavior */ @@ -763,6 +1008,15 @@ *caps = newcaps; } +/** + * gst_caps_to_string: + * @caps: a #GstCaps + * + * Converts @caps to a string representation. This string representation + * can be converted back to a #GstCaps by #gst_caps_from_string(). + * + * Returns: a string representing @caps + */ gchar *gst_caps_to_string (const GstCaps *caps) { int i; @@ -832,6 +1086,14 @@ return TRUE; } +/** + * gst_caps_from_string: + * @caps: a string to convert to #GstCaps + * + * Converts @caps from a string representation. + * + * Returns: a new #GstCaps + */ GstCaps *gst_caps_from_string (const gchar *string) { GstCaps *caps; Index: gstcaps.h =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstcaps.h,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- gstcaps.h 2 Jan 2004 23:04:14 -0000 1.61 +++ gstcaps.h 15 Jan 2004 09:03:42 -0000 1.62 @@ -85,14 +85,18 @@ GstCaps *gst_caps_split_one (GstCaps *caps); int gst_caps_get_size (const GstCaps *caps); GstStructure *gst_caps_get_structure (const GstCaps *caps, int index); +#ifndef GST_DISABLE_DEPRECATED GstCaps *gst_caps_copy_1 (const GstCaps *caps); +#endif void gst_caps_set_simple (GstCaps *caps, char *field, ...); void gst_caps_set_simple_valist (GstCaps *caps, char *field, va_list varargs); /* tests */ gboolean gst_caps_is_any (const GstCaps *caps); gboolean gst_caps_is_empty (const GstCaps *caps); +#ifndef GST_DISABLE_DEPRECATED gboolean gst_caps_is_chained (const GstCaps *caps); +#endif gboolean gst_caps_is_fixed (const GstCaps *caps); gboolean gst_caps_is_equal_fixed (const GstCaps *caps1, const GstCaps *caps2); gboolean gst_caps_is_always_compatible (const GstCaps *caps1, Index: gstpad.c =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstpad.c,v retrieving revision 1.262 retrieving revision 1.263 diff -u -d -r1.262 -r1.263 --- gstpad.c 15 Jan 2004 03:03:15 -0000 1.262 +++ gstpad.c 15 Jan 2004 09:03:42 -0000 1.263 @@ -220,6 +220,7 @@ GValue *return_accu, const GValue *handler_return, gpointer dummy) { if (g_value_get_pointer (handler_return)) { + g_value_copy (handler_return, return_accu); /* stop emission if something was returned */ return FALSE; } @@ -1872,8 +1873,7 @@ } if (caps->structs->len > 1) { - GstCaps *retcaps = gst_caps_copy_1 (caps); - return retcaps; + return gst_caps_new_full (gst_caps_get_structure (caps, 0), NULL); } newcaps = gst_caps_copy (caps); |
From: David S. <ds...@pd...> - 2004-01-15 20:36:07
|
CVS Root: /home/cvs/gstreamer Module: gstreamer Changes by: ds Date: Thu Jan 15 2004 12:37:19 PST Log message: * gst/gstqueue.c: * gst/gstqueue.h: Fix the spelling of "treshold" and make min_threshold actually affect the queue. Modified files: . : ChangeLog gst : gstqueue.c gstqueue.h Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.101&r2=1.102 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstqueue.c.diff?r1=1.88&r2=1.89 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstqueue.h.diff?r1=1.21&r2=1.22 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.101 retrieving revision 1.102 diff -u -d -r1.101 -r1.102 --- ChangeLog 15 Jan 2004 09:03:41 -0000 1.101 +++ ChangeLog 15 Jan 2004 20:37:06 -0000 1.102 @@ -1,5 +1,12 @@ 2004-01-15 David Schleef <ds...@sc...> + * gst/gstqueue.c: + * gst/gstqueue.h: + Fix the spelling of "treshold" and make min_threshold actually + affect the queue. + +2004-01-15 David Schleef <ds...@sc...> + * gst/gstcaps.c: Add lots of documentation. * gst/gstcaps.h: Index: gstqueue.c =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstqueue.c,v retrieving revision 1.88 retrieving revision 1.89 diff -u -d -r1.88 -r1.89 --- gstqueue.c 14 Jan 2004 01:50:31 -0000 1.88 +++ gstqueue.c 15 Jan 2004 20:37:07 -0000 1.89 @@ -55,9 +55,9 @@ ARG_MAX_SIZE_BUFFERS, ARG_MAX_SIZE_BYTES, ARG_MAX_SIZE_TIME, - ARG_MIN_TRESHOLD_BUFFERS, - ARG_MIN_TRESHOLD_BYTES, - ARG_MIN_TRESHOLD_TIME, + ARG_MIN_THRESHOLD_BUFFERS, + ARG_MIN_THRESHOLD_BYTES, + ARG_MIN_THRESHOLD_TIME, ARG_LEAKY, ARG_MAY_DEADLOCK, ARG_BLOCK_TIMEOUT @@ -205,16 +205,16 @@ "Max. amount of data in the queue (in ns, 0=disable)", 0, G_MAXUINT64, 0, G_PARAM_READWRITE)); - g_object_class_install_property (gobject_class, ARG_MIN_TRESHOLD_BYTES, - g_param_spec_uint ("min-treshold-bytes", "Min. treshold (kB)", + g_object_class_install_property (gobject_class, ARG_MIN_THRESHOLD_BYTES, + g_param_spec_uint ("min-threshold-bytes", "Min. threshold (kB)", "Min. amount of data in the queue to allow reading (bytes, 0=disable)", 0, G_MAXUINT, 0, G_PARAM_READWRITE)); - g_object_class_install_property (gobject_class, ARG_MIN_TRESHOLD_BUFFERS, - g_param_spec_uint ("min-treshold-buffers", "Min. treshold (buffers)", + g_object_class_install_property (gobject_class, ARG_MIN_THRESHOLD_BUFFERS, + g_param_spec_uint ("min-threshold-buffers", "Min. threshold (buffers)", "Min. number of buffers in the queue to allow reading (0=disable)", 0, G_MAXUINT, 0, G_PARAM_READWRITE)); - g_object_class_install_property (gobject_class, ARG_MIN_TRESHOLD_TIME, - g_param_spec_uint64 ("min-treshold-time", "Min. treshold (ns)", + g_object_class_install_property (gobject_class, ARG_MIN_THRESHOLD_TIME, + g_param_spec_uint64 ("min-threshold-time", "Min. threshold (ns)", "Min. amount of data in the queue to allow reading (in ns, 0=disable)", 0, G_MAXUINT64, 0, G_PARAM_READWRITE)); @@ -269,9 +269,9 @@ queue->max_size.buffers = 250; /* high limit */ queue->max_size.bytes = 0; /* unlimited */ queue->max_size.time = 0; /* unlimited */ - queue->min_treshold.buffers = 0; /* no treshold */ - queue->min_treshold.bytes = 0; /* no treshold */ - queue->min_treshold.time = 0; /* no treshold */ + queue->min_threshold.buffers = 0; /* no threshold */ + queue->min_threshold.bytes = 0; /* no threshold */ + queue->min_threshold.time = 0; /* no threshold */ queue->leaky = GST_QUEUE_NO_LEAK; queue->may_deadlock = TRUE; @@ -395,13 +395,13 @@ "-%" G_GUINT64_FORMAT " ns, %u elements", \ GST_DEBUG_PAD_NAME (pad), \ queue->cur_level.buffers, \ - queue->min_treshold.buffers, \ + queue->min_threshold.buffers, \ queue->max_size.buffers, \ queue->cur_level.bytes, \ - queue->min_treshold.bytes, \ + queue->min_threshold.bytes, \ queue->max_size.bytes, \ queue->cur_level.time, \ - queue->min_treshold.time, \ + queue->min_threshold.time, \ queue->max_size.time, \ queue->queue->length) @@ -509,6 +509,7 @@ * to make things read-only. Also keep our list uptodate. */ queue->cur_level.bytes -= GST_BUFFER_SIZE (data); queue->cur_level.buffers --; + g_object_notify (G_OBJECT (queue), "current-level-buffers"); if (GST_BUFFER_DURATION (data) != GST_CLOCK_TIME_NONE) queue->cur_level.time -= GST_BUFFER_DURATION (data); @@ -604,6 +605,7 @@ /* Note that we only add buffers (not events) to the statistics */ if (GST_IS_BUFFER (data)) { queue->cur_level.buffers++; + g_object_notify (G_OBJECT (queue), "current-level-buffers"); queue->cur_level.bytes += GST_BUFFER_SIZE (data); if (GST_BUFFER_DURATION (data) != GST_CLOCK_TIME_NONE) queue->cur_level.time += GST_BUFFER_DURATION (data); @@ -642,24 +644,24 @@ "locked t:%p", g_thread_self ()); if (queue->queue->length == 0 || - (queue->min_treshold.buffers > 0 && - queue->cur_level.buffers < queue->min_treshold.buffers) || - (queue->min_treshold.bytes > 0 && - queue->cur_level.bytes < queue->min_treshold.bytes) || - (queue->min_treshold.time > 0 && - queue->cur_level.time < queue->min_treshold.time)) { + (queue->min_threshold.buffers > 0 && + queue->cur_level.buffers < queue->min_threshold.buffers) || + (queue->min_threshold.bytes > 0 && + queue->cur_level.bytes < queue->min_threshold.bytes) || + (queue->min_threshold.time > 0 && + queue->cur_level.time < queue->min_threshold.time)) { g_mutex_unlock (queue->qlock); g_signal_emit (G_OBJECT (queue), gst_queue_signals[SIGNAL_UNDERRUN], 0); g_mutex_lock (queue->qlock); STATUS (queue, "pre-empty wait"); while (queue->queue->length == 0 || - (queue->min_treshold.buffers > 0 && - queue->cur_level.buffers < queue->min_treshold.buffers) || - (queue->min_treshold.bytes > 0 && - queue->cur_level.bytes < queue->min_treshold.bytes) || - (queue->min_treshold.time > 0 && - queue->cur_level.time < queue->min_treshold.time)) { + (queue->min_threshold.buffers > 0 && + queue->cur_level.buffers < queue->min_threshold.buffers) || + (queue->min_threshold.bytes > 0 && + queue->cur_level.bytes < queue->min_threshold.bytes) || + (queue->min_threshold.time > 0 && + queue->cur_level.time < queue->min_threshold.time)) { /* if there's a pending state change for this queue or its * manager, switch back to iterator so bottom half of state * change executes. */ @@ -930,14 +932,14 @@ case ARG_MAX_SIZE_TIME: queue->max_size.time = g_value_get_uint64 (value); break; - case ARG_MIN_TRESHOLD_BYTES: - queue->max_size.bytes = g_value_get_uint (value); + case ARG_MIN_THRESHOLD_BYTES: + queue->min_threshold.bytes = g_value_get_uint (value); break; - case ARG_MIN_TRESHOLD_BUFFERS: - queue->max_size.buffers = g_value_get_uint (value); + case ARG_MIN_THRESHOLD_BUFFERS: + queue->min_threshold.buffers = g_value_get_uint (value); break; - case ARG_MIN_TRESHOLD_TIME: - queue->max_size.time = g_value_get_uint64 (value); + case ARG_MIN_THRESHOLD_TIME: + queue->min_threshold.time = g_value_get_uint64 (value); break; case ARG_LEAKY: queue->leaky = g_value_get_enum (value); @@ -983,14 +985,14 @@ case ARG_MAX_SIZE_TIME: g_value_set_uint64 (value, queue->max_size.time); break; - case ARG_MIN_TRESHOLD_BYTES: - g_value_set_uint (value, queue->min_treshold.bytes); + case ARG_MIN_THRESHOLD_BYTES: + g_value_set_uint (value, queue->min_threshold.bytes); break; - case ARG_MIN_TRESHOLD_BUFFERS: - g_value_set_uint (value, queue->min_treshold.buffers); + case ARG_MIN_THRESHOLD_BUFFERS: + g_value_set_uint (value, queue->min_threshold.buffers); break; - case ARG_MIN_TRESHOLD_TIME: - g_value_set_uint64 (value, queue->min_treshold.time); + case ARG_MIN_THRESHOLD_TIME: + g_value_set_uint64 (value, queue->min_threshold.time); break; case ARG_LEAKY: g_value_set_enum (value, queue->leaky); Index: gstqueue.h =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstqueue.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- gstqueue.h 11 Jan 2004 22:11:35 -0000 1.21 +++ gstqueue.h 15 Jan 2004 20:37:07 -0000 1.22 @@ -65,7 +65,7 @@ guint64 time; /* amount of time */ } cur_level, /* currently in the queue */ max_size, /* max. amount of data allowed in the queue */ - min_treshold; /* min. amount of data required to wake reader */ + min_threshold; /* min. amount of data required to wake reader */ /* whether we leak data, and at which end */ gint leaky; |
From: David S. <ds...@pd...> - 2004-01-15 21:29:49
|
CVS Root: /home/cvs/gstreamer Module: gstreamer Changes by: ds Date: Thu Jan 15 2004 13:31:01 PST Log message: * gst/gstelement.c: (gst_element_get_compatible_pad_filtered), (gst_element_link_pads_filtered): Use GST_PAD_ macros instead of GST_RPAD_, since we don't know if it's a real or ghost pad. Modified files: . : ChangeLog gst : gstelement.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.102&r2=1.103 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstelement.c.diff?r1=1.235&r2=1.236 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.102 retrieving revision 1.103 diff -u -d -r1.102 -r1.103 --- ChangeLog 15 Jan 2004 20:37:06 -0000 1.102 +++ ChangeLog 15 Jan 2004 21:30:48 -0000 1.103 @@ -1,5 +1,11 @@ 2004-01-15 David Schleef <ds...@sc...> + * gst/gstelement.c: (gst_element_get_compatible_pad_filtered), + (gst_element_link_pads_filtered): Use GST_PAD_ macros instead + of GST_RPAD_, since we don't know if it's a real or ghost pad. + +2004-01-15 David Schleef <ds...@sc...> + * gst/gstqueue.c: * gst/gstqueue.h: Fix the spelling of "treshold" and make min_threshold actually Index: gstelement.c =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstelement.c,v retrieving revision 1.235 retrieving revision 1.236 diff -u -d -r1.235 -r1.236 --- gstelement.c 15 Jan 2004 01:35:41 -0000 1.235 +++ gstelement.c 15 Jan 2004 21:30:49 -0000 1.236 @@ -1630,7 +1630,7 @@ } templ = gst_pad_template_new ((gchar *) GST_PAD_NAME (pad), - GST_RPAD_DIRECTION (pad), GST_PAD_ALWAYS, templcaps); + GST_PAD_DIRECTION (pad), GST_PAD_ALWAYS, templcaps); foundpad = gst_element_request_compatible_pad (element, templ); gst_object_unref (GST_OBJECT (templ)); @@ -1642,7 +1642,7 @@ //g_warning("got here"); //if (filtercaps == NULL) { templ = gst_pad_template_new ((gchar *) GST_PAD_NAME (pad), - GST_RPAD_DIRECTION (pad), GST_PAD_ALWAYS, gst_caps_new_any()); + GST_PAD_DIRECTION (pad), GST_PAD_ALWAYS, gst_caps_new_any()); foundpad = gst_element_request_compatible_pad (element, templ); gst_object_unref (GST_OBJECT (templ)); @@ -1712,7 +1712,7 @@ GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "no pad %s:%s", GST_ELEMENT_NAME (src), srcpadname); return FALSE; } else { - if (!(GST_RPAD_DIRECTION (srcpad) == GST_PAD_SRC)) { + if (!(GST_PAD_DIRECTION (srcpad) == GST_PAD_SRC)) { GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "pad %s:%s is no src pad", GST_DEBUG_PAD_NAME (srcpad)); return FALSE; } @@ -1732,7 +1732,7 @@ GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "no pad %s:%s", GST_ELEMENT_NAME (dest), destpadname); return FALSE; } else { - if (!(GST_RPAD_DIRECTION (destpad) == GST_PAD_SINK)) { + if (!(GST_PAD_DIRECTION (destpad) == GST_PAD_SINK)) { GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "pad %s:%s is no sink pad", GST_DEBUG_PAD_NAME (destpad)); return FALSE; } @@ -1758,7 +1758,7 @@ do { GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "trying src pad %s:%s", GST_DEBUG_PAD_NAME (srcpad)); - if ((GST_RPAD_DIRECTION (srcpad) == GST_PAD_SRC) && + if ((GST_PAD_DIRECTION (srcpad) == GST_PAD_SRC) && (GST_PAD_PEER (srcpad) == NULL)) { GstPad *temp = gst_element_get_compatible_pad_filtered (dest, srcpad, filtercaps); @@ -1786,7 +1786,7 @@ do { GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "trying dest pad %s:%s", GST_DEBUG_PAD_NAME (destpad)); - if ((GST_RPAD_DIRECTION (destpad) == GST_PAD_SINK) && + if ((GST_PAD_DIRECTION (destpad) == GST_PAD_SINK) && (GST_PAD_PEER (destpad) == NULL)) { GstPad *temp = gst_element_get_compatible_pad_filtered (src, destpad, filtercaps); |
From: David S. <ds...@pd...> - 2004-01-20 09:13:20
|
CVS Root: /home/cvs/gstreamer Module: gstreamer Changes by: ds Date: Tue Jan 20 2004 01:14:38 PST Log message: * gst/gststructure.c: (gst_structure_to_string): Convert function to use gst_value_serialize(). * gst/gstvalue.c: (gst_value_serialize_list), (gst_value_serialize_fourcc), (gst_value_serialize_int_range), (gst_value_serialize_double_range), (gst_value_serialize_boolean), (gst_value_serialize_int), (gst_value_serialize_double), (gst_string_wrap), (gst_value_serialize_string), (gst_value_serialize), (gst_value_deserialize): * gst/gstvalue.h: Add implementations for serialize. Modified files: . : ChangeLog gst : gststructure.c gstvalue.c gstvalue.h Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.121&r2=1.122 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gststructure.c.diff?r1=1.10&r2=1.11 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstvalue.c.diff?r1=1.9&r2=1.10 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstvalue.h.diff?r1=1.11&r2=1.12 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.121 retrieving revision 1.122 diff -u -d -r1.121 -r1.122 --- ChangeLog 19 Jan 2004 23:02:55 -0000 1.121 +++ ChangeLog 20 Jan 2004 09:14:25 -0000 1.122 @@ -1,3 +1,16 @@ +2004-01-20 David Schleef <ds...@sc...> + + * gst/gststructure.c: (gst_structure_to_string): + Convert function to use gst_value_serialize(). + * gst/gstvalue.c: (gst_value_serialize_list), + (gst_value_serialize_fourcc), (gst_value_serialize_int_range), + (gst_value_serialize_double_range), (gst_value_serialize_boolean), + (gst_value_serialize_int), (gst_value_serialize_double), + (gst_string_wrap), (gst_value_serialize_string), + (gst_value_serialize), (gst_value_deserialize): + * gst/gstvalue.h: + Add implementations for serialize. + 2004-01-20 Julien MOUTTE <ju...@mo...> * gst/gsterror.h: xvidenc.c needs GST_LIBRARY_ERROR_ENCODE. Dunno if Index: gststructure.c =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gststructure.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- gststructure.c 11 Jan 2004 23:25:02 -0000 1.10 +++ gststructure.c 20 Jan 2004 09:14:25 -0000 1.11 @@ -955,55 +955,6 @@ ((c) == '-') || ((c) == '+') || ((c) == '/') || ((c) == ':') || \ ((c) == '.')) -static gchar * -_gst_structure_wrap_string(gchar *s) -{ - gchar *t; - int len; - gchar *d, *e; - gboolean wrap = FALSE; - - len = 0; - t = s; - while (*t) { - if(GST_ASCII_IS_STRING(*t)) { - len++; - } else if(*t < 0x20 || *t >= 0x7f) { - wrap = TRUE; - len += 4; - } else { - wrap = TRUE; - len += 2; - } - t++; - } - - if (!wrap) return s; - - e = d = g_malloc(len + 3); - - *e++ = '\"'; - t = s; - while (*t) { - if(GST_ASCII_IS_STRING(*t)) { - *e++ = *t++; - } else if(*t < 0x20 || *t >= 0x7f) { - *e++ = '\\'; - *e++ = '0' + ((*t)>>6); - *e++ = '0' + (((*t)>>3)&0x7); - *e++ = '0' + ((*t++)&0x7); - } else { - *e++ = '\\'; - *e++ = *t++; - } - } - *e++ = '\"'; - *e = 0; - - g_free(s); - return d; -} - /** * gst_structure_to_string: * @structure: a #GstStructure @@ -1017,7 +968,6 @@ { GstStructureField *field; GString *s; - char *t; int i; g_return_val_if_fail(structure != NULL, NULL); @@ -1026,14 +976,12 @@ /* FIXME this string may need to be escaped */ g_string_append_printf(s, "%s", g_quark_to_string(structure->name)); for(i=0;i<structure->fields->len;i++) { - GValue s_val = { 0 }; + char *t; GType type; field = GST_STRUCTURE_FIELD(structure, i); - g_value_init(&s_val, G_TYPE_STRING); - g_value_transform (&field->value, &s_val); - + t = gst_value_serialize (&field->value); type = G_VALUE_TYPE (&field->value); if (type == GST_TYPE_LIST) { @@ -1045,21 +993,14 @@ } else { type = G_TYPE_INT; } - t = g_strdup(g_value_get_string(&s_val)); } else if (G_VALUE_TYPE(&field->value) == GST_TYPE_INT_RANGE) { type = G_TYPE_INT; - t = g_strdup(g_value_get_string(&s_val)); } else if (G_VALUE_TYPE(&field->value) == GST_TYPE_DOUBLE_RANGE) { type = G_TYPE_DOUBLE; - t = g_strdup(g_value_get_string(&s_val)); - } else { - t = _gst_structure_wrap_string(g_strdup(g_value_get_string(&s_val))); } - g_string_append_printf(s, ", %s=(%s)%s", g_quark_to_string(field->name), _gst_structure_to_abbr(type), t); g_free(t); - g_value_unset (&s_val); } return g_string_free(s, FALSE); } Index: gstvalue.c =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstvalue.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- gstvalue.c 23 Dec 2003 21:22:38 -0000 1.9 +++ gstvalue.c 20 Jan 2004 09:14:25 -0000 1.10 @@ -283,8 +283,24 @@ static char * gst_value_serialize_list (const GValue *value) { - g_warning("unimplemented"); - return NULL; + int i; + GArray *array = value->data[0].v_pointer; + GString *s; + GValue *v; + gchar *s_val; + + s = g_string_new("{ "); + for(i=0;i<array->len;i++){ + v = &g_array_index (array, GValue, i); + s_val = gst_value_serialize (v); + g_string_append (s, s_val); + g_free (s_val); + if (i<array->len - 1) { + g_string_append (s, ", "); + } + } + g_string_append (s, " }"); + return g_string_free (s, FALSE); } static gboolean @@ -384,8 +400,16 @@ static char * gst_value_serialize_fourcc (const GValue *value) { - g_warning("unimplemented"); - return NULL; + guint32 fourcc = value->data[0].v_int; + + if (g_ascii_isalnum ((fourcc>>0) & 0xff) && + g_ascii_isalnum ((fourcc>>8) & 0xff) && + g_ascii_isalnum ((fourcc>>16) & 0xff) && + g_ascii_isalnum ((fourcc>>24) & 0xff)){ + return g_strdup_printf(GST_FOURCC_FORMAT, GST_FOURCC_ARGS(fourcc)); + } else { + return g_strdup_printf("0x%08x", fourcc); + } } static gboolean @@ -499,8 +523,8 @@ static char * gst_value_serialize_int_range (const GValue *value) { - g_warning("unimplemented"); - return NULL; + return g_strdup_printf ("[ %d, %d ]", value->data[0].v_int, + value->data[1].v_int); } static gboolean @@ -619,8 +643,11 @@ static char * gst_value_serialize_double_range (const GValue *value) { - g_warning("unimplemented"); - return NULL; + char d1[G_ASCII_DTOSTR_BUF_SIZE]; + char d2[G_ASCII_DTOSTR_BUF_SIZE]; + g_ascii_dtostr(d1, G_ASCII_DTOSTR_BUF_SIZE, value->data[0].v_double); + g_ascii_dtostr(d2, G_ASCII_DTOSTR_BUF_SIZE, value->data[1].v_double); + return g_strdup_printf ("[ %s, %s ]", d1, d2); } static gboolean @@ -671,8 +698,10 @@ static char * gst_value_serialize_boolean (const GValue *value) { - g_warning("unimplemented"); - return NULL; + if (value->data[0].v_int) { + return g_strdup ("true"); + } + return g_strdup ("false"); } static gboolean @@ -698,8 +727,7 @@ static char * gst_value_serialize_int (const GValue *value) { - g_warning("unimplemented"); - return NULL; + return g_strdup_printf ("%d", value->data[0].v_int); } static gboolean @@ -727,8 +755,9 @@ static char * gst_value_serialize_double (const GValue *value) { - g_warning("unimplemented"); - return NULL; + char d[G_ASCII_DTOSTR_BUF_SIZE]; + g_ascii_dtostr(d, G_ASCII_DTOSTR_BUF_SIZE, value->data[0].v_double); + return g_strdup (d); } static gboolean @@ -750,11 +779,62 @@ return GST_VALUE_EQUAL; } +#define GST_ASCII_IS_STRING(c) (g_ascii_isalnum((c)) || ((c) == '_') || \ + ((c) == '-') || ((c) == '+') || ((c) == '/') || ((c) == ':') || \ + ((c) == '.')) + +static gchar * +gst_string_wrap (const char *s) +{ + const gchar *t; + int len; + gchar *d, *e; + gboolean wrap = FALSE; + + len = 0; + t = s; + while (*t) { + if(GST_ASCII_IS_STRING(*t)) { + len++; + } else if(*t < 0x20 || *t >= 0x7f) { + wrap = TRUE; + len += 4; + } else { + wrap = TRUE; + len += 2; + } + t++; + } + + if (!wrap) return strdup (s); + + e = d = g_malloc(len + 3); + + *e++ = '\"'; + t = s; + while (*t) { + if(GST_ASCII_IS_STRING(*t)) { + *e++ = *t++; + } else if(*t < 0x20 || *t >= 0x7f) { + *e++ = '\\'; + *e++ = '0' + ((*t)>>6); + *e++ = '0' + (((*t)>>3)&0x7); + *e++ = '0' + ((*t++)&0x7); + } else { + *e++ = '\\'; + *e++ = *t++; + } + } + *e++ = '\"'; + *e = 0; + + return d; +} + static char * gst_value_serialize_string (const GValue *value) { - g_warning("unimplemented"); - return NULL; + return gst_string_wrap (value->data[0].v_pointer); } static gboolean @@ -1102,6 +1182,45 @@ g_value_copy (src, dest); } +/** + * gst_value_serialize: + * + */ +gchar * +gst_value_serialize (const GValue *value) +{ + int i; + GValue s_val = { 0 }; + GstValueTable *table; + char *s; + + for(i=0;i<gst_value_table->len;i++){ + table = &g_array_index(gst_value_table, GstValueTable, i); + if(table->type != G_VALUE_TYPE(value) || + table->serialize == NULL) continue; + + return table->serialize(value); + } + + g_value_init (&s_val, G_TYPE_STRING); + g_value_transform (value, &s_val); + s = gst_string_wrap (g_value_get_string (&s_val)); + g_value_unset (&s_val); + + return s; +} + +/** + * gst_value_deserialize: + * + */ +gboolean +gst_value_deserialize (GValue *dest, const gchar *src) +{ + g_warning("unimplemented"); + return FALSE; +} + void _gst_value_initialize (void) { Index: gstvalue.h =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstvalue.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- gstvalue.h 12 Jan 2004 03:15:01 -0000 1.11 +++ gstvalue.h 20 Jan 2004 09:14:25 -0000 1.12 @@ -129,6 +129,10 @@ void gst_value_init_and_copy (GValue *dest, const GValue *src); void _gst_value_initialize (void); +gchar * gst_value_serialize (const GValue *value); +gboolean gst_value_deserialize (GValue *dest, const gchar *src); + + G_END_DECLS #endif |
From: David S. <ds...@pd...> - 2004-01-26 23:24:10
|
CVS Root: /home/cvs/gstreamer Module: gstreamer Changes by: ds Date: Mon Jan 26 2004 15:25:36 PST Log message: * gst/gstpad.c: (gst_pad_try_set_caps): Revert last change making try_set_caps() work with non-fixed caps. Modified files: . : ChangeLog gst : gstpad.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.140&r2=1.141 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstpad.c.diff?r1=1.268&r2=1.269 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.140 retrieving revision 1.141 diff -u -d -r1.140 -r1.141 --- ChangeLog 26 Jan 2004 23:16:20 -0000 1.140 +++ ChangeLog 26 Jan 2004 23:25:24 -0000 1.141 @@ -1,3 +1,8 @@ +2004-01-26 David Schleef <ds...@sc...> + + * gst/gstpad.c: (gst_pad_try_set_caps): Revert last change + making try_set_caps() work with non-fixed caps. + 2004-01-26 Ronald Bultje <rb...@ro...> * docs/pwg/advanced_types.xml: Index: gstpad.c =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstpad.c,v retrieving revision 1.268 retrieving revision 1.269 diff -u -d -r1.268 -r1.269 --- gstpad.c 26 Jan 2004 23:16:20 -0000 1.268 +++ gstpad.c 26 Jan 2004 23:25:24 -0000 1.269 @@ -1322,21 +1322,28 @@ g_return_val_if_fail (GST_IS_REAL_PAD (pad), GST_PAD_LINK_REFUSED); g_return_val_if_fail (!GST_FLAG_IS_SET (pad, GST_PAD_NEGOTIATING), GST_PAD_LINK_REFUSED); - + + /* setting non-fixed caps on a pad is not allowed */ + if (!gst_caps_is_fixed (caps)) { + GST_CAT_INFO (GST_CAT_CAPS, + "trying to set unfixed caps on pad %s:%s, not allowed", + GST_DEBUG_PAD_NAME (pad)); + g_warning ("trying to set non fixed caps on pad %s:%s, not allowed", + GST_DEBUG_PAD_NAME (pad)); + + gst_caps_debug (caps, "unfixed caps"); + return GST_PAD_LINK_REFUSED; + } + /* we allow setting caps on non-linked pads. It's ignored */ if (!GST_PAD_PEER (pad)) { return GST_PAD_LINK_OK; } /* if the desired caps are already there, it's trivially ok */ - if (GST_PAD_CAPS (pad)) { - GstCaps *intersection; - intersection = gst_caps_intersect (caps, GST_PAD_CAPS (pad)); - if (!gst_caps_is_empty (intersection)) { - gst_caps_free (intersection); - return GST_PAD_LINK_OK; - } - gst_caps_free (intersection); + if (GST_PAD_CAPS (pad) && gst_caps_is_equal_fixed (caps, + GST_PAD_CAPS (pad))) { + return GST_PAD_LINK_OK; } g_return_val_if_fail (GST_PAD_LINK_SRC (pad), GST_PAD_LINK_REFUSED); |
From: David S. <ds...@pd...> - 2004-01-27 02:04:47
|
CVS Root: /home/cvs/gstreamer Module: gstreamer Changes by: ds Date: Mon Jan 26 2004 18:06:14 PST Log message: * gst/gstpad.c: (gst_pad_try_set_caps_nonfixed): * gst/gstpad.h: Add new function to allow element to (somewhat) specify non-fixed caps on a pad. * gst/gstqueue.c: (gst_queue_chain): Remove noisy g_object_notify() that I added a few weeks ago. Modified files: . : ChangeLog gst : gstpad.c gstpad.h gstqueue.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.141&r2=1.142 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstpad.c.diff?r1=1.269&r2=1.270 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstpad.h.diff?r1=1.138&r2=1.139 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstqueue.c.diff?r1=1.92&r2=1.93 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.141 retrieving revision 1.142 diff -u -d -r1.141 -r1.142 --- ChangeLog 26 Jan 2004 23:25:24 -0000 1.141 +++ ChangeLog 27 Jan 2004 02:06:02 -0000 1.142 @@ -1,5 +1,13 @@ 2004-01-26 David Schleef <ds...@sc...> + * gst/gstpad.c: (gst_pad_try_set_caps_nonfixed): + * gst/gstpad.h: Add new function to allow element to (somewhat) + specify non-fixed caps on a pad. + * gst/gstqueue.c: (gst_queue_chain): Remove noisy g_object_notify() + that I added a few weeks ago. + +2004-01-26 David Schleef <ds...@sc...> + * gst/gstpad.c: (gst_pad_try_set_caps): Revert last change making try_set_caps() work with non-fixed caps. Index: gstpad.c =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstpad.c,v retrieving revision 1.269 retrieving revision 1.270 diff -u -d -r1.269 -r1.270 --- gstpad.c 26 Jan 2004 23:25:24 -0000 1.269 +++ gstpad.c 27 Jan 2004 02:06:02 -0000 1.270 @@ -1378,13 +1378,66 @@ return ret; } +GstPadLinkReturn +gst_pad_try_set_caps_nonfixed (GstPad *pad, const GstCaps *caps) +{ + GstPadLink *link; + GstPadLink *oldlink; + GstPadLinkReturn ret; + g_return_val_if_fail (pad != NULL, GST_PAD_LINK_REFUSED); + g_return_val_if_fail (GST_IS_REAL_PAD (pad), GST_PAD_LINK_REFUSED); + g_return_val_if_fail (!GST_FLAG_IS_SET (pad, GST_PAD_NEGOTIATING), + GST_PAD_LINK_REFUSED); + /* we allow setting caps on non-linked pads. It's ignored */ + if (!GST_PAD_PEER (pad)) { + return GST_PAD_LINK_OK; + } + /* if the link is already negotiated and the caps are compatible + * with what we're setting, it's trivially OK. */ + if (GST_PAD_CAPS (pad)) { + GstCaps *intersection; + intersection = gst_caps_intersect (caps, GST_PAD_CAPS (pad)); + if (!gst_caps_is_empty (intersection)) { + gst_caps_free (intersection); + return GST_PAD_LINK_OK; + } + gst_caps_free (intersection); + } + g_return_val_if_fail (GST_PAD_LINK_SRC (pad), GST_PAD_LINK_REFUSED); + g_return_val_if_fail (GST_PAD_LINK_SINK (pad), GST_PAD_LINK_REFUSED); + link = gst_pad_link_new (); + + link->srcpad = GST_PAD_LINK_SRC (pad); + link->sinkpad = GST_PAD_LINK_SINK (pad); + + if (!gst_pad_link_ready_for_negotiation (link)) { + gst_pad_link_free (link); + return GST_PAD_LINK_DELAYED; + } + + oldlink = GST_REAL_PAD(pad)->link; + if (oldlink && oldlink->filtercaps) { + link->filtercaps = gst_caps_copy (oldlink->filtercaps); + } + if (link->srcpad == pad) { + link->srccaps = gst_caps_copy(caps); + link->sinkcaps = gst_pad_get_caps (link->sinkpad); + link->srcnotify = FALSE; + } else { + link->srccaps = gst_pad_get_caps (link->srcpad); + link->sinkcaps = gst_caps_copy(caps); + link->sinknotify = FALSE; + } + ret = gst_pad_link_try (link); + return ret; +} /** * gst_pad_can_link_filtered: Index: gstpad.h =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstpad.h,v retrieving revision 1.138 retrieving revision 1.139 diff -u -d -r1.138 -r1.139 --- gstpad.h 15 Jan 2004 03:03:15 -0000 1.138 +++ gstpad.h 27 Jan 2004 02:06:02 -0000 1.139 @@ -410,6 +410,7 @@ GstCaps* gst_pad_get_caps (GstPad *pad); G_CONST_RETURN GstCaps* gst_pad_get_pad_template_caps (GstPad *pad); GstPadLinkReturn gst_pad_try_set_caps (GstPad *pad, const GstCaps *caps); +GstPadLinkReturn gst_pad_try_set_caps_nonfixed (GstPad *pad, const GstCaps *caps); gboolean gst_pad_check_compatibility (GstPad *srcpad, GstPad *sinkpad); void gst_pad_set_getcaps_function (GstPad *pad, GstPadGetCapsFunction getcaps); Index: gstqueue.c =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstqueue.c,v retrieving revision 1.92 retrieving revision 1.93 diff -u -d -r1.92 -r1.93 --- gstqueue.c 26 Jan 2004 23:16:21 -0000 1.92 +++ gstqueue.c 27 Jan 2004 02:06:02 -0000 1.93 @@ -510,7 +510,6 @@ * to make things read-only. Also keep our list uptodate. */ queue->cur_level.bytes -= GST_BUFFER_SIZE (data); queue->cur_level.buffers --; - g_object_notify (G_OBJECT (queue), "current-level-buffers"); if (GST_BUFFER_DURATION (data) != GST_CLOCK_TIME_NONE) queue->cur_level.time -= GST_BUFFER_DURATION (data); @@ -606,7 +605,6 @@ /* Note that we only add buffers (not events) to the statistics */ if (GST_IS_BUFFER (data)) { queue->cur_level.buffers++; - g_object_notify (G_OBJECT (queue), "current-level-buffers"); queue->cur_level.bytes += GST_BUFFER_SIZE (data); if (GST_BUFFER_DURATION (data) != GST_CLOCK_TIME_NONE) queue->cur_level.time += GST_BUFFER_DURATION (data); |
From: David S. <ds...@pd...> - 2004-01-30 21:24:56
|
CVS Root: /home/cvs/gstreamer Module: gstreamer Changes by: ds Date: Fri Jan 30 2004 13:26:27 PST Log message: * gst/cothreads.c: Add another fallback if MAP_ANONYMOUS is missing (#132991) Modified files: . : ChangeLog gst : cothreads.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.177&r2=1.178 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/cothreads.c.diff?r1=1.111&r2=1.112 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.177 retrieving revision 1.178 diff -u -d -r1.177 -r1.178 --- ChangeLog 30 Jan 2004 20:48:09 -0000 1.177 +++ ChangeLog 30 Jan 2004 21:26:15 -0000 1.178 @@ -1,3 +1,8 @@ +2004-01-30 David Schleef <ds...@sc...> + + * gst/cothreads.c: Add another fallback if MAP_ANONYMOUS is + missing (#132991) + 2004-01-30 Laurent Vivier <Lau...@bu...> reviewed by Benjamin Otte Index: cothreads.c =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/cothreads.c,v retrieving revision 1.111 retrieving revision 1.112 diff -u -d -r1.111 -r1.112 --- cothreads.c 4 Nov 2003 17:24:46 -0000 1.111 +++ cothreads.c 30 Jan 2004 21:26:15 -0000 1.112 @@ -42,9 +42,14 @@ #include <ucontext.h> #endif -/* older glibc's have MAP_ANON instead of MAP_ANONYMOUS */ #ifndef MAP_ANONYMOUS +#ifdef MAP_ANON +/* older glibc's have MAP_ANON instead of MAP_ANONYMOUS */ #define MAP_ANONYMOUS MAP_ANON +#else +/* make due without. If this fails, we need to open and map /dev/zero */ +#define MAP_ANONYMOUS 0 +#endif #endif #define STACK_SIZE 0x200000 |
From: David S. <ds...@pd...> - 2004-02-05 02:29:31
|
CVS Root: /home/cvs/gstreamer Module: gstreamer Changes by: ds Date: Wed Feb 04 2004 18:31:05 PST Log message: * gst/gstelement.c: (gst_element_clear_pad_caps): Make sure we have a GstRealPad before accessing its structure members. Modified files: . : ChangeLog gst : gstelement.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.203&r2=1.204 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstelement.c.diff?r1=1.247&r2=1.248 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.203 retrieving revision 1.204 diff -u -d -r1.203 -r1.204 --- ChangeLog 4 Feb 2004 22:35:12 -0000 1.203 +++ ChangeLog 5 Feb 2004 02:30:53 -0000 1.204 @@ -1,3 +1,8 @@ +2004-02-04 David Schleef <ds...@sc...> + + * gst/gstelement.c: (gst_element_clear_pad_caps): Make sure we have + a GstRealPad before accessing its structure members. + 2004-02-04 Benjamin Otte <in...@pu...> * gst/gstclock.c: (gst_clock_init), (gst_clock_set_speed), Index: gstelement.c =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstelement.c,v retrieving revision 1.247 retrieving revision 1.248 diff -u -d -r1.247 -r1.248 --- gstelement.c 3 Feb 2004 22:13:13 -0000 1.247 +++ gstelement.c 5 Feb 2004 02:30:53 -0000 1.248 @@ -2757,7 +2757,9 @@ GstPad *pad = GST_PAD (pads->data); gst_pad_unnegotiate (pad); - gst_caps_replace (&GST_RPAD_EXPLICIT_CAPS (pad), NULL); + if (GST_IS_REAL_PAD (pad)){ + gst_caps_replace (&GST_RPAD_EXPLICIT_CAPS (pad), NULL); + } pads = g_list_next (pads); } |
From: David S. <ds...@pd...> - 2004-02-05 18:58:17
|
CVS Root: /home/cvs/gstreamer Module: gstreamer Changes by: ds Date: Thu Feb 05 2004 10:59:54 PST Log message: * gst/gstmarshal.list: * gst/gstpad.c: (gst_real_pad_class_init), (_gst_real_pad_fixate_accumulator): Revert POINTER->BOXED change in signal marshaller. Modified files: . : ChangeLog gst : gstmarshal.list gstpad.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.208&r2=1.209 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstmarshal.list.diff?r1=1.14&r2=1.15 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstpad.c.diff?r1=1.282&r2=1.283 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.208 retrieving revision 1.209 diff -u -d -r1.208 -r1.209 --- ChangeLog 5 Feb 2004 15:10:14 -0000 1.208 +++ ChangeLog 5 Feb 2004 18:59:42 -0000 1.209 @@ -1,3 +1,10 @@ +2004-02-05 David Schleef <ds...@sc...> + + * gst/gstmarshal.list: + * gst/gstpad.c: (gst_real_pad_class_init), + (_gst_real_pad_fixate_accumulator): + Revert POINTER->BOXED change in signal marshaller. + 2004-02-05 Thomas Vander Stichele <thomas (at) apestaart (dot) org> * gstreamer.spec.in: Index: gstmarshal.list =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstmarshal.list,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- gstmarshal.list 5 Feb 2004 13:51:26 -0000 1.14 +++ gstmarshal.list 5 Feb 2004 18:59:42 -0000 1.15 @@ -16,5 +16,3 @@ BOOLEAN:VOID BOOLEAN:POINTER POINTER:POINTER -BOXED:BOXED -VOID:BOXED Index: gstpad.c =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstpad.c,v retrieving revision 1.282 retrieving revision 1.283 diff -u -d -r1.282 -r1.283 --- gstpad.c 5 Feb 2004 13:51:26 -0000 1.282 +++ gstpad.c 5 Feb 2004 18:59:42 -0000 1.283 @@ -183,8 +183,8 @@ gst_real_pad_signals[REAL_CAPS_NEGO_FAILED] = g_signal_new ("caps_nego_failed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRealPadClass, caps_nego_failed), NULL, NULL, - gst_marshal_VOID__BOXED, G_TYPE_NONE, 1, - GST_TYPE_CAPS); + gst_marshal_VOID__POINTER, G_TYPE_NONE, 1, + G_TYPE_POINTER); gst_real_pad_signals[REAL_LINKED] = g_signal_new ("linked", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRealPadClass, linked), NULL, NULL, @@ -199,9 +199,11 @@ g_signal_new ("fixate", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRealPadClass, appfixatefunc), _gst_real_pad_fixate_accumulator, NULL, - gst_marshal_BOXED__BOXED, GST_TYPE_CAPS, 1, - GST_TYPE_CAPS); + gst_marshal_POINTER__POINTER, G_TYPE_POINTER, 1, + G_TYPE_POINTER); +/* gtk_object_add_arg_type ("GstRealPad::active", G_TYPE_BOOLEAN, */ +/* GTK_ARG_READWRITE, REAL_ARG_ACTIVE); */ g_object_class_install_property (G_OBJECT_CLASS (klass), REAL_ARG_ACTIVE, g_param_spec_boolean ("active", "Active", "Whether the pad is active.", TRUE, G_PARAM_READWRITE)); @@ -219,7 +221,7 @@ _gst_real_pad_fixate_accumulator (GSignalInvocationHint *ihint, GValue *return_accu, const GValue *handler_return, gpointer dummy) { - if (g_value_get_boxed (handler_return)) { + if (g_value_get_pointer (handler_return)) { g_value_copy (handler_return, return_accu); /* stop emission if something was returned */ return FALSE; |
From: David S. <ds...@pd...> - 2004-02-06 18:18:14
|
CVS Root: /home/cvs/gstreamer Module: gstreamer Changes by: ds Date: Fri Feb 06 2004 10:18:09 PST Log message: * gst/gstindex.c: (gst_index_add_format), (gst_index_add_id), (gst_index_add_entry), (gst_index_add_associationv), (gst_index_add_association): Add gst_index_add_associationv() and clean up gst_index_add_association(). #127133 Modified files: . : ChangeLog gst : gstindex.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.213&r2=1.214 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstindex.c.diff?r1=1.16&r2=1.17 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.213 retrieving revision 1.214 diff -u -d -r1.213 -r1.214 --- ChangeLog 6 Feb 2004 17:54:40 -0000 1.213 +++ ChangeLog 6 Feb 2004 18:17:56 -0000 1.214 @@ -1,3 +1,10 @@ +2004-02-06 David Schleef <ds...@sc...> + + * gst/gstindex.c: (gst_index_add_format), (gst_index_add_id), + (gst_index_add_entry), (gst_index_add_associationv), + (gst_index_add_association): Add gst_index_add_associationv() + and clean up gst_index_add_association(). #127133 + 2004-02-06 Thomas Vander Stichele <thomas at apestaart dot org> * autogen.sh: check out common with right tag if CVS/Tag exists Index: gstindex.c =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstindex.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- gstindex.c 3 Feb 2004 03:31:25 -0000 1.16 +++ gstindex.c 6 Feb 2004 18:17:56 -0000 1.17 @@ -54,6 +54,7 @@ gchar **writer_string, gpointer data); static gboolean gst_index_gtype_resolver (GstIndex *index, GstObject *writer, gchar **writer_string, gpointer data); +static void gst_index_add_entry (GstIndex *index, GstIndexEntry *entry); static GstObject *parent_class = NULL; static guint gst_index_signals[LAST_SIGNAL] = { 0 }; @@ -437,7 +438,6 @@ { GstIndexEntry *entry; const GstFormatDefinition* def; - GstIndexClass *iclass; g_return_val_if_fail (GST_IS_INDEX (index), NULL); g_return_val_if_fail (format != 0, NULL); @@ -453,12 +453,7 @@ def = gst_format_get_details (format); entry->data.format.key = def->nick; - iclass = GST_INDEX_GET_CLASS (index); - - if (iclass->add_entry) - iclass->add_entry (index, entry); - - g_signal_emit (G_OBJECT (index), gst_index_signals[ENTRY_ADDED], 0, entry); + gst_index_add_entry (index, entry); return entry; } @@ -477,7 +472,6 @@ gst_index_add_id (GstIndex *index, gint id, gchar *description) { GstIndexEntry *entry; - GstIndexClass *iclass; g_return_val_if_fail (GST_IS_INDEX (index), NULL); g_return_val_if_fail (description != NULL, NULL); @@ -490,12 +484,7 @@ entry->id = id; entry->data.id.description = description; - iclass = GST_INDEX_GET_CLASS (index); - - if (iclass->add_entry) - iclass->add_entry (index, entry); - - g_signal_emit (G_OBJECT (index), gst_index_signals[ENTRY_ADDED], 0, entry); + gst_index_add_entry (index, entry); return entry; } @@ -603,6 +592,59 @@ return TRUE; } +static void +gst_index_add_entry (GstIndex *index, GstIndexEntry *entry) +{ + GstIndexClass *iclass; + + iclass = GST_INDEX_GET_CLASS (index); + + if (iclass->add_entry) { + iclass->add_entry (index, entry); + } + + g_signal_emit (G_OBJECT (index), gst_index_signals[ENTRY_ADDED], 0, entry); +} + +/** + * gst_index_add_associationv: + * @index: the index to add the entry to + * @id: the id of the index writer + * @flags: optinal flags for this entry + * @n: number of associations + * @list: list of associations + * @...: other format/value pairs or 0 to end the list + * + * Associate given format/value pairs with each other. + * + * Returns: a pointer to the newly added entry in the index. + */ +GstIndexEntry* +gst_index_add_associationv (GstIndex *index, gint id, GstAssocFlags flags, + int n, const GstIndexAssociation *list) +{ + GstIndexEntry *entry; + + g_return_val_if_fail (n > 0, NULL); + g_return_val_if_fail (list != NULL, NULL); + g_return_val_if_fail (GST_IS_INDEX (index), NULL); + + if (!GST_INDEX_IS_WRITABLE (index) || id == -1) + return NULL; + + entry = g_malloc (sizeof (GstIndexEntry)); + + entry->type = GST_INDEX_ENTRY_ASSOCIATION; + entry->id = id; + entry->data.assoc.flags = flags; + entry->data.assoc.assocs = g_memdup(list, sizeof (GstIndexAssociation) * n); + entry->data.assoc.nassocs = n; + + gst_index_add_entry (index, entry); + + return entry; +} + /** * gst_index_add_association: * @index: the index to add the entry to @@ -612,7 +654,7 @@ * @value: the value * @...: other format/value pairs or 0 to end the list * - * Associate given format/value pairs with eachother. + * Associate given format/value pairs with each other. * Be sure to pass gint64 values to this functions varargs, * you might want to use a gint64 cast to be sure. * @@ -623,13 +665,11 @@ GstFormat format, gint64 value, ...) { va_list args; - GstIndexAssociation *assoc; GstIndexEntry *entry; - gulong size; - gint nassocs = 0; + GstIndexAssociation *list; + gint n_assocs = 0; GstFormat cur_format; - volatile gint64 dummy; - GstIndexClass *iclass; + GArray *array; g_return_val_if_fail (GST_IS_INDEX (index), NULL); g_return_val_if_fail (format != 0, NULL); @@ -637,49 +677,30 @@ if (!GST_INDEX_IS_WRITABLE (index) || id == -1) return NULL; + array = g_array_new(FALSE, FALSE, sizeof(GstIndexAssociation)); + va_start (args, value); cur_format = format; - + n_assocs = 0; while (cur_format) { - nassocs++; - cur_format = va_arg (args, GstFormat); - if (cur_format) - dummy = va_arg (args, gint64); - } - va_end (args); - - /* make room for two assoc */ - size = sizeof (GstIndexEntry) + (sizeof (GstIndexAssociation) * nassocs); - - entry = g_malloc (size); - - entry->type = GST_INDEX_ENTRY_ASSOCIATION; - entry->id = id; - entry->data.assoc.flags = flags; - assoc = (GstIndexAssociation *) (((guint8 *) entry) + sizeof (GstIndexEntry)); - entry->data.assoc.assocs = assoc; - entry->data.assoc.nassocs = nassocs; - - va_start (args, value); - while (format) { - assoc->format = format; - assoc->value = value; + GstIndexAssociation a; - assoc++; + n_assocs++; + cur_format = va_arg (args, GstFormat); + if (cur_format) { + a.format = cur_format; + a.value = va_arg (args, gint64); - format = va_arg (args, GstFormat); - if (format) - value = va_arg (args, gint64); + g_array_append_val (array, a); + } } va_end (args); - iclass = GST_INDEX_GET_CLASS (index); - - if (iclass->add_entry) - iclass->add_entry (index, entry); + list = (GstIndexAssociation *) g_array_free (array, FALSE); - g_signal_emit (G_OBJECT (index), gst_index_signals[ENTRY_ADDED], 0, entry); + entry = gst_index_add_associationv (index, id, flags, n_assocs, list); + g_free (list); return entry; } |
From: David S. <ds...@pd...> - 2004-02-11 08:29:39
|
CVS Root: /home/cvs/gstreamer Module: gstreamer Changes by: ds Date: Wed Feb 11 2004 00:29:06 PST Log message: * gst/gstpad.c: (gst_pad_link_intersect), (gst_pad_link_fixate), (gst_pad_try_set_caps): Fix format strings for GST_PTR_FORMAT. Modified files: . : ChangeLog gst : gstpad.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.220&r2=1.221 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstpad.c.diff?r1=1.284&r2=1.285 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.220 retrieving revision 1.221 diff -u -d -r1.220 -r1.221 --- ChangeLog 10 Feb 2004 11:57:27 -0000 1.220 +++ ChangeLog 11 Feb 2004 08:28:54 -0000 1.221 @@ -1,3 +1,8 @@ +2004-02-11 David Schleef <ds...@sc...> + + * gst/gstpad.c: (gst_pad_link_intersect), (gst_pad_link_fixate), + (gst_pad_try_set_caps): Fix format strings for GST_PTR_FORMAT. + 2004-02-10 Julien MOUTTE <ju...@mo...> * gst/gstevent.c: (_gst_event_free): Sometimes a tag event arrives but Index: gstpad.c =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstpad.c,v retrieving revision 1.284 retrieving revision 1.285 diff -u -d -r1.284 -r1.285 --- gstpad.c 5 Feb 2004 23:46:13 -0000 1.284 +++ gstpad.c 11 Feb 2004 08:28:54 -0000 1.285 @@ -1046,21 +1046,21 @@ GST_DEBUG ("intersecting link from %s:%s to %s:%s", GST_DEBUG_PAD_NAME (link->srcpad), GST_DEBUG_PAD_NAME (link->sinkpad)); - GST_DEBUG ("srccaps " GST_PTR_FORMAT, link->srccaps); - GST_DEBUG ("sinkcaps " GST_PTR_FORMAT, link->sinkcaps); - GST_DEBUG ("filtercaps " GST_PTR_FORMAT, link->filtercaps); + GST_DEBUG ("srccaps %" GST_PTR_FORMAT, link->srccaps); + GST_DEBUG ("sinkcaps %" GST_PTR_FORMAT, link->sinkcaps); + GST_DEBUG ("filtercaps %" GST_PTR_FORMAT, link->filtercaps); pad_intersection = gst_caps_intersect (link->srccaps, link->sinkcaps); if (link->filtercaps) { - GST_DEBUG ("unfiltered intersection " GST_PTR_FORMAT, pad_intersection); + GST_DEBUG ("unfiltered intersection %" GST_PTR_FORMAT, pad_intersection); link->caps = gst_caps_intersect (pad_intersection, link->filtercaps); gst_caps_free (pad_intersection); } else { link->caps = pad_intersection; } - GST_DEBUG ("intersection " GST_PTR_FORMAT, link->caps); + GST_DEBUG ("intersection %" GST_PTR_FORMAT, link->caps); } static gboolean @@ -1095,7 +1095,7 @@ g_return_if_fail (caps != NULL); g_return_if_fail (!gst_caps_is_empty(caps)); - GST_DEBUG ("trying to fixate caps " GST_PTR_FORMAT, caps); + GST_DEBUG ("trying to fixate caps %" GST_PTR_FORMAT, caps); while (!gst_caps_is_fixed (caps)) { int i; @@ -1106,31 +1106,31 @@ case 0: g_signal_emit (G_OBJECT (link->srcpad), gst_real_pad_signals[REAL_FIXATE], 0, caps, &newcaps); - GST_DEBUG ("app srcpad signal fixated to " GST_PTR_FORMAT, newcaps); + GST_DEBUG ("app srcpad signal fixated to %" GST_PTR_FORMAT, newcaps); break; case 1: g_signal_emit (G_OBJECT (link->sinkpad), gst_real_pad_signals[REAL_FIXATE], 0, caps, &newcaps); - GST_DEBUG ("app sinkpad signal fixated to " GST_PTR_FORMAT, newcaps); + GST_DEBUG ("app sinkpad signal fixated to %" GST_PTR_FORMAT, newcaps); break; case 2: if (GST_RPAD_FIXATEFUNC(link->srcpad)) { newcaps = GST_RPAD_FIXATEFUNC(link->srcpad) ( GST_PAD (link->srcpad), caps); - GST_DEBUG ("srcpad fixated to " GST_PTR_FORMAT, newcaps); + GST_DEBUG ("srcpad fixated to %" GST_PTR_FORMAT, newcaps); } break; case 3: if (GST_RPAD_FIXATEFUNC(link->sinkpad)) { newcaps = GST_RPAD_FIXATEFUNC(link->sinkpad) ( GST_PAD (link->sinkpad), caps); - GST_DEBUG ("sinkpad fixated to " GST_PTR_FORMAT, newcaps); + GST_DEBUG ("sinkpad fixated to %" GST_PTR_FORMAT, newcaps); } break; case 4: newcaps = _gst_pad_default_fixate_func ( GST_PAD(link->srcpad), caps); - GST_DEBUG ("core fixated to GST_PTR_FORMAT", newcaps); + GST_DEBUG ("core fixated to % "GST_PTR_FORMAT, newcaps); break; } if (newcaps) { @@ -1332,7 +1332,7 @@ g_warning ("trying to set non fixed caps on pad %s:%s, not allowed", GST_DEBUG_PAD_NAME (pad)); - GST_DEBUG ("unfixed caps " GST_PTR_FORMAT, caps); + GST_DEBUG ("unfixed caps %" GST_PTR_FORMAT, caps); return GST_PAD_LINK_REFUSED; } |
From: David S. <ds...@pd...> - 2004-02-11 19:03:00
|
CVS Root: /home/cvs/gstreamer Module: gstreamer Changes by: ds Date: Wed Feb 11 2004 11:02:12 PST Log message: reviewed by: David Schleef <ds...@sc...> * gst/gstclock.c: (gst_clock_entry_new): fixes structure initialisation of clock (bug #134128) Modified files: . : ChangeLog gst : gstclock.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.229&r2=1.230 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstclock.c.diff?r1=1.43&r2=1.44 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.229 retrieving revision 1.230 diff -u -d -r1.229 -r1.230 --- ChangeLog 11 Feb 2004 18:49:26 -0000 1.229 +++ ChangeLog 11 Feb 2004 19:02:00 -0000 1.230 @@ -1,3 +1,10 @@ +2004-02-11 ko...@im... + + reviewed by: David Schleef <ds...@sc...> + + * gst/gstclock.c: (gst_clock_entry_new): fixes structure + initialisation of clock (bug #134128) + 2004-02-11 Thomas Vander Stichele <thomas at apestaart dot org> * configure.ac: Index: gstclock.c =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/gst/gstclock.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- gstclock.c 4 Feb 2004 22:35:12 -0000 1.43 +++ gstclock.c 11 Feb 2004 19:02:00 -0000 1.44 @@ -76,7 +76,7 @@ entry->clock = clock; entry->time = time; - entry->interval = time; + entry->interval = interval; entry->type = type; entry->status = GST_CLOCK_ENTRY_OK; |
From: David S. <ds...@pd...> - 2004-02-19 20:14:41
|
CVS Root: /home/cvs/gstreamer Module: gstreamer Changes by: ds Date: Thu Feb 19 2004 12:08:57 PST Log message: * gst/gstinfo.h: Copy G_STRFUNC implementation from glib-2.4 and use it for GST_FUNCTION. (bug #134750) Modified files: . : ChangeLog gst : gstinfo.h Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.257&r2=1.258 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstinfo.h.diff?r1=1.62&r2=1.63 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.257 retrieving revision 1.258 diff -u -d -r1.257 -r1.258 --- a/ChangeLog 19 Feb 2004 17:29:13 -0000 1.257 +++ b/ChangeLog 19 Feb 2004 20:08:45 -0000 1.258 @@ -1,3 +1,8 @@ +2004-02-19 David Schleef <ds...@sc...> + + * gst/gstinfo.h: Copy G_STRFUNC implementation from glib-2.4 + and use it for GST_FUNCTION. (bug #134750) 2004-02-19 Thomas Vander Stichele <thomas at apestaart dot org> * po/fr.po: Index: gstinfo.h RCS file: /home/cvs/gstreamer/gstreamer/gst/gstinfo.h,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- a/gstinfo.h 29 Jan 2004 01:20:22 -0000 1.62 +++ b/gstinfo.h 19 Feb 2004 20:08:45 -0000 1.63 @@ -116,19 +116,16 @@ /* You might want to define GST_FUNCTION in apps' configure script */ #ifndef GST_FUNCTION -#ifdef G_GNUC_PRETTY_FUNCTION -#define GST_FUNCTION G_GNUC_PRETTY_FUNCTION -#elif HAVE_FUNC -#define GST_FUNCTION __func__ -#elif HAVE_PRETTY_FUNCTION -#define GST_FUNCTION __PRETTY_FUNCTION__ -#elif HAVE_FUNCTION -#define GST_FUNCTION __FUNCTION__ +#if defined (__GNUC__) +# define GST_FUNCTION ((const char*) (__PRETTY_FUNCTION__)) +#elif defined (G_HAVE_ISO_VARARGS) +# define GST_FUNCTION ((const char*) (__func__)) #else -#define GST_FUNCTION "" +# define GST_FUNCTION ((const char*) ("???")) #endif #endif /* ifndef GST_FUNCTION */ typedef struct _GstDebugMessage GstDebugMessage; typedef void (*GstLogFunction) (GstDebugCategory * category, GstDebugLevel level, |