Browse Source

screen/dxgi: use WINAPI_FAMILY to check cursor availability

pull/162/head
Steve Lhomme 3 years ago
parent
commit
5efb048582
  1. 12
      modules/access/screen/dxgi.cpp
  2. 2
      modules/access/screen/screen.h

12
modules/access/screen/dxgi.cpp

@ -99,7 +99,7 @@ static block_t *screen_Capture(demux_t *p_demux)
goto error; goto error;
} }
#if defined(SCREEN_SUBSCREEN) && !defined(VLC_WINSTORE_APP) #if defined(SCREEN_SUBSCREEN) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
if( p_sys->b_follow_mouse ) if( p_sys->b_follow_mouse )
{ {
POINT pos; POINT pos;
@ -108,7 +108,7 @@ static block_t *screen_Capture(demux_t *p_demux)
pos.y -= p_data->screen_y; pos.y -= p_data->screen_y;
FollowMouse( p_sys, pos.x, pos.y ); FollowMouse( p_sys, pos.x, pos.y );
} }
#endif // SCREEN_SUBSCREEN && !VLC_WINSTORE_APP #endif // SCREEN_SUBSCREEN && WINAPI_PARTITION_DESKTOP
/* copy the texture into the block texture */ /* copy the texture into the block texture */
hr = resource.As(&d3d11res); hr = resource.As(&d3d11res);
@ -177,19 +177,19 @@ int screen_InitCaptureDXGI(demux_t *p_demux)
return VLC_ENOTSUP; return VLC_ENOTSUP;
} }
#ifdef VLC_WINSTORE_APP #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
if (p_sys->b_follow_mouse) if (p_sys->b_follow_mouse)
{ {
msg_Dbg(p_demux, "screen-follow-mouse not supported in UWP DXGI"); msg_Dbg(p_demux, "screen-follow-mouse not supported in UWP DXGI");
return VLC_ENOTSUP; return VLC_ENOTSUP;
} }
#endif // VLC_WINSTORE_APP #endif // !WINAPI_PARTITION_DESKTOP
p_data = new (std::nothrow) screen_data_t(); p_data = new (std::nothrow) screen_data_t();
if (unlikely(p_data == nullptr)) if (unlikely(p_data == nullptr))
return VLC_ENOMEM; return VLC_ENOMEM;
#ifndef VLC_WINSTORE_APP #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
p_data->screen_x = GetSystemMetrics( SM_XVIRTUALSCREEN ); p_data->screen_x = GetSystemMetrics( SM_XVIRTUALSCREEN );
p_data->screen_y = GetSystemMetrics( SM_YVIRTUALSCREEN ); p_data->screen_y = GetSystemMetrics( SM_YVIRTUALSCREEN );
#endif #endif
@ -290,7 +290,7 @@ int screen_InitCapture(demux_t *p_demux)
int ret = screen_InitCaptureDXGI(p_demux); int ret = screen_InitCaptureDXGI(p_demux);
if (ret == VLC_SUCCESS) if (ret == VLC_SUCCESS)
return VLC_SUCCESS; return VLC_SUCCESS;
#if defined(_WIN32) && !defined(VLC_WINSTORE_APP) #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
return screen_InitCaptureGDI(p_demux); return screen_InitCaptureGDI(p_demux);
#else #else
return ret; return ret;

2
modules/access/screen/screen.h

@ -74,7 +74,7 @@ typedef struct
} demux_sys_t; } demux_sys_t;
int screen_InitCapture ( demux_t * ); int screen_InitCapture ( demux_t * );
#if defined(_WIN32) && !defined(VLC_WINSTORE_APP) #if defined(_WIN32)
int screen_InitCaptureGDI ( demux_t * ); int screen_InitCaptureGDI ( demux_t * );
#endif #endif

Loading…
Cancel
Save