1 /* 2 * Copyright 2009 Google Inc. All Rights Reserved. 3 * Author: rschultz@google.com (Rebecca Schultz Zavin) 4 */ 5 6 #ifndef ANDROID_ZOOM_REPO_HARDWARE_SEC_LIBOVERLAY_V4L2_UTILS_H_ 7 #define ANDROID_ZOOM_REPO_HARDWARE_SEC_LIBOVERLAY_V4L2_UTILS_H_ 8 9 #include "s5p_fimc.h" 10 11 int v4l2_overlay_open(int id); 12 int v4l2_overlay_get_caps(int fd, struct v4l2_capability *caps); 13 int v4l2_overlay_req_buf(int fd, uint32_t *num_bufs, int cacheable_buffers, 14 int zerocopy); 15 int v4l2_overlay_query_buffer(int fd, int index, struct v4l2_buffer *buf); 16 int v4l2_overlay_map_buf(int fd, int index, void **start, size_t *len); 17 int v4l2_overlay_unmap_buf(void *start, size_t len); 18 int v4l2_overlay_stream_on(int fd); 19 int v4l2_overlay_stream_off(int fd); 20 int v4l2_overlay_q_buf(int fd, int index, int zerocopy); 21 int v4l2_overlay_dq_buf(int fd, int *index, int zerocopy); 22 int v4l2_overlay_init(int fd, uint32_t w, uint32_t h, uint32_t fmt, 23 uint32_t addr); 24 int v4l2_overlay_get_input_size(int fd, uint32_t *w, uint32_t *h, 25 uint32_t *fmt); 26 int v4l2_overlay_set_position(int fd, int32_t x, int32_t y, int32_t w, 27 int32_t h, int rotation); 28 int v4l2_overlay_get_position(int fd, int32_t *x, int32_t *y, int32_t *w, 29 int32_t *h); 30 int v4l2_overlay_set_crop(int fd, uint32_t x, uint32_t y, uint32_t w, 31 uint32_t h); 32 int v4l2_overlay_get_crop(int fd, uint32_t *x, uint32_t *y, uint32_t *w, 33 uint32_t *h); 34 int v4l2_overlay_set_flip(int fd, int degree); 35 int v4l2_overlay_set_rotation(int fd, int degree, int step); 36 int v4l2_overlay_set_colorkey(int fd, int enable, int colorkey); 37 int v4l2_overlay_set_global_alpha(int fd, int enable, int alpha); 38 int v4l2_overlay_set_local_alpha(int fd, int enable); 39 int v4l2_overlay_init_fimc(int fd, s5p_fimc_t *s5p_fimc); 40 int v4l2_overlay_s_fbuf(int fd, int rotation); 41 42 enum { 43 V4L2_OVERLAY_PLANE_GRAPHICS, 44 V4L2_OVERLAY_PLANE_VIDEO1, 45 V4L2_OVERLAY_PLANE_VIDEO2, 46 }; 47 48 enum { 49 /* support customed format for zero copy */ 50 HAL_PIXEL_FORMAT_YCbCr_420_SP = 0x21, 51 HAL_PIXEL_FORMAT_YCbCr_420_P = 0x13, 52 HAL_PIXEL_FORMAT_CUSTOM_YCbCr_420_SP = 0x100, 53 HAL_PIXEL_FORMAT_CUSTOM_YCbCr_422_I = 0x101, 54 HAL_PIXEL_FORMAT_CUSTOM_CbYCrY_422_I = 0x102, 55 HAL_PIXEL_FORMAT_CUSTOM_YCrCb_420_SP = 0x103, 56 HAL_PIXEL_FORMAT_CUSTOM_MAX 57 }; 58 59 enum { 60 PFT_RGB, 61 PFT_YUV420, 62 PFT_YUV422, 63 PFT_YUV444, 64 }; 65 66 struct mapping_data { 67 int fd; 68 size_t length; 69 uint32_t offset; 70 void *ptr; 71 }; 72 73 #define ALL_BUFFERS_FLUSHED -66 74 75 #endif /* ANDROID_ZOOM_REPO_HARDWARE_SEC_LIBOVERLAY_V4L2_UTILS_H_*/ 76