Bug 794282 - Enable gstreamer by default in builds, but pref off r=cpearce,khuey

This commit is contained in:
Edwin Flores 2013-06-22 11:16:53 +12:00
parent 3ce75d8a3f
commit 50e1276b08
5 changed files with 19 additions and 8 deletions

View File

@ -5756,6 +5756,10 @@ AC_SUBST(MOZ_PULSEAUDIO_LIBS)
dnl ========================================================
dnl = Enable GStreamer
dnl ========================================================
if test "$OS_TARGET" = "Linux"; then
MOZ_GSTREAMER=1
fi
MOZ_ARG_ENABLE_BOOL(gstreamer,
[ --enable-gstreamer Enable GStreamer support],
MOZ_GSTREAMER=1,

View File

@ -20,7 +20,8 @@ bool
GStreamerDecoder::CanHandleMediaType(const nsACString& aMIMEType,
const nsAString* aCodecs)
{
return GStreamerFormatHelper::Instance()->CanHandleMediaType(aMIMEType, aCodecs);
return MediaDecoder::IsGStreamerEnabled() &&
GStreamerFormatHelper::Instance()->CanHandleMediaType(aMIMEType, aCodecs);
}
} // namespace mozilla

View File

@ -44,7 +44,7 @@ load_gstreamer()
return true;
}
void *gstreamerLib = nullptr;
void *gstreamerLib = NULL;
guint major = 0;
guint minor = 0;
guint micro, nano;

View File

@ -695,19 +695,25 @@ function mediaTestCleanup() {
var branch = prefService.getBranch("media.");
var oldDefault = 2;
var oldAuto = 3;
var oldGStreamer = undefined;
var oldOpus = undefined;
try {
oldDefault = branch.getIntPref("preload.default");
oldAuto = branch.getIntPref("preload.auto");
oldOpus = branch.getBoolPref("opus.enabled");
} catch(ex) { }
try { oldGStreamer = branch.getBoolPref("gstreamer.enabled"); } catch(ex) { }
try { oldDefault = branch.getIntPref("preload.default"); } catch(ex) { }
try { oldAuto = branch.getIntPref("preload.auto"); } catch(ex) { }
try { oldOpus = branch.getBoolPref("opus.enabled"); } catch(ex) { }
branch.setIntPref("preload.default", 2); // preload_metadata
branch.setIntPref("preload.auto", 3); // preload_enough
// test opus playback iff the pref exists
if (oldOpus !== undefined)
branch.setBoolPref("opus.enabled", true);
if (oldGStreamer !== undefined)
branch.setBoolPref("gstreamer.enabled", true);
window.addEventListener("unload", function() {
if (oldGStreamer !== undefined)
branch.setBoolPref("gstreamer.enabled", oldGStreamer);
branch.setIntPref("preload.default", oldDefault);
branch.setIntPref("preload.auto", oldAuto);
if (oldOpus !== undefined)

View File

@ -188,7 +188,7 @@ pref("media.webm.enabled", true);
pref("media.dash.enabled", false);
#endif
#ifdef MOZ_GSTREAMER
pref("media.gstreamer.enabled", true);
pref("media.gstreamer.enabled", false);
#endif
#ifdef MOZ_WEBRTC
pref("media.navigator.enabled", true);