Changed the GstPadFactory and added the GstPadTemplate.

Original commit message from CVS:
Changed the GstPadFactory and added the GstPadTemplate.

The GstPadFactory is an easy way to define a pad with capabilities.
The GstPadFactory is converted into a GstPadTemplate. The template is
used to create new pads and to expose the possible pads used in an
element to the plugin system.

updated mp3parse, mpg123, cdparanoia to the new API.
Rerun gstreamer-register because the XML definition has changed.
This commit is contained in:
Wim Taymans 2000-12-13 19:29:35 +00:00
parent 97fc2e9f07
commit 196c67d7ff
19 changed files with 639 additions and 313 deletions

View file

@ -71,6 +71,11 @@ cothread_context *ctx
cothread_state *thread, cothread_func func,int argc, char **argv
</FUNCTION>
<FUNCTION>
<NAME>cothread_getcurrent</NAME>
<RETURNS>int </RETURNS>
void
</FUNCTION>
<FUNCTION>
<NAME>cothread_switch</NAME>
<RETURNS>void </RETURNS>
cothread_state *thread
@ -105,14 +110,6 @@ void
<RETURNS>void </RETURNS>
void
</FUNCTION>
<MACRO>
<NAME>DEBUG</NAME>
#define DEBUG(format, args...) g_print("DEBUG:(%d) " format, getpid() , ##args)
</MACRO>
<MACRO>
<NAME>DEBUG</NAME>
#define DEBUG(format, args...)
</MACRO>
<VARIABLE>
<NAME>gst_bin_details</NAME>
extern GstElementDetails gst_bin_details;
@ -164,6 +161,7 @@ struct GstBin {
cothread_context *threadcontext;
gboolean use_cothreads;
GList *outside_schedules;
};
</STRUCT>
<FUNCTION>
@ -506,11 +504,6 @@ void
<RETURNS>GstElement *</RETURNS>
gchar *name
</FUNCTION>
<FUNCTION>
<NAME>gst_connection_push</NAME>
<RETURNS>void </RETURNS>
GstConnection *connection
</FUNCTION>
<ENUM>
<NAME>GstElementState</NAME>
typedef enum {
@ -568,15 +561,22 @@ typedef enum {
GST_ELEMENT_MULTI_IN = (1 << 4),
GST_ELEMENT_THREAD_SUGGESTED = (1 << 5),
GST_ELEMENT_NO_SEEK = (1 << 6),
GST_ELEMENT_NEW_LOOPFUNC = (1 << 16),
GST_ELEMENT_COTHREAD_STOPPING = (1 << 17),
} GstElementFlags;
</ENUM>
<MACRO>
<NAME>GST_ELEMENT_IS_MULTI_IN</NAME>
#define GST_ELEMENT_IS_MULTI_IN(obj) (GST_FLAGS(obj) & GST_ELEMENT_MULTI_IN)
#define GST_ELEMENT_IS_MULTI_IN(obj) (GST_FLAG_IS_SET(obj,GST_ELEMENT_MULTI_IN))
</MACRO>
<MACRO>
<NAME>GST_ELEMENT_IS_THREAD_SUGGESTED</NAME>
#define GST_ELEMENT_IS_THREAD_SUGGESTED(obj) (GST_FLAGS(obj) & GST_ELEMENT_THREAD_SUGGESTED)
#define GST_ELEMENT_IS_THREAD_SUGGESTED(obj) (GST_FLAG_IS_SET(obj,GST_ELEMENT_THREAD_SUGGESTED))
</MACRO>
<MACRO>
<NAME>GST_ELEMENT_IS_COTHREAD_STOPPING</NAME>
#define GST_ELEMENT_IS_COTHREAD_STOPPING(obj) (GST_FLAG_IS_SET(obj,GST_ELEMENT_COTHREAD_STOPPING))
</MACRO>
<STRUCT>
<NAME>GstElement</NAME>
@ -618,7 +618,7 @@ struct GstElement {
<NAME>GstElementDetails</NAME>
struct GstElementDetails {
gchar *longname; /* long, english name */
gchar *class; /* type of element, kinda */
gchar *klass; /* type of element, kinda */
gchar *description; /* insights of one form or another */
gchar *version; /* version of the element */
gchar *author; /* who wrote this thing? */
@ -633,8 +633,7 @@ struct GstElementFactory {
GstElementDetails *details; /* pointer to details struct */
GList *src_types;
GList *sink_types;
GList *padfactories;
};
</STRUCT>
<FUNCTION>
@ -742,14 +741,14 @@ gchar *name,GtkType type,GstElementDetails *details
GstElementFactory *elementfactory
</FUNCTION>
<FUNCTION>
<NAME>gst_elementfactory_add_src</NAME>
<NAME>gst_elementfactory_unregister</NAME>
<RETURNS>void </RETURNS>
GstElementFactory *elementfactory, guint16 id
GstElementFactory *elementfactory
</FUNCTION>
<FUNCTION>
<NAME>gst_elementfactory_add_sink</NAME>
<NAME>gst_elementfactory_add_pad</NAME>
<RETURNS>void </RETURNS>
GstElementFactory *elementfactory, guint16 id
GstElementFactory *elementfactory,GstPadFactory *pad
</FUNCTION>
<FUNCTION>
<NAME>gst_elementfactory_find</NAME>
@ -1053,11 +1052,11 @@ GstObject *object
</MACRO>
<MACRO>
<NAME>GST_PAD_CONNECTED</NAME>
#define GST_PAD_CONNECTED(pad) (pad && (pad)->peer != NULL)
#define GST_PAD_CONNECTED(pad) ((pad) && (pad)->peer != NULL)
</MACRO>
<MACRO>
<NAME>GST_PAD_CAN_PULL</NAME>
#define GST_PAD_CAN_PULL(pad) (pad && (pad)->pullfunc != NULL)
#define GST_PAD_CAN_PULL(pad) ((pad) && (pad)->pullfunc != NULL)
</MACRO>
<STRUCT>
<NAME>GstPad</NAME>
@ -1098,13 +1097,21 @@ typedef enum {
GST_PAD_SINK,
} GstPadDirection;
</ENUM>
<ENUM>
<NAME>GstPadFlags</NAME>
typedef enum {
GST_PAD_DISABLED = (1 << 4),
} GstPadFlags;
</ENUM>
<STRUCT>
<NAME>GstPad</NAME>
struct GstPad {
GstObject object;
gchar *name;
guint16 type;
GstCaps *caps;
cothread_state *threadstate;
GstPadDirection direction;
@ -1113,15 +1120,35 @@ struct GstPad {
GstBuffer *bufpen;
GstPadChainFunction chainfunc;
GstPadPushFunction pushfunc;
GstPadPullFunction pullfunc;
GstPadPullRegionFunction pullregionfunc;
GstPadPushFunction pushfunc;
GstPadQoSFunction qosfunc;
GstObject *parent;
GList *ghostparents;
};
</STRUCT>
<ENUM>
<NAME>GstPadPresence</NAME>
typedef enum {
GST_PAD_ALWAYS,
GST_PAD_SOMETIMES,
} GstPadPresence;
</ENUM>
<STRUCT>
<NAME>GstPadFactory</NAME>
</STRUCT>
<STRUCT>
<NAME>GstPadFactory</NAME>
struct GstPadFactory {
gchar *nametemplate;
GstCapsFactory *caps;
GstPadDirection direction;
GstPadPresence presence;
gpointer priv;
};
</STRUCT>
<FUNCTION>
<NAME>gst_pad_get_type</NAME>
<RETURNS>GtkType </RETURNS>
@ -1152,19 +1179,24 @@ GstPad *pad, GstPadChainFunction chain
GstPad *pad, GstPadPullFunction pull
</FUNCTION>
<FUNCTION>
<NAME>gst_pad_set_pullregion_function</NAME>
<RETURNS>void </RETURNS>
GstPad *pad, GstPadPullRegionFunction pullregion
</FUNCTION>
<FUNCTION>
<NAME>gst_pad_set_qos_function</NAME>
<RETURNS>void </RETURNS>
GstPad *pad, GstPadQoSFunction qos
</FUNCTION>
<FUNCTION>
<NAME>gst_pad_get_type_id</NAME>
<RETURNS>guint16 </RETURNS>
GstPad *pad
<NAME>gst_pad_set_caps</NAME>
<RETURNS>void </RETURNS>
GstPad *pad, GstCaps *caps
</FUNCTION>
<FUNCTION>
<NAME>gst_pad_set_type_id</NAME>
<RETURNS>void </RETURNS>
GstPad *pad, guint16 id
<NAME>gst_pad_get_caps</NAME>
<RETURNS>GstCaps *</RETURNS>
GstPad *pad
</FUNCTION>
<FUNCTION>
<NAME>gst_pad_set_name</NAME>
@ -1246,6 +1278,26 @@ GstPad *pad, xmlNodePtr parent
<RETURNS>void </RETURNS>
xmlNodePtr parent, GstObject *element, GHashTable *elements
</FUNCTION>
<FUNCTION>
<NAME>gst_padfactory_create</NAME>
<RETURNS>GstPad *</RETURNS>
GstPadFactory *factory, gchar *name
</FUNCTION>
<FUNCTION>
<NAME>gst_padfactory_get_caps</NAME>
<RETURNS>GstCaps *</RETURNS>
GstPadFactory *factory
</FUNCTION>
<FUNCTION>
<NAME>gst_padfactory_save_thyself</NAME>
<RETURNS>xmlNodePtr </RETURNS>
GstPadFactory *pad, xmlNodePtr parent
</FUNCTION>
<FUNCTION>
<NAME>gst_padfactory_load_thyself</NAME>
<RETURNS>GstPadFactory *</RETURNS>
xmlNodePtr parent
</FUNCTION>
<VARIABLE>
<NAME>gst_pipeline_details</NAME>
extern GstElementDetails gst_pipeline_details;
@ -1354,6 +1406,11 @@ GModule *module
gchar *name
</FUNCTION>
<FUNCTION>
<NAME>gst_plugin_set_longname</NAME>
<RETURNS>void </RETURNS>
GstPlugin *plugin, gchar *longname
</FUNCTION>
<FUNCTION>
<NAME>gst_plugin_load_all</NAME>
<RETURNS>void </RETURNS>
void
@ -1364,19 +1421,14 @@ void
gchar *name
</FUNCTION>
<FUNCTION>
<NAME>gst_library_load</NAME>
<RETURNS>gboolean </RETURNS>
gchar *name
</FUNCTION>
<FUNCTION>
<NAME>gst_plugin_load_absolute</NAME>
<RETURNS>gboolean </RETURNS>
gchar *name
</FUNCTION>
<FUNCTION>
<NAME>gst_plugin_set_longname</NAME>
<RETURNS>void </RETURNS>
GstPlugin *plugin, gchar *longname
<NAME>gst_library_load</NAME>
<RETURNS>gboolean </RETURNS>
gchar *name
</FUNCTION>
<FUNCTION>
<NAME>gst_plugin_add_factory</NAME>
@ -1520,8 +1572,8 @@ typedef enum {
<STRUCT>
<NAME>GstSrc</NAME>
struct GstSrc {
GstElement element;
gint32 flags;
GstElement element;
gint32 flags;
};
</STRUCT>
<MACRO>
@ -1540,16 +1592,6 @@ struct GstSrc {
void
</FUNCTION>
<FUNCTION>
<NAME>gst_src_push</NAME>
<RETURNS>void </RETURNS>
GstSrc *src
</FUNCTION>
<FUNCTION>
<NAME>gst_src_push_region</NAME>
<RETURNS>void </RETURNS>
GstSrc *src, gulong offset, gulong size
</FUNCTION>
<FUNCTION>
<NAME>gst_src_signal_eos</NAME>
<RETURNS>void </RETURNS>
GstSrc *src
@ -1778,7 +1820,7 @@ struct GstType {
gchar *mime; /* MIME type */
gchar *exts; /* space-delimited list of extensions */
GstTypeFindFunc typefindfunc; /* typefind function */
GSList *typefindfuncs; /* typefind functions */
GList *srcs; /* list of src objects for this type */
GList *sinks; /* list of sink objects for type */
@ -1812,16 +1854,6 @@ gchar *mime
gchar *ext
</FUNCTION>
<FUNCTION>
<NAME>gst_type_add_src</NAME>
<RETURNS>void </RETURNS>
guint16 id, GstElementFactory *src
</FUNCTION>
<FUNCTION>
<NAME>gst_type_add_sink</NAME>
<RETURNS>void </RETURNS>
guint16 id, GstElementFactory *sink
</FUNCTION>
<FUNCTION>
<NAME>gst_type_get_srcs</NAME>
<RETURNS>GList *</RETURNS>
guint16 id
@ -1970,6 +2002,56 @@ const guchar *fname, const guchar *root
<RETURNS>GstElement *</RETURNS>
GstXML *xml, const guchar *name
</FUNCTION>
<STRUCT>
<NAME>GstCaps</NAME>
</STRUCT>
<TYPEDEF>
<NAME>GstCapsFactoryEntry</NAME>
typedef gpointer GstCapsFactoryEntry;
</TYPEDEF>
<TYPEDEF>
<NAME>GstCapsFactory[]</NAME>
typedef GstCapsFactoryEntry GstCapsFactory[];
</TYPEDEF>
<TYPEDEF>
<NAME>GstCapsListFactory[]</NAME>
typedef GstCapsFactory *GstCapsListFactory[];
</TYPEDEF>
<ENUM>
<NAME>GstCapsDefinition</NAME>
typedef enum {
GST_CAPS_ALWAYS = 1,
GST_CAPS_MAYBE = 2,
} GstCapsDefinition;
</ENUM>
<STRUCT>
<NAME>GstCaps</NAME>
struct GstCaps {
guint16 id; /* type id (major type) */
GstProps *properties; /* properties for this capability */
};
</STRUCT>
<FUNCTION>
<NAME>gst_caps_register</NAME>
<RETURNS>GstCaps *</RETURNS>
GstCapsFactory *factory
</FUNCTION>
<FUNCTION>
<NAME>gst_caps_check_compatibility</NAME>
<RETURNS>gboolean </RETURNS>
GstCaps *caps1, GstCaps *caps2
</FUNCTION>
<FUNCTION>
<NAME>gst_caps_save_thyself</NAME>
<RETURNS>xmlNodePtr </RETURNS>
GstCaps *caps, xmlNodePtr parent
</FUNCTION>
<FUNCTION>
<NAME>gst_caps_load_thyself</NAME>
<RETURNS>GstCaps *</RETURNS>
xmlNodePtr parent
</FUNCTION>
<MACRO>
<NAME>GST_BUFFER_POOL</NAME>
#define GST_BUFFER_POOL(buf) \
@ -2092,6 +2174,198 @@ void
void
</FUNCTION>
<MACRO>
<NAME>GST_DEBUG_ENABLED</NAME>
#define GST_DEBUG_ENABLED
</MACRO>
<MACRO>
<NAME>GST_DEBUG_PREFIX</NAME>
#define GST_DEBUG_PREFIX(format,args...) \
"DEBUG(%d:%d)" __PRETTY_FUNCTION__ ":%d" format , getpid() , cothread_getcurrent() , __LINE__ , ## args
</MACRO>
<USER_FUNCTION>
<NAME>_debug_function_f</NAME>
<RETURNS>void </RETURNS>
</USER_FUNCTION>
<MACRO>
<NAME>DEBUG</NAME>
#define DEBUG(format,args...) \
(_debug_string != NULL) ? \
fprintf(stderr,GST_DEBUG_PREFIX("%s: "format , _debug_string , ## args )) : \
fprintf(stderr,GST_DEBUG_PREFIX(": "format , ## args ))
</MACRO>
<MACRO>
<NAME>DEBUG_ENTER</NAME>
#define DEBUG_ENTER(format, args...) \
fprintf(stderr,GST_DEBUG_PREFIX(format": entering\n" , ## args ))
</MACRO>
<MACRO>
<NAME>DEBUG_SET_STRING</NAME>
#define DEBUG_SET_STRING(format, args...) \
gchar *_debug_string = g_strdup_printf(format , ## args )
</MACRO>
<MACRO>
<NAME>DEBUG_ENTER_STRING</NAME>
#define DEBUG_ENTER_STRING DEBUG_ENTER("%s",_debug_string)
</MACRO>
<MACRO>
<NAME>DEBUG_LEAVE</NAME>
#define DEBUG_LEAVE(format, args...) \
if (_debug_string != NULL) g_free(_debug_string),\
fprintf(stderr,GST_DEBUG_PREFIX(format": leaving\n" , ## args ))
</MACRO>
<MACRO>
<NAME>DEBUG_LEAVE_STRING</NAME>
#define DEBUG_LEAVE_STRING DEBUG_LEAVE("%s",_debug_string)
</MACRO>
<MACRO>
<NAME>DEBUG</NAME>
#define DEBUG(format, args...)
</MACRO>
<MACRO>
<NAME>DEBUG_ENTER</NAME>
#define DEBUG_ENTER(format, args...)
</MACRO>
<MACRO>
<NAME>DEBUG_LEAVE</NAME>
#define DEBUG_LEAVE(format, args...)
</MACRO>
<MACRO>
<NAME>DEBUG_SET_STRING</NAME>
#define DEBUG_SET_STRING(format, args...)
</MACRO>
<MACRO>
<NAME>DEBUG_ENTER_STRING</NAME>
#define DEBUG_ENTER_STRING
</MACRO>
<MACRO>
<NAME>GST_DEBUG_PAD_NAME</NAME>
#define GST_DEBUG_PAD_NAME(pad) \
((pad)->parent != NULL) ? gst_element_get_name(GST_ELEMENT((pad)->parent)) : "''", gst_pad_get_name(pad)
</MACRO>
<STRUCT>
<NAME>GstProps</NAME>
</STRUCT>
<TYPEDEF>
<NAME>GstPropsFactoryEntry</NAME>
typedef gpointer GstPropsFactoryEntry;
</TYPEDEF>
<TYPEDEF>
<NAME>GstPropsFactory[]</NAME>
typedef GstPropsFactoryEntry GstPropsFactory[];
</TYPEDEF>
<TYPEDEF>
<NAME>GstPropsListFactory[]</NAME>
typedef GstPropsFactory *GstPropsListFactory[];
</TYPEDEF>
<ENUM>
<NAME>GstPropsId</NAME>
typedef enum {
GST_PROPS_END_ID_NUM = 0,
GST_PROPS_LIST_ID_NUM,
GST_PROPS_INT_ID_NUM,
GST_PROPS_INT_RANGE_ID_NUM,
GST_PROPS_FOURCC_ID_NUM,
GST_PROPS_BOOL_ID_NUM,
} GstPropsId;
</ENUM>
<MACRO>
<NAME>GST_PROPS_LIST_ID</NAME>
#define GST_PROPS_LIST_ID GINT_TO_POINTER(GST_PROPS_LIST_ID_NUM)
</MACRO>
<MACRO>
<NAME>GST_PROPS_INT_ID</NAME>
#define GST_PROPS_INT_ID GINT_TO_POINTER(GST_PROPS_INT_ID_NUM)
</MACRO>
<MACRO>
<NAME>GST_PROPS_INT_RANGE_ID</NAME>
#define GST_PROPS_INT_RANGE_ID GINT_TO_POINTER(GST_PROPS_INT_RANGE_ID_NUM)
</MACRO>
<MACRO>
<NAME>GST_PROPS_FOURCC_ID</NAME>
#define GST_PROPS_FOURCC_ID GINT_TO_POINTER(GST_PROPS_FOURCC_ID_NUM)
</MACRO>
<MACRO>
<NAME>GST_PROPS_BOOL_ID</NAME>
#define GST_PROPS_BOOL_ID GINT_TO_POINTER(GST_PROPS_BOOL_ID_NUM)
</MACRO>
<MACRO>
<NAME>GST_PROPS_LIST</NAME>
#define GST_PROPS_LIST(a...) GST_PROPS_LIST_ID,##a,NULL
</MACRO>
<MACRO>
<NAME>GST_PROPS_INT</NAME>
#define GST_PROPS_INT(a) GST_PROPS_INT_ID,(GINT_TO_POINTER(a))
</MACRO>
<MACRO>
<NAME>GST_PROPS_INT_RANGE</NAME>
#define GST_PROPS_INT_RANGE(a,b) GST_PROPS_INT_RANGE_ID,(GINT_TO_POINTER(a)),(GINT_TO_POINTER(b))
</MACRO>
<MACRO>
<NAME>GST_PROPS_FOURCC</NAME>
#define GST_PROPS_FOURCC(a,b,c,d) GST_PROPS_FOURCC_ID,(GINT_TO_POINTER((a)|(b)<<8|(c)<<16|(d)<<24))
</MACRO>
<MACRO>
<NAME>GST_PROPS_FOURCC_INT</NAME>
#define GST_PROPS_FOURCC_INT(a) GST_PROPS_FOURCC_ID,(GINT_TO_POINTER(a))
</MACRO>
<MACRO>
<NAME>GST_PROPS_BOOLEAN</NAME>
#define GST_PROPS_BOOLEAN(a) GST_PROPS_BOOL_ID,(GINT_TO_POINTER(a))
</MACRO>
<STRUCT>
<NAME>GstProps</NAME>
struct GstProps {
GSList *properties; /* properties for this capability */
};
</STRUCT>
<FUNCTION>
<NAME>gst_props_register</NAME>
<RETURNS>GstProps *</RETURNS>
GstPropsFactory factory
</FUNCTION>
<FUNCTION>
<NAME>gst_props_check_compatibility</NAME>
<RETURNS>gboolean </RETURNS>
GstProps *props1, GstProps *props2
</FUNCTION>
<FUNCTION>
<NAME>gst_props_save_thyself</NAME>
<RETURNS>xmlNodePtr </RETURNS>
GstProps *props, xmlNodePtr parent
</FUNCTION>
<FUNCTION>
<NAME>gst_props_load_thyself</NAME>
<RETURNS>GstProps *</RETURNS>
xmlNodePtr parent
</FUNCTION>
<STRUCT>
<NAME>GstPropsEntry</NAME>
</STRUCT>
<STRUCT>
<NAME>GstPropsEntry</NAME>
struct GstPropsEntry {
GQuark propid;
GstPropsId propstype;
union {
/* flat values */
gboolean bool_data;
guint32 fourcc_data;
gint int_data;
/* structured values */
struct {
GList *entries;
} list_data;
struct {
gint min;
gint max;
} int_range_data;
} data;
};
</STRUCT>
<MACRO>
<NAME>GST_TYPE_ASYNCDISKSRC</NAME>
#define GST_TYPE_ASYNCDISKSRC \
(gst_asyncdisksrc_get_type())
@ -2245,7 +2519,7 @@ GstElementFactory *factory
<MACRO>
<NAME>GST_IS_AUDIOSRC_CLASS</NAME>
#define GST_IS_AUDIOSRC_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIOSRC)))
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIOSRC))
</MACRO>
<ENUM>
<NAME>GstAudioSrcFlags</NAME>
@ -2377,7 +2651,7 @@ void
<MACRO>
<NAME>GST_IS_ESDSINK_CLASS</NAME>
#define GST_IS_ESDSINK_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_ESDSINK)))
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_ESDSINK))
</MACRO>
<STRUCT>
<NAME>GstEsdSink</NAME>
@ -2428,7 +2702,7 @@ void
<MACRO>
<NAME>GST_IS_FAKESINK_CLASS</NAME>
#define GST_IS_FAKESINK_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_FAKESINK)))
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_FAKESINK))
</MACRO>
<STRUCT>
<NAME>GstFakeSink</NAME>
@ -2472,7 +2746,7 @@ void
<MACRO>
<NAME>GST_IS_FAKESRC_CLASS</NAME>
#define GST_IS_FAKESRC_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_FAKESRC)))
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_FAKESRC))
</MACRO>
<STRUCT>
<NAME>GstFakeSrc</NAME>
@ -2516,7 +2790,7 @@ void
<MACRO>
<NAME>GST_IS_FDSINK_CLASS</NAME>
#define GST_IS_FDSINK_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_FDSINK)))
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_FDSINK))
</MACRO>
<STRUCT>
<NAME>GstFdSink</NAME>
@ -2562,7 +2836,7 @@ void
<MACRO>
<NAME>GST_IS_FDSRC_CLASS</NAME>
#define GST_IS_FDSRC_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_FDSRC)))
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_FDSRC))
</MACRO>
<STRUCT>
<NAME>GstFdSrc</NAME>
@ -2614,7 +2888,7 @@ void
<MACRO>
<NAME>GST_IS_HTTPSRC_CLASS</NAME>
#define GST_IS_HTTPSRC_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_HTTPSRC)))
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_HTTPSRC))
</MACRO>
<ENUM>
<NAME>GstHttpSrcFlags</NAME>
@ -2671,7 +2945,7 @@ void
<MACRO>
<NAME>GST_IS_IDENTITY_CLASS</NAME>
#define GST_IS_IDENTITY_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_IDENTITY)))
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_IDENTITY))
</MACRO>
<STRUCT>
<NAME>GstIdentity</NAME>
@ -2777,7 +3051,7 @@ void
<MACRO>
<NAME>GST_IS_SINESRC_CLASS</NAME>
#define GST_IS_SINESRC_CLASS(obj) \
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_SINESRC)))
(GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_SINESRC))
</MACRO>
<STRUCT>
<NAME>GstSineSrc</NAME>

