LiveKit C++ Client SDK v1.9.0
Real-time audio/video/data SDK for C++
Loading...
Searching...
No Matches
remote_track_publication.h
1/*
2 * Copyright 2025 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
21#include "livekit/track.h"
22#include "livekit/track_publication.h"
23#include "livekit/visibility.h"
24
25namespace livekit {
26
27namespace proto {
28class OwnedTrackPublication;
29}
30
32class LIVEKIT_API RemoteTrackPublication : public TrackPublication {
33public:
36 explicit RemoteTrackPublication(const proto::OwnedTrackPublication& owned);
37
41 bool subscribed() const noexcept { return subscribed_; }
42
48 void setSubscribed(const bool subscribed);
49
53 bool enabled() const noexcept { return enabled_; }
54
65 bool setEnabled(const bool enabled);
66
71 VideoQuality videoQuality() const noexcept { return video_quality_; }
72
82 bool setVideoQuality(const VideoQuality quality);
83
96 bool setVideoDimensions(const std::uint32_t width, const std::uint32_t height);
97
98private:
99 enum class VideoPreference {
100 DEFAULT,
101 DIMENSIONS,
102 QUALITY,
103 };
104
105 bool subscribed_{false};
106 bool enabled_{true};
107 VideoPreference video_preference_{VideoPreference::DEFAULT};
108 VideoQuality video_quality_{VideoQuality::HIGH};
109 std::uint32_t requested_width_{0};
110 std::uint32_t requested_height_{0};
111};
112
113} // namespace livekit
A track published by a remote participant.
Definition remote_track_publication.h:32
bool setEnabled(const bool enabled)
Enables or disables media delivery for this publication.
void setSubscribed(const bool subscribed)
Changes the desired subscription state for this publication.
RemoteTrackPublication(const proto::OwnedTrackPublication &owned)
Note, this RemoteTrackPublication is constructed internally only; safe to accept proto::OwnedTrackPub...
bool setVideoQuality(const VideoQuality quality)
Requests the maximum simulcast quality to receive.
bool setVideoDimensions(const std::uint32_t width, const std::uint32_t height)
Requests the maximum video dimensions to receive for this publication.
bool enabled() const noexcept
Returns whether media delivery is enabled for this publication.
Definition remote_track_publication.h:53
bool subscribed() const noexcept
Returns the locally recorded subscription state.
Definition remote_track_publication.h:41
VideoQuality videoQuality() const noexcept
Returns the requested maximum simulcast quality.
Definition remote_track_publication.h:71
Base class for a track that has been published to a room.
Definition track_publication.h:39
Public API for the LiveKit C++ Client SDK.
Definition audio_frame.h:25
VideoQuality
Maximum receive quality requested for a remote video track.
Definition track.h:58