Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
81126aae
Commit
81126aae
authored
Jun 20, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: embedded window support
Except that this returns an invalid X11 handle.
parent
6ba2d51e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
3 deletions
+73
-3
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.cpp
+5
-3
modules/gui/qt4/qt4.cpp
modules/gui/qt4/qt4.cpp
+68
-0
No files found.
modules/gui/qt4/main_interface.cpp
View file @
81126aae
...
@@ -437,9 +437,11 @@ void MainInterface::handleMainUi( QSettings *settings )
...
@@ -437,9 +437,11 @@ void MainInterface::handleMainUi( QSettings *settings )
videoWidget
=
new
VideoWidget
(
p_intf
);
videoWidget
=
new
VideoWidget
(
p_intf
);
mainLayout
->
insertWidget
(
0
,
videoWidget
);
mainLayout
->
insertWidget
(
0
,
videoWidget
);
}
var_Create
(
p_intf
,
"window_widget"
,
VLC_VAR_ADDRESS
);
else
vlc_value_t
val
;
{
val
.
p_address
=
this
;
var_Set
(
p_intf
,
"window_widget"
,
val
);
msg_Err
(
p_intf
,
"window_widget = %p"
,
this
);
}
}
/* Finish the sizing */
/* Finish the sizing */
...
...
modules/gui/qt4/qt4.cpp
View file @
81126aae
...
@@ -50,6 +50,8 @@
...
@@ -50,6 +50,8 @@
static
int
Open
(
vlc_object_t
*
);
static
int
Open
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
static
int
OpenDialogs
(
vlc_object_t
*
);
static
int
OpenDialogs
(
vlc_object_t
*
);
static
int
OpenWindow
(
vlc_object_t
*
);
static
void
CloseWindow
(
vlc_object_t
*
);
static
void
Run
(
intf_thread_t
*
);
static
void
Run
(
intf_thread_t
*
);
static
void
Init
(
intf_thread_t
*
);
static
void
Init
(
intf_thread_t
*
);
static
void
ShowDialog
(
intf_thread_t
*
,
int
,
int
,
intf_dialog_args_t
*
);
static
void
ShowDialog
(
intf_thread_t
*
,
int
,
int
,
intf_dialog_args_t
*
);
...
@@ -201,6 +203,10 @@ vlc_module_begin();
...
@@ -201,6 +203,10 @@ vlc_module_begin();
false
);
false
);
set_callbacks
(
OpenDialogs
,
Close
);
set_callbacks
(
OpenDialogs
,
Close
);
add_submodule
();
set_capability
(
"vout window"
,
50
);
set_callbacks
(
OpenWindow
,
CloseWindow
);
vlc_module_end
();
vlc_module_end
();
/*****************************************************************************
/*****************************************************************************
...
@@ -421,3 +427,65 @@ static int PopupMenuCB( vlc_object_t *p_this, const char *psz_variable,
...
@@ -421,3 +427,65 @@ static int PopupMenuCB( vlc_object_t *p_this, const char *psz_variable,
ShowDialog
(
p_intf
,
INTF_DIALOG_POPUPMENU
,
new_val
.
b_bool
,
0
);
ShowDialog
(
p_intf
,
INTF_DIALOG_POPUPMENU
,
new_val
.
b_bool
,
0
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
/**
* Video output window provider
*/
#include <vlc_window.h>
static
int
ControlWindow
(
vout_window_t
*
,
int
,
va_list
);
static
int
OpenWindow
(
vlc_object_t
*
obj
)
{
vout_window_t
*
wnd
=
(
vout_window_t
*
)
obj
;
/* TODO: should probably be in the libvlc core instead: */
if
(
!
config_GetInt
(
obj
,
"embedded-video"
))
return
VLC_EGENERIC
;
intf_thread_t
*
intf
=
(
intf_thread_t
*
)
vlc_object_find_name
(
obj
,
"qt4"
,
FIND_ANYWHERE
);
if
(
intf
==
NULL
)
return
VLC_EGENERIC
;
/* Qt4 not in use */
assert
(
intf
->
i_object_type
==
VLC_OBJECT_INTF
);
var_Create
(
intf
,
"window_mutex"
,
VLC_VAR_MUTEX
);
var_Create
(
intf
,
"window_widget"
,
VLC_VAR_ADDRESS
);
vlc_value_t
lockval
,
ptrval
;
var_Get
(
intf
,
"window_mutex"
,
&
lockval
);
vlc_mutex_lock
((
vlc_mutex_t
*
)
lockval
.
p_address
);
msg_Dbg
(
obj
,
"waiting for interface..."
);
do
{
var_Get
(
intf
,
"window_widget"
,
&
ptrval
);
/* FIXME A condition variable would be way more appropriate. */
msleep
(
INTF_IDLE_SLEEP
);
}
while
(
ptrval
.
p_address
==
NULL
);
msg_Dbg
(
obj
,
"requestiong window..."
);
MainInterface
*
mi
=
(
MainInterface
*
)
ptrval
.
p_address
;
wnd
->
handle
=
mi
->
requestVideo
(
wnd
->
vout
,
&
wnd
->
pos_x
,
&
wnd
->
pos_y
,
&
wnd
->
width
,
&
wnd
->
height
);
vlc_mutex_unlock
((
vlc_mutex_t
*
)
lockval
.
p_address
);
wnd
->
control
=
ControlWindow
;
wnd
->
p_private
=
intf
;
return
VLC_SUCCESS
;
}
static
int
ControlWindow
(
vout_window_t
*
wnd
,
int
query
,
va_list
args
)
{
intf_thread_t
*
intf
=
(
intf_thread_t
*
)
wnd
->
p_private
;
intf
->
p_sys
->
p_mi
->
controlVideo
(
wnd
->
handle
,
query
,
args
);
}
static
void
CloseWindow
(
vlc_object_t
*
obj
)
{
vout_window_t
*
wnd
=
(
vout_window_t
*
)
obj
;
intf_thread_t
*
intf
=
(
intf_thread_t
*
)
obj
->
p_private
;
intf
->
p_sys
->
p_mi
->
releaseVideo
(
wnd
->
handle
);
vlc_object_release
(
intf
);
}
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