1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/media/webrtc/LoadManagerFactory.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,43 @@ 1.4 +/* -*- Mode: C++; tab-width: 50; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "LoadManager.h" 1.10 +#include "LoadManagerFactory.h" 1.11 +#include "MainThreadUtils.h" 1.12 + 1.13 +#include "mozilla/Preferences.h" 1.14 + 1.15 +namespace mozilla { 1.16 + 1.17 +LoadManager* LoadManagerBuild(void) 1.18 +{ 1.19 + MOZ_ASSERT(NS_IsMainThread()); 1.20 + 1.21 +#if defined(ANDROID) || defined(LINUX) 1.22 + int loadMeasurementInterval = 1.23 + mozilla::Preferences::GetInt("media.navigator.load_adapt.measure_interval", 1000); 1.24 + int averagingSeconds = 1.25 + mozilla::Preferences::GetInt("media.navigator.load_adapt.avg_seconds", 3); 1.26 + float highLoadThreshold = 1.27 + mozilla::Preferences::GetFloat("media.navigator.load_adapt.high_load", 0.90); 1.28 + float lowLoadThreshold = 1.29 + mozilla::Preferences::GetFloat("media.navigator.load_adapt.low_load", 0.40); 1.30 + 1.31 + return new LoadManager(loadMeasurementInterval, 1.32 + averagingSeconds, 1.33 + highLoadThreshold, 1.34 + lowLoadThreshold); 1.35 +#else 1.36 + // LoadManager not implemented on this platform. 1.37 + return nullptr; 1.38 +#endif 1.39 +} 1.40 + 1.41 +void LoadManagerDestroy(mozilla::LoadManager* aLoadManager) 1.42 +{ 1.43 + delete aLoadManager; 1.44 +} 1.45 + 1.46 +}; // namespace