Updated the API docs
[platform/upstream/gstreamer.git] / docs / gst / tmpl / gstautoplug.sgml
1 <!-- ##### SECTION Title ##### -->
2 GstAutoplug
3
4 <!-- ##### SECTION Short_Description ##### -->
5 Automatically create and connect elements
6
7 <!-- ##### SECTION Long_Description ##### -->
8 <para>
9 GstAutoplug is an abstract class that is used for constructing and 
10 connecting elements. Two types of autopluggers exist: renderer ones and non
11 renderer ones. the renderer autopluggers will not have any src pads while the
12 non renderer ones do.
13 </para>
14
15 <para>
16 You first need to create a suitable autoplugger with gst_autoplugfactory_make() 
17 (see #GstAutoplugFactory).
18 The name of the autoplugger must be one of the registered autopluggers 
19 (see #GstStaticAutoplug and #GstStaticAutoplugRender).
20 </para>
21 <para>
22 If the autoplugger supports the RENDERER API, use gst_autoplug_to_renderers() call to
23 create a bin that connectes the src caps to the specified rendrer elements. You can 
24 then add the bin to a pipeline and run it.
25
26   <programlisting>
27   GstAutoplug *autoplug;
28   GstElement  *element;
29   GstElement  *sink;
30
31   /* create a static autoplugger */
32   autoplug = gst_autoplugfactory_make ("staticrender");
33
34   /* create an osssink */
35   sink = gst_elementfactory_make ("osssink", "our_sink");
36
37   /* create an element that can play audio/mp3 through osssink */
38   element = gst_autoplug_to_renderers (autoplug, 
39                                        gst_caps_new (
40                                          "sink_audio_caps",
41                                          "audio/mp3",
42                                          NULL
43                                        ),
44                                        sink,
45                                        NULL);
46
47   /* add the element to a bin and connect the sink pad */
48   ...
49   </programlisting>
50 </para>
51 <para>
52 If the autoplugger supports the CAPS API, use gst_autoplug_to_caps() call to
53 connect the src caps to the destination caps. The created bin will have src pads 
54 compatible with the provided sink caps.
55
56   <programlisting>
57   GstAutoplug *autoplug;
58   GstElement  *element;
59
60   /* create a static autoplugger */
61   autoplug = gst_autoplugfactory_make ("static");
62
63   /* create an element that converts audio/mp3 to audio/raw */
64   element = gst_autoplug_to_caps (autoplug, 
65                                   gst_caps_new (
66                                     "sink_audio_caps",
67                                     "audio/mp3",
68                                     NULL
69                                   ),
70                                   gst_caps_new (
71                                     "src_audio_caps",
72                                     "audio/raw",
73                                     NULL
74                                   ),
75                                   NULL);
76
77   /* add the element to a bin and connect the src/sink pads */
78   ...
79   </programlisting>
80 </para>
81
82 <para>
83 Optionally you can get a notification when a new object is added to the created
84 pipeline with a g_signal_connect to the "new_object" signal.
85 </para>
86
87 <para>
88 Use the regular gst_object_destroy() call to destroy the autoplugger.
89 </para>
90
91 <!-- ##### SECTION See_Also ##### -->
92 <para>
93 #GstStaticAutoplug, #GstStaticAutoplugRender
94 </para>
95
96 <!-- ##### STRUCT GstAutoplug ##### -->
97 <para>
98
99 </para>
100
101 @object: 
102
103 <!-- ##### ENUM GstAutoplugFlags ##### -->
104 <para>
105 The type of the autoplugger.
106 </para>
107
108 @GST_AUTOPLUG_TO_CAPS: 
109 @GST_AUTOPLUG_TO_RENDERER: 
110 @GST_AUTOPLUG_FLAG_LAST: 
111
112 <!-- ##### FUNCTION gst_autoplug_signal_new_object ##### -->
113 <para>
114
115 </para>
116
117 @autoplug: 
118 @object: 
119
120
121 <!-- ##### FUNCTION gst_autoplug_to_caps ##### -->
122 <para>
123
124 </para>
125
126 @autoplug: 
127 @srccaps: 
128 @sinkcaps: 
129 @Varargs: 
130 @Returns: 
131
132
133 <!-- ##### FUNCTION gst_autoplug_to_renderers ##### -->
134 <para>
135
136 </para>
137
138 @autoplug: 
139 @srccaps: 
140 @target: 
141 @Varargs: 
142 @Returns: 
143
144