1 // Copyright 2009 Google Inc. All Rights Reserved. 2 // Author: rschultz@google.com (Rebecca Schultz Zavin) 3 4 #ifndef ANDROID_ZOOM_REPO_HARDWARE_TI_OMAP3_LIBOVERLAY_V4L2_UTILS_H_ 5 #define ANDROID_ZOOM_REPO_HARDWARE_TI_OMAP3_LIBOVERLAY_V4L2_UTILS_H_ 6 7 int v4l2_overlay_open(int id); 8 int v4l2_overlay_get_caps(int fd, struct v4l2_capability *caps); 9 int v4l2_overlay_req_buf(int fd, uint32_t *num_bufs, int cacheable_buffers); 10 int v4l2_overlay_query_buffer(int fd, int index, struct v4l2_buffer *buf); 11 int v4l2_overlay_map_buf(int fd, int index, void **start, size_t *len); 12 int v4l2_overlay_unmap_buf(void *start, size_t len); 13 int v4l2_overlay_stream_on(int fd); 14 int v4l2_overlay_stream_off(int fd); 15 int v4l2_overlay_q_buf(int fd, int index); 16 int v4l2_overlay_dq_buf(int fd, int *index); 17 int v4l2_overlay_init(int fd, uint32_t w, uint32_t h, uint32_t fmt); 18 int v4l2_overlay_get_input_size(int fd, uint32_t *w, uint32_t *h, uint32_t *fmt); 19 int v4l2_overlay_set_position(int fd, int32_t x, int32_t y, int32_t w, 20 int32_t h); 21 int v4l2_overlay_get_position(int fd, int32_t *x, int32_t *y, int32_t *w, 22 int32_t *h); 23 int v4l2_overlay_set_crop(int fd, uint32_t x, uint32_t y, uint32_t w, 24 uint32_t h); 25 int v4l2_overlay_get_crop(int fd, uint32_t *x, uint32_t *y, uint32_t *w, 26 uint32_t *h); 27 int v4l2_overlay_set_rotation(int fd, int degree, int step); 28 int v4l2_overlay_set_colorkey(int fd, int enable, int colorkey); 29 int v4l2_overlay_set_global_alpha(int fd, int enable, int alpha); 30 int v4l2_overlay_set_local_alpha(int fd, int enable); 31 32 enum { 33 V4L2_OVERLAY_PLANE_GRAPHICS, 34 V4L2_OVERLAY_PLANE_VIDEO1, 35 V4L2_OVERLAY_PLANE_VIDEO2, 36 }; 37 38 typedef struct 39 { 40 int fd; 41 size_t length; 42 uint32_t offset; 43 void *ptr; 44 } mapping_data_t; 45 46 #define ALL_BUFFERS_FLUSHED -66 47 48 #endif // ANDROID_ZOOM_REPO_HARDWARE_TI_OMAP3_LIBOVERLAY_V4L2_UTILS_H_ 49