fork/rust-sdks
git clone https://git.julia.blue/fork/rust-sdks
a5ba08e
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/peer_connection_interface.h" 22#include "api/rtp_parameters.h" 23#include "api/rtp_transceiver_direction.h" 24#include "api/rtp_transceiver_interface.h" 25#include "api/scoped_refptr.h" 26#include "livekit/rtc_error.h" 27#include "livekit/rtp_parameters.h" 28#include "livekit/rtp_receiver.h" 29#include "livekit/rtp_sender.h" 30#include "rust/cxx.h" 31 32namespace livekit { 33class RtpTransceiver ; 34} 35#include "webrtc-sys/src/rtp_transceiver.rs.h" 36 37namespace livekit { 38 39webrtc ::RtpTransceiverInit to_native_rtp_transceiver_init ( 40RtpTransceiverInit init ); 41 42class RtpTransceiver { 43public : 44RtpTransceiver ( 45std ::shared_ptr < RtcRuntime > rtc_runtime , 46rtc ::scoped_refptr < webrtc ::RtpTransceiverInterface > transceiver , 47rtc ::scoped_refptr < webrtc ::PeerConnectionInterface > peer_connection ); 48 49MediaType media_type ()const ; 50 51rust ::String mid ()const ; 52 53std ::shared_ptr < RtpSender > sender ()const ; 54 55std ::shared_ptr < RtpReceiver > receiver ()const ; 56 57bool stopped ()const ; 58 59bool stopping ()const ; 60 61RtpTransceiverDirection direction ()const ; 62 63void set_direction (RtpTransceiverDirection direction )const ; 64 65RtpTransceiverDirection current_direction ()const ; 66 67RtpTransceiverDirection fired_direction ()const ; 68 69void stop_standard ()const ; 70 71void set_codec_preferences (rust ::Vec < RtpCodecCapability > codecs )const ; 72 73rust ::Vec < RtpCodecCapability > codec_preferences ()const ; 74 75rust ::Vec < RtpHeaderExtensionCapability > header_extensions_to_negotiate () 76const ; 77 78rust ::Vec < RtpHeaderExtensionCapability > negotiated_header_extensions ()const ; 79 80void set_header_extensions_to_negotiate ( 81rust ::Vec < RtpHeaderExtensionCapability > header_extensions_to_offer )const ; 82 83private : 84std ::shared_ptr < RtcRuntime > rtc_runtime_ ; 85rtc ::scoped_refptr < webrtc ::RtpTransceiverInterface > transceiver_ ; 86rtc ::scoped_refptr < webrtc ::PeerConnectionInterface > peer_connection_ ; 87}; 88 89static std ::shared_ptr < RtpTransceiver > _shared_rtp_transceiver () { 90return nullptr ; 91} 92 93}// namespace livekit