00001 #ifndef VIDEOOUT_DX_H_
00002 #define VIDEOOUT_DX_H_
00003
00004
00005
00006
00007
00008 #include <windows.h>
00009 #include <ddraw.h>
00010
00011
00012 #ifdef CONFIG_CYGWIN
00013 #undef max
00014 #endif
00015 #include "videooutbase.h"
00016
00017 class VideoOutputDX : public VideoOutput
00018 {
00019 public:
00020 VideoOutputDX();
00021 ~VideoOutputDX();
00022
00023 bool Init(int width, int height, float aspect, WId winid,
00024 int winx, int winy, int winw, int winh, WId embedid = 0);
00025 void PrepareFrame(VideoFrame *buffer, FrameScanType);
00026 void Show(FrameScanType );
00027
00028 bool InputChanged(const QSize &input_size,
00029 float aspect,
00030 MythCodecID av_codec_id,
00031 void *codec_private);
00032 void Zoom(ZoomDirection direction);
00033
00034 void EmbedInWidget(WId wid, int x, int y, int w, int h);
00035 void StopEmbedding(void);
00036
00037 int GetRefreshRate(void);
00038
00039 void DrawUnusedRects(bool sync = true);
00040
00041 void UpdatePauseFrame(void);
00042 void ProcessFrame(VideoFrame *frame, OSD *osd,
00043 FilterChain *filterList,
00044 NuppelVideoPlayer *pipPlayer);
00045
00046 void MoveResize(void);
00047 int SetPictureAttribute(PictureAttribute attribute, int newValue);
00048
00049 float GetDisplayAspect(void) const;
00050
00051 void WaitForVSync(void);
00052
00053 static QStringList GetAllowedRenderers(MythCodecID myth_codec_id,
00054 const QSize &video_dim);
00055
00056 private:
00057 void Exit(void);
00058
00059 bool XJ_started;
00060
00061 VideoFrame pauseFrame;
00062
00063 HWND wnd;
00064
00065 LPDIRECTDRAW2 ddobject;
00066 LPDIRECTDRAWSURFACE2 display;
00067
00068 LPDIRECTDRAWCLIPPER clipper;
00069 LPDIRECTDRAWCOLORCONTROL ccontrol;
00070 HINSTANCE ddraw_dll;
00071
00072
00073 HMONITOR monitor;
00074 GUID *display_driver;
00075 HMONITOR (WINAPI* MonitorFromWindow)(HWND, DWORD);
00076 BOOL (WINAPI* GetMonitorInfo)(HMONITOR, LPMONITORINFO);
00077
00078 RECT rect_display;
00079
00080 LPDIRECTDRAWSURFACE2 front_surface;
00081 LPDIRECTDRAWSURFACE2 back_surface;
00082
00083 DWORD chroma;
00084
00085 int XJ_width, XJ_height;
00086
00087 int colorkey;
00088 int rgb_colorkey;
00089
00090 bool using_overlay;
00091 bool overlay_3buf;
00092
00093 bool use_sysmem;
00094
00095 int outputpictures;
00096
00097 void MakeSurface();
00098
00099 int DirectXInitDDraw();
00100 int DirectXCreateDisplay();
00101 int DirectXCreateClipper();
00102 int DirectXCreateSurface(LPDIRECTDRAWSURFACE2 *pp_surface_final,
00103 DWORD i_chroma, bool b_overlay, int i_backbuffers);
00104 void DirectXCloseDDraw();
00105 void DirectXCloseDisplay();
00106 void DirectXCloseSurface();
00107 void DirectXGetDDrawCaps();
00108 DWORD DirectXFindColorkey(uint32_t i_color);
00109 int DirectXUpdateOverlay();
00110 int DirectXLockSurface(void **picbuf, int *stride);
00111 int DirectXUnlockSurface();
00112
00113 int NewPicture();
00114 };
00115
00116 #endif