|
LiveKit C++ SDK
Real-time audio/video SDK for C++
|
#include <video_frame.h>
Public Member Functions | |
| VideoFrame (int width, int height, VideoBufferType type, std::vector< std::uint8_t > data) | |
| VideoFrame (const VideoFrame &)=delete | |
| VideoFrame & | operator= (const VideoFrame &)=delete |
| VideoFrame (VideoFrame &&) noexcept=default | |
| VideoFrame & | operator= (VideoFrame &&) noexcept=default |
| int | width () const noexcept |
| int | height () const noexcept |
| VideoBufferType | type () const noexcept |
| std::uint8_t * | data () noexcept |
| const std::uint8_t * | data () const noexcept |
| std::size_t | dataSize () const noexcept |
| std::vector< VideoPlaneInfo > | planeInfos () const |
| VideoFrame | convert (VideoBufferType dst, bool flip_y=false) const |
Static Public Member Functions | |
| static VideoFrame | create (int width, int height, VideoBufferType type) |
Static Protected Member Functions | |
| static VideoFrame | fromOwnedInfo (const proto::OwnedVideoBuffer &owned) |
Friends | |
| class | VideoStream |
Public SDK representation of a video frame.
| VideoFrame livekit::VideoFrame::convert | ( | VideoBufferType | dst, |
| bool | flip_y = false |
||
| ) | const |
Convert this frame into another pixel format.
This uses the underlying FFI video_convert pipeline to transform the current frame into a new VideoFrame with the requested dst buffer type (e.g. ARGB → I420, BGRA → RGB24, etc.).
| dst | Desired output format (see VideoBufferType). |
| flip_y | If true, the converted frame will be vertically flipped. |
Notes:
Typical usage: VideoFrame i420 = frame.convert(VideoBufferType::I420);
|
static |
Allocate a new frame with the correct buffer size for the given format. Data is zero-initialized.
| std::vector< VideoPlaneInfo > livekit::VideoFrame::planeInfos | ( | ) | const |
Compute plane layout for this frame (Y/U/V, UV, etc.), in terms of pointers & sizes relative to this frame's backing buffer.
For packed formats (ARGB, RGB24) this will be either 1 plane or empty.