mflodman@webrtc.org | 65f995a | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2013 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 | |
mflodman@webrtc.org | b429e51 | 2013-12-18 09:46:22 +0000 | [diff] [blame] | 11 | #ifndef WEBRTC_VIDEO_SEND_STREAM_H_ |
| 12 | #define WEBRTC_VIDEO_SEND_STREAM_H_ |
mflodman@webrtc.org | 65f995a | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 13 | |
sprang@webrtc.org | ccd4284 | 2014-01-07 09:54:34 +0000 | [diff] [blame] | 14 | #include <map> |
mflodman@webrtc.org | 65f995a | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 15 | #include <string> |
palmkvist | e75f204 | 2016-09-28 06:19:48 -0700 | [diff] [blame] | 16 | #include <utility> |
perkj | 26091b1 | 2016-09-01 01:17:40 -0700 | [diff] [blame] | 17 | #include <vector> |
Per | a48ddb7 | 2016-09-29 11:48:50 +0200 | [diff] [blame] | 18 | #include <utility> |
mflodman@webrtc.org | 65f995a | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 19 | |
aleloi | a8eb756 | 2016-11-28 07:02:13 -0800 | [diff] [blame] | 20 | #include "webrtc/api/call/transport.h" |
mflodman@webrtc.org | 65f995a | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 21 | #include "webrtc/common_types.h" |
pbos | a96b60b | 2016-04-18 21:12:48 -0700 | [diff] [blame] | 22 | #include "webrtc/common_video/include/frame_callback.h" |
pbos@webrtc.org | 16e03b7 | 2013-10-28 16:32:01 +0000 | [diff] [blame] | 23 | #include "webrtc/config.h" |
nisse | d30a111 | 2016-04-18 05:15:22 -0700 | [diff] [blame] | 24 | #include "webrtc/media/base/videosinkinterface.h" |
perkj | a49cbd3 | 2016-09-16 07:53:41 -0700 | [diff] [blame] | 25 | #include "webrtc/media/base/videosourceinterface.h" |
Edward Lemur | c20978e | 2017-07-06 19:44:34 +0200 | [diff] [blame] | 26 | #include "webrtc/rtc_base/platform_file.h" |
mflodman@webrtc.org | 65f995a | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 27 | |
| 28 | namespace webrtc { |
| 29 | |
| 30 | class VideoEncoder; |
| 31 | |
pbos | 1ba8d39 | 2016-05-01 20:18:34 -0700 | [diff] [blame] | 32 | class VideoSendStream { |
mflodman@webrtc.org | 65f995a | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 33 | public: |
pbos@webrtc.org | 09c77b9 | 2015-02-25 10:42:16 +0000 | [diff] [blame] | 34 | struct StreamStats { |
asapersson | 2e5cfcd | 2016-08-11 08:41:18 -0700 | [diff] [blame] | 35 | std::string ToString() const; |
| 36 | |
pbos@webrtc.org | 09c77b9 | 2015-02-25 10:42:16 +0000 | [diff] [blame] | 37 | FrameCounts frame_counts; |
asapersson | 2e5cfcd | 2016-08-11 08:41:18 -0700 | [diff] [blame] | 38 | bool is_rtx = false; |
asapersson | a6a699a | 2016-11-25 03:52:46 -0800 | [diff] [blame] | 39 | bool is_flexfec = false; |
pbos@webrtc.org | 09c77b9 | 2015-02-25 10:42:16 +0000 | [diff] [blame] | 40 | int width = 0; |
| 41 | int height = 0; |
| 42 | // TODO(holmer): Move bitrate_bps out to the webrtc::Call layer. |
| 43 | int total_bitrate_bps = 0; |
| 44 | int retransmit_bitrate_bps = 0; |
| 45 | int avg_delay_ms = 0; |
| 46 | int max_delay_ms = 0; |
| 47 | StreamDataCounters rtp_stats; |
| 48 | RtcpPacketTypeCounter rtcp_packet_type_counts; |
| 49 | RtcpStatistics rtcp_stats; |
| 50 | }; |
| 51 | |
pbos@webrtc.org | 025f4f1 | 2013-06-05 11:33:21 +0000 | [diff] [blame] | 52 | struct Stats { |
asapersson | 2e5cfcd | 2016-08-11 08:41:18 -0700 | [diff] [blame] | 53 | std::string ToString(int64_t time_ms) const; |
Peter Boström | b7d9a97 | 2015-12-18 16:01:11 +0100 | [diff] [blame] | 54 | std::string encoder_implementation_name = "unknown"; |
Fredrik Solenberg | 78fb3b3 | 2015-06-11 12:38:38 +0200 | [diff] [blame] | 55 | int input_frame_rate = 0; |
| 56 | int encode_frame_rate = 0; |
| 57 | int avg_encode_time_ms = 0; |
| 58 | int encode_usage_percent = 0; |
sakal | 43536c3 | 2016-10-24 01:46:43 -0700 | [diff] [blame] | 59 | uint32_t frames_encoded = 0; |
sakal | 87da404 | 2016-10-31 06:53:47 -0700 | [diff] [blame] | 60 | rtc::Optional<uint64_t> qp_sum; |
Per | a48ddb7 | 2016-09-29 11:48:50 +0200 | [diff] [blame] | 61 | // Bitrate the encoder is currently configured to use due to bandwidth |
| 62 | // limitations. |
Fredrik Solenberg | 78fb3b3 | 2015-06-11 12:38:38 +0200 | [diff] [blame] | 63 | int target_media_bitrate_bps = 0; |
Per | a48ddb7 | 2016-09-29 11:48:50 +0200 | [diff] [blame] | 64 | // Bitrate the encoder is actually producing. |
Fredrik Solenberg | 78fb3b3 | 2015-06-11 12:38:38 +0200 | [diff] [blame] | 65 | int media_bitrate_bps = 0; |
Per | a48ddb7 | 2016-09-29 11:48:50 +0200 | [diff] [blame] | 66 | // Media bitrate this VideoSendStream is configured to prefer if there are |
| 67 | // no bandwidth limitations. |
| 68 | int preferred_media_bitrate_bps = 0; |
Fredrik Solenberg | 78fb3b3 | 2015-06-11 12:38:38 +0200 | [diff] [blame] | 69 | bool suspended = false; |
asapersson | 17821db | 2015-12-14 02:08:12 -0800 | [diff] [blame] | 70 | bool bw_limited_resolution = false; |
perkj | 803d97f | 2016-11-01 11:45:46 -0700 | [diff] [blame] | 71 | bool cpu_limited_resolution = false; |
asapersson | 09f0561 | 2017-05-15 23:40:18 -0700 | [diff] [blame] | 72 | bool bw_limited_framerate = false; |
| 73 | bool cpu_limited_framerate = false; |
perkj | 803d97f | 2016-11-01 11:45:46 -0700 | [diff] [blame] | 74 | // Total number of times resolution as been requested to be changed due to |
asapersson | fab6707 | 2017-04-04 05:51:49 -0700 | [diff] [blame] | 75 | // CPU/quality adaptation. |
perkj | 803d97f | 2016-11-01 11:45:46 -0700 | [diff] [blame] | 76 | int number_of_cpu_adapt_changes = 0; |
asapersson | fab6707 | 2017-04-04 05:51:49 -0700 | [diff] [blame] | 77 | int number_of_quality_adapt_changes = 0; |
pbos@webrtc.org | 09c77b9 | 2015-02-25 10:42:16 +0000 | [diff] [blame] | 78 | std::map<uint32_t, StreamStats> substreams; |
pbos@webrtc.org | 025f4f1 | 2013-06-05 11:33:21 +0000 | [diff] [blame] | 79 | }; |
| 80 | |
| 81 | struct Config { |
perkj | 26091b1 | 2016-09-01 01:17:40 -0700 | [diff] [blame] | 82 | public: |
solenberg | 4fbae2b | 2015-08-28 04:07:10 -0700 | [diff] [blame] | 83 | Config() = delete; |
perkj | 26091b1 | 2016-09-01 01:17:40 -0700 | [diff] [blame] | 84 | Config(Config&&) = default; |
pbos | 2d56668 | 2015-09-28 09:59:31 -0700 | [diff] [blame] | 85 | explicit Config(Transport* send_transport) |
solenberg | 4fbae2b | 2015-08-28 04:07:10 -0700 | [diff] [blame] | 86 | : send_transport(send_transport) {} |
| 87 | |
perkj | 26091b1 | 2016-09-01 01:17:40 -0700 | [diff] [blame] | 88 | Config& operator=(Config&&) = default; |
| 89 | Config& operator=(const Config&) = delete; |
| 90 | |
| 91 | // Mostly used by tests. Avoid creating copies if you can. |
| 92 | Config Copy() const { return Config(*this); } |
| 93 | |
pbos@webrtc.org | 1e92b0a | 2014-05-15 09:35:06 +0000 | [diff] [blame] | 94 | std::string ToString() const; |
| 95 | |
pbos@webrtc.org | f577ae9 | 2014-03-19 08:43:57 +0000 | [diff] [blame] | 96 | struct EncoderSettings { |
perkj | 26091b1 | 2016-09-01 01:17:40 -0700 | [diff] [blame] | 97 | EncoderSettings() = default; |
| 98 | EncoderSettings(std::string payload_name, |
| 99 | int payload_type, |
| 100 | VideoEncoder* encoder) |
| 101 | : payload_name(std::move(payload_name)), |
| 102 | payload_type(payload_type), |
| 103 | encoder(encoder) {} |
pbos@webrtc.org | 1e92b0a | 2014-05-15 09:35:06 +0000 | [diff] [blame] | 104 | std::string ToString() const; |
| 105 | |
pbos@webrtc.org | f577ae9 | 2014-03-19 08:43:57 +0000 | [diff] [blame] | 106 | std::string payload_name; |
Fredrik Solenberg | 78fb3b3 | 2015-06-11 12:38:38 +0200 | [diff] [blame] | 107 | int payload_type = -1; |
pbos@webrtc.org | f577ae9 | 2014-03-19 08:43:57 +0000 | [diff] [blame] | 108 | |
sophiechang | 47d78cc | 2015-09-03 18:24:44 -0700 | [diff] [blame] | 109 | // TODO(sophiechang): Delete this field when no one is using internal |
| 110 | // sources anymore. |
| 111 | bool internal_source = false; |
| 112 | |
Peter Boström | e449915 | 2016-02-05 11:13:28 +0100 | [diff] [blame] | 113 | // Allow 100% encoder utilization. Used for HW encoders where CPU isn't |
| 114 | // expected to be the limiting factor, but a chip could be running at |
| 115 | // 30fps (for example) exactly. |
| 116 | bool full_overuse_time = false; |
| 117 | |
pbos@webrtc.org | f577ae9 | 2014-03-19 08:43:57 +0000 | [diff] [blame] | 118 | // Uninitialized VideoEncoder instance to be used for encoding. Will be |
| 119 | // initialized from inside the VideoSendStream. |
Fredrik Solenberg | 78fb3b3 | 2015-06-11 12:38:38 +0200 | [diff] [blame] | 120 | VideoEncoder* encoder = nullptr; |
pbos@webrtc.org | f577ae9 | 2014-03-19 08:43:57 +0000 | [diff] [blame] | 121 | } encoder_settings; |
pbos@webrtc.org | 025f4f1 | 2013-06-05 11:33:21 +0000 | [diff] [blame] | 122 | |
sprang@webrtc.org | 25fce9a | 2013-10-16 13:29:14 +0000 | [diff] [blame] | 123 | static const size_t kDefaultMaxPacketSize = 1500 - 40; // TCP over IPv4. |
pbos@webrtc.org | 025f4f1 | 2013-06-05 11:33:21 +0000 | [diff] [blame] | 124 | struct Rtp { |
pbos@webrtc.org | 1e92b0a | 2014-05-15 09:35:06 +0000 | [diff] [blame] | 125 | std::string ToString() const; |
pbos@webrtc.org | 025f4f1 | 2013-06-05 11:33:21 +0000 | [diff] [blame] | 126 | |
| 127 | std::vector<uint32_t> ssrcs; |
| 128 | |
deadbeef | 1387149 | 2015-12-09 12:37:51 -0800 | [diff] [blame] | 129 | // See RtcpMode for description. |
| 130 | RtcpMode rtcp_mode = RtcpMode::kCompound; |
| 131 | |
pbos@webrtc.org | 025f4f1 | 2013-06-05 11:33:21 +0000 | [diff] [blame] | 132 | // Max RTP packet size delivered to send transport from VideoEngine. |
Fredrik Solenberg | 78fb3b3 | 2015-06-11 12:38:38 +0200 | [diff] [blame] | 133 | size_t max_packet_size = kDefaultMaxPacketSize; |
pbos@webrtc.org | 025f4f1 | 2013-06-05 11:33:21 +0000 | [diff] [blame] | 134 | |
| 135 | // RTP header extensions to use for this send stream. |
| 136 | std::vector<RtpExtension> extensions; |
| 137 | |
| 138 | // See NackConfig for description. |
| 139 | NackConfig nack; |
| 140 | |
brandtr | b5f2c3f | 2016-10-04 23:28:39 -0700 | [diff] [blame] | 141 | // See UlpfecConfig for description. |
| 142 | UlpfecConfig ulpfec; |
pbos@webrtc.org | 025f4f1 | 2013-06-05 11:33:21 +0000 | [diff] [blame] | 143 | |
brandtr | 3d200bd | 2017-01-16 06:59:19 -0800 | [diff] [blame] | 144 | struct Flexfec { |
| 145 | // Payload type of FlexFEC. Set to -1 to disable sending FlexFEC. |
| 146 | int payload_type = -1; |
| 147 | |
| 148 | // SSRC of FlexFEC stream. |
| 149 | uint32_t ssrc = 0; |
| 150 | |
| 151 | // Vector containing a single element, corresponding to the SSRC of the |
| 152 | // media stream being protected by this FlexFEC stream. |
| 153 | // The vector MUST have size 1. |
| 154 | // |
| 155 | // TODO(brandtr): Update comment above when we support |
| 156 | // multistream protection. |
| 157 | std::vector<uint32_t> protected_media_ssrcs; |
| 158 | } flexfec; |
brandtr | e950cad | 2016-11-15 05:25:41 -0800 | [diff] [blame] | 159 | |
pbos@webrtc.org | c279a5d | 2014-01-24 09:30:53 +0000 | [diff] [blame] | 160 | // Settings for RTP retransmission payload format, see RFC 4588 for |
| 161 | // details. |
| 162 | struct Rtx { |
pbos@webrtc.org | 1e92b0a | 2014-05-15 09:35:06 +0000 | [diff] [blame] | 163 | std::string ToString() const; |
pbos@webrtc.org | c279a5d | 2014-01-24 09:30:53 +0000 | [diff] [blame] | 164 | // SSRCs to use for the RTX streams. |
| 165 | std::vector<uint32_t> ssrcs; |
| 166 | |
| 167 | // Payload type to use for the RTX stream. |
Fredrik Solenberg | 78fb3b3 | 2015-06-11 12:38:38 +0200 | [diff] [blame] | 168 | int payload_type = -1; |
pbos@webrtc.org | c279a5d | 2014-01-24 09:30:53 +0000 | [diff] [blame] | 169 | } rtx; |
pbos@webrtc.org | 025f4f1 | 2013-06-05 11:33:21 +0000 | [diff] [blame] | 170 | |
| 171 | // RTCP CNAME, see RFC 3550. |
| 172 | std::string c_name; |
| 173 | } rtp; |
| 174 | |
solenberg | 4fbae2b | 2015-08-28 04:07:10 -0700 | [diff] [blame] | 175 | // Transport for outgoing packets. |
pbos | 2d56668 | 2015-09-28 09:59:31 -0700 | [diff] [blame] | 176 | Transport* send_transport = nullptr; |
solenberg | 4fbae2b | 2015-08-28 04:07:10 -0700 | [diff] [blame] | 177 | |
pbos@webrtc.org | 025f4f1 | 2013-06-05 11:33:21 +0000 | [diff] [blame] | 178 | // Called for each I420 frame before encoding the frame. Can be used for |
Fredrik Solenberg | 78fb3b3 | 2015-06-11 12:38:38 +0200 | [diff] [blame] | 179 | // effects, snapshots etc. 'nullptr' disables the callback. |
nisse | d30a111 | 2016-04-18 05:15:22 -0700 | [diff] [blame] | 180 | rtc::VideoSinkInterface<VideoFrame>* pre_encode_callback = nullptr; |
pbos@webrtc.org | 025f4f1 | 2013-06-05 11:33:21 +0000 | [diff] [blame] | 181 | |
Fredrik Solenberg | 78fb3b3 | 2015-06-11 12:38:38 +0200 | [diff] [blame] | 182 | // Called for each encoded frame, e.g. used for file storage. 'nullptr' |
Peter Boström | e449915 | 2016-02-05 11:13:28 +0100 | [diff] [blame] | 183 | // disables the callback. Also measures timing and passes the time |
| 184 | // spent on encoding. This timing will not fire if encoding takes longer |
| 185 | // than the measuring window, since the sample data will have been dropped. |
Fredrik Solenberg | 78fb3b3 | 2015-06-11 12:38:38 +0200 | [diff] [blame] | 186 | EncodedFrameObserver* post_encode_callback = nullptr; |
pbos@webrtc.org | 025f4f1 | 2013-06-05 11:33:21 +0000 | [diff] [blame] | 187 | |
pbos@webrtc.org | 025f4f1 | 2013-06-05 11:33:21 +0000 | [diff] [blame] | 188 | // Expected delay needed by the renderer, i.e. the frame will be delivered |
| 189 | // this many milliseconds, if possible, earlier than expected render time. |
pbos@webrtc.org | 1e92b0a | 2014-05-15 09:35:06 +0000 | [diff] [blame] | 190 | // Only valid if |local_renderer| is set. |
Fredrik Solenberg | 78fb3b3 | 2015-06-11 12:38:38 +0200 | [diff] [blame] | 191 | int render_delay_ms = 0; |
pbos@webrtc.org | 025f4f1 | 2013-06-05 11:33:21 +0000 | [diff] [blame] | 192 | |
pbos@webrtc.org | 025f4f1 | 2013-06-05 11:33:21 +0000 | [diff] [blame] | 193 | // Target delay in milliseconds. A positive value indicates this stream is |
| 194 | // used for streaming instead of a real-time call. |
Fredrik Solenberg | 78fb3b3 | 2015-06-11 12:38:38 +0200 | [diff] [blame] | 195 | int target_delay_ms = 0; |
pbos@webrtc.org | 025f4f1 | 2013-06-05 11:33:21 +0000 | [diff] [blame] | 196 | |
henrik.lundin@webrtc.org | ce8e093 | 2013-11-18 12:18:43 +0000 | [diff] [blame] | 197 | // True if the stream should be suspended when the available bitrate fall |
| 198 | // below the minimum configured bitrate. If this variable is false, the |
| 199 | // stream may send at a rate higher than the estimated available bitrate. |
Fredrik Solenberg | 78fb3b3 | 2015-06-11 12:38:38 +0200 | [diff] [blame] | 200 | bool suspend_below_min_bitrate = false; |
perkj | 26091b1 | 2016-09-01 01:17:40 -0700 | [diff] [blame] | 201 | |
sergeyu | 80ed35e | 2016-11-28 13:11:13 -0800 | [diff] [blame] | 202 | // Enables periodic bandwidth probing in application-limited region. |
| 203 | bool periodic_alr_bandwidth_probing = false; |
| 204 | |
perkj | 26091b1 | 2016-09-01 01:17:40 -0700 | [diff] [blame] | 205 | private: |
| 206 | // Access to the copy constructor is private to force use of the Copy() |
| 207 | // method for those exceptional cases where we do use it. |
| 208 | Config(const Config&) = default; |
pbos@webrtc.org | 025f4f1 | 2013-06-05 11:33:21 +0000 | [diff] [blame] | 209 | }; |
| 210 | |
pbos | 1ba8d39 | 2016-05-01 20:18:34 -0700 | [diff] [blame] | 211 | // Starts stream activity. |
| 212 | // When a stream is active, it can receive, process and deliver packets. |
| 213 | virtual void Start() = 0; |
| 214 | // Stops stream activity. |
| 215 | // When a stream is stopped, it can't receive, process or deliver packets. |
| 216 | virtual void Stop() = 0; |
| 217 | |
perkj | 803d97f | 2016-11-01 11:45:46 -0700 | [diff] [blame] | 218 | // Based on the spec in |
| 219 | // https://w3c.github.io/webrtc-pc/#idl-def-rtcdegradationpreference. |
sprang | c5d62e2 | 2017-04-02 23:53:04 -0700 | [diff] [blame] | 220 | // These options are enforced on a best-effort basis. For instance, all of |
| 221 | // these options may suffer some frame drops in order to avoid queuing. |
| 222 | // TODO(sprang): Look into possibility of more strictly enforcing the |
| 223 | // maintain-framerate option. |
perkj | 803d97f | 2016-11-01 11:45:46 -0700 | [diff] [blame] | 224 | enum class DegradationPreference { |
sprang | c5d62e2 | 2017-04-02 23:53:04 -0700 | [diff] [blame] | 225 | // Don't take any actions based on over-utilization signals. |
| 226 | kDegradationDisabled, |
asapersson | 3c81a1a | 2017-06-14 05:52:21 -0700 | [diff] [blame] | 227 | // On over-use, request lower frame rate, possibly causing frame drops. |
perkj | 803d97f | 2016-11-01 11:45:46 -0700 | [diff] [blame] | 228 | kMaintainResolution, |
asapersson | 3c81a1a | 2017-06-14 05:52:21 -0700 | [diff] [blame] | 229 | // On over-use, request lower resolution, possibly causing down-scaling. |
sprang | c5d62e2 | 2017-04-02 23:53:04 -0700 | [diff] [blame] | 230 | kMaintainFramerate, |
| 231 | // Try to strike a "pleasing" balance between frame rate or resolution. |
perkj | 803d97f | 2016-11-01 11:45:46 -0700 | [diff] [blame] | 232 | kBalanced, |
| 233 | }; |
sprang | c5d62e2 | 2017-04-02 23:53:04 -0700 | [diff] [blame] | 234 | |
perkj | a49cbd3 | 2016-09-16 07:53:41 -0700 | [diff] [blame] | 235 | virtual void SetSource( |
perkj | 803d97f | 2016-11-01 11:45:46 -0700 | [diff] [blame] | 236 | rtc::VideoSourceInterface<webrtc::VideoFrame>* source, |
| 237 | const DegradationPreference& degradation_preference) = 0; |
mflodman@webrtc.org | 65f995a | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 238 | |
pbos@webrtc.org | f577ae9 | 2014-03-19 08:43:57 +0000 | [diff] [blame] | 239 | // Set which streams to send. Must have at least as many SSRCs as configured |
| 240 | // in the config. Encoder settings are passed on to the encoder instance along |
| 241 | // with the VideoStream settings. |
perkj | 26091b1 | 2016-09-01 01:17:40 -0700 | [diff] [blame] | 242 | virtual void ReconfigureVideoEncoder(VideoEncoderConfig config) = 0; |
mflodman@webrtc.org | 65f995a | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 243 | |
pbos@webrtc.org | 273a414 | 2014-12-01 15:23:21 +0000 | [diff] [blame] | 244 | virtual Stats GetStats() = 0; |
pbos | 1ba8d39 | 2016-05-01 20:18:34 -0700 | [diff] [blame] | 245 | |
palmkvist | e75f204 | 2016-09-28 06:19:48 -0700 | [diff] [blame] | 246 | // Takes ownership of each file, is responsible for closing them later. |
| 247 | // Calling this method will close and finalize any current logs. |
| 248 | // Some codecs produce multiple streams (VP8 only at present), each of these |
| 249 | // streams will log to a separate file. kMaxSimulcastStreams in common_types.h |
| 250 | // gives the max number of such streams. If there is no file for a stream, or |
| 251 | // the file is rtc::kInvalidPlatformFileValue, frames from that stream will |
| 252 | // not be logged. |
| 253 | // If a frame to be written would make the log too large the write fails and |
| 254 | // the log is closed and finalized. A |byte_limit| of 0 means no limit. |
| 255 | virtual void EnableEncodedFrameRecording( |
| 256 | const std::vector<rtc::PlatformFile>& files, |
| 257 | size_t byte_limit) = 0; |
| 258 | inline void DisableEncodedFrameRecording() { |
| 259 | EnableEncodedFrameRecording(std::vector<rtc::PlatformFile>(), 0); |
| 260 | } |
| 261 | |
pbos | 1ba8d39 | 2016-05-01 20:18:34 -0700 | [diff] [blame] | 262 | protected: |
| 263 | virtual ~VideoSendStream() {} |
mflodman@webrtc.org | 65f995a | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 264 | }; |
| 265 | |
mflodman@webrtc.org | 65f995a | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 266 | } // namespace webrtc |
| 267 | |
mflodman@webrtc.org | b429e51 | 2013-12-18 09:46:22 +0000 | [diff] [blame] | 268 | #endif // WEBRTC_VIDEO_SEND_STREAM_H_ |