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

Side by Side Diff: content/renderer/media/media_stream_dispatcher.h

Issue 287383002: Implement getMediaDevices. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 6 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 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DISPATCHER_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DISPATCHER_H_
6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DISPATCHER_H_ 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DISPATCHER_H_
7 7
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 // Cancel the request for a new media stream to be created. 50 // Cancel the request for a new media stream to be created.
51 virtual void CancelGenerateStream( 51 virtual void CancelGenerateStream(
52 int request_id, 52 int request_id,
53 const base::WeakPtr<MediaStreamDispatcherEventHandler>& event_handler); 53 const base::WeakPtr<MediaStreamDispatcherEventHandler>& event_handler);
54 54
55 // Stop a started device that has been requested by calling GenerateStream. 55 // Stop a started device that has been requested by calling GenerateStream.
56 virtual void StopStreamDevice(const StreamDeviceInfo& device_info); 56 virtual void StopStreamDevice(const StreamDeviceInfo& device_info);
57 57
58 // Request to enumerate devices. 58 // Request to enumerate devices.
59 void EnumerateDevices( 59 virtual void EnumerateDevices(
60 int request_id, 60 int request_id,
61 const base::WeakPtr<MediaStreamDispatcherEventHandler>& event_handler, 61 const base::WeakPtr<MediaStreamDispatcherEventHandler>& event_handler,
62 MediaStreamType type, 62 MediaStreamType type,
63 const GURL& security_origin); 63 const GURL& security_origin);
64 64
65 // Request to stop enumerating devices. 65 // Request to stop enumerating devices.
66 void StopEnumerateDevices( 66 void StopEnumerateDevices(
67 int request_id, 67 int request_id,
68 const base::WeakPtr<MediaStreamDispatcherEventHandler>& event_handler); 68 const base::WeakPtr<MediaStreamDispatcherEventHandler>& event_handler);
69 69
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 const StreamDeviceInfoArray& audio_array, 116 const StreamDeviceInfoArray& audio_array,
117 const StreamDeviceInfoArray& video_array); 117 const StreamDeviceInfoArray& video_array);
118 void OnStreamGenerationFailed( 118 void OnStreamGenerationFailed(
119 int request_id, 119 int request_id,
120 content::MediaStreamRequestResult result); 120 content::MediaStreamRequestResult result);
121 void OnDeviceStopped(const std::string& label, 121 void OnDeviceStopped(const std::string& label,
122 const StreamDeviceInfo& device_info); 122 const StreamDeviceInfo& device_info);
123 void OnDevicesEnumerated( 123 void OnDevicesEnumerated(
124 int request_id, 124 int request_id,
125 const StreamDeviceInfoArray& device_array); 125 const StreamDeviceInfoArray& device_array);
126 void OnDevicesEnumerationFailed(int request_id);
127 void OnDeviceOpened( 126 void OnDeviceOpened(
128 int request_id, 127 int request_id,
129 const std::string& label, 128 const std::string& label,
130 const StreamDeviceInfo& device_info); 129 const StreamDeviceInfo& device_info);
131 void OnDeviceOpenFailed(int request_id); 130 void OnDeviceOpenFailed(int request_id);
132 131
133 // Used for DCHECKs so methods calls won't execute in the wrong thread. 132 // Used for DCHECKs so methods calls won't execute in the wrong thread.
134 scoped_refptr<base::MessageLoopProxy> main_loop_; 133 scoped_refptr<base::MessageLoopProxy> main_loop_;
135 134
136 int next_ipc_id_; 135 int next_ipc_id_;
137 typedef std::map<std::string, Stream> LabelStreamMap; 136 typedef std::map<std::string, Stream> LabelStreamMap;
138 LabelStreamMap label_stream_map_; 137 LabelStreamMap label_stream_map_;
139 138
140 // List of calls made to the browser process that have not yet completed or 139 // List of calls made to the browser process that have not yet completed or
141 // been canceled. 140 // been canceled.
142 typedef std::list<Request> RequestList; 141 typedef std::list<Request> RequestList;
143 RequestList requests_; 142 RequestList requests_;
144 143
145 DISALLOW_COPY_AND_ASSIGN(MediaStreamDispatcher); 144 DISALLOW_COPY_AND_ASSIGN(MediaStreamDispatcher);
146 }; 145 };
147 146
148 } // namespace content 147 } // namespace content
149 148
150 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DISPATCHER_H_ 149 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DISPATCHER_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | content/renderer/media/media_stream_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698