Commit f66b8478 authored by Val Doroshchuk's avatar Val Doroshchuk

wo videooutput

parent 14e268cf
......@@ -63,15 +63,6 @@ void QGstreamerPipelinePrivate::updateMediaObject()
q->setMediaPlayer(obj);
}
void QGstreamerPipelinePrivate::updatePipeline(bool ready)
{
Q_Q(QGstreamerPipeline);
emit rendererIsReady(ready);
if (ready)
q->setPipeline(pendingPipelineDesc);
}
QGstreamerPipeline::QGstreamerPipeline(QObject *parent)
: QGstreamerPipeline(new QGstreamerPipelinePrivate(this), nullptr, parent)
{
......@@ -151,10 +142,12 @@ void QGstreamerPipeline::setMediaPlayer(QMediaPlayer *src)
connect(d->session, &QGstreamerPlayerSession::pipelineChanged,
this, &QGstreamerPipeline::pipelineChanged);
connect(d->session, &QGstreamerPlayerSession::rendererIsReady,
d, &QGstreamerPipelinePrivate::updatePipeline);
d, &QGstreamerPipelinePrivate::rendererIsReady);
d->mediaPlayer = src;
emit mediaPlayerChanged();
setPipeline(d->pendingPipelineDesc);
}
QString QGstreamerPipeline::pipeline() const
......
......@@ -76,9 +76,6 @@ public:
public Q_SLOTS:
void updateMediaObject();
private Q_SLOTS:
void updatePipeline(bool);
Q_SIGNALS:
void streamsChanged();
void rendererIsReady(bool);
......
......@@ -240,8 +240,6 @@ QGstreamerPlaybin::QGstreamerPlaybin(QMediaPlayer *media, QObject *parent)
d, &QGstreamerPlaybinPrivate::onMediaPlayerChanged);
connect(d, &QGstreamerPipelinePrivate::rendererIsReady,
d, &QGstreamerPlaybinPrivate::updatePlaybin);
d->onMediaPlayerChanged();
}
QGstreamerPlaybin::QGstreamerPlaybin(QObject *parent)
......
......@@ -68,6 +68,23 @@ Item {
signalName: "pipelineChanged"
}
MediaPlayer {
id: player2
autoPlay: false
loops: Audio.Infinite
}
Pipeline {
id: control2
source: player2
}
SignalSpy {
id: spyPipeline2
target: control2
signalName: "pipelineChanged"
}
TestCase {
name: "GstreamerPipelineControl"
......@@ -78,6 +95,7 @@ Item {
}
function test_pipeline() {
spyPipeline.clear();
var pp = "videotestsrc ! autovideosink";
control.pipeline = pp;
compare(spyPipeline.count, 1);
......@@ -85,10 +103,20 @@ Item {
}
function test_setProp() {
spyPipeline.clear();
control.pipeline = "videotestsrc name=src ! autovideosink";
compare(spyPipeline.count, 2);
compare(spyPipeline.count, 1);
control.set("src", {"num-buffers": 1});
compare(player.error, MediaPlayer.NoError);
}
function test_pipelineWithoutOutput() {
spyPipeline2.clear();
var pp = "videotestsrc ! autovideosink";
control2.pipeline = pp;
compare(spyPipeline2.count, 1);
compare(control2.pipeline, pp);
compare(player2.error, MediaPlayer.NoError);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment