Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
4adeff9f
Commit
4adeff9f
authored
Sep 09, 2008
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement partial screen capture and cursor following on windows.
parent
e5324e70
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
76 additions
and
45 deletions
+76
-45
NEWS
NEWS
+2
-0
modules/access/screen/screen.c
modules/access/screen/screen.c
+17
-1
modules/access/screen/screen.h
modules/access/screen/screen.h
+9
-2
modules/access/screen/win32.c
modules/access/screen/win32.c
+45
-31
modules/access/screen/x11.c
modules/access/screen/x11.c
+3
-11
No files found.
NEWS
View file @
4adeff9f
...
...
@@ -3,6 +3,8 @@ Changes between 0.9.1 and 1.0.0-git:
Inputs:
* Mouse cursor support in x11 screen module
* Screen module now supports partial screen capture and mouse following on
windows.
Decoders:
* AES3 (SMPTE 302M) support
...
...
modules/access/screen/screen.c
View file @
4adeff9f
/*****************************************************************************
* screen.c: Screen capture module.
*****************************************************************************
* Copyright (C) 2004 the VideoLAN team
* Copyright (C) 2004
-2008
the VideoLAN team
* $Id$
*
* Authors: Gildas Bazin <gbazin@videolan.org>
* Antoine Cellerier <dionoea at videolan dot org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -308,3 +309,18 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
return
VLC_EGENERIC
;
}
}
#ifdef SCREEN_SUBSCREEN
void
FollowMouse
(
demux_sys_t
*
p_sys
,
int
i_x
,
int
i_y
)
{
i_x
-=
p_sys
->
i_width
/
2
;
if
(
i_x
<
0
)
i_x
=
0
;
p_sys
->
i_left
=
__MIN
(
(
unsigned
int
)
i_x
,
p_sys
->
i_screen_width
-
p_sys
->
i_width
);
i_y
-=
p_sys
->
i_height
/
2
;
if
(
i_y
<
0
)
i_y
=
0
;
p_sys
->
i_top
=
__MIN
(
(
unsigned
int
)
i_y
,
p_sys
->
i_screen_height
-
p_sys
->
i_height
);
}
#endif
modules/access/screen/screen.h
View file @
4adeff9f
/*****************************************************************************
* screen.h: Screen capture module.
*****************************************************************************
* Copyright (C) 2004 the VideoLAN team
* Copyright (C) 2004
-2008
the VideoLAN team
* $Id$
*
* Authors: Gildas Bazin <gbazin@videolan.org>
* Antoine Cellerier <dionoea at videolan dot org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -25,8 +26,11 @@
#include <vlc_access.h>
#include <vlc_demux.h>
#if !defined( HAVE_
WIN32 ) && !defined( HAVE_
BEOS ) && !defined( HAVE_DARWIN )
#if !defined( HAVE_BEOS ) && !defined( HAVE_DARWIN )
# define SCREEN_SUBSCREEN
#endif
#if !defined( HAVE_WIN32 ) && !defined( HAVE_BEOS ) && !defined( HAVE_DARWIN )
# define SCREEN_MOUSE
#endif
...
...
@@ -69,3 +73,6 @@ int screen_InitCapture ( demux_t * );
int
screen_CloseCapture
(
demux_t
*
);
block_t
*
screen_Capture
(
demux_t
*
);
#ifdef SCREEN_SUBSCREEN
void
FollowMouse
(
demux_sys_t
*
,
int
,
int
);
#endif
modules/access/screen/win32.c
View file @
4adeff9f
...
...
@@ -54,9 +54,11 @@ int screen_InitCapture( demux_t *p_demux )
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
screen_data_t
*
p_data
;
int
i_chroma
,
i_bits_per_pixel
;
vlc_value_t
val
;
p_sys
->
p_data
=
p_data
=
malloc
(
sizeof
(
screen_data_t
)
);
if
(
!
p_data
)
return
VLC_ENOMEM
;
memset
(
p_data
,
0
,
sizeof
(
screen_data_t
)
);
/* Get the device context for the whole screen */
p_data
->
hdc_src
=
CreateDC
(
"DISPLAY"
,
NULL
,
NULL
,
NULL
);
...
...
@@ -122,32 +124,6 @@ int screen_InitCapture( demux_t *p_demux )
}
/* Create the bitmap info header */
p_data
->
bmi
.
bmiHeader
.
biSize
=
sizeof
(
BITMAPINFOHEADER
);
p_data
->
bmi
.
bmiHeader
.
biWidth
=
p_sys
->
fmt
.
video
.
i_width
;
p_data
->
bmi
.
bmiHeader
.
biHeight
=
-
p_sys
->
fmt
.
video
.
i_height
;
p_data
->
bmi
.
bmiHeader
.
biPlanes
=
1
;
p_data
->
bmi
.
bmiHeader
.
biBitCount
=
p_sys
->
fmt
.
video
.
i_bits_per_pixel
;
p_data
->
bmi
.
bmiHeader
.
biCompression
=
BI_RGB
;
p_data
->
bmi
.
bmiHeader
.
biSizeImage
=
0
;
p_data
->
bmi
.
bmiHeader
.
biXPelsPerMeter
=
p_data
->
bmi
.
bmiHeader
.
biYPelsPerMeter
=
0
;
p_data
->
bmi
.
bmiHeader
.
biClrUsed
=
0
;
p_data
->
bmi
.
bmiHeader
.
biClrImportant
=
0
;
var_Create
(
p_demux
,
"screen-fragment-size"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
var_Get
(
p_demux
,
"screen-fragment-size"
,
&
val
);
p_data
->
i_fragment_size
=
val
.
i_int
>
0
?
val
.
i_int
:
p_sys
->
fmt
.
video
.
i_height
;
p_data
->
i_fragment_size
=
val
.
i_int
>
p_sys
->
fmt
.
video
.
i_height
?
p_sys
->
fmt
.
video
.
i_height
:
p_data
->
i_fragment_size
;
p_sys
->
f_fps
*=
(
p_sys
->
fmt
.
video
.
i_height
/
p_data
->
i_fragment_size
);
p_sys
->
i_incr
=
1000000
/
p_sys
->
f_fps
;
p_data
->
i_fragment
=
0
;
p_data
->
p_block
=
0
;
return
VLC_SUCCESS
;
}
...
...
@@ -189,6 +165,37 @@ static block_t *CaptureBlockNew( demux_t *p_demux )
int
i_buffer
;
HBITMAP
hbmp
;
if
(
p_data
->
bmi
.
bmiHeader
.
biSize
==
0
)
{
vlc_value_t
val
;
/* Create the bitmap info header */
p_data
->
bmi
.
bmiHeader
.
biSize
=
sizeof
(
BITMAPINFOHEADER
);
p_data
->
bmi
.
bmiHeader
.
biWidth
=
p_sys
->
fmt
.
video
.
i_width
;
p_data
->
bmi
.
bmiHeader
.
biHeight
=
-
p_sys
->
fmt
.
video
.
i_height
;
p_data
->
bmi
.
bmiHeader
.
biPlanes
=
1
;
p_data
->
bmi
.
bmiHeader
.
biBitCount
=
p_sys
->
fmt
.
video
.
i_bits_per_pixel
;
p_data
->
bmi
.
bmiHeader
.
biCompression
=
BI_RGB
;
p_data
->
bmi
.
bmiHeader
.
biSizeImage
=
0
;
p_data
->
bmi
.
bmiHeader
.
biXPelsPerMeter
=
p_data
->
bmi
.
bmiHeader
.
biYPelsPerMeter
=
0
;
p_data
->
bmi
.
bmiHeader
.
biClrUsed
=
0
;
p_data
->
bmi
.
bmiHeader
.
biClrImportant
=
0
;
var_Create
(
p_demux
,
"screen-fragment-size"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
var_Get
(
p_demux
,
"screen-fragment-size"
,
&
val
);
p_data
->
i_fragment_size
=
val
.
i_int
>
0
?
val
.
i_int
:
p_sys
->
fmt
.
video
.
i_height
;
p_data
->
i_fragment_size
=
val
.
i_int
>
p_sys
->
fmt
.
video
.
i_height
?
p_sys
->
fmt
.
video
.
i_height
:
p_data
->
i_fragment_size
;
p_sys
->
f_fps
*=
(
p_sys
->
fmt
.
video
.
i_height
/
p_data
->
i_fragment_size
);
p_sys
->
i_incr
=
1000000
/
p_sys
->
f_fps
;
p_data
->
i_fragment
=
0
;
p_data
->
p_block
=
0
;
}
/* Create the bitmap storage space */
hbmp
=
CreateDIBSection
(
p_data
->
hdc_dst
,
&
p_data
->
bmi
,
DIB_RGB_COLORS
,
&
p_buffer
,
NULL
,
0
);
...
...
@@ -242,11 +249,18 @@ block_t *screen_Capture( demux_t *p_demux )
}
}
if
(
!
BitBlt
(
p_data
->
hdc_dst
,
0
,
p_data
->
i_fragment
*
p_data
->
i_fragment_size
,
if
(
p_sys
->
b_follow_mouse
)
{
POINT
pos
;
GetCursorPos
(
&
pos
);
FollowMouse
(
p_sys
,
pos
.
x
,
pos
.
y
);
}
if
(
!
BitBlt
(
p_data
->
hdc_dst
,
0
,
p_data
->
i_fragment
*
p_data
->
i_fragment_size
,
p_sys
->
fmt
.
video
.
i_width
,
p_data
->
i_fragment_size
,
p_data
->
hdc_src
,
0
,
p_data
->
i_fragment
*
p_data
->
i_fragment_size
,
p_data
->
hdc_src
,
p_sys
->
i_left
,
p_sys
->
i_top
+
p_data
->
i_fragment
*
p_data
->
i_fragment
_size
,
IS_WINNT
?
SRCCOPY
|
CAPTUREBLT
:
SRCCOPY
)
)
{
msg_Err
(
p_demux
,
"error during BitBlt()"
);
...
...
modules/access/screen/x11.c
View file @
4adeff9f
/*****************************************************************************
* x11.c: Screen capture module.
*****************************************************************************
* Copyright (C) 2004 the VideoLAN team
* Copyright (C) 2004
-2008
the VideoLAN team
* $Id$
*
* Authors: Gildas Bazin <gbazin@videolan.org>
* Antoine Cellerier <dionoea at videolan dot org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -133,16 +134,7 @@ block_t *screen_Capture( demux_t *p_demux )
&
mask
)
)
{
if
(
p_sys
->
b_follow_mouse
)
{
root_x
-=
p_sys
->
i_width
/
2
;
if
(
root_x
<
0
)
root_x
=
0
;
p_sys
->
i_left
=
__MIN
(
(
unsigned
int
)
root_x
,
p_sys
->
i_screen_width
-
p_sys
->
i_width
);
root_y
-=
p_sys
->
i_height
/
2
;
if
(
root_y
<
0
)
root_y
=
0
;
p_sys
->
i_top
=
__MIN
(
(
unsigned
int
)
root_y
,
p_sys
->
i_screen_height
-
p_sys
->
i_height
);
}
FollowMouse
(
p_sys
,
root_x
,
root_y
);
}
else
msg_Dbg
(
p_demux
,
"XQueryPointer() failed"
);
...
...
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