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

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

Issue 2377163002: VideoCaptureImpl cleanup: merge ctor+Init() and DeInit()+dtor. (Closed)
Patch Set: Rebase and cleanups in unit test files Created 4 years, 2 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
« no previous file with comments | « no previous file | content/renderer/media/video_capture_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 30 matching lines...) Expand all
41 // video_capture_impl_manager.cc for the lifetime of this object. 41 // video_capture_impl_manager.cc for the lifetime of this object.
42 // All methods must be called on the IO thread. 42 // All methods must be called on the IO thread.
43 // 43 //
44 // This is an internal class used by VideoCaptureImplManager only. Do not access 44 // This is an internal class used by VideoCaptureImplManager only. Do not access
45 // this directly. 45 // this directly.
46 class CONTENT_EXPORT VideoCaptureImpl 46 class CONTENT_EXPORT VideoCaptureImpl
47 : public VideoCaptureMessageFilter::Delegate { 47 : public VideoCaptureMessageFilter::Delegate {
48 public: 48 public:
49 ~VideoCaptureImpl() override; 49 ~VideoCaptureImpl() override;
50 50
51 VideoCaptureImpl(media::VideoCaptureSessionId session_id, 51 VideoCaptureImpl(
52 VideoCaptureMessageFilter* filter); 52 media::VideoCaptureSessionId session_id,
53 53 VideoCaptureMessageFilter* filter,
54 // Start listening to IPC messages. 54 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner);
miu 2016/09/29 06:59:40 Please use new smart pointer arg-passing style: Th
mcasas 2016/09/29 14:42:41 Done.
55 void Init();
56
57 // Stop listening to IPC messages.
58 void DeInit();
59 55
60 // Stop/resume delivering video frames to clients, based on flag |suspend|. 56 // Stop/resume delivering video frames to clients, based on flag |suspend|.
61 void SuspendCapture(bool suspend); 57 void SuspendCapture(bool suspend);
62 58
63 // Start capturing using the provided parameters. 59 // Start capturing using the provided parameters.
64 // |client_id| must be unique to this object in the render process. It is 60 // |client_id| must be unique to this object in the render process. It is
65 // used later to stop receiving video frames. 61 // used later to stop receiving video frames.
66 // |state_update_cb| will be called when state changes. 62 // |state_update_cb| will be called when state changes.
67 // |deliver_frame_cb| will be called when a frame is ready. 63 // |deliver_frame_cb| will be called when a frame is ready.
68 void StartCapture(int client_id, 64 void StartCapture(int client_id,
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 media::VideoCaptureParams params_; 187 media::VideoCaptureParams params_;
192 188
193 // The device's first captured frame referecne time sent from browser process 189 // The device's first captured frame referecne time sent from browser process
194 // side. 190 // side.
195 base::TimeTicks first_frame_ref_time_; 191 base::TimeTicks first_frame_ref_time_;
196 192
197 bool suspended_; 193 bool suspended_;
198 VideoCaptureState state_; 194 VideoCaptureState state_;
199 195
200 // IO message loop reference for checking correct class operation. 196 // IO message loop reference for checking correct class operation.
201 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; 197 const scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
202 198
203 // WeakPtrFactory pointing back to |this| object, for use with 199 // WeakPtrFactory pointing back to |this| object, for use with
204 // media::VideoFrames constructed in OnBufferReceived() from buffers cached 200 // media::VideoFrames constructed in OnBufferReceived() from buffers cached
205 // in |client_buffers_|. 201 // in |client_buffers_|.
206 // NOTE: Weak pointers must be invalidated before all other member variables. 202 // NOTE: Weak pointers must be invalidated before all other member variables.
207 base::WeakPtrFactory<VideoCaptureImpl> weak_factory_; 203 base::WeakPtrFactory<VideoCaptureImpl> weak_factory_;
208 204
209 DISALLOW_COPY_AND_ASSIGN(VideoCaptureImpl); 205 DISALLOW_COPY_AND_ASSIGN(VideoCaptureImpl);
210 }; 206 };
211 207
212 } // namespace content 208 } // namespace content
213 209
214 #endif // CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_H_ 210 #endif // CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/video_capture_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698