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

Unified Diff: content/renderer/media/media_stream_dispatcher.h

Issue 8480028: support video device enumeration from renderer process. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: code review Created 8 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/media/media_stream_messages.h ('k') | content/renderer/media/media_stream_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/media_stream_dispatcher.h
===================================================================
--- content/renderer/media/media_stream_dispatcher.h (revision 118766)
+++ content/renderer/media/media_stream_dispatcher.h (working copy)
@@ -41,6 +41,22 @@
// Stop a started stream. Label is the label provided in OnStreamGenerated.
virtual void StopStream(const std::string& label);
+ // Request to enumerate devices.
+ void EnumerateDevices(int request_id,
+ MediaStreamDispatcherEventHandler* event_handler,
+ media_stream::MediaStreamType type,
+ const std::string& security_origin);
+
+ // Request to open a device.
+ void OpenDevice(int request_id,
+ MediaStreamDispatcherEventHandler* event_handler,
+ const std::string& device_id,
+ media_stream::MediaStreamType type,
+ const std::string& security_origin);
+
+ // Close a started device. |label| is provided in OnDeviceOpened.
+ void CloseDevice(const std::string& label);
+
// Check if the label is a valid stream.
virtual bool IsStream(const std::string& label);
// Get the video session_id given a label. The label identifies a stream.
@@ -50,7 +66,8 @@
virtual int audio_session_id(const std::string& label, int index);
private:
- FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherTest, Basic);
+ FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherTest, BasicStream);
+ FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherTest, BasicVideoDevice);
FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherTest, TestFailure);
struct Request;
@@ -69,6 +86,15 @@
void OnStreamGenerationFailed(int request_id);
void OnVideoDeviceFailed(const std::string& label, int index);
void OnAudioDeviceFailed(const std::string& label, int index);
+ void OnDevicesEnumerated(
+ int request_id,
+ const media_stream::StreamDeviceInfoArray& device_array);
+ void OnDevicesEnumerationFailed(int request_id);
+ void OnDeviceOpened(
+ int request_id,
+ const std::string& label,
+ const media_stream::StreamDeviceInfo& device_info);
+ void OnDeviceOpenFailed(int request_id);
int next_ipc_id_;
typedef std::map<std::string, Stream> LabelStreamMap;
« no previous file with comments | « content/common/media/media_stream_messages.h ('k') | content/renderer/media/media_stream_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698