Commit f66b8478 authored by Val Doroshchuk's avatar Val Doroshchuk

wo videooutput

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