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

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

Issue 84393002: Revert 236927 "Reorganize media::VideoCapture* types" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years 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. Some helper 7 // All functions are expected to be called from Browser::IO thread. Some helper
8 // functions (*OnDeviceThread) will dispatch operations to the device thread. 8 // functions (*OnDeviceThread) will dispatch operations to the device thread.
9 // VideoCaptureManager will open OS dependent instances of VideoCaptureDevice. 9 // VideoCaptureManager will open OS dependent instances of VideoCaptureDevice.
10 // A device can only be opened once. 10 // A device can only be opened once.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 virtual void Close(int capture_session_id) OVERRIDE; 52 virtual void Close(int capture_session_id) OVERRIDE;
53 53
54 // Used by unit test to make sure a fake device is used instead of a real 54 // Used by unit test to make sure a fake device is used instead of a real
55 // video capture device. Due to timing requirements, the function must be 55 // video capture device. Due to timing requirements, the function must be
56 // called before EnumerateDevices and Open. 56 // called before EnumerateDevices and Open.
57 void UseFakeDevice(); 57 void UseFakeDevice();
58 58
59 // Called by VideoCaptureHost to locate a capture device for |capture_params|, 59 // Called by VideoCaptureHost to locate a capture device for |capture_params|,
60 // adding the Host as a client of the device's controller if successful. The 60 // adding the Host as a client of the device's controller if successful. The
61 // value of |session_id| controls which device is selected; 61 // value of |capture_params.session_id| controls which device is selected;
62 // this value should be a session id previously returned by Open(). 62 // this value should be a session id previously returned by Open().
63 // 63 //
64 // If the device is not already started (i.e., no other client is currently 64 // If the device is not already started (i.e., no other client is currently
65 // capturing from this device), this call will cause a VideoCaptureController 65 // capturing from this device), this call will cause a VideoCaptureController
66 // and VideoCaptureDevice to be created, possibly asynchronously. 66 // and VideoCaptureDevice to be created, possibly asynchronously.
67 // 67 //
68 // On success, the controller is returned via calling |done_cb|, indicating 68 // On success, the controller is returned via calling |done_cb|, indicating
69 // that the client was successfully added. A NULL controller is passed to 69 // that the client was successfully added. A NULL controller is passed to
70 // the callback on failure. 70 // the callback on failure.
71 void StartCaptureForClient(media::VideoCaptureSessionId session_id, 71 void StartCaptureForClient(const media::VideoCaptureParams& capture_params,
72 const media::VideoCaptureParams& capture_params,
73 base::ProcessHandle client_render_process, 72 base::ProcessHandle client_render_process,
74 VideoCaptureControllerID client_id, 73 VideoCaptureControllerID client_id,
75 VideoCaptureControllerEventHandler* client_handler, 74 VideoCaptureControllerEventHandler* client_handler,
76 const DoneCB& done_cb); 75 const DoneCB& done_cb);
77 76
78 // Called by VideoCaptureHost to remove |client_handler|. If this is the last 77 // Called by VideoCaptureHost to remove |client_handler|. If this is the last
79 // client of the device, the |controller| and its VideoCaptureDevice may be 78 // client of the device, the |controller| and its VideoCaptureDevice may be
80 // destroyed. The client must not access |controller| after calling this 79 // destroyed. The client must not access |controller| after calling this
81 // function. 80 // function.
82 void StopCaptureForClient(VideoCaptureController* controller, 81 void StopCaptureForClient(VideoCaptureController* controller,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 113
115 // Queries and returns the available device IDs. 114 // Queries and returns the available device IDs.
116 media::VideoCaptureDevice::Names GetAvailableDevicesOnDeviceThread( 115 media::VideoCaptureDevice::Names GetAvailableDevicesOnDeviceThread(
117 MediaStreamType stream_type); 116 MediaStreamType stream_type);
118 117
119 // Create and Start a new VideoCaptureDevice, storing the result in 118 // Create and Start a new VideoCaptureDevice, storing the result in
120 // |entry->video_capture_device|. Ownership of |client| passes to 119 // |entry->video_capture_device|. Ownership of |client| passes to
121 // the device. 120 // the device.
122 void DoStartDeviceOnDeviceThread( 121 void DoStartDeviceOnDeviceThread(
123 DeviceEntry* entry, 122 DeviceEntry* entry,
124 const media::VideoCaptureParams& params, 123 const media::VideoCaptureCapability& capture_params,
125 scoped_ptr<media::VideoCaptureDevice::Client> client); 124 scoped_ptr<media::VideoCaptureDevice::Client> client);
126 125
127 // Stop and destroy the VideoCaptureDevice held in 126 // Stop and destroy the VideoCaptureDevice held in
128 // |entry->video_capture_device|. 127 // |entry->video_capture_device|.
129 void DoStopDeviceOnDeviceThread(DeviceEntry* entry); 128 void DoStopDeviceOnDeviceThread(DeviceEntry* entry);
130 129
131 // The message loop of media stream device thread, where VCD's live. 130 // The message loop of media stream device thread, where VCD's live.
132 scoped_refptr<base::MessageLoopProxy> device_loop_; 131 scoped_refptr<base::MessageLoopProxy> device_loop_;
133 132
134 // Only accessed on Browser::IO thread. 133 // Only accessed on Browser::IO thread.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 // when a device is created in DoStartDeviceOnDeviceThread(). Used only on the 176 // when a device is created in DoStartDeviceOnDeviceThread(). Used only on the
178 // device thread. 177 // device thread.
179 media::VideoCaptureDevice::Names video_capture_devices_; 178 media::VideoCaptureDevice::Names video_capture_devices_;
180 179
181 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); 180 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager);
182 }; 181 };
183 182
184 } // namespace content 183 } // namespace content
185 184
186 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ 185 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698