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

Side by Side Diff: media/video/capture/linux/v4l2_capture_delegate.cc

Issue 1124723006: VideoCaptureDeviceLinux: Add support for SPLANE+DMABUF V4L2 type capture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "media/video/capture/linux/v4l2_capture_delegate.h" 5 #include "media/video/capture/linux/v4l2_capture_delegate.h"
6 6
7 #include <linux/version.h>
7 #include <poll.h> 8 #include <poll.h>
8 #include <sys/fcntl.h> 9 #include <sys/fcntl.h>
9 #include <sys/ioctl.h> 10 #include <sys/ioctl.h>
10 #include <sys/mman.h> 11 #include <sys/mman.h>
11 12
12 #include "base/bind.h" 13 #include "base/bind.h"
13 #include "base/files/file_enumerator.h" 14 #include "base/files/file_enumerator.h"
14 #include "base/posix/eintr_wrapper.h" 15 #include "base/posix/eintr_wrapper.h"
15 #include "base/strings/stringprintf.h" 16 #include "base/strings/stringprintf.h"
16 #include "media/base/bind_to_current_loop.h" 17 #include "media/base/bind_to_current_loop.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 }; 62 };
62 63
63 // static 64 // static
64 scoped_refptr<V4L2CaptureDelegate> 65 scoped_refptr<V4L2CaptureDelegate>
65 V4L2CaptureDelegate::CreateV4L2CaptureDelegate( 66 V4L2CaptureDelegate::CreateV4L2CaptureDelegate(
66 const VideoCaptureDevice::Name& device_name, 67 const VideoCaptureDevice::Name& device_name,
67 const scoped_refptr<base::SingleThreadTaskRunner>& v4l2_task_runner, 68 const scoped_refptr<base::SingleThreadTaskRunner>& v4l2_task_runner,
68 int power_line_frequency) { 69 int power_line_frequency) {
69 switch (device_name.capture_api_type()) { 70 switch (device_name.capture_api_type()) {
70 case VideoCaptureDevice::Name::V4L2_SINGLE_PLANE: 71 case VideoCaptureDevice::Name::V4L2_SINGLE_PLANE:
72 case VideoCaptureDevice::Name::V4L2_SINGLE_PLANE_DMABUF:
71 return make_scoped_refptr(new V4L2CaptureDelegateSinglePlane( 73 return make_scoped_refptr(new V4L2CaptureDelegateSinglePlane(
72 device_name, v4l2_task_runner, power_line_frequency)); 74 device_name, v4l2_task_runner, power_line_frequency));
73 case VideoCaptureDevice::Name::V4L2_MULTI_PLANE: 75 case VideoCaptureDevice::Name::V4L2_MULTI_PLANE:
74 #if !defined(OS_OPENBSD) 76 #if !defined(OS_OPENBSD)
75 return make_scoped_refptr(new V4L2CaptureDelegateMultiPlane( 77 return make_scoped_refptr(new V4L2CaptureDelegateMultiPlane(
76 device_name, v4l2_task_runner, power_line_frequency)); 78 device_name, v4l2_task_runner, power_line_frequency));
77 default: 79 default:
78 #endif 80 #endif
79 NOTIMPLEMENTED() << "Unknown V4L2 capture API type"; 81 NOTIMPLEMENTED() << "Unknown V4L2 capture API type";
80 return scoped_refptr<V4L2CaptureDelegate>(); 82 return scoped_refptr<V4L2CaptureDelegate>();
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 FROM_HERE, base::Bind(&V4L2CaptureDelegate::DoCapture, this)); 413 FROM_HERE, base::Bind(&V4L2CaptureDelegate::DoCapture, this));
412 } 414 }
413 415
414 void V4L2CaptureDelegate::SetErrorState(const std::string& reason) { 416 void V4L2CaptureDelegate::SetErrorState(const std::string& reason) {
415 DCHECK(v4l2_task_runner_->BelongsToCurrentThread()); 417 DCHECK(v4l2_task_runner_->BelongsToCurrentThread());
416 is_capturing_ = false; 418 is_capturing_ = false;
417 client_->OnError(reason); 419 client_->OnError(reason);
418 } 420 }
419 421
420 } // namespace media 422 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698