OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <dlfcn.h> | 5 #include <dlfcn.h> |
6 #include <fcntl.h> | 6 #include <fcntl.h> |
7 #include <linux/videodev2.h> | 7 #include <linux/videodev2.h> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/posix/eintr_wrapper.h" | 10 #include "base/posix/eintr_wrapper.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
145 | 145 |
146 bool TegraV4L2Device::Initialize() { | 146 bool TegraV4L2Device::Initialize() { |
147 const char* device_path = NULL; | 147 const char* device_path = NULL; |
148 switch (type_) { | 148 switch (type_) { |
149 case kDecoder: | 149 case kDecoder: |
150 device_path = kDecoderDevice; | 150 device_path = kDecoderDevice; |
151 break; | 151 break; |
152 case kEncoder: | 152 case kEncoder: |
153 device_path = kEncoderDevice; | 153 device_path = kEncoderDevice; |
154 break; | 154 break; |
155 case kImageProcessor: | 155 case kImageProcessor: |
wuchengli
2015/06/11 11:08:54
Just change this to default.
henryhsu
2015/06/12 05:48:00
Done.
| |
156 DVLOG(1) << "Device type " << type_ << " not supported on this platform"; | 156 DVLOG(1) << "Device type " << type_ << " not supported on this platform"; |
157 return false; | 157 return false; |
158 case kJpegDecoder: | |
159 DVLOG(1) << "Device type " << type_ << " not supported on this platform"; | |
160 return false; | |
158 } | 161 } |
159 | 162 |
160 if (!g_tegra_function_symbol_finder_.Get().initialized()) { | 163 if (!g_tegra_function_symbol_finder_.Get().initialized()) { |
161 DLOG(ERROR) << "Unable to initialize functions"; | 164 DLOG(ERROR) << "Unable to initialize functions"; |
162 return false; | 165 return false; |
163 } | 166 } |
164 device_fd_ = HANDLE_EINTR( | 167 device_fd_ = HANDLE_EINTR( |
165 TegraV4L2_Open(device_path, O_RDWR | O_NONBLOCK | O_CLOEXEC)); | 168 TegraV4L2_Open(device_path, O_RDWR | O_NONBLOCK | O_CLOEXEC)); |
166 if (device_fd_ == -1) { | 169 if (device_fd_ == -1) { |
167 DLOG(ERROR) << "Unable to open device " << device_path; | 170 DLOG(ERROR) << "Unable to open device " << device_path; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
214 GLenum TegraV4L2Device::GetTextureTarget() { return GL_TEXTURE_2D; } | 217 GLenum TegraV4L2Device::GetTextureTarget() { return GL_TEXTURE_2D; } |
215 | 218 |
216 uint32 TegraV4L2Device::PreferredInputFormat() { | 219 uint32 TegraV4L2Device::PreferredInputFormat() { |
217 // TODO(posciak): We should support "dontcare" returns here once we | 220 // TODO(posciak): We should support "dontcare" returns here once we |
218 // implement proper handling (fallback, negotiation) for this in users. | 221 // implement proper handling (fallback, negotiation) for this in users. |
219 CHECK_EQ(type_, kEncoder); | 222 CHECK_EQ(type_, kEncoder); |
220 return V4L2_PIX_FMT_YUV420M; | 223 return V4L2_PIX_FMT_YUV420M; |
221 } | 224 } |
222 | 225 |
223 } // namespace content | 226 } // namespace content |
OLD | NEW |