Top |
FsCodecGList * | current-recv-codecs | Read |
GstStructure * | decryption-parameters | Read |
FsStreamDirection | direction | Read / Write / Construct |
FsCodecGList * | negotiated-codecs | Read |
FsParticipant * | participant | Read / Write / Construct Only |
FsCodecGList * | remote-codecs | Read |
gboolean | require-encryption | Read / Write |
FsSession * | session | Read / Write / Construct Only |
This object is the base implementation of a Farstream Stream. It
needs to be derived and implemented by a Farstream conference GStreamer
element. A Farstream Stream is a media stream originating from a
FsParticipant inside a FsSession. In fact, a FsStream instance is
obtained by adding a participant into a session using
fs_session_new_stream()
.
This will communicate asynchronous events to the user through GstMessage of type GST_MESSAGE_ELEMENT sent over the GstBus.
farstream-new-local-candidate
" message1 2 |
"stream" #FsStream The stream that emits the message "candidate" #FsCandidate The new candidate |
This message is emitted when a new local candidate is discovered.
farstream-local-candidates-prepared
" message1 |
"stream" #FsStream The stream that emits the message |
This signal is emitted when all local candidates have been prepared, an ICE implementation would send its SDP offer or answer.
farstream-new-active-candidate-pair
" message1 2 3 |
"stream" #FsStream The stream that emits the message "local-candidate" #FsCandidate Local candidate being used "remote-candidate" #FsCandidate Remote candidate being used |
This message is emitted when there is a new active candidate pair that has been established. This is specially useful for ICE where the active candidate pair can change automatically due to network conditions. The user must not modify the candidates and must copy them if he wants to use them outside the callback scope. This message is emitted once per component.
farstream-recv-codecs-changed
" message1 2 |
"stream" #FsStream The stream that emits the message "codecs" #FsCodecGList A #GList of #FsCodec |
This message is emitted when the content of the “current-recv-codecs” property changes. It is normally emitted right after the “src-pad-added” signal only if that codec was not previously received in this stream, but it can also be emitted if the pad already exists, but the source material that will come to it is different. The list of new recv-codecs is included in the message
gboolean fs_stream_set_transmitter (FsStream *stream
,const gchar *transmitter
,GParameter *stream_transmitter_parameters
,guint stream_transmitter_n_parameters
,GError **error
);
Set the transmitter to use for this stream. This function will only succeed once.
The parameters correspond to the varios GObject properties of the selected stream 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-create FsStreamTransmitter. |
[array length=stream_transmitter_n_parameters][allow-none] |
error |
gboolean fs_stream_set_transmitter_ht (FsStream *stream
,const gchar *transmitter
,GHashTable *stream_transmitter_parameters
,GError **error
);
Set the transmitter to use for this stream. This function will only succeed once.
The parameters correspond to the varios GObject properties of the selected stream transmitter.
This is the same as fs_stream_set_transmitter()
except that the parameters
are passed in a GHashTable to make it more friendly to GObject introspection
stream |
a FsStream |
|
transmitter |
Name of the type of transmitter to use for this stream |
|
stream_transmitter_parameters |
A GHashTable of string->GValue containing the parameters. |
[element-type utf8 GValue][allow-none] |
error |
gboolean fs_stream_add_remote_candidates (FsStream *stream
,GList *candidates
,GError **error
);
This function adds remote candidates. Any new candidates are
added to the list. The candidates will be used to establish a connection
with the peer. A copy will be made so the user must free the
passed candidate using fs_candidate_destroy()
when done.
stream |
an FsStream |
|
candidates |
an GList of FsCandidate representing the remote candidates. |
[element-type FsCandidate] |
error |
gboolean fs_stream_set_remote_codecs (FsStream *stream
,GList *remote_codecs
,GError **error
);
This function will set the list of remote codecs for this stream. If
the given remote codecs couldn't be negotiated with the list of local
codecs or already negotiated codecs for the corresponding FsSession, error
will be set and FALSE
will be returned. The remote_codecs
list will be
copied so it must be free'd using fs_codec_list_destroy()
when done.
gboolean fs_stream_force_remote_candidates (FsStream *stream
,GList *remote_candidates
,GError **error
);
This function forces data to be sent immediately to the selected remote candidate, by-passing any connectivity checks. There should be at most one candidate per component.
stream |
a FsStream |
|
remote_candidates |
a GList of FsCandidate to force. |
[element-type FsCandidate] |
error |
gboolean fs_stream_set_decryption_parameters (FsStream *stream
,GstStructure *parameters
,GError **error
);
Sets decryption parameters. The exact parameters depend on the type of plugin being used.
stream |
a FsStream |
|
parameters |
a GstStructure containing the decryption parameters. |
[transfer none] |
error |
Since: UNRELEASED
void
fs_stream_destroy (FsStream *stream
);
This will cause the stream to remove all links to other objects and to remove itself from the FsSession. Once a FsStream has been destroyed, it can not be used anymore.
It is strongly recommended to call this function from the main thread because releasing the application's reference to a stream.
GstIterator *
fs_stream_iterate_src_pads (FsStream *stream
);
Creates a GstIterator that can be used to iterate the src pads of this stream. These are the pads that were announced by “src-pad-added” and are still valid.
void fs_stream_add_id (FsStream *stream
,guint id
);
This function is used to add data identifiers that allow the plugin to recognize packets that are meant for id. For example, in RTP, one would set the SSRCs that are expected.
Depending on the protocol, one may be able to add more than one ID to a stream (in RTP you can have multiple SSRCs in a stream). If a protocol supports only one id, adding a new one will overwrite it. If an ID was already set on a stream, adding it to another stream will override the previdous decision.
For most protocols, calling this function is optional as the incoming data can be matched with a stream by its source IP address. This is mostly useful if one is using multicast or is behind a muxer server.
void fs_stream_emit_error (FsStream *stream
,gint error_no
,const gchar *error_msg
);
This function emits the “error”" signal, it should only be called by subclasses.
stream |
FsStream on which to emit the error signal |
|
error_no |
The number of the error |
|
error_msg |
Error message to be displayed to user |
void fs_stream_emit_src_pad_added (FsStream *stream
,GstPad *pad
,FsCodec *codec
);
Emits the “src-pad-added”" signal, it should only be called by subclasses.
struct FsStreamClass { GObjectClass parent_class; /*virtual functions */ gboolean (*add_remote_candidates) (FsStream *stream, GList *candidates, GError **error); gboolean (*force_remote_candidates) (FsStream *stream, GList *remote_candidates, GError **error); gboolean (*set_remote_codecs) (FsStream *stream, GList *remote_codecs, GError **error); 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); gboolean (* set_decryption_parameters) (FsStream *stream, GstStructure *parameters, GError **error); };
You must override add_remote_candidate in a subclass. If you have to negotiate codecs, then you must override set_remote_codecs too
GObjectClass |
Our parent |
|
Set sthe remote candidates |
||
Forces certain remote candidates |
||
Sets the list of remote codecs |
||
Add a known id to be associated with this stream |
||
Set the transmitter to use for this stream |
||
Set decryption parameters |
These are the possible states of a stream, a simple multicast stream could only be in "disconnected" or "ready" state. An stream using an ICE transmitter would use all of these.
“current-recv-codecs”
property “current-recv-codecs” FsCodecGList *
This is the list of codecs that have been received by this stream.
The user must free the list if fs_codec_list_destroy()
.
The "farstream-recv-codecs-changed" message is send on the GstBus
when the value of this property changes.
It is normally emitted right after “src-pad-added”
only if that codec was not previously received in this stream, but it can
also be emitted if the pad already exists, but the source material that
will come to it is different.
Flags: Read
“decryption-parameters”
property“decryption-parameters” GstStructure *
Retrieves previously set decryption parameters
Flags: Read
“direction”
property“direction” FsStreamDirection
The direction of the stream. This property is set initially as a parameter
to the fs_session_new_stream()
function. It can be changed later if
required by setting this property.
Flags: Read / Write / Construct
“negotiated-codecs”
property “negotiated-codecs” FsCodecGList *
This is the list of negotiatied codecs, it is the same list as the list of FsCodec from the parent FsSession, except that the codec config data has been replaced with the data from the remote codecs for this stream. This is the list of FsCodec used to receive data from this stream. It is a GList of FsCodec.
Flags: Read
“participant”
property“participant” FsParticipant *
The FsParticipant for this stream. This property is a construct param and is read-only construction.
Flags: Read / Write / Construct Only
“remote-codecs”
property “remote-codecs” FsCodecGList *
This is the list of remote codecs for this stream. They must be set by the
user as soon as they are known using fs_stream_set_remote_codecs()
(generally through external signaling). It is a GList of FsCodec.
Flags: Read
“require-encryption”
property“require-encryption” gboolean
If set to TRUE, only encrypted content will be accepted on this stream.
Flags: Read / Write
Default value: FALSE
“error”
signalvoid user_function (FsStream *self, FsError errorno, gchar *error_msg, gpointer user_data)
This signal is emitted in any error condition
self |
FsStream that emitted the signal |
|
errorno |
The number of the error |
|
error_msg |
Error message to be displayed to user |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“src-pad-added”
signalvoid user_function (FsStream *self, GstPad *pad, FsCodec *codec, gpointer user_data)
This signal is emitted when a new gst source pad has been created for a specific codec being received. There will be a different source pad for each codec that is received. The user must ref the GstPad if he wants to keep it. The user should not modify the FsCodec and must copy it if he wants to use it outside the callback scope.
This signal is not emitted on the main thread, but on GStreamer's streaming thread!
Flags: Run Last