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

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

Issue 1106563002: FakeVideoCaptureDevice: add support for capturing into Dma-Bufs using VGEM in CrOs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ermircan@ comments; removed GpuMemoryBuffer modifications (go in other CL) Created 5 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 base::ThreadChecker thread_checker_; 50 base::ThreadChecker thread_checker_;
51 51
52 const FakeVideoCaptureDeviceType device_type_; 52 const FakeVideoCaptureDeviceType device_type_;
53 53
54 scoped_ptr<VideoCaptureDevice::Client> client_; 54 scoped_ptr<VideoCaptureDevice::Client> client_;
55 // |fake_frame_| is used for capturing on Own Buffers. 55 // |fake_frame_| is used for capturing on Own Buffers.
56 scoped_ptr<uint8[]> fake_frame_; 56 scoped_ptr<uint8[]> fake_frame_;
57 int frame_count_; 57 int frame_count_;
58 VideoCaptureFormat capture_format_; 58 VideoCaptureFormat capture_format_;
59 59
60 #if defined(OS_CHROMEOS) && defined(USE_OZONE)
61 // |client_->ReserveOutputBuffer()| might give a Buffer with null data(), in
62 // that case and for certain platforms, we can try and map the underlying
63 // Buffer::AsPlatformFile(), which is a dma-buf. This can only happen via the
64 // VGEM API. VgemWrapper encapsulates all the operations regarding it.
65 class VgemWrapper;
66 scoped_ptr<VgemWrapper> vgem_wrapper_;
67 #endif
68
60 // FakeVideoCaptureDevice post tasks to itself for frame construction and 69 // FakeVideoCaptureDevice post tasks to itself for frame construction and
61 // needs to deal with asynchronous StopAndDeallocate(). 70 // needs to deal with asynchronous StopAndDeallocate().
62 base::WeakPtrFactory<FakeVideoCaptureDevice> weak_factory_; 71 base::WeakPtrFactory<FakeVideoCaptureDevice> weak_factory_;
63 72
64 DISALLOW_COPY_AND_ASSIGN(FakeVideoCaptureDevice); 73 DISALLOW_COPY_AND_ASSIGN(FakeVideoCaptureDevice);
65 }; 74 };
66 75
67 } // namespace media 76 } // namespace media
68 77
69 #endif // MEDIA_VIDEO_CAPTURE_FAKE_VIDEO_CAPTURE_DEVICE_H_ 78 #endif // MEDIA_VIDEO_CAPTURE_FAKE_VIDEO_CAPTURE_DEVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698