FarsightTransmitter

FarsightTransmitter — A object that represents a network transmitter

Synopsis

                    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);

Object Hierarchy

  GObject
   +----FarsightTransmitter

Properties

  "media-type"               guint                 : Read / Write

Signals

  "connection-state-changed"                       : Run Last
  "error"                                          : Run Last
  "native-candidates-prepared"                     : Run Last
  "new-active-candidate-pair"                      : Run Last
  "new-native-candidate"                           : Run Last

Description

Details

FarsightTransmitter

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.


FarsightTransmitterClass

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;


enum FarsightTransmitterError

typedef enum
{
  FARSIGHT_TRANSMITTER_ERROR_UNKNOWN
} FarsightTransmitterError;

Enum used to indicate an error condition.


enum FarsightTransmitterState

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

FARSIGHT_TRANSMITTER_STATE_DISCONNECTED

The transmitter is not connected

FARSIGHT_TRANSMITTER_STATE_CONNECTING

The transmitter is trying to establish a connection

FARSIGHT_TRANSMITTER_STATE_CONNECTED

The transmitter is connected and can start streaming.

farsight_transmitter_add_remote_candidates ()

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

farsight_transmitter_destroy ()

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.


farsight_transmitter_factory_make ()

FarsightTransmitter * farsight_transmitter_factory_make (const gchar *transmitter_id);

transmitter_id :

Returns :


farsight_transmitter_get_gst_sink ()

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.

farsight_transmitter_get_gst_src ()

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.

farsight_transmitter_prepare ()

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.

farsight_transmitter_signal_connection_state_changed ()

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

farsight_transmitter_signal_error ()

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

farsight_transmitter_signal_native_candidates_prepared ()

void                farsight_transmitter_signal_native_candidates_prepared
                                                        (FarsightTransmitter *self);

self :


farsight_transmitter_signal_new_active_candidate_pair ()

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

farsight_transmitter_signal_new_native_candidate ()

void                farsight_transmitter_signal_new_native_candidate
                                                        (FarsightTransmitter *self,
                                                         const FarsightTransportInfo *candidate);

self :

candidate :


farsight_transmitter_stop ()

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.

Property Details

The "media-type" property

  "media-type"               guint                 : Read / Write

The media type (audio/video) of the stream.

Allowed values: <= 1

Default value: 0

Signal Details

The "connection-state-changed" signal

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.

The "error" signal

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.

The "native-candidates-prepared" signal

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.

The "new-active-candidate-pair" signal

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.

The "new-native-candidate" signal

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.