From ad698f49d1e2aa8984f4569ebf5c598238fa4691 Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Wed, 28 Sep 2016 16:41:44 +0300 Subject: Pass the context to QtAndroidMediaPlayer This way it can be used in a service Task-number: QTBUG-54506 Change-Id: I2d75b69dfbf7b345322f7625baf544af2af200c5 Reviewed-by: Christian Stromme --- .../qt5/android/multimedia/QtAndroidMediaPlayer.java | 11 +++++------ src/plugins/android/src/wrappers/jni/androidmediaplayer.cpp | 5 +++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/plugins/android/jar/src/org/qtproject/qt5/android/multimedia/QtAndroidMediaPlayer.java b/src/plugins/android/jar/src/org/qtproject/qt5/android/multimedia/QtAndroidMediaPlayer.java index d0983d38a..2a66fa2c4 100644 --- a/src/plugins/android/jar/src/org/qtproject/qt5/android/multimedia/QtAndroidMediaPlayer.java +++ b/src/plugins/android/jar/src/org/qtproject/qt5/android/multimedia/QtAndroidMediaPlayer.java @@ -44,7 +44,6 @@ import java.lang.String; import java.io.FileInputStream; // API is level is < 9 unless marked otherwise. -import android.app.Activity; import android.content.Context; import android.media.MediaPlayer; import android.net.Uri; @@ -68,7 +67,7 @@ public class QtAndroidMediaPlayer private MediaPlayer mMediaPlayer = null; private Uri mUri = null; private final long mID; - private final Activity mActivity; + private final Context mContext; private boolean mMuted = false; private int mVolume = 100; private static final String TAG = "Qt MediaPlayer"; @@ -207,10 +206,10 @@ public class QtAndroidMediaPlayer } - public QtAndroidMediaPlayer(final Activity activity, final long id) + public QtAndroidMediaPlayer(final Context context, final long id) { mID = id; - mActivity = activity; + mContext = context; } private void setState(int state) @@ -363,7 +362,7 @@ public class QtAndroidMediaPlayer final boolean inAssets = (mUri.getScheme().compareTo("assets") == 0); if (inAssets) { final String asset = mUri.getPath().substring(1 /* Remove first '/' */); - final AssetManager am = mActivity.getAssets(); + final AssetManager am = mContext.getAssets(); afd = am.openFd(asset); final long offset = afd.getStartOffset(); final long length = afd.getLength(); @@ -374,7 +373,7 @@ public class QtAndroidMediaPlayer FileDescriptor fd = fis.getFD(); mMediaPlayer.setDataSource(fd); } else { - mMediaPlayer.setDataSource(mActivity, mUri); + mMediaPlayer.setDataSource(mContext, mUri); } setState(State.Initialized); } catch (final IOException e) { diff --git a/src/plugins/android/src/wrappers/jni/androidmediaplayer.cpp b/src/plugins/android/src/wrappers/jni/androidmediaplayer.cpp index f65d6aade..582d8aa9d 100644 --- a/src/plugins/android/src/wrappers/jni/androidmediaplayer.cpp +++ b/src/plugins/android/src/wrappers/jni/androidmediaplayer.cpp @@ -57,10 +57,11 @@ AndroidMediaPlayer::AndroidMediaPlayer() : QObject() { QWriteLocker locker(rwLock); + auto context = QtAndroidPrivate::activity() ? QtAndroidPrivate::activity() : QtAndroidPrivate::service(); const jlong id = reinterpret_cast(this); mMediaPlayer = QJNIObjectPrivate(QtAndroidMediaPlayerClassName, - "(Landroid/app/Activity;J)V", - QtAndroidPrivate::activity(), + "(Landroid/content/Context;J)V", + context, id); mediaPlayers->append(this); } -- cgit v1.2.1 From e4aef963cbd32274669af6b66158f6f0ca4ba3ed Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Fri, 21 Oct 2016 14:36:09 +0300 Subject: Add changes file for 5.7.1 Change-Id: Icdbdc8c58c331dffd4f8dd4a05ec986ed4b9d159 Reviewed-by: Yoann Lopes --- dist/changes-5.7.1 | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 dist/changes-5.7.1 diff --git a/dist/changes-5.7.1 b/dist/changes-5.7.1 new file mode 100644 index 000000000..d7cf4709b --- /dev/null +++ b/dist/changes-5.7.1 @@ -0,0 +1,34 @@ +Qt 5.7.1 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.7.0. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +http://doc.qt.io/qt-5/index.html + +The Qt version 5.7 series is binary compatible with the 5.6.x series. +Applications compiled for 5.6 will continue to run with 5.7. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* Platform Specific Changes * +**************************************************************************** + +Android +------- + + - QCamera::setViewfinderSettings() and all the related functions to query + the supported viewfinder settings are now functional. + +WinRT +----- + + - [QTBUG-55894] The QIODevice passed to a QAudioInput / QAudioOutput is + now written / read from the same thread it was created in. -- cgit v1.2.1