fake_video_codec_factory.h (1982B)
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/environment/environment.h" 18 #include "api/video_codecs/sdp_video_format.h" 19 #include "api/video_codecs/video_decoder.h" 20 #include "api/video_codecs/video_decoder_factory.h" 21 #include "api/video_codecs/video_encoder.h" 22 #include "api/video_codecs/video_encoder_factory.h" 23 #include "rtc_base/system/rtc_export.h" 24 25 namespace webrtc { 26 27 // Provides a fake video encoder instance that produces frames large enough for 28 // the given bitrate constraints. 29 class RTC_EXPORT FakeVideoEncoderFactory : public VideoEncoderFactory { 30 public: 31 FakeVideoEncoderFactory() = default; 32 33 // VideoEncoderFactory implementation 34 std::vector<SdpVideoFormat> GetSupportedFormats() const override; 35 std::unique_ptr<VideoEncoder> Create(const Environment& env, 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> Create(const Environment& env, 50 const SdpVideoFormat& format) override; 51 }; 52 53 } // namespace webrtc 54 55 #endif // MEDIA_ENGINE_FAKE_VIDEO_CODEC_FACTORY_H_