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

Side by Side Diff: media/video/capture/mac/video_capture_device_avfoundation_mac.mm

Issue 904593002: Assert RendererScheduler thread usage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix mac Created 5 years, 10 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 | « content/renderer/scheduler/web_scheduler_impl.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 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "media/video/capture/mac/video_capture_device_avfoundation_mac.h" 5 #import "media/video/capture/mac/video_capture_device_avfoundation_mac.h"
6 6
7 #import <CoreVideo/CoreVideo.h> 7 #import <CoreVideo/CoreVideo.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/mac/foundation_util.h" 10 #include "base/mac/foundation_util.h"
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 272
273 #pragma mark Private methods 273 #pragma mark Private methods
274 274
275 // |captureOutput| is called by the capture device to deliver a new frame. 275 // |captureOutput| is called by the capture device to deliver a new frame.
276 - (void)captureOutput:(CrAVCaptureOutput*)captureOutput 276 - (void)captureOutput:(CrAVCaptureOutput*)captureOutput
277 didOutputSampleBuffer:(CoreMediaGlue::CMSampleBufferRef)sampleBuffer 277 didOutputSampleBuffer:(CoreMediaGlue::CMSampleBufferRef)sampleBuffer
278 fromConnection:(CrAVCaptureConnection*)connection { 278 fromConnection:(CrAVCaptureConnection*)connection {
279 // AVFoundation calls from a number of threads, depending on, at least, if 279 // AVFoundation calls from a number of threads, depending on, at least, if
280 // Chrome is on foreground or background. Sample the actual thread here. 280 // Chrome is on foreground or background. Sample the actual thread here.
281 callback_thread_checker_.DetachFromThread(); 281 callback_thread_checker_.DetachFromThread();
282 callback_thread_checker_.CalledOnValidThread(); 282 CHECK(callback_thread_checker_.CalledOnValidThread());
283 283
284 const CoreMediaGlue::CMFormatDescriptionRef formatDescription = 284 const CoreMediaGlue::CMFormatDescriptionRef formatDescription =
285 CoreMediaGlue::CMSampleBufferGetFormatDescription(sampleBuffer); 285 CoreMediaGlue::CMSampleBufferGetFormatDescription(sampleBuffer);
286 const FourCharCode fourcc = 286 const FourCharCode fourcc =
287 CoreMediaGlue::CMFormatDescriptionGetMediaSubType(formatDescription); 287 CoreMediaGlue::CMFormatDescriptionGetMediaSubType(formatDescription);
288 const CoreMediaGlue::CMVideoDimensions dimensions = 288 const CoreMediaGlue::CMVideoDimensions dimensions =
289 CoreMediaGlue::CMVideoFormatDescriptionGetDimensions(formatDescription); 289 CoreMediaGlue::CMVideoFormatDescriptionGetDimensions(formatDescription);
290 const media::VideoCaptureFormat captureFormat( 290 const media::VideoCaptureFormat captureFormat(
291 gfx::Size(dimensions.width, dimensions.height), 291 gfx::Size(dimensions.width, dimensions.height),
292 frameRate_, 292 frameRate_,
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 } 342 }
343 343
344 - (void)sendErrorString:(NSString*)error { 344 - (void)sendErrorString:(NSString*)error {
345 DLOG(ERROR) << [error UTF8String]; 345 DLOG(ERROR) << [error UTF8String];
346 base::AutoLock lock(lock_); 346 base::AutoLock lock(lock_);
347 if (frameReceiver_) 347 if (frameReceiver_)
348 frameReceiver_->ReceiveError([error UTF8String]); 348 frameReceiver_->ReceiveError([error UTF8String]);
349 } 349 }
350 350
351 @end 351 @end
OLDNEW
« no previous file with comments | « content/renderer/scheduler/web_scheduler_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698