blob: eb70e206ecb92a6b744e3913e0650c10cb2ee24b [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"
Tommi1c1f5402021-06-14 08:54:2021#include "call/receive_stream.h"
Mirko Bonadei92ea95e2017-09-15 04:47:3122#include "call/rtp_packet_sink_interface.h"
Philipp Hancke17e8a5c2023-06-21 11:53:4123#include "modules/rtp_rtcp/include/receive_statistics.h"
brandtr76648da2016-10-20 11:54:4824
25namespace webrtc {
26
Tommi1c1f5402021-06-14 08:54:2027class FlexfecReceiveStream : public RtpPacketSinkInterface,
Tommi0601db92022-05-18 07:18:3728 public ReceiveStreamInterface {
brandtr76648da2016-10-20 11:54:4829 public:
eladalonc0d481a2017-08-02 14:39:0730 ~FlexfecReceiveStream() override = default;
eladalon42f44f92017-07-25 13:40:0631
brandtr7250b392016-12-19 09:13:4632 struct Config {
Paulina Hensman11b34f42018-04-09 12:24:5233 explicit Config(Transport* rtcp_send_transport);
Mirko Bonadei8fdcac32018-08-28 14:30:1834 Config(const Config&);
Paulina Hensman11b34f42018-04-09 12:24:5235 ~Config();
brandtr8313a6f2017-01-13 15:41:1936
brandtr7250b392016-12-19 09:13:4637 std::string ToString() const;
brandtr76648da2016-10-20 11:54:4838
brandtr8313a6f2017-01-13 15:41:1939 // Returns true if all RTP information is available in order to
40 // enable receiving FlexFEC.
41 bool IsCompleteAndEnabled() const;
42
brandtr7250b392016-12-19 09:13:4643 // Payload type for FlexFEC.
44 int payload_type = -1;
brandtr76648da2016-10-20 11:54:4845
Tommi7a15ff32022-05-09 18:54:0246 ReceiveStreamRtpConfig rtp;
brandtr7250b392016-12-19 09:13:4647
48 // Vector containing a single element, corresponding to the SSRC of the
49 // media stream being protected by this FlexFEC stream. The vector MUST have
50 // size 1.
51 //
52 // TODO(brandtr): Update comment above when we support multistream
53 // protection.
54 std::vector<uint32_t> protected_media_ssrcs;
55
brandtr7250b392016-12-19 09:13:4656 // What RTCP mode to use in the reports.
57 RtcpMode rtcp_mode = RtcpMode::kCompound;
58
59 // Transport for outgoing RTCP packets.
60 Transport* rtcp_send_transport = nullptr;
brandtr7250b392016-12-19 09:13:4661 };
Tommiaeb44122022-07-14 16:33:4262
63 // TODO(tommi): FlexfecReceiveStream inherits from ReceiveStreamInterface,
64 // not VideoReceiveStreamInterface where there's also a SetRtcpMode method.
65 // Perhaps this should be in ReceiveStreamInterface and apply to audio streams
66 // as well (although there's no logic that would use it at present).
67 virtual void SetRtcpMode(RtcpMode mode) = 0;
Tommi43b15c32022-07-28 07:24:5268
69 // Called to change the payload type after initialization.
70 virtual void SetPayloadType(int payload_type) = 0;
71 virtual int payload_type() const = 0;
Philipp Hancke17e8a5c2023-06-21 11:53:4172
73 virtual const ReceiveStatistics* GetStats() const = 0;
brandtr76648da2016-10-20 11:54:4874};
75
brandtr76648da2016-10-20 11:54:4876} // namespace webrtc
77
Mirko Bonadei92ea95e2017-09-15 04:47:3178#endif // CALL_FLEXFEC_RECEIVE_STREAM_H_