#ifdef MODULE_NAME_IS_glwin32
#include "../opengl.h"
#endif
+#ifdef MODULE_NAME_IS_direct2d
+#include <d2d1.h>
+#endif
#include "common.h"
static void CommonChangeThumbnailClip(vout_display_t *, bool show);
static int CommonControlSetFullscreen(vout_display_t *, bool is_fullscreen);
+#if !defined(UNDER_CE) && !defined(MODULE_NAME_IS_glwin32)
static void DisableScreensaver(vout_display_t *);
static void RestoreScreensaver(vout_display_t *);
+#endif
/* */
int CommonInit(vout_display_t *vd)
/**
* It updates a picture data/pitches.
*/
-void CommonUpdatePicture(picture_t *picture,
- uint8_t *data, unsigned pitch)
+int CommonUpdatePicture(picture_t *picture, picture_t **fallback,
+ uint8_t *data, unsigned pitch)
{
+ if (fallback) {
+ if (*fallback == NULL) {
+ *fallback = picture_NewFromFormat(&picture->format);
+ if (*fallback == NULL)
+ return VLC_EGENERIC;
+ }
+ for (int n = 0; n < picture->i_planes; n++) {
+ const plane_t *src = &(*fallback)->p[n];
+ plane_t *dst = &picture->p[n];
+ dst->p_pixels = src->p_pixels;
+ dst->i_pitch = src->i_pitch;
+ dst->i_lines = src->i_lines;
+ }
+ return VLC_SUCCESS;
+ }
/* fill in buffer info in first plane */
picture->p->p_pixels = data;
picture->p->i_pitch = pitch;
picture->p[2].p_pixels = p_tmp;
}
}
+ return VLC_SUCCESS;
}
void AlignRect(RECT *r, int align_boundary, int align_size)
SWP_NOCOPYBITS|SWP_NOZORDER|SWP_ASYNCWINDOWPOS);
/* Destination image position and dimensions */
-#if defined(MODULE_NAME_IS_direct3d)
+#if defined(MODULE_NAME_IS_direct3d) || defined(MODULE_NAME_IS_direct2d)
rect_dest.left = 0;
rect_dest.right = place.width;
rect_dest.top = 0;
#endif
-#if defined(MODULE_NAME_IS_directx) || defined(MODULE_NAME_IS_direct3d)
+#if defined(MODULE_NAME_IS_directx) || defined(MODULE_NAME_IS_direct3d) || defined(MODULE_NAME_IS_direct2d)
/* UpdateOverlay directdraw function doesn't automatically clip to the
* display size so we need to do it otherwise it will fail
* It is also needed for d3d to avoid exceding our surface size */
/* Apply overlay hardware constraints */
if (sys->use_overlay)
AlignRect(&rect_src_clipped, sys->i_align_src_boundary, sys->i_align_src_size);
-#elif defined(MODULE_NAME_IS_direct3d)
+#elif defined(MODULE_NAME_IS_direct3d) || defined(MODULE_NAME_IS_direct2d)
/* Needed at least with YUV content */
rect_src_clipped.left &= ~1;
rect_src_clipped.right &= ~1;
}
}
-#ifndef UNDER_CE
+#if !defined(UNDER_CE) && !defined(MODULE_NAME_IS_glwin32)
static void DisableScreensaver(vout_display_t *vd)
{
vout_display_sys_t *sys = vd->sys;