| Home · All Classes · All Namespaces · Modules · Functions · Files

# Tp::StreamedMediaChannel Class Reference
[Channel proxies]

The StreamedMediaChannel class provides an object representing a Telepathy channel of type StreamedMedia or Call. More...

`#include <TelepathyQt4/StreamedMediaChannel>`

Inherits Tp::Channel.

List of all members.

## Public Types

- enum StateChangeReason { StateChangeReasonUnknown, StateChangeReasonUserRequested }

## Signals

- void contentAdded (const Tp::MediaContentPtr &content)
- void contentRemoved (const Tp::MediaContentPtr &content)
- void streamAdded (const Tp::MediaStreamPtr &stream)
- void streamRemoved (const Tp::MediaStreamPtr &stream)
- void streamDirectionChanged (const Tp::MediaStreamPtr &stream, Tp::MediaStreamDirection direction, Tp::MediaStreamPendingSend pendingSend)
- void streamStateChanged (const Tp::MediaStreamPtr &stream, Tp::MediaStreamState state)
- void streamError (const Tp::MediaStreamPtr &stream, Tp::MediaStreamError errorCode, const QString &errorMessage)
- void localHoldStateChanged (Tp::LocalHoldState state, Tp::LocalHoldStateReason reason)

## Public Member Functions

- virtual ~StreamedMediaChannel ()
- bool awaitingLocalAnswer () const
- bool awaitingRemoteAnswer () const
- PendingOperation * acceptCall ()
- PendingOperation * hangupCall (StateChangeReason reason, const QString &detailedReason, const QString &message)
- MediaContents contents () const
- MediaContents contentsForType (MediaStreamType type) const
- TELEPATHY_QT4_DEPRECATED
  MediaStreams streams () const
- TELEPATHY_QT4_DEPRECATED
  MediaStreams streamsForType (MediaStreamType type) const
- PendingMediaContent * requestContent (const QString &name, MediaStreamType type)
- TELEPATHY_QT4_DEPRECATED
  PendingMediaStreams * requestStream (const ContactPtr &contact, MediaStreamType type)
- TELEPATHY_QT4_DEPRECATED
  PendingMediaStreams * requestStreams (const ContactPtr &contact, QList< MediaStreamType > types)
- PendingOperation * removeContent (const MediaContentPtr &content)
- TELEPATHY_QT4_DEPRECATED
  PendingOperation * removeStream (const MediaStreamPtr &stream)
- TELEPATHY_QT4_DEPRECATED
  PendingOperation * removeStreams (const MediaStreams &streams)
- bool handlerStreamingRequired () const
- LocalHoldState localHoldState () const
- LocalHoldStateReason localHoldStateReason () const
- PendingOperation * requestHold (bool hold)

## Static Public Member Functions

- static StreamedMediaChannelPtr create (const ConnectionPtr &connection, const QString &objectPath, const QVariantMap &immutableProperties)

## Static Public Attributes

- static const Feature FeatureContents
- static const Feature FeatureLocalHoldState
- static const Feature FeatureStreams

## Protected Member Functions

- StreamedMediaChannel (const ConnectionPtr &connection, const QString &objectPath, const QVariantMap &immutableProperties)

## Detailed Description

The StreamedMediaChannel class provides an object representing a Telepathy channel of type StreamedMedia or Call.

## Member Enumeration Documentation

enum Tp::StreamedMediaChannel::StateChangeReason

Enumerator:

  StateChangeReasonUnknown |
  StateChangeReasonUserRequested |

## Constructor & Destructor Documentation

Tp::StreamedMediaChannel::~StreamedMediaChannel | ( |  | ) | `[virtual]`

Class destructor.

Tp::StreamedMediaChannel::StreamedMediaChannel | ( | const ConnectionPtr & | connection,
|  | const QString & | objectPath,
|  | const QVariantMap & | immutableProperties |
| ) |  |  | `[protected]`

Construct a new StreamedMediaChannel associated with the given object on the same service as the given connection.

