LiveKit C++ SDK
Real-time audio/video SDK for C++
Loading...
Searching...
No Matches
local_video_track.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 "local_track_publication.h"
20#include "track.h"
21
22#include <memory>
23#include <string>
24
25namespace livekit {
26
27namespace proto {
28class OwnedTrack;
29}
30
31class VideoSource;
32
54class LocalVideoTrack : public Track {
55public:
65 static std::shared_ptr<LocalVideoTrack>
66 createLocalVideoTrack(const std::string &name,
67 const std::shared_ptr<VideoSource> &source);
68
73 void mute();
74
76 void unmute();
77
80 std::string to_string() const;
81
84 std::shared_ptr<LocalTrackPublication> publication() const noexcept {
85 return local_publication_;
86 }
87
89 void setPublication(const std::shared_ptr<LocalTrackPublication>
90 &publication) noexcept override {
91 local_publication_ = std::move(publication);
92 }
93
94private:
95 explicit LocalVideoTrack(FfiHandle handle, const proto::OwnedTrack &track);
96
99 std::shared_ptr<LocalTrackPublication> local_publication_;
100};
101
102} // namespace livekit
RAII wrapper for an FFI handle (uintptr_t) coming from Rust.
Definition ffi_handle.h:29
Definition local_video_track.h:54
std::shared_ptr< LocalTrackPublication > publication() const noexcept
Definition local_video_track.h:84
void unmute()
Unmutes the video track and resumes sending video to the room.
void setPublication(const std::shared_ptr< LocalTrackPublication > &publication) noexcept override
Sets the publication that owns this track.
Definition local_video_track.h:89
static std::shared_ptr< LocalVideoTrack > createLocalVideoTrack(const std::string &name, const std::shared_ptr< VideoSource > &source)
std::string to_string() const
Definition track.h:73