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

Side by Side Diff: talk/media/webrtc/webrtcvideocapturer.cc

Issue 1485673003: WebRtcVideoCapturer: SetCaptureState(CS_STOPPED) on Stop and ensure state changes in unittest (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years 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 | « no previous file | talk/media/webrtc/webrtcvideocapturer_unittest.cc » ('j') | 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 * libjingle 2 * libjingle
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 LOG(LS_INFO) << "Camera '" << GetId() << "' stopped after capturing " 343 LOG(LS_INFO) << "Camera '" << GetId() << "' stopped after capturing "
344 << captured_frames_ << " frames and dropping " 344 << captured_frames_ << " frames and dropping "
345 << drop_ratio << "%"; 345 << drop_ratio << "%";
346 346
347 // Clear any pending async invokes (that OnIncomingCapturedFrame may have 347 // Clear any pending async invokes (that OnIncomingCapturedFrame may have
348 // caused). 348 // caused).
349 async_invoker_.reset(); 349 async_invoker_.reset();
350 350
351 SetCaptureFormat(NULL); 351 SetCaptureFormat(NULL);
352 start_thread_ = nullptr; 352 start_thread_ = nullptr;
353 SetCaptureState(CS_STOPPED);
353 } 354 }
354 355
355 bool WebRtcVideoCapturer::IsRunning() { 356 bool WebRtcVideoCapturer::IsRunning() {
356 return (module_ != NULL && module_->CaptureStarted()); 357 return (module_ != NULL && module_->CaptureStarted());
357 } 358 }
358 359
359 bool WebRtcVideoCapturer::GetPreferredFourccs(std::vector<uint32_t>* fourccs) { 360 bool WebRtcVideoCapturer::GetPreferredFourccs(std::vector<uint32_t>* fourccs) {
360 if (!fourccs) { 361 if (!fourccs) {
361 return false; 362 return false;
362 } 363 }
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 // Convert units from VideoFrame RenderTimeMs to CapturedFrame (nanoseconds). 439 // Convert units from VideoFrame RenderTimeMs to CapturedFrame (nanoseconds).
439 time_stamp = sample.render_time_ms() * rtc::kNumNanosecsPerMillisec; 440 time_stamp = sample.render_time_ms() * rtc::kNumNanosecsPerMillisec;
440 data_size = rtc::checked_cast<uint32_t>(length); 441 data_size = rtc::checked_cast<uint32_t>(length);
441 data = buffer; 442 data = buffer;
442 rotation = sample.rotation(); 443 rotation = sample.rotation();
443 } 444 }
444 445
445 } // namespace cricket 446 } // namespace cricket
446 447
447 #endif // HAVE_WEBRTC_VIDEO 448 #endif // HAVE_WEBRTC_VIDEO
OLDNEW
« no previous file with comments | « no previous file | talk/media/webrtc/webrtcvideocapturer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698