View file

@ -30,6 +30,12 @@ gst_init
gst_main
gst_main_quit
DEBUG
GST_DEBUG_ENABLED
DEBUG_SET_STRING
DEBUG_ENTER_STRING
DEBUG_ENTER
DEBUG_LEAVE_STRING
DEBUG_LEAVE
<SUBSECTION Standard>
SETUP_STACK
</SECTION>

View file

@ -31,11 +31,3 @@ elements. A connection is typically a bas class for queues.
@Returns:
<!-- ##### FUNCTION gst_connection_push ##### -->
<para>
</para>
@connection:

View file

@ -143,6 +143,8 @@ may have.
@GST_ELEMENT_MULTI_IN:
@GST_ELEMENT_THREAD_SUGGESTED:
@GST_ELEMENT_NO_SEEK:
@GST_ELEMENT_NEW_LOOPFUNC:
@GST_ELEMENT_COTHREAD_STOPPING:
<!-- ##### MACRO GST_ELEMENT_IS_MULTI_IN ##### -->
<para>
@ -174,7 +176,7 @@ describes the element, mostly for the benefit of editors.
</para>
@longname:
@class:
@klass:
@description:
@version:
@author:
@ -190,8 +192,7 @@ GstElementDetails struct for the element.
@name:
@type:
@details:
@src_types:
@sink_types:
@padfactories:
<!-- ##### USER_FUNCTION GstElementLoopFunction ##### -->
<para>
@ -379,24 +380,6 @@ circumstances.
@elementfactory:
<!-- ##### FUNCTION gst_elementfactory_add_sink ##### -->
<para>
</para>
@elementfactory:
@id:
<!-- ##### FUNCTION gst_elementfactory_add_src ##### -->
<para>
</para>
@elementfactory:
@id:
<!-- ##### FUNCTION gst_elementfactory_find ##### -->
<para>

