multifdsink

multifdsink — Send data to multiple filedescriptors

Synopsis




            GstMultiFdSink;
enum        GstRecoverPolicy;
enum        GstSyncMethod;
enum        GstClientStatus;

Object Hierarchy


  GObject
   +----GstObject
         +----GstElement
               +----GstBaseSink
                     +----GstMultiFdSink
                           +----GstTCPServerSink

Properties


  "buffers-max"          gint                  : Read / Write
  "buffers-queued"       guint                 : Read
  "buffers-soft-max"     gint                  : Read / Write
  "bytes-served"         guint64               : Read
  "bytes-to-serve"       guint64               : Read
  "mode"                 GstFDSetMode          : Read / Write
  "protocol"             GstTCPProtocol        : Read / Write
  "recover-policy"       GstRecoverPolicy      : Read / Write
  "sync-clients"         gboolean              : Read / Write
  "sync-method"          GstSyncMethod         : Read / Write
  "timeout"              guint64               : Read / Write

Signal Prototypes


"add"       void        user_function      (GstMultiFdSink *fd,
                                            gint arg2,
                                            gpointer user_data);
"clear"     void        user_function      (GstMultiFdSink *arg1,
                                            gpointer user_data);
"client-added"
            void        user_function      (GstMultiFdSink *fd,
                                            gint arg2,
                                            gpointer user_data);
"client-removed"
            void        user_function      (GstMultiFdSink *fd,
                                            gint status,
                                            GstClientStatus *arg3,
                                            gpointer user_data);
"get-stats" GValueArray*user_function      (GstMultiFdSink *fd,
                                            gint Returns,
                                            gpointer user_data);
"remove"    void        user_function      (GstMultiFdSink *fd,
                                            gint arg2,
                                            gpointer user_data);

Description

Element Information

plugin tcp
authorThomas Vander Stichele <thomas at apestaart dot org>, Wim Taymans <wim@fluendo.com>
classSink/Network

Details

GstMultiFdSink

typedef struct _GstMultiFdSink GstMultiFdSink;

The multifdsink object structure.


enum GstRecoverPolicy

typedef enum
{
  GST_RECOVER_POLICY_NONE,
  GST_RECOVER_POLICY_RESYNC_LATEST,
  GST_RECOVER_POLICY_RESYNC_SOFT_LIMIT,
  GST_RECOVER_POLICY_RESYNC_KEYFRAME,
} GstRecoverPolicy;

Possible values for the recovery procedure to use when a client consumes data too slow and has a backlag of more that soft-limit buffers.

GST_RECOVER_POLICY_NONE no recovering is done
GST_RECOVER_POLICY_RESYNC_LATEST client is moved to last buffer
GST_RECOVER_POLICY_RESYNC_SOFT_LIMIT client is moved to the soft limit
GST_RECOVER_POLICY_RESYNC_KEYFRAME client is moved to latest keyframe

enum GstSyncMethod

typedef enum
{
  GST_SYNC_METHOD_LATEST,
  GST_SYNC_METHOD_NEXT_KEYFRAME,
  GST_SYNC_METHOD_LATEST_KEYFRAME,
} GstSyncMethod;

This enum defines the selection of the first buffer that is sent to a new client.

GST_SYNC_METHOD_LATEST client receives most recent buffer
GST_SYNC_METHOD_NEXT_KEYFRAME client receives next keyframe
GST_SYNC_METHOD_LATEST_KEYFRAME client receives latest keyframe (burst)

enum GstClientStatus

typedef enum
{
  GST_CLIENT_STATUS_OK          = 0,
  GST_CLIENT_STATUS_CLOSED      = 1,
  GST_CLIENT_STATUS_REMOVED     = 2,
  GST_CLIENT_STATUS_SLOW        = 3,
  GST_CLIENT_STATUS_ERROR       = 4,
  GST_CLIENT_STATUS_DUPLICATE   = 5,
} GstClientStatus;

This specifies the reason why a client was removed from multifdsink and is received in the "client-removed" signal.

