| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 break; | 63 break; |
| 64 case CoreMediaGlue::kCMPixelFormat_422YpCbCr8_yuvs: | 64 case CoreMediaGlue::kCMPixelFormat_422YpCbCr8_yuvs: |
| 65 pixelFormat = media::PIXEL_FORMAT_YUY2; | 65 pixelFormat = media::PIXEL_FORMAT_YUY2; |
| 66 break; | 66 break; |
| 67 case CoreMediaGlue::kCMVideoCodecType_JPEG_OpenDML: | 67 case CoreMediaGlue::kCMVideoCodecType_JPEG_OpenDML: |
| 68 pixelFormat = media::PIXEL_FORMAT_MJPEG; | 68 pixelFormat = media::PIXEL_FORMAT_MJPEG; |
| 69 default: | 69 default: |
| 70 break; | 70 break; |
| 71 } | 71 } |
| 72 | 72 |
| 73 CoreMediaGlue::CMVideoDimensions dimensions = | 73 CoreMediaGlue::CMVideoDimensions dimensions = |
| 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() << " " << format.ToString(); | 84 DVLOG(2) << name.name() << " " << format.ToString(); |
| 85 } | 85 } |
| 86 } | 86 } |
| 87 | 87 |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 } | 287 } |
| 288 | 288 |
| 289 - (void)sendErrorString:(NSString*)error { | 289 - (void)sendErrorString:(NSString*)error { |
| 290 DLOG(ERROR) << [error UTF8String]; | 290 DLOG(ERROR) << [error UTF8String]; |
| 291 base::AutoLock lock(lock_); | 291 base::AutoLock lock(lock_); |
| 292 if (frameReceiver_) | 292 if (frameReceiver_) |
| 293 frameReceiver_->ReceiveError([error UTF8String]); | 293 frameReceiver_->ReceiveError([error UTF8String]); |
| 294 } | 294 } |
| 295 | 295 |
| 296 @end | 296 @end |
| OLD | NEW |