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

Side by Side Diff: webrtc/api/videocapturertracksource.cc

Issue 1827023002: Get VideoCapturer stats via VideoTrackSourceInterface in StatsCollector, (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Move StatsReport logic to VideoRtpSender. Created 4 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 if (!worker_thread()->Invoke<bool>( 355 if (!worker_thread()->Invoke<bool>(
356 rtc::Bind(&cricket::VideoCapturer::StartCapturing, 356 rtc::Bind(&cricket::VideoCapturer::StartCapturing,
357 video_capturer_.get(), format_))) { 357 video_capturer_.get(), format_))) {
358 SetState(kEnded); 358 SetState(kEnded);
359 return; 359 return;
360 } 360 }
361 started_ = true; 361 started_ = true;
362 // Initialize hasn't succeeded until a successful state change has occurred. 362 // Initialize hasn't succeeded until a successful state change has occurred.
363 } 363 }
364 364
365 bool VideoCapturerTrackSource::GetStats(Stats* stats) {
366 cricket::VideoFormat last_captured_frame_format;
367 video_capturer_->GetStats(&last_captured_frame_format);
368 stats->input_width = last_captured_frame_format.width;
369 stats->input_height = last_captured_frame_format.height;
370
371 return true;
372 }
373
365 void VideoCapturerTrackSource::Stop() { 374 void VideoCapturerTrackSource::Stop() {
366 if (!started_) { 375 if (!started_) {
367 return; 376 return;
368 } 377 }
369 started_ = false; 378 started_ = false;
370 worker_thread()->Invoke<void>( 379 worker_thread()->Invoke<void>(
371 rtc::Bind(&cricket::VideoCapturer::Stop, video_capturer_.get())); 380 rtc::Bind(&cricket::VideoCapturer::Stop, video_capturer_.get()));
372 } 381 }
373 382
374 void VideoCapturerTrackSource::Restart() { 383 void VideoCapturerTrackSource::Restart() {
(...skipping 19 matching lines...) Expand all
394 this, capturer, capture_state)); 403 this, capturer, capture_state));
395 return; 404 return;
396 } 405 }
397 406
398 if (capturer == video_capturer_.get()) { 407 if (capturer == video_capturer_.get()) {
399 SetState(GetReadyState(capture_state)); 408 SetState(GetReadyState(capture_state));
400 } 409 }
401 } 410 }
402 411
403 } // namespace webrtc 412 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698