[gst-cvs] CVS: gstreamer/gst cothreads.c,1.43,1.44 gst.c,1.44,1.45 gstautoplug.c,1.24,1.25 gstbin.c,1.93,1.94 gstbin.h,1.24,1.25 gstbuffer.c,1.39,1.40 gstbuffer.h,1.28,1.29 gstbufferpool.c,1.20,1.21 gstbufferpool.h,1.12,1.13 gstclock.c,1.13,1.14 gstelement.c,1.78,1.79 gstelement.h,1.62,1.63 gstelementfactory.c,1.50,1.51 gstevent.c,1.2,1.3 gstinfo.c,1.27,1.28 gstobject.c,1.27,1.28 gstpad.c,1.117,1.118 gstpad.h,1.65,1.66 gstpipeline.h,1.12,1.13 gstplugin.c,1.66,1.67 gstplugin.h,1.21,1.22 gstpluginfeature.c,1.3,1.4 gstpluginfeature.h,1.1,1.2 gstscheduler.c,1.33,1.34 gstscheduler.h,1.8,1.9 gsttimecache.c,1.1,1.2 gsttimecache.h,1.1,1.2 gsttype.c,1.31,1.32 gstutils.c,1.19,1.20 gstutils.h,1.10,1.11
Wim Taymans
wtay at users.sourceforge.net
Sun Oct 21 11:01:03 PDT 2001
- Previous message: [gst-cvs] CVS: gstreamer/gst/elements Makefile.am,1.30,1.31 gstdisksrc.c,1.37,1.38 gstmultidisksrc.c,1.5,1.6 gstpipefilter.c,1.13,1.14 gstsinesrc.c,1.24,NONE gstsinesrc.h,1.14,NONE
- Next message: [gst-cvs] CVS: gstreamer/libs/bytestream gstbytestream.c,1.2,1.3 gstbytestream.h,1.2,1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/gstreamer/gstreamer/gst
In directory usw-pr-cvs1:/tmp/cvs-serv30015
Modified Files:
cothreads.c gst.c gstautoplug.c gstbin.c gstbin.h gstbuffer.c
gstbuffer.h gstbufferpool.c gstbufferpool.h gstclock.c
gstelement.c gstelement.h gstelementfactory.c gstevent.c
gstinfo.c gstobject.c gstpad.c gstpad.h gstpipeline.h
gstplugin.c gstplugin.h gstpluginfeature.c gstpluginfeature.h
gstscheduler.c gstscheduler.h gsttimecache.c gsttimecache.h
gsttype.c gstutils.c gstutils.h
Log Message:
API docs.
revived _buffer_ref_by_count
fast types for scheduler and bin.
error checking on plugin features;
removed some prototypes that were not implemented (gst_pipeline_iterate
comes to mind)
remove gst_pad_event until we know what it's supposed to do.
remove sinesrc, it wasn't compiles anymore, so...
updates to various elements that used the old event API.
Index: cothreads.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/cothreads.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- cothreads.c 2001/09/10 19:46:00 1.43
+++ cothreads.c 2001/10/21 18:00:31 1.44
@@ -192,10 +192,12 @@
* cothread_main:
* @ctx: cothread context to find main thread of
*
+ * Get the main thread.
+ *
* Returns: the #cothread_state of the main (0th) thread
*/
cothread_state*
-cothread_main(cothread_context *ctx)
+cothread_main (cothread_context *ctx)
{
GST_DEBUG (0,"returning %p, the 0th cothread\n",ctx->threads[0]);
return ctx->threads[0];
@@ -204,10 +206,12 @@
/**
* cothread_current_main:
*
+ * Get the main thread in the current pthread.
+ *
* Returns: the #cothread_state of the main (0th) thread in the current pthread
*/
cothread_state*
-cothread_current_main(void)
+cothread_current_main (void)
{
cothread_context *ctx = pthread_getspecific(_cothread_key);
return ctx->threads[0];
@@ -242,10 +246,14 @@
/**
* cothread_getcurrent:
*
+ * Get the current cothread id
+ *
* Returns: the current cothread id
*/
-int cothread_getcurrent(void) __attribute__ ((no_instrument_function));
-int cothread_getcurrent(void) {
+int cothread_getcurrent (void) __attribute__ ((no_instrument_function));
+int
+cothread_getcurrent (void)
+{
cothread_context *ctx = pthread_getspecific(_cothread_key);
if (!ctx) return -1;
return ctx->current;
Index: gst.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gst.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- gst.c 2001/10/17 10:21:24 1.44
+++ gst.c 2001/10/21 18:00:31 1.45
@@ -34,6 +34,7 @@
#include "gstthread.h"
#include "gstqueue.h"
#include "gstautoplug.h"
+#include "gstscheduler.h"
#ifndef GST_DISABLE_TYPEFIND
#include "gsttypefind.h"
#endif
@@ -117,6 +118,8 @@
gst_elementfactory_get_type ();
gst_element_get_type ();
gst_typefactory_get_type ();
+ gst_schedule_get_type ();
+ gst_bin_get_type ();
#ifndef GST_DISABLE_AUTOPLUG
gst_autoplugfactory_get_type ();
#endif
Index: gstautoplug.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstautoplug.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- gstautoplug.c 2001/10/17 10:21:24 1.24
+++ gstautoplug.c 2001/10/21 18:00:31 1.25
@@ -335,11 +335,11 @@
g_return_val_if_fail (factory != NULL, NULL);
- gst_plugin_feature_ensure_loaded (GST_PLUGIN_FEATURE (factory));
-
- g_return_val_if_fail (factory->type != 0, NULL);
+ if (gst_plugin_feature_ensure_loaded (GST_PLUGIN_FEATURE (factory))) {
+ g_return_val_if_fail (factory->type != 0, NULL);
- new = GST_AUTOPLUG (g_object_new(factory->type,NULL));
+ new = GST_AUTOPLUG (g_object_new(factory->type,NULL));
+ }
return new;
}
Index: gstbin.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstbin.c,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -d -r1.93 -r1.94
--- gstbin.c 2001/10/17 10:21:24 1.93
+++ gstbin.c 2001/10/21 18:00:31 1.94
@@ -36,6 +36,7 @@
"(C) 1999",
};
+GType _gst_bin_type = 0;
static void gst_bin_dispose (GObject *object);
@@ -74,9 +75,7 @@
GType
gst_bin_get_type (void)
{
- static GType bin_type = 0;
-
- if (!bin_type) {
+ if (!_gst_bin_type) {
static const GTypeInfo bin_info = {
sizeof(GstBinClass),
NULL,
@@ -89,9 +88,9 @@
(GInstanceInitFunc)gst_bin_init,
NULL
};
- bin_type = g_type_register_static (GST_TYPE_ELEMENT, "GstBin", &bin_info, 0);
+ _gst_bin_type = g_type_register_static (GST_TYPE_ELEMENT, "GstBin", &bin_info, 0);
}
- return bin_type;
+ return _gst_bin_type;
}
static void
Index: gstbin.h
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstbin.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- gstbin.h 2001/06/25 01:20:08 1.24
+++ gstbin.h 2001/10/21 18:00:31 1.25
@@ -32,17 +32,22 @@
#endif /* __cplusplus */
extern GstElementDetails gst_bin_details;
+extern GType _gst_bin_type;
-#define GST_TYPE_BIN \
- (gst_bin_get_type())
-#define GST_BIN(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_BIN,GstBin))
-#define GST_BIN_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_BIN,GstBinClass))
-#define GST_IS_BIN(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_BIN))
-#define GST_IS_BIN_CLASS(obj) \
- (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_BIN))
+#define GST_TYPE_BIN (_gst_bin_type)
+# define GST_IS_BIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_BIN))
+# define GST_IS_BIN_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_BIN))
+
+#define GST_BIN_FAST(obj) ((GstBin*)(obj))
+#define GST_BIN_CLASS_FAST(klass) ((GstBinClass*)(klass))
+
+#ifdef GST_TYPE_PARANOID
+# define GST_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_BIN, GstBin))
+# define GST_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_BIN, GstBinClass))
+#else
+# define GST_BIN GST_BIN_FAST
+# define GST_BIN_CLASS GST_BIN_CLASS_FAST
+#endif
typedef enum {
/* this bin is a manager of child elements, i.e. a pipeline or thread */
Index: gstbuffer.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstbuffer.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- gstbuffer.c 2001/10/17 10:21:24 1.39
+++ gstbuffer.c 2001/10/21 18:00:31 1.40
@@ -102,8 +102,10 @@
/**
* gst_buffer_new_from_pool:
* @pool: the buffer pool to use
+ * @offset: the offset of the new buffer
+ * @size: the size of the new buffer
*
- * Create a new buffer using the specified bufferpool.
+ * Create a new buffer using the specified bufferpool, offset and size.
*
* Returns: new buffer
*/
@@ -315,6 +317,30 @@
}
/**
+ * gst_buffer_ref_by_count:
+ * @buffer: the GstBuffer to reference
+ * @count: a number
+ *
+ * Increment the refcount of this buffer by the given number.
+ */
+void
+gst_buffer_ref_by_count (GstBuffer *buffer, gint count)
+{
+ g_return_if_fail (buffer != NULL);
+ g_return_if_fail (count > 0);
+
+#ifdef HAVE_ATOMIC_H
+ g_return_if_fail (atomic_read (&(buffer->refcount)) > 0);
+ atomic_add (count, &(buffer->refcount));
+#else
+ g_return_if_fail (buffer->refcount > 0);
+ GST_BUFFER_LOCK (buffer);
+ buffer->refcount += count;
+ GST_BUFFER_UNLOCK (buffer);
+#endif
+}
+
+/**
* gst_buffer_unref:
* @buffer: the GstBuffer to unref
*
@@ -388,8 +414,8 @@
return newbuf;
}
-/*
- * gst_buffer_is_span_fast
+/**
+ * gst_buffer_is_span_fast:
* @buf1: first source buffer
* @buf2: second source buffer
*
@@ -439,7 +465,7 @@
// make sure buf1 has a lower address than buf2
if (buf1->data > buf2->data) {
GstBuffer *tmp = buf1;
- g_print ("swapping buffers\n");
+ //g_print ("swapping buffers\n");
buf1 = buf2;
buf2 = tmp;
}
@@ -450,7 +476,7 @@
newbuf = gst_buffer_create_sub (buf1->parent, buf1->data - (buf1->parent->data) + offset, len);
}
else {
- g_print ("slow path taken in buffer_span\n");
+ //g_print ("slow path taken in buffer_span\n");
// otherwise we simply have to brute-force copy the buffers
newbuf = gst_buffer_new ();
Index: gstbuffer.h
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstbuffer.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- gstbuffer.h 2001/10/17 10:21:24 1.28
+++ gstbuffer.h 2001/10/21 18:00:31 1.29
@@ -36,7 +36,6 @@
//
#include <gst/gstdata.h>
-#include <gst/gstobject.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -137,8 +136,8 @@
gpointer pool_private;
/* utility function pointers */
- GstBufferFreeFunc free; // free the data associated with the buffer
- GstBufferCopyFunc copy; // copy the data from one buffer to another
+ GstBufferFreeFunc free; /* free the data associated with the buffer */
+ GstBufferCopyFunc copy; /* copy the data from one buffer to another */
};
/* initialisation */
@@ -152,6 +151,7 @@
/* refcounting */
void gst_buffer_ref (GstBuffer *buffer);
+void gst_buffer_ref_by_count (GstBuffer *buffer, gint count);
void gst_buffer_unref (GstBuffer *buffer);
/* destroying the buffer */
@@ -163,7 +163,7 @@
/* merge, span, or append two buffers, intelligently */
GstBuffer* gst_buffer_merge (GstBuffer *buf1, GstBuffer *buf2);
GstBuffer* gst_buffer_span (GstBuffer *buf1,guint32 offset,GstBuffer *buf2,guint32 len);
-GstBuffer* gst_buffer_append (GstBuffer *buf, GstBuffer *buf2);
+GstBuffer* gst_buffer_append (GstBuffer *buffer, GstBuffer *append);
gboolean gst_buffer_is_span_fast (GstBuffer *buf1, GstBuffer *buf2);
Index: gstbufferpool.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstbufferpool.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- gstbufferpool.c 2001/10/17 10:21:24 1.20
+++ gstbufferpool.c 2001/10/21 18:00:31 1.21
@@ -191,7 +191,7 @@
/**
* gst_buffer_pool_set_buffer_copy_function:
* @pool: the pool to set the buffer copy function for
- * @destroy: the copy function
+ * @copy: the copy function
*
* Sets the function that will be called when a buffer is copied.
*
@@ -207,7 +207,7 @@
}
/**
- * gst_buffer_pool_set_pool_destroy_hook:
+ * gst_buffer_pool_set_destroy_hook:
* @pool: the pool to set the destroy hook for
* @destroy: the destroy function
*
@@ -243,14 +243,13 @@
/**
* gst_buffer_pool_get_user_data:
* @pool: the pool to get the user data from
- * @user_data: any user data to be passed to the create/destroy buffer functions
- * and the destroy hook
*
* gets user data
+ *
+ * Returns: The user data of this bufferpool
*/
gpointer
-gst_buffer_pool_get_user_data (GstBufferPool *pool,
- gpointer user_data)
+gst_buffer_pool_get_user_data (GstBufferPool *pool)
{
g_return_val_if_fail (pool != NULL, NULL);
Index: gstbufferpool.h
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstbufferpool.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- gstbufferpool.h 2001/08/27 06:24:49 1.12
+++ gstbufferpool.h 2001/10/21 18:00:31 1.13
@@ -70,7 +70,7 @@
/* refcounting */
void gst_buffer_pool_ref (GstBufferPool *pool);
void gst_buffer_pool_ref_by_count (GstBufferPool *pool, int count);
-void gst_buffer_pool_unref (GstBufferPool *buffer);
+void gst_buffer_pool_unref (GstBufferPool *pool);
/* setting create and destroy functions */
void gst_buffer_pool_set_buffer_new_function (GstBufferPool *pool,
@@ -83,8 +83,7 @@
GstBufferPoolDestroyHook destroy);
void gst_buffer_pool_set_user_data (GstBufferPool *pool,
gpointer user_data);
-gpointer gst_buffer_pool_get_user_data (GstBufferPool *pool,
- gpointer user_data);
+gpointer gst_buffer_pool_get_user_data (GstBufferPool *pool);
/* destroying the buffer pool */
void gst_buffer_pool_destroy (GstBufferPool *pool);
Index: gstclock.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstclock.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- gstclock.c 2001/05/25 21:00:06 1.13
+++ gstclock.c 2001/10/21 18:00:31 1.14
@@ -57,6 +57,13 @@
return clock;
}
+/**
+ * gst_clock_get_system:
+ *
+ * Get the global system clock
+ *
+ * Returns: the global clock
+ */
GstClock*
gst_clock_get_system(void)
{
@@ -67,6 +74,14 @@
return the_system_clock;
}
+/**
+ * gst_clock_register:
+ * @clock: the name of the clock to register to
+ * @obj: the object registering to the clock
+ *
+ * State that an object is interested in listening to the
+ * given clock
+ */
void
gst_clock_register (GstClock *clock, GstObject *obj)
{
@@ -77,6 +92,13 @@
}
}
+/**
+ * gst_clock_set:
+ * @clock: The clock to set
+ * @time: the time to set
+ *
+ * Set the time of the given clock to time.
+ */
void
gst_clock_set (GstClock *clock, GstClockTime time)
{
@@ -92,6 +114,16 @@
time, now, clock->start_time);
}
+/**
+ * gst_clock_current_diff:
+ * @clock: the clock to calculate the diff against
+ * @time: the time
+ *
+ * Calculate the difference between the given clock and the
+ * given time
+ *
+ * Returns: the clock difference
+ */
GstClockTimeDiff
gst_clock_current_diff (GstClock *clock, GstClockTime time)
{
@@ -106,6 +138,13 @@
return GST_CLOCK_DIFF (time, now);
}
+/**
+ * gst_clock_reset:
+ * @clock: the clock to reset
+ *
+ * Reset the given clock. The of the clock will be adjusted back
+ * to 0.
+ */
void
gst_clock_reset (GstClock *clock)
{
@@ -120,6 +159,14 @@
g_mutex_unlock (clock->lock);
}
+/**
+ * gst_clock_wait:
+ * @clock: the clock to wait on
+ * @time: the time to wait for
+ * @obj: the object performing the wait
+ *
+ * Wait for a specific clock tick on the given clock.
+ */
void
gst_clock_wait (GstClock *clock, GstClockTime time, GstObject *obj)
{
Index: gstelement.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstelement.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- gstelement.c 2001/10/17 10:21:24 1.78
+++ gstelement.c 2001/10/21 18:00:31 1.79
@@ -794,12 +794,20 @@
}
+/**
+ * gst_element_get_state:
+ * @element: element to get state of
+ *
+ * Gets the state of the element.
+ *
+ * Returns: The element state
+ */
GstElementState
-gst_element_get_state (GstElement *elem)
+gst_element_get_state (GstElement *element)
{
- g_return_val_if_fail (GST_IS_ELEMENT (elem), GST_STATE_VOID_PENDING);
+ g_return_val_if_fail (GST_IS_ELEMENT (element), GST_STATE_VOID_PENDING);
- return GST_STATE (elem);
+ return GST_STATE (element);
}
/**
@@ -969,23 +977,6 @@
G_OBJECT_CLASS (parent_class)->dispose (object);
}
-/*
-static gchar *_gst_element_type_names[] = {
- "invalid",
- "none",
- "char",
- "uchar",
- "bool",
- "int",
- "uint",
- "long",
- "ulong",
- "float",
- "double",
- "string",
-};
-*/
-
#ifndef GST_DISABLE_LOADSAVE
/**
* gst_element_save_thyself:
@@ -1260,7 +1251,17 @@
}
-const gchar *gst_element_statename(GstElementState state) {
+/**
+ * gst_element_statename:
+ * @state: The state to get the name of
+ *
+ * Gets a string representing the given state.
+ *
+ * Returns: a string with the statename.
+ */
+const gchar*
+gst_element_statename (GstElementState state)
+{
switch (state) {
#ifdef GST_DEBUG_COLOR
case GST_STATE_VOID_PENDING: return "NONE_PENDING";break;
Index: gstelement.h
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstelement.h,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -d -r1.62 -r1.63
--- gstelement.h 2001/10/17 10:21:24 1.62
+++ gstelement.h 2001/10/21 18:00:31 1.63
@@ -177,7 +177,7 @@
GstPad* (*request_new_pad) (GstElement *element, GstPadTemplate *templ, const gchar* name);
};
-void gst_element_class_add_padtemplate (GstElementClass *element, GstPadTemplate *templ);
+void gst_element_class_add_padtemplate (GstElementClass *klass, GstPadTemplate *templ);
GType gst_element_get_type (void);
#define gst_element_destroy(element) gst_object_destroy (GST_OBJECT (element))
@@ -214,7 +214,7 @@
void gst_element_signal_eos (GstElement *element);
-GstElementState gst_element_get_state (GstElement *elem);
+GstElementState gst_element_get_state (GstElement *element);
/* called by the app to set the state of the element */
gint gst_element_set_state (GstElement *element, GstElementState state);
const gchar * gst_element_statename (GstElementState state);
Index: gstelementfactory.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstelementfactory.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- gstelementfactory.c 2001/10/17 10:21:24 1.50
+++ gstelementfactory.c 2001/10/21 18:00:31 1.51
@@ -229,17 +229,17 @@
GST_DEBUG (GST_CAT_ELEMENTFACTORY,"creating element from factory \"%s\" with name \"%s\" and type %d\n",
GST_OBJECT_NAME (factory), name, factory->type);
- gst_plugin_feature_ensure_loaded (GST_PLUGIN_FEATURE (factory));
+ if (!gst_plugin_feature_ensure_loaded (GST_PLUGIN_FEATURE (factory)))
+ return NULL;
- if (factory->type == 0)
- {
+ if (factory->type == 0) {
/* FIXME: g_critical is glib-2.0, not glib-1.2
g_critical ("Factory for `%s' has no type",
*/
g_warning ("Factory for `%s' has no type",
gst_object_get_name (GST_OBJECT (factory)));
return NULL;
- }
+ }
// create an instance of the element
element = GST_ELEMENT(g_object_new(factory->type,NULL));
Index: gstevent.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstevent.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- gstevent.c 2001/10/17 10:21:24 1.2
+++ gstevent.c 2001/10/21 18:00:31 1.3
@@ -50,13 +50,20 @@
_gst_event_chunk = g_mem_chunk_new ("GstEvent", eventsize,
eventsize * 32, G_ALLOC_AND_FREE);
-
_gst_event_chunk_lock = g_mutex_new ();
// register the type
_gst_event_type = g_type_register_static (G_TYPE_INT, "GstEvent", &event_info, 0);
}
+/**
+ * gst_event_new:
+ * @type: The type of the new event
+ *
+ * Allocate a new event of the given type.
+ *
+ * Returns: A new event.
+ */
GstEvent*
gst_event_new (GstEventType type)
{
@@ -73,6 +80,12 @@
return event;
}
+/**
+ * gst_event_free:
+ * @event: The event to free
+ *
+ * Free the given element.
+ */
void
gst_event_free (GstEvent* event)
{
@@ -81,7 +94,16 @@
g_mutex_unlock (_gst_event_chunk_lock);
}
-/* seek stuff */
+/**
+ * gst_event_new_seek:
+ * @type: The type of the seek event
+ * @offset: The offset of the seek
+ * @flush: A boolean indicating a flush has to be performed as well
+ *
+ * Allocate a new seek event with the given parameters.
+ *
+ * Returns: A new seek event.
+ */
GstEvent*
gst_event_new_seek (GstSeekType type, guint64 offset, gboolean flush)
{
Index: gstinfo.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstinfo.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- gstinfo.c 2001/10/21 02:06:12 1.27
+++ gstinfo.c 2001/10/21 18:00:31 1.28
@@ -66,6 +66,8 @@
* gst_get_category_name:
* @category: the category to return the name of
*
+ * Return a string containing the name of the category
+ *
* Returns: string containing the name of the category
*/
const gchar *
@@ -214,6 +216,8 @@
/**
* gst_debug_get_categories:
*
+ * Return the current bitmask of enabled DEBUG categories
+ *
* Returns: the current bitmask of enabled DEBUG categories
* The bit for any given category is (1 << GST_CAT_...).
*/
@@ -339,6 +343,9 @@
/**
* gst_info_get_categories:
*
+ * Return the current bitmask of enabled INFO categories
+ * The bit for any given category is (1 << GST_CAT_...).
+ *
* Returns: the current bitmask of enabled INFO categories
* The bit for any given category is (1 << GST_CAT_...).
*/
@@ -528,6 +535,7 @@
void
gst_debug_print_stack_trace (void)
{
+ //nothing because it's compiled out
}
#endif /* GST_ENABLE_FUNC_INTSTRUMENTATION */
Index: gstobject.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstobject.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- gstobject.c 2001/10/17 10:21:24 1.27
+++ gstobject.c 2001/10/21 18:00:31 1.28
@@ -186,6 +186,12 @@
}
}
+/**
+ * gst_object_destroy:
+ * @object: GstObject to destroy
+ *
+ * Destroy the object.
+ */
void
gst_object_destroy (GstObject *object)
{
@@ -475,13 +481,11 @@
}
/**
- * gst_object_load_thyself:
+ * gst_object_restore_thyself:
* @object: GstObject to load into
- * @parent: The parent XML node to save the object into
- *
- * Saves the given object into the parent XML node.
+ * @parent: The parent XML node to load the object from
*
- * Returns: the new xmlNodePtr with the saved object
+ * Restores the given object with the data from the parent XML node.
*/
void
gst_object_restore_thyself (GstObject *object, xmlNodePtr parent)
Index: gstpad.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstpad.c,v
retrieving revision 1.117
retrieving revision 1.118
diff -u -d -r1.117 -r1.118
--- gstpad.c 2001/10/17 10:21:24 1.117
+++ gstpad.c 2001/10/21 18:00:31 1.118
@@ -1970,32 +1970,20 @@
gst_element_signal_eos(GST_PAD_PARENT(pad));
else
GST_DEBUG(GST_CAT_EVENT, "WARNING: no default behavior for EOS with multiple sinkpads\n");
+ default:
break;
}
}
-
-gboolean
-gst_pad_event (GstPad *pad, GstEventType event, gint64 timestamp, guint32 data)
-{
- GstRealPad *peer;
- gboolean handled = FALSE;
-
- GST_DEBUG(GST_CAT_EVENT, "have event %d on pad %s:%s\n",(gint)event,GST_DEBUG_PAD_NAME(pad));
-
- peer = GST_RPAD_PEER(pad);
- if (GST_RPAD_EVENTFUNC(peer)) {
- //handled = GST_RPAD_EVENTFUNC(peer) (peer, event, timestamp, data);
- }
- else {
- GST_DEBUG(GST_CAT_EVENT, "there's no event function for peer %s:%s\n",GST_DEBUG_PAD_NAME(peer));
- }
-
- if (!handled) {
- GST_DEBUG(GST_CAT_EVENT, "would proceed with default behavior here\n");
- //gst_pad_event_default(peer,event, timestamp, data);
- }
-}
+/**
+ * gst_pad_send_event:
+ * @pad: the pad to send the event to
+ * @event: the event to send to the pad.
+ *
+ * Send the event to the pad.
+ *
+ * Returns: TRUe if the event was handled.
+ */
gboolean
gst_pad_send_event (GstPad *pad, GstEvent *event)
{
Index: gstpad.h
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstpad.h,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -d -r1.65 -r1.66
--- gstpad.h 2001/10/17 10:21:24 1.65
+++ gstpad.h 2001/10/21 18:00:31 1.66
@@ -403,16 +403,6 @@
NULL )
#endif
-#if 1
-gboolean gst_pad_event (GstPad *pad, GstEventType event, gint64 timestamp, guint32 data);
-#else
-#define gst_pad_event(pad,event,timestamp,data) G_STMT_START{ \
- ( (((GstRealPad *)(pad))->peer->eventhandler) ? \
- (((GstRealPad *)(pad))->peer->eventhandler)((GstPad *)(((GstRealPad *)(pad))->peer),(event),(timestamp),(data)) : \
-FALSE )
-}G_STMT_END
-#endif
-
gboolean gst_pad_send_event (GstPad *pad, GstEvent *event);
GstBuffer* gst_pad_peek (GstPad *pad);
Index: gstpipeline.h
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstpipeline.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- gstpipeline.h 2001/10/20 23:15:29 1.12
+++ gstpipeline.h 2001/10/21 18:00:31 1.13
@@ -60,8 +60,6 @@
GstElement* gst_pipeline_new (const gchar *name);
#define gst_pipeline_destroy(pipeline) gst_object_destroy(GST_OBJECT(pipeline))
-void gst_pipeline_iterate (GstPipeline *pipeline);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
Index: gstplugin.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstplugin.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- gstplugin.c 2001/10/17 10:21:24 1.66
+++ gstplugin.c 2001/10/21 18:00:31 1.67
@@ -274,6 +274,11 @@
GST_INFO (GST_CAT_PLUGIN_LOADING,"loaded %d plugins", _gst_plugins_seqno);
}
+/**
+ * gst_plugin_unload_all:
+ *
+ * Unload all plugins in memory.
+ */
void
gst_plugin_unload_all (void)
{
@@ -391,11 +396,11 @@
}
/**
- * gst_plugin_load:
+ * gst_plugin_load_absolute:
* @name: name of plugin to load
*
* Load the named plugin. Name should be given as
- * "libplugin.so".
+ * "/path/to/plugin/libplugin.so".
*
* Returns: whether the plugin was loaded or not
*/
@@ -464,8 +469,10 @@
}
/**
- * gst_plugin_load_absolute:
- * @name: name of plugin to load
+ * gst_plugin_load_plugin:
+ * @plugin: The plugin to load
+ *
+ * Load the given plugin.
*
* Returns: whether or not the plugin loaded
*/
Index: gstplugin.h
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstplugin.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- gstplugin.h 2001/10/17 10:21:24 1.21
+++ gstplugin.h 2001/10/21 18:00:31 1.22
@@ -85,8 +85,6 @@
void _gst_plugin_initialize (void);
void _gst_plugin_register_static (GstPluginDesc *desc);
-GstPlugin* gst_plugin_new (const gchar *name, gint major, gint minor);
-
void gst_plugin_add_path (const gchar *path);
const gchar* gst_plugin_get_name (GstPlugin *plugin);
Index: gstpluginfeature.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstpluginfeature.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- gstpluginfeature.c 2001/09/14 22:16:47 1.3
+++ gstpluginfeature.c 2001/10/21 18:00:31 1.4
@@ -110,7 +110,16 @@
}
#endif /* GST_DISABLE_REGISTRY */
-void
+/**
+ * gst_plugin_feature_ensure_loaded:
+ * @feature: the plugin feature to check
+ *
+ * Check if the plugin containing the feature is loaded,
+ * if not, the plugin will be loaded.
+ *
+ * Returns: a boolean indicating the feature is loaded.
+ */
+gboolean
gst_plugin_feature_ensure_loaded (GstPluginFeature *feature)
{
GstPlugin *plugin = (GstPlugin *) (feature->manager);
@@ -118,10 +127,18 @@
if (plugin && !gst_plugin_is_loaded (plugin)) {
GST_DEBUG (GST_CAT_PLUGIN_LOADING, "loading plugin %s for feature\n", plugin->name);
- gst_plugin_load_plugin (plugin);
+ return gst_plugin_load_plugin (plugin);
}
+ return TRUE;
}
+/**
+ * gst_plugin_feature_unload_thyself:
+ * @feature: the plugin feature to check
+ *
+ * Unload the given feature. This will decrease the refcount
+ * in the plugin and will eventually unload the plugin
+ */
void
gst_plugin_feature_unload_thyself (GstPluginFeature *feature)
{
Index: gstpluginfeature.h
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstpluginfeature.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- gstpluginfeature.h 2001/08/21 20:16:45 1.1
+++ gstpluginfeature.h 2001/10/21 18:00:31 1.2
@@ -60,7 +60,7 @@
/* normal GObject stuff */
GType gst_plugin_feature_get_type (void);
-void gst_plugin_feature_ensure_loaded (GstPluginFeature *feature);
+gboolean gst_plugin_feature_ensure_loaded (GstPluginFeature *feature);
void gst_plugin_feature_unload_thyself (GstPluginFeature *feature);
#ifdef __cplusplus
Index: gstscheduler.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstscheduler.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- gstscheduler.c 2001/10/17 10:21:24 1.33
+++ gstscheduler.c 2001/10/21 18:00:31 1.34
@@ -25,6 +25,7 @@
#include "gstscheduler.h"
+GType _gst_schedule_type = 0;
static int
gst_schedule_loopfunc_wrapper (int argc,char *argv[])
@@ -827,11 +828,11 @@
static void gst_schedule_init (GstSchedule *schedule);
static GstObjectClass *parent_class = NULL;
-
-GType gst_schedule_get_type(void) {
- static GType schedule_type = 0;
- if (!schedule_type) {
+GType
+gst_schedule_get_type (void)
+{
+ if (!_gst_schedule_type) {
static const GTypeInfo schedule_info = {
sizeof(GstScheduleClass),
NULL,
@@ -844,9 +845,9 @@
(GInstanceInitFunc)gst_schedule_init,
NULL
};
- schedule_type = g_type_register_static(GST_TYPE_OBJECT, "GstSchedule", &schedule_info, 0);
+ _gst_schedule_type = g_type_register_static(GST_TYPE_OBJECT, "GstSchedule", &schedule_info, 0);
}
- return schedule_type;
+ return _gst_schedule_type;
}
static void
@@ -870,6 +871,14 @@
schedule->iterate = GST_DEBUG_FUNCPTR(gst_schedule_iterate);
}
+/**
+ * gst_schedule_new:
+ * @parent: the parent of the new scheduler
+ *
+ * Create a new scheduler for the given parent.
+ *
+ * Returns: the new scheduler.
+ */
GstSchedule*
gst_schedule_new(GstElement *parent)
{
@@ -1083,6 +1092,14 @@
}
}
+/**
+ * gst_schedule_pad_connect:
+ * @sched: the scheduler
+ * @srcpad: the srcpad to connect
+ * @sinkpad: the sinkpad to connect to
+ *
+ * Connect the srcpad to the given sinkpad.
+ */
void
gst_schedule_pad_connect (GstSchedule *sched, GstPad *srcpad, GstPad *sinkpad)
{
@@ -1159,6 +1176,14 @@
}
}
+/**
+ * gst_schedule_pad_disconnect:
+ * @sched: the scheduler
+ * @srcpad: the srcpad to disconnect
+ * @sinkpad: the sinkpad to disconnect from
+ *
+ * Disconnect the srcpad to the given sinkpad.
+ */
void
gst_schedule_pad_disconnect (GstSchedule *sched, GstPad *srcpad, GstPad *sinkpad)
{
@@ -1195,6 +1220,15 @@
}
}
+/**
+ * gst_schedule_pad_select:
+ * @sched: the scheduler
+ * @padlist: the padlist to select on
+ *
+ * register the given padlist for a select operation.
+ *
+ * Returns: the pad which received a buffer.
+ */
GstPad*
gst_schedule_pad_select (GstSchedule *sched, GList *padlist)
{
@@ -1235,6 +1269,13 @@
return pad;
}
+/**
+ * gst_schedule_add_element:
+ * @sched: the scheduler
+ * @element: the element to add to the scheduler
+ *
+ * Add an element to the scheduler.
+ */
void
gst_schedule_add_element (GstSchedule *sched, GstElement *element)
{
@@ -1296,6 +1337,13 @@
}
}
+/**
+ * gst_schedule_enable_element:
+ * @sched: the scheduler
+ * @element: the element to enable
+ *
+ * Enable an element for scheduling.
+ */
void
gst_schedule_enable_element (GstSchedule *sched, GstElement *element)
{
@@ -1310,6 +1358,13 @@
GST_INFO (GST_CAT_SCHEDULING, "element not found in any chain, not enabling");
}
+/**
+ * gst_schedule_disable_element:
+ * @sched: the scheduler
+ * @element: the element to disable
+ *
+ * Disable an element for scheduling.
+ */
void
gst_schedule_disable_element (GstSchedule *sched, GstElement *element)
{
@@ -1324,6 +1379,13 @@
}
}
+/**
+ * gst_schedule_remove_element:
+ * @sched: the scheduler
+ * @element: the element to remove
+ *
+ * Remove an element from the scheduler.
+ */
void
gst_schedule_remove_element (GstSchedule *sched, GstElement *element)
{
@@ -1351,6 +1413,14 @@
}
}
+/**
+ * gst_schedule_iterate:
+ * @sched: the scheduler
+ *
+ * Perform one iteration on the scheduler.
+ *
+ * Returns: a boolean indicating something usefull has happened.
+ */
gboolean
gst_schedule_iterate (GstSchedule *sched)
{
@@ -1485,8 +1555,13 @@
return !eos;
}
-
+/**
+ * gst_schedule_show:
+ * @sched: the scheduler
+ *
+ * Dump the state of the scheduler
+ */
void
gst_schedule_show (GstSchedule *sched)
{
Index: gstscheduler.h
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstscheduler.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- gstscheduler.h 2001/07/16 20:18:17 1.8
+++ gstscheduler.h 2001/10/21 18:00:31 1.9
@@ -33,16 +33,22 @@
#endif /* __cplusplus */
-#define GST_TYPE_SCHEDULE \
- (gst_schedule_get_type())
-#define GST_SCHEDULE(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SCHEDULE,GstSchedule))
-#define GST_SCHEDULE_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SCHEDULE,GstScheduleClass))
-#define GST_IS_SCHEDULE(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SCHEDULE))
-#define GST_IS_SCHEDULE_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SCHEDULE))
+extern GType _gst_schedule_type;
+
+#define GST_TYPE_SCHEDULE (_gst_schedule_type)
+# define GST_IS_SCHEDULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_SCHEDULE))
+# define GST_IS_SCHEDULE_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_SCHEDULE))
+
+#define GST_SCHEDULE_FAST(obj) ((GstSchedule*)(obj))
+#define GST_SCHEDULE_CLASS_FAST(klass) ((GstScheduleClass*)(klass))
+
+#ifdef GST_TYPE_PARANOID
+# define GST_SCHEDULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_SCHEDULE, GstSchedule))
+# define GST_SCHEDULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_SCHEDULE, GstScheduleClass))
+#else
+# define GST_SCHEDULE GST_SCHEDULE_FAST
+# define GST_SCHEDULE_CLASS GST_SCHEDULE_CLASS_FAST
+#endif
#define GST_SCHED_PARENT(sched) ((sched)->parent)
Index: gsttimecache.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gsttimecache.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- gsttimecache.c 2001/08/13 20:19:34 1.1
+++ gsttimecache.c 2001/10/21 18:00:31 1.2
@@ -85,6 +85,13 @@
GST_DEBUG(0, "created new timecache\n");
}
+/**
+ * gst_timecache_new:
+ *
+ * Create a new tilecache object
+ *
+ * Returns: a new timecache object
+ */
GstTimeCache *
gst_timecache_new()
{
@@ -95,12 +102,29 @@
return tc;
}
+/**
+ * gst_timecache_get_group:
+ * @tc: the timecache to get the current group from
+ *
+ * Get the id of the current group.
+ *
+ * Returns: the id of the current group.
+ */
gint
gst_timecache_get_group(GstTimeCache *tc)
{
return tc->curgroup->groupnum;
}
+/**
+ * gst_timecache_new_group:
+ * @tc: the timecache to create the new group in
+ *
+ * Create a new group for the given timecache. It will be
+ * set as the current group.
+ *
+ * Returns: the id of the newly created group.
+ */
gint
gst_timecache_new_group(GstTimeCache *tc)
{
@@ -110,6 +134,16 @@
return tc->maxgroup;
}
+/**
+ * gst_timecache_set_group:
+ * @tc: the timecache to set the new group in
+ * @groupnum: the groupnumber to set
+ *
+ * Set the current groupnumber to the given argument.
+ *
+ * Returns: TRUE if the operation succeeded, FALSE if the group
+ * did not exist.
+ */
gboolean
gst_timecache_set_group(GstTimeCache *tc, gint groupnum)
{
@@ -137,18 +171,42 @@
return FALSE;
}
+/**
+ * gst_timecache_set_certainty:
+ * @tc: the timecache to set the certainty on
+ * @certainty: the certainty to set
+ *
+ * Set the certainty of the given timecache.
+ */
void
gst_timecache_set_certainty(GstTimeCache *tc, GstTimeCacheCertainty certainty)
{
tc->curgroup->certainty = certainty;
}
+/**
+ * gst_timecache_get_certainty:
+ * @tc: the timecache to get the certainty of
+ *
+ * Get the certainty of the given timecache.
+ *
+ * Returns: the certainty of the timecache.
+ */
GstTimeCacheCertainty
gst_timecache_get_certainty(GstTimeCache *tc)
{
return tc->curgroup->certainty;
}
+/**
+ * gst_timecache_add_entry:
+ * @tc: the timecache to add the entry to
+ * @location: the location
+ * @timestamp: the timestamp
+ *
+ * Associate the given timestamp with the given location in the
+ * timecache.
+ */
void
gst_timecache_add_entry (GstTimeCache *tc, guint64 location, gint64 timestamp)
{
@@ -169,12 +227,25 @@
GST_DEBUG(0, "added entry to timecache group %d\n",tc->curgroup->groupnum);
}
-gint _gst_timecache_find_location (const GstTimeCacheEntry *entry, const guint64 *location) {
+static gint
+_gst_timecache_find_location (const GstTimeCacheEntry *entry, const guint64 *location)
+{
if (*location < entry->location) return -1;
else if (*location > entry->location) return 1;
else return 0;
}
+/**
+ * gst_timecache_find_location:
+ * @tc: the timecache to find the timestamp in
+ * @location: the location
+ * @timestamp: the timestamp
+ *
+ * Look up the associated timestamp for the given location in the
+ * timecache.
+ *
+ * Returns: TRUE if the location was found in the timecache.
+ */
gboolean
gst_timecache_find_location (GstTimeCache *tc, guint64 location, gint64 *timestamp)
{
@@ -196,12 +267,25 @@
return FALSE;
}
-gint _gst_timecache_find_timestamp (const GstTimeCacheEntry *entry, const gint64 *timestamp) {
+static gint
+_gst_timecache_find_timestamp (const GstTimeCacheEntry *entry, const gint64 *timestamp)
+{
if (*timestamp < entry->timestamp) return -1;
else if (*timestamp > entry->timestamp) return 1;
else return 0;
}
+/**
+ * gst_timecache_find_timestamp:
+ * @tc: the timecache to find the location in
+ * @location: the location
+ * @timestamp: the timestamp
+ *
+ * Look up the associated location for the given timestamp in the
+ * timecache.
+ *
+ * Returns: TRUE if the timestamp was found in the timecache.
+ */
gboolean
gst_timecache_find_timestamp (GstTimeCache *tc, gint64 timestamp, guint64 *location)
{
Index: gsttimecache.h
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gsttimecache.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- gsttimecache.h 2001/08/13 20:19:34 1.1
+++ gsttimecache.h 2001/10/21 18:00:31 1.2
@@ -56,19 +56,19 @@
};
struct _GstTimeCacheGroup {
- // unique ID of group in cache
+ /* unique ID of group in cache */
gint groupnum;
- // list of entries
+ /* list of entries */
GList *entries;
- // the certainty level of the group
+ /* the certainty level of the group */
GstTimeCacheCertainty certainty;
- // peer group that contains more certain entries
+ /* peer group that contains more certain entries */
gint peergroup;
- // range variables
+ /* range variables */
gint64 mintimestamp,maxtimestamp;
guint64 minlocation,maxlocation;
};
Index: gsttype.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gsttype.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- gsttype.c 2001/09/14 22:16:47 1.31
+++ gsttype.c 2001/10/21 18:00:31 1.32
@@ -109,6 +109,14 @@
_gst_typefactories = g_list_prepend (_gst_typefactories, factory);
}
+/**
+ * gst_typefactory_new:
+ * @definition: the definition to use
+ *
+ * Creata a new typefactory from the given definition.
+ *
+ * Returns: the new typefactory
+ */
GstTypeFactory*
gst_typefactory_new (GstTypeDefinition *definition)
{
@@ -325,13 +333,13 @@
GstTypeFactory *factory = (GstTypeFactory *)priv;
GST_DEBUG (GST_CAT_TYPES,"gsttype: need to load typefind function for %s\n", factory->mime);
-
- gst_plugin_feature_ensure_loaded (GST_PLUGIN_FEATURE (factory));
- if (factory->typefindfunc) {
- GstCaps *res = factory->typefindfunc (buffer, factory);
- if (res)
- return res;
+ if (gst_plugin_feature_ensure_loaded (GST_PLUGIN_FEATURE (factory))) {
+ if (factory->typefindfunc) {
+ GstCaps *res = factory->typefindfunc (buffer, factory);
+ if (res)
+ return res;
+ }
}
return NULL;
Index: gstutils.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstutils.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- gstutils.c 2001/10/20 23:06:49 1.19
+++ gstutils.c 2001/10/21 18:00:31 1.20
@@ -40,15 +40,15 @@
* Returns: the property of the object
*/
gint
-gst_util_get_int_arg (GObject *object, const gchar *argname)
+gst_util_get_int_arg (GObject * object, const gchar * argname)
{
GValue value;
ZERO (value);
g_value_init (&value, G_TYPE_INT);
- g_object_get_property(G_OBJECT(object),argname,&value);
+ g_object_get_property (G_OBJECT (object), argname, &value);
- return g_value_get_int(&value);
+ return g_value_get_int (&value);
}
/**
@@ -61,15 +61,15 @@
* Returns: the property of the object
*/
gint
-gst_util_get_bool_arg (GObject *object, const gchar *argname)
+gst_util_get_bool_arg (GObject * object, const gchar * argname)
{
GValue value;
ZERO (value);
g_value_init (&value, G_TYPE_BOOLEAN);
- g_object_get_property(G_OBJECT(object),argname,&value);
+ g_object_get_property (G_OBJECT (object), argname, &value);
- return g_value_get_boolean(&value);
+ return g_value_get_boolean (&value);
}
/**
@@ -82,15 +82,15 @@
* Returns: the property of the object
*/
glong
-gst_util_get_long_arg (GObject *object, const gchar *argname)
+gst_util_get_long_arg (GObject * object, const gchar * argname)
{
GValue value;
ZERO (value);
g_value_init (&value, G_TYPE_LONG);
- g_object_get_property(G_OBJECT(object),argname,&value);
+ g_object_get_property (G_OBJECT (object), argname, &value);
- return g_value_get_long(&value);
+ return g_value_get_long (&value);
}
/**
@@ -103,15 +103,15 @@
* Returns: the property of the object
*/
gfloat
-gst_util_get_float_arg (GObject *object, const gchar *argname)
+gst_util_get_float_arg (GObject * object, const gchar * argname)
{
GValue value;
ZERO (value);
g_value_init (&value, G_TYPE_FLOAT);
- g_object_get_property(G_OBJECT(object),argname,&value);
+ g_object_get_property (G_OBJECT (object), argname, &value);
- return g_value_get_float(&value);
+ return g_value_get_float (&value);
}
/**
@@ -123,16 +123,16 @@
*
* Returns: the property of the object
*/
-gdouble
-gst_util_get_double_arg (GObject *object, const gchar *argname)
+gdouble
+gst_util_get_double_arg (GObject * object, const gchar * argname)
{
GValue value;
ZERO (value);
g_value_init (&value, G_TYPE_DOUBLE);
- g_object_get_property(G_OBJECT(object),argname,&value);
+ g_object_get_property (G_OBJECT (object), argname, &value);
- return g_value_get_double(&value);
+ return g_value_get_double (&value);
}
/**
@@ -144,16 +144,16 @@
*
* Returns: the property of the object
*/
- const gchar*
-gst_util_get_string_arg (GObject *object, const gchar *argname)
+const gchar *
+gst_util_get_string_arg (GObject * object, const gchar * argname)
{
GValue value;
ZERO (value);
g_value_init (&value, G_TYPE_STRING);
- g_object_get_property(G_OBJECT(object),argname,&value);
+ g_object_get_property (G_OBJECT (object), argname, &value);
- return g_value_get_string(&value); // memleak?
+ return g_value_get_string (&value); // memleak?
}
/**
@@ -166,15 +166,15 @@
* Returns: the property of the object
*/
gpointer
-gst_util_get_pointer_arg (GObject *object, const gchar *argname)
+gst_util_get_pointer_arg (GObject * object, const gchar * argname)
{
GValue value;
ZERO (value);
g_value_init (&value, G_TYPE_POINTER);
- g_object_get_property(G_OBJECT(object),argname,&value);
+ g_object_get_property (G_OBJECT (object), argname, &value);
- return g_value_get_pointer(&value);
+ return g_value_get_pointer (&value);
}
/**
@@ -206,24 +206,24 @@
*
* Dumps the memory block into a hex representation. Useful for debugging.
*/
-void
-gst_util_dump_mem (guchar *mem, guint size)
+void
+gst_util_dump_mem (guchar * mem, guint size)
{
guint i, j;
- i = j =0;
- while (i<size) {
+ i = j = 0;
+ while (i < size) {
if (j == 0) {
- g_print("\n%08x : ", i);
+ g_print ("\n%08x : ", i);
j = 15;
}
else {
j--;
}
- g_print("%02x ", mem[i]);
+ g_print ("%02x ", mem[i]);
i++;
}
- g_print("\n");
+ g_print ("\n");
}
/**
@@ -236,88 +236,99 @@
* sets the argument with it.
*/
void
-gst_util_set_object_arg (GObject *object, const gchar *name, const gchar *value)
+gst_util_set_object_arg (GObject * object, const gchar * name, const gchar * value)
{
if (name && value) {
GParamSpec *paramspec;
- paramspec = g_object_class_find_property(G_OBJECT_GET_CLASS(object),name);
+ paramspec = g_object_class_find_property (G_OBJECT_GET_CLASS (object), name);
if (!paramspec) {
return;
}
- GST_DEBUG(0,"paramspec->flags is %d, paramspec->value_type is %d\n",
- paramspec->flags,paramspec->value_type);
+ GST_DEBUG (0, "paramspec->flags is %d, paramspec->value_type is %d\n",
+ paramspec->flags, paramspec->value_type);
if (paramspec->flags & G_PARAM_WRITABLE) {
switch (paramspec->value_type) {
- case G_TYPE_STRING:
- g_object_set (G_OBJECT (object), name, value, NULL);
- break;
- case G_TYPE_ENUM:
- case G_TYPE_INT: {
- gint i;
- sscanf (value, "%d", &i);
- g_object_set (G_OBJECT (object), name, i, NULL);
+ case G_TYPE_STRING:
+ g_object_set (G_OBJECT (object), name, value, NULL);
break;
+ case G_TYPE_ENUM:
+ case G_TYPE_INT:{
+ gint i;
+
+ sscanf (value, "%d", &i);
+ g_object_set (G_OBJECT (object), name, i, NULL);
+ break;
}
- case G_TYPE_UINT: {
- guint i;
- sscanf (value, "%u", &i);
- g_object_set (G_OBJECT (object), name, i, NULL);
+ case G_TYPE_UINT:{
+ guint i;
+
+ sscanf (value, "%u", &i);
+ g_object_set (G_OBJECT (object), name, i, NULL);
break;
}
- case G_TYPE_LONG: {
+ case G_TYPE_LONG:{
glong i;
+
sscanf (value, "%ld", &i);
- g_object_set (G_OBJECT (object), name, i, NULL);
+ g_object_set (G_OBJECT (object), name, i, NULL);
break;
}
- case G_TYPE_ULONG: {
+ case G_TYPE_ULONG:{
gulong i;
+
sscanf (value, "%lu", &i);
- g_object_set (G_OBJECT (object), name, i, NULL);
+ g_object_set (G_OBJECT (object), name, i, NULL);
break;
}
- case G_TYPE_BOOLEAN: {
+ case G_TYPE_BOOLEAN:{
gboolean i = FALSE;
- if (!strncmp ("true", value, 4)) i = TRUE;
- g_object_set (G_OBJECT (object), name, i, NULL);
+
+ if (!strncmp ("true", value, 4))
+ i = TRUE;
+ g_object_set (G_OBJECT (object), name, i, NULL);
break;
}
- case G_TYPE_CHAR: {
+ case G_TYPE_CHAR:{
gchar i;
+
sscanf (value, "%c", &i);
- g_object_set (G_OBJECT (object), name, i, NULL);
+ g_object_set (G_OBJECT (object), name, i, NULL);
break;
}
- case G_TYPE_UCHAR: {
+ case G_TYPE_UCHAR:{
guchar i;
+
sscanf (value, "%c", &i);
- g_object_set (G_OBJECT (object), name, i, NULL);
+ g_object_set (G_OBJECT (object), name, i, NULL);
break;
}
- case G_TYPE_FLOAT: {
+ case G_TYPE_FLOAT:{
gfloat i;
+
sscanf (value, "%f", &i);
- g_object_set (G_OBJECT (object), name, i, NULL);
+ g_object_set (G_OBJECT (object), name, i, NULL);
break;
}
- case G_TYPE_DOUBLE: {
+ case G_TYPE_DOUBLE:{
gfloat i;
+
sscanf (value, "%g", &i);
- g_object_set (G_OBJECT (object), name, (gdouble)i, NULL);
+ g_object_set (G_OBJECT (object), name, (gdouble) i, NULL);
break;
}
- default:
- if (G_IS_PARAM_SPEC_ENUM(paramspec)) {
- gint i;
- sscanf (value, "%d", &i);
- g_object_set (G_OBJECT (object), name, i, NULL);
+ default:
+ if (G_IS_PARAM_SPEC_ENUM (paramspec)) {
+ gint i;
+
+ sscanf (value, "%d", &i);
+ g_object_set (G_OBJECT (object), name, i, NULL);
}
else if (paramspec->value_type == GST_TYPE_FILENAME) {
- g_object_set (G_OBJECT (object), name, value, NULL);
+ g_object_set (G_OBJECT (object), name, value, NULL);
}
break;
}
@@ -336,140 +347,150 @@
#include "gstprops.h"
#include "gstpropsprivate.h"
-static void string_append_indent (GString *str, gint count)
+static void
+string_append_indent (GString * str, gint count)
{
gint xx;
- for (xx=0; xx < count; xx++)
+
+ for (xx = 0; xx < count; xx++)
g_string_append_c (str, ' ');
}
-static void
-gst_print_props (GString *buf, gint indent,
- GList *props, gboolean showname)
+static void
+gst_print_props (GString * buf, gint indent, GList * props, gboolean showname)
{
GList *elem;
guint width = 0;
-
+
if (showname)
- for (elem = props; elem; elem = g_list_next (elem))
- {
- GstPropsEntry *prop = elem->data;
- const gchar *name = g_quark_to_string (prop->propid);
+ for (elem = props; elem; elem = g_list_next (elem)) {
+ GstPropsEntry *prop = elem->data;
+ const gchar *name = g_quark_to_string (prop->propid);
- if (width < strlen (name))
- width = strlen (name);
- }
+ if (width < strlen (name))
+ width = strlen (name);
+ }
- for (elem = props; elem; elem = g_list_next (elem))
- {
- GstPropsEntry *prop = elem->data;
+ for (elem = props; elem; elem = g_list_next (elem)) {
+ GstPropsEntry *prop = elem->data;
- string_append_indent (buf, indent);
- if (showname)
- {
- const gchar *name = g_quark_to_string (prop->propid);
-
- g_string_append (buf, name);
- string_append_indent (buf, 2 + width - strlen (name));
- }
+ string_append_indent (buf, indent);
+ if (showname) {
+ const gchar *name = g_quark_to_string (prop->propid);
- switch (prop->propstype) {
+ g_string_append (buf, name);
+ string_append_indent (buf, 2 + width - strlen (name));
+ }
+
+ switch (prop->propstype) {
case GST_PROPS_INT_ID:
g_string_append_printf (buf, "%d (int)\n", prop->data.int_data);
break;
case GST_PROPS_INT_RANGE_ID:
g_string_append_printf (buf, "%d - %d (int)\n",
- prop->data.int_range_data.min,
- prop->data.int_range_data.max);
+ prop->data.int_range_data.min, prop->data.int_range_data.max);
break;
case GST_PROPS_FLOAT_ID:
g_string_append_printf (buf, "%f (float)\n", prop->data.float_data);
- break;
+ break;
case GST_PROPS_FLOAT_RANGE_ID:
g_string_append_printf (buf, "%f - %f (float)\n",
- prop->data.float_range_data.min,
- prop->data.float_range_data.max);
+ prop->data.float_range_data.min, prop->data.float_range_data.max);
break;
case GST_PROPS_BOOL_ID:
- g_string_append_printf (buf, "%s\n",
- prop->data.bool_data ? "TRUE" : "FALSE");
+ g_string_append_printf (buf, "%s\n", prop->data.bool_data ? "TRUE" : "FALSE");
break;
case GST_PROPS_STRING_ID:
g_string_append_printf (buf, "\"%s\"\n", prop->data.string_data.string);
break;
case GST_PROPS_FOURCC_ID:
g_string_append_printf (buf, "'%c%c%c%c' (fourcc)\n",
- prop->data.fourcc_data & 0xff,
- prop->data.fourcc_data>>8 & 0xff,
- prop->data.fourcc_data>>16 & 0xff,
- prop->data.fourcc_data>>24 & 0xff);
+ prop->data.fourcc_data & 0xff,
+ prop->data.fourcc_data >> 8 & 0xff,
+ prop->data.fourcc_data >> 16 & 0xff,
+ prop->data.fourcc_data >> 24 & 0xff);
break;
case GST_PROPS_LIST_ID:
- gst_print_props (buf, indent+2, prop->data.list_data.entries, FALSE);
+ gst_print_props (buf, indent + 2, prop->data.list_data.entries, FALSE);
break;
default:
g_string_append_printf (buf, "unknown proptype %d\n", prop->propstype);
break;
- }
+ }
}
}
-void gst_print_pad_caps (GString *buf, gint indent, GstPad *pad)
+/**
+ * gst_print_pad_caps:
+ * @buf: the buffer to print the caps in
+ * @indent: initial indentation
+ * @pad: the pad to print the caps from
+ *
+ * Write the pad capabilities in a human readable format into
+ * the given GString.
+ */
+void
+gst_print_pad_caps (GString * buf, gint indent, GstPad * pad)
{
GstRealPad *realpad;
GstCaps *caps;
- realpad = GST_PAD_REALIZE(pad);
+ realpad = GST_PAD_REALIZE (pad);
caps = realpad->caps;
- if (!caps)
- {
- string_append_indent (buf, indent);
- g_string_printf (buf, "%s:%s has no capabilities",
- GST_DEBUG_PAD_NAME (pad));
- }
- else
- {
- gint capx = 0;
+ if (!caps) {
+ string_append_indent (buf, indent);
+ g_string_printf (buf, "%s:%s has no capabilities", GST_DEBUG_PAD_NAME (pad));
+ }
+ else {
+ gint capx = 0;
- while (caps) {
- GstType *type;
+ while (caps) {
+ GstType *type;
- string_append_indent (buf, indent);
- g_string_append_printf (buf, "Cap[%d]: %s\n", capx++, caps->name);
+ string_append_indent (buf, indent);
+ g_string_append_printf (buf, "Cap[%d]: %s\n", capx++, caps->name);
- type = gst_type_find_by_id (caps->id);
- string_append_indent (buf, indent+2);
- g_string_append_printf (buf, "MIME type: %s\n",
- type->mime? type->mime : "unknown/unknown");
+ type = gst_type_find_by_id (caps->id);
+ string_append_indent (buf, indent + 2);
+ g_string_append_printf (buf, "MIME type: %s\n", type->mime ? type->mime : "unknown/unknown");
- if (caps->properties)
- gst_print_props (buf, indent + 4,
- caps->properties->properties, TRUE);
+ if (caps->properties)
+ gst_print_props (buf, indent + 4, caps->properties->properties, TRUE);
- caps = caps->next;
- }
+ caps = caps->next;
}
+ }
}
-void gst_print_element_args (GString *buf, gint indent, GstElement *element)
+/**
+ * gst_print_element_args:
+ * @buf: the buffer to print the args in
+ * @indent: initial indentation
+ * @element: the element to print the args of
+ *
+ * Print the element argument in a human readable format in the given
+ * GString.
+ */
+void
+gst_print_element_args (GString * buf, gint indent, GstElement * element)
{
gint num_properties;
gint px;
guint width;
- GParamSpec **property_specs =
- g_object_class_list_properties (G_OBJECT_GET_CLASS (element),
- &num_properties);
-
- width=0;
- for (px=0; px < num_properties; px++) {
+ GParamSpec **property_specs = g_object_class_list_properties (G_OBJECT_GET_CLASS (element),
+ &num_properties);
+
+ width = 0;
+ for (px = 0; px < num_properties; px++) {
GParamSpec *param = property_specs[px];
+
if (width < strlen (param->name))
width = strlen (param->name);
}
- for (px=0; px < num_properties; px++) {
+ for (px = 0; px < num_properties; px++) {
GParamSpec *param = property_specs[px];
GValue value;
@@ -492,49 +513,57 @@
#endif
g_string_append_printf (buf, "%s (%s)",
- values [g_value_get_enum (&value)].value_nick,
- g_type_name (G_VALUE_TYPE (&value)));
+ values[g_value_get_enum (&value)].value_nick,
+ g_type_name (G_VALUE_TYPE (&value)));
}
- else
+ else {
switch (G_VALUE_TYPE (&value)) {
- case G_TYPE_STRING:
- g_string_append_printf (buf, "\"%s\"", g_value_get_string (&value));
- break;
- case G_TYPE_BOOLEAN:
- g_string_append (buf, g_value_get_boolean (&value)? "TRUE":"FALSE");
- break;
- case G_TYPE_ULONG:{
- gulong val = g_value_get_ulong (&value);
- g_string_append_printf (buf, "%lu (0x%lx)", val, val);
- break;}
- case G_TYPE_LONG:{
- glong val = g_value_get_long (&value);
- g_string_append_printf (buf, "%ld (0x%lx)", val, val);
- break;}
- case G_TYPE_UINT:{
- guint val = g_value_get_uint (&value);
- g_string_append_printf (buf, "%u (0x%x)", val, val);
- break;}
- case G_TYPE_INT:{
- gint val = g_value_get_int (&value);
- g_string_append_printf (buf, "%d (0x%x)", val, val);
- break;}
- case G_TYPE_FLOAT:
- g_string_append_printf (buf, "%f", g_value_get_float (&value));
- break;
- case G_TYPE_DOUBLE:
- g_string_append_printf (buf, "%f", g_value_get_double (&value));
- break;
- default:
- g_string_append_printf (buf, "unknown value_type %d", G_VALUE_TYPE (&value));
- break;
+ case G_TYPE_STRING:
+ g_string_append_printf (buf, "\"%s\"", g_value_get_string (&value));
+ break;
+ case G_TYPE_BOOLEAN:
+ g_string_append (buf, g_value_get_boolean (&value) ? "TRUE" : "FALSE");
+ break;
+ case G_TYPE_ULONG:{
+ gulong val = g_value_get_ulong (&value);
+
+ g_string_append_printf (buf, "%lu (0x%lx)", val, val);
+ break;
+ }
+ case G_TYPE_LONG:{
+ glong val = g_value_get_long (&value);
+
+ g_string_append_printf (buf, "%ld (0x%lx)", val, val);
+ break;
+ }
+ case G_TYPE_UINT:{
+ guint val = g_value_get_uint (&value);
+
+ g_string_append_printf (buf, "%u (0x%x)", val, val);
+ break;
+ }
+ case G_TYPE_INT:{
+ gint val = g_value_get_int (&value);
+
+ g_string_append_printf (buf, "%d (0x%x)", val, val);
+ break;
+ }
+ case G_TYPE_FLOAT:
+ g_string_append_printf (buf, "%f", g_value_get_float (&value));
+ break;
+ case G_TYPE_DOUBLE:
+ g_string_append_printf (buf, "%f", g_value_get_double (&value));
+ break;
+ default:
+ g_string_append_printf (buf, "unknown value_type %d", G_VALUE_TYPE (&value));
+ break;
}
+ }
g_string_append_c (buf, '\n');
if (G_VALUE_TYPE (&value))
g_value_unset (&value);
}
-
g_free (property_specs);
}
Index: gstutils.h
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstutils.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- gstutils.h 2001/09/18 04:20:04 1.10
+++ gstutils.h 2001/10/21 18:00:31 1.11
@@ -45,8 +45,8 @@
void gst_util_dump_mem (guchar *mem, guint size);
-void gst_print_pad_caps (GString *buf, gint indent, GstPad *pad);
-void gst_print_element_args (GString *buf, gint indent, GstElement *element);
+void gst_print_pad_caps (GString *buf, gint indent, GstPad *pad);
+void gst_print_element_args (GString *buf, gint indent, GstElement *element);
#ifdef __cplusplus
}
- Previous message: [gst-cvs] CVS: gstreamer/gst/elements Makefile.am,1.30,1.31 gstdisksrc.c,1.37,1.38 gstmultidisksrc.c,1.5,1.6 gstpipefilter.c,1.13,1.14 gstsinesrc.c,1.24,NONE gstsinesrc.h,1.14,NONE
- Next message: [gst-cvs] CVS: gstreamer/libs/bytestream gstbytestream.c,1.2,1.3 gstbytestream.h,1.2,1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Gstreamer-commits
mailing list