GST_CLIENT_STATUS_OK client is ok
GST_CLIENT_STATUS_CLOSED client closed the socket
GST_CLIENT_STATUS_REMOVED client is removed
GST_CLIENT_STATUS_SLOW client is too slow
GST_CLIENT_STATUS_ERROR client is in error
GST_CLIENT_STATUS_DUPLICATE same client added twice

Properties

The "buffers-max" property

  "buffers-max"          gint                  : Read / Write

max number of buffers to queue (-1 = no limit).

Allowed values: >= -1

Default value: -1


The "buffers-queued" property

  "buffers-queued"       guint                 : Read

Number of buffers currently queued.

Default value: 0


The "buffers-soft-max" property

  "buffers-soft-max"     gint                  : Read / Write

Recover client when going over this limit (-1 = no limit).

Allowed values: >= -1

Default value: -1


The "bytes-served" property

  "bytes-served"         guint64               : Read

Total number of bytes send to all clients.

Default value: 0


The "bytes-to-serve" property

  "bytes-to-serve"       guint64               : Read

Number of bytes received to serve to clients.

Default value: 0


The "mode" property

  "mode"                 GstFDSetMode          : Read / Write

The mode for selecting activity on the fds.

Default value: Poll


The "protocol" property

  "protocol"             GstTCPProtocol        : Read / Write

The protocol to wrap data in.

Default value: GST_TCP_PROTOCOL_NONE


The "recover-policy" property

  "recover-policy"       GstRecoverPolicy      : Read / Write

How to recover when client reaches the soft max.

Default value: Do not try to recover


The "sync-clients" property

  "sync-clients"         gboolean              : Read / Write

(DEPRECATED) Sync clients to a keyframe.

Default value: FALSE


The "sync-method" property

  "sync-method"          GstSyncMethod         : Read / Write

How to sync new clients to the stream.

Default value: Serve starting from the latest buffer


The "timeout" property

  "timeout"              guint64               : Read / Write

Maximum inactivity timeout in nanoseconds for a client (0 = no limit).

Default value: 0

Signals

The "add" signal

void        user_function                  (GstMultiFdSink *fd,
                                            gint arg2,
                                            gpointer user_data);

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

gstmultifdsink : the multifdsink element to emit this signal on
fd : the file descriptor to add to multifdsink
user_data :user data set when the signal handler was connected.

The "clear" signal

void        user_function                  (GstMultiFdSink *arg1,
                                            gpointer user_data);

Remove all file descriptors from multifdsink. Since multifdsink did not open fd's itself, it does not explicitly close the fd. The application should do so by connecting to the client-removed callback.

@:
gstmultifdsink : the multifdsink element to emit this signal on
user_data :user data set when the signal handler was connected.

The "client-added" signal

void        user_function                  (GstMultiFdSink *fd,
                                            gint arg2,
                                            gpointer user_data);

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

gstmultifdsink : the multifdsink element that emitted this signal
fd : the file descriptor that was added to multifdsink
user_data :user data set when the signal handler was connected.

The "client-removed" signal

void        user_function                  (GstMultiFdSink *fd,
                                            gint status,
                                            GstClientStatus *arg3,
                                            gpointer user_data);

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

gstmultifdsink : the multifdsink element that emitted this signal
fd : the file descriptor that was removed from multifdsink
status : the reason why the client was removed
user_data :user data set when the signal handler was connected.

The "get-stats" signal

GValueArray*user_function                  (GstMultiFdSink *fd,
                                            gint Returns,
                                            gpointer user_data);

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

gstmultifdsink : the multifdsink element to emit this signal on
fd : the file descriptor to get stats of from multifdsink
user_data :user data set when the signal handler was connected.
Returns : a GValueArray with the statistics. The array contains 5 guint64 values that represent respectively total number of bytes sent, time when the client was added, time when the client was disconnected/removed, time the client is/was active, last activity time. All times are expressed in nanoseconds (GstClockTime).

The "remove" signal

void        user_function                  (GstMultiFdSink *fd,
                                            gint arg2,
                                            gpointer user_data);

Remove the given open file descriptor from multifdsink.

gstmultifdsink : the multifdsink element to emit this signal on
fd : the file descriptor to remove from multifdsink
user_data :user data set when the signal handler was connected.