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

Side by Side Diff: content/browser/renderer_host/media/media_stream_dispatcher_host.h

Issue 8480028: support video device enumeration from renderer process. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: code review Created 9 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 19 matching lines...) Expand all
30 public: 30 public:
31 MediaStreamDispatcherHost(const content::ResourceContext* resource_context, 31 MediaStreamDispatcherHost(const content::ResourceContext* resource_context,
32 int render_process_id); 32 int render_process_id);
33 virtual ~MediaStreamDispatcherHost(); 33 virtual ~MediaStreamDispatcherHost();
34 34
35 // MediaStreamRequester implementation. 35 // MediaStreamRequester implementation.
36 virtual void StreamGenerated( 36 virtual void StreamGenerated(
37 const std::string& label, 37 const std::string& label,
38 const StreamDeviceInfoArray& audio_devices, 38 const StreamDeviceInfoArray& audio_devices,
39 const StreamDeviceInfoArray& video_devices) OVERRIDE; 39 const StreamDeviceInfoArray& video_devices) OVERRIDE;
40 40
mflodman_chromium_OOO 2011/12/02 18:44:02 Old code, but the empty line should be removed to
wjia(left Chromium) 2012/01/24 00:59:46 Done.
41 virtual void StreamGenerationFailed(const std::string& label) OVERRIDE; 41 virtual void StreamGenerationFailed(const std::string& label) OVERRIDE;
42 virtual void AudioDeviceFailed(const std::string& label, int index) OVERRIDE; 42 virtual void AudioDeviceFailed(const std::string& label, int index) OVERRIDE;
43 virtual void VideoDeviceFailed(const std::string& label, int index) OVERRIDE; 43 virtual void VideoDeviceFailed(const std::string& label, int index) OVERRIDE;
44 44
mflodman_chromium_OOO 2011/12/02 18:44:02 Remove empty line.
wjia(left Chromium) 2012/01/24 00:59:46 Done.
45 virtual void DevicesEnumerated(const std::string& label,
mflodman_chromium_OOO 2011/12/02 18:44:02 Here and below: OVERRIDE.
wjia(left Chromium) 2012/01/24 00:59:46 Done.
46 const StreamDeviceInfoArray& devices);
47 virtual void DevicesEnumerationFailed(const std::string& label);
48 virtual void DeviceOpened(const std::string& label,
49 const StreamDeviceInfo& video_device);
50 virtual void DeviceOpenFailed(const std::string& label);
51
45 // BrowserMessageFilter implementation. 52 // BrowserMessageFilter implementation.
46 virtual bool OnMessageReceived(const IPC::Message& message, 53 virtual bool OnMessageReceived(const IPC::Message& message,
47 bool* message_was_ok) OVERRIDE; 54 bool* message_was_ok) OVERRIDE;
48 virtual void OnChannelClosing() OVERRIDE; 55 virtual void OnChannelClosing() OVERRIDE;
49 56
50 private: 57 private:
51 friend class MockMediaStreamDispatcherHost; 58 friend class MockMediaStreamDispatcherHost;
52 59
53 void OnGenerateStream(int render_view_id, 60 void OnGenerateStream(int render_view_id,
54 int page_request_id, 61 int page_request_id,
55 const StreamOptions& components, 62 const StreamOptions& components,
56 const std::string& security_origin); 63 const std::string& security_origin);
57 64
58 void OnStopGeneratedStream(int render_view_id, const std::string& label); 65 void OnStopGeneratedStream(int render_view_id, const std::string& label);
59 66
67 void OnEnumerateDevices(int render_view_id,
68 int page_request_id,
69 media_stream::MediaStreamType type,
70 const std::string& security_origin);
71
72 void OnOpenDevice(int render_view_id,
73 int page_request_id,
74 const std::string& device_id,
75 media_stream::MediaStreamType type,
76 const std::string& security_origin);
77
60 // Returns the media stream manager to forward events to, 78 // Returns the media stream manager to forward events to,
61 // creating one if needed. 79 // creating one if needed.
62 MediaStreamManager* manager(); 80 MediaStreamManager* manager();
63 81
64 const content::ResourceContext* resource_context_; 82 const content::ResourceContext* resource_context_;
65 int render_process_id_; 83 int render_process_id_;
66 84
67 struct StreamRequest; 85 struct StreamRequest;
68 typedef std::map<std::string, StreamRequest> StreamMap; 86 typedef std::map<std::string, StreamRequest> StreamMap;
69 // Streams generated for this host. 87 // Streams generated for this host.
70 StreamMap streams_; 88 StreamMap streams_;
71 89
72 DISALLOW_COPY_AND_ASSIGN(MediaStreamDispatcherHost); 90 DISALLOW_COPY_AND_ASSIGN(MediaStreamDispatcherHost);
73 }; 91 };
74 92
75 } // namespace media_stream 93 } // namespace media_stream
76 94
77 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_ 95 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698