![]() |
![]() |
![]() |
Farsight2 Reference Manual | ![]() |
---|---|---|---|---|
FsStream; FsStreamClass; enum FsStreamDirection; gboolean fs_stream_add_remote_candidate (FsStream *stream, FsCandidate *candidate, GError **error); void fs_stream_remote_candidates_added (FsStream *stream); gboolean fs_stream_select_candidate_pair (FsStream *stream, gchar *lfoundation, gchar *rfoundation, GError **error); gboolean fs_stream_set_remote_codecs (FsStream *stream, GList *remote_codecs, GError **error); void fs_stream_emit_error (FsStream *stream, gint error_no, gchar *error_msg, gchar *debug_msg); void fs_stream_emit_src_pad_added (FsStream *stream, GstPad *pad, FsCodec *codec);
"current-recv-codecs" FsCodecGList : Read "direction" FsStreamDirection : Read / Write / Construct "participant" FsParticipant : Read / Write / Construct Only "remote-codecs" FsCodecGList : Read "session" FsSession : Read / Write / Construct Only "stream-transmitter" FsStreamTransmitter : Read / Write / Construct Only
"error" : Run Last "local-candidates-prepared" : Run Last "new-active-candidate-pair" : Run Last "new-local-candidate" : Run Last "recv-codecs-changed" : Run Last "src-pad-added" : Run Last
This object is the base implementation of a Farsight Stream. It needs to be derived and implemented by a farsight conference gstreamer element. A Farsight Stream is a media stream originating from a participant inside a session. In fact, a FarsightStream instance is obtained by adding a participant into a session using fs_session_add_participant.
typedef struct _FsStream FsStream;
All members are private, access them using methods and properties
typedef struct { GObjectClass parent_class; /*virtual functions */ gboolean (*add_remote_candidate) (FsStream *stream, FsCandidate *candidate, GError **error); void (*remote_candidates_added) (FsStream *stream); gboolean (*select_candidate_pair) (FsStream *stream, gchar *lfoundation, gchar *rfoundation, GError **error); gboolean (*set_remote_codecs) (FsStream *stream, GList *remote_codecs, GError **error); } FsStreamClass;
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 |
|
Adds a remote candidate |
|
Tell the stream to start the connectivity checks |
|
Select the candidate pair |
|
Sets the list of remote codecs |
typedef enum { FS_DIRECTION_NONE = 0, FS_DIRECTION_SEND = 1<<0, FS_DIRECTION_RECV = 1<<1, FS_DIRECTION_BOTH = FS_DIRECTION_SEND | FS_DIRECTION_RECV } FsStreamDirection;
An enum for specifying the direction of a stream
gboolean fs_stream_add_remote_candidate (FsStream *stream, FsCandidate *candidate, GError **error);
This function adds the given candidate into the remote candiate list of the
stream. It will be used for establishing a connection with the peer. A copy
will be made so the user must free the passed candidate using
fs_candidate_destroy()
when done.
|
an FsStream |
|
an FsCandidate struct representing a remote candidate |
|
location of a GError, or NULL if no error occured
|
Returns : |
TRUE if the candidate was valid, FALSE otherwise |
void fs_stream_remote_candidates_added (FsStream *stream);
Call this function when the remotes candidates have been set and the checks can start. More candidates can be added afterwards
|
a FsStream |
gboolean fs_stream_select_candidate_pair (FsStream *stream, gchar *lfoundation, gchar *rfoundation, GError **error);
This function selects one pair of candidates to be selected to start sending media on.
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.
void fs_stream_emit_error (FsStream *stream, gint error_no, gchar *error_msg, gchar *debug_msg);
This function emits the FsStream::error" signal, it should only be called by subclasses.
|
FsStream on which to emit the error signal |
|
The number of the error |
|
Error message to be displayed to user |
|
Debugging error message |
void fs_stream_emit_src_pad_added (FsStream *stream, GstPad *pad, FsCodec *codec);
This functin emits the FsStream::src-pad-added" signal, it should only be called by subclasses.
current-recv-codecs
" property"current-recv-codecs" FsCodecGList : Read
A GList of FsCodec representing the codecs that have been received.
direction
" property"direction" FsStreamDirection : Read / Write / Construct
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.
participant
" property"participant" FsParticipant : Read / Write / Construct Only
The FsParticipant for this stream. This property is a construct param and is read-only construction.
remote-codecs
" property"remote-codecs" FsCodecGList : Read
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.
session
" property"session" FsSession : Read / Write / Construct Only
The FsSession for this stream. This property is a construct param and is read-only construction.
stream-transmitter
" property"stream-transmitter" FsStreamTransmitter : Read / Write / Construct Only
The FsStreamTransmitter for this stream.
void user_function (FsStream *self, gint errorno, gchar *error_msg, gchar *debug_msg, gpointer user_data) : Run Last
This signal is emitted in any error condition
|
FsStream that emitted the signal |
|
The number of the error |
|
Error message to be displayed to user |
|
Debugging error message |
|
user data set when the signal handler was connected. |
void user_function (FsStream *self, gpointer user_data) : Run Last
This signal is emitted when all local candidates have been prepared, an ICE implementation would send its SDP offer or answer.
|
FsStream that emitted the signal |
|
user data set when the signal handler was connected. |
void user_function (FsStream *self, FsCandidate *local_candidate, FsCandidate *remote_candidate, gpointer user_data) : Run Last
This signal is emitted when there is a new active chandidate 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.
|
FsStream that emitted the signal |
|
FsCandidate of the local candidate being used |
|
FsCandidate of the remote candidate being used |
|
user data set when the signal handler was connected. |
void user_function (FsStream *self, FsCandidate *local_candidate, gpointer user_data) : Run Last
This signal is emitted when a new local candidate is discovered.
|
FsStream that emitted the signal |
|
FsCandidate of the local candidate |
|
user data set when the signal handler was connected. |
void user_function (FsStream *self, gpointer user_data) : Run Last
This signal is emitted when the list of currently received codecs has changed. They can be fetched from the FsStream:current-recv-codecs property. This is useful for displaying the current active reception codecs. This signal 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.
|
FsStream that emitted the signal |
|
user data set when the signal handler was connected. |
void user_function (FsStream *self, GstPad *pad, FsCodec *codec, gpointer user_data) : Run Last
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!