encoder_settings.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Copyright (c) 2014 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 TEST_ENCODER_SETTINGS_H_
  11. #define TEST_ENCODER_SETTINGS_H_
  12. #include <stddef.h>
  13. #include <string>
  14. #include <vector>
  15. #include "api/video_codecs/video_encoder_config.h"
  16. #include "call/video_receive_stream.h"
  17. #include "call/video_send_stream.h"
  18. namespace webrtc {
  19. namespace test {
  20. class DefaultVideoStreamFactory
  21. : public VideoEncoderConfig::VideoStreamFactoryInterface {
  22. public:
  23. DefaultVideoStreamFactory();
  24. static const size_t kMaxNumberOfStreams = 3;
  25. // Defined as {150000, 450000, 1500000};
  26. static const int kMaxBitratePerStream[];
  27. // Defined as {50000, 200000, 700000};
  28. static const int kDefaultMinBitratePerStream[];
  29. private:
  30. std::vector<VideoStream> CreateEncoderStreams(
  31. int width,
  32. int height,
  33. const VideoEncoderConfig& encoder_config) override;
  34. };
  35. // Creates |encoder_config.number_of_streams| VideoStreams where index
  36. // |encoder_config.number_of_streams -1| have width = |width|, height =
  37. // |height|. The total max bitrate of all VideoStreams is
  38. // |encoder_config.max_bitrate_bps|.
  39. std::vector<VideoStream> CreateVideoStreams(
  40. int width,
  41. int height,
  42. const webrtc::VideoEncoderConfig& encoder_config);
  43. void FillEncoderConfiguration(VideoCodecType codec_type,
  44. size_t num_streams,
  45. VideoEncoderConfig* configuration);
  46. VideoReceiveStream::Decoder CreateMatchingDecoder(
  47. int payload_type,
  48. const std::string& payload_name);
  49. VideoReceiveStream::Decoder CreateMatchingDecoder(
  50. const VideoSendStream::Config& config);
  51. } // namespace test
  52. } // namespace webrtc
  53. #endif // TEST_ENCODER_SETTINGS_H_