Log options
This commit is contained in:
14
hw/v4l2.h
14
hw/v4l2.h
@ -18,23 +18,13 @@
|
||||
|
||||
#include <linux/videodev2.h>
|
||||
|
||||
#include "opts/log.h"
|
||||
|
||||
#ifndef CFG_XIOCTL_RETRIES
|
||||
# define CFG_XIOCTL_RETRIES 4
|
||||
#endif
|
||||
#define XIOCTL_RETRIES ((unsigned)(CFG_XIOCTL_RETRIES))
|
||||
|
||||
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
|
||||
|
||||
extern int log_debug;
|
||||
|
||||
// assumes that name is first item
|
||||
#define dev_name(dev) (dev ? *(const char**)dev : "?")
|
||||
#define E_LOG_ERROR(dev, _msg, ...) do { fprintf(stderr, "%s: %s: " _msg "\n", __FILENAME__, dev_name(dev), ##__VA_ARGS__); goto error; } while(0)
|
||||
#define E_LOG_PERROR(dev, _msg, ...) do { fprintf(stderr, "%s: %s: " _msg "\n", __FILENAME__, dev_name(dev), ##__VA_ARGS__); exit(-1); } while(0)
|
||||
#define E_LOG_INFO(dev, _msg, ...) do { fprintf(stderr, "%s: %s: " _msg "\n", __FILENAME__, dev_name(dev), ##__VA_ARGS__); } while(0)
|
||||
#define E_LOG_VERBOSE(dev, _msg, ...) do { fprintf(stderr, "%s: %s: " _msg "\n", __FILENAME__, dev_name(dev), ##__VA_ARGS__); } while(0)
|
||||
#define E_LOG_DEBUG(dev, _msg, ...) do { if (log_debug) { fprintf(stderr, "%s: %s: " _msg "\n", __FILENAME__, dev_name(dev), ##__VA_ARGS__); } } while(0)
|
||||
|
||||
typedef struct {
|
||||
char buf[10];
|
||||
} fourcc_string;
|
||||
|
Reference in New Issue
Block a user