Parameters:

  | connection | Connection owning this channel, and specifying the service.
  | objectPath | The object path of this channel.
  | immutableProperties | The immutable properties of this channel.

## Member Function Documentation

StreamedMediaChannelPtr Tp::StreamedMediaChannel::create | ( | const ConnectionPtr & | connection,
|  | const QString & | objectPath,
|  | const QVariantMap & | immutableProperties |
| ) |  |  | `[static]`

Create a new StreamedMediaChannel object.

Parameters:

  | connection | Connection owning this channel, and specifying the service.
  | objectPath | The object path of this channel.
  | immutableProperties | The immutable properties of this channel.

Returns:
  A StreamedMediaChannelPtr object pointing to the newly created StreamedMediaChannel object.

Reimplemented from Tp::Channel.

bool Tp::StreamedMediaChannel::awaitingLocalAnswer | ( |  | ) | const

Return whether this channel is awaiting local answer.

Returns:
  `true` if awaiting local answer, `false` otherwise.

See also:
  awaitingRemoteAnswer()

bool Tp::StreamedMediaChannel::awaitingRemoteAnswer | ( |  | ) | const

Return whether this channel is awaiting remote answer.

Returns:
  `true` if awaiting remote answer, `false` otherwise.

See also:
  awaitingLocalAnswer()

PendingOperation * Tp::StreamedMediaChannel::acceptCall | ( |  | ) |

Accept an incoming call.

Returns:
  A PendingOperation which will emit PendingOperation::finished when the call has finished.

PendingOperation * Tp::StreamedMediaChannel::hangupCall | ( | StateChangeReason | reason,
|  | const QString & | detailedReason,
|  | const QString & | message |
| ) |  |  |

Request that the call is ended.

Parameters:

  | reason | A generic hangup reason.
  | detailedReason | A more specific reason for the call hangup, if one is available, or an empty string otherwise.
  | message | A human-readable message to be sent to the remote contact(s).

Returns:
  A PendingOperation which will emit PendingOperation::finished when the call has finished.

MediaContents Tp::StreamedMediaChannel::contents | ( |  | ) | const

Return a list of media contents in this channel.

This methods requires StreamedMediaChannel::FeatureContents to be enabled.

Returns:
  The contents in this channel.

See also:
  contentAdded(), contentRemoved(), contentsForType(), requestContent()

MediaContents Tp::StreamedMediaChannel::contentsForType | ( | MediaStreamType | type | ) | const

Return a list of media contents in this channel for the given type type.

This methods requires StreamedMediaChannel::FeatureContents to be enabled.

Parameters:

  | type | The interested type.

Returns:
  A list of media contents in this channel for the given type type.

See also:
  contentAdded(), contentRemoved(), contents(), requestContent()

MediaStreams Tp::StreamedMediaChannel::streams | ( |  | ) | const

Return a list of media streams in this channel.

This methods requires StreamedMediaChannel::FeatureStreams to be enabled.

Returns:
  The media streams in this channel.

See also:
  streamAdded(), streamRemoved(), streamsForType(), requestStreams()

MediaStreams Tp::StreamedMediaChannel::streamsForType | ( | MediaStreamType | type | ) | const

Return a list of media streams in this channel for the given type type.

This methods requires StreamedMediaChannel::FeatureStreams to be enabled.

Parameters:

  | type | The interested type.

Returns:
  A list of media streams in this channel for the given type type.

See also:
  streamAdded(), streamRemoved(), streams(), requestStreams()

PendingMediaContent * Tp::StreamedMediaChannel::requestContent | ( | const QString & | name,
|  | MediaStreamType | type |
| ) |  |  |

Request that media content be established to exchange the given type type of media.

This methods requires StreamedMediaChannel::FeatureContents to be enabled.

Returns:
  A PendingMediaContent which will emit PendingMediaContent::finished when the call has finished.

See also:
  contentAdded(), contents(), contentsForType()

