OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // VideoCaptureImplManager manages video capture devices in renderer process. | 5 // VideoCaptureImplManager manages video capture devices in renderer process. |
6 // The video capture clients use AddDevice() to get a pointer to | 6 // The video capture clients use AddDevice() to get a pointer to |
7 // video capture device. VideoCaputreImplManager supports multiple clients | 7 // video capture device. VideoCaputreImplManager supports multiple clients |
8 // accessing same device. | 8 // accessing same device. |
9 | 9 |
10 #ifndef CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_MANAGER_H_ | 10 #ifndef CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_MANAGER_H_ |
(...skipping 28 matching lines...) Expand all Loading... |
39 static void RemoveDevice(media::VideoCaptureSessionId id, | 39 static void RemoveDevice(media::VideoCaptureSessionId id, |
40 media::VideoCapture::EventHandler* handler); | 40 media::VideoCapture::EventHandler* handler); |
41 | 41 |
42 static VideoCaptureImplManager* GetInstance(); | 42 static VideoCaptureImplManager* GetInstance(); |
43 | 43 |
44 private: | 44 private: |
45 struct Device { | 45 struct Device { |
46 Device(); | 46 Device(); |
47 Device(VideoCaptureImpl* device, | 47 Device(VideoCaptureImpl* device, |
48 media::VideoCapture::EventHandler* handler); | 48 media::VideoCapture::EventHandler* handler); |
| 49 ~Device(); |
49 | 50 |
50 VideoCaptureImpl* vc; | 51 VideoCaptureImpl* vc; |
51 std::list<media::VideoCapture::EventHandler*> clients; | 52 std::list<media::VideoCapture::EventHandler*> clients; |
52 }; | 53 }; |
53 | 54 |
54 void FreeDevice(VideoCaptureImpl* vc); | 55 void FreeDevice(VideoCaptureImpl* vc); |
55 | 56 |
56 typedef std::map<media::VideoCaptureSessionId, Device> Devices; | 57 typedef std::map<media::VideoCaptureSessionId, Device> Devices; |
57 Devices devices_; | 58 Devices devices_; |
58 base::Lock lock_; | 59 base::Lock lock_; |
59 scoped_refptr<base::MessageLoopProxy> ml_proxy_; | 60 scoped_refptr<base::MessageLoopProxy> ml_proxy_; |
60 scoped_ptr<media::MessageLoopFactory> ml_factory_; | 61 scoped_ptr<media::MessageLoopFactory> ml_factory_; |
61 | 62 |
62 DISALLOW_COPY_AND_ASSIGN(VideoCaptureImplManager); | 63 DISALLOW_COPY_AND_ASSIGN(VideoCaptureImplManager); |
63 }; | 64 }; |
64 | 65 |
65 DISABLE_RUNNABLE_METHOD_REFCOUNT(VideoCaptureImplManager); | 66 DISABLE_RUNNABLE_METHOD_REFCOUNT(VideoCaptureImplManager); |
66 | 67 |
67 #endif // CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_MANAGER_H_ | 68 #endif // CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_MANAGER_H_ |
OLD | NEW |