| 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 #ifndef CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_H_ | 6 #define CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 using ClientInfoMap = std::map<int, ClientInfo>; | 114 using ClientInfoMap = std::map<int, ClientInfo>; |
| 115 | 115 |
| 116 using BufferFinishedCallback = | 116 using BufferFinishedCallback = |
| 117 base::Callback<void(const gpu::SyncToken& sync_token, | 117 base::Callback<void(const gpu::SyncToken& sync_token, |
| 118 double consumer_resource_utilization)>; | 118 double consumer_resource_utilization)>; |
| 119 | 119 |
| 120 // VideoCaptureMessageFilter::Delegate interface implementation. | 120 // VideoCaptureMessageFilter::Delegate interface implementation. |
| 121 void OnBufferCreated(base::SharedMemoryHandle handle, | 121 void OnBufferCreated(base::SharedMemoryHandle handle, |
| 122 int length, | 122 int length, |
| 123 int buffer_id) override; | 123 int buffer_id) override; |
| 124 void OnBufferDestroyed(int buffer_id) override; | |
| 125 void OnBufferReceived(int buffer_id, | |
| 126 base::TimeDelta timestamp, | |
| 127 const base::DictionaryValue& metadata, | |
| 128 media::VideoPixelFormat pixel_format, | |
| 129 media::VideoFrame::StorageType storage_type, | |
| 130 const gfx::Size& coded_size, | |
| 131 const gfx::Rect& visible_rect) override; | |
| 132 void OnDelegateAdded(int32_t device_id) override; | 124 void OnDelegateAdded(int32_t device_id) override; |
| 133 | 125 |
| 134 // mojom::VideoCaptureObserver implementation. | 126 // mojom::VideoCaptureObserver implementation. |
| 135 void OnStateChanged(mojom::VideoCaptureState state) override; | 127 void OnStateChanged(mojom::VideoCaptureState state) override; |
| 128 void OnBufferReady(int32_t buffer_id, mojom::VideoFrameInfoPtr info) override; |
| 129 void OnBufferDestroyed(int32_t buffer_id) override; |
| 136 | 130 |
| 137 // Sends an IPC message to browser process when all clients are done with the | 131 // Sends an IPC message to browser process when all clients are done with the |
| 138 // buffer. | 132 // buffer. |
| 139 void OnClientBufferFinished(int buffer_id, | 133 void OnClientBufferFinished(int buffer_id, |
| 140 const scoped_refptr<ClientBuffer>& buffer, | 134 const scoped_refptr<ClientBuffer>& buffer, |
| 141 const gpu::SyncToken& release_sync_token, | 135 const gpu::SyncToken& release_sync_token, |
| 142 double consumer_resource_utilization); | 136 double consumer_resource_utilization); |
| 143 | 137 |
| 144 void StopDevice(); | 138 void StopDevice(); |
| 145 void RestartCapture(); | 139 void RestartCapture(); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 // in |client_buffers_|. | 195 // in |client_buffers_|. |
| 202 // NOTE: Weak pointers must be invalidated before all other member variables. | 196 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 203 base::WeakPtrFactory<VideoCaptureImpl> weak_factory_; | 197 base::WeakPtrFactory<VideoCaptureImpl> weak_factory_; |
| 204 | 198 |
| 205 DISALLOW_COPY_AND_ASSIGN(VideoCaptureImpl); | 199 DISALLOW_COPY_AND_ASSIGN(VideoCaptureImpl); |
| 206 }; | 200 }; |
| 207 | 201 |
| 208 } // namespace content | 202 } // namespace content |
| 209 | 203 |
| 210 #endif // CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_H_ | 204 #endif // CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_H_ |
| OLD | NEW |