## TpBaseMediaCallStream

TpBaseMediaCallStream — base class for TpSvcCallStreamInterfaceMedia implementations

## Functions

gboolean | ( *TpBaseMediaCallStreamFinishInitialCandidatesFunc ) ()
GPtrArray * | ( *TpBaseMediaCallStreamAddCandidatesFunc ) ()
void | ( *TpBaseMediaCallStreamReportFailureFunc ) ()
void | ( *TpBaseMediaCallStreamRequestReceivingFunc ) ()
gboolean | ( *TpBaseMediaCallStreamSetSendingFunc ) ()
void | tp_base_media_call_stream_set_relay_info ()
void | tp_base_media_call_stream_set_stun_servers ()
void | tp_base_media_call_stream_add_endpoint ()
void | tp_base_media_call_stream_remove_endpoint ()
GList * | tp_base_media_call_stream_get_endpoints ()
const gchar * | tp_base_media_call_stream_get_username ()
const gchar * | tp_base_media_call_stream_get_password ()
void | tp_base_media_call_stream_update_receiving_state ()
TpStreamFlowState | tp_base_media_call_stream_get_receiving_state ()
void | tp_base_media_call_stream_update_sending_state ()
TpStreamFlowState | tp_base_media_call_stream_get_sending_state ()
void | tp_base_media_call_stream_set_local_sending ()
gboolean | tp_base_media_call_stream_get_local_sending ()
GPtrArray * | tp_base_media_call_stream_get_local_candidates ()

## Properties

GPtrArray_DBusGObjectPath_ * | endpoints | Read
gboolean | has-server-info | Read
gboolean | ice-restart-pending | Read
GPtrArray_GValueArray_guint+gchararray+guint+GHashTable_gchararray+GValue___* | local-candidates | Read
GValueArray_gchararray+gchararray_* | local-credentials | Read
guint | receiving-state | Read
GPtrArray_GHashTable_gchararray+GValue__* | relay-info | Read
guint | sending-state | Read
GPtrArray_GValueArray_gchararray+guint__* | stun-servers | Read
guint | transport | Read / Write / Construct Only

## Types and Values

struct | TpBaseMediaCallStream
struct | TpBaseMediaCallStreamClass

## Object Hierarchy

        GObject
        ╰── TpBaseCallStream
            ╰── TpBaseMediaCallStream

## Implemented Interfaces

TpBaseMediaCallStream implements TpSvcDBusProperties, TpSvcCallStream and TpSvcCallStreamInterfaceMedia.

## Includes

    #include <telepathy-glib/telepathy-glib.h>

## Description

This base class makes it easier to write TpSvcCallStreamInterfaceMedia implementations by implementing some of its properties and methods.

Subclasses must still implement TpBaseCallStream's virtual methods plus TpBaseMediaCallStreamClass.add_local_candidates and TpBaseMediaCallStreamClass.finish_initial_candidates.

## Functions

### TpBaseMediaCallStreamFinishInitialCandidatesFunc ()

    gboolean
    (*TpBaseMediaCallStreamFinishInitialCandidatesFunc)
                                   (TpBaseMediaCallStream *self,
                                    GError **error);

Signature of an implementation of TpBaseMediaCallStreamClass.finish_initial_candidates.

#### Parameters

self | a TpBaseMediaCallStream |
error | a GError to fill |

Since 0.17.5

### TpBaseMediaCallStreamAddCandidatesFunc ()

    GPtrArray *
    (*TpBaseMediaCallStreamAddCandidatesFunc)
                                   (TpBaseMediaCallStream *self,
                                    const GPtrArray *candidates,
                                    GError **error);

Signature of an implementation of TpBaseMediaCallStreamClass.add_local_candidates.

Implementation should validate the added `candidates` and return a subset (or all) of them that are accepted. Implementation should return a new GPtrArray build in a way that `g_ptr_array_unref()` is enough to free all its memory. It is fine to just add element pointers from `candidates` to the returned GPtrArray without deep-copy them.

#### Parameters

self | a TpBaseMediaCallStream |
candidates | a GPtrArray of GValueArray containing candidates info |
error | a GError to fill |

Since 0.17.5

### TpBaseMediaCallStreamReportFailureFunc ()

    void
    (*TpBaseMediaCallStreamReportFailureFunc)
                                   (TpBaseMediaCallStream *self,
                                    TpStreamFlowState old_state,
                                    TpCallStateChangeReason reason,
                                    const gchar *dbus_reason,
                                    const gchar *message);

Signature of an implementation of TpBaseMediaCallStreamClass.report_sending_failure and TpBaseMediaCallStreamClass.report_receiving_failure.

#### Parameters

self | a TpBaseMediaCallStream |
old_state | the previous TpStreamFlowState |
reason | the TpCallStateChangeReason of the change |
dbus_reason | a specific reason for the change, which may be a D-Bus error in the Telepathy namespace, a D-Bus error in any other namespace (for implementation-specific errors), or the empty string to indicate that the state change was not an error. |
message | an optional debug message, to expediate debugging the potentially many processes involved in a call. |

Since 0.17.5

