summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2012-02-22 01:11:29 (GMT)
committerOlivier CrĂȘte <olivier.crete@collabora.com>2012-02-22 01:15:20 (GMT)
commit544e5ef7af95dd8d70bbc122962a04a3f0c9f74a (patch)
treecb7907e8ce3869b917b36152199733a8787e6a25
parentf8b2fbc4dcfe495ca26acb33e875aea56f929dd4 (diff)
downloadfarstream-544e5ef7af95dd8d70bbc122962a04a3f0c9f74a.tar.gz
farstream-544e5ef7af95dd8d70bbc122962a04a3f0c9f74a.tar.xz
Add "do-timestamp" property to the transmitters
Make it possible for the "raw" plugin to not have the transmitter put timestamps on the buffers.
-rw-r--r--farstream/fs-transmitter.c17
-rw-r--r--gst/fsrawconference/fs-raw-session.c5
-rw-r--r--transmitters/multicast/fs-multicast-transmitter.c13
-rw-r--r--transmitters/nice/fs-nice-transmitter.c21
-rw-r--r--transmitters/rawudp/fs-rawudp-transmitter.c27
-rw-r--r--transmitters/shm/fs-shm-transmitter.c16
6 files changed, 87 insertions, 12 deletions
diff --git a/farstream/fs-transmitter.c b/farstream/fs-transmitter.c
index 11c955c..d0c52c1 100644
--- a/farstream/fs-transmitter.c
+++ b/farstream/fs-transmitter.c
@@ -62,7 +62,8 @@ enum
PROP_GST_SINK,
PROP_GST_SRC,
PROP_COMPONENTS,
- PROP_TYPE_OF_SERVICE
+ PROP_TYPE_OF_SERVICE,
+ PROP_DO_TIMESTAMP,
};
/*
@@ -166,6 +167,20 @@ fs_transmitter_class_init (FsTransmitterClass *klass)
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
+ * FsTransmitter:do-timestamp:
+ *
+ * Apply current stream time to buffers or provide buffers without
+ * timestamps. Must be set before creating a stream transmitter.
+ */
+ g_object_class_install_property (gobject_class,
+ PROP_DO_TIMESTAMP,
+ g_param_spec_boolean ("do-timestamp",
+ "Do Timestamp",
+ "Apply current stream time to buffers",
+ TRUE,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+ /**
* FsTransmitter::error:
* @self: #FsTransmitter that emitted the signal
* @errorno: The number of the error
diff --git a/gst/fsrawconference/fs-raw-session.c b/gst/fsrawconference/fs-raw-session.c
index e65c0f5..42fdf80 100644
--- a/gst/fsrawconference/fs-raw-session.c
+++ b/gst/fsrawconference/fs-raw-session.c
@@ -1354,7 +1354,10 @@ static FsStreamTransmitter *_stream_get_stream_transmitter (FsRawStream *stream,
if (!fstransmitter)
goto error;
- g_object_set (fstransmitter, "tos", self->priv->tos, NULL);
+ g_object_set (fstransmitter,
+ "tos", self->priv->tos,
+ "do-timestamp", FALSE,
+ NULL);
stream_transmitter = fs_transmitter_new_stream_transmitter (fstransmitter,
participant, n_parameters, parameters, error);
diff --git a/transmitters/multicast/fs-multicast-transmitter.c b/transmitters/multicast/fs-multicast-transmitter.c
index a0b8222..fd1f2fa 100644
--- a/transmitters/multicast/fs-multicast-transmitter.c
+++ b/transmitters/multicast/fs-multicast-transmitter.c
@@ -73,7 +73,8 @@ enum
PROP_GST_SINK,
PROP_GST_SRC,
PROP_COMPONENTS,
- PROP_TYPE_OF_SERVICE
+ PROP_TYPE_OF_SERVICE,
+ PROP_DO_TIMESTAMP
};
struct _FsMulticastTransmitterPrivate
@@ -92,6 +93,7 @@ struct _FsMulticastTransmitterPrivate
GList **udpsocks;
gint type_of_service;
+ gboolean do_timestamp;
gboolean disposed;
};
@@ -192,6 +194,8 @@ fs_multicast_transmitter_class_init (FsMulticastTransmitterClass *klass)
"components");
g_object_class_override_property (gobject_class, PROP_TYPE_OF_SERVICE,
"tos");
+ g_object_class_override_property (gobject_class, PROP_DO_TIMESTAMP,
+ "do-timestamp");
transmitter_class->new_stream_transmitter =
fs_multicast_transmitter_new_stream_transmitter;
@@ -214,6 +218,7 @@ fs_multicast_transmitter_init (FsMulticastTransmitter *self)
self->components = 2;
self->priv->mutex = g_mutex_new ();
+ self->priv->do_timestamp = TRUE;
}
static void
@@ -438,6 +443,9 @@ fs_multicast_transmitter_get_property (GObject *object,
g_value_set_uint (value, self->priv->type_of_service);
g_mutex_unlock (self->priv->mutex);
break;
+ case PROP_DO_TIMESTAMP:
+ g_value_set_boolean (value, self->priv->do_timestamp);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -460,6 +468,9 @@ fs_multicast_transmitter_set_property (GObject *object,
fs_multicast_transmitter_set_type_of_service (self,
g_value_get_uint (value));
break;
+ case PROP_DO_TIMESTAMP:
+ self->priv->do_timestamp = g_value_get_boolean (value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
diff --git a/transmitters/nice/fs-nice-transmitter.c b/transmitters/nice/fs-nice-transmitter.c
index 64d8f18..a99b747 100644
--- a/transmitters/nice/fs-nice-transmitter.c
+++ b/transmitters/nice/fs-nice-transmitter.c
@@ -63,7 +63,8 @@ enum
PROP_GST_SINK,
PROP_GST_SRC,
PROP_COMPONENTS,
- PROP_TOS
+ PROP_TOS,
+ PROP_DO_TIMESTAMP
};
struct _FsNiceTransmitterPrivate
@@ -79,6 +80,7 @@ struct _FsNiceTransmitterPrivate
GstElement **sink_tees;
gint tos;
+ gboolean do_timestamp;
};
#define FS_NICE_TRANSMITTER_GET_PRIVATE(o) \
@@ -173,6 +175,8 @@ fs_nice_transmitter_class_init (FsNiceTransmitterClass *klass)
g_object_class_override_property (gobject_class, PROP_COMPONENTS,
"components");
g_object_class_override_property (gobject_class, PROP_TOS, "tos");
+ g_object_class_override_property (gobject_class, PROP_DO_TIMESTAMP,
+ "do-timestamp");
transmitter_class->new_stream_transmitter =
fs_nice_transmitter_new_stream_transmitter;
@@ -193,6 +197,7 @@ fs_nice_transmitter_init (FsNiceTransmitter *self)
self->priv = FS_NICE_TRANSMITTER_GET_PRIVATE (self);
self->components = 2;
+ self->priv->do_timestamp = TRUE;
}
static void
@@ -413,6 +418,9 @@ fs_nice_transmitter_get_property (GObject *object,
case PROP_TOS:
g_value_set_uint (value, self->priv->tos);
break;
+ case PROP_DO_TIMESTAMP:
+ g_value_set_boolean (value, self->priv->do_timestamp);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -435,6 +443,9 @@ fs_nice_transmitter_set_property (GObject *object,
case PROP_TOS:
self->priv->tos = g_value_get_uint (value);
break;
+ case PROP_DO_TIMESTAMP:
+ self->priv->do_timestamp = g_value_get_boolean (value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -483,6 +494,7 @@ _create_sinksource (
guint stream_id,
guint component_id,
GstPadDirection direction,
+ gboolean do_timestamp,
GCallback have_buffer_callback,
gpointer have_buffer_user_data,
gulong *buffer_probe_id,
@@ -516,6 +528,10 @@ _create_sinksource (
"async", FALSE,
"sync", FALSE,
NULL);
+ else
+ g_object_set (elem,
+ "do-timestamp", do_timestamp,
+ NULL);
if (!gst_bin_add (bin, elem))
{
@@ -721,6 +737,7 @@ fs_nice_transmitter_add_gst_stream (FsNiceTransmitter *self,
stream_id,
c,
GST_PAD_SRC,
+ self->priv->do_timestamp,
have_buffer_callback,
have_buffer_user_data,
&ns->probe_ids[c],
@@ -744,7 +761,7 @@ fs_nice_transmitter_add_gst_stream (FsNiceTransmitter *self,
stream_id,
c,
GST_PAD_SINK,
- NULL, NULL, NULL,
+ FALSE, NULL, NULL, NULL,
&ns->requested_tee_pads[c],
error);
diff --git a/transmitters/rawudp/fs-rawudp-transmitter.c b/transmitters/rawudp/fs-rawudp-transmitter.c
index 36961e3..377de54 100644
--- a/transmitters/rawudp/fs-rawudp-transmitter.c
+++ b/transmitters/rawudp/fs-rawudp-transmitter.c
@@ -73,7 +73,8 @@ enum
PROP_GST_SINK,
PROP_GST_SRC,
PROP_COMPONENTS,
- PROP_TYPE_OF_SERVICE
+ PROP_TYPE_OF_SERVICE,
+ PROP_DO_TIMESTAMP
};
struct _FsRawUdpTransmitterPrivate
@@ -93,6 +94,7 @@ struct _FsRawUdpTransmitterPrivate
GList **udpports;
gint type_of_service;
+ gboolean do_timestamp;
gboolean disposed;
};
@@ -196,6 +198,8 @@ fs_rawudp_transmitter_class_init (FsRawUdpTransmitterClass *klass)
"components");
g_object_class_override_property (gobject_class, PROP_TYPE_OF_SERVICE,
"tos");
+ g_object_class_override_property (gobject_class, PROP_DO_TIMESTAMP,
+ "do-timestamp");
transmitter_class->new_stream_transmitter =
fs_rawudp_transmitter_new_stream_transmitter;
@@ -218,6 +222,7 @@ fs_rawudp_transmitter_init (FsRawUdpTransmitter *self)
self->components = 2;
self->priv->mutex = g_mutex_new ();
+ self->priv->do_timestamp = TRUE;
}
static void
@@ -456,6 +461,9 @@ fs_rawudp_transmitter_get_property (GObject *object,
g_value_set_uint (value, self->priv->type_of_service);
g_mutex_unlock (self->priv->mutex);
break;
+ case PROP_DO_TIMESTAMP:
+ g_value_set_boolean (value, self->priv->do_timestamp);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -479,6 +487,9 @@ fs_rawudp_transmitter_set_property (GObject *object,
fs_rawudp_transmitter_set_type_of_service (self,
g_value_get_uint (value));
break;
+ case PROP_DO_TIMESTAMP:
+ self->priv->do_timestamp = g_value_get_boolean (value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -636,6 +647,7 @@ _create_sinksource (
GstElement *filter,
gint fd,
GstPadDirection direction,
+ gboolean do_timestamp,
GstPad **requested_pad,
GError **error)
{
@@ -655,9 +667,9 @@ _create_sinksource (
}
g_object_set (elem,
+ "sockfd", fd,
"auto-multicast", FALSE,
"closefd", FALSE,
- "sockfd", fd,
NULL);
if (direction == GST_PAD_SINK)
@@ -665,6 +677,10 @@ _create_sinksource (
"async", FALSE,
"sync", FALSE,
NULL);
+ else
+ g_object_set (elem,
+ "do-timestamp", do_timestamp,
+ NULL);
if (!gst_bin_add (bin, elem))
{
@@ -876,13 +892,14 @@ fs_rawudp_transmitter_get_udpport (FsRawUdpTransmitter *trans,
udpport->udpsrc = _create_sinksource ("udpsrc",
GST_BIN (trans->priv->gst_src), udpport->funnel, NULL,
- udpport->fd, GST_PAD_SRC, &udpport->udpsrc_requested_pad, error);
+ udpport->fd, GST_PAD_SRC, trans->priv->do_timestamp,
+ &udpport->udpsrc_requested_pad, error);
if (!udpport->udpsrc)
goto error;
udpport->udpsink = _create_sinksource ("multiudpsink",
GST_BIN (trans->priv->gst_sink), udpport->tee, NULL,
- udpport->fd, GST_PAD_SINK, &udpport->udpsink_requested_pad, error);
+ udpport->fd, GST_PAD_SINK, FALSE, &udpport->udpsink_requested_pad, error);
if (!udpport->udpsink)
goto error;
@@ -893,7 +910,7 @@ fs_rawudp_transmitter_get_udpport (FsRawUdpTransmitter *trans,
{
udpport->recvonly_udpsink = _create_sinksource ("multiudpsink",
GST_BIN (trans->priv->gst_sink), udpport->tee, udpport->recvonly_filter,
- udpport->fd, GST_PAD_SINK, &udpport->recvonly_requested_pad, error);
+ udpport->fd, GST_PAD_SINK, FALSE, &udpport->recvonly_requested_pad, error);
if (!udpport->recvonly_udpsink)
goto error;
}
diff --git a/transmitters/shm/fs-shm-transmitter.c b/transmitters/shm/fs-shm-transmitter.c
index e0b1106..200055d 100644
--- a/transmitters/shm/fs-shm-transmitter.c
+++ b/transmitters/shm/fs-shm-transmitter.c
@@ -57,7 +57,8 @@ enum
PROP_0,
PROP_GST_SINK,
PROP_GST_SRC,
- PROP_COMPONENTS
+ PROP_COMPONENTS,
+ PROP_DO_TIMESTAMP,
};
struct _FsShmTransmitterPrivate
@@ -71,6 +72,8 @@ struct _FsShmTransmitterPrivate
/* They are tables of pointers, one per component */
GstElement **funnels;
GstElement **tees;
+
+ gboolean do_timestamp;
};
#define FS_SHM_TRANSMITTER_GET_PRIVATE(o) \
@@ -266,6 +269,8 @@ fs_shm_transmitter_class_init (FsShmTransmitterClass *klass)
g_object_class_override_property (gobject_class, PROP_GST_SINK, "gst-sink");
g_object_class_override_property (gobject_class, PROP_COMPONENTS,
"components");
+ g_object_class_override_property (gobject_class, PROP_DO_TIMESTAMP,
+ "do-timestamp");
transmitter_class->new_stream_transmitter =
fs_shm_transmitter_new_stream_transmitter;
@@ -286,6 +291,7 @@ fs_shm_transmitter_init (FsShmTransmitter *self)
self->priv = FS_SHM_TRANSMITTER_GET_PRIVATE (self);
self->components = 2;
+ self->priv->do_timestamp = TRUE;
}
static void
@@ -489,6 +495,9 @@ fs_shm_transmitter_get_property (GObject *object,
case PROP_COMPONENTS:
g_value_set_uint (value, self->components);
break;
+ case PROP_DO_TIMESTAMP:
+ g_value_set_boolean (value, self->priv->do_timestamp);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -507,6 +516,9 @@ fs_shm_transmitter_set_property (GObject *object,
case PROP_COMPONENTS:
self->components = g_value_get_uint (value);
break;
+ case PROP_DO_TIMESTAMP:
+ self->priv->do_timestamp = g_value_get_boolean (value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -607,7 +619,7 @@ fs_shm_transmitter_get_shm_src (FsShmTransmitter *self,
g_object_set (elem,
"socket-path", path,
- "do-timestamp", TRUE,
+ "do-timestamp", self->priv->do_timestamp,
"is-live", TRUE,
NULL);