| OLD | NEW |
| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 CoreMediaGlue::CMVideoFormatDescriptionGetDimensions( | 74 CoreMediaGlue::CMVideoFormatDescriptionGetDimensions( |
| 75 [format formatDescription]); | 75 [format formatDescription]); |
| 76 | 76 |
| 77 for (CrAVFrameRateRange* frameRate in | 77 for (CrAVFrameRateRange* frameRate in |
| 78 [format videoSupportedFrameRateRanges]) { | 78 [format videoSupportedFrameRateRanges]) { |
| 79 media::VideoCaptureFormat format( | 79 media::VideoCaptureFormat format( |
| 80 gfx::Size(dimensions.width, dimensions.height), | 80 gfx::Size(dimensions.width, dimensions.height), |
| 81 frameRate.maxFrameRate, | 81 frameRate.maxFrameRate, |
| 82 pixelFormat); | 82 pixelFormat); |
| 83 formats->push_back(format); | 83 formats->push_back(format); |
| 84 DVLOG(2) << name.name() << " resolution: " | 84 DVLOG(2) << name.name() << " " << format.ToString(); |
| 85 << format.frame_size.ToString() << ", fps: " | |
| 86 << format.frame_rate << ", pixel format: " | |
| 87 << format.pixel_format; | |
| 88 } | 85 } |
| 89 } | 86 } |
| 90 | 87 |
| 91 } | 88 } |
| 92 | 89 |
| 93 #pragma mark Public methods | 90 #pragma mark Public methods |
| 94 | 91 |
| 95 - (id)initWithFrameReceiver:(media::VideoCaptureDeviceMac*)frameReceiver { | 92 - (id)initWithFrameReceiver:(media::VideoCaptureDeviceMac*)frameReceiver { |
| 96 if ((self = [super init])) { | 93 if ((self = [super init])) { |
| 97 DCHECK(main_thread_checker_.CalledOnValidThread()); | 94 DCHECK(main_thread_checker_.CalledOnValidThread()); |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 } | 287 } |
| 291 | 288 |
| 292 - (void)sendErrorString:(NSString*)error { | 289 - (void)sendErrorString:(NSString*)error { |
| 293 DLOG(ERROR) << [error UTF8String]; | 290 DLOG(ERROR) << [error UTF8String]; |
| 294 base::AutoLock lock(lock_); | 291 base::AutoLock lock(lock_); |
| 295 if (frameReceiver_) | 292 if (frameReceiver_) |
| 296 frameReceiver_->ReceiveError([error UTF8String]); | 293 frameReceiver_->ReceiveError([error UTF8String]); |
| 297 } | 294 } |
| 298 | 295 |
| 299 @end | 296 @end |
| OLD | NEW |