fork/rust-sdks
git clone https://git.julia.blue/fork/rust-sdks
a1b926e
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 "api/video_codecs/video_encoder.h" 20#include "api/video_codecs/video_encoder_factory.h" 21 22namespace livekit { 23class VideoEncoderFactory :public webrtc ::VideoEncoderFactory { 24class InternalFactory :public webrtc ::VideoEncoderFactory { 25public : 26InternalFactory (); 27 28std ::vector < webrtc ::SdpVideoFormat > GetSupportedFormats ()const override ; 29 30CodecSupport QueryCodecSupport ( 31const webrtc ::SdpVideoFormat & format , 32absl ::optional < std ::string > scalability_mode )const override ; 33 34std ::unique_ptr < webrtc ::VideoEncoder > Create ( 35const webrtc ::Environment & env ,const webrtc ::SdpVideoFormat & format )override ; 36 37private : 38std ::vector < std ::unique_ptr < webrtc ::VideoEncoderFactory >>factories_ ; 39 }; 40 41public : 42VideoEncoderFactory (); 43 44std ::vector < webrtc ::SdpVideoFormat > GetSupportedFormats ()const override ; 45 46CodecSupport QueryCodecSupport ( 47const webrtc ::SdpVideoFormat & format , 48absl ::optional < std ::string > scalability_mode )const override ; 49 50std ::unique_ptr < webrtc ::VideoEncoder > Create ( 51const webrtc ::Environment & env ,const webrtc ::SdpVideoFormat & format )override ; 52 53private : 54std ::unique_ptr < InternalFactory > internal_factory_ ; 55}; 56}// namespace livekit