+2004-08-17 Wim Taymans <wim@fluendo.com>
+
+ * gst/tcp/gstmultifdsink.c: (gst_multifdsink_class_init),
+ (gst_multifdsink_init), (gst_multifdsink_add),
+ (gst_multifdsink_client_queue_buffer),
+ (gst_multifdsink_set_property), (gst_multifdsink_get_property):
+ * gst/tcp/gstmultifdsink.h:
+ Added option to send a keyframe to clients as the first buffer.
+ Make timeout property writable.
+
2004-08-17 Thomas Vander Stichele <thomas at apestaart dot org>
patch by: Wim Taymans
#define DEFAULT_UNITS_SOFT_MAX -1
#define DEFAULT_RECOVER_POLICY GST_RECOVER_POLICY_NONE
#define DEFAULT_TIMEOUT 0
+#define DEFAULT_SYNC_CLIENTS FALSE
enum
{
ARG_RECOVER_POLICY,
ARG_TIMEOUT,
+ ARG_SYNC_CLIENTS,
ARG_BYTES_TO_SERVE,
ARG_BYTES_SERVED,
};
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_TIMEOUT,
g_param_spec_uint64 ("timeout", "Timeout",
"Maximum inactivity timeout in nanoseconds for a client (0 = no limit)",
- 0, G_MAXUINT64, DEFAULT_TIMEOUT, G_PARAM_READABLE));
+ 0, G_MAXUINT64, DEFAULT_TIMEOUT, G_PARAM_READWRITE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SYNC_CLIENTS,
+ g_param_spec_boolean ("sync-clients", "Sync clients",
+ "Sync clients to a keyframe",
+ DEFAULT_SYNC_CLIENTS, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BYTES_TO_SERVE,
g_param_spec_uint64 ("bytes-to-serve", "Bytes to serve",
"Number of bytes received to serve to clients", 0, G_MAXUINT64, 0,
this->recover_policy = DEFAULT_RECOVER_POLICY;
this->timeout = DEFAULT_TIMEOUT;
+ this->sync_clients = DEFAULT_SYNC_CLIENTS;
}
void
client->bytes_sent = 0;
client->dropped_buffers = 0;
client->avg_queue_size = 0;
+ client->need_keyunit = sink->sync_clients;
/* update start time */
g_get_current_time (&now);
gst_multifdsink_client_queue_buffer (GstMultiFdSink * sink,
GstTCPClient * client, GstBuffer * buffer)
{
+ if (client->need_keyunit) {
+ if (GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_DELTA_UNIT)) {
+ return TRUE;
+ } else if (!GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_IN_CAPS)) {
+ client->need_keyunit = FALSE;
+ }
+ }
+
if (sink->protocol == GST_TCP_PROTOCOL_TYPE_GDP) {
guint8 *header;
guint len;
case ARG_TIMEOUT:
multifdsink->timeout = g_value_get_uint64 (value);
break;
+ case ARG_SYNC_CLIENTS:
+ multifdsink->sync_clients = g_value_get_boolean (value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
case ARG_TIMEOUT:
g_value_set_uint64 (value, multifdsink->timeout);
break;
+ case ARG_SYNC_CLIENTS:
+ g_value_set_boolean (value, multifdsink->sync_clients);
+ break;
case ARG_BYTES_TO_SERVE:
g_value_set_uint64 (value, multifdsink->bytes_to_serve);
break;