From: Wim T. <wt...@us...> - 2002-12-14 13:00:04
|
CVS Root: /cvsroot/gstreamer Module: gstreamer Changes by: wtay Date: Sat Dec 14 2002 05:00:03 PST Log message: Documentation updates Modified files: gst : cothreads.c gst.c gstbuffer.c gstbufferpool-default.c gstbufferpool-default.h gstclock.c gstclock.h gstdata.c gstelement.c gstelement.h gstindex.c gstobject.c gstpad.c gstpad.h gstprobe.c gstprobe.h gstscheduler.c gstthread.c gstthread.h Links: http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/cothreads.c.diff?r1=1.102&r2=1.103 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gst.c.diff?r1=1.85&r2=1.86 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstbuffer.c.diff?r1=1.57&r2=1.58 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstbufferpool-default.c.diff?r1=1.2&r2=1.3 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstbufferpool-default.h.diff?r1=1.1&r2=1.2 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstclock.c.diff?r1=1.29&r2=1.30 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstclock.h.diff?r1=1.14&r2=1.15 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstdata.c.diff?r1=1.9&r2=1.10 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstelement.c.diff?r1=1.168&r2=1.169 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstelement.h.diff?r1=1.114&r2=1.115 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstindex.c.diff?r1=1.1&r2=1.2 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstobject.c.diff?r1=1.50&r2=1.51 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstpad.c.diff?r1=1.189&r2=1.190 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstpad.h.diff?r1=1.103&r2=1.104 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstprobe.c.diff?r1=1.2&r2=1.3 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstprobe.h.diff?r1=1.2&r2=1.3 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstscheduler.c.diff?r1=1.79&r2=1.80 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstthread.c.diff?r1=1.101&r2=1.102 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstthread.h.diff?r1=1.19&r2=1.20 ====Begin Diffs==== Index: cothreads.c =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/cothreads.c,v retrieving revision 1.102 retrieving revision 1.103 diff -u -d -r1.102 -r1.103 --- cothreads.c 10 Dec 2002 04:05:14 -0000 1.102 +++ cothreads.c 14 Dec 2002 12:59:49 -0000 1.103 @@ -308,21 +308,21 @@ /** * cothread_free: - * @cothread: the cothread state + * @thread: the cothread state * * Free the given cothread state */ void -cothread_free (cothread_state *cothread) +cothread_free (cothread_state *thread) { - g_return_if_fail (cothread != NULL); + g_return_if_fail (thread != NULL); GST_INFO (GST_CAT_COTHREADS, "flag cothread %d for destruction", - cothread->cothreadnum); + thread->cothreadnum); /* we simply flag the cothread for destruction here */ - if (cothread) - cothread->flags |= COTHREAD_DESTROYED; + if (thread) + thread->flags |= COTHREAD_DESTROYED; else g_warning ("somebody set up us the bomb"); } Index: gst.c =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/gst.c,v retrieving revision 1.85 retrieving revision 1.86 diff -u -d -r1.85 -r1.86 --- gst.c 12 Dec 2002 22:14:18 -0000 1.85 +++ gst.c 14 Dec 2002 12:59:50 -0000 1.86 @@ -140,8 +140,9 @@ * This function will return %FALSE if GStreamer could not be initialized * for some reason. If you want your program to fail fatally, * use gst_init() instead. + * + * Returns: TRUE if GStreamer coul be initialized */ - gboolean gst_init_check (int *argc, char **argv[]) { @@ -176,6 +177,8 @@ * Initializes the GStreamer library, parsing the options, * setting up internal path lists, * registering built-in elements, and loading standard plugins. + * + * Returns: TRUE when the initialization succeeded. */ gboolean gst_init_with_popt_table (int *argc, char **argv[], Index: gstbuffer.c =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/gstbuffer.c,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- gstbuffer.c 1 Dec 2002 01:39:35 -0000 1.57 +++ gstbuffer.c 14 Dec 2002 12:59:50 -0000 1.58 @@ -412,6 +412,12 @@ return newbuf; } +/** + * gst_buffer_pool_default_free: + * @pool: a #GstBufferPool to free. + * + * Frees the memory associated with the bufferpool. + */ void gst_buffer_pool_default_free (GstBufferPool *pool) { Index: gstbufferpool-default.c =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/gstbufferpool-default.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- gstbufferpool-default.c 24 Jul 2002 20:20:50 -0000 1.2 +++ gstbufferpool-default.c 14 Dec 2002 12:59:50 -0000 1.3 @@ -51,7 +51,7 @@ /** - * _gst_buffer_pool_get_default: + * gst_buffer_pool_get_default: * @buffer_size: the number of bytes this buffer will store * @pool_size: the default number of buffers to be preallocated * @@ -60,7 +60,7 @@ * already exists this will be returned, otherwise a new instance will * be created. * - * Returns: an instance of GstBufferPool + * Returns: an instance of #GstBufferPool */ GstBufferPool* gst_buffer_pool_get_default (guint buffer_size, guint pool_size) Index: gstbufferpool-default.h =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/gstbufferpool-default.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- gstbufferpool-default.h 24 Jul 2002 20:20:50 -0000 1.1 +++ gstbufferpool-default.h 14 Dec 2002 12:59:50 -0000 1.2 @@ -29,7 +29,7 @@ G_BEGIN_DECLS /* a default pool */ -GstBufferPool* gst_buffer_pool_get_default (guint size, guint numbuffers); +GstBufferPool* gst_buffer_pool_get_default (guint buffer_size, guint pool_size); G_END_DECLS Index: gstclock.c =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/gstclock.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- gstclock.c 11 Dec 2002 21:33:07 -0000 1.29 +++ gstclock.c 14 Dec 2002 12:59:50 -0000 1.30 @@ -92,7 +92,7 @@ } /** - * gst_clock_new_periodic__id + * gst_clock_new_periodic_id * @clock: The clockid to get a periodic notification id from * @start_time: the requested start time * @interval: the requested interval @@ -191,15 +191,13 @@ } /** - * gst_clock_wait_async - * @clock: a #GstClock to wait on - * @time: The #GstClockTime to wait for + * gst_clock_id_wait_async: + * @id: a #GstClockID to wait on * @func: The callback function * @user_data: User data passed in the calback * - * Register a callback on the given clock that will be triggered - * when the clock has reached the given time. A ClockID is returned - * that can be used to cancel the request. + * Register a callback on the given clockid with the given + * function and user_data. * * Returns: the result of the non blocking wait. */ @@ -230,13 +228,10 @@ } /** - * gst_clock_remove_id - * @clock: The clock to cancel the request on - * @id: The id to cancel + * gst_clock_id_unschedule: + * @id: The id to unschedule * * Cancel an outstanding async notification request with the given ID. - * This can be an ID generated with gst_clock_wait_async() or - * gst_clock_notify_async(). */ void gst_clock_id_unschedule (GstClockID id) @@ -254,7 +249,7 @@ } /** - * gst_clock_id_free + * gst_clock_id_free: * @id: The clockid to free * * Free the resources held by the given id @@ -268,7 +263,7 @@ } /** - * gst_clock_unlock_id + * gst_clock_id_unlock: * @id: The clockid to unlock * * Unlock the givan ClockID. Index: gstclock.h =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/gstclock.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- gstclock.h 2 Nov 2002 13:54:34 -0000 1.14 +++ gstclock.h 14 Dec 2002 12:59:50 -0000 1.15 @@ -61,17 +61,18 @@ typedef struct _GstClock GstClock; typedef struct _GstClockClass GstClockClass; -typedef gboolean (*GstClockCallback) (GstClock *clock, GstClockTime time, GstClockID id, gpointer user_data); +typedef gboolean (*GstClockCallback) (GstClock *clock, GstClockTime time, + GstClockID id, gpointer user_data); typedef enum { - /*< protected >*/ + /* --- protected --- */ GST_CLOCK_ENTRY_OK, GST_CLOCK_ENTRY_EARLY, GST_CLOCK_ENTRY_RESTART, } GstClockEntryStatus; typedef enum { - /*< protected >*/ + /* --- protected --- */ GST_CLOCK_ENTRY_SINGLE, GST_CLOCK_ENTRY_PERIODIC, } GstClockEntryType; @@ -84,7 +85,7 @@ #define GST_CLOCK_ENTRY_STATUS(entry) ((entry)->status) struct _GstClockEntry { - /*< protected >*/ + /* --- protected --- */ GstClock *clock; GstClockEntryType type; GstClockTime time; Index: gstdata.c =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/gstdata.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- gstdata.c 28 Nov 2002 00:10:38 -0000 1.9 +++ gstdata.c 14 Dec 2002 12:59:50 -0000 1.10 @@ -103,6 +103,8 @@ * gst_data_needs_copy_on_write: * @data: a #GstData to copy * + * Query if the gstdata needs to be copied before it can safely be modified. + * * Returns: TRUE if the given #GstData is potentially shared and needs to * be copied before it can be modified safely. */ Index: gstelement.c =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/gstelement.c,v retrieving revision 1.168 retrieving revision 1.169 diff -u -d -r1.168 -r1.169 --- gstelement.c 12 Dec 2002 22:14:28 -0000 1.168 +++ gstelement.c 14 Dec 2002 12:59:50 -0000 1.169 @@ -766,14 +766,29 @@ return res; } +/** + * gst_element_is_indexable: + * @element: a #GstElement. + * + * Queries if the element can be indexed/ + * + * Returns: TRUE if the element can be indexed. + */ gboolean -gst_element_is_cachable (GstElement *element) +gst_element_is_indexable (GstElement *element) { g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE); return (CLASS (element)->set_index != NULL); } +/** + * gst_element_set_index: + * @element: a #GstElement. + * @index: a #GstIndex. + * + * Set the specified GstIndex on the element. + */ void gst_element_set_index (GstElement *element, GstIndex *index) { @@ -784,6 +799,15 @@ CLASS (element)->set_index (element, index); } +/** + * gst_element_get_index: + * @element: a #GstElement. + * + * Gets the index from the element. + * + * Returns: a #GstIndex or NULL when no index was set on the + * element. + */ GstIndex* gst_element_get_index (GstElement *element) { @@ -794,7 +818,6 @@ return NULL; } - /** * gst_element_release_locks: Index: gstelement.h =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/gstelement.h,v retrieving revision 1.114 retrieving revision 1.115 diff -u -d -r1.114 -r1.115 --- gstelement.h 12 Dec 2002 22:14:30 -0000 1.114 +++ gstelement.h 14 Dec 2002 12:59:50 -0000 1.115 @@ -224,7 +224,7 @@ GstClockReturn gst_element_clock_wait (GstElement *element, GstClock *clock, GstClockTime time, GstClockTimeDiff *jitter); /* indexs */ -gboolean gst_element_is_cachable (GstElement *element); +gboolean gst_element_is_indexable (GstElement *element); void gst_element_set_index (GstElement *element, GstIndex *index); GstIndex* gst_element_get_index (GstElement *element); Index: gstindex.c =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/gstindex.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- gstindex.c 12 Dec 2002 22:16:10 -0000 1.1 +++ gstindex.c 14 Dec 2002 12:59:50 -0000 1.2 @@ -226,6 +226,15 @@ return index->curgroup->certainty; } +/** + * gst_index_set_filter: + * @index: the index to register the filter on + * @filter: the filter to register + * @user_data: data passed to the filter function + * + * 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 (GstIndex *index, GstIndexFilter filter, gpointer user_data) @@ -236,6 +245,15 @@ index->filter_user_data = user_data; } +/** + * gst_index_set_resolver: + * @index: the index to register the resolver on + * @resolver: the resolver to register + * @user_data: data passed to the resolver function + * + * Lets the app register a custom function to map index + * ids to writer descriptions. + */ void gst_index_set_resolver (GstIndex *index, GstIndexResolver resolver, gpointer user_data) @@ -246,6 +264,12 @@ index->resolver_user_data = user_data; } +/** + * gst_index_entry_free: + * @entry: the entry to free + * + * Free the memory used by the given entry. + */ void gst_index_entry_free (GstIndexEntry *entry) { @@ -294,6 +318,8 @@ * @id: the id of the index writer * @description: the description of the index writer * + * Add an id entry into the index. + * * Returns: a pointer to the newly added entry in the index. */ GstIndexEntry* @@ -371,6 +397,7 @@ * gst_index_add_association: * @index: the index to add the entry to * @id: the id of the index writer + * @flags: optinal flags for this entry * @format: the format of the value * @value: the value * @...: other format/value pairs or 0 to end the list @@ -441,6 +468,25 @@ return entry; } +/** + * gst_index_add_object: + * @index: the index to add the object to + * @id: the id of the index writer + * @key: a key for the object + * @type: the GType of the object + * @object: a pointer to the object to add + * + * Add the given object to the index with the given key. + * + * Returns: a pointer to the newly added entry in the index. + */ +GstIndexEntry* +gst_index_add_object (GstIndex *index, gint id, gchar *key, + GType type, gpointer object) +{ + return NULL; +} + static gint gst_index_compare_func (gconstpointer a, gconstpointer b, @@ -449,6 +495,19 @@ return a - b; } +/** + * gst_index_get_assoc_entry: + * @index: the index to search + * @id: the id of the index writer + * @method: The lookup method to use + * @format: the format of the value + * @value: the value to find + * + * Finds the given format/value in the index + * + * Returns: the entry associated with the value or NULL if the + * value was not found. + */ GstIndexEntry* gst_index_get_assoc_entry (GstIndex *index, gint id, GstIndexLookupMethod method, @@ -460,6 +519,22 @@ gst_index_compare_func, NULL); } +/** + * gst_index_get_assoc_entry_full: + * @index: the index to search + * @id: the id of the index writer + * @method: The lookup method to use + * @format: the format of the value + * @value: the value to find + * @func: the function used to compare entries + * @user_data: user data passed to the compare function + * + * Finds the given format/value in the index with the given + * compare function and user_data. + * + * Returns: the entry associated with the value or NULL if the + * value was not found. + */ GstIndexEntry* gst_index_get_assoc_entry_full (GstIndex *index, gint id, GstIndexLookupMethod method, @@ -475,6 +550,17 @@ return NULL; } +/** + * gst_index_entry_assoc_map: + * @entry: the index to search + * @format: the format of the value the find + * @value: a pointer to store the value + * + * Gets alternative formats associated with the indexentry. + * + * Returns: TRUE if there was a value associated with the given + * format. + */ gboolean gst_index_entry_assoc_map (GstIndexEntry *entry, GstFormat format, gint64 *value) Index: gstobject.c =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/gstobject.c,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- gstobject.c 20 Nov 2002 21:13:07 -0000 1.50 +++ gstobject.c 14 Dec 2002 12:59:50 -0000 1.51 @@ -315,7 +315,8 @@ * @object: the #GObject that signalled the notify. * @orig: a #GstObject that initiated the notify. * @pspec: a #GParamSpec of the property. - * @excluded_props: a set of user-specified properties to exclude. + * @excluded_props: a set of user-specified properties to exclude or + * NULL to show all changes. * * Adds a default deep_notify signal callback to an * element. The user data should contain a pointer to an array of Index: gstpad.c =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/gstpad.c,v retrieving revision 1.189 retrieving revision 1.190 diff -u -d -r1.189 -r1.190 --- gstpad.c 6 Dec 2002 20:03:57 -0000 1.189 +++ gstpad.c 14 Dec 2002 12:59:50 -0000 1.190 @@ -357,7 +357,6 @@ GstPadDirection gst_pad_get_direction (GstPad *pad) { - g_return_val_if_fail (pad != NULL, GST_PAD_UNKNOWN); g_return_val_if_fail (GST_IS_PAD (pad), GST_PAD_UNKNOWN); return GST_PAD_DIRECTION (pad); @@ -366,6 +365,7 @@ /** * gst_pad_set_active: * @pad: the #GstPad to activate or deactivate. + * @active: TRUE to activate the pad. * * Activates or deactivates the given pad. */ @@ -375,7 +375,6 @@ GstRealPad *realpad; gboolean old; - g_return_if_fail (pad != NULL); g_return_if_fail (GST_IS_PAD (pad)); if (GST_PAD_IS_ACTIVE (pad) == active) @@ -399,6 +398,22 @@ } /** + * gst_pad_is_active: + * @pad: the #GstPad to query + * + * Query if a pad is active + * + * Returns: TRUE if the pad is active. + */ +gboolean +gst_pad_is_active (GstPad *pad) +{ + g_return_val_if_fail (GST_IS_PAD (pad), FALSE); + + return !GST_FLAG_IS_SET (pad, GST_PAD_DISABLED); +} + +/** * gst_pad_set_name: * @pad: a #GstPad to set the name of. * @name: the name of the pad. @@ -409,7 +424,6 @@ void gst_pad_set_name (GstPad *pad, const gchar *name) { - g_return_if_fail (pad != NULL); g_return_if_fail (GST_IS_PAD (pad)); gst_object_set_name (GST_OBJECT (pad), name); @@ -482,7 +496,6 @@ gst_pad_set_event_function (GstPad *pad, GstPadEventFunction event) { - g_return_if_fail (pad != NULL); g_return_if_fail (GST_IS_REAL_PAD (pad)); GST_RPAD_EVENTFUNC (pad) = event; @@ -491,19 +504,34 @@ GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (event)); } +/** + * gst_pad_set_event_mask_function: + * @pad: a #GstPad to set the event mask function for. + * @mask_func: the #GstPadEventMaskFunction to set. + * + * Sets the given event mask function for the pad. + */ void gst_pad_set_event_mask_function (GstPad *pad, - GstPadEventMaskFunction mask_function) + GstPadEventMaskFunction mask_func) { - g_return_if_fail (pad != NULL); g_return_if_fail (GST_IS_REAL_PAD (pad)); - GST_RPAD_EVENTMASKFUNC (pad) = mask_function; + GST_RPAD_EVENTMASKFUNC (pad) = mask_func; GST_DEBUG (GST_CAT_PADS, "eventmaskfunc for %s:%s set to %s", - GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (mask_function)); + GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (mask_func)); } +/** + * gst_pad_get_event_masks: + * @pad: a #GstPad to get the event mask for. + * + * Gets the array of eventmasks from the given pad. + * + * Returns: an array with eventmasks, the list is ended + * with 0 + */ const GstEventMask* gst_pad_get_event_masks (GstPad *pad) { @@ -523,13 +551,22 @@ } static gboolean -gst_pad_get_event_masks_dispatcher (GstPad *pad, const GstFormat **data) +gst_pad_get_event_masks_dispatcher (GstPad *pad, const GstEventMask **data) { - *data = gst_pad_get_formats (pad); + *data = gst_pad_get_event_masks (pad); return TRUE; } +/** + * gst_pad_get_event_masks_default: + * @pad: a #GstPad to get the event mask for. + * + * Invokes the default event masks dispatcher on the pad. + * + * Returns: an array with eventmasks, the list is ended + * with 0 + */ const GstEventMask* gst_pad_get_event_masks_default (GstPad *pad) { @@ -541,6 +578,15 @@ return result; } +/** + * gst_pad_handles_event: + * @pad: a #GstPad to check + * @mask: the mask to check + * + * Checks if the pad can handle the given eventmask. + * + * Returns: TRUE if the pad can handle the given eventmask + */ gboolean gst_pad_handles_event (GstPad *pad, GstEventMask *mask) { @@ -603,6 +649,13 @@ GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (query)); } +/** + * gst_pad_set_query_type_function: + * @pad: the #GstPad to set the query type function for. + * @type_func: the #GstPadQueryTypeFunction to set. + * + * Set the given query type function for the pad. + */ void gst_pad_set_query_type_function (GstPad *pad, GstPadQueryTypeFunction type_func) { @@ -615,6 +668,15 @@ GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (type_func)); } +/** + * gst_pad_get_query_types: + * @pad: the #GstPad to query + * + * Get an array of supported queries that can be performed + * on this pad. + * + * Returns: an array of querytypes anded with 0. + */ const GstPadQueryType* gst_pad_get_query_types (GstPad *pad) { @@ -641,6 +703,15 @@ return TRUE; } +/** + * gst_pad_get_query_types_default: + * @pad: the #GstPad to query + * + * Invoke the default dispatcher for the query types on + * the pad. + * + * Returns: an array of querytypes anded with 0. + */ const GstPadQueryType* gst_pad_get_query_types_default (GstPad *pad) { @@ -1100,7 +1171,6 @@ GstPadTemplate* gst_pad_get_pad_template (GstPad *pad) { - g_return_val_if_fail (pad != NULL, NULL); g_return_val_if_fail (GST_IS_PAD (pad), NULL); return GST_PAD_PAD_TEMPLATE (pad); @@ -1111,7 +1181,10 @@ * gst_pad_get_scheduler: * @pad: a #GstPad to get the scheduler of. * - * Gets the scheduler of the pad. + * Gets the scheduler of the pad. Since the pad does not + * have a scheduler of its own, the scheduler of the parent + * is taken. For decoupled pads, the scheduler of the peer + * parent is taken. * * Returns: the #GstScheduler of the pad. */ @@ -1121,7 +1194,6 @@ GstScheduler *scheduler = NULL; GstElement *parent; - g_return_val_if_fail (pad != NULL, NULL); g_return_val_if_fail (GST_IS_PAD (pad), NULL); parent = gst_pad_get_parent (pad); @@ -2041,12 +2113,10 @@ } /* FIXME: shouldn't pad and ghost be switched ? - * FIXME: shouldn't the bin argument be dumped ? */ /** * gst_ghost_pad_save_thyself: * @pad: a ghost #GstPad to save. - * @bin: the #bin * @parent: the parent #xmlNodePtr to save the description in. * * Saves the ghost pad into an xml representation. @@ -2469,7 +2539,7 @@ * * Creates a new ghost pad associated with the given pad, and names it with * the given name. If name is NULL, a guaranteed unique name (across all - * ghost pads) will be assigned (most likely of the form ghostpad%d). + * ghost pads) will be assigned (most likely of the form ghostpad&perc;d). * * Returns: a new ghost #GstPad, or NULL in case of an error. */ @@ -2887,6 +2957,15 @@ return FALSE; } +/** + * gst_pad_handles_format: + * @pad: a #GstPad to check + * @format: the format to check + * + * Checks if the pad can handle the given format. + * + * Returns: TRUE if the pad can handle the given format + */ gboolean gst_pad_handles_format (GstPad *pad, GstFormat format) { @@ -2914,6 +2993,14 @@ return TRUE; } +/** + * gst_pad_get_formats_default: + * @pad: a #GstPad to query + * + * Invoke the default format dispatcher for the pad. + * + * Returns: An array of GstFormats ended with a 0 value. + */ const GstFormat* gst_pad_get_formats_default (GstPad *pad) { @@ -2925,6 +3012,14 @@ return result; } +/** + * gst_pad_get_formats: + * @pad: a #GstPad to query + * + * Gets the list of supported formats from the pad. + * + * Returns: An array of GstFormats ended with a 0 value. + */ const GstFormat* gst_pad_get_formats (GstPad *pad) { Index: gstpad.h =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/gstpad.h,v retrieving revision 1.103 retrieving revision 1.104 diff -u -d -r1.103 -r1.104 --- gstpad.h 29 Nov 2002 17:05:08 -0000 1.103 +++ gstpad.h 14 Dec 2002 12:59:50 -0000 1.104 @@ -285,9 +285,6 @@ #define GST_RPAD_QUERYTYPEFUNC(pad) (((GstRealPad *)(pad))->querytypefunc) #define GST_RPAD_EVENTMASKFUNC(pad) (((GstRealPad *)(pad))->eventmaskfunc) -#define GST_RPAD_EVENT_MASKS(pad) (((GstRealPad *)(pad))->event_masks) -#define GST_RPAD_QUERY_TYPES(pad) (((GstRealPad *)(pad))->query_types) - #define GST_RPAD_CONNECTFUNC(pad) (((GstRealPad *)(pad))->connectfunc) #define GST_RPAD_GETCAPSFUNC(pad) (((GstRealPad *)(pad))->getcapsfunc) #define GST_RPAD_BUFFERPOOLFUNC(pad) (((GstRealPad *)(pad))->bufferpoolfunc) @@ -480,7 +477,8 @@ /* convert/query/format functions */ -void gst_pad_set_formats_function (GstPad *pad, GstPadFormatsFunction format); +void gst_pad_set_formats_function (GstPad *pad, + GstPadFormatsFunction formats); gboolean gst_pad_handles_format (GstPad *pad, GstFormat format); const GstFormat* gst_pad_get_formats (GstPad *pad); const GstFormat* gst_pad_get_formats_default (GstPad *pad); @@ -494,7 +492,7 @@ GstFormat *dest_format, gint64 *dest_value); void gst_pad_set_query_function (GstPad *pad, GstPadQueryFunction query); -void gst_pad_set_query_type_function (GstPad *pad, GstPadQueryTypeFunction type_function); +void gst_pad_set_query_type_function (GstPad *pad, GstPadQueryTypeFunction type_func); const GstPadQueryType* gst_pad_get_query_types (GstPad *pad); const GstPadQueryType* gst_pad_get_query_types_default (GstPad *pad); gboolean gst_pad_query (GstPad *pad, GstPadQueryType type, @@ -511,10 +509,9 @@ gpointer data); #define gst_pad_add_probe(pad, probe) \ - (gst_probe_dispatcher_add_probe (&(GST_REAL_PAD (pad)-probedisp), probe)) + (gst_probe_dispatcher_add_probe (&(GST_REAL_PAD (pad)-probedisp), probe)) #define gst_pad_remove_probe(pad, probe) \ - (gst_probe_dispatcher_remove_probe (&(GST_REAL_PAD (pad)-probedisp), probe)) - + (gst_probe_dispatcher_remove_probe (&(GST_REAL_PAD (pad)-probedisp), probe)) #ifndef GST_DISABLE_LOADSAVE void gst_pad_load_and_connect (xmlNodePtr self, GstObject *parent); Index: gstprobe.c =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/gstprobe.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- gstprobe.c 2 Nov 2002 14:06:43 -0000 1.2 +++ gstprobe.c 14 Dec 2002 12:59:50 -0000 1.3 @@ -24,7 +24,16 @@ #include "gstlog.h" #include "gstprobe.h" - +/** + * gst_probe_new: + * @single_shot: TRUE if a single shot probe is required + * @callback: the function to call when the probe is triggered + * @user_data: data passed to the callback function + * + * Create a new probe with the specified parameters + * + * Returns: a new #GstProbe. + */ GstProbe* gst_probe_new (gboolean single_shot, GstProbeCallback callback, @@ -43,6 +52,12 @@ return probe; } +/** + * gst_probe_destroy: + * @probe: The probe to destroy + * + * Free the memeory associated with the probe. + */ void gst_probe_destroy (GstProbe *probe) { @@ -51,6 +66,15 @@ g_free (probe); } +/** + * gst_probe_perform: + * @probe: The probe to trigger + * @data: the GstData that triggered the probe. + * + * Perform the callback associated with the given probe. + * + * Returns: the result of the probe callback function. + */ gboolean gst_probe_perform (GstProbe *probe, GstData *data) { @@ -64,6 +88,13 @@ return res; } +/** + * gst_probe_dispatcher_new: + * + * Create a new probe dispatcher + * + * Returns: a new probe dispatcher. + */ GstProbeDispatcher* gst_probe_dispatcher_new (void) { @@ -76,11 +107,29 @@ return disp; } +/** + * gst_probe_dispatcher_destroy: + * @disp: the dispatcher to destroy + * + * Free the memory allocated by the probe dispatcher. All pending + * probes are removed first. + */ void gst_probe_dispatcher_destroy (GstProbeDispatcher *disp) { + g_return_if_fail (disp); + + /* FIXME, free pending probes */ + g_free (disp); } +/** + * gst_probe_dispatcher_init: + * @disp: the dispatcher to initialize + * + * Initialize the dispatcher. Useful for statically allocated probe + * dispatchers. + */ void gst_probe_dispatcher_init (GstProbeDispatcher *disp) { @@ -90,6 +139,14 @@ disp->probes = NULL; } +/** + * gst_probe_dispatcher_set_active: + * @disp: the dispatcher to activate + * @active: boolean to indicate activation or deactivation + * + * Activate or deactivate the given dispatcher + * dispatchers. + */ void gst_probe_dispatcher_set_active (GstProbeDispatcher *disp, gboolean active) { @@ -98,6 +155,13 @@ disp->active = active; } +/** + * gst_probe_dispatcher_add_probe: + * @disp: the dispatcher to add the probe to + * @probe: the probe to add to the dispatcher + * + * Adds the given probe to the dispatcher. + */ void gst_probe_dispatcher_add_probe (GstProbeDispatcher *disp, GstProbe *probe) { @@ -107,6 +171,13 @@ disp->probes = g_slist_prepend (disp->probes, probe); } +/** + * gst_probe_dispatcher_remove_probe: + * @disp: the dispatcher to remove the probe from + * @probe: the probe to remove from the dispatcher + * + * Removes the given probe from the dispatcher. + */ void gst_probe_dispatcher_remove_probe (GstProbeDispatcher *disp, GstProbe *probe) { @@ -116,6 +187,15 @@ disp->probes = g_slist_remove (disp->probes, probe); } +/** + * gst_probe_dispatcher_dispatch: + * @disp: the dispatcher to dispatch + * @data: the data that triggered the dispatch + * + * Trigger all registered probes on the given dispatcher. + * + * Returns: TRUE if all callbacks returned TRUE. + */ gboolean gst_probe_dispatcher_dispatch (GstProbeDispatcher *disp, GstData *data) { Index: gstprobe.h =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/gstprobe.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- gstprobe.h 2 Nov 2002 14:06:43 -0000 1.2 +++ gstprobe.h 14 Dec 2002 12:59:50 -0000 1.3 @@ -44,12 +44,12 @@ }; -GstProbe* gst_pad_probe_new (gboolean single_shot, +GstProbe* gst_probe_new (gboolean single_shot, GstProbeCallback callback, gpointer user_data); -void gst_pad_probe_destroy (GstProbe *probe); +void gst_probe_destroy (GstProbe *probe); -gboolean gst_pad_probe_perform (GstProbe *probe, GstData *data); +gboolean gst_probe_perform (GstProbe *probe, GstData *data); typedef struct _GstProbeDispatcher GstProbeDispatcher; Index: gstscheduler.c =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/gstscheduler.c,v retrieving revision 1.79 retrieving revision 1.80 diff -u -d -r1.79 -r1.80 --- gstscheduler.c 6 Dec 2002 23:05:25 -0000 1.79 +++ gstscheduler.c 14 Dec 2002 12:59:50 -0000 1.80 @@ -295,15 +295,13 @@ } /** - * gst_scheduler_state_transition: + * gst_scheduler_scheduling_change: * @sched: the scheduler - * @element: the element with the state transition - * @transition: the state transition - * - * Tell the scheduler that an element changed its state. + * @element: the element that changed its scheduling strategy * - * Returns: a GstElementStateReturn indicating success or failure - * of the state transition. + * Tell the scheduler that an element changed its scheduling strategy. + * An element could, for example, change its loop function or changes + * from a loop based element to a chain based element. */ void gst_scheduler_scheduling_change (GstScheduler *sched, GstElement *element) Index: gstthread.c =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/gstthread.c,v retrieving revision 1.101 retrieving revision 1.102 diff -u -d -r1.101 -r1.102 --- gstthread.c 7 Dec 2002 14:15:52 -0000 1.101 +++ gstthread.c 14 Dec 2002 12:59:50 -0000 1.102 @@ -60,7 +60,6 @@ enum { ARG_0, - ARG_SCHEDPOLICY, ARG_PRIORITY, }; @@ -71,9 +70,10 @@ static void gst_thread_dispose (GObject *object); -static void gst_thread_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); -static void gst_thread_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); - +static void gst_thread_set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec); +static void gst_thread_get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec); static GstElementStateReturn gst_thread_change_state (GstElement *element); @@ -86,21 +86,23 @@ static void* gst_thread_main_loop (void *arg); -#define GST_TYPE_THREAD_SCHEDPOLICY (gst_thread_schedpolicy_get_type()) +#define GST_TYPE_THREAD_PRIORITY (gst_thread_priority_get_type()) static GType -gst_thread_schedpolicy_get_type(void) { - static GType thread_schedpolicy_type = 0; - static GEnumValue thread_schedpolicy[] = { - {G_THREAD_PRIORITY_LOW, "LOW", "Low Priority Scheduling"}, - {G_THREAD_PRIORITY_NORMAL, "NORMAL", "Normal Scheduling"}, - {G_THREAD_PRIORITY_HIGH, "HIGH", "High Priority Scheduling"}, - {G_THREAD_PRIORITY_URGENT, "URGENT", "Urgent Scheduling"}, - {0, NULL, NULL}, +gst_thread_priority_get_type(void) +{ + static GType thread_priority_type = 0; + static GEnumValue thread_priority[] = + { + { G_THREAD_PRIORITY_LOW, "LOW", "Low Priority Scheduling" }, + { G_THREAD_PRIORITY_NORMAL, "NORMAL", "Normal Scheduling" }, + { G_THREAD_PRIORITY_HIGH, "HIGH", "High Priority Scheduling" }, + { G_THREAD_PRIORITY_URGENT, "URGENT", "Urgent Scheduling" }, + { 0, NULL, NULL }, }; - if (!thread_schedpolicy_type) { - thread_schedpolicy_type = g_enum_register_static("GstThreadSchedPolicy", thread_schedpolicy); + if (!thread_priority_type) { + thread_priority_type = g_enum_register_static("GstThreadPriority", thread_priority); } - return thread_schedpolicy_type; + return thread_priority_type; } static GstBinClass *parent_class = NULL; @@ -140,12 +142,9 @@ parent_class = g_type_class_ref (GST_TYPE_BIN); - g_object_class_install_property(G_OBJECT_CLASS (klass), ARG_SCHEDPOLICY, - g_param_spec_enum("schedpolicy", "Scheduling Policy", "The scheduling policy of the thread", - GST_TYPE_THREAD_SCHEDPOLICY, G_THREAD_PRIORITY_NORMAL, G_PARAM_READWRITE)); - g_object_class_install_property(G_OBJECT_CLASS (klass), ARG_PRIORITY, - g_param_spec_int("priority", "Scheduling Priority", "The scheduling priority of the thread", - 0, 99, 0, G_PARAM_READWRITE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_PRIORITY, + g_param_spec_enum ("priority", "Scheduling Policy", "The scheduling priority of the thread", + GST_TYPE_THREAD_PRIORITY, G_THREAD_PRIORITY_NORMAL, G_PARAM_READWRITE)); gst_thread_signals[SHUTDOWN] = g_signal_new ("shutdown", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, @@ -186,8 +185,7 @@ thread->ppid = getpid (); thread->thread_id = (GThread *) NULL; /* set in NULL -> READY */ - thread->sched_policy = G_THREAD_PRIORITY_NORMAL; - thread->priority = 0; + thread->priority = G_THREAD_PRIORITY_NORMAL; thread->stack = NULL; } @@ -216,22 +214,31 @@ } } +/** + * gst_thread_set_priority: + * @thread: the thread to change + * @priority: the new priority for the thread + * + * change the thread's priority + */ +void +gst_thread_set_priority (GstThread *thread, GThreadPriority priority) +{ + g_return_if_fail (GST_IS_THREAD (thread)); + + thread->priority = priority; +} + static void gst_thread_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GstThread *thread; - /* it's not null if we got it, but it might not be ours */ - g_return_if_fail (GST_IS_THREAD (object)); - thread = GST_THREAD (object); switch (prop_id) { - case ARG_SCHEDPOLICY: - thread->sched_policy = g_value_get_enum (value); - break; case ARG_PRIORITY: - thread->priority = g_value_get_int (value); + thread->priority = g_value_get_enum (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -244,17 +251,11 @@ { GstThread *thread; - /* it's not null if we got it, but it might not be ours */ - g_return_if_fail (GST_IS_THREAD (object)); - thread = GST_THREAD (object); switch (prop_id) { - case ARG_SCHEDPOLICY: - g_value_set_enum (value, thread->sched_policy); - break; case ARG_PRIORITY: - g_value_set_int (value, thread->priority); + g_value_set_enum (value, thread->priority); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -365,7 +366,7 @@ */ GST_DEBUG (GST_CAT_THREAD, "going to g_thread_create_full..."); thread->thread_id = g_thread_create_full(gst_thread_main_loop, - thread, STACK_SIZE, TRUE, TRUE, G_THREAD_PRIORITY_NORMAL, + thread, STACK_SIZE, TRUE, TRUE, thread->priority, &error); if (!thread->thread_id){ Index: gstthread.h =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/gstthread.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- gstthread.h 6 Dec 2002 23:05:25 -0000 1.19 +++ gstthread.h 14 Dec 2002 12:59:50 -0000 1.20 @@ -43,7 +43,6 @@ GST_THREAD_FLAG_LAST = GST_BIN_FLAG_LAST + 4 } GstThreadState; - #define GST_TYPE_THREAD \ (gst_thread_get_type()) #define GST_THREAD(obj) \ @@ -62,8 +61,7 @@ GstBin bin; GThread *thread_id; /* id of the thread, if any */ - int sched_policy; - int priority; + GThreadPriority priority; gpointer *stack; guint stack_size; /* stack size */ gint pid; /* the pid of the thread */ @@ -84,6 +82,8 @@ GType gst_thread_get_type (void); GstElement* gst_thread_new (const gchar *name); + +void gst_thread_set_priority (GstThread *thread, GThreadPriority priority); G_END_DECLS |