Emircan Uysaler | 0a37547 | 2017-12-11 12:21:02 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
Emircan Uysaler | d7ae3c3 | 2018-01-25 13:01:09 -0800 | [diff] [blame] | 11 | #ifndef MEDIA_ENGINE_MULTIPLEXCODECFACTORY_H_ |
| 12 | #define MEDIA_ENGINE_MULTIPLEXCODECFACTORY_H_ |
Emircan Uysaler | 0a37547 | 2017-12-11 12:21:02 +0530 | [diff] [blame] | 13 | |
| 14 | #include <memory> |
| 15 | #include <vector> |
| 16 | |
| 17 | #include "api/video_codecs/video_decoder_factory.h" |
| 18 | #include "api/video_codecs/video_encoder_factory.h" |
| 19 | |
| 20 | namespace webrtc { |
| 21 | |
Emircan Uysaler | d7ae3c3 | 2018-01-25 13:01:09 -0800 | [diff] [blame] | 22 | class MultiplexEncoderFactory : public VideoEncoderFactory { |
Emircan Uysaler | 0a37547 | 2017-12-11 12:21:02 +0530 | [diff] [blame] | 23 | public: |
Emircan Uysaler | d7ae3c3 | 2018-01-25 13:01:09 -0800 | [diff] [blame] | 24 | explicit MultiplexEncoderFactory( |
| 25 | std::unique_ptr<VideoEncoderFactory> factory); |
Emircan Uysaler | 0a37547 | 2017-12-11 12:21:02 +0530 | [diff] [blame] | 26 | |
| 27 | std::vector<SdpVideoFormat> GetSupportedFormats() const override; |
| 28 | CodecInfo QueryVideoEncoder(const SdpVideoFormat& format) const override; |
| 29 | std::unique_ptr<VideoEncoder> CreateVideoEncoder( |
| 30 | const SdpVideoFormat& format) override; |
| 31 | |
| 32 | private: |
| 33 | std::unique_ptr<VideoEncoderFactory> factory_; |
| 34 | }; |
| 35 | |
Emircan Uysaler | d7ae3c3 | 2018-01-25 13:01:09 -0800 | [diff] [blame] | 36 | class MultiplexDecoderFactory : public VideoDecoderFactory { |
Emircan Uysaler | 0a37547 | 2017-12-11 12:21:02 +0530 | [diff] [blame] | 37 | public: |
Emircan Uysaler | d7ae3c3 | 2018-01-25 13:01:09 -0800 | [diff] [blame] | 38 | explicit MultiplexDecoderFactory( |
| 39 | std::unique_ptr<VideoDecoderFactory> factory); |
Emircan Uysaler | 0a37547 | 2017-12-11 12:21:02 +0530 | [diff] [blame] | 40 | |
| 41 | std::vector<SdpVideoFormat> GetSupportedFormats() const override; |
| 42 | std::unique_ptr<VideoDecoder> CreateVideoDecoder( |
| 43 | const SdpVideoFormat& format) override; |
| 44 | |
| 45 | private: |
| 46 | std::unique_ptr<VideoDecoderFactory> factory_; |
| 47 | }; |
| 48 | |
| 49 | } // namespace webrtc |
| 50 | |
Emircan Uysaler | d7ae3c3 | 2018-01-25 13:01:09 -0800 | [diff] [blame] | 51 | #endif // MEDIA_ENGINE_MULTIPLEXCODECFACTORY_H_ |