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() << " resolution: " | 84 DVLOG(2) << name.name() << " resolution: " |
85 << format.frame_size.ToString() << ", fps: " | 85 << format.frame_size.ToString() << ", fps: " |
86 << format.frame_rate << ", pixel format: " | 86 << format.frame_rate << ", pixel format: " |
87 << format.pixel_format; | 87 << format.pixel_format; |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 } | 290 } |
291 | 291 |
292 - (void)sendErrorString:(NSString*)error { | 292 - (void)sendErrorString:(NSString*)error { |
293 DLOG(ERROR) << [error UTF8String]; | 293 DLOG(ERROR) << [error UTF8String]; |
294 base::AutoLock lock(lock_); | 294 base::AutoLock lock(lock_); |
295 if (frameReceiver_) | 295 if (frameReceiver_) |
296 frameReceiver_->ReceiveError([error UTF8String]); | 296 frameReceiver_->ReceiveError([error UTF8String]); |
297 } | 297 } |
298 | 298 |
299 @end | 299 @end |
OLD | NEW |