# GstBufferStraw

These macros and functions are for internal use of the unit tests found inside the 'check' directories of various GStreamer packages.

## Functions

### gst_buffer_straw_get_buffer

    GstBuffer *
    gst_buffer_straw_get_buffer (GstElement * bin,
                                 GstPad * pad)

Get one buffer from pad. Implemented via buffer probes. This function will block until the pipeline passes a buffer over pad, so for robust behavior in unit tests, you need to use check's timeout to fail out in the case that a buffer never arrives.

You must have previously called gst_buffer_straw_start_pipeline on pipeline and pad.

Parameters:

`bin` –

the pipeline previously started via gst_buffer_straw_start_pipeline

`pad` –

the pad previously passed to gst_buffer_straw_start_pipeline

Returns –

the captured GstBuffer.

### GstCheck.prototype.buffer_straw_get_buffer

    function GstCheck.prototype.buffer_straw_get_buffer(bin: Gst.Element, pad: Gst.Pad): {
        // javascript wrapper for 'gst_buffer_straw_get_buffer'
    }

Get one buffer from pad. Implemented via buffer probes. This function will block until the pipeline passes a buffer over pad, so for robust behavior in unit tests, you need to use check's timeout to fail out in the case that a buffer never arrives.

You must have previously called GstCheck.prototype.buffer_straw_start_pipeline on pipeline and pad.

Parameters:

`bin` (Gst.Element) –

the pipeline previously started via GstCheck.prototype.buffer_straw_start_pipeline

`pad` (Gst.Pad) –

the pad previously passed to GstCheck.prototype.buffer_straw_start_pipeline

Returns (Gst.Buffer) –

the captured Gst.Buffer.

### GstCheck.buffer_straw_get_buffer

    def GstCheck.buffer_straw_get_buffer (bin, pad):
        #python wrapper for 'gst_buffer_straw_get_buffer'

Get one buffer from pad. Implemented via buffer probes. This function will block until the pipeline passes a buffer over pad, so for robust behavior in unit tests, you need to use check's timeout to fail out in the case that a buffer never arrives.

You must have previously called GstCheck.buffer_straw_start_pipeline on pipeline and pad.

Parameters:

`bin` (Gst.Element) –

the pipeline previously started via GstCheck.buffer_straw_start_pipeline

`pad` (Gst.Pad) –

the pad previously passed to GstCheck.buffer_straw_start_pipeline

Returns (Gst.Buffer) –

the captured Gst.Buffer.

### gst_buffer_straw_start_pipeline

    gst_buffer_straw_start_pipeline (GstElement * bin,
                                     GstPad * pad)

Sets up a pipeline for buffer sucking. This will allow you to call gst_buffer_straw_get_buffer to access buffers as they pass over pad.

This function is normally used in unit tests that want to verify that a particular element is outputting correct buffers. For example, you would make a pipeline via gst_parse_launch, pull out the pad you want to monitor, then call gst_buffer_straw_get_buffer to get the buffers that pass through pad. The pipeline will block until you have sucked off the buffers.

This function will set the state of bin to PLAYING; to clean up, be sure to call gst_buffer_straw_stop_pipeline.

Note that you may not start two buffer straws at the same time. This function is intended for unit tests, not general API use. In fact it calls fail_if from libcheck, so you cannot use it outside unit tests.

Parameters:

`bin` –

the pipeline to run

`pad` –

a pad on an element in bin

### GstCheck.prototype.buffer_straw_start_pipeline

    function GstCheck.prototype.buffer_straw_start_pipeline(bin: Gst.Element, pad: Gst.Pad): {
        // javascript wrapper for 'gst_buffer_straw_start_pipeline'
    }

Sets up a pipeline for buffer sucking. This will allow you to call GstCheck.prototype.buffer_straw_get_buffer to access buffers as they pass over pad.

This function is normally used in unit tests that want to verify that a particular element is outputting correct buffers. For example, you would make a pipeline via Gst.prototype.parse_launch, pull out the pad you want to monitor, then call GstCheck.prototype.buffer_straw_get_buffer to get the buffers that pass through pad. The pipeline will block until you have sucked off the buffers.

This function will set the state of bin to PLAYING; to clean up, be sure to call GstCheck.prototype.buffer_straw_stop_pipeline.

Note that you may not start two buffer straws at the same time. This function is intended for unit tests, not general API use. In fact it calls fail_if from libcheck, so you cannot use it outside unit tests.

Parameters:

`bin` (Gst.Element) –

the pipeline to run

`pad` (Gst.Pad) –

a pad on an element in bin

### GstCheck.buffer_straw_start_pipeline

    def GstCheck.buffer_straw_start_pipeline (bin, pad):
        #python wrapper for 'gst_buffer_straw_start_pipeline'

Sets up a pipeline for buffer sucking. This will allow you to call GstCheck.buffer_straw_get_buffer to access buffers as they pass over pad.

This function is normally used in unit tests that want to verify that a particular element is outputting correct buffers. For example, you would make a pipeline via Gst.parse_launch, pull out the pad you want to monitor, then call GstCheck.buffer_straw_get_buffer to get the buffers that pass through pad. The pipeline will block until you have sucked off the buffers.

This function will set the state of bin to PLAYING; to clean up, be sure to call GstCheck.buffer_straw_stop_pipeline.

Note that you may not start two buffer straws at the same time. This function is intended for unit tests, not general API use. In fact it calls fail_if from libcheck, so you cannot use it outside unit tests.

Parameters:

`bin` (Gst.Element) –

the pipeline to run

`pad` (Gst.Pad) –

a pad on an element in bin

### gst_buffer_straw_stop_pipeline

    gst_buffer_straw_stop_pipeline (GstElement * bin,
                                    GstPad * pad)

Set bin to GST_STATE_NULL and release resource allocated in gst_buffer_straw_start_pipeline.

You must have previously called gst_buffer_straw_start_pipeline on pipeline and pad.

Parameters:

`bin` –

the pipeline previously started via gst_buffer_straw_start_pipeline

`pad` –

the pad previously passed to gst_buffer_straw_start_pipeline

### GstCheck.prototype.buffer_straw_stop_pipeline

    function GstCheck.prototype.buffer_straw_stop_pipeline(bin: Gst.Element, pad: Gst.Pad): {
        // javascript wrapper for 'gst_buffer_straw_stop_pipeline'
    }

Set bin to Gst.State.NULL and release resource allocated in GstCheck.prototype.buffer_straw_start_pipeline.

You must have previously called GstCheck.prototype.buffer_straw_start_pipeline on pipeline and pad.

Parameters:

`bin` (Gst.Element) –

the pipeline previously started via GstCheck.prototype.buffer_straw_start_pipeline

`pad` (Gst.Pad) –

the pad previously passed to GstCheck.prototype.buffer_straw_start_pipeline

### GstCheck.buffer_straw_stop_pipeline

    def GstCheck.buffer_straw_stop_pipeline (bin, pad):
        #python wrapper for 'gst_buffer_straw_stop_pipeline'

Set bin to Gst.State.NULL and release resource allocated in GstCheck.buffer_straw_start_pipeline.

You must have previously called GstCheck.buffer_straw_start_pipeline on pipeline and pad.

Parameters:

`bin` (Gst.Element) –

the pipeline previously started via GstCheck.buffer_straw_start_pipeline

`pad` (Gst.Pad) –

the pad previously passed to GstCheck.buffer_straw_start_pipeline

The results of the search are