You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
2.9 KiB

/*
* Copyright (c) Hisilicon Technologies Co., Ltd.. 2019-2019. All rights reserved.
* Description: Huanglong VI MPI declaration.
* Author: ATV team
* Create: 2019-11-20
*/
#ifndef __MPI_VI_H__
#define __MPI_VI_H__
#define LOG_MODULE_ID SOC_ID_VI
#define TIMEOUT_MAX_VALUE_MS 3000
#include <pthread.h>
#include "soc_log.h"
#include "soc_errno.h"
#include "drv_ioctl_vi.h"
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif /* __cplusplus */
#define mpi_vi_log_err(fmt...) soc_log_err(fmt)
#define mpi_vi_log_info(fmt...) soc_log_info(fmt)
#define mpi_vi_log_dbg(fmt...) soc_log_dbg(fmt)
#define mpi_vi_log_fatal(fmt...) soc_log_fatal(fmt)
#define mpi_vi_log_warn(fmt...) soc_log_warn(fmt)
#define mpi_vi_func_enter() soc_info_func_enter()
#define mpi_vi_func_exit() soc_info_func_exit()
#define mpi_vi_dbg_print_u32(val) soc_dbg_print_u32(val)
#define VI_THREAD_NAME_LEN 64
typedef struct {
td_handle vi_handle;
td_handle vo_handle;
td_u32 poll_type;
td_bool bypass_vo_for_test;
td_bool vi_que_thread_running;
td_bool vi_deq_thread_running;
ext_vi_dbg_info vi_dbg_info;
pthread_t api_que_thread;
pthread_t api_deq_thread;
td_char thread_name[VI_THREAD_NAME_LEN];
} vi_api_info;
td_u32 mpi_vi_diff_us(struct timeval end, struct timeval start);
td_s32 ext_mpi_vi_init(td_void);
td_s32 ext_mpi_vi_deinit(td_void);
td_s32 ext_mpi_vi_create(const ext_vi_attr *attr, td_handle *vi_handle);
td_s32 ext_mpi_vi_destroy(td_handle vi_handle);
td_s32 ext_mpi_vi_attach(td_handle vi_handle, td_handle vo_handle);
td_s32 ext_mpi_vi_detach(td_handle vi_handle, td_handle vo_handle);
td_s32 ext_mpi_vi_start(td_handle vi_handle);
td_s32 ext_mpi_vi_stop(td_handle vi_handle);
td_s32 ext_mpi_vi_update_nstd_info(td_handle vi_handle, ext_vi_nonstd_info nstd_info);
td_s32 ext_mpi_vi_set_src_quantization_range(td_handle vi_handle, ext_vi_quantization_range range_type);
td_s32 ext_mpi_vi_set_picture_mode(td_handle vi_handle, ext_vi_picture_mode picture_mode);
td_s32 ext_mpi_vi_set_config(td_handle vi_handle, const ext_vi_config *cfg);
td_s32 ext_mpi_vi_get_config(td_handle vi_handle, ext_vi_config *cfg);
td_s32 ext_mpi_vi_get_attr(td_handle vi_handle, ext_vi_attr *attr);
td_s32 ext_mpi_vi_set_capture_latency(td_handle vi_handle, td_u32 capture_latency);
td_s32 ext_mpi_vi_get_capture_latency(td_handle vi_handle, td_u32 *capture_latency);
td_s32 ext_mpi_vi_set_pattern(td_handle vi_handle, const ext_vi_pattern_info *pattern_info);
td_s32 ext_mpi_vi_get_pattern(td_handle vi_handle, ext_vi_pattern_info *pattern_info);
td_s32 ext_mpi_vi_acquire_frame(vi_path_info *path_info);
td_s32 ext_mpi_vi_release_frame(vi_path_info *path_info);
td_s32 ext_mpi_vi_set_output_attr(td_handle vi_handle, const ext_vi_output_attr *ext_output_attr);
td_s32 ext_mpi_vi_get_output_attr(td_handle vi_handle, ext_vi_output_attr *ext_output_attr);
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* __cplusplus */
#endif /* __MPI_VI_H__ */