### TpBaseMediaCallStreamRequestReceivingFunc ()

    void
    (*TpBaseMediaCallStreamRequestReceivingFunc)
                                   (TpBaseMediaCallStream *self,
                                    TpHandle contact,
                                    gboolean receive);

Signature of an implementation of TpBaseMediaCallStreamClass.request_receiving.

#### Parameters

self | a TpBaseMediaCallStream |
contact | the contact from who user wants to start or stop receiving |
receive | wheter or not user would like to be receiving |

Since 0.17.5

### TpBaseMediaCallStreamSetSendingFunc ()

    gboolean
    (*TpBaseMediaCallStreamSetSendingFunc)
                                   (TpBaseMediaCallStream *self,
                                    gboolean sending,
                                    GError **error);

Signature of an implementation of TpBaseMediaCallStreamClass.set_sending.

#### Parameters

self | a TpBaseMediaCallStream |
sending | whether or not user would like to be sending |
error | a GError to fill |

#### Returns

`TRUE` on success, `FALSE` otherwise.

Since 0.17.5

### tp_base_media_call_stream_set_relay_info ()

    void
    tp_base_media_call_stream_set_relay_info
                                   (TpBaseMediaCallStream *self,
                                    GPtrArray *relays);

Set the relays info. The GPtrArray should have a free_func defined such as `g_ptr_array_ref()` is enough to keep the data and `g_ptr_array_unref()` is enough to release it later.

Note that this replaces the previously set relays, it is not an addition.

#### Parameters

self | a TpBaseMediaCallStream |
relays | the new relays info |

Since 0.17.5

### tp_base_media_call_stream_set_stun_servers ()

    void
    tp_base_media_call_stream_set_stun_servers
                                   (TpBaseMediaCallStream *self,
                                    GPtrArray *stun_servers);

Set the STUN servers. The GPtrArray should have a free_func defined such as `g_ptr_array_ref()` is enough to keep the data and `g_ptr_array_unref()` is enough to release it later.

Note that this replaces the previously set STUN servers, it is not an addition.

#### Parameters

self | a TpBaseMediaCallStream |
stun_servers | the new stun servers |

Since 0.17.5

### tp_base_media_call_stream_add_endpoint ()

    void
    tp_base_media_call_stream_add_endpoint
                                   (TpBaseMediaCallStream *self,
                                    TpCallStreamEndpoint *endpoint);

Add `endpoint` to “endpoints” list, and emits EndpointsChanged DBus signal.

#### Parameters

self | a TpBaseMediaCallStream |
endpoint | a TpCallStreamEndpoint |

Since 0.17.5

### tp_base_media_call_stream_remove_endpoint ()

    void
    tp_base_media_call_stream_remove_endpoint
                                   (TpBaseMediaCallStream *self,
                                    TpCallStreamEndpoint *endpoint);

Remove `endpoint` from “endpoints” list, and emits EndpointsChanged DBus signal.

#### Parameters

self | a TpBaseMediaCallStream |
endpoint | a TpCallStreamEndpoint |

Since 0.17.5

### tp_base_media_call_stream_get_endpoints ()

    GList *
    tp_base_media_call_stream_get_endpoints
                                   (TpBaseMediaCallStream *self);

Same as “endpoints” but as a GList of TpCallStreamEndpoint.

#### Parameters

self | a TpBaseMediaCallStream |

#### Returns

Borrowed GList of TpCallStreamEndpoint.

Since 0.17.5

### tp_base_media_call_stream_get_username ()

    const gchar *
    tp_base_media_call_stream_get_username
                                   (TpBaseMediaCallStream *self);

#### Parameters

self | a TpBaseMediaCallStream |

#### Returns

the username part of “local-credentials”

Since 0.17.5

### tp_base_media_call_stream_get_password ()

    const gchar *
    tp_base_media_call_stream_get_password
                                   (TpBaseMediaCallStream *self);

#### Parameters

self | a TpBaseMediaCallStream |

#### Returns

the password part of “local-credentials”

Since 0.17.5

### tp_base_media_call_stream_update_receiving_state ()

    void
    tp_base_media_call_stream_update_receiving_state
                                   (TpBaseMediaCallStream *self);

Update the receiving state.

#### Parameters

self | a TpBaseMediaCallStream |

Since 0.17.5

### tp_base_media_call_stream_get_receiving_state ()

    TpStreamFlowState
    tp_base_media_call_stream_get_receiving_state
                                   (TpBaseMediaCallStream *self);

#### Parameters

self | a TpBaseMediaCallStream |

#### Returns

the value of “receiving-state”.

Since 0.17.5

### tp_base_media_call_stream_update_sending_state ()

    void
    tp_base_media_call_stream_update_sending_state
                                   (TpBaseMediaCallStream *self);

Update the sending state.

#### Parameters

self | a TpBaseMediaCallStream |

Since 0.17.5

### tp_base_media_call_stream_get_sending_state ()

    TpStreamFlowState
    tp_base_media_call_stream_get_sending_state
                                   (TpBaseMediaCallStream *self);

#### Parameters

self | a TpBaseMediaCallStream |

