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_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> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
15 #include "content/common/media/media_stream_options.h" | 15 #include "content/common/media/media_stream_options.h" |
16 #include "content/public/renderer/render_view_observer.h" | 16 #include "content/public/renderer/render_view_observer.h" |
17 #include "content/renderer/media/media_stream_dispatcher_eventhandler.h" | 17 #include "content/renderer/media/media_stream_dispatcher_eventhandler.h" |
18 | 18 |
| 19 class RenderViewImpl; |
| 20 |
19 // MediaStreamDispatcher is a delegate for the Media Stream API messages. | 21 // MediaStreamDispatcher is a delegate for the Media Stream API messages. |
20 // MediaStreams are used by WebKit to open media devices such as Video Capture | 22 // MediaStreams are used by WebKit to open media devices such as Video Capture |
21 // and Audio input devices. | 23 // and Audio input devices. |
22 // It's the complement of MediaStreamDispatcherHost (owned by | 24 // It's the complement of MediaStreamDispatcherHost (owned by |
23 // BrowserRenderProcessHost). | 25 // BrowserRenderProcessHost). |
24 class CONTENT_EXPORT MediaStreamDispatcher | 26 class CONTENT_EXPORT MediaStreamDispatcher |
25 : public content::RenderViewObserver { | 27 : public content::RenderViewObserver { |
26 public: | 28 public: |
27 explicit MediaStreamDispatcher(RenderView* render_view); | 29 explicit MediaStreamDispatcher(RenderViewImpl* render_view); |
28 virtual ~MediaStreamDispatcher(); | 30 virtual ~MediaStreamDispatcher(); |
29 | 31 |
30 // Request a new media stream to be created. | 32 // Request a new media stream to be created. |
31 // This can be used either of WebKit or a plugin. | 33 // This can be used either of WebKit or a plugin. |
32 // Note: The event_handler must be valid for as long as the stream exists. | 34 // Note: The event_handler must be valid for as long as the stream exists. |
33 void GenerateStream(int request_id, | 35 void GenerateStream(int request_id, |
34 MediaStreamDispatcherEventHandler* event_handler, | 36 MediaStreamDispatcherEventHandler* event_handler, |
35 media_stream::StreamOptions components, | 37 media_stream::StreamOptions components, |
36 const std::string& security_origin); | 38 const std::string& security_origin); |
37 | 39 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 LabelStreamMap label_stream_map_; | 91 LabelStreamMap label_stream_map_; |
90 | 92 |
91 // List of calls made to GenerateStream that has not yet completed. | 93 // List of calls made to GenerateStream that has not yet completed. |
92 typedef std::list<Request> RequestList; | 94 typedef std::list<Request> RequestList; |
93 RequestList requests_; | 95 RequestList requests_; |
94 | 96 |
95 DISALLOW_COPY_AND_ASSIGN(MediaStreamDispatcher); | 97 DISALLOW_COPY_AND_ASSIGN(MediaStreamDispatcher); |
96 }; | 98 }; |
97 | 99 |
98 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DISPATCHER_H_ | 100 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DISPATCHER_H_ |
OLD | NEW |