<!entity GstPad SYSTEM "sgml/gstpad.sgml">
<!entity GstPipeline SYSTEM "sgml/gstpipeline.sgml">
<!entity GstAutoplug SYSTEM "sgml/gstautoplug.sgml">
+<!entity GstParse SYSTEM "sgml/gstparse.sgml">
<!entity GstPlugin SYSTEM "sgml/gstplugin.sgml">
<!entity GstThread SYSTEM "sgml/gstthread.sgml">
<!entity GstTrace SYSTEM "sgml/gsttrace.sgml">
with some more specialized elements.</para>
&Gst;
- &GstInfo;
- &GstObject;
- &GstElement;
- &GstBin;
- &GstPipeline;
&GstAutoplug;
+ &GstBin;
&GstBuffer;
&GstBufferPool;
+ &GstCaps;
+ &GstCpu;
+ &GstElement;
+ &GstInfo;
+ &GstMeta;
+ &GstObject;
&GstPad;
+ &GstParse;
+ &GstPipeline;
&GstPlugin;
- &GstThread;
+ &GstProps;
&GstQueue;
- &GstTypeFind;
-
+ &GstThread;
+ &GstTrace;
&GstType;
- &GstCaps;
- &GstProps;
- &GstMeta;
+ &GstTypeFind;
&GstUtils;
- &GstCpu;
- &GstTrace;
&GstXml;
&cothreads;
GST_IS_BIN_CLASS
gst_bin_details
gst_bin_use_cothreads
-gst_bin_remove_eos_provider
-gst_bin_add_eos_provider
_GstBinChain
</SECTION>
GstElementFlags
GST_ELEMENT_IS_THREAD_SUGGESTED
GST_ELEMENT_IS_COTHREAD_STOPPING
+GST_ELEMENT_IS_EOS
GstElement
GstElementDetails
GstElementFactory
GST_IS_ELEMENT
GST_IS_ELEMENT_CLASS
gst_element_get_type
-gst_element_announce_eos
</SECTION>
<SECTION>
gst_pad_get_element_private
gst_pad_set_parent
gst_pad_get_parent
-gst_pad_add_ghost_parent
-gst_pad_remove_ghost_parent
-gst_pad_get_ghost_parents
+gst_pad_add_ghost_pad
+gst_pad_remove_ghost_pad
+gst_pad_get_ghost_pad_list
gst_pad_get_peer
gst_pad_connect
gst_pad_disconnect
gst_pad_pullregion
gst_pad_select
gst_pad_set_eos
-gst_pad_eos_func
gst_pad_handle_qos
gst_pad_eos
gst_pad_save_thyself
GST_GPAD_REALPAD
GstGhostPad
+gst_ghost_pad_new
GstPadFactoryEntry
GstPadFactory[]
<TITLE>GstXml</TITLE>
GstXML
gst_xml_new
+gst_xml_new_from_memory
gst_xml_write
gst_xml_get_element
gst_xml_get_topelements
</para>
@bin:
+@Returns:
<!-- ##### FUNCTION gst_bin_create_plan ##### -->
@GST_ELEMENT_NEW_LOOPFUNC:
@GST_ELEMENT_COTHREAD_STOPPING:
@GST_ELEMENT_USE_COTHREAD:
+@GST_ELEMENT_EOS:
@GST_ELEMENT_FLAG_LAST:
<!-- ##### MACRO GST_ELEMENT_IS_THREAD_SUGGESTED ##### -->
@obj: The element to query
+<!-- ##### MACRO GST_ELEMENT_IS_EOS ##### -->
+<para>
+
+</para>
+
+@obj:
+
+
<!-- ##### STRUCT GstElement ##### -->
<para>
@element:
@pad:
+@name:
<!-- ##### FUNCTION gst_element_remove_ghost_pad ##### -->
<!-- ##### SECTION Title ##### -->
-gstinfo
+GstInfo
<!-- ##### SECTION Short_Description ##### -->
info/debugging/error handling
@Returns:
-<!-- ##### FUNCTION gst_pad_add_ghost_parent ##### -->
+<!-- ##### FUNCTION gst_pad_add_ghost_pad ##### -->
<para>
</para>
@pad:
-@parent:
+@ghostpad:
-<!-- ##### FUNCTION gst_pad_remove_ghost_parent ##### -->
+<!-- ##### FUNCTION gst_pad_remove_ghost_pad ##### -->
<para>
</para>
@pad:
-@parent:
+@ghostpad:
-<!-- ##### FUNCTION gst_pad_get_ghost_parents ##### -->
+<!-- ##### FUNCTION gst_pad_get_ghost_pad_list ##### -->
<para>
</para>
@Returns:
-<!-- ##### FUNCTION gst_pad_eos_func ##### -->
-<para>
-
-</para>
-
-@pad:
-@Returns:
-
-
<!-- ##### FUNCTION gst_pad_handle_qos ##### -->
<para>
<!-- ##### MACRO gst_pad_eos ##### -->
<para>
-
+Call the EOS function of the pad
</para>
-@pad:
+@pad: the pad to call the eos function of.
<!-- ##### FUNCTION gst_pad_save_thyself ##### -->
@pushfunc:
@pullfunc:
@pullregionfunc:
-@ghostparents:
+@ghostpads:
<!-- ##### MACRO GST_RPAD_DIRECTION ##### -->
<para>
@pad:
@realpad:
+<!-- ##### FUNCTION gst_ghost_pad_new ##### -->
+<para>
+
+</para>
+
+@name:
+@pad:
+@Returns:
+
+
<!-- ##### TYPEDEF GstPadFactoryEntry ##### -->
<para>
Defines an entry for a padfactory.
GstParse
<!-- ##### SECTION Short_Description ##### -->
-
+Parses commandline syntax into a pipeline.
<!-- ##### SECTION Long_Description ##### -->
<para>
-
+This method allows you to create a pipeline from a command
+line syntax description.
</para>
<!-- ##### SECTION See_Also ##### -->
GstQueue
<!-- ##### SECTION Short_Description ##### -->
-Simple data queue. (queue)
+Simple asynchronous data queue.
<!-- ##### SECTION Long_Description ##### -->
<para>
Simple data queue. Data is queued till max_level buffers any subsequent buffers
sent to this filter will block until free space becomes available in the buffer.
+The queue is typically used in conjunction with a thread.
</para>
<para>
You can query how many buffers are queued with the level argument.
<para>
The default queue length is set to 10.
</para>
+<para>
+The queue blocks by default.
+</para>
<!-- ##### SECTION See_Also ##### -->
<para>
<!-- ##### ARG GstQueue:block ##### -->
<para>
-
-</para>
-
-<!-- ##### ARG GstQueue:timeout ##### -->
-<para>
-
+Specify wether the queue blocks or not.
</para>
</para>
+<!-- ##### ARG GstQueue:timeout ##### -->
+<para>
+
+</para>
+
+
<!-- ##### FUNCTION gst_fakesrc_new ##### -->
<para>
@klass:
+<!-- ##### FUNCTION gst_pad_add_ghost_parent ##### -->
+<para>
+
+</para>
+
+@pad:
+@parent:
+
<!-- ##### MACRO GST_SINK_CLASS ##### -->
<para>
</para>
+<!-- ##### FUNCTION gst_pad_get_ghost_parents ##### -->
+<para>
+
+</para>
+
+@pad:
+@Returns:
+
<!-- ##### STRUCT GstAudioSrc ##### -->
<para>
@GST_PROPS_FOURCC_ID_NUM:
@GST_PROPS_BOOL_ID_NUM:
+<!-- ##### FUNCTION gst_pad_eos_func ##### -->
+<para>
+
+</para>
+
+@pad:
+@Returns:
+
<!-- ##### STRUCT GstEsdSinkClass ##### -->
<para>
</para>
+<!-- ##### FUNCTION gst_pad_remove_ghost_parent ##### -->
+<para>
+
+</para>
+
+@pad:
+@parent:
+
<!-- ##### SECTION ./tmpl/GstElement.sgml:Title ##### -->
GstElement
@Returns:
+<!-- ##### FUNCTION gst_xml_new_from_memory ##### -->
+<para>
+
+</para>
+
+@buffer:
+@size:
+@root:
+@Returns:
+
+
<!-- ##### FUNCTION gst_xml_write ##### -->
<para>
static void gst_autoplug_class_init (GstAutoplugClass *klass);
static void gst_autoplug_init (GstAutoplug *autoplug);
-static GList* gst_autoplug_func (gpointer src, gpointer sink,
- GstAutoplugListFunction list_function,
- GstAutoplugCostFunction cost_function,
+static GList* gst_autoplug_func (gpointer src, gpointer sink,
+ GstAutoplugListFunction list_function,
+ GstAutoplugCostFunction cost_function,
gpointer data);
struct _gst_autoplug_node
static void gst_autoplug_init(GstAutoplug *autoplug) {
}
-static gboolean
-gst_autoplug_can_match (GstElementFactory *src, GstElementFactory *dest)
+static gboolean
+gst_autoplug_can_match (GstElementFactory *src, GstElementFactory *dest)
{
GList *srctemps, *desttemps;
GST_INFO (GST_CAT_AUTOPLUG_ATTEMPT,"factory \"%s\" cannot connect with factory \"%s\"", src->name, dest->name);
return FALSE;
}
-
+
static GList*
gst_autoplug_elementfactory_get_list (gpointer data)
{
#define IS_CAPS(cap) (((cap) == caps->src) || (cap) == caps->sink)
-static guint
-gst_autoplug_caps_find_cost (gpointer src, gpointer dest, gpointer data)
+static guint
+gst_autoplug_caps_find_cost (gpointer src, gpointer dest, gpointer data)
{
caps_struct *caps = (caps_struct *)data;
gboolean res;
res = gst_autoplug_can_match ((GstElementFactory *)src, (GstElementFactory *)dest);
}
- if (res)
+ if (res)
return 1;
- else
+ else
return GST_AUTOPLUG_MAX_COST;
}
* the two caps
*/
GList*
-gst_autoplug_caps (GstCaps *srccaps, GstCaps *sinkcaps)
+gst_autoplug_caps (GstCaps *srccaps, GstCaps *sinkcaps)
{
caps_struct caps;
GST_INFO (GST_CAT_AUTOPLUG_ATTEMPT,"autoplugging two caps structures");
- return gst_autoplug_func (caps.src, caps.sink,
- gst_autoplug_elementfactory_get_list,
+ return gst_autoplug_func (caps.src, caps.sink,
+ gst_autoplug_elementfactory_get_list,
gst_autoplug_caps_find_cost,
&caps);
}
* the two caps lists
*/
GList*
-gst_autoplug_caps_list (GList *srccaps, GList *sinkcaps)
+gst_autoplug_caps_list (GList *srccaps, GList *sinkcaps)
{
caps_struct caps;
GST_INFO (GST_CAT_AUTOPLUG_ATTEMPT,"autoplugging two caps list structures");
- return gst_autoplug_func (caps.src, caps.sink,
- gst_autoplug_elementfactory_get_list,
+ return gst_autoplug_func (caps.src, caps.sink,
+ gst_autoplug_elementfactory_get_list,
gst_autoplug_caps_find_cost,
&caps);
}
* the two pads
*/
GList*
-gst_autoplug_pads (GstPad *srcpad, GstPad *sinkpad)
+gst_autoplug_pads (GstPad *srcpad, GstPad *sinkpad)
{
caps_struct caps;
-// caps.src = srcpad->caps;
-// caps.sink = sinkpad->caps;
caps.src = gst_pad_get_caps_list(srcpad);
caps.sink = gst_pad_get_caps_list(sinkpad);
GST_INFO (GST_CAT_AUTOPLUG_ATTEMPT,"autoplugging two caps structures");
- return gst_autoplug_func (caps.src, caps.sink,
- gst_autoplug_elementfactory_get_list,
+ return gst_autoplug_func (caps.src, caps.sink,
+ gst_autoplug_elementfactory_get_list,
gst_autoplug_caps_find_cost,
&caps);
}
while (rgnNodes[i].iNode) {
if (rgnNodes[i].iNode == factory) return i;
- i++;
+ i++;
}
return 0;
}
{
GstElementFactory *current;
GList *factories = NULL;
-
+
current = rgnNodes[find_factory(rgnNodes, factory)].iPrev;
GST_INFO (GST_CAT_AUTOPLUG_ATTEMPT,"factories found in autoplugging (reversed order)");
while (current != NULL)
- {
+ {
gpointer next = NULL;
-
+
next = rgnNodes[find_factory(rgnNodes, current)].iPrev;
if (next) {
factories = g_list_prepend (factories, current);
}
static GList*
-gst_autoplug_enqueue (GList *queue, gpointer iNode, gint iDist, gpointer iPrev)
+gst_autoplug_enqueue (GList *queue, gpointer iNode, gint iDist, gpointer iPrev)
{
gst_autoplug_node *node = g_malloc (sizeof (gst_autoplug_node));
}
static GList*
-gst_autoplug_dequeue (GList *queue, gpointer *iNode, gint *iDist, gpointer *iPrev)
+gst_autoplug_dequeue (GList *queue, gpointer *iNode, gint *iDist, gpointer *iPrev)
{
GList *head;
gst_autoplug_node *node;
head = g_list_first (queue);
-
+
if (head) {
node = (gst_autoplug_node *)head->data;
*iNode = node->iNode;
}
static GList*
-gst_autoplug_func (gpointer src, gpointer sink,
+gst_autoplug_func (gpointer src, gpointer sink,
GstAutoplugListFunction list_function,
GstAutoplugCostFunction cost_function,
gpointer data)
GList *elements = g_list_copy (list_function(data));
GList *factories;
guint num_factories;
-
+
elements = g_list_append (elements, sink);
elements = g_list_append (elements, src);
-
+
factories = elements;
-
+
num_factories = g_list_length (factories);
rgnNodes = g_new0 (gst_autoplug_node, num_factories+1);
GList *factories2 = elements;
queue = gst_autoplug_dequeue (queue, &iNode, &iDist, &iPrev);
-
+
for (i=0; i< num_factories; i++) {
gpointer current = factories2->data;
-
+
iCost = cost_function (iNode, current, data);
if (iCost != GST_AUTOPLUG_MAX_COST) {
if((GST_AUTOPLUG_MAX_COST == rgnNodes[i].iDist) ||
* @bin: #Gstbin to iterate
*
* Iterates over the elements in this bin.
+ *
+ * Returns: TRUE if the bin did something usefull. This value
+ * can be used to determine it the bin is in EOS.
*/
gboolean
gst_bin_iterate (GstBin *bin)
/* the element has to be scheduled as a cothread for any sanity */
GST_ELEMENT_USE_COTHREAD,
- // if this element is in EOS
+ /* if this element is in EOS */
GST_ELEMENT_EOS,
/* use some padding for future expansion */
/***** Start with the base GstPad class *****/
-static void gst_pad_class_init (GstPadClass *klass);
-static void gst_pad_init (GstPad *pad);
+static void gst_pad_class_init (GstPadClass *klass);
+static void gst_pad_init (GstPad *pad);
static GstObject *pad_parent_class = NULL;
static void gst_real_pad_destroy (GtkObject *object);
static void gst_pad_push_func (GstPad *pad, GstBuffer *buf);
+static gboolean gst_pad_eos_func (GstPad *pad);
+
static GstPad *real_pad_parent_class = NULL;
static guint gst_real_pad_signals[REAL_LAST_SIGNAL] = { 0 };
}
static void
-gst_real_pad_class_init (GstRealPadClass *klass)
+gst_real_pad_class_init (GstRealPadClass *klass)
{
GtkObjectClass *gtkobject_class;
gtkobject_class->get_arg = gst_real_pad_get_arg;
}
-static void
-gst_real_pad_init (GstRealPad *pad)
+static void
+gst_real_pad_init (GstRealPad *pad)
{
pad->direction = GST_PAD_UNKNOWN;
pad->peer = NULL;
*/
GstPad*
gst_pad_new (gchar *name,
- GstPadDirection direction)
+ GstPadDirection direction)
{
GstRealPad *pad;
*/
GstPad*
gst_pad_new_from_template (GstPadTemplate *templ,
- gchar *name)
+ gchar *name)
{
GstPad *pad;
*
* Returns: the direction of the pad
*/
-GstPadDirection
-gst_pad_get_direction (GstPad *pad)
+GstPadDirection
+gst_pad_get_direction (GstPad *pad)
{
g_return_val_if_fail (pad != NULL, GST_PAD_UNKNOWN);
g_return_val_if_fail (GST_IS_PAD (pad), GST_PAD_UNKNOWN);
*
* Set the name of a pad.
*/
-void
-gst_pad_set_name (GstPad *pad,
- const gchar *name)
+void
+gst_pad_set_name (GstPad *pad,
+ const gchar *name)
{
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_PAD (pad));
* Returns: the name of the pad, don't free.
*/
const gchar*
-gst_pad_get_name (GstPad *pad)
+gst_pad_get_name (GstPad *pad)
{
g_return_val_if_fail (pad != NULL, NULL);
g_return_val_if_fail (GST_IS_PAD (pad), NULL);
* Set the given chain function for the pad.
*/
void gst_pad_set_chain_function (GstPad *pad,
- GstPadChainFunction chain)
+ GstPadChainFunction chain)
{
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_REAL_PAD (pad));
*
* Set the given get function for the pad.
*/
-void
+void
gst_pad_set_get_function (GstPad *pad,
- GstPadGetFunction get)
+ GstPadGetFunction get)
{
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_REAL_PAD (pad));
*
* Set the given getregion function for the pad.
*/
-void
+void
gst_pad_set_getregion_function (GstPad *pad,
- GstPadGetRegionFunction getregion)
+ GstPadGetRegionFunction getregion)
{
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_REAL_PAD (pad));
*
* Set the given qos function for the pad.
*/
-void
+void
gst_pad_set_qos_function (GstPad *pad,
- GstPadQoSFunction qos)
+ GstPadQoSFunction qos)
{
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_REAL_PAD (pad));
-
+
GST_RPAD_QOSFUNC(pad) = qos;
GST_DEBUG (0,"qosfunc for %s:%s(@%p) at %p is set to %p\n",
GST_DEBUG_PAD_NAME(pad),pad,&GST_RPAD_QOSFUNC(pad),qos);
*
* Set the given EOS function for the pad.
*/
-void
+void
gst_pad_set_eos_function (GstPad *pad,
- GstPadEOSFunction eos)
+ GstPadEOSFunction eos)
{
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_REAL_PAD (pad));
-
+
GST_RPAD_EOSFUNC(pad) = eos;
GST_DEBUG (0,"eosfunc for %s:%s(@%p) at %p is set to %p\n",
GST_DEBUG_PAD_NAME(pad),pad,&GST_RPAD_EOSFUNC(pad),eos);
static void
-gst_pad_push_func(GstPad *pad, GstBuffer *buf)
+gst_pad_push_func(GstPad *pad, GstBuffer *buf)
{
if (GST_RPAD_CHAINFUNC(GST_RPAD_PEER(pad)) != NULL) {
GST_DEBUG (0,"calling chain function\n");
*
* Pass the qos message downstream.
*/
-void
+void
gst_pad_handle_qos(GstPad *pad,
glong qos_message)
{
*
* Disconnects the source pad from the sink pad.
*/
-void
+void
gst_pad_disconnect (GstPad *srcpad,
- GstPad *sinkpad)
+ GstPad *sinkpad)
{
GstRealPad *realsrc, *realsink;
*
* Connects the source pad to the sink pad.
*/
-void
+void
gst_pad_connect (GstPad *srcpad,
- GstPad *sinkpad)
+ GstPad *sinkpad)
{
GstRealPad *realsrc, *realsink;
GstRealPad *temppad;
}
g_return_if_fail((GST_RPAD_DIRECTION(realsrc) == GST_PAD_SRC) &&
(GST_RPAD_DIRECTION(realsink) == GST_PAD_SINK));
-
+
if (!gst_pad_check_compatibility (srcpad, sinkpad)) {
g_warning ("gstpad: connecting incompatible pads (%s:%s) and (%s:%s)\n",
GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad));
/**
* gst_pad_set_parent:
- * @pad: the pad to set the parent
+ * @pad: the pad to set the parent
* @parent: the object to set the parent to
*
* Sets the parent object of a pad.
*/
-void
+void
gst_pad_set_parent (GstPad *pad,
- GstObject *parent)
+ GstObject *parent)
{
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_PAD (pad));
/**
* gst_pad_add_ghost_pad:
- * @pad: the pad to set the ghost parent
+ * @pad: the pad to set the ghost parent
* @ghostpad: the ghost pad to add
*
* Add a ghost pad to a pad.
*/
-void
+void
gst_pad_add_ghost_pad (GstPad *pad,
- GstPad *ghostpad)
+ GstPad *ghostpad)
{
GstRealPad *realpad;
/**
- * gst_pad_remove_ghost_parent:
- * @pad: the pad to remove the ghost parent
+ * gst_pad_remove_ghost_pad:
+ * @pad: the pad to remove the ghost parent
* @ghostpad: the ghost pad to remove from the pad
*
* Remove a ghost pad from a pad.
*/
-void
-gst_pad_remove_ghost_parent (GstPad *pad,
- GstPad *ghostpad)
+void
+gst_pad_remove_ghost_pad (GstPad *pad,
+ GstPad *ghostpad)
{
GstRealPad *realpad;
* Returns: the parent object
*/
GstObject*
-gst_pad_get_parent (GstPad *pad)
+gst_pad_get_parent (GstPad *pad)
{
g_return_val_if_fail (pad != NULL, NULL);
g_return_val_if_fail (GST_IS_PAD (pad), NULL);
* Returns: a GList of ghost pads
*/
GList*
-gst_pad_get_ghost_parents (GstPad *pad)
+gst_pad_get_ghost_pad_list (GstPad *pad)
{
g_return_val_if_fail (pad != NULL, NULL);
g_return_val_if_fail (GST_IS_PAD (pad), NULL);
*
* Set the capabilities of this pad.
*/
-void
-gst_pad_set_caps_list (GstPad *pad,
- GList *caps)
+void
+gst_pad_set_caps_list (GstPad *pad,
+ GList *caps)
{
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_REAL_PAD (pad)); // NOTE this restriction
*
* Returns: a list of the capabilities of this pad
*/
-GList *
-gst_pad_get_caps_list (GstPad *pad)
+GList *
+gst_pad_get_caps_list (GstPad *pad)
{
g_return_val_if_fail (pad != NULL, NULL);
g_return_val_if_fail (GST_IS_PAD (pad), NULL);
*
* Returns: a capability or NULL if not found
*/
-GstCaps *
-gst_pad_get_caps_by_name (GstPad *pad, gchar *name)
+GstCaps *
+gst_pad_get_caps_by_name (GstPad *pad, gchar *name)
{
GList *caps;
caps = g_list_next (caps);
}
-
+
return NULL;
}
* Returns: TRUE if they are compatible or the capabilities
* could not be checked
*/
-gboolean
-gst_pad_check_compatibility (GstPad *srcpad, GstPad *sinkpad)
+gboolean
+gst_pad_check_compatibility (GstPad *srcpad, GstPad *sinkpad)
{
GstRealPad *realsrc, *realsink;
}
}
else {
- GST_DEBUG (0,"gstpad: could not check capabilities of pads (%s:%s) and (%s:%s)\n",
+ GST_DEBUG (0,"gstpad: could not check capabilities of pads (%s:%s) and (%s:%s)\n",
GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad));
return TRUE;
}
* Returns: the peer pad
*/
GstPad*
-gst_pad_get_peer (GstPad *pad)
+gst_pad_get_peer (GstPad *pad)
{
g_return_val_if_fail (pad != NULL, NULL);
g_return_val_if_fail (GST_IS_PAD (pad), NULL);
}
// FIXME this needs to be rethought soon
-static void
-gst_real_pad_destroy (GtkObject *object)
+static void
+gst_real_pad_destroy (GtkObject *object)
{
GstPad *pad = GST_PAD (object);
* Read the pad definition from the XML node and connect the given pad
* in element to a pad of an element in the hashtable.
*/
-void
-gst_pad_load_and_connect (xmlNodePtr parent,
- GstObject *element,
- GHashTable *elements)
+void
+gst_pad_load_and_connect (xmlNodePtr parent,
+ GstObject *element,
+ GHashTable *elements)
{
xmlNodePtr field = parent->childs;
GstPad *pad = NULL, *targetpad;
*
* Returns: the xml representation of the pad
*/
-xmlNodePtr
+xmlNodePtr
gst_pad_save_thyself (GstPad *pad,
- xmlNodePtr parent)
+ xmlNodePtr parent)
{
GstRealPad *realpad;
GstPad *peer;
*
* Returns: the xml representation of the pad
*/
-xmlNodePtr
+xmlNodePtr
gst_pad_ghost_save_thyself (GstPad *pad,
GstElement *bin,
- xmlNodePtr parent)
+ xmlNodePtr parent)
{
xmlNodePtr self;
#endif
/************************************************************************
- *
+ *
* templates
*
*/
*
* Returns: the new padtemplate
*/
-GstPadTemplate*
-gst_padtemplate_new (GstPadFactory *factory)
+GstPadTemplate*
+gst_padtemplate_new (GstPadFactory *factory)
{
GstPadTemplate *new;
GstPadFactoryEntry tag;
/**
* gst_padtemplate_create:
- * @name_template: the name template
+ * @name_template: the name template
* @direction: the direction for the template
* @presence: the presence of the pad
* @caps: a list of capabilities for the template
GList *caps)
{
GstPadTemplate *new;
-
+
new = g_new0 (GstPadTemplate, 1);
new->name_template = name_template;
*
* Returns: the new padtemplate
*/
-GstPadTemplate*
+GstPadTemplate*
gst_padtemplate_load_thyself (xmlNodePtr parent)
{
xmlNodePtr field = parent->childs;
}
-gboolean
+static gboolean
gst_pad_eos_func(GstPad *pad)
{
GstElement *element;
* Returns: TRUE if it succeeded
*/
gboolean
-gst_pad_set_eos(GstPad *pad)
+gst_pad_set_eos(GstPad *pad)
{
g_return_val_if_fail (pad != NULL, FALSE);
g_return_val_if_fail (GST_IS_REAL_PAD(pad), FALSE); // NOTE the restriction
// add ourselves to the real pad's list of ghostpads
gst_pad_add_ghost_pad (pad, GST_PAD(ghostpad));
-
+
// FIXME need to ref the real pad here... ?
GST_DEBUG(0,"created ghost pad \"%s\"\n",name);
#define GST_PAD_PEER(pad) GST_RPAD_PEER(GST_PAD_REALIZE(pad))
/* Some check functions (unused?) */
-#define GST_PAD_CONNECTED(pad) (GST_IS_REAL_PAD(pad) && GST_REAL_PAD(pad)->peer != NULL)
-#define GST_PAD_CAN_PULL(pad) (GST_IS_REAL_PAD(pad) && GST_REAL_PAD(pad)->pullfunc != NULL)
+#define GST_PAD_CONNECTED(pad) (GST_IS_REAL_PAD(pad) && GST_REAL_PAD(pad)->peer != NULL)
+#define GST_PAD_CAN_PULL(pad) (GST_IS_REAL_PAD(pad) && GST_REAL_PAD(pad)->pullfunc != NULL)
/***** PadTemplate *****/
-#define GST_TYPE_PADTEMPLATE (gst_padtemplate_get_type ())
-#define GST_PADTEMPLATE(obj) (GTK_CHECK_CAST ((obj), GST_TYPE_PADTEMPLATE,GstPad))
-#define GST_PADTEMPLATE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GST_TYPE_PADTEMPLATE,GstPadClass))
-#define GST_IS_PADTEMPLATE(obj) (GTK_CHECK_TYPE ((obj), GST_TYPE_PADTEMPLATE))
-#define GST_IS_PADTEMPLATE_CLASS(obj) (GTK_CHECK_CLASS_TYPE ((klass), GST_TYPE_PADTEMPLATE))
+#define GST_TYPE_PADTEMPLATE (gst_padtemplate_get_type ())
+#define GST_PADTEMPLATE(obj) (GTK_CHECK_CAST ((obj), GST_TYPE_PADTEMPLATE,GstPad))
+#define GST_PADTEMPLATE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GST_TYPE_PADTEMPLATE,GstPadClass))
+#define GST_IS_PADTEMPLATE(obj) (GTK_CHECK_TYPE ((obj), GST_TYPE_PADTEMPLATE))
+#define GST_IS_PADTEMPLATE_CLASS(obj) (GTK_CHECK_CLASS_TYPE ((klass), GST_TYPE_PADTEMPLATE))
typedef enum {
GST_PAD_ALWAYS,
} GstPadPresence;
struct _GstPadTemplate {
- GstObject object;
+ GstObject object;
gchar *name_template;
GstPadDirection direction;
GstPadPresence presence;
- GList *caps;
+ GList *caps;
};
struct _GstPadTemplateClass {
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_REQUEST GINT_TO_POINTER(GST_PAD_REQUEST)
+#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_REQUEST GINT_TO_POINTER(GST_PAD_REQUEST)
-#define GST_PAD_FACTORY_SRC GINT_TO_POINTER(GST_PAD_SRC)
-#define GST_PAD_FACTORY_SINK GINT_TO_POINTER(GST_PAD_SINK)
+#define GST_PAD_FACTORY_SRC GINT_TO_POINTER(GST_PAD_SRC)
+#define GST_PAD_FACTORY_SINK GINT_TO_POINTER(GST_PAD_SINK)
-#define GST_PAD_FACTORY_CAPS(a...) GINT_TO_POINTER(1),##a,NULL
+#define GST_PAD_FACTORY_CAPS(a...) GINT_TO_POINTER(1),##a,NULL
-GtkType gst_pad_get_type (void);
-GtkType gst_real_pad_get_type (void);
-GtkType gst_ghost_pad_get_type (void);
+GtkType gst_pad_get_type (void);
+GtkType gst_real_pad_get_type (void);
+GtkType gst_ghost_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_select (GstPad *nextpad, ...);
-#define gst_pad_eos(pad) (GST_RPAD_EOSFUNC(GST_RPAD_PEER(pad))(GST_PAD(GST_RPAD_PEER(pad))))
+#define gst_pad_eos(pad) (GST_RPAD_EOSFUNC(GST_RPAD_PEER(pad))(GST_PAD(GST_RPAD_PEER(pad))))
gboolean gst_pad_set_eos (GstPad *pad);
-gboolean gst_pad_eos_func (GstPad *pad);
void gst_pad_handle_qos (GstPad *pad, glong qos_message);
xmlNodePtr gst_pad_save_thyself (GstPad *pad, xmlNodePtr parent);
}
*/
-gchar *
+static gchar *
gst_parse_unique_name(gchar *type,gst_parse_priv *priv)
{
gint count;
return i+1;
}
-gint gst_parse_launch(const gchar *cmdline,GstBin *parent) {
+/**
+ * gst_parse_launch:
+ * @cmdline: the command line describing the pipeline
+ * @parent: the parent bin for the resulting pipeline
+ *
+ * Create a new pipeline based on command line syntax.
+ *
+ * Returns: ?
+ */
+gint
+gst_parse_launch(const gchar *cmdline,GstBin *parent)
+{
gst_parse_priv priv;
gchar **argvn;
gint newargc;
ARG_LEVEL,
ARG_MAX_LEVEL,
ARG_BLOCK,
- ARG_TIMEOUT,
};
GTK_ARG_READWRITE, ARG_MAX_LEVEL);
gtk_object_add_arg_type ("GstQueue::block", GTK_TYPE_BOOL,
GTK_ARG_READWRITE, ARG_BLOCK);
- gtk_object_add_arg_type ("GstQueue::timeout", GTK_TYPE_INT,
- GTK_ARG_READWRITE, ARG_TIMEOUT);
gtkobject_class->set_arg = gst_queue_set_arg;
gtkobject_class->get_arg = gst_queue_get_arg;
case ARG_BLOCK:
queue->block = GTK_VALUE_BOOL (*arg);
break;
- case ARG_TIMEOUT:
- break;
default:
break;
}
case ARG_BLOCK:
GTK_VALUE_BOOL (*arg) = queue->block;
break;
- case ARG_TIMEOUT:
- break;
default:
arg->type = GTK_TYPE_INVALID;
break;
static void gst_thread_signal_thread (GstThread *thread);
static void gst_thread_wait_thread (GstThread *thread);
-static void gst_thread_create_plan_dummy (GstBin *bin);
static void gst_thread_schedule_dummy (GstBin *bin);
static void* gst_thread_main_loop (void *arg);
gstelement_class->save_thyself = gst_thread_save_thyself;
gstelement_class->restore_thyself = gst_thread_restore_thyself;
- //gstbin_class->create_plan = gst_thread_create_plan_dummy;
gstbin_class->schedule = gst_thread_schedule_dummy;
gtkobject_class->set_arg = gst_thread_set_arg;
GST_INFO (GST_CAT_THREAD,"gstthread: scheduling delayed until thread starts");
}
-static void
-gst_thread_create_plan_dummy (GstBin *bin)
-{
- g_return_if_fail (GST_IS_THREAD (bin));
-
- if (!GST_FLAG_IS_SET (GST_THREAD (bin), GST_THREAD_STATE_SPINNING))
- GST_INFO (GST_CAT_THREAD,"gstthread: create plan delayed until thread starts");
-}
-
static void
gst_thread_set_arg (GtkObject *object,
GtkArg *arg,
#include "gstbin.h"
-static void gst_xml_class_init (GstXMLClass *klass);
+static void gst_xml_class_init (GstXMLClass *klass);
static void gst_xml_init (GstXML *xml);
static GstObjectClass *parent_class = NULL;
-GtkType
-gst_xml_get_type(void)
+GtkType
+gst_xml_get_type(void)
{
static GtkType xml_type = 0;
}
static void
-gst_xml_class_init (GstXMLClass *klass)
+gst_xml_class_init (GstXMLClass *klass)
{
parent_class = gtk_type_class (GST_TYPE_OBJECT);
}
-static void
-gst_xml_init(GstXML *xml)
+static void
+gst_xml_init(GstXML *xml)
{
}
*
* Returns: a pointer to an XML document
*/
-xmlDocPtr
-gst_xml_write (GstElement *element)
+xmlDocPtr
+gst_xml_write (GstElement *element)
{
xmlDocPtr doc;
return doc;
}
-/**
- * gst_xml_new:
- * @fname: The filename with the xml description
- * @root: The name of the root object to build
- *
- * Creates a new GstXML object (and the corresponding elements) from
- * the XML file fname. Optionally it will only build the element from
- * the element node root (if it is not NULL). This feature is useful
- * if you only want to build a specific element from an XML file
- * but not the pipeline it is embedded in. Note also that the XML parse
- * tree is cached to speed up creating another GstXML object for
- * the same file
- *
- * Returns: a pointer to a new GstElement
- */
-GstXML*
-gst_xml_new (const guchar *fname, const guchar *root)
+static GstXML*
+gst_xml_real_parse (xmlDocPtr doc, const guchar *root)
{
- xmlDocPtr doc;
- xmlNodePtr field;
GstXML *xml;
+ xmlNodePtr field;
- g_return_val_if_fail(fname != NULL, NULL);
-
- doc = xmlParseFile(fname);
-
- if (!doc) {
- g_print("gstxml: XML file \"%s\" could not be read\n", fname);
- return NULL;
- }
if (strcmp(doc->xmlRootNode->name, "GST-Pipeline")) {
- g_print("gstxml: XML file \"%s\" is in wrong format\n", fname);
+ g_warning("gstxml: XML file is in wrong format\n");
return NULL;
}
xml->topelements = NULL;
field = doc->xmlRootNode->xmlChildrenNode;
-
+
while (field) {
if (!strcmp(field->name, "element")) {
GstElement *element;
-
+
xml->elements = g_hash_table_new(g_str_hash, g_str_equal);
element = gst_element_load_thyself(field, xml->elements);
-
+
g_hash_table_destroy (xml->elements);
xml->topelements = g_list_prepend (xml->topelements, element);
return xml;
}
+/**
+ * gst_xml_new:
+ * @fname: The filename with the xml description
+ * @root: The name of the root object to build
+ *
+ * Creates a new GstXML object (and the corresponding elements) from
+ * the XML file fname. Optionally it will only build the element from
+ * the element node root (if it is not NULL). This feature is useful
+ * if you only want to build a specific element from an XML file
+ * but not the pipeline it is embedded in. Note also that the XML parse
+ * tree is cached to speed up creating another GstXML object for
+ * the same file
+ *
+ * Returns: a pointer to a new GstXML object
+ */
+GstXML*
+gst_xml_new (const guchar *fname, const guchar *root)
+{
+ xmlDocPtr doc;
+
+ g_return_val_if_fail(fname != NULL, NULL);
+
+ doc = xmlParseFile(fname);
+
+ if (!doc) {
+ g_warning("gstxml: XML file \"%s\" could not be read\n", fname);
+ return NULL;
+ }
+
+ return gst_xml_real_parse (doc, root);
+}
+
+/**
+ * gst_xml_new_from_memory:
+ * @buffer: a pointer to the in memory XML buffer
+ * @size: the size of the buffer
+ * @root: the name of the root objects to build
+ *
+ * Creates a new GstXML object (and the corresponding elements) from
+ * an in memory XML buffer.
+ *
+ * Returns: a pointer to a new GstXML object
+ */
+GstXML*
+gst_xml_new_from_memory (guchar *buffer, guint size, const gchar *root)
+{
+ xmlDocPtr doc;
+
+ g_return_val_if_fail(buffer != NULL, NULL);
+
+ doc = xmlParseMemory (buffer, size);
+
+ return gst_xml_real_parse (doc, root);
+}
+
/**
* gst_xml_get_topelements:
* @xml: The GstXML to get the elements from
* Returns: a GList of elements
*/
GList*
-gst_xml_get_topelements (GstXML *xml)
+gst_xml_get_topelements (GstXML *xml)
{
g_return_val_if_fail (xml != NULL, NULL);
* @xml: The GstXML to get the element from
* @name: The name of element to retreive
*
- * This function is used to get a pointer to the GstElement corresponding
- * to name in the pipeline description. You would use this if you have
+ * This function is used to get a pointer to the GstElement corresponding
+ * to name in the pipeline description. You would use this if you have
* to do anything to the element after loading.
*
* Returns: a pointer to a new GstElement
*/
GstElement*
-gst_xml_get_element (GstXML *xml, const guchar *name)
+gst_xml_get_element (GstXML *xml, const guchar *name)
{
GstElement *element;
GList *topelements;
if (GST_IS_BIN (top)) {
element = gst_bin_get_by_name (GST_BIN (top), name);
- if (element)
+ if (element)
return element;
}
}
GtkObjectClass parent_class;
};
-GtkType gst_xml_get_type (void);
+GtkType gst_xml_get_type (void);
/* create an XML document out of a pipeline */
-xmlDocPtr gst_xml_write (GstElement *element);
+xmlDocPtr gst_xml_write (GstElement *element);
GstXML* gst_xml_new (const guchar *fname, const guchar *root);
+GstXML* gst_xml_new_from_memory (guchar *buffer, guint size, const gchar *root);
+
GstElement* gst_xml_get_element (GstXML *xml, const guchar *name);
-GList* gst_xml_get_topelements (GstXML *xml);
+GList* gst_xml_get_topelements (GstXML *xml);
#ifdef __cplusplus
}
ARG_LEVEL,
ARG_MAX_LEVEL,
ARG_BLOCK,
- ARG_TIMEOUT,
};
GTK_ARG_READWRITE, ARG_MAX_LEVEL);
gtk_object_add_arg_type ("GstQueue::block", GTK_TYPE_BOOL,
GTK_ARG_READWRITE, ARG_BLOCK);
- gtk_object_add_arg_type ("GstQueue::timeout", GTK_TYPE_INT,
- GTK_ARG_READWRITE, ARG_TIMEOUT);
gtkobject_class->set_arg = gst_queue_set_arg;
gtkobject_class->get_arg = gst_queue_get_arg;
case ARG_BLOCK:
queue->block = GTK_VALUE_BOOL (*arg);
break;
- case ARG_TIMEOUT:
- break;
default:
break;
}
case ARG_BLOCK:
GTK_VALUE_BOOL (*arg) = queue->block;
break;
- case ARG_TIMEOUT:
- break;
default:
arg->type = GTK_TYPE_INVALID;
break;
if (realpad->qosfunc)
printf(" Has qosfunc(): %s\n",GST_DEBUG_FUNCPTR_NAME(realpad->qosfunc));
if (realpad->eosfunc) {
- if (realpad->eosfunc == gst_pad_eos_func)
- printf(" Has default eosfunc() gst_pad_eos_func()\n");
- else
- printf(" Has eosfunc(): %s\n",GST_DEBUG_FUNCPTR_NAME(realpad->eosfunc));
+ printf(" Has eosfunc(): %s\n",GST_DEBUG_FUNCPTR_NAME(realpad->eosfunc));
}
if (pad->padtemplate)