blob: fe57643cb0f2d373b37d3b38fb359e1e7c1f373e [file] [log] [blame]
brandtr76648da2016-10-20 04:54:48 -07001/*
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
pbosc7c26a02017-01-02 08:42:32 -080014#include <stdint.h>
15
brandtr76648da2016-10-20 04:54:48 -070016#include <string>
brandtr7250b392016-12-19 01:13:46 -080017#include <vector>
brandtr76648da2016-10-20 04:54:48 -070018
brandtr7250b392016-12-19 01:13:46 -080019#include "webrtc/api/call/transport.h"
20#include "webrtc/config.h"
brandtr76648da2016-10-20 04:54:48 -070021
22namespace webrtc {
23
brandtr7250b392016-12-19 01:13:46 -080024class FlexfecReceiveStream {
brandtr76648da2016-10-20 04:54:48 -070025 public:
brandtr7250b392016-12-19 01:13:46 -080026 struct Stats {
27 std::string ToString(int64_t time_ms) const;
brandtr76648da2016-10-20 04:54:48 -070028
brandtr7250b392016-12-19 01:13:46 -080029 // TODO(brandtr): Add appropriate stats here.
30 int flexfec_bitrate_bps;
31 };
brandtr76648da2016-10-20 04:54:48 -070032
brandtr7250b392016-12-19 01:13:46 -080033 struct Config {
34 std::string ToString() const;
brandtr76648da2016-10-20 04:54:48 -070035
brandtr7250b392016-12-19 01:13:46 -080036 // Payload type for FlexFEC.
37 int payload_type = -1;
brandtr76648da2016-10-20 04:54:48 -070038
brandtr7250b392016-12-19 01:13:46 -080039 // SSRC for FlexFEC stream to be received.
40 uint32_t remote_ssrc = 0;
41
42 // Vector containing a single element, corresponding to the SSRC of the
43 // media stream being protected by this FlexFEC stream. The vector MUST have
44 // size 1.
45 //
46 // TODO(brandtr): Update comment above when we support multistream
47 // protection.
48 std::vector<uint32_t> protected_media_ssrcs;
49
50 // SSRC for RTCP reports to be sent.
51 uint32_t local_ssrc = 0;
52
53 // What RTCP mode to use in the reports.
54 RtcpMode rtcp_mode = RtcpMode::kCompound;
55
56 // Transport for outgoing RTCP packets.
57 Transport* rtcp_send_transport = nullptr;
58
59 // |transport_cc| is true whenever the send-side BWE RTCP feedback message
60 // has been negotiated. This is a prerequisite for enabling send-side BWE.
61 bool transport_cc = false;
62
63 // RTP header extensions that have been negotiated for this track.
brandtrb29e6522016-12-21 06:37:18 -080064 std::vector<RtpExtension> rtp_header_extensions;
brandtr7250b392016-12-19 01:13:46 -080065 };
66
67 // Starts stream activity.
68 // When a stream is active, it can receive and process packets.
69 virtual void Start() = 0;
70 // Stops stream activity.
71 // When a stream is stopped, it can't receive nor process packets.
72 virtual void Stop() = 0;
73
74 virtual Stats GetStats() const = 0;
75
76 protected:
77 virtual ~FlexfecReceiveStream() = default;
brandtr76648da2016-10-20 04:54:48 -070078};
79
brandtr76648da2016-10-20 04:54:48 -070080} // namespace webrtc
81
82#endif // WEBRTC_CALL_FLEXFEC_RECEIVE_STREAM_H_