summaryrefslogtreecommitdiffstats
path: root/libc
diff options
context:
space:
mode:
authorQuIC Gerrit Code Review <gerrit@quicinc.com>2009-12-16 08:06:57 -0800
committerQuIC Gerrit Code Review <gerrit@quicinc.com>2009-12-16 08:06:57 -0800
commitc5c0adffe8561332371f201c5693369db0a88666 (patch)
treedea382dfe48c5fc1fd460d05e8491cb054ab4d0a /libc
parentae0d88263574fcadbdee0f6d8e57329d07489819 (diff)
parent352bfe4ce7de3d04a3da98acb2b8cb0363e421c2 (diff)
downloadbionic-c5c0adffe8561332371f201c5693369db0a88666.zip
bionic-c5c0adffe8561332371f201c5693369db0a88666.tar.gz
bionic-c5c0adffe8561332371f201c5693369db0a88666.tar.bz2
* changes: bionic: update msm_q6venc.h
Diffstat (limited to 'libc')
-rw-r--r--[-rwxr-xr-x]libc/kernel/common/linux/msm_q6venc.h300
1 files changed, 233 insertions, 67 deletions
diff --git a/libc/kernel/common/linux/msm_q6venc.h b/libc/kernel/common/linux/msm_q6venc.h
index 95c52c6..89ad5bf 100755..100644
--- a/libc/kernel/common/linux/msm_q6venc.h
+++ b/libc/kernel/common/linux/msm_q6venc.h
@@ -14,94 +14,260 @@
#include <linux/types.h>
-struct venc_buf {
- unsigned int src_id;
- unsigned int fd;
+#define VENC_MAX_RECON_BUFFERS 2
+
+#define VENC_FLAG_EOS 0x00000001
+#define VENC_FLAG_END_OF_FRAME 0x00000010
+#define VENC_FLAG_SYNC_FRAME 0x00000020
+#define VENC_FLAG_CODEC_CONFIG 0x00000080
+
+enum venc_flush_type {
+ VENC_FLUSH_INPUT,
+ VENC_FLUSH_OUTPUT,
+ VENC_FLUSH_ALL
+};
+
+enum venc_state_type {
+ VENC_STATE_PAUSE = 0x1,
+ VENC_STATE_START = 0x2,
+ VENC_STATE_STOP = 0x4
+};
+
+enum venc_event_type_enum {
+ VENC_EVENT_UNKNOWN_STATUS,
+ VENC_EVENT_START_STATUS,
+ VENC_EVENT_STOP_STATUS,
+ VENC_EVENT_SUSPEND_STATUS,
+ VENC_EVENT_RESUME_STATUS,
+ VENC_EVENT_FLUSH_STATUS,
+ VENC_EVENT_RELEASE_INPUT,
+ VENC_EVENT_DELIVER_OUTPUT
+};
+
+enum venc_status_code {
+ VENC_STATUS_SUCCESS,
+ VENC_STATUS_ERROR,
+ VENC_STATUS_INVALID_STATE,
+ VENC_STATUS_FLUSHING,
+ VENC_STATUS_INVALID_PARAM,
+ VENC_STATUS_CMD_QUEUE_FULL,
+ VENC_STATUS_CRITICAL,
+ VENC_STATUS_INSUFFICIENT_RESOURCES,
+ VENC_STATUS_TIMEOUT
+};
+
+enum venc_msg_code {
+ VENC_MSG_INDICATION,
+ VENC_MSG_INPUT_BUFFER_DONE,
+ VENC_MSG_OUTPUT_BUFFER_DONE,
+ VENC_MSG_NEED_OUTPUT_BUFFER,
+ VENC_MSG_FLUSH,
+ VENC_MSG_START,
+ VENC_MSG_STOP,
+ VENC_MSG_PAUSE,
+ VENC_MSG_RESUME,
+ VENC_MSG_STOP_READING_MSG
+};
+
+enum venc_error_code {
+ VENC_S_SUCCESS,
+ VENC_S_EFAIL,
+ VENC_S_EFATAL,
+ VENC_S_EBADPARAM,
+ VENC_S_EINVALSTATE,
+ VENC_S_ENOSWRES,
+ VENC_S_ENOHWRES,
+ VENC_S_EBUFFREQ,
+ VENC_S_EINVALCMD,
+ VENC_S_ETIMEOUT,
+ VENC_S_ENOREATMPT,
+ VENC_S_ENOPREREQ,
+ VENC_S_ECMDQFULL,
+ VENC_S_ENOTSUPP,
+ VENC_S_ENOTIMPL,
+ VENC_S_ENOTPMEM,
+ VENC_S_EFLUSHED,
+ VENC_S_EINSUFBUF,
+ VENC_S_ESAMESTATE,
+ VENC_S_EINVALTRANS
+};
+
+enum venc_mem_region_enum {
+ VENC_EBI1,
+ VENC_SMI
+};
+
+struct venc_buf_type {
+ unsigned int region;
+ unsigned int phys;
+ unsigned int size;
+ int offset;
+};
+
+struct venc_qp_range {
+ unsigned int min_qp;
+ unsigned int max_qp;
+};
+
+struct venc_frame_rate {
+ unsigned int frame_rate_num;
+ unsigned int frame_rate_den;
+};
+
+struct venc_frame_quality {
+ unsigned int frame_rate_num;
+ unsigned int frame_rate_den;
+ unsigned int bitrate;
+ unsigned int min_qp;
+ unsigned int max_qp;
+};
+
+struct venc_slice_info {
+ unsigned int slice_mode;
+ unsigned int units_per_slice;
+};
+
+struct venc_common_config {
+ unsigned int standard;
+ unsigned int input_frame_height;
+ unsigned int input_frame_width;
+ unsigned int output_frame_height;
+ unsigned int output_frame_width;
+ unsigned int rotation_angle;
+ unsigned int intra_period;
+ unsigned int rate_control;
+ struct venc_frame_quality frame_quality;
+ unsigned int iframe_qp;
+ unsigned int pframe_qp;
+ struct venc_slice_info slice_config;
+ struct venc_buf_type recon_buf1;
+ struct venc_buf_type recon_buf2;
+ struct venc_buf_type wb_buf;
+ void *callback_event;
+};
+
+struct venc_mpeg4_config {
+ unsigned int profile;
+ unsigned int level;
+ unsigned int time_resolution;
+ unsigned int ac_prediction;
+ unsigned int hec_interval;
+ unsigned int data_partition;
+ unsigned int short_header;
+};
+
+struct venc_h263_config {
+ unsigned int profile;
+ unsigned int level;
+};
+
+struct venc_h264_config {
+ unsigned int profile;
+ unsigned int level;
+ unsigned int max_nal;
+ unsigned int idr_period;
+};
+
+struct venc_pmem {
+ int src;
+ int fd;
unsigned int offset;
+ void *virt;
+ void *phys;
unsigned int size;
};
-struct q6_init_config {
- unsigned short venc_standard;
- unsigned short partial_run_length_flag;
- unsigned short h263_annex_ispt;
- unsigned short h263_annex_jspt;
- unsigned short h263_annex_tspt;
- unsigned short rc_flag;
- unsigned short one_mv_flag;
- unsigned short acdc_pred_enable;
- unsigned short rounding_bit_ctrl;
- unsigned short rotation_flag;
- unsigned short max_mvx;
- unsigned short max_mvy;
- unsigned short enc_frame_height_inmb;
- unsigned short enc_frame_width_inmb;
- unsigned short dvs_frame_height;
- unsigned short dvs_frame_width;
- unsigned int ref_frame_buf1_phy;
- unsigned int ref_frame_buf2_phy;
- unsigned int rlc_buf1_phy;
- unsigned int rlc_buf2_phy;
- unsigned int rlc_buf_length;
+struct venc_buffer {
+ unsigned char *ptr_buffer;
+ unsigned int size;
+ unsigned int len;
+ unsigned int offset;
+ long long time_stamp;
+ unsigned int flags;
+ unsigned int client_data;
+
+};
+
+struct venc_buffers {
+ struct venc_pmem recon_buf[VENC_MAX_RECON_BUFFERS];
+ struct venc_pmem wb_buf;
};
-struct init_config {
- struct venc_buf ref_frame_buf1;
- struct venc_buf ref_frame_buf2;
- struct venc_buf rlc_buf1;
- struct venc_buf rlc_buf2;
- struct q6_init_config q6_init_config;
+struct venc_buffer_flush {
+ unsigned int flush_mode;
};
-struct q6_encode_param {
- unsigned int y_addr_phy;
- unsigned int uv_addr_phy;
- unsigned int x_offset;
- unsigned int y_offset;
- unsigned int frame_rho_budget;
- unsigned int frame_type;
- unsigned int qp;
+union venc_msg_data {
+ struct venc_buffer buf;
+ struct venc_buffer_flush flush_ret;
+
};
-struct encode_param {
- struct venc_buf y_addr;
- struct venc_buf uv_addr;
- struct q6_encode_param q6_encode_param;
+struct venc_msg {
+ unsigned int status_code;
+ unsigned int msg_code;
+ union venc_msg_data msg_data;
+ unsigned int msg_data_size;
};
-struct intra_refresh {
- unsigned int intra_refresh_enable;
- unsigned int intra_mb_num;
+union venc_codec_config {
+ struct venc_mpeg4_config mpeg4_params;
+ struct venc_h263_config h263_params;
+ struct venc_h264_config h264_params;
};
-struct rc_config {
- unsigned short max_frame_qp_up_delta;
- unsigned short max_frame_qp_down_delta;
- unsigned short min_frame_qp;
- unsigned short max_frame_qp;
+struct venc_q6_config {
+ struct venc_common_config config_params;
+ union venc_codec_config codec_params;
};
-struct q6_frame_type {
- unsigned int frame_type;
- unsigned int frame_len;
- unsigned int frame_addr;
- unsigned int map_table;
+struct venc_init_config {
+ struct venc_q6_config q6_config;
+ struct venc_buffers q6_bufs;
};
-struct frame_type {
- struct venc_buf frame_addr;
- struct q6_frame_type q6_frame_type;
+struct venc_seq_config {
+ int size;
+ struct venc_pmem buf;
+ struct venc_q6_config q6_config;
};
#define VENC_IOCTL_MAGIC 'V'
-#define VENC_IOCTL_INITIALIZE _IOW(VENC_IOCTL_MAGIC, 1, struct init_config)
-#define VENC_IOCTL_ENCODE _IOW(VENC_IOCTL_MAGIC, 2, struct encode_param)
-#define VENC_IOCTL_INTRA_REFRESH _IOW(VENC_IOCTL_MAGIC, 3, struct intra_refresh)
-#define VENC_IOCTL_RC_CONFIG _IOW(VENC_IOCTL_MAGIC, 4, struct rc_config)
-#define VENC_IOCTL_ENCODE_CONFIG _IOW(VENC_IOCTL_MAGIC, 5, struct init_config)
-#define VENC_IOCTL_STOP _IO(VENC_IOCTL_MAGIC, 6)
-#define VENC_IOCTL_WAIT_FOR_ENCODE _IOR(VENC_IOCTL_MAGIC, 7, struct frame_type)
-#define VENC_IOCTL_STOP_ENCODE _IO(VENC_IOCTL_MAGIC, 8)
+#define VENC_IOCTL_CMD_READ_NEXT_MSG _IOWR(VENC_IOCTL_MAGIC, 1, struct venc_msg)
+
+#define VENC_IOCTL_CMD_STOP_READ_MSG _IO(VENC_IOCTL_MAGIC, 2)
+
+#define VENC_IOCTL_SET_INPUT_BUFFER _IOW(VENC_IOCTL_MAGIC, 3, struct venc_pmem)
+
+#define VENC_IOCTL_SET_OUTPUT_BUFFER _IOW(VENC_IOCTL_MAGIC, 4, struct venc_pmem)
+
+#define VENC_IOCTL_CMD_START _IOW(VENC_IOCTL_MAGIC, 5, struct venc_init_config)
+
+#define VENC_IOCTL_CMD_ENCODE_FRAME _IOW(VENC_IOCTL_MAGIC, 6, struct venc_buffer)
+
+#define VENC_IOCTL_CMD_FILL_OUTPUT_BUFFER _IOW(VENC_IOCTL_MAGIC, 7, struct venc_buffer)
+
+#define VENC_IOCTL_CMD_FLUSH _IOW(VENC_IOCTL_MAGIC, 8, struct venc_buffer_flush)
+
+#define VENC_IOCTL_CMD_PAUSE _IO(VENC_IOCTL_MAGIC, 9)
+
+#define VENC_IOCTL_CMD_RESUME _IO(VENC_IOCTL_MAGIC, 10)
+
+#define VENC_IOCTL_CMD_STOP _IO(VENC_IOCTL_MAGIC, 11)
+
+#define VENC_IOCTL_SET_INTRA_PERIOD _IOW(VENC_IOCTL_MAGIC, 12, int)
+
+#define VENC_IOCTL_CMD_REQUEST_IFRAME _IO(VENC_IOCTL_MAGIC, 13)
+
+#define VENC_IOCTL_GET_SEQUENCE_HDR _IOWR(VENC_IOCTL_MAGIC, 14, struct venc_seq_config)
+
+#define VENC_IOCTL_SET_INTRA_REFRESH _IOW(VENC_IOCTL_MAGIC, 15, int)
+
+#define VENC_IOCTL_SET_FRAME_RATE _IOW(VENC_IOCTL_MAGIC, 16, struct venc_frame_rate)
+
+#define VENC_IOCTL_SET_TARGET_BITRATE _IOW(VENC_IOCTL_MAGIC, 17, int)
+
+#define VENC_IOCTL_SET_QP_RANGE _IOW(VENC_IOCTL_MAGIC, 18, struct venc_qp_range)
#endif