]> git.sesse.net Git - vlc/blobdiff - modules/video_output/msw/common.h
Use var_InheritString for --decklink-video-connection.
[vlc] / modules / video_output / msw / common.h
index b5bbe07c4baeec5ead82d3cdd97535f532aa69b5..3a67c7d11759edcde7492927aa29dc727216cabd 100644 (file)
@@ -80,12 +80,6 @@ struct vout_display_sys_t
     HWND                 hparent;             /* Handle of the parent window */
     HWND                 hfswnd;          /* Handle of the fullscreen window */
 
-    /* Multi-monitor support */
-    HMONITOR             hmonitor;          /* handle of the current monitor */
-    GUID                 *p_display_driver;
-    HMONITOR             (WINAPI* MonitorFromWindow)(HWND, DWORD);
-    BOOL                 (WINAPI* GetMonitorInfo)(HMONITOR, LPMONITORINFO);
-
     /* size of the display */
     RECT         rect_display;
     int          display_depth;
@@ -114,45 +108,64 @@ struct vout_display_sys_t
     RECT         rect_dest;
     RECT         rect_dest_clipped;
 
-    bool   allow_hw_yuv;    /* Should we use hardware YUV->RGB conversions */
-
+    picture_pool_t *pool;
 
 #ifdef MODULE_NAME_IS_directx
+    /* Multi-monitor support */
+    HMONITOR             hmonitor;          /* handle of the current monitor */
+    GUID                 *display_driver;
+    HMONITOR             (WINAPI* MonitorFromWindow)(HWND, DWORD);
+    BOOL                 (WINAPI* GetMonitorInfo)(HMONITOR, LPMONITORINFO);
+
     /* Overlay alignment restrictions */
     int          i_align_src_boundary;
     int          i_align_src_size;
     int          i_align_dest_boundary;
     int          i_align_dest_size;
 
-    bool      b_wallpaper;    /* show as desktop wallpaper ? */
+    bool   use_wallpaper;   /* show as desktop wallpaper ? */
 
-    bool   b_using_overlay;         /* Are we using an overlay surface */
-    bool   b_use_sysmem;   /* Should we use system memory for surfaces */
-    bool   b_3buf_overlay;   /* Should we use triple buffered overlays */
+    bool   use_overlay;     /* Are we using an overlay surface */
+    bool   restore_overlay;
 
     /* DDraw capabilities */
-    int          b_caps_overlay_clipping;
+    bool            can_blit_fourcc;
 
-    unsigned int    i_rgb_colorkey;      /* colorkey in RGB used by the overlay */
-    unsigned int    i_colorkey;                 /* colorkey used by the overlay */
+    uint32_t        i_rgb_colorkey;      /* colorkey in RGB used by the overlay */
+    uint32_t        i_colorkey;                 /* colorkey used by the overlay */
 
     COLORREF        color_bkg;
     COLORREF        color_bkgtxt;
 
-    LPDIRECTDRAW2        p_ddobject;                    /* DirectDraw object */
-    LPDIRECTDRAWSURFACE2 p_display;                        /* Display device */
-    LPDIRECTDRAWSURFACE2 p_current_surface;   /* surface currently displayed */
-    LPDIRECTDRAWCLIPPER  p_clipper;             /* clipper used for blitting */
+    LPDIRECTDRAW2        ddobject;                    /* DirectDraw object */
+    LPDIRECTDRAWSURFACE2 display;                        /* Display device */
+    LPDIRECTDRAWCLIPPER  clipper;             /* clipper used for blitting */
     HINSTANCE            hddraw_dll;       /* handle of the opened ddraw dll */
+
+    picture_resource_t   resource;
+
+    /* It protects the following variables */
     vlc_mutex_t    lock;
+    bool           ch_wallpaper;
+    bool           wallpaper_requested;
 #endif
 
 #ifdef MODULE_NAME_IS_glwin32
-    HDC hGLDC;
-    HGLRC hGLRC;
+    HDC                   hGLDC;
+    HGLRC                 hGLRC;
+    vout_opengl_t         gl;
+    vout_display_opengl_t vgl;
+#endif
+
+#ifdef MODULE_NAME_IS_direct2d
+    HINSTANCE              d2_dll;            /* handle of the opened d2d1 dll */
+    ID2D1Factory           *d2_factory;                         /* D2D factory */
+    ID2D1HwndRenderTarget  *d2_render_target;          /* D2D rendering target */
+    ID2D1Bitmap            *d2_bitmap;                            /* D2 bitmap */
 #endif
 
 #ifdef MODULE_NAME_IS_direct3d
