| 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 // VideoCaptureImpl represents a capture device in renderer process. It provides | 5 // VideoCaptureImpl represents a capture device in renderer process. It provides |
| 6 // interfaces for clients to Start/Stop capture. It also communicates to clients | 6 // interfaces for clients to Start/Stop capture. It also communicates to clients |
| 7 // when buffer is ready, state of capture device is changed. | 7 // when buffer is ready, state of capture device is changed. |
| 8 | 8 |
| 9 // VideoCaptureImpl is also a delegate of VideoCaptureMessageFilter which relays | 9 // VideoCaptureImpl is also a delegate of VideoCaptureMessageFilter which relays |
| 10 // operation of a capture device to the browser process and receives responses | 10 // operation of a capture device to the browser process and receives responses |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 }; | 107 }; |
| 108 typedef std::map<int, ClientInfo> ClientInfoMap; | 108 typedef std::map<int, ClientInfo> ClientInfoMap; |
| 109 | 109 |
| 110 // VideoCaptureMessageFilter::Delegate interface. | 110 // VideoCaptureMessageFilter::Delegate interface. |
| 111 virtual void OnBufferCreated(base::SharedMemoryHandle handle, | 111 virtual void OnBufferCreated(base::SharedMemoryHandle handle, |
| 112 int length, | 112 int length, |
| 113 int buffer_id) OVERRIDE; | 113 int buffer_id) OVERRIDE; |
| 114 virtual void OnBufferDestroyed(int buffer_id) OVERRIDE; | 114 virtual void OnBufferDestroyed(int buffer_id) OVERRIDE; |
| 115 virtual void OnBufferReceived(int buffer_id, | 115 virtual void OnBufferReceived(int buffer_id, |
| 116 const media::VideoCaptureFormat& format, | 116 const media::VideoCaptureFormat& format, |
| 117 const gfx::Rect& visible_rect, |
| 117 base::TimeTicks) OVERRIDE; | 118 base::TimeTicks) OVERRIDE; |
| 118 virtual void OnMailboxBufferReceived(int buffer_id, | 119 virtual void OnMailboxBufferReceived(int buffer_id, |
| 119 const gpu::MailboxHolder& mailbox_holder, | 120 const gpu::MailboxHolder& mailbox_holder, |
| 120 const media::VideoCaptureFormat& format, | 121 const media::VideoCaptureFormat& format, |
| 121 base::TimeTicks timestamp) OVERRIDE; | 122 base::TimeTicks timestamp) OVERRIDE; |
| 122 virtual void OnStateChanged(VideoCaptureState state) OVERRIDE; | 123 virtual void OnStateChanged(VideoCaptureState state) OVERRIDE; |
| 123 virtual void OnDeviceSupportedFormatsEnumerated( | 124 virtual void OnDeviceSupportedFormatsEnumerated( |
| 124 const media::VideoCaptureFormats& supported_formats) OVERRIDE; | 125 const media::VideoCaptureFormats& supported_formats) OVERRIDE; |
| 125 virtual void OnDeviceFormatsInUseReceived( | 126 virtual void OnDeviceFormatsInUseReceived( |
| 126 const media::VideoCaptureFormats& formats_in_use) OVERRIDE; | 127 const media::VideoCaptureFormats& formats_in_use) OVERRIDE; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 // in |client_buffers_|. | 182 // in |client_buffers_|. |
| 182 // NOTE: Weak pointers must be invalidated before all other member variables. | 183 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 183 base::WeakPtrFactory<VideoCaptureImpl> weak_factory_; | 184 base::WeakPtrFactory<VideoCaptureImpl> weak_factory_; |
| 184 | 185 |
| 185 DISALLOW_COPY_AND_ASSIGN(VideoCaptureImpl); | 186 DISALLOW_COPY_AND_ASSIGN(VideoCaptureImpl); |
| 186 }; | 187 }; |
| 187 | 188 |
| 188 } // namespace content | 189 } // namespace content |
| 189 | 190 |
| 190 #endif // CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_H_ | 191 #endif // CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_H_ |
| OLD | NEW |