# GstAppSrc

The appsrc element can be used by applications to insert data into a GStreamer pipeline. Unlike most GStreamer elements, appsrc provides external API functions.

appsrc can be used by linking with the libgstapp library to access the methods directly or by using the appsrc action signals.

Before operating appsrc, the caps property must be set to fixed caps describing the format of the data that will be pushed with appsrc. An exception to this is when pushing buffers with unknown caps, in which case no caps should be set. This is typically true of file-like sources that push raw byte buffers. If you don't want to explicitly set the caps, you can use gst_app_src_push_sample. This method gets the caps associated with the sample and sets them on the appsrc replacing any previously set caps (if different from sample's caps).

The main way of handing data to the appsrc element is by calling the gst_app_src_push_buffer method or by emitting the push-buffer action signal. This will put the buffer onto a queue from which appsrc will read from in its streaming thread. It is important to note that data transport will not happen from the thread that performed the push-buffer call.

The "max-bytes", "max-buffers" and "max-time" properties control how much data can be queued in appsrc before appsrc considers the queue full. A filled internal queue will always signal the "enough-data" signal, which signals the application that it should stop pushing data into appsrc. The "block" property will cause appsrc to block the push-buffer method until free data becomes available again.

When the internal queue is running out of data, the "need-data" signal is emitted, which signals the application that it should start pushing more data into appsrc.

In addition to the "need-data" and "enough-data" signals, appsrc can emit the "seek-data" signal when the "stream-mode" property is set to "seekable" or "random-access". The signal argument will contain the new desired position in the stream expressed in the unit set with the "format" property. After receiving the seek-data signal, the application should push-buffers from the new position.

These signals allow the application to operate the appsrc in two different ways:

The push mode, in which the application repeatedly calls the push-buffer/push-sample method with a new buffer/sample. Optionally, the queue size in the appsrc can be controlled with the enough-data and need-data signals by respectively stopping/starting the push-buffer/push-sample calls. This is a typical mode of operation for the stream-type "stream" and "seekable". Use this mode when implementing various network protocols or hardware devices.

The pull mode, in which the need-data signal triggers the next push-buffer call. This mode is typically used in the "random-access" stream-type. Use this mode for file access or other randomly accessible sources. In this mode, a buffer of exactly the amount of bytes given by the need-data signal should be pushed into appsrc.

In all modes, the size property on appsrc should contain the total stream size in bytes. Setting this property is mandatory in the random-access mode. For the stream and seekable modes, setting this property is optional but recommended.

When the application has finished pushing data into appsrc, it should call gst_app_src_end_of_stream or emit the end-of-stream action signal. After this call, no more buffers can be pushed into appsrc until a flushing seek occurs or the state of the appsrc has gone through READY.

## GstAppSrc

    GObject
        ╰──GInitiallyUnowned
            ╰──GstObject
                ╰──GstElement
                    ╰──GstBaseSrc
                        ╰──GstAppSrc

### Members

`basesrc` (GstBaseSrc) –
No description available

### Class structure

#### GstAppSrcClass

##### Fields

`basesrc_class` (GstBaseSrcClass) –
No description available

### GstApp.AppSrcClass

##### Attributes

`basesrc_class` (GstBase.BaseSrcClass) –
No description available

### GstApp.AppSrcClass

##### Attributes

`basesrc_class` (GstBase.BaseSrcClass) –
No description available

## GstApp.AppSrc

    GObject.Object
        ╰──GObject.InitiallyUnowned
            ╰──Gst.Object
                ╰──Gst.Element
                    ╰──GstBase.BaseSrc
                        ╰──GstApp.AppSrc

### Members

`basesrc` (GstBase.BaseSrc) –
No description available

## GstApp.AppSrc

    GObject.Object
        ╰──GObject.InitiallyUnowned
            ╰──Gst.Object
                ╰──Gst.Element
                    ╰──GstBase.BaseSrc
                        ╰──GstApp.AppSrc

### Members

`basesrc` (GstBase.BaseSrc) –
No description available

### Methods

#### gst_app_src_end_of_stream

    GstFlowReturn
    gst_app_src_end_of_stream (GstAppSrc * appsrc)

Indicates to the appsrc element that the last buffer queued in the element is the last buffer of the stream.

Parameters:

`appsrc` –

a GstAppSrc

Returns –

GST_FLOW_OK when the EOS was successfully queued. GST_FLOW_FLUSHING when appsrc is not PAUSED or PLAYING.

#### GstApp.AppSrc.prototype.end_of_stream

    function GstApp.AppSrc.prototype.end_of_stream(): {
        // javascript wrapper for 'gst_app_src_end_of_stream'
    }

Indicates to the appsrc element that the last buffer queued in the element is the last buffer of the stream.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

Returns (Gst.FlowReturn) –

Gst.FlowReturn.OK when the EOS was successfully queued. Gst.FlowReturn.FLUSHING when appsrc is not PAUSED or PLAYING.

#### GstApp.AppSrc.end_of_stream

    def GstApp.AppSrc.end_of_stream (self):
        #python wrapper for 'gst_app_src_end_of_stream'

Indicates to the appsrc element that the last buffer queued in the element is the last buffer of the stream.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

Returns (Gst.FlowReturn) –

Gst.FlowReturn.OK when the EOS was successfully queued. Gst.FlowReturn.FLUSHING when appsrc is not PAUSED or PLAYING.

#### gst_app_src_get_caps

    GstCaps *
    gst_app_src_get_caps (GstAppSrc * appsrc)

Get the configured caps on appsrc.

Parameters:

`appsrc` –

a GstAppSrc

Returns ( [nullable][transfer: full]) –

the GstCaps produced by the source. gst_caps_unref after usage.

#### GstApp.AppSrc.prototype.get_caps

    function GstApp.AppSrc.prototype.get_caps(): {
        // javascript wrapper for 'gst_app_src_get_caps'
    }

Get the configured caps on appsrc.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

Returns (Gst.Caps) –

the Gst.Caps produced by the source. gst_caps_unref (not introspectable) after usage.

#### GstApp.AppSrc.get_caps

    def GstApp.AppSrc.get_caps (self):
        #python wrapper for 'gst_app_src_get_caps'

Get the configured caps on appsrc.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

Returns (Gst.Caps) –

the Gst.Caps produced by the source. gst_caps_unref (not introspectable) after usage.

#### gst_app_src_get_current_level_buffers

    guint64
    gst_app_src_get_current_level_buffers (GstAppSrc * appsrc)

Get the number of currently queued buffers inside appsrc.

Parameters:

`appsrc` –

a GstAppSrc

Returns –

The number of currently queued buffers.

Since : 1.20

#### GstApp.AppSrc.prototype.get_current_level_buffers

    function GstApp.AppSrc.prototype.get_current_level_buffers(): {
        // javascript wrapper for 'gst_app_src_get_current_level_buffers'
    }

Get the number of currently queued buffers inside appsrc.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

Returns (Number) –

The number of currently queued buffers.

Since : 1.20

#### GstApp.AppSrc.get_current_level_buffers

    def GstApp.AppSrc.get_current_level_buffers (self):
        #python wrapper for 'gst_app_src_get_current_level_buffers'

Get the number of currently queued buffers inside appsrc.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

Returns (int) –

The number of currently queued buffers.

Since : 1.20

#### gst_app_src_get_current_level_bytes

    guint64
    gst_app_src_get_current_level_bytes (GstAppSrc * appsrc)

Get the number of currently queued bytes inside appsrc.

Parameters:

`appsrc` –

a GstAppSrc

Returns –

The number of currently queued bytes.

Since : 1.2

#### GstApp.AppSrc.prototype.get_current_level_bytes

    function GstApp.AppSrc.prototype.get_current_level_bytes(): {
        // javascript wrapper for 'gst_app_src_get_current_level_bytes'
    }

Get the number of currently queued bytes inside appsrc.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

Returns (Number) –

The number of currently queued bytes.

Since : 1.2

#### GstApp.AppSrc.get_current_level_bytes

    def GstApp.AppSrc.get_current_level_bytes (self):
        #python wrapper for 'gst_app_src_get_current_level_bytes'

Get the number of currently queued bytes inside appsrc.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

Returns (int) –

The number of currently queued bytes.

Since : 1.2

#### gst_app_src_get_current_level_time

    GstClockTime
    gst_app_src_get_current_level_time (GstAppSrc * appsrc)

Get the amount of currently queued time inside appsrc.

Parameters:

`appsrc` –

a GstAppSrc

Returns –

The amount of currently queued time.

Since : 1.20

#### GstApp.AppSrc.prototype.get_current_level_time

    function GstApp.AppSrc.prototype.get_current_level_time(): {
        // javascript wrapper for 'gst_app_src_get_current_level_time'
    }

Get the amount of currently queued time inside appsrc.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

Returns (Number) –

The amount of currently queued time.

Since : 1.20

#### GstApp.AppSrc.get_current_level_time

    def GstApp.AppSrc.get_current_level_time (self):
        #python wrapper for 'gst_app_src_get_current_level_time'

Get the amount of currently queued time inside appsrc.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

Returns (int) –

The amount of currently queued time.

Since : 1.20

#### gst_app_src_get_duration

    GstClockTime
    gst_app_src_get_duration (GstAppSrc * appsrc)

Get the duration of the stream in nanoseconds. A value of GST_CLOCK_TIME_NONE means that the duration is not known.

Parameters:

`appsrc` –

a GstAppSrc

Returns –

the duration of the stream previously set with gst_app_src_set_duration;

Since : 1.10

#### GstApp.AppSrc.prototype.get_duration

    function GstApp.AppSrc.prototype.get_duration(): {
        // javascript wrapper for 'gst_app_src_get_duration'
    }

Get the duration of the stream in nanoseconds. A value of GST_CLOCK_TIME_NONE means that the duration is not known.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

Returns (Number) –

the duration of the stream previously set with GstApp.AppSrc.prototype.set_duration;

Since : 1.10

#### GstApp.AppSrc.get_duration

    def GstApp.AppSrc.get_duration (self):
        #python wrapper for 'gst_app_src_get_duration'

Get the duration of the stream in nanoseconds. A value of GST_CLOCK_TIME_NONE means that the duration is not known.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

Returns (int) –

the duration of the stream previously set with GstApp.AppSrc.set_duration;

Since : 1.10

#### gst_app_src_get_emit_signals

    gboolean
    gst_app_src_get_emit_signals (GstAppSrc * appsrc)

Check if appsrc will emit the "new-preroll" and "new-buffer" signals.

Parameters:

`appsrc` –

a GstAppSrc

Returns –

TRUE if appsrc is emitting the "new-preroll" and "new-buffer" signals.

#### GstApp.AppSrc.prototype.get_emit_signals

    function GstApp.AppSrc.prototype.get_emit_signals(): {
        // javascript wrapper for 'gst_app_src_get_emit_signals'
    }

