blob: 418775c7780d3d349694e10b99063237d31e3d76 [file] [log] [blame]
nisseeed52bf2017-05-19 06:15:19 -07001/*
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
11#ifndef WEBRTC_CALL_RTX_RECEIVE_STREAM_H_
12#define WEBRTC_CALL_RTX_RECEIVE_STREAM_H_
13
14#include <map>
15
nissed76b7b22017-06-01 04:02:35 -070016#include "webrtc/call/rtp_packet_sink_interface.h"
nisseeed52bf2017-05-19 06:15:19 -070017
18namespace webrtc {
19
nisse38644992017-08-30 04:16:40 -070020// This class is responsible for RTX decapsulation. The resulting media packets
21// are passed on to a sink representing the associated media stream.
nisseeed52bf2017-05-19 06:15:19 -070022class RtxReceiveStream : public RtpPacketSinkInterface {
23 public:
24 RtxReceiveStream(RtpPacketSinkInterface* media_sink,
nisse38644992017-08-30 04:16:40 -070025 std::map<int, int> associated_payload_types,
nisse8e7eee02017-09-08 05:51:54 -070026 uint32_t media_ssrc);
nisse76e62b02017-05-31 02:24:52 -070027 ~RtxReceiveStream() override;
nisseeed52bf2017-05-19 06:15:19 -070028 // RtpPacketSinkInterface.
29 void OnRtpPacket(const RtpPacketReceived& packet) override;
30
31 private:
32 RtpPacketSinkInterface* const media_sink_;
nisse38644992017-08-30 04:16:40 -070033 // Map from rtx payload type -> media payload type.
34 const std::map<int, int> associated_payload_types_;
nisseeed52bf2017-05-19 06:15:19 -070035 // TODO(nisse): Ultimately, the media receive stream shouldn't care about the
36 // ssrc, and we should delete this.
37 const uint32_t media_ssrc_;
nisseeed52bf2017-05-19 06:15:19 -070038};
39
40} // namespace webrtc
41
42#endif // WEBRTC_CALL_RTX_RECEIVE_STREAM_H_