rtp_video_sender_interface.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 CALL_RTP_VIDEO_SENDER_INTERFACE_H_
  11. #define CALL_RTP_VIDEO_SENDER_INTERFACE_H_
  12. #include <map>
  13. #include <vector>
  14. #include "absl/types/optional.h"
  15. #include "api/array_view.h"
  16. #include "api/call/bitrate_allocation.h"
  17. #include "api/fec_controller_override.h"
  18. #include "call/rtp_config.h"
  19. #include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
  20. #include "modules/rtp_rtcp/source/rtp_sequence_number_map.h"
  21. #include "modules/utility/include/process_thread.h"
  22. #include "modules/video_coding/include/video_codec_interface.h"
  23. namespace webrtc {
  24. class VideoBitrateAllocation;
  25. struct FecProtectionParams;
  26. class RtpVideoSenderInterface : public EncodedImageCallback,
  27. public FecControllerOverride {
  28. public:
  29. virtual void RegisterProcessThread(ProcessThread* module_process_thread) = 0;
  30. virtual void DeRegisterProcessThread() = 0;
  31. // RtpVideoSender will only route packets if being active, all
  32. // packets will be dropped otherwise.
  33. virtual void SetActive(bool active) = 0;
  34. // Sets the sending status of the rtp modules and appropriately sets the
  35. // RtpVideoSender to active if any rtp modules are active.
  36. virtual void SetActiveModules(const std::vector<bool> active_modules) = 0;
  37. virtual bool IsActive() = 0;
  38. virtual void OnNetworkAvailability(bool network_available) = 0;
  39. virtual std::map<uint32_t, RtpState> GetRtpStates() const = 0;
  40. virtual std::map<uint32_t, RtpPayloadState> GetRtpPayloadStates() const = 0;
  41. virtual void DeliverRtcp(const uint8_t* packet, size_t length) = 0;
  42. virtual void OnBitrateAllocationUpdated(
  43. const VideoBitrateAllocation& bitrate) = 0;
  44. virtual void OnBitrateUpdated(BitrateAllocationUpdate update,
  45. int framerate) = 0;
  46. virtual void OnTransportOverheadChanged(
  47. size_t transport_overhead_bytes_per_packet) = 0;
  48. virtual uint32_t GetPayloadBitrateBps() const = 0;
  49. virtual uint32_t GetProtectionBitrateBps() const = 0;
  50. virtual void SetEncodingData(size_t width,
  51. size_t height,
  52. size_t num_temporal_layers) = 0;
  53. virtual std::vector<RtpSequenceNumberMap::Info> GetSentRtpPacketInfos(
  54. uint32_t ssrc,
  55. rtc::ArrayView<const uint16_t> sequence_numbers) const = 0;
  56. // Implements FecControllerOverride.
  57. void SetFecAllowed(bool fec_allowed) override = 0;
  58. };
  59. } // namespace webrtc
  60. #endif // CALL_RTP_VIDEO_SENDER_INTERFACE_H_