aboutsummaryrefslogtreecommitdiff
path: root/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'common.h')
-rw-r--r--common.h35
1 files changed, 19 insertions, 16 deletions
diff --git a/common.h b/common.h
index b6dabba..804ac1d 100644
--- a/common.h
+++ b/common.h
@@ -64,6 +64,8 @@
#define memzero(x) memset(&(x), 0, sizeof (x));
+#define ALIGN(val, align) ((val + (align - 1)) & ~(align - 1))
+
/* Maximum number of output buffers */
#define MAX_OUT_BUF 16
@@ -110,34 +112,34 @@ struct video {
int fd;
/* Output queue related */
- int out_buf_cnt;
- int out_buf_size;
+ unsigned int out_buf_cnt;
+ unsigned int out_buf_size;
uint32_t out_buf_off[MAX_OUT_BUF];
uint8_t *out_buf_addr[MAX_OUT_BUF];
int out_buf_flag[MAX_OUT_BUF];
/* Capture queue related */
- int cap_w;
- int cap_h;
- int cap_crop_w;
- int cap_crop_h;
- int cap_crop_left;
- int cap_crop_top;
- int cap_buf_cnt;
- int cap_buf_cnt_min;
- int cap_buf_size[CAP_PLANES];
+ unsigned int cap_w;
+ unsigned int cap_h;
+ unsigned int cap_crop_w;
+ unsigned int cap_crop_h;
+ unsigned int cap_crop_left;
+ unsigned int cap_crop_top;
+ unsigned int cap_buf_cnt;
+ unsigned int cap_buf_cnt_min;
+ unsigned int cap_buf_size[CAP_PLANES];
uint32_t cap_buf_off[MAX_CAP_BUF][CAP_PLANES];
uint8_t *cap_buf_addr[MAX_CAP_BUF][CAP_PLANES];
- int cap_buf_flag[MAX_CAP_BUF];
- int cap_buf_queued;
+ unsigned int cap_buf_flag[MAX_CAP_BUF];
+ unsigned int cap_buf_queued;
unsigned long total_encoded;
};
struct instance {
- int width;
- int height;
- int save_encoded;
+ unsigned int width;
+ unsigned int height;
+ unsigned int save_encoded;
char *save_path;
unsigned long num_frames_to_save;
@@ -153,6 +155,7 @@ struct instance {
/* Codec to be used for encoding */
unsigned long codec;
+ char *codec_name;
pthread_mutex_t lock;