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

Represents a real-time video source that can accept frames from the application and feed them into the LiveKit core. More...

#include <video_source.h>

Public Member Functions

 VideoSource (int width, int height)
 Create a new native video source with a fixed resolution.
 
 VideoSource (const VideoSource &)=delete
 
VideoSourceoperator= (const VideoSource &)=delete
 
 VideoSource (VideoSource &&) noexcept=default
 
VideoSourceoperator= (VideoSource &&) noexcept=default
 
int width () const noexcept
 Source resolution as declared at construction.
 
int height () const noexcept
 
std::uint64_t ffiHandleId () const noexcept
 Underlying FFI handle ID (0 if invalid).
 
void captureFrame (const VideoFrame &frame, const VideoCaptureOptions &options)
 Push a VideoFrame into the FFI video source.
 
void captureFrame (const VideoFrame &frame, std::int64_t timestamp_us=0, VideoRotation rotation=VideoRotation::VIDEO_ROTATION_0)
 Backward-compatible convenience overload for timestamp + rotation only.
 

Detailed Description

Represents a real-time video source that can accept frames from the application and feed them into the LiveKit core.

Constructor & Destructor Documentation

◆ VideoSource()

livekit::VideoSource::VideoSource ( int  width,
int  height 
)

Create a new native video source with a fixed resolution.

Parameters
widthWidth in pixels.
heightHeight in pixels.
Exceptions
std::runtime_errorif the FFI call fails or the response does not contain the expected new_video_source field.

Member Function Documentation

◆ captureFrame()

void livekit::VideoSource::captureFrame ( const VideoFrame frame,
const VideoCaptureOptions options 
)

Push a VideoFrame into the FFI video source.

Parameters
frameVideo frame to send.
optionsTimestamp, rotation, and optional metadata for this frame.

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