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

Side by Side Diff: content/browser/renderer_host/media/video_capture_manager.h

Issue 8589018: Close video capture devices on the device thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changes based on review by wjia. Created 9 years, 1 month 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
« no previous file with comments | « no previous file | content/browser/renderer_host/media/video_capture_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // VideoCaptureManager is used to open/close, start/stop, enumerate available 5 // VideoCaptureManager is used to open/close, start/stop, enumerate available
6 // video capture devices, and manage VideoCaptureController's. 6 // video capture devices, and manage VideoCaptureController's.
7 // All functions are expected to be called from Browser::IO thread. 7 // All functions are expected to be called from Browser::IO thread.
8 // VideoCaptureManager will open OS dependent instances of VideoCaptureDevice. 8 // VideoCaptureManager will open OS dependent instances of VideoCaptureDevice.
9 // A device can only be opened once. 9 // A device can only be opened once.
10 10
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 void PostOnError(int capture_session_id, MediaStreamProviderError error); 116 void PostOnError(int capture_session_id, MediaStreamProviderError error);
117 117
118 // Helpers 118 // Helpers
119 void GetAvailableDevices(media::VideoCaptureDevice::Names* device_names); 119 void GetAvailableDevices(media::VideoCaptureDevice::Names* device_names);
120 bool DeviceOpened(const media::VideoCaptureDevice::Name& device_name); 120 bool DeviceOpened(const media::VideoCaptureDevice::Name& device_name);
121 bool DeviceInUse(const media::VideoCaptureDevice* video_capture_device); 121 bool DeviceInUse(const media::VideoCaptureDevice* video_capture_device);
122 media::VideoCaptureDevice* GetOpenedDevice( 122 media::VideoCaptureDevice* GetOpenedDevice(
123 const StreamDeviceInfo& device_info); 123 const StreamDeviceInfo& device_info);
124 bool IsOnCaptureDeviceThread() const; 124 bool IsOnCaptureDeviceThread() const;
125 media::VideoCaptureDevice* GetDeviceInternal(int capture_session_id); 125 media::VideoCaptureDevice* GetDeviceInternal(int capture_session_id);
126 void TerminateOnDeviceThread();
126 127
127 // Thread for all calls to VideoCaptureDevice. 128 // Thread for all calls to VideoCaptureDevice.
128 base::Thread vc_device_thread_; 129 base::Thread vc_device_thread_;
129 130
130 // Only accessed on Browser::IO thread. 131 // Only accessed on Browser::IO thread.
131 MediaStreamProviderListener* listener_; 132 MediaStreamProviderListener* listener_;
132 int new_capture_session_id_; 133 int new_capture_session_id_;
133 134
134 // Only accessed from vc_device_thread_. 135 // Only accessed from vc_device_thread_.
135 // VideoCaptureManager owns all VideoCaptureDevices and is responsible for 136 // VideoCaptureManager owns all VideoCaptureDevices and is responsible for
(...skipping 12 matching lines...) Expand all
148 Controllers controllers_; 149 Controllers controllers_;
149 150
150 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); 151 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager);
151 }; 152 };
152 153
153 } // namespace media_stream 154 } // namespace media_stream
154 155
155 DISABLE_RUNNABLE_METHOD_REFCOUNT(media_stream::VideoCaptureManager); 156 DISABLE_RUNNABLE_METHOD_REFCOUNT(media_stream::VideoCaptureManager);
156 157
157 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ 158 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/media/video_capture_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698