Check if appsrc will emit the "new-preroll" and "new-buffer" signals.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

Returns (Number) –

true if appsrc is emitting the "new-preroll" and "new-buffer" signals.

#### GstApp.AppSrc.get_emit_signals

    def GstApp.AppSrc.get_emit_signals (self):
        #python wrapper for 'gst_app_src_get_emit_signals'

Check if appsrc will emit the "new-preroll" and "new-buffer" signals.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

Returns (bool) –

True if appsrc is emitting the "new-preroll" and "new-buffer" signals.

#### gst_app_src_get_latency

    gst_app_src_get_latency (GstAppSrc * appsrc,
                             guint64 * min,
                             guint64 * max)

Retrieve the min and max latencies in min and max respectively.

Parameters:

`appsrc` –

a GstAppSrc

`min` ( [out]) –

the min latency

`max` ( [out]) –

the max latency

#### GstApp.AppSrc.prototype.get_latency

    function GstApp.AppSrc.prototype.get_latency(): {
        // javascript wrapper for 'gst_app_src_get_latency'
    }

Retrieve the min and max latencies in min and max respectively.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

#### GstApp.AppSrc.get_latency

    def GstApp.AppSrc.get_latency (self):
        #python wrapper for 'gst_app_src_get_latency'

Retrieve the min and max latencies in min and max respectively.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

#### gst_app_src_get_leaky_type

    GstAppLeakyType
    gst_app_src_get_leaky_type (GstAppSrc * appsrc)

Returns the currently set GstAppLeakyType. See gst_app_src_set_leaky_type for more details.

Parameters:

`appsrc` –

a GstAppSrc

Returns –

The currently set GstAppLeakyType.

Since : 1.20

#### GstApp.AppSrc.prototype.get_leaky_type

    function GstApp.AppSrc.prototype.get_leaky_type(): {
        // javascript wrapper for 'gst_app_src_get_leaky_type'
    }

Returns the currently set GstApp.AppLeakyType. See GstApp.AppSrc.prototype.set_leaky_type for more details.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

Returns (GstApp.AppLeakyType) –

The currently set GstApp.AppLeakyType.

Since : 1.20

#### GstApp.AppSrc.get_leaky_type

    def GstApp.AppSrc.get_leaky_type (self):
        #python wrapper for 'gst_app_src_get_leaky_type'

Returns the currently set GstApp.AppLeakyType. See GstApp.AppSrc.set_leaky_type for more details.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

Returns (GstApp.AppLeakyType) –

The currently set GstApp.AppLeakyType.

Since : 1.20

#### gst_app_src_get_max_buffers

    guint64
    gst_app_src_get_max_buffers (GstAppSrc * appsrc)

Get the maximum amount of buffers that can be queued in appsrc.

Parameters:

`appsrc` –

a GstAppSrc

Returns –

The maximum amount of buffers that can be queued.

Since : 1.20

#### GstApp.AppSrc.prototype.get_max_buffers

    function GstApp.AppSrc.prototype.get_max_buffers(): {
        // javascript wrapper for 'gst_app_src_get_max_buffers'
    }

Get the maximum amount of buffers that can be queued in appsrc.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

Returns (Number) –

The maximum amount of buffers that can be queued.

Since : 1.20

#### GstApp.AppSrc.get_max_buffers

    def GstApp.AppSrc.get_max_buffers (self):
        #python wrapper for 'gst_app_src_get_max_buffers'

Get the maximum amount of buffers that can be queued in appsrc.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

Returns (int) –

The maximum amount of buffers that can be queued.

Since : 1.20

#### gst_app_src_get_max_bytes

    guint64
    gst_app_src_get_max_bytes (GstAppSrc * appsrc)

Get the maximum amount of bytes that can be queued in appsrc.

Parameters:

`appsrc` –

a GstAppSrc

Returns –

The maximum amount of bytes that can be queued.

#### GstApp.AppSrc.prototype.get_max_bytes

    function GstApp.AppSrc.prototype.get_max_bytes(): {
        // javascript wrapper for 'gst_app_src_get_max_bytes'
    }

Get the maximum amount of bytes that can be queued in appsrc.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

Returns (Number) –

The maximum amount of bytes that can be queued.

#### GstApp.AppSrc.get_max_bytes

    def GstApp.AppSrc.get_max_bytes (self):
        #python wrapper for 'gst_app_src_get_max_bytes'

Get the maximum amount of bytes that can be queued in appsrc.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

Returns (int) –

The maximum amount of bytes that can be queued.

#### gst_app_src_get_max_time

    GstClockTime
    gst_app_src_get_max_time (GstAppSrc * appsrc)

Get the maximum amount of time that can be queued in appsrc.

Parameters:

`appsrc` –

a GstAppSrc

Returns –

The maximum amount of time that can be queued.

Since : 1.20

#### GstApp.AppSrc.prototype.get_max_time

    function GstApp.AppSrc.prototype.get_max_time(): {
        // javascript wrapper for 'gst_app_src_get_max_time'
    }

Get the maximum amount of time that can be queued in appsrc.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

Returns (Number) –

The maximum amount of time that can be queued.

Since : 1.20

#### GstApp.AppSrc.get_max_time

    def GstApp.AppSrc.get_max_time (self):
        #python wrapper for 'gst_app_src_get_max_time'

Get the maximum amount of time that can be queued in appsrc.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

Returns (int) –

The maximum amount of time that can be queued.

Since : 1.20

#### gst_app_src_get_size

    gint64
    gst_app_src_get_size (GstAppSrc * appsrc)

Get the size of the stream in bytes. A value of -1 means that the size is not known.

Parameters:

`appsrc` –

a GstAppSrc

Returns –

the size of the stream previously set with gst_app_src_set_size;

#### GstApp.AppSrc.prototype.get_size

    function GstApp.AppSrc.prototype.get_size(): {
        // javascript wrapper for 'gst_app_src_get_size'
    }

Get the size of the stream in bytes. A value of -1 means that the size is not known.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

Returns (Number) –

the size of the stream previously set with GstApp.AppSrc.prototype.set_size;

#### GstApp.AppSrc.get_size

    def GstApp.AppSrc.get_size (self):
        #python wrapper for 'gst_app_src_get_size'

Get the size of the stream in bytes. A value of -1 means that the size is not known.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

Returns (int) –

the size of the stream previously set with GstApp.AppSrc.set_size;

#### gst_app_src_get_stream_type

    GstAppStreamType
    gst_app_src_get_stream_type (GstAppSrc * appsrc)

Get the stream type. Control the stream type of appsrc with gst_app_src_set_stream_type.

Parameters:

`appsrc` –

a GstAppSrc

Returns –

the stream type.

#### GstApp.AppSrc.prototype.get_stream_type

    function GstApp.AppSrc.prototype.get_stream_type(): {
        // javascript wrapper for 'gst_app_src_get_stream_type'
    }

Get the stream type. Control the stream type of appsrc with GstApp.AppSrc.prototype.set_stream_type.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

Returns (GstApp.AppStreamType) –

the stream type.

#### GstApp.AppSrc.get_stream_type

    def GstApp.AppSrc.get_stream_type (self):
        #python wrapper for 'gst_app_src_get_stream_type'

Get the stream type. Control the stream type of appsrc with GstApp.AppSrc.set_stream_type.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

Returns (GstApp.AppStreamType) –

the stream type.

#### gst_app_src_push_buffer

    GstFlowReturn
    gst_app_src_push_buffer (GstAppSrc * appsrc,
                             GstBuffer * buffer)

Adds a buffer to the queue of buffers that the appsrc element will push to its source pad. This function takes ownership of the buffer.

When the block property is TRUE, this function can block until free space becomes available in the queue.

Parameters:

`appsrc` –

a GstAppSrc

`buffer` ( [transfer: full]) –

a GstBuffer to push

Returns –

GST_FLOW_OK when the buffer was successfully queued. GST_FLOW_FLUSHING when appsrc is not PAUSED or PLAYING. GST_FLOW_EOS when EOS occurred.

#### GstApp.AppSrc.prototype.push_buffer

    function GstApp.AppSrc.prototype.push_buffer(buffer: Gst.Buffer): {
        // javascript wrapper for 'gst_app_src_push_buffer'
    }

Adds a buffer to the queue of buffers that the appsrc element will push to its source pad. This function takes ownership of the buffer.

When the block property is TRUE, this function can block until free space becomes available in the queue.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`buffer` (Gst.Buffer) –

a Gst.Buffer to push

Returns (Gst.FlowReturn) –

Gst.FlowReturn.OK when the buffer was successfully queued. Gst.FlowReturn.FLUSHING when appsrc is not PAUSED or PLAYING. Gst.FlowReturn.EOS when EOS occurred.

#### GstApp.AppSrc.push_buffer

    def GstApp.AppSrc.push_buffer (self, buffer):
        #python wrapper for 'gst_app_src_push_buffer'

Adds a buffer to the queue of buffers that the appsrc element will push to its source pad. This function takes ownership of the buffer.

When the block property is TRUE, this function can block until free space becomes available in the queue.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`buffer` (Gst.Buffer) –

a Gst.Buffer to push

Returns (Gst.FlowReturn) –

Gst.FlowReturn.OK when the buffer was successfully queued. Gst.FlowReturn.FLUSHING when appsrc is not PAUSED or PLAYING. Gst.FlowReturn.EOS when EOS occurred.

#### gst_app_src_push_buffer_list

    GstFlowReturn
    gst_app_src_push_buffer_list (GstAppSrc * appsrc,
                                  GstBufferList * buffer_list)

Adds a buffer list to the queue of buffers and buffer lists that the appsrc element will push to its source pad. This function takes ownership of buffer_list.

When the block property is TRUE, this function can block until free space becomes available in the queue.

Parameters:

`appsrc` –

a GstAppSrc

`buffer_list` ( [transfer: full]) –

a GstBufferList to push

Returns –

GST_FLOW_OK when the buffer list was successfully queued. GST_FLOW_FLUSHING when appsrc is not PAUSED or PLAYING. GST_FLOW_EOS when EOS occurred.

Since : 1.14

#### GstApp.AppSrc.prototype.push_buffer_list

    function GstApp.AppSrc.prototype.push_buffer_list(buffer_list: Gst.BufferList): {
        // javascript wrapper for 'gst_app_src_push_buffer_list'
    }

Adds a buffer list to the queue of buffers and buffer lists that the appsrc element will push to its source pad. This function takes ownership of buffer_list.

When the block property is TRUE, this function can block until free space becomes available in the queue.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`buffer_list` (Gst.BufferList) –

a Gst.BufferList to push

Returns (Gst.FlowReturn) –

