Commit b6d31c1c authored by Erik Walthinsen's avatar Erik Walthinsen

Megapatch, changes which states are available, how they're used, and how...

Megapatch, changes which states are available, how they're used, and how they're set.  Also modifies the scheduling s...

Original commit message from CVS:
Megapatch, changes which states are available, how they're used, and how
they're set.  Also modifies the scheduling system, breaking pulled
buffers.  Check mail archives for more details.
parent 5effd6fe
SUBDIRS = gst plugins test editor tools docs libs
SUBDIRS = gst libs plugins test editor tools docs tests
bin_SCRIPTS = gstreamer-config
......
......@@ -61,7 +61,7 @@ for dir in `find * -name autogen.sh -print | grep -v '^autogen.sh$' | \
popd > /dev/null
done
./configure --enable-maintainer-mode "$@"
./configure --enable-maintainer-mode --enable-debug "$@"
echo
echo "Now type 'make' to compile $package."
......@@ -51,7 +51,7 @@ AM_PATH_GLIB(1.2.0,,
glib gmodule gthread)
dnl Put the glib flags into $LIBS and $CFLAGS since we always use them
LIBS="$LIBS $GLIB_LIBS"
CFLAGS="$FLAGS $GLIB_CFLAGS"
CFLAGS="$CFLAGS $GLIB_CFLAGS"
dnl Check for libxml
AC_PATH_PROG(XML_CONFIG, xml-config, no)
......@@ -306,7 +306,7 @@ AM_CONDITIONAL(HAVE_LIBMMX, test "x$USE_LIBMMX" = "xyes")
AM_CONDITIONAL(HAVE_ATOMIC_H, test "x$USE_ATOMIC_H" = "xyes")
AM_CONDITIONAL(HAVE_XAUDIO, test "x$HAVE_XAUDIO" = "xyes")
AM_CONDITIONAL(HAVE_CSSAUTH, test "x$HAVE_CSSAUTH" = "xyes")
AM_CONDITIONAL(HAVE_GTK_DOC, $HAVE_GTK_DOC)
AM_CONDITIONAL(HAVE_GTK_DOC, test "x$HAVE_GTK_DOC" = "xyes")
dnl FIXME: having to AC_SUBST these is messy. Not sure if CPPFLAGS and LDFLAGS
......
SUBDIRS =
if HAVE_GTK_DOC
SUBDIRS += gst
SUBDIRS += gst manual
endif
DIST_SUBDIRS = gst
DIST_SUBDIRS = gst manual
EXTRA_DIST = random slides
......@@ -136,25 +136,6 @@ struct GstBin {
cothread_context *threadcontext;
};
</STRUCT>
<STRUCT>
<NAME>GstBinClass</NAME>
struct GstBinClass {
GstElementClass parent_class;
void (*object_added) (GstObject *object,GstObject *child);
/* change the state of elements of the given type */
gboolean (*change_state_type) (GstBin *bin,
GstElementState state,
GtkType type);
/* create a plan for the execution of the bin */
void (*create_plan) (GstBin *bin);
/* run a full iteration of operation */
void (*iterate) (GstBin *bin);
};
</STRUCT>
<FUNCTION>
<NAME>gst_bin_get_type</NAME>
<RETURNS>GtkType </RETURNS>
......@@ -359,64 +340,6 @@ GstBuffer *buffer
<RETURNS>void </RETURNS>
GstBuffer *buffer,GstMeta *meta
</FUNCTION>
<TYPEDEF>
<NAME>GstClockTime</NAME>
typedef guint64 GstClockTime;
</TYPEDEF>
<TYPEDEF>
<NAME>GstClockTimeDiff</NAME>
typedef gint64 GstClockTimeDiff;
</TYPEDEF>
<MACRO>
<NAME>GST_CLOCK_DIFF</NAME>
#define GST_CLOCK_DIFF(s, e) (GstClockTimeDiff)((s)-(e))
</MACRO>
<STRUCT>
<NAME>GstClock</NAME>
</STRUCT>
<STRUCT>
<NAME>GstClock</NAME>
struct GstClock {
gchar *name;
GstClockTime start_time;
GstClockTime current_time;
GstClockTimeDiff adjust;
gboolean locking;
GList *sinkobjects;
GMutex *sinkmutex;
GMutex *lock;
};
</STRUCT>
<FUNCTION>
<NAME>gst_clock_new</NAME>
<RETURNS>GstClock *</RETURNS>
gchar *name
</FUNCTION>
<FUNCTION>
<NAME>gst_clock_get_system</NAME>
<RETURNS>GstClock *</RETURNS>
void
</FUNCTION>
<FUNCTION>
<NAME>gst_clock_register</NAME>
<RETURNS>void </RETURNS>
GstClock *clock, GstObject *obj
</FUNCTION>
<FUNCTION>
<NAME>gst_clock_set</NAME>
<RETURNS>void </RETURNS>
GstClock *clock, GstClockTime time
</FUNCTION>
<FUNCTION>
<NAME>gst_clock_reset</NAME>
<RETURNS>void </RETURNS>
GstClock *clock
</FUNCTION>
<FUNCTION>
<NAME>gst_clock_wait</NAME>
<RETURNS>void </RETURNS>
GstClock *clock, GstClockTime time, GstObject *obj
</FUNCTION>
<MACRO>
<NAME>GST_TYPE_CONNECTION</NAME>
#define GST_TYPE_CONNECTION \
......@@ -454,15 +377,6 @@ struct GstConnection {
GstElement element;
};
</STRUCT>
<STRUCT>
<NAME>GstConnectionClass</NAME>
struct GstConnectionClass {
GstElementClass parent_class;
/* push function */
void (*push) (GstConnection *connection);
};
</STRUCT>
<FUNCTION>
<NAME>gst_connection_get_type</NAME>
<RETURNS>GtkType </RETURNS>
......@@ -504,14 +418,16 @@ typedef enum {
<NAME>GST_STATE_SET</NAME>
#define GST_STATE_SET(obj,flag) \
G_STMT_START{ (GST_STATE (obj) |= (flag)); \
gst_info("set '%s' state %d\n",gst_element_get_name(obj),flag); \
gst_info("set '%s' state %d(%s)\n",gst_element_get_name(obj),flag, \
_gst_print_statename(flag)); \
}G_STMT_END
</MACRO>
<MACRO>
<NAME>GST_STATE_UNSET</NAME>
#define GST_STATE_UNSET(obj,flag) \
G_STMT_START{ (GST_STATE (obj) &= ~(flag)); \
gst_info("unset '%s' state %d\n",gst_element_get_name(obj),flag); \
gst_info("unset '%s' state %d(%s)\n",gst_element_get_name(obj),flag, \
_gst_print_statename(flag)); \
}G_STMT_END
</MACRO>
<MACRO>
......@@ -539,6 +455,16 @@ gst_info("unset '%s' state %d\n",gst_element_get_name(obj),flag); \
#define GST_IS_ELEMENT_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_ELEMENT))
</MACRO>
<ENUM>
<NAME>GstElementFlags</NAME>
typedef enum {
GST_ELEMENT_MULTI_OUT = (1 << 16),
} GstElementFlags;
</ENUM>
<MACRO>
<NAME>GST_ELEMENT_IS_MULTI_OUT</NAME>
#define GST_ELEMENT_IS_MULTI_OUT(obj) ((GST_FLAGS(obj) & GST_ELEMENT_MULTI_OUT)
</MACRO>
<STRUCT>
<NAME>GstElement</NAME>
</STRUCT>
......@@ -575,32 +501,6 @@ struct GstElement {
};
</STRUCT>
<STRUCT>
<NAME>GstElementClass</NAME>
struct GstElementClass {
GstObjectClass parent_class;
/* the elementfactory that created us */
GstElementFactory *elementfactory;
/* signal callbacks */
void (*state_change) (GstElement *element,GstElementState state);
void (*new_pad) (GstElement *element,GstPad *pad);
void (*new_ghost_pad) (GstElement *element,GstPad *pad);
void (*error) (GstElement *element,gchar *error);
/* events */
gboolean (*start) (GstElement *element,GstElementState state);
gboolean (*stop) (GstElement *element);
/* change the element state */
gboolean (*change_state) (GstElement *element,GstElementState state);
/* create or read XML representation of self */
xmlNodePtr (*save_thyself)(GstElement *element,xmlNodePtr parent);
void (*restore_thyself)(GstElement *element,xmlNodePtr *self);
};
</STRUCT>
<STRUCT>
<NAME>GstElementDetails</NAME>
struct GstElementDetails {
gchar *longname; /* long, english name */
......@@ -776,12 +676,6 @@ struct GstFilter {
GstElement element;
};
</STRUCT>
<STRUCT>
<NAME>GstFilterClass</NAME>
struct GstFilterClass {
GstElementClass parent_class;
};
</STRUCT>
<FUNCTION>
<NAME>gst_filter_get_type</NAME>
<RETURNS>GtkType </RETURNS>
......@@ -926,17 +820,6 @@ struct GstObject {
GstObject *parent;
};
</STRUCT>
<STRUCT>
<NAME>GstObjectClass</NAME>
struct GstObjectClass {
GtkObjectClass parent_class;
/* signals */
void (*parent_set) (GstObject *object,GstObject *parent);
/* functions go here */
};
</STRUCT>
<MACRO>
<NAME>GST_FLAGS</NAME>
#define GST_FLAGS(obj) GTK_OBJECT_FLAGS(obj)
......@@ -1028,13 +911,11 @@ GstObject *object
</MACRO>
<MACRO>
<NAME>GST_PAD_CONNECTED</NAME>
#define GST_PAD_CONNECTED(pad) \
((pad)->peer != NULL)
#define GST_PAD_CONNECTED(pad) ((pad)->peer != NULL)
</MACRO>
<MACRO>
<NAME>GST_PAD_CAN_PULL</NAME>
#define GST_PAD_CAN_PULL(pad) \
((pad)->pull != NULL)
#define GST_PAD_CAN_PULL(pad) ((pad)->pullfunc != NULL)
</MACRO>
<STRUCT>
<NAME>GstPad</NAME>
......@@ -1049,7 +930,7 @@ GstPad *pad,GstBuffer *buf
</USER_FUNCTION>
<USER_FUNCTION>
<NAME>GstPadPullFunction</NAME>
<RETURNS>GstBuffer *</RETURNS>
<RETURNS>void </RETURNS>
GstPad *pad
</USER_FUNCTION>
<USER_FUNCTION>
......@@ -1079,19 +960,14 @@ struct GstPad {
GstBuffer *bufpen;
GstPadChainFunction chain;
GstPadPullFunction pull;
GstPadChainFunction chainfunc;
GstPadPullFunction pullfunc;
GstPadPushFunction pushfunc;
GstObject *parent;
GList *ghostparents;
};
</STRUCT>
<STRUCT>
<NAME>GstPadClass</NAME>
struct GstPadClass {
GstObjectClass parent_class;
};
</STRUCT>
<FUNCTION>
<NAME>gst_pad_get_type</NAME>
<RETURNS>GtkType </RETURNS>
......@@ -1233,12 +1109,6 @@ struct GstPipeline {
GstBin bin;
};
</STRUCT>
<STRUCT>
<NAME>GstPipelineClass</NAME>
struct GstPipelineClass {
GstBinClass parent_class;
};
</STRUCT>
<FUNCTION>
<NAME>gst_pipeline_get_type</NAME>
<RETURNS>GtkType </RETURNS>
......@@ -1368,12 +1238,6 @@ struct GstSink {
GstElement element;
};
</STRUCT>
<STRUCT>
<NAME>GstSinkClass</NAME>
struct GstSinkClass {
GstElementClass parent_class;
};
</STRUCT>
<FUNCTION>
<NAME>gst_sink_get_type</NAME>
<RETURNS>GtkType </RETURNS>
......@@ -1438,19 +1302,6 @@ struct GstSrc {
gint32 flags;
};
</STRUCT>
<STRUCT>
<NAME>GstSrcClass</NAME>
struct GstSrcClass {
GstElementClass parent_class;
/* subclass functions */
void (*push) (GstSrc *src);
void (*push_region) (GstSrc *src,gulong offset,gulong size);
/* signals */
void (*eos) (GstSrc *src);
};
</STRUCT>
<MACRO>
<NAME>GST_SRC_SET_FLAGS</NAME>
#define GST_SRC_SET_FLAGS(src,flag) \
......@@ -1523,12 +1374,6 @@ struct GstTee {
GSList *srcpads;
};
</STRUCT>
<STRUCT>
<NAME>GstTeeClass</NAME>
struct GstTeeClass {
GstFilterClass parent_class;
};
</STRUCT>
<FUNCTION>
<NAME>gst_tee_get_type</NAME>
<RETURNS>GtkType </RETURNS>
......@@ -1593,20 +1438,11 @@ typedef enum {
struct GstThread {
GstBin bin;
GList *entries; /* used to determine iterate behavior */
gint numentries; /* number of above entry points */
pthread_t thread_id; /* id of the thread, if any */
GMutex *lock; /* thread lock/condititon pair... */
GCond *cond; /* used to control the thread */
};
</STRUCT>
<STRUCT>
<NAME>GstThreadClass</NAME>
struct GstThreadClass {
GstBinClass parent_class;
};
</STRUCT>
<FUNCTION>
<NAME>gst_thread_get_type</NAME>
<RETURNS>GtkType </RETURNS>
......@@ -1825,6 +1661,64 @@ GtkObject *object,guchar *argname
<RETURNS>xmlDocPtr </RETURNS>
GstElement *element
</FUNCTION>
<TYPEDEF>
<NAME>GstClockTime</NAME>
typedef guint64 GstClockTime;
</TYPEDEF>
<TYPEDEF>
<NAME>GstClockTimeDiff</NAME>
typedef gint64 GstClockTimeDiff;
</TYPEDEF>
<MACRO>
<NAME>GST_CLOCK_DIFF</NAME>
#define GST_CLOCK_DIFF(s, e) (GstClockTimeDiff)((s)-(e))
</MACRO>
<STRUCT>
<NAME>GstClock</NAME>
</STRUCT>
<STRUCT>
<NAME>GstClock</NAME>
struct GstClock {
gchar *name;
GstClockTime start_time;
GstClockTime current_time;
GstClockTimeDiff adjust;
gboolean locking;
GList *sinkobjects;
GMutex *sinkmutex;
GMutex *lock;
};
</STRUCT>
<FUNCTION>
<NAME>gst_clock_new</NAME>
<RETURNS>GstClock *</RETURNS>
gchar *name
</FUNCTION>
<FUNCTION>
<NAME>gst_clock_get_system</NAME>
<RETURNS>GstClock *</RETURNS>
void
</FUNCTION>
<FUNCTION>
<NAME>gst_clock_register</NAME>
<RETURNS>void </RETURNS>
GstClock *clock, GstObject *obj
</FUNCTION>
<FUNCTION>
<NAME>gst_clock_set</NAME>
<RETURNS>void </RETURNS>
GstClock *clock, GstClockTime time
</FUNCTION>
<FUNCTION>
<NAME>gst_clock_reset</NAME>
<RETURNS>void </RETURNS>
GstClock *clock
</FUNCTION>
<FUNCTION>
<NAME>gst_clock_wait</NAME>
<RETURNS>void </RETURNS>
GstClock *clock, GstClockTime time, GstObject *obj
</FUNCTION>
<MACRO>
<NAME>GST_TYPE_ASYNCDISKSRC</NAME>
#define GST_TYPE_ASYNCDISKSRC \
......@@ -1885,12 +1779,6 @@ struct GstAsyncDiskSrc {
gulong seq; /* buffer sequence number */
};
</STRUCT>
<STRUCT>
<NAME>GstAsyncDiskSrcClass</NAME>
struct GstAsyncDiskSrcClass {
GstSrcClass parent_class;
};
</STRUCT>
<FUNCTION>
<NAME>gst_asyncdisksrc_get_type</NAME>
<RETURNS>GtkType </RETURNS>
......@@ -1944,15 +1832,6 @@ struct GstAudioSink {
gint frequency;
};
</STRUCT>
<STRUCT>
<NAME>GstAudioSinkClass</NAME>
struct GstAudioSinkClass {
GstSinkClass parent_class;
/* signals */
void (*handoff) (GstElement *element,GstPad *pad);
};
</STRUCT>
<FUNCTION>
<NAME>gst_audiosink_get_type</NAME>
<RETURNS>GtkType </RETURNS>
......@@ -2014,12 +1893,6 @@ struct GstAudioSrc {
MetaAudioRaw *meta;
};
</STRUCT>
<STRUCT>
<NAME>GstAudioSrcClass</NAME>
struct GstAudioSrcClass {
GstSrcClass parent_class;
};
</STRUCT>
<FUNCTION>
<NAME>gst_audiosrc_get_type</NAME>
<RETURNS>GtkType </RETURNS>
......@@ -2080,12 +1953,6 @@ struct GstDiskSrc {
gulong seq; /* buffer sequence number */
};
</STRUCT>
<STRUCT>
<NAME>GstDiskSrcClass</NAME>
struct GstDiskSrcClass {
GstSrcClass parent_class;
};
</STRUCT>
<FUNCTION>
<NAME>gst_disksrc_get_type</NAME>
<RETURNS>GtkType </RETURNS>
......@@ -2137,15 +2004,6 @@ struct GstEsdSink {
gint frequency;
};
</STRUCT>
<STRUCT>
<NAME>GstEsdSinkClass</NAME>
struct GstEsdSinkClass {
GstFilterClass parent_class;
/* signals */
void (*handoff) (GstElement *element,GstPad *pad);
};
</STRUCT>
<FUNCTION>
<NAME>gst_esdsink_get_type</NAME>
<RETURNS>GtkType </RETURNS>
......@@ -2190,12 +2048,6 @@ struct GstFakeSink {
GstPad *sinkpad;
};
</STRUCT>
<STRUCT>
<NAME>GstFakeSinkClass</NAME>
struct GstFakeSinkClass {
GstSinkClass parent_class;
};
</STRUCT>
<FUNCTION>
<NAME>gst_fakesink_get_type</NAME>
<RETURNS>GtkType </RETURNS>
......@@ -2240,12 +2092,6 @@ struct GstFakeSrc {
GstPad *srcpad;
};
</STRUCT>
<STRUCT>
<NAME>GstFakeSrcClass</NAME>
struct GstFakeSrcClass {
GstSrcClass parent_class;
};
</STRUCT>
<FUNCTION>
<NAME>gst_fakesrc_get_type</NAME>
<RETURNS>GtkType </RETURNS>
......@@ -2292,12 +2138,6 @@ struct GstFdSink {
int fd;
};
</STRUCT>
<STRUCT>
<NAME>GstFdSinkClass</NAME>
struct GstFdSinkClass {
GstSinkClass parent_class;
};
</STRUCT>
<FUNCTION>
<NAME>gst_fdsink_get_type</NAME>
<RETURNS>GtkType </RETURNS>
......@@ -2350,12 +2190,6 @@ struct GstFdSrc {
gulong seq; /* buffer sequence number */
};
</STRUCT>
<STRUCT>
<NAME>GstFdSrcClass</NAME>
struct GstFdSrcClass {
GstSrcClass parent_class;
};
</STRUCT>
<FUNCTION>
<NAME>gst_fdsrc_get_type</NAME>
<RETURNS>GtkType </RETURNS>
......@@ -2407,12 +2241,6 @@ struct GstHttpSrc {
gulong bytes_per_read; /* bytes per read */
};
</STRUCT>
<STRUCT>
<NAME>GstHttpSrcClass</NAME>
struct GstHttpSrcClass {
GstSrcClass parent_class;
};
</STRUCT>
<FUNCTION>
<NAME>gst_httpsrc_get_type</NAME>
<RETURNS>GtkType </RETURNS>
......@@ -2460,12 +2288,6 @@ struct GstIdentity {
gint control;
};
</STRUCT>
<STRUCT>
<NAME>GstIdentityClass</NAME>
struct GstIdentityClass {
GstFilterClass parent_class;
};
</STRUCT>
<FUNCTION>
<NAME>gst_identity_get_type</NAME>
<RETURNS>GtkType </RETURNS>
......@@ -2526,12 +2348,6 @@ struct GstQueue {
GCond *fullcond;
};
</STRUCT>
<STRUCT>
<NAME>GstQueueClass</NAME>
struct GstQueueClass {
GstConnectionClass parent_class;
};
</STRUCT>
<FUNCTION>
<NAME>gst_queue_get_type</NAME>
<RETURNS>GtkType </RETURNS>
......@@ -2585,18 +2401,15 @@ struct GstSineSrc {
gint channels;
gint frequency;
/* state */
double mTheta;
gulong seq;
MetaAudioRaw meta;
gboolean sentmeta;
};
</STRUCT>
<STRUCT>
<NAME>GstSineSrcClass</NAME>
struct GstSineSrcClass {
GstSrcClass parent_class;
};
</STRUCT>
<FUNCTION>
<NAME>gst_sinesrc_get_type</NAME>
<RETURNS>GtkType </RETURNS>
......
......@@ -58,6 +58,9 @@ libgstinclude_HEADERS = \
cothreads.h
CFLAGS += -O2 -Wall
#if USE_DEBUG
CFLAGS += -g
#endif
libgst_la_LIBADD = $(GLIB_LIBS) $(GTK_LIBS) $(XML_LIBS)
libgst_la_LDFLAGS = -version-info $(STREAMER_CURRENT):$(STREAMER_REVISION):$(STREAMER_AGE)
......
......@@ -45,13 +45,13 @@ struct _elements_entry {
};
struct _elements_entry _elements[] = {
{ "fakesrc", gst_fakesrc_get_type, &gst_fakesrc_details },
{ "fakesink", gst_fakesink_get_type, &gst_fakesink_details },
{ "asyncdisksrc", gst_asyncdisksrc_get_type, &gst_asyncdisksrc_details },
{ "audiosink", gst_audiosink_get_type, &gst_audiosink_details },
{ "audiosrc", gst_audiosrc_get_type, &gst_audiosrc_details },
{ "disksrc", gst_disksrc_get_type, &gst_disksrc_details },
{ "identity", gst_identity_get_type, &gst_identity_details },
{ "fakesink", gst_fakesink_get_type, &gst_fakesink_details },
{ "fakesrc", gst_fakesrc_get_type, &gst_fakesrc_details },
{ "fdsink", gst_fdsink_get_type, &gst_fdsink_details },
{ "fdsrc", gst_fdsrc_get_type, &gst_fdsrc_details },
#if HAVE_LIBGHTTP
......
......@@ -86,8 +86,8 @@ static void gst_fakesink_init(GstFakeSink *fakesink) {
gst_element_add_pad(GST_ELEMENT(fakesink),fakesink->sinkpad);
gst_pad_set_chain_function(fakesink->sinkpad,gst_fakesink_chain);
// we're already complete, since we don't have any args...
gst_element_set_state(GST_ELEMENT(fakesink),GST_STATE_COMPLETE);
// we're ready right away, since we don't have any args...
// gst_element_set_state(GST_ELEMENT(fakesink),GST_STATE_READY);