1 /*
2  *  Copyright (c) 2018 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 
11 #ifndef MEDIA_ENGINE_FAKE_VIDEO_CODEC_FACTORY_H_
12 #define MEDIA_ENGINE_FAKE_VIDEO_CODEC_FACTORY_H_
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 #include "rtc_base/system/rtc_export.h"
20 
21 namespace webrtc {
22 
23 // Provides a fake video encoder instance that produces frames large enough for
24 // the given bitrate constraints.
25 class RTC_EXPORT FakeVideoEncoderFactory : public VideoEncoderFactory {
26  public:
27   FakeVideoEncoderFactory();
28 
29   static std::unique_ptr<VideoEncoder> CreateVideoEncoder();
30 
31   // VideoEncoderFactory implementation
32   std::vector<SdpVideoFormat> GetSupportedFormats() const override;
33   VideoEncoderFactory::CodecInfo QueryVideoEncoder(
34       const SdpVideoFormat& format) const override;
35   std::unique_ptr<VideoEncoder> CreateVideoEncoder(
36       const SdpVideoFormat& format) override;
37 };
38 
39 // Provides a fake video decoder instance that ignores the given bitstream and
40 // produces frames.
41 class RTC_EXPORT FakeVideoDecoderFactory : public VideoDecoderFactory {
42  public:
43   FakeVideoDecoderFactory();
44 
45   static std::unique_ptr<VideoDecoder> CreateVideoDecoder();
46 
47   // VideoDecoderFactory implementation
48   std::vector<SdpVideoFormat> GetSupportedFormats() const override;
49   std::unique_ptr<VideoDecoder> CreateVideoDecoder(
50       const SdpVideoFormat& format) override;
51 };
52 
53 }  // namespace webrtc
54 
55 #endif  // MEDIA_ENGINE_FAKE_VIDEO_CODEC_FACTORY_H_
56