Gst.FlowReturn.OK when the buffer list was successfully queued. Gst.FlowReturn.FLUSHING when appsrc is not PAUSED or PLAYING. Gst.FlowReturn.EOS when EOS occurred.

Since : 1.14

#### GstApp.AppSrc.push_buffer_list

    def GstApp.AppSrc.push_buffer_list (self, buffer_list):
        #python wrapper for 'gst_app_src_push_buffer_list'

Adds a buffer list to the queue of buffers and buffer lists that the appsrc element will push to its source pad. This function takes ownership of buffer_list.

When the block property is TRUE, this function can block until free space becomes available in the queue.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`buffer_list` (Gst.BufferList) –

a Gst.BufferList to push

Returns (Gst.FlowReturn) –

Gst.FlowReturn.OK when the buffer list was successfully queued. Gst.FlowReturn.FLUSHING when appsrc is not PAUSED or PLAYING. Gst.FlowReturn.EOS when EOS occurred.

Since : 1.14

#### gst_app_src_push_sample

    GstFlowReturn
    gst_app_src_push_sample (GstAppSrc * appsrc,
                             GstSample * sample)

Extract a buffer from the provided sample and adds it to the queue of buffers that the appsrc element will push to its source pad. Any previous caps that were set on appsrc will be replaced by the caps associated with the sample if not equal.

This function does not take ownership of the sample so the sample needs to be unreffed after calling this function.

When the block property is TRUE, this function can block until free space becomes available in the queue.

Parameters:

`appsrc` –

a GstAppSrc

`sample` ( [transfer: none]) –

a GstSample from which buffer and caps may be extracted

Returns –

GST_FLOW_OK when the buffer was successfully queued. GST_FLOW_FLUSHING when appsrc is not PAUSED or PLAYING. GST_FLOW_EOS when EOS occurred.

Since : 1.6

#### GstApp.AppSrc.prototype.push_sample

    function GstApp.AppSrc.prototype.push_sample(sample: Gst.Sample): {
        // javascript wrapper for 'gst_app_src_push_sample'
    }

Extract a buffer from the provided sample and adds it to the queue of buffers that the appsrc element will push to its source pad. Any previous caps that were set on appsrc will be replaced by the caps associated with the sample if not equal.

This function does not take ownership of the sample so the sample needs to be unreffed after calling this function.

When the block property is TRUE, this function can block until free space becomes available in the queue.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`sample` (Gst.Sample) –

a Gst.Sample from which buffer and caps may be extracted

Returns (Gst.FlowReturn) –

Gst.FlowReturn.OK when the buffer was successfully queued. Gst.FlowReturn.FLUSHING when appsrc is not PAUSED or PLAYING. Gst.FlowReturn.EOS when EOS occurred.

Since : 1.6

#### GstApp.AppSrc.push_sample

    def GstApp.AppSrc.push_sample (self, sample):
        #python wrapper for 'gst_app_src_push_sample'

Extract a buffer from the provided sample and adds it to the queue of buffers that the appsrc element will push to its source pad. Any previous caps that were set on appsrc will be replaced by the caps associated with the sample if not equal.

This function does not take ownership of the sample so the sample needs to be unreffed after calling this function.

When the block property is TRUE, this function can block until free space becomes available in the queue.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`sample` (Gst.Sample) –

a Gst.Sample from which buffer and caps may be extracted

Returns (Gst.FlowReturn) –

Gst.FlowReturn.OK when the buffer was successfully queued. Gst.FlowReturn.FLUSHING when appsrc is not PAUSED or PLAYING. Gst.FlowReturn.EOS when EOS occurred.

Since : 1.6

#### gst_app_src_set_callbacks

    gst_app_src_set_callbacks (GstAppSrc * appsrc,
                               GstAppSrcCallbacks * callbacks,
                               gpointer user_data,
                               GDestroyNotify notify)

Set callbacks which will be executed when data is needed, enough data has been collected or when a seek should be performed. This is an alternative to using the signals, it has lower overhead and is thus less expensive, but also less flexible.

If callbacks are installed, no signals will be emitted for performance reasons.

Before 1.16.3 it was not possible to change the callbacks in a thread-safe way.

Since 1.28.3 it is allowed to set the callbacks to NULL to unset them.

Note that gst_app_src_set_callbacks and gst_app_src_set_simple_callbacks are mutually exclusive and setting one will unset the other.

Parameters:

`appsrc` –

a GstAppSrc

`callbacks` ( [nullable]) –

the callbacks

`user_data` –

a user_data argument for the callbacks

`notify` –

a destroy notify function

#### gst_app_src_set_caps

    gst_app_src_set_caps (GstAppSrc * appsrc,
                          const GstCaps * caps)

Set the capabilities on the appsrc element. This function takes a copy of the caps structure. After calling this method, the source will only produce caps that match caps. caps must be fixed and the caps on the buffers must match the caps or left NULL.

Parameters:

`appsrc` –

a GstAppSrc

`caps` ( [nullable]) –

caps to set

#### GstApp.AppSrc.prototype.set_caps

    function GstApp.AppSrc.prototype.set_caps(caps: Gst.Caps): {
        // javascript wrapper for 'gst_app_src_set_caps'
    }

Set the capabilities on the appsrc element. This function takes a copy of the caps structure. After calling this method, the source will only produce caps that match caps. caps must be fixed and the caps on the buffers must match the caps or left NULL.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`caps` (Gst.Caps) –

caps to set

#### GstApp.AppSrc.set_caps

    def GstApp.AppSrc.set_caps (self, caps):
        #python wrapper for 'gst_app_src_set_caps'

Set the capabilities on the appsrc element. This function takes a copy of the caps structure. After calling this method, the source will only produce caps that match caps. caps must be fixed and the caps on the buffers must match the caps or left NULL.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`caps` (Gst.Caps) –

caps to set

#### gst_app_src_set_duration

    gst_app_src_set_duration (GstAppSrc * appsrc,
                              GstClockTime duration)

Set the duration of the stream in nanoseconds. A value of GST_CLOCK_TIME_NONE means that the duration is not known.

Parameters:

`appsrc` –

a GstAppSrc

`duration` –

the duration to set

Since : 1.10

#### GstApp.AppSrc.prototype.set_duration

    function GstApp.AppSrc.prototype.set_duration(duration: Number): {
        // javascript wrapper for 'gst_app_src_set_duration'
    }

Set the duration of the stream in nanoseconds. A value of GST_CLOCK_TIME_NONE means that the duration is not known.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`duration` (Number) –

the duration to set

Since : 1.10

#### GstApp.AppSrc.set_duration

    def GstApp.AppSrc.set_duration (self, duration):
        #python wrapper for 'gst_app_src_set_duration'

Set the duration of the stream in nanoseconds. A value of GST_CLOCK_TIME_NONE means that the duration is not known.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`duration` (int) –

the duration to set

Since : 1.10

#### gst_app_src_set_emit_signals

    gst_app_src_set_emit_signals (GstAppSrc * appsrc,
                                  gboolean emit)

Make appsrc emit the "new-preroll" and "new-buffer" signals. This option is by default disabled because signal emission is expensive and unneeded when the application prefers to operate in pull mode.

Parameters:

`appsrc` –

a GstAppSrc

`emit` –

the new state

#### GstApp.AppSrc.prototype.set_emit_signals

    function GstApp.AppSrc.prototype.set_emit_signals(emit: Number): {
        // javascript wrapper for 'gst_app_src_set_emit_signals'
    }

Make appsrc emit the "new-preroll" and "new-buffer" signals. This option is by default disabled because signal emission is expensive and unneeded when the application prefers to operate in pull mode.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`emit` (Number) –

the new state

#### GstApp.AppSrc.set_emit_signals

    def GstApp.AppSrc.set_emit_signals (self, emit):
        #python wrapper for 'gst_app_src_set_emit_signals'

Make appsrc emit the "new-preroll" and "new-buffer" signals. This option is by default disabled because signal emission is expensive and unneeded when the application prefers to operate in pull mode.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`emit` (bool) –

the new state

#### gst_app_src_set_latency

    gst_app_src_set_latency (GstAppSrc * appsrc,
                             guint64 min,
                             guint64 max)

Configure the min and max latency in src. If min is set to -1, the default latency calculations for pseudo-live sources will be used.

Parameters:

`appsrc` –

a GstAppSrc

`min` –

the min latency

`max` –

the max latency

#### GstApp.AppSrc.prototype.set_latency

    function GstApp.AppSrc.prototype.set_latency(min: Number, max: Number): {
        // javascript wrapper for 'gst_app_src_set_latency'
    }

Configure the min and max latency in src. If min is set to -1, the default latency calculations for pseudo-live sources will be used.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`min` (Number) –

the min latency

`max` (Number) –

the max latency

#### GstApp.AppSrc.set_latency

    def GstApp.AppSrc.set_latency (self, min, max):
        #python wrapper for 'gst_app_src_set_latency'

Configure the min and max latency in src. If min is set to -1, the default latency calculations for pseudo-live sources will be used.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`min` (int) –

the min latency

`max` (int) –

the max latency

#### gst_app_src_set_leaky_type

    gst_app_src_set_leaky_type (GstAppSrc * appsrc,
                                GstAppLeakyType leaky)

When set to any other value than GST_APP_LEAKY_TYPE_NONE then the appsrc will drop any buffers that are pushed into it once its internal queue is full. The selected type defines whether to drop the oldest or new buffers.

Parameters:

`appsrc` –

a GstAppSrc

`leaky` –

the GstAppLeakyType

Since : 1.20

#### GstApp.AppSrc.prototype.set_leaky_type

    function GstApp.AppSrc.prototype.set_leaky_type(leaky: GstApp.AppLeakyType): {
        // javascript wrapper for 'gst_app_src_set_leaky_type'
    }

When set to any other value than GST_APP_LEAKY_TYPE_NONE then the appsrc will drop any buffers that are pushed into it once its internal queue is full. The selected type defines whether to drop the oldest or new buffers.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`leaky` (GstApp.AppLeakyType) –

the GstApp.AppLeakyType

Since : 1.20

#### GstApp.AppSrc.set_leaky_type

    def GstApp.AppSrc.set_leaky_type (self, leaky):
        #python wrapper for 'gst_app_src_set_leaky_type'

When set to any other value than GST_APP_LEAKY_TYPE_NONE then the appsrc will drop any buffers that are pushed into it once its internal queue is full. The selected type defines whether to drop the oldest or new buffers.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`leaky` (GstApp.AppLeakyType) –

the GstApp.AppLeakyType

Since : 1.20

#### gst_app_src_set_max_buffers

    gst_app_src_set_max_buffers (GstAppSrc * appsrc,
                                 guint64 max)

Set the maximum amount of buffers that can be queued in appsrc. After the maximum amount of buffers are queued, appsrc will emit the "enough-data" signal.

