From 5985f28e1baf121572d51ec954aa865e088cc0b6 Mon Sep 17 00:00:00 2001 From: andrewlewis Date: Fri, 24 Feb 2017 02:18:22 -0800 Subject: [PATCH] Add GVR extension and GvrBufferProcessor. A GvrBufferProcessor can be passed to the player by overriding SimpleExoPlayer's buildBufferProcessors method. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=148442114 --- extensions/gvr/README.md | 19 +++++++++++++++++++ extensions/gvr/build.gradle | 30 ++++++++++++++++++++++++++++++ settings.gradle | 13 ++++++------- 3 files changed, 55 insertions(+), 7 deletions(-) create mode 100644 extensions/gvr/README.md create mode 100644 extensions/gvr/build.gradle diff --git a/extensions/gvr/README.md b/extensions/gvr/README.md new file mode 100644 index 0000000000..b6be1705a2 --- /dev/null +++ b/extensions/gvr/README.md @@ -0,0 +1,19 @@ +# ExoPlayer GVR Extension # + +## Description ## + +The GVR extension wraps the [Google VR SDK for Android][]. It provides a +GvrBufferProcessor, which uses [GvrAudioSurround][] to provide binaural +rendering of surround sound and ambisonic soundfields. + +## Instructions ## + +If using SimpleExoPlayer, override SimpleExoPlayer.buildBufferProcessors to +return a GvrBufferProcessor. + +If constructing renderers directly, pass a GvrBufferProcessor to +MediaCodecAudioRenderer's constructor. + +[Google VR SDK for Android]: https://developers.google.com/vr/android/ +[GvrAudioSurround]: https://developers.google.com/vr/android/reference/com/google/vr/sdk/audio/GvrAudioSurround + diff --git a/extensions/gvr/build.gradle b/extensions/gvr/build.gradle new file mode 100644 index 0000000000..5ee9f45509 --- /dev/null +++ b/extensions/gvr/build.gradle @@ -0,0 +1,30 @@ +// Copyright (C) 2017 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +apply plugin: 'com.android.library' + +android { + compileSdkVersion project.ext.compileSdkVersion + buildToolsVersion project.ext.buildToolsVersion + + defaultConfig { + // Required by com.google.vr:sdk-audio. + minSdkVersion 19 + targetSdkVersion project.ext.targetSdkVersion + } +} + +dependencies { + compile project(':library') + compile 'com.google.vr:sdk-audio:1.20.0' +} diff --git a/settings.gradle b/settings.gradle index 8500dc6af7..d2d9cc87ed 100644 --- a/settings.gradle +++ b/settings.gradle @@ -15,20 +15,19 @@ include ':library' include ':testutils' include ':demo' include ':playbacktests' +include ':extension-ffmpeg' +include ':extension-flac' +include ':extension-okhttp' include ':extension-opus' include ':extension-vp9' -include ':extension-okhttp' -include ':extension-flac' -include ':extension-ffmpeg' // Uncomment the following line to use the Cronet Extension. // include ':extension-cronet' - +project(':extension-ffmpeg').projectDir = new File(settingsDir, 'extensions/ffmpeg') +project(':extension-flac').projectDir = new File(settingsDir, 'extensions/flac') +project(':extension-okhttp').projectDir = new File(settingsDir, 'extensions/okhttp') project(':extension-opus').projectDir = new File(settingsDir, 'extensions/opus') project(':extension-vp9').projectDir = new File(settingsDir, 'extensions/vp9') -project(':extension-okhttp').projectDir = new File(settingsDir, 'extensions/okhttp') -project(':extension-flac').projectDir = new File(settingsDir, 'extensions/flac') -project(':extension-ffmpeg').projectDir = new File(settingsDir, 'extensions/ffmpeg') // Uncomment the following line to use the Cronet Extension. // See extensions/cronet/README.md for details. // project(':extension-cronet').projectDir = new File(settingsDir, 'extensions/cronet')