24#include "livekit/visibility.h"
29enum class VideoBufferType { RGBA = 0, ABGR, ARGB, BGRA, RGB24, I420, I420A, I422, I444, I010, NV12 };
39class OwnedVideoBuffer;
64 int width() const noexcept {
return width_; }
65 int height() const noexcept {
return height_; }
66 VideoBufferType type() const noexcept {
return type_; }
68 std::uint8_t* data() noexcept {
return data_.data(); }
69 const std::uint8_t* data() const noexcept {
return data_.data(); }
70 std::size_t dataSize() const noexcept {
return data_.size(); }
107 static VideoFrame fromOwnedInfo(
const proto::OwnedVideoBuffer& owned);
113 std::vector<std::uint8_t> data_;
Public SDK representation of a video frame.
Definition video_frame.h:48
VideoFrame convert(VideoBufferType dst, bool flip_y=false) const
Convert this frame into another pixel format.
static VideoFrame create(int width, int height, VideoBufferType type)
Allocate a new frame with the correct buffer size for the given format.
std::vector< VideoPlaneInfo > planeInfos() const
Compute plane layout for this frame (Y/U/V, UV, etc.), in terms of pointers & sizes relative to this ...
Represents a pull-based stream of decoded video frames coming from a remote (or local) LiveKit track.
Definition video_stream.h:66
Public API for the LiveKit C++ Client SDK.
Definition audio_frame.h:25
VideoBufferType
Mirror of WebRTC video buffer type.
Definition video_frame.h:29
Plane layout metadata for a VideoFrame buffer.
Definition video_frame.h:32
std::uintptr_t data_ptr
pointer to plane data (for FFI)
Definition video_frame.h:33
std::uint32_t stride
bytes per row
Definition video_frame.h:34
std::uint32_t size
plane size in bytes
Definition video_frame.h:35