Parameters:

`appsrc` –

a GstAppSrc

`max` –

the maximum number of buffers to queue

Since : 1.20

#### GstApp.AppSrc.prototype.set_max_buffers

    function GstApp.AppSrc.prototype.set_max_buffers(max: Number): {
        // javascript wrapper for 'gst_app_src_set_max_buffers'
    }

Set the maximum amount of buffers that can be queued in appsrc. After the maximum amount of buffers are queued, appsrc will emit the "enough-data" signal.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`max` (Number) –

the maximum number of buffers to queue

Since : 1.20

#### GstApp.AppSrc.set_max_buffers

    def GstApp.AppSrc.set_max_buffers (self, max):
        #python wrapper for 'gst_app_src_set_max_buffers'

Set the maximum amount of buffers that can be queued in appsrc. After the maximum amount of buffers are queued, appsrc will emit the "enough-data" signal.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`max` (int) –

the maximum number of buffers to queue

Since : 1.20

#### gst_app_src_set_max_bytes

    gst_app_src_set_max_bytes (GstAppSrc * appsrc,
                               guint64 max)

Set the maximum amount of bytes that can be queued in appsrc. After the maximum amount of bytes are queued, appsrc will emit the "enough-data" signal.

Parameters:

`appsrc` –

a GstAppSrc

`max` –

the maximum number of bytes to queue

#### GstApp.AppSrc.prototype.set_max_bytes

    function GstApp.AppSrc.prototype.set_max_bytes(max: Number): {
        // javascript wrapper for 'gst_app_src_set_max_bytes'
    }

Set the maximum amount of bytes that can be queued in appsrc. After the maximum amount of bytes are queued, appsrc will emit the "enough-data" signal.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`max` (Number) –

the maximum number of bytes to queue

#### GstApp.AppSrc.set_max_bytes

    def GstApp.AppSrc.set_max_bytes (self, max):
        #python wrapper for 'gst_app_src_set_max_bytes'

Set the maximum amount of bytes that can be queued in appsrc. After the maximum amount of bytes are queued, appsrc will emit the "enough-data" signal.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`max` (int) –

the maximum number of bytes to queue

#### gst_app_src_set_max_time

    gst_app_src_set_max_time (GstAppSrc * appsrc,
                              GstClockTime max)

Set the maximum amount of time that can be queued in appsrc. After the maximum amount of time are queued, appsrc will emit the "enough-data" signal.

Parameters:

`appsrc` –

a GstAppSrc

`max` –

the maximum amonut of time to queue

Since : 1.20

#### GstApp.AppSrc.prototype.set_max_time

    function GstApp.AppSrc.prototype.set_max_time(max: Number): {
        // javascript wrapper for 'gst_app_src_set_max_time'
    }

Set the maximum amount of time that can be queued in appsrc. After the maximum amount of time are queued, appsrc will emit the "enough-data" signal.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`max` (Number) –

the maximum amonut of time to queue

Since : 1.20

#### GstApp.AppSrc.set_max_time

    def GstApp.AppSrc.set_max_time (self, max):
        #python wrapper for 'gst_app_src_set_max_time'

Set the maximum amount of time that can be queued in appsrc. After the maximum amount of time are queued, appsrc will emit the "enough-data" signal.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`max` (int) –

the maximum amonut of time to queue

Since : 1.20

#### gst_app_src_set_simple_callbacks

    gst_app_src_set_simple_callbacks (GstAppSrc * appsrc,
                                      GstAppSrcSimpleCallbacks * cb)

Set callbacks which will be executed when data is needed, enough data has been collected or when a seek should be performed. This is an alternative to using the signals, it has lower overhead and is thus less expensive, but also less flexible.

If callbacks are installed, no signals will be emitted for performance reasons.

Once cb is set on an GstAppSrc it is not possible anymore to change any of the callbacks inside it.

Note that gst_app_src_set_callbacks and gst_app_src_set_simple_callbacks are mutually exclusive and setting one will unset the other.

Parameters:

`appsrc` –

a GstAppSrc

`cb` ( [transfer: full][nullable]) –

the callbacks

Since : 1.28

#### GstApp.AppSrc.prototype.set_simple_callbacks

    function GstApp.AppSrc.prototype.set_simple_callbacks(cb: GstApp.AppSrcSimpleCallbacks): {
        // javascript wrapper for 'gst_app_src_set_simple_callbacks'
    }

Set callbacks which will be executed when data is needed, enough data has been collected or when a seek should be performed. This is an alternative to using the signals, it has lower overhead and is thus less expensive, but also less flexible.

If callbacks are installed, no signals will be emitted for performance reasons.

Once cb is set on an GstApp.AppSrc it is not possible anymore to change any of the callbacks inside it.

Note that gst_app_src_set_callbacks (not introspectable) and GstApp.AppSrc.prototype.set_simple_callbacks are mutually exclusive and setting one will unset the other.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`cb` (GstApp.AppSrcSimpleCallbacks) –

the callbacks

Since : 1.28

#### GstApp.AppSrc.set_simple_callbacks

    def GstApp.AppSrc.set_simple_callbacks (self, cb):
        #python wrapper for 'gst_app_src_set_simple_callbacks'

Set callbacks which will be executed when data is needed, enough data has been collected or when a seek should be performed. This is an alternative to using the signals, it has lower overhead and is thus less expensive, but also less flexible.

If callbacks are installed, no signals will be emitted for performance reasons.

Once cb is set on an GstApp.AppSrc it is not possible anymore to change any of the callbacks inside it.

Note that gst_app_src_set_callbacks (not introspectable) and GstApp.AppSrc.set_simple_callbacks are mutually exclusive and setting one will unset the other.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`cb` (GstApp.AppSrcSimpleCallbacks) –

the callbacks

Since : 1.28

#### gst_app_src_set_size

    gst_app_src_set_size (GstAppSrc * appsrc,
                          gint64 size)

Set the size of the stream in bytes. A value of -1 means that the size is not known.

Parameters:

`appsrc` –

a GstAppSrc

`size` –

the size to set

#### GstApp.AppSrc.prototype.set_size

    function GstApp.AppSrc.prototype.set_size(size: Number): {
        // javascript wrapper for 'gst_app_src_set_size'
    }

Set the size of the stream in bytes. A value of -1 means that the size is not known.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`size` (Number) –

the size to set

#### GstApp.AppSrc.set_size

    def GstApp.AppSrc.set_size (self, size):
        #python wrapper for 'gst_app_src_set_size'

Set the size of the stream in bytes. A value of -1 means that the size is not known.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`size` (int) –

the size to set

#### gst_app_src_set_stream_type

    gst_app_src_set_stream_type (GstAppSrc * appsrc,
                                 GstAppStreamType type)

Set the stream type on appsrc. For seekable streams, the "seek" signal must be connected to.

A stream_type stream

Parameters:

`appsrc` –

a GstAppSrc

`type` –

the new state

#### GstApp.AppSrc.prototype.set_stream_type

    function GstApp.AppSrc.prototype.set_stream_type(type: GstApp.AppStreamType): {
        // javascript wrapper for 'gst_app_src_set_stream_type'
    }

Set the stream type on appsrc. For seekable streams, the "seek" signal must be connected to.

A stream_type stream

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`type` (GstApp.AppStreamType) –

the new state

#### GstApp.AppSrc.set_stream_type

    def GstApp.AppSrc.set_stream_type (self, type):
        #python wrapper for 'gst_app_src_set_stream_type'

Set the stream type on appsrc. For seekable streams, the "seek" signal must be connected to.

A stream_type stream

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`type` (GstApp.AppStreamType) –

the new state

### Signals

#### enough-data

    enough_data_callback (GstAppSrc * self,
                          gpointer user_data)

Signal that the source has enough data. It is recommended that the application stops calling push-buffer until the need-data signal is emitted again to avoid excessive buffer queueing.

Parameters:

`self` –
No description available
`user_data` –
No description available

Flags: Run Last

#### enough-data

    function enough_data_callback(self: GstApp.AppSrc, user_data: Object): {
        // javascript callback for the 'enough-data' signal
    }

Signal that the source has enough data. It is recommended that the application stops calling push-buffer until the need-data signal is emitted again to avoid excessive buffer queueing.

Parameters:

`self` (GstApp.AppSrc) –
No description available
`user_data` (Object) –
No description available

Flags: Run Last

#### enough-data

    def enough_data_callback (self, *user_data):
        #python callback for the 'enough-data' signal

Signal that the source has enough data. It is recommended that the application stops calling push-buffer until the need-data signal is emitted again to avoid excessive buffer queueing.

Parameters:

`self` (GstApp.AppSrc) –
No description available
`user_data` (variadic) –
No description available

Flags: Run Last

#### need-data

    need_data_callback (GstAppSrc * self,
                        guint length,
                        gpointer user_data)

Signal that the source needs more data. In the callback or from another thread you should call push-buffer or end-of-stream.

length is just a hint and when it is set to -1, any number of bytes can be pushed into appsrc.

You can call push-buffer multiple times until the enough-data signal is fired.

Parameters:

`self` –
No description available
`length` –

the amount of bytes needed.

`user_data` –
No description available

Flags: Run Last

#### need-data

    function need_data_callback(self: GstApp.AppSrc, length: Number, user_data: Object): {
        // javascript callback for the 'need-data' signal
    }

Signal that the source needs more data. In the callback or from another thread you should call push-buffer or end-of-stream.

length is just a hint and when it is set to -1, any number of bytes can be pushed into appsrc.

You can call push-buffer multiple times until the enough-data signal is fired.

Parameters:

`self` (GstApp.AppSrc) –
No description available
`length` (Number) –

the amount of bytes needed.

`user_data` (Object) –
No description available

Flags: Run Last

#### need-data

    def need_data_callback (self, length, *user_data):
        #python callback for the 'need-data' signal

Signal that the source needs more data. In the callback or from another thread you should call push-buffer or end-of-stream.

length is just a hint and when it is set to -1, any number of bytes can be pushed into appsrc.

You can call push-buffer multiple times until the enough-data signal is fired.

Parameters:

`self` (GstApp.AppSrc) –
No description available
`length` (int) –

the amount of bytes needed.

`user_data` (variadic) –
No description available

Flags: Run Last

#### seek-data

    gboolean
    seek_data_callback (GstAppSrc * self,
                        guint64 offset,
                        gpointer user_data)

Seek to the given offset. The next push-buffer should produce buffers from the new offset. This callback is only called for seekable stream types.

Parameters:

`self` –
No description available
`offset` –

the offset to seek to

`user_data` –
No description available
Returns –

TRUE if the seek succeeded.

Flags: Run Last

#### seek-data

    function seek_data_callback(self: GstApp.AppSrc, offset: Number, user_data: Object): {
        // javascript callback for the 'seek-data' signal
    }

