multifdsink

This plugin writes incoming data to a set of file descriptors. The file descriptors can be added to multifdsink by emitting the GstMultiFdSink::add signal. For each descriptor added, the GstMultiFdSink::client-added signal will be called.

The multifdsink element needs to be set into READY, PAUSED or PLAYING state before operations such as adding clients are possible.

A client can also be added with the GstMultiFdSink::add-full signal that allows for more control over what and how much data a client initially receives.

Clients can be removed from multifdsink by emitting the GstMultiFdSink::remove signal. For each descriptor removed, the GstMultiFdSink::client-removed signal will be called. The GstMultiFdSink::client-removed signal can also be fired when multifdsink decides that a client is not active anymore or, depending on the value of the recover-policy property, if the client is reading too slowly. In all cases, multifdsink will never close a file descriptor itself. The user of multifdsink is responsible for closing all file descriptors. This can for example be done in response to the GstMultiFdSink::client-fd-removed signal. Note that multifdsink still has a reference to the file descriptor when the GstMultiFdSink::client-removed signal is emitted, so that "get-stats" can be performed on the descriptor; it is therefore not safe to close the file descriptor in the GstMultiFdSink::client-removed signal handler, and you should use the GstMultiFdSink::client-fd-removed signal to safely close the fd.

Multifdsink internally keeps a queue of the incoming buffers and uses a separate thread to send the buffers to the clients. This ensures that no client write can block the pipeline and that clients can read with different speeds.

When adding a client to multifdsink, the sync-method property will define which buffer in the queued buffers will be sent first to the client. Clients can be sent the most recent buffer (which might not be decodable by the client if it is not a keyframe), the next keyframe received in multifdsink (which can take some time depending on the keyframe rate), or the last received keyframe (which will cause a simple burst-on-connect). Multifdsink will always keep at least one keyframe in its internal buffers when the sync-mode is set to latest-keyframe.

There are additional values for the sync-method property to allow finer control over burst-on-connect behaviour. By selecting the 'burst' method a minimum burst size can be chosen, 'burst-keyframe' additionally requires that the burst begin with a keyframe, and 'burst-with-keyframe' attempts to burst beginning with a keyframe, but will prefer a minimum burst size even if it requires not starting with a keyframe.

Multifdsink can be instructed to keep at least a minimum amount of data expressed in time or byte units in its internal queues with the time-min and bytes-min properties respectively. These properties are useful if the application adds clients with the GstMultiFdSink::add-full signal to make sure that a burst connect can actually be honored.

When streaming data, clients are allowed to read at a different rate than the rate at which multifdsink receives data. If the client is reading too fast, no data will be send to the client until multifdsink receives more data. If the client, however, reads too slowly, data for that client will be queued up in multifdsink. Two properties control the amount of data (buffers) that is queued in multifdsink: buffers-max and buffers-soft-max. A client that falls behind by buffers-max is removed from multifdsink forcibly.

A client with a lag of at least buffers-soft-max enters the recovery procedure which is controlled with the recover-policy property. A recover policy of NONE will do nothing, RESYNC_LATEST will send the most recently received buffer as the next buffer for the client, RESYNC_SOFT_LIMIT positions the client to the soft limit in the buffer queue and RESYNC_KEYFRAME positions the client at the most recent keyframe in the buffer queue.

multifdsink will by default synchronize on the clock before serving the buffers to the clients. This behaviour can be disabled by setting the sync property to FALSE. Multifdsink will by default not do QoS and will never drop late buffers.

Hierarchy

GObject
    ╰──GInitiallyUnowned
        ╰──GstObject
            ╰──GstElement
                ╰──GstBaseSink
                    ╰──GstMultiHandleSink
                        ╰──multifdsink

Factory details

Authors: – Thomas Vander Stichele , Wim Taymans

Classification:Sink/Network

Rank – none

Plugin – tcp

Package – GStreamer Base Plug-ins

Pad Templates

sink

ANY

Presencealways

Directionsink

Object typeGstPad


Signals

add

add_callback (GstElement * gstmultifdsink,
              gint fd,
              gpointer udata)
def add_callback (gstmultifdsink, fd, udata):
    #python callback for the 'add' signal
function add_callback(gstmultifdsink: GstElement * gstmultifdsink, fd: gint fd, udata: gpointer udata): {
    // javascript callback for the 'add' signal
}

Hand the given open file descriptor to multifdsink to write to.

Parameters:

gstmultifdsink

the multifdsink element to emit this signal on

fd

the file descriptor to add to multifdsink

udata
No description available

Flags: Run Last / Action


add-full

add_full_callback (GstElement * gstmultifdsink,
                   gint fd,
                   GstMultiHandleSinkSyncMethod * sync,
                   GstFormat * format_min,
                   guint64 value_min,
                   GstFormat * format_max,
                   guint64 value_max,
                   gpointer udata)
def add_full_callback (gstmultifdsink, fd, sync, format_min, value_min, format_max, value_max, udata):
    #python callback for the 'add-full' signal
function add_full_callback(gstmultifdsink: GstElement * gstmultifdsink, fd: gint fd, sync: GstMultiHandleSinkSyncMethod * sync, format_min: GstFormat * format_min, value_min: guint64 value_min, format_max: GstFormat * format_max, value_max: guint64 value_max, udata: gpointer udata): {
    // javascript callback for the 'add-full' signal
}

Hand the given open file descriptor to multifdsink to write to and specify the burst parameters for the new connection.

Parameters:

gstmultifdsink

