simulcast.h 2.0 KB

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