1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gstreamer.Element;
26 
27 private import glib.ErrorG;
28 private import glib.GException;
29 private import glib.Str;
30 private import gobject.ObjectG;
31 private import gobject.Signals;
32 private import gobject.Type;
33 private import gstreamer.Bus;
34 private import gstreamer.Caps;
35 private import gstreamer.Clock;
36 private import gstreamer.Context;
37 private import gstreamer.ElementFactory;
38 private import gstreamer.Event;
39 private import gstreamer.Iterator;
40 private import gstreamer.Message;
41 private import gstreamer.ObjectGst;
42 private import gstreamer.Pad;
43 private import gstreamer.PadTemplate;
44 private import gstreamer.Plugin;
45 private import gstreamer.Query;
46 private import gstreamerc.gstreamer;
47 public  import gstreamerc.gstreamertypes;
48 public  import gtkc.gdktypes;
49 private import gtkc.gobject;
50 
51 
52 /**
53  * GstElement is the abstract base class needed to construct an element that
54  * can be used in a GStreamer pipeline. Please refer to the plugin writers
55  * guide for more information on creating #GstElement subclasses.
56  * 
57  * The name of a #GstElement can be get with gst_element_get_name() and set with
58  * gst_element_set_name().  For speed, GST_ELEMENT_NAME() can be used in the
59  * core when using the appropriate locking. Do not use this in plug-ins or
60  * applications in order to retain ABI compatibility.
61  * 
62  * Elements can have pads (of the type #GstPad).  These pads link to pads on
63  * other elements.  #GstBuffer flow between these linked pads.
64  * A #GstElement has a #GList of #GstPad structures for all their input (or sink)
65  * and output (or source) pads.
66  * Core and plug-in writers can add and remove pads with gst_element_add_pad()
67  * and gst_element_remove_pad().
68  * 
69  * An existing pad of an element can be retrieved by name with
70  * gst_element_get_static_pad(). A new dynamic pad can be created using
71  * gst_element_request_pad() with a #GstPadTemplate.
72  * An iterator of all pads can be retrieved with gst_element_iterate_pads().
73  * 
74  * Elements can be linked through their pads.
75  * If the link is straightforward, use the gst_element_link()
76  * convenience function to link two elements, or gst_element_link_many()
77  * for more elements in a row.
78  * Use gst_element_link_filtered() to link two elements constrained by
79  * a specified set of #GstCaps.
80  * For finer control, use gst_element_link_pads() and
81  * gst_element_link_pads_filtered() to specify the pads to link on
82  * each element by name.
83  * 
84  * Each element has a state (see #GstState).  You can get and set the state
85  * of an element with gst_element_get_state() and gst_element_set_state().
86  * Setting a state triggers a #GstStateChange. To get a string representation
87  * of a #GstState, use gst_element_state_get_name().
88  * 
89  * You can get and set a #GstClock on an element using gst_element_get_clock()
90  * and gst_element_set_clock().
91  * Some elements can provide a clock for the pipeline if
92  * the #GST_ELEMENT_FLAG_PROVIDE_CLOCK flag is set. With the
93  * gst_element_provide_clock() method one can retrieve the clock provided by
94  * such an element.
95  * Not all elements require a clock to operate correctly. If the
96  * #GST_ELEMENT_FLAG_REQUIRE_CLOCK() flag is set, a clock should be set on the
97  * element with gst_element_set_clock().
98  * 
99  * Note that clock selection and distribution is normally handled by the
100  * toplevel #GstPipeline so the clock functions are only to be used in very
101  * specific situations.
102  */
103 public class Element : ObjectGst
104 {
105 	/** the main Gtk struct */
106 	protected GstElement* gstElement;
107 
108 	/** Get the main Gtk struct */
109 	public GstElement* getElementStruct()
110 	{
111 		return gstElement;
112 	}
113 
114 	/** the main Gtk struct as a void* */
115 	protected override void* getStruct()
116 	{
117 		return cast(void*)gstElement;
118 	}
119 
120 	protected override void setStruct(GObject* obj)
121 	{
122 		gstElement = cast(GstElement*)obj;
123 		super.setStruct(obj);
124 	}
125 
126 	/**
127 	 * Sets our main struct and passes it to the parent class.
128 	 */
129 	public this (GstElement* gstElement, bool ownedRef = false)
130 	{
131 		this.gstElement = gstElement;
132 		super(cast(GstObject*)gstElement, ownedRef);
133 	}
134 
135 	/**
136 	 * Queries an element for the stream position.
137 	 * This is a convenience function for gstreamerD.
138 	 * Returns:
139 	 *  The current position in nanoseconds - GstFormat.TIME.
140 	 */
141 	public long queryPosition()
142 	{
143 		GstFormat form = GstFormat.TIME;
144 		long cur_pos;
145 		queryPosition( form, cur_pos );
146 		return cur_pos;
147 	}
148 	
149 	/**
150 	 * Queries an element for the stream duration.
151 	 * This is a convenience function for gstreamerD.
152 	 * Returns:
153 	 *  The duration in nanoseconds - GstFormat.TIME.
154 	 */
155 	public long queryDuration()
156 	{
157 		GstFormat form = GstFormat.TIME;
158 		long cur_dur;
159 		queryDuration( form, cur_dur );
160 		return cur_dur;
161 	}
162 	
163 	/**
164 	 *	This set's the filename for a filesrc element.
165 	 */
166 	public void location( string set )
167 	{
168 		//g_object_set( G_OBJECT(getElementStruct()), "location", set, NULL);
169 		setProperty("location", set);
170 	}
171 	
172 	/**
173 	 * Set the caps property of an Element.
174 	 */
175 	void caps( Caps cp )
176 	{
177 		g_object_set( getElementStruct(), Str.toStringz("caps"), cp.getCapsStruct(), null );
178 	}
179 	
180 	/**
181 	 * For your convenience in gstreamerD: you can seek to the
182 	 * position of the pipeline measured in time_nanoseconds.
183 	 */
184 	public int seek( long time_nanoseconds ) //gint64
185 	{
186 		return seek( 1.0, GstFormat.TIME, GstSeekFlags.FLUSH,
187 		GstSeekType.SET, time_nanoseconds,
188 		GstSeekType.NONE, GST_CLOCK_TIME_NONE);
189 	}
190 	
191 	/**
192 	 * Get's all the pads from an element in a Pad[].
193 	 */
194 	public Pad[] pads()
195 	{
196 		Pad[] result;
197 		GValue* pad = g_value_init(new GValue(), Type.fromName("GstPad"));
198 		GstIterator* iter = gst_element_iterate_pads(gstElement);
199 		
200 		while ( gst_iterator_next(iter, pad) == GstIteratorResult.OK )
201 		{
202 			result ~= new Pad(cast(GstPad*)g_value_get_object(pad));
203 			g_value_reset(pad);
204 		}
205 		
206 		g_value_unset(pad);
207 		
208 		return result;
209 	}
210 
211 	/**
212 	 */
213 
214 	public static GType getType()
215 	{
216 		return gst_element_get_type();
217 	}
218 
219 	/**
220 	 * Creates an element for handling the given URI.
221 	 *
222 	 * Params:
223 	 *     type = Whether to create a source or a sink
224 	 *     uri = URI to create an element for
225 	 *     elementname = Name of created element, can be %NULL.
226 	 *
227 	 * Return: a new element or %NULL if none could be created
228 	 *
229 	 * Throws: GException on failure.
230 	 */
231 	public static Element makeFromUri(GstURIType type, string uri, string elementname)
232 	{
233 		GError* err = null;
234 		
235 		auto p = gst_element_make_from_uri(type, Str.toStringz(uri), Str.toStringz(elementname), &err);
236 		
237 		if (err !is null)
238 		{
239 			throw new GException( new ErrorG(err) );
240 		}
241 		
242 		if(p is null)
243 		{
244 			return null;
245 		}
246 		
247 		return ObjectG.getDObject!(Element)(cast(GstElement*) p);
248 	}
249 
250 	/**
251 	 * Create a new elementfactory capable of instantiating objects of the
252 	 * @type and add the factory to @plugin.
253 	 *
254 	 * Params:
255 	 *     plugin = #GstPlugin to register the element with, or %NULL for
256 	 *         a static element.
257 	 *     name = name of elements of this type
258 	 *     rank = rank of element (higher rank means more importance when autoplugging)
259 	 *     type = GType of element to register
260 	 *
261 	 * Return: %TRUE, if the registering succeeded, %FALSE on error
262 	 */
263 	public static bool register(Plugin plugin, string name, uint rank, GType type)
264 	{
265 		return gst_element_register((plugin is null) ? null : plugin.getPluginStruct(), Str.toStringz(name), rank, type) != 0;
266 	}
267 
268 	/**
269 	 * Gets a string representing the given state change result.
270 	 *
271 	 * Params:
272 	 *     stateRet = a #GstStateChangeReturn to get the name of.
273 	 *
274 	 * Return: a string with the name of the state
275 	 *     result.
276 	 */
277 	public static string stateChangeReturnGetName(GstStateChangeReturn stateRet)
278 	{
279 		return Str.toString(gst_element_state_change_return_get_name(stateRet));
280 	}
281 
282 	/**
283 	 * Gets a string representing the given state.
284 	 *
285 	 * Params:
286 	 *     state = a #GstState to get the name of.
287 	 *
288 	 * Return: a string with the name of the state.
289 	 */
290 	public static string stateGetName(GstState state)
291 	{
292 		return Str.toString(gst_element_state_get_name(state));
293 	}
294 
295 	/**
296 	 * Abort the state change of the element. This function is used
297 	 * by elements that do asynchronous state changes and find out
298 	 * something is wrong.
299 	 *
300 	 * This function should be called with the STATE_LOCK held.
301 	 *
302 	 * MT safe.
303 	 */
304 	public void abortState()
305 	{
306 		gst_element_abort_state(gstElement);
307 	}
308 
309 	/**
310 	 * Adds a pad (link point) to @element. @pad's parent will be set to @element;
311 	 * see gst_object_set_parent() for refcounting information.
312 	 *
313 	 * Pads are not automatically activated so elements should perform the needed
314 	 * steps to activate the pad in case this pad is added in the PAUSED or PLAYING
315 	 * state. See gst_pad_set_active() for more information about activating pads.
316 	 *
317 	 * The pad and the element should be unlocked when calling this function.
318 	 *
319 	 * This function will emit the #GstElement::pad-added signal on the element.
320 	 *
321 	 * Params:
322 	 *     pad = the #GstPad to add to the element.
323 	 *
324 	 * Return: %TRUE if the pad could be added. This function can fail when
325 	 *     a pad with the same name already existed or the pad already had another
326 	 *     parent.
327 	 *
328 	 *     MT safe.
329 	 */
330 	public bool addPad(Pad pad)
331 	{
332 		return gst_element_add_pad(gstElement, (pad is null) ? null : pad.getPadStruct()) != 0;
333 	}
334 
335 	/**
336 	 * Perform @transition on @element.
337 	 *
338 	 * This function must be called with STATE_LOCK held and is mainly used
339 	 * internally.
340 	 *
341 	 * Params:
342 	 *     transition = the requested transition
343 	 *
344 	 * Return: the #GstStateChangeReturn of the state transition.
345 	 */
346 	public GstStateChangeReturn changeState(GstStateChange transition)
347 	{
348 		return gst_element_change_state(gstElement, transition);
349 	}
350 
351 	/**
352 	 * Commit the state change of the element and proceed to the next
353 	 * pending state if any. This function is used
354 	 * by elements that do asynchronous state changes.
355 	 * The core will normally call this method automatically when an
356 	 * element returned %GST_STATE_CHANGE_SUCCESS from the state change function.
357 	 *
358 	 * If after calling this method the element still has not reached
359 	 * the pending state, the next state change is performed.
360 	 *
361 	 * This method is used internally and should normally not be called by plugins
362 	 * or applications.
363 	 *
364 	 * Params:
365 	 *     ret = The previous state return value
366 	 *
367 	 * Return: The result of the commit state change.
368 	 *
369 	 *     MT safe.
370 	 */
371 	public GstStateChangeReturn continueState(GstStateChangeReturn ret)
372 	{
373 		return gst_element_continue_state(gstElement, ret);
374 	}
375 
376 	/**
377 	 * Creates a pad for each pad template that is always available.
378 	 * This function is only useful during object initialization of
379 	 * subclasses of #GstElement.
380 	 */
381 	public void createAllPads()
382 	{
383 		gst_element_create_all_pads(gstElement);
384 	}
385 
386 	/**
387 	 * Returns the base time of the element. The base time is the
388 	 * absolute time of the clock when this element was last put to
389 	 * PLAYING. Subtracting the base time from the clock time gives
390 	 * the running time of the element.
391 	 *
392 	 * Return: the base time of the element.
393 	 *
394 	 *     MT safe.
395 	 */
396 	public GstClockTime getBaseTime()
397 	{
398 		return gst_element_get_base_time(gstElement);
399 	}
400 
401 	/**
402 	 * Returns the bus of the element. Note that only a #GstPipeline will provide a
403 	 * bus for the application.
404 	 *
405 	 * Return: the element's #GstBus. unref after usage.
406 	 *
407 	 *     MT safe.
408 	 */
409 	public Bus getBus()
410 	{
411 		auto p = gst_element_get_bus(gstElement);
412 		
413 		if(p is null)
414 		{
415 			return null;
416 		}
417 		
418 		return ObjectG.getDObject!(Bus)(cast(GstBus*) p, true);
419 	}
420 
421 	/**
422 	 * Gets the currently configured clock of the element. This is the clock as was
423 	 * last set with gst_element_set_clock().
424 	 *
425 	 * Elements in a pipeline will only have their clock set when the
426 	 * pipeline is in the PLAYING state.
427 	 *
428 	 * Return: the #GstClock of the element. unref after usage.
429 	 *
430 	 *     MT safe.
431 	 */
432 	public Clock getClock()
433 	{
434 		auto p = gst_element_get_clock(gstElement);
435 		
436 		if(p is null)
437 		{
438 			return null;
439 		}
440 		
441 		return ObjectG.getDObject!(Clock)(cast(GstClock*) p, true);
442 	}
443 
444 	/**
445 	 * Looks for an unlinked pad to which the given pad can link. It is not
446 	 * guaranteed that linking the pads will work, though it should work in most
447 	 * cases.
448 	 *
449 	 * This function will first attempt to find a compatible unlinked ALWAYS pad,
450 	 * and if none can be found, it will request a compatible REQUEST pad by looking
451 	 * at the templates of @element.
452 	 *
453 	 * Params:
454 	 *     pad = the #GstPad to find a compatible one for.
455 	 *     caps = the #GstCaps to use as a filter.
456 	 *
457 	 * Return: the #GstPad to which a link
458 	 *     can be made, or %NULL if one cannot be found. gst_object_unref()
459 	 *     after usage.
460 	 */
461 	public Pad getCompatiblePad(Pad pad, Caps caps)
462 	{
463 		auto p = gst_element_get_compatible_pad(gstElement, (pad is null) ? null : pad.getPadStruct(), (caps is null) ? null : caps.getCapsStruct());
464 		
465 		if(p is null)
466 		{
467 			return null;
468 		}
469 		
470 		return ObjectG.getDObject!(Pad)(cast(GstPad*) p, true);
471 	}
472 
473 	/**
474 	 * Retrieves a pad template from @element that is compatible with @compattempl.
475 	 * Pads from compatible templates can be linked together.
476 	 *
477 	 * Params:
478 	 *     compattempl = the #GstPadTemplate to find a compatible
479 	 *         template for
480 	 *
481 	 * Return: a compatible #GstPadTemplate,
482 	 *     or %NULL if none was found. No unreferencing is necessary.
483 	 */
484 	public PadTemplate getCompatiblePadTemplate(PadTemplate compattempl)
485 	{
486 		auto p = gst_element_get_compatible_pad_template(gstElement, (compattempl is null) ? null : compattempl.getPadTemplateStruct());
487 		
488 		if(p is null)
489 		{
490 			return null;
491 		}
492 		
493 		return ObjectG.getDObject!(PadTemplate)(cast(GstPadTemplate*) p);
494 	}
495 
496 	/**
497 	 * Retrieves the factory that was used to create this element.
498 	 *
499 	 * Return: the #GstElementFactory used for creating this
500 	 *     element. no refcounting is needed.
501 	 */
502 	public ElementFactory getFactory()
503 	{
504 		auto p = gst_element_get_factory(gstElement);
505 		
506 		if(p is null)
507 		{
508 			return null;
509 		}
510 		
511 		return ObjectG.getDObject!(ElementFactory)(cast(GstElementFactory*) p);
512 	}
513 
514 	/**
515 	 * Retrieves a pad from the element by name (e.g. "src_\%d"). This version only
516 	 * retrieves request pads. The pad should be released with
517 	 * gst_element_release_request_pad().
518 	 *
519 	 * This method is slower than manually getting the pad template and calling
520 	 * gst_element_request_pad() if the pads should have a specific name (e.g.
521 	 * @name is "src_1" instead of "src_\%u").
522 	 *
523 	 * Params:
524 	 *     name = the name of the request #GstPad to retrieve.
525 	 *
526 	 * Return: requested #GstPad if found,
527 	 *     otherwise %NULL.  Release after usage.
528 	 */
529 	public Pad getRequestPad(string name)
530 	{
531 		auto p = gst_element_get_request_pad(gstElement, Str.toStringz(name));
532 		
533 		if(p is null)
534 		{
535 			return null;
536 		}
537 		
538 		return ObjectG.getDObject!(Pad)(cast(GstPad*) p, true);
539 	}
540 
541 	/**
542 	 * Returns the start time of the element. The start time is the
543 	 * running time of the clock when this element was last put to PAUSED.
544 	 *
545 	 * Usually the start_time is managed by a toplevel element such as
546 	 * #GstPipeline.
547 	 *
548 	 * MT safe.
549 	 *
550 	 * Return: the start time of the element.
551 	 */
552 	public GstClockTime getStartTime()
553 	{
554 		return gst_element_get_start_time(gstElement);
555 	}
556 
557 	/**
558 	 * Gets the state of the element.
559 	 *
560 	 * For elements that performed an ASYNC state change, as reported by
561 	 * gst_element_set_state(), this function will block up to the
562 	 * specified timeout value for the state change to complete.
563 	 * If the element completes the state change or goes into
564 	 * an error, this function returns immediately with a return value of
565 	 * %GST_STATE_CHANGE_SUCCESS or %GST_STATE_CHANGE_FAILURE respectively.
566 	 *
567 	 * For elements that did not return %GST_STATE_CHANGE_ASYNC, this function
568 	 * returns the current and pending state immediately.
569 	 *
570 	 * This function returns %GST_STATE_CHANGE_NO_PREROLL if the element
571 	 * successfully changed its state but is not able to provide data yet.
572 	 * This mostly happens for live sources that only produce data in
573 	 * %GST_STATE_PLAYING. While the state change return is equivalent to
574 	 * %GST_STATE_CHANGE_SUCCESS, it is returned to the application to signal that
575 	 * some sink elements might not be able to complete their state change because
576 	 * an element is not producing data to complete the preroll. When setting the
577 	 * element to playing, the preroll will complete and playback will start.
578 	 *
579 	 * Params:
580 	 *     state = a pointer to #GstState to hold the state.
581 	 *         Can be %NULL.
582 	 *     pending = a pointer to #GstState to hold the pending
583 	 *         state. Can be %NULL.
584 	 *     timeout = a #GstClockTime to specify the timeout for an async
585 	 *         state change or %GST_CLOCK_TIME_NONE for infinite timeout.
586 	 *
587 	 * Return: %GST_STATE_CHANGE_SUCCESS if the element has no more pending state
588 	 *     and the last state change succeeded, %GST_STATE_CHANGE_ASYNC if the
589 	 *     element is still performing a state change or
590 	 *     %GST_STATE_CHANGE_FAILURE if the last state change failed.
591 	 *
592 	 *     MT safe.
593 	 */
594 	public GstStateChangeReturn getState(out GstState state, out GstState pending, GstClockTime timeout)
595 	{
596 		return gst_element_get_state(gstElement, &state, &pending, timeout);
597 	}
598 
599 	/**
600 	 * Retrieves a pad from @element by name. This version only retrieves
601 	 * already-existing (i.e. 'static') pads.
602 	 *
603 	 * Params:
604 	 *     name = the name of the static #GstPad to retrieve.
605 	 *
606 	 * Return: the requested #GstPad if
607 	 *     found, otherwise %NULL.  unref after usage.
608 	 *
609 	 *     MT safe.
610 	 */
611 	public Pad getStaticPad(string name)
612 	{
613 		auto p = gst_element_get_static_pad(gstElement, Str.toStringz(name));
614 		
615 		if(p is null)
616 		{
617 			return null;
618 		}
619 		
620 		return ObjectG.getDObject!(Pad)(cast(GstPad*) p, true);
621 	}
622 
623 	/**
624 	 * Checks if the state of an element is locked.
625 	 * If the state of an element is locked, state changes of the parent don't
626 	 * affect the element.
627 	 * This way you can leave currently unused elements inside bins. Just lock their
628 	 * state before changing the state from #GST_STATE_NULL.
629 	 *
630 	 * MT safe.
631 	 *
632 	 * Return: %TRUE, if the element's state is locked.
633 	 */
634 	public bool isLockedState()
635 	{
636 		return gst_element_is_locked_state(gstElement) != 0;
637 	}
638 
639 	/**
640 	 * Retrieves an iterator of @element's pads. The iterator should
641 	 * be freed after usage. Also more specialized iterators exists such as
642 	 * gst_element_iterate_src_pads() or gst_element_iterate_sink_pads().
643 	 *
644 	 * The order of pads returned by the iterator will be the order in which
645 	 * the pads were added to the element.
646 	 *
647 	 * Return: the #GstIterator of #GstPad.
648 	 *
649 	 *     MT safe.
650 	 */
651 	public Iterator iteratePads()
652 	{
653 		auto p = gst_element_iterate_pads(gstElement);
654 		
655 		if(p is null)
656 		{
657 			return null;
658 		}
659 		
660 		return ObjectG.getDObject!(Iterator)(cast(GstIterator*) p);
661 	}
662 
663 	/**
664 	 * Retrieves an iterator of @element's sink pads.
665 	 *
666 	 * The order of pads returned by the iterator will be the order in which
667 	 * the pads were added to the element.
668 	 *
669 	 * Return: the #GstIterator of #GstPad.
670 	 *
671 	 *     MT safe.
672 	 */
673 	public Iterator iterateSinkPads()
674 	{
675 		auto p = gst_element_iterate_sink_pads(gstElement);
676 		
677 		if(p is null)
678 		{
679 			return null;
680 		}
681 		
682 		return ObjectG.getDObject!(Iterator)(cast(GstIterator*) p);
683 	}
684 
685 	/**
686 	 * Retrieves an iterator of @element's source pads.
687 	 *
688 	 * The order of pads returned by the iterator will be the order in which
689 	 * the pads were added to the element.
690 	 *
691 	 * Return: the #GstIterator of #GstPad.
692 	 *
693 	 *     MT safe.
694 	 */
695 	public Iterator iterateSrcPads()
696 	{
697 		auto p = gst_element_iterate_src_pads(gstElement);
698 		
699 		if(p is null)
700 		{
701 			return null;
702 		}
703 		
704 		return ObjectG.getDObject!(Iterator)(cast(GstIterator*) p);
705 	}
706 
707 	/**
708 	 * Links @src to @dest. The link must be from source to
709 	 * destination; the other direction will not be tried. The function looks for
710 	 * existing pads that aren't linked yet. It will request new pads if necessary.
711 	 * Such pads need to be released manually when unlinking.
712 	 * If multiple links are possible, only one is established.
713 	 *
714 	 * Make sure you have added your elements to a bin or pipeline with
715 	 * gst_bin_add() before trying to link them.
716 	 *
717 	 * Params:
718 	 *     dest = the #GstElement containing the destination pad.
719 	 *
720 	 * Return: %TRUE if the elements could be linked, %FALSE otherwise.
721 	 */
722 	public bool link(Element dest)
723 	{
724 		return gst_element_link(gstElement, (dest is null) ? null : dest.getElementStruct()) != 0;
725 	}
726 
727 	/**
728 	 * Links @src to @dest using the given caps as filtercaps.
729 	 * The link must be from source to
730 	 * destination; the other direction will not be tried. The function looks for
731 	 * existing pads that aren't linked yet. It will request new pads if necessary.
732 	 * If multiple links are possible, only one is established.
733 	 *
734 	 * Make sure you have added your elements to a bin or pipeline with
735 	 * gst_bin_add() before trying to link them.
736 	 *
737 	 * Params:
738 	 *     dest = the #GstElement containing the destination pad.
739 	 *     filter = the #GstCaps to filter the link,
740 	 *         or %NULL for no filter.
741 	 *
742 	 * Return: %TRUE if the pads could be linked, %FALSE otherwise.
743 	 */
744 	public bool linkFiltered(Element dest, Caps filter)
745 	{
746 		return gst_element_link_filtered(gstElement, (dest is null) ? null : dest.getElementStruct(), (filter is null) ? null : filter.getCapsStruct()) != 0;
747 	}
748 
749 	/**
750 	 * Links the two named pads of the source and destination elements.
751 	 * Side effect is that if one of the pads has no parent, it becomes a
752 	 * child of the parent of the other element.  If they have different
753 	 * parents, the link fails.
754 	 *
755 	 * Params:
756 	 *     srcpadname = the name of the #GstPad in source element
757 	 *         or %NULL for any pad.
758 	 *     dest = the #GstElement containing the destination pad.
759 	 *     destpadname = the name of the #GstPad in destination element,
760 	 *         or %NULL for any pad.
761 	 *
762 	 * Return: %TRUE if the pads could be linked, %FALSE otherwise.
763 	 */
764 	public bool linkPads(string srcpadname, Element dest, string destpadname)
765 	{
766 		return gst_element_link_pads(gstElement, Str.toStringz(srcpadname), (dest is null) ? null : dest.getElementStruct(), Str.toStringz(destpadname)) != 0;
767 	}
768 
769 	/**
770 	 * Links the two named pads of the source and destination elements. Side effect
771 	 * is that if one of the pads has no parent, it becomes a child of the parent of
772 	 * the other element. If they have different parents, the link fails. If @caps
773 	 * is not %NULL, makes sure that the caps of the link is a subset of @caps.
774 	 *
775 	 * Params:
776 	 *     srcpadname = the name of the #GstPad in source element
777 	 *         or %NULL for any pad.
778 	 *     dest = the #GstElement containing the destination pad.
779 	 *     destpadname = the name of the #GstPad in destination element
780 	 *         or %NULL for any pad.
781 	 *     filter = the #GstCaps to filter the link,
782 	 *         or %NULL for no filter.
783 	 *
784 	 * Return: %TRUE if the pads could be linked, %FALSE otherwise.
785 	 */
786 	public bool linkPadsFiltered(string srcpadname, Element dest, string destpadname, Caps filter)
787 	{
788 		return gst_element_link_pads_filtered(gstElement, Str.toStringz(srcpadname), (dest is null) ? null : dest.getElementStruct(), Str.toStringz(destpadname), (filter is null) ? null : filter.getCapsStruct()) != 0;
789 	}
790 
791 	/**
792 	 * Links the two named pads of the source and destination elements.
793 	 * Side effect is that if one of the pads has no parent, it becomes a
794 	 * child of the parent of the other element.  If they have different
795 	 * parents, the link fails.
796 	 *
797 	 * Calling gst_element_link_pads_full() with @flags == %GST_PAD_LINK_CHECK_DEFAULT
798 	 * is the same as calling gst_element_link_pads() and the recommended way of
799 	 * linking pads with safety checks applied.
800 	 *
801 	 * This is a convenience function for gst_pad_link_full().
802 	 *
803 	 * Params:
804 	 *     srcpadname = the name of the #GstPad in source element
805 	 *         or %NULL for any pad.
806 	 *     dest = the #GstElement containing the destination pad.
807 	 *     destpadname = the name of the #GstPad in destination element,
808 	 *         or %NULL for any pad.
809 	 *     flags = the #GstPadLinkCheck to be performed when linking pads.
810 	 *
811 	 * Return: %TRUE if the pads could be linked, %FALSE otherwise.
812 	 */
813 	public bool linkPadsFull(string srcpadname, Element dest, string destpadname, GstPadLinkCheck flags)
814 	{
815 		return gst_element_link_pads_full(gstElement, Str.toStringz(srcpadname), (dest is null) ? null : dest.getElementStruct(), Str.toStringz(destpadname), flags) != 0;
816 	}
817 
818 	/**
819 	 * Brings the element to the lost state. The current state of the
820 	 * element is copied to the pending state so that any call to
821 	 * gst_element_get_state() will return %GST_STATE_CHANGE_ASYNC.
822 	 *
823 	 * An ASYNC_START message is posted. If the element was PLAYING, it will
824 	 * go to PAUSED. The element will be restored to its PLAYING state by
825 	 * the parent pipeline when it prerolls again.
826 	 *
827 	 * This is mostly used for elements that lost their preroll buffer
828 	 * in the %GST_STATE_PAUSED or %GST_STATE_PLAYING state after a flush,
829 	 * they will go to their pending state again when a new preroll buffer is
830 	 * queued. This function can only be called when the element is currently
831 	 * not in error or an async state change.
832 	 *
833 	 * This function is used internally and should normally not be called from
834 	 * plugins or applications.
835 	 */
836 	public void lostState()
837 	{
838 		gst_element_lost_state(gstElement);
839 	}
840 
841 	/**
842 	 * Post an error, warning or info message on the bus from inside an element.
843 	 *
844 	 * @type must be of #GST_MESSAGE_ERROR, #GST_MESSAGE_WARNING or
845 	 * #GST_MESSAGE_INFO.
846 	 *
847 	 * MT safe.
848 	 *
849 	 * Params:
850 	 *     type = the #GstMessageType
851 	 *     domain = the GStreamer GError domain this message belongs to
852 	 *     code = the GError code belonging to the domain
853 	 *     text = an allocated text string to be used
854 	 *         as a replacement for the default message connected to code,
855 	 *         or %NULL
856 	 *     dbg = an allocated debug message to be
857 	 *         used as a replacement for the default debugging information,
858 	 *         or %NULL
859 	 *     file = the source code file where the error was generated
860 	 *     funct = the source code function where the error was generated
861 	 *     line = the source code line where the error was generated
862 	 */
863 	public void messageFull(GstMessageType type, GQuark domain, int code, string text, string dbg, string file, string funct, int line)
864 	{
865 		gst_element_message_full(gstElement, type, domain, code, Str.toStringz(text), Str.toStringz(dbg), Str.toStringz(file), Str.toStringz(funct), line);
866 	}
867 
868 	/**
869 	 * Use this function to signal that the element does not expect any more pads
870 	 * to show up in the current pipeline. This function should be called whenever
871 	 * pads have been added by the element itself. Elements with #GST_PAD_SOMETIMES
872 	 * pad templates use this in combination with autopluggers to figure out that
873 	 * the element is done initializing its pads.
874 	 *
875 	 * This function emits the #GstElement::no-more-pads signal.
876 	 *
877 	 * MT safe.
878 	 */
879 	public void noMorePads()
880 	{
881 		gst_element_no_more_pads(gstElement);
882 	}
883 
884 	/**
885 	 * Post a message on the element's #GstBus. This function takes ownership of the
886 	 * message; if you want to access the message after this call, you should add an
887 	 * additional reference before calling.
888 	 *
889 	 * Params:
890 	 *     message = a #GstMessage to post
891 	 *
892 	 * Return: %TRUE if the message was successfully posted. The function returns
893 	 *     %FALSE if the element did not have a bus.
894 	 *
895 	 *     MT safe.
896 	 */
897 	public bool postMessage(Message message)
898 	{
899 		return gst_element_post_message(gstElement, (message is null) ? null : message.getMessageStruct()) != 0;
900 	}
901 
902 	/**
903 	 * Get the clock provided by the given element.
904 	 * <note>An element is only required to provide a clock in the PAUSED
905 	 * state. Some elements can provide a clock in other states.</note>
906 	 *
907 	 * Return: the GstClock provided by the
908 	 *     element or %NULL if no clock could be provided.  Unref after usage.
909 	 *
910 	 *     MT safe.
911 	 */
912 	public Clock provideClock()
913 	{
914 		auto p = gst_element_provide_clock(gstElement);
915 		
916 		if(p is null)
917 		{
918 			return null;
919 		}
920 		
921 		return ObjectG.getDObject!(Clock)(cast(GstClock*) p, true);
922 	}
923 
924 	/**
925 	 * Performs a query on the given element.
926 	 *
927 	 * For elements that don't implement a query handler, this function
928 	 * forwards the query to a random srcpad or to the peer of a
929 	 * random linked sinkpad of this element.
930 	 *
931 	 * Please note that some queries might need a running pipeline to work.
932 	 *
933 	 * Params:
934 	 *     query = the #GstQuery.
935 	 *
936 	 * Return: %TRUE if the query could be performed.
937 	 *
938 	 *     MT safe.
939 	 */
940 	public bool query(Query query)
941 	{
942 		return gst_element_query(gstElement, (query is null) ? null : query.getQueryStruct()) != 0;
943 	}
944 
945 	/**
946 	 * Queries an element to convert @src_val in @src_format to @dest_format.
947 	 *
948 	 * Params:
949 	 *     srcFormat = a #GstFormat to convert from.
950 	 *     srcVal = a value to convert.
951 	 *     destFormat = the #GstFormat to convert to.
952 	 *     destVal = a pointer to the result.
953 	 *
954 	 * Return: %TRUE if the query could be performed.
955 	 */
956 	public bool queryConvert(GstFormat srcFormat, long srcVal, GstFormat destFormat, out long destVal)
957 	{
958 		return gst_element_query_convert(gstElement, srcFormat, srcVal, destFormat, &destVal) != 0;
959 	}
960 
961 	/**
962 	 * Queries an element (usually top-level pipeline or playbin element) for the
963 	 * total stream duration in nanoseconds. This query will only work once the
964 	 * pipeline is prerolled (i.e. reached PAUSED or PLAYING state). The application
965 	 * will receive an ASYNC_DONE message on the pipeline bus when that is the case.
966 	 *
967 	 * If the duration changes for some reason, you will get a DURATION_CHANGED
968 	 * message on the pipeline bus, in which case you should re-query the duration
969 	 * using this function.
970 	 *
971 	 * Params:
972 	 *     format = the #GstFormat requested
973 	 *     duration = A location in which to store the total duration, or %NULL.
974 	 *
975 	 * Return: %TRUE if the query could be performed.
976 	 */
977 	public bool queryDuration(GstFormat format, out long duration)
978 	{
979 		return gst_element_query_duration(gstElement, format, &duration) != 0;
980 	}
981 
982 	/**
983 	 * Queries an element (usually top-level pipeline or playbin element) for the
984 	 * stream position in nanoseconds. This will be a value between 0 and the
985 	 * stream duration (if the stream duration is known). This query will usually
986 	 * only work once the pipeline is prerolled (i.e. reached PAUSED or PLAYING
987 	 * state). The application will receive an ASYNC_DONE message on the pipeline
988 	 * bus when that is the case.
989 	 *
990 	 * If one repeatedly calls this function one can also create a query and reuse
991 	 * it in gst_element_query().
992 	 *
993 	 * Params:
994 	 *     format = the #GstFormat requested
995 	 *     cur = a location in which to store the current
996 	 *         position, or %NULL.
997 	 *
998 	 * Return: %TRUE if the query could be performed.
999 	 */
1000 	public bool queryPosition(GstFormat format, out long cur)
1001 	{
1002 		return gst_element_query_position(gstElement, format, &cur) != 0;
1003 	}
1004 
1005 	/**
1006 	 * Makes the element free the previously requested pad as obtained
1007 	 * with gst_element_request_pad().
1008 	 *
1009 	 * This does not unref the pad. If the pad was created by using
1010 	 * gst_element_request_pad(), gst_element_release_request_pad() needs to be
1011 	 * followed by gst_object_unref() to free the @pad.
1012 	 *
1013 	 * MT safe.
1014 	 *
1015 	 * Params:
1016 	 *     pad = the #GstPad to release.
1017 	 */
1018 	public void releaseRequestPad(Pad pad)
1019 	{
1020 		gst_element_release_request_pad(gstElement, (pad is null) ? null : pad.getPadStruct());
1021 	}
1022 
1023 	/**
1024 	 * Removes @pad from @element. @pad will be destroyed if it has not been
1025 	 * referenced elsewhere using gst_object_unparent().
1026 	 *
1027 	 * This function is used by plugin developers and should not be used
1028 	 * by applications. Pads that were dynamically requested from elements
1029 	 * with gst_element_request_pad() should be released with the
1030 	 * gst_element_release_request_pad() function instead.
1031 	 *
1032 	 * Pads are not automatically deactivated so elements should perform the needed
1033 	 * steps to deactivate the pad in case this pad is removed in the PAUSED or
1034 	 * PLAYING state. See gst_pad_set_active() for more information about
1035 	 * deactivating pads.
1036 	 *
1037 	 * The pad and the element should be unlocked when calling this function.
1038 	 *
1039 	 * This function will emit the #GstElement::pad-removed signal on the element.
1040 	 *
1041 	 * Params:
1042 	 *     pad = the #GstPad to remove from the element.
1043 	 *
1044 	 * Return: %TRUE if the pad could be removed. Can return %FALSE if the
1045 	 *     pad does not belong to the provided element.
1046 	 *
1047 	 *     MT safe.
1048 	 */
1049 	public bool removePad(Pad pad)
1050 	{
1051 		return gst_element_remove_pad(gstElement, (pad is null) ? null : pad.getPadStruct()) != 0;
1052 	}
1053 
1054 	/**
1055 	 * Retrieves a request pad from the element according to the provided template.
1056 	 * Pad templates can be looked up using
1057 	 * gst_element_factory_get_static_pad_templates().
1058 	 *
1059 	 * The pad should be released with gst_element_release_request_pad().
1060 	 *
1061 	 * Params:
1062 	 *     templ = a #GstPadTemplate of which we want a pad of.
1063 	 *     name = the name of the request #GstPad
1064 	 *         to retrieve. Can be %NULL.
1065 	 *     caps = the caps of the pad we want to
1066 	 *         request. Can be %NULL.
1067 	 *
1068 	 * Return: requested #GstPad if found,
1069 	 *     otherwise %NULL.  Release after usage.
1070 	 */
1071 	public Pad requestPad(PadTemplate templ, string name, Caps caps)
1072 	{
1073 		auto p = gst_element_request_pad(gstElement, (templ is null) ? null : templ.getPadTemplateStruct(), Str.toStringz(name), (caps is null) ? null : caps.getCapsStruct());
1074 		
1075 		if(p is null)
1076 		{
1077 			return null;
1078 		}
1079 		
1080 		return ObjectG.getDObject!(Pad)(cast(GstPad*) p, true);
1081 	}
1082 
1083 	/**
1084 	 * Sends a seek event to an element. See gst_event_new_seek() for the details of
1085 	 * the parameters. The seek event is sent to the element using
1086 	 * gst_element_send_event().
1087 	 *
1088 	 * MT safe.
1089 	 *
1090 	 * Params:
1091 	 *     rate = The new playback rate
1092 	 *     format = The format of the seek values
1093 	 *     flags = The optional seek flags.
1094 	 *     startType = The type and flags for the new start position
1095 	 *     start = The value of the new start position
1096 	 *     stopType = The type and flags for the new stop position
1097 	 *     stop = The value of the new stop position
1098 	 *
1099 	 * Return: %TRUE if the event was handled. Flushing seeks will trigger a
1100 	 *     preroll, which will emit %GST_MESSAGE_ASYNC_DONE.
1101 	 */
1102 	public bool seek(double rate, GstFormat format, GstSeekFlags flags, GstSeekType startType, long start, GstSeekType stopType, long stop)
1103 	{
1104 		return gst_element_seek(gstElement, rate, format, flags, startType, start, stopType, stop) != 0;
1105 	}
1106 
1107 	/**
1108 	 * Simple API to perform a seek on the given element, meaning it just seeks
1109 	 * to the given position relative to the start of the stream. For more complex
1110 	 * operations like segment seeks (e.g. for looping) or changing the playback
1111 	 * rate or seeking relative to the last configured playback segment you should
1112 	 * use gst_element_seek().
1113 	 *
1114 	 * In a completely prerolled PAUSED or PLAYING pipeline, seeking is always
1115 	 * guaranteed to return %TRUE on a seekable media type or %FALSE when the media
1116 	 * type is certainly not seekable (such as a live stream).
1117 	 *
1118 	 * Some elements allow for seeking in the READY state, in this
1119 	 * case they will store the seek event and execute it when they are put to
1120 	 * PAUSED. If the element supports seek in READY, it will always return %TRUE when
1121 	 * it receives the event in the READY state.
1122 	 *
1123 	 * Params:
1124 	 *     format = a #GstFormat to execute the seek in, such as #GST_FORMAT_TIME
1125 	 *     seekFlags = seek options; playback applications will usually want to use
1126 	 *         GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT here
1127 	 *     seekPos = position to seek to (relative to the start); if you are doing
1128 	 *         a seek in #GST_FORMAT_TIME this value is in nanoseconds -
1129 	 *         multiply with #GST_SECOND to convert seconds to nanoseconds or
1130 	 *         with #GST_MSECOND to convert milliseconds to nanoseconds.
1131 	 *
1132 	 * Return: %TRUE if the seek operation succeeded. Flushing seeks will trigger a
1133 	 *     preroll, which will emit %GST_MESSAGE_ASYNC_DONE.
1134 	 */
1135 	public bool seekSimple(GstFormat format, GstSeekFlags seekFlags, long seekPos)
1136 	{
1137 		return gst_element_seek_simple(gstElement, format, seekFlags, seekPos) != 0;
1138 	}
1139 
1140 	/**
1141 	 * Sends an event to an element. If the element doesn't implement an
1142 	 * event handler, the event will be pushed on a random linked sink pad for
1143 	 * downstream events or a random linked source pad for upstream events.
1144 	 *
1145 	 * This function takes ownership of the provided event so you should
1146 	 * gst_event_ref() it if you want to reuse the event after this call.
1147 	 *
1148 	 * MT safe.
1149 	 *
1150 	 * Params:
1151 	 *     event = the #GstEvent to send to the element.
1152 	 *
1153 	 * Return: %TRUE if the event was handled. Events that trigger a preroll (such
1154 	 *     as flushing seeks and steps) will emit %GST_MESSAGE_ASYNC_DONE.
1155 	 */
1156 	public bool sendEvent(Event event)
1157 	{
1158 		return gst_element_send_event(gstElement, (event is null) ? null : event.getEventStruct()) != 0;
1159 	}
1160 
1161 	/**
1162 	 * Set the base time of an element. See gst_element_get_base_time().
1163 	 *
1164 	 * MT safe.
1165 	 *
1166 	 * Params:
1167 	 *     time = the base time to set.
1168 	 */
1169 	public void setBaseTime(GstClockTime time)
1170 	{
1171 		gst_element_set_base_time(gstElement, time);
1172 	}
1173 
1174 	/**
1175 	 * Sets the bus of the element. Increases the refcount on the bus.
1176 	 * For internal use only, unless you're testing elements.
1177 	 *
1178 	 * MT safe.
1179 	 *
1180 	 * Params:
1181 	 *     bus = the #GstBus to set.
1182 	 */
1183 	public void setBus(Bus bus)
1184 	{
1185 		gst_element_set_bus(gstElement, (bus is null) ? null : bus.getBusStruct());
1186 	}
1187 
1188 	/**
1189 	 * Sets the clock for the element. This function increases the
1190 	 * refcount on the clock. Any previously set clock on the object
1191 	 * is unreffed.
1192 	 *
1193 	 * Params:
1194 	 *     clock = the #GstClock to set for the element.
1195 	 *
1196 	 * Return: %TRUE if the element accepted the clock. An element can refuse a
1197 	 *     clock when it, for example, is not able to slave its internal clock to the
1198 	 *     @clock or when it requires a specific clock to operate.
1199 	 *
1200 	 *     MT safe.
1201 	 */
1202 	public bool setClock(Clock clock)
1203 	{
1204 		return gst_element_set_clock(gstElement, (clock is null) ? null : clock.getClockStruct()) != 0;
1205 	}
1206 
1207 	/**
1208 	 * Sets the context of the element. Increases the refcount of the context.
1209 	 *
1210 	 * MT safe.
1211 	 *
1212 	 * Params:
1213 	 *     context = the #GstContext to set.
1214 	 */
1215 	public void setContext(Context context)
1216 	{
1217 		gst_element_set_context(gstElement, (context is null) ? null : context.getContextStruct());
1218 	}
1219 
1220 	/**
1221 	 * Locks the state of an element, so state changes of the parent don't affect
1222 	 * this element anymore.
1223 	 *
1224 	 * MT safe.
1225 	 *
1226 	 * Params:
1227 	 *     lockedState = %TRUE to lock the element's state
1228 	 *
1229 	 * Return: %TRUE if the state was changed, %FALSE if bad parameters were given
1230 	 *     or the elements state-locking needed no change.
1231 	 */
1232 	public bool setLockedState(bool lockedState)
1233 	{
1234 		return gst_element_set_locked_state(gstElement, lockedState) != 0;
1235 	}
1236 
1237 	/**
1238 	 * Set the start time of an element. The start time of the element is the
1239 	 * running time of the element when it last went to the PAUSED state. In READY
1240 	 * or after a flushing seek, it is set to 0.
1241 	 *
1242 	 * Toplevel elements like #GstPipeline will manage the start_time and
1243 	 * base_time on its children. Setting the start_time to #GST_CLOCK_TIME_NONE
1244 	 * on such a toplevel element will disable the distribution of the base_time to
1245 	 * the children and can be useful if the application manages the base_time
1246 	 * itself, for example if you want to synchronize capture from multiple
1247 	 * pipelines, and you can also ensure that the pipelines have the same clock.
1248 	 *
1249 	 * MT safe.
1250 	 *
1251 	 * Params:
1252 	 *     time = the base time to set.
1253 	 */
1254 	public void setStartTime(GstClockTime time)
1255 	{
1256 		gst_element_set_start_time(gstElement, time);
1257 	}
1258 
1259 	/**
1260 	 * Sets the state of the element. This function will try to set the
1261 	 * requested state by going through all the intermediary states and calling
1262 	 * the class's state change function for each.
1263 	 *
1264 	 * This function can return #GST_STATE_CHANGE_ASYNC, in which case the
1265 	 * element will perform the remainder of the state change asynchronously in
1266 	 * another thread.
1267 	 * An application can use gst_element_get_state() to wait for the completion
1268 	 * of the state change or it can wait for a %GST_MESSAGE_ASYNC_DONE or
1269 	 * %GST_MESSAGE_STATE_CHANGED on the bus.
1270 	 *
1271 	 * State changes to %GST_STATE_READY or %GST_STATE_NULL never return
1272 	 * #GST_STATE_CHANGE_ASYNC.
1273 	 *
1274 	 * Params:
1275 	 *     state = the element's new #GstState.
1276 	 *
1277 	 * Return: Result of the state change using #GstStateChangeReturn.
1278 	 *
1279 	 *     MT safe.
1280 	 */
1281 	public GstStateChangeReturn setState(GstState state)
1282 	{
1283 		return gst_element_set_state(gstElement, state);
1284 	}
1285 
1286 	/**
1287 	 * Tries to change the state of the element to the same as its parent.
1288 	 * If this function returns %FALSE, the state of element is undefined.
1289 	 *
1290 	 * Return: %TRUE, if the element's state could be synced to the parent's state.
1291 	 *
1292 	 *     MT safe.
1293 	 */
1294 	public bool syncStateWithParent()
1295 	{
1296 		return gst_element_sync_state_with_parent(gstElement) != 0;
1297 	}
1298 
1299 	/**
1300 	 * Unlinks all source pads of the source element with all sink pads
1301 	 * of the sink element to which they are linked.
1302 	 *
1303 	 * If the link has been made using gst_element_link(), it could have created an
1304 	 * requestpad, which has to be released using gst_element_release_request_pad().
1305 	 *
1306 	 * Params:
1307 	 *     dest = the sink #GstElement to unlink.
1308 	 */
1309 	public void unlink(Element dest)
1310 	{
1311 		gst_element_unlink(gstElement, (dest is null) ? null : dest.getElementStruct());
1312 	}
1313 
1314 	/**
1315 	 * Unlinks the two named pads of the source and destination elements.
1316 	 *
1317 	 * This is a convenience function for gst_pad_unlink().
1318 	 *
1319 	 * Params:
1320 	 *     srcpadname = the name of the #GstPad in source element.
1321 	 *     dest = a #GstElement containing the destination pad.
1322 	 *     destpadname = the name of the #GstPad in destination element.
1323 	 */
1324 	public void unlinkPads(string srcpadname, Element dest, string destpadname)
1325 	{
1326 		gst_element_unlink_pads(gstElement, Str.toStringz(srcpadname), (dest is null) ? null : dest.getElementStruct(), Str.toStringz(destpadname));
1327 	}
1328 
1329 	int[string] connectedSignals;
1330 
1331 	void delegate(Element)[] onNoMorePadsListeners;
1332 	/**
1333 	 * This signals that the element will not generate more dynamic pads.
1334 	 * Note that this signal will usually be emitted from the context of
1335 	 * the streaming thread.
1336 	 */
1337 	void addOnNoMorePads(void delegate(Element) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
1338 	{
1339 		if ( "no-more-pads" !in connectedSignals )
1340 		{
1341 			Signals.connectData(
1342 				this,
1343 				"no-more-pads",
1344 				cast(GCallback)&callBackNoMorePads,
1345 				cast(void*)this,
1346 				null,
1347 				connectFlags);
1348 			connectedSignals["no-more-pads"] = 1;
1349 		}
1350 		onNoMorePadsListeners ~= dlg;
1351 	}
1352 	extern(C) static void callBackNoMorePads(GstElement* elementStruct, Element _element)
1353 	{
1354 		foreach ( void delegate(Element) dlg; _element.onNoMorePadsListeners )
1355 		{
1356 			dlg(_element);
1357 		}
1358 	}
1359 
1360 	void delegate(Pad, Element)[] onPadAddedListeners;
1361 	/**
1362 	 * a new #GstPad has been added to the element. Note that this signal will
1363 	 * usually be emitted from the context of the streaming thread. Also keep in
1364 	 * mind that if you add new elements to the pipeline in the signal handler
1365 	 * you will need to set them to the desired target state with
1366 	 * gst_element_set_state() or gst_element_sync_state_with_parent().
1367 	 *
1368 	 * Params:
1369 	 *     newPad = the pad that has been added
1370 	 */
1371 	void addOnPadAdded(void delegate(Pad, Element) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
1372 	{
1373 		if ( "pad-added" !in connectedSignals )
1374 		{
1375 			Signals.connectData(
1376 				this,
1377 				"pad-added",
1378 				cast(GCallback)&callBackPadAdded,
1379 				cast(void*)this,
1380 				null,
1381 				connectFlags);
1382 			connectedSignals["pad-added"] = 1;
1383 		}
1384 		onPadAddedListeners ~= dlg;
1385 	}
1386 	extern(C) static void callBackPadAdded(GstElement* elementStruct, GstPad* newPad, Element _element)
1387 	{
1388 		foreach ( void delegate(Pad, Element) dlg; _element.onPadAddedListeners )
1389 		{
1390 			dlg(ObjectG.getDObject!(Pad)(newPad), _element);
1391 		}
1392 	}
1393 
1394 	void delegate(Pad, Element)[] onPadRemovedListeners;
1395 	/**
1396 	 * a #GstPad has been removed from the element
1397 	 *
1398 	 * Params:
1399 	 *     oldPad = the pad that has been removed
1400 	 */
1401 	void addOnPadRemoved(void delegate(Pad, Element) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
1402 	{
1403 		if ( "pad-removed" !in connectedSignals )
1404 		{
1405 			Signals.connectData(
1406 				this,
1407 				"pad-removed",
1408 				cast(GCallback)&callBackPadRemoved,
1409 				cast(void*)this,
1410 				null,
1411 				connectFlags);
1412 			connectedSignals["pad-removed"] = 1;
1413 		}
1414 		onPadRemovedListeners ~= dlg;
1415 	}
1416 	extern(C) static void callBackPadRemoved(GstElement* elementStruct, GstPad* oldPad, Element _element)
1417 	{
1418 		foreach ( void delegate(Pad, Element) dlg; _element.onPadRemovedListeners )
1419 		{
1420 			dlg(ObjectG.getDObject!(Pad)(oldPad), _element);
1421 		}
1422 	}
1423 }