#### Returns

the value of “sending-state”.

Since 0.17.5

### tp_base_media_call_stream_set_local_sending ()

    void
    tp_base_media_call_stream_set_local_sending
                                   (TpBaseMediaCallStream *self,
                                    gboolean sending);

Set local sending state.

#### Parameters

self | a TpBaseMediaCallStream |
sending | whether or not we are sending |

Since 0.17.5

### tp_base_media_call_stream_get_local_sending ()

    gboolean
    tp_base_media_call_stream_get_local_sending
                                   (TpBaseMediaCallStream *self);

Gets the local sending state

#### Parameters

self | a TpBaseMediaCallStream |

#### Returns

The local sending state

Since 0.17.7

### tp_base_media_call_stream_get_local_candidates ()

    GPtrArray *
    tp_base_media_call_stream_get_local_candidates
                                   (TpBaseMediaCallStream *self);

#### Parameters

self | a TpBaseMediaCallStream |

#### Returns

the value of “local-candidates” as a GtrArray

Since 0.17.5

## Types and Values

### struct TpBaseMediaCallStream

    struct TpBaseMediaCallStream;

A base class for media call stream implementations

Since 0.17.5

### struct TpBaseMediaCallStreamClass

    struct TpBaseMediaCallStreamClass {
      TpBaseMediaCallStreamReportFailureFunc report_sending_failure;
      TpBaseMediaCallStreamReportFailureFunc report_receiving_failure;
      TpBaseMediaCallStreamAddCandidatesFunc add_local_candidates;
      TpBaseMediaCallStreamFinishInitialCandidatesFunc finish_initial_candidates;

      TpBaseMediaCallStreamRequestReceivingFunc request_receiving;
      TpBaseMediaCallStreamSetSendingFunc set_sending;
    };

The class structure for TpBaseMediaCallStream

#### Members

TpBaseMediaCallStreamReportFailureFunc `report_sending_failure`; | optional; called to indicate a failure in the outgoing portion of the stream |
TpBaseMediaCallStreamReportFailureFunc `report_receiving_failure`; | optional; called to indicate a failure in the incoming portion of the stream |
TpBaseMediaCallStreamAddCandidatesFunc `add_local_candidates`; | mandatory; called when new candidates are added |
TpBaseMediaCallStreamFinishInitialCandidatesFunc `finish_initial_candidates`; | optional; called when the initial batch of candidates has been added, and should now be processed/sent to the remote side |
TpBaseMediaCallStreamRequestReceivingFunc `request_receiving`; | optional (see “can-request-receiving”); virtual method called when user requested receiving from the given remote contact. This virtual method should be implemented instead of TpBaseCallStreamClass.request_receiving |
TpBaseMediaCallStreamSetSendingFunc `set_sending`; | mandatory; virtual method called when user requested to start/stop sending to remote contacts. This virtual method should be implemented instead of TpBaseCallStreamClass.set_sending |

Since 0.17.5

## Property Details

### The `“endpoints”` property

      “endpoints”                GPtrArray_DBusGObjectPath_ *

GPtrArray{object-path string} The endpoints of this content.

Flags: Read

Since 0.17.5

### The `“has-server-info”` property

      “has-server-info”          gboolean

`TRUE` if “relay-info” and “stun-servers” have been set.

Flags: Read

Default value: FALSE

Since 0.17.5

### The `“ice-restart-pending”` property

      “ice-restart-pending”      gboolean

`TRUE` when ICERestartRequested signal is emitted, and `FALSE` when SetCredentials is called. Useful for debugging.

Flags: Read

Default value: FALSE

Since 0.17.5

### The `“local-candidates”` property

      “local-candidates”         GPtrArray_GValueArray_guint+gchararray+guint+GHashTable_gchararray+GValue___*

GPtrArray{candidate GValueArray} List of local candidates.

Flags: Read

Since 0.17.5

### The `“local-credentials”` property

      “local-credentials”        GValueArray_gchararray+gchararray_*

GValueArray{username string, password string} ufrag and pwd as defined by ICE.

Flags: Read

Since 0.17.5

### The `“receiving-state”` property

      “receiving-state”          guint

The receiving TpStreamFlowState.

Flags: Read

Default value: 0

Since 0.17.5

### The `“relay-info”` property

      “relay-info”               GPtrArray_GHashTable_gchararray+GValue__*

GPtrArray{relay-info asv} List of relay information.

Flags: Read

Since 0.17.5

### The `“sending-state”` property

      “sending-state”            guint

The sending TpStreamFlowState.

Flags: Read

Default value: 0

Since 0.17.5

### The `“stun-servers”` property

      “stun-servers”             GPtrArray_GValueArray_gchararray+guint__*

GPtrArray{stun-server GValueArray} List of STUN servers.

Flags: Read

Since 0.17.5

### The `“transport”` property

      “transport”                guint

The TpStreamTransportType of this stream.

Flags: Read / Write / Construct Only

Default value: 0

Since 0.17.5

## See Also

TpSvcCallStreamInterfaceMedia, TpBaseCallChannel, TpBaseCallStream and TpBaseCallContent