![]() |
![]() |
![]() |
GStreamer Base Plugins 0.10 Plugins Reference Manual | ![]() |
---|---|---|---|---|
GObject +----GstObject +----GstElement +----GstBaseSink +----GstMultiFdSink +----GstTCPServerSink
"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
"add" void user_function (GstMultiFdSink *gstmultifdsink, gint fd, gpointer user_data) : Run last "clear" void user_function (GstMultiFdSink *gstmultifdsink, gpointer user_data) : Run last "client-added" void user_function (GstMultiFdSink *gstmultifdsink, gint fd, gpointer user_data) : Run last "client-removed" void user_function (GstMultiFdSink *gstmultifdsink, gint fd, GstClientStatus *status, gpointer user_data) : Run last "get-stats" GValueArray*user_function (GstMultiFdSink *gstmultifdsink, gint fd, gpointer user_data) : Run last "remove" void user_function (GstMultiFdSink *gstmultifdsink, gint fd, gpointer user_data) : Run last "client-fd-removed" void user_function (GstMultiFdSink *gstmultifdsink, gint fd, gpointer user_data) : Run last
This plugin writes incoming data to a set of file descriptors. The file descriptors can be added to multifdsink by emiting the "add" signal. For each descriptor added, the "client-added" signal will be called.
Clients can be removed from multifdsink by emiting the "remove" signal. For each descriptor removed, the "client-removed" signal will be called. The "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," if the client is reading to slow. In all cases, multifdsink will never ever close a file descriptor itself. The user of multifdsink is responsible for closing the file descriptor. This can for example be done in response to the "client-fd-removed" signal. Note that multifdsink still has a reference to the file descriptor when the "client-removed" signal is emited so that "get-stats" can be performed on the descriptor; It is therefore not allowed to close the file descriptor in the "client-removed" signal, use the "client-fd-removed" signal to close the fd.
Multifdsink internally keeps a queue of the incomming 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 will be sent first to the client. Clients can be sent respectively the most recent buffer (which might not be decodable by the client when 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 burst-on-connect).
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 slow, data for that client will bunch up in multifdsink. Two properties control the amount of data (buffers) that is queued in multifdsink: "buffers-max" and "buffers-soft-max". A client with a lag of "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 to the most recent keyframe in the buffer queue.
multifdsink will synchronize on the clock before serving the buffers to the clients.
Last reviewed on 2006-04-28 (0.10.7)
plugin | tcp |
author | Thomas Vander Stichele <thomas at apestaart dot org>, Wim Taymans <wim@fluendo.com> |
class | Sink/Network |
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.
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.
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.
buffers-max
" property"buffers-max" gint : Read / Write
max number of buffers to queue (-1 = no limit).
Allowed values: >= -1
Default value: -1
buffers-queued
" property"buffers-queued" guint : Read
Number of buffers currently queued.
Default value: 0
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
bytes-served
" property"bytes-served" guint64 : Read
Total number of bytes send to all clients.
Default value: 0
bytes-to-serve
" property"bytes-to-serve" guint64 : Read
Number of bytes received to serve to clients.
Default value: 0
mode
" property"mode" GstFDSetMode : Read / Write
The mode for selecting activity on the fds.
Default value: Poll
protocol
" property"protocol" GstTCPProtocol : Read / Write
The protocol to wrap data in.
Default value: GST_TCP_PROTOCOL_NONE
recover-policy
" property"recover-policy" GstRecoverPolicy : Read / Write
How to recover when client reaches the soft max.
Default value: Do not try to recover
sync-clients
" property"sync-clients" gboolean : Read / Write
(DEPRECATED) Sync clients to a keyframe.
Default value: FALSE
sync-method
" property"sync-method" GstSyncMethod : Read / Write
How to sync new clients to the stream.
Default value: Serve starting from the latest buffer
void user_function (GstMultiFdSink *gstmultifdsink, gint fd, gpointer user_data) : Run last
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. |
void user_function (GstMultiFdSink *gstmultifdsink, gpointer user_data) : Run last
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. |
void user_function (GstMultiFdSink *gstmultifdsink, gint fd, gpointer user_data) : Run last
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. |
void user_function (GstMultiFdSink *gstmultifdsink, gint fd, GstClientStatus *status, gpointer user_data) : Run last
The given file descriptor is about to be removed from multifdsink. This signal will be emited 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.
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 |
user_data : |
user data set when the signal handler was connected. |
GValueArray*user_function (GstMultiFdSink *gstmultifdsink, gint fd, gpointer user_data) : Run last
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). |
void user_function (GstMultiFdSink *gstmultifdsink, gint fd, gpointer user_data) : Run last
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. |
void user_function (GstMultiFdSink *gstmultifdsink, gint fd, gpointer user_data) : Run last
The given file descriptor was removed from multifdsink. This signal will be emited 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.
gstmultifdsink : |
the multifdsink element that emitted this signal |
fd : |
the file descriptor that was removed from multifdsink |
user_data : |
user data set when the signal handler was connected. |
Since 0.10.7