fork/rust-sdks

git clone https://git.julia.blue/fork/rust-sdks

aoife cassidychore(webrtc-sys): bump to m125_release (#505)a1b926e

main
1.8 KiB56 linesraw
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 {
24  class InternalFactory : public webrtc::VideoEncoderFactory {
25   public:
26    InternalFactory();
27
28    std::vector<webrtc::SdpVideoFormat> GetSupportedFormats() const override;
29
30    CodecSupport QueryCodecSupport(
31        const webrtc::SdpVideoFormat& format,
32        absl::optional<std::string> scalability_mode) const override;
33
34    std::unique_ptr<webrtc::VideoEncoder> Create(
35        const webrtc::Environment& env, const webrtc::SdpVideoFormat& format) override;
36
37   private:
38    std::vector<std::unique_ptr<webrtc::VideoEncoderFactory>> factories_;
39  };
40
41 public:
42  VideoEncoderFactory();
43
44  std::vector<webrtc::SdpVideoFormat> GetSupportedFormats() const override;
45
46  CodecSupport QueryCodecSupport(
47      const webrtc::SdpVideoFormat& format,
48      absl::optional<std::string> scalability_mode) const override;
49
50  std::unique_ptr<webrtc::VideoEncoder> Create(
51      const webrtc::Environment& env, const webrtc::SdpVideoFormat& format) override;
52
53 private:
54  std::unique_ptr<InternalFactory> internal_factory_;
55};
56}  // namespace livekit