From: <wi...@fr...> - 2005-11-19 17:26:44
|
CVS Root: /cvs/gstreamer Module: gstreamer Changes by: wingo Date: Sat Nov 19 2005 09:26:39 PST Log message: 2005-11-19 Andy Wingo <wi...@po...> * gst/gstindex.h (GstIndex): Add field for user_data_destroy. We don't have a dispose function, so it won't get called when the object is unreffed, but oh well! * gst/gstindex.c (gst_index_set_filter_full): New API function, allows a destroy function to be set so user_data can be freed. Fixes #168438. (gst_index_set_filter): Call gst_index_set_filter_full. Modified files: . : ChangeLog gst : gstindex.c gstindex.h Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.1932&r2=1.1933 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstindex.c.diff?r1=1.35&r2=1.36 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstindex.h.diff?r1=1.21&r2=1.22 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.1932 retrieving revision 1.1933 diff -u -d -r1.1932 -r1.1933 --- ChangeLog 19 Nov 2005 17:08:22 -0000 1.1932 +++ ChangeLog 19 Nov 2005 17:26:27 -0000 1.1933 @@ -1,5 +1,14 @@ 2005-11-19 Andy Wingo <wi...@po...> + * gst/gstindex.h (GstIndex): Add field for user_data_destroy. We + don't have a dispose function, so it won't get called when the + object is unreffed, but oh well! + + * gst/gstindex.c (gst_index_set_filter_full): New API function, + allows a destroy function to be set so user_data can be freed. + Fixes #168438. + (gst_index_set_filter): Call gst_index_set_filter_full. * check/gst/gstvalue.c (test_string): Add test for bug #165650. * gst/gstvalue.c (gst_string_wrap): Trying to serialize a NULL Index: gstindex.c RCS file: /cvs/gstreamer/gstreamer/gst/gstindex.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- gstindex.c 14 Nov 2005 11:58:44 -0000 1.35 +++ gstindex.c 19 Nov 2005 17:26:27 -0000 1.36 @@ -402,8 +402,31 @@ { g_return_if_fail (GST_IS_INDEX (index)); + gst_index_set_filter_full (index, filter, user_data, NULL); +} +/** + * gst_index_set_filter_full: + * @index: the index to register the filter on + * @filter: the filter to register + * @user_data: data passed to the filter function + * @user_data_destroy: function to call when @user_data is unset + * + * Lets the app register a custom filter function so that + * it can select what entries should be stored in the index. + */ +void +gst_index_set_filter_full (GstIndex * index, + GstIndexFilter filter, gpointer user_data, GDestroyNotify user_data_destroy) +{ + g_return_if_fail (GST_IS_INDEX (index)); + if (index->filter_user_data && index->filter_user_data_destroy) + index->filter_user_data_destroy (index->filter_user_data); index->filter = filter; index->filter_user_data = user_data; + index->filter_user_data_destroy = user_data_destroy; } /** Index: gstindex.h RCS file: /cvs/gstreamer/gstreamer/gst/gstindex.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- gstindex.h 15 Oct 2005 15:30:22 -0000 1.21 +++ gstindex.h 19 Nov 2005 17:26:27 -0000 1.22 @@ -327,6 +327,7 @@ GstIndexFilter filter; gpointer filter_user_data; + GDestroyNotify filter_user_data_destroy; GHashTable *writers; gint last_id; @@ -369,6 +370,9 @@ void gst_index_set_filter (GstIndex *index, GstIndexFilter filter, gpointer user_data); +void gst_index_set_filter_full (GstIndex *index, + GstIndexFilter filter, gpointer user_data, + GDestroyNotify user_data_destroy); void gst_index_set_resolver (GstIndex *index, GstIndexResolver resolver, gpointer user_data); |