Merge b2g-inbound to m-c.

This commit is contained in:
Ryan VanderMeulen 2014-04-25 16:12:25 -04:00
commit 2a22e940cd
35 changed files with 514 additions and 115 deletions

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/> <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="56f79456db5dc3ca010a56d09e1e8cc15a2408db"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="0292e64ef8451df104dcf9ac3b2c6749b81684dd"/> <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="0292e64ef8451df104dcf9ac3b2c6749b81684dd"/>

View File

@ -17,7 +17,7 @@
</project> </project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/> <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="56f79456db5dc3ca010a56d09e1e8cc15a2408db"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/> <project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8d6c36d74ba9aefbc8c3618fc93dd4907a0dbf5e"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="8d6c36d74ba9aefbc8c3618fc93dd4907a0dbf5e"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="65fba428f8d76336b33ddd9e15900357953600ba"> <project name="platform_build" path="build" remote="b2g" revision="65fba428f8d76336b33ddd9e15900357953600ba">
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="56f79456db5dc3ca010a56d09e1e8cc15a2408db"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/> <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/> <project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/> <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="56f79456db5dc3ca010a56d09e1e8cc15a2408db"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="0292e64ef8451df104dcf9ac3b2c6749b81684dd"/> <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="0292e64ef8451df104dcf9ac3b2c6749b81684dd"/>

View File

@ -18,7 +18,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/> <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="56f79456db5dc3ca010a56d09e1e8cc15a2408db"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/> <project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8d6c36d74ba9aefbc8c3618fc93dd4907a0dbf5e"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="8d6c36d74ba9aefbc8c3618fc93dd4907a0dbf5e"/>

View File

@ -4,6 +4,6 @@
"remote": "", "remote": "",
"branch": "" "branch": ""
}, },
"revision": "2fccee502f455ba2ca7178efa5cf247d90df8afb", "revision": "a0017eff21d39da46b6e8cf993f8fecf9ccb2af2",
"repo_path": "/integration/gaia-central" "repo_path": "/integration/gaia-central"
} }

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/> <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="56f79456db5dc3ca010a56d09e1e8cc15a2408db"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

View File

@ -15,7 +15,7 @@
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/> <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="56f79456db5dc3ca010a56d09e1e8cc15a2408db"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/> <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="56f79456db5dc3ca010a56d09e1e8cc15a2408db"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/> <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="56f79456db5dc3ca010a56d09e1e8cc15a2408db"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

View File

@ -17,7 +17,7 @@
</project> </project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/> <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="56f79456db5dc3ca010a56d09e1e8cc15a2408db"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/> <project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8d6c36d74ba9aefbc8c3618fc93dd4907a0dbf5e"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="8d6c36d74ba9aefbc8c3618fc93dd4907a0dbf5e"/>

View File

@ -0,0 +1,36 @@
. "$topsrcdir/b2g/config/mozconfigs/common"
. "$topsrcdir/build/unix/mozconfig.linux32"
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --enable-update-packaging
ac_add_options --enable-signmar
ac_add_options --enable-debug
# Nightlies only since this has a cost in performance
#ac_add_options --enable-js-diagnostics
# This will overwrite the default of stripping everything and keep the symbol table.
# This is useful for profiling and debugging and only increases the package size
# by 2 MBs.
STRIP_FLAGS="--strip-debug"
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1
export MOZ_TELEMETRY_REPORTING=1
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
# DISABLED WHILE NOT ON TRY ac_add_options --enable-warnings-as-errors
# Use ccache
. "$topsrcdir/build/mozconfig.cache"
#B2G options
ac_add_options --enable-application=b2g
ENABLE_MARIONETTE=1
ac_add_options --disable-elf-hack
export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
GAIADIR=$topsrcdir/gaia
. "$topsrcdir/b2g/config/mozconfigs/common.override"

View File

@ -0,0 +1,31 @@
. "$topsrcdir/b2g/config/mozconfigs/common"
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --enable-update-packaging
ac_add_options --enable-jemalloc
ac_add_options --enable-signmar
ac_add_options --enable-debug
# Nightlies only since this has a cost in performance
ac_add_options --enable-js-diagnostics
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1
export MOZ_TELEMETRY_REPORTING=1
if test "$PROCESSOR_ARCHITECTURE" = "AMD64" -o "$PROCESSOR_ARCHITEW6432" = "AMD64"; then
. $topsrcdir/build/win32/mozconfig.vs2010-win64
else
. $topsrcdir/build/win32/mozconfig.vs2010
fi
# B2G Options
ac_add_options --enable-application=b2g
ENABLE_MARIONETTE=1
export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
GAIADIR=$topsrcdir/gaia
. "$topsrcdir/b2g/config/mozconfigs/common.override"

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/> <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="facd91d31db983a60c7f1035ca01b727c7a1de65"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="56f79456db5dc3ca010a56d09e1e8cc15a2408db"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

View File

