Sets our main struct and passes it to the parent class.
Signal that the end-of-stream has been reached. This signal is emitted from the streaming thread.
Signal that a new preroll sample is available.
Signal that a new sample is available.
Get the last preroll sample in appsink. This was the sample that caused the appsink to preroll in the PAUSED state.
This function blocks until a sample or EOS becomes available or the appsink element is set to the READY/NULL state.
Get the last preroll sample in appsink. This was the sample that caused the appsink to preroll in the PAUSED state.
This function blocks until a sample or EOS becomes available or the appsink element is set to the READY/NULL state or the timeout expires.
Get the main Gtk struct
Check if appsink supports buffer lists.
Get the configured caps on appsink.
Check if appsink will drop old buffers when the maximum amount of queued buffers is reached.
Check if appsink will emit the "new-preroll" and "new-sample" signals.
Get the maximum amount of buffers that can be queued in appsink.
the main Gtk struct as a void*
Check if appsink will wait for all buffers to be consumed when an EOS is received.
Check if appsink is EOS, which is when no more samples can be pulled because an EOS event was received.
Get the last preroll sample in appsink. This was the sample that caused the appsink to preroll in the PAUSED state.
This function blocks until a sample or EOS becomes available or the appsink element is set to the READY/NULL state.
Instruct appsink to enable or disable buffer list support.
Set callbacks which will be executed for each new preroll, new sample and eos. This is an alternative to using the signals, it has lower overhead and is thus less expensive, but also less flexible.
Set the capabilities on the appsink element. This function takes a copy of the caps structure. After calling this method, the sink will only accept caps that match caps. If caps is non-fixed, or incomplete, you must check the caps on the samples to get the actual used caps.
Instruct appsink to drop old buffers when the maximum amount of queued buffers is reached.
Make appsink emit the "new-preroll" and "new-sample" signals. This option is by default disabled because signal emission is expensive and unneeded when the application prefers to operate in pull mode.
Set the maximum amount of buffers that can be queued in appsink. After this amount of buffers are queued in appsink, any more buffers will block upstream elements until a sample is pulled from appsink.
Instruct appsink to wait for all buffers to be consumed when an EOS is received.
Get the last preroll sample in appsink. This was the sample that caused the appsink to preroll in the PAUSED state.
This function blocks until a sample or EOS becomes available or the appsink element is set to the READY/NULL state or the timeout expires.
the main Gtk struct
the main Gtk struct
Get the main Gtk struct
the main Gtk struct as a void*
If the sink spawns its own thread for pulling buffers from upstream it should call this method after it has pulled a buffer. If the element needed to preroll, this function will perform the preroll and will then block until the element state is changed.
Get the number of bytes that the sink will pull when it is operating in pull mode.
Checks if sink is currently configured to drop buffers which are outside the current segment
Get the last sample that arrived in the sink and was used for preroll or for rendering. This property can be used to generate thumbnails.
Get the currently configured latency.
Get the maximum amount of bits per second that the sink will render.
Gets the max lateness value. See BaseSink.setMaxLateness for more details.
Get the processing deadline of sink. see BaseSink.setProcessingDeadline for more information about the processing deadline.
Get the render delay of sink. see BaseSink.setRenderDelay for more information about the render delay.
Checks if sink is currently configured to synchronize against the clock.
Get the time that will be inserted between frames to control the maximum buffers per second.
Get the synchronisation offset of sink.
Checks if sink is currently configured to perform asynchronous state changes to PAUSED.
Checks if sink is currently configured to store the last received sample in the last-sample property.
Checks if sink is currently configured to send Quality-of-Service events upstream.
Query the sink for the latency parameters. The latency will be queried from the upstream elements. live will be TRUE if sink is configured to synchronize against the clock. upstream_live will be TRUE if an upstream element is live.
Configures sink to perform all state changes asynchronously. When async is disabled, the sink will immediately go to PAUSED instead of waiting for a preroll buffer. This feature is useful if the sink does not synchronize against the clock or when it is dealing with sparse streams.
Set the number of bytes that the sink will pull when it is operating in pull mode.
Configure sink to drop buffers which are outside the current segment
Configures sink to store the last received sample in the last-sample property.
Set the maximum amount of bits per second that the sink will render.
Sets the new max lateness value to max_lateness. This value is used to decide if a buffer should be dropped or not based on the buffer timestamp and the current clock time. A value of -1 means an unlimited time.
Maximum amount of time (in nanoseconds) that the pipeline can take for processing the buffer. This is added to the latency of live pipelines.
Configures sink to send Quality-of-Service events upstream.
Set the render delay in sink to delay. The render delay is the time between actual rendering of a buffer and its synchronisation time. Some devices might delay media rendering which can be compensated for with this function.
Configures sink to synchronize on the clock or not. When sync is FALSE, incoming samples will be played as fast as possible. If sync is TRUE, the timestamps of the incoming buffers will be used to schedule the exact render time of its contents.
Set the time that will be inserted between rendered buffers. This can be used to control the maximum buffers per second that the sink will render.
Adjust the synchronisation of sink with offset. A negative value will render buffers earlier than their timestamp. A positive value will delay rendering. This function can be used to fix playback of badly timestamped buffers.
This function will wait for preroll to complete and will then block until time is reached. It is usually called by subclasses that use their own internal synchronisation but want to let some synchronization (like EOS) be handled by the base class.
This function will block until time is reached. It is usually called by subclasses that use their own internal synchronisation.
If the GstBaseSinkClas.render|GstBaseSinkClas.renders method performs its own synchronisation against the clock it must unblock when going from PLAYING to the PAUSED state and call this method before continuing to render the remaining data.
Get the main Gtk struct
the main Gtk struct as a void*
Gets the list of protocols supported by handler. This list may not be modified.
Gets the currently handled URI.
Gets the type of the given URI handler
Tries to set the URI of the given handler.
Appsink is a sink plugin that supports many different methods for making the application get a handle on the GStreamer data in a pipeline. Unlike most GStreamer elements, Appsink provides external API functions.
appsink can be used by linking to the gstappsink.h header file to access the methods or by using the appsink action signals and properties.
The normal way of retrieving samples from appsink is by using the AppSink.pullSample and AppSink.pullPreroll methods. These methods block until a sample becomes available in the sink or when the sink is shut down or reaches EOS. There are also timed variants of these methods, AppSink.tryPullSample and AppSink.tryPullPreroll, which accept a timeout parameter to limit the amount of time to wait.
Appsink will internally use a queue to collect buffers from the streaming thread. If the application is not pulling samples fast enough, this queue will consume a lot of memory over time. The "max-buffers" property can be used to limit the queue size. The "drop" property controls whether the streaming thread blocks or if older buffers are dropped when the maximum queue size is reached. Note that blocking the streaming thread can negatively affect real-time performance and should be avoided.
If a blocking behaviour is not desirable, setting the "emit-signals" property to TRUE will make appsink emit the "new-sample" and "new-preroll" signals when a sample can be pulled without blocking.
The "caps" property on appsink can be used to control the formats that appsink can receive. This property can contain non-fixed caps, the format of the pulled samples can be obtained by getting the sample caps.
If one of the pull-preroll or pull-sample methods return NULL, the appsink is stopped or in the EOS state. You can check for the EOS state with the "eos" property or with the AppSink.isEos method.
The eos signal can also be used to be informed when the EOS state is reached to avoid polling.