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
993bc6c2
Commit
993bc6c2
authored
Oct 06, 2015
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
caopengllayer: cosmetics
parent
d759a18e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
28 deletions
+27
-28
modules/video_output/caopengllayer.m
modules/video_output/caopengllayer.m
+27
-28
No files found.
modules/video_output/caopengllayer.m
View file @
993bc6c2
/*****************************************************************************
* caopengllayer.m: CAOpenGLLayer (Mac OS X) video output
*****************************************************************************
* Copyright (C) 2014 VLC authors and VideoLAN
* Copyright (C) 2014
-2015
VLC authors and VideoLAN
* $Id$
*
* Authors: David Fuhrmann <david dot fuhrmann at googlemail dot com>
...
...
@@ -74,11 +74,10 @@ static void OpenglSwap (vlc_gl_t *gl);
-
(
CGSize
)
currentOutputSize
;
@end
@interface
VLCCAOpenGLLayer
:
CAOpenGLLayer
{
vout_display_t
*
_vd
;
}
@interface
VLCCAOpenGLLayer
:
CAOpenGLLayer
@property
(
nonatomic
,
readwrite
)
vout_display_t
*
voutDisplay
;
-
(
void
)
setVoutDisplay
:(
vout_display_t
*
)
aVd
;
@end
...
...
@@ -407,7 +406,7 @@ static void *OurGetProcAddress (vlc_gl_t *gl, const char *name)
-
(
void
)
setVoutDisplay
:(
vout_display_t
*
)
aVd
{
_v
d
=
aVd
;
_v
outDisplay
=
aVd
;
}
-
(
void
)
resizeWithOldSuperlayerSize
:(
CGSize
)
size
...
...
@@ -416,24 +415,24 @@ static void *OurGetProcAddress (vlc_gl_t *gl, const char *name)
CGSize
boundsSize
=
self
.
visibleRect
.
size
;
if
(
_v
d
)
vout_display_SendEventDisplaySize
(
_v
d
,
boundsSize
.
width
,
boundsSize
.
height
);
if
(
_v
outDisplay
)
vout_display_SendEventDisplaySize
(
_v
outDisplay
,
boundsSize
.
width
,
boundsSize
.
height
);
}
-
(
BOOL
)
canDrawInCGLContext
:(
CGLContextObj
)
glContext
pixelFormat
:(
CGLPixelFormatObj
)
pixelFormat
forLayerTime
:(
CFTimeInterval
)
timeInterval
displayTime
:(
const
CVTimeStamp
*
)
timeStamp
{
/* Only draw the frame if we have a frame that was previously rendered */
if
(
!
_v
d
)
if
(
!
_v
outDisplay
)
return
false
;
return
_v
d
->
sys
->
b_frame_available
;
return
_v
outDisplay
->
sys
->
b_frame_available
;
}
-
(
void
)
drawInCGLContext
:(
CGLContextObj
)
glContext
pixelFormat
:(
CGLPixelFormatObj
)
pixelFormat
forLayerTime
:(
CFTimeInterval
)
timeInterval
displayTime
:(
const
CVTimeStamp
*
)
timeStamp
{
if
(
!
_v
d
)
if
(
!
_v
outDisplay
)
return
;
vout_display_sys_t
*
sys
=
_v
d
->
sys
;
vout_display_sys_t
*
sys
=
_v
outDisplay
->
sys
;
if
(
!
sys
->
vgl
)
return
;
...
...
@@ -444,16 +443,16 @@ static void *OurGetProcAddress (vlc_gl_t *gl, const char *name)
glViewport
(
sys
->
place
.
x
,
bounds
.
size
.
height
-
(
sys
->
place
.
y
+
sys
->
place
.
height
),
sys
->
place
.
width
,
sys
->
place
.
height
);
// flush is also done by this method, no need to call super
vout_display_opengl_Display
(
sys
->
vgl
,
&
_v
d
->
source
);
vout_display_opengl_Display
(
sys
->
vgl
,
&
_v
outDisplay
->
source
);
sys
->
b_frame_available
=
NO
;
}
-
(
CGLContextObj
)
copyCGLContextForPixelFormat
:(
CGLPixelFormatObj
)
pixelFormat
{
// Only one opengl context is allowed for the module lifetime
if
(
_v
d
->
sys
->
glContext
)
{
msg_Dbg
(
_v
d
,
"Return existing context: %p"
,
_vd
->
sys
->
glContext
);
return
_v
d
->
sys
->
glContext
;
if
(
_v
outDisplay
->
sys
->
glContext
)
{
msg_Dbg
(
_v
outDisplay
,
"Return existing context: %p"
,
_voutDisplay
->
sys
->
glContext
);
return
_v
outDisplay
->
sys
->
glContext
;
}
CGLContextObj
context
=
[
super
copyCGLContextForPixelFormat
:
pixelFormat
];
...
...
@@ -467,7 +466,7 @@ static void *OurGetProcAddress (vlc_gl_t *gl, const char *name)
&
params
);
@synchronized
(
self
)
{
_v
d
->
sys
->
glContext
=
context
;
_v
outDisplay
->
sys
->
glContext
=
context
;
}
return
context
;
...
...
@@ -481,13 +480,13 @@ static void *OurGetProcAddress (vlc_gl_t *gl, const char *name)
-
(
void
)
mouseButtonDown
:(
int
)
buttonNumber
{
@synchronized
(
self
)
{
if
(
_v
d
)
{
if
(
_v
outDisplay
)
{
if
(
buttonNumber
==
0
)
vout_display_SendEventMousePressed
(
_v
d
,
MOUSE_BUTTON_LEFT
);
vout_display_SendEventMousePressed
(
_v
outDisplay
,
MOUSE_BUTTON_LEFT
);
else
if
(
buttonNumber
==
1
)
vout_display_SendEventMousePressed
(
_v
d
,
MOUSE_BUTTON_RIGHT
);
vout_display_SendEventMousePressed
(
_v
outDisplay
,
MOUSE_BUTTON_RIGHT
);
else
vout_display_SendEventMousePressed
(
_v
d
,
MOUSE_BUTTON_CENTER
);
vout_display_SendEventMousePressed
(
_v
outDisplay
,
MOUSE_BUTTON_CENTER
);
}
}
}
...
...
@@ -495,13 +494,13 @@ static void *OurGetProcAddress (vlc_gl_t *gl, const char *name)
-
(
void
)
mouseButtonUp
:(
int
)
buttonNumber
{
@synchronized
(
self
)
{
if
(
_v
d
)
{
if
(
_v
outDisplay
)
{
if
(
buttonNumber
==
0
)
vout_display_SendEventMouseReleased
(
_v
d
,
MOUSE_BUTTON_LEFT
);
vout_display_SendEventMouseReleased
(
_v
outDisplay
,
MOUSE_BUTTON_LEFT
);
else
if
(
buttonNumber
==
1
)
vout_display_SendEventMouseReleased
(
_v
d
,
MOUSE_BUTTON_RIGHT
);
vout_display_SendEventMouseReleased
(
_v
outDisplay
,
MOUSE_BUTTON_RIGHT
);
else
vout_display_SendEventMouseReleased
(
_v
d
,
MOUSE_BUTTON_CENTER
);
vout_display_SendEventMouseReleased
(
_v
outDisplay
,
MOUSE_BUTTON_CENTER
);
}
}
}
...
...
@@ -509,12 +508,12 @@ static void *OurGetProcAddress (vlc_gl_t *gl, const char *name)
-
(
void
)
mouseMovedToX
:(
double
)
xValue
Y
:(
double
)
yValue
{
@synchronized
(
self
)
{
if
(
_v
d
)
{
vout_display_SendMouseMovedDisplayCoordinates
(
_v
d
,
if
(
_v
outDisplay
)
{
vout_display_SendMouseMovedDisplayCoordinates
(
_v
outDisplay
,
ORIENT_NORMAL
,
xValue
,
yValue
,
&
_v
d
->
sys
->
place
);
&
_v
outDisplay
->
sys
->
place
);
}
}
}
...
...
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