v4l_encoder: convert macro checked_ioctl to funtion (#29609)

* break to multiple lines

* convert to function

* format errno

* use safe_ioctl

* cleanup
old-commit-hash: 1e62999e75b2ba85b7c443af0d8b3132e8e909d2
This commit is contained in:
Dean Lee
2023-08-26 02:05:22 +08:00
committed by GitHub
parent dbf03eb2c2
commit d5631664d3
+7 -1
View File
@@ -19,7 +19,13 @@
// echo 0x7fffffff > /sys/kernel/debug/msm_vidc/debug_level
const int env_debug_encoder = (getenv("DEBUG_ENCODER") != NULL) ? atoi(getenv("DEBUG_ENCODER")) : 0;
#define checked_ioctl(x, y, z) { int _ret = HANDLE_EINTR(ioctl(x, y, z)); if (_ret!=0) { LOGE("checked_ioctl failed %d %lx %p", x, y, z); } assert(_ret==0); }
static void checked_ioctl(int fd, unsigned long request, void *argp) {
int ret = util::safe_ioctl(fd, request, argp);
if (ret != 0) {
LOGE("checked_ioctl failed with error %d (%d %lx %p)", errno, fd, request, argp);
assert(0);
}
}
static void dequeue_buffer(int fd, v4l2_buf_type buf_type, unsigned int *index=NULL, unsigned int *bytesused=NULL, unsigned int *flags=NULL, struct timeval *timestamp=NULL) {
v4l2_plane plane = {0};