Seek to the given offset. The next push-buffer should produce buffers from the new offset. This callback is only called for seekable stream types.

Parameters:

`self` (GstApp.AppSrc) –
No description available
`offset` (Number) –

the offset to seek to

`user_data` (Object) –
No description available
Returns (Number) –

true if the seek succeeded.

Flags: Run Last

#### seek-data

    def seek_data_callback (self, offset, *user_data):
        #python callback for the 'seek-data' signal

Seek to the given offset. The next push-buffer should produce buffers from the new offset. This callback is only called for seekable stream types.

Parameters:

`self` (GstApp.AppSrc) –
No description available
`offset` (int) –

the offset to seek to

`user_data` (variadic) –
No description available
Returns (bool) –

True if the seek succeeded.

Flags: Run Last

### Action Signals

#### end-of-stream

    g_signal_emit_by_name (self, "end-of-stream", user_data, &ret);

Notify appsrc that no more buffer are available.

Parameters:

`self` (GstAppSrc *) –
No description available
`user_data` (gpointer) –
No description available
Returns –
No description available

Flags: Run Last / Action

#### end-of-stream

    let ret = self.emit ("end-of-stream", user_data);

Notify appsrc that no more buffer are available.

Parameters:

`self` (GstApp.AppSrc) –
No description available
`user_data` (Object) –
No description available
Returns (Gst.FlowReturn) –
No description available

Flags: Run Last / Action

#### end-of-stream

    ret = self.emit ("end-of-stream", user_data)

Notify appsrc that no more buffer are available.

Parameters:

`self` (GstApp.AppSrc) –
No description available
`user_data` (variadic) –
No description available
Returns (Gst.FlowReturn) –
No description available

Flags: Run Last / Action

#### push-buffer

    g_signal_emit_by_name (self, "push-buffer", buffer, user_data, &ret);

Adds a buffer to the queue of buffers that the appsrc element will push to its source pad.

This function does not take ownership of the buffer, but it takes a reference so the buffer can be unreffed at any time after calling this function.

When the block property is TRUE, this function can block until free space becomes available in the queue.

Parameters:

`self` (GstAppSrc *) –
No description available
`buffer` (GstBuffer *, [transfer: none]) –

a buffer to push

`user_data` (gpointer) –
No description available
Returns –
No description available

Flags: Run Last / Action

#### push-buffer

    let ret = self.emit ("push-buffer", buffer, user_data);

Adds a buffer to the queue of buffers that the appsrc element will push to its source pad.

This function does not take ownership of the buffer, but it takes a reference so the buffer can be unreffed at any time after calling this function.

When the block property is TRUE, this function can block until free space becomes available in the queue.

Parameters:

`self` (GstApp.AppSrc) –
No description available
`buffer` (Gst.Buffer) –

a buffer to push

`user_data` (Object) –
No description available
Returns (Gst.FlowReturn) –
No description available

Flags: Run Last / Action

#### push-buffer

    ret = self.emit ("push-buffer", buffer, user_data)

Adds a buffer to the queue of buffers that the appsrc element will push to its source pad.

This function does not take ownership of the buffer, but it takes a reference so the buffer can be unreffed at any time after calling this function.

When the block property is TRUE, this function can block until free space becomes available in the queue.

Parameters:

`self` (GstApp.AppSrc) –
No description available
`buffer` (Gst.Buffer) –

a buffer to push

`user_data` (variadic) –
No description available
Returns (Gst.FlowReturn) –
No description available

Flags: Run Last / Action

#### push-buffer-list

    g_signal_emit_by_name (self, "push-buffer-list", buffer_list, user_data, &ret);

Adds a buffer list to the queue of buffers and buffer lists that the appsrc element will push to its source pad.

This function does not take ownership of the buffer list, but it takes a reference so the buffer list can be unreffed at any time after calling this function.

When the block property is TRUE, this function can block until free space becomes available in the queue.

Parameters:

`self` (GstAppSrc *) –
No description available
`buffer_list` (GstBufferList *, [transfer: none]) –

a buffer list to push

`user_data` (gpointer) –
No description available
Returns –
No description available

Flags: Run Last / Action

Since : 1.14

#### push-buffer-list

    let ret = self.emit ("push-buffer-list", buffer_list, user_data);

Adds a buffer list to the queue of buffers and buffer lists that the appsrc element will push to its source pad.

This function does not take ownership of the buffer list, but it takes a reference so the buffer list can be unreffed at any time after calling this function.

When the block property is TRUE, this function can block until free space becomes available in the queue.

Parameters:

`self` (GstApp.AppSrc) –
No description available
`buffer_list` (Gst.BufferList) –

a buffer list to push

`user_data` (Object) –
No description available
Returns (Gst.FlowReturn) –
No description available

Flags: Run Last / Action

Since : 1.14

#### push-buffer-list

    ret = self.emit ("push-buffer-list", buffer_list, user_data)

Adds a buffer list to the queue of buffers and buffer lists that the appsrc element will push to its source pad.

This function does not take ownership of the buffer list, but it takes a reference so the buffer list can be unreffed at any time after calling this function.

When the block property is TRUE, this function can block until free space becomes available in the queue.

Parameters:

`self` (GstApp.AppSrc) –
No description available
`buffer_list` (Gst.BufferList) –

a buffer list to push

`user_data` (variadic) –
No description available
Returns (Gst.FlowReturn) –
No description available

Flags: Run Last / Action

Since : 1.14

#### push-sample

    g_signal_emit_by_name (self, "push-sample", sample, user_data, &ret);

Extract a buffer from the provided sample and adds the extracted buffer to the queue of buffers that the appsrc element will push to its source pad. This function set the appsrc caps based on the caps in the sample and reset the caps if they change. Only the caps and the buffer of the provided sample are used and not for example the segment in the sample.

This function does not take ownership of the sample, but it takes a reference so the sample can be unreffed at any time after calling this function.

When the block property is TRUE, this function can block until free space becomes available in the queue.

Parameters:

`self` (GstAppSrc *) –
No description available
`sample` (GstSample *, [transfer: none]) –

a sample from which extract buffer to push

`user_data` (gpointer) –
No description available
Returns –
No description available

Flags: Run Last / Action

Since : 1.6

#### push-sample

    let ret = self.emit ("push-sample", sample, user_data);

Extract a buffer from the provided sample and adds the extracted buffer to the queue of buffers that the appsrc element will push to its source pad. This function set the appsrc caps based on the caps in the sample and reset the caps if they change. Only the caps and the buffer of the provided sample are used and not for example the segment in the sample.

This function does not take ownership of the sample, but it takes a reference so the sample can be unreffed at any time after calling this function.

When the block property is TRUE, this function can block until free space becomes available in the queue.

Parameters:

`self` (GstApp.AppSrc) –
No description available
`sample` (Gst.Sample) –

a sample from which extract buffer to push

`user_data` (Object) –
No description available
Returns (Gst.FlowReturn) –
No description available

Flags: Run Last / Action

Since : 1.6

#### push-sample

    ret = self.emit ("push-sample", sample, user_data)

Extract a buffer from the provided sample and adds the extracted buffer to the queue of buffers that the appsrc element will push to its source pad. This function set the appsrc caps based on the caps in the sample and reset the caps if they change. Only the caps and the buffer of the provided sample are used and not for example the segment in the sample.

This function does not take ownership of the sample, but it takes a reference so the sample can be unreffed at any time after calling this function.

When the block property is TRUE, this function can block until free space becomes available in the queue.

Parameters:

`self` (GstApp.AppSrc) –
No description available
`sample` (Gst.Sample) –

a sample from which extract buffer to push

`user_data` (variadic) –
No description available
Returns (Gst.FlowReturn) –
No description available

Flags: Run Last / Action

Since : 1.6

### Properties

#### block

    “block” gboolean

When max-bytes are queued and after the enough-data signal has been emitted, block any further push-buffer calls until the amount of queued bytes drops below the max-bytes limit.

Flags : Read / Write

#### block

    “block” Number

When max-bytes are queued and after the enough-data signal has been emitted, block any further push-buffer calls until the amount of queued bytes drops below the max-bytes limit.

Flags : Read / Write

#### block

    “self.props.block” bool

When max-bytes are queued and after the enough-data signal has been emitted, block any further push-buffer calls until the amount of queued bytes drops below the max-bytes limit.

Flags : Read / Write

#### caps

    “caps” GstCaps *

The GstCaps that will negotiated downstream and will be put on outgoing buffers.

Flags : Read / Write

#### caps

    “caps” Gst.Caps

The GstCaps that will negotiated downstream and will be put on outgoing buffers.

Flags : Read / Write

#### caps

    “self.props.caps” Gst.Caps

The GstCaps that will negotiated downstream and will be put on outgoing buffers.

Flags : Read / Write

#### current-level-buffers

    “current-level-buffers” guint64

The number of currently queued buffers inside appsrc.

Flags : Read

Since : 1.20

#### current-level-buffers

    “current-level-buffers” Number

The number of currently queued buffers inside appsrc.

Flags : Read

Since : 1.20

#### current_level_buffers

    “self.props.current_level_buffers” int

The number of currently queued buffers inside appsrc.

Flags : Read

Since : 1.20

#### current-level-bytes

    “current-level-bytes” guint64

The number of currently queued bytes inside appsrc.

Flags : Read

Since : 1.2

#### current-level-bytes

    “current-level-bytes” Number

The number of currently queued bytes inside appsrc.

Flags : Read

Since : 1.2

#### current_level_bytes

    “self.props.current_level_bytes” int

The number of currently queued bytes inside appsrc.

Flags : Read

Since : 1.2

#### current-level-time

    “current-level-time” guint64

The amount of currently queued time inside appsrc.

Flags : Read

Since : 1.20

#### current-level-time

    “current-level-time” Number

The amount of currently queued time inside appsrc.

Flags : Read

Since : 1.20

#### current_level_time

    “self.props.current_level_time” int

The amount of currently queued time inside appsrc.

Flags : Read

Since : 1.20

#### dropped

    “dropped” guint64

Number of buffers that were dropped.

Flags : Read

Since : 1.28

#### dropped

    “dropped” Number

Number of buffers that were dropped.

Flags : Read

Since : 1.28

#### dropped

    “self.props.dropped” int

Number of buffers that were dropped.

Flags : Read

Since : 1.28

#### duration

    “duration” guint64

The total duration in nanoseconds of the data stream. If the total duration is known, it is recommended to configure it with this property.

Flags : Read / Write

Since : 1.10

#### duration

    “duration” Number

The total duration in nanoseconds of the data stream. If the total duration is known, it is recommended to configure it with this property.

Flags : Read / Write

Since : 1.10

#### duration

    “self.props.duration” int

The total duration in nanoseconds of the data stream. If the total duration is known, it is recommended to configure it with this property.

