rtx_receive_stream.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright (c) 2017 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_RTX_RECEIVE_STREAM_H_
  11. #define CALL_RTX_RECEIVE_STREAM_H_
  12. #include <cstdint>
  13. #include <map>
  14. #include "call/rtp_packet_sink_interface.h"
  15. namespace webrtc {
  16. class ReceiveStatistics;
  17. // This class is responsible for RTX decapsulation. The resulting media packets
  18. // are passed on to a sink representing the associated media stream.
  19. class RtxReceiveStream : public RtpPacketSinkInterface {
  20. public:
  21. RtxReceiveStream(RtpPacketSinkInterface* media_sink,
  22. std::map<int, int> associated_payload_types,
  23. uint32_t media_ssrc,
  24. // TODO(nisse): Delete this argument, and
  25. // corresponding member variable, by moving the
  26. // responsibility for rtcp feedback to
  27. // RtpStreamReceiverController.
  28. ReceiveStatistics* rtp_receive_statistics = nullptr);
  29. ~RtxReceiveStream() override;
  30. // RtpPacketSinkInterface.
  31. void OnRtpPacket(const RtpPacketReceived& packet) override;
  32. private:
  33. RtpPacketSinkInterface* const media_sink_;
  34. // Map from rtx payload type -> media payload type.
  35. const std::map<int, int> associated_payload_types_;
  36. // TODO(nisse): Ultimately, the media receive stream shouldn't care about the
  37. // ssrc, and we should delete this.
  38. const uint32_t media_ssrc_;
  39. ReceiveStatistics* const rtp_receive_statistics_;
  40. };
  41. } // namespace webrtc
  42. #endif // CALL_RTX_RECEIVE_STREAM_H_