brandtr | 76648da | 2016-10-20 04:54:48 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
brandtr | 76648da | 2016-10-20 04:54:48 -0700 | [diff] [blame] | 14 | #include <string> |
brandtr | 7250b39 | 2016-12-19 01:13:46 -0800 | [diff] [blame] | 15 | #include <vector> |
brandtr | 76648da | 2016-10-20 04:54:48 -0700 | [diff] [blame] | 16 | |
brandtr | 7250b39 | 2016-12-19 01:13:46 -0800 | [diff] [blame] | 17 | #include "webrtc/api/call/transport.h" |
| 18 | #include "webrtc/config.h" |
brandtr | 76648da | 2016-10-20 04:54:48 -0700 | [diff] [blame] | 19 | |
| 20 | namespace webrtc { |
| 21 | |
brandtr | 7250b39 | 2016-12-19 01:13:46 -0800 | [diff] [blame] | 22 | class FlexfecReceiveStream { |
brandtr | 76648da | 2016-10-20 04:54:48 -0700 | [diff] [blame] | 23 | public: |
brandtr | 7250b39 | 2016-12-19 01:13:46 -0800 | [diff] [blame] | 24 | struct Stats { |
| 25 | std::string ToString(int64_t time_ms) const; |
brandtr | 76648da | 2016-10-20 04:54:48 -0700 | [diff] [blame] | 26 | |
brandtr | 7250b39 | 2016-12-19 01:13:46 -0800 | [diff] [blame] | 27 | // TODO(brandtr): Add appropriate stats here. |
| 28 | int flexfec_bitrate_bps; |
| 29 | }; |
brandtr | 76648da | 2016-10-20 04:54:48 -0700 | [diff] [blame] | 30 | |
brandtr | 7250b39 | 2016-12-19 01:13:46 -0800 | [diff] [blame] | 31 | struct Config { |
| 32 | std::string ToString() const; |
brandtr | 76648da | 2016-10-20 04:54:48 -0700 | [diff] [blame] | 33 | |
brandtr | 7250b39 | 2016-12-19 01:13:46 -0800 | [diff] [blame] | 34 | // Payload type for FlexFEC. |
| 35 | int payload_type = -1; |
brandtr | 76648da | 2016-10-20 04:54:48 -0700 | [diff] [blame] | 36 | |
brandtr | 7250b39 | 2016-12-19 01:13:46 -0800 | [diff] [blame] | 37 | // SSRC for FlexFEC stream to be received. |
| 38 | uint32_t remote_ssrc = 0; |
| 39 | |
| 40 | // Vector containing a single element, corresponding to the SSRC of the |
| 41 | // media stream being protected by this FlexFEC stream. The vector MUST have |
| 42 | // size 1. |
| 43 | // |
| 44 | // TODO(brandtr): Update comment above when we support multistream |
| 45 | // protection. |
| 46 | std::vector<uint32_t> protected_media_ssrcs; |
| 47 | |
| 48 | // SSRC for RTCP reports to be sent. |
| 49 | uint32_t local_ssrc = 0; |
| 50 | |
| 51 | // What RTCP mode to use in the reports. |
| 52 | RtcpMode rtcp_mode = RtcpMode::kCompound; |
| 53 | |
| 54 | // Transport for outgoing RTCP packets. |
| 55 | Transport* rtcp_send_transport = nullptr; |
| 56 | |
| 57 | // |transport_cc| is true whenever the send-side BWE RTCP feedback message |
| 58 | // has been negotiated. This is a prerequisite for enabling send-side BWE. |
| 59 | bool transport_cc = false; |
| 60 | |
| 61 | // RTP header extensions that have been negotiated for this track. |
brandtr | 70e4053 | 2016-12-21 00:22:03 -0800 | [diff] [blame] | 62 | std::vector<RtpExtension> extensions; |
brandtr | 7250b39 | 2016-12-19 01:13:46 -0800 | [diff] [blame] | 63 | }; |
| 64 | |
| 65 | // Starts stream activity. |
| 66 | // When a stream is active, it can receive and process packets. |
| 67 | virtual void Start() = 0; |
| 68 | // Stops stream activity. |
| 69 | // When a stream is stopped, it can't receive nor process packets. |
| 70 | virtual void Stop() = 0; |
| 71 | |
| 72 | virtual Stats GetStats() const = 0; |
| 73 | |
| 74 | protected: |
| 75 | virtual ~FlexfecReceiveStream() = default; |
brandtr | 76648da | 2016-10-20 04:54:48 -0700 | [diff] [blame] | 76 | }; |
| 77 | |
brandtr | 76648da | 2016-10-20 04:54:48 -0700 | [diff] [blame] | 78 | } // namespace webrtc |
| 79 | |
| 80 | #endif // WEBRTC_CALL_FLEXFEC_RECEIVE_STREAM_H_ |