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

Side by Side Diff: content/common/gpu/media/v4l2_slice_video_decode_accelerator.cc

Issue 1554543002: v4l2 accelerators: use V4L2_CAP_VIDEO_M2M_MPLANE capability. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove fallback in slice VDA and image processor Created 4 years, 11 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 <errno.h> 5 #include <errno.h>
6 #include <fcntl.h> 6 #include <fcntl.h>
7 #include <linux/videodev2.h> 7 #include <linux/videodev2.h>
8 #include <poll.h> 8 #include <poll.h>
9 #include <sys/eventfd.h> 9 #include <sys/eventfd.h>
10 #include <sys/ioctl.h> 10 #include <sys/ioctl.h>
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 return false; 478 return false;
479 } 479 }
480 480
481 if (!gfx::g_driver_egl.ext.b_EGL_KHR_fence_sync) { 481 if (!gfx::g_driver_egl.ext.b_EGL_KHR_fence_sync) {
482 LOG(ERROR) << "Initialize(): context does not have EGL_KHR_fence_sync"; 482 LOG(ERROR) << "Initialize(): context does not have EGL_KHR_fence_sync";
483 return false; 483 return false;
484 } 484 }
485 485
486 // Capabilities check. 486 // Capabilities check.
487 struct v4l2_capability caps; 487 struct v4l2_capability caps;
488 const __u32 kCapsRequired = 488 const __u32 kCapsRequired = V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_STREAMING;
489 V4L2_CAP_VIDEO_CAPTURE_MPLANE |
490 V4L2_CAP_VIDEO_OUTPUT_MPLANE |
491 V4L2_CAP_STREAMING;
492 IOCTL_OR_ERROR_RETURN_FALSE(VIDIOC_QUERYCAP, &caps); 489 IOCTL_OR_ERROR_RETURN_FALSE(VIDIOC_QUERYCAP, &caps);
493 if ((caps.capabilities & kCapsRequired) != kCapsRequired) { 490 if ((caps.capabilities & kCapsRequired) != kCapsRequired) {
494 DLOG(ERROR) << "Initialize(): ioctl() failed: VIDIOC_QUERYCAP" 491 LOG(ERROR) << "Initialize(): ioctl() failed: VIDIOC_QUERYCAP"
wuchengli 2015/12/29 09:43:32 I don't know why this used to be DLOG. All other t
495 ", caps check failed: 0x" << std::hex << caps.capabilities; 492 ", caps check failed: 0x" << std::hex << caps.capabilities;
496 return false; 493 return false;
497 } 494 }
498 495
499 if (!SetupFormats()) 496 if (!SetupFormats())
500 return false; 497 return false;
501 498
502 if (!decoder_thread_.Start()) { 499 if (!decoder_thread_.Start()) {
503 DLOG(ERROR) << "Initialize(): device thread failed to start"; 500 DLOG(ERROR) << "Initialize(): device thread failed to start";
504 return false; 501 return false;
505 } 502 }
(...skipping 2037 matching lines...) Expand 10 before | Expand all | Expand 10 after
2543 if (!device) 2540 if (!device)
2544 return SupportedProfiles(); 2541 return SupportedProfiles();
2545 2542
2546 const uint32_t supported_formats[] = { 2543 const uint32_t supported_formats[] = {
2547 V4L2_PIX_FMT_H264_SLICE, V4L2_PIX_FMT_VP8_FRAME}; 2544 V4L2_PIX_FMT_H264_SLICE, V4L2_PIX_FMT_VP8_FRAME};
2548 return device->GetSupportedDecodeProfiles(arraysize(supported_formats), 2545 return device->GetSupportedDecodeProfiles(arraysize(supported_formats),
2549 supported_formats); 2546 supported_formats);
2550 } 2547 }
2551 2548
2552 } // namespace content 2549 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698