blob: c5ac0f9fb6e0506609a7845272c77b5d783ec04a [file] [log] [blame]
brandtr76648da2016-10-20 11:54:481/*
2 * Copyright (c) 2016 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_FLEXFEC_RECEIVE_STREAM_H_
12#define CALL_FLEXFEC_RECEIVE_STREAM_H_
brandtr76648da2016-10-20 11:54:4813
pbosc7c26a02017-01-02 16:42:3214#include <stdint.h>
Jonas Olssona4d87372019-07-05 17:08:3315
brandtr76648da2016-10-20 11:54:4816#include <string>
brandtr7250b392016-12-19 09:13:4617#include <vector>
brandtr76648da2016-10-20 11:54:4818
Mirko Bonadei92ea95e2017-09-15 04:47:3119#include "api/call/transport.h"
Yves Gerey665174f2018-06-19 13:03:0520#include "api/rtp_headers.h"
Steve Anton10542f22019-01-11 17:11:0021#include "api/rtp_parameters.h"
Tommi1c1f5402021-06-14 08:54:2022#include "call/receive_stream.h"
Mirko Bonadei92ea95e2017-09-15 04:47:3123#include "call/rtp_packet_sink_interface.h"
Philipp Hancke17e8a5c2023-06-21 11:53:4124#include "modules/rtp_rtcp/include/receive_statistics.h"
brandtr76648da2016-10-20 11:54:4825
26namespace webrtc {
27
Tommi1c1f5402021-06-14 08:54:2028class FlexfecReceiveStream : public RtpPacketSinkInterface,
Tommi0601db92022-05-18 07:18:3729 public ReceiveStreamInterface {
brandtr76648da2016-10-20 11:54:4830 public:
eladalonc0d481a2017-08-02 14:39:0731 ~FlexfecReceiveStream() override = default;
eladalon42f44f92017-07-25 13:40:0632
brandtr7250b392016-12-19 09:13:4633 struct Config {
Paulina Hensman11b34f42018-04-09 12:24:5234 explicit Config(Transport* rtcp_send_transport);
Mirko Bonadei8fdcac32018-08-28 14:30:1835 Config(const Config&);
Paulina Hensman11b34f42018-04-09 12:24:5236 ~Config();
brandtr8313a6f2017-01-13 15:41:1937
brandtr7250b392016-12-19 09:13:4638 std::string ToString() const;
brandtr76648da2016-10-20 11:54:4839
brandtr8313a6f2017-01-13 15:41:1940 // Returns true if all RTP information is available in order to
41 // enable receiving FlexFEC.
42 bool IsCompleteAndEnabled() const;
43
brandtr7250b392016-12-19 09:13:4644 // Payload type for FlexFEC.
45 int payload_type = -1;
brandtr76648da2016-10-20 11:54:4846
Tommi7a15ff32022-05-09 18:54:0247 ReceiveStreamRtpConfig rtp;
brandtr7250b392016-12-19 09:13:4648
49 // Vector containing a single element, corresponding to the SSRC of the
50 // media stream being protected by this FlexFEC stream. The vector MUST have
51 // size 1.
52 //
53 // TODO(brandtr): Update comment above when we support multistream
54 // protection.
55 std::vector<uint32_t> protected_media_ssrcs;
56
brandtr7250b392016-12-19 09:13:4657 // What RTCP mode to use in the reports.
58 RtcpMode rtcp_mode = RtcpMode::kCompound;
59
60 // Transport for outgoing RTCP packets.
61 Transport* rtcp_send_transport = nullptr;
brandtr7250b392016-12-19 09:13:4662 };
Tommiaeb44122022-07-14 16:33:4263
64 // TODO(tommi): FlexfecReceiveStream inherits from ReceiveStreamInterface,
65 // not VideoReceiveStreamInterface where there's also a SetRtcpMode method.
66 // Perhaps this should be in ReceiveStreamInterface and apply to audio streams
67 // as well (although there's no logic that would use it at present).
68 virtual void SetRtcpMode(RtcpMode mode) = 0;
Tommi43b15c32022-07-28 07:24:5269
70 // Called to change the payload type after initialization.
71 virtual void SetPayloadType(int payload_type) = 0;
72 virtual int payload_type() const = 0;
Philipp Hancke17e8a5c2023-06-21 11:53:4173
74 virtual const ReceiveStatistics* GetStats() const = 0;
brandtr76648da2016-10-20 11:54:4875};
76
brandtr76648da2016-10-20 11:54:4877} // namespace webrtc
78
Mirko Bonadei92ea95e2017-09-15 04:47:3179#endif // CALL_FLEXFEC_RECEIVE_STREAM_H_