mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge mozilla-central to fx-team
This commit is contained in:
commit
d5cf415f6e
@ -19,13 +19,13 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="a13d42ab5240008e042d0c61bf9c9d05174e70e4"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="70953f779faf6b1a94861c34ffdc3d5fd1c442e5"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="abedd83e1ba61cb83e59c723ad6279ad2a7aa1d1"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="ca283b9db2b151d465cfd2e19346cf58fe89e413"/>
|
||||
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="d5800c36b2d5822fc3fe1899b9280401de466e1e"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="3512d982f336887a73283bb8d1147a8f7b822077"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="fd4be2909b788b563435fe0addb1bd98dfa75457"/>
|
||||
<!-- Stock Android things -->
|
||||
<project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
|
||||
<project name="platform/bionic" path="bionic" revision="c72b8f6359de7ed17c11ddc9dfdde3f615d188a9"/>
|
||||
|
@ -17,10 +17,10 @@
|
||||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="a13d42ab5240008e042d0c61bf9c9d05174e70e4"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="70953f779faf6b1a94861c34ffdc3d5fd1c442e5"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="abedd83e1ba61cb83e59c723ad6279ad2a7aa1d1"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="3512d982f336887a73283bb8d1147a8f7b822077"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="fd4be2909b788b563435fe0addb1bd98dfa75457"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
||||
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
|
||||
<!-- Stock Android things -->
|
||||
|
@ -15,14 +15,14 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="65fba428f8d76336b33ddd9e15900357953600ba">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="a13d42ab5240008e042d0c61bf9c9d05174e70e4"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="70953f779faf6b1a94861c34ffdc3d5fd1c442e5"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="abedd83e1ba61cb83e59c723ad6279ad2a7aa1d1"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
||||
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="3512d982f336887a73283bb8d1147a8f7b822077"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="fd4be2909b788b563435fe0addb1bd98dfa75457"/>
|
||||
<!-- Stock Android things -->
|
||||
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="f92a936f2aa97526d4593386754bdbf02db07a12"/>
|
||||
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="6e47ff2790f5656b5b074407829ceecf3e6188c4"/>
|
||||
|
@ -19,13 +19,13 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="a13d42ab5240008e042d0c61bf9c9d05174e70e4"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="70953f779faf6b1a94861c34ffdc3d5fd1c442e5"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="abedd83e1ba61cb83e59c723ad6279ad2a7aa1d1"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="ca283b9db2b151d465cfd2e19346cf58fe89e413"/>
|
||||
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="d5800c36b2d5822fc3fe1899b9280401de466e1e"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="3512d982f336887a73283bb8d1147a8f7b822077"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="fd4be2909b788b563435fe0addb1bd98dfa75457"/>
|
||||
<!-- Stock Android things -->
|
||||
<project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
|
||||
<project name="platform/bionic" path="bionic" revision="c72b8f6359de7ed17c11ddc9dfdde3f615d188a9"/>
|
||||
|
@ -18,10 +18,10 @@
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="a13d42ab5240008e042d0c61bf9c9d05174e70e4"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="70953f779faf6b1a94861c34ffdc3d5fd1c442e5"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="abedd83e1ba61cb83e59c723ad6279ad2a7aa1d1"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="3512d982f336887a73283bb8d1147a8f7b822077"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="fd4be2909b788b563435fe0addb1bd98dfa75457"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
||||
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
|
||||
<!-- Stock Android things -->
|
||||
|
@ -4,6 +4,6 @@
|
||||
"remote": "",
|
||||
"branch": ""
|
||||
},
|
||||
"revision": "ee7c5efe7a7f24887ee7f772311a9a37997ae232",
|
||||
"revision": "993067c495a5e0956dfe4169f1f48d9a791304f0",
|
||||
"repo_path": "/integration/gaia-central"
|
||||
}
|
||||
|
@ -17,12 +17,12 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="a13d42ab5240008e042d0c61bf9c9d05174e70e4"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="70953f779faf6b1a94861c34ffdc3d5fd1c442e5"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="abedd83e1ba61cb83e59c723ad6279ad2a7aa1d1"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="3512d982f336887a73283bb8d1147a8f7b822077"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="fd4be2909b788b563435fe0addb1bd98dfa75457"/>
|
||||
<!-- Stock Android things -->
|
||||
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
|
||||
<project name="platform/bionic" path="bionic" revision="d2eb6c7b6e1bc7643c17df2d9d9bcb1704d0b9ab"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="a13d42ab5240008e042d0c61bf9c9d05174e70e4"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="70953f779faf6b1a94861c34ffdc3d5fd1c442e5"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="abedd83e1ba61cb83e59c723ad6279ad2a7aa1d1"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>
|
||||
|
@ -19,12 +19,12 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="a13d42ab5240008e042d0c61bf9c9d05174e70e4"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="70953f779faf6b1a94861c34ffdc3d5fd1c442e5"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="abedd83e1ba61cb83e59c723ad6279ad2a7aa1d1"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="3512d982f336887a73283bb8d1147a8f7b822077"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="fd4be2909b788b563435fe0addb1bd98dfa75457"/>
|
||||
<!-- Stock Android things -->
|
||||
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
|
||||
<project name="platform/bionic" path="bionic" revision="cd5dfce80bc3f0139a56b58aca633202ccaee7f8"/>
|
||||
|
@ -17,12 +17,12 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="a13d42ab5240008e042d0c61bf9c9d05174e70e4"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="70953f779faf6b1a94861c34ffdc3d5fd1c442e5"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="abedd83e1ba61cb83e59c723ad6279ad2a7aa1d1"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="3512d982f336887a73283bb8d1147a8f7b822077"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="fd4be2909b788b563435fe0addb1bd98dfa75457"/>
|
||||
<project name="gonk-patches" path="patches" remote="b2g" revision="223a2421006e8f5da33f516f6891c87cae86b0f6"/>
|
||||
<!-- Stock Android things -->
|
||||
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
|
||||
|
@ -17,10 +17,10 @@
|
||||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="a13d42ab5240008e042d0c61bf9c9d05174e70e4"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="70953f779faf6b1a94861c34ffdc3d5fd1c442e5"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="abedd83e1ba61cb83e59c723ad6279ad2a7aa1d1"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="3512d982f336887a73283bb8d1147a8f7b822077"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="fd4be2909b788b563435fe0addb1bd98dfa75457"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
||||
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
|
||||
<!-- Stock Android things -->
|
||||
|
@ -17,12 +17,12 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="a13d42ab5240008e042d0c61bf9c9d05174e70e4"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="70953f779faf6b1a94861c34ffdc3d5fd1c442e5"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="abedd83e1ba61cb83e59c723ad6279ad2a7aa1d1"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="3512d982f336887a73283bb8d1147a8f7b822077"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="fd4be2909b788b563435fe0addb1bd98dfa75457"/>
|
||||
<project name="gonk-patches" path="patches" remote="b2g" revision="223a2421006e8f5da33f516f6891c87cae86b0f6"/>
|
||||
<!-- Stock Android things -->
|
||||
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
|
||||
|
@ -7,6 +7,7 @@
|
||||
gyp_vars = {
|
||||
'build_with_mozilla': 1,
|
||||
'build_with_chromium': 0,
|
||||
'use_official_google_api_keys': 0,
|
||||
'have_clock_monotonic': 1 if CONFIG['HAVE_CLOCK_MONOTONIC'] else 0,
|
||||
'have_ethtool_cmd_speed_hi': 1 if CONFIG['MOZ_WEBRTC_HAVE_ETHTOOL_SPEED_HI'] else 0,
|
||||
'include_alsa_audio': 1 if CONFIG['MOZ_ALSA'] else 0,
|
||||
|
223
content/media/gtest/TestVorbisTrackEncoder.cpp
Normal file
223
content/media/gtest/TestVorbisTrackEncoder.cpp
Normal file
@ -0,0 +1,223 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "VorbisTrackEncoder.h"
|
||||
#include "WebMWriter.h"
|
||||
#include "MediaStreamGraph.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
class TestVorbisTrackEncoder : public VorbisTrackEncoder
|
||||
{
|
||||
public:
|
||||
// Return true if it has successfully initialized the vorbis encoder.
|
||||
bool TestVorbisCreation(int aChannels, int aSamplingRate)
|
||||
{
|
||||
if (Init(aChannels, aSamplingRate) == NS_OK) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
static bool
|
||||
TestVorbisInit(int aChannels, int aSamplingRate)
|
||||
{
|
||||
TestVorbisTrackEncoder encoder;
|
||||
return encoder.TestVorbisCreation(aChannels, aSamplingRate);
|
||||
}
|
||||
|
||||
static int
|
||||
ReadLacing(const uint8_t* aInput, uint32_t aInputLength, uint32_t& aReadBytes)
|
||||
{
|
||||
aReadBytes = 0;
|
||||
|
||||
int packetSize = 0;
|
||||
while (aReadBytes < aInputLength) {
|
||||
if (aInput[aReadBytes] == 255) {
|
||||
packetSize += 255;
|
||||
aReadBytes++;
|
||||
} else { // the last byte
|
||||
packetSize += aInput[aReadBytes];
|
||||
aReadBytes++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return packetSize;
|
||||
}
|
||||
|
||||
static bool
|
||||
parseVorbisMetadata(nsTArray<uint8_t>& aData, int aChannels, int aRate)
|
||||
{
|
||||
uint32_t offset = 0;
|
||||
// the first byte should be 2.
|
||||
if (aData.ElementAt(0) != 2) {
|
||||
return false;
|
||||
}
|
||||
offset = 1;
|
||||
|
||||
// Read the length of header and header_comm
|
||||
uint32_t readbytes;
|
||||
ogg_packet header;
|
||||
ogg_packet header_comm;
|
||||
ogg_packet header_code;
|
||||
memset(&header, 0, sizeof(ogg_packet));
|
||||
memset(&header_comm, 0, sizeof(ogg_packet));
|
||||
memset(&header_code, 0, sizeof(ogg_packet));
|
||||
|
||||
int header_length;
|
||||
int header_comm_length;
|
||||
int header_code_length;
|
||||
EXPECT_TRUE(offset < aData.Length());
|
||||
header_length = ReadLacing(aData.Elements()+offset, aData.Length()-offset,
|
||||
readbytes);
|
||||
offset += readbytes;
|
||||
EXPECT_TRUE(offset < aData.Length());
|
||||
header_comm_length = ReadLacing(aData.Elements()+offset,
|
||||
aData.Length()-offset, readbytes);
|
||||
offset += readbytes;
|
||||
EXPECT_TRUE(offset < aData.Length());
|
||||
// The rest length is header_code.
|
||||
header_code_length = aData.Length() - offset - header_length
|
||||
- header_comm_length;
|
||||
EXPECT_TRUE(header_code_length >= 32);
|
||||
|
||||
// Verify the three header packets by vorbis_synthesis_headerin.
|
||||
// Raise the b_o_s (begin of stream) flag.
|
||||
header.b_o_s = true;
|
||||
header.packet = aData.Elements() + offset;
|
||||
header.bytes = header_length;
|
||||
offset += header_length;
|
||||
header_comm.packet = aData.Elements() + offset;
|
||||
header_comm.bytes = header_comm_length;
|
||||
offset += header_comm_length;
|
||||
header_code.packet = aData.Elements() + offset;
|
||||
header_code.bytes = header_code_length;
|
||||
|
||||
vorbis_info vi;
|
||||
vorbis_comment vc;
|
||||
vorbis_info_init(&vi);
|
||||
vorbis_comment_init(&vc);
|
||||
|
||||
EXPECT_TRUE(0 == vorbis_synthesis_headerin(&vi, &vc, &header));
|
||||
|
||||
EXPECT_TRUE(0 == vorbis_synthesis_headerin(&vi, &vc, &header_comm));
|
||||
|
||||
EXPECT_TRUE(0 == vorbis_synthesis_headerin(&vi, &vc, &header_code));
|
||||
|
||||
EXPECT_TRUE(vi.channels == aChannels);
|
||||
EXPECT_TRUE(vi.rate == aRate);
|
||||
|
||||
vorbis_info_clear(&vi);
|
||||
vorbis_comment_clear(&vc);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Test init function
|
||||
TEST(VorbisTrackEncoder, Init)
|
||||
{
|
||||
// Channel number range test
|
||||
// Expect false with 0 or negative channels of input signal.
|
||||
EXPECT_FALSE(TestVorbisInit(0, 16000));
|
||||
EXPECT_FALSE(TestVorbisInit(-1, 16000));
|
||||
EXPECT_FALSE(TestVorbisInit(8 + 1, 16000));
|
||||
|
||||
// Sample rate and channel range test.
|
||||
for (int i = 1; i <= 8; i++) {
|
||||
EXPECT_FALSE(TestVorbisInit(i, -1));
|
||||
EXPECT_TRUE(TestVorbisInit(i, 8000));
|
||||
EXPECT_TRUE(TestVorbisInit(i, 11000));
|
||||
EXPECT_TRUE(TestVorbisInit(i, 16000));
|
||||
EXPECT_TRUE(TestVorbisInit(i, 22050));
|
||||
EXPECT_TRUE(TestVorbisInit(i, 32000));
|
||||
EXPECT_TRUE(TestVorbisInit(i, 44100));
|
||||
EXPECT_TRUE(TestVorbisInit(i, 48000));
|
||||
EXPECT_TRUE(TestVorbisInit(i, 96000));
|
||||
EXPECT_FALSE(TestVorbisInit(i, 200000 + 1));
|
||||
}
|
||||
}
|
||||
|
||||
// Test metadata
|
||||
TEST(VorbisTrackEncoder, Metadata)
|
||||
{
|
||||
// Initiate vorbis encoder.
|
||||
TestVorbisTrackEncoder encoder;
|
||||
int channels = 1;
|
||||
int rate = 44100;
|
||||
encoder.TestVorbisCreation(channels, rate);
|
||||
|
||||
nsRefPtr<TrackMetadataBase> meta = encoder.GetMetadata();
|
||||
nsRefPtr<VorbisMetadata> vorbisMetadata(static_cast<VorbisMetadata*>(meta.get()));
|
||||
|
||||
// According to initialization parameters, verify the correctness
|
||||
// of vorbisMetadata.
|
||||
EXPECT_TRUE(vorbisMetadata->mChannels == channels);
|
||||
EXPECT_TRUE(vorbisMetadata->mSamplingFrequency == rate);
|
||||
EXPECT_TRUE(parseVorbisMetadata(vorbisMetadata->mData, channels, rate));
|
||||
}
|
||||
|
||||
// Test encode function
|
||||
TEST(VorbisTrackEncoder, EncodedFrame)
|
||||
{
|
||||
// Initiate vorbis encoder
|
||||
TestVorbisTrackEncoder encoder;
|
||||
int channels = 1;
|
||||
int rate = 44100;
|
||||
encoder.TestVorbisCreation(channels, rate);
|
||||
|
||||
// Generate 1 second samples.
|
||||
// Reference PeerConnectionMedia.h::Fake_AudioGenerator
|
||||
nsRefPtr<mozilla::SharedBuffer> samples =
|
||||
mozilla::SharedBuffer::Create(rate * sizeof(AudioDataValue));
|
||||
AudioDataValue* data = static_cast<AudioDataValue*>(samples->Data());
|
||||
for (int i = 0; i < rate; i++) {
|
||||
data[i] = ((i%8)*4000) - (7*4000)/2;
|
||||
}
|
||||
nsAutoTArray<const AudioDataValue*,1> channelData;
|
||||
channelData.AppendElement(data);
|
||||
AudioSegment segment;
|
||||
segment.AppendFrames(samples.forget(), channelData, 44100);
|
||||
|
||||
// Track change notification.
|
||||
encoder.NotifyQueuedTrackChanges(nullptr, 0, 0, 0, 0, segment);
|
||||
|
||||
// Pull Encoded data back from encoder and verify encoded samples.
|
||||
EncodedFrameContainer container;
|
||||
EXPECT_TRUE(NS_SUCCEEDED(encoder.GetEncodedTrack(container)));
|
||||
// Should have some encoded data.
|
||||
EXPECT_TRUE(container.GetEncodedFrames().Length() > 0);
|
||||
EXPECT_TRUE(container.GetEncodedFrames().ElementAt(0)->GetFrameData().Length()
|
||||
> 0);
|
||||
EXPECT_TRUE(container.GetEncodedFrames().ElementAt(0)->GetFrameType() ==
|
||||
EncodedFrame::FrameType::VORBIS_AUDIO_FRAME);
|
||||
// Encoded data doesn't have duration and timestamp.
|
||||
EXPECT_TRUE(container.GetEncodedFrames().ElementAt(0)->GetDuration() == 0);
|
||||
EXPECT_TRUE(container.GetEncodedFrames().ElementAt(0)->GetTimeStamp() == 0);
|
||||
}
|
||||
|
||||
// EOS test
|
||||
TEST(VorbisTrackEncoder, EncodeComplete)
|
||||
{
|
||||
// Initiate vorbis encoder
|
||||
TestVorbisTrackEncoder encoder;
|
||||
int channels = 1;
|
||||
int rate = 44100;
|
||||
encoder.TestVorbisCreation(channels, rate);
|
||||
|
||||
// Track end notification.
|
||||
AudioSegment segment;
|
||||
encoder.NotifyQueuedTrackChanges(nullptr, 0, 0, 0,
|
||||
MediaStreamListener::TRACK_EVENT_ENDED,
|
||||
segment);
|
||||
|
||||
// Pull Encoded Data back from encoder. Since we had send out
|
||||
// EOS to encoder, encoder.GetEncodedTrack should return
|
||||
// NS_OK immidiately.
|
||||
EncodedFrameContainer container;
|
||||
EXPECT_TRUE(NS_SUCCEEDED(encoder.GetEncodedTrack(container)));
|
||||
}
|
@ -13,6 +13,7 @@ UNIFIED_SOURCES += [
|
||||
|
||||
if CONFIG['MOZ_WEBM_ENCODER']:
|
||||
UNIFIED_SOURCES += ['TestVideoTrackEncoder.cpp',
|
||||
'TestVorbisTrackEncoder.cpp',
|
||||
]
|
||||
|
||||
EXPORT_LIBRARY = True
|
||||
|
@ -66,7 +66,7 @@ load 952756.html
|
||||
load 986901.html
|
||||
load buffer-source-ended-1.html
|
||||
load offline-buffer-source-ended-1.html
|
||||
skip-if(B2G) HTTP load media-element-source-seek-1.html # intermittent B2G timeouts, bug 994351
|
||||
HTTP load media-element-source-seek-1.html
|
||||
skip-if(B2G) load oscillator-ended-1.html # intermittent B2G timeouts, bug 920338
|
||||
skip-if(B2G) load oscillator-ended-2.html # intermittent B2G timeouts, bug 920338
|
||||
include ../../mediasource/test/crashtests/crashtests.list
|
||||
|
@ -6,14 +6,15 @@ audioElement.autoplay = true;
|
||||
audioElement.src = "sound.ogg";
|
||||
audioElement.onplaying =
|
||||
function() {
|
||||
audioElement.onseeked =
|
||||
audioElement.onplaying = null;
|
||||
setTimeout(
|
||||
function() {
|
||||
setTimeout(
|
||||
audioElement.onseeked =
|
||||
function() {
|
||||
document.documentElement.removeAttribute("class");
|
||||
}, 100);
|
||||
};
|
||||
audioElement.currentTime = 0;
|
||||
};
|
||||
audioElement.currentTime = 0;
|
||||
}, 100);
|
||||
};
|
||||
|
||||
var context = new window.AudioContext();
|
||||
|
@ -256,6 +256,9 @@ public:
|
||||
already_AddRefed<DOMRequest> Mount(ErrorResult& aRv);
|
||||
already_AddRefed<DOMRequest> Unmount(ErrorResult& aRv);
|
||||
|
||||
bool CanBeMounted();
|
||||
bool CanBeFormatted();
|
||||
bool CanBeShared();
|
||||
bool Default();
|
||||
|
||||
// Uses XPCOM GetStorageName
|
||||
@ -305,6 +308,7 @@ private:
|
||||
nsString mStorageType;
|
||||
nsCOMPtr<nsIFile> mRootDirectory;
|
||||
nsString mStorageName;
|
||||
bool mIsShareable;
|
||||
|
||||
already_AddRefed<nsDOMDeviceStorage> GetStorage(const nsAString& aFullPath,
|
||||
nsAString& aOutStoragePath);
|
||||
|
@ -3100,6 +3100,7 @@ NS_IMPL_RELEASE_INHERITED(nsDOMDeviceStorage, DOMEventTargetHelper)
|
||||
|
||||
nsDOMDeviceStorage::nsDOMDeviceStorage(nsPIDOMWindow* aWindow)
|
||||
: DOMEventTargetHelper(aWindow)
|
||||
, mIsShareable(false)
|
||||
, mIsWatchingFile(false)
|
||||
, mAllowedToWatchFile(false)
|
||||
{
|
||||
@ -3127,6 +3128,27 @@ nsDOMDeviceStorage::Init(nsPIDOMWindow* aWindow, const nsAString &aType,
|
||||
}
|
||||
if (!mStorageName.IsEmpty()) {
|
||||
RegisterForSDCardChanges(this);
|
||||
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
if (DeviceStorageTypeChecker::IsVolumeBased(mStorageType)) {
|
||||
nsCOMPtr<nsIVolumeService> vs = do_GetService(NS_VOLUMESERVICE_CONTRACTID);
|
||||
if (NS_WARN_IF(!vs)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIVolume> vol;
|
||||
rv = vs->GetVolumeByName(mStorageName, getter_AddRefs(vol));
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
bool isFake;
|
||||
rv = vol->GetIsFake(&isFake);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
mIsShareable = !isFake;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Grab the principal of the document
|
||||
@ -3913,6 +3935,26 @@ nsDOMDeviceStorage::Default()
|
||||
return mStorageName.Equals(defaultStorageName);
|
||||
}
|
||||
|
||||
bool
|
||||
nsDOMDeviceStorage::CanBeFormatted()
|
||||
{
|
||||
// Currently, any volume which can be shared can also be formatted.
|
||||
return mIsShareable;
|
||||
}
|
||||
|
||||
bool
|
||||
nsDOMDeviceStorage::CanBeMounted()
|
||||
{
|
||||
// Currently, any volume which can be shared can also be mounted/unmounted.
|
||||
return mIsShareable;
|
||||
}
|
||||
|
||||
bool
|
||||
nsDOMDeviceStorage::CanBeShared()
|
||||
{
|
||||
return mIsShareable;
|
||||
}
|
||||
|
||||
already_AddRefed<Promise>
|
||||
nsDOMDeviceStorage::GetRoot()
|
||||
{
|
||||
|
@ -1690,12 +1690,13 @@ ContentChild::RecvFileSystemUpdate(const nsString& aFsName,
|
||||
const int32_t& aMountGeneration,
|
||||
const bool& aIsMediaPresent,
|
||||
const bool& aIsSharing,
|
||||
const bool& aIsFormatting)
|
||||
const bool& aIsFormatting,
|
||||
const bool& aIsFake)
|
||||
{
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
nsRefPtr<nsVolume> volume = new nsVolume(aFsName, aVolumeName, aState,
|
||||
aMountGeneration, aIsMediaPresent,
|
||||
aIsSharing, aIsFormatting);
|
||||
aIsSharing, aIsFormatting, aIsFake);
|
||||
|
||||
nsRefPtr<nsVolumeService> vs = nsVolumeService::GetSingleton();
|
||||
if (vs) {
|
||||
@ -1710,6 +1711,7 @@ ContentChild::RecvFileSystemUpdate(const nsString& aFsName,
|
||||
unused << aIsMediaPresent;
|
||||
unused << aIsSharing;
|
||||
unused << aIsFormatting;
|
||||
unused << aIsFake;
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
@ -256,7 +256,8 @@ public:
|
||||
const int32_t& aMountGeneration,
|
||||
const bool& aIsMediaPresent,
|
||||
const bool& aIsSharing,
|
||||
const bool& aIsFormatting) MOZ_OVERRIDE;
|
||||
const bool& aIsFormatting,
|
||||
const bool& aIsFake) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool RecvNuwaFork() MOZ_OVERRIDE;
|
||||
|
||||
|
@ -2237,6 +2237,7 @@ ContentParent::Observe(nsISupports* aSubject,
|
||||
bool isMediaPresent;
|
||||
bool isSharing;
|
||||
bool isFormatting;
|
||||
bool isFake;
|
||||
|
||||
vol->GetName(volName);
|
||||
vol->GetMountPoint(mountPoint);
|
||||
@ -2245,10 +2246,11 @@ ContentParent::Observe(nsISupports* aSubject,
|
||||
vol->GetIsMediaPresent(&isMediaPresent);
|
||||
vol->GetIsSharing(&isSharing);
|
||||
vol->GetIsFormatting(&isFormatting);
|
||||
vol->GetIsFake(&isFake);
|
||||
|
||||
unused << SendFileSystemUpdate(volName, mountPoint, state,
|
||||
mountGeneration, isMediaPresent,
|
||||
isSharing, isFormatting);
|
||||
isSharing, isFormatting, isFake);
|
||||
} else if (!strcmp(aTopic, "phone-state-changed")) {
|
||||
nsString state(aData);
|
||||
unused << SendNotifyPhoneStateChange(state);
|
||||
|
@ -388,7 +388,7 @@ child:
|
||||
|
||||
FileSystemUpdate(nsString fsName, nsString mountPoint, int32_t fsState,
|
||||
int32_t mountGeneration, bool isMediaPresent,
|
||||
bool isSharing, bool isFormatting);
|
||||
bool isSharing, bool isFormatting, bool isFake);
|
||||
|
||||
// Ask the Nuwa process to create a new child process.
|
||||
NuwaFork();
|
||||
|
@ -4,7 +4,7 @@
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
WEBRTC_SIGNALLING_TEST_MANIFESTS += ['steeplechase.ini']
|
||||
|
||||
MOCHITEST_MANIFESTS += ['mochitest.ini']
|
||||
if CONFIG ['MOZ_WEBRTC']:
|
||||
MOCHITEST_MANIFESTS += ['mochitest.ini']
|
||||
WEBRTC_SIGNALLING_TEST_MANIFESTS += ['steeplechase.ini']
|
||||
|
||||
|
@ -30,13 +30,13 @@ public:
|
||||
nsVolume(const nsAString& aName, const nsAString& aMountPoint,
|
||||
const int32_t& aState, const int32_t& aMountGeneration,
|
||||
const bool& aIsMediaPresent, const bool& aIsSharing,
|
||||
const bool& aIsFormatting)
|
||||
const bool& aIsFormatting, const bool& aIsFake)
|
||||
: mName(aName),
|
||||
mMountPoint(aMountPoint),
|
||||
mState(aState),
|
||||
mMountGeneration(aMountGeneration),
|
||||
mMountLocked(false),
|
||||
mIsFake(false),
|
||||
mIsFake(aIsFake),
|
||||
mIsMediaPresent(aIsMediaPresent),
|
||||
mIsSharing(aIsSharing),
|
||||
mIsFormatting(aIsFormatting)
|
||||
@ -82,7 +82,7 @@ public:
|
||||
typedef nsTArray<nsRefPtr<nsVolume> > Array;
|
||||
|
||||
private:
|
||||
~nsVolume() {}
|
||||
virtual ~nsVolume() {} // MozExternalRefCountType complains if this is non-virtual
|
||||
|
||||
friend class nsVolumeService; // Calls the following XxxMountLock functions
|
||||
void UpdateMountLock(const nsAString& aMountLockState);
|
||||
|
@ -249,7 +249,8 @@ nsVolumeService::CreateOrGetVolumeByPath(const nsAString& aPath, nsIVolume** aRe
|
||||
-1 /* generation */,
|
||||
true /* isMediaPresent*/,
|
||||
false /* isSharing */,
|
||||
false /* isFormatting */);
|
||||
false /* isFormatting */,
|
||||
true /* isFake */);
|
||||
vol.forget(aResult);
|
||||
return NS_OK;
|
||||
}
|
||||
@ -382,8 +383,8 @@ nsVolumeService::CreateFakeVolume(const nsAString& name, const nsAString& path)
|
||||
-1 /* mountGeneration */,
|
||||
true /* isMediaPresent */,
|
||||
false /* isSharing */,
|
||||
false /* isFormatting */);
|
||||
vol->SetIsFake(true);
|
||||
false /* isFormatting */,
|
||||
true /* isFake */);
|
||||
vol->LogState();
|
||||
UpdateVolume(vol.get());
|
||||
return NS_OK;
|
||||
|
@ -52,6 +52,18 @@ interface DeviceStorage : EventTarget {
|
||||
// include any path information.
|
||||
readonly attribute DOMString storageName;
|
||||
|
||||
// Indicates if the storage area denoted by storageName is capable of
|
||||
// being mounted and unmounted.
|
||||
readonly attribute boolean canBeMounted;
|
||||
|
||||
// Indicates if the storage area denoted by storageName is capable of
|
||||
// being shared and unshared.
|
||||
readonly attribute boolean canBeShared;
|
||||
|
||||
// Indicates if the storage area denoted by storageName is capable of
|
||||
// being formatted.
|
||||
readonly attribute boolean canBeFormatted;
|
||||
|
||||
// Determines if this storage area is the one which will be used by default
|
||||
// for storing new files.
|
||||
readonly attribute boolean default;
|
||||
|
@ -434,10 +434,13 @@ SurfaceStream_TripleBuffer::SwapProducer(SurfaceFactory* factory,
|
||||
|
||||
// If WaitForCompositor succeeds, mStaging has moved to mConsumer.
|
||||
// If it failed, we might have to scrap it.
|
||||
if (mStaging && !WaitForCompositor())
|
||||
if (mStaging) {
|
||||
WaitForCompositor();
|
||||
}
|
||||
if (mStaging) {
|
||||
Scrap(mStaging);
|
||||
}
|
||||
|
||||
MOZ_ASSERT(!mStaging);
|
||||
Move(mProducer, mStaging);
|
||||
mStaging->Fence();
|
||||
}
|
||||
@ -470,19 +473,15 @@ SurfaceStream_TripleBuffer_Async::~SurfaceStream_TripleBuffer_Async()
|
||||
{
|
||||
}
|
||||
|
||||
bool
|
||||
void
|
||||
SurfaceStream_TripleBuffer_Async::WaitForCompositor()
|
||||
{
|
||||
PROFILER_LABEL("SurfaceStream_TripleBuffer_Async", "WaitForCompositor");
|
||||
|
||||
// We are assumed to be locked
|
||||
while (mStaging) {
|
||||
if (!NS_SUCCEEDED(mMonitor.Wait(PR_MillisecondsToInterval(100)))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
// If we haven't be notified within 100ms, then
|
||||
// something must have happened and it will never arrive.
|
||||
// Bail out to avoid deadlocking.
|
||||
mMonitor.Wait(PR_MillisecondsToInterval(100));
|
||||
}
|
||||
|
||||
} /* namespace gfx */
|
||||
|
@ -192,7 +192,7 @@ protected:
|
||||
SharedSurface* mConsumer;
|
||||
|
||||
// Returns true if we were able to wait, false if not
|
||||
virtual bool WaitForCompositor() { return false; }
|
||||
virtual void WaitForCompositor() {}
|
||||
|
||||
// To support subclasses initializing the mType.
|
||||
SurfaceStream_TripleBuffer(SurfaceStreamType type, SurfaceStream* prevStream);
|
||||
@ -221,7 +221,7 @@ class SurfaceStream_TripleBuffer_Async
|
||||
: public SurfaceStream_TripleBuffer
|
||||
{
|
||||
protected:
|
||||
virtual bool WaitForCompositor() MOZ_OVERRIDE;
|
||||
virtual void WaitForCompositor() MOZ_OVERRIDE;
|
||||
|
||||
public:
|
||||
SurfaceStream_TripleBuffer_Async(SurfaceStream* prevStream);
|
||||
|
@ -453,7 +453,9 @@ Range::intersect(TempAllocator &alloc, const Range *lhs, const Range *rhs, bool
|
||||
newHasInt32LowerBound && newHasInt32UpperBound &&
|
||||
newLower == newUpper))
|
||||
{
|
||||
refineInt32BoundsByExponent(newExponent, &newLower, &newUpper);
|
||||
refineInt32BoundsByExponent(newExponent,
|
||||
&newLower, &newHasInt32LowerBound,
|
||||
&newUpper, &newHasInt32UpperBound);
|
||||
|
||||
// If we're intersecting two ranges that don't overlap, this could also
|
||||
// push the bounds past each other, since the actual intersection is
|
||||
@ -2113,7 +2115,9 @@ Range::wrapAroundToInt32()
|
||||
|
||||
// Clearing the fractional field may provide an opportunity to refine
|
||||
// lower_ or upper_.
|
||||
refineInt32BoundsByExponent(max_exponent_, &lower_, &upper_);
|
||||
refineInt32BoundsByExponent(max_exponent_,
|
||||
&lower_, &hasInt32LowerBound_,
|
||||
&upper_, &hasInt32UpperBound_);
|
||||
|
||||
assertInvariants();
|
||||
}
|
||||
|
@ -277,12 +277,17 @@ class Range : public TempObject {
|
||||
// Given an exponent value and pointers to the lower and upper bound values,
|
||||
// this function refines the lower and upper bound values to the tighest
|
||||
// bound for integer values implied by the exponent.
|
||||
static void refineInt32BoundsByExponent(uint16_t e, int32_t *l, int32_t *h) {
|
||||
static void refineInt32BoundsByExponent(uint16_t e,
|
||||
int32_t *l, bool *lb,
|
||||
int32_t *h, bool *hb)
|
||||
{
|
||||
if (e < MaxInt32Exponent) {
|
||||
// pow(2, max_exponent_+1)-1 to compute a maximum absolute value.
|
||||
int32_t limit = (uint32_t(1) << (e + 1)) - 1;
|
||||
*h = Min(*h, limit);
|
||||
*l = Max(*l, -limit);
|
||||
*hb = true;
|
||||
*lb = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -771,7 +771,7 @@ Chunk::init(JSRuntime *rt)
|
||||
info.trailer.location = ChunkLocationTenuredHeap;
|
||||
info.trailer.runtime = rt;
|
||||
|
||||
/* The rest of info fields are initialized in PickChunk. */
|
||||
/* The rest of info fields are initialized in pickChunk. */
|
||||
}
|
||||
|
||||
static inline Chunk **
|
||||
@ -1502,11 +1502,9 @@ ArenaLists::allocateFromArenaInline(Zone *zone, AllocKind thingKind)
|
||||
* a lock.
|
||||
*/
|
||||
|
||||
Chunk *chunk = nullptr;
|
||||
|
||||
ArenaList *al = &arenaLists[thingKind];
|
||||
AutoLockGC maybeLock;
|
||||
|
||||
bool backgroundFinalizationIsRunning = false;
|
||||
#ifdef JS_THREADSAFE
|
||||
ArenaLists::BackgroundFinalizeState *bfs = &backgroundFinalizeState[thingKind];
|
||||
if (*bfs != BFS_DONE) {
|
||||
@ -1518,15 +1516,7 @@ ArenaLists::allocateFromArenaInline(Zone *zone, AllocKind thingKind)
|
||||
JSRuntime *rt = zone->runtimeFromAnyThread();
|
||||
maybeLock.lock(rt);
|
||||
if (*bfs == BFS_RUN) {
|
||||
JS_ASSERT(al->isCursorAtEnd());
|
||||
chunk = rt->gc.pickChunk(zone);
|
||||
if (!chunk) {
|
||||
/*
|
||||
* Let the caller to wait for the background allocation to
|
||||
* finish and restart the allocation attempt.
|
||||
*/
|
||||
return nullptr;
|
||||
}
|
||||
backgroundFinalizationIsRunning = true;
|
||||
} else if (*bfs == BFS_JUST_FINISHED) {
|
||||
/* See comments before BackgroundFinalizeState definition. */
|
||||
*bfs = BFS_DONE;
|
||||
@ -1536,47 +1526,47 @@ ArenaLists::allocateFromArenaInline(Zone *zone, AllocKind thingKind)
|
||||
}
|
||||
#endif /* JS_THREADSAFE */
|
||||
|
||||
if (!chunk) {
|
||||
if (ArenaHeader *aheader = al->arenaAfterCursor()) {
|
||||
/*
|
||||
* Normally, the empty arenas are returned to the chunk
|
||||
* and should not present on the list. In parallel
|
||||
* execution, however, we keep empty arenas in the arena
|
||||
* list to avoid synchronizing on the chunk.
|
||||
*/
|
||||
JS_ASSERT(!aheader->isEmpty() || InParallelSection());
|
||||
ArenaHeader *aheader;
|
||||
ArenaList *al = &arenaLists[thingKind];
|
||||
if (!backgroundFinalizationIsRunning && (aheader = al->arenaAfterCursor())) {
|
||||
/*
|
||||
* Normally, the empty arenas are returned to the chunk
|
||||
* and should not be present on the list. In parallel
|
||||
* execution, however, we keep empty arenas in the arena
|
||||
* list to avoid synchronizing on the chunk.
|
||||
*/
|
||||
JS_ASSERT(!aheader->isEmpty() || InParallelSection());
|
||||
|
||||
al->moveCursorPast(aheader);
|
||||
al->moveCursorPast(aheader);
|
||||
|
||||
/*
|
||||
* Move the free span stored in the arena to the free list and
|
||||
* allocate from it.
|
||||
*/
|
||||
FreeSpan firstFreeSpan = aheader->getFirstFreeSpan();
|
||||
freeLists[thingKind].setHead(&firstFreeSpan);
|
||||
aheader->setAsFullyUsed();
|
||||
if (MOZ_UNLIKELY(zone->wasGCStarted())) {
|
||||
if (zone->needsBarrier()) {
|
||||
aheader->allocatedDuringIncremental = true;
|
||||
zone->runtimeFromMainThread()->gc.marker.delayMarkingArena(aheader);
|
||||
} else if (zone->isGCSweeping()) {
|
||||
PushArenaAllocatedDuringSweep(zone->runtimeFromMainThread(), aheader);
|
||||
}
|
||||
/*
|
||||
* Move the free span stored in the arena to the free list and
|
||||
* allocate from it.
|
||||
*/
|
||||
FreeSpan firstFreeSpan = aheader->getFirstFreeSpan();
|
||||
freeLists[thingKind].setHead(&firstFreeSpan);
|
||||
aheader->setAsFullyUsed();
|
||||
if (MOZ_UNLIKELY(zone->wasGCStarted())) {
|
||||
if (zone->needsBarrier()) {
|
||||
aheader->allocatedDuringIncremental = true;
|
||||
zone->runtimeFromMainThread()->gc.marker.delayMarkingArena(aheader);
|
||||
} else if (zone->isGCSweeping()) {
|
||||
PushArenaAllocatedDuringSweep(zone->runtimeFromMainThread(), aheader);
|
||||
}
|
||||
void *thing = freeLists[thingKind].allocate(Arena::thingSize(thingKind));
|
||||
JS_ASSERT(thing); // This allocation is infallible.
|
||||
return thing;
|
||||
}
|
||||
|
||||
/* Make sure we hold the GC lock before we call PickChunk. */
|
||||
JSRuntime *rt = zone->runtimeFromAnyThread();
|
||||
if (!maybeLock.locked())
|
||||
maybeLock.lock(rt);
|
||||
chunk = rt->gc.pickChunk(zone);
|
||||
if (!chunk)
|
||||
return nullptr;
|
||||
void *thing = freeLists[thingKind].allocate(Arena::thingSize(thingKind));
|
||||
JS_ASSERT(thing); // This allocation is infallible.
|
||||
return thing;
|
||||
}
|
||||
|
||||
/* Make sure we hold the GC lock before we call pickChunk. */
|
||||
JSRuntime *rt = zone->runtimeFromAnyThread();
|
||||
if (!maybeLock.locked())
|
||||
maybeLock.lock(rt);
|
||||
Chunk *chunk = rt->gc.pickChunk(zone);
|
||||
if (!chunk)
|
||||
return nullptr;
|
||||
|
||||
/*
|
||||
* While we still hold the GC lock get an arena from some chunk, mark it
|
||||
* as full as its single free span is moved to the free lits, and insert
|
||||
@ -1587,7 +1577,7 @@ ArenaLists::allocateFromArenaInline(Zone *zone, AllocKind thingKind)
|
||||
* cache locality.
|
||||
*/
|
||||
JS_ASSERT(al->isCursorAtEnd());
|
||||
ArenaHeader *aheader = chunk->allocateArena(zone, thingKind);
|
||||
aheader = chunk->allocateArena(zone, thingKind);
|
||||
if (!aheader)
|
||||
return nullptr;
|
||||
|
||||
|
@ -2308,13 +2308,16 @@ nsLayoutUtils::TransformFrameRectToAncestor(nsIFrame* aFrame,
|
||||
|
||||
static nsIntPoint GetWidgetOffset(nsIWidget* aWidget, nsIWidget*& aRootWidget) {
|
||||
nsIntPoint offset(0, 0);
|
||||
nsIWidget* parent = aWidget->GetParent();
|
||||
while (parent) {
|
||||
while ((aWidget->WindowType() == eWindowType_child ||
|
||||
aWidget->WindowType() == eWindowType_plugin)) {
|
||||
nsIWidget* parent = aWidget->GetParent();
|
||||
if (!parent) {
|
||||
break;
|
||||
}
|
||||
nsIntRect bounds;
|
||||
aWidget->GetBounds(bounds);
|
||||
offset += bounds.TopLeft();
|
||||
aWidget = parent;
|
||||
parent = aWidget->GetParent();
|
||||
}
|
||||
aRootWidget = aWidget;
|
||||
return offset;
|
||||
|
@ -1185,7 +1185,7 @@ nsObjectFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
}
|
||||
|
||||
DisplayListClipState::AutoClipContainingBlockDescendantsToContentBox
|
||||
clip(aBuilder, this, DisplayListClipState::ASSUME_DRAWING_RESTRICTED_TO_CONTENT_RECT);
|
||||
clip(aBuilder, this);
|
||||
|
||||
// determine if we are printing
|
||||
if (type == nsPresContext::eContext_Print) {
|
||||
|
@ -660,6 +660,12 @@ function BuildConditionSandbox(aURL) {
|
||||
sandbox.AddressSanitizer = false;
|
||||
#endif
|
||||
|
||||
#if MOZ_WEBRTC
|
||||
sandbox.webrtc = true;
|
||||
#else
|
||||
sandbox.webrtc = false;
|
||||
#endif
|
||||
|
||||
var hh = CC[NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX + "http"].
|
||||
getService(CI.nsIHttpProtocolHandler);
|
||||
sandbox.http = { __exposedProps__: {} };
|
||||
|
13
media/libyuv/build/dir_exists.py
Normal file
13
media/libyuv/build/dir_exists.py
Normal file
@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env python
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
import sys
|
||||
import subprocess
|
||||
import os.path
|
||||
|
||||
def main():
|
||||
return subprocess.call([sys.executable, "../webrtc/trunk/build/dir_exists.py"] + sys.argv[1:])
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
12
media/libyuv/build/mac/find_sdk.py
Executable file
12
media/libyuv/build/mac/find_sdk.py
Executable file
@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env python
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
def main():
|
||||
return subprocess.call([sys.executable, "../webrtc/trunk/build/mac/find_sdk.py"] + sys.argv[1:])
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
@ -924,7 +924,7 @@
|
||||
'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
|
||||
|
||||
'conditions': [
|
||||
['OS=="win" and "<!(<(PYTHON) <(DEPTH)/build/dir_exists.py <(windows_sdk_default_path))"=="True"', {
|
||||
['"<!(<(PYTHON) <(DEPTH)/build/dir_exists.py <(windows_sdk_default_path))"=="True"', {
|
||||
'windows_sdk_path%': '<(windows_sdk_default_path)',
|
||||
}, {
|
||||
'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.0',
|
||||
|
@ -31,7 +31,7 @@ include ../../dom/xbl/crashtests/crashtests.list
|
||||
include ../../dom/xslt/crashtests/crashtests.list
|
||||
|
||||
# Bug 811873 - mozRTCPeerConnection doesn't support remote browser yet
|
||||
skip-if(B2G||browserIsRemote) include ../../dom/media/tests/crashtests/crashtests.list
|
||||
skip-if(B2G||browserIsRemote||!webrtc) include ../../dom/media/tests/crashtests/crashtests.list
|
||||
|
||||
include ../../dom/src/offline/crashtests/crashtests.list
|
||||
include ../../dom/src/jsurl/crashtests/crashtests.list
|
||||
|
@ -752,9 +752,14 @@ function makeDReportMap(aJSONReports)
|
||||
assert(jr.description !== undefined, "Missing description");
|
||||
|
||||
// Strip out some non-deterministic stuff that prevents clean diffs --
|
||||
// e.g. PIDs, addresses.
|
||||
// e.g. PIDs, addresses, null principal UUIDs. (Note that we don't strip
|
||||
// out all UUIDs because some of them -- such as those used by add-ons --
|
||||
// are deterministic.)
|
||||
let strippedProcess = jr.process.replace(/pid \d+/, "pid NNN");
|
||||
let strippedPath = jr.path.replace(/0x[0-9A-Fa-f]+/, "0xNNN");
|
||||
strippedPath = strippedPath.replace(
|
||||
/moz-nullprincipal:{........-....-....-....-............}/,
|
||||
"moz-nullprincipal:{NNNNNNNN-NNNN-NNNN-NNNN-NNNNNNNNNNNN}");
|
||||
let processPath = strippedProcess + kProcessPathSep + strippedPath;
|
||||
|
||||
let rOld = dreportMap[processPath];
|
||||
|
@ -13,7 +13,7 @@
|
||||
{"process": "P", "path": "foobar", "kind": 2, "units": 0, "amount": 100, "description": "Desc."},
|
||||
{"process": "P", "path": "zero1", "kind": 2, "units": 0, "amount": 0, "description": "Desc."},
|
||||
|
||||
{"process": "P2 (pid 22)", "path": "z 0x1234", "kind": 2, "units": 0, "amount": 33, "description": "Desc."},
|
||||
{"process": "P2 (pid 22)", "path": "z-moz-nullprincipal:{85e250f3-57ae-46c4-a11e-4176dd39d9c5} 0x1234", "kind": 2, "units": 0, "amount": 33, "description": "Desc."},
|
||||
|
||||
{"process": "P3", "path": "p3", "kind": 2, "units": 0, "amount": 55, "description": "Desc."},
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
{"process": "P", "path": "foobaz", "kind": 2, "units": 0, "amount": 0, "description": "Desc."},
|
||||
|
||||
{"process": "P2 (pid 33)", "path": "z 0x5678", "kind": 2, "units": 0, "amount": 44, "description": "Desc."},
|
||||
{"process": "P2 (pid 33)", "path": "z-moz-nullprincipal:{161effaa-c1f7-4010-a08e-e7c9aea01aed} 0x5678", "kind": 2, "units": 0, "amount": 44, "description": "Desc."},
|
||||
|
||||
{"process": "P4", "path": "p4", "kind": 2, "units": 0, "amount": 66, "description": "Desc."},
|
||||
|
||||
|
@ -287,7 +287,7 @@ End of P\n\
|
||||
P2 (pid NNN)\n\
|
||||
Other Measurements\n\
|
||||
\n\
|
||||
11 B ── z 0xNNN\n\
|
||||
11 B ── z-moz-nullprincipal:{NNNNNNNN-NNNN-NNNN-NNNN-NNNNNNNNNNNN} 0xNNN\n\
|
||||
\n\
|
||||
End of P2 (pid NNN)\n\
|
||||
P3\n\
|
||||
|
@ -49,6 +49,8 @@ add_tier_dir('platform', ['ipc', 'js/ipc'])
|
||||
|
||||
add_tier_dir('platform', ['hal', 'js/xpconnect', 'intl/chardet'])
|
||||
|
||||
add_tier_dir('platform', 'media/libyuv')
|
||||
|
||||
add_tier_dir('platform', ['modules/libjar', 'storage'])
|
||||
|
||||
if CONFIG['MOZ_PERMISSIONS']:
|
||||
@ -65,7 +67,6 @@ if CONFIG['MOZ_WEBRTC']:
|
||||
'media/mtransport/third_party',
|
||||
'media/mtransport/build',
|
||||
'media/mtransport/standalone',
|
||||
'media/libyuv',
|
||||
])
|
||||
|
||||
if CONFIG['MOZ_OMX_PLUGIN']:
|
||||
|
@ -27,6 +27,8 @@ support-files = window_composition_text_querycontent.xul
|
||||
[test_sizemode_events.xul]
|
||||
[test_bug760802.xul]
|
||||
[test_clipboard.xul]
|
||||
[test_panel_mouse_coords.xul]
|
||||
skip-if = toolkit == "windows" # bug 1009955
|
||||
|
||||
# Cocoa
|
||||
[test_native_menus.xul]
|
||||
|
83
widget/tests/test_panel_mouse_coords.xul
Normal file
83
widget/tests/test_panel_mouse_coords.xul
Normal file
@ -0,0 +1,83 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
|
||||
<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=835044
|
||||
-->
|
||||
<window title="Mozilla Bug 835044"
|
||||
onload="startTest()"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
|
||||
|
||||
<panel id="thepanel" level="parent"
|
||||
onpopupshown="sendMouseEvent();"
|
||||
onmousemove="checkCoords(event);"
|
||||
width="80" height="80">
|
||||
</panel>
|
||||
|
||||
<!-- test results are displayed in the html:body -->
|
||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=835044"
|
||||
id="anchor"
|
||||
target="_blank">Mozilla Bug 835044</a>
|
||||
</body>
|
||||
|
||||
<!-- test code goes here -->
|
||||
<script type="application/javascript">
|
||||
<![CDATA[
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
let Cc = Components.classes;
|
||||
let Ci = Components.interfaces;
|
||||
let utils = window.QueryInterface(Ci.nsIInterfaceRequestor).
|
||||
getInterface(Ci.nsIDOMWindowUtils);
|
||||
let panel = document.getElementById('thepanel');
|
||||
let nativeMouseMove;
|
||||
let rect;
|
||||
|
||||
function startTest() {
|
||||
let widgetToolkit = Cc["@mozilla.org/xre/app-info;1"].
|
||||
getService(Ci.nsIXULRuntime).widgetToolkit;
|
||||
|
||||
if (widgetToolkit == "cocoa") {
|
||||
nativeMouseMove = 5; // NSMouseMoved
|
||||
} else if (widgetToolkit == "windows") {
|
||||
nativeMouseMove = 1; // MOUSEEVENTF_MOVE
|
||||
} else if (/^gtk/.test(widgetToolkit)) {
|
||||
nativeMouseMove = 3; // GDK_MOTION_NOTIFY
|
||||
} else {
|
||||
todo_is("widgetToolkit", widgetToolkit, "Platform not supported");
|
||||
done();
|
||||
}
|
||||
|
||||
// This first event is to ensure that the next event will have different
|
||||
// coordinates to the previous mouse position, and so actually generates
|
||||
// mouse events. The mouse is not moved off the window, as that might
|
||||
// move focus to another application.
|
||||
utils.sendNativeMouseEvent(window.mozInnerScreenX, window.mozInnerScreenY,
|
||||
nativeMouseMove, 0, window.documentElement);
|
||||
|
||||
panel.openPopup(document.getElementById("anchor"), "after_start");
|
||||
}
|
||||
|
||||
function sendMouseEvent() {
|
||||
rect = panel.getBoundingClientRect();
|
||||
let x = window.mozInnerScreenX + rect.left + 1;
|
||||
let y = window.mozInnerScreenY + rect.top + 2;
|
||||
utils.sendNativeMouseEvent(x, y, nativeMouseMove, 0,
|
||||
window.documentElement);
|
||||
}
|
||||
|
||||
function checkCoords(event) {
|
||||
is(event.clientX, rect.left + 1, "Motion x coordinate");
|
||||
is(event.clientY, rect.top + 2, "Motion y coordinate");
|
||||
done();
|
||||
}
|
||||
|
||||
function done() {
|
||||
SimpleTest.finish();
|
||||
}
|
||||
]]>
|
||||
</script>
|
||||
</window>
|
@ -613,7 +613,9 @@ public:
|
||||
class NodePool
|
||||
{
|
||||
private:
|
||||
enum { BlockSize = 8 * 1024 }; // could be int template parameter
|
||||
// The -2 allows us to use |BlockSize + 1| for |mEntries|, and fit |mNext|,
|
||||
// all without causing slop.
|
||||
enum { BlockSize = 8 * 1024 - 2 };
|
||||
|
||||
struct Block
|
||||
{
|
||||
@ -623,6 +625,13 @@ private:
|
||||
Block()
|
||||
{
|
||||
NS_NOTREACHED("should never be called");
|
||||
|
||||
// Ensure Block is the right size (see the comment on BlockSize above).
|
||||
static_assert(
|
||||
sizeof(Block) == 163824 || // 32-bit; equals 39.997 pages
|
||||
sizeof(Block) == 262120, // 64-bit; equals 63.994 pages
|
||||
"ill-sized NodePool::Block"
|
||||
);
|
||||
}
|
||||
~Block()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user