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 // VideoCaptureHost serves video capture related messages from | 5 // VideoCaptureHost serves video capture related messages from |
6 // VideCaptureMessageFilter which lives inside the render process. | 6 // VideCaptureMessageFilter which lives inside the render process. |
7 // | 7 // |
8 // This class is owned by BrowserRenderProcessHost, and instantiated on UI | 8 // This class is owned by BrowserRenderProcessHost, and instantiated on UI |
9 // thread, but all other operations and method calls happen on IO thread. | 9 // thread, but all other operations and method calls happen on IO thread. |
10 // | 10 // |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 #include <map> | 39 #include <map> |
40 | 40 |
41 #include "base/memory/ref_counted.h" | 41 #include "base/memory/ref_counted.h" |
42 #include "base/message_loop_helpers.h" | 42 #include "base/message_loop_helpers.h" |
43 #include "content/browser/renderer_host/media/video_capture_controller.h" | 43 #include "content/browser/renderer_host/media/video_capture_controller.h" |
44 #include "content/common/content_export.h" | 44 #include "content/common/content_export.h" |
45 #include "content/public/browser/browser_message_filter.h" | 45 #include "content/public/browser/browser_message_filter.h" |
46 #include "ipc/ipc_message.h" | 46 #include "ipc/ipc_message.h" |
47 | 47 |
48 class AudioManager; | |
49 | |
50 namespace content { | 48 namespace content { |
51 class ResourceContext; | 49 class ResourceContext; |
52 } // namespace content | 50 } // namespace content |
53 | 51 |
| 52 namespace media { |
| 53 class AudioManager; |
| 54 } |
| 55 |
54 class CONTENT_EXPORT VideoCaptureHost | 56 class CONTENT_EXPORT VideoCaptureHost |
55 : public content::BrowserMessageFilter, | 57 : public content::BrowserMessageFilter, |
56 public VideoCaptureControllerEventHandler { | 58 public VideoCaptureControllerEventHandler { |
57 public: | 59 public: |
58 explicit VideoCaptureHost(content::ResourceContext* resource_context, | 60 explicit VideoCaptureHost(content::ResourceContext* resource_context, |
59 AudioManager* audio_manager); | 61 media::AudioManager* audio_manager); |
60 | 62 |
61 // content::BrowserMessageFilter implementation. | 63 // content::BrowserMessageFilter implementation. |
62 virtual void OnChannelClosing() OVERRIDE; | 64 virtual void OnChannelClosing() OVERRIDE; |
63 virtual void OnDestruct() const OVERRIDE; | 65 virtual void OnDestruct() const OVERRIDE; |
64 virtual bool OnMessageReceived(const IPC::Message& message, | 66 virtual bool OnMessageReceived(const IPC::Message& message, |
65 bool* message_was_ok) OVERRIDE; | 67 bool* message_was_ok) OVERRIDE; |
66 | 68 |
67 // VideoCaptureControllerEventHandler implementation. | 69 // VideoCaptureControllerEventHandler implementation. |
68 virtual void OnError(const VideoCaptureControllerID& id) OVERRIDE; | 70 virtual void OnError(const VideoCaptureControllerID& id) OVERRIDE; |
69 virtual void OnBufferCreated(const VideoCaptureControllerID& id, | 71 virtual void OnBufferCreated(const VideoCaptureControllerID& id, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 // Helpers. | 140 // Helpers. |
139 media_stream::VideoCaptureManager* GetVideoCaptureManager(); | 141 media_stream::VideoCaptureManager* GetVideoCaptureManager(); |
140 | 142 |
141 struct Entry; | 143 struct Entry; |
142 typedef std::map<VideoCaptureControllerID, Entry*> EntryMap; | 144 typedef std::map<VideoCaptureControllerID, Entry*> EntryMap; |
143 // A map of VideoCaptureControllerID to its state and VideoCaptureController. | 145 // A map of VideoCaptureControllerID to its state and VideoCaptureController. |
144 EntryMap entries_; | 146 EntryMap entries_; |
145 | 147 |
146 // Used to get a pointer to VideoCaptureManager to start/stop capture devices. | 148 // Used to get a pointer to VideoCaptureManager to start/stop capture devices. |
147 content::ResourceContext* resource_context_; | 149 content::ResourceContext* resource_context_; |
148 AudioManager* audio_manager_; | 150 media::AudioManager* audio_manager_; |
149 | 151 |
150 DISALLOW_COPY_AND_ASSIGN(VideoCaptureHost); | 152 DISALLOW_COPY_AND_ASSIGN(VideoCaptureHost); |
151 }; | 153 }; |
152 | 154 |
153 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ | 155 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ |
OLD | NEW |