|
LiveKit C++ SDK
Real-time audio/video SDK for C++
|
#include <data_track_stream.h>
Classes | |
| struct | Options |
Public Member Functions | |
| DataTrackStream (const DataTrackStream &)=delete | |
| DataTrackStream & | operator= (const DataTrackStream &)=delete |
| DataTrackStream (DataTrackStream &&) noexcept=delete | |
| DataTrackStream & | operator= (DataTrackStream &&) noexcept=delete |
| bool | read (DataTrackFrame &out) |
| void | close () |
Friends | |
| class | RemoteDataTrack |
Represents a pull-based stream of frames from a remote data track.
Provides a blocking read() interface similar to AudioStream / VideoStream. Frames are delivered via FfiEvent callbacks and stored internally.
Destroying the stream automatically unsubscribes from the remote track by releasing the underlying FFI handle.
Typical usage:
auto sub_result = remoteDataTrack->subscribe(); if (sub_result) { auto sub = sub_result.value(); DataTrackFrame frame; while (sub->read(frame)) { // process frame.payload } }
| void livekit::DataTrackStream::close | ( | ) |
End the stream early.
Releases the FFI handle (which unsubscribes from the remote track), unregisters the event listener, and wakes any blocking read().
| bool livekit::DataTrackStream::read | ( | DataTrackFrame & | out | ) |
Blocking read: waits until a DataTrackFrame is available, or the stream reaches EOS / is closed.
| out | On success, filled with the next data frame. |