View file

@ -137,24 +137,6 @@ the function that will be called when a QoS message is sent.
@pull:
<!-- ##### FUNCTION gst_pad_get_type_id ##### -->
<para>
</para>
@pad:
@Returns:
<!-- ##### FUNCTION gst_pad_set_type_id ##### -->
<para>
</para>
@pad:
@id:
<!-- ##### FUNCTION gst_pad_set_name ##### -->
<para>
@ -312,3 +294,8 @@ the function that will be called when a QoS message is sent.
@elements:
<!-- ##### ARG GstPad:active ##### -->
<para>
</para>

View file

@ -17,6 +17,14 @@
</para>
<!-- ##### FUNCTION gst_type_add_sink ##### -->
<para>
</para>
@id:
@sink:
<!-- ##### FUNCTION gst_tee_get_type ##### -->
<para>
@ -171,13 +179,6 @@
@Returns:
<!-- ##### FUNCTION gst_object_get_type ##### -->
<para>
</para>
@Returns:
<!-- ##### MACRO GST_SINESRC ##### -->
<para>
@ -185,19 +186,19 @@
@obj:
<!-- ##### SECTION ./tmpl/plugin.sgml:Long_Description ##### -->
<para>
</para>
<!-- ##### FUNCTION gst_audiosrc_get_type ##### -->
<!-- ##### FUNCTION gst_object_get_type ##### -->
<para>
</para>
@Returns:
<!-- ##### SECTION ./tmpl/plugin.sgml:Long_Description ##### -->
<para>
</para>
<!-- ##### MACRO GST_QUEUE_CLASS ##### -->
<para>
@ -205,6 +206,13 @@
@klass:
<!-- ##### FUNCTION gst_audiosrc_get_type ##### -->
<para>
</para>
@Returns:
<!-- ##### MACRO GST_IS_QUEUE ##### -->
<para>
@ -329,6 +337,14 @@
@pad:
@buf:
<!-- ##### FUNCTION gst_type_add_src ##### -->
<para>
</para>
@id:
@src:
<!-- ##### FUNCTION gst_esdsink_get_type ##### -->
<para>
@ -356,12 +372,6 @@
</para>
<!-- ##### STRUCT GstFakeSink ##### -->
<para>
</para>
<!-- ##### MACRO GST_THREAD_CLASS ##### -->
<para>
@ -369,6 +379,12 @@
@klass:
<!-- ##### STRUCT GstFakeSink ##### -->
<para>
</para>
<!-- ##### MACRO GST_BIN_CLASS ##### -->
<para>
@ -403,16 +419,16 @@
@obj:
<!-- ##### SECTION ./tmpl/gstcolorspace.sgml:Title ##### -->
GstColorSpace
<!-- ##### STRUCT GstEsdSink ##### -->
<para>
</para>
<!-- ##### SECTION ./tmpl/gstcolorspace.sgml:Title ##### -->
GstColorSpace
<!-- ##### MACRO GST_PAD ##### -->
<para>
@ -471,6 +487,13 @@ GstColorSpace
@obj:
<!-- ##### FUNCTION gst_src_push ##### -->
<para>
</para>
@src:
<!-- ##### STRUCT GstThreadClass ##### -->
<para>
@ -502,6 +525,15 @@ GstGetbits
@obj:
<!-- ##### FUNCTION gst_src_push_region ##### -->
<para>
</para>
@src:
@offset:
@size:
<!-- ##### MACRO GST_SINESRC_CLASS ##### -->
<para>
@ -703,14 +735,14 @@ This macro unsets the given state on the element.
<!-- ##### MACRO GST_ASYNCDISKSRC_CLASS ##### -->
<!-- ##### MACRO GST_ESDSINK_CLASS ##### -->
<para>
</para>
@klass:
<!-- ##### MACRO GST_ESDSINK_CLASS ##### -->
<!-- ##### MACRO GST_ASYNCDISKSRC_CLASS ##### -->
<para>
</para>
@ -938,6 +970,14 @@ A flag indicating that SSE instructions are supported.
</para>
<!-- ##### FUNCTION gst_pad_set_type_id ##### -->
<para>
</para>
@pad:
@id:
<!-- ##### STRUCT GstAudioSrcClass ##### -->
<para>
@ -1104,6 +1144,13 @@ This macro checks to see if the given state is set.
@Returns:
<!-- ##### FUNCTION gst_connection_push ##### -->
<para>
</para>
@connection:
<!-- ##### MACRO GST_TYPE_CONNECTION ##### -->
<para>
@ -1276,6 +1323,14 @@ Get the size of the current file.
@obj:
<!-- ##### FUNCTION gst_elementfactory_add_sink ##### -->
<para>
</para>
@elementfactory:
@id:
<!-- ##### FUNCTION gst_fakesrc_get_type ##### -->
<para>
@ -1283,6 +1338,14 @@ Get the size of the current file.
@Returns:
<!-- ##### FUNCTION gst_pad_get_type_id ##### -->
<para>
</para>
@pad:
@Returns:
<!-- ##### FUNCTION gst_queue_chain ##### -->
<para>
@ -1366,13 +1429,6 @@ Get the size of the current file.
</para>
<!-- ##### MACRO GST_META ##### -->
<para>
</para>
@meta:
<!-- ##### FUNCTION gst_audiosink_get_type ##### -->
<para>
@ -1380,6 +1436,13 @@ Get the size of the current file.
@Returns:
<!-- ##### MACRO GST_META ##### -->
<para>
</para>
@meta:
<!-- ##### FUNCTION gst_httpsrc_get_type ##### -->
<para>
@ -1421,6 +1484,12 @@ Get the size of the current file.
</para>
<!-- ##### MACRO GST_TYPE_FILTER ##### -->
<para>
</para>
<!-- ##### MACRO GST_IS_SINESRC_CLASS ##### -->
<para>
@ -1428,12 +1497,6 @@ Get the size of the current file.
@obj:
<!-- ##### MACRO GST_TYPE_FILTER ##### -->
<para>
</para>
<!-- ##### MACRO GST_IS_AUDIOSRC_CLASS ##### -->
<para>
@ -1511,6 +1574,10 @@ GstElement
@obj:
<!-- ##### SECTION ./tmpl/plugin.sgml:Short_Description ##### -->
<!-- ##### FUNCTION gst_audiosrc_push ##### -->
<para>
@ -1518,10 +1585,6 @@ GstElement
@src:
<!-- ##### SECTION ./tmpl/plugin.sgml:Short_Description ##### -->
<!-- ##### MACRO GST_HTTPSRC_CLASS ##### -->
<para>
@ -1572,6 +1635,14 @@ GstElement
@fd:
@Returns:
<!-- ##### FUNCTION gst_elementfactory_add_src ##### -->
<para>
</para>
@elementfactory:
@id:
<!-- ##### MACRO GST_BUFFER_POOL ##### -->
<para>
@ -1637,15 +1708,15 @@ GstElement
@name:
@Returns:
<!-- ##### MACRO GST_CPU_FLAG_MMX ##### -->
<para>
A flag indicating that MMX instructions are supported.
</para>
<!-- ##### MACRO GST_TYPE_ESDSINK ##### -->
<para>
</para>
<!-- ##### MACRO GST_CPU_FLAG_MMX ##### -->
<para>
A flag indicating that MMX instructions are supported.
</para>

