Backed out 3 changesets (bug 1446233) for Wr failures in /html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-two-cue-layout-after-first-end.html on a CLOSED TREE

Backed out changeset ed217fb39a92 (bug 1446233)
Backed out changeset f5bec009a111 (bug 1446233)
Backed out changeset a71dd6219f8a (bug 1446233)
This commit is contained in:
shindli 2018-03-23 04:11:01 +02:00
parent ac696a0587
commit 5d297279b1
7 changed files with 18 additions and 106 deletions

4
Cargo.lock generated
View File

@ -71,7 +71,7 @@ dependencies = [
[[package]]
name = "audioipc-client"
version = "0.4.0"
version = "0.3.0"
dependencies = [
"audioipc 0.2.2",
"cubeb-backend 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -724,7 +724,7 @@ dependencies = [
name = "gkrust-shared"
version = "0.1.0"
dependencies = [
"audioipc-client 0.4.0",
"audioipc-client 0.3.0",
"audioipc-server 0.2.2",
"cose-c 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"cubeb-pulse 0.1.1",

View File

@ -29,9 +29,6 @@
#include "GeneratedJNIWrappers.h"
#endif
#define AUDIOIPC_POOL_SIZE_DEFAULT 1
#define AUDIOIPC_STACK_SIZE_DEFAULT (64*1024)
#define PREF_VOLUME_SCALE "media.volume_scale"
#define PREF_CUBEB_BACKEND "media.cubeb.backend"
#define PREF_CUBEB_LATENCY_PLAYBACK "media.cubeb_latency_playback_ms"
@ -41,8 +38,6 @@
#define PREF_CUBEB_FORCE_SAMPLE_RATE "media.cubeb.force_sample_rate"
#define PREF_CUBEB_LOGGING_LEVEL "media.cubeb.logging_level"
#define PREF_CUBEB_SANDBOX "media.cubeb.sandbox"
#define PREF_AUDIOIPC_POOL_SIZE "media.audioipc.pool_size"
#define PREF_AUDIOIPC_STACK_SIZE "media.audioipc.stack_size"
#define MASK_MONO (1 << AudioConfig::CHANNEL_MONO)
#define MASK_MONO_LFE (MASK_MONO | (1 << AudioConfig::CHANNEL_LFE))
@ -66,19 +61,12 @@
#endif
extern "C" {
struct AudioIpcInitParams {
int mServerConnection;
size_t mPoolSize;
size_t mStackSize;
};
// These functions are provided by audioipc-server crate
extern void* audioipc_server_start();
extern mozilla::ipc::FileDescriptor::PlatformHandleType audioipc_server_new_client(void*);
extern void audioipc_server_stop(void*);
// These functions are provided by audioipc-client crate
extern int audioipc_client_init(cubeb**, const char*, const AudioIpcInitParams*);
extern int audioipc_client_init(cubeb**, const char*, int);
}
namespace mozilla {
@ -145,9 +133,7 @@ bool sCubebPlaybackLatencyPrefSet = false;
bool sCubebMSGLatencyPrefSet = false;
bool sAudioStreamInitEverSucceeded = false;
#ifdef MOZ_CUBEB_REMOTING
bool sCubebSandbox = false;
size_t sAudioIPCPoolSize;
size_t sAudioIPCStackSize;
bool sCubebSandbox;
#endif
StaticAutoPtr<char> sBrandName;
StaticAutoPtr<char> sCubebBackendName;
@ -297,16 +283,6 @@ void PrefChanged(const char* aPref, void* aClosure)
StartSoundServer();
}
}
else if (strcmp(aPref, PREF_AUDIOIPC_POOL_SIZE) == 0) {
StaticMutexAutoLock lock(sMutex);
sAudioIPCPoolSize = Preferences::GetUint(PREF_AUDIOIPC_POOL_SIZE,
AUDIOIPC_POOL_SIZE_DEFAULT);
}
else if (strcmp(aPref, PREF_AUDIOIPC_STACK_SIZE) == 0) {
StaticMutexAutoLock lock(sMutex);
sAudioIPCStackSize = Preferences::GetUint(PREF_AUDIOIPC_STACK_SIZE,
AUDIOIPC_STACK_SIZE_DEFAULT);
}
#endif
}
@ -504,17 +480,11 @@ cubeb* GetCubebContextUnlocked()
}
}
AudioIpcInitParams initParams;
initParams.mPoolSize = sAudioIPCPoolSize;
initParams.mStackSize = sAudioIPCStackSize;
initParams.mServerConnection = sIPCConnection->ClonePlatformHandle().release();
MOZ_LOG(gCubebLog, LogLevel::Debug, ("%s: %d", PREF_AUDIOIPC_POOL_SIZE, (int) initParams.mPoolSize));
MOZ_LOG(gCubebLog, LogLevel::Debug, ("%s: %d", PREF_AUDIOIPC_STACK_SIZE, (int) initParams.mStackSize));
MOZ_LOG(gCubebLog, LogLevel::Info, ("%s: %s", PREF_CUBEB_SANDBOX, sCubebSandbox ? "true" : "false"));
int rv = sCubebSandbox
? audioipc_client_init(&sCubebContext, sBrandName, &initParams)
? audioipc_client_init(&sCubebContext, sBrandName,
sIPCConnection->ClonePlatformHandle().release())
: cubeb_init(&sCubebContext, sBrandName, sCubebBackendName.get());
sIPCConnection = nullptr;
#else // !MOZ_CUBEB_REMOTING
@ -609,8 +579,6 @@ void InitLibrary()
Preferences::RegisterCallback(PrefChanged, PREF_CUBEB_FORCE_SAMPLE_RATE);
Preferences::RegisterCallbackAndCall(PrefChanged, PREF_CUBEB_BACKEND);
Preferences::RegisterCallbackAndCall(PrefChanged, PREF_CUBEB_SANDBOX);
Preferences::RegisterCallbackAndCall(PrefChanged, PREF_AUDIOIPC_POOL_SIZE);
Preferences::RegisterCallbackAndCall(PrefChanged, PREF_AUDIOIPC_STACK_SIZE);
if (MOZ_LOG_TEST(gCubebLog, LogLevel::Verbose)) {
cubeb_set_log_callback(CUBEB_LOG_VERBOSE, CubebLogCallback);
} else if (MOZ_LOG_TEST(gCubebLog, LogLevel::Error)) {
@ -635,8 +603,6 @@ void InitLibrary()
void ShutdownLibrary()
{
Preferences::UnregisterCallback(PrefChanged, PREF_VOLUME_SCALE);
Preferences::UnregisterCallback(PrefChanged, PREF_AUDIOIPC_STACK_SIZE);
Preferences::UnregisterCallback(PrefChanged, PREF_AUDIOIPC_POOL_SIZE);
Preferences::UnregisterCallback(PrefChanged, PREF_CUBEB_SANDBOX);
Preferences::UnregisterCallback(PrefChanged, PREF_CUBEB_BACKEND);
Preferences::UnregisterCallback(PrefChanged, PREF_CUBEB_LATENCY_PLAYBACK);

View File

@ -5,4 +5,4 @@ Makefile.in build files for the Mozilla build system.
The audioipc-2 git repository is: https://github.com/djg/audioipc-2.git
The git commit ID used was b93386611d7d9689c4f0177a4704f0adc16bc2d1 (2018-03-09 14:45:24 +1000)
The git commit ID used was f6c4829f826950fc059dbf7b33e8aa9e20c447a5 (2018-03-07 20:25:18 +0100)

View File

@ -1,6 +1,6 @@
[package]
name = "audioipc-client"
version = "0.4.0"
version = "0.3.0"
authors = [
"Matthew Gregan <kinetik@flim.org>",
"Dan Glastonbury <dan.glastonbury@gmail.com>"
@ -12,7 +12,7 @@ audioipc = { path="../audioipc" }
cubeb-backend = "0.4"
foreign-types = "0.3"
futures = { version="0.1.18", default-features=false, features=["use_std"] }
futures-cpupool = { version="0.1.8", default-features=false }
futures-cpupool = { version="0.1.5", default-features=false }
libc = "0.2"
log = "^0.3.6"
tokio-core = "0.1"

View File

@ -3,7 +3,7 @@
// This program is made available under an ISC-style license. See the
// accompanying file LICENSE for details
use {ClientStream, CPUPOOL_INIT_PARAMS, G_SERVER_FD};
use ClientStream;
use assert_not_in_callback;
use audioipc::{messages, ClientMessage, ServerMessage};
use audioipc::{core, rpc};
@ -69,7 +69,7 @@ impl ClientContext {
// TODO: encapsulate connect, etc inside audioipc.
fn open_server_stream() -> Result<net::UnixStream> {
unsafe {
if let Some(fd) = G_SERVER_FD {
if let Some(fd) = super::G_SERVER_FD {
return Ok(net::UnixStream::from_raw_fd(fd));
}
@ -113,14 +113,9 @@ impl ContextOps for ClientContext {
let rpc = t!(rx_rpc.recv());
let cpupool = CPUPOOL_INIT_PARAMS.with(|p| {
let params = p.replace(None).unwrap();
futures_cpupool::Builder::new()
.name_prefix("AudioIPC")
.pool_size(params.pool_size)
.stack_size(params.stack_size)
.create()
});
let cpupool = futures_cpupool::Builder::new()
.name_prefix("AudioIPC")
.create();
let ctx = Box::new(ClientContext {
_ops: &CLIENT_OPS as *const _,
@ -270,7 +265,7 @@ impl Drop for ClientContext {
debug!("ClientContext drop...");
let _ = send_recv!(self.rpc(), ClientDisconnect => ClientDisconnected);
unsafe {
if G_SERVER_FD.is_some() {
if super::G_SERVER_FD.is_some() {
libc::close(super::G_SERVER_FD.take().unwrap());
}
}

View File

@ -26,33 +26,7 @@ use std::os::raw::{c_char, c_int};
use std::os::unix::io::RawFd;
use stream::ClientStream;
type InitParamsTls = std::cell::RefCell<Option<CpuPoolInitParams>>;
thread_local!(static IN_CALLBACK: std::cell::RefCell<bool> = std::cell::RefCell::new(false));
thread_local!(static CPUPOOL_INIT_PARAMS: InitParamsTls = std::cell::RefCell::new(None));
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct AudioIpcInitParams {
pub server_connection: c_int,
pub pool_size: usize,
pub stack_size: usize,
}
#[derive(Clone, Copy, Debug)]
struct CpuPoolInitParams {
pub pool_size: usize,
pub stack_size: usize,
}
impl CpuPoolInitParams {
pub fn init_with(params: &AudioIpcInitParams) -> Self {
CpuPoolInitParams {
pool_size: params.pool_size,
stack_size: params.stack_size,
}
}
}
fn set_in_callback(in_callback: bool) {
IN_CALLBACK.with(|b| {
@ -67,15 +41,6 @@ fn assert_not_in_callback() {
});
}
fn set_cpupool_init_params<P>(params: P)
where
P: Into<Option<CpuPoolInitParams>>,
{
CPUPOOL_INIT_PARAMS.with(|p| {
*p.borrow_mut() = params.into();
});
}
static mut G_SERVER_FD: Option<RawFd> = None;
#[no_mangle]
@ -83,24 +48,15 @@ static mut G_SERVER_FD: Option<RawFd> = None;
pub unsafe extern "C" fn audioipc_client_init(
c: *mut *mut ffi::cubeb,
context_name: *const c_char,
init_params: *const AudioIpcInitParams,
server_connection: c_int,
) -> c_int {
if init_params.is_null() {
return cubeb_backend::ffi::CUBEB_ERROR;
}
let init_params = &*init_params;
// TODO: Windows portability (for fd).
// TODO: Better way to pass extra parameters to Context impl.
if G_SERVER_FD.is_some() {
panic!("audioipc client's server connection already initialized.");
}
if init_params.server_connection >= 0 {
G_SERVER_FD = Some(init_params.server_connection);
if server_connection >= 0 {
G_SERVER_FD = Some(server_connection);
}
let cpupool_init_params = CpuPoolInitParams::init_with(&init_params);
set_cpupool_init_params(cpupool_init_params);
capi::capi_init::<ClientContext>(c, context_name)
}

View File

@ -666,11 +666,6 @@ pref("media.cubeb.logging_level", "");
// Cubeb sandbox (remoting) control
#ifdef XP_LINUX
pref("media.cubeb.sandbox", true);
// The cubeb pulse audio backend effectively serializes callbacks so
// only 1 thread is required.
pref("media.audioipc.pool_size", 1);
// 64 kB stack per pool thread.
pref("media.audioipc.stack_size", 65536);
#else
pref("media.cubeb.sandbox", false);
#endif