OLD | NEW |
---|---|
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 24 matching lines...) Expand all Loading... | |
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 |
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 |
45 virtual void VideoDevicesEnumerated(const std::string& label, | |
46 const StreamDeviceInfoArray& devices); | |
47 virtual void VideoDevicesEnumerationFailed(const std::string& label); | |
48 virtual void VideoDeviceOpened(const std::string& label, | |
mflodman_chromium_OOO
2011/11/29 02:30:56
Q: Since we'll support audio in the future(?), wha
wjia(left Chromium)
2011/11/30 00:14:23
Done. I thought the first step is to make video wo
| |
49 const StreamDeviceInfo& video_device); | |
50 virtual void VideoDeviceOpenFailed(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 OnEnumerateVideoDevices(int render_view_id, | |
68 int page_request_id, | |
69 const std::string& security_origin); | |
70 | |
71 void OnOpenVideoDevice(int render_view_id, | |
72 int page_request_id, | |
73 const std::string& device_id, | |
74 const std::string& security_origin); | |
75 | |
60 // Returns the media stream manager to forward events to, | 76 // Returns the media stream manager to forward events to, |
61 // creating one if needed. | 77 // creating one if needed. |
62 MediaStreamManager* manager(); | 78 MediaStreamManager* manager(); |
63 | 79 |
64 const content::ResourceContext* resource_context_; | 80 const content::ResourceContext* resource_context_; |
65 int render_process_id_; | 81 int render_process_id_; |
66 | 82 |
67 struct StreamRequest; | 83 struct StreamRequest; |
68 typedef std::map<std::string, StreamRequest> StreamMap; | 84 typedef std::map<std::string, StreamRequest> StreamMap; |
69 // Streams generated for this host. | 85 // Streams generated for this host. |
70 StreamMap streams_; | 86 StreamMap streams_; |
71 | 87 |
72 DISALLOW_COPY_AND_ASSIGN(MediaStreamDispatcherHost); | 88 DISALLOW_COPY_AND_ASSIGN(MediaStreamDispatcherHost); |
73 }; | 89 }; |
74 | 90 |
75 } // namespace media_stream | 91 } // namespace media_stream |
76 | 92 |
77 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_ | 93 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_ |
OLD | NEW |