# Playback tutorial 7: Custom playbin2 sinks This page last changed on Dec 03, 2012 by xartigas. # Goal `playbin2` can be further customized by manually selecting its audio and video sinks. This allows applications to rely on `playbin2` to retrieve and decode the media and then manage the final render/display themselves. This tutorial shows: - How to replace the sinks selected by `playbin2`. - How to use a complex pipeline as a sink. # Introduction Two properties of `playbin2` allow selecting the desired audio and video sinks: `audio-sink` and `video-sink` (respectively). The application only needs to instantiate the appropriate `GstElement` and pass it to `playbin2` through these properties. This method, though, only allows using a single Element as sink. If a more complex pipeline is required, for example, an equalizer plus an audio sink, it needs to be wrapped in a Bin, so it looks to `playbin2` as if it was a single Element. A Bin (`GstBin`) is a container that encapsulates partial pipelines so they can be managed as single elements. As an example, the `GstPipeline` we have been using in all tutorials is a type of `GstBin`, which does not interact with external Elements. Elements inside a Bin connect to external elements through Ghost Pads (`GstGhostPad`), this is, Pads on the surface of the Bin which simply forward data from an external Pad to a given Pad on an internal Element. ![](attachments/1441842/2424880.png) **Figure 1:** A Bin with two Elements and one Ghost Pad. `GstBin`s are also a type of `GstElement`, so they can be used wherever an Element is required, in particular, as sinks for `playbin2` (and they are then known as **sink-bins**). # An equalized player Copy this code into a text file named `playback-tutorial-7.c`.
This tutorial is included in the SDK since release 2012.7. If you cannot find it in the downloaded code, please install the latest release of the GStreamer SDK. |