+    bool allow_hw_yuv;    /* Should we use hardware YUV->RGB conversions */
     /* show video on desktop window ? */
     bool use_desktop;
     struct {
@@ -172,7 +185,6 @@ struct vout_display_sys_t
     LPDIRECT3DVERTEXBUFFER9 d3dvtc;
 
     picture_resource_t      resource;
-    picture_pool_t          *pool;
 
     /* */
     bool                    reset_device;
@@ -184,39 +196,22 @@ struct vout_display_sys_t
     bool           desktop_requested;
 #endif
 
-#ifdef MODULE_NAME_IS_wingdi
-
+#if defined(MODULE_NAME_IS_wingdi) || defined(MODULE_NAME_IS_wingapi)
     int  i_depth;
 
     /* Our offscreen bitmap and its framebuffer */
     HDC        off_dc;
     HBITMAP    off_bitmap;
-    uint8_t *  p_pic_buffer;
-    int        i_pic_pitch;
-    int        i_pic_pixel_pitch;
-
-    BITMAPINFO bitmapinfo;
-    RGBQUAD    red;
-    RGBQUAD    green;
-    RGBQUAD    blue;
-#endif
 
-#ifdef MODULE_NAME_IS_wingapi
-    int        i_depth;
-    int        render_width;
-    int        render_height;
-           /* Our offscreen bitmap and its framebuffer */
-    HDC        off_dc;
-    HBITMAP    off_bitmap;
-    uint8_t *  p_pic_buffer;
-    int        i_pic_pitch;
-    int        i_pic_pixel_pitch;
-
-    BITMAPINFO bitmapinfo;
-    RGBQUAD    red;
-    RGBQUAD    green;
-    RGBQUAD    blue;
+    struct
+    {
+        BITMAPINFO bitmapinfo;
+        RGBQUAD    red;
+        RGBQUAD    green;
+        RGBQUAD    blue;
+    };
 
+#   ifdef MODULE_NAME_IS_wingapi
     HINSTANCE  gapi_dll;                   /* handle of the opened gapi dll */
 
     /* GAPI functions */
@@ -227,24 +222,20 @@ struct vout_display_sys_t
     GXDisplayProperties (*GXGetDisplayProperties)();
     int (*GXSuspend)();
     int (*GXResume)();
+#   endif
 #endif
 };
 
 #ifdef MODULE_NAME_IS_wingapi
-#   define GXOpenDisplay p_vout->p_sys->GXOpenDisplay
-#   define GXCloseDisplay p_vout->p_sys->GXCloseDisplay
-#   define GXBeginDraw p_vout->p_sys->GXBeginDraw
-#   define GXEndDraw p_vout->p_sys->GXEndDraw
-#   define GXGetDisplayProperties p_vout->p_sys->GXGetDisplayProperties
-#   define GXSuspend p_vout->p_sys->GXSuspend
-#   define GXResume p_vout->p_sys->GXResume
+#   define GXOpenDisplay          vd->sys->GXOpenDisplay
+#   define GXCloseDisplay         vd->sys->GXCloseDisplay
+#   define GXBeginDraw            vd->sys->GXBeginDraw
+#   define GXEndDraw              vd->sys->GXEndDraw
+#   define GXGetDisplayProperties vd->sys->GXGetDisplayProperties
+#   define GXSuspend              vd->sys->GXSuspend
+#   define GXResume               vd->sys->GXResume
 #endif
 
-/*****************************************************************************
- * Prototypes from directx.c
- *****************************************************************************/
-int DirectDrawUpdateOverlay(vout_display_t *);
-
 /*****************************************************************************
  * Prototypes from common.c
  *****************************************************************************/
@@ -253,11 +244,13 @@ void CommonClean(vout_display_t *);
 void CommonManage(vout_display_t *);
 int  CommonControl(vout_display_t *, int , va_list );
 void CommonDisplay(vout_display_t *);
+int  CommonUpdatePicture(picture_t *, picture_t **, uint8_t *, unsigned);
 
 void UpdateRects (vout_display_t *,
                   const vout_display_cfg_t *,
                   const video_format_t *,
                   bool is_forced);
+void AlignRect(RECT *, int align_boundary, int align_size);
 
 /*****************************************************************************
  * Constants
@@ -272,7 +265,7 @@ void UpdateRects (vout_display_t *,
  *****************************************************************************/
 #ifdef UNDER_CE
 
-#define AdjustWindowRect(a,b,c)
+#define AdjustWindowRect(a,b,c) AdjustWindowRectEx(a,b,c,0)
 
 #ifndef GCL_HBRBACKGROUND
 #   define GCL_HBRBACKGROUND (-10)