📄 cne2000.c
字号:
OsdWnd.y = this->YOffset + OsdWnd.y; } else { OsdWnd.x += VisWnd.x; OsdWnd.y += VisWnd.y; } IDecoder_UpdateVideoWindow(this->m_pIDecoder, &VisWnd, &FrameWnd, (this->NewOverlayFlags & VIDEO_VALID_ENABLE) ? &ValidWnd : NULL, &OsdWnd, &this->OsdHiLiWnd, this->LetterBox | ((this->OverlayFlags & OSD_VIDEO_INDEPENDENT_DEST)? OSD_VIDEO_INDEPENDENT:0) ); return TRUE;}/****f* HwLib/CNE2000__VGAUpdateVideoWindow * USAGE * NOT PRESENT in IDecoderBoard interface * void CNE2000__VGAUpdateVideoWindow(IDecoderBoard* pIDecoderBoard) * DESCRIPTION * CNE2000__VGAUpdateVideoWindow - used only for analog overlay, to display * the MPEG in a scalable window using a VGA chroma key. * Before calling this function you shoud call IDecoderBoard_OverlaySetSrc, * IDecoderBoard_OverlaySetAcq, IDecoderBoard_OverlaySetDst and * IDecoderBoard_OverlaySetVgaKey, IDecoderBoard_OverlaySetMode * It is called by IDecoderBoard_UpdateOverlay, CNE2000__VidSetVGATV * It calls CNE2000__UpdateScaledVideoWindow and IAnalogOverlay_SetMode * PARAMETERS * IN IDecoderBoard* pIDecoderBoard - pointer to the board object * SEE ALSO * IDecoderBoard_UpdateOverlay/*****************************************************************************/void CNE2000__VGAUpdateVideoWindow(IDecoderBoard* pIDecoderBoard){ CQuasarBoard *this = (CQuasarBoard*) pIDecoderBoard; if( CNE2000__UpdateScaledVideoWindow(pIDecoderBoard) ) IAnalogOverlay_SetMode(this->m_pINova1, this->ModeReq); else IAnalogOverlay_SetMode(this->m_pINova1, MpegModeNone);}/****f* HwLib/IDecoderBoard_UpdateOverlay * USAGE * QRESULT IDecoderBoard_UpdateOverlay(IDecoderBoard* pIDecoderBoard) * Specific implementation: * CNE2000__UpdateOverlay * CVE2000__UpdateOverlay * CQuad__UpdateOverlay * DESCRIPTION * IDecoderBoard_UpdateOverlay - according with the BoardVersion and the output * device for Mpeg the function will map to: * CQuasarBoard__TVVMIUpdateVideoWindow * CQuasarBoard__HdtvUpdateVideoWindow * CNE2000__VGAUpdateVideoWindow * This function is called every time when a change in display settings occurs. * It is called by IDecoderBoard_OverlaySetAcq, IDecoderBoard_OverlaySetSrc, * IDecoderBoard_OverlaySetDest, IDecoderBoard_VidChangeDisplayResolution, * IDecoderBoard_VidSetVGATV, CQuasarBoard__VideoHwSetOutputAspect, * IDecoderBoard_VideoSetAttribute, IDecoderBoard_OverlaySetAllWindows * PARAMETERS * IN IDecoderBoard* pIDecoderBoard - pointer to the board object * SEE ALSO * IDecoderBoard_OverlaySetAllWindows/*****************************************************************************/QRESULT CNE2000__UpdateOverlay(IDecoderBoard* pIDecoderBoard){ CQuasarBoard *this = (CQuasarBoard*) pIDecoderBoard; if(this->TvOut == SET_VGA) CNE2000__VGAUpdateVideoWindow(pIDecoderBoard); else if(this->TvOut == SET_TV) CQuasarBoard__TVVMIUpdateVideoWindow(pIDecoderBoard); else // SET_HDTV CQuasarBoard__HdtvUpdateVideoWindow(pIDecoderBoard); return Q_OK;}/****f* HwLib/CNE2000__VidChangeResolution * USAGE * NOT PRESENT in IDecoderBoard interface * void CNE2000__VidChangeResolution(IDecoderBoard* pIDecoderBoard, PMPEG_DISPLAY_RESOLUTION pDisplay) * DESCRIPTION * CNE2000__VidChangeResolution - used to program the analog overlay boards * to change the display settings when VGA mode was changed. * It is called by VidChangeDisplayResolution, CNE2000__VidSetVGATV . * PARAMETERS * IN IDecoderBoard* pIDecoderBoard - pointer to the board object * IN PMPEG_DISPLAY_RESOLUTION pDisplay - gives width, height, bits/pixel for the new VGA resolution * SEE ALSO * IDecoderBoard_VidChangeDisplayResolution/*****************************************************************************/void CNE2000__VidChangeResolution(IDecoderBoard* pIDecoderBoard, PMPEG_DISPLAY_RESOLUTION pDisplay){ CQuasarBoard *this = (CQuasarBoard*) pIDecoderBoard; if( !this->DisplayResolutionChanged ) return; // suppose display controller stopped before changing the DVCLK QDbgLog((QLOG_TRACE, QDebugLevelWarning, TEXT("--->VidChangeDispRes finally done") )); QDbgLog((QLOG_TRACE, QDebugLevelWarning, TEXT(" Resolution = %d x %d x %d"), this->DisplayResolution.iScreenWidth, this->DisplayResolution.iScreenHeight, this->DisplayResolution.iBitsPerPixel)); this->DisplayResolutionChanged = 0; OSmemcpy ((void*)&this->DisplayResolution, (void*)pDisplay, sizeof (MPEG_DISPLAY_RESOLUTION)); IAnalogOverlay_SetVgaResolution(this->m_pINova1, &this->DisplayResolution); IAnalogOverlay_IsVGAConnected(this->m_pINova1); // use this function to detect the polarity of VGA sync OSTimeDelay(20000); this->HFrequency = IAnalogOverlay_GetHFreq(this->m_pINova1, TRUE);// get the HFreq from hardware this->DefHFrequency = this->HFrequency; IAnalogOverlay_SetDVCLKFrequency(this->m_pINova1, this->HFrequency); IAnalogOverlay_GetDefaultCorrection(this->m_pINova1, &this->DefCorrection); IDecoder_SetKmin(this->m_pIDecoder, this->SrcWnd.w + 6, this->HFrequency * 100 ); this->IsInterlaced = IDecoder_IsInterlaced (this->m_pIDecoder, this->DisplayResolution.iScreenHeight);}/****f* HwLib/IDecoderBoard_VidChangeDisplayResolution * USAGE * QRESULT IDecoderBoard_VidChangeDisplayResolution(IDecoderBoard* pIDecoderBoard, PMPEG_DISPLAY_RESOLUTION pDisplay) * QRESULT CNE2000__VidChangeDisplayResolution(IDecoderBoard* pIDecoderBoard, PMPEG_DISPLAY_RESOLUTION pDisplay) * DESCRIPTION * IDecoderBoard_VidChangeDisplayResolution - used to program the analog overlay boards * to change the display settings when VGA mode was changed. * It is called by VidChangeDisplayResolution, CNE2000__VidSetVGATV . * PARAMETERS * IN IDecoderBoard* pIDecoderBoard - pointer to the board object * IN PMPEG_DISPLAY_RESOLUTION pDisplay - gives width, height, bits/pixel for the new VGA resolution * SEE ALSO * IDecoderBoard_VidChangeResolution/*****************************************************************************/QRESULT CNE2000__VidChangeDisplayResolution(IDecoderBoard* pIDecoderBoard, PMPEG_DISPLAY_RESOLUTION pDisplay){ CQuasarBoard *this = (CQuasarBoard*) pIDecoderBoard; if( this->BoardCapabilities & MPEG_CAPABILITY_VGA_WINDOW )// analog cable connected { QDbgLog((QLOG_TRACE, QDebugLevelWarning, TEXT("--->VidChgDispRes ") )); OSmemcpy (&this->NewDisplayResolution, (VOID*)pDisplay, sizeof (MPEG_DISPLAY_RESOLUTION)); this->DisplayResolutionChanged = 1; if( this->TvOut != SET_VGA ) { QDbgLog((QLOG_TRACE, QDebugLevelWarning, TEXT(" when TvOut != SET_VGA -> do it later") )); return Q_OK; } // stop the display controller before changing the DVCLK IDecoder_StopDisplayController(this->m_pIDecoder); CNE2000__VidChangeResolution(pIDecoderBoard, &this->NewDisplayResolution); CNE2000__VGAUpdateVideoWindow(pIDecoderBoard); } return Q_OK;}/****f* HwLib/IDecoderBoard_SetCustomTvHdtv * USAGE * QRESULT IDecoderBoard_SetCustomTvHdtv(IDecoderBoard* pIDecoderBoard, void* pTvHdtv, DWORD TvHdtvSize) * Specific implementation: * CNE2000__SetCustomTvHdtv * CVE2000__SetCustomTvHdtv * DESCRIPTION * IDecoderBoard_SetCustomTvHdtv - called only by IDecoderBoard_VideoSetAttribute * with MpegAttrHDTVMode attribute. * PARAMETERS * IN IDecoderBoard* pIDecoderBoard - pointer to the board object * IN void* pTvHdtv - pointer to HDTV_MODE structure * IN DWORD TvHdtvSize - size of HDTV_MODE structure * RETURN VALUE * Q_OK, Q_FAIL * SEE ALSO * IDecoderBoard_VideoSetAttribute, IDecoderBoard_VidSetVGATV, CQuasarBoard__HdtvCalc/*****************************************************************************/QRESULT CNE2000__SetCustomTvHdtv(IDecoderBoard* pIDecoderBoard, void* pTvHdtv, DWORD TvHdtvSize){ CQuasarBoard *this = (CQuasarBoard*) pIDecoderBoard; if(pTvHdtv == NULL) return Q_FAIL; OSmemcpy ((void*)&this->HdtvMode, pTvHdtv, sizeof (HDTV_MODE)); this->HdtvMode.PixelFreq = 0; this->HdtvMode.Interlaced = 0; if( (this->TvOut == SET_HDTV) || (this->TvOut == SET_HDTV_SUBD) ) IDecoderBoard_VidSetVGATV(pIDecoderBoard, RST_DC | this->TvDacsState, this->TvOut); return Q_OK;}////////////////////////////////////////////////////////////////////////////// calibration/****f* HwLib/IDecoderBoard_OverlaySetVgaKey * USAGE * QRESULT IDecoderBoard_OverlaySetVgaKey(IDecoderBoard* pIDecoderBoard, PMPEG_OVERLAY_KEY pKey) * QRESULT CNE2000__OverlaySetVgaKey(IDecoderBoard* pIDecoderBoard, PMPEG_OVERLAY_KEY pKey) * DESCRIPTION * IDecoderBoard_OverlaySetVgaKey - used to set the VGA color that will become transparent for Mpeg. * Before using this function a color calibration shoud be done. * PARAMETERS * IN IDecoderBoard* pIDecoderBoard - pointer to the board object * IN PMPEG_OVERLAY_KEY pKey - rgbColor member is the VGA color transparent for Mpeg. * If (rgbColor & 0xFF000000) is null (rgbColor & 0x00FFFFFF) is the RGB color. * If (rgbColor & 0xFF000000) is not null (rgbColor & 0x00FFFFFF) should be an index * in the next palette: * 0x00 = 0x000000; * 0x01 = 0x000080; * 0x02 = 0x008000; * 0x03 = 0x008080; * 0x04 = 0x800000; * 0x05 = 0x800080; * 0x06 = 0x808000; * 0x07 = 0xC0C0C0; * 0xF8 = 0x808080; * 0xF9 = 0x0000FF; * 0xFA = 0x00FF00; * 0xFB = 0x00FFFF; * 0xFC = 0xFF0000; * 0xFD = 0xFF00FF; * 0xFE = 0xFFFF00; * 0xFF = 0xFFFFFF; * Every R, G, B byte resulted is transformed from digital value to the necessary range * for the AnalogOverlay hardware, using linear interpolation of the values from * CALIBRATION_PARAMETERS structure. This structure is set when color calibration is done. * RETURN VALUE * Q_OK, E_NOT_SUPPORTED if Analog overlay is not present * SEE ALSO * IDecoderBoard_OverlayGetVgaKey, IDecoderBoard_OverlaySetColorCalibration, * IAnalogOverlay_SetVgaKey, CNova__UpdateColorKey/*****************************************************************************/QRESULT CNE2000__OverlaySetVgaKey(IDecoderBoard* pIDecoderBoard, PMPEG_OVERLAY_KEY pKey){ CQuasarBoard *this = (CQuasarBoard*) pIDecoderBoard; if(this->m_pINova1 == NULL) return E_NOT_SUPPORTED; IAnalogOverlay_SetVgaKey(this->m_pINova1, pKey); return Q_OK;}/****f* HwLib/IDecoderBoard_OverlayGetVgaKey * USAGE * QRESULT IDecoderBoard_OverlayGetVgaKey(IDecoderBoard* pIDecoderBoard, PMPEG_OVERLAY_KEY pKey) * QRESULT CNE2000__OverlayGetVgaKey(IDecoderBoard* pIDecoderBoard, PMPEG_OVERLAY_KEY pKey) * DESCRIPTION * IDecoderBoard_OverlayGetVgaKey - used to get the VGA color that will become transparent for Mpeg. * PARAMETERS * IN IDecoderBoard* pIDecoderBoard - pointer to the board object * OUT PMPEG_OVERLAY_KEY pKey - rgbColor member receives VGA color transparent for Mpeg. * RETURN VALUE * Q_OK, E_NOT_SUPPORTED if Analog overlay is not present * SEE ALSO * IDecoderBoard_OverlaySetVgaKey, IAnalogOverlay_GetVgaKey/*****************************************************************************/QRESULT CNE2000__OverlayGetVgaKey(IDecoderBoard* pIDecoderBoard, PMPEG_OVERLAY_KEY pKey){ CQuasarBoard *this = (CQuasarBoard*) pIDecoderBoard; if(this->m_pINova1 == NULL) return E_NOT_SUPPORTED; IAnalogOverlay_GetVgaKey(this->m_pINova1, pKey); return Q_OK;}/****f* HwLib/IDecoderBoard_OverlaySetVgaKey2 * USAGE * QRESULT IDecoderBoard_OverlaySetVgaKey2(IDecoderBoard* pIDecoderBoard, PMPEG_OVERLAY_KEY2 pKey2) * QRESULT CNE2000__OverlaySetVgaKey2(IDecoderBoard* pIDecoderBoard, PMPEG_OVERLAY_KEY2 pKey2) * DESCRIPTION * IDecoderBoard_OverlaySetVgaKey2 - used to set the VGA color that will become transparent for Mpeg. * PARAMETERS * IN IDecoderBoard* pIDecoderBoard - pointer to the board object * IN PMPEG_OVERLAY_KEY2 pKey2 - rgbColor member is the VGA color transparent for Mpeg. * If OVERLAY_COLOUR_REGISTERS* pOverride member is not NULL the values set in this structure * are used to program the AnalogOverlay hardware - for manual calibration of the colors) * If pOverride member is NULL IDecoderBoard_OverlaySetVgaKey2 is like IDecoderBoard_OverlaySetVgaKey * RETURN VALUE * Q_OK, E_NOT_SUPPORTED if Analog overlay is not present * SEE ALSO * IDecoderBoard_OverlayGetVgaKey2, IDecoderBoard_OverlaySetColorCalibration, * IAnalogOverlay_SetVgaKey2, CNova__UpdateColorKey/*****************************************************************************/QRESULT CNE2000__OverlaySetVgaKey2(IDecoderBoard* pIDecoderBoard, PMPEG_OVERLAY_KEY2 pKey2){ CQuasarBoard *this = (CQuasarBoard*) pIDecoderBoard; if(this->m_pINova1 == NULL) return E_NOT_SUPPORTED; IAnalogOverlay_SetVgaKey2(this->m_pINova1, pKey2); return Q_OK;}/****f* HwLib/IDecoderBoard_OverlayGetVgaKey2 * USAGE * QRESULT IDecoderBoard_OverlayGetVgaKey2(IDecoderBoard* pIDecoderBoard, PMPEG_OVERLAY_KEY2 pKey2) * QRESULT CNE2000__OverlayGetVgaKey2(IDecoderBoard* pIDecoderBoard, PMPEG_OVERLAY_KEY2 pKey2) * DESCRIPTION * IDecoderBoard_OverlayGetVgaKey2 - NOT IMPLEMENTED. * PARAMETERS * IN IDecoderBoard* pIDecoderBoard - pointer to the board object * OUT PMPEG_OVERLAY_KEY pKey - * RETURN VALUE * Q_OK/*****************************************************************************/QRESULT CNE2000__OverlayGetVgaKey2(IDecoderBoard* pIDecoderBoard, PMPEG_OVERLAY_KEY2 pKey2){ QDbgLog((QLOG_TRACE, QDebugLevelWarning, TEXT("OverlayGetVgaKey2 NOT IMPLEMENTED") )); return Q_OK;}/****f* HwLib/IDecoderBoard_OverlaySetMode * USAGE * QRESULT IDecoderBoard_OverlaySetMode(IDecoderBoard* pIDecoderBoard, MPEG_OVERLAY_MODE Mode) * QRESULT CNE2000__OverlaySetMode(IDecoderBoard* pIDecoderBoard, MPEG_OVERLAY_MODE Mode) * DESCRIPTION * IDecoderBoard_OverlaySetMode - used to set the VGA color that will become transparent for Mpeg.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -