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

Side by Side Diff: media/capture/video/fake_video_capture_device.h

Issue 2005753006: ImageCapture: ScopedResultCallback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reillyg@ second round of comments Created 4 years, 7 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 // Implementation of a fake VideoCaptureDevice class. Used for testing other 5 // Implementation of a fake VideoCaptureDevice class. Used for testing other
6 // video capture classes when no real hardware is available. 6 // video capture classes when no real hardware is available.
7 7
8 #ifndef MEDIA_VIDEO_CAPTURE_FAKE_VIDEO_CAPTURE_DEVICE_H_ 8 #ifndef MEDIA_VIDEO_CAPTURE_FAKE_VIDEO_CAPTURE_DEVICE_H_
9 #define MEDIA_VIDEO_CAPTURE_FAKE_VIDEO_CAPTURE_DEVICE_H_ 9 #define MEDIA_VIDEO_CAPTURE_FAKE_VIDEO_CAPTURE_DEVICE_H_
10 10
(...skipping 19 matching lines...) Expand all
30 }; 30 };
31 31
32 FakeVideoCaptureDevice(BufferOwnership buffer_ownership, 32 FakeVideoCaptureDevice(BufferOwnership buffer_ownership,
33 float fake_capture_rate); 33 float fake_capture_rate);
34 ~FakeVideoCaptureDevice() override; 34 ~FakeVideoCaptureDevice() override;
35 35
36 // VideoCaptureDevice implementation. 36 // VideoCaptureDevice implementation.
37 void AllocateAndStart(const VideoCaptureParams& params, 37 void AllocateAndStart(const VideoCaptureParams& params,
38 std::unique_ptr<Client> client) override; 38 std::unique_ptr<Client> client) override;
39 void StopAndDeAllocate() override; 39 void StopAndDeAllocate() override;
40 bool TakePhoto(const TakePhotoCallback& photo_callback) override; 40 void TakePhoto(ScopedCallback<TakePhotoCallback> callback) override;
41 41
42 private: 42 private:
43 void CaptureUsingOwnBuffers(base::TimeTicks expected_execution_time); 43 void CaptureUsingOwnBuffers(base::TimeTicks expected_execution_time);
44 void CaptureUsingClientBuffers(base::TimeTicks expected_execution_time); 44 void CaptureUsingClientBuffers(base::TimeTicks expected_execution_time);
45 void BeepAndScheduleNextCapture( 45 void BeepAndScheduleNextCapture(
46 base::TimeTicks expected_execution_time, 46 base::TimeTicks expected_execution_time,
47 const base::Callback<void(base::TimeTicks)>& next_capture); 47 const base::Callback<void(base::TimeTicks)>& next_capture);
48 48
49 // |thread_checker_| is used to check that all methods are called in the 49 // |thread_checker_| is used to check that all methods are called in the
50 // correct thread that owns the object. 50 // correct thread that owns the object.
(...skipping 15 matching lines...) Expand all
66 // FakeVideoCaptureDevice post tasks to itself for frame construction and 66 // FakeVideoCaptureDevice post tasks to itself for frame construction and
67 // needs to deal with asynchronous StopAndDeallocate(). 67 // needs to deal with asynchronous StopAndDeallocate().
68 base::WeakPtrFactory<FakeVideoCaptureDevice> weak_factory_; 68 base::WeakPtrFactory<FakeVideoCaptureDevice> weak_factory_;
69 69
70 DISALLOW_COPY_AND_ASSIGN(FakeVideoCaptureDevice); 70 DISALLOW_COPY_AND_ASSIGN(FakeVideoCaptureDevice);
71 }; 71 };
72 72
73 } // namespace media 73 } // namespace media
74 74
75 #endif // MEDIA_VIDEO_CAPTURE_FAKE_VIDEO_CAPTURE_DEVICE_H_ 75 #endif // MEDIA_VIDEO_CAPTURE_FAKE_VIDEO_CAPTURE_DEVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698