diff options
author | Yoann Lopes <yoann.lopes@digia.com> | 2014-07-01 12:34:58 +0200 |
---|---|---|
committer | Yoann Lopes <yoann.lopes@digia.com> | 2014-07-03 15:49:53 +0200 |
commit | fbd57c983d512fdc9fda81432ae28e2e9bb6d6e4 (patch) | |
tree | 2dff879c2faff9555cecc7b6c2c8dfbd57426322 /src/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp | |
parent | a7f924186c6cbb98ccf9be7e62ecb1eabb022703 (diff) |
GStreamer: correctly handle URLs from QMediaRecorder::setOutputLocation
Task-number: QTBUG-39949
Change-Id: Idf575b126bd3531655c8abda55c9e04149a4fb85
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
Diffstat (limited to 'src/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp')
-rw-r--r-- | src/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp b/src/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp index 518a66bc0..b9114c68d 100644 --- a/src/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp +++ b/src/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp @@ -134,8 +134,10 @@ GstElement *QGstreamerCaptureSession::buildEncodeBin() return 0; } + // Output location was rejected in setOutputlocation() if not a local file + QUrl actualSink = QUrl::fromLocalFile(QDir::currentPath()).resolved(m_sink); GstElement *fileSink = gst_element_factory_make("filesink", "filesink"); - g_object_set(G_OBJECT(fileSink), "location", m_sink.toString().toLocal8Bit().constData(), NULL); + g_object_set(G_OBJECT(fileSink), "location", QFile::encodeName(actualSink.toLocalFile()).constData(), NULL); gst_bin_add_many(GST_BIN(encodeBin), muxer, fileSink, NULL); if (!gst_element_link(muxer, fileSink)) { @@ -731,6 +733,11 @@ QUrl QGstreamerCaptureSession::outputLocation() const bool QGstreamerCaptureSession::setOutputLocation(const QUrl& sink) { + if (!sink.isRelative() && !sink.isLocalFile()) { + qWarning("Output location must be a local file"); + return false; + } + m_sink = sink; return true; } |