@ -849,7 +849,7 @@ MediaStreamGraphImpl::CreateOrDestroyAudioStreams(GraphTime aAudioOutputStartTim
// match the system's ideal channel configuration. // match the system's ideal channel configuration.
// NOTE: we presume this is either fast or async-under-the-covers // NOTE: we presume this is either fast or async-under-the-covers
audioOutputStream->mStream->Init(2, mSampleRate, audioOutputStream->mStream->Init(2, mSampleRate,
AudioChannel::Normal, aStream->mAudioChannelType,
AudioStream::LowLatency); AudioStream::LowLatency);
audioOutputStream->mTrackID = tracks->GetID(); audioOutputStream->mTrackID = tracks->GetID();
@ -1784,6 +1784,7 @@ MediaStream::MediaStream(DOMMediaStream* aWrapper)
, mMainThreadFinished(false) , mMainThreadFinished(false)
, mMainThreadDestroyed(false) , mMainThreadDestroyed(false)
, mGraph(nullptr) , mGraph(nullptr)
, mAudioChannelType(dom::AudioChannel::Normal)
{ {
MOZ_COUNT_CTOR(MediaStream); MOZ_COUNT_CTOR(MediaStream);
// aWrapper should not already be connected to a MediaStream! It needs // aWrapper should not already be connected to a MediaStream! It needs

View File

@ -19,6 +19,7 @@
#include "nsAutoRef.h" #include "nsAutoRef.h"
#include "speex/speex_resampler.h" #include "speex/speex_resampler.h"
#include "AudioMixer.h" #include "AudioMixer.h"
#include "mozilla/dom/AudioChannelBinding.h"
class nsIRunnable; class nsIRunnable;
@ -524,6 +525,8 @@ public:
virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const; virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const;
virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const; virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const;
void SetAudioChannelType(dom::AudioChannel aType) { mAudioChannelType = aType; }
protected: protected:
virtual void AdvanceTimeVaryingValuesToCurrentTime(GraphTime aCurrentTime, GraphTime aBlockedTime) virtual void AdvanceTimeVaryingValuesToCurrentTime(GraphTime aCurrentTime, GraphTime aBlockedTime)
{ {
@ -650,6 +653,8 @@ protected:
// Our media stream graph // Our media stream graph
MediaStreamGraphImpl* mGraph; MediaStreamGraphImpl* mGraph;
dom::AudioChannel mAudioChannelType;
}; };
/** /**

View File

@ -424,18 +424,6 @@ bool OmxDecoder::TryLoad() {
// read audio metadata // read audio metadata
if (mAudioSource.get()) { if (mAudioSource.get()) {
// For RTSP, we don't read the audio source for now.
// The metadata of RTSP will be obtained through SDP at connection time.
if (mResource->GetRtspPointer()) {
sp<MetaData> meta = mAudioSource->getFormat();
if (!meta->findInt32(kKeyChannelCount, &mAudioChannels) ||
!meta->findInt32(kKeySampleRate, &mAudioSampleRate)) {
NS_WARNING("Couldn't get audio metadata from OMX decoder");
return false;
}
return true;
}
// To reliably get the channel and sample rate data we need to read from the // To reliably get the channel and sample rate data we need to read from the
// audio source until we get a INFO_FORMAT_CHANGE status // audio source until we get a INFO_FORMAT_CHANGE status
status_t err = mAudioSource->read(&mAudioBuffer); status_t err = mAudioSource->read(&mAudioBuffer);

View File

@ -303,11 +303,11 @@ nsresult
RtspOmxReader::ReadMetadata(MediaInfo* aInfo, RtspOmxReader::ReadMetadata(MediaInfo* aInfo,
MetadataTags** aTags) MetadataTags** aTags)
{ {
SetActive();
nsresult rv = MediaOmxReader::ReadMetadata(aInfo, aTags); nsresult rv = MediaOmxReader::ReadMetadata(aInfo, aTags);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
SetActive();
return NS_OK; return NS_OK;
} }

View File

@ -65,15 +65,6 @@ public:
return NS_OK; return NS_OK;
} }
// Override FindStartTime() to return null pointer.
// For Rtsp, we don't have the first video frame in DECODING_METADATA state.
// It will be available until player request Play() and media decoder enters
// DECODING state.
virtual VideoData* FindStartTime(int64_t& aOutStartTime)
MOZ_FINAL MOZ_OVERRIDE {
return nullptr;
}
virtual void SetIdle() MOZ_OVERRIDE; virtual void SetIdle() MOZ_OVERRIDE;
virtual void SetActive() MOZ_OVERRIDE; virtual void SetActive() MOZ_OVERRIDE;

View File

@ -77,6 +77,7 @@ static float GetSampleRateForAudioContext(bool aIsOffline, float aSampleRate)
AudioContext::AudioContext(nsPIDOMWindow* aWindow, AudioContext::AudioContext(nsPIDOMWindow* aWindow,
bool aIsOffline, bool aIsOffline,
AudioChannel aChannel,
uint32_t aNumberOfChannels, uint32_t aNumberOfChannels,
uint32_t aLength, uint32_t aLength,
float aSampleRate) float aSampleRate)
@ -92,8 +93,8 @@ AudioContext::AudioContext(nsPIDOMWindow* aWindow,
// Note: AudioDestinationNode needs an AudioContext that must already be // Note: AudioDestinationNode needs an AudioContext that must already be
// bound to the window. // bound to the window.
mDestination = new AudioDestinationNode(this, aIsOffline, aNumberOfChannels, mDestination = new AudioDestinationNode(this, aIsOffline, aChannel,
aLength, aSampleRate); aNumberOfChannels, aLength, aSampleRate);
// We skip calling SetIsOnlyNodeForContext during mDestination's constructor, // We skip calling SetIsOnlyNodeForContext during mDestination's constructor,
// because we can only call SetIsOnlyNodeForContext after mDestination has // because we can only call SetIsOnlyNodeForContext after mDestination has
// been set up. // been set up.
@ -137,6 +138,24 @@ AudioContext::Constructor(const GlobalObject& aGlobal,
return object.forget(); return object.forget();
} }
/* static */ already_AddRefed<AudioContext>
AudioContext::Constructor(const GlobalObject& aGlobal,
AudioChannel aChannel,
ErrorResult& aRv)
{
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aGlobal.GetAsSupports());
if (!window) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
nsRefPtr<AudioContext> object = new AudioContext(window, false, aChannel);
RegisterWeakMemoryReporter(object);
return object.forget();
}
/* static */ already_AddRefed<AudioContext> /* static */ already_AddRefed<AudioContext>
AudioContext::Constructor(const GlobalObject& aGlobal, AudioContext::Constructor(const GlobalObject& aGlobal,
uint32_t aNumberOfChannels, uint32_t aNumberOfChannels,
@ -162,6 +181,7 @@ AudioContext::Constructor(const GlobalObject& aGlobal,
nsRefPtr<AudioContext> object = new AudioContext(window, nsRefPtr<AudioContext> object = new AudioContext(window,
true, true,
AudioChannel::Normal,
aNumberOfChannels, aNumberOfChannels,
aLength, aLength,
aSampleRate); aSampleRate);

View File

@ -67,6 +67,7 @@ class AudioContext MOZ_FINAL : public DOMEventTargetHelper,
{ {
AudioContext(nsPIDOMWindow* aParentWindow, AudioContext(nsPIDOMWindow* aParentWindow,
bool aIsOffline, bool aIsOffline,
AudioChannel aChannel = AudioChannel::Normal,
uint32_t aNumberOfChannels = 0, uint32_t aNumberOfChannels = 0,
uint32_t aLength = 0, uint32_t aLength = 0,
float aSampleRate = 0.0f); float aSampleRate = 0.0f);
@ -95,6 +96,12 @@ public:
static already_AddRefed<AudioContext> static already_AddRefed<AudioContext>
Constructor(const GlobalObject& aGlobal, ErrorResult& aRv); Constructor(const GlobalObject& aGlobal, ErrorResult& aRv);
// Constructor for regular AudioContext. A default audio channel is needed.
static already_AddRefed<AudioContext>
Constructor(const GlobalObject& aGlobal,
AudioChannel aChannel,
ErrorResult& aRv);
// Constructor for offline AudioContext // Constructor for offline AudioContext
static already_AddRefed<AudioContext> static already_AddRefed<AudioContext>
Constructor(const GlobalObject& aGlobal, Constructor(const GlobalObject& aGlobal,

View File

@ -228,6 +228,7 @@ NS_IMPL_RELEASE_INHERITED(AudioDestinationNode, AudioNode)
AudioDestinationNode::AudioDestinationNode(AudioContext* aContext, AudioDestinationNode::AudioDestinationNode(AudioContext* aContext,
bool aIsOffline, bool aIsOffline,
AudioChannel aChannel,
uint32_t aNumberOfChannels, uint32_t aNumberOfChannels,
uint32_t aLength, uint32_t aLength,
float aSampleRate) float aSampleRate)
@ -252,13 +253,13 @@ AudioDestinationNode::AudioDestinationNode(AudioContext* aContext,
static_cast<AudioNodeEngine*>(new DestinationNodeEngine(this)); static_cast<AudioNodeEngine*>(new DestinationNodeEngine(this));
mStream = graph->CreateAudioNodeStream(engine, MediaStreamGraph::EXTERNAL_STREAM); mStream = graph->CreateAudioNodeStream(engine, MediaStreamGraph::EXTERNAL_STREAM);
mStream->SetAudioChannelType(aChannel);
mStream->AddMainThreadListener(this); mStream->AddMainThreadListener(this);
mStream->AddAudioOutput(&gWebAudioOutputKey); mStream->AddAudioOutput(&gWebAudioOutputKey);
AudioChannel channel = AudioChannelService::GetDefaultAudioChannel(); if (aChannel != AudioChannel::Normal) {
if (channel != AudioChannel::Normal) {
ErrorResult rv; ErrorResult rv;
SetMozAudioChannelType(channel, rv); SetMozAudioChannelType(aChannel, rv);
} }
if (!aIsOffline && UseAudioChannelService()) { if (!aIsOffline && UseAudioChannelService()) {

View File

@ -30,6 +30,7 @@ public:
// whether it's in offline mode. // whether it's in offline mode.
AudioDestinationNode(AudioContext* aContext, AudioDestinationNode(AudioContext* aContext,
bool aIsOffline, bool aIsOffline,
AudioChannel aChannel = AudioChannel::Normal,
uint32_t aNumberOfChannels = 0, uint32_t aNumberOfChannels = 0,
uint32_t aLength = 0, uint32_t aLength = 0,
float aSampleRate = 0.0f); float aSampleRate = 0.0f);

View File

@ -66,7 +66,7 @@ function test_preferences(aChannel) {
SpecialPowers.pushPermissions( SpecialPowers.pushPermissions(
[{ "type": "audio-channel-" + aChannel, "allow": false, "context": document }], [{ "type": "audio-channel-" + aChannel, "allow": false, "context": document }],
function() { function() {
var ac = new AudioContext(); var ac = new AudioContext(aChannel);
ok(ac, "AudioContext created"); ok(ac, "AudioContext created");
is(ac.mozAudioChannelType, aChannel, "Default ac channel == '" + aChannel + "'"); is(ac.mozAudioChannelType, aChannel, "Default ac channel == '" + aChannel + "'");
runTest(); runTest();

View File

@ -87,8 +87,8 @@ AudioChannelService::Shutdown()
NS_IMPL_ISUPPORTS2(AudioChannelService, nsIObserver, nsITimerCallback) NS_IMPL_ISUPPORTS2(AudioChannelService, nsIObserver, nsITimerCallback)
AudioChannelService::AudioChannelService() AudioChannelService::AudioChannelService()
: mCurrentHigherChannel(INT32_MAX) : mCurrentHigherChannel(-1)
, mCurrentVisibleHigherChannel(INT32_MAX) , mCurrentVisibleHigherChannel(-1)
, mPlayableHiddenContentChildID(CONTENT_PROCESS_ID_UNKNOWN) , mPlayableHiddenContentChildID(CONTENT_PROCESS_ID_UNKNOWN)
, mDisabled(false) , mDisabled(false)
, mDefChannelChildID(CONTENT_PROCESS_ID_UNKNOWN) , mDefChannelChildID(CONTENT_PROCESS_ID_UNKNOWN)

View File

@ -0,0 +1,18 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
const { Services } = Cu.import('resource://gre/modules/Services.jsm');
const { SystemAppProxy } = Cu.import('resource://gre/modules/SystemAppProxy.jsm');
addMessageListener('init-chrome-event', function(message) {
// listen mozChromeEvent and forward to content process.
let type = message.type;
SystemAppProxy.addEventListener('mozChromeEvent', function(event) {
let details = event.detail;
if (details.type === type) {
sendAsyncMessage('chrome-event', details);
}
}, true);
});

View File

@ -0,0 +1,99 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test audio-channel-changed & visible-audio-channel-changed mozChromeEvent</title>
</head>
<body>
<div id="content"></div>
<script>
var normalAudio;
var contentAudio;
var notificationAudio;
var alarmAudio;
var telephonyAudio;
var ringerAudio;
var publicnotificationAudio;
function playWithAudioType(audio, type) {
audio.mozAudioChannelType = type;
audio.src = "test.ogg";
audio.loop = true;
audio.play();
}
function runTest() {
// normal channel.
normalAudio = new Audio();
playWithAudioType(normalAudio, 'normal');
// content channel.
contentAudio = new Audio();
playWithAudioType(contentAudio, 'content');
// notification channel.
notificationAudio = new Audio();
playWithAudioType(notificationAudio, 'notification');
// alarm channel.
alarmAudio = new Audio();
playWithAudioType(alarmAudio, 'alarm');
// telephony channel.
telephonyAudio = new Audio();
playWithAudioType(telephonyAudio, 'telephony');
// ringer channel.
ringerAudio = new Audio();
playWithAudioType(ringerAudio, 'ringer');
// publicnotification channel.
publicnotificationAudio = new Audio();
playWithAudioType(publicnotificationAudio, 'publicnotification');
window.addEventListener('hashchange', function(event) {
if (location.hash == "#pauseAudio") {
publicnotificationAudio.pause();
ringerAudio.pause();
telephonyAudio.pause();
}
if (location.hash == "#pauseAudioFollowing") {
alarmAudio.pause();
notificationAudio.pause();
contentAudio.pause();
normalAudio.pause();
}
}, false);
}
function checkBackgroundStatus() {
if (location.hash == "#fg") {
runTest();
return;
}
if (document.hidden) {
runTest();
return;
}
document.addEventListener('visibilitychange', function visibilityChange() {
if (document.hidden) {
runTest();
}
});
}
SpecialPowers.pushPermissions(
[{ "type": "audio-channel-content", "allow": 1, "context": document },
{ "type": "audio-channel-notification", "allow": 1, "context": document },
{ "type": "audio-channel-alarm", "allow": 1, "context": document },
{ "type": "audio-channel-telephony", "allow": 1, "context": document },
{ "type": "audio-channel-ringer", "allow": 1, "context": document },
{ "type": "audio-channel-publicnotification", "allow": 1, "context": document }],
checkBackgroundStatus);
</script>
</body>
</html>

View File

@ -0,0 +1,7 @@
[DEFAULT]
support-files =
file_audio.html
AudioChannelChromeScript.js
[test_audioChannelChange.html]
skip-if = (toolkit != 'gonk')

View File

@ -11,5 +11,7 @@ CPP_UNIT_TESTS += [
if CONFIG['OS_ARCH'] == 'WINNT': if CONFIG['OS_ARCH'] == 'WINNT':
DEFINES['NOMINMAX'] = True DEFINES['NOMINMAX'] = True
MOCHITEST_MANIFESTS += ['mochitest.ini']
FAIL_ON_WARNINGS = True FAIL_ON_WARNINGS = True

View File

@ -0,0 +1,209 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Test audio-channel-changed & visible-audio-channel-changed mozChromeEvent</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<div id="content"></div>
<script type="application/javascript;version=1.7">
var expectedAudioTypes;
var expectedVisibleAudioTypes;
var expectedVisibleAudioType;
var index;
var visibleIndex;
var iframe1;
var normalAudio;
function playWithAudioType(audio, type) {
audio.mozAudioChannelType = type;
audio.src = "test.ogg";
audio.loop = true;
audio.play();
}
function fgBgTestListener(message) {
var type = message.type;
var channel = message.channel;
if (type == 'audio-channel-changed') {
is(channel, expectedAudioTypes[index], channel + " is received and expected " + expectedAudioTypes[index]);
index++;
}
if (type == 'visible-audio-channel-changed') {
is(channel, expectedVisibleAudioType, channel + " is received and expected " + expectedVisibleAudioType);
}
// All audio types are playing now so ask to pause them.
// This call will stop audio from highest to telephony.
if ('cmd-pause' == expectedAudioTypes[index]) {
iframe1.src = 'file_audio.html#pauseAudio';
index++;
}
// According to there is a 1.5 second delay of releasing telephony,
// we need to wait for it then continue to pause others.
if ('cmd-secondPause' == expectedAudioTypes[index]) {
iframe1.src = 'file_audio.html#pauseAudioFollowing';
index++;
}
if (index == expectedAudioTypes.length) {
document.body.removeChild(iframe1);
script.removeMessageListener('chrome-event', fgBgTestListener);
normalAudio.pause();
SimpleTest.finish();
}
}
// Channel of visible-audio-channel-changed event should be always normal.
// Audios in background should not effect visible-audio-channel-changed.
function runFgBgTest() {
expectedAudioTypes = ["normal", "content", "notification",
"alarm", "telephony", "ringer", "publicnotification", "cmd-pause",
"ringer", "telephony", "alarm", "cmd-secondPause", "notification",
"content", "normal"];
expectedVisibleAudioType = "normal";
index = 0;
script.addMessageListener('chrome-event', fgBgTestListener);
// To play a audio with normal channel in the foreground.
normalAudio = new Audio();
playWithAudioType(normalAudio, 'normal');
iframe1.src = 'file_audio.html#bg';
document.body.appendChild(iframe1);
iframe1.setVisible(false);
}
function bgTestListener(message) {
var type = message.type;
var channel = message.channel;
if (type == 'audio-channel-changed') {
is(channel, expectedAudioTypes[index], channel + " is received and expected " + expectedAudioTypes[index]);
index++;
}
if (type == 'visible-audio-channel-changed') {
is(channel, expectedVisibleAudioType, channel + " is received and expected " + expectedVisibleAudioType);
}
// All audio types are playing now so ask to pause them.
if ('cmd-pause' == expectedAudioTypes[index]) {
iframe1.src = 'file_audio.html#pauseAudio';
index++;
}
if ('cmd-secondPause' == expectedAudioTypes[index]) {
iframe1.src = 'file_audio.html#pauseAudioFollowing';
index++;
}
if (index == expectedAudioTypes.length) {
document.body.removeChild(iframe1);
script.removeMessageListener('chrome-event', bgTestListener);
runFgBgTest();
}
}
// 1. Channel of visible-audio-channel-changed event should be always none.
// 2. normal is not allowed to be played in the background.
function runBgTest() {
expectedAudioTypes = ["content", "notification",
"alarm", "telephony", "ringer", "publicnotification", "cmd-pause",
"ringer", "telephony", "alarm", "cmd-secondPause", "notification",
"content", "none"];
expectedVisibleAudioType = "none";
index = 0;
script.addMessageListener('chrome-event', bgTestListener);
iframe1.src = 'file_audio.html#bg';
document.body.appendChild(iframe1);
iframe1.setVisible(false);
}
function fgTestListener(message) {
var type = message.type;
var channel = message.channel;
if (type == 'audio-channel-changed') {
is(channel, expectedAudioTypes[index], channel + " is received and expected " + expectedAudioTypes[index]);
index++;
}
if (type == 'visible-audio-channel-changed') {
is(channel, expectedAudioTypes[visibleIndex], channel + " is received and expected " + expectedAudioTypes[visibleIndex]);
visibleIndex++;
}
// All audio types are playing now so ask to pause them.
if ('cmd-pause' == expectedAudioTypes[visibleIndex] &&
'cmd-pause' == expectedAudioTypes[index]) {
iframe1.src = 'file_audio.html#pauseAudio';
visibleIndex++;
index++;
}
if ('cmd-secondPause' == expectedAudioTypes[visibleIndex] &&
'cmd-secondPause' == expectedAudioTypes[index]) {
iframe1.src = 'file_audio.html#pauseAudioFollowing';
visibleIndex++;
index++;
}
if (index == expectedAudioTypes.length && visibleIndex == expectedAudioTypes.length) {
document.body.removeChild(iframe1);
script.removeMessageListener('chrome-event', fgTestListener);
runBgTest();
}
}
// The foreground audio will effect both of audio-channel-changed and
// visible-audio-channel-changed.
function runFgTest() {
expectedAudioTypes = ["normal", "content", "notification",
"alarm", "telephony", "ringer", "publicnotification",
"cmd-pause", "ringer", "telephony", "alarm",
"cmd-secondPause", "notification", "content",
"normal", "none"];
index = 0;
visibleIndex = 0;
script.addMessageListener('chrome-event', fgTestListener);
iframe1 = document.createElement('iframe');
iframe1.setAttribute('mozbrowser', true);
iframe1.src = 'file_audio.html#fg';
document.body.appendChild(iframe1);
}
var url = SimpleTest.getTestFileURL("AudioChannelChromeScript.js")
var script = SpecialPowers.loadChromeScript(url);
script.sendAsyncMessage("init-chrome-event", {
type: 'audio-channel-changed'
});
script.sendAsyncMessage("init-chrome-event", {
type: 'visible-audio-channel-changed'
});
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPermissions(
[{ "type": "browser", "allow": 1, "context": document },
{ "type": "embed-apps", "allow": 1, "context": document },
{ "type": "webapps-manage", "allow": 1, "context": document }], function() {
SpecialPowers.pushPrefEnv({"set": [["dom.ipc.browser_frames.oop_by_default", true],
["media.useAudioChannelService", true],
["dom.mozBrowserFramesEnabled", true]]}, runFgTest);
});
</script>
</body>
</html>

View File

@ -81,9 +81,6 @@ XPCOMUtils.defineLazyServiceGetter(this, "gSystemMessenger",
XPCOMUtils.defineLazyServiceGetter(this, "gSystemWorkerManager", XPCOMUtils.defineLazyServiceGetter(this, "gSystemWorkerManager",
"@mozilla.org/telephony/system-worker-manager;1", "@mozilla.org/telephony/system-worker-manager;1",
"nsISystemWorkerManager"); "nsISystemWorkerManager");
XPCOMUtils.defineLazyServiceGetter(this, "gSettingsService",
"@mozilla.org/settingsService;1",
"nsISettingsService");
XPCOMUtils.defineLazyServiceGetter(this, "UUIDGenerator", XPCOMUtils.defineLazyServiceGetter(this, "UUIDGenerator",
"@mozilla.org/uuid-generator;1", "@mozilla.org/uuid-generator;1",
"nsIUUIDGenerator"); "nsIUUIDGenerator");
@ -415,11 +412,8 @@ function Nfc() {
this.worker.onerror = this.onerror.bind(this); this.worker.onerror = this.onerror.bind(this);
this.worker.onmessage = this.onmessage.bind(this); this.worker.onmessage = this.onmessage.bind(this);
Services.obs.addObserver(this, NFC.TOPIC_MOZSETTINGS_CHANGED, false);
gMessageManager.init(this); gMessageManager.init(this);
let lock = gSettingsService.createLock();
lock.get(NFC.SETTING_NFC_ENABLED, this);
// Maps sessionId (that are generated from nfcd) with a unique guid : 'SessionToken' // Maps sessionId (that are generated from nfcd) with a unique guid : 'SessionToken'
this.sessionTokenMap = {}; this.sessionTokenMap = {};
this.targetsByRequestId = {}; this.targetsByRequestId = {};
@ -434,12 +428,11 @@ Nfc.prototype = {
classDescription: "Nfc", classDescription: "Nfc",
interfaces: [Ci.nsIWorkerHolder]}), interfaces: [Ci.nsIWorkerHolder]}),
QueryInterface: XPCOMUtils.generateQI([Ci.nsIWorkerHolder, QueryInterface: XPCOMUtils.generateQI([Ci.nsIWorkerHolder]),
Ci.nsIObserver,
Ci.nsISettingsServiceCallback]),
_currentSessionId: null, _currentSessionId: null,
_enabled: false,
powerLevel: NFC.NFC_POWER_LEVEL_UNKNOWN,
onerror: function onerror(event) { onerror: function onerror(event) {
debug("Got an error: " + event.filename + ":" + debug("Got an error: " + event.filename + ":" +
@ -526,6 +519,10 @@ Nfc.prototype = {
} }
delete this.targetsByRequestId[message.requestId]; delete this.targetsByRequestId[message.requestId];
if (message.status == NFC.GECKO_NFC_ERROR_SUCCESS) {
this.powerLevel = message.powerLevel;
}
target.sendAsyncMessage("NFC:ConfigResponse", message); target.sendAsyncMessage("NFC:ConfigResponse", message);
break; break;
case "ConnectResponse": // Fall through. case "ConnectResponse": // Fall through.
@ -575,8 +572,8 @@ Nfc.prototype = {
return null; return null;
} }
if (!this._enabled) { if (this.powerLevel != NFC.NFC_POWER_LEVEL_ENABLED) {
debug("NFC is not enabled."); debug("NFC is not enabled. current powerLevel:" + this.powerLevel);
this.sendNfcErrorResponse(message); this.sendNfcErrorResponse(message);
return null; return null;
} }
@ -630,35 +627,6 @@ Nfc.prototype = {
return null; return null;
}, },
/**
* nsISettingsServiceCallback
*/
handle: function handle(aName, aResult) {
switch(aName) {
case NFC.SETTING_NFC_ENABLED:
debug("'nfc.enabled' is now " + aResult);
this._enabled = aResult;
break;
}
},
/**
* nsIObserver
*/
observe: function observe(subject, topic, data) {
switch (topic) {
case NFC.TOPIC_MOZSETTINGS_CHANGED:
let setting = JSON.parse(data);
if (setting) {
let setting = JSON.parse(data);
this.handle(setting.key, setting.value);
}
break;
}
},
setConfig: function setConfig(prop) { setConfig: function setConfig(prop) {
this.sendToWorker("config", prop); this.sendToWorker("config", prop);
} }

View File

@ -66,9 +66,7 @@ this.NFC_POWER_LEVEL_DISABLED = 0;
this.NFC_POWER_LEVEL_LOW = 1; this.NFC_POWER_LEVEL_LOW = 1;
this.NFC_POWER_LEVEL_ENABLED = 2; this.NFC_POWER_LEVEL_ENABLED = 2;
this.TOPIC_MOZSETTINGS_CHANGED = "mozsettings-changed";
this.TOPIC_XPCOM_SHUTDOWN = "xpcom-shutdown"; this.TOPIC_XPCOM_SHUTDOWN = "xpcom-shutdown";
this.SETTING_NFC_ENABLED = "nfc.enabled";
this.NFC_PEER_EVENT_READY = 0x01; this.NFC_PEER_EVENT_READY = 0x01;
this.NFC_PEER_EVENT_LOST = 0x02; this.NFC_PEER_EVENT_LOST = 0x02;

View File

@ -1498,6 +1498,11 @@ RilObject.prototype = {
}, },
sendDialRequest: function(options) { sendDialRequest: function(options) {
// Always succeed.
options.success = true;
this.sendChromeMessage(options);
this._createPendingOutgoingCall(options);
let Buf = this.context.Buf; let Buf = this.context.Buf;
Buf.newParcel(options.request, options); Buf.newParcel(options.request, options);
Buf.writeString(options.number); Buf.writeString(options.number);
@ -1541,6 +1546,7 @@ RilObject.prototype = {
let callIndex = call.callIndex; let callIndex = call.callIndex;
if (callIndex === OUTGOING_PLACEHOLDER_CALL_INDEX) { if (callIndex === OUTGOING_PLACEHOLDER_CALL_INDEX) {
if (DEBUG) this.context.debug("Hang up pending outgoing call.");
this._removeVoiceCall(call, GECKO_CALL_ERROR_NORMAL_CALL_CLEARING); this._removeVoiceCall(call, GECKO_CALL_ERROR_NORMAL_CALL_CLEARING);
return; return;
} }
@ -3846,14 +3852,14 @@ RilObject.prototype = {
} }
if (pendingOutgoingCall) { if (pendingOutgoingCall) {
// We don't get a successful call for pendingOutgoingCall.
if (!newCalls || Object.keys(newCalls).length === 0) { if (!newCalls || Object.keys(newCalls).length === 0) {
if (DEBUG) this.context.debug("No result for pending outgoing call."); // We don't get a successful call for pendingOutgoingCall.
pendingOutgoingCall.failCause = GECKO_CALL_ERROR_UNSPECIFIED; this._removePendingOutgoingCall(GECKO_CALL_ERROR_UNSPECIFIED);
this._handleDisconnectedCall(pendingOutgoingCall); } else {
// Only remove it from currentCalls map. Will use the new call to
// replace the placeholder.
delete this.currentCalls[OUTGOING_PLACEHOLDER_CALL_INDEX];
} }
delete this.currentCalls[OUTGOING_PLACEHOLDER_CALL_INDEX];
} }
// Go through any remaining calls that are new to us. // Go through any remaining calls that are new to us.
@ -3866,7 +3872,7 @@ RilObject.prototype = {
(newCall.state === CALL_STATE_DIALING || (newCall.state === CALL_STATE_DIALING ||
newCall.state === CALL_STATE_ALERTING)) { newCall.state === CALL_STATE_ALERTING)) {
// Receive a new outgoing call which is already hung up by user. // Receive a new outgoing call which is already hung up by user.
if (DEBUG) this.context.debug("Hang up pending outgoing call"); if (DEBUG) this.context.debug("Pending outgoing call is hung up by user.");
this.sendHangUpRequest(newCall.callIndex); this.sendHangUpRequest(newCall.callIndex);
} else { } else {
this._addNewVoiceCall(newCall); this._addNewVoiceCall(newCall);
@ -3933,6 +3939,25 @@ RilObject.prototype = {
} }
}, },
_createPendingOutgoingCall: function(options) {
if (DEBUG) this.context.debug("Create a pending outgoing call.");
this._addNewVoiceCall({
number: options.number,
state: CALL_STATE_DIALING,
callIndex: OUTGOING_PLACEHOLDER_CALL_INDEX
});
},
_removePendingOutgoingCall: function(failCause) {
let call = this.currentCalls[OUTGOING_PLACEHOLDER_CALL_INDEX];
if (!call) {
return;
}
if (DEBUG) this.context.debug("Remove pending outgoing call.");
this._removeVoiceCall(pendingOutgoingCall, failCause);
},
_ensureConference: function() { _ensureConference: function() {
let oldState = this.currentConference.state; let oldState = this.currentConference.state;
let remaining = Object.keys(this.currentConference.participants); let remaining = Object.keys(this.currentConference.participants);
@ -5329,24 +5354,14 @@ RilObject.prototype[REQUEST_GET_CURRENT_CALLS] = function REQUEST_GET_CURRENT_CA
this._processCalls(calls); this._processCalls(calls);
}; };
RilObject.prototype[REQUEST_DIAL] = function REQUEST_DIAL(length, options) { RilObject.prototype[REQUEST_DIAL] = function REQUEST_DIAL(length, options) {
options.success = (options.rilRequestError === 0); // We already return a successful response before. Don't respond it again!
if (options.success) { if (options.rilRequestError) {
this.sendChromeMessage(options); this.getFailCauseCode((function(failCause) {
this._removePendingOutgoingCall(failCause);
// Create a pending outgoing call. }).bind(this));
if (DEBUG) this.context.debug("Create a pending outgoing call.");
this._addNewVoiceCall({
number: options.number,
state: CALL_STATE_DIALING,
callIndex: OUTGOING_PLACEHOLDER_CALL_INDEX
});
} else {
this.getFailCauseCode((function(options, failCause) {
options.errorMsg = failCause;
this.sendChromeMessage(options);
}).bind(this, options));
} }
}; };
RilObject.prototype[REQUEST_DIAL_EMERGENCY_CALL] = RilObject.prototype[REQUEST_DIAL];
RilObject.prototype[REQUEST_GET_IMSI] = function REQUEST_GET_IMSI(length, options) { RilObject.prototype[REQUEST_GET_IMSI] = function REQUEST_GET_IMSI(length, options) {
if (options.rilRequestError) { if (options.rilRequestError) {
return; return;

View File

@ -13,7 +13,8 @@
callback DecodeSuccessCallback = void (AudioBuffer decodedData); callback DecodeSuccessCallback = void (AudioBuffer decodedData);
callback DecodeErrorCallback = void (); callback DecodeErrorCallback = void ();
[Constructor] [Constructor,
Constructor(AudioChannel audioChannelType)]
interface AudioContext : EventTarget { interface AudioContext : EventTarget {
readonly attribute AudioDestinationNode destination; readonly attribute AudioDestinationNode destination;
@ -28,7 +29,7 @@ interface AudioContext : EventTarget {
DecodeSuccessCallback successCallback, DecodeSuccessCallback successCallback,
optional DecodeErrorCallback errorCallback); optional DecodeErrorCallback errorCallback);
// AudioNode creation // AudioNode creation
[NewObject] [NewObject]
AudioBufferSourceNode createBufferSource(); AudioBufferSourceNode createBufferSource();

View File

@ -558,6 +558,7 @@ var WifiManager = (function() {
// Tell the event worker to start waiting for events. // Tell the event worker to start waiting for events.
retryTimer = null; retryTimer = null;
connectTries = 0; connectTries = 0;
recvErrors = 0;
manager.connectToSupplicant = true; manager.connectToSupplicant = true;
didConnectSupplicant(function(){}); didConnectSupplicant(function(){});
return; return;
@ -735,8 +736,8 @@ var WifiManager = (function() {
if (eventData.indexOf("CTRL-EVENT-TERMINATING") === 0) { if (eventData.indexOf("CTRL-EVENT-TERMINATING") === 0) {
// As long the monitor socket is not closed and we haven't seen too many // As long the monitor socket is not closed and we haven't seen too many
// recv errors yet, we will keep going for a bit longer. // recv errors yet, we will keep going for a bit longer.
if (eventData.indexOf("connection closed") === -1 && if (event.indexOf("connection closed") === -1 &&
eventData.indexOf("recv error") !== -1 && ++recvErrors < 10) event.indexOf("recv error") !== -1 && ++recvErrors < 10)
return true; return true;
notifyStateChange({ state: "DISCONNECTED", BSSID: null, id: -1 }); notifyStateChange({ state: "DISCONNECTED", BSSID: null, id: -1 });