LiveKit C++ SDK
Real-time audio/video 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#ifndef LIVEKIT_DATA_TRACK_ERROR_H
18#define LIVEKIT_DATA_TRACK_ERROR_H
19
20#include <cstdint>
21#include <string>
22
23namespace livekit {
24
25namespace proto {
26class PublishDataTrackError;
27class LocalDataTrackTryPushError;
28class SubscribeDataTrackError;
29} // namespace proto
30
31enum class PublishDataTrackErrorCode : std::uint32_t {
32 UNKNOWN = 0,
33 INVALID_HANDLE = 1,
34 DUPLICATE_NAME = 2,
35 TIMEOUT = 3,
36 DISCONNECTED = 4,
37 NOT_ALLOWED = 5,
38 INVALID_NAME = 6,
39 LIMIT_REACHED = 7,
40 PROTOCOL_ERROR = 8,
41 INTERNAL = 9,
42};
43
45 PublishDataTrackErrorCode code{PublishDataTrackErrorCode::UNKNOWN};
46 std::string message;
47
49 fromProto(const proto::PublishDataTrackError &error);
50};
51
52enum class LocalDataTrackTryPushErrorCode : std::uint32_t {
53 UNKNOWN = 0,
54 INVALID_HANDLE = 1,
55 TRACK_UNPUBLISHED = 2,
56 QUEUE_FULL = 3,
57 INTERNAL = 4,
58};
59
61 LocalDataTrackTryPushErrorCode code{LocalDataTrackTryPushErrorCode::UNKNOWN};
62 std::string message;
63
65 fromProto(const proto::LocalDataTrackTryPushError &error);
66};
67
68enum class SubscribeDataTrackErrorCode : std::uint32_t {
69 UNKNOWN = 0,
70 INVALID_HANDLE = 1,
71 UNPUBLISHED = 2,
72 TIMEOUT = 3,
73 DISCONNECTED = 4,
74 PROTOCOL_ERROR = 5,
75 INTERNAL = 6,
76};
77
79 SubscribeDataTrackErrorCode code{SubscribeDataTrackErrorCode::UNKNOWN};
80 std::string message;
81
83 fromProto(const proto::SubscribeDataTrackError &error);
84};
85
86} // namespace livekit
87
88#endif // LIVEKIT_DATA_TRACK_ERROR_H
Definition data_track_error.h:60
Definition data_track_error.h:44
Definition data_track_error.h:78