blob: d64cb26f707e61340d54fee275ab4db93b263751 [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>
15
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"
Mirko Bonadei92ea95e2017-09-15 04:47:3121#include "api/rtpparameters.h"
22#include "call/rtp_packet_sink_interface.h"
Mirko Bonadei71207422017-09-15 11:58:0923#include "common_types.h" // NOLINT(build/include)
brandtr76648da2016-10-20 11:54:4824
25namespace webrtc {
26
eladalonc0d481a2017-08-02 14:39:0727class FlexfecReceiveStream : public RtpPacketSinkInterface {
brandtr76648da2016-10-20 11:54:4828 public:
eladalonc0d481a2017-08-02 14:39:0729 ~FlexfecReceiveStream() override = default;
eladalon42f44f92017-07-25 13:40:0630
brandtr7250b392016-12-19 09:13:4631 struct Stats {
32 std::string ToString(int64_t time_ms) const;
brandtr76648da2016-10-20 11:54:4833
brandtr7250b392016-12-19 09:13:4634 // TODO(brandtr): Add appropriate stats here.
35 int flexfec_bitrate_bps;
36 };
brandtr76648da2016-10-20 11:54:4837
brandtr7250b392016-12-19 09:13:4638 struct Config {
Paulina Hensman11b34f42018-04-09 12:24:5239 explicit Config(Transport* rtcp_send_transport);
40 ~Config();
brandtr8313a6f2017-01-13 15:41:1941
brandtr7250b392016-12-19 09:13:4642 std::string ToString() const;
brandtr76648da2016-10-20 11:54:4843
brandtr8313a6f2017-01-13 15:41:1944 // Returns true if all RTP information is available in order to
45 // enable receiving FlexFEC.
46 bool IsCompleteAndEnabled() const;
47
brandtr7250b392016-12-19 09:13:4648 // Payload type for FlexFEC.
49 int payload_type = -1;
brandtr76648da2016-10-20 11:54:4850
brandtr7250b392016-12-19 09:13:4651 // SSRC for FlexFEC stream to be received.
52 uint32_t remote_ssrc = 0;
53
54 // Vector containing a single element, corresponding to the SSRC of the
55 // media stream being protected by this FlexFEC stream. The vector MUST have
56 // size 1.
57 //
58 // TODO(brandtr): Update comment above when we support multistream
59 // protection.
60 std::vector<uint32_t> protected_media_ssrcs;
61
62 // SSRC for RTCP reports to be sent.
63 uint32_t local_ssrc = 0;
64
65 // What RTCP mode to use in the reports.
66 RtcpMode rtcp_mode = RtcpMode::kCompound;
67
68 // Transport for outgoing RTCP packets.
69 Transport* rtcp_send_transport = nullptr;
70
71 // |transport_cc| is true whenever the send-side BWE RTCP feedback message
72 // has been negotiated. This is a prerequisite for enabling send-side BWE.
73 bool transport_cc = false;
74
75 // RTP header extensions that have been negotiated for this track.
brandtrb29e6522016-12-21 14:37:1876 std::vector<RtpExtension> rtp_header_extensions;
brandtr7250b392016-12-19 09:13:4677 };
78
brandtr7250b392016-12-19 09:13:4679 virtual Stats GetStats() const = 0;
80
eladalon42f44f92017-07-25 13:40:0681 virtual const Config& GetConfig() const = 0;
brandtr76648da2016-10-20 11:54:4882};
83
brandtr76648da2016-10-20 11:54:4884} // namespace webrtc
85
Mirko Bonadei92ea95e2017-09-15 04:47:3186#endif // CALL_FLEXFEC_RECEIVE_STREAM_H_