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
2e4212b2
Commit
2e4212b2
authored
Jan 11, 2009
by
FUJISAWA Tooru
Committed by
Felix Paul Kühne
Jan 11, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add subscreen/follow mouse support to Mac OS X screen module.
Signed-off-by:
Felix Paul Kühne
<
fkuehne@videolan.org
>
parent
28425401
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
13 deletions
+32
-13
modules/access/screen/mac.c
modules/access/screen/mac.c
+32
-13
No files found.
modules/access/screen/mac.c
View file @
2e4212b2
...
...
@@ -103,10 +103,16 @@ int screen_InitCapture( demux_t *p_demux )
p_data
->
screen_width
=
viewport
[
2
];
p_data
->
screen_height
=
viewport
[
3
];
p_data
->
left
=
0
;
p_data
->
top
=
0
;
p_data
->
src_width
=
p_data
->
screen_width
;
p_data
->
src_height
=
p_data
->
screen_height
;
p_data
->
left
=
p_sys
->
i_left
;
p_data
->
top
=
p_sys
->
i_top
;
p_data
->
src_width
=
var_CreateGetInteger
(
p_demux
,
"screen-width"
);
if
(
p_data
->
src_width
<=
0
)
{
p_data
->
src_width
=
p_data
->
screen_width
;
}
p_data
->
src_height
=
var_CreateGetInteger
(
p_demux
,
"screen-height"
);
if
(
p_data
->
src_height
<=
0
)
{
p_data
->
src_height
=
p_data
->
screen_height
;
}
p_data
->
dest_width
=
p_data
->
src_width
;
p_data
->
dest_height
=
p_data
->
src_height
;
...
...
@@ -127,9 +133,10 @@ int screen_InitCapture( demux_t *p_demux )
es_format_Init
(
&
p_sys
->
fmt
,
VIDEO_ES
,
VLC_FOURCC
(
'R'
,
'V'
,
'3'
,
'2'
)
);
p_sys
->
fmt
.
video
.
i_width
=
p_data
->
dest_width
;
p_sys
->
fmt
.
video
.
i_visible_width
=
p_data
->
dest_width
;
p_sys
->
fmt
.
video
.
i_height
=
p_data
->
dest_height
;
/* p_sys->fmt.video.i_* must set to screen size, not subscreen size */
p_sys
->
fmt
.
video
.
i_width
=
p_data
->
screen_width
;
p_sys
->
fmt
.
video
.
i_visible_width
=
p_data
->
screen_width
;
p_sys
->
fmt
.
video
.
i_height
=
p_data
->
screen_height
;
p_sys
->
fmt
.
video
.
i_bits_per_pixel
=
32
;
glGenTextures
(
1
,
&
(
p_data
->
texture
)
);
...
...
@@ -184,6 +191,23 @@ block_t *screen_Capture( demux_t *p_demux )
return
0
;
}
CGPoint
cursor_pos
;
CGError
cursor_result
;
cursor_pos
.
x
=
0
;
cursor_pos
.
y
=
0
;
cursor_result
=
CGSGetCurrentCursorLocation
(
p_data
->
connection
,
&
cursor_pos
);
if
(
p_sys
->
b_follow_mouse
&&
cursor_result
==
kCGErrorSuccess
)
{
FollowMouse
(
p_sys
,
cursor_pos
.
x
,
cursor_pos
.
y
);
p_data
->
left
=
p_sys
->
i_left
;
p_data
->
top
=
p_sys
->
i_top
;
}
CGLSetCurrentContext
(
p_data
->
screen
);
glReadPixels
(
p_data
->
left
,
p_data
->
screen_height
-
p_data
->
top
-
p_data
->
src_height
,
...
...
@@ -212,18 +236,13 @@ block_t *screen_Capture( demux_t *p_demux )
glEnd
();
glDisable
(
GL_TEXTURE_2D
);
CGPoint
cursor_pos
;
int
size
;
int
tmp1
,
tmp2
,
tmp3
,
tmp4
;
unsigned
char
*
cursor_image
;
CGRect
cursor_rect
;
CGPoint
cursor_hot
;
cursor_pos
.
x
=
0
;
cursor_pos
.
y
=
0
;
if
(
CGSGetCurrentCursorLocation
(
p_data
->
connection
,
&
cursor_pos
)
==
kCGErrorSuccess
if
(
cursor_result
==
kCGErrorSuccess
&&
CGSGetGlobalCursorDataSize
(
p_data
->
connection
,
&
size
)
==
kCGErrorSuccess
)
{
...
...
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