diff options
-rw-r--r-- | src/gsttools/qgstreamerplayercontrol.cpp | 6 | ||||
-rw-r--r-- | src/gsttools/qgstvideorenderersink.cpp | 13 | ||||
-rw-r--r-- | src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp | 5 |
3 files changed, 18 insertions, 6 deletions
diff --git a/src/gsttools/qgstreamerplayercontrol.cpp b/src/gsttools/qgstreamerplayercontrol.cpp index 165978288..d65102e2f 100644 --- a/src/gsttools/qgstreamerplayercontrol.cpp +++ b/src/gsttools/qgstreamerplayercontrol.cpp @@ -439,8 +439,10 @@ void QGstreamerPlayerControl::updateSessionState(QMediaPlayer::State state) } m_pendingSeekPosition = -1; - if (m_currentState == QMediaPlayer::PlayingState) - m_session->play(); + if (m_currentState == QMediaPlayer::PlayingState) { + if (m_mediaStatus == QMediaPlayer::BufferedMedia) + m_session->play(); + } } updateMediaStatus(); diff --git a/src/gsttools/qgstvideorenderersink.cpp b/src/gsttools/qgstvideorenderersink.cpp index 9eb2531a1..4000f2178 100644 --- a/src/gsttools/qgstvideorenderersink.cpp +++ b/src/gsttools/qgstvideorenderersink.cpp @@ -141,6 +141,19 @@ bool QGstDefaultVideoRenderer::present(QAbstractVideoSurface *surface, GstBuffer if (!videoBuffer) videoBuffer = new QGstVideoBuffer(buffer, m_videoInfo); + auto meta = gst_buffer_get_video_crop_meta (buffer); + if (meta) { + QRect vp(meta->x, meta->y, meta->width, meta->height); + if (m_format.viewport() != vp) { +#ifdef DEBUG_VIDEO_SURFACE_SINK + qDebug() << Q_FUNC_INFO << " Update viewport on Metadata: [" << meta->height << "x" << meta->width << " | " << meta->x << "x" << meta->y << "]"; +#endif + //Update viewport if data is not the same + m_format.setViewport(vp); + surface->start(m_format); + } + } + QVideoFrame frame( videoBuffer, m_format.frameSize(), diff --git a/src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp b/src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp index 52ec75f44..b164bc31a 100644 --- a/src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp @@ -366,12 +366,9 @@ bool CameraBinImageCapture::processBusMessage(const QGstreamerMessage &message) #ifdef DEBUG_CAPTURE qDebug() << Q_FUNC_INFO << "Dropped saving file" << fileName; #endif - //camerabin creates an empty file when captured buffer is dropped, - //let's remove it QFileInfo info(QString::fromUtf8(fileName)); - if (info.exists() && info.isFile() && info.size() == 0) { + if (info.exists() && info.isFile()) QFile(info.absoluteFilePath()).remove(); - } } } } |