| 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 21 matching lines...) Expand all Loading... |
| 32 // | < VideoCaptureMsg_StateChanged | | 32 // | < VideoCaptureMsg_StateChanged | |
| 33 // | (kStopped) | | 33 // | (kStopped) | |
| 34 // v v | 34 // v v |
| 35 | 35 |
| 36 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ | 36 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ |
| 37 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ | 37 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ |
| 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 "content/browser/browser_message_filter.h" | |
| 43 #include "content/browser/renderer_host/media/video_capture_controller.h" | 42 #include "content/browser/renderer_host/media/video_capture_controller.h" |
| 44 #include "content/common/content_export.h" | 43 #include "content/common/content_export.h" |
| 44 #include "content/public/browser/browser_message_filter.h" |
| 45 #include "ipc/ipc_message.h" | 45 #include "ipc/ipc_message.h" |
| 46 | 46 |
| 47 namespace content { | 47 namespace content { |
| 48 class ResourceContext; | 48 class ResourceContext; |
| 49 } // namespace content | 49 } // namespace content |
| 50 | 50 |
| 51 class CONTENT_EXPORT VideoCaptureHost | 51 class CONTENT_EXPORT VideoCaptureHost |
| 52 : public BrowserMessageFilter, | 52 : public content::BrowserMessageFilter, |
| 53 public VideoCaptureControllerEventHandler { | 53 public VideoCaptureControllerEventHandler { |
| 54 public: | 54 public: |
| 55 explicit VideoCaptureHost(const content::ResourceContext* resource_context); | 55 explicit VideoCaptureHost(const content::ResourceContext* resource_context); |
| 56 | 56 |
| 57 // BrowserMessageFilter implementation. | 57 // content::BrowserMessageFilter implementation. |
| 58 virtual void OnChannelClosing() OVERRIDE; | 58 virtual void OnChannelClosing() OVERRIDE; |
| 59 virtual void OnDestruct() const OVERRIDE; | 59 virtual void OnDestruct() const OVERRIDE; |
| 60 virtual bool OnMessageReceived(const IPC::Message& message, | 60 virtual bool OnMessageReceived(const IPC::Message& message, |
| 61 bool* message_was_ok) OVERRIDE; | 61 bool* message_was_ok) OVERRIDE; |
| 62 | 62 |
| 63 // VideoCaptureControllerEventHandler implementation. | 63 // VideoCaptureControllerEventHandler implementation. |
| 64 virtual void OnError(const VideoCaptureControllerID& id) OVERRIDE; | 64 virtual void OnError(const VideoCaptureControllerID& id) OVERRIDE; |
| 65 virtual void OnBufferCreated(const VideoCaptureControllerID& id, | 65 virtual void OnBufferCreated(const VideoCaptureControllerID& id, |
| 66 base::SharedMemoryHandle handle, | 66 base::SharedMemoryHandle handle, |
| 67 int length, int buffer_id) OVERRIDE; | 67 int length, int buffer_id) OVERRIDE; |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 // A map of VideoCaptureControllerID to its state and VideoCaptureController. | 139 // A map of VideoCaptureControllerID to its state and VideoCaptureController. |
| 140 EntryMap entries_; | 140 EntryMap entries_; |
| 141 | 141 |
| 142 // Used to get a pointer to VideoCaptureManager to start/stop capture devices. | 142 // Used to get a pointer to VideoCaptureManager to start/stop capture devices. |
| 143 const content::ResourceContext* resource_context_; | 143 const content::ResourceContext* resource_context_; |
| 144 | 144 |
| 145 DISALLOW_COPY_AND_ASSIGN(VideoCaptureHost); | 145 DISALLOW_COPY_AND_ASSIGN(VideoCaptureHost); |
| 146 }; | 146 }; |
| 147 | 147 |
| 148 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ | 148 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ |
| OLD | NEW |