Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: webrtc/video/video_send_stream.cc

Issue 1353263005: Adding support for simulcast and spatial layers into VideoQualityTest (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase master, includes the perf regression fix Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/video/video_quality_test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 303
304 strncpy(video_codec.plName, 304 strncpy(video_codec.plName,
305 config_.encoder_settings.payload_name.c_str(), 305 config_.encoder_settings.payload_name.c_str(),
306 kPayloadNameSize - 1); 306 kPayloadNameSize - 1);
307 video_codec.plName[kPayloadNameSize - 1] = '\0'; 307 video_codec.plName[kPayloadNameSize - 1] = '\0';
308 video_codec.plType = config_.encoder_settings.payload_type; 308 video_codec.plType = config_.encoder_settings.payload_type;
309 video_codec.numberOfSimulcastStreams = 309 video_codec.numberOfSimulcastStreams =
310 static_cast<unsigned char>(streams.size()); 310 static_cast<unsigned char>(streams.size());
311 video_codec.minBitrate = streams[0].min_bitrate_bps / 1000; 311 video_codec.minBitrate = streams[0].min_bitrate_bps / 1000;
312 RTC_DCHECK_LE(streams.size(), static_cast<size_t>(kMaxSimulcastStreams)); 312 RTC_DCHECK_LE(streams.size(), static_cast<size_t>(kMaxSimulcastStreams));
313 if (video_codec.codecType == kVideoCodecVP9) {
314 // If the vector is empty, bitrates will be configured automatically.
315 RTC_DCHECK(config.spatial_layers.empty() ||
316 config.spatial_layers.size() ==
317 video_codec.codecSpecific.VP9.numberOfSpatialLayers);
318 RTC_DCHECK_LE(video_codec.codecSpecific.VP9.numberOfSpatialLayers,
319 kMaxSimulcastStreams);
320 for (size_t i = 0; i < config.spatial_layers.size(); ++i)
321 video_codec.spatialLayers[i] = config.spatial_layers[i];
322 }
313 for (size_t i = 0; i < streams.size(); ++i) { 323 for (size_t i = 0; i < streams.size(); ++i) {
314 SimulcastStream* sim_stream = &video_codec.simulcastStream[i]; 324 SimulcastStream* sim_stream = &video_codec.simulcastStream[i];
315 RTC_DCHECK_GT(streams[i].width, 0u); 325 RTC_DCHECK_GT(streams[i].width, 0u);
316 RTC_DCHECK_GT(streams[i].height, 0u); 326 RTC_DCHECK_GT(streams[i].height, 0u);
317 RTC_DCHECK_GT(streams[i].max_framerate, 0); 327 RTC_DCHECK_GT(streams[i].max_framerate, 0);
318 // Different framerates not supported per stream at the moment. 328 // Different framerates not supported per stream at the moment.
319 RTC_DCHECK_EQ(streams[i].max_framerate, streams[0].max_framerate); 329 RTC_DCHECK_EQ(streams[i].max_framerate, streams[0].max_framerate);
320 RTC_DCHECK_GE(streams[i].min_bitrate_bps, 0); 330 RTC_DCHECK_GE(streams[i].min_bitrate_bps, 0);
321 RTC_DCHECK_GE(streams[i].target_bitrate_bps, streams[i].min_bitrate_bps); 331 RTC_DCHECK_GE(streams[i].target_bitrate_bps, streams[i].min_bitrate_bps);
322 RTC_DCHECK_GE(streams[i].max_bitrate_bps, streams[i].target_bitrate_bps); 332 RTC_DCHECK_GE(streams[i].max_bitrate_bps, streams[i].target_bitrate_bps);
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 vie_channel_->IsSendingFecEnabled()); 506 vie_channel_->IsSendingFecEnabled());
497 507
498 // Restart the media flow 508 // Restart the media flow
499 vie_encoder_->Restart(); 509 vie_encoder_->Restart();
500 510
501 return true; 511 return true;
502 } 512 }
503 513
504 } // namespace internal 514 } // namespace internal
505 } // namespace webrtc 515 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/video_quality_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698