Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Side by Side Diff: content/renderer/media/video_capture_impl.h

Issue 2045813003: Decouple capture timestamp and reference time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 BufferFinishedCallback; 113 BufferFinishedCallback;
114 114
115 // VideoCaptureMessageFilter::Delegate interface. 115 // VideoCaptureMessageFilter::Delegate interface.
116 void OnBufferCreated(base::SharedMemoryHandle handle, 116 void OnBufferCreated(base::SharedMemoryHandle handle,
117 int length, 117 int length,
118 int buffer_id) override; 118 int buffer_id) override;
119 void OnBufferCreated2(const std::vector<gfx::GpuMemoryBufferHandle>& handles, 119 void OnBufferCreated2(const std::vector<gfx::GpuMemoryBufferHandle>& handles,
120 const gfx::Size& size, 120 const gfx::Size& size,
121 int buffer_id) override; 121 int buffer_id) override;
122 void OnBufferDestroyed(int buffer_id) override; 122 void OnBufferDestroyed(int buffer_id) override;
123 void OnBufferReceived( 123 void OnBufferReceived(int buffer_id,
124 int buffer_id, 124 base::TimeDelta timestamp,
125 base::TimeTicks timestamp, 125 const base::DictionaryValue& metadata,
126 const base::DictionaryValue& metadata, 126 media::VideoPixelFormat pixel_format,
127 media::VideoPixelFormat pixel_format, 127 media::VideoFrame::StorageType storage_type,
128 media::VideoFrame::StorageType storage_type, 128 const gfx::Size& coded_size,
129 const gfx::Size& coded_size, 129 const gfx::Rect& visible_rect) override;
130 const gfx::Rect& visible_rect) override;
131 void OnStateChanged(VideoCaptureState state) override; 130 void OnStateChanged(VideoCaptureState state) override;
132 void OnDeviceSupportedFormatsEnumerated( 131 void OnDeviceSupportedFormatsEnumerated(
133 const media::VideoCaptureFormats& supported_formats) override; 132 const media::VideoCaptureFormats& supported_formats) override;
134 void OnDeviceFormatsInUseReceived( 133 void OnDeviceFormatsInUseReceived(
135 const media::VideoCaptureFormats& formats_in_use) override; 134 const media::VideoCaptureFormats& formats_in_use) override;
136 void OnDelegateAdded(int32_t device_id) override; 135 void OnDelegateAdded(int32_t device_id) override;
137 136
138 // Sends an IPC message to browser process when all clients are done with the 137 // Sends an IPC message to browser process when all clients are done with the
139 // buffer. 138 // buffer.
140 void OnClientBufferFinished(int buffer_id, 139 void OnClientBufferFinished(int buffer_id,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 ClientBuffer2Map client_buffer2s_; 181 ClientBuffer2Map client_buffer2s_;
183 182
184 ClientInfoMap clients_; 183 ClientInfoMap clients_;
185 ClientInfoMap clients_pending_on_filter_; 184 ClientInfoMap clients_pending_on_filter_;
186 ClientInfoMap clients_pending_on_restart_; 185 ClientInfoMap clients_pending_on_restart_;
187 186
188 // Member params_ represents the video format requested by the 187 // Member params_ represents the video format requested by the
189 // client to this class via StartCapture(). 188 // client to this class via StartCapture().
190 media::VideoCaptureParams params_; 189 media::VideoCaptureParams params_;
191 190
192 // The device's first captured frame timestamp sent from browser process side. 191 // The device's first captured frame referecne time sent from browser process
193 base::TimeTicks first_frame_timestamp_; 192 // side.
193 base::TimeTicks first_frame_ref_time_;
194 194
195 bool suspended_; 195 bool suspended_;
196 VideoCaptureState state_; 196 VideoCaptureState state_;
197 197
198 // IO message loop reference for checking correct class operation. 198 // IO message loop reference for checking correct class operation.
199 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; 199 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
200 200
201 // WeakPtrFactory pointing back to |this| object, for use with 201 // WeakPtrFactory pointing back to |this| object, for use with
202 // media::VideoFrames constructed in OnBufferReceived() from buffers cached 202 // media::VideoFrames constructed in OnBufferReceived() from buffers cached
203 // in |client_buffers_|. 203 // in |client_buffers_|.
204 // NOTE: Weak pointers must be invalidated before all other member variables. 204 // NOTE: Weak pointers must be invalidated before all other member variables.
205 base::WeakPtrFactory<VideoCaptureImpl> weak_factory_; 205 base::WeakPtrFactory<VideoCaptureImpl> weak_factory_;
206 206
207 DISALLOW_COPY_AND_ASSIGN(VideoCaptureImpl); 207 DISALLOW_COPY_AND_ASSIGN(VideoCaptureImpl);
208 }; 208 };
209 209
210 } // namespace content 210 } // namespace content
211 211
212 #endif // CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_H_ 212 #endif // CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_H_
OLDNEW
« no previous file with comments | « content/common/media/video_capture_messages.h ('k') | content/renderer/media/video_capture_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698