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" property controls 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)
–
Class structure
GstAppSrc
GObject ╰──GInitiallyUnowned ╰──GstObject ╰──GstElement ╰──GstBaseSrc ╰──GstAppSrc
Members
basesrc
(GstBaseSrc)
–
GstAppSrc
GObject ╰──GInitiallyUnowned ╰──GstObject ╰──GstElement ╰──GstBaseSrc ╰──GstAppSrc
Members
basesrc
(GstBaseSrc)
–
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
–
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
)
–
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
)
–
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
–
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
)
–
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
)
–
the Gst.Caps produced by the source. gst_caps_unref (not introspectable) after usage.
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
–
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
)
–
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
)
–
The number of currently queued bytes.
Since : 1.2
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
–
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
)
–
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
)
–
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
–
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
)
–
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
)
–
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.
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
)
–
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
)
–
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
–
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
)
–
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
)
–
The maximum amount of bytes that can be queued.
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
–
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
)
–
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
)
–
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
–
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
)
–
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
)
–
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.
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.
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.
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.
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.
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.
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
–
sample
(
[transfer: none]
)
–
a GstSample from which buffer and caps may be extracted
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
)
–
sample
(
Gst.Sample
)
–
a Gst.Sample from which buffer and caps may be extracted
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
)
–
sample
(
Gst.Sample
)
–
a Gst.Sample from which buffer and caps may be extracted
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.
Parameters:
appsrc
–
callbacks
–
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
)
–
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.
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.
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.
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.
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.
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.
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.
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
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
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
Signals
end-of-stream
GstFlowReturn * end_of_stream_callback (GstAppSrc * self, gpointer user_data)
Notify appsrc that no more buffer are available.
Parameters:
self
–
user_data
–
end-of-stream
function end_of_stream_callback(self: GstApp.AppSrc, user_data: Object): {
// javascript callback for the 'end-of-stream' signal
}
Notify appsrc that no more buffer are available.
Parameters:
self
(
GstApp.AppSrc
)
–
user_data
(
Object
)
–
end-of-stream
def end_of_stream_callback (self, *user_data):
#python callback for the 'end-of-stream' signal
Notify appsrc that no more buffer are available.
Parameters:
self
(
GstApp.AppSrc
)
–
user_data
(
variadic
)
–
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
–
user_data
–
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
)
–
user_data
(
Object
)
–
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
)
–
user_data
(
variadic
)
–
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
–
length
–
the amount of bytes needed.
user_data
–
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
)
–
length
(
Number
)
–
the amount of bytes needed.
user_data
(
Object
)
–
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
)
–
length
(
int
)
–
the amount of bytes needed.
user_data
(
variadic
)
–
Flags: Run Last
push-buffer
GstFlowReturn * push_buffer_callback (GstAppSrc * self, GstBuffer * buffer, gpointer 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 so the buffer 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:
self
–
buffer
–
a buffer to push
user_data
–
push-buffer
function push_buffer_callback(self: GstApp.AppSrc, buffer: Gst.Buffer, user_data: Object): {
// javascript callback for the 'push-buffer' signal
}
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 so the buffer 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:
self
(
GstApp.AppSrc
)
–
buffer
(
Gst.Buffer
)
–
a buffer to push
user_data
(
Object
)
–
push-buffer
def push_buffer_callback (self, buffer, *user_data):
#python callback for the 'push-buffer' signal
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 so the buffer 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:
self
(
GstApp.AppSrc
)
–
buffer
(
Gst.Buffer
)
–
a buffer to push
user_data
(
variadic
)
–
push-buffer-list
GstFlowReturn * push_buffer_list_callback (GstAppSrc * self, GstBufferList * buffer_list, gpointer 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 so the buffer list 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:
self
–
buffer_list
–
a buffer list to push
user_data
–
Since : 1.14
push-buffer-list
function push_buffer_list_callback(self: GstApp.AppSrc, buffer_list: Gst.BufferList, user_data: Object): {
// javascript callback for the 'push-buffer-list' signal
}
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 so the buffer list 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:
self
(
GstApp.AppSrc
)
–
buffer_list
(
Gst.BufferList
)
–
a buffer list to push
user_data
(
Object
)
–
Since : 1.14
push-buffer-list
def push_buffer_list_callback (self, buffer_list, *user_data):
#python callback for the 'push-buffer-list' signal
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 so the buffer list 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:
self
(
GstApp.AppSrc
)
–
buffer_list
(
Gst.BufferList
)
–
a buffer list to push
user_data
(
variadic
)
–
Since : 1.14
push-sample
GstFlowReturn * push_sample_callback (GstAppSrc * self, GstSample * sample, gpointer 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 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:
self
–
sample
–
a sample from which extract buffer to push
user_data
–
Since : 1.6
push-sample
function push_sample_callback(self: GstApp.AppSrc, sample: Gst.Sample, user_data: Object): {
// javascript callback for the 'push-sample' signal
}
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 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:
self
(
GstApp.AppSrc
)
–
sample
(
Gst.Sample
)
–
a sample from which extract buffer to push
user_data
(
Object
)
–
Since : 1.6
push-sample
def push_sample_callback (self, sample, *user_data):
#python callback for the 'push-sample' signal
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 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:
self
(
GstApp.AppSrc
)
–
sample
(
Gst.Sample
)
–
a sample from which extract buffer to push
user_data
(
variadic
)
–
Since : 1.6
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
–
offset
–
the offset to seek to
user_data
–
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
)
–
offset
(
Number
)
–
the offset to seek to
user_data
(
Object
)
–
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
)
–
offset
(
int
)
–
the offset to seek to
user_data
(
variadic
)
–
Flags: Run Last
Properties
Virtual Methods
end_of_stream
GstFlowReturn end_of_stream (GstAppSrc * appsrc)
Parameters:
appsrc
–
end_of_stream
function end_of_stream(appsrc: GstApp.AppSrc): {
// javascript implementation of the 'end_of_stream' virtual method
}
Parameters:
appsrc
(
GstApp.AppSrc
)
–
end_of_stream
def end_of_stream (appsrc):
#python implementation of the 'end_of_stream' virtual method
Parameters:
appsrc
(
GstApp.AppSrc
)
–
enough_data
function enough_data(appsrc: GstApp.AppSrc): {
// javascript implementation of the 'enough_data' virtual method
}
Parameters:
appsrc
(
GstApp.AppSrc
)
–
enough_data
def enough_data (appsrc):
#python implementation of the 'enough_data' virtual method
Parameters:
appsrc
(
GstApp.AppSrc
)
–
need_data
need_data (GstAppSrc * appsrc, guint length)
Parameters:
appsrc
–
length
–
need_data
function need_data(appsrc: GstApp.AppSrc, length: Number): {
// javascript implementation of the 'need_data' virtual method
}
Parameters:
appsrc
(
GstApp.AppSrc
)
–
length
(
Number
)
–
need_data
def need_data (appsrc, length):
#python implementation of the 'need_data' virtual method
Parameters:
appsrc
(
GstApp.AppSrc
)
–
length
(
int
)
–
push_buffer
GstFlowReturn push_buffer (GstAppSrc * appsrc, GstBuffer * buffer)
Parameters:
appsrc
–
buffer
–
push_buffer
function push_buffer(appsrc: GstApp.AppSrc, buffer: Gst.Buffer): {
// javascript implementation of the 'push_buffer' virtual method
}
Parameters:
appsrc
(
GstApp.AppSrc
)
–
buffer
(
Gst.Buffer
)
–
push_buffer
def push_buffer (appsrc, buffer):
#python implementation of the 'push_buffer' virtual method
Parameters:
appsrc
(
GstApp.AppSrc
)
–
buffer
(
Gst.Buffer
)
–
push_buffer_list
GstFlowReturn push_buffer_list (GstAppSrc * appsrc, GstBufferList * buffer_list)
Parameters:
appsrc
–
buffer_list
–
push_buffer_list
function push_buffer_list(appsrc: GstApp.AppSrc, buffer_list: Gst.BufferList): {
// javascript implementation of the 'push_buffer_list' virtual method
}
Parameters:
appsrc
(
GstApp.AppSrc
)
–
buffer_list
(
Gst.BufferList
)
–
push_buffer_list
def push_buffer_list (appsrc, buffer_list):
#python implementation of the 'push_buffer_list' virtual method
Parameters:
appsrc
(
GstApp.AppSrc
)
–
buffer_list
(
Gst.BufferList
)
–
push_sample
GstFlowReturn push_sample (GstAppSrc * appsrc, GstSample * sample)
Parameters:
appsrc
–
sample
–
push_sample
function push_sample(appsrc: GstApp.AppSrc, sample: Gst.Sample): {
// javascript implementation of the 'push_sample' virtual method
}
Parameters:
appsrc
(
GstApp.AppSrc
)
–
sample
(
Gst.Sample
)
–
push_sample
def push_sample (appsrc, sample):
#python implementation of the 'push_sample' virtual method
Parameters:
appsrc
(
GstApp.AppSrc
)
–
sample
(
Gst.Sample
)
–
seek_data
gboolean seek_data (GstAppSrc * appsrc, guint64 offset)
Parameters:
appsrc
–
offset
–
seek_data
function seek_data(appsrc: GstApp.AppSrc, offset: Number): {
// javascript implementation of the 'seek_data' virtual method
}
Parameters:
appsrc
(
GstApp.AppSrc
)
–
offset
(
Number
)
–
seek_data
def seek_data (appsrc, offset):
#python implementation of the 'seek_data' virtual method
Parameters:
appsrc
(
GstApp.AppSrc
)
–
offset
(
int
)
–
GstAppSrcCallbacks
A set of callbacks that can be installed on the appsrc with gst_app_src_set_callbacks.
Function Macros
GST_APP_SRC_CAST
#define GST_APP_SRC_CAST(obj) \ ((GstAppSrc*)(obj))
Enumerations
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())
The results of the search are