gstautoplug.sgml 3.28 KB
Newer Older
1 2 3 4
<!-- ##### SECTION Title ##### -->
GstAutoplug

<!-- ##### SECTION Short_Description ##### -->
5
Automatically create and link elements
6 7 8 9

<!-- ##### SECTION Long_Description ##### -->
<para>
GstAutoplug is an abstract class that is used for constructing and 
10 11
linking elements. Two types of autopluggers exist: renderer ones and non
renderer ones. The renderer autopluggers will not have any src pads while the
12 13 14 15
non renderer ones do.
</para>

<para>
16
You first need to create a suitable autoplugger with gst_autoplug_factory_make() 
17 18 19 20 21
(see #GstAutoplugFactory).
The name of the autoplugger must be one of the registered autopluggers 
(see #GstStaticAutoplug and #GstStaticAutoplugRender).
</para>
<para>
22 23
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 
24 25 26 27 28 29 30 31
then add the bin to a pipeline and run it.

  <programlisting>
  GstAutoplug *autoplug;
  GstElement  *element;
  GstElement  *sink;

  /* create a static autoplugger */
32
  autoplug = gst_autoplug_factory_make ("staticrender");
33 34

  /* create an osssink */
35
  sink = gst_element_factory_make ("osssink", "our_sink");
36 37 38 39 40 41 42 43 44 45 46

  /* 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);

47
  /* add the element to a bin and link the sink pad */
48 49 50 51
  ...
  </programlisting>
</para>
<para>
52 53
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 
54 55 56 57 58 59 60
compatible with the provided sink caps.

  <programlisting>
  GstAutoplug *autoplug;
  GstElement  *element;

  /* create a static autoplugger */
61
  autoplug = gst_autoplug_factory_make ("static");
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76

  /* 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);

77
  /* add the element to a bin and link the src/sink pads */
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
  ...
  </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>
Wim Taymans's avatar
Wim Taymans committed
98
The autoplug object
99 100 101
</para>


Benjamin Otte's avatar
Benjamin Otte committed
102 103 104 105 106 107 108 109
<!-- ##### SIGNAL GstAutoplug::new-object ##### -->
<para>

</para>

@gstautoplug: the object which received the signal.
@arg1: 

110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
<!-- ##### 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: