|
LiveKit C++ Client SDK v1.4.0
Real-time audio/video/data SDK for C++
|
Represents a data track published by a remote participant. More...
#include <remote_data_track.h>
Public Member Functions | |
| RemoteDataTrack (const RemoteDataTrack &)=delete | |
| RemoteDataTrack & | operator= (const RemoteDataTrack &)=delete |
| const DataTrackInfo & | info () const noexcept |
| Metadata about this data track. | |
| const std::string & | publisherIdentity () const noexcept |
| Identity of the remote participant who published this track. | |
| LIVEKIT_API bool | isPublished () const |
| Whether the track is still published by the remote participant. | |
| LIVEKIT_API void | setPipelineOptions (const DataTrackPipelineOptions &options) |
| Configures options for the pipeline handling incoming packets for this track. | |
| LIVEKIT_API Result< std::shared_ptr< DataTrackStream >, SubscribeDataTrackError > | subscribe (const DataTrackStream::Options &options={}) |
| Subscribe to this remote data track. | |
Friends | |
| class | Room |
Represents a data track published by a remote participant.
Discovered via the DataTrackPublishedEvent room event. Unlike audio/video tracks, remote data tracks require an explicit subscribe() call to begin receiving frames.
Typical usage:
// In RoomDelegate::onDataTrackPublished callback: auto sub_result = remoteDataTrack->subscribe(); if (sub_result) { auto sub = sub_result.value(); DataTrackFrame frame; while (sub->read(frame)) { // process frame } }
| LIVEKIT_API void livekit::RemoteDataTrack::setPipelineOptions | ( | const DataTrackPipelineOptions & | options | ) |
Configures options for the pipeline handling incoming packets for this track.
These options apply to all current and future subscriptions of this track, and may be set at any time. New options take effect with the next received packet.
| options | Pipeline options to apply to this remote data track. |
| LIVEKIT_API Result< std::shared_ptr< DataTrackStream >, SubscribeDataTrackError > livekit::RemoteDataTrack::subscribe | ( | const DataTrackStream::Options & | options = {} | ) |
Subscribe to this remote data track.
Returns a DataTrackStream that delivers frames via blocking read(). Destroy the stream to unsubscribe.