mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-02 13:29:30 +08:00
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: 1e62999e75
This commit is contained in:
@@ -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};
|
||||
|
||||
Reference in New Issue
Block a user