blob: 8ffa4400a9c9e762378f03055c741f146567afd8 [file] [log] [blame]
nisseeed52bf2017-05-19 13:15:191/*
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 Bonadei92ea95e2017-09-15 04:47:3111#ifndef CALL_RTX_RECEIVE_STREAM_H_
12#define CALL_RTX_RECEIVE_STREAM_H_
nisseeed52bf2017-05-19 13:15:1913
14#include <map>
15
Mirko Bonadei92ea95e2017-09-15 04:47:3116#include "call/rtp_packet_sink_interface.h"
nisseeed52bf2017-05-19 13:15:1917
18namespace webrtc {
19
nisseca5706d2017-09-11 09:32:1620class ReceiveStatistics;
21
nisse38644992017-08-30 11:16:4022// This class is responsible for RTX decapsulation. The resulting media packets
23// are passed on to a sink representing the associated media stream.
nisseeed52bf2017-05-19 13:15:1924class RtxReceiveStream : public RtpPacketSinkInterface {
25 public:
26 RtxReceiveStream(RtpPacketSinkInterface* media_sink,
nisse38644992017-08-30 11:16:4027 std::map<int, int> associated_payload_types,
nisseca5706d2017-09-11 09:32:1628 uint32_t media_ssrc,
29 // TODO(nisse): Delete this argument, and
30 // corresponding member variable, by moving the
31 // responsibility for rtcp feedback to
32 // RtpStreamReceiverController.
33 ReceiveStatistics* rtp_receive_statistics = nullptr);
nisse76e62b02017-05-31 09:24:5234 ~RtxReceiveStream() override;
nisseeed52bf2017-05-19 13:15:1935 // RtpPacketSinkInterface.
36 void OnRtpPacket(const RtpPacketReceived& packet) override;
37
38 private:
39 RtpPacketSinkInterface* const media_sink_;
nisse38644992017-08-30 11:16:4040 // Map from rtx payload type -> media payload type.
41 const std::map<int, int> associated_payload_types_;
nisseeed52bf2017-05-19 13:15:1942 // TODO(nisse): Ultimately, the media receive stream shouldn't care about the
43 // ssrc, and we should delete this.
44 const uint32_t media_ssrc_;
nisseca5706d2017-09-11 09:32:1645 ReceiveStatistics* const rtp_receive_statistics_;
nisseeed52bf2017-05-19 13:15:1946};
47
48} // namespace webrtc
49
Mirko Bonadei92ea95e2017-09-15 04:47:3150#endif // CALL_RTX_RECEIVE_STREAM_H_