Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
|
tommi (sloooow) - chröme
2013/03/21 14:48:05
don't think we're supposed to change copyright yea
| |
| 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 // VideoCaptureMessageFilter which lives inside the render process. | 6 // VideoCaptureMessageFilter 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 // |
| 11 // Here's an example of a typical IPC dialog for video capture: | 11 // Here's an example of a typical IPC dialog for video capture: |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 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/sequenced_task_runner_helpers.h" | 42 #include "base/sequenced_task_runner_helpers.h" |
| 43 #include "content/browser/renderer_host/media/video_capture_controller.h" | 43 #include "content/browser/renderer_host/media/video_capture_controller.h" |
| 44 #include "content/common/content_export.h" | 44 #include "content/common/content_export.h" |
| 45 #include "content/public/browser/browser_message_filter.h" | 45 #include "content/public/browser/browser_message_filter.h" |
| 46 #include "ipc/ipc_message.h" | 46 #include "ipc/ipc_message.h" |
| 47 #include "media/video/video_encode_types.h" | |
| 47 | 48 |
| 48 namespace content { | 49 namespace content { |
| 49 | 50 |
| 50 class CONTENT_EXPORT VideoCaptureHost | 51 class CONTENT_EXPORT VideoCaptureHost |
| 51 : public BrowserMessageFilter, | 52 : public BrowserMessageFilter, |
| 52 public VideoCaptureControllerEventHandler { | 53 public VideoCaptureControllerEventHandler { |
| 53 public: | 54 public: |
| 54 VideoCaptureHost(); | 55 VideoCaptureHost(); |
| 55 | 56 |
| 56 // BrowserMessageFilter implementation. | 57 // BrowserMessageFilter implementation. |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 130 | 131 |
| 131 void DoPausedOnIOThread(const VideoCaptureControllerID& controller_id); | 132 void DoPausedOnIOThread(const VideoCaptureControllerID& controller_id); |
| 132 | 133 |
| 133 void DeleteVideoCaptureControllerOnIOThread( | 134 void DeleteVideoCaptureControllerOnIOThread( |
| 134 const VideoCaptureControllerID& controller_id); | 135 const VideoCaptureControllerID& controller_id); |
| 135 | 136 |
| 136 // Returns the video capture manager. This is a virtual function so that | 137 // Returns the video capture manager. This is a virtual function so that |
| 137 // the unit tests can inject their own MediaStreamManager. | 138 // the unit tests can inject their own MediaStreamManager. |
| 138 virtual VideoCaptureManager* GetVideoCaptureManager(); | 139 virtual VideoCaptureManager* GetVideoCaptureManager(); |
| 139 | 140 |
| 141 // Encoded video source message handlers. | |
| 142 void OnCreateBitstream(int device_id, | |
| 143 int stream_id, | |
| 144 media::VideoEncodingParameters params); | |
| 145 void OnBitstreamBufferConsumed(int device_id, int stream_id, int buffer_id); | |
| 146 void OnDestroyBitstream(int device_id, int stream_id); | |
| 147 void OnTryConfigureBitstream(int device_id, | |
| 148 int stream_id, | |
| 149 media::RuntimeVideoEncodingParameters params); | |
| 150 void OnRequestSpecialFrame(int device_id, int stream_id, int flags); | |
| 151 | |
| 140 struct Entry; | 152 struct Entry; |
| 141 typedef std::map<VideoCaptureControllerID, Entry*> EntryMap; | 153 typedef std::map<VideoCaptureControllerID, Entry*> EntryMap; |
| 142 // A map of VideoCaptureControllerID to its state and VideoCaptureController. | 154 // A map of VideoCaptureControllerID to its state and VideoCaptureController. |
| 143 EntryMap entries_; | 155 EntryMap entries_; |
| 144 | 156 |
| 145 DISALLOW_COPY_AND_ASSIGN(VideoCaptureHost); | 157 DISALLOW_COPY_AND_ASSIGN(VideoCaptureHost); |
| 146 }; | 158 }; |
| 147 | 159 |
| 148 } // namespace content | 160 } // namespace content |
| 149 | 161 |
| 150 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ | 162 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ |
| OLD | NEW |