Skip to content

Commit bf0e76b

Browse files
committed
Several fixes and improvements.
1 parent f8f23b2 commit bf0e76b

39 files changed

+1083
-195
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
tools/build*
22
*.pro.user*
3-
3rdparty
3+
3rdparty*
44
3rdparty/*
55
openmaxil_backend/3rdparty/*
66
piomxtextures_qt_driver/mediaplayer/.qmake.conf

piomxtextures_lib/piomxtextures_lib.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
TEMPLATE = lib
2525

26-
VERSION = 5.0.0
26+
VERSION = 5.1.0
2727

2828
QT += core core-private gui gui-private opengl quick quick-private
2929
CONFIG += no_private_qt_headers_warning

piomxtextures_pocplayer/qml/POC_ControlBarVideo.qml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ POC_ControlBar {
4040
Layout.fillWidth: true
4141
maximumValue: 1.0
4242
minimumValue: 0.0
43-
stepSize: 0.01
44-
value: videoOutputSurface.position/videoOutputSurface.duration;
43+
stepSize: 0.0001
44+
value:
45+
mediaPlayer.position/mediaPlayer.duration;
4546
updateValueWhileDragging: false
4647

4748
// NOTE: Remember to avoid seeking on value changed. That will result in

piomxtextures_qt_driver/mediaplayer/openmaxilmetadataprovider.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
/*------------------------------------------------------------------------------
2525
| includes
2626
+-----------------------------------------------------------------------------*/
27-
#include <lc_logging.h>
27+
#include <QDate>
2828

29-
#include "QtCore/QDate"
29+
#include "omx_logging.h"
3030

3131
#include "qmediametadata.h"
3232
#include "openmaxilmetadataprovider.h"

piomxtextures_qt_driver/mediaplayer/openmaxilplayercontrol.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@
5555
| definitions
5656
+-----------------------------------------------------------------------------*/
5757
//#define DEBUG_PLAYBIN
58-
#define DEBUG_PLAYER_CONTROL
58+
//#define DEBUG_PLAYER_CONTROL
5959

6060
#ifndef DEBUG_PLAYER_CONTROL
6161
#ifdef LOG_DEBUG
6262
#undef LOG_DEBUG
63-
#define LOG_DEBUG(...) {(void)0}
63+
#define LOG_DEBUG(...) {(void)0;}
6464
#endif // LOG_DEBUG
6565
#else
66-
#include <lc_logging.h>
66+
#include <omx_logging.h>
6767
#endif // DEBUG_PLAYER_CONTROL
6868

6969

piomxtextures_qt_driver/mediaplayer/openmaxilplayercontrol.h

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727
/*------------------------------------------------------------------------------
2828
| includes
2929
+-----------------------------------------------------------------------------*/
30-
#include <QtCore/qobject.h>
31-
#include <QtCore/qstack.h>
32-
#include <QtCore/qsemaphore.h>
33-
#include <QtCore/qmutex.h>
30+
#include <QObject>
31+
#include <QStack>
32+
#include <QSemaphore>
33+
#include <QMutex>
3434
#include <QQuickItem>
35-
36-
#include <qmediacontent.h>
37-
#include <qmediaplayer.h>
38-
#include <qmediaplayercontrol.h>
35+
#include <QMediaContent>
36+
#include <QMediaPlayer>
37+
#include <QMediaPlayerControl>
38+
#include <QTimer>
3939

4040
#include <limits.h>
4141

@@ -125,9 +125,10 @@ private slots:
125125
const OMX_MediaProcessor::OMX_MediaStatus& status) const;
126126

127127
bool m_ownStream;
128-
129128
bool m_seekToStartPending;
129+
130130
qint64 m_pendingSeekPosition;
131+
131132
QMediaContent m_currentResource;
132133

133134
OMX_EGLBufferProviderSh m_texProvider;

piomxtextures_qt_driver/mediaplayer/openmaxilplayerserviceplugin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include "openmaxilplayerserviceplugin.h"
3333
#include "openmaxilplayerservice.h"
3434

35-
#include "lc_logging.h"
35+
#include "omx_logging.h"
3636

