simulcast.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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/transport/webrtc_key_value_config.h"
  15. #include "api/units/data_rate.h"
  16. #include "api/video_codecs/video_encoder_config.h"
  17. namespace cricket {
  18. // Gets the total maximum bitrate for the |streams|.
  19. webrtc::DataRate GetTotalMaxBitrate(
  20. const std::vector<webrtc::VideoStream>& streams);
  21. // Adds any bitrate of |max_bitrate| that is above the total maximum bitrate for
  22. // the |layers| to the highest quality layer.
  23. void BoostMaxSimulcastLayer(webrtc::DataRate max_bitrate,
  24. std::vector<webrtc::VideoStream>* layers);
  25. // Round size to nearest simulcast-friendly size
  26. int NormalizeSimulcastSize(int size, size_t simulcast_layers);
  27. // Gets simulcast settings.
  28. std::vector<webrtc::VideoStream> GetSimulcastConfig(
  29. size_t min_layers,
  30. size_t max_layers,
  31. int width,
  32. int height,
  33. double bitrate_priority,
  34. int max_qp,
  35. bool is_screenshare_with_conference_mode,
  36. bool temporal_layers_supported,
  37. const webrtc::WebRtcKeyValueConfig& trials);
  38. // Gets the simulcast config layers for a non-screensharing case.
  39. std::vector<webrtc::VideoStream> GetNormalSimulcastLayers(
  40. size_t max_layers,
  41. int width,
  42. int height,
  43. double bitrate_priority,
  44. int max_qp,
  45. bool temporal_layers_supported,
  46. bool base_heavy_tl3_rate_alloc,
  47. const webrtc::WebRtcKeyValueConfig& trials);
  48. // Gets simulcast config layers for screenshare settings.
  49. std::vector<webrtc::VideoStream> GetScreenshareLayers(
  50. size_t max_layers,
  51. int width,
  52. int height,
  53. double bitrate_priority,
  54. int max_qp,
  55. bool temporal_layers_supported,
  56. bool base_heavy_tl3_rate_alloc,
  57. const webrtc::WebRtcKeyValueConfig& trials);
  58. } // namespace cricket
  59. #endif // MEDIA_ENGINE_SIMULCAST_H_