You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2014/08/06 00:09:51 UTC

[1/3] git commit: ubuntu: support qt 5.2

Repository: cordova-plugin-media-capture
Updated Branches:
  refs/heads/master a6810a95a -> 3e3cac45b


ubuntu: support qt 5.2


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/commit/2407918f
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/tree/2407918f
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/diff/2407918f

Branch: refs/heads/master
Commit: 2407918f5db4e30844679ec197746850434b2c44
Parents: 1bef8d0
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Sat Jul 26 20:17:56 2014 +0400
Committer: Maxim Ermilov <ma...@canonical.com>
Committed: Sat Jul 26 20:17:56 2014 +0400

----------------------------------------------------------------------
 src/ubuntu/MediaCaptureWidget.qml |  3 +--
 src/ubuntu/capture.cpp            | 18 +++++++-----------
 src/ubuntu/capture.h              |  2 +-
 3 files changed, 9 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/blob/2407918f/src/ubuntu/MediaCaptureWidget.qml
----------------------------------------------------------------------
diff --git a/src/ubuntu/MediaCaptureWidget.qml b/src/ubuntu/MediaCaptureWidget.qml
index cf0b04c..98350fa 100644
--- a/src/ubuntu/MediaCaptureWidget.qml
+++ b/src/ubuntu/MediaCaptureWidget.qml
@@ -39,7 +39,6 @@ Rectangle {
     Camera {
         objectName: "camera"
         id: camera
-        cameraState: Camera.UnloadedState
         onError: {
             console.log(errorString);
             shootButton.source = recordOffImagePath
@@ -56,7 +55,7 @@ Rectangle {
             outputLocation: ui.parent.plugin('Capture').generateLocation("mp4")
             onRecorderStateChanged: {
                if (videoRecorder.recorderState === CameraRecorder.StoppedState) {
-                   ui.parent.exec("Capture", "onVideoRecordEnd", [camera.videoRecorder.actualLocation]);
+                   ui.parent.exec("Capture", "onVideoRecordEnd", [camera.videoRecorder.outputLocation]);
                    shootButton.source = recordOffImagePath
                }
             }

http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/blob/2407918f/src/ubuntu/capture.cpp
----------------------------------------------------------------------
diff --git a/src/ubuntu/capture.cpp b/src/ubuntu/capture.cpp
index cab4074..c18d289 100644
--- a/src/ubuntu/capture.cpp
+++ b/src/ubuntu/capture.cpp
@@ -28,7 +28,7 @@ function createObject() {                                               \
         component.statusChanged.connect(finishCreation);                \
 }                                                                       \
 function finishCreation() {                                             \
-    CordovaWrapper.captureObject = component.createObject(root,         \
+    CordovaWrapper.global.captureObject = component.createObject(root,         \
         {root: root, cordova: cordova, state: \"%2\"});                 \
 }                                                                       \
 createObject()";
@@ -58,7 +58,6 @@ void MediaCapture::captureAudio(int scId, int ecId, QVariantMap options) {
 
     QString path = m_cordova->get_app_dir() + "/../qml/MediaCaptureWidget.qml";
 
-    // TODO: relative url
     QString qml = QString(code).arg(CordovaInternal::format(path)).arg("audio");
     m_cordova->execQML(qml);
 
@@ -75,7 +74,7 @@ void MediaCapture::onAudioRecordError(QMediaRecorder::Error) {
     _recorder.clear();
     _files.clear();
 
-    m_cordova->execQML("CordovaWrapper.captureObject.destroy()");
+    m_cordova->execQML("CordovaWrapper.global.captureObject.destroy()");
 }
 
 void MediaCapture::recordAudio() {
@@ -90,7 +89,7 @@ void MediaCapture::recordAudio() {
         this->callback(_scId, QString("[%1]").arg(formatFile(_db, path)));
         _ecId = _scId = 0;
 
-        m_cordova->execQML("CordovaWrapper.captureObject.destroy()");
+        m_cordova->execQML("CordovaWrapper.global.captureObject.destroy()");
     } else {
         _recorder = QSharedPointer<QAudioRecorder>(new QAudioRecorder);
         QObject::connect(_recorder.data(), SIGNAL(error(QMediaRecorder::Error)), this, SLOT(onAudioRecordError(QMediaRecorder::Error)));
@@ -110,7 +109,7 @@ void MediaCapture::cancel() {
     if (!_ecId)
         return;
 
-    m_cordova->execQML("CordovaWrapper.captureObject.destroy()");
+    m_cordova->execQML("CordovaWrapper.global.captureObject.destroy()");
 
     _recorder.clear();
     this->callback(_ecId, QString("{code: %1}").arg(CAPTURE_NO_MEDIA_FILES));
@@ -126,8 +125,6 @@ void MediaCapture::captureVideo(int scId, int ecId, QVariantMap options) {
     }
 
     QString path = m_cordova->get_app_dir() + "/../qml/MediaCaptureWidget.qml";
-
-    // TODO: relative url
     QString qml = QString(code).arg(CordovaInternal::format(path)).arg("videoRecording");
     m_cordova->execQML(qml);
 
@@ -135,14 +132,13 @@ void MediaCapture::captureVideo(int scId, int ecId, QVariantMap options) {
     _ecId = ecId;
 }
 
-void MediaCapture::onVideoRecordEnd(QString path) {
-    assert(path.startsWith("file:"));
-    path = path.mid(5);
+void MediaCapture::onVideoRecordEnd(const QString &uri) {
+    QString path = QUrl::fromUserInput(uri).path();
 
     this->callback(_scId, QString("[%1]").arg(formatFile(_db, path)));
     _ecId = _scId = 0;
 
-    m_cordova->execQML("CordovaWrapper.captureObject.destroy()");
+    m_cordova->execQML("CordovaWrapper.global.captureObject.destroy()");
 }
 
 void MediaCapture::captureImage(int scId, int ecId, QVariantMap options) {

http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/blob/2407918f/src/ubuntu/capture.h
----------------------------------------------------------------------
diff --git a/src/ubuntu/capture.h b/src/ubuntu/capture.h
index 2c6caa4..4499dbe 100644
--- a/src/ubuntu/capture.h
+++ b/src/ubuntu/capture.h
@@ -49,7 +49,7 @@ public slots:
 
     void recordAudio();
     void cancel();
-    void onVideoRecordEnd(QString path);
+    void onVideoRecordEnd(const QString &uri);
     void onImageSaved(const QString &path);
 
     QString generateLocation(const QString &extension) {


[3/3] git commit: Merge branch 'master' of https://github.com/Zaspire/cordova-plugin-media-capture

Posted by st...@apache.org.
Merge branch 'master' of https://github.com/Zaspire/cordova-plugin-media-capture


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/commit/3e3cac45
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/tree/3e3cac45
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/diff/3e3cac45

Branch: refs/heads/master
Commit: 3e3cac45b84e8a90adf26de7263ac7322cb70e1f
Parents: a6810a9 139e280
Author: Steven Gill <st...@gmail.com>
Authored: Tue Aug 5 15:09:39 2014 -0700
Committer: Steven Gill <st...@gmail.com>
Committed: Tue Aug 5 15:09:39 2014 -0700

----------------------------------------------------------------------
 src/ubuntu/MediaCaptureWidget.qml |  3 +--
 src/ubuntu/capture.cpp            | 26 ++++++++++----------------
 src/ubuntu/capture.h              |  8 ++++----
 3 files changed, 15 insertions(+), 22 deletions(-)
----------------------------------------------------------------------



[2/3] git commit: ubuntu: fix compler warnings

Posted by st...@apache.org.
ubuntu: fix compler warnings


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/commit/139e2806
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/tree/139e2806
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/diff/139e2806

Branch: refs/heads/master
Commit: 139e2806939469a4f890c1465e7036c60c11659e
Parents: 2407918
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Sun Jul 27 00:50:14 2014 +0400
Committer: Maxim Ermilov <ma...@canonical.com>
Committed: Sun Jul 27 00:50:14 2014 +0400

----------------------------------------------------------------------
 src/ubuntu/capture.cpp | 8 +++-----
 src/ubuntu/capture.h   | 6 +++---
 2 files changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/blob/139e2806/src/ubuntu/capture.cpp
----------------------------------------------------------------------
diff --git a/src/ubuntu/capture.cpp b/src/ubuntu/capture.cpp
index c18d289..aaf0910 100644
--- a/src/ubuntu/capture.cpp
+++ b/src/ubuntu/capture.cpp
@@ -50,7 +50,7 @@ static QString formatFile(const QMimeDatabase &db, const QString &path) {
 MediaCapture::MediaCapture(Cordova *cordova): CPlugin(cordova), _scId(0), _ecId(0) {
 }
 
-void MediaCapture::captureAudio(int scId, int ecId, QVariantMap options) {
+void MediaCapture::captureAudio(int scId, int ecId, const QVariantMap &) {
     if (_scId || _ecId) {
         this->callback(_ecId, QString("{code: %1}").arg(CAPTURE_APPLICATION_BUSY));
         return;
@@ -118,7 +118,7 @@ void MediaCapture::cancel() {
     _recorder.clear();
 }
 
-void MediaCapture::captureVideo(int scId, int ecId, QVariantMap options) {
+void MediaCapture::captureVideo(int scId, int ecId, const QVariantMap &) {
     if (_scId || _ecId) {
         this->callback(_ecId, QString("{code: %1}").arg(CAPTURE_APPLICATION_BUSY));
         return;
@@ -141,15 +141,13 @@ void MediaCapture::onVideoRecordEnd(const QString &uri) {
     m_cordova->execQML("CordovaWrapper.global.captureObject.destroy()");
 }
 
-void MediaCapture::captureImage(int scId, int ecId, QVariantMap options) {
+void MediaCapture::captureImage(int scId, int ecId, const QVariantMap &) {
     if (_scId || _ecId) {
         this->callback(_ecId, QString("{code: %1}").arg(CAPTURE_APPLICATION_BUSY));
         return;
     }
 
     QString path = m_cordova->get_app_dir() + "/../qml/MediaCaptureWidget.qml";
-
-    // TODO: relative url
     QString qml = QString(code).arg(CordovaInternal::format(path)).arg("camera");
     m_cordova->execQML(qml);
 

http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/blob/139e2806/src/ubuntu/capture.h
----------------------------------------------------------------------
diff --git a/src/ubuntu/capture.h b/src/ubuntu/capture.h
index 4499dbe..4806771 100644
--- a/src/ubuntu/capture.h
+++ b/src/ubuntu/capture.h
@@ -43,9 +43,9 @@ public:
     }
 
 public slots:
-    void captureAudio(int scId, int ecId, QVariantMap options);
-    void captureImage(int scId, int ecId, QVariantMap options);
-    void captureVideo(int scId, int ecId, QVariantMap options);
+    void captureAudio(int scId, int ecId, const QVariantMap &);
+    void captureImage(int scId, int ecId, const QVariantMap &);
+    void captureVideo(int scId, int ecId, const QVariantMap &);
 
     void recordAudio();
     void cancel();