3737
/*------------------------------------------------------------------------------
3838
| OMX_PlayerServicePlugin::create

piomxtextures_qt_driver/mediaplayer/openmaxilvideorenderercontrol.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,12 @@ void OpenMAXILVideoRendererControl::onTexturesReady()
205205
QVideoFrame::Format_RGB565,
206206
QAbstractVideoBuffer::GLTextureHandle
207207
);
208+
209+
// This is needed to force an update of the surface format int the
210+
// following refresh.
211+
if (m_surface)
212+
if (m_surface->isActive())
213+
m_surface->stop();
208214
}
209215

210216
/*------------------------------------------------------------------------------

piomxtextures_samples/piomxtextures_samples.pro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ OTHER_FILES += video_*
3030
DISTFILES += \
3131
audio_simple.qml \
3232
video_concurrent.qml \
33-
video_loop.qml
33+
video_loop.qml \
34+
video_loop_position.qml
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
/*
2+
* Project: PiOmxTextures
3+
* Author: Luca Carlon
4+
* Date: 08.08.2015
5+
*
6+
* Copyright (c) 2012-2015 Luca Carlon. All rights reserved.
7+
*
8+
* This file is part of PiOmxTextures.
9+
*
10+
* PiOmxTextures is free software: you can redistribute it and/or modify
11+
* it under the terms of the GNU General Public License as published by
12+
* the Free Software Foundation, either version 3 of the License, or
13+
* (at your option) any later version.
14+
*
15+
* PiOmxTextures is distributed in the hope that it will be useful,
16+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
* GNU General Public License for more details.
19+
*
20+
* You should have received a copy of the GNU General Public License
21+
* along with PiOmxTextures. If not, see <http://www.gnu.org/licenses/>.
22+
*/
23+
24+
import QtQuick 2.0
25+
import QtQml 2.2
26+
import QtMultimedia 5.0
27+
28+
Rectangle {
29+
property var videoUris: []
30+
property var audioUris: []
31+
property int videoIndex: 0
32+
property int audioIndex: 0
33+
34+
color: "red"
35+
36+
Component.onCompleted: {
37+
var arguments = Qt.application.arguments;
38+
if (arguments.length < 6) {
39+
console.log("Too few arguments.");
40+
Qt.quit();
41+
}
42+
43+
videoUris.push(arguments[2]);
44+
videoUris.push(arguments[3]);
45+
audioUris.push(arguments[4]);
46+
audioUris.push(arguments[5]);
47+
48+
nextVideo(video1);
49+
nextVideo(video2);
50+
nextAudio(audio);
51+
}
52+
53+
Video {
54+
id: video1
55+
width: 500
56+
height: 450
57+
x: parent.width/3 - width/2
58+
y: parent.height/2 - height/2
59+
autoPlay: false
60+
onStopped: nextVideo(video1)
61+
}
62+
63+
Video {
64+
id: video2
65+
width: 500
66+
height: 450
67+
x: parent.width/3*2 - width/2
68+
y: parent.height/2 - height/2
69+
autoPlay: false
70+
onStopped: nextVideo(video2)
71+
}
72+
73+
Audio {
74+
id: audio
75+
source: uri3
76+
autoPlay: false
77+
onStopped: nextAudio(audio)
78+
}
79+
80+
//Timer {
81+
// interval: 500
82+
// running: true; repeat: true
83+
// onTriggered: {
84+
// console.log("Position video1: " + video1.position + ".");
85+
// console.log("Position video2: " + video2.position + ".");
86+
// console.log("Position audio: " + audio.position + ".");
87+
// }
88+
//}
89+
90+
Timer {
91+
interval: 5000
92+
running: true; repeat: true
93+
onTriggered: {
94+
console.log("Switching audio...");
95+
audio.stop();
96+
}
97+
}
98+
99+
function nextVideo(element) {
100+
element.source = videoUris[videoIndex++%2];
101+
element.play();
102+
}
103+
104+
function nextAudio(element) {
105+
element.source = audioUris[audioIndex++%2];
106+
element.play();
107+
}
108+
}

0 commit comments

Comments
 (0)