Flags : Read / Write

Since : 1.10

#### emit-signals

    “emit-signals” gboolean

Make appsrc emit the "need-data", "enough-data" and "seek-data" signals. This option is by default enabled for backwards compatibility reasons but can disabled when needed because signal emission is expensive.

Flags : Read / Write

#### emit-signals

    “emit-signals” Number

Make appsrc emit the "need-data", "enough-data" and "seek-data" signals. This option is by default enabled for backwards compatibility reasons but can disabled when needed because signal emission is expensive.

Flags : Read / Write

#### emit_signals

    “self.props.emit_signals” bool

Make appsrc emit the "need-data", "enough-data" and "seek-data" signals. This option is by default enabled for backwards compatibility reasons but can disabled when needed because signal emission is expensive.

Flags : Read / Write

#### format

    “format” GstFormat *

The format to use for segment events. When the source is producing timestamped buffers this property should be set to GST_FORMAT_TIME.

Flags : Read / Write

#### format

    “format” Gst.Format

The format to use for segment events. When the source is producing timestamped buffers this property should be set to GST_FORMAT_TIME.

Flags : Read / Write

#### format

    “self.props.format” Gst.Format

The format to use for segment events. When the source is producing timestamped buffers this property should be set to GST_FORMAT_TIME.

Flags : Read / Write

#### handle-segment-change

    “handle-segment-change” gboolean

When enabled, appsrc will check GstSegment in GstSample which was pushed via gst_app_src_push_sample or "push-sample" signal action. If a GstSegment is changed, corresponding segment event will be followed by next data flow.

FIXME: currently only GST_FORMAT_TIME format is supported and therefore GstAppSrc::format should be time. However, possibly GstAppSrc can support other formats.

Flags : Read / Write

Since : 1.18

#### handle-segment-change

    “handle-segment-change” Number

When enabled, appsrc will check GstSegment in GstSample which was pushed via GstApp.AppSrc.prototype.push_sample or "push-sample" signal action. If a GstSegment is changed, corresponding segment event will be followed by next data flow.

FIXME: currently only GST_FORMAT_TIME format is supported and therefore GstAppSrc::format should be time. However, possibly GstApp.AppSrc can support other formats.

Flags : Read / Write

Since : 1.18

#### handle_segment_change

    “self.props.handle_segment_change” bool

When enabled, appsrc will check GstSegment in GstSample which was pushed via GstApp.AppSrc.push_sample or "push-sample" signal action. If a GstSegment is changed, corresponding segment event will be followed by next data flow.

FIXME: currently only GST_FORMAT_TIME format is supported and therefore GstAppSrc::format should be time. However, possibly GstApp.AppSrc can support other formats.

Flags : Read / Write

Since : 1.18

#### in

    “in” guint64

Number of input buffers that were queued.

Flags : Read

Since : 1.28

#### in

    “in” Number

Number of input buffers that were queued.

Flags : Read

Since : 1.28

#### in

    “self.props.in” int

Number of input buffers that were queued.

Flags : Read

Since : 1.28

#### is-live

    “is-live” gboolean

Instruct the source to behave like a live source. This includes that it will only push out buffers in the PLAYING state.

Flags : Read / Write

#### is-live

    “is-live” Number

Instruct the source to behave like a live source. This includes that it will only push out buffers in the PLAYING state.

Flags : Read / Write

#### is_live

    “self.props.is_live” bool

Instruct the source to behave like a live source. This includes that it will only push out buffers in the PLAYING state.

Flags : Read / Write

#### leaky-type

    “leaky-type” GstAppLeakyType *

When set to any other value than GST_APP_LEAKY_TYPE_NONE then the appsrc will drop any buffers that are pushed into it once its internal queue is full. The selected type defines whether to drop the oldest or new buffers.

Flags : Read / Write

Since : 1.20

#### leaky-type

    “leaky-type” GstApp.AppLeakyType

When set to any other value than GST_APP_LEAKY_TYPE_NONE then the appsrc will drop any buffers that are pushed into it once its internal queue is full. The selected type defines whether to drop the oldest or new buffers.

Flags : Read / Write

Since : 1.20

#### leaky_type

    “self.props.leaky_type” GstApp.AppLeakyType

When set to any other value than GST_APP_LEAKY_TYPE_NONE then the appsrc will drop any buffers that are pushed into it once its internal queue is full. The selected type defines whether to drop the oldest or new buffers.

Flags : Read / Write

Since : 1.20

#### max-buffers

    “max-buffers” guint64

The maximum amount of buffers that can be queued internally. After the maximum amount of buffers are queued, appsrc will emit the "enough-data" signal.

Flags : Read / Write

Since : 1.20

#### max-buffers

    “max-buffers” Number

The maximum amount of buffers that can be queued internally. After the maximum amount of buffers are queued, appsrc will emit the "enough-data" signal.

Flags : Read / Write

Since : 1.20

#### max_buffers

    “self.props.max_buffers” int

The maximum amount of buffers that can be queued internally. After the maximum amount of buffers are queued, appsrc will emit the "enough-data" signal.

Flags : Read / Write

Since : 1.20

#### max-bytes

    “max-bytes” guint64

The maximum amount of bytes that can be queued internally. After the maximum amount of bytes are queued, appsrc will emit the "enough-data" signal.

Flags : Read / Write

#### max-bytes

    “max-bytes” Number

The maximum amount of bytes that can be queued internally. After the maximum amount of bytes are queued, appsrc will emit the "enough-data" signal.

Flags : Read / Write

#### max_bytes

    “self.props.max_bytes” int

The maximum amount of bytes that can be queued internally. After the maximum amount of bytes are queued, appsrc will emit the "enough-data" signal.

Flags : Read / Write

#### max-latency

    “max-latency” gint64

Flags : Read / Write

#### max-latency

    “max-latency” Number

Flags : Read / Write

#### max_latency

    “self.props.max_latency” int

Flags : Read / Write

#### max-time

    “max-time” guint64

The maximum amount of time that can be queued internally. After the maximum amount of time are queued, appsrc will emit the "enough-data" signal.

Flags : Read / Write

Since : 1.20

#### max-time

    “max-time” Number

The maximum amount of time that can be queued internally. After the maximum amount of time are queued, appsrc will emit the "enough-data" signal.

Flags : Read / Write

Since : 1.20

#### max_time

    “self.props.max_time” int

The maximum amount of time that can be queued internally. After the maximum amount of time are queued, appsrc will emit the "enough-data" signal.

Flags : Read / Write

Since : 1.20

#### min-latency

    “min-latency” gint64

The minimum latency of the source. A value of -1 will use the default latency calculations of GstBaseSrc.

Flags : Read / Write

#### min-latency

    “min-latency” Number

The minimum latency of the source. A value of -1 will use the default latency calculations of GstBase.BaseSrc.

Flags : Read / Write

#### min_latency

    “self.props.min_latency” int

The minimum latency of the source. A value of -1 will use the default latency calculations of GstBase.BaseSrc.

Flags : Read / Write

#### min-percent

    “min-percent” guint

Make appsrc emit the "need-data" signal when the amount of bytes in the queue drops below this percentage of max-bytes.

Flags : Read / Write

#### min-percent

    “min-percent” Number

Make appsrc emit the "need-data" signal when the amount of bytes in the queue drops below this percentage of max-bytes.

Flags : Read / Write

#### min_percent

    “self.props.min_percent” int

Make appsrc emit the "need-data" signal when the amount of bytes in the queue drops below this percentage of max-bytes.

Flags : Read / Write

#### out

    “out” guint64

Number of output buffers that were dequeued.

Flags : Read

Since : 1.28

#### out

    “out” Number

Number of output buffers that were dequeued.

Flags : Read

Since : 1.28

#### out

    “self.props.out” int

Number of output buffers that were dequeued.

Flags : Read

Since : 1.28

#### silent

    “silent” gboolean

Don't emit notify for input, output and dropped buffers.

Flags : Read / Write

Since : 1.28

#### silent

    “silent” Number

Don't emit notify for input, output and dropped buffers.

Flags : Read / Write

Since : 1.28

#### silent

    “self.props.silent” bool

Don't emit notify for input, output and dropped buffers.

Flags : Read / Write

Since : 1.28

#### size

    “size” gint64

The total size in bytes of the data stream. If the total size is known, it is recommended to configure it with this property.

Flags : Read / Write

#### size

    “size” Number

The total size in bytes of the data stream. If the total size is known, it is recommended to configure it with this property.

Flags : Read / Write

#### size

    “self.props.size” int

The total size in bytes of the data stream. If the total size is known, it is recommended to configure it with this property.

Flags : Read / Write

#### stream-type

    “stream-type” GstAppStreamType *

The type of stream that this source is producing. For seekable streams the application should connect to the seek-data signal.

Flags : Read / Write

#### stream-type

    “stream-type” GstApp.AppStreamType

The type of stream that this source is producing. For seekable streams the application should connect to the seek-data signal.

Flags : Read / Write

#### stream_type

    “self.props.stream_type” GstApp.AppStreamType

The type of stream that this source is producing. For seekable streams the application should connect to the seek-data signal.

Flags : Read / Write

### Virtual Methods

#### end_of_stream

    GstFlowReturn
    end_of_stream (GstAppSrc * appsrc)

Parameters:

`appsrc` –
No description available
Returns –
No description available

#### vfunc_end_of_stream

    function vfunc_end_of_stream(appsrc: GstApp.AppSrc): {
        // javascript implementation of the 'end_of_stream' virtual method
    }

Parameters:

`appsrc` (GstApp.AppSrc) –
No description available
Returns (Gst.FlowReturn) –
No description available

#### do_end_of_stream

    def do_end_of_stream (appsrc):
        #python implementation of the 'end_of_stream' virtual method

Parameters:

`appsrc` (GstApp.AppSrc) –
No description available
Returns (Gst.FlowReturn) –
No description available

#### enough_data

    enough_data (GstAppSrc * appsrc)

Parameters:

`appsrc` –
No description available

#### vfunc_enough_data

    function vfunc_enough_data(appsrc: GstApp.AppSrc): {
        // javascript implementation of the 'enough_data' virtual method
    }

Parameters:

`appsrc` (GstApp.AppSrc) –
No description available

#### do_enough_data

    def do_enough_data (appsrc):
        #python implementation of the 'enough_data' virtual method

Parameters:

`appsrc` (GstApp.AppSrc) –
No description available

#### need_data

    need_data (GstAppSrc * appsrc,
               guint length)

Parameters:

`appsrc` –
No description available
`length` –
No description available

#### vfunc_need_data

    function vfunc_need_data(appsrc: GstApp.AppSrc, length: Number): {
        // javascript implementation of the 'need_data' virtual method
    }

Parameters:

