blob: 400bca4c13cf119da8c338a18dbc6e34c7fec76f [file] [log] [blame]
brandtr4e974392016-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
11#ifndef WEBRTC_CALL_FLEXFEC_RECEIVE_STREAM_H_
12#define WEBRTC_CALL_FLEXFEC_RECEIVE_STREAM_H_
13
pbos67d12ed2017-01-02 16:42:3214#include <stdint.h>
15
brandtr4e974392016-10-20 11:54:4816#include <string>
brandtr02a64312016-12-19 09:13:4617#include <vector>
brandtr4e974392016-10-20 11:54:4818
brandtr02a64312016-12-19 09:13:4619#include "webrtc/api/call/transport.h"
Stefan Holmer36189cd2017-09-01 13:29:2820#include "webrtc/api/rtpparameters.h"
eladalon2c1cbc12017-08-02 14:39:0721#include "webrtc/call/rtp_packet_sink_interface.h"
Stefan Holmer36189cd2017-09-01 13:29:2822#include "webrtc/common_types.h"
brandtr4e974392016-10-20 11:54:4823
24namespace webrtc {
25
eladalon2c1cbc12017-08-02 14:39:0726class FlexfecReceiveStream : public RtpPacketSinkInterface {
brandtr4e974392016-10-20 11:54:4827 public:
eladalon2c1cbc12017-08-02 14:39:0728 ~FlexfecReceiveStream() override = default;
eladalon0dedc272017-07-25 13:40:0629
brandtr02a64312016-12-19 09:13:4630 struct Stats {
31 std::string ToString(int64_t time_ms) const;
brandtr4e974392016-10-20 11:54:4832
brandtr02a64312016-12-19 09:13:4633 // TODO(brandtr): Add appropriate stats here.
34 int flexfec_bitrate_bps;
35 };
brandtr4e974392016-10-20 11:54:4836
brandtr02a64312016-12-19 09:13:4637 struct Config {
brandtrb9af9fd2017-01-13 15:41:1938 explicit Config(Transport* rtcp_send_transport)
39 : rtcp_send_transport(rtcp_send_transport) {
40 RTC_DCHECK(rtcp_send_transport);
41 }
42
brandtr02a64312016-12-19 09:13:4643 std::string ToString() const;
brandtr4e974392016-10-20 11:54:4844
brandtrb9af9fd2017-01-13 15:41:1945 // Returns true if all RTP information is available in order to
46 // enable receiving FlexFEC.
47 bool IsCompleteAndEnabled() const;
48
brandtr02a64312016-12-19 09:13:4649 // Payload type for FlexFEC.
50 int payload_type = -1;
brandtr4e974392016-10-20 11:54:4851
brandtr02a64312016-12-19 09:13:4652 // SSRC for FlexFEC stream to be received.
53 uint32_t remote_ssrc = 0;
54
55 // Vector containing a single element, corresponding to the SSRC of the
56 // media stream being protected by this FlexFEC stream. The vector MUST have
57 // size 1.
58 //
59 // TODO(brandtr): Update comment above when we support multistream
60 // protection.
61 std::vector<uint32_t> protected_media_ssrcs;
62
63 // SSRC for RTCP reports to be sent.
64 uint32_t local_ssrc = 0;
65
66 // What RTCP mode to use in the reports.
67 RtcpMode rtcp_mode = RtcpMode::kCompound;
68
69 // Transport for outgoing RTCP packets.
70 Transport* rtcp_send_transport = nullptr;
71
72 // |transport_cc| is true whenever the send-side BWE RTCP feedback message
73 // has been negotiated. This is a prerequisite for enabling send-side BWE.
74 bool transport_cc = false;
75
76 // RTP header extensions that have been negotiated for this track.
brandtr909d3832016-12-21 14:37:1877 std::vector<RtpExtension> rtp_header_extensions;
brandtr02a64312016-12-19 09:13:4678 };
79
brandtr02a64312016-12-19 09:13:4680 virtual Stats GetStats() const = 0;
81
eladalon0dedc272017-07-25 13:40:0682 virtual const Config& GetConfig() const = 0;
brandtr4e974392016-10-20 11:54:4883};
84
brandtr4e974392016-10-20 11:54:4885} // namespace webrtc
86
87#endif // WEBRTC_CALL_FLEXFEC_RECEIVE_STREAM_H_