#ifndef VMF_VIDEO_DISPLAY_H
#define VMF_VIDEO_DISPLAY_H

#include <stdint.h>

typedef struct VMF_VDISP_HANDLE_S VMF_VDISP_HANDLE_T;

#define VMF_VIDEO_DISPLAY_MIN_QUEUE_SIZE  3

/* Frame buffer descriptor (apdwData[0] = Y plane virtual address) */
typedef struct {
    void    *apdwData[4];
    uint32_t _pad[8];
} VMF_FRAME_BUF_T;

/* Display init options — fields accessed by set_video_data() in kdp2_host_stream.c */
typedef struct {
    uint32_t dwInPixFormat;
    uint32_t dwMaxInWidth;
    uint32_t dwMaxInHeight;
    uint32_t _pad[61];
} VMF_VDISP_INITOPT_T;

VMF_VDISP_HANDLE_T *VMF_VDISP_Init(VMF_VDISP_INITOPT_T *opt);
int VMF_VDISP_Open(VMF_VDISP_HANDLE_T **handle, unsigned int w, unsigned int h);
int VMF_VDISP_Close(VMF_VDISP_HANDLE_T *handle);
void VMF_VDISP_SetEarlyInterrupt(VMF_VDISP_HANDLE_T *handle, uint32_t val);
int  VMF_VDISP_All_Setting_Reset(VMF_VDISP_HANDLE_T *handle);
int  VMF_VDISP_SetCompress(VMF_VDISP_HANDLE_T *handle, int enable);
void VMF_VDISP_Stop(VMF_VDISP_HANDLE_T *handle);
void VMF_VDISP_Release(VMF_VDISP_HANDLE_T *handle);
int  VMF_VDISP_ProcessOneFrame(VMF_VDISP_HANDLE_T *handle, VMF_FRAME_BUF_T *buf, uint32_t *q_idx);
int  VMF_VDISP_SetMirror(VMF_VDISP_HANDLE_T *handle, uint32_t enable);
int  VMF_VDISP_SetFlip(VMF_VDISP_HANDLE_T *handle, uint32_t enable);
int  VMF_VDISP_YUVOutput_SetContrast(VMF_VDISP_HANDLE_T *handle, int contrast);
int  VMF_VDISP_YUVOutput_GetContrast(VMF_VDISP_HANDLE_T *handle, int *contrast);
int  VMF_VDISP_YUVOutput_SetBrightness(VMF_VDISP_HANDLE_T *handle, int brightness);
int  VMF_VDISP_YUVOutput_GetBrightness(VMF_VDISP_HANDLE_T *handle, int *brightness);
int  VMF_VDISP_YUVOutput_SetSaturation(VMF_VDISP_HANDLE_T *handle, uint32_t saturation);
int  VMF_VDISP_YUVOutput_GetSaturation(VMF_VDISP_HANDLE_T *handle, uint32_t *saturation);

#endif /* VMF_VIDEO_DISPLAY_H */
