Bug 1105452 - Need to use new Audio system APIs for audio offload playback. r=roc, r=jld, r=ggrisco
authorJay Wang <jaywang@codeaurora.org>
Tue, 02 Dec 2014 17:10:00 -0500
changeset 244517 92bd6caa14da1311e5fb40b0f05681cc36adab40
parent 244516 f4e24f92339506c631e7eb4faff8d2f6c76d5fd6
child 244518 b7d01a4d3be47b156b757932e10f29640af44e09
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, jld, ggrisco
bugs1105452
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1105452 - Need to use new Audio system APIs for audio offload playback. r=roc, r=jld, r=ggrisco Resolve the build failure caused by API changes There are some changes in Audio APIs in Android version 21. Modifying the code to use the new APIs. Change-Id: I24fdeb20f8f957d05fb6c0c317de0a6f0769c347 Resolve seccomp violation caused by syscall 256 Modify the filter to allow syscall 256 (set_tid_address). Change-Id: I49461770c4c5e70bf68462d34321381b0b7ead0a
dom/media/omx/AudioOffloadPlayer.cpp
security/sandbox/linux/SandboxFilter.cpp
--- a/dom/media/omx/AudioOffloadPlayer.cpp
+++ b/dom/media/omx/AudioOffloadPlayer.cpp
@@ -72,26 +72,35 @@ AudioOffloadPlayer::AudioOffloadPlayer(M
 
 #ifdef PR_LOGGING
   if (!gAudioOffloadPlayerLog) {
     gAudioOffloadPlayerLog = PR_NewLogModule("AudioOffloadPlayer");
   }
 #endif
 
   CHECK(aObserver);
+#if ANDROID_VERSION >= 21
+  mSessionId = AudioSystem::newAudioUniqueId();
+  AudioSystem::acquireAudioSessionId(mSessionId, -1);
+#else
   mSessionId = AudioSystem::newAudioSessionId();
   AudioSystem::acquireAudioSessionId(mSessionId);
+#endif
   mAudioSink = new AudioOutput(mSessionId,
       IPCThreadState::self()->getCallingUid());
 }
 
 AudioOffloadPlayer::~AudioOffloadPlayer()
 {
   Reset();
+#if ANDROID_VERSION >= 21
+  AudioSystem::releaseAudioSessionId(mSessionId, -1);
+#else
   AudioSystem::releaseAudioSessionId(mSessionId);
+#endif
 }
 
 void AudioOffloadPlayer::SetSource(const sp<MediaSource> &aSource)
 {
   MOZ_ASSERT(NS_IsMainThread());
   CHECK(!mSource.get());
 
   mSource = aSource;
--- a/security/sandbox/linux/SandboxFilter.cpp
+++ b/security/sandbox/linux/SandboxFilter.cpp
@@ -239,16 +239,17 @@ SandboxFilterImplContent::Build() {
   Allow(SYSCALL(epoll_ctl));
   Allow(SYSCALL(sched_yield));
   Allow(SYSCALL(sched_getscheduler));
   Allow(SYSCALL(sched_setscheduler));
   Allow(SYSCALL(sched_getparam));
   Allow(SYSCALL(sched_setparam));
   Allow(SYSCALL(sigaltstack));
   Allow(SYSCALL(pipe));
+  Allow(SYSCALL(set_tid_address));
 
   /* Always last and always OK calls */
   /* Architecture-specific very infrequently used syscalls */
 #if SYSCALL_EXISTS(sigaction)
   Allow(SYSCALL(sigaction));
 #endif
   Allow(SYSCALL(rt_sigaction));
 #ifdef ARM_SYSCALL