PendingMediaStreams * Tp::StreamedMediaChannel::requestStream | ( | const ContactPtr & | contact,
|  | MediaStreamType | type |
| ) |  |  |

Request that media streams be established to exchange the given type type of media with the given contact contact.

This methods requires StreamedMediaChannel::FeatureStreams to be enabled.

Returns:
  A PendingMediaStreams which will emit PendingMediaStreams::finished when the call has finished.

See also:
  streamAdded(), streams(), streamsForType()

PendingMediaStreams * Tp::StreamedMediaChannel::requestStreams | ( | const ContactPtr & | contact,
|  | QList< MediaStreamType > | types |
| ) |  |  |

Request that media streams be established to exchange the given types types of media with the given contact contact.

This methods requires StreamedMediaChannel::FeatureStreams to be enabled.

Returns:
  A PendingMediaStreams which will emit PendingMediaStreams::finished when the call has finished.

See also:
  streamAdded(), streams(), streamsForType()

PendingOperation * Tp::StreamedMediaChannel::removeContent | ( | const MediaContentPtr & | content | ) |

Remove the specified media content from this channel.

Parameters:

  | content | Media content to remove.

Returns:
  A PendingOperation which will emit PendingOperation::finished when the call has finished.

See also:
  contentRemoved(), contents(), contentsForType()

PendingOperation * Tp::StreamedMediaChannel::removeStream | ( | const MediaStreamPtr & | stream | ) |

Remove the specified media stream from this channel.

This methods requires StreamedMediaChannel::FeatureStreams to be enabled.

Parameters:

  | stream | Media stream to remove.

Returns:
  A PendingOperation which will emit PendingOperation::finished when the call has finished.

See also:
  streamRemoved(), streams(), streamsForType()

PendingOperation * Tp::StreamedMediaChannel::removeStreams | ( | const MediaStreams & | streams | ) |

Remove the specified media streams from this channel.

This methods requires StreamedMediaChannel::FeatureStreams to be enabled.

Parameters:

  | streams | List of media streams to remove.

Returns:
  A PendingOperation which will emit PendingOperation::finished when the call has finished.

See also:
  streamRemoved(), streams(), streamsForType()

bool Tp::StreamedMediaChannel::handlerStreamingRequired | ( |  | ) | const

Check whether media streaming by the handler is required for this channel.

For channels with the MediaSignalling interface, the main handler of the channel is responsible for doing the actual streaming, for instance by calling createFarsightChannel(channel) from TelepathyQt4-Farsight library and using the telepathy-farsight API on the resulting TfChannel.

Returns:
  `true` if required, `false` otherwise.

LocalHoldState Tp::StreamedMediaChannel::localHoldState | ( |  | ) | const

Return whether the local user has placed this channel on hold.

This method requires StreamedMediaChannel::FeatureHoldState to be enabled.

Returns:
  The channel local hold state.

See also:
  requestHold(), localHoldStateChanged()

LocalHoldStateReason Tp::StreamedMediaChannel::localHoldStateReason | ( |  | ) | const

Return the reason why localHoldState() changed to its current value.

This method requires StreamedMediaChannel::FeatureLocalHoldState to be enabled.

Returns:
  The channel local hold state reason.

See also:
  requestHold(), localHoldStateChanged()

PendingOperation * Tp::StreamedMediaChannel::requestHold | ( | bool | hold | ) |

Request that the channel be put on hold (be instructed not to send any media streams to you) or be taken off hold.

If the connection manager can immediately tell that the requested state change could not possibly succeed, the resulting PendingOperation will fail with error code TELEPATHY_ERROR_NOT_AVAILABLE. If the requested state is the same as the current state, the resulting PendingOperation will finish successfully.

Otherwise, the channel's local hold state will change to Tp::LocalHoldStatePendingHold or Tp::LocalHoldStatePendingUnhold (as appropriate), then the resulting PendingOperation will finish successfully.

The eventual success or failure of the request is indicated by a subsequent localHoldStateChanged() signal, changing the local hold state to Tp::LocalHoldStateHeld or Tp::LocalHoldStateUnheld.

