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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 #include "ipc/ipc_message.h" | 46 #include "ipc/ipc_message.h" |
47 | 47 |
48 namespace content { | 48 namespace content { |
49 class ResourceContext; | 49 class ResourceContext; |
50 } // namespace content | 50 } // namespace content |
51 | 51 |
52 class CONTENT_EXPORT VideoCaptureHost | 52 class CONTENT_EXPORT VideoCaptureHost |
53 : public content::BrowserMessageFilter, | 53 : public content::BrowserMessageFilter, |
54 public VideoCaptureControllerEventHandler { | 54 public VideoCaptureControllerEventHandler { |
55 public: | 55 public: |
56 explicit VideoCaptureHost(const content::ResourceContext* resource_context); | 56 explicit VideoCaptureHost(content::ResourceContext* resource_context); |
57 | 57 |
58 // content::BrowserMessageFilter implementation. | 58 // content::BrowserMessageFilter implementation. |
59 virtual void OnChannelClosing() OVERRIDE; | 59 virtual void OnChannelClosing() OVERRIDE; |
60 virtual void OnDestruct() const OVERRIDE; | 60 virtual void OnDestruct() const OVERRIDE; |
61 virtual bool OnMessageReceived(const IPC::Message& message, | 61 virtual bool OnMessageReceived(const IPC::Message& message, |
62 bool* message_was_ok) OVERRIDE; | 62 bool* message_was_ok) OVERRIDE; |
63 | 63 |
64 // VideoCaptureControllerEventHandler implementation. | 64 // VideoCaptureControllerEventHandler implementation. |
65 virtual void OnError(const VideoCaptureControllerID& id) OVERRIDE; | 65 virtual void OnError(const VideoCaptureControllerID& id) OVERRIDE; |
66 virtual void OnBufferCreated(const VideoCaptureControllerID& id, | 66 virtual void OnBufferCreated(const VideoCaptureControllerID& id, |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 134 |
135 // Helpers. | 135 // Helpers. |
136 media_stream::VideoCaptureManager* GetVideoCaptureManager(); | 136 media_stream::VideoCaptureManager* GetVideoCaptureManager(); |
137 | 137 |
138 struct Entry; | 138 struct Entry; |
139 typedef std::map<VideoCaptureControllerID, Entry*> EntryMap; | 139 typedef std::map<VideoCaptureControllerID, Entry*> EntryMap; |
140 // A map of VideoCaptureControllerID to its state and VideoCaptureController. | 140 // A map of VideoCaptureControllerID to its state and VideoCaptureController. |
141 EntryMap entries_; | 141 EntryMap entries_; |
142 | 142 |
143 // Used to get a pointer to VideoCaptureManager to start/stop capture devices. | 143 // Used to get a pointer to VideoCaptureManager to start/stop capture devices. |
144 const content::ResourceContext* resource_context_; | 144 content::ResourceContext* resource_context_; |
145 | 145 |
146 DISALLOW_COPY_AND_ASSIGN(VideoCaptureHost); | 146 DISALLOW_COPY_AND_ASSIGN(VideoCaptureHost); |
147 }; | 147 }; |
148 | 148 |
149 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ | 149 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ |
OLD | NEW |