the multifdsink element to emit this signal on

fd

the file descriptor to add to multifdsink

sync

the sync method to use

format_min

the format of value_min

value_min

the minimum amount of data to burst expressed in format_min units.

format_max

the format of value_max

value_max

the maximum amount of data to burst expressed in format_max units.

udata
No description available

Flags: Run Last / Action


client-added

client_added_callback (GstElement * gstmultifdsink,
                       gint fd,
                       gpointer udata)
def client_added_callback (gstmultifdsink, fd, udata):
    #python callback for the 'client-added' signal
function client_added_callback(gstmultifdsink: GstElement * gstmultifdsink, fd: gint fd, udata: gpointer udata): {
    // javascript callback for the 'client-added' signal
}

The given file descriptor was added to multifdsink. This signal will be emitted from the streaming thread so application should be prepared for that.

Parameters:

gstmultifdsink

the multifdsink element that emitted this signal

fd

the file descriptor that was added to multifdsink

udata
No description available

Flags: Run Last


client-fd-removed

client_fd_removed_callback (GstElement * gstmultifdsink,
                            gint fd,
                            gpointer udata)
def client_fd_removed_callback (gstmultifdsink, fd, udata):
    #python callback for the 'client-fd-removed' signal
function client_fd_removed_callback(gstmultifdsink: GstElement * gstmultifdsink, fd: gint fd, udata: gpointer udata): {
    // javascript callback for the 'client-fd-removed' signal
}

The given file descriptor was removed from multifdsink. This signal will be emitted from the streaming thread so applications should be prepared for that.

In this callback, gstmultifdsink has removed all the information associated with fd and it is therefore not possible to call get-stats with fd. It is however safe to close() and reuse fd in the callback.

Parameters:

gstmultifdsink

the multifdsink element that emitted this signal

fd

the file descriptor that was removed from multifdsink

udata
No description available

Flags: Run Last


client-removed

client_removed_callback (GstElement * gstmultifdsink,
                         gint fd,
                         GstMultiHandleSinkClientStatus * status,
                         gpointer udata)
def client_removed_callback (gstmultifdsink, fd, status, udata):
    #python callback for the 'client-removed' signal
function client_removed_callback(gstmultifdsink: GstElement * gstmultifdsink, fd: gint fd, status: GstMultiHandleSinkClientStatus * status, udata: gpointer udata): {
    // javascript callback for the 'client-removed' signal
}

The given file descriptor is about to be removed from multifdsink. This signal will be emitted from the streaming thread so applications should be prepared for that.

gstmultifdsink still holds a handle to fd so it is possible to call the get-stats signal from this callback. For the same reason it is not safe to close() and reuse fd in this callback.

Parameters:

gstmultifdsink

the multifdsink element that emitted this signal

fd

the file descriptor that is to be removed from multifdsink

status

the reason why the client was removed

udata
No description available

Flags: Run Last


get-stats

GstStructure *
get_stats_callback (GstElement * gstmultifdsink,
                    gint fd,
                    gpointer udata)
def get_stats_callback (gstmultifdsink, fd, udata):
    #python callback for the 'get-stats' signal
function get_stats_callback(gstmultifdsink: GstElement * gstmultifdsink, fd: gint fd, udata: gpointer udata): {
    // javascript callback for the 'get-stats' signal
}

Get statistics about fd. This function returns a GstStructure to ease automatic wrapping for bindings.

Parameters:

gstmultifdsink

the multifdsink element to emit this signal on

fd

the file descriptor to get stats of from multifdsink

udata
No description available
Returns ( GstStructure * ) –

a GstStructure with the statistics. The structures contains guint64 values that represent respectively: total number of bytes sent (bytes-sent), time when the client was added (connect-time), time when the client was disconnected/removed (disconnect-time), time the client is/was active (connect-duration), last activity time (in epoch seconds) (last-activity-time), number of buffers dropped (buffers-dropped), the timestamp of the first buffer (first-buffer-ts) and of the last buffer (last-buffer-ts). All times are expressed in nanoseconds (GstClockTime). The structure can be empty if the client was not found.

Flags: Run Last / Action


remove

remove_callback (GstElement * gstmultifdsink,
                 gint fd,
                 gpointer udata)
def remove_callback (gstmultifdsink, fd, udata):
    #python callback for the 'remove' signal
function remove_callback(gstmultifdsink: GstElement * gstmultifdsink, fd: gint fd, udata: gpointer udata): {
    // javascript callback for the 'remove' signal
}

Remove the given open file descriptor from multifdsink.

Parameters:

gstmultifdsink

the multifdsink element to emit this signal on

fd

the file descriptor to remove from multifdsink

udata
No description available

Flags: Run Last / Action


remove-flush

remove_flush_callback (GstElement * gstmultifdsink,
                       gint fd,
                       gpointer udata)
def remove_flush_callback (gstmultifdsink, fd, udata):
    #python callback for the 'remove-flush' signal
function remove_flush_callback(gstmultifdsink: GstElement * gstmultifdsink, fd: gint fd, udata: gpointer udata): {
    // javascript callback for the 'remove-flush' signal
}

Remove the given open file descriptor from multifdsink after flushing all the pending data to the fd.

Parameters:

gstmultifdsink

the multifdsink element to emit this signal on

fd

the file descriptor to remove from multifdsink

udata
No description available

Flags: Run Last / Action


Properties

handle-read

“handle-read” gboolean

Handle client reads and discard the data

Flags : Read / Write

Default value : true


The results of the search are