View file

@ -84,24 +84,6 @@ This macro usets the given flags.
@src:
<!-- ##### FUNCTION gst_src_push ##### -->
<para>
</para>
@src:
<!-- ##### FUNCTION gst_src_push_region ##### -->
<para>
</para>
@src:
@offset:
@size:
<!-- ##### SIGNAL GstSrc::eos ##### -->
<para>
An eos signal is triggered whenever the GstSrc has reached the end of

View file

@ -71,7 +71,7 @@ A type
@id:
@mime:
@exts:
@typefindfunc:
@typefindfuncs:
@srcs:
@sinks:
@converters:
@ -112,24 +112,6 @@ The struct with the typefactory information
@Returns:
<!-- ##### FUNCTION gst_type_add_src ##### -->
<para>
</para>
@id:
@src:
<!-- ##### FUNCTION gst_type_add_sink ##### -->
<para>
</para>
@id:
@sink:
<!-- ##### FUNCTION gst_type_get_srcs ##### -->
<para>

View file

@ -67,7 +67,10 @@ enum {
/* FILL ME */
};
static GstCapsFactory audiosink_sink_caps = {
static GstPadFactory audiosink_sink_factory = {
"sink",
GST_PAD_FACTORY_SINK,
GST_PAD_FACTORY_ALWAYS,
"audio/raw",
"format", GST_PROPS_INT (AFMT_S16_LE),
"depth", GST_PROPS_LIST (
@ -115,7 +118,7 @@ gst_audiosink_channels_get_type(void) {
static GstSinkClass *parent_class = NULL;
static guint gst_audiosink_signals[LAST_SIGNAL] = { 0 };
static GstCaps *gst_audiosink_sink_caps = NULL;
static GstPadTemplate *gst_audiosink_sink_template;
GtkType
gst_audiosink_get_type (void)
@ -176,9 +179,8 @@ gst_audiosink_class_init (GstAudioSinkClass *klass)
static void
gst_audiosink_init (GstAudioSink *audiosink)
{
audiosink->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
audiosink->sinkpad = gst_pad_new_from_template (gst_audiosink_sink_template, "sink");
gst_element_add_pad (GST_ELEMENT (audiosink), audiosink->sinkpad);
gst_pad_set_caps (audiosink->sinkpad, gst_audiosink_sink_caps);
gst_pad_set_chain_function (audiosink->sinkpad, gst_audiosink_chain);
@ -410,7 +412,8 @@ gst_audiosink_change_state (GstElement *element)
gboolean
gst_audiosink_factory_init (GstElementFactory *factory)
{
gst_audiosink_sink_caps = gst_caps_register (audiosink_sink_caps);
gst_audiosink_sink_template = gst_padtemplate_new (&audiosink_sink_factory);
gst_elementfactory_add_padtemplate (factory, gst_audiosink_sink_template);
return TRUE;
}

View file

@ -122,7 +122,7 @@ static void gst_httpsrc_init(GstHttpSrc *httpsrc) {
httpsrc->bytes_per_read = 4096;
}
static void gst_httpsrc_push(GstPad *pad) {
static void gst_httpsrc_pull(GstPad *pad) {
GstHttpSrc *src;
GstBuffer *buf;
glong readbytes;

View file

@ -45,6 +45,27 @@ get_type_for_mime (gchar *mime)
return typeid;
}
/**
* gst_caps_new:
* @mime: the mime type to attach to the capability
*
* create a new capability with the given mime type
*
* Returns: a new capability
*/
GstCaps*
gst_caps_new (gchar *mime)
{
GstCaps *caps;
g_return_val_if_fail (mime != NULL, NULL);
caps = g_new0 (GstCaps, 1);
caps->id = get_type_for_mime (mime);
return caps;
}
/**
* gst_caps_register:
* @factory: the factory to register
@ -53,7 +74,7 @@ get_type_for_mime (gchar *mime)
*
* Returns: The registered capability
*/
GstCaps *
GstCaps*
gst_caps_register (GstCapsFactory *factory)
{
GstCapsFactoryEntry tag;

View file

@ -43,6 +43,7 @@ struct _GstCaps {
/* initialize the subsystem */
void _gst_caps_initialize (void);
GstCaps* gst_caps_new (gchar *mime);
GstCaps* gst_caps_register (GstCapsFactory *factory);
gboolean gst_caps_check_compatibility (GstCaps *caps1, GstCaps *caps2);

View file

@ -153,7 +153,7 @@ struct _GstElementFactory {
GstElementDetails *details; /* pointer to details struct */
GList *padfactories;
GList *padtemplates;
};
GtkType gst_element_get_type (void);
@ -196,8 +196,8 @@ GstElementFactory* gst_elementfactory_new (gchar *name,GtkType type,
void gst_elementfactory_register (GstElementFactory *elementfactory);
void gst_elementfactory_unregister (GstElementFactory *elementfactory);
void gst_elementfactory_add_pad (GstElementFactory *elementfactory,
GstPadFactory *pad);
void gst_elementfactory_add_padtemplate (GstElementFactory *elementfactory,
GstPadTemplate *pad);
GstElementFactory* gst_elementfactory_find (gchar *name);
GList* gst_elementfactory_get_list (void);

View file

@ -58,15 +58,15 @@ gst_elementfactory_register (GstElementFactory *elementfactory)
void
gst_elementfactory_unregister (GstElementFactory *factory)
{
GList *padfactories;
GList *padtemplates;
g_return_if_fail (factory != NULL);
padfactories = factory->padfactories;
padtemplates = factory->padtemplates;
while (padfactories) {
GstPadFactory *padfactory = (GstPadFactory *)padfactories->data;
GstCaps *caps = gst_padfactory_get_caps (padfactory);
while (padtemplates) {
GstPadTemplate *padfactory = (GstPadTemplate *)padtemplates->data;
GstCaps *caps = padfactory->caps;
if (caps) {
switch (padfactory->direction) {
@ -80,7 +80,7 @@ gst_elementfactory_unregister (GstElementFactory *factory)
break;
}
}
padfactories = g_list_next (padfactories);
padtemplates = g_list_next (padtemplates);
}
_gst_elementfactories = g_list_remove (_gst_elementfactories, factory);
@ -148,7 +148,7 @@ gst_elementfactory_new (gchar *name, GtkType type,
factory->name = g_strdup(name);
factory->type = type;
factory->details = details;
factory->padfactories = NULL;
factory->padtemplates = NULL;
return factory;
}
@ -224,28 +224,27 @@ gst_elementfactory_make (gchar *factoryname, gchar *name)
}
/**
* gst_elementfactory_add_pad :
* gst_elementfactory_add_padtemplate :
* @elementfactory: factory to add the src id to
* @pad: the padfactory to add
* @template: the padtemplate to add
*
* Add the given padfactory to this element.
*
* Add the given padtemplate to this elementfactory.
*/
void
gst_elementfactory_add_pad (GstElementFactory *factory,
GstPadFactory *padfactory)
gst_elementfactory_add_padtemplate (GstElementFactory *factory,
GstPadTemplate *template)
{
GstCaps *caps;
g_return_if_fail(factory != NULL);
g_return_if_fail(padfactory != NULL);
g_return_if_fail(template != NULL);
factory->padfactories = g_list_append (factory->padfactories, padfactory);
factory->padtemplates = g_list_append (factory->padtemplates, template);
caps = gst_padfactory_get_caps (padfactory);
caps = template->caps;
if (caps) {
switch (padfactory->direction) {
switch (template->direction) {
case GST_PAD_SRC:
_gst_type_add_src (caps->id, factory);
break;
@ -282,14 +281,14 @@ gst_elementfactory_save_thyself (GstElementFactory *factory,
xmlNewChild(parent,NULL,"author", factory->details->author);
xmlNewChild(parent,NULL,"copyright", factory->details->copyright);
pads = factory->padfactories;
pads = factory->padtemplates;
if (pads) {
while (pads) {
xmlNodePtr subtree;
GstPadFactory *padfactory = (GstPadFactory *)pads->data;
GstPadTemplate *padtemplate = (GstPadTemplate *)pads->data;
subtree = xmlNewChild(parent, NULL, "padfactory", NULL);
gst_padfactory_save_thyself(padfactory, subtree);
subtree = xmlNewChild(parent, NULL, "padtemplate", NULL);
gst_padtemplate_save_thyself(padtemplate, subtree);
pads = g_list_next (pads);
}
@ -311,7 +310,7 @@ gst_elementfactory_load_thyself (xmlNodePtr parent)
GstElementFactory *factory = g_new0(GstElementFactory, 1);
xmlNodePtr children = parent->childs;
factory->details = g_new0(GstElementDetails, 1);
factory->padfactories = NULL;
factory->padtemplates = NULL;
while (children) {
if (!strcmp(children->name, "name")) {
@ -335,12 +334,12 @@ gst_elementfactory_load_thyself (xmlNodePtr parent)
if (!strcmp(children->name, "copyright")) {
factory->details->copyright = g_strdup(xmlNodeGetContent(children));
}
if (!strcmp(children->name, "padfactory")) {
GstPadFactory *padfactory;
if (!strcmp(children->name, "padtemplate")) {
GstPadTemplate *template;
padfactory = gst_padfactory_load_thyself (children);
template = gst_padtemplate_load_thyself (children);
gst_elementfactory_add_pad (factory, padfactory);
gst_elementfactory_add_padtemplate (factory, template);
}
children = children->next;

View file

@ -175,6 +175,31 @@ gst_pad_new (gchar *name,
pad = GST_PAD (gtk_type_new (gst_pad_get_type ()));
pad->name = g_strdup (name);
pad->direction = direction;
return pad;
}
/**
* gst_pad_new_from_template:
* @temp: the pad template to use
* @name: the name of the element
*
* Create a new pad with given name from the given template.
*
* Returns: new pad
*/
GstPad*
gst_pad_new_from_template (GstPadTemplate *temp,
gchar *name)
{
GstPad *pad;
g_return_val_if_fail (name != NULL, NULL);
g_return_val_if_fail (temp != NULL, NULL);
pad = gst_pad_new (name, temp->direction);
pad->caps = temp->caps;
return pad;
}
@ -848,73 +873,65 @@ gst_pad_ghost_save_thyself (GstPad *pad,
return self;
}
/**
* gst_padfactory_create:
* @factory: the pad factory
* @name: the name of the new pad
*
* crrates a new pad form the given factory
*
* Returns: the new pad;
*/
GstPad*
gst_padfactory_create (GstPadFactory *factory,
gchar *name)
GstPadTemplate*
gst_padtemplate_new (GstPadFactory *factory)
{
GstPad *newpad;
GstCaps *caps;
GstPadTemplate *new;
GstPadFactoryEntry tag;
gint i = 0;
newpad = gst_pad_new (name, factory->direction);
g_return_val_if_fail (factory != NULL, NULL);
caps = gst_padfactory_get_caps (factory);
new = g_new0 (GstPadTemplate, 1);
gst_pad_set_caps (newpad, caps);
tag = (*factory)[i++];
g_return_val_if_fail (tag != NULL, new);
new->name_template = g_strdup ((gchar *)tag);
return newpad;
tag = (*factory)[i++];
new->direction = GPOINTER_TO_UINT (tag);
tag = (*factory)[i++];
new->presence = GPOINTER_TO_UINT (tag);
new->caps = gst_caps_register ((GstCapsFactory *)&(*factory)[i]);
return new;
}
GstCaps*
gst_padfactory_get_caps (GstPadFactory *factory)
GstPadTemplate*
gst_padtemplate_create (gchar *name_template,
GstPadDirection direction, GstPadPresence presence,
GstCaps *caps, ...)
{
if (factory->priv) {
return (GstCaps *) factory->priv;
}
else if (factory->caps) {
GstCaps *caps;
caps = gst_caps_register (factory->caps);
factory->priv = caps;
return caps;
}
else return NULL;
return NULL;
}
xmlNodePtr
gst_padfactory_save_thyself (GstPadFactory *pad, xmlNodePtr parent)
gst_padtemplate_save_thyself (GstPadTemplate *pad, xmlNodePtr parent)
{
xmlNodePtr subtree;
xmlNewChild(parent,NULL,"nametemplate", pad->nametemplate);
xmlNewChild(parent,NULL,"nametemplate", pad->name_template);
xmlNewChild(parent,NULL,"direction", (pad->direction == GST_PAD_SINK? "sink":"src"));
xmlNewChild(parent,NULL,"presence", (pad->presence == GST_PAD_ALWAYS? "always":"sometimes"));
subtree = xmlNewChild(parent,NULL,"caps", NULL);
gst_caps_save_thyself (gst_padfactory_get_caps (pad), subtree);
gst_caps_save_thyself (pad->caps, subtree);
return parent;
}
GstPadFactory*
gst_padfactory_load_thyself (xmlNodePtr parent)
GstPadTemplate*
gst_padtemplate_load_thyself (xmlNodePtr parent)
{
xmlNodePtr field = parent->childs;
GstPadFactory *factory = g_new0 (GstPadFactory, 1);
GstPadTemplate *factory = g_new0 (GstPadTemplate, 1);
while (field) {
if (!strcmp(field->name, "nametemplate")) {
factory->nametemplate = g_strdup(xmlNodeGetContent(field));
factory->name_template = g_strdup(xmlNodeGetContent(field));
}
if (!strcmp(field->name, "direction")) {
gchar *value = xmlNodeGetContent(field);
@ -938,7 +955,7 @@ gst_padfactory_load_thyself (xmlNodePtr parent)
}
}
else if (!strcmp(field->name, "caps")) {
factory->priv = gst_caps_load_thyself (field);
factory->caps = gst_caps_load_thyself (field);
}
field = field->next;
}

View file

@ -103,22 +103,30 @@ typedef enum {
GST_PAD_SOMETIMES,
} GstPadPresence;
typedef struct _GstPadFactory GstPadFactory;
typedef struct _GstPadTemplate GstPadTemplate;
/* factory */
struct _GstPadFactory {
gchar *nametemplate;
GstCapsFactory *caps;
/* template */
struct _GstPadTemplate {
gchar *name_template;
GstPadDirection direction;
GstPadPresence presence;
gpointer priv;
GstCaps *caps;
};
/* factory */
typedef gpointer GstPadFactoryEntry;
typedef GstPadFactoryEntry GstPadFactory[];
#define GST_PAD_FACTORY_ALWAYS GINT_TO_POINTER(GST_PAD_ALWAYS)
#define GST_PAD_FACTORY_SOMETIMES GINT_TO_POINTER(GST_PAD_SOMETIMES)
#define GST_PAD_FACTORY_SRC GINT_TO_POINTER(GST_PAD_SRC)
#define GST_PAD_FACTORY_SINK GINT_TO_POINTER(GST_PAD_SINK)
GtkType gst_pad_get_type (void);
GstPad* gst_pad_new (gchar *name, GstPadDirection direction);
#define gst_pad_destroy(pad) gst_object_destroy (GST_OBJECT (pad))
GstPad* gst_pad_new_from_template (GstPadTemplate *temp, gchar *name);
GstPadDirection gst_pad_get_direction (GstPad *pad);
@ -154,12 +162,13 @@ void gst_pad_load_and_connect (xmlNodePtr parent, GstObject *element, GHashTa
/* factory */
GstPad* gst_padfactory_create (GstPadFactory *factory, gchar *name);
GstPadTemplate* gst_padtemplate_new (GstPadFactory *factory);
GstPadTemplate* gst_padtemplate_create (gchar *name_template,
GstPadDirection direction, GstPadPresence presence,
GstCaps *caps, ...);
GstCaps* gst_padfactory_get_caps (GstPadFactory *factory);
xmlNodePtr gst_padfactory_save_thyself (GstPadFactory *pad, xmlNodePtr parent);
GstPadFactory* gst_padfactory_load_thyself (xmlNodePtr parent);
xmlNodePtr gst_padtemplate_save_thyself (GstPadTemplate *pad, xmlNodePtr parent);
GstPadTemplate* gst_padtemplate_load_thyself (xmlNodePtr parent);
#ifdef __cplusplus
}

View file

@ -266,28 +266,26 @@ gst_type_handle_src (guint16 id, GstElementFactory *src, gboolean remove)
g_return_if_fail (type != NULL);
g_return_if_fail (src != NULL);
g_print ("gsttype: handle src \"%s\" %d\n", src->name, remove);
if (remove)
type->srcs = g_list_remove (type->srcs, src);
else
type->srcs = g_list_prepend (type->srcs, src);
// find out if the element has to be indexed in the matrix
walk = src->padfactories;
walk = src->padtemplates;
while (walk) {
GstPadFactory *factory;
GstPadTemplate *template;
factory = (GstPadFactory *) walk->data;
template = (GstPadTemplate *) walk->data;
if (factory->direction == GST_PAD_SINK) {
if (template->direction == GST_PAD_SINK) {
GstType *type2;
GList *converters;
GList *orig;
GstCaps *caps;
caps = gst_padfactory_get_caps (factory);
caps = template->caps;
if (caps)
type2 = gst_type_find_by_id (caps->id);
@ -353,28 +351,26 @@ gst_type_handle_sink (guint16 id, GstElementFactory *sink, gboolean remove)
g_return_if_fail (type != NULL);
g_return_if_fail (sink != NULL);
g_print ("gsttype: handle sink \"%s\" %d\n", sink->name, remove);
if (remove)
type->sinks = g_list_remove (type->sinks, sink);
else
type->sinks = g_list_prepend (type->sinks, sink);
// find out if the element has to be indexed in the matrix
walk = sink->padfactories;
walk = sink->padtemplates;
while (walk) {
GstPadFactory *factory;
GstPadTemplate *template;
factory = (GstPadFactory *) walk->data;
template = (GstPadTemplate *) walk->data;
if (factory->direction == GST_PAD_SRC) {
if (template->direction == GST_PAD_SRC) {
guint16 id2;
GList *converters;
GList *orig;
GstCaps *caps;
caps = gst_padfactory_get_caps (factory);
caps = template->caps;
if (caps)
id2 = caps->id;

View file

@ -67,7 +67,10 @@ enum {
/* FILL ME */
};
static GstCapsFactory audiosink_sink_caps = {
static GstPadFactory audiosink_sink_factory = {
"sink",
GST_PAD_FACTORY_SINK,
GST_PAD_FACTORY_ALWAYS,
"audio/raw",
"format", GST_PROPS_INT (AFMT_S16_LE),
"depth", GST_PROPS_LIST (
@ -115,7 +118,7 @@ gst_audiosink_channels_get_type(void) {
static GstSinkClass *parent_class = NULL;
static guint gst_audiosink_signals[LAST_SIGNAL] = { 0 };
static GstCaps *gst_audiosink_sink_caps = NULL;
static GstPadTemplate *gst_audiosink_sink_template;
GtkType
gst_audiosink_get_type (void)
@ -176,9 +179,8 @@ gst_audiosink_class_init (GstAudioSinkClass *klass)
static void
gst_audiosink_init (GstAudioSink *audiosink)
{
audiosink->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
audiosink->sinkpad = gst_pad_new_from_template (gst_audiosink_sink_template, "sink");
gst_element_add_pad (GST_ELEMENT (audiosink), audiosink->sinkpad);
gst_pad_set_caps (audiosink->sinkpad, gst_audiosink_sink_caps);
gst_pad_set_chain_function (audiosink->sinkpad, gst_audiosink_chain);
@ -410,7 +412,8 @@ gst_audiosink_change_state (GstElement *element)
gboolean
gst_audiosink_factory_init (GstElementFactory *factory)
{
gst_audiosink_sink_caps = gst_caps_register (audiosink_sink_caps);
gst_audiosink_sink_template = gst_padtemplate_new (&audiosink_sink_factory);
gst_elementfactory_add_padtemplate (factory, gst_audiosink_sink_template);
return TRUE;
}

View file

@ -122,7 +122,7 @@ static void gst_httpsrc_init(GstHttpSrc *httpsrc) {
httpsrc->bytes_per_read = 4096;
}
static void gst_httpsrc_push(GstPad *pad) {
static void gst_httpsrc_pull(GstPad *pad) {
GstHttpSrc *src;
GstBuffer *buf;
glong readbytes;