⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 videorendereroverlay.h

📁 ZPAV (H265) PC(X86) demo ZPAV (H265) 是 音视频 压缩解压 协议
💻 H
字号:

/*
///////////////////////////////////////////////////////////////////////////////
//                                                                           //
//   Copyright (C) 2006-2008  Beijing,  pengzhen (pengzhenxp@yahoo.com.cn)   //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////
*/

#ifndef __VIDEORENDERER_OVERLAY_H__
#define __VIDEORENDERER_OVERLAY_H__

/*
 * DirectDraw includes
 *
 */

#ifdef __WINCE__
#include <ddraw.h>
#define LPDIRECTDRAW_PTR        LPDIRECTDRAW4
#define LPDIRECTDRAWSURFACE_PTR LPDIRECTDRAWSURFACE4
#define IID_IDirectDraw_IID     IID_IDirectDraw4
#else //!__WINCE__
#include "ddraw.h"
#define LPDIRECTDRAW_PTR        LPDIRECTDRAW7
#define LPDIRECTDRAWSURFACE_PTR LPDIRECTDRAWSURFACE7
#define IID_IDirectDraw_IID     IID_IDirectDraw7
#endif //__WINCE__


/*
 * Overlay VideoRenderer Class
 */

class MediaVideoRendererOverlay 

{

public:

	MediaVideoRendererOverlay();
	~MediaVideoRendererOverlay();

private:

	LPDIRECTDRAW_PTR        m_pdd;
	LPDIRECTDRAWSURFACE_PTR m_pddsPrimary;
	LPDIRECTDRAWSURFACE_PTR m_pddsOverlay;
	LPDIRECTDRAWCLIPPER     m_pddClipper;

	DDOVERLAYFX m_ovfx;
	DWORD       m_dwUpdateFlags; 

public :

	RECT m_rsRect;
	RECT m_rdRect;
 
	RECT m_rsRect_op;
	RECT m_rdRect_op;

	int m_rdWid ;
	int m_rdHei ;
	
	HWND m_hWnd;
	int  m_width;
	int  m_pitch;
	int  m_height;

	void* m_pSurfacePhyAddress ;
	void* m_pSurfaceAddress ;

public :

	static int m_bIsOverlayFlag  ;
	static int m_bIsOverlayRGBFlag  ;
	static int m_iColorFormat  ;
	static int m_iRGBBitCount  ;

	int m_iCurCardOverlayNo  ;
    int m_iCurCardOverlayNo_Bak  ;

	int m_iCurCardFullFlag   ;

#define MAX_CARD_NUM 33 
    static RECT m_rsRect_bak[MAX_CARD_NUM] ;
#ifdef __INSERT_FONT__
	static POINT m_pFontPos[MAX_CARD_NUM];
	static BOOL m_pFontView[MAX_CARD_NUM]; 
#endif //__INSERT_FONT__


public :
	
	static int m_iTotalCard  ; 
	static int m_iCardNo_CX , m_iCardNo_CY ;

	int m_vidWidth   , m_vidHeight  ;
	int m_vidWidth1   , m_vidWidth2 ; 


    void get_card_size( int iTotalCard )  ;

	int get_cur_card_phy_adr_wid() ;

	int get_cur_card_adr_off( int iCurrentCard ) ;
    int get_cur_card_phy_adr( int iCurrentCard ) ;
	int get_cur_card_adr( int iCurrentCard ) ;

	void Get_Video_CaptureSize() ;

	int ddraw_init( int iTotalCard , int nvidWidth,  int nvidHeight ) ;
	int ddraw_init( int iTotalCard ) ;
	void ddraw_exit() ;

public :

	static int m_iScroll_CX , m_iScroll_CY , m_iScrollPageNo , m_iScrollPageNo_Bak ;
	
	SIZE GetCardScales( );

	void SetScroll( int iWhichScroll );
	void ScrollPage( );

private :

	BOOL CreatePdd( ) ;
	BOOL CreatePrimary( ) ;
	BOOL CreateOverlay(int width, int height) ;

	void ConvertGDIColor( COLORREF dwGDIColor );

	BOOL GetRGBFormat() ;

	BOOL GetSurfaceAddress( BOOL iSurfacePhyAddress = TRUE );

	void DrawEmpty() ;
	void DrawFree() ;

	BOOL DrawInit(int width, int height) ;

	void GetDrawRect( )  ;

#ifdef __INSERT_FONT__
	void InvalidateFont();
	void SetFontPos( )  ;
	void GetFontPos( )  ;
#endif //__INSERT_FONT__

public :

	void Get_rdRect_op() ;

	BOOL SetDrawRect(HWND hwnd , int wHWCardNo );

	WORD GetCurCardNo( POINT lpPos )  ;

	WORD SetCurCardFullWin( POINT lpPos )  ;
	WORD SetCurCardFullWin1( int wHWCardNo )  ;

	void GetData( BYTE *dst, BYTE *src ) ;

	void Draw();
	void Draw(int iCurCardNo ) ;
	void Draw(int iCurCardNo , BYTE *dst, BYTE *src ) ;

	void Draw(BYTE* lpTextContext, int iTexWidth, int iTexHeight ) ;
	void Draw(BYTE *src, BYTE* lpTextContext, int iTexWidth, int iTexHeight ) ;

	void Draw(int iCurCardNo, BYTE** lpDPhyAdr) ;

#ifdef __INSERT_FONT__
	void DrawText( int iCardNo , TCHAR* lpText , COLORREF dwTextColor=0x0000ffff ) ;
#endif //__INSERT_FONT__


#ifdef MPEG4D_API
public :
	void Draw(int iCurCardNo, dvp_ctx* lpVideoDec , pack_yuv420_function convert_yuv) ;
#endif //MPEG4D_API


#ifdef __YUV__

#if defined(BT848_API) || defined(MPEG4D_API) 
#define dvp_pack_yuv422  dvp_pack_yuyv
#endif 

#if defined(SAA7130_API) || defined(TM1300_API) 
#define dvp_pack_yuv422  dvp_pack_uyvy
#endif 

	static pack_yuv422_function m_pack_yuv422 ; 

#endif /* __YUV__ */


};


#endif //__VIDEORENDERER_OVERLAY_H__

⌨️ 快捷键说明

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