nisse | eed52bf | 2017-05-19 06:15:19 -0700 | [diff] [blame] | 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 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #ifndef CALL_RTX_RECEIVE_STREAM_H_ |
| 12 | #define CALL_RTX_RECEIVE_STREAM_H_ |
nisse | eed52bf | 2017-05-19 06:15:19 -0700 | [diff] [blame] | 13 | |
Stephan Hartmann | 03fade5 | 2020-05-02 12:17:05 +0000 | [diff] [blame] | 14 | #include <cstdint> |
nisse | eed52bf | 2017-05-19 06:15:19 -0700 | [diff] [blame] | 15 | #include <map> |
| 16 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 17 | #include "call/rtp_packet_sink_interface.h" |
nisse | eed52bf | 2017-05-19 06:15:19 -0700 | [diff] [blame] | 18 | |
| 19 | namespace webrtc { |
| 20 | |
nisse | ca5706d | 2017-09-11 02:32:16 -0700 | [diff] [blame] | 21 | class ReceiveStatistics; |
| 22 | |
nisse | 3864499 | 2017-08-30 04:16:40 -0700 | [diff] [blame] | 23 | // This class is responsible for RTX decapsulation. The resulting media packets |
| 24 | // are passed on to a sink representing the associated media stream. |
nisse | eed52bf | 2017-05-19 06:15:19 -0700 | [diff] [blame] | 25 | class RtxReceiveStream : public RtpPacketSinkInterface { |
| 26 | public: |
| 27 | RtxReceiveStream(RtpPacketSinkInterface* media_sink, |
nisse | 3864499 | 2017-08-30 04:16:40 -0700 | [diff] [blame] | 28 | std::map<int, int> associated_payload_types, |
nisse | ca5706d | 2017-09-11 02:32:16 -0700 | [diff] [blame] | 29 | uint32_t media_ssrc, |
| 30 | // TODO(nisse): Delete this argument, and |
| 31 | // corresponding member variable, by moving the |
| 32 | // responsibility for rtcp feedback to |
| 33 | // RtpStreamReceiverController. |
| 34 | ReceiveStatistics* rtp_receive_statistics = nullptr); |
nisse | 76e62b0 | 2017-05-31 02:24:52 -0700 | [diff] [blame] | 35 | ~RtxReceiveStream() override; |
nisse | eed52bf | 2017-05-19 06:15:19 -0700 | [diff] [blame] | 36 | // RtpPacketSinkInterface. |
| 37 | void OnRtpPacket(const RtpPacketReceived& packet) override; |
| 38 | |
| 39 | private: |
| 40 | RtpPacketSinkInterface* const media_sink_; |
nisse | 3864499 | 2017-08-30 04:16:40 -0700 | [diff] [blame] | 41 | // Map from rtx payload type -> media payload type. |
| 42 | const std::map<int, int> associated_payload_types_; |
nisse | eed52bf | 2017-05-19 06:15:19 -0700 | [diff] [blame] | 43 | // TODO(nisse): Ultimately, the media receive stream shouldn't care about the |
| 44 | // ssrc, and we should delete this. |
| 45 | const uint32_t media_ssrc_; |
nisse | ca5706d | 2017-09-11 02:32:16 -0700 | [diff] [blame] | 46 | ReceiveStatistics* const rtp_receive_statistics_; |
nisse | eed52bf | 2017-05-19 06:15:19 -0700 | [diff] [blame] | 47 | }; |
| 48 | |
| 49 | } // namespace webrtc |
| 50 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 51 | #endif // CALL_RTX_RECEIVE_STREAM_H_ |