Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
a8eb61e4
Commit
a8eb61e4
authored
Sep 09, 2008
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement mouse pointer support in win32 screen.
Also fix mouse pointer position when capture a subscreen in x11.
parent
13c381a0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
83 additions
and
55 deletions
+83
-55
NEWS
NEWS
+1
-1
modules/access/screen/screen.c
modules/access/screen/screen.c
+61
-0
modules/access/screen/screen.h
modules/access/screen/screen.h
+3
-3
modules/access/screen/win32.c
modules/access/screen/win32.c
+13
-1
modules/access/screen/x11.c
modules/access/screen/x11.c
+5
-50
No files found.
NEWS
View file @
a8eb61e4
...
@@ -2,7 +2,7 @@ Changes between 0.9.1 and 1.0.0-git:
...
@@ -2,7 +2,7 @@ Changes between 0.9.1 and 1.0.0-git:
------------------------------------
------------------------------------
Inputs:
Inputs:
* Mouse cursor support in x11
screen module
* Mouse cursor support in x11
and win32 screen modules
* Screen module now supports partial screen capture and mouse following on
* Screen module now supports partial screen capture and mouse following on
windows.
windows.
...
...
modules/access/screen/screen.c
View file @
a8eb61e4
...
@@ -192,7 +192,9 @@ static int Open( vlc_object_t *p_this )
...
@@ -192,7 +192,9 @@ static int Open( vlc_object_t *p_this )
{
{
p_sys
->
i_screen_width
=
p_sys
->
fmt
.
video
.
i_width
;
p_sys
->
i_screen_width
=
p_sys
->
fmt
.
video
.
i_width
;
p_sys
->
i_screen_height
=
p_sys
->
fmt
.
video
.
i_height
;
p_sys
->
i_screen_height
=
p_sys
->
fmt
.
video
.
i_height
;
p_sys
->
fmt
.
video
.
i_visible_width
=
p_sys
->
fmt
.
video
.
i_width
=
p_sys
->
i_width
;
p_sys
->
fmt
.
video
.
i_width
=
p_sys
->
i_width
;
p_sys
->
fmt
.
video
.
i_visible_height
=
p_sys
->
fmt
.
video
.
i_height
=
p_sys
->
i_height
;
p_sys
->
fmt
.
video
.
i_height
=
p_sys
->
i_height
;
p_sys
->
b_follow_mouse
=
var_CreateGetInteger
(
p_demux
,
p_sys
->
b_follow_mouse
=
var_CreateGetInteger
(
p_demux
,
"screen-follow-mouse"
);
"screen-follow-mouse"
);
...
@@ -324,3 +326,62 @@ void FollowMouse( demux_sys_t *p_sys, int i_x, int i_y )
...
@@ -324,3 +326,62 @@ void FollowMouse( demux_sys_t *p_sys, int i_x, int i_y )
p_sys
->
i_screen_height
-
p_sys
->
i_height
);
p_sys
->
i_screen_height
-
p_sys
->
i_height
);
}
}
#endif
#endif
#ifdef SCREEN_MOUSE
void
RenderCursor
(
demux_t
*
p_demux
,
int
i_x
,
int
i_y
,
uint8_t
*
p_dst
)
{
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
if
(
!
p_sys
->
dst
.
i_planes
)
vout_InitPicture
(
p_demux
,
&
p_sys
->
dst
,
p_sys
->
fmt
.
video
.
i_chroma
,
p_sys
->
fmt
.
video
.
i_width
,
p_sys
->
fmt
.
video
.
i_height
,
p_sys
->
fmt
.
video
.
i_aspect
);
if
(
!
p_sys
->
p_blend
)
{
p_sys
->
p_blend
=
vlc_object_create
(
p_demux
,
sizeof
(
filter_t
)
);
if
(
!
p_sys
->
p_blend
)
msg_Err
(
p_demux
,
"Could not allocate memory for blending module"
);
else
{
es_format_Init
(
&
p_sys
->
p_blend
->
fmt_in
,
VIDEO_ES
,
VLC_FOURCC
(
'R'
,
'G'
,
'B'
,
'A'
)
);
p_sys
->
p_blend
->
fmt_in
.
video
=
p_sys
->
p_mouse
->
format
;
p_sys
->
p_blend
->
fmt_out
=
p_sys
->
fmt
;
p_sys
->
p_blend
->
p_module
=
module_Need
(
p_sys
->
p_blend
,
"video blending"
,
0
,
0
);
if
(
!
p_sys
->
p_blend
->
p_module
)
{
msg_Err
(
p_demux
,
"Could not load video blending module"
);
vlc_object_detach
(
p_sys
->
p_blend
);
vlc_object_release
(
p_sys
->
p_blend
);
p_sys
->
p_blend
=
NULL
;
}
}
}
if
(
p_sys
->
p_blend
)
{
p_sys
->
dst
.
p
->
p_pixels
=
p_dst
;
p_sys
->
p_blend
->
pf_video_blend
(
p_sys
->
p_blend
,
&
p_sys
->
dst
,
p_sys
->
p_mouse
,
#ifdef SCREEN_SUBSCREEN
i_x
-
p_sys
->
i_left
,
#else
i_x
,
#endif
#ifdef SCREEN_SUBSCREEN
i_y
-
p_sys
->
i_top
,
#else
i_y
,
#endif
255
);
}
else
{
picture_Release
(
p_sys
->
p_mouse
);
p_sys
->
p_mouse
=
NULL
;
}
}
#endif
modules/access/screen/screen.h
View file @
a8eb61e4
...
@@ -28,9 +28,6 @@
...
@@ -28,9 +28,6 @@
#if !defined( HAVE_BEOS ) && !defined( HAVE_DARWIN )
#if !defined( HAVE_BEOS ) && !defined( HAVE_DARWIN )
# define SCREEN_SUBSCREEN
# define SCREEN_SUBSCREEN
#endif
#if !defined( HAVE_WIN32 ) && !defined( HAVE_BEOS ) && !defined( HAVE_DARWIN )
# define SCREEN_MOUSE
# define SCREEN_MOUSE
#endif
#endif
...
@@ -76,3 +73,6 @@ block_t *screen_Capture( demux_t * );
...
@@ -76,3 +73,6 @@ block_t *screen_Capture( demux_t * );
#ifdef SCREEN_SUBSCREEN
#ifdef SCREEN_SUBSCREEN
void
FollowMouse
(
demux_sys_t
*
,
int
,
int
);
void
FollowMouse
(
demux_sys_t
*
,
int
,
int
);
#endif
#endif
#ifdef SCREEN_MOUSE
void
RenderCursor
(
demux_t
*
,
int
,
int
,
uint8_t
*
);
#endif
modules/access/screen/win32.c
View file @
a8eb61e4
/*****************************************************************************
/*****************************************************************************
* win32.c: Screen capture module.
* win32.c: Screen capture module.
*****************************************************************************
*****************************************************************************
* Copyright (C) 2004 the VideoLAN team
* Copyright (C) 2004
-2008
the VideoLAN team
* $Id$
* $Id$
*
*
* Authors: Gildas Bazin <gbazin@videolan.org>
* Authors: Gildas Bazin <gbazin@videolan.org>
...
@@ -97,9 +97,12 @@ int screen_InitCapture( demux_t *p_demux )
...
@@ -97,9 +97,12 @@ int screen_InitCapture( demux_t *p_demux )
}
}
es_format_Init
(
&
p_sys
->
fmt
,
VIDEO_ES
,
i_chroma
);
es_format_Init
(
&
p_sys
->
fmt
,
VIDEO_ES
,
i_chroma
);
p_sys
->
fmt
.
video
.
i_visible_width
=
p_sys
->
fmt
.
video
.
i_width
=
GetDeviceCaps
(
p_data
->
hdc_src
,
HORZRES
);
p_sys
->
fmt
.
video
.
i_width
=
GetDeviceCaps
(
p_data
->
hdc_src
,
HORZRES
);
p_sys
->
fmt
.
video
.
i_visible_height
=
p_sys
->
fmt
.
video
.
i_height
=
GetDeviceCaps
(
p_data
->
hdc_src
,
VERTRES
);
p_sys
->
fmt
.
video
.
i_height
=
GetDeviceCaps
(
p_data
->
hdc_src
,
VERTRES
);
p_sys
->
fmt
.
video
.
i_bits_per_pixel
=
i_bits_per_pixel
;
p_sys
->
fmt
.
video
.
i_bits_per_pixel
=
i_bits_per_pixel
;
p_sys
->
fmt
.
video
.
i_chroma
=
i_chroma
;
switch
(
i_chroma
)
switch
(
i_chroma
)
{
{
...
@@ -275,6 +278,15 @@ block_t *screen_Capture( demux_t *p_demux )
...
@@ -275,6 +278,15 @@ block_t *screen_Capture( demux_t *p_demux )
block_t
*
p_block
=
p_data
->
p_block
;
block_t
*
p_block
=
p_data
->
p_block
;
p_data
->
i_fragment
=
0
;
p_data
->
i_fragment
=
0
;
p_data
->
p_block
=
0
;
p_data
->
p_block
=
0
;
if
(
p_sys
->
p_mouse
)
{
POINT
pos
;
GetCursorPos
(
&
pos
);
RenderCursor
(
p_demux
,
pos
.
x
,
pos
.
y
,
p_block
->
p_buffer
);
}
return
p_block
;
return
p_block
;
}
}
...
...
modules/access/screen/x11.c
View file @
a8eb61e4
...
@@ -160,56 +160,11 @@ block_t *screen_Capture( demux_t *p_demux )
...
@@ -160,56 +160,11 @@ block_t *screen_Capture( demux_t *p_demux )
return
0
;
return
0
;
}
}
if
(
!
p_sys
->
p_mouse
)
vlc_memcpy
(
p_block
->
p_buffer
,
image
->
data
,
i_size
);
vlc_memcpy
(
p_block
->
p_buffer
,
image
->
data
,
i_size
);
else
if
(
p_sys
->
p_mouse
)
{
RenderCursor
(
p_demux
,
root_x
,
root_y
,
if
(
!
p_sys
->
dst
.
i_planes
)
p_block
->
p_buffer
);
vout_InitPicture
(
p_demux
,
&
p_sys
->
dst
,
p_sys
->
fmt
.
video
.
i_chroma
,
p_sys
->
fmt
.
video
.
i_width
,
p_sys
->
fmt
.
video
.
i_height
,
p_sys
->
fmt
.
video
.
i_aspect
);
if
(
!
p_sys
->
p_blend
)
{
p_sys
->
p_blend
=
vlc_object_create
(
p_demux
,
sizeof
(
filter_t
)
);
if
(
!
p_sys
->
p_blend
)
msg_Err
(
p_demux
,
"Could not allocate memory for blending module"
);
else
{
es_format_Init
(
&
p_sys
->
p_blend
->
fmt_in
,
VIDEO_ES
,
VLC_FOURCC
(
'R'
,
'G'
,
'B'
,
'A'
)
);
p_sys
->
p_blend
->
fmt_in
.
video
=
p_sys
->
p_mouse
->
format
;
p_sys
->
p_blend
->
fmt_out
=
p_sys
->
fmt
;
p_sys
->
p_blend
->
p_module
=
module_Need
(
p_sys
->
p_blend
,
"video blending"
,
0
,
0
);
if
(
!
p_sys
->
p_blend
->
p_module
)
{
msg_Err
(
p_demux
,
"Could not load video blending module"
);
vlc_object_detach
(
p_sys
->
p_blend
);
vlc_object_release
(
p_sys
->
p_blend
);
p_sys
->
p_blend
=
NULL
;
}
}
}
if
(
p_sys
->
p_blend
)
{
vlc_memcpy
(
p_block
->
p_buffer
,
image
->
data
,
i_size
);
p_sys
->
dst
.
p
->
p_pixels
=
p_block
->
p_buffer
;
p_sys
->
p_blend
->
pf_video_blend
(
p_sys
->
p_blend
,
&
p_sys
->
dst
,
p_sys
->
p_mouse
,
root_x
,
root_y
,
255
);
}
else
{
picture_Release
(
p_sys
->
p_mouse
);
p_sys
->
p_mouse
=
NULL
;
vlc_memcpy
(
p_block
->
p_buffer
,
image
->
data
,
i_size
);
}
}
XDestroyImage
(
image
);
XDestroyImage
(
image
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment