LiveKit C++ Client SDK v1.12.2
Real-time audio/video/data SDK for C++
Loading...
Searching...
No Matches
room_callbacks.h
1/*
2 * Copyright 2026 LiveKit
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include <cstdint>
20#include <functional>
21#include <optional>
22#include <vector>
23
24namespace livekit {
25
26class AudioFrame;
27class VideoFrame;
28struct VideoFrameEvent;
29
31using AudioFrameCallback = std::function<void(const AudioFrame&)>;
32
34using VideoFrameCallback = std::function<void(const VideoFrame& frame, std::int64_t timestamp_us)>;
35
37using VideoFrameEventCallback = std::function<void(const VideoFrameEvent&)>;
38
41 std::function<void(const std::vector<std::uint8_t>& payload, std::optional<std::uint64_t> user_timestamp)>;
42
44using DataFrameCallbackId = std::uint64_t;
45
46} // namespace livekit
Represents a raw PCM audio frame with interleaved int16 samples.
Definition audio_frame.h:37
Public SDK representation of a video frame.
Definition video_frame.h:48
Public API for the LiveKit C++ Client SDK.
Definition audio_frame.h:25
std::function< void(const VideoFrameEvent &)> VideoFrameEventCallback
Callback for incoming video frame events on a subscription reader thread.
Definition room_callbacks.h:37
std::uint64_t DataFrameCallbackId
Identifier for a data frame callback registration.
Definition room_callbacks.h:44
std::function< void(const std::vector< std::uint8_t > &payload, std::optional< std::uint64_t > user_timestamp)> DataFrameCallback
Callback for incoming data frames on a subscription reader thread.
Definition room_callbacks.h:41
std::function< void(const AudioFrame &)> AudioFrameCallback
Callback for incoming audio frames on a subscription reader thread.
Definition room_callbacks.h:31
std::function< void(const VideoFrame &frame, std::int64_t timestamp_us)> VideoFrameCallback
Callback for incoming video frames on a subscription reader thread.
Definition room_callbacks.h:34
A single video frame event delivered by VideoStream::read().
Definition video_stream.h:37