`appsrc` (GstApp.AppSrc) –
No description available
`length` (Number) –
No description available

#### do_need_data

    def do_need_data (appsrc, length):
        #python implementation of the 'need_data' virtual method

Parameters:

`appsrc` (GstApp.AppSrc) –
No description available
`length` (int) –
No description available

#### push_buffer

    GstFlowReturn
    push_buffer (GstAppSrc * appsrc,
                 GstBuffer * buffer)

Parameters:

`appsrc` –
No description available
`buffer` –
No description available
Returns –
No description available

#### vfunc_push_buffer

    function vfunc_push_buffer(appsrc: GstApp.AppSrc, buffer: Gst.Buffer): {
        // javascript implementation of the 'push_buffer' virtual method
    }

Parameters:

`appsrc` (GstApp.AppSrc) –
No description available
`buffer` (Gst.Buffer) –
No description available
Returns (Gst.FlowReturn) –
No description available

#### do_push_buffer

    def do_push_buffer (appsrc, buffer):
        #python implementation of the 'push_buffer' virtual method

Parameters:

`appsrc` (GstApp.AppSrc) –
No description available
`buffer` (Gst.Buffer) –
No description available
Returns (Gst.FlowReturn) –
No description available

#### push_buffer_list

    GstFlowReturn
    push_buffer_list (GstAppSrc * appsrc,
                      GstBufferList * buffer_list)

Parameters:

`appsrc` –
No description available
`buffer_list` –
No description available
Returns –
No description available

#### vfunc_push_buffer_list

    function vfunc_push_buffer_list(appsrc: GstApp.AppSrc, buffer_list: Gst.BufferList): {
        // javascript implementation of the 'push_buffer_list' virtual method
    }

Parameters:

`appsrc` (GstApp.AppSrc) –
No description available
`buffer_list` (Gst.BufferList) –
No description available
Returns (Gst.FlowReturn) –
No description available

#### do_push_buffer_list

    def do_push_buffer_list (appsrc, buffer_list):
        #python implementation of the 'push_buffer_list' virtual method

Parameters:

`appsrc` (GstApp.AppSrc) –
No description available
`buffer_list` (Gst.BufferList) –
No description available
Returns (Gst.FlowReturn) –
No description available

#### push_sample

    GstFlowReturn
    push_sample (GstAppSrc * appsrc,
                 GstSample * sample)

Parameters:

`appsrc` –
No description available
`sample` –
No description available
Returns –
No description available

#### vfunc_push_sample

    function vfunc_push_sample(appsrc: GstApp.AppSrc, sample: Gst.Sample): {
        // javascript implementation of the 'push_sample' virtual method
    }

Parameters:

`appsrc` (GstApp.AppSrc) –
No description available
`sample` (Gst.Sample) –
No description available
Returns (Gst.FlowReturn) –
No description available

#### do_push_sample

    def do_push_sample (appsrc, sample):
        #python implementation of the 'push_sample' virtual method

Parameters:

`appsrc` (GstApp.AppSrc) –
No description available
`sample` (Gst.Sample) –
No description available
Returns (Gst.FlowReturn) –
No description available

#### seek_data

    gboolean
    seek_data (GstAppSrc * appsrc,
               guint64 offset)

Parameters:

`appsrc` –
No description available
`offset` –
No description available
Returns –
No description available

#### vfunc_seek_data

    function vfunc_seek_data(appsrc: GstApp.AppSrc, offset: Number): {
        // javascript implementation of the 'seek_data' virtual method
    }

Parameters:

`appsrc` (GstApp.AppSrc) –
No description available
`offset` (Number) –
No description available
Returns (Number) –
No description available

#### do_seek_data

    def do_seek_data (appsrc, offset):
        #python implementation of the 'seek_data' virtual method

Parameters:

`appsrc` (GstApp.AppSrc) –
No description available
`offset` (int) –
No description available
Returns (bool) –
No description available

## GstAppSrcCallbacks

A set of callbacks that can be installed on the appsrc with gst_app_src_set_callbacks.

## GstAppSrcSimpleCallbacks

A set of callbacks that can be installed on the appsink with gst_app_sink_set_simple_callbacks.

Unlike GstAppSrcCallbacks this can also be used from bindings.

Since : 1.28

## GstApp.AppSrcSimpleCallbacks

A set of callbacks that can be installed on the appsink with GstApp.AppSink.prototype.set_simple_callbacks.

Unlike GstAppSrcCallbacks this can also be used from bindings.

Since : 1.28

## GstApp.AppSrcSimpleCallbacks

A set of callbacks that can be installed on the appsink with GstApp.AppSink.set_simple_callbacks.

Unlike GstAppSrcCallbacks this can also be used from bindings.

Since : 1.28

### Constructors

#### gst_app_src_simple_callbacks_new

    GstAppSrcSimpleCallbacks *
    gst_app_src_simple_callbacks_new ()

Creates a new instance of callbacks.

Returns ( [transfer: full]) –

New empty GstAppSrcSimpleCallbacks

Since : 1.28

#### GstApp.AppSrcSimpleCallbacks.prototype.new

    function GstApp.AppSrcSimpleCallbacks.prototype.new(): {
        // javascript wrapper for 'gst_app_src_simple_callbacks_new'
    }

Creates a new instance of callbacks.

Returns (GstApp.AppSrcSimpleCallbacks) –

New empty GstAppSrcSimpleCallbacks

Since : 1.28

#### GstApp.AppSrcSimpleCallbacks.new

    def GstApp.AppSrcSimpleCallbacks.new ():
        #python wrapper for 'gst_app_src_simple_callbacks_new'

Creates a new instance of callbacks.

Returns (GstApp.AppSrcSimpleCallbacks) –

New empty GstAppSrcSimpleCallbacks

Since : 1.28

### Methods

#### gst_app_src_simple_callbacks_ref

    GstAppSrcSimpleCallbacks *
    gst_app_src_simple_callbacks_ref (GstAppSrcSimpleCallbacks * cb)

Increases the reference count of cb.

Parameters:

`cb` –

the callbacks

Returns ( [transfer: full]) –

the callbacks

Since : 1.28

#### GstApp.AppSrcSimpleCallbacks.prototype.ref

    function GstApp.AppSrcSimpleCallbacks.prototype.ref(): {
        // javascript wrapper for 'gst_app_src_simple_callbacks_ref'
    }

Increases the reference count of cb.

Parameters:

`cb` (GstApp.AppSrcSimpleCallbacks) –

the callbacks

Returns (GstApp.AppSrcSimpleCallbacks) –

the callbacks

Since : 1.28

#### GstApp.AppSrcSimpleCallbacks.ref

    def GstApp.AppSrcSimpleCallbacks.ref (self):
        #python wrapper for 'gst_app_src_simple_callbacks_ref'

Increases the reference count of cb.

Parameters:

`cb` (GstApp.AppSrcSimpleCallbacks) –

the callbacks

Returns (GstApp.AppSrcSimpleCallbacks) –

the callbacks

Since : 1.28

#### gst_app_src_simple_callbacks_set_enough_data

    gst_app_src_simple_callbacks_set_enough_data (GstAppSrcSimpleCallbacks * cb,
                                                  GstAppSrcEnoughDataCallback enough_data_cb,
                                                  gpointer user_data,
                                                  GDestroyNotify destroy_notify)

Sets the enough data callback on cb.

Once cb is set on an GstAppSrc it is not possible anymore to change any of the callbacks inside it.

Parameters:

`cb` –

the callbacks

`enough_data_cb` ( [scope notified][closure]) –

EOS callback

`user_data` –

the user data

`destroy_notify` –

GDestroyNotify to free the user data

Since : 1.28

#### GstApp.AppSrcSimpleCallbacks.prototype.set_enough_data

    function GstApp.AppSrcSimpleCallbacks.prototype.set_enough_data(enough_data_cb: GstApp.AppSrcEnoughDataCallback, user_data: Object): {
        // javascript wrapper for 'gst_app_src_simple_callbacks_set_enough_data'
    }

Sets the enough data callback on cb.

Once cb is set on an GstApp.AppSrc it is not possible anymore to change any of the callbacks inside it.

Parameters:

`cb` (GstApp.AppSrcSimpleCallbacks) –

the callbacks

`enough_data_cb` (GstApp.AppSrcEnoughDataCallback) –

EOS callback

`user_data` (Object) –

the user data

Since : 1.28

#### GstApp.AppSrcSimpleCallbacks.set_enough_data

    def GstApp.AppSrcSimpleCallbacks.set_enough_data (self, enough_data_cb, *user_data):
        #python wrapper for 'gst_app_src_simple_callbacks_set_enough_data'

Sets the enough data callback on cb.

Once cb is set on an GstApp.AppSrc it is not possible anymore to change any of the callbacks inside it.

Parameters:

`cb` (GstApp.AppSrcSimpleCallbacks) –

the callbacks

`enough_data_cb` (GstApp.AppSrcEnoughDataCallback) –

EOS callback

`user_data` (variadic) –

the user data

Since : 1.28

#### gst_app_src_simple_callbacks_set_need_data

    gst_app_src_simple_callbacks_set_need_data (GstAppSrcSimpleCallbacks * cb,
                                                GstAppSrcNeedDataCallback need_data_cb,
                                                gpointer user_data,
                                                GDestroyNotify destroy_notify)

Sets the need data callback on cb.

Once cb is set on an GstAppSrc it is not possible anymore to change any of the callbacks inside it.

Parameters:

`cb` –

the callbacks

`need_data_cb` ( [scope notified][closure]) –

EOS callback

`user_data` –

the user data

`destroy_notify` –

GDestroyNotify to free the user data

Since : 1.28

#### GstApp.AppSrcSimpleCallbacks.prototype.set_need_data

    function GstApp.AppSrcSimpleCallbacks.prototype.set_need_data(need_data_cb: GstApp.AppSrcNeedDataCallback, user_data: Object): {
        // javascript wrapper for 'gst_app_src_simple_callbacks_set_need_data'
    }

Sets the need data callback on cb.

Once cb is set on an GstApp.AppSrc it is not possible anymore to change any of the callbacks inside it.

Parameters:

`cb` (GstApp.AppSrcSimpleCallbacks) –

the callbacks

`need_data_cb` (GstApp.AppSrcNeedDataCallback) –

EOS callback

`user_data` (Object) –

the user data

Since : 1.28

#### GstApp.AppSrcSimpleCallbacks.set_need_data

    def GstApp.AppSrcSimpleCallbacks.set_need_data (self, need_data_cb, *user_data):
        #python wrapper for 'gst_app_src_simple_callbacks_set_need_data'

Sets the need data callback on cb.

Once cb is set on an GstApp.AppSrc it is not possible anymore to change any of the callbacks inside it.

Parameters:

`cb` (GstApp.AppSrcSimpleCallbacks) –

