mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 15:04:46 +00:00
The first wave of docs updates
Original commit message from CVS: The first wave of docs updates Added a little more comments about the API usage in the api docs. Some fixes for the capsnego testsuite.
This commit is contained in:
parent
a8ba9c4122
commit
6bd5dcffab
24 changed files with 1126 additions and 636 deletions
configure.in
docs/gst
gst
tests/old/testsuite/capsnego
testsuite/capsnego
|
@ -837,6 +837,7 @@ plugins/filters/passthrough/Makefile
|
|||
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
|
||||
|
@ -884,6 +885,7 @@ examples/queue2/Makefile
|
|||
examples/queue3/Makefile
|
||||
examples/queue4/Makefile
|
||||
examples/thread/Makefile
|
||||
examples/mixer/Makefile
|
||||
examples/launch/Makefile
|
||||
examples/xml/Makefile
|
||||
examples/plugins/Makefile
|
||||
|
|
|
@ -27,6 +27,9 @@ cothread_get_data
|
|||
gst_init
|
||||
gst_main
|
||||
gst_main_quit
|
||||
GST_VERSION_MICRO
|
||||
GST_VERSION_MAJOR
|
||||
GST_VERSION_MINOR
|
||||
<SUBSECTION Standard>
|
||||
</SECTION>
|
||||
|
||||
|
@ -136,9 +139,13 @@ GST_BUFFER_SIZE
|
|||
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
|
||||
|
@ -367,12 +374,11 @@ GstPadGetRegionFunction
|
|||
GstPadQoSFunction
|
||||
GstPadEOSFunction
|
||||
GstPadNewCapsFunction
|
||||
|
||||
GstPadBufferPoolFunction
|
||||
|
||||
GstPadNegotiateReturn
|
||||
GstPadNegotiateFunction
|
||||
|
||||
|
||||
GstPadPushFunction
|
||||
GstPadPullFunction
|
||||
GstRegionType
|
||||
|
@ -391,6 +397,7 @@ gst_pad_set_negotiate_function
|
|||
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
|
||||
|
@ -410,6 +417,7 @@ gst_pad_disconnect
|
|||
gst_pad_push
|
||||
gst_pad_pull
|
||||
gst_pad_pullregion
|
||||
gst_pad_get_bufferpool
|
||||
gst_pad_set_eos
|
||||
gst_pad_handle_qos
|
||||
gst_pad_eos
|
||||
|
@ -439,6 +447,7 @@ GST_RPAD_QOSFUNC
|
|||
GST_RPAD_EOSFUNC
|
||||
GST_RPAD_NEGOTIATEFUNC
|
||||
GST_RPAD_NEWCAPSFUNC
|
||||
GST_RPAD_BUFFERPOOLFUNC
|
||||
|
||||
GST_GPAD_REALPAD
|
||||
GstGhostPad
|
||||
|
@ -450,6 +459,9 @@ GST_PADTEMPLATE_CAPS
|
|||
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
|
||||
|
@ -615,6 +627,9 @@ gst_typefactory_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
|
||||
|
@ -622,6 +637,7 @@ gst_caps_ref
|
|||
gst_caps_unref
|
||||
gst_caps_copy
|
||||
gst_caps_copy_on_write
|
||||
gst_caps_chain
|
||||
gst_caps_append
|
||||
gst_caps_prepend
|
||||
gst_caps_set_name
|
||||
|
|
|
@ -9,7 +9,6 @@ GtkObject
|
|||
GstFakeSrc
|
||||
GstFakeSink
|
||||
GstDiskSrc
|
||||
GstHttpSrc
|
||||
GstFdSrc
|
||||
GstSineSrc
|
||||
GstFdSink
|
||||
|
|
|
@ -53,3 +53,24 @@ pipeline</ulink> and Microsoft's DirectShow for some background.
|
|||
|
||||
|
||||
|
||||
<!-- ##### MACRO GST_VERSION_MICRO ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### MACRO GST_VERSION_MAJOR ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### MACRO GST_VERSION_MINOR ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -7,12 +7,92 @@ Automatically create and connect elements
|
|||
<!-- ##### 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>
|
||||
|
||||
<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 ##### -->
|
||||
|
@ -24,7 +104,7 @@ connecting elements.
|
|||
|
||||
<!-- ##### ENUM GstAutoplugFlags ##### -->
|
||||
<para>
|
||||
|
||||
The type of the autoplugger.
|
||||
</para>
|
||||
|
||||
@GST_AUTOPLUG_TO_CAPS:
|
||||
|
|
|
@ -43,10 +43,10 @@ Flags for a bin.
|
|||
|
||||
<!-- ##### MACRO gst_bin_destroy ##### -->
|
||||
<para>
|
||||
|
||||
Free the memory allocated by this bin
|
||||
</para>
|
||||
|
||||
@bin:
|
||||
@bin: the bin to free
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gst_bin_add ##### -->
|
||||
|
|
|
@ -102,6 +102,22 @@ Get the timestamp for this buffer.
|
|||
@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
|
||||
|
@ -160,6 +176,7 @@ used when data in a stream has been skipped
|
|||
@metas:
|
||||
@parent:
|
||||
@pool:
|
||||
@pool_private:
|
||||
|
||||
<!-- ##### FUNCTION gst_buffer_new ##### -->
|
||||
<para>
|
||||
|
|
|
@ -39,6 +39,34 @@ Unlock the caps structure
|
|||
@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>
|
||||
|
||||
|
@ -76,6 +104,7 @@ Unlock the caps structure
|
|||
</para>
|
||||
|
||||
@caps:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gst_caps_unref ##### -->
|
||||
|
@ -84,6 +113,7 @@ Unlock the caps structure
|
|||
</para>
|
||||
|
||||
@caps:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gst_caps_copy ##### -->
|
||||
|
@ -104,6 +134,16 @@ Unlock the caps structure
|
|||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gst_caps_chain ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@caps:
|
||||
@Varargs:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gst_caps_append ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -212,21 +252,21 @@ Unlock the caps structure
|
|||
|
||||
<!-- ##### 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 ##### -->
|
||||
|
@ -241,29 +281,29 @@ Unlock the caps structure
|
|||
|
||||
<!-- ##### 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 ##### -->
|
||||
|
|
|
@ -28,3 +28,8 @@ with the buffer. (fakesink)
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GstFakeSink:silent ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
|
|
@ -14,14 +14,3 @@ Reads data from a URL.
|
|||
|
||||
</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>
|
||||
|
||||
|
|
|
@ -157,11 +157,22 @@ The function that will be called in an EOS case.
|
|||
|
||||
<!-- ##### USER_FUNCTION GstPadNewCapsFunction ##### -->
|
||||
<para>
|
||||
|
||||
The function that will be called when the caps of the pad has
|
||||
changed.
|
||||
</para>
|
||||
|
||||
@pad:
|
||||
@caps:
|
||||
@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: the pad with the bufferpool
|
||||
@Returns: the GstBufferPool associated with this pad.
|
||||
|
||||
|
||||
<!-- ##### ENUM GstPadNegotiateReturn ##### -->
|
||||
|
@ -180,10 +191,8 @@ The function that will be called when negotiating.
|
|||
|
||||
@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 ##### -->
|
||||
|
@ -349,6 +358,15 @@ Destroy the pad.
|
|||
@newcaps:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gst_pad_set_bufferpool_function ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@pad:
|
||||
@bufpool:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gst_pad_set_caps ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -530,6 +548,15 @@ Destroy the pad.
|
|||
@size:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gst_pad_get_bufferpool ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@pad:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gst_pad_set_eos ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -657,6 +684,7 @@ Call the EOS function of the pad
|
|||
@pullregionfunc:
|
||||
@negotiatefunc:
|
||||
@newcapsfunc:
|
||||
@bufferpoolfunc:
|
||||
@ghostpads:
|
||||
|
||||
<!-- ##### MACRO GST_RPAD_DIRECTION ##### -->
|
||||
|
@ -771,6 +799,14 @@ Get the EOS function of the real pad.
|
|||
@pad:
|
||||
|
||||
|
||||
<!-- ##### MACRO GST_RPAD_BUFFERPOOLFUNC ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@pad:
|
||||
|
||||
|
||||
<!-- ##### MACRO GST_GPAD_REALPAD ##### -->
|
||||
<para>
|
||||
Get the real pad of this ghost pad.
|
||||
|
@ -849,6 +885,37 @@ Indicates when this pad will become available.
|
|||
@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>
|
||||
|
||||
|
|
|
@ -26,13 +26,14 @@ GstCaps
|
|||
|
||||
<!-- ##### 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 ##### -->
|
||||
|
@ -65,11 +66,7 @@ Create an integer range property.
|
|||
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 ##### -->
|
||||
|
@ -82,27 +79,27 @@ Create a boolean property.
|
|||
|
||||
<!-- ##### 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 ##### -->
|
||||
|
@ -113,8 +110,6 @@ Create a boolean property.
|
|||
@firstname:
|
||||
@Varargs:
|
||||
@Returns:
|
||||
<!-- # Unused Parameters # -->
|
||||
@entry:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gst_props_newv ##### -->
|
||||
|
|
|
@ -67,14 +67,6 @@ Query the element for the current mime type
|
|||
</para>
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gst_fdsink_chain ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@pad:
|
||||
@buf:
|
||||
|
||||
<!-- ##### FUNCTION gst_pad_remove_ghost_parent ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -83,7 +75,7 @@ Query the element for the current mime type
|
|||
@pad:
|
||||
@parent:
|
||||
|
||||
<!-- ##### FUNCTION gst_identity_chain ##### -->
|
||||
<!-- ##### FUNCTION gst_fdsink_chain ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
@ -91,7 +83,13 @@ Query the element for the current mime type
|
|||
@pad:
|
||||
@buf:
|
||||
|
||||
<!-- ##### FUNCTION gst_audiosink_chain ##### -->
|
||||
<!-- ##### ARG GstHttpSrc:location ##### -->
|
||||
<para>
|
||||
Specify the location of the file. The location must be a fully qualified URL.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gst_identity_chain ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
@ -106,6 +104,14 @@ Query the element for the current mime type
|
|||
|
||||
@Returns:
|
||||
|
||||
<!-- ##### FUNCTION gst_audiosink_chain ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@pad:
|
||||
@buf:
|
||||
|
||||
<!-- ##### MACRO GST_PIPELINE_CLASS ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -200,6 +206,12 @@ the stream.
|
|||
@gstsrc: the object which received the signal.
|
||||
@arg1: the object which received the signal
|
||||
|
||||
<!-- ##### TYPEDEF GstCapsFactoryEntry ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gst_disksrc_get_type ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -207,12 +219,6 @@ the stream.
|
|||
|
||||
@Returns:
|
||||
|
||||
<!-- ##### TYPEDEF GstCapsFactoryEntry ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### MACRO GST_IS_DISKSRC_CLASS ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -366,16 +372,16 @@ subclass use this to start their flag enumeration
|
|||
@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>
|
||||
|
||||
|
@ -655,13 +661,13 @@ Specify the current offset in the file.
|
|||
@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>
|
||||
|
@ -695,17 +701,24 @@ Specify the current offset in the file.
|
|||
@name:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### STRUCT GstConnection ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstQueueClass ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstConnection ##### -->
|
||||
<!-- ##### FUNCTION gst_fakesrc_push ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@src:
|
||||
|
||||
<!-- ##### FUNCTION gst_type_add_sink ##### -->
|
||||
<para>
|
||||
|
@ -715,13 +728,6 @@ Specify the current offset in the file.
|
|||
@id:
|
||||
@sink:
|
||||
|
||||
<!-- ##### FUNCTION gst_fakesrc_push ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@src:
|
||||
|
||||
<!-- ##### MACRO GST_IS_IDENTITY_CLASS ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -1135,13 +1141,6 @@ GstFilter
|
|||
|
||||
@obj:
|
||||
|
||||
<!-- ##### FUNCTION gst_fdsrc_get_type ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@Returns:
|
||||
|
||||
<!-- ##### MACRO GST_IS_QUEUE_CLASS ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -1149,6 +1148,13 @@ GstFilter
|
|||
|
||||
@obj:
|
||||
|
||||
<!-- ##### FUNCTION gst_fdsrc_get_type ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@Returns:
|
||||
|
||||
<!-- ##### FUNCTION gst_pad_get_type_id ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -1157,6 +1163,13 @@ GstFilter
|
|||
@pad:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### FUNCTION gst_thread_iterate ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@thread:
|
||||
|
||||
<!-- ##### STRUCT OverlayClip ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -1167,13 +1180,6 @@ GstFilter
|
|||
@y1:
|
||||
@y2:
|
||||
|
||||
<!-- ##### FUNCTION gst_thread_iterate ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@thread:
|
||||
|
||||
<!-- ##### ENUM GstSrcFlags ##### -->
|
||||
<para>
|
||||
Flags for the GstSrc element
|
||||
|
@ -1249,13 +1255,6 @@ Defines an entry for a padfactory.
|
|||
|
||||
@obj:
|
||||
|
||||
<!-- ##### MACRO GST_AUDIOSINK_CLASS ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@klass:
|
||||
|
||||
<!-- ##### FUNCTION gst_asyncdisksrc_get_type ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -1263,6 +1262,13 @@ Defines an entry for a padfactory.
|
|||
|
||||
@Returns:
|
||||
|
||||
<!-- ##### MACRO GST_AUDIOSINK_CLASS ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@klass:
|
||||
|
||||
<!-- ##### MACRO GST_PAD_FACTORY_SINK ##### -->
|
||||
<para>
|
||||
Indicates a sinkpad for the padfactory.
|
||||
|
@ -1298,6 +1304,12 @@ Indicates a sinkpad for the padfactory.
|
|||
@pad:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### MACRO GST_PROPS_FOURCC_ID ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gst_esdsink_new ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -1306,12 +1318,6 @@ Indicates a sinkpad for the padfactory.
|
|||
@name:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### MACRO GST_PROPS_FOURCC_ID ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gst_element_request_pad ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -1421,12 +1427,6 @@ This macro sets the given flags.
|
|||
@flag: Flag to set, can by any number of bits in guint32.
|
||||
@obj: GstSrc to set flag in.
|
||||
|
||||
<!-- ##### MACRO DEBUG_LEAVE_STRING ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### MACRO GST_PROPS_FLOAT_STRING ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -1434,6 +1434,12 @@ This macro sets the given flags.
|
|||
|
||||
@a:
|
||||
|
||||
<!-- ##### MACRO DEBUG_LEAVE_STRING ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gst_filter_get_type ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -1455,16 +1461,16 @@ This macro sets the given flags.
|
|||
</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>
|
||||
|
||||
|
@ -1602,6 +1608,13 @@ Indicates a srcpad for the padfactory.
|
|||
|
||||
@obj:
|
||||
|
||||
<!-- ##### ARG GstHttpSrc:bytesperread ##### -->
|
||||
<para>
|
||||
Specify how many bytes to read at a time.
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### MACRO GST_THREAD ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -1771,13 +1784,6 @@ or a video card.
|
|||
</para>
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gst_esdsink_get_type ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@Returns:
|
||||
|
||||
<!-- ##### MACRO GST_IS_BIN_CLASS ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -1785,6 +1791,13 @@ or a video card.
|
|||
|
||||
@obj:
|
||||
|
||||
<!-- ##### FUNCTION gst_esdsink_get_type ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@Returns:
|
||||
|
||||
<!-- ##### SECTION ./tmpl/GstElement.sgml:See_Also ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -1805,6 +1818,12 @@ Query whether this object has multiple input pads.
|
|||
|
||||
@obj: Element to query for multiple input pads.
|
||||
|
||||
<!-- ##### SECTION ./tmpl/gstfilter.sgml:See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### MACRO DEBUG_NOPREFIX ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -1813,12 +1832,6 @@ Query whether this object has multiple input pads.
|
|||
@format:
|
||||
@args...:
|
||||
|
||||
<!-- ##### SECTION ./tmpl/gstfilter.sgml:See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GstAudioSink:frequency ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -2236,6 +2249,13 @@ this in the factory definition.
|
|||
|
||||
@audiosink:
|
||||
|
||||
<!-- ##### MACRO GST_IS_FAKESINK ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@obj:
|
||||
|
||||
<!-- ##### MACRO GST_STATE_UNSET ##### -->
|
||||
<para>
|
||||
This macro unsets the given state on the element.
|
||||
|
@ -2244,13 +2264,6 @@ This macro unsets the given state on the element.
|
|||
@obj: Element to unset state of.
|
||||
@flag: State to unset, can be any number of bits in guint32.
|
||||
|
||||
<!-- ##### MACRO GST_IS_FAKESINK ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@obj:
|
||||
|
||||
<!-- ##### MACRO GST_QUEUE_CLASS ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -2323,13 +2336,6 @@ The number of bytes per read.
|
|||
|
||||
@obj:
|
||||
|
||||
<!-- ##### FUNCTION gst_sinesrc_get_type ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@Returns:
|
||||
|
||||
<!-- ##### MACRO ERROR_OBJECT ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -2340,6 +2346,13 @@ The number of bytes per read.
|
|||
@format:
|
||||
@args...:
|
||||
|
||||
<!-- ##### FUNCTION gst_sinesrc_get_type ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@Returns:
|
||||
|
||||
<!-- ##### MACRO GST_IS_IDENTITY ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -2444,14 +2457,9 @@ This macro sets the given state on the element.
|
|||
|
||||
@obj:
|
||||
|
||||
<!-- ##### FUNCTION gst_src_push_region ##### -->
|
||||
<para>
|
||||
<!-- ##### SECTION ./tmpl/videoraw.sgml:Short_Description ##### -->
|
||||
Information about video buffers.
|
||||
|
||||
</para>
|
||||
|
||||
@src:
|
||||
@offset:
|
||||
@size:
|
||||
|
||||
<!-- ##### FUNCTION gst_fdsink_get_type ##### -->
|
||||
<para>
|
||||
|
@ -2460,9 +2468,14 @@ This macro sets the given state on the element.
|
|||
|
||||
@Returns:
|
||||
|
||||
<!-- ##### SECTION ./tmpl/videoraw.sgml:Short_Description ##### -->
|
||||
Information about video buffers.
|
||||
<!-- ##### FUNCTION gst_src_push_region ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@src:
|
||||
@offset:
|
||||
@size:
|
||||
|
||||
<!-- ##### STRUCT GstPipelineClass ##### -->
|
||||
<para>
|
||||
|
@ -2566,13 +2579,13 @@ A flag indicating that SSE instructions are supported.
|
|||
|
||||
@obj:
|
||||
|
||||
<!-- ##### STRUCT GstDiskSrcClass ##### -->
|
||||
<!-- ##### ARG GstAsyncDiskSrc:size ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GstAsyncDiskSrc:size ##### -->
|
||||
<!-- ##### STRUCT GstDiskSrcClass ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
@ -2653,6 +2666,12 @@ Information about audio buffers.
|
|||
</para>
|
||||
|
||||
|
||||
<!-- ##### FUNCTION plugin_initialize ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gst_caps_register ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -2661,12 +2680,6 @@ Information about audio buffers.
|
|||
@factory:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### FUNCTION plugin_initialize ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GstAsyncDiskSrc:location ##### -->
|
||||
<para>
|
||||
Specify the location of the file to read.
|
||||
|
@ -2730,13 +2743,6 @@ the offset.
|
|||
</para>
|
||||
|
||||
|
||||
<!-- ##### MACRO GST_IS_ASYNCDISKSRC_CLASS ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@obj:
|
||||
|
||||
<!-- ##### FUNCTION gst_sinesrc_new ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -2745,6 +2751,13 @@ the offset.
|
|||
@name:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### MACRO GST_IS_ASYNCDISKSRC_CLASS ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@obj:
|
||||
|
||||
<!-- ##### ARG GstAudioSrc:curoffset ##### -->
|
||||
<para>
|
||||
Get the current number of bytes read.
|
||||
|
@ -2793,13 +2806,6 @@ plugin
|
|||
|
||||
@klass:
|
||||
|
||||
<!-- ##### MACRO GST_ASYNCDISKSRC ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@obj:
|
||||
|
||||
<!-- ##### MACRO GST_HTTPSRC_CLASS ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -2807,6 +2813,13 @@ plugin
|
|||
|
||||
@klass:
|
||||
|
||||
<!-- ##### MACRO GST_ASYNCDISKSRC ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@obj:
|
||||
|
||||
<!-- ##### ARG GstPad:active ##### -->
|
||||
<para>
|
||||
Indicates this pad is active
|
||||
|
|
|
@ -120,7 +120,7 @@ gst_caps_destroy (GstCaps *caps)
|
|||
* 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)
|
||||
|
@ -153,7 +153,7 @@ 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)
|
||||
|
|
|
@ -336,6 +336,15 @@ gst_object_sink (GstObject *object)
|
|||
}
|
||||
#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)
|
||||
{
|
||||
|
|
11
gst/gstpad.c
11
gst/gstpad.c
|
@ -452,7 +452,7 @@ gst_pad_set_newcaps_function (GstPad *pad,
|
|||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
@ -916,6 +916,15 @@ gst_pad_get_peer (GstPad *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)
|
||||
{
|
||||
|
|
|
@ -4,53 +4,87 @@
|
|||
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 GstPadTemplate*
|
||||
src_template_factory (void)
|
||||
{
|
||||
static GstPadTemplate *templ = 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,
|
||||
};
|
||||
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 GstCapsFactory sink_caps = {
|
||||
"sink_caps",
|
||||
"video/raw",
|
||||
"height", GST_PROPS_INT (3000),
|
||||
NULL
|
||||
};
|
||||
static GstPadTemplate*
|
||||
sink_template_factory (void)
|
||||
{
|
||||
static GstPadTemplate *templ = NULL;
|
||||
|
||||
static GstCapsFactory src_caps = {
|
||||
"src_caps",
|
||||
"video/raw",
|
||||
"height", GST_PROPS_INT (3000),
|
||||
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 GstPadTemplate *srctempl, *sinktempl;
|
||||
static GstCaps *srccaps, *sinkcaps;
|
||||
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;
|
||||
}
|
||||
|
@ -61,10 +95,11 @@ negotiate_src (GstPad *pad, GstCaps **caps, gint counter)
|
|||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
@ -74,6 +109,9 @@ negotiate_sink (GstPad *pad, GstCaps **caps, gint counter)
|
|||
return GST_PAD_NEGOTIATE_FAIL;
|
||||
}
|
||||
|
||||
static GstPadTemplate *srctempl, *sinktempl;
|
||||
static GstCaps *srccaps, *sinkcaps;
|
||||
|
||||
static gboolean
|
||||
perform_check (void)
|
||||
{
|
||||
|
@ -121,14 +159,14 @@ main (int argc, char *argv[])
|
|||
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");
|
||||
|
||||
|
|
|
@ -3,82 +3,112 @@
|
|||
|
||||
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 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 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 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 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 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 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 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 GstCapsFactory sink_caps = {
|
||||
"sink_caps",
|
||||
"audio/raw",
|
||||
"rate", GST_PROPS_INT (6000),
|
||||
NULL
|
||||
};
|
||||
static GstCaps*
|
||||
sink_caps (void)
|
||||
{
|
||||
return
|
||||
gst_caps_new (
|
||||
"sink_caps",
|
||||
"audio/raw",
|
||||
gst_props_new (
|
||||
"rate", GST_PROPS_INT (6000),
|
||||
NULL));
|
||||
}
|
||||
|
||||
static GstCapsFactory src_caps = {
|
||||
"src_caps",
|
||||
"audio/raw",
|
||||
"rate", GST_PROPS_INT (3000),
|
||||
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;
|
||||
}
|
||||
|
@ -91,10 +121,10 @@ negotiate_src (GstPad *pad, GstCaps **caps, gint counter)
|
|||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
@ -114,21 +144,22 @@ main (int argc, char *argv[])
|
|||
|
||||
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);
|
||||
|
|
|
@ -3,83 +3,113 @@
|
|||
|
||||
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 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 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 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 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 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 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 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 GstCapsFactory sink_caps = {
|
||||
"sink_caps",
|
||||
"audio/raw",
|
||||
"rate", GST_PROPS_INT (6000),
|
||||
NULL
|
||||
};
|
||||
static GstCaps*
|
||||
sink_caps (void)
|
||||
{
|
||||
return
|
||||
gst_caps_new (
|
||||
"sink_caps",
|
||||
"audio/raw",
|
||||
gst_props_new (
|
||||
"rate", GST_PROPS_INT (6000),
|
||||
NULL));
|
||||
}
|
||||
|
||||
static GstCapsFactory src_caps = {
|
||||
"src_caps",
|
||||
"audio/raw",
|
||||
"rate", GST_PROPS_INT (3000),
|
||||
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;
|
||||
}
|
||||
|
@ -92,19 +122,19 @@ converter_negotiate_src (GstPad *pad, GstCaps **caps, gint counter)
|
|||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
@ -113,11 +143,11 @@ converter_negotiate_sink (GstPad *pad, GstCaps **caps, gint counter)
|
|||
}
|
||||
|
||||
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 (
|
||||
|
@ -143,13 +173,13 @@ main (int argc, char *argv[])
|
|||
|
||||
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");
|
||||
|
||||
|
@ -157,8 +187,8 @@ main (int argc, char *argv[])
|
|||
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");
|
||||
|
|
|
@ -4,36 +4,51 @@
|
|||
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 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 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 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 GstCapsFactory src_caps = {
|
||||
"src_caps",
|
||||
"audio/raw",
|
||||
"rate", GST_PROPS_INT (3000),
|
||||
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;
|
||||
|
||||
|
@ -41,14 +56,14 @@ static gint src_rate = 140;
|
|||
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 (
|
||||
|
@ -77,15 +92,15 @@ negotiate_src (GstPad *pad, GstCaps **caps, gint counter)
|
|||
}
|
||||
|
||||
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 (
|
||||
|
@ -126,15 +141,15 @@ main (int argc, char *argv[])
|
|||
|
||||
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");
|
||||
|
|
|
@ -4,53 +4,87 @@
|
|||
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 GstPadTemplate*
|
||||
src_template_factory (void)
|
||||
{
|
||||
static GstPadTemplate *templ = 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,
|
||||
};
|
||||
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 GstCapsFactory sink_caps = {
|
||||
"sink_caps",
|
||||
"video/raw",
|
||||
"height", GST_PROPS_INT (3000),
|
||||
NULL
|
||||
};
|
||||
static GstPadTemplate*
|
||||
sink_template_factory (void)
|
||||
{
|
||||
static GstPadTemplate *templ = NULL;
|
||||
|
||||
static GstCapsFactory src_caps = {
|
||||
"src_caps",
|
||||
"video/raw",
|
||||
"height", GST_PROPS_INT (3000),
|
||||
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 GstPadTemplate *srctempl, *sinktempl;
|
||||
static GstCaps *srccaps, *sinkcaps;
|
||||
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;
|
||||
}
|
||||
|
@ -61,10 +95,11 @@ negotiate_src (GstPad *pad, GstCaps **caps, gint counter)
|
|||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
@ -74,6 +109,9 @@ negotiate_sink (GstPad *pad, GstCaps **caps, gint counter)
|
|||
return GST_PAD_NEGOTIATE_FAIL;
|
||||
}
|
||||
|
||||
static GstPadTemplate *srctempl, *sinktempl;
|
||||
static GstCaps *srccaps, *sinkcaps;
|
||||
|
||||
static gboolean
|
||||
perform_check (void)
|
||||
{
|
||||
|
@ -121,14 +159,14 @@ main (int argc, char *argv[])
|
|||
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");
|
||||
|
||||
|
|
|
@ -3,82 +3,112 @@
|
|||
|
||||
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 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 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 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 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 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 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 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 GstCapsFactory sink_caps = {
|
||||
"sink_caps",
|
||||
"audio/raw",
|
||||
"rate", GST_PROPS_INT (6000),
|
||||
NULL
|
||||
};
|
||||
static GstCaps*
|
||||
sink_caps (void)
|
||||
{
|
||||
return
|
||||
gst_caps_new (
|
||||
"sink_caps",
|
||||
"audio/raw",
|
||||
gst_props_new (
|
||||
"rate", GST_PROPS_INT (6000),
|
||||
NULL));
|
||||
}
|
||||
|
||||
static GstCapsFactory src_caps = {
|
||||
"src_caps",
|
||||
"audio/raw",
|
||||
"rate", GST_PROPS_INT (3000),
|
||||
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;
|
||||
}
|
||||
|
@ -91,10 +121,10 @@ negotiate_src (GstPad *pad, GstCaps **caps, gint counter)
|
|||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
@ -114,21 +144,22 @@ main (int argc, char *argv[])
|
|||
|
||||
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);
|
||||
|
|
|
@ -3,83 +3,113 @@
|
|||
|
||||
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 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 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 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 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 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 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 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 GstCapsFactory sink_caps = {
|
||||
"sink_caps",
|
||||
"audio/raw",
|
||||
"rate", GST_PROPS_INT (6000),
|
||||
NULL
|
||||
};
|
||||
static GstCaps*
|
||||
sink_caps (void)
|
||||
{
|
||||
return
|
||||
gst_caps_new (
|
||||
"sink_caps",
|
||||
"audio/raw",
|
||||
gst_props_new (
|
||||
"rate", GST_PROPS_INT (6000),
|
||||
NULL));
|
||||
}
|
||||
|
||||
static GstCapsFactory src_caps = {
|
||||
"src_caps",
|
||||
"audio/raw",
|
||||
"rate", GST_PROPS_INT (3000),
|
||||
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;
|
||||
}
|
||||
|
@ -92,19 +122,19 @@ converter_negotiate_src (GstPad *pad, GstCaps **caps, gint counter)
|
|||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
@ -113,11 +143,11 @@ converter_negotiate_sink (GstPad *pad, GstCaps **caps, gint counter)
|
|||
}
|
||||
|
||||
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 (
|
||||
|
@ -143,13 +173,13 @@ main (int argc, char *argv[])
|
|||
|
||||
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");
|
||||
|
||||
|
@ -157,8 +187,8 @@ main (int argc, char *argv[])
|
|||
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");
|
||||
|
|
|
@ -4,36 +4,51 @@
|
|||
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 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 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 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 GstCapsFactory src_caps = {
|
||||
"src_caps",
|
||||
"audio/raw",
|
||||
"rate", GST_PROPS_INT (3000),
|
||||
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;
|
||||
|
||||
|
@ -41,14 +56,14 @@ static gint src_rate = 140;
|
|||
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 (
|
||||
|
@ -77,15 +92,15 @@ negotiate_src (GstPad *pad, GstCaps **caps, gint counter)
|
|||
}
|
||||
|
||||
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 (
|
||||
|
@ -126,15 +141,15 @@ main (int argc, char *argv[])
|
|||
|
||||
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");
|
||||
|
|
Loading…
Reference in a new issue