Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
5df7c698
Commit
5df7c698
authored
Jun 04, 2005
by
Eric Petit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport of [11282]
parent
7deac3a3
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
72 deletions
+70
-72
modules/gui/macosx/controls.m
modules/gui/macosx/controls.m
+1
-0
modules/gui/macosx/vout.h
modules/gui/macosx/vout.h
+7
-4
modules/gui/macosx/vout.m
modules/gui/macosx/vout.m
+18
-13
modules/gui/macosx/voutgl.m
modules/gui/macosx/voutgl.m
+18
-28
modules/gui/macosx/voutqt.m
modules/gui/macosx/voutqt.m
+26
-27
No files found.
modules/gui/macosx/controls.m
View file @
5df7c698
...
@@ -690,6 +690,7 @@
...
@@ -690,6 +690,7 @@
-
(
void
)
dealloc
-
(
void
)
dealloc
{
{
free
(
psz_name
);
free
(
psz_name
);
[
super
dealloc
];
}
}
-
(
char
*
)
name
-
(
char
*
)
name
...
...
modules/gui/macosx/vout.h
View file @
5df7c698
...
@@ -30,17 +30,20 @@
...
@@ -30,17 +30,20 @@
@interface
VLCWindow
:
NSWindow
@interface
VLCWindow
:
NSWindow
{
{
vout_thread_t
*
p_vout
;
vout_thread_t
*
p_vout
;
vout_thread_t
*
p_real_vout
;
NSView
*
o_view
;
NSRect
*
s_frame
;
vout_thread_t
*
p_real_vout
;
Ptr
p_fullscreen_state
;
Ptr
p_fullscreen_state
;
mtime_t
i_time_mouse_last_moved
;
mtime_t
i_time_mouse_last_moved
;
NSRect
*
s_frame
;
vlc_bool_t
b_init_ok
;
vlc_bool_t
b_init_ok
;
}
}
-
(
id
)
initWithVout
:
(
vout_thread_t
*
)
p_vout
frame
:
(
NSRect
*
)
s_frame
;
-
(
id
)
initWithVout
:
(
vout_thread_t
*
)
p_vout
view
:
(
NSView
*
)
view
frame
:
(
NSRect
*
)
s_frame
;
-
(
id
)
initReal
:
(
id
)
sender
;
-
(
id
)
initReal
:
(
id
)
sender
;
-
(
void
)
close
;
-
(
void
)
close
;
-
(
id
)
closeReal
:
(
id
)
sender
;
-
(
void
)
setOnTop
:(
BOOL
)
b_on_top
;
-
(
void
)
setOnTop
:(
BOOL
)
b_on_top
;
-
(
void
)
hideMouse
:(
BOOL
)
b_hide
;
-
(
void
)
hideMouse
:(
BOOL
)
b_hide
;
...
...
modules/gui/macosx/vout.m
View file @
5df7c698
...
@@ -65,20 +65,15 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
...
@@ -65,20 +65,15 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
*****************************************************************************/
*****************************************************************************/
@implementation
VLCWindow
@implementation
VLCWindow
-
(
id
)
initWithVout
:
(
vout_thread_t
*
)
vout
frame
:
(
NSRect
*
)
frame
-
(
id
)
initWithVout
:
(
vout_thread_t
*
)
vout
view
:
(
NSView
*
)
view
frame
:
(
NSRect
*
)
frame
{
{
p_vout
=
vout
;
p_vout
=
vout
;
o_view
=
view
;
s_frame
=
frame
;
s_frame
=
frame
;
if
(
MACOS_VERSION
>=
10
.
2
)
{
[
self
performSelectorOnMainThread
:
@selector
(
initReal
:)
[
self
performSelectorOnMainThread
:
@selector
(
initReal
:)
withObject:
NULL
waitUntilDone
:
YES
];
withObject:
NULL
waitUntilDone
:
YES
];
}
else
{
[
self
initReal
:
NULL
];
}
if
(
!
b_init_ok
)
if
(
!
b_init_ok
)
{
{
...
@@ -283,19 +278,31 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
...
@@ -283,19 +278,31 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
[
self
setAcceptsMouseMovedEvents
:
YES
];
[
self
setAcceptsMouseMovedEvents
:
YES
];
[
self
makeFirstResponder
:
self
];
[
self
makeFirstResponder
:
self
];
/* Add the view. It's automatically resized to fit the window */
[
self
setContentView
:
o_view
];
[
o_pool
release
];
[
o_pool
release
];
b_init_ok
=
VLC_TRUE
;
b_init_ok
=
VLC_TRUE
;
return
self
;
return
self
;
}
}
-
(
void
)
close
-
(
void
)
close
{
/* XXX waitUntilDone = NO to avoid a possible deadlock when hitting
Command-Q */
[
self
performSelectorOnMainThread
:
@selector
(
closeReal
:)
withObject:
NULL
waitUntilDone
:
NO
];
}
-
(
id
)
closeReal
:
(
id
)
sender
{
{
[
super
close
];
[
super
close
];
if
(
p_fullscreen_state
)
if
(
p_fullscreen_state
)
{
{
EndFullScreen
(
p_fullscreen_state
,
0
);
EndFullScreen
(
p_fullscreen_state
,
0
);
}
}
return
NULL
;
}
}
-
(
void
)
setOnTop
:(
BOOL
)
b_on_top
-
(
void
)
setOnTop
:(
BOOL
)
b_on_top
...
@@ -701,11 +708,9 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
...
@@ -701,11 +708,9 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
NSPoint
ml
;
NSPoint
ml
;
NSRect
s_rect
;
NSRect
s_rect
;
BOOL
b_inside
;
BOOL
b_inside
;
NSView
*
o_view
;
i_time_mouse_last_moved
=
mdate
();
i_time_mouse_last_moved
=
mdate
();
o_view
=
[
self
contentView
];
s_rect
=
[
o_view
bounds
];
s_rect
=
[
o_view
bounds
];
ml
=
[
o_view
convertPoint
:
[
o_event
locationInWindow
]
fromView
:
nil
];
ml
=
[
o_view
convertPoint
:
[
o_event
locationInWindow
]
fromView
:
nil
];
b_inside
=
[
o_view
mouse
:
ml
inRect
:
s_rect
];
b_inside
=
[
o_view
mouse
:
ml
inRect
:
s_rect
];
...
...
modules/gui/macosx/voutgl.m
View file @
5df7c698
...
@@ -48,11 +48,9 @@
...
@@ -48,11 +48,9 @@
vout_thread_t
*
p_vout
;
vout_thread_t
*
p_vout
;
}
}
-
(
id
)
initWithFrame
:
(
NSRect
)
frame
vout
:
(
vout_thread_t
*
)
p_vout
;
-
(
id
)
initWithVout
:
(
vout_thread_t
*
)
p_vout
;
@end
@end
struct
vout_sys_t
struct
vout_sys_t
{
{
NSAutoreleasePool
*
o_pool
;
NSAutoreleasePool
*
o_pool
;
...
@@ -99,23 +97,19 @@ int E_(OpenVideoGL) ( vlc_object_t * p_this )
...
@@ -99,23 +97,19 @@ int E_(OpenVideoGL) ( vlc_object_t * p_this )
p_vout
->
p_sys
->
o_pool
=
[[
NSAutoreleasePool
alloc
]
init
];
p_vout
->
p_sys
->
o_pool
=
[[
NSAutoreleasePool
alloc
]
init
];
vlc_mutex_init
(
p_vout
,
&
p_vout
->
p_sys
->
lock
);
vlc_mutex_init
(
p_vout
,
&
p_vout
->
p_sys
->
lock
);
/* Spawn window */
/* Create the GL view */
p_vout
->
p_sys
->
o_glview
=
[[
VLCGLView
alloc
]
initWithVout
:
p_vout
];
[
p_vout
->
p_sys
->
o_glview
autorelease
];
/* Spawn the window */
p_vout
->
p_sys
->
b_got_frame
=
VLC_FALSE
;
p_vout
->
p_sys
->
b_got_frame
=
VLC_FALSE
;
p_vout
->
p_sys
->
o_window
=
[[
VLCWindow
alloc
]
initWithVout
:
p_vout
p_vout
->
p_sys
->
o_window
=
[[
VLCWindow
alloc
]
initWithVout
:
p_vout
frame:
nil
];
view:
p_vout
->
p_sys
->
o_glview
frame
:
nil
];
if
(
!
p_vout
->
p_sys
->
o_window
)
if
(
!
p_vout
->
p_sys
->
o_window
)
{
{
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
/* Add OpenGL view */
#define o_glview p_vout->p_sys->o_glview
o_glview
=
[[
VLCGLView
alloc
]
initWithFrame
:
[
p_vout
->
p_sys
->
o_window
frame
]
vout
:
p_vout
];
[
p_vout
->
p_sys
->
o_window
setContentView
:
o_glview
];
[
o_glview
autorelease
];
#undef o_glview
p_vout
->
pf_init
=
Init
;
p_vout
->
pf_init
=
Init
;
p_vout
->
pf_end
=
End
;
p_vout
->
pf_end
=
End
;
p_vout
->
pf_manage
=
Manage
;
p_vout
->
pf_manage
=
Manage
;
...
@@ -132,12 +126,6 @@ void E_(CloseVideoGL) ( vlc_object_t * p_this )
...
@@ -132,12 +126,6 @@ void E_(CloseVideoGL) ( vlc_object_t * p_this )
vout_thread_t
*
p_vout
=
(
vout_thread_t
*
)
p_this
;
vout_thread_t
*
p_vout
=
(
vout_thread_t
*
)
p_this
;
NSAutoreleasePool
*
o_pool
=
[[
NSAutoreleasePool
alloc
]
init
];
NSAutoreleasePool
*
o_pool
=
[[
NSAutoreleasePool
alloc
]
init
];
/* Remove the GLView from the window, because we are not sure OS X
will actually close the window right away. When it doesn't,
VLCGLView's reshape is called while p_vout and p_vout->p_sys
aren't valid anymore and crashes. */
[
p_vout
->
p_sys
->
o_window
setContentView
:
NULL
];
/* Close the window */
/* Close the window */
[
p_vout
->
p_sys
->
o_window
close
];
[
p_vout
->
p_sys
->
o_window
close
];
...
@@ -177,23 +165,25 @@ static int Manage( vout_thread_t * p_vout )
...
@@ -177,23 +165,25 @@ static int Manage( vout_thread_t * p_vout )
p_vout
->
b_fullscreen
=
!
p_vout
->
b_fullscreen
;
p_vout
->
b_fullscreen
=
!
p_vout
->
b_fullscreen
;
#define o_glview p_vout->p_sys->o_glview
o_glview
=
[[
VLCGLView
alloc
]
initWithVout
:
p_vout
];
[
o_glview
autorelease
];
if
(
p_vout
->
p_sys
->
b_saved_frame
)
if
(
p_vout
->
p_sys
->
b_saved_frame
)
{
{
p_vout
->
p_sys
->
o_window
=
[[
VLCWindow
alloc
]
p_vout
->
p_sys
->
o_window
=
[[
VLCWindow
alloc
]
initWithVout:
p_vout
frame
:
&
p_vout
->
p_sys
->
s_frame
];
initWithVout:
p_vout
view
:
o_glview
frame:
&
p_vout
->
p_sys
->
s_frame
];
}
}
else
else
{
{
p_vout
->
p_sys
->
o_window
=
[[
VLCWindow
alloc
]
p_vout
->
p_sys
->
o_window
=
[[
VLCWindow
alloc
]
initWithVout:
p_vout
frame
:
nil
];
initWithVout:
p_vout
view
:
o_glview
frame
:
nil
];
}
}
#define o_glview p_vout->p_sys->o_glview
o_glview
=
[[
VLCGLView
alloc
]
initWithFrame
:
[
p_vout
->
p_sys
->
o_window
frame
]
vout
:
p_vout
];
[
p_vout
->
p_sys
->
o_window
setContentView
:
o_glview
];
[
o_glview
autorelease
];
[[
o_glview
openGLContext
]
makeCurrentContext
];
[[
o_glview
openGLContext
]
makeCurrentContext
];
#undef o_glview
#undef o_glview
[
o_pool
release
];
[
o_pool
release
];
p_vout
->
i_changes
&=
~
VOUT_FULLSCREEN_CHANGE
;
p_vout
->
i_changes
&=
~
VOUT_FULLSCREEN_CHANGE
;
...
@@ -246,9 +236,9 @@ static void Unlock( vout_thread_t * p_vout )
...
@@ -246,9 +236,9 @@ static void Unlock( vout_thread_t * p_vout )
*****************************************************************************/
*****************************************************************************/
@implementation
VLCGLView
@implementation
VLCGLView
-
(
id
)
initWith
Frame
:
(
NSRect
)
frame
vout
:
(
vout_thread_t
*
)
_p_
vout
-
(
id
)
initWith
Vout
:
(
vout_thread_t
*
)
vout
{
{
p_vout
=
_p_
vout
;
p_vout
=
vout
;
NSOpenGLPixelFormatAttribute
attribs
[]
=
NSOpenGLPixelFormatAttribute
attribs
[]
=
{
{
...
@@ -270,7 +260,7 @@ static void Unlock( vout_thread_t * p_vout )
...
@@ -270,7 +260,7 @@ static void Unlock( vout_thread_t * p_vout )
return
nil
;
return
nil
;
}
}
self
=
[
super
initWithFrame
:
frame
pixelFormat
:
fmt
];
self
=
[
super
initWithFrame
:
NSMakeRect
(
0
,
0
,
10
,
10
)
pixelFormat
:
fmt
];
[
fmt
release
];
[
fmt
release
];
[[
self
openGLContext
]
makeCurrentContext
];
[[
self
openGLContext
]
makeCurrentContext
];
...
...
modules/gui/macosx/voutqt.m
View file @
5df7c698
...
@@ -140,25 +140,6 @@ int E_(OpenVideoQT) ( vlc_object_t *p_this )
...
@@ -140,25 +140,6 @@ int E_(OpenVideoQT) ( vlc_object_t *p_this )
else
else
p_vout
->
p_sys
->
b_embedded
=
VLC_FALSE
;
p_vout
->
p_sys
->
b_embedded
=
VLC_FALSE
;
if
(
p_vout
->
p_sys
->
b_embedded
)
{
/* Zero the clipping rectangle */
p_vout
->
p_sys
->
clipping_rect
.
left
=
0
;
p_vout
->
p_sys
->
clipping_rect
.
right
=
0
;
p_vout
->
p_sys
->
clipping_rect
.
top
=
0
;
p_vout
->
p_sys
->
clipping_rect
.
bottom
=
0
;
}
else
{
/* Spawn window */
p_vout
->
p_sys
->
o_window
=
[[
VLCWindow
alloc
]
initWithVout
:
p_vout
frame
:
nil
];
if
(
!
p_vout
->
p_sys
->
o_window
)
{
return
VLC_EGENERIC
;
}
}
p_vout
->
p_sys
->
b_altivec
=
p_vout
->
p_libvlc
->
i_cpu
&
CPU_CAPABILITY_ALTIVEC
;
p_vout
->
p_sys
->
b_altivec
=
p_vout
->
p_libvlc
->
i_cpu
&
CPU_CAPABILITY_ALTIVEC
;
msg_Dbg
(
p_vout
,
"We do%s have Altivec"
,
p_vout
->
p_sys
->
b_altivec
?
""
:
"n't"
);
msg_Dbg
(
p_vout
,
"We do%s have Altivec"
,
p_vout
->
p_sys
->
b_altivec
?
""
:
"n't"
);
...
@@ -221,9 +202,27 @@ int E_(OpenVideoQT) ( vlc_object_t *p_this )
...
@@ -221,9 +202,27 @@ int E_(OpenVideoQT) ( vlc_object_t *p_this )
#define o_qtview p_vout->p_sys->o_qtview
#define o_qtview p_vout->p_sys->o_qtview
o_qtview
=
[[
VLCQTView
alloc
]
initWithVout
:
p_vout
];
o_qtview
=
[[
VLCQTView
alloc
]
initWithVout
:
p_vout
];
[
p_vout
->
p_sys
->
o_window
setContentView
:
o_qtview
];
[
o_qtview
autorelease
];
[
o_qtview
autorelease
];
if
(
p_vout
->
p_sys
->
b_embedded
)
{
/* Zero the clipping rectangle */
p_vout
->
p_sys
->
clipping_rect
.
left
=
0
;
p_vout
->
p_sys
->
clipping_rect
.
right
=
0
;
p_vout
->
p_sys
->
clipping_rect
.
top
=
0
;
p_vout
->
p_sys
->
clipping_rect
.
bottom
=
0
;
}
else
{
/* Spawn window */
p_vout
->
p_sys
->
o_window
=
[[
VLCWindow
alloc
]
initWithVout:
p_vout
view
:
o_qtview
frame
:
nil
];
if
(
!
p_vout
->
p_sys
->
o_window
)
{
return
VLC_EGENERIC
;
}
}
/* Retrieve the QuickDraw port */
/* Retrieve the QuickDraw port */
if
(
p_vout
->
p_sys
->
b_embedded
)
if
(
p_vout
->
p_sys
->
b_embedded
)
{
{
...
@@ -498,22 +497,22 @@ static int CoToggleFullscreen( vout_thread_t *p_vout )
...
@@ -498,22 +497,22 @@ static int CoToggleFullscreen( vout_thread_t *p_vout )
p_vout
->
b_fullscreen
=
!
p_vout
->
b_fullscreen
;
p_vout
->
b_fullscreen
=
!
p_vout
->
b_fullscreen
;
#define o_qtview p_vout->p_sys->o_qtview
o_qtview
=
[[
VLCQTView
alloc
]
initWithVout
:
p_vout
];
[
o_qtview
autorelease
];
if
(
p_vout
->
p_sys
->
b_saved_frame
)
if
(
p_vout
->
p_sys
->
b_saved_frame
)
{
{
p_vout
->
p_sys
->
o_window
=
[[
VLCWindow
alloc
]
p_vout
->
p_sys
->
o_window
=
[[
VLCWindow
alloc
]
initWithVout:
p_vout
frame
:
&
p_vout
->
p_sys
->
s_frame
];
initWithVout:
p_vout
view
:
o_qtview
frame:
&
p_vout
->
p_sys
->
s_frame
];
}
}
else
else
{
{
p_vout
->
p_sys
->
o_window
=
[[
VLCWindow
alloc
]
p_vout
->
p_sys
->
o_window
=
[[
VLCWindow
alloc
]
initWithVout:
p_vout
frame
:
nil
];
initWithVout:
p_vout
view
:
o_qtview
frame
:
nil
];
}
}
#define o_qtview p_vout->p_sys->o_qtview
o_qtview
=
[[
VLCQTView
alloc
]
initWithVout
:
p_vout
];
[
p_vout
->
p_sys
->
o_window
setContentView
:
o_qtview
];
[
o_qtview
autorelease
];
/* Retrieve the QuickDraw port */
/* Retrieve the QuickDraw port */
[
o_qtview
lockFocus
];
[
o_qtview
lockFocus
];
p_vout
->
p_sys
->
p_qdport
=
[
o_qtview
qdPort
];
p_vout
->
p_sys
->
p_qdport
=
[
o_qtview
qdPort
];
...
...
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