summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authornick@chromium.org <nick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-12 22:21:51 +0000
committernick@chromium.org <nick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-12 22:21:51 +0000
commit8f5815242ddd4e395a4fa8259c578e66eacd7b5e (patch)
treef532faee488b39097ccc0afbb731eb21f7ab26a2 /media
parentf800f9b964b97c62d905d7fc63676b9361b70b42 (diff)
downloadchromium_src-8f5815242ddd4e395a4fa8259c578e66eacd7b5e.zip
chromium_src-8f5815242ddd4e395a4fa8259c578e66eacd7b5e.tar.gz
chromium_src-8f5815242ddd4e395a4fa8259c578e66eacd7b5e.tar.bz2
Rewrite VideoCaptureManager to streamline the lifetimes of
VideoCaptureController vs. VideoCaptureDevice. The goal of this change is to eliminate code and statefulness from VCM, VCC and VCD and to move towards more consistent threading behavior. Move most of the state of the VCM to the IO thread only. Track both the VCC and the VCD objects in a single collection that lives on the IO thread. Move the allocation of the Controller to the IO thread. Always allocate a Controller before a Device, and have the Controller outlive its Device. Device creation and destruction is farmed out to the device thread, but the decision to create or destroy occurs on the IO thread. VCM::Open() no longer creates the device but instead just records the ID of the device to be created. De-duplication of active devices will occur when a client actually Starts() a session. From the Controller, the changes to the VCM enable some simplifications here. Remove the notion of pending_clients_ and device restart. This is possible to do because the decision of which devices are open lives on the IO thread, so we don't have to worry about inconsistencies. Grant the Controller sole responsibility for tracking its clients, rather than having the Manager maintain a parallel list of handlers. In turn, the Manager asks the Controller how many clients remain, and takes on responsibility for actually starting and stopping the Device. Removing the Controller's calls into the manager enables some new unit tests on the public API of the Controller. Two small, subtle bugfixes are included: [1] In VCC, we were sometimes still delivering events to clients after |session_close|. This was uncovered by unit tests. [2] In VCM, the "in_use" state of devices (meaning whether any client had opened the device) was being returned to the MediaStreamManager in the devices-enumerated event. This change sets it to always be false, as it would appear that the MSM intends |in_use| to indicate per- session, not a systemwide per- device, bit. Several new unit tests are included. TEST=Manual tests of windows webcam creation, basic tests of chromecast mirroring BUG=284829,289731,289684 Review URL: https://chromiumcodereview.appspot.com/22866015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222883 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r--media/video/capture/video_capture_device.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/media/video/capture/video_capture_device.h b/media/video/capture/video_capture_device.h
index 8ef43e7..0eaf39e 100644
--- a/media/video/capture/video_capture_device.h
+++ b/media/video/capture/video_capture_device.h
@@ -90,7 +90,7 @@ class MEDIA_EXPORT VideoCaptureDevice {
#if defined(OS_WIN)
// This class wraps the CaptureApiType, so it has a by default value if not
// inititalized, and I (mcasas) do a DCHECK on reading its value.
- class CaptureApiClass{
+ class CaptureApiClass {
public:
CaptureApiClass(): capture_api_type_(API_TYPE_UNKNOWN) {}
CaptureApiClass(const CaptureApiType api_type)