fork/rust-sdks
git clone https://git.julia.blue/fork/rust-sdks
55bda13
main
1/* 2* Copyright 2023 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 <memory> 20 21#include "api/media_stream_interface.h" 22#include "livekit/helper.h" 23#include "livekit/webrtc.h" 24#include "rust/cxx.h" 25 26namespace livekit { 27class MediaStream ; 28}// namespace livekit 29#include "webrtc-sys/src/media_stream.rs.h" 30 31namespace livekit { 32 33class MediaStream { 34public : 35MediaStream (std ::shared_ptr < RtcRuntime > rtc_runtime , 36rtc ::scoped_refptr < webrtc ::MediaStreamInterface > stream ); 37 38rust ::String id ()const ; 39rust ::Vec < VideoTrackPtr > get_video_tracks ()const ; 40rust ::Vec < AudioTrackPtr > get_audio_tracks ()const ; 41 42std ::shared_ptr < AudioTrack > find_audio_track (rust ::String track_id )const ; 43std ::shared_ptr < VideoTrack > find_video_track (rust ::String track_id )const ; 44 45bool add_track (std ::shared_ptr < MediaStreamTrack > track )const ; 46bool remove_track (std ::shared_ptr < MediaStreamTrack > track )const ; 47 48private : 49std ::shared_ptr < RtcRuntime > rtc_runtime_ ; 50rtc ::scoped_refptr < webrtc ::MediaStreamInterface > media_stream_ ; 51}; 52 53static std ::shared_ptr < MediaStream > _shared_media_stream () { 54return nullptr ;// Ignore 55} 56 57}// namespace livekit