plugins/filters/adder/Makefile
plugins/filters/colorspace/Makefile
plugins/filters/volenv/Makefile
+plugins/filters/adder/Makefile
plugins/icecast/Makefile
plugins/icecast/icecastsend/Makefile
plugins/effects/Makefile
examples/queue3/Makefile
examples/queue4/Makefile
examples/thread/Makefile
+examples/mixer/Makefile
examples/launch/Makefile
examples/xml/Makefile
examples/plugins/Makefile
gst_init
gst_main
gst_main_quit
+GST_VERSION_MICRO
+GST_VERSION_MAJOR
+GST_VERSION_MINOR
<SUBSECTION Standard>
</SECTION>
GST_BUFFER_OFFSET
GST_BUFFER_MAXSIZE
GST_BUFFER_TIMESTAMP
+GST_BUFFER_BUFFERPOOL
+GST_BUFFER_POOL_PRIVATE
GST_BUFFER_LOCK
GST_BUFFER_TRYLOCK
GST_BUFFER_UNLOCK
+
+
GstBufferFlags
GstBuffer
gst_buffer_new
GstPadQoSFunction
GstPadEOSFunction
GstPadNewCapsFunction
-
+GstPadBufferPoolFunction
GstPadNegotiateReturn
GstPadNegotiateFunction
-
GstPadPushFunction
GstPadPullFunction
GstRegionType
gst_pad_set_qos_function
gst_pad_set_eos_function
gst_pad_set_newcaps_function
+gst_pad_set_bufferpool_function
gst_pad_set_caps
gst_pad_get_caps
gst_pad_check_compatibility
gst_pad_push
gst_pad_pull
gst_pad_pullregion
+gst_pad_get_bufferpool
gst_pad_set_eos
gst_pad_handle_qos
gst_pad_eos
GST_RPAD_EOSFUNC
GST_RPAD_NEGOTIATEFUNC
GST_RPAD_NEWCAPSFUNC
+GST_RPAD_BUFFERPOOLFUNC
GST_GPAD_REALPAD
GstGhostPad
GST_PADTEMPLATE_DIRECTION
GST_PADTEMPLATE_NAME_TEMPLATE
GST_PADTEMPLATE_PRESENCE
+GST_PADTEMPLATE_NEW
+GST_PADTEMPLATE_FACTORY
+GST_PADTEMPLATE_GET
gst_padtemplate_new
gst_padtemplate_load_thyself
gst_padtemplate_save_thyself
GST_CAPS_LOCK
GST_CAPS_TRYLOCK
GST_CAPS_UNLOCK
+GST_CAPS_NEW
+GST_CAPS_FACTORY
+GST_CAPS_GET
GstCaps
gst_caps_new
gst_caps_destroy
gst_caps_unref
gst_caps_copy
gst_caps_copy_on_write
+gst_caps_chain
gst_caps_append
gst_caps_prepend
gst_caps_set_name
GstFakeSrc
GstFakeSink
GstDiskSrc
- GstHttpSrc
GstFdSrc
GstSineSrc
GstFdSink
+<!-- ##### MACRO GST_VERSION_MICRO ##### -->
+<para>
+
+</para>
+
+
+
+<!-- ##### MACRO GST_VERSION_MAJOR ##### -->
+<para>
+
+</para>
+
+
+
+<!-- ##### MACRO GST_VERSION_MINOR ##### -->
+<para>
+
+</para>
+
+
+
<!-- ##### SECTION Long_Description ##### -->
<para>
GstAutoplug is an abstract class that is used for constructing and
-connecting elements.
+connecting elements. Two types og autopluggers exist: renderer ones and non
+renderer ones. the renderer autopluggers will not have any src pads while the
+non renderer ones do.
+</para>
+
+<para>
+You first need to create a suitable autoplugger with gst_autoplugfactory_make().
+The name of the autoplugger must be one of the registered autopluggers
+(see #GstStaticAutoplug and #GstStaticAutoplugRender).
+</para>
+<para>
+A list of all available autopluggers can be obtained with gst_autoplugfactory_get_list().
+</para>
+<para>
+If the autoplugger supports the RENDERER API, use gst_autoplug_to_renderers() call to
+create a bin that connectes the src caps to the specified rendrer elements. You can
+then add the bin to a pipeline and run it.
+
+ <programlisting>
+ GstAutoplug *autoplug;
+ GstElement *element;
+ GstElement *sink;
+
+ /* create a static autoplugger */
+ autoplug = gst_autoplugfactory_make ("staticrender");
+
+ /* create an osssink */
+ sink = gst_elementfactory_make ("osssink", "our_sink");
+
+ /* create an element that can play audio/mp3 through osssink */
+ element = gst_autoplug_to_renderers (autoplug,
+ gst_caps_new (
+ "sink_audio_caps",
+ "audio/mp3",
+ NULL
+ ),
+ sink,
+ NULL);
+
+ /* add the element to a bin and connect the sink pad */
+ ...
+ </programlisting>
+</para>
+<para>
+If the autoplugger supports the CAPS API, use gst_autoplug_to_caps() call to
+connect the src caps to the destination caps. The created bin will have src pads
+compatible with the provided sink caps.
+
+ <programlisting>
+ GstAutoplug *autoplug;
+ GstElement *element;
+
+ /* create a static autoplugger */
+ autoplug = gst_autoplugfactory_make ("static");
+
+ /* create an element that converts audio/mp3 to audio/raw */
+ element = gst_autoplug_to_caps (autoplug,
+ gst_caps_new (
+ "sink_audio_caps",
+ "audio/mp3",
+ NULL
+ ),
+ gst_caps_new (
+ "src_audio_caps",
+ "audio/raw",
+ NULL
+ ),
+ NULL);
+
+ /* add the element to a bin and connect the src/sink pads */
+ ...
+ </programlisting>
</para>
-<!-- ##### SECTION See_Also ##### -->
<para>
+Optionally you can get a notification when a new object is added to the created
+pipeline with a gtk_signal_connect to the "new_object" signal.
+</para>
+<para>
+Use the regular gst_object_destroy() call to destroy the autoplugger.
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+GstStaticAutoplug, GstStaticAutoplugRender
</para>
<!-- ##### STRUCT GstAutoplug ##### -->
<!-- ##### ENUM GstAutoplugFlags ##### -->
<para>
-
+The type of the autoplugger.
</para>
@GST_AUTOPLUG_TO_CAPS:
<!-- ##### MACRO gst_bin_destroy ##### -->
<para>
-
+Free the memory allocated by this bin
</para>
-@bin:
+@bin: the bin to free
<!-- ##### FUNCTION gst_bin_add ##### -->
@buf: GstBuffer
+<!-- ##### MACRO GST_BUFFER_BUFFERPOOL ##### -->
+<para>
+Get the bufferpool for this buffer.
+</para>
+
+@buf: GstBuffer
+
+
+<!-- ##### MACRO GST_BUFFER_POOL_PRIVATE ##### -->
+<para>
+Get the bufferpool private data.
+</para>
+
+@buf: GstBuffer
+
+
<!-- ##### MACRO GST_BUFFER_LOCK ##### -->
<para>
This macro will obtain a lock on the object, making serialization
@metas:
@parent:
@pool:
+@pool_private:
<!-- ##### FUNCTION gst_buffer_new ##### -->
<para>
@caps: The caps structure to unlock
+<!-- ##### MACRO GST_CAPS_NEW ##### -->
+<para>
+A convenience macro to create a new GstCaps structure.
+</para>
+
+@name: the name of the caps structure
+@type: the mime type of the caps structure
+@a...: the properties of this caps stucture.
+
+
+<!-- ##### MACRO GST_CAPS_FACTORY ##### -->
+<para>
+A convenience macro to create a GstCaps factory.
+</para>
+
+@factoryname: the name of the factory
+@a...: the caps to create with this factory, usualy specified
+with GST_CAPS_NEW()
+
+
+<!-- ##### MACRO GST_CAPS_GET ##### -->
+<para>
+A convenience macro to get a GstCaps from the given capsfactory.
+</para>
+
+@fact: the factory to use.
+
+
<!-- ##### STRUCT GstCaps ##### -->
<para>
</para>
@caps:
+@Returns:
<!-- ##### FUNCTION gst_caps_unref ##### -->
</para>
@caps:
+@Returns:
<!-- ##### FUNCTION gst_caps_copy ##### -->
@Returns:
+<!-- ##### FUNCTION gst_caps_chain ##### -->
+<para>
+
+</para>
+
+@caps:
+@Varargs:
+@Returns:
+
+
<!-- ##### FUNCTION gst_caps_append ##### -->
<para>
<!-- ##### MACRO gst_caps_set ##### -->
<para>
-
+Set a property of a caps structure.
</para>
-@caps:
-@name:
-@args...:
+@caps: the caps structure to modify
+@name: the name of the property to change
+@args...: the new value of the property
<!-- ##### MACRO gst_caps_get_boolean ##### -->
<para>
-
+Get the value of the named property as a boolean.
</para>
-@caps:
-@name:
+@caps: the caps to query
+@name: the name of the property to get
<!-- ##### FUNCTION gst_caps_get_by_name ##### -->
<!-- ##### MACRO gst_caps_get_fourcc_int ##### -->
<para>
-
+Get the value of the named property as a fourcc.
</para>
-@caps:
-@name:
+@caps: the caps to query
+@name: the name of the property to get
<!-- ##### MACRO gst_caps_get_int ##### -->
<para>
-
+Get the value of the named property as an int.
</para>
-@caps:
-@name:
+@caps: the caps to query
+@name: the name of the property to get
<!-- ##### MACRO gst_caps_get_string ##### -->
<para>
-
+Get the value of the named property as a string.
</para>
-@caps:
-@name:
+@caps: the caps to query
+@name: the name of the property to get
<!-- ##### FUNCTION gst_caps_save_thyself ##### -->
</para>
+<!-- ##### ARG GstFakeSink:silent ##### -->
+<para>
+
+</para>
+
</para>
-<!-- ##### ARG GstHttpSrc:location ##### -->
-<para>
-Specify the location of the file. The location must be a fully qualified URL.
-</para>
-
-<!-- ##### ARG GstHttpSrc:bytesperread ##### -->
-<para>
-Specify how many bytes to read at a time.
-
-</para>
-
<!-- ##### USER_FUNCTION GstPadNewCapsFunction ##### -->
<para>
+The function that will be called when the caps of the pad has
+changed.
+</para>
+
+@pad: The pad that has its caps changed
+@caps: the new caps of the pad
+
+<!-- ##### USER_FUNCTION GstPadBufferPoolFunction ##### -->
+<para>
+The function that will be called when a bufferpool is requested
+from this pad.
</para>
-@pad:
-@caps:
+@pad: the pad with the bufferpool
+@Returns: the GstBufferPool associated with this pad.
<!-- ##### ENUM GstPadNegotiateReturn ##### -->
@pad: The pad that is being negotiated
@caps: The current caps that are being negotiated
-@data:
+@data: A generic gpointer that can be used to store user_data
@Returns: The result of the negotiation process
-<!-- # Unused Parameters # -->
-@count: A counter to keep track of the negotiation process
<!-- ##### USER_FUNCTION GstPadPushFunction ##### -->
@newcaps:
+<!-- ##### FUNCTION gst_pad_set_bufferpool_function ##### -->
+<para>
+
+</para>
+
+@pad:
+@bufpool:
+
+
<!-- ##### FUNCTION gst_pad_set_caps ##### -->
<para>
@size:
+<!-- ##### FUNCTION gst_pad_get_bufferpool ##### -->
+<para>
+
+</para>
+
+@pad:
+@Returns:
+
+
<!-- ##### FUNCTION gst_pad_set_eos ##### -->
<para>
@pullregionfunc:
@negotiatefunc:
@newcapsfunc:
+@bufferpoolfunc:
@ghostpads:
<!-- ##### MACRO GST_RPAD_DIRECTION ##### -->
@pad:
+<!-- ##### MACRO GST_RPAD_BUFFERPOOLFUNC ##### -->
+<para>
+
+</para>
+
+@pad:
+
+
<!-- ##### MACRO GST_GPAD_REALPAD ##### -->
<para>
Get the real pad of this ghost pad.
@templ:
+<!-- ##### MACRO GST_PADTEMPLATE_NEW ##### -->
+<para>
+
+</para>
+
+@padname:
+@dir:
+@pres:
+@a...:
+
+
+<!-- ##### MACRO GST_PADTEMPLATE_FACTORY ##### -->
+<para>
+
+</para>
+
+@name:
+@padname:
+@dir:
+@pres:
+@a...:
+
+
+<!-- ##### MACRO GST_PADTEMPLATE_GET ##### -->
+<para>
+
+</para>
+
+@fact:
+
+
<!-- ##### FUNCTION gst_padtemplate_new ##### -->
<para>
<!-- ##### MACRO GST_MAKE_FOURCC ##### -->
<para>
-
+Create a FOURCC value that can easily be used to construct
+a fourcc property.
</para>
-@a:
-@b:
-@c:
-@d:
+@a: first fourcc byte
+@b: second fourcc byte
+@c: third fourcc byte
+@d: fourth fourcc byte
<!-- ##### MACRO GST_PROPS_LIST ##### -->
Construct a fourcc property out of four bytes.
</para>
-@a: first byte
-<!-- # Unused Parameters # -->
-@b: second byte
-@c: third byte
-@d: fourth byte
+@a: a fourcc value usualy created with GST_FOURCC_MAKE ()
<!-- ##### MACRO GST_PROPS_BOOLEAN ##### -->
<!-- ##### MACRO GST_PROPS_STRING ##### -->
<para>
-
+Create a string value.
</para>
-@a:
+@a: the string value.
<!-- ##### MACRO GST_PROPS_FLOAT ##### -->
<para>
-
+Create a floating point value.
</para>
-@a:
+@a: the float value
<!-- ##### MACRO GST_PROPS_FLOAT_RANGE ##### -->
<para>
-
+Create a float range value.
</para>
-@a:
-@b:
+@a: lower float bounds
+@b: upper float bounds
<!-- ##### FUNCTION gst_props_new ##### -->
@firstname:
@Varargs:
@Returns:
-<!-- # Unused Parameters # -->
-@entry:
<!-- ##### FUNCTION gst_props_newv ##### -->
</para>
-<!-- ##### FUNCTION gst_fdsink_chain ##### -->
+<!-- ##### FUNCTION gst_pad_remove_ghost_parent ##### -->
<para>
</para>
@pad:
-@buf:
+@parent:
-<!-- ##### FUNCTION gst_pad_remove_ghost_parent ##### -->
+<!-- ##### FUNCTION gst_fdsink_chain ##### -->
<para>
</para>
@pad:
-@parent:
+@buf:
-<!-- ##### FUNCTION gst_identity_chain ##### -->
+<!-- ##### ARG GstHttpSrc:location ##### -->
<para>
-
+Specify the location of the file. The location must be a fully qualified URL.
</para>
-@pad:
-@buf:
-<!-- ##### FUNCTION gst_audiosink_chain ##### -->
+<!-- ##### FUNCTION gst_identity_chain ##### -->
<para>
</para>
@Returns:
+<!-- ##### FUNCTION gst_audiosink_chain ##### -->
+<para>
+
+</para>
+
+@pad:
+@buf:
+
<!-- ##### MACRO GST_PIPELINE_CLASS ##### -->
<para>
@gstsrc: the object which received the signal.
@arg1: the object which received the signal
-<!-- ##### FUNCTION gst_disksrc_get_type ##### -->
+<!-- ##### TYPEDEF GstCapsFactoryEntry ##### -->
<para>
</para>
-@Returns:
-<!-- ##### TYPEDEF GstCapsFactoryEntry ##### -->
+<!-- ##### FUNCTION gst_disksrc_get_type ##### -->
<para>
</para>
+@Returns:
<!-- ##### MACRO GST_IS_DISKSRC_CLASS ##### -->
<para>
@audiosink:
@channels:
+<!-- ##### SECTION ./tmpl/gstconnection.sgml:Short_Description ##### -->
+Generic connection between elements.
+
+
<!-- ##### STRUCT GstSinkClass ##### -->
<para>
</para>
-<!-- ##### SECTION ./tmpl/gstconnection.sgml:Short_Description ##### -->
-Generic connection between elements.
-
-
<!-- ##### STRUCT GstFilterClass ##### -->
<para>
@sheight:
@bytes_per_line:
-<!-- ##### ARG GstAudioSink:format ##### -->
+<!-- ##### SECTION ./tmpl/GstElement.sgml:Long_Description ##### -->
<para>
</para>
-<!-- ##### SECTION ./tmpl/GstElement.sgml:Long_Description ##### -->
+<!-- ##### ARG GstAudioSink:format ##### -->
<para>
</para>
@name:
@Returns:
-<!-- ##### STRUCT GstQueueClass ##### -->
+<!-- ##### STRUCT GstConnection ##### -->
<para>
</para>
-<!-- ##### STRUCT GstConnection ##### -->
+<!-- ##### STRUCT GstQueueClass ##### -->
<para>
</para>
-<!-- ##### FUNCTION gst_type_add_sink ##### -->
+<!-- ##### FUNCTION gst_fakesrc_push ##### -->
<para>
</para>
-@id:
-@sink:
+@src:
-<!-- ##### FUNCTION gst_fakesrc_push ##### -->
+<!-- ##### FUNCTION gst_type_add_sink ##### -->
<para>
</para>
-@src:
+@id:
+@sink:
<!-- ##### MACRO GST_IS_IDENTITY_CLASS ##### -->
<para>
@obj:
-<!-- ##### FUNCTION gst_fdsrc_get_type ##### -->
+<!-- ##### MACRO GST_IS_QUEUE_CLASS ##### -->
<para>
</para>
-@Returns:
+@obj:
-<!-- ##### MACRO GST_IS_QUEUE_CLASS ##### -->
+<!-- ##### FUNCTION gst_fdsrc_get_type ##### -->
<para>
</para>
-@obj:
+@Returns:
<!-- ##### FUNCTION gst_pad_get_type_id ##### -->
<para>
@pad:
@Returns:
-<!-- ##### STRUCT OverlayClip ##### -->
+<!-- ##### FUNCTION gst_thread_iterate ##### -->
<para>
</para>
-@x1:
-@x2:
-@y1:
-@y2:
+@thread:
-<!-- ##### FUNCTION gst_thread_iterate ##### -->
+<!-- ##### STRUCT OverlayClip ##### -->
<para>
</para>
-@thread:
+@x1:
+@x2:
+@y1:
+@y2:
<!-- ##### ENUM GstSrcFlags ##### -->
<para>
@obj:
-<!-- ##### MACRO GST_AUDIOSINK_CLASS ##### -->
+<!-- ##### FUNCTION gst_asyncdisksrc_get_type ##### -->
<para>
</para>
-@klass:
+@Returns:
-<!-- ##### FUNCTION gst_asyncdisksrc_get_type ##### -->
+<!-- ##### MACRO GST_AUDIOSINK_CLASS ##### -->
<para>
</para>
-@Returns:
+@klass:
<!-- ##### MACRO GST_PAD_FACTORY_SINK ##### -->
<para>
@pad:
@Returns:
-<!-- ##### FUNCTION gst_esdsink_new ##### -->
+<!-- ##### MACRO GST_PROPS_FOURCC_ID ##### -->
<para>
</para>
-@name:
-@Returns:
-<!-- ##### MACRO GST_PROPS_FOURCC_ID ##### -->
+<!-- ##### FUNCTION gst_esdsink_new ##### -->
<para>
</para>
+@name:
+@Returns:
<!-- ##### FUNCTION gst_element_request_pad ##### -->
<para>
@flag: Flag to set, can by any number of bits in guint32.
@obj: GstSrc to set flag in.
-<!-- ##### MACRO DEBUG_LEAVE_STRING ##### -->
+<!-- ##### MACRO GST_PROPS_FLOAT_STRING ##### -->
<para>
</para>
+@a:
-<!-- ##### MACRO GST_PROPS_FLOAT_STRING ##### -->
+<!-- ##### MACRO DEBUG_LEAVE_STRING ##### -->
<para>
</para>
-@a:
<!-- ##### FUNCTION gst_filter_get_type ##### -->
<para>
</para>
+<!-- ##### SECTION ./tmpl/gstsink.sgml:Title ##### -->
+GstSink
+
+
<!-- ##### MACRO GST_CPU_FLAG_MMX ##### -->
<para>
A flag indicating that MMX instructions are supported.
</para>
-<!-- ##### SECTION ./tmpl/gstsink.sgml:Title ##### -->
-GstSink
-
-
<!-- ##### FUNCTION gst_object_get_type ##### -->
<para>
@obj:
+<!-- ##### ARG GstHttpSrc:bytesperread ##### -->
+<para>
+Specify how many bytes to read at a time.
+
+</para>
+
+
<!-- ##### MACRO GST_THREAD ##### -->
<para>
</para>
-<!-- ##### FUNCTION gst_esdsink_get_type ##### -->
+<!-- ##### MACRO GST_IS_BIN_CLASS ##### -->
<para>
</para>
-@Returns:
+@obj:
-<!-- ##### MACRO GST_IS_BIN_CLASS ##### -->
+<!-- ##### FUNCTION gst_esdsink_get_type ##### -->
<para>
</para>
-@obj:
+@Returns:
<!-- ##### SECTION ./tmpl/GstElement.sgml:See_Also ##### -->
<para>
@obj: Element to query for multiple input pads.
-<!-- ##### MACRO DEBUG_NOPREFIX ##### -->
+<!-- ##### SECTION ./tmpl/gstfilter.sgml:See_Also ##### -->
<para>
</para>
-@format:
-@args...:
-<!-- ##### SECTION ./tmpl/gstfilter.sgml:See_Also ##### -->
+<!-- ##### MACRO DEBUG_NOPREFIX ##### -->
<para>
</para>
+@format:
+@args...:
<!-- ##### ARG GstAudioSink:frequency ##### -->
<para>
@audiosink:
-<!-- ##### MACRO GST_STATE_UNSET ##### -->
+<!-- ##### MACRO GST_IS_FAKESINK ##### -->
<para>
-This macro unsets the given state on the element.
+
</para>
-@obj: Element to unset state of.
-@flag: State to unset, can be any number of bits in guint32.
+@obj:
-<!-- ##### MACRO GST_IS_FAKESINK ##### -->
+<!-- ##### MACRO GST_STATE_UNSET ##### -->
<para>
-
+This macro unsets the given state on the element.
</para>
-@obj:
+@obj: Element to unset state of.
+@flag: State to unset, can be any number of bits in guint32.
<!-- ##### MACRO GST_QUEUE_CLASS ##### -->
<para>
@obj:
-<!-- ##### FUNCTION gst_sinesrc_get_type ##### -->
-<para>
-
-</para>
-
-@Returns:
-
<!-- ##### MACRO ERROR_OBJECT ##### -->
<para>
@format:
@args...:
+<!-- ##### FUNCTION gst_sinesrc_get_type ##### -->
+<para>
+
+</para>
+
+@Returns:
+
<!-- ##### MACRO GST_IS_IDENTITY ##### -->
<para>
@obj:
-<!-- ##### FUNCTION gst_src_push_region ##### -->
-<para>
-
-</para>
+<!-- ##### SECTION ./tmpl/videoraw.sgml:Short_Description ##### -->
+Information about video buffers.
-@src:
-@offset:
-@size:
<!-- ##### FUNCTION gst_fdsink_get_type ##### -->
<para>
@Returns:
-<!-- ##### SECTION ./tmpl/videoraw.sgml:Short_Description ##### -->
-Information about video buffers.
+<!-- ##### FUNCTION gst_src_push_region ##### -->
+<para>
+</para>
+
+@src:
+@offset:
+@size:
<!-- ##### STRUCT GstPipelineClass ##### -->
<para>
@obj:
-<!-- ##### STRUCT GstDiskSrcClass ##### -->
+<!-- ##### ARG GstAsyncDiskSrc:size ##### -->
<para>
</para>
-<!-- ##### ARG GstAsyncDiskSrc:size ##### -->
+<!-- ##### STRUCT GstDiskSrcClass ##### -->
<para>
</para>
</para>
-<!-- ##### FUNCTION gst_caps_register ##### -->
+<!-- ##### FUNCTION plugin_initialize ##### -->
<para>
</para>
-@factory:
-@Returns:
-<!-- ##### FUNCTION plugin_initialize ##### -->
+<!-- ##### FUNCTION gst_caps_register ##### -->
<para>
</para>
+@factory:
+@Returns:
<!-- ##### ARG GstAsyncDiskSrc:location ##### -->
<para>
</para>
-<!-- ##### MACRO GST_IS_ASYNCDISKSRC_CLASS ##### -->
+<!-- ##### FUNCTION gst_sinesrc_new ##### -->
<para>
</para>
-@obj:
+@name:
+@Returns:
-<!-- ##### FUNCTION gst_sinesrc_new ##### -->
+<!-- ##### MACRO GST_IS_ASYNCDISKSRC_CLASS ##### -->
<para>
</para>
-@name:
-@Returns:
+@obj:
<!-- ##### ARG GstAudioSrc:curoffset ##### -->
<para>
@klass:
-<!-- ##### MACRO GST_ASYNCDISKSRC ##### -->
+<!-- ##### MACRO GST_HTTPSRC_CLASS ##### -->
<para>
</para>
-@obj:
+@klass:
-<!-- ##### MACRO GST_HTTPSRC_CLASS ##### -->
+<!-- ##### MACRO GST_ASYNCDISKSRC ##### -->
<para>
</para>
-@klass:
+@obj:
<!-- ##### ARG GstPad:active ##### -->
<para>
* Decrease the refcount of this caps structure,
* destroying it when the refcount is 0
*
- * Retruns: caps or NULL if the refcount reached 0
+ * Returns: caps or NULL if the refcount reached 0
*/
GstCaps*
gst_caps_unref (GstCaps *caps)
*
* Increase the refcount of this caps structure
*
- * Returnns: the caps with the refcount incremented
+ * Returns: the caps with the refcount incremented
*/
GstCaps*
gst_caps_ref (GstCaps *caps)
}
#endif /* gst_object_sink */
+/**
+ * gst_object_save_thyself:
+ * @object: GstObject to save
+ * @parent: The parent XML node to save the object into
+ *
+ * Saves the given object into the parent XML node.
+ *
+ * Returns: the new xmlNodePtr with the saved object
+ */
xmlNodePtr
gst_object_save_thyself (GstObject *object, xmlNodePtr parent)
{
/**
* gst_pad_set_bufferpool_function:
* @pad: the pad to set the bufferpool function for
- * @newcaps: the bufferpool function
+ * @bufpool: the bufferpool function
*
* Set the given bufferpool function for the pad.
*/
return GST_PAD(GST_PAD_PEER(pad));
}
+/**
+ * gst_pad_get_buffer_pool:
+ * @pad: the pad to get the bufferpool from
+ *
+ * Gst the bufferpool of the peer pad of the given
+ * pad
+ *
+ * Returns: The GstBufferPool or NULL.
+ */
GstBufferPool*
gst_pad_get_bufferpool (GstPad *pad)
{
GstPad *srcpad, *sinkpad;
GstPad *srcpadtempl, *sinkpadtempl;
-static GstPadFactory src_factory = {
- "src",
- GST_PAD_FACTORY_SRC,
- GST_PAD_FACTORY_ALWAYS,
- GST_PAD_FACTORY_CAPS(
- "test_src",
- "video/raw",
- "height", GST_PROPS_INT_RANGE (16, 4096)
- ),
- NULL,
-};
-
-static GstPadFactory sink_factory = {
- "sink",
- GST_PAD_FACTORY_SINK,
- GST_PAD_FACTORY_ALWAYS,
- GST_PAD_FACTORY_CAPS(
- "test_sink",
- "video/raw",
- "height", GST_PROPS_INT_RANGE (16, 8192)
- ),
- NULL,
-};
-
-static GstCapsFactory sink_caps = {
- "sink_caps",
- "video/raw",
- "height", GST_PROPS_INT (3000),
- NULL
-};
-
-static GstCapsFactory src_caps = {
- "src_caps",
- "video/raw",
- "height", GST_PROPS_INT (3000),
- NULL
-};
+static GstPadTemplate*
+src_template_factory (void)
+{
+ static GstPadTemplate *templ = NULL;
+
+ if (!templ) {
+ templ = gst_padtemplate_new (
+ "src",
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ gst_caps_new (
+ "test_src",
+ "video/raw",
+ gst_props_new (
+ "height", GST_PROPS_INT_RANGE (16, 4096),
+ NULL)),
+ NULL);
+ }
+ return templ;
+}
-static GstPadTemplate *srctempl, *sinktempl;
-static GstCaps *srccaps, *sinkcaps;
+static GstPadTemplate*
+sink_template_factory (void)
+{
+ static GstPadTemplate *templ = NULL;
+
+ if (!templ) {
+ templ = gst_padtemplate_new (
+ "sink",
+ GST_PAD_SINK,
+ GST_PAD_ALWAYS,
+ gst_caps_new (
+ "test_sink",
+ "video/raw",
+ gst_props_new (
+ "height", GST_PROPS_INT_RANGE (16, 8192),
+ NULL)),
+ NULL);
+ }
+ return templ;
+}
+
+static GstCaps*
+sink_caps_factory (void)
+{
+ static GstCaps *caps = NULL;
+
+ if (!caps) {
+ caps = gst_caps_new (
+ "sink_caps",
+ "video/raw",
+ gst_props_new (
+ "height", GST_PROPS_INT (3000),
+ NULL));
+ }
+ return caps;
+}
+
+static GstCaps*
+src_caps_factory (void)
+{
+ static GstCaps *caps = NULL;
+
+ if (!caps) {
+ caps = gst_caps_new (
+ "src_caps",
+ "video/raw",
+ gst_props_new (
+ "height", GST_PROPS_INT (3000),
+ NULL));
+ }
+ return caps;
+}
static GstPadNegotiateReturn
-negotiate_src (GstPad *pad, GstCaps **caps, gint counter)
+negotiate_src (GstPad *pad, GstCaps **caps, gpointer *data)
{
g_print (">");
- if (counter == 0) {
+ if (*data == NULL) {
+ *data = GINT_TO_POINTER (TRUE);
*caps = NULL;
return GST_PAD_NEGOTIATE_TRY;
}
}
static GstPadNegotiateReturn
-negotiate_sink (GstPad *pad, GstCaps **caps, gint counter)
+negotiate_sink (GstPad *pad, GstCaps **caps, gpointer *data)
{
g_print ("<");
- if (counter == 0) {
+ if (*data == NULL) {
+ *data = GINT_TO_POINTER (TRUE);
*caps = NULL;
return GST_PAD_NEGOTIATE_TRY;
}
return GST_PAD_NEGOTIATE_FAIL;
}
+static GstPadTemplate *srctempl, *sinktempl;
+static GstCaps *srccaps, *sinkcaps;
+
static gboolean
perform_check (void)
{
srcpad = gst_pad_new ("src", GST_PAD_SRC);
sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
- srctempl = gst_padtemplate_new (&src_factory);
- sinktempl = gst_padtemplate_new (&sink_factory);
+ srctempl = src_template_factory ();
+ sinktempl = sink_template_factory ();
- srcpadtempl = gst_pad_new_from_template (srctempl, "src");
- sinkpadtempl = gst_pad_new_from_template (sinktempl, "sink");
+ srcpadtempl = gst_pad_new_from_template (src_template_factory (), "src");
+ sinkpadtempl = gst_pad_new_from_template (sink_template_factory (), "sink");
- sinkcaps = gst_caps_register (&sink_caps);
- srccaps = gst_caps_register (&src_caps);
+ sinkcaps = sink_caps_factory ();
+ srccaps = src_caps_factory ();
g_print ("*** compatible caps/templates ***\n");
GstPad *srcpad, *sinkpad;
GstPad *srcconvpad, *sinkconvpad;
-GstPad *srcpadtempl, *sinkpadtempl;
-GstPad *srcconvtempl, *sinkconvtempl;
+GstPadTemplate *srcpadtempl, *sinkpadtempl;
+GstPadTemplate *srcconvtempl, *sinkconvtempl;
gint converter_in = -1, converter_out = -1;
-static GstPadFactory src_factory = {
- "src",
- GST_PAD_FACTORY_SRC,
- GST_PAD_FACTORY_ALWAYS,
- GST_PAD_FACTORY_CAPS(
- "test_src",
- "audio/raw",
- "rate", GST_PROPS_INT_RANGE (16, 20000)
- ),
- NULL,
-};
-
-static GstPadFactory src_conv_factory = {
- "src",
- GST_PAD_FACTORY_SRC,
- GST_PAD_FACTORY_ALWAYS,
- GST_PAD_FACTORY_CAPS(
- "test_src",
- "audio/raw",
- "rate", GST_PROPS_INT_RANGE (16, 20000)
- ),
- NULL,
-};
-
-static GstPadFactory sink_conv_factory = {
- "src",
- GST_PAD_FACTORY_SINK,
- GST_PAD_FACTORY_ALWAYS,
- GST_PAD_FACTORY_CAPS(
- "test_src",
- "audio/raw",
- "rate", GST_PROPS_INT_RANGE (16, 20000)
- ),
- NULL,
-};
-
-static GstPadFactory sink_factory = {
- "sink",
- GST_PAD_FACTORY_SINK,
- GST_PAD_FACTORY_ALWAYS,
- GST_PAD_FACTORY_CAPS(
- "test_sink",
- "audio/raw",
- "rate", GST_PROPS_INT_RANGE (16, 20000)
- ),
- NULL,
-};
-
-static GstCapsFactory sink_caps = {
- "sink_caps",
- "audio/raw",
- "rate", GST_PROPS_INT (6000),
- NULL
-};
-
-static GstCapsFactory src_caps = {
- "src_caps",
- "audio/raw",
- "rate", GST_PROPS_INT (3000),
- NULL
-};
+static GstPadTemplate*
+src_factory (void)
+{
+ return
+ gst_padtemplate_new (
+ "src",
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ gst_caps_new (
+ "test_src",
+ "audio/raw",
+ gst_props_new (
+ "rate", GST_PROPS_INT_RANGE (16, 20000),
+ NULL)),
+ NULL);
+}
+
+static GstPadTemplate*
+src_conv_factory (void)
+{
+ return
+ gst_padtemplate_new (
+ "src",
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ gst_caps_new (
+ "test_src",
+ "audio/raw",
+ gst_props_new (
+ "rate", GST_PROPS_INT_RANGE (16, 20000),
+ NULL)),
+ NULL);
+}
+
+static GstPadTemplate*
+sink_conv_factory (void)
+{
+ return
+ gst_padtemplate_new (
+ "src",
+ GST_PAD_SINK,
+ GST_PAD_ALWAYS,
+ gst_caps_new (
+ "test_src",
+ "audio/raw",
+ gst_props_new (
+ "rate", GST_PROPS_INT_RANGE (16, 20000),
+ NULL)),
+ NULL);
+}
+
+static GstPadTemplate*
+sink_factory (void)
+{
+ return
+ gst_padtemplate_new (
+ "sink",
+ GST_PAD_SINK,
+ GST_PAD_ALWAYS,
+ gst_caps_new (
+ "test_sink",
+ "audio/raw",
+ gst_props_new (
+ "rate", GST_PROPS_INT_RANGE (16, 20000),
+ NULL)),
+ NULL);
+}
+
+static GstCaps*
+sink_caps (void)
+{
+ return
+ gst_caps_new (
+ "sink_caps",
+ "audio/raw",
+ gst_props_new (
+ "rate", GST_PROPS_INT (6000),
+ NULL));
+}
+
+static GstCaps*
+src_caps (void)
+{
+ return
+ gst_caps_new (
+ "src_caps",
+ "audio/raw",
+ gst_props_new (
+ "rate", GST_PROPS_INT (3000),
+ NULL));
+}
static GstPadTemplate *srctempl, *sinktempl;
static GstCaps *srccaps, *sinkcaps;
static GstPadNegotiateReturn
-negotiate_src (GstPad *pad, GstCaps **caps, gint counter)
+negotiate_src (GstPad *pad, GstCaps **caps, gpointer *data)
{
g_print (">");
- if (counter == 0) {
+ if (data == NULL) {
*caps = NULL;
return GST_PAD_NEGOTIATE_TRY;
}
}
static GstPadNegotiateReturn
-negotiate_sink (GstPad *pad, GstCaps **caps, gint counter)
+negotiate_sink (GstPad *pad, GstCaps **caps, gpointer *data)
{
g_print ("<");
- if (counter == 0) {
+ if (data == NULL) {
*caps = NULL;
return GST_PAD_NEGOTIATE_TRY;
}
gst_init (&argc, &argv);
- srctempl = gst_padtemplate_new (&src_factory);
- sinktempl = gst_padtemplate_new (&sink_factory);
+ srctempl = src_factory ();
+ sinktempl = sink_factory ();
srcpad = gst_pad_new_from_template (srctempl, "src");
sinkpad = gst_pad_new_from_template (sinktempl, "sink");
- srcconvtempl = gst_padtemplate_new (&src_conv_factory);
- sinkconvtempl = gst_padtemplate_new (&sink_conv_factory);
+ srcconvtempl = src_conv_factory ();
+ sinkconvtempl = sink_conv_factory ();
srcconvpad = gst_pad_new_from_template (srcconvtempl, "src");
sinkconvpad = gst_pad_new_from_template (sinkconvtempl, "sink");
gst_pad_set_negotiate_function (srcconvpad, negotiate_src);
gst_pad_set_negotiate_function (sinkconvpad, negotiate_sink);
- sinkcaps = gst_caps_register (&sink_caps);
- srccaps = gst_caps_register (&src_caps);
+ sinkcaps = sink_caps ();
+ srccaps = src_caps ();
+
result = gst_pad_set_caps (srcpad, srccaps);
g_print ("set caps on src: %d\n", result);
g_print ("initial converter status: %d %d\n", converter_in, converter_out);
GstPad *srcpad, *sinkpad;
GstPad *srcconvpad, *sinkconvpad;
-GstPad *srcpadtempl, *sinkpadtempl;
-GstPad *srcconvtempl, *sinkconvtempl;
+GstPadTemplate *srcpadtempl, *sinkpadtempl;
+GstPadTemplate *srcconvtempl, *sinkconvtempl;
gint converter_in = -1, converter_out = -1;
gint target_rate = 2000;
-static GstPadFactory src_factory = {
- "src",
- GST_PAD_FACTORY_SRC,
- GST_PAD_FACTORY_ALWAYS,
- GST_PAD_FACTORY_CAPS(
- "test_src",
- "audio/raw",
- "rate", GST_PROPS_INT_RANGE (16, 20000)
- ),
- NULL,
-};
-
-static GstPadFactory src_conv_factory = {
- "src",
- GST_PAD_FACTORY_SRC,
- GST_PAD_FACTORY_ALWAYS,
- GST_PAD_FACTORY_CAPS(
- "test_src",
- "audio/raw",
- "rate", GST_PROPS_INT_RANGE (16, 20000)
- ),
- NULL,
-};
-
-static GstPadFactory sink_conv_factory = {
- "src",
- GST_PAD_FACTORY_SINK,
- GST_PAD_FACTORY_ALWAYS,
- GST_PAD_FACTORY_CAPS(
- "test_src",
- "audio/raw",
- "rate", GST_PROPS_INT_RANGE (16, 20000)
- ),
- NULL,
-};
-
-static GstPadFactory sink_factory = {
- "sink",
- GST_PAD_FACTORY_SINK,
- GST_PAD_FACTORY_ALWAYS,
- GST_PAD_FACTORY_CAPS(
- "test_sink",
- "audio/raw",
- "rate", GST_PROPS_INT_RANGE (16, 20000)
- ),
- NULL,
-};
-
-static GstCapsFactory sink_caps = {
- "sink_caps",
- "audio/raw",
- "rate", GST_PROPS_INT (6000),
- NULL
-};
-
-static GstCapsFactory src_caps = {
- "src_caps",
- "audio/raw",
- "rate", GST_PROPS_INT (3000),
- NULL
-};
+static GstPadTemplate*
+src_factory (void)
+{
+ return
+ gst_padtemplate_new (
+ "src",
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ gst_caps_new (
+ "test_src",
+ "audio/raw",
+ gst_props_new (
+ "rate", GST_PROPS_INT_RANGE (16, 20000),
+ NULL)),
+ NULL);
+}
+
+static GstPadTemplate*
+src_conv_factory (void)
+{
+ return
+ gst_padtemplate_new (
+ "src",
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ gst_caps_new (
+ "test_src",
+ "audio/raw",
+ gst_props_new (
+ "rate", GST_PROPS_INT_RANGE (16, 20000),
+ NULL)),
+ NULL);
+}
+
+static GstPadTemplate*
+sink_conv_factory (void)
+{
+ return
+ gst_padtemplate_new (
+ "src",
+ GST_PAD_SINK,
+ GST_PAD_ALWAYS,
+ gst_caps_new (
+ "test_src",
+ "audio/raw",
+ gst_props_new (
+ "rate", GST_PROPS_INT_RANGE (16, 20000),
+ NULL)),
+ NULL);
+}
+
+static GstPadTemplate*
+sink_factory (void)
+{
+ return
+ gst_padtemplate_new (
+ "sink",
+ GST_PAD_SINK,
+ GST_PAD_ALWAYS,
+ gst_caps_new (
+ "test_sink",
+ "audio/raw",
+ gst_props_new (
+ "rate", GST_PROPS_INT_RANGE (16, 20000),
+ NULL)),
+ NULL);
+}
+
+static GstCaps*
+sink_caps (void)
+{
+ return
+ gst_caps_new (
+ "sink_caps",
+ "audio/raw",
+ gst_props_new (
+ "rate", GST_PROPS_INT (6000),
+ NULL));
+}
+
+static GstCaps*
+src_caps (void)
+{
+ return
+ gst_caps_new (
+ "src_caps",
+ "audio/raw",
+ gst_props_new (
+ "rate", GST_PROPS_INT (3000),
+ NULL));
+}
static GstPadTemplate *srctempl, *sinktempl;
static GstCaps *srccaps, *sinkcaps;
static GstPadNegotiateReturn
-converter_negotiate_src (GstPad *pad, GstCaps **caps, gint counter)
+converter_negotiate_src (GstPad *pad, GstCaps **caps, gpointer *data)
{
g_print (">");
- if (counter == 0) {
+ if (*data == NULL) {
*caps = NULL;
return GST_PAD_NEGOTIATE_TRY;
}
}
static GstPadNegotiateReturn
-converter_negotiate_sink (GstPad *pad, GstCaps **caps, gint counter)
+converter_negotiate_sink (GstPad *pad, GstCaps **caps, gpointer *data)
{
g_print ("<");
- if (counter == 0) {
+ if (*data == NULL) {
*caps = GST_PAD_CAPS (srcconvpad);
return GST_PAD_NEGOTIATE_TRY;
}
if (*caps) {
converter_in = gst_caps_get_int (*caps, "rate");
- if (counter == 1) {
+ if (*data == 1) {
converter_out = gst_caps_get_int (*caps, "rate");
- return gst_pad_negotiate_proxy (pad, srcconvpad, caps, counter);
+ return gst_pad_negotiate_proxy (pad, srcconvpad, caps);
}
return GST_PAD_NEGOTIATE_AGREE;
}
}
static GstPadNegotiateReturn
-target_negotiate_sink (GstPad *pad, GstCaps **caps, gint counter)
+target_negotiate_sink (GstPad *pad, GstCaps **caps, gpointer *data)
{
g_print ("{");
- if (counter == 0) {
- *caps = gst_caps_new_with_props (
+ if (*data == NULL) {
+ *caps = gst_caps_new (
"target_caps",
"audio/raw",
gst_props_new (
gst_init (&argc, &argv);
- srctempl = gst_padtemplate_new (&src_factory);
- sinktempl = gst_padtemplate_new (&sink_factory);
+ srctempl = src_factory ();
+ sinktempl = sink_factory ();
srcpad = gst_pad_new_from_template (srctempl, "src");
sinkpad = gst_pad_new_from_template (sinktempl, "sink");
- srcconvtempl = gst_padtemplate_new (&src_conv_factory);
- sinkconvtempl = gst_padtemplate_new (&sink_conv_factory);
+ srcconvtempl = src_conv_factory ();
+ sinkconvtempl = sink_conv_factory ();
srcconvpad = gst_pad_new_from_template (srcconvtempl, "csrc");
sinkconvpad = gst_pad_new_from_template (sinkconvtempl, "csink");
gst_pad_set_negotiate_function (sinkconvpad, converter_negotiate_sink);
gst_pad_set_negotiate_function (sinkpad, target_negotiate_sink);
- sinkcaps = gst_caps_register (&sink_caps);
- srccaps = gst_caps_register (&src_caps);
+ sinkcaps = sink_caps ();
+ srccaps = src_caps ();
g_print ("-------) (-----------) (----- \n");
g_print (" ! ! converter ! ! \n");
GstPad *srcconvpad, *sinkconvpad;
GstPadTemplate *srcconvtempl, *sinkconvtempl;
-static GstPadFactory src_conv_factory = {
- "src",
- GST_PAD_FACTORY_SRC,
- GST_PAD_FACTORY_ALWAYS,
- GST_PAD_FACTORY_CAPS(
- "test_src",
- "audio/raw",
- "rate", GST_PROPS_INT_RANGE (16, 20000)
- ),
- NULL,
-};
-
-static GstPadFactory sink_conv_factory = {
- "src",
- GST_PAD_FACTORY_SINK,
- GST_PAD_FACTORY_ALWAYS,
- GST_PAD_FACTORY_CAPS(
- "test_src",
- "audio/raw",
- "rate", GST_PROPS_INT_RANGE (16, 20000)
- ),
- NULL,
-};
-
-static GstCapsFactory src_caps = {
- "src_caps",
- "audio/raw",
- "rate", GST_PROPS_INT (3000),
- NULL
-};
+static GstPadTemplate*
+src_conv_factory (void)
+{
+ return
+ gst_padtemplate_new (
+ "src",
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ gst_caps_new (
+ "test_src",
+ "audio/raw",
+ gst_props_new (
+ "rate", GST_PROPS_INT_RANGE (16, 20000),
+ NULL)),
+ NULL);
+}
+
+static GstPadTemplate*
+sink_conv_factory (void)
+{
+ return
+ gst_padtemplate_new (
+ "sink",
+ GST_PAD_SINK,
+ GST_PAD_ALWAYS,
+ gst_caps_new (
+ "test_src",
+ "audio/raw",
+ gst_props_new (
+ "rate", GST_PROPS_INT_RANGE (16, 20000),
+ NULL)),
+ NULL);
+}
+
+static GstCaps*
+src_caps (void)
+{
+ return
+ gst_caps_new (
+ "src_caps",
+ "audio/raw",
+ gst_props_new (
+ "rate", GST_PROPS_INT (3000),
+ NULL));
+}
static GstCaps *srccaps, *sinkcaps;
static gint sink_rate = 100;
static GstPadNegotiateReturn
-negotiate_src (GstPad *pad, GstCaps **caps, gint counter)
+negotiate_src (GstPad *pad, GstCaps **caps, gpointer *data)
{
g_print (">(%d:%d)", src_rate, (*caps)->refcount);
src_rate++;
- if (counter == 0 || caps == NULL) {
+ if (*data == NULL || caps == NULL) {
g_print ("*");
- *caps = gst_caps_new_with_props (
+ *caps = gst_caps_new (
"src_caps",
"audio/raw",
gst_props_new (
}
static GstPadNegotiateReturn
-negotiate_sink (GstPad *pad, GstCaps **caps, gint counter)
+negotiate_sink (GstPad *pad, GstCaps **caps, gpointer *data)
{
g_print ("<(%d:%d:%p)", sink_rate, (*caps)->refcount, *caps);
sink_rate++;
- if (counter == 0 || *caps == NULL) {
+ if (*data == NULL || *caps == NULL) {
g_print ("*");
- *caps = gst_caps_new_with_props (
+ *caps = gst_caps_new (
"sink_caps",
"audio/raw",
gst_props_new (
g_mem_chunk_info();
- srcconvtempl = gst_padtemplate_new (&src_conv_factory);
- sinkconvtempl = gst_padtemplate_new (&sink_conv_factory);
+ srcconvtempl = src_conv_factory ();
+ sinkconvtempl = sink_conv_factory ();
srcconvpad = gst_pad_new_from_template (srcconvtempl, "src");
sinkconvpad = gst_pad_new_from_template (sinkconvtempl, "sink");
gst_pad_set_negotiate_function (srcconvpad, negotiate_src);
gst_pad_set_negotiate_function (sinkconvpad, negotiate_sink);
- srccaps = gst_caps_register (&src_caps);
+ srccaps = src_caps ();
sinkcaps = gst_caps_copy (srccaps);
g_print ("The wild goose chase...\n");
GstPad *srcpad, *sinkpad;
GstPad *srcpadtempl, *sinkpadtempl;
-static GstPadFactory src_factory = {
- "src",
- GST_PAD_FACTORY_SRC,
- GST_PAD_FACTORY_ALWAYS,
- GST_PAD_FACTORY_CAPS(
- "test_src",
- "video/raw",
- "height", GST_PROPS_INT_RANGE (16, 4096)
- ),
- NULL,
-};
-
-static GstPadFactory sink_factory = {
- "sink",
- GST_PAD_FACTORY_SINK,
- GST_PAD_FACTORY_ALWAYS,
- GST_PAD_FACTORY_CAPS(
- "test_sink",
- "video/raw",
- "height", GST_PROPS_INT_RANGE (16, 8192)
- ),
- NULL,
-};
-
-static GstCapsFactory sink_caps = {
- "sink_caps",
- "video/raw",
- "height", GST_PROPS_INT (3000),
- NULL
-};
-
-static GstCapsFactory src_caps = {
- "src_caps",
- "video/raw",
- "height", GST_PROPS_INT (3000),
- NULL
-};
+static GstPadTemplate*
+src_template_factory (void)
+{
+ static GstPadTemplate *templ = NULL;
+
+ if (!templ) {
+ templ = gst_padtemplate_new (
+ "src",
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ gst_caps_new (
+ "test_src",
+ "video/raw",
+ gst_props_new (
+ "height", GST_PROPS_INT_RANGE (16, 4096),
+ NULL)),
+ NULL);
+ }
+ return templ;
+}
-static GstPadTemplate *srctempl, *sinktempl;
-static GstCaps *srccaps, *sinkcaps;
+static GstPadTemplate*
+sink_template_factory (void)
+{
+ static GstPadTemplate *templ = NULL;
+
+ if (!templ) {
+ templ = gst_padtemplate_new (
+ "sink",
+ GST_PAD_SINK,
+ GST_PAD_ALWAYS,
+ gst_caps_new (
+ "test_sink",
+ "video/raw",
+ gst_props_new (
+ "height", GST_PROPS_INT_RANGE (16, 8192),
+ NULL)),
+ NULL);
+ }
+ return templ;
+}
+
+static GstCaps*
+sink_caps_factory (void)
+{
+ static GstCaps *caps = NULL;
+
+ if (!caps) {
+ caps = gst_caps_new (
+ "sink_caps",
+ "video/raw",
+ gst_props_new (
+ "height", GST_PROPS_INT (3000),
+ NULL));
+ }
+ return caps;
+}
+
+static GstCaps*
+src_caps_factory (void)
+{
+ static GstCaps *caps = NULL;
+
+ if (!caps) {
+ caps = gst_caps_new (
+ "src_caps",
+ "video/raw",
+ gst_props_new (
+ "height", GST_PROPS_INT (3000),
+ NULL));
+ }
+ return caps;
+}
static GstPadNegotiateReturn
-negotiate_src (GstPad *pad, GstCaps **caps, gint counter)
+negotiate_src (GstPad *pad, GstCaps **caps, gpointer *data)
{
g_print (">");
- if (counter == 0) {
+ if (*data == NULL) {
+ *data = GINT_TO_POINTER (TRUE);
*caps = NULL;
return GST_PAD_NEGOTIATE_TRY;
}
}
static GstPadNegotiateReturn
-negotiate_sink (GstPad *pad, GstCaps **caps, gint counter)
+negotiate_sink (GstPad *pad, GstCaps **caps, gpointer *data)
{
g_print ("<");
- if (counter == 0) {
+ if (*data == NULL) {
+ *data = GINT_TO_POINTER (TRUE);
*caps = NULL;
return GST_PAD_NEGOTIATE_TRY;
}
return GST_PAD_NEGOTIATE_FAIL;
}
+static GstPadTemplate *srctempl, *sinktempl;
+static GstCaps *srccaps, *sinkcaps;
+
static gboolean
perform_check (void)
{
srcpad = gst_pad_new ("src", GST_PAD_SRC);
sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
- srctempl = gst_padtemplate_new (&src_factory);
- sinktempl = gst_padtemplate_new (&sink_factory);
+ srctempl = src_template_factory ();
+ sinktempl = sink_template_factory ();
- srcpadtempl = gst_pad_new_from_template (srctempl, "src");
- sinkpadtempl = gst_pad_new_from_template (sinktempl, "sink");
+ srcpadtempl = gst_pad_new_from_template (src_template_factory (), "src");
+ sinkpadtempl = gst_pad_new_from_template (sink_template_factory (), "sink");
- sinkcaps = gst_caps_register (&sink_caps);
- srccaps = gst_caps_register (&src_caps);
+ sinkcaps = sink_caps_factory ();
+ srccaps = src_caps_factory ();
g_print ("*** compatible caps/templates ***\n");
GstPad *srcpad, *sinkpad;
GstPad *srcconvpad, *sinkconvpad;
-GstPad *srcpadtempl, *sinkpadtempl;
-GstPad *srcconvtempl, *sinkconvtempl;
+GstPadTemplate *srcpadtempl, *sinkpadtempl;
+GstPadTemplate *srcconvtempl, *sinkconvtempl;
gint converter_in = -1, converter_out = -1;
-static GstPadFactory src_factory = {
- "src",
- GST_PAD_FACTORY_SRC,
- GST_PAD_FACTORY_ALWAYS,
- GST_PAD_FACTORY_CAPS(
- "test_src",
- "audio/raw",
- "rate", GST_PROPS_INT_RANGE (16, 20000)
- ),
- NULL,
-};
-
-static GstPadFactory src_conv_factory = {
- "src",
- GST_PAD_FACTORY_SRC,
- GST_PAD_FACTORY_ALWAYS,
- GST_PAD_FACTORY_CAPS(
- "test_src",
- "audio/raw",
- "rate", GST_PROPS_INT_RANGE (16, 20000)
- ),
- NULL,
-};
-
-static GstPadFactory sink_conv_factory = {
- "src",
- GST_PAD_FACTORY_SINK,
- GST_PAD_FACTORY_ALWAYS,
- GST_PAD_FACTORY_CAPS(
- "test_src",
- "audio/raw",
- "rate", GST_PROPS_INT_RANGE (16, 20000)
- ),
- NULL,
-};
-
-static GstPadFactory sink_factory = {
- "sink",
- GST_PAD_FACTORY_SINK,
- GST_PAD_FACTORY_ALWAYS,
- GST_PAD_FACTORY_CAPS(
- "test_sink",
- "audio/raw",
- "rate", GST_PROPS_INT_RANGE (16, 20000)
- ),
- NULL,
-};
-
-static GstCapsFactory sink_caps = {
- "sink_caps",
- "audio/raw",
- "rate", GST_PROPS_INT (6000),
- NULL
-};
-
-static GstCapsFactory src_caps = {
- "src_caps",
- "audio/raw",
- "rate", GST_PROPS_INT (3000),
- NULL
-};
+static GstPadTemplate*
+src_factory (void)
+{
+ return
+ gst_padtemplate_new (
+ "src",
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ gst_caps_new (
+ "test_src",
+ "audio/raw",
+ gst_props_new (
+ "rate", GST_PROPS_INT_RANGE (16, 20000),
+ NULL)),
+ NULL);
+}
+
+static GstPadTemplate*
+src_conv_factory (void)
+{
+ return
+ gst_padtemplate_new (
+ "src",
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ gst_caps_new (
+ "test_src",
+ "audio/raw",
+ gst_props_new (
+ "rate", GST_PROPS_INT_RANGE (16, 20000),
+ NULL)),
+ NULL);
+}
+
+static GstPadTemplate*
+sink_conv_factory (void)
+{
+ return
+ gst_padtemplate_new (
+ "src",
+ GST_PAD_SINK,
+ GST_PAD_ALWAYS,
+ gst_caps_new (
+ "test_src",
+ "audio/raw",
+ gst_props_new (
+ "rate", GST_PROPS_INT_RANGE (16, 20000),
+ NULL)),
+ NULL);
+}
+
+static GstPadTemplate*
+sink_factory (void)
+{
+ return
+ gst_padtemplate_new (
+ "sink",
+ GST_PAD_SINK,
+ GST_PAD_ALWAYS,
+ gst_caps_new (
+ "test_sink",
+ "audio/raw",
+ gst_props_new (
+ "rate", GST_PROPS_INT_RANGE (16, 20000),
+ NULL)),
+ NULL);
+}
+
+static GstCaps*
+sink_caps (void)
+{
+ return
+ gst_caps_new (
+ "sink_caps",
+ "audio/raw",
+ gst_props_new (
+ "rate", GST_PROPS_INT (6000),
+ NULL));
+}
+
+static GstCaps*
+src_caps (void)
+{
+ return
+ gst_caps_new (
+ "src_caps",
+ "audio/raw",
+ gst_props_new (
+ "rate", GST_PROPS_INT (3000),
+ NULL));
+}
static GstPadTemplate *srctempl, *sinktempl;
static GstCaps *srccaps, *sinkcaps;
static GstPadNegotiateReturn
-negotiate_src (GstPad *pad, GstCaps **caps, gint counter)
+negotiate_src (GstPad *pad, GstCaps **caps, gpointer *data)
{
g_print (">");
- if (counter == 0) {
+ if (data == NULL) {
*caps = NULL;
return GST_PAD_NEGOTIATE_TRY;
}
}
static GstPadNegotiateReturn
-negotiate_sink (GstPad *pad, GstCaps **caps, gint counter)
+negotiate_sink (GstPad *pad, GstCaps **caps, gpointer *data)
{
g_print ("<");
- if (counter == 0) {
+ if (data == NULL) {
*caps = NULL;
return GST_PAD_NEGOTIATE_TRY;
}
gst_init (&argc, &argv);
- srctempl = gst_padtemplate_new (&src_factory);
- sinktempl = gst_padtemplate_new (&sink_factory);
+ srctempl = src_factory ();
+ sinktempl = sink_factory ();
srcpad = gst_pad_new_from_template (srctempl, "src");
sinkpad = gst_pad_new_from_template (sinktempl, "sink");
- srcconvtempl = gst_padtemplate_new (&src_conv_factory);
- sinkconvtempl = gst_padtemplate_new (&sink_conv_factory);
+ srcconvtempl = src_conv_factory ();
+ sinkconvtempl = sink_conv_factory ();
srcconvpad = gst_pad_new_from_template (srcconvtempl, "src");
sinkconvpad = gst_pad_new_from_template (sinkconvtempl, "sink");
gst_pad_set_negotiate_function (srcconvpad, negotiate_src);
gst_pad_set_negotiate_function (sinkconvpad, negotiate_sink);
- sinkcaps = gst_caps_register (&sink_caps);
- srccaps = gst_caps_register (&src_caps);
+ sinkcaps = sink_caps ();
+ srccaps = src_caps ();
+
result = gst_pad_set_caps (srcpad, srccaps);
g_print ("set caps on src: %d\n", result);
g_print ("initial converter status: %d %d\n", converter_in, converter_out);
GstPad *srcpad, *sinkpad;
GstPad *srcconvpad, *sinkconvpad;
-GstPad *srcpadtempl, *sinkpadtempl;
-GstPad *srcconvtempl, *sinkconvtempl;
+GstPadTemplate *srcpadtempl, *sinkpadtempl;
+GstPadTemplate *srcconvtempl, *sinkconvtempl;
gint converter_in = -1, converter_out = -1;
gint target_rate = 2000;
-static GstPadFactory src_factory = {
- "src",
- GST_PAD_FACTORY_SRC,
- GST_PAD_FACTORY_ALWAYS,
- GST_PAD_FACTORY_CAPS(
- "test_src",
- "audio/raw",
- "rate", GST_PROPS_INT_RANGE (16, 20000)
- ),
- NULL,
-};
-
-static GstPadFactory src_conv_factory = {
- "src",
- GST_PAD_FACTORY_SRC,
- GST_PAD_FACTORY_ALWAYS,
- GST_PAD_FACTORY_CAPS(
- "test_src",
- "audio/raw",
- "rate", GST_PROPS_INT_RANGE (16, 20000)
- ),
- NULL,
-};
-
-static GstPadFactory sink_conv_factory = {
- "src",
- GST_PAD_FACTORY_SINK,
- GST_PAD_FACTORY_ALWAYS,
- GST_PAD_FACTORY_CAPS(
- "test_src",
- "audio/raw",
- "rate", GST_PROPS_INT_RANGE (16, 20000)
- ),
- NULL,
-};
-
-static GstPadFactory sink_factory = {
- "sink",
- GST_PAD_FACTORY_SINK,
- GST_PAD_FACTORY_ALWAYS,
- GST_PAD_FACTORY_CAPS(
- "test_sink",
- "audio/raw",
- "rate", GST_PROPS_INT_RANGE (16, 20000)
- ),
- NULL,
-};
-
-static GstCapsFactory sink_caps = {
- "sink_caps",
- "audio/raw",
- "rate", GST_PROPS_INT (6000),
- NULL
-};
-
-static GstCapsFactory src_caps = {
- "src_caps",
- "audio/raw",
- "rate", GST_PROPS_INT (3000),
- NULL
-};
+static GstPadTemplate*
+src_factory (void)
+{
+ return
+ gst_padtemplate_new (
+ "src",
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ gst_caps_new (
+ "test_src",
+ "audio/raw",
+ gst_props_new (
+ "rate", GST_PROPS_INT_RANGE (16, 20000),
+ NULL)),
+ NULL);
+}
+
+static GstPadTemplate*
+src_conv_factory (void)
+{
+ return
+ gst_padtemplate_new (
+ "src",
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ gst_caps_new (
+ "test_src",
+ "audio/raw",
+ gst_props_new (
+ "rate", GST_PROPS_INT_RANGE (16, 20000),
+ NULL)),
+ NULL);
+}
+
+static GstPadTemplate*
+sink_conv_factory (void)
+{
+ return
+ gst_padtemplate_new (
+ "src",
+ GST_PAD_SINK,
+ GST_PAD_ALWAYS,
+ gst_caps_new (
+ "test_src",
+ "audio/raw",
+ gst_props_new (
+ "rate", GST_PROPS_INT_RANGE (16, 20000),
+ NULL)),
+ NULL);
+}
+
+static GstPadTemplate*
+sink_factory (void)
+{
+ return
+ gst_padtemplate_new (
+ "sink",
+ GST_PAD_SINK,
+ GST_PAD_ALWAYS,
+ gst_caps_new (
+ "test_sink",
+ "audio/raw",
+ gst_props_new (
+ "rate", GST_PROPS_INT_RANGE (16, 20000),
+ NULL)),
+ NULL);
+}
+
+static GstCaps*
+sink_caps (void)
+{
+ return
+ gst_caps_new (
+ "sink_caps",
+ "audio/raw",
+ gst_props_new (
+ "rate", GST_PROPS_INT (6000),
+ NULL));
+}
+
+static GstCaps*
+src_caps (void)
+{
+ return
+ gst_caps_new (
+ "src_caps",
+ "audio/raw",
+ gst_props_new (
+ "rate", GST_PROPS_INT (3000),
+ NULL));
+}
static GstPadTemplate *srctempl, *sinktempl;
static GstCaps *srccaps, *sinkcaps;
static GstPadNegotiateReturn
-converter_negotiate_src (GstPad *pad, GstCaps **caps, gint counter)
+converter_negotiate_src (GstPad *pad, GstCaps **caps, gpointer *data)
{
g_print (">");
- if (counter == 0) {
+ if (*data == NULL) {
*caps = NULL;
return GST_PAD_NEGOTIATE_TRY;
}
}
static GstPadNegotiateReturn
-converter_negotiate_sink (GstPad *pad, GstCaps **caps, gint counter)
+converter_negotiate_sink (GstPad *pad, GstCaps **caps, gpointer *data)
{
g_print ("<");
- if (counter == 0) {
+ if (*data == NULL) {
*caps = GST_PAD_CAPS (srcconvpad);
return GST_PAD_NEGOTIATE_TRY;
}
if (*caps) {
converter_in = gst_caps_get_int (*caps, "rate");
- if (counter == 1) {
+ if (*data == 1) {
converter_out = gst_caps_get_int (*caps, "rate");
- return gst_pad_negotiate_proxy (pad, srcconvpad, caps, counter);
+ return gst_pad_negotiate_proxy (pad, srcconvpad, caps);
}
return GST_PAD_NEGOTIATE_AGREE;
}
}
static GstPadNegotiateReturn
-target_negotiate_sink (GstPad *pad, GstCaps **caps, gint counter)
+target_negotiate_sink (GstPad *pad, GstCaps **caps, gpointer *data)
{
g_print ("{");
- if (counter == 0) {
- *caps = gst_caps_new_with_props (
+ if (*data == NULL) {
+ *caps = gst_caps_new (
"target_caps",
"audio/raw",
gst_props_new (
gst_init (&argc, &argv);
- srctempl = gst_padtemplate_new (&src_factory);
- sinktempl = gst_padtemplate_new (&sink_factory);
+ srctempl = src_factory ();
+ sinktempl = sink_factory ();
srcpad = gst_pad_new_from_template (srctempl, "src");
sinkpad = gst_pad_new_from_template (sinktempl, "sink");
- srcconvtempl = gst_padtemplate_new (&src_conv_factory);
- sinkconvtempl = gst_padtemplate_new (&sink_conv_factory);
+ srcconvtempl = src_conv_factory ();
+ sinkconvtempl = sink_conv_factory ();
srcconvpad = gst_pad_new_from_template (srcconvtempl, "csrc");
sinkconvpad = gst_pad_new_from_template (sinkconvtempl, "csink");
gst_pad_set_negotiate_function (sinkconvpad, converter_negotiate_sink);
gst_pad_set_negotiate_function (sinkpad, target_negotiate_sink);
- sinkcaps = gst_caps_register (&sink_caps);
- srccaps = gst_caps_register (&src_caps);
+ sinkcaps = sink_caps ();
+ srccaps = src_caps ();
g_print ("-------) (-----------) (----- \n");
g_print (" ! ! converter ! ! \n");
GstPad *srcconvpad, *sinkconvpad;
GstPadTemplate *srcconvtempl, *sinkconvtempl;
-static GstPadFactory src_conv_factory = {
- "src",
- GST_PAD_FACTORY_SRC,
- GST_PAD_FACTORY_ALWAYS,
- GST_PAD_FACTORY_CAPS(
- "test_src",
- "audio/raw",
- "rate", GST_PROPS_INT_RANGE (16, 20000)
- ),
- NULL,
-};
-
-static GstPadFactory sink_conv_factory = {
- "src",
- GST_PAD_FACTORY_SINK,
- GST_PAD_FACTORY_ALWAYS,
- GST_PAD_FACTORY_CAPS(
- "test_src",
- "audio/raw",
- "rate", GST_PROPS_INT_RANGE (16, 20000)
- ),
- NULL,
-};
-
-static GstCapsFactory src_caps = {
- "src_caps",
- "audio/raw",
- "rate", GST_PROPS_INT (3000),
- NULL
-};
+static GstPadTemplate*
+src_conv_factory (void)
+{
+ return
+ gst_padtemplate_new (
+ "src",
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ gst_caps_new (
+ "test_src",
+ "audio/raw",
+ gst_props_new (
+ "rate", GST_PROPS_INT_RANGE (16, 20000),
+ NULL)),
+ NULL);
+}
+
+static GstPadTemplate*
+sink_conv_factory (void)
+{
+ return
+ gst_padtemplate_new (
+ "sink",
+ GST_PAD_SINK,
+ GST_PAD_ALWAYS,
+ gst_caps_new (
+ "test_src",
+ "audio/raw",
+ gst_props_new (
+ "rate", GST_PROPS_INT_RANGE (16, 20000),
+ NULL)),
+ NULL);
+}
+
+static GstCaps*
+src_caps (void)
+{
+ return
+ gst_caps_new (
+ "src_caps",
+ "audio/raw",
+ gst_props_new (
+ "rate", GST_PROPS_INT (3000),
+ NULL));
+}
static GstCaps *srccaps, *sinkcaps;
static gint sink_rate = 100;
static GstPadNegotiateReturn
-negotiate_src (GstPad *pad, GstCaps **caps, gint counter)
+negotiate_src (GstPad *pad, GstCaps **caps, gpointer *data)
{
g_print (">(%d:%d)", src_rate, (*caps)->refcount);
src_rate++;
- if (counter == 0 || caps == NULL) {
+ if (*data == NULL || caps == NULL) {
g_print ("*");
- *caps = gst_caps_new_with_props (
+ *caps = gst_caps_new (
"src_caps",
"audio/raw",
gst_props_new (
}
static GstPadNegotiateReturn
-negotiate_sink (GstPad *pad, GstCaps **caps, gint counter)
+negotiate_sink (GstPad *pad, GstCaps **caps, gpointer *data)
{
g_print ("<(%d:%d:%p)", sink_rate, (*caps)->refcount, *caps);
sink_rate++;
- if (counter == 0 || *caps == NULL) {
+ if (*data == NULL || *caps == NULL) {
g_print ("*");
- *caps = gst_caps_new_with_props (
+ *caps = gst_caps_new (
"sink_caps",
"audio/raw",
gst_props_new (
g_mem_chunk_info();
- srcconvtempl = gst_padtemplate_new (&src_conv_factory);
- sinkconvtempl = gst_padtemplate_new (&sink_conv_factory);
+ srcconvtempl = src_conv_factory ();
+ sinkconvtempl = sink_conv_factory ();
srcconvpad = gst_pad_new_from_template (srcconvtempl, "src");
sinkconvpad = gst_pad_new_from_template (sinkconvtempl, "sink");
gst_pad_set_negotiate_function (srcconvpad, negotiate_src);
gst_pad_set_negotiate_function (sinkconvpad, negotiate_sink);
- srccaps = gst_caps_register (&src_caps);
+ srccaps = src_caps ();
sinkcaps = gst_caps_copy (srccaps);
g_print ("The wild goose chase...\n");