Commit ed44454c authored by Val Doroshchuk's avatar Val Doroshchuk

widget renderer

parent ed294e59
......@@ -77,13 +77,12 @@ public Q_SLOTS:
protected:
QPointer<QObject> source;
QPointer<QMediaObject> mediaObject;
QGstreamerVideoRenderer *renderer = nullptr;
QGstreamerVideoRendererInterface *renderer = nullptr;
QGstreamerPlayerSession *session = nullptr;
GstElement *playbin = nullptr;
QString pipelineDesc;
QString pendingPipelineDesc;
//GstElement *pipeline = nullptr;
QString videoSinkDesc;
QString pendingVideoSinkDesc;
......@@ -220,7 +219,9 @@ void QGstreamerMediaPlayerPrivate::updatePipeline()
return;
if (!pendingPipelineDesc.isEmpty()) {
QGstVideoRendererSink::setSurface(renderer->surface());
auto videoRenderer = static_cast<QGstreamerVideoRenderer *>(renderer);
if (videoRenderer)
QGstVideoRendererSink::setSurface(videoRenderer->surface());
GstElement *pipeline = parseDesc(pendingPipelineDesc);
if (pipeline) {
pipelineDesc = pendingPipelineDesc;
......@@ -306,7 +307,7 @@ void QGstreamerMediaPlayer::setMediaObject(QMediaObject *src)
connect(d->session, &QGstreamerPlayerSession::rendererChanged,
[d](QGstreamerVideoRendererInterface *r) {
d->renderer = static_cast<QGstreamerVideoRenderer *>(r);
d->renderer = r;
// Set pipeline when surface is ready.
d->updatePipeline();
});
......
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