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 // VideoCaptureMessageFilter which lives inside the render process. | 6 // VideoCaptureMessageFilter which lives inside the render process. |
7 // | 7 // |
8 // This class is owned by RenderProcessHostImpl, and instantiated on UI | 8 // This class is owned by RenderProcessHostImpl, 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 namespace content { | 64 namespace content { |
65 class MediaStreamManager; | 65 class MediaStreamManager; |
66 | 66 |
67 class CONTENT_EXPORT VideoCaptureHost | 67 class CONTENT_EXPORT VideoCaptureHost |
68 : public BrowserMessageFilter, | 68 : public BrowserMessageFilter, |
69 public VideoCaptureControllerEventHandler { | 69 public VideoCaptureControllerEventHandler { |
70 public: | 70 public: |
71 explicit VideoCaptureHost(MediaStreamManager* media_stream_manager); | 71 explicit VideoCaptureHost(MediaStreamManager* media_stream_manager); |
72 | 72 |
73 // BrowserMessageFilter implementation. | 73 // BrowserMessageFilter implementation. |
74 virtual void OnChannelClosing() override; | 74 void OnChannelClosing() override; |
75 virtual void OnDestruct() const override; | 75 void OnDestruct() const override; |
76 virtual bool OnMessageReceived(const IPC::Message& message) override; | 76 bool OnMessageReceived(const IPC::Message& message) override; |
77 | 77 |
78 // VideoCaptureControllerEventHandler implementation. | 78 // VideoCaptureControllerEventHandler implementation. |
79 virtual void OnError(const VideoCaptureControllerID& id) override; | 79 void OnError(const VideoCaptureControllerID& id) override; |
80 virtual void OnBufferCreated(const VideoCaptureControllerID& id, | 80 void OnBufferCreated(const VideoCaptureControllerID& id, |
81 base::SharedMemoryHandle handle, | 81 base::SharedMemoryHandle handle, |
82 int length, | 82 int length, |
83 int buffer_id) override; | 83 int buffer_id) override; |
84 virtual void OnBufferDestroyed(const VideoCaptureControllerID& id, | 84 void OnBufferDestroyed(const VideoCaptureControllerID& id, |
85 int buffer_id) override; | 85 int buffer_id) override; |
86 virtual void OnBufferReady(const VideoCaptureControllerID& id, | 86 void OnBufferReady(const VideoCaptureControllerID& id, |
87 int buffer_id, | 87 int buffer_id, |
88 const media::VideoCaptureFormat& format, | 88 const media::VideoCaptureFormat& format, |
89 const gfx::Rect& visible_rect, | 89 const gfx::Rect& visible_rect, |
90 base::TimeTicks timestamp) override; | 90 base::TimeTicks timestamp) override; |
91 virtual void OnMailboxBufferReady(const VideoCaptureControllerID& id, | 91 void OnMailboxBufferReady(const VideoCaptureControllerID& id, |
92 int buffer_id, | 92 int buffer_id, |
93 const gpu::MailboxHolder& mailbox_holder, | 93 const gpu::MailboxHolder& mailbox_holder, |
94 const media::VideoCaptureFormat& format, | 94 const media::VideoCaptureFormat& format, |
95 base::TimeTicks timestamp) override; | 95 base::TimeTicks timestamp) override; |
96 virtual void OnEnded(const VideoCaptureControllerID& id) override; | 96 void OnEnded(const VideoCaptureControllerID& id) override; |
97 | 97 |
98 private: | 98 private: |
99 friend class BrowserThread; | 99 friend class BrowserThread; |
100 friend class base::DeleteHelper<VideoCaptureHost>; | 100 friend class base::DeleteHelper<VideoCaptureHost>; |
101 friend class MockVideoCaptureHost; | 101 friend class MockVideoCaptureHost; |
102 friend class VideoCaptureHostTest; | 102 friend class VideoCaptureHostTest; |
103 | 103 |
104 virtual ~VideoCaptureHost(); | 104 ~VideoCaptureHost() override; |
105 | 105 |
106 // IPC message: Start capture on the VideoCaptureDevice referenced by | 106 // IPC message: Start capture on the VideoCaptureDevice referenced by |
107 // |session_id|. |device_id| is an id created by VideoCaptureMessageFilter | 107 // |session_id|. |device_id| is an id created by VideoCaptureMessageFilter |
108 // to identify a session between a VideoCaptureMessageFilter and a | 108 // to identify a session between a VideoCaptureMessageFilter and a |
109 // VideoCaptureHost. | 109 // VideoCaptureHost. |
110 void OnStartCapture(int device_id, | 110 void OnStartCapture(int device_id, |
111 media::VideoCaptureSessionId session_id, | 111 media::VideoCaptureSessionId session_id, |
112 const media::VideoCaptureParams& params); | 112 const media::VideoCaptureParams& params); |
113 void OnControllerAdded( | 113 void OnControllerAdded( |
114 int device_id, | 114 int device_id, |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 // is connected. An entry in this map holds a null controller while it is in | 190 // is connected. An entry in this map holds a null controller while it is in |
191 // the process of starting. | 191 // the process of starting. |
192 EntryMap entries_; | 192 EntryMap entries_; |
193 | 193 |
194 DISALLOW_COPY_AND_ASSIGN(VideoCaptureHost); | 194 DISALLOW_COPY_AND_ASSIGN(VideoCaptureHost); |
195 }; | 195 }; |
196 | 196 |
197 } // namespace content | 197 } // namespace content |
198 | 198 |
199 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ | 199 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ |
OLD | NEW |