| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 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 // BrowserMessageFilter implementation. |
| 58 virtual void OnChannelClosing(); | 58 virtual void OnChannelClosing() OVERRIDE; |
| 59 virtual void OnDestruct() const; | 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); | 61 bool* message_was_ok) OVERRIDE; |
| 62 | 62 |
| 63 // VideoCaptureControllerEventHandler implementation. | 63 // VideoCaptureControllerEventHandler implementation. |
| 64 virtual void OnError(const VideoCaptureControllerID& id); | 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); | 67 int length, int buffer_id) OVERRIDE; |
| 68 virtual void OnBufferReady(const VideoCaptureControllerID& id, | 68 virtual void OnBufferReady(const VideoCaptureControllerID& id, |
| 69 int buffer_id, | 69 int buffer_id, |
| 70 base::Time timestamp); | 70 base::Time timestamp) OVERRIDE; |
| 71 virtual void OnFrameInfo(const VideoCaptureControllerID& id, | 71 virtual void OnFrameInfo(const VideoCaptureControllerID& id, |
| 72 int width, | 72 int width, |
| 73 int height, | 73 int height, |
| 74 int frame_per_second); | 74 int frame_per_second) OVERRIDE; |
| 75 virtual void OnReadyToDelete(const VideoCaptureControllerID& id); | 75 virtual void OnReadyToDelete(const VideoCaptureControllerID& id) OVERRIDE; |
| 76 | 76 |
| 77 private: | 77 private: |
| 78 friend class content::BrowserThread; | 78 friend class content::BrowserThread; |
| 79 friend class DeleteTask<VideoCaptureHost>; | 79 friend class DeleteTask<VideoCaptureHost>; |
| 80 friend class MockVideoCaptureHost; | 80 friend class MockVideoCaptureHost; |
| 81 friend class VideoCaptureHostTest; | 81 friend class VideoCaptureHostTest; |
| 82 | 82 |
| 83 virtual ~VideoCaptureHost(); | 83 virtual ~VideoCaptureHost(); |
| 84 | 84 |
| 85 // IPC message: Start capture on the VideoCaptureDevice referenced by | 85 // IPC message: Start capture on the VideoCaptureDevice referenced by |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 // Record state of each VideoCaptureControllerID. | 145 // Record state of each VideoCaptureControllerID. |
| 146 EntryState entry_state_; | 146 EntryState entry_state_; |
| 147 | 147 |
| 148 // 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. |
| 149 const content::ResourceContext* resource_context_; | 149 const content::ResourceContext* resource_context_; |
| 150 | 150 |
| 151 DISALLOW_COPY_AND_ASSIGN(VideoCaptureHost); | 151 DISALLOW_COPY_AND_ASSIGN(VideoCaptureHost); |
| 152 }; | 152 }; |
| 153 | 153 |
| 154 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ | 154 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ |
| OLD | NEW |