1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
5 The connection between Elements
7 <!-- ##### SECTION Long_Description ##### -->
9 #GstElement are connected to each other via "pads", which are extremely light-weight generic
10 connections. After two pad are retrieved from an element with gst_element_get_pad(), the pads
11 can be connected with gst_pad_connect().
14 Pads are typically created from a #GstPadTemplate with gst_pad_new_from_template().
17 Pad have #GstCaps attached to it to describe the media type they
18 are capable of dealing with. gst_pad_get_caps() and gst_pad_set_caps() are used to
19 manipulate the caps of the pads.
20 Pads created from a padtemplate cannot set capabilities that are incompatible with
21 the padtemplates capabilities.
24 Pads without padtemplates can be created with gst_pad_new() which takes a direction and
25 a name as an argument.
28 gst_pad_get_parent() will retrieve the #GstElement that owns the pad.
31 GstElements creating a pad will typicilally use the various gst_pad_set_*_function() calls
32 to register callbacks for various events on the pads.
35 GstElements will use gst_pad_push() and gst_pad_pull() to push out or pull a buffer in. The
36 gst_pad_pullregion() function can be used to request for a buffer with a specific offset (in
37 time or in bytes). gst_pad_select() and gst_pad_selectv() are use by plugins to wait on a set
38 of pads for a new #GstBuffer or #GstEvent.
41 To send an event on a pad, use gst_pad_send_event().
44 <!-- ##### SECTION See_Also ##### -->
46 #GstPadTemplate, #GstElement, #GstEvent
49 <!-- ##### MACRO GST_PAD_NAME ##### -->
51 Get the name of the pad.
54 @pad: the pad to query
57 <!-- ##### MACRO GST_PAD_ELEMENT_PRIVATE ##### -->
59 Get the private data set by the element that owns the pad.
62 @pad: the pad to query
65 <!-- ##### MACRO GST_PAD_PARENT ##### -->
67 Get the parent element of this pad.
70 @pad: the pad to query
73 <!-- ##### MACRO GST_PAD_PADTEMPLATE ##### -->
75 Get the padtemplate that was used to create this pad. NULL if no padtemplate
79 @pad: the pad to query
82 <!-- ##### MACRO GST_PAD_REALIZE ##### -->
84 Return the real pad of this pad.
87 @pad: the pad to query
90 <!-- ##### MACRO GST_PAD_DIRECTION ##### -->
92 Get the pad direction.
95 @pad: the pad to query
98 <!-- ##### MACRO GST_PAD_CAPS ##### -->
100 Get the capabilities of a pad.
103 @pad: the pad to query
106 <!-- ##### MACRO GST_PAD_PEER ##### -->
108 Get the peerpad of this pad.
111 @pad: the pad to query
114 <!-- ##### MACRO GST_PAD_CONNECTED ##### -->
116 Is this pad connected.
119 @pad: the pad to check
122 <!-- ##### MACRO GST_PAD_CAN_PULL ##### -->
124 Can this pad be used to pull a buffer.
127 @pad: the pad to check
130 <!-- ##### STRUCT GstPad ##### -->
136 <!-- ##### USER_FUNCTION GstPadChainFunction ##### -->
138 The function that will be called when chaining buffers.
141 @pad: the pad that performed the chain
142 @buf: the buffer that is chained
145 <!-- ##### USER_FUNCTION GstPadGetFunction ##### -->
147 The function that will be called when pulling a buffer.
150 @pad: the pad to get a buffer from
151 @Returns: a #GstBuffer
154 <!-- ##### USER_FUNCTION GstPadGetRegionFunction ##### -->
156 The function that will be called when pulling a region buffer.
157 You can specify which buffer to get using an offset/length pair or
158 a start/stop timecode pair.
161 @pad: the pad to get a buffer from
162 @type: the type of region to get (time or offset based)
163 @offset: the offset of the region to get
164 @len: the length of the region to get
165 @Returns: a #GstBuffer
168 <!-- ##### USER_FUNCTION GstPadNewCapsFunction ##### -->
170 The function that will be called when the caps of the pad has
174 @pad: The pad that has its caps changed
175 @caps: the new caps of the pad
178 <!-- ##### USER_FUNCTION GstPadBufferPoolFunction ##### -->
180 The function that will be called when a bufferpool is requested
184 @pad: the pad with the bufferpool
185 @Returns: the GstBufferPool associated with this pad.
188 <!-- ##### ENUM GstPadNegotiateReturn ##### -->
190 The possible results from padnegotiation.
193 @GST_PAD_NEGOTIATE_FAIL: The pads could not agree about the media type.
194 @GST_PAD_NEGOTIATE_AGREE: The pads agreed about the media type.
195 @GST_PAD_NEGOTIATE_TRY: The pad did not agree and suggests another media type.
197 <!-- ##### USER_FUNCTION GstPadNegotiateFunction ##### -->
199 The function that will be called when negotiating.
202 @pad: The pad that is being negotiated
203 @caps: The current caps that are being negotiated
204 @data: A generic gpointer that can be used to store user_data
205 @Returns: The result of the negotiation process
208 <!-- ##### ENUM GstRegionType ##### -->
210 the region types for #gst_pad_pullregion.
214 @GST_REGION_OFFSET_LEN: an offet/length pair
215 @GST_REGION_TIME_LEN: a time start/length pair
217 <!-- ##### USER_FUNCTION GstPadPullRegionFunction ##### -->
219 The function that will be called when pulling a region buffer.
220 You can specify which buffer to get using an offset/length pair or
221 a start/stop timecode pair.
224 @pad: the pad to get a buffer from
225 @type: the type of region to get (time or offset based)
226 @offset: the offset of the region to get
227 @len: the length of the region to get
228 @Returns: a #GstBuffer
231 <!-- ##### USER_FUNCTION GstPadEventFunction ##### -->
241 <!-- ##### ENUM GstPadDirection ##### -->
243 The direction this pad is.
246 @GST_PAD_UNKNOWN: direction is unknown
247 @GST_PAD_SRC: this is a source pad
248 @GST_PAD_SINK: this is a sink pad
250 <!-- ##### ENUM GstPadFlags ##### -->
255 @GST_PAD_DISABLED: the pad is disabled
256 @GST_PAD_EOS: the pad is in end of stream state
257 @GST_PAD_FLAG_LAST: subclasses can use this number to enumerate their flags
259 <!-- ##### FUNCTION gst_pad_new ##### -->
269 <!-- ##### MACRO gst_pad_destroy ##### -->
274 @pad: the pad to destroy
277 <!-- ##### FUNCTION gst_pad_new_from_template ##### -->
285 <!-- # Unused Parameters # -->
289 <!-- ##### FUNCTION gst_pad_get_direction ##### -->
298 <!-- ##### FUNCTION gst_pad_set_chain_function ##### -->
307 <!-- ##### FUNCTION gst_pad_set_get_function ##### -->
316 <!-- ##### FUNCTION gst_pad_set_getregion_function ##### -->
325 <!-- ##### FUNCTION gst_pad_set_negotiate_function ##### -->
334 <!-- ##### FUNCTION gst_pad_set_newcaps_function ##### -->
343 <!-- ##### FUNCTION gst_pad_set_bufferpool_function ##### -->
352 <!-- ##### FUNCTION gst_pad_set_caps ##### -->
362 <!-- ##### FUNCTION gst_pad_get_caps ##### -->
371 <!-- ##### FUNCTION gst_pad_check_compatibility ##### -->
381 <!-- ##### FUNCTION gst_pad_set_name ##### -->
390 <!-- ##### FUNCTION gst_pad_get_name ##### -->
399 <!-- ##### FUNCTION gst_pad_set_element_private ##### -->
408 <!-- ##### FUNCTION gst_pad_get_element_private ##### -->
417 <!-- ##### FUNCTION gst_pad_set_parent ##### -->
426 <!-- ##### FUNCTION gst_pad_get_parent ##### -->
435 <!-- ##### FUNCTION gst_pad_get_sched ##### -->
444 <!-- ##### FUNCTION gst_pad_set_sched ##### -->
453 <!-- ##### FUNCTION gst_pad_get_real_parent ##### -->
462 <!-- ##### FUNCTION gst_pad_add_ghost_pad ##### -->
471 <!-- ##### FUNCTION gst_pad_remove_ghost_pad ##### -->
480 <!-- ##### FUNCTION gst_pad_get_ghost_pad_list ##### -->
489 <!-- ##### FUNCTION gst_pad_get_peer ##### -->
498 <!-- ##### FUNCTION gst_pad_connect ##### -->
505 <!-- # Unused Parameters # -->
509 <!-- ##### FUNCTION gst_pad_try_connect ##### -->
519 <!-- ##### FUNCTION gst_pad_disconnect ##### -->
528 <!-- ##### FUNCTION gst_pad_push ##### -->
535 <!-- # Unused Parameters # -->
539 <!-- ##### FUNCTION gst_pad_pull ##### -->
548 <!-- ##### FUNCTION gst_pad_pullregion ##### -->
558 <!-- # Unused Parameters # -->
562 <!-- ##### FUNCTION gst_pad_get_bufferpool ##### -->
571 <!-- ##### FUNCTION gst_pad_load_and_connect ##### -->
578 <!-- # Unused Parameters # -->
583 <!-- ##### FUNCTION gst_pad_negotiate_proxy ##### -->
592 <!-- # Unused Parameters # -->
597 <!-- ##### FUNCTION gst_pad_renegotiate ##### -->
606 <!-- ##### FUNCTION gst_pad_get_padtemplate ##### -->
615 <!-- ##### FUNCTION gst_pad_get_padtemplate_caps ##### -->
624 <!-- ##### FUNCTION gst_pad_ghost_save_thyself ##### -->
635 <!-- ##### FUNCTION gst_pad_peek ##### -->
644 <!-- ##### FUNCTION gst_pad_select ##### -->
653 <!-- ##### FUNCTION gst_pad_selectv ##### -->
663 <!-- ##### FUNCTION gst_pad_send_event ##### -->
673 <!-- ##### FUNCTION gst_pad_event_default ##### -->
682 <!-- ##### FUNCTION gst_pad_set_event_function ##### -->
691 <!-- ##### STRUCT GstRealPad ##### -->
719 <!-- ##### MACRO GST_RPAD_LEN ##### -->
721 Get the length of the region that is being pulled.
724 @pad: the real pad to query.
727 <!-- ##### MACRO GST_RPAD_OFFSET ##### -->
729 Get the offset of the region that is being pulled.
732 @pad: the real pad to query.
735 <!-- ##### MACRO GST_RPAD_SCHED ##### -->
737 Get the scheduler of this real pad.
740 @pad: the real pad to query.
743 <!-- ##### MACRO GST_RPAD_REGIONTYPE ##### -->
745 Get the type of the region that is being pulled.
748 @pad: the real pad to query.
751 <!-- ##### MACRO GST_RPAD_DIRECTION ##### -->
753 Get the direction of the real pad.
756 @pad: the realpad to query.
759 <!-- ##### MACRO GST_RPAD_CAPS ##### -->
761 Get the caps of the real pad.
764 @pad: the real pad to query.
767 <!-- ##### MACRO GST_RPAD_PEER ##### -->
769 Get the peer element of the real pad.
772 @pad: the real pad to query.
775 <!-- ##### MACRO GST_RPAD_BUFPEN ##### -->
777 Get the bufpen of the real pad.
780 @pad: the real pad to query.
783 <!-- ##### MACRO GST_RPAD_CHAINFUNC ##### -->
785 Get the chain function of the real pad.
788 @pad: the real pad to query.
791 <!-- ##### MACRO GST_RPAD_GETFUNC ##### -->
793 Get get getfunction of the real pad.
796 @pad: the real pad to query.
799 <!-- ##### MACRO GST_RPAD_GETREGIONFUNC ##### -->
801 Get the getregion function of the real pad.
804 @pad: the real pad to query.
807 <!-- ##### MACRO GST_RPAD_PULLREGIONFUNC ##### -->
809 Get the pullregion function of the real pad.
812 @pad: the real pad to query.
815 <!-- ##### MACRO GST_RPAD_NEGOTIATEFUNC ##### -->
817 Get the negotiate function from the real pad.
820 @pad: the real pad to query.
823 <!-- ##### MACRO GST_RPAD_NEWCAPSFUNC ##### -->
825 Get the newcaps function from the real pad.
828 @pad: the real pad to query.
831 <!-- ##### MACRO GST_RPAD_BUFFERPOOLFUNC ##### -->
833 Get the bufferpoolfunction from the real pad.
836 @pad: the real pad to query.
839 <!-- ##### MACRO GST_RPAD_CHAINHANDLER ##### -->
841 Get the eventhandler function from the real pad.
844 @pad: the real pad to query.
847 <!-- ##### MACRO GST_RPAD_EVENTFUNC ##### -->
849 Get the event function of this real pad.
852 @pad: the real pad to query.
855 <!-- ##### MACRO GST_RPAD_EVENTHANDLER ##### -->
857 Get the eventhandler function of this real pad.
860 @pad: the real pad to query.
863 <!-- ##### MACRO GST_RPAD_GETHANDLER ##### -->
865 Get the gethandler function of this real pad.
868 @pad: the real pad to query.
871 <!-- ##### MACRO GST_GPAD_REALPAD ##### -->
873 Get the real pad of this ghost pad.
876 @pad: the real pad to query.
879 <!-- ##### STRUCT GstGhostPad ##### -->
887 <!-- ##### FUNCTION gst_ghost_pad_new ##### -->