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

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

Issue 9320070: Re-added OnChannelClosing in MediaStreamDispatcherHost to close open media devices. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Indentation after rebase. Created 8 years, 10 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 // 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();
127 126
128 // Thread for all calls to VideoCaptureDevice. 127 // Thread for all calls to VideoCaptureDevice.
129 base::Thread vc_device_thread_; 128 base::Thread vc_device_thread_;
130 129
131 // Only accessed on Browser::IO thread. 130 // Only accessed on Browser::IO thread.
132 MediaStreamProviderListener* listener_; 131 MediaStreamProviderListener* listener_;
133 int new_capture_session_id_; 132 int new_capture_session_id_;
134 133
135 // Only accessed from vc_device_thread_. 134 // Only accessed from vc_device_thread_.
136 // VideoCaptureManager owns all VideoCaptureDevices and is responsible for 135 // VideoCaptureManager owns all VideoCaptureDevices and is responsible for
(...skipping 10 matching lines...) Expand all
147 // VideoCaptureDevice is one-to-one mapped to VideoCaptureController. 146 // VideoCaptureDevice is one-to-one mapped to VideoCaptureController.
148 typedef std::map<media::VideoCaptureDevice*, Controller*> Controllers; 147 typedef std::map<media::VideoCaptureDevice*, Controller*> Controllers;
149 Controllers controllers_; 148 Controllers controllers_;
150 149
151 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); 150 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager);
152 }; 151 };
153 152
154 } // namespace media_stream 153 } // namespace media_stream
155 154
156 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ 155 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698