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