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

Side by Side Diff: media/video/capture/linux/video_capture_device_linux.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: Rebase Created 5 years, 6 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 #include "media/video/capture/linux/video_capture_device_linux.h" 5 #include "media/video/capture/linux/video_capture_device_linux.h"
6 6
7 #if defined(OS_OPENBSD) 7 #if defined(OS_OPENBSD)
8 #include <sys/videoio.h> 8 #include <sys/videoio.h>
9 #else 9 #else
10 #include <linux/videodev2.h> 10 #include <linux/videodev2.h>
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 const VideoCaptureParams& params, 93 const VideoCaptureParams& params,
94 scoped_ptr<VideoCaptureDevice::Client> client) { 94 scoped_ptr<VideoCaptureDevice::Client> client) {
95 DCHECK(!capture_impl_); 95 DCHECK(!capture_impl_);
96 if (v4l2_thread_.IsRunning()) 96 if (v4l2_thread_.IsRunning())
97 return; // Wrong state. 97 return; // Wrong state.
98 v4l2_thread_.Start(); 98 v4l2_thread_.Start();
99 99
100 const int line_frequency = 100 const int line_frequency =
101 TranslatePowerLineFrequencyToV4L2(GetPowerLineFrequencyForLocation()); 101 TranslatePowerLineFrequencyToV4L2(GetPowerLineFrequencyForLocation());
102 capture_impl_ = V4L2CaptureDelegate::CreateV4L2CaptureDelegate( 102 capture_impl_ = V4L2CaptureDelegate::CreateV4L2CaptureDelegate(
103 device_name_, v4l2_thread_.message_loop_proxy(), line_frequency); 103 device_name_,
104 v4l2_thread_.message_loop_proxy(),
105 client.get(),
106 line_frequency);
104 if (!capture_impl_) { 107 if (!capture_impl_) {
105 client->OnError("Failed to create VideoCaptureDelegate"); 108 client->OnError("Failed to create VideoCaptureDelegate");
106 return; 109 return;
107 } 110 }
108 v4l2_thread_.message_loop()->PostTask( 111 v4l2_thread_.message_loop()->PostTask(
109 FROM_HERE, 112 FROM_HERE,
110 base::Bind(&V4L2CaptureDelegate::AllocateAndStart, capture_impl_, 113 base::Bind(&V4L2CaptureDelegate::AllocateAndStart, capture_impl_,
111 params.requested_format.frame_size.width(), 114 params.requested_format.frame_size.width(),
112 params.requested_format.frame_size.height(), 115 params.requested_format.frame_size.height(),
113 params.requested_format.frame_rate, base::Passed(&client))); 116 params.requested_format.frame_rate, base::Passed(&client)));
(...skipping 25 matching lines...) Expand all
139 return V4L2_CID_POWER_LINE_FREQUENCY_50HZ; 142 return V4L2_CID_POWER_LINE_FREQUENCY_50HZ;
140 case kPowerLine60Hz: 143 case kPowerLine60Hz:
141 return V4L2_CID_POWER_LINE_FREQUENCY_60HZ; 144 return V4L2_CID_POWER_LINE_FREQUENCY_60HZ;
142 default: 145 default:
143 // If we have no idea of the frequency, at least try and set it to AUTO. 146 // If we have no idea of the frequency, at least try and set it to AUTO.
144 return V4L2_CID_POWER_LINE_FREQUENCY_AUTO; 147 return V4L2_CID_POWER_LINE_FREQUENCY_AUTO;
145 } 148 }
146 } 149 }
147 150
148 } // namespace media 151 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698