LiveKit C++ Client SDK v1.1.0
Real-time audio/video/data SDK for C++
Loading...
Searching...
No Matches
data_track_error.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 <string>
21
22#include "livekit/visibility.h"
23
24namespace livekit {
25
26namespace proto {
27class PublishDataTrackError;
28class LocalDataTrackTryPushError;
29class SubscribeDataTrackError;
30} // namespace proto
31
33enum class PublishDataTrackErrorCode : std::uint32_t {
34 UNKNOWN = 0,
35 INVALID_HANDLE = 1,
36 DUPLICATE_NAME = 2,
37 TIMEOUT = 3,
38 DISCONNECTED = 4,
39 NOT_ALLOWED = 5,
40 INVALID_NAME = 6,
41 LIMIT_REACHED = 7,
42 PROTOCOL_ERROR = 8,
43 INTERNAL = 9,
44};
45
48 PublishDataTrackErrorCode code{PublishDataTrackErrorCode::UNKNOWN};
49 std::string message;
50
51 LIVEKIT_API static PublishDataTrackError fromProto(const proto::PublishDataTrackError& error);
52};
53
55enum class LocalDataTrackTryPushErrorCode : std::uint32_t {
56 UNKNOWN = 0,
57 INVALID_HANDLE = 1,
58 TRACK_UNPUBLISHED = 2,
59 QUEUE_FULL = 3,
60 INTERNAL = 4,
61};
62
65 LocalDataTrackTryPushErrorCode code{LocalDataTrackTryPushErrorCode::UNKNOWN};
66 std::string message;
67
68 LIVEKIT_API static LocalDataTrackTryPushError fromProto(const proto::LocalDataTrackTryPushError& error);
69};
70
72enum class SubscribeDataTrackErrorCode : std::uint32_t {
73 UNKNOWN = 0,
74 INVALID_HANDLE = 1,
75 UNPUBLISHED = 2,
76 TIMEOUT = 3,
77 DISCONNECTED = 4,
78 PROTOCOL_ERROR = 5,
79 INTERNAL = 6,
80};
81
84 SubscribeDataTrackErrorCode code{SubscribeDataTrackErrorCode::UNKNOWN};
85 std::string message;
86
87 LIVEKIT_API static SubscribeDataTrackError fromProto(const proto::SubscribeDataTrackError& error);
88};
89
90} // namespace livekit
Public API for the LiveKit C++ Client SDK.
Definition audio_frame.h:25
PublishDataTrackErrorCode
Error code returned when publishing a local data track fails.
Definition data_track_error.h:33
SubscribeDataTrackErrorCode
Error code returned when subscribing to a remote data track fails.
Definition data_track_error.h:72
LocalDataTrackTryPushErrorCode
Error code returned when pushing a frame to a local data track fails.
Definition data_track_error.h:55
Error details returned when pushing a frame to a local data track fails.
Definition data_track_error.h:64
Error details returned when publishing a local data track fails.
Definition data_track_error.h:47
Error details returned when subscribing to a remote data track fails.
Definition data_track_error.h:83