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
4a422c22
Commit
4a422c22
authored
Apr 08, 2011
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Screen Win32: cosmetics
parent
97c0744f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
36 deletions
+30
-36
modules/access/screen/screen.c
modules/access/screen/screen.c
+3
-3
modules/access/screen/win32.c
modules/access/screen/win32.c
+27
-33
No files found.
modules/access/screen/screen.c
View file @
4a422c22
...
...
@@ -18,8 +18,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
*
Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
* along with this program; if not, write to the Free Software
Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
...
...
@@ -32,7 +32,7 @@
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_modules.h>
#include <vlc_modules.h>
/* module_need for "video blending" */
#include "screen.h"
/*****************************************************************************
...
...
modules/access/screen/win32.c
View file @
4a422c22
/*****************************************************************************
* win32.c: Screen capture module.
*****************************************************************************
* Copyright (C) 2004-20
08
the VideoLAN team
* Copyright (C) 2004-20
11
the VideoLAN team
* $Id$
*
* Authors: Gildas Bazin <gbazin@videolan.org>
...
...
@@ -17,8 +17,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
*
Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
* along with this program; if not, write to the Free Software
Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
...
...
@@ -33,10 +33,6 @@
#include "screen.h"
#ifndef CAPTUREBLT
# define CAPTUREBLT (DWORD)0x40000000
/* Include layered windows */
#endif
struct
screen_data_t
{
HDC
hdc_src
;
...
...
@@ -90,8 +86,7 @@ int screen_InitCapture( demux_t *p_demux )
case
32
:
i_chroma
=
VLC_CODEC_RGB32
;
break
;
default:
msg_Err
(
p_demux
,
"unknown screen depth %i"
,
p_sys
->
fmt
.
video
.
i_bits_per_pixel
);
msg_Err
(
p_demux
,
"unknown screen depth %i"
,
i_bits_per_pixel
);
DeleteDC
(
p_data
->
hdc_dst
);
ReleaseDC
(
0
,
p_data
->
hdc_src
);
free
(
p_data
);
...
...
@@ -99,12 +94,12 @@ int screen_InitCapture( demux_t *p_demux )
}
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_visible_width
=
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_chroma
=
i_chroma
;
p_sys
->
fmt
.
video
.
i_chroma
=
i_chroma
;
switch
(
i_chroma
)
{
...
...
@@ -128,7 +123,6 @@ int screen_InitCapture( demux_t *p_demux )
break
;
}
return
VLC_SUCCESS
;
}
...
...
@@ -174,17 +168,17 @@ static block_t *CaptureBlockNew( demux_t *p_demux )
{
int
i_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
;
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
=
0
;
p_data
->
bmi
.
bmiHeader
.
biYPelsPerMeter
=
0
;
p_data
->
bmi
.
bmiHeader
.
biClrUsed
=
0
;
p_data
->
bmi
.
bmiHeader
.
biClrImportant
=
0
;
i_val
=
var_CreateGetInteger
(
p_demux
,
"screen-fragment-size"
);
p_data
->
i_fragment_size
=
i_val
>
0
?
i_val
:
(
int
)
p_sys
->
fmt
.
video
.
i_height
;
...
...
@@ -204,8 +198,7 @@ static block_t *CaptureBlockNew( demux_t *p_demux )
if
(
!
hbmp
||
!
p_buffer
)
{
msg_Err
(
p_demux
,
"cannot create bitmap"
);
if
(
hbmp
)
DeleteObject
(
hbmp
);
return
NULL
;
goto
error
;
}
/* Select the bitmap into the compatible DC */
...
...
@@ -217,16 +210,13 @@ static block_t *CaptureBlockNew( demux_t *p_demux )
if
(
!
p_data
->
hgdi_backup
)
{
msg_Err
(
p_demux
,
"cannot select bitmap"
);
DeleteObject
(
hbmp
);
return
NULL
;
goto
error
;
}
/* Build block */
if
(
!
(
p_block
=
malloc
(
sizeof
(
block_t
)
+
sizeof
(
block_sys_t
)
))
)
{
DeleteObject
(
hbmp
);
return
NULL
;
}
goto
error
;
/* Fill all fields */
i_buffer
=
(
p_sys
->
fmt
.
video
.
i_bits_per_pixel
+
7
)
/
8
*
p_sys
->
fmt
.
video
.
i_width
*
p_sys
->
fmt
.
video
.
i_height
;
...
...
@@ -235,6 +225,10 @@ static block_t *CaptureBlockNew( demux_t *p_demux )
p_block
->
hbmp
=
hbmp
;
return
&
p_block
->
self
;
error:
if
(
hbmp
)
DeleteObject
(
hbmp
);
return
NULL
;
}
block_t
*
screen_Capture
(
demux_t
*
p_demux
)
...
...
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