# proxysrc

Proxysrc is a source element that proxies events, queries, and buffers from another pipeline that contains a matching proxysink element. The purpose is to allow two decoupled pipelines to function as though they are one without having to manually shuttle buffers, events, queries, etc between the two.

The element queues buffers from the matching proxysink to an internal queue, so everything downstream is properly decoupled from the upstream pipeline. However, the queue may get filled up if the downstream pipeline does not accept buffers quickly enough; perhaps because it is not yet PLAYING.

## Usage

     GstElement *pipe1, *pipe2, *psink, *psrc;
     GstClock *clock;

     pipe1 = gst_parse_launch ("audiotestsrc ! proxysink name=psink", NULL);
     psink = gst_bin_get_by_name (GST_BIN (pipe1), "psink");

     pipe2 = gst_parse_launch ("proxysrc name=psrc ! autoaudiosink", NULL);
     psrc = gst_bin_get_by_name (GST_BIN (pipe2), "psrc");

     // Connect the two pipelines
     g_object_set (psrc, "proxysink", psink, NULL);

     // Both pipelines must agree on the timing information or we'll get glitches
     // or overruns/underruns. Ideally, we should tell pipe1 to use the same clock
     // as pipe2, but since that will be set asynchronously to the audio clock, it
     // is simpler and likely accurate enough to use the system clock for both
     // pipelines. If no element in either pipeline will provide a clock, this
     // is not needed.
     clock = gst_system_clock_obtain ();
     gst_pipeline_use_clock (GST_PIPELINE (pipe1), clock);
     gst_pipeline_use_clock (GST_PIPELINE (pipe2), clock);
     g_object_unref (clock);

     // This is not really needed in this case since the pipelines are created and
     // started at the same time. However, an application that dynamically
     // generates pipelines must ensure that all the pipelines that will be
     // connected together share the same base time.
     gst_element_set_base_time (pipe1, 0);
     gst_element_set_base_time (pipe2, 0);

     gst_element_set_state (pipe1, GST_STATE_PLAYING);
     gst_element_set_state (pipe2, GST_STATE_PLAYING);

## Hierarchy

    GObject
        ╰──GInitiallyUnowned
            ╰──GstObject
                ╰──GstElement
                    ╰──GstBin
                        ╰──proxysrc

## Implemented interfaces

    GstChildProxy

## Factory details

Authors: – Sebastian Dröge

Classification: – `Source`

Rank – none

Plugin – proxy

Package – GStreamer Bad Plug-ins

## Pad Templates

### `src`

    ANY

Presence – always

Direction – src

Object type – GstPad

## Properties

### proxysink

    “proxysink” GstProxySink *

Matching proxysink

Flags : Read / Write

The results of the search are