?? hdmi.h
字號:
/* * * Copyright (c) 2001-2007 Sigma Designs, Inc. * All Rights Reserved. Proprietary and Confidential. * *//** @file hdmi.c @brief Interface to access an HDMI capture port @author Christian Wolff, Sean.Sekwon.Choi @date 2007-07-16*/#ifndef __HDMI_H__#define __HDMI_H__#include "../../samples/dvi_hdmi.h"struct cap_hdmi_instance;struct cap_hdmi_update { RMuint32 APIVersion; // set to 1 RMbool GeneralControlPacketUpdate; RMbool AudioCPPacketUpdate; RMbool ISRC1PacketUpdate; RMbool ISRC2PacketUpdate; RMbool GamutMetadataPacketUpdate; RMbool VendorSpecificInfoFrameUpdate; RMbool AVIInfoFrameUpdate; RMbool AVIInfoFrameInvalidate; // invalidate any cached AVI RMbool SPDInfoFrameUpdate; RMbool AudioInfoFrameUpdate; RMbool MPEGInfoFrameUpdate;};enum cap_hdmi_mode { cap_hdmi_mode_unknown, cap_hdmi_mode_HDMI, cap_hdmi_mode_DVI};struct cap_hdmi_avi_info { RMbool valid; RMuint32 scan_info; // S RMbool v_bar; // B0 RMbool h_bar; // B1 RMuint32 active_format; // A, R RMuint32 color_format; // Y RMuint32 aspect_ratio; // M RMuint32 color_space; // C RMuint32 scaling; // SC RMuint32 quantisation; // Q RMuint32 ext_col; // EC RMbool it_content; // ITC RMuint32 vic; // VIC RMuint32 pixel_rep; // PR RMuint32 in_pixel_rep; // PR on the output of the HDMI chip, after reduction RMuint32 top; RMuint32 bottom; RMuint32 left; RMuint32 right;};#define HDMI_CEA861_VIDEOMODES_N 60#define HDMI_CEA861_VIDEOMODES { \ EMhwlibTVStandard_Custom, /* 0 */ \ EMhwlibTVStandard_HDMI_640x480p60, /* 1 */ \ EMhwlibTVStandard_HDMI_480p60, /* 2 */ \ EMhwlibTVStandard_HDMI_480p60, /* 3 */ \ EMhwlibTVStandard_HDMI_720p60, /* 4 */ \ EMhwlibTVStandard_HDMI_1080i60, /* 5 */ \ EMhwlibTVStandard_HDMI_480i60, /* 6 */ \ EMhwlibTVStandard_HDMI_480i60, /* 7 */ \ EMhwlibTVStandard_HDMI_240p60, /* 8 */ \ EMhwlibTVStandard_HDMI_240p60, /* 9 */ \ EMhwlibTVStandard_HDMI_2880x480i60, /* 10 */ \ EMhwlibTVStandard_HDMI_2880x480i60, /* 11 */ \ EMhwlibTVStandard_HDMI_2880x240p60, /* 12 */ \ EMhwlibTVStandard_HDMI_2880x240p60, /* 13 */ \ EMhwlibTVStandard_HDMI_1440x480p60, /* 14 */ \ EMhwlibTVStandard_HDMI_1440x480p60, /* 15 */ \ EMhwlibTVStandard_HDMI_1080p60, /* 16 */ \ EMhwlibTVStandard_HDMI_576p50, /* 17 */ \ EMhwlibTVStandard_HDMI_576p50, /* 18 */ \ EMhwlibTVStandard_HDMI_720p50, /* 19 */ \ EMhwlibTVStandard_HDMI_1080i50, /* 20 */ \ EMhwlibTVStandard_HDMI_576i50, /* 21 */ \ EMhwlibTVStandard_HDMI_576i50, /* 22 */ \ EMhwlibTVStandard_HDMI_288p50, /* 23 */ \ EMhwlibTVStandard_HDMI_288p50, /* 24 */ \ EMhwlibTVStandard_HDMI_2880x576i50, /* 25 */ \ EMhwlibTVStandard_HDMI_2880x576i50, /* 26 */ \ EMhwlibTVStandard_HDMI_2880x288p50, /* 27 */ \ EMhwlibTVStandard_HDMI_2880x288p50, /* 28 */ \ EMhwlibTVStandard_HDMI_1440x576p50, /* 29 */ \ EMhwlibTVStandard_HDMI_1440x576p50, /* 30 */ \ EMhwlibTVStandard_HDMI_1080p50, /* 31 */ \ EMhwlibTVStandard_HDMI_1080p24, /* 32 */ \ EMhwlibTVStandard_HDMI_1080p25, /* 33 */ \ EMhwlibTVStandard_HDMI_1080p30, /* 34 */ \ EMhwlibTVStandard_HDMI_2880x480p60, /* 35 */ \ EMhwlibTVStandard_HDMI_2880x480p60, /* 36 */ \ EMhwlibTVStandard_HDMI_2880x576p50, /* 37 */ \ EMhwlibTVStandard_HDMI_2880x576p50, /* 38 */ \ EMhwlibTVStandard_HDMI_1080i50_1250, /* 39 */ \ EMhwlibTVStandard_HDMI_1080i100, /* 40 */ \ EMhwlibTVStandard_HDMI_720p100, /* 41 */ \ EMhwlibTVStandard_HDMI_576p100, /* 42 */ \ EMhwlibTVStandard_HDMI_576p100, /* 43 */ \ EMhwlibTVStandard_HDMI_576i100, /* 44 */ \ EMhwlibTVStandard_HDMI_576i100, /* 45 */ \ EMhwlibTVStandard_HDMI_1080i120, /* 46 */ \ EMhwlibTVStandard_HDMI_720p120, /* 47 */ \ EMhwlibTVStandard_HDMI_480p120, /* 48 */ \ EMhwlibTVStandard_HDMI_480p120, /* 49 */ \ EMhwlibTVStandard_HDMI_480i120, /* 50 */ \ EMhwlibTVStandard_HDMI_480i120, /* 51 */ \ EMhwlibTVStandard_HDMI_576p200, /* 52 */ \ EMhwlibTVStandard_HDMI_576p200, /* 53 */ \ EMhwlibTVStandard_HDMI_576i200, /* 54 */ \ EMhwlibTVStandard_HDMI_576i200, /* 55 */ \ EMhwlibTVStandard_HDMI_480p240, /* 56 */ \ EMhwlibTVStandard_HDMI_480p240, /* 57 */ \ EMhwlibTVStandard_HDMI_480i240, /* 58 */ \ EMhwlibTVStandard_HDMI_480i240, /* 59 */ \}// VESA/CVT subset of all EMhwlib video modes#define HDMI_VESA_CVT_VIDEOMODES { \ EMhwlibTVStandard_VESA_640x350x85, \ EMhwlibTVStandard_VESA_640x400x85, \ EMhwlibTVStandard_VESA_720x400x85, \ EMhwlibTVStandard_VESA_640x480x60, \ EMhwlibTVStandard_VESA_640x480x72, \ EMhwlibTVStandard_VESA_640x480x75, \ EMhwlibTVStandard_VESA_640x480x85, \ EMhwlibTVStandard_VESA_848x480x60, \ EMhwlibTVStandard_VESA_800x600x56, \ EMhwlibTVStandard_VESA_800x600x60, \ EMhwlibTVStandard_VESA_800x600x72, \ EMhwlibTVStandard_VESA_800x600x75, \ EMhwlibTVStandard_VESA_800x600x85, \ EMhwlibTVStandard_VESA_1024x768x43, \ EMhwlibTVStandard_VESA_1024x768x60, \ EMhwlibTVStandard_VESA_1024x768x70, \ EMhwlibTVStandard_VESA_1024x768x75, \ EMhwlibTVStandard_VESA_1024x768x85, \ EMhwlibTVStandard_VESA_1152x864x75, \ EMhwlibTVStandard_VESA_1280x768x60RB, \ EMhwlibTVStandard_VESA_1280x768x60, \ EMhwlibTVStandard_VESA_1280x768x75, \ EMhwlibTVStandard_VESA_1280x768x85, \ EMhwlibTVStandard_VESA_1280x960x60, \ EMhwlibTVStandard_VESA_1280x960x85, \ EMhwlibTVStandard_VESA_1280x1024x60, \ EMhwlibTVStandard_VESA_1280x1024x75, \ EMhwlibTVStandard_VESA_1280x1024x85, \ EMhwlibTVStandard_VESA_1360x768x60, \ EMhwlibTVStandard_VESA_1366x768x60, \ EMhwlibTVStandard_VESA_1400x1050x60RB, \ EMhwlibTVStandard_VESA_1400x1050x60, \ EMhwlibTVStandard_VESA_1400x1050x75, \ EMhwlibTVStandard_VESA_1400x1050x85, \ EMhwlibTVStandard_VESA_1600x1200x60, \ EMhwlibTVStandard_VESA_1600x1200x65, \ EMhwlibTVStandard_VESA_1600x1200x70, \ EMhwlibTVStandard_VESA_1600x1200x75, \ EMhwlibTVStandard_VESA_1600x1200x85, \ EMhwlibTVStandard_VESA_1792x1344x60, \ EMhwlibTVStandard_VESA_1792x1344x75, \ EMhwlibTVStandard_VESA_1856x1392x60, \ EMhwlibTVStandard_VESA_1856x1392x75, \ EMhwlibTVStandard_VESA_1920x1200x60RB, \ EMhwlibTVStandard_VESA_1920x1200x60, \ EMhwlibTVStandard_VESA_1920x1200x75, \ EMhwlibTVStandard_VESA_1920x1200x85, \ EMhwlibTVStandard_VESA_1920x1440x60, \ EMhwlibTVStandard_VESA_1920x1440x75, \ EMhwlibTVStandard_VESA_640x350x70, \ EMhwlibTVStandard_VESA_640x480i30, \ EMhwlibTVStandard_VESA_640x480i60, \ EMhwlibTVStandard_VESA_720x400x70, \ EMhwlibTVStandard_VESA_640x480x66, \ EMhwlibTVStandard_VESA_832x624x75, \ EMhwlibTVStandard_VESA_1152x870x75, \ EMhwlibTVStandard_VESA_1280x720x60, \ EMhwlibTVStandard_VESA_1280x720x75, \ EMhwlibTVStandard_VESA_1440x900x60RB, \ EMhwlibTVStandard_VESA_1440x900x60, \ EMhwlibTVStandard_VESA_1440x900x75, \ EMhwlibTVStandard_VESA_1680x1050x60RB, \ EMhwlibTVStandard_VESA_1680x1050x60, \ EMhwlibTVStandard_VESA_1920x1080x60i, \ EMhwlibTVStandard_CVT_640x480x50, \ EMhwlibTVStandard_CVT_640x480x60, \ EMhwlibTVStandard_CVT_640x480x75, \ EMhwlibTVStandard_CVT_640x480x85, \ EMhwlibTVStandard_CVT_800x600x50, \ EMhwlibTVStandard_CVT_800x600x60, \ EMhwlibTVStandard_CVT_800x600x75, \ EMhwlibTVStandard_CVT_800x600x85, \ EMhwlibTVStandard_CVT_1024x768x50, \ EMhwlibTVStandard_CVT_1024x768x60, \ EMhwlibTVStandard_CVT_1024x768x75, \ EMhwlibTVStandard_CVT_1024x768x85, \ EMhwlibTVStandard_CVT_1152x864x50, \ EMhwlibTVStandard_CVT_1152x864x60, \ EMhwlibTVStandard_CVT_1152x864x75, \ EMhwlibTVStandard_CVT_1152x864x85, \ EMhwlibTVStandard_CVT_1280x960x50, \ EMhwlibTVStandard_CVT_1280x960x60, \ EMhwlibTVStandard_CVT_1280x960x75, \ EMhwlibTVStandard_CVT_1280x960x85, \ EMhwlibTVStandard_CVT_1280x1024x50, \ EMhwlibTVStandard_CVT_1280x1024x60, \ EMhwlibTVStandard_CVT_1280x1024x75, \ EMhwlibTVStandard_CVT_1280x1024x85, \ EMhwlibTVStandard_CVT_1600x1200x50, \ EMhwlibTVStandard_CVT_1600x1200x60, \};RMstatus cap_hdmi_open( struct RUA *pRUA, struct cap_chip_instance *pChip, struct cap_hdmi_instance **ppHDMI);RMstatus cap_hdmi_close( struct cap_hdmi_instance *pHDMI);/* tri-state all outputs and power down the selected chip */RMstatus cap_hdmi_tristate( struct cap_hdmi_instance *pHDMI);/* prepares the selected input for capture (initializes the chip) */RMstatus cap_hdmi_select_input( struct cap_hdmi_instance *pHDMI, RMuint32 input);/* set the pixel repetition value announced in the AVI info frame. This reduces the pixel clock and all horizontal timing values accordingly. */RMstatus cap_hdmi_apply_pixelrep( struct cap_hdmi_instance *pHDMI, RMuint32 pixel_rep);/** Initializes audio section of HDMI chip Reads channel status from HDMI chip Returns current sample frequency, or 0 if no audio*/RMstatus cap_hdmi_setup_audio( struct cap_hdmi_instance *pHDMI, RMuint32 MClkFactor, RMuint32 *pSamplingRate);/* Detect HDMI or DVI mode from the chip, signaling necessary actions */RMstatus cap_hdmi_detect_mode( struct cap_hdmi_instance *pHDMI, enum cap_hdmi_mode *pHDMIMode, RMbool *pUpdateAVI, // need to handle AVI Info Frame again RMbool *pUpdateAudio, // need to re-start audio RMbool *pUpdateVideo); // need to detect video mode/* set up certain capture parameters to match DVI capture mode (RGB888) */RMstatus cap_hdmi_prepare_dvi_mode( struct cap_hdmi_instance *pHDMI, enum EMhwlibTVStandard TVStandard, RMbool Wide, enum EMhwlibColorSpace *pInputColorSpace, enum EMhwlibInputColorFormat *pInputColorFormat, RMbool *pUpsample422, RMuint32 *pZoomX, RMuint32 *pZoomY, RMuint32 *pZoomW, RMuint32 *pZoomH, struct EMhwlibAspectRatio *pPictureAspectRatio);/* read an info frame of the specified 'type' from the selected chip *//* set 'version' to a specific requested version, or to 0 for any */RMstatus cap_hdmi_read_info_frame( struct cap_hdmi_instance *pHDMI, RMuint8 type, RMuint8 version, RMuint8 *header, RMuint8 *data, RMuint32 size, RMbool honor_checksum);/* signal intent to read the next available info frame of the specified 'type' */RMstatus cap_hdmi_prepare_info_frame( struct cap_hdmi_instance *pHDMI, RMuint8 type);/* Parses an Audio CP info frame, returns the filled struct */RMstatus cap_hdmi_parse_audio_cp_packet( struct cap_hdmi_instance *pHDMI, RMuint8 *header, RMuint8 *data, struct DH_AudioCP_Info *pAudioCP);/* Parses an ISRC1 info frame, return RM_PENDING if not new If not continued in ISRC2, fills in 16 bytes in pISRC and sets *pISRCSize, otherwise *pISRCSize will be set to 0. */RMstatus cap_hdmi_parse_isrc1_packet( struct cap_hdmi_instance *pHDMI, RMuint8 *header, RMuint8 *data, RMuint32 *pISRCSize, RMuint8 *pISRC);/* Parses an ISRC2 info frame, return RM_PENDING if not new. otherwise fills in 32 bytes from ISRC1 and ISRC2 into pISRC and sets *pISRCSize */RMstatus cap_hdmi_parse_isrc2_packet( struct cap_hdmi_instance *pHDMI, RMuint8 *header, RMuint8 *data, RMuint32 *pISRCSize, RMuint8 *pISRC);/* parses and prints a gamut metadata packet */RMstatus cap_hdmi_parse_gamut_packet( struct cap_hdmi_instance *pHDMI, RMuint8 *header, RMuint8 *data, struct DH_GamutMetadata *pGamutMetadata);/* parse vendor-specific info frame */RMstatus cap_hdmi_parse_vendor_info_frame( struct cap_hdmi_instance *pHDMI, RMuint8 *header, RMuint8 *data, RMuint32 *pVendorID, RMuint8 *pVendorData, RMuint32 *pVendorDataSize);/* parses an AVI data block into a struct cap_hdmi_avi_info */void cap_hdmi_parse_avi_struct(RMuint8 *avi_data, struct cap_hdmi_avi_info *avi);/* debug print of the AVI Info Frame, formatted same as table 7 in CEA 861-D */RMstatus cap_hdmi_print_avi_info_frame( struct cap_hdmi_instance *pHDMI, RMuint8 *avi_header, RMuint8 *avi_data, struct cap_hdmi_avi_info *avi);RMstatus cap_hdmi_handle_avi_info_frame( struct cap_hdmi_instance *pHDMI, struct cap_hdmi_avi_info *avi, struct cap_update *pUpdate);RMstatus cap_hdmi_parse_spd_info_frame( struct cap_hdmi_instance *pHDMI, RMuint8 *header, RMuint8 *data, // spd_data[1] through spd_data[25] are used struct DH_SPDInfoFrame *pSPDInfo);RMstatus cap_hdmi_parse_audio_info_frame( struct cap_hdmi_instance *pHDMI, RMuint8 *header, RMuint8 *data, struct DH_AudioInfoFrame *pAudioInfo);RMstatus cap_hdmi_parse_mpeg_info_frame( struct cap_hdmi_instance *pHDMI, RMuint8 *header, RMuint8 *data, struct DH_MPEGInfoFrame *pMPEGInfo);/* Returns RM_OK if cap_hdmi_handle_int() needs to be called */RMstatus cap_hdmi_check_int( struct cap_hdmi_instance *pHDMI);/* check and handle interrupts and/or other changes on the chip, fill in update information to pUpdate */RMstatus cap_hdmi_handle_int( struct cap_hdmi_instance *pHDMI, struct cap_update *pUpdate);// TODO has to go into main or common/* helper function to deduct probablt picture aspect ratio from video standard */void cap_get_aspect_ratio_from_video_mode( enum EMhwlibTVStandard TVStandard, struct EMhwlibTVFormatDigital *pTVFormat, RMbool wide, // ambiguous modes (SDTV,EDTV): FALSE=4:3, TRUE=16:9 anamorphic RMuint32 *asp_x, RMuint32 *asp_y);// TODO has to go into main or common/* helper function to reduce and aspect ratio to a certain value range */void cap_reduce_aspect_ratio( RMuint32 *X, RMuint32 *Y, RMuint32 boundary);#endif // __HDMI_H__
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -