FarsightTransmitter

FarsightTransmitter — A object that represents a network transmitter

Functions

Properties

guint media-type Read / Write

Signals

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

Types and Values

Object Hierarchy

    GObject
    ╰── FarsightTransmitter

Description

Functions

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.

Parameters

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.

Parameters


farsight_transmitter_factory_make ()

FarsightTransmitter *
farsight_transmitter_factory_make (const gchar *transmitter_id);


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.

Parameters

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.

Parameters

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.

Parameters

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

Parameters

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

Parameters

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


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

Parameters

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


farsight_transmitter_stop ()

gboolean
farsight_transmitter_stop (FarsightTransmitter *self);

This tells the transmitter to stop transmitting and shutdown any sockets.

Parameters

Returns

FALSE if the shutdown sequence fails.

Types and Values

struct FarsightTransmitter

struct 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.


struct FarsightTransmitterClass

struct FarsightTransmitterClass {
  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);
};


enum FarsightTransmitterError

Enum used to indicate an error condition.

Members

FARSIGHT_TRANSMITTER_ERROR_UNKNOWN

   

enum FarsightTransmitterState

An enum used to signal the state of a FarsightTransmitter

Members

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.

 

Property Details

The “media-type” property

  “media-type”               guint

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

Flags: Read / Write

Allowed values: <= 1

Default value: 0

Signal Details

The “connection-state-changed” signal

void
user_function (FarsightTransmitter *self,
               gint                 state,
               gpointer             user_data)

This signal is emitted when the connection state changes.

Parameters

self

FarsightTransmitter that emitted the signal

 

state

FarsightTransmitterState of new state

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “error” signal

void
user_function (FarsightTransmitter *self,
               gint                 type,
               gchar               *message,
               gpointer             user_data)

This signal is emitted in any error condition

Parameters

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.

 

Flags: Run Last


The “native-candidates-prepared” signal

void
user_function (FarsightTransmitter *self,
               gpointer             user_data)

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

Parameters

self

FarsightTransmitter that emitted the signal

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “new-active-candidate-pair” signal

void
user_function (FarsightTransmitter *self,
               gchar               *native_candidate_id,
               gchar               *remote_candidate_id,
               gpointer             user_data)

Emitted when this FarsightTransmitter has chosen a new active candidate pair to use to connect to the remote client.

Parameters

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.

 

Flags: Run Last


The “new-native-candidate” signal

void
user_function (FarsightTransmitter *self,
               gpointer             candidate,
               gpointer             user_data)

This signal is emitted when a new native candidate is found.

Parameters

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.

 

Flags: Run Last