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
5ddebbf9
Commit
5ddebbf9
authored
Oct 12, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: emit video window resize events
parent
b5087f21
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
15 deletions
+39
-15
modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/components/interface_widgets.cpp
+20
-4
modules/gui/qt4/components/interface_widgets.hpp
modules/gui/qt4/components/interface_widgets.hpp
+5
-1
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.cpp
+7
-6
modules/gui/qt4/main_interface.hpp
modules/gui/qt4/main_interface.hpp
+6
-3
modules/gui/qt4/qt4.cpp
modules/gui/qt4/qt4.cpp
+1
-1
No files found.
modules/gui/qt4/components/interface_widgets.cpp
View file @
5ddebbf9
...
...
@@ -35,8 +35,6 @@
#include "menus.hpp"
/* Popup menu on bgWidget */
#include <vlc_vout.h>
#include <QLabel>
#include <QToolButton>
#include <QPalette>
...
...
@@ -64,6 +62,9 @@
#include <math.h>
#include <assert.h>
#include <vlc_vout.h>
#include <vlc_vout_window.h>
/**********************************************************************
* Video Widget. A simple frame on which video is drawn
* This class handles resize issues
...
...
@@ -78,6 +79,7 @@ VideoWidget::VideoWidget( intf_thread_t *_p_i )
layout
=
new
QHBoxLayout
(
this
);
layout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
stable
=
NULL
;
p_window
=
NULL
;
show
();
}
...
...
@@ -85,6 +87,7 @@ VideoWidget::~VideoWidget()
{
/* Ensure we are not leaking the video output. This would crash. */
assert
(
!
stable
);
assert
(
!
p_window
);
}
void
VideoWidget
::
sync
(
void
)
...
...
@@ -100,14 +103,16 @@ void VideoWidget::sync( void )
/**
* Request the video to avoid the conflicts
**/
WId
VideoWidget
::
request
(
unsigned
int
*
pi_width
,
unsigned
int
*
pi_height
,
bool
b_keep_size
)
WId
VideoWidget
::
request
(
struct
vout_window_t
*
p_wnd
,
unsigned
int
*
pi_width
,
unsigned
int
*
pi_height
,
bool
b_keep_size
)
{
if
(
stable
)
{
msg_Dbg
(
p_intf
,
"embedded video already in use"
);
return
0
;
}
assert
(
!
p_window
);
if
(
b_keep_size
)
{
*
pi_width
=
size
().
width
();
...
...
@@ -148,6 +153,7 @@ WId VideoWidget::request( unsigned int *pi_width, unsigned int *pi_height,
XSelectInput
(
dpy
,
w
,
attr
.
your_event_mask
);
#endif
sync
();
p_window
=
p_wnd
;
return
stable
->
winId
();
}
...
...
@@ -168,6 +174,15 @@ void VideoWidget::SetSizing( unsigned int w, unsigned int h )
sync
();
}
void
VideoWidget
::
resizeEvent
(
QResizeEvent
*
event
)
{
if
(
p_window
!=
NULL
)
vout_window_ReportSize
(
p_window
,
event
->
size
().
width
(),
event
->
size
().
height
()
);
QWidget
::
resizeEvent
(
event
);
}
void
VideoWidget
::
release
(
void
)
{
msg_Dbg
(
p_intf
,
"Video is not needed anymore"
);
...
...
@@ -177,6 +192,7 @@ void VideoWidget::release( void )
layout
->
removeWidget
(
stable
);
stable
->
deleteLater
();
stable
=
NULL
;
p_window
=
NULL
;
}
updateGeometry
();
...
...
modules/gui/qt4/components/interface_widgets.hpp
View file @
5ddebbf9
...
...
@@ -50,6 +50,7 @@ class QPixmap;
class
QHBoxLayout
;
class
QMenu
;
class
QSlider
;
struct
vout_window_t
;
/******************** Video Widget ****************/
class
VideoWidget
:
public
QFrame
...
...
@@ -59,7 +60,7 @@ public:
VideoWidget
(
intf_thread_t
*
);
virtual
~
VideoWidget
();
WId
request
(
unsigned
int
*
,
unsigned
int
*
,
bool
);
WId
request
(
struct
vout_window_t
*
,
unsigned
int
*
,
unsigned
int
*
,
bool
);
void
release
(
void
);
void
sync
(
void
);
...
...
@@ -69,8 +70,11 @@ protected:
return
NULL
;
}
virtual
void
resizeEvent
(
QResizeEvent
*
);
private:
intf_thread_t
*
p_intf
;
vout_window_t
*
p_window
;
QWidget
*
stable
;
QLayout
*
layout
;
...
...
modules/gui/qt4/main_interface.cpp
View file @
5ddebbf9
...
...
@@ -203,8 +203,8 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
/* VideoWidget connects for asynchronous calls */
b_videoFullScreen
=
false
;
connect
(
this
,
SIGNAL
(
askGetVideo
(
WId
*
,
unsigned
*
,
unsigned
*
)),
this
,
SLOT
(
getVideoSlot
(
WId
*
,
unsigned
*
,
unsigned
*
)),
connect
(
this
,
SIGNAL
(
askGetVideo
(
WId
*
,
struct
vout_window_t
*
,
unsigned
*
,
unsigned
*
)),
this
,
SLOT
(
getVideoSlot
(
WId
*
,
struct
vout_window_t
*
,
unsigned
*
,
unsigned
*
)),
Qt
::
BlockingQueuedConnection
);
connect
(
this
,
SIGNAL
(
askReleaseVideo
(
void
)),
this
,
SLOT
(
releaseVideoSlot
(
void
)),
...
...
@@ -681,7 +681,8 @@ void MainInterface::toggleFSC()
* All window provider queries must be handled through signals or events.
* That's why we have all those emit statements...
*/
WId
MainInterface
::
getVideo
(
unsigned
int
*
pi_width
,
unsigned
int
*
pi_height
)
WId
MainInterface
::
getVideo
(
struct
vout_window_t
*
p_wnd
,
unsigned
int
*
pi_width
,
unsigned
int
*
pi_height
)
{
if
(
!
videoWidget
)
return
0
;
...
...
@@ -689,11 +690,11 @@ WId MainInterface::getVideo( unsigned int *pi_width, unsigned int *pi_height )
/* This is a blocking call signal. Results are returned through pointers.
* Beware of deadlocks! */
WId
id
;
emit
askGetVideo
(
&
id
,
pi_width
,
pi_height
);
emit
askGetVideo
(
&
id
,
p
_wnd
,
p
i_width
,
pi_height
);
return
id
;
}
void
MainInterface
::
getVideoSlot
(
WId
*
p_id
,
void
MainInterface
::
getVideoSlot
(
WId
*
p_id
,
struct
vout_window_t
*
p_wnd
,
unsigned
*
pi_width
,
unsigned
*
pi_height
)
{
/* Hidden or minimized, activate */
...
...
@@ -701,7 +702,7 @@ void MainInterface::getVideoSlot( WId *p_id,
toggleUpdateSystrayMenu
();
/* Request the videoWidget */
WId
ret
=
videoWidget
->
request
(
pi_width
,
pi_height
,
!
b_autoresize
);
WId
ret
=
videoWidget
->
request
(
p
_wnd
,
p
i_width
,
pi_height
,
!
b_autoresize
);
*
p_id
=
ret
;
if
(
ret
)
/* The videoWidget is available */
{
...
...
modules/gui/qt4/main_interface.hpp
View file @
5ddebbf9
...
...
@@ -55,6 +55,7 @@ class QVBoxLayout;
class
QMenu
;
class
QSize
;
class
StandardPLPanel
;
struct
vout_window_t
;
class
MainInterface
:
public
QVLCMW
{
...
...
@@ -70,7 +71,8 @@ public:
static
const
QEvent
::
Type
ToolbarsNeedRebuild
;
/* Video requests from core */
WId
getVideo
(
unsigned
int
*
pi_width
,
unsigned
int
*
pi_height
);
WId
getVideo
(
struct
vout_window_t
*
,
unsigned
int
*
pi_width
,
unsigned
int
*
pi_height
);
void
releaseVideo
(
void
);
int
controlVideo
(
int
i_query
,
va_list
args
);
...
...
@@ -208,7 +210,8 @@ public slots:
#endif
/* Manage the Video Functions from the vout threads */
void
getVideoSlot
(
WId
*
p_id
,
unsigned
*
pi_width
,
unsigned
*
pi_height
);
void
getVideoSlot
(
WId
*
p_id
,
struct
vout_window_t
*
,
unsigned
*
pi_width
,
unsigned
*
pi_height
);
void
releaseVideoSlot
(
void
);
void
emitBoss
();
...
...
@@ -259,7 +262,7 @@ private slots:
void
continuePlayback
();
signals:
void
askGetVideo
(
WId
*
p_id
,
unsigned
*
pi_width
,
unsigned
*
pi_height
);
void
askGetVideo
(
WId
*
,
struct
vout_window_t
*
,
unsigned
*
,
unsigned
*
);
void
askReleaseVideo
(
);
void
askVideoToResize
(
unsigned
int
,
unsigned
int
);
void
askVideoSetFullScreen
(
bool
);
...
...
modules/gui/qt4/qt4.cpp
View file @
5ddebbf9
...
...
@@ -672,7 +672,7 @@ static int WindowOpen( vout_window_t *p_wnd, const vout_window_cfg_t *cfg )
unsigned
i_width
=
cfg
->
width
;
unsigned
i_height
=
cfg
->
height
;
WId
wid
=
p_mi
->
getVideo
(
&
i_width
,
&
i_height
);
WId
wid
=
p_mi
->
getVideo
(
p_wnd
,
&
i_width
,
&
i_height
);
if
(
!
wid
)
return
VLC_EGENERIC
;
...
...
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