From d420674edd1d2bf5f327aceb9eeefaf26024d7a6 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 27 Jan 2015 14:50:02 -0800 Subject: [PATCH 1/4] apply orientation change to listening position for audio --- cmake/android/AndroidManifest.xml.in | 2 +- gvr-interface/CMakeLists.txt | 1 + gvr-interface/src/Client.cpp | 4 +++ gvr-interface/src/GVRInterface.cpp | 2 +- gvr-interface/src/RenderingClient.cpp | 1 - .../gvrinterface/InterfaceActivity.java | 25 +++++++++++++++++++ interface/src/Application.cpp | 1 - libraries/networking/src/AccountManager.cpp | 2 -- 8 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 gvr-interface/src/java/io/highfidelity/gvrinterface/InterfaceActivity.java diff --git a/cmake/android/AndroidManifest.xml.in b/cmake/android/AndroidManifest.xml.in index 2459627f50..39c97a6608 100755 --- a/cmake/android/AndroidManifest.xml.in +++ b/cmake/android/AndroidManifest.xml.in @@ -9,7 +9,7 @@ +#include #include #include #include @@ -28,6 +29,9 @@ Client::Client(QObject* parent) : } void Client::setupNetworking() { + // once Application order of instantiation is fixed this should be done from AccountManager + AccountManager::getInstance().setAuthURL(DEFAULT_NODE_AUTH_URL); + // setup the NodeList for this client DependencyManager::registerInheritance(); auto nodeList = DependencyManager::set(NodeType::Agent, 0); diff --git a/gvr-interface/src/GVRInterface.cpp b/gvr-interface/src/GVRInterface.cpp index 1101325823..1a18529793 100644 --- a/gvr-interface/src/GVRInterface.cpp +++ b/gvr-interface/src/GVRInterface.cpp @@ -79,7 +79,7 @@ void GVRInterface::idle() { auto ovrOrientation = sensor.Predicted.Pose.Orientation; glm::quat newOrientation(ovrOrientation.w, ovrOrientation.x, ovrOrientation.y, ovrOrientation.z); - // _client->setOrientation(newOrientation); + _client->setOrientation(newOrientation); if (counter++ % 100000 == 0) { qDebug() << "GetSensorState in frame" << counter << "-" diff --git a/gvr-interface/src/RenderingClient.cpp b/gvr-interface/src/RenderingClient.cpp index 5683c8e01e..3113cbf838 100644 --- a/gvr-interface/src/RenderingClient.cpp +++ b/gvr-interface/src/RenderingClient.cpp @@ -74,7 +74,6 @@ void RenderingClient::processVerifiedPacket(const HifiSockAddr& senderSockAddr, Qt::QueuedConnection, Q_ARG(QByteArray, incomingPacket)); } else { - qDebug() << "Processing received audio of" << incomingPacket.size(); QMetaObject::invokeMethod(DependencyManager::get().data(), "addReceivedAudioToStream", Qt::QueuedConnection, Q_ARG(QByteArray, incomingPacket)); diff --git a/gvr-interface/src/java/io/highfidelity/gvrinterface/InterfaceActivity.java b/gvr-interface/src/java/io/highfidelity/gvrinterface/InterfaceActivity.java new file mode 100644 index 0000000000..be4d42e725 --- /dev/null +++ b/gvr-interface/src/java/io/highfidelity/gvrinterface/InterfaceActivity.java @@ -0,0 +1,25 @@ +// +// InterfaceActivity.java +// gvr-interface/java +// +// Created by Stephen Birarda on 1/26/15. +// Copyright 2015 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +package io.highfidelity.gvrinterface; + +import android.os.Bundle; +import android.view.WindowManager; +import org.qtproject.qt5.android.bindings.QtActivity; + +public class InterfaceActivity extends QtActivity { + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); + } +} \ No newline at end of file diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 20dc50bcac..c25e39599a 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -227,7 +227,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : auto nodeList = DependencyManager::get(); Model::setAbstractViewStateInterface(this); // The model class will sometimes need to know view state details from us - // read the ApplicationInfo.ini file for Name/Version/Domain information QSettings applicationInfo(PathUtils::resourcesPath() + "info/ApplicationInfo.ini", QSettings::IniFormat); diff --git a/libraries/networking/src/AccountManager.cpp b/libraries/networking/src/AccountManager.cpp index aa282de015..2ce11ae38b 100644 --- a/libraries/networking/src/AccountManager.cpp +++ b/libraries/networking/src/AccountManager.cpp @@ -74,8 +74,6 @@ AccountManager::AccountManager() : qRegisterMetaType("JSONCallbackParameters"); qRegisterMetaType("QHttpMultiPart*"); - - setAuthURL(DEFAULT_NODE_AUTH_URL); connect(&_accountInfo, &DataServerAccountInfo::balanceChanged, this, &AccountManager::accountInfoBalanceChanged); } From d09b8f8c2edc831f5d63f0e52486535bf5e9cebc Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 27 Jan 2015 14:52:28 -0800 Subject: [PATCH 2/4] remove enter VR mode and leave VR mode --- gvr-interface/src/GVRInterface.cpp | 43 ------------------------------ gvr-interface/src/GVRInterface.h | 3 --- 2 files changed, 46 deletions(-) diff --git a/gvr-interface/src/GVRInterface.cpp b/gvr-interface/src/GVRInterface.cpp index 1a18529793..85f568aa57 100644 --- a/gvr-interface/src/GVRInterface.cpp +++ b/gvr-interface/src/GVRInterface.cpp @@ -104,46 +104,3 @@ void GVRInterface::handleApplicationStateChange(Qt::ApplicationState state) { break; } } - -void GVRInterface::enterVRMode() { - // // Reload local preferences, in case we are coming back from a -// // switch to the dashboard that changed them. -// ovr_UpdateLocalPreferences(); -// -// // Default vrModeParms -// ovrModeParms vrModeParms; -// vrModeParms.AsynchronousTimeWarp = true; -// vrModeParms.AllowPowerSave = true; -// vrModeParms.DistortionFileName = NULL; -// vrModeParms.EnableImageServer = false; -// vrModeParms.CpuLevel = 2; -// vrModeParms.GpuLevel = 2; -// vrModeParms.GameThreadTid = 0; -// -// QPlatformNativeInterface* interface = QApplication::platformNativeInterface(); -// -// vrModeParms.ActivityObject = (jobject) interface->nativeResourceForIntegration("QtActivity"); -// -// _hmdInfo = new ovrHmdInfo; -// -// const char* cpuLevelStr = ovr_GetLocalPreferenceValueForKey( LOCAL_PREF_DEV_CPU_LEVEL, "-1" ); -// const int cpuLevel = atoi( cpuLevelStr ); -// if ( cpuLevel >= 0 ) { -// vrModeParms.CpuLevel = cpuLevel; -// qDebug() << "Local Preferences: Setting cpuLevel" << vrModeParms.CpuLevel; -// } -// -// const char* gpuLevelStr = ovr_GetLocalPreferenceValueForKey( LOCAL_PREF_DEV_GPU_LEVEL, "-1" ); -// const int gpuLevel = atoi( gpuLevelStr ); -// if ( gpuLevel >= 0 ) { -// vrModeParms.GpuLevel = gpuLevel; -// qDebug() << "Local Preferences: Setting gpuLevel" << vrModeParms.GpuLevel; -// } -// -// _ovr = ovr_EnterVrMode(vrModeParms, _hmdInfo); -} - -void GVRInterface::leaveVRMode() { - - // ovr_LeaveVrMode(_ovr); -} diff --git a/gvr-interface/src/GVRInterface.h b/gvr-interface/src/GVRInterface.h index 0a384f59ae..6d38406e7f 100644 --- a/gvr-interface/src/GVRInterface.h +++ b/gvr-interface/src/GVRInterface.h @@ -34,9 +34,6 @@ private slots: void handleApplicationStateChange(Qt::ApplicationState state); void idle(); private: - void enterVRMode(); - void leaveVRMode(); - RenderingClient* _client; bool _inVRMode; From 730be964fec9bbf987f6b03de65388af46646d9f Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 27 Jan 2015 16:00:58 -0800 Subject: [PATCH 3/4] add instructions for Oculus Mobile SDK --- BUILD_ANDROID.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/BUILD_ANDROID.md b/BUILD_ANDROID.md index f38b9575b2..97e2ba3e53 100644 --- a/BUILD_ANDROID.md +++ b/BUILD_ANDROID.md @@ -94,6 +94,11 @@ make install This will create the `lib` and `include` folders inside `ANDROID_LIB_DIR/soxr` that FindSoxr will look for. +####Oculus Mobile SDK + +Download the [Oculus Mobile SDK](https://developer.oculus.com/downloads/#sdk=mobile) and extract the archive inside your `ANDROID_LIB_DIR` folder. Rename the extracted folder to `libovr`. + +From the VrLib directory, use ndk-build to build VrLib. This will create the liboculus.a archive that our FindLibOVR module will look for when cmake is run. ####GLM From bf454f3b57455e4d87414018c1eb7cedc58ee33d Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 27 Jan 2015 16:02:01 -0800 Subject: [PATCH 4/4] add the oculus mobile sdk as an Android requirement --- BUILD_ANDROID.md | 1 + 1 file changed, 1 insertion(+) diff --git a/BUILD_ANDROID.md b/BUILD_ANDROID.md index 97e2ba3e53..9812d144a4 100644 --- a/BUILD_ANDROID.md +++ b/BUILD_ANDROID.md @@ -7,6 +7,7 @@ You will need the following tools to build our Android targets. * [Android NDK](https://developer.android.com/tools/sdk/ndk/index.html) = r10c * [Android SDK](http://developer.android.com/sdk/installing/index.html) ~> 24.0.2 * Be sure to install SDK Platform for API Level 19 +* [Oculus Mobile SDK](https://developer.oculus.com/downloads/#sdk=mobile) ~> 0.4.2 You will also need to cross-compile the dependencies required for all platforms for Android, and help CMake find these compiled libraries on your machine.