the callbacks

`need_data_cb` (GstApp.AppSrcNeedDataCallback) –

EOS callback

`user_data` (variadic) –

the user data

Since : 1.28

#### gst_app_src_simple_callbacks_set_seek_data

    gst_app_src_simple_callbacks_set_seek_data (GstAppSrcSimpleCallbacks * cb,
                                                GstAppSrcSeekDataCallback seek_data_cb,
                                                gpointer user_data,
                                                GDestroyNotify destroy_notify)

Sets the seek data callback on cb.

Once cb is set on an GstAppSrc it is not possible anymore to change any of the callbacks inside it.

Parameters:

`cb` –

the callbacks

`seek_data_cb` ( [scope notified][closure]) –

EOS callback

`user_data` –

the user data

`destroy_notify` –

GDestroyNotify to free the user data

Since : 1.28

#### GstApp.AppSrcSimpleCallbacks.prototype.set_seek_data

    function GstApp.AppSrcSimpleCallbacks.prototype.set_seek_data(seek_data_cb: GstApp.AppSrcSeekDataCallback, user_data: Object): {
        // javascript wrapper for 'gst_app_src_simple_callbacks_set_seek_data'
    }

Sets the seek data callback on cb.

Once cb is set on an GstApp.AppSrc it is not possible anymore to change any of the callbacks inside it.

Parameters:

`cb` (GstApp.AppSrcSimpleCallbacks) –

the callbacks

`seek_data_cb` (GstApp.AppSrcSeekDataCallback) –

EOS callback

`user_data` (Object) –

the user data

Since : 1.28

#### GstApp.AppSrcSimpleCallbacks.set_seek_data

    def GstApp.AppSrcSimpleCallbacks.set_seek_data (self, seek_data_cb, *user_data):
        #python wrapper for 'gst_app_src_simple_callbacks_set_seek_data'

Sets the seek data callback on cb.

Once cb is set on an GstApp.AppSrc it is not possible anymore to change any of the callbacks inside it.

Parameters:

`cb` (GstApp.AppSrcSimpleCallbacks) –

the callbacks

`seek_data_cb` (GstApp.AppSrcSeekDataCallback) –

EOS callback

`user_data` (variadic) –

the user data

Since : 1.28

#### gst_app_src_simple_callbacks_unref

    gst_app_src_simple_callbacks_unref (GstAppSrcSimpleCallbacks * cb)

Decreases the reference count of cb and frees it after the last reference is dropped.

Parameters:

`cb` –

the callbacks

Since : 1.28

#### GstApp.AppSrcSimpleCallbacks.prototype.unref

    function GstApp.AppSrcSimpleCallbacks.prototype.unref(): {
        // javascript wrapper for 'gst_app_src_simple_callbacks_unref'
    }

Decreases the reference count of cb and frees it after the last reference is dropped.

Parameters:

`cb` (GstApp.AppSrcSimpleCallbacks) –

the callbacks

Since : 1.28

#### GstApp.AppSrcSimpleCallbacks.unref

    def GstApp.AppSrcSimpleCallbacks.unref (self):
        #python wrapper for 'gst_app_src_simple_callbacks_unref'

Decreases the reference count of cb and frees it after the last reference is dropped.

Parameters:

`cb` (GstApp.AppSrcSimpleCallbacks) –

the callbacks

Since : 1.28

## Function Macros

### GST_APP_SRC_CAST

    #define GST_APP_SRC_CAST(obj) \
      ((GstAppSrc*)(obj))

## Enumerations

### GstAppLeakyType

Buffer dropping scheme to avoid the element's internal queue to block when full.

##### Members

`GST_APP_LEAKY_TYPE_NONE` (0) –

Not Leaky

`GST_APP_LEAKY_TYPE_UPSTREAM` (1) –

Leaky on upstream (new buffers)

`GST_APP_LEAKY_TYPE_DOWNSTREAM` (2) –

Leaky on downstream (old buffers)

Since : 1.20

### GstApp.AppLeakyType

Buffer dropping scheme to avoid the element's internal queue to block when full.

##### Members

`GstApp.AppLeakyType.NONE` (0) –

Not Leaky

`GstApp.AppLeakyType.UPSTREAM` (1) –

Leaky on upstream (new buffers)

`GstApp.AppLeakyType.DOWNSTREAM` (2) –

Leaky on downstream (old buffers)

Since : 1.20

### GstApp.AppLeakyType

Buffer dropping scheme to avoid the element's internal queue to block when full.

##### Members

`GstApp.AppLeakyType.NONE` (0) –

Not Leaky

`GstApp.AppLeakyType.UPSTREAM` (1) –

Leaky on upstream (new buffers)

`GstApp.AppLeakyType.DOWNSTREAM` (2) –

Leaky on downstream (old buffers)

Since : 1.20

### GstAppStreamType

The stream type.

##### Members

`GST_APP_STREAM_TYPE_STREAM` (0) –

No seeking is supported in the stream, such as a live stream.

`GST_APP_STREAM_TYPE_SEEKABLE` (1) –

The stream is seekable but seeking might not be very fast, such as data from a webserver.

`GST_APP_STREAM_TYPE_RANDOM_ACCESS` (2) –

The stream is seekable and seeking is fast, such as in a local file.

### GstApp.AppStreamType

The stream type.

##### Members

`GstApp.AppStreamType.STREAM` (0) –

No seeking is supported in the stream, such as a live stream.

`GstApp.AppStreamType.SEEKABLE` (1) –

The stream is seekable but seeking might not be very fast, such as data from a webserver.

`GstApp.AppStreamType.RANDOM_ACCESS` (2) –

The stream is seekable and seeking is fast, such as in a local file.

### GstApp.AppStreamType

The stream type.

##### Members

`GstApp.AppStreamType.STREAM` (0) –

No seeking is supported in the stream, such as a live stream.

`GstApp.AppStreamType.SEEKABLE` (1) –

The stream is seekable but seeking might not be very fast, such as data from a webserver.

`GstApp.AppStreamType.RANDOM_ACCESS` (2) –

The stream is seekable and seeking is fast, such as in a local file.

## Constants

### GST_TYPE_APP_SRC

    #define GST_TYPE_APP_SRC \
      (gst_app_src_get_type())

### GST_TYPE_APP_SRC_SIMPLE_CALLBACKS

    #define GST_TYPE_APP_SRC_SIMPLE_CALLBACKS (gst_app_src_simple_callbacks_get_type ())

Since : 1.28

## Callbacks

### GstAppSrcEnoughDataCallback

    (*GstAppSrcEnoughDataCallback) (GstAppSrc * appsrc,
                                    gpointer user_data)

Called when appsrc has enough data. It is recommended that the application stops calling push-buffer until the need_data callback is emitted again to avoid excessive buffer queueing.

Parameters:

`appsrc` –

a GstAppSrc

`user_data` –

callback user data

Since : 1.28

### GstApp.AppSrcEnoughDataCallback

    function GstApp.AppSrcEnoughDataCallback(appsrc: GstApp.AppSrc, user_data: Object): {
        // javascript wrapper for 'GstAppSrcEnoughDataCallback'
    }

Called when appsrc has enough data. It is recommended that the application stops calling push-buffer until the need_data callback is emitted again to avoid excessive buffer queueing.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`user_data` (Object) –

callback user data

Since : 1.28

### GstApp.AppSrcEnoughDataCallback

    def GstApp.AppSrcEnoughDataCallback (appsrc, *user_data):
        #python wrapper for 'GstAppSrcEnoughDataCallback'

Called when appsrc has enough data. It is recommended that the application stops calling push-buffer until the need_data callback is emitted again to avoid excessive buffer queueing.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`user_data` (variadic) –

callback user data

Since : 1.28

### GstAppSrcNeedDataCallback

    (*GstAppSrcNeedDataCallback) (GstAppSrc * appsrc,
                                  guint length,
                                  gpointer user_data)

Called when the appsrc needs more data. A buffer or EOS should be pushed to appsrc from this thread or another thread. length is just a hint and when it is set to -1, any number of bytes can be pushed into appsrc.

Parameters:

`appsrc` –

a GstAppSrc

`length` –

Length hint

`user_data` –

callback user data

Since : 1.28

### GstApp.AppSrcNeedDataCallback

    function GstApp.AppSrcNeedDataCallback(appsrc: GstApp.AppSrc, length: Number, user_data: Object): {
        // javascript wrapper for 'GstAppSrcNeedDataCallback'
    }

Called when the appsrc needs more data. A buffer or EOS should be pushed to appsrc from this thread or another thread. length is just a hint and when it is set to -1, any number of bytes can be pushed into appsrc.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`length` (Number) –

Length hint

`user_data` (Object) –

callback user data

Since : 1.28

### GstApp.AppSrcNeedDataCallback

    def GstApp.AppSrcNeedDataCallback (appsrc, length, *user_data):
        #python wrapper for 'GstAppSrcNeedDataCallback'

Called when the appsrc needs more data. A buffer or EOS should be pushed to appsrc from this thread or another thread. length is just a hint and when it is set to -1, any number of bytes can be pushed into appsrc.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`length` (int) –

Length hint

`user_data` (variadic) –

callback user data

Since : 1.28

### GstAppSrcSeekDataCallback

    gboolean
    (*GstAppSrcSeekDataCallback) (GstAppSrc * appsrc,
                                  guint64 offset,
                                  gpointer user_data)

Called when a seek should be performed to the offset. The next push-buffer should produce buffers from the new offset. This callback is only called for seekable stream types.

Parameters:

`appsrc` –

a GstAppSrc

`offset` –

Offset to seek to.

`user_data` –

callback user data

Returns –

TRUE if the seek was successful.

Since : 1.28

### GstApp.AppSrcSeekDataCallback

    function GstApp.AppSrcSeekDataCallback(appsrc: GstApp.AppSrc, offset: Number, user_data: Object): {
        // javascript wrapper for 'GstAppSrcSeekDataCallback'
    }

Called when a seek should be performed to the offset. The next push-buffer should produce buffers from the new offset. This callback is only called for seekable stream types.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`offset` (Number) –

Offset to seek to.

`user_data` (Object) –

callback user data

Returns (Number) –

true if the seek was successful.

Since : 1.28

### GstApp.AppSrcSeekDataCallback

    def GstApp.AppSrcSeekDataCallback (appsrc, offset, *user_data):
        #python wrapper for 'GstAppSrcSeekDataCallback'

Called when a seek should be performed to the offset. The next push-buffer should produce buffers from the new offset. This callback is only called for seekable stream types.

Parameters:

`appsrc` (GstApp.AppSrc) –

a GstApp.AppSrc

`offset` (int) –

Offset to seek to.

`user_data` (variadic) –

callback user data

Returns (bool) –

True if the seek was successful.

Since : 1.28

The results of the search are