If the channel has multiple streams, and the connection manager succeeds in changing the hold state of one stream but fails to change the hold state of another, it will attempt to revert all streams to their previous hold states.

If the channel does not support the TELEPATHY_INTERFACE_CHANNEL_INTERFACE_HOLD interface, the PendingOperation will fail with error code TELEPATHY_ERROR_NOT_IMPLEMENTED.

Parameters:

  | hold | A boolean indicating whether or not the channel should be on hold

Returns:
  A PendingOperation, which will emit PendingOperation::finished when the request finishes.

See also:
  localHoldState(), localHoldStateReason(), localHoldStateChanged()

void Tp::StreamedMediaChannel::contentAdded | ( | const Tp::MediaContentPtr & | content | ) | `[signal]`

This signal is emitted when a media content is added to this channel.

Parameters:

  | content | The media content that was added.

See also:
  contents(), contentsForType()

void Tp::StreamedMediaChannel::contentRemoved | ( | const Tp::MediaContentPtr & | content | ) | `[signal]`

This signal is emitted when a media content is removed from this channel.

Parameters:

  | content | The media content that was removed.

See also:
  contents(), contentsForType()

void Tp::StreamedMediaChannel::streamAdded | ( | const Tp::MediaStreamPtr & | stream | ) | `[signal]`

This signal is emitted when a media stream is added to this channel.

Parameters:

  | stream | The media stream that was added.

See also:
  streams(), streamsForType()

void Tp::StreamedMediaChannel::streamRemoved | ( | const Tp::MediaStreamPtr & | stream | ) | `[signal]`

This signal is emitted when a media stream is removed from this channel.

Parameters:

  | content | The media stream that was removed.

See also:
  streams(), streamsForType()

void Tp::StreamedMediaChannel::streamDirectionChanged | ( | const Tp::MediaStreamPtr & | stream,
|  | Tp::MediaStreamDirection | direction,
|  | Tp::MediaStreamPendingSend | pendingSend |
| ) |  |  | `[signal]`

This signal is emitted when a media stream direction changes.

Parameters:

  | stream | The media stream which the direction changed.
  | direction | The new direction of the stream that changed.
  | pendingSend | the new pending send flags of the stream that changed.

void Tp::StreamedMediaChannel::streamStateChanged | ( | const Tp::MediaStreamPtr & | stream,
|  | Tp::MediaStreamState | state |
| ) |  |  | `[signal]`

This signal is emitted when a media stream state changes.

Parameters:

  | stream | The media stream which the state changed.
  | state | The new state of the stream that changed.

void Tp::StreamedMediaChannel::streamError | ( | const Tp::MediaStreamPtr & | stream,
|  | Tp::MediaStreamError | errorCode,
|  | const QString & | errorMessage |
| ) |  |  | `[signal]`

This signal is emitted when an error occurs on a media stream.

Parameters:

  | stream | The media stream which the error occurred.
  | errorCode | The error code.
  | errorMessage | The error message.

void Tp::StreamedMediaChannel::localHoldStateChanged | ( | Tp::LocalHoldState | state,
|  | Tp::LocalHoldStateReason | reason |
| ) |  |  | `[signal]`

This signal is emitted when the local hold state of this channel changes.

Parameters:

  | state | The new local hold state of this channel.
  | reason | The reason why the change occurred.

See also:
  localHoldState(), localHoldStateReason()

## Member Data Documentation

const Feature Tp::StreamedMediaChannel::FeatureContents`[static]`

Feature used in order to access media content specific methods.

See media content specific methods' documentation for more details.

const Feature Tp::StreamedMediaChannel::FeatureLocalHoldState`[static]`

Feature used in order to access local hold state info.

See local hold state specific methods' documentation for more details.

const Feature Tp::StreamedMediaChannel::FeatureStreams`[static]`

Feature used in order to access media stream specific methods.

See media stream specific methods' documentation for more details.