diff options
author | wjia@chromium.org <wjia@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-25 23:31:02 +0000 |
---|---|---|
committer | wjia@chromium.org <wjia@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-25 23:31:02 +0000 |
commit | 735873dcf6f73eb6a38a78f858733b827422802f (patch) | |
tree | d5ffae2ab9b780b6aaedcf58d229b4fad6e2a83b /content/common/media/media_stream_messages.h | |
parent | 1bd895d821f5db07e6b844f7c36462a24b5f652d (diff) | |
download | chromium_src-735873dcf6f73eb6a38a78f858733b827422802f.zip chromium_src-735873dcf6f73eb6a38a78f858733b827422802f.tar.gz chromium_src-735873dcf6f73eb6a38a78f858733b827422802f.tar.bz2 |
support video device enumeration from renderer process.
1. renderer process sends EnumerateDevices message to browser process, and expect DevicesEnumerated or DeivcesEnumerationFailed message.
2. renderer process sends OpenDevice message to browser process, and expect DeviceOpened or DeviceOpenFailed message.
3. after renderer process gets DeviceOpened message, it can use |label| to get the session_id which is the identifier to Start/Stop video capture.
4. renderer process re-uses StopGeneratedStream for CloseOpenedDevice.
5. simplify interface between MediaStreamManager and MediaStreamDeviceSettings by removing GetDevices function call.
The test example code is at http://codereview.chromium.org/8511074/
BUG=41777
TEST=trybots
Review URL: https://chromiumcodereview.appspot.com/8480028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119139 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common/media/media_stream_messages.h')
-rw-r--r-- | content/common/media/media_stream_messages.h | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/content/common/media/media_stream_messages.h b/content/common/media/media_stream_messages.h index 3f9d3df..a58e097 100644 --- a/content/common/media/media_stream_messages.h +++ b/content/common/media/media_stream_messages.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -51,6 +51,27 @@ IPC_MESSAGE_ROUTED2(MediaStreamHostMsg_AudioDeviceFailed, std::string /* label */, int /* index */) +// The browser has enumerated devices successfully. +IPC_MESSAGE_ROUTED2(MediaStreamMsg_DevicesEnumerated, + int /* request id */, + media_stream::StreamDeviceInfoArray /* device_list */) + +// The browser has failed to enumerate devices. +IPC_MESSAGE_ROUTED1(MediaStreamMsg_DevicesEnumerationFailed, + int /* request id */) + +// TODO(wjia): should DeviceOpen* messages be merged with +// StreamGenerat* ones? +// The browser has opened a device successfully. +IPC_MESSAGE_ROUTED3(MediaStreamMsg_DeviceOpened, + int /* request id */, + std::string /* label */, + media_stream::StreamDeviceInfo /* the device */) + +// The browser has failed to open a device. +IPC_MESSAGE_ROUTED1(MediaStreamMsg_DeviceOpenFailed, + int /* request id */) + // Messages sent from the renderer to the browser. // Request a new media stream. @@ -64,3 +85,18 @@ IPC_MESSAGE_CONTROL4(MediaStreamHostMsg_GenerateStream, IPC_MESSAGE_CONTROL2(MediaStreamHostMsg_StopGeneratedStream, int /* render view id */, std::string /* label */) + +// Request to enumerate devices. +IPC_MESSAGE_CONTROL4(MediaStreamHostMsg_EnumerateDevices, + int /* render view id */, + int /* request id */, + media_stream::MediaStreamType /* type */, + std::string /* security origin */) + +// Request to open the device. +IPC_MESSAGE_CONTROL5(MediaStreamHostMsg_OpenDevice, + int /* render view id */, + int /* request id */, + std::string /* device_id */, + media_stream::MediaStreamType /* type */, + std::string /* security origin */) |