displaydev.h

来自「AMLOGIC DPF source code」· C头文件 代码 · 共 506 行 · 第 1/2 页

H
506
字号
#define PLAY_RATE_60        1600

#define PLAY_FPS2_RATE(x)   (96000/(x))

#define VIDEO_DEC_FORMAT_MPEG2      0
#define VIDEO_DEC_FORMAT_MPEG4_3    1
#define VIDEO_DEC_FORMAT_MPEG4_4    2
#define VIDEO_DEC_FORMAT_MPEG4_5    3
#define VIDEO_DEC_FORMAT_MJPEG      4
#define VIDEO_DEC_FORMAT_REAL_8     5
#define VIDEO_DEC_FORMAT_REAL_9     6

typedef struct {
    unsigned    format;
    unsigned    width;
    unsigned    height;
    unsigned    rate;
    unsigned    extra;
    unsigned    status;
    void *      param;
} dec_sysinfo_t;

typedef enum {
    PIC_DEC_STOPPED = 0,            /* decoder is not running */
    PIC_DEC_WAITFOR_HW_INFO,        /* waiting for hardware information ready */
    PIC_DEC_RUNNING,                /* driver task is running */
    PIC_DEC_INIT_DRVTSK,          	/* init driver task */
    PIC_DEC_PAUSED,          		/* wake scaler */
    PIC_DEC_ERROR,                  /* something wrong during decoding */
    PIC_DEC_DONE,                   /* one picture is successfully decoded */
    PIC_DEC_COMPATIABLE             /* the picture format is not compatiable */
} picdec_state_t;

typedef enum {
    PICDEC_FB_PICINFO,
    PICDEC_FB_STATUS,
    PICDEC_FB_MOREDATA
} pic_dec_fbcode_t;
    
typedef struct {
    pic_dec_fbcode_t    fbcode;
    unsigned            arg1;
    unsigned            arg2;
    unsigned            arg3;
} pic_dec_fb_t;    

typedef int (*picdec_callback)(unsigned arg, pic_dec_fb_t *feedback);

typedef enum {
    PIC_DEC_DIR_0 = 0,
    PIC_DEC_DIR_90,
    PIC_DEC_DIR_180,
    PIC_DEC_DIR_270
} pic_dir_t;

#define PICDEC_START_FLAG_AUDIO_COMP        0x00000001
#define PICDEC_START_FLAG_VPP_AUTOCENTER    0x00000002
#define PICDEC_START_FLAG_THUMB_PREFERED    0x00000004
#define PICDEC_START_FLAG_FULL_SCREEN		0x00000008
#define PICDEC_START_FLAG_ORIGINAL_SCREEN   0x00000010
#define PICDEC_START_FLAG_CENTER_CROP       0x00000020
#define PICDEC_START_FLAG_SMART_CENTER_CROP 0x00000040
#define PICDEC_START_FLAG_USE_DYNAMIC_FRAME 0x00000080
#define PICDEC_START_FLAG_CINEMA			0x00000100
#define PICDEC_START_FLAG_SMART_VPP_ZOOM	0x00000200	


#define PICDEC_START_FLAG_NORMAL 			0x10000000
#define PICDEC_START_FLAG_SHARPER 			0x20000000
#define PICDEC_START_FLAG_SOFTER 			0x40000000
#define PICDEC_START_FLAG_PORTRAIT          0x01000000

typedef enum {
    PICDEC_EFFECT_NONE = 0,
    PICDEC_EFFECT_GRAYSCALE
} picdec_effect_t;

typedef struct {
	unsigned	    top;
	unsigned	    left;
	unsigned	    width;
	unsigned	    height;
	unsigned        timeout;
	pic_dir_t	    direction;
	unsigned	    area;
	picdec_callback	cb;
	unsigned	    cb_arg;
    unsigned        driver_prio;
    unsigned        flags;
    unsigned        crop_policy;
    unsigned        smart_vpp_zoom;
    int             small_pic_display_policy;
    picdec_effect_t decoder_effect;
} picdec_startcmd_t;

/* frame type define
 * Progressive
 *  bit     [0]     : '0
 *          [1]     : '0 -- normal progressive
 *                  : '1 -- de-interlaced
 *          [2]     : '0 -- de-interlaced CbCr need bobbing on top field
 *                  : '1 -- de-interlaced CbCr need bobbing on bottom field
 * Interlace
 *  bit     [0]     : '1
 *          [1]     : '0 -- top field
 *                  : '1 -- bottom field
 *          [2]     : reserved
 *          [3]     : '1 -- first field
 * Both
 *  bit     [10-4]  : 0x4b for 3:2 pulldown and 0x4a for 2:2 pulldown, 0 for normal
 *  bit     [11]    : '0 VPP input from VMIX, '1 VPP input from FIFO
 *  bit     [12]    : '0 VIU normal mode, '1 VIU field mode
 *  bit     [13]    : '0 VIU input from SDRAM1, '1 VIU input from Frame Buffer
 */
#define VIDTYPE_TYPEMASK                0x7
#define VIDTYPE_PROGRESSIVE             0x0     /* progressive */
#define VIDTYPE_PROGRESSIVE_BOB_TOP     0x2     /* de-interlace CbCr bottom interlace */
#define VIDTYPE_PROGRESSIVE_BOB_BOTTOM  0x6     /* de-interlace CbCr top interlace */
#define VIDTYPE_INTERLACE               0x1
#define VIDTYPE_INTERLACE_TOP           0x1     /* interlaced picture, top field */
#define VIDTYPE_INTERLACE_BOTTOM        0x3     /* interlaced picture, bottom field */
#define VIDTYPE_INTERLACE_FIRST         0x8     /* this interlace field is the first field in one frame */
#define VIDTYPE_PULLDOWN                0x10
#define VIDTYPE_HD                      0x800   /* HD (from FIFO/VMIX) */
#define VIDTYPE_VIU_FIELD               0x1000  /* VIU field mode */
#define VIDTYPE_VIU_FRAME_BUFFER        0x2000  /* VIU select sdram2 path */

#define DISP_RATIO_FORCECONFIG          0x80000000
#define DISP_RATIO_CTRL_MASK            0x00000003
#define DISP_RATIO_NO_KEEPRATIO         0x00000000
#define DISP_RATIO_KEEPRATIO            0x00000001
#define DISP_RATIO_KEEPRATIO_SHORTSIDE  0x00000002

#define DISP_RATIO_ASPECT_RATIO_MASK    0x0000ff00
#define DISP_RATIO_ASPECT_RATIO_BIT     8

#define ASPECT_4_3                      ((3 << 8) / 4)
#define ASPECT_16_9                     ((9 << 8) / 16)

typedef struct DISPLAY_BUF_STRUCT
{
	unsigned    type;
	unsigned    buffer_index;
    unsigned    duration;
    unsigned    duration_pulldown;
	unsigned    disp_luma;
	unsigned    disp_luma_odd;
	unsigned    disp_chro_v;
	unsigned    disp_chro_v_odd;
	unsigned    disp_chro_u;
	unsigned    disp_chro_u_odd;
    unsigned    width;
    unsigned    height;
    unsigned    content_width;
    unsigned    content_height;
    unsigned    ratio_control;
} DISPLAY_BUF_STRUCT;

typedef enum {
    VIDEO_SYNC_MODE_MPEG2_AV = 0,
    VIDEO_SYNC_MODE_MPEG4,
    VIDEO_SYNC_MODE_LF,
    VIDEO_SYNC_MODE_REAL,
    VIDEO_SYNC_MODE_MAX
} video_sync_mode_t;

#define SYNC_SKEW_DEFAULT          12288
#define SYNC_SKEW_AAC              -30000

typedef enum {
    SYNC_STATE_HOLD = 0,            /* wait for scr setup */
    SYNC_STATE_PLAY_AMASTER,        /* video skip/repeat follow audio */
    SYNC_STATE_PLAY_VMASTER         /* audio start/pause follow video (during SF/step/pause) */
} sync_stat_t;
    
typedef struct {
    int     enable;
	int		mode;
	sync_stat_t    sync_state;
    int sync_skew;
} videosync_mode_t ;

typedef struct {
    void (*irq_handler)(void);
    void (*bh_handler)(void);
    unsigned onetime_flag;
} displayctl_hook_t ;

typedef int (*hdfreq_func_t)(unsigned);

/* define for DECODERIO_SET_DEINTERLACE_LEVEL
*
*
*/
/* set deinterlace level basded on buffers number*/
#define DEINTERLACE_LEVEL_DEFAULT       0
/* 
*    DEINTERLACE_LEVEL_FORCE_VIDEO: need 4 buffers 
*    'bob' is used for any source: 
*    bot=>first frame; top=>second frame 
*    suitable for moving pictures
*/
#define DEINTERLACE_LEVEL_FORCE_VIDEO     1

/* 
*    DEINTERLACE_LEVEL_FORCE_FILM: need 4 buffers
*    'weave' is used for any source:
*    top+bot=>first frame; top+bot=>second frame
*    suitable for still pictures
*/          
#define DEINTERLACE_LEVEL_FORCE_FILM   2

/* 
*    DEINTERLACE_LEVEL_SIMPLE: need 4 buffers
*    'weave' is used for progressive source;
*    'bob' is used for interlace source 
*/
#define DEINTERLACE_LEVEL_SIMPLE        3

/* 
*   DEINTERLACE_LEVEL_AUTO: need 5 buffers 
*    'weave' is used for progressive source and interlace still pictures;
*    'bob' is used for interlace moving pictures 
*    'pull down" is detected
*/
#define DEINTERLACE_LEVEL_AUTO          4

/* 
*   DEINTERLACE_LEVEL_PIXEL_BASED: need 5 buffers and 2 deinterlace buffers
*/
#define DEINTERLACE_LEVEL_LUMA_PIXEL_BASED   5

#define DEINTERLACE_LEVEL_PIXEL_BASED   6

/* 
*    DEINTERLACE_LEVEL_SIMPLE: need 4 buffers
*    'bob' is used for interlace source 
*    first frame use 'bob', second frame repeat
*/
#define DEINTERLACE_LEVEL_FORCE_HALF        7


/* define for DECODERIO_FEATURES
*
*
*/
#define DECODER_GET_FEATURE 0x80000000

#define DECODER_FEATURE_OLD_ERROR_PROCESS 1


#endif /* DISPLAYDEV_H */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?