You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.9 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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 MEDIA_ENGINE_SIMULCAST_H_
  11. #define MEDIA_ENGINE_SIMULCAST_H_
  12. #include <stddef.h>
  13. #include <vector>
  14. #include "api/video_codecs/video_encoder_config.h"
  15. namespace cricket {
  16. // Gets the total maximum bitrate for the |streams|.
  17. int GetTotalMaxBitrateBps(const std::vector<webrtc::VideoStream>& streams);
  18. // Adds any bitrate of |max_bitrate_bps| that is above the total maximum bitrate
  19. // for the |layers| to the highest quality layer.
  20. void BoostMaxSimulcastLayer(int max_bitrate_bps,
  21. std::vector<webrtc::VideoStream>* layers);
  22. // Round size to nearest simulcast-friendly size
  23. int NormalizeSimulcastSize(int size, size_t simulcast_layers);
  24. // Gets simulcast settings.
  25. std::vector<webrtc::VideoStream> GetSimulcastConfig(
  26. size_t max_layers,
  27. int width,
  28. int height,
  29. double bitrate_priority,
  30. int max_qp,
  31. bool is_screenshare_with_conference_mode,
  32. bool temporal_layers_supported = true);
  33. // Gets the simulcast config layers for a non-screensharing case.
  34. std::vector<webrtc::VideoStream> GetNormalSimulcastLayers(
  35. size_t max_layers,
  36. int width,
  37. int height,
  38. double bitrate_priority,
  39. int max_qp,
  40. bool temporal_layers_supported = true);
  41. // Gets simulcast config layers for screenshare settings.
  42. std::vector<webrtc::VideoStream> GetScreenshareLayers(
  43. size_t max_layers,
  44. int width,
  45. int height,
  46. double bitrate_priority,
  47. int max_qp,
  48. bool temporal_layers_supported = true);
  49. } // namespace cricket
  50. #endif // MEDIA_ENGINE_SIMULCAST_H_