Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Val Doroshchuk
qtgstreamerextras
Commits
1a4d0d41
Commit
1a4d0d41
authored
May 25, 2018
by
Val Doroshchuk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add hole punching
parent
b7cb7917
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
198 additions
and
1 deletion
+198
-1
.gitignore
.gitignore
+1
-1
.qmake.conf
.qmake.conf
+3
-0
src/gstreamerextras/playback/qgstreamermediaplayer.cpp
src/gstreamerextras/playback/qgstreamermediaplayer.cpp
+8
-0
src/gstreamerextras/playback/qgstreamermediaplayer.h
src/gstreamerextras/playback/qgstreamermediaplayer.h
+2
-0
src/plugins/plugins.pro
src/plugins/plugins.pro
+2
-0
src/plugins/video/transparentvideobackend/qtransparentvideobackend.cpp
...ideo/transparentvideobackend/qtransparentvideobackend.cpp
+98
-0
src/plugins/video/transparentvideobackend/qtransparentvideobackend.h
.../video/transparentvideobackend/qtransparentvideobackend.h
+59
-0
src/plugins/video/transparentvideobackend/transparentvideobackend.json
...ideo/transparentvideobackend/transparentvideobackend.json
+4
-0
src/plugins/video/transparentvideobackend/transparentvideobackend.pro
...video/transparentvideobackend/transparentvideobackend.pro
+14
-0
src/plugins/video/video.pro
src/plugins/video/video.pro
+3
-0
src/src.pro
src/src.pro
+4
-0
No files found.
.gitignore
View file @
1a4d0d41
...
...
@@ -31,7 +31,7 @@ src/gstreamer/qtgstreamerversion.h
QtGstreamer.version*
*-config*
config.*
.qmake
*
.qmake
.cache
.pch
uic_*
*_wrapper.sh
...
...
.qmake.conf
0 → 100644
View file @
1a4d0d41
load
(
qt_build_config
)
MODULE_VERSION
=
5
.
12
.
0
src/gstreamerextras/playback/qgstreamermediaplayer.cpp
View file @
1a4d0d41
...
...
@@ -355,5 +355,13 @@ QVariantMap QGstreamerMediaPlayer::textStreamProperties(int i)
return
d
->
session
?
d
->
session
->
textStreamProperties
(
i
)
:
QVariantMap
();
}
void
QGstreamerMediaPlayer
::
set
(
const
QString
&
elementName
,
const
QVariantMap
&
map
)
{
Q_D
(
QGstreamerMediaPlayer
);
if
(
d
->
session
)
d
->
session
->
setGstProperties
(
elementName
,
map
);
}
#include "moc_qgstreamermediaplayer.cpp"
QT_END_NAMESPACE
src/gstreamerextras/playback/qgstreamermediaplayer.h
View file @
1a4d0d41
...
...
@@ -101,6 +101,8 @@ public:
void
setTextStream
(
int
i
);
Q_INVOKABLE
QVariantMap
textStreamProperties
(
int
i
);
Q_INVOKABLE
void
set
(
const
QString
&
elementName
,
const
QVariantMap
&
map
);
Q_SIGNALS:
void
sourceChanged
();
void
mediaObjectChanged
();
...
...
src/plugins/plugins.pro
View file @
1a4d0d41
TEMPLATE
=
subdirs
SUBDIRS
+=
video
src/plugins/video/transparentvideobackend/qtransparentvideobackend.cpp
0 → 100644
View file @
1a4d0d41
/****************************************************************************
**
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qtransparentvideobackend.h"
#include <private/qdeclarativevideooutput_render_p.h>
#include <private/qquickwindow_p.h>
#include <private/qsgadaptationlayer_p.h>
#include <private/qdeclarativevideooutput_p.h>
class
QTransparentVideoRendererBackend
:
public
QDeclarativeVideoRendererBackend
{
public:
QTransparentVideoRendererBackend
(
QDeclarativeVideoOutput
*
parent
)
:
QDeclarativeVideoRendererBackend
(
parent
)
{}
void
itemChange
(
QQuickItem
::
ItemChange
change
,
const
QQuickItem
::
ItemChangeData
&
changeData
)
override
;
QSGNode
*
updatePaintNode
(
QSGNode
*
oldNode
,
QQuickItem
::
UpdatePaintNodeData
*
data
)
override
;
private:
QSGContext
*
m_context
=
nullptr
;
};
void
QTransparentVideoRendererBackend
::
itemChange
(
QQuickItem
::
ItemChange
change
,
const
QQuickItem
::
ItemChangeData
&
changeData
)
{
Q_UNUSED
(
change
);
if
(
!
changeData
.
window
)
return
;
m_context
=
static_cast
<
QQuickWindowPrivate
*>
(
QObjectPrivate
::
get
(
changeData
.
window
))
->
context
->
sceneGraphContext
();
QSurfaceFormat
fmt
=
changeData
.
window
->
requestedFormat
();
if
(
fmt
.
alphaBufferSize
()
!=
8
)
{
fmt
.
setAlphaBufferSize
(
8
);
changeData
.
window
->
setFormat
(
fmt
);
}
}
QSGNode
*
QTransparentVideoRendererBackend
::
updatePaintNode
(
QSGNode
*
oldNode
,
QQuickItem
::
UpdatePaintNodeData
*
data
)
{
Q_UNUSED
(
data
);
if
(
!
m_context
)
return
nullptr
;
QSGInternalRectangleNode
*
rect
=
static_cast
<
QSGInternalRectangleNode
*>
(
oldNode
);
if
(
!
rect
)
rect
=
m_context
->
createInternalRectangleNode
();
rect
->
setColor
(
QColor
(
0
,
0
,
0
,
0
));
rect
->
setRect
(
QRectF
(
0
,
0
,
q
->
width
(),
q
->
height
()));
rect
->
update
();
return
rect
;
}
QDeclarativeVideoBackend
*
QTransparentVideoNodeBackend
::
create
(
QDeclarativeVideoOutput
*
parent
)
{
return
parent
->
punchHole
()
?
new
QTransparentVideoRendererBackend
(
parent
)
:
nullptr
;
}
src/plugins/video/transparentvideobackend/qtransparentvideobackend.h
0 → 100644
View file @
1a4d0d41
/****************************************************************************
**
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QTRANSPARENTVIDEOBACKEND_H
#define QTRANSPARENTVIDEOBACKEND_H
#include <private/qdeclarativevideooutput_backend_p.h>
QT_BEGIN_NAMESPACE
class
QTransparentVideoNodeBackend
:
public
QObject
,
public
QDeclarativeVideoBackendFactoryInterface
{
Q_OBJECT
Q_INTERFACES
(
QDeclarativeVideoBackendFactoryInterface
)
Q_PLUGIN_METADATA
(
IID
"org.qt-project.qt.declarativevideobackendfactory/5.2"
FILE
"transparentvideobackend.json"
)
public:
QDeclarativeVideoBackend
*
create
(
QDeclarativeVideoOutput
*
parent
)
override
;
};
QT_END_NAMESPACE
#endif
src/plugins/video/transparentvideobackend/transparentvideobackend.json
0 → 100644
View file @
1a4d0d41
{
"Keys"
:
[
"transparentvideobackend"
],
"Services"
:
[
"declarativevideobackend"
]
}
src/plugins/video/transparentvideobackend/transparentvideobackend.pro
0 → 100644
View file @
1a4d0d41
TARGET
=
transparentvideobackend
QT
+=
qtmultimediaquicktools
-
private
quick
-
private
HEADERS
+=
\
qtransparentvideobackend
.
h
SOURCES
+=
\
qtransparentvideobackend
.
cpp
PLUGIN_TYPE
=
video
/
declarativevideobackend
PLUGIN_EXTENDS
=
quick
PLUGIN_CLASS_NAME
=
QTransparentVideoNodeBackend
load
(
qt_plugin
)
src/plugins/video/video.pro
0 → 100644
View file @
1a4d0d41
TEMPLATE
=
subdirs
SUBDIRS
+=
transparentvideobackend
src/src.pro
View file @
1a4d0d41
...
...
@@ -9,3 +9,7 @@ qtHaveModule(quick):qtConfig(opengl) {
SUBDIRS
+=
\
src_imports
}
src_plugins
.
subdir
=
plugins
SUBDIRS
+=
src_plugins
\ No newline at end of file
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