2002-01-15 00:41:22 +00:00
|
|
|
<!-- ##### SECTION Title ##### -->
|
|
|
|
GstAutoplug
|
|
|
|
|
|
|
|
<!-- ##### SECTION Short_Description ##### -->
|
2003-01-24 18:08:39 +00:00
|
|
|
Automatically create and link elements
|
2002-01-15 00:41:22 +00:00
|
|
|
|
|
|
|
<!-- ##### SECTION Long_Description ##### -->
|
|
|
|
<para>
|
|
|
|
GstAutoplug is an abstract class that is used for constructing and
|
2003-01-24 18:08:39 +00:00
|
|
|
linking elements. Two types of autopluggers exist: renderer ones and non
|
|
|
|
renderer ones. The renderer autopluggers will not have any src pads while the
|
2002-01-15 00:41:22 +00:00
|
|
|
non renderer ones do.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2002-04-11 20:35:18 +00:00
|
|
|
You first need to create a suitable autoplugger with gst_autoplug_factory_make()
|
2002-01-15 00:41:22 +00:00
|
|
|
(see #GstAutoplugFactory).
|
|
|
|
The name of the autoplugger must be one of the registered autopluggers
|
|
|
|
(see #GstStaticAutoplug and #GstStaticAutoplugRender).
|
|
|
|
</para>
|
|
|
|
<para>
|
2003-01-24 18:08:39 +00:00
|
|
|
If the autoplugger supports the RENDERER API, use gst_autoplug_to_renderers() to
|
|
|
|
create a bin that links the src caps to the specified renderer elements. You can
|
2002-01-15 00:41:22 +00:00
|
|
|
then add the bin to a pipeline and run it.
|
|
|
|
|
|
|
|
<programlisting>
|
|
|
|
GstAutoplug *autoplug;
|
|
|
|
GstElement *element;
|
|
|
|
GstElement *sink;
|
|
|
|
|
|
|
|
/* create a static autoplugger */
|
2002-04-11 20:35:18 +00:00
|
|
|
autoplug = gst_autoplug_factory_make ("staticrender");
|
2002-01-15 00:41:22 +00:00
|
|
|
|
|
|
|
/* create an osssink */
|
2002-04-11 20:35:18 +00:00
|
|
|
sink = gst_element_factory_make ("osssink", "our_sink");
|
2002-01-15 00:41:22 +00:00
|
|
|
|
|
|
|
/* 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);
|
|
|
|
|
2003-01-24 18:08:39 +00:00
|
|
|
/* add the element to a bin and link the sink pad */
|
2002-01-15 00:41:22 +00:00
|
|
|
...
|
|
|
|
</programlisting>
|
|
|
|
</para>
|
|
|
|
<para>
|
2003-01-24 18:08:39 +00:00
|
|
|
If the autoplugger supports the CAPS API, use gst_autoplug_to_caps() to
|
|
|
|
link the src caps to the destination caps. The created bin will have src caps
|
2002-01-15 00:41:22 +00:00
|
|
|
compatible with the provided sink caps.
|
|
|
|
|
|
|
|
<programlisting>
|
|
|
|
GstAutoplug *autoplug;
|
|
|
|
GstElement *element;
|
|
|
|
|
|
|
|
/* create a static autoplugger */
|
2002-04-11 20:35:18 +00:00
|
|
|
autoplug = gst_autoplug_factory_make ("static");
|
2002-01-15 00:41:22 +00:00
|
|
|
|
|
|
|
/* 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);
|
|
|
|
|
2003-01-24 18:08:39 +00:00
|
|
|
/* add the element to a bin and link the src/sink pads */
|
2002-01-15 00:41:22 +00:00
|
|
|
...
|
|
|
|
</programlisting>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Optionally you can get a notification when a new object is added to the created
|
|
|
|
pipeline with a g_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 ##### -->
|
|
|
|
<para>
|
2002-12-14 13:02:16 +00:00
|
|
|
The autoplug object
|
2002-01-15 00:41:22 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### ENUM GstAutoplugFlags ##### -->
|
|
|
|
<para>
|
|
|
|
The type of the autoplugger.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@GST_AUTOPLUG_TO_CAPS:
|
|
|
|
@GST_AUTOPLUG_TO_RENDERER:
|
|
|
|
@GST_AUTOPLUG_FLAG_LAST:
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_autoplug_signal_new_object ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@autoplug:
|
|
|
|
@object:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_autoplug_to_caps ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@autoplug:
|
|
|
|
@srccaps:
|
|
|
|
@sinkcaps:
|
|
|
|
@Varargs:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_autoplug_to_renderers ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@autoplug:
|
|
|
|
@srccaps:
|
|
|
|
@target:
|
|
|
|
@Varargs:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2002-03-31 14:00:33 +00:00
|
|
|
<!-- ##### SIGNAL GstAutoplug::new-object ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@gstautoplug: the object which received the signal.
|
|
|
|
@arg1:
|
|
|
|
|