| OLD | NEW |
| 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/gpu/v4l2_jpeg_decode_accelerator.h" | 5 #include "media/gpu/v4l2_jpeg_decode_accelerator.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <linux/videodev2.h> | 8 #include <linux/videodev2.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 #include <sys/mman.h> | 10 #include <sys/mman.h> |
| 11 | 11 |
| 12 #include <memory> | 12 #include <memory> |
| 13 | 13 |
| 14 #include "base/big_endian.h" | 14 #include "base/big_endian.h" |
| 15 #include "base/bind.h" | 15 #include "base/bind.h" |
| 16 #include "base/thread_task_runner_handle.h" | 16 #include "base/threading/thread_task_runner_handle.h" |
| 17 #include "media/filters/jpeg_parser.h" | 17 #include "media/filters/jpeg_parser.h" |
| 18 #include "media/gpu/v4l2_jpeg_decode_accelerator.h" | 18 #include "media/gpu/v4l2_jpeg_decode_accelerator.h" |
| 19 #include "third_party/libyuv/include/libyuv.h" | 19 #include "third_party/libyuv/include/libyuv.h" |
| 20 | 20 |
| 21 #define IOCTL_OR_ERROR_RETURN_VALUE(type, arg, value, type_name) \ | 21 #define IOCTL_OR_ERROR_RETURN_VALUE(type, arg, value, type_name) \ |
| 22 do { \ | 22 do { \ |
| 23 if (device_->Ioctl(type, arg) != 0) { \ | 23 if (device_->Ioctl(type, arg) != 0) { \ |
| 24 PLOG(ERROR) << __func__ << "(): ioctl() failed: " << type_name; \ | 24 PLOG(ERROR) << __func__ << "(): ioctl() failed: " << type_name; \ |
| 25 PostNotifyError(kInvalidBitstreamBufferId, PLATFORM_FAILURE); \ | 25 PostNotifyError(kInvalidBitstreamBufferId, PLATFORM_FAILURE); \ |
| 26 return value; \ | 26 return value; \ |
| (...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 882 device_poll_thread_.Stop(); | 882 device_poll_thread_.Stop(); |
| 883 | 883 |
| 884 // Clear the interrupt now, to be sure. | 884 // Clear the interrupt now, to be sure. |
| 885 if (!device_->ClearDevicePollInterrupt()) | 885 if (!device_->ClearDevicePollInterrupt()) |
| 886 return false; | 886 return false; |
| 887 | 887 |
| 888 return true; | 888 return true; |
| 889 } | 889 } |
| 890 | 890 |
| 891 } // namespace media | 891 } // namespace media |
| OLD | NEW |