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

Side by Side Diff: media/video/capture/mac/video_capture_device_mac.h

Issue 10905134: use lock to make sure device will not deliver any frame after it's stopped. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
OLDNEW
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 // OS X implementation of VideoCaptureDevice, using QTKit as native capture API. 5 // OS X implementation of VideoCaptureDevice, using QTKit as native capture API.
6 6
7 #ifndef MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ 7 #ifndef MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_
8 #define MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ 8 #define MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_
9 9
10 #include <string> 10 #include <string>
11 11
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/synchronization/lock.h"
13 #include "media/video/capture/video_capture_device.h" 14 #include "media/video/capture/video_capture_device.h"
14 #include "media/video/capture/video_capture_types.h" 15 #include "media/video/capture/video_capture_types.h"
15 16
16 @class VideoCaptureDeviceQTKit; 17 @class VideoCaptureDeviceQTKit;
17 18
18 namespace media { 19 namespace media {
19 20
20 // Called by VideoCaptureManager to open, close and start, stop video capture 21 // Called by VideoCaptureManager to open, close and start, stop video capture
21 // devices. 22 // devices.
22 class VideoCaptureDeviceMac : public VideoCaptureDevice { 23 class VideoCaptureDeviceMac : public VideoCaptureDevice {
(...skipping 25 matching lines...) Expand all
48 kNotInitialized, 49 kNotInitialized,
49 kIdle, 50 kIdle,
50 kAllocated, 51 kAllocated,
51 kCapturing, 52 kCapturing,
52 kError 53 kError
53 }; 54 };
54 55
55 VideoCaptureDevice::Name device_name_; 56 VideoCaptureDevice::Name device_name_;
56 VideoCaptureDevice::EventHandler* observer_; 57 VideoCaptureDevice::EventHandler* observer_;
57 InternalState state_; 58 InternalState state_;
59 base::Lock lock_;
58 60
59 VideoCaptureDeviceQTKit* capture_device_; 61 VideoCaptureDeviceQTKit* capture_device_;
60 62
61 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceMac); 63 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceMac);
62 }; 64 };
63 65
64 } // namespace media 66 } // namespace media
65 67
66 #endif // MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ 68 #endif // MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698