diff options
author | Olivier CrĂȘte <olivier.crete@collabora.co.uk> | 2011-02-07 18:29:48 +0000 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2011-10-11 15:37:15 -0400 |
commit | b1524b5456537db80ffe60f970926ad1c447a058 (patch) | |
tree | 5053f23fa872dbaceb62ac06acdc89c78b682ba1 | |
parent | 71decc1a43524d7a32e1b75a2bf256a7dba3a33a (diff) | |
download | farstream-b1524b5456537db80ffe60f970926ad1c447a058.tar.gz |
stream: Add set_transmitter() method
-rw-r--r-- | docs/libs/farsight2-libs-sections.txt | 1 | ||||
-rw-r--r-- | gst-libs/gst/farsight/fs-stream.c | 41 | ||||
-rw-r--r-- | gst-libs/gst/farsight/fs-stream.h | 12 |
3 files changed, 54 insertions, 0 deletions
diff --git a/docs/libs/farsight2-libs-sections.txt b/docs/libs/farsight2-libs-sections.txt index 29ee787f..7b23e5d8 100644 --- a/docs/libs/farsight2-libs-sections.txt +++ b/docs/libs/farsight2-libs-sections.txt @@ -31,6 +31,7 @@ fs_stream_set_remote_codecs fs_stream_force_remote_candidates fs_stream_add_id fs_stream_get_src_pads_iterator +fs_stream_set_transmitter fs_stream_emit_error fs_stream_emit_src_pad_added <SUBSECTION Standard> diff --git a/gst-libs/gst/farsight/fs-stream.c b/gst-libs/gst/farsight/fs-stream.c index df26cb91..e909e0cd 100644 --- a/gst-libs/gst/farsight/fs-stream.c +++ b/gst-libs/gst/farsight/fs-stream.c @@ -594,3 +594,44 @@ fs_stream_get_src_pads_iterator (FsStream *stream) &stream->priv->src_pads_cookie, &stream->priv->src_pads, g_object_ref (stream), src_pad_iterator_item_func, g_object_unref); } + + +/** + * fs_stream_set_transmitter: + * @stream: a #FsStream + * @transmitter: Name of the type of transmitter to use for this stream + * @stream_transmitter_n_parameters: Number of parametrs passed to the stream + * transmitter + * @stream_transmitter_parameters: an array of n_parameters #GParameter struct + * that will be passed to the newly-created #FsStreamTransmitter + * @error: location of a #GError, or %NULL if no error occured + * + * Set the transmitter to use for this stream. This function will only succeed + * once. + * + * Returns: %TRUE if the transmitter could be set, %FALSE otherwise + */ + +gboolean +fs_stream_set_transmitter (FsStream *stream, + const gchar *transmitter, + GParameter *stream_transmitter_parameters, + guint stream_transmitter_n_parameters, + GError **error) +{ + FsStreamClass *klass; + + g_return_val_if_fail (stream, FALSE); + g_return_val_if_fail (FS_IS_STREAM (stream), FALSE); + klass = FS_STREAM_GET_CLASS (stream); + + if (klass->set_transmitter) + return klass->set_transmitter (stream, transmitter, + stream_transmitter_parameters, stream_transmitter_n_parameters, error); + + + g_set_error (error, FS_ERROR, FS_ERROR_NOT_IMPLEMENTED, + "set_transmitter not defined in class"); + + return FALSE; +} diff --git a/gst-libs/gst/farsight/fs-stream.h b/gst-libs/gst/farsight/fs-stream.h index 5fcb980f..2070e62c 100644 --- a/gst-libs/gst/farsight/fs-stream.h +++ b/gst-libs/gst/farsight/fs-stream.h @@ -103,6 +103,7 @@ typedef struct _FsStreamPrivate FsStreamPrivate; * @force_remote_candidates: Forces certain remote candidates * @set_remote_codecs: Sets the list of remote codecs * @add_id: Add a known id to be associated with this stream + * @set_transmitter: Set the transmitter to use for this stream * * You must override add_remote_candidate in a subclass. * If you have to negotiate codecs, then you must override set_remote_codecs too @@ -127,6 +128,12 @@ struct _FsStreamClass void (*add_id) (FsStream *stream, guint id); + gboolean (*set_transmitter) (FsStream *stream, + const gchar *transmitter, + GParameter *stream_transmitter_parameters, + guint stream_transmitter_n_parameters, + GError **error); + /*< private >*/ gpointer _padding[8]; }; @@ -172,6 +179,11 @@ void fs_stream_emit_src_pad_added (FsStream *stream, GstIterator *fs_stream_get_src_pads_iterator (FsStream *stream); +gboolean fs_stream_set_transmitter (FsStream *stream, + const gchar *transmitter, + GParameter *stream_transmitter_parameters, + guint stream_transmitter_n_parameters, + GError **error); G_END_DECLS |