Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 virtual void OnBufferCreated(const VideoCaptureControllerID& id, | 71 virtual void OnBufferCreated(const VideoCaptureControllerID& id, |
| 72 base::SharedMemoryHandle handle, | 72 base::SharedMemoryHandle handle, |
| 73 int length, int buffer_id) OVERRIDE; | 73 int length, int buffer_id) OVERRIDE; |
| 74 virtual void OnBufferReady(const VideoCaptureControllerID& id, | 74 virtual void OnBufferReady(const VideoCaptureControllerID& id, |
| 75 int buffer_id, | 75 int buffer_id, |
| 76 base::Time timestamp) OVERRIDE; | 76 base::Time timestamp) OVERRIDE; |
| 77 virtual void OnFrameInfo(const VideoCaptureControllerID& id, | 77 virtual void OnFrameInfo(const VideoCaptureControllerID& id, |
| 78 int width, | 78 int width, |
| 79 int height, | 79 int height, |
| 80 int frame_per_second) OVERRIDE; | 80 int frame_per_second) OVERRIDE; |
| 81 virtual void OnPaused(const VideoCaptureControllerID& id) OVERRIDE; | |
| 81 virtual void OnReadyToDelete(const VideoCaptureControllerID& id) OVERRIDE; | 82 virtual void OnReadyToDelete(const VideoCaptureControllerID& id) OVERRIDE; |
| 82 | 83 |
| 83 private: | 84 private: |
| 84 friend class content::BrowserThread; | 85 friend class content::BrowserThread; |
| 85 friend class base::DeleteHelper<VideoCaptureHost>; | 86 friend class base::DeleteHelper<VideoCaptureHost>; |
| 86 friend class MockVideoCaptureHost; | 87 friend class MockVideoCaptureHost; |
| 87 friend class VideoCaptureHostTest; | 88 friend class VideoCaptureHostTest; |
| 88 | 89 |
| 89 virtual ~VideoCaptureHost(); | 90 virtual ~VideoCaptureHost(); |
| 90 | 91 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 130 // Send a information about frame resolution and frame rate | 131 // Send a information about frame resolution and frame rate |
| 131 // to the VideoCaptureMessageFilter. | 132 // to the VideoCaptureMessageFilter. |
| 132 void DoSendFrameInfo(int device_id, | 133 void DoSendFrameInfo(int device_id, |
| 133 int width, | 134 int width, |
| 134 int height, | 135 int height, |
| 135 int frame_per_second); | 136 int frame_per_second); |
| 136 | 137 |
| 137 // Handle error coming from VideoCaptureDevice. | 138 // Handle error coming from VideoCaptureDevice. |
| 138 void DoHandleError(int device_id); | 139 void DoHandleError(int device_id); |
| 139 | 140 |
| 141 void DoPaused(int device_id); | |
|
mflodman_chromium_OOO
2012/05/29 09:11:03
Do we want a comment it should be called on IO-thr
wjia(left Chromium)
2012/05/29 16:59:14
All Do* functions have been renamed to DO*OnIOThre
mflodman_chromium_OOO
2012/05/29 18:19:54
Nice!
| |
| 142 | |
| 140 // Helpers. | 143 // Helpers. |
| 141 media_stream::VideoCaptureManager* GetVideoCaptureManager(); | 144 media_stream::VideoCaptureManager* GetVideoCaptureManager(); |
| 142 | 145 |
| 143 struct Entry; | 146 struct Entry; |
| 144 typedef std::map<VideoCaptureControllerID, Entry*> EntryMap; | 147 typedef std::map<VideoCaptureControllerID, Entry*> EntryMap; |
| 145 // A map of VideoCaptureControllerID to its state and VideoCaptureController. | 148 // A map of VideoCaptureControllerID to its state and VideoCaptureController. |
| 146 EntryMap entries_; | 149 EntryMap entries_; |
| 147 | 150 |
| 148 // Used to get a pointer to VideoCaptureManager to start/stop capture devices. | 151 // Used to get a pointer to VideoCaptureManager to start/stop capture devices. |
| 149 content::ResourceContext* resource_context_; | 152 content::ResourceContext* resource_context_; |
| 150 media::AudioManager* audio_manager_; | 153 media::AudioManager* audio_manager_; |
| 151 | 154 |
| 152 DISALLOW_COPY_AND_ASSIGN(VideoCaptureHost); | 155 DISALLOW_COPY_AND_ASSIGN(VideoCaptureHost); |
| 153 }; | 156 }; |
| 154 | 157 |
| 155 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ | 158 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ |
| OLD | NEW |