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

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

Issue 1064963002: VideoCapture: add support for GpuMemoryBuffer allocation and lifetime mgmt in VideoCaptureBufferPool (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
11 #include <string> 11 #include <string>
12 12
13 #include "base/atomicops.h" 13 #include "base/atomicops.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "base/threading/thread.h" 16 #include "base/threading/thread.h"
17 #include "base/threading/thread_checker.h" 17 #include "base/threading/thread_checker.h"
18 #include "media/video/capture/video_capture_device.h" 18 #include "media/video/capture/video_capture_device.h"
19 19
20 namespace media { 20 namespace media {
21 21
22 class MEDIA_EXPORT FakeVideoCaptureDevice : public VideoCaptureDevice { 22 class MEDIA_EXPORT FakeVideoCaptureDevice : public VideoCaptureDevice {
23 public: 23 public:
24 enum FakeVideoCaptureDeviceType { 24 enum FakeVideoCaptureDeviceType {
25 USING_OWN_BUFFERS, 25 USING_OWN_BUFFERS,
26 USING_OWN_BUFFERS_TRIPLANAR,
26 USING_CLIENT_BUFFERS, 27 USING_CLIENT_BUFFERS,
27 USING_GPU_MEMORY_BUFFERS, 28 USING_GPU_MEMORY_BUFFERS,
28 }; 29 };
29 30
30 static int FakeCapturePeriodMs() { return kFakeCapturePeriodMs; } 31 static int FakeCapturePeriodMs() { return kFakeCapturePeriodMs; }
31 32
32 explicit FakeVideoCaptureDevice(FakeVideoCaptureDeviceType device_type); 33 explicit FakeVideoCaptureDevice(FakeVideoCaptureDeviceType device_type);
33 ~FakeVideoCaptureDevice() override; 34 ~FakeVideoCaptureDevice() override;
34 35
35 // VideoCaptureDevice implementation. 36 // VideoCaptureDevice implementation.
(...skipping 24 matching lines...) Expand all
60 // FakeVideoCaptureDevice post tasks to itself for frame construction and 61 // FakeVideoCaptureDevice post tasks to itself for frame construction and
61 // needs to deal with asynchronous StopAndDeallocate(). 62 // needs to deal with asynchronous StopAndDeallocate().
62 base::WeakPtrFactory<FakeVideoCaptureDevice> weak_factory_; 63 base::WeakPtrFactory<FakeVideoCaptureDevice> weak_factory_;
63 64
64 DISALLOW_COPY_AND_ASSIGN(FakeVideoCaptureDevice); 65 DISALLOW_COPY_AND_ASSIGN(FakeVideoCaptureDevice);
65 }; 66 };
66 67
67 } // namespace media 68 } // namespace media
68 69
69 #endif // MEDIA_VIDEO_CAPTURE_FAKE_VIDEO_CAPTURE_DEVICE_H_ 70 #endif // MEDIA_VIDEO_CAPTURE_FAKE_VIDEO_CAPTURE_DEVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698