fake_video_codec_factory.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. #ifndef MEDIA_ENGINE_FAKE_VIDEO_CODEC_FACTORY_H_
  11. #define MEDIA_ENGINE_FAKE_VIDEO_CODEC_FACTORY_H_
  12. #include <memory>
  13. #include <vector>
  14. #include "api/video_codecs/video_decoder_factory.h"
  15. #include "api/video_codecs/video_encoder_factory.h"
  16. #include "rtc_base/system/rtc_export.h"
  17. namespace webrtc {
  18. // Provides a fake video encoder instance that produces frames large enough for
  19. // the given bitrate constraints.
  20. class RTC_EXPORT FakeVideoEncoderFactory : public VideoEncoderFactory {
  21. public:
  22. FakeVideoEncoderFactory();
  23. static std::unique_ptr<VideoEncoder> CreateVideoEncoder();
  24. // VideoEncoderFactory implementation
  25. std::vector<SdpVideoFormat> GetSupportedFormats() const override;
  26. std::unique_ptr<VideoEncoder> CreateVideoEncoder(
  27. const SdpVideoFormat& format) override;
  28. };
  29. // Provides a fake video decoder instance that ignores the given bitstream and
  30. // produces frames.
  31. class RTC_EXPORT FakeVideoDecoderFactory : public VideoDecoderFactory {
  32. public:
  33. FakeVideoDecoderFactory();
  34. static std::unique_ptr<VideoDecoder> CreateVideoDecoder();
  35. // VideoDecoderFactory implementation
  36. std::vector<SdpVideoFormat> GetSupportedFormats() const override;
  37. std::unique_ptr<VideoDecoder> CreateVideoDecoder(
  38. const SdpVideoFormat& format) override;
  39. };
  40. } // namespace webrtc
  41. #endif // MEDIA_ENGINE_FAKE_VIDEO_CODEC_FACTORY_H_