LiveKit C++ Client SDK v1.4.0
Real-time audio/video/data SDK for C++
Loading...
Searching...
No Matches
livekit::RemoteDataTrack Class Reference

Represents a data track published by a remote participant. More...

#include <remote_data_track.h>

Public Member Functions

 RemoteDataTrack (const RemoteDataTrack &)=delete
 
RemoteDataTrackoperator= (const RemoteDataTrack &)=delete
 
const DataTrackInfoinfo () 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 >, SubscribeDataTrackErrorsubscribe (const DataTrackStream::Options &options={})
 Subscribe to this remote data track.
 

Friends

class Room
 

Detailed Description

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 } }

Member Function Documentation

◆ setPipelineOptions()

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.

Parameters
optionsPipeline options to apply to this remote data track.

◆ subscribe()

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.


The documentation for this class was generated from the following file: