| Farsight Reference Manual | ||||
|---|---|---|---|---|
FarsightTransmitter;
FarsightTransmitterClass;
enum FarsightTransmitterError;
enum FarsightTransmitterState;
void farsight_transmitter_add_remote_candidates
(FarsightTransmitter *self,
const GList *remote_candidate_list);
void farsight_transmitter_destroy (FarsightTransmitter *self);
FarsightTransmitter* farsight_transmitter_factory_make
(const gchar *transmitter_id);
GstElement* farsight_transmitter_get_gst_sink
(FarsightTransmitter *self);
GstElement* farsight_transmitter_get_gst_src
(FarsightTransmitter *self);
gboolean farsight_transmitter_prepare (FarsightTransmitter *self);
void farsight_transmitter_signal_connection_state_changed
(FarsightTransmitter *self,
FarsightTransmitterState state);
void farsight_transmitter_signal_error
(FarsightTransmitter *self,
FarsightTransmitterError type,
gchar *message);
void farsight_transmitter_signal_native_candidates_prepared
(FarsightTransmitter *self);
void farsight_transmitter_signal_new_active_candidate_pair
(FarsightTransmitter *self,
const gchar *native_candidate_id,
const gchar *remote_candidate_id);
void farsight_transmitter_signal_new_native_candidate
(FarsightTransmitter *self,
const FarsightTransportInfo *candidate);
gboolean farsight_transmitter_stop (FarsightTransmitter *self);
"connection-state-changed" void user_function (FarsightTransmitter *self, gint state, gpointer user_data) : Run last "error" void user_function (FarsightTransmitter *self, gint type, gchar *message, gpointer user_data) : Run last "native-candidates-prepared" void user_function (FarsightTransmitter *self, gpointer user_data) : Run last "new-active-candidate-pair" void user_function (FarsightTransmitter *self, gchar *native_candidate_id, gchar *remote_candidate_id, gpointer user_data) : Run last "new-native-candidate" void user_function (FarsightTransmitter *self, gpointer candidate, gpointer user_data) : Run last
typedef struct _FarsightTransmitter FarsightTransmitter;
A network transmitter that farsight plugins can use to communicate on the network. These transmitter can contain advanced connectivity features such as STUN, TURN or can be plain UDP / TCP sockets.
typedef struct {
GObjectClass parent_class;
/*virtual methods */
gboolean (* prepare) (FarsightTransmitter *self);
gboolean (* stop) (FarsightTransmitter *self);
void (* add_remote_candidates) (FarsightTransmitter *self, const GList *remote_candidate_list);
GstElement * (* get_gst_src) (FarsightTransmitter *self);
GstElement * (* get_gst_sink) (FarsightTransmitter *self);
} FarsightTransmitterClass;
typedef enum
{
FARSIGHT_TRANSMITTER_ERROR_UNKNOWN
} FarsightTransmitterError;
Enum used to indicate an error condition.
typedef enum
{
FARSIGHT_TRANSMITTER_STATE_DISCONNECTED,
FARSIGHT_TRANSMITTER_STATE_CONNECTING,
FARSIGHT_TRANSMITTER_STATE_CONNECTED
} FarsightTransmitterState;
An enum used to signal the state of a FarsightTransmitter
void farsight_transmitter_add_remote_candidates
(FarsightTransmitter *self,
const GList *remote_candidate_list);
Tells the transmitter what the remote candidates are for transmission.
self : |
a FarsightTransmitter |
remote_candidate_list : |
a GList of FarsightTransport of the remote candidates |
void farsight_transmitter_destroy (FarsightTransmitter *self);
Destroy this transmitter and all resources allocated by it. This function should be used instead of g_object_unref in order to destroy the transmitter.
self : |
a FarsightTransmitter |
FarsightTransmitter* farsight_transmitter_factory_make (const gchar *transmitter_id);
transmitter_id : |
|
| Returns : |
GstElement* farsight_transmitter_get_gst_sink
(FarsightTransmitter *self);
Asks the transmitter to return the pointer to the gstreamer sink used by this transmitter.
self : |
a FarsightTransmitter |
| Returns : | a pointer a sink GstElement to use. |
GstElement* farsight_transmitter_get_gst_src
(FarsightTransmitter *self);
Asks the transmitter to return the pointer to the gstreamer source used by this transmitter.
self : |
a FarsightTransmitter |
| Returns : | a pointer a source GstElement to use. |
gboolean farsight_transmitter_prepare (FarsightTransmitter *self);
This tells the transmitter to prepare itself for transmission. Basically it discovers local candidates, opens sockets and other specific operations.
self : |
a FarsightTransmitter |
| Returns : | FALSE if the preparation failed. |
void farsight_transmitter_signal_connection_state_changed
(FarsightTransmitter *self,
FarsightTransmitterState state);
Used by subclasses of FarsightTransmitter to emit an connection-state-changed signal
self : |
FarsightTransmitter that emitted the signal |
state : |
FarsighmTransmitterState of new state |
void farsight_transmitter_signal_error
(FarsightTransmitter *self,
FarsightTransmitterError type,
gchar *message);
Used by subclasses of FarsightTransmitter to emit an error signal
self : |
FarsightTransmitter that emitted the signal |
type : |
FarsightTransmitterError type of error |
message : |
Error message |
void farsight_transmitter_signal_native_candidates_prepared
(FarsightTransmitter *self);
self : |
void farsight_transmitter_signal_new_active_candidate_pair
(FarsightTransmitter *self,
const gchar *native_candidate_id,
const gchar *remote_candidate_id);
Used by subclasses of FarsightTransmitter to emit an new-active-candidate-pair signal
self : |
a FarsightTransmitter |
native_candidate_id : |
string identifier of native candidate that is now active |
remote_candidate_id : |
string identifier of remote candidate that is now active |
void farsight_transmitter_signal_new_native_candidate
(FarsightTransmitter *self,
const FarsightTransportInfo *candidate);
self : |
|
candidate : |
gboolean farsight_transmitter_stop (FarsightTransmitter *self);
This tells the transmitter to stop transmitting and shutdown any sockets.
self : |
a FarsightTransmitter |
| Returns : | FALSE if the shutdown sequence fails. |
void user_function (FarsightTransmitter *self, gint state, gpointer user_data) : Run last
This signal is emitted when the connection state changes.
self : |
FarsightTransmitter that emitted the signal |
state : |
FarsightTransmitterState of new state |
user_data : |
user data set when the signal handler was connected. |
void user_function (FarsightTransmitter *self, gint type, gchar *message, gpointer user_data) : Run last
This signal is emitted in any error condition
self : |
FarsightTransmitter that emitted the signal |
type : |
FarsightTransmitterError type of error |
message : |
Error message |
user_data : |
user data set when the signal handler was connected. |
void user_function (FarsightTransmitter *self, gpointer user_data) : Run last
This signal is emitted when the native candidates have been prepared. This usually means all of the local ports have been opened, local interfaces have been found, and/or external ports have been found, and/or relay server has been setup, or anything else the protocol needs. After emission of this signal, farsight_transmitter_get_native_candidate_list should return meaningful data
self : |
FarsightTransmitter that emitted the signal |
user_data : |
user data set when the signal handler was connected. |
void user_function (FarsightTransmitter *self, gchar *native_candidate_id, gchar *remote_candidate_id, gpointer user_data) : Run last
Emitted when this FarsightTransmitter has chosen a new active candidate pair to use to connect to the remote client.
self : |
FarsightTransmitter that emitted the signal |
native_candidate_id : |
string identifier of native candidate that is now active |
remote_candidate_id : |
string identifier of remote candidate that is now active |
user_data : |
user data set when the signal handler was connected. |
void user_function (FarsightTransmitter *self, gpointer candidate, gpointer user_data) : Run last
This signal is emitted when a new native candidate is found.
self : |
FarsightTransmitter that emitted the signal |
candidate : |
a FarsightTransportInfo of the new native candidate |
user_data : |
user data set when the signal handler was connected. |