VideoRendererOverlay.h
上传用户:tuheem
上传日期:2007-05-01
资源大小:21889k
文件大小:2k
- /**************************************************************************************
- * *
- * *
- **************************************************************************************/
- #ifndef VIDEORENDERER_OVERLAY_H
- #define VIDEORENDERER_OVERLAY_H
- /*
- * 基类
- */
- #include "MediaClasses.h"
- #include "Resizer.h"
- /*
- * 包括直接显示
- *
- */
- #include <ddraw.h>
- /*
- * 叠加目标色度键
- */
- //像素深度是用位/像素(bpp)决定
- #define DD_OVERLAY_COLORKEY_16BPP 0x00000001
- #define DD_OVERLAY_COLORKEY_32BPP 0x0000000F
- #define DD_OVERLAY_COLORREF 0x000F0000
- #define DD_OVERLAY_COLORKEY_FULLSCREEN 0x00000001
- #define DD_OVERLAY_COLORREF_FULLSCREEN 0x000F0000
- /*
- * 叠加视频补偿器类
- */
- class MediaVideoRendererOverlay : public MediaItemVideoRenderer {
- private:
- MediaItemSubtitler *subtitler;
- MediaBuffer *lastPicture;
- DWORD invertFlag;
- LPDIRECTDRAW7 lpdd;
- LPDIRECTDRAWSURFACE7 lpddsPrimary;
- LPDIRECTDRAWCLIPPER lpddClipper;
- LPDIRECTDRAWSURFACE7 lpddsOverlay;
- unsigned int width;
- unsigned int height;
- media_video_mode_t videoMode;
- unsigned int fullscreenWidth;
- unsigned int fullscreenHeight;
- DWORD bpp;
- DWORD physicalDepth;
- RECT fullRects[3];
- HWND hwndPlayback;
- public:
- MediaVideoRendererOverlay();
- ~MediaVideoRendererOverlay();
- /*
- * 媒体项方法
- */
- media_type_t GetType();
- char *GetName();
- MP_RESULT Connect(MediaItem *item);
- MP_RESULT ReleaseConnections();
- DWORD GetCaps();
- MP_RESULT Configure(HINSTANCE hInstance, HWND hwnd);
- /*
- * 专用的叠加探测方法
- *
- */
- BOOL AreOverlaysSupported();
- /*
- * 视频补偿方法
- */
- MP_RESULT Init(HWND hwnd, unsigned int width, unsigned int height);
- MP_RESULT InitFullscreen(HWND hwnd, unsigned int width, unsigned int height);
- media_video_mode_t GetVideoMode();
- MP_RESULT Stop();
- RECT *GetFullscreenRects();
- MP_RESULT Draw(MediaBuffer *buffer, RECT *rect, int frameNumber, int invertFlag);
- MP_RESULT DrawFullscreen(MediaBuffer *buffer, int frameNumber, int invertFlag, int desktopMode);
- MP_RESULT Close();
- };
- #endif