| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // MacOSX implementation of generic VideoCaptureDevice, using either QTKit or | 5 // MacOSX implementation of generic VideoCaptureDevice, using either QTKit or |
| 6 // AVFoundation as native capture API. QTKit is used in OSX versions 10.6 and | 6 // AVFoundation as native capture API. QTKit is used in OSX versions 10.6 and |
| 7 // previous, and AVFoundation is used in the rest. | 7 // previous, and AVFoundation is used in the rest. |
| 8 | 8 |
| 9 #ifndef MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ | 9 #ifndef MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ |
| 10 #define MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ | 10 #define MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ |
| 11 | 11 |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "base/message_loop/message_loop_proxy.h" | |
| 18 #include "media/video/capture/video_capture_device.h" | 17 #include "media/video/capture/video_capture_device.h" |
| 19 #include "media/video/capture/video_capture_types.h" | 18 #include "media/video/capture/video_capture_types.h" |
| 20 | 19 |
| 21 @protocol PlatformVideoCapturingMac; | 20 @protocol PlatformVideoCapturingMac; |
| 22 | 21 |
| 23 namespace media { | 22 namespace media { |
| 24 | 23 |
| 25 // Called by VideoCaptureManager to open, close and start, stop video capture | 24 // Called by VideoCaptureManager to open, close and start, stop video capture |
| 26 // devices. | 25 // devices. |
| 27 class VideoCaptureDeviceMac : public VideoCaptureDevice { | 26 class VideoCaptureDeviceMac : public VideoCaptureDevice { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 }; | 58 }; |
| 60 | 59 |
| 61 Name device_name_; | 60 Name device_name_; |
| 62 scoped_ptr<VideoCaptureDevice::Client> client_; | 61 scoped_ptr<VideoCaptureDevice::Client> client_; |
| 63 | 62 |
| 64 VideoCaptureCapability current_settings_; | 63 VideoCaptureCapability current_settings_; |
| 65 bool sent_frame_info_; | 64 bool sent_frame_info_; |
| 66 bool tried_to_square_pixels_; | 65 bool tried_to_square_pixels_; |
| 67 | 66 |
| 68 // Only read and write state_ from inside this loop. | 67 // Only read and write state_ from inside this loop. |
| 69 const scoped_refptr<base::MessageLoopProxy> loop_proxy_; | 68 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 70 InternalState state_; | 69 InternalState state_; |
| 71 | 70 |
| 72 // Used with Bind and PostTask to ensure that methods aren't called | 71 // Used with Bind and PostTask to ensure that methods aren't called |
| 73 // after the VideoCaptureDeviceMac is destroyed. | 72 // after the VideoCaptureDeviceMac is destroyed. |
| 74 base::WeakPtrFactory<VideoCaptureDeviceMac> weak_factory_; | 73 base::WeakPtrFactory<VideoCaptureDeviceMac> weak_factory_; |
| 75 base::WeakPtr<VideoCaptureDeviceMac> weak_this_; | 74 base::WeakPtr<VideoCaptureDeviceMac> weak_this_; |
| 76 | 75 |
| 77 id<PlatformVideoCapturingMac> capture_device_; | 76 id<PlatformVideoCapturingMac> capture_device_; |
| 78 | 77 |
| 79 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceMac); | 78 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceMac); |
| 80 }; | 79 }; |
| 81 | 80 |
| 82 } // namespace media | 81 } // namespace media |
| 83 | 82 |
| 84 #endif // MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ | 83 #endif // MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ |
| OLD | NEW |