v4l_encoder: convert macro `checked_ioctl` to funtion (#29609)

* break to multiple lines

* convert to function

* format errno

* use safe_ioctl

* cleanup
pull/29632/head
Dean Lee 2 years ago committed by GitHub
parent 86386fd87f
commit 1e62999e75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      system/loggerd/encoder/v4l_encoder.cc

@ -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};

Loading…
Cancel
Save