| 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 "base/message_loop_helpers.h" |
| 42 #include "content/browser/renderer_host/media/video_capture_controller.h" | 43 #include "content/browser/renderer_host/media/video_capture_controller.h" |
| 43 #include "content/common/content_export.h" | 44 #include "content/common/content_export.h" |
| 44 #include "content/public/browser/browser_message_filter.h" | 45 #include "content/public/browser/browser_message_filter.h" |
| 45 #include "ipc/ipc_message.h" | 46 #include "ipc/ipc_message.h" |
| 46 | 47 |
| 47 namespace content { | 48 namespace content { |
| 48 class ResourceContext; | 49 class ResourceContext; |
| 49 } // namespace content | 50 } // namespace content |
| 50 | 51 |
| 51 class CONTENT_EXPORT VideoCaptureHost | 52 class CONTENT_EXPORT VideoCaptureHost |
| (...skipping 17 matching lines...) Expand all Loading... |
| 69 int buffer_id, | 70 int buffer_id, |
| 70 base::Time timestamp) OVERRIDE; | 71 base::Time timestamp) OVERRIDE; |
| 71 virtual void OnFrameInfo(const VideoCaptureControllerID& id, | 72 virtual void OnFrameInfo(const VideoCaptureControllerID& id, |
| 72 int width, | 73 int width, |
| 73 int height, | 74 int height, |
| 74 int frame_per_second) OVERRIDE; | 75 int frame_per_second) OVERRIDE; |
| 75 virtual void OnReadyToDelete(const VideoCaptureControllerID& id) OVERRIDE; | 76 virtual void OnReadyToDelete(const VideoCaptureControllerID& id) OVERRIDE; |
| 76 | 77 |
| 77 private: | 78 private: |
| 78 friend class content::BrowserThread; | 79 friend class content::BrowserThread; |
| 79 friend class DeleteTask<VideoCaptureHost>; | 80 friend class base::DeleteHelper<VideoCaptureHost>; |
| 80 friend class MockVideoCaptureHost; | 81 friend class MockVideoCaptureHost; |
| 81 friend class VideoCaptureHostTest; | 82 friend class VideoCaptureHostTest; |
| 82 | 83 |
| 83 virtual ~VideoCaptureHost(); | 84 virtual ~VideoCaptureHost(); |
| 84 | 85 |
| 85 // IPC message: Start capture on the VideoCaptureDevice referenced by | 86 // IPC message: Start capture on the VideoCaptureDevice referenced by |
| 86 // VideoCaptureParams::session_id. |device_id| is an id created by | 87 // VideoCaptureParams::session_id. |device_id| is an id created by |
| 87 // VideCaptureMessageFilter to identify a session | 88 // VideCaptureMessageFilter to identify a session |
| 88 // between a VideCaptureMessageFilter and a VideoCaptureHost. | 89 // between a VideCaptureMessageFilter and a VideoCaptureHost. |
| 89 void OnStartCapture(int device_id, | 90 void OnStartCapture(int device_id, |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 // A map of VideoCaptureControllerID to its state and VideoCaptureController. | 140 // A map of VideoCaptureControllerID to its state and VideoCaptureController. |
| 140 EntryMap entries_; | 141 EntryMap entries_; |
| 141 | 142 |
| 142 // 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. |
| 143 const content::ResourceContext* resource_context_; | 144 const content::ResourceContext* resource_context_; |
| 144 | 145 |
| 145 DISALLOW_COPY_AND_ASSIGN(VideoCaptureHost); | 146 DISALLOW_COPY_AND_ASSIGN(VideoCaptureHost); |
| 146 }; | 147 }; |
| 147 | 148 |
| 148 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ | 149 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ |
| OLD | NEW |