Bug 794282 - Enable gstreamer by default in builds, but pref off r=cpearce,khuey
authorEdwin Flores <eflores@mozilla.com>
Sat, 22 Jun 2013 11:16:53 +1200
changeset 147523 0f5225fd56225f229541c60e02f079c18d7374ef
parent 147522 ca547b83df2604473824f6b1bed850008deb0c94
child 147524 763400c1a485ef2ba15d217b7277d083a7a8f6a2
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce, khuey
bugs794282
milestone24.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 794282 - Enable gstreamer by default in builds, but pref off r=cpearce,khuey
configure.in
content/media/gstreamer/GStreamerDecoder.cpp
content/media/gstreamer/GStreamerLoader.cpp
content/media/test/manifest.js
modules/libpref/src/init/all.js
--- a/configure.in
+++ b/configure.in
@@ -5751,16 +5751,20 @@ fi
 
 AC_SUBST(MOZ_PULSEAUDIO)
 AC_SUBST(MOZ_PULSEAUDIO_CFLAGS)
 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,
 MOZ_GSTREAMER=)
 
 if test "$MOZ_GSTREAMER"; then
     # API version, eg 0.10, 1.0 etc
     GST_API_VERSION=0.10
--- a/content/media/gstreamer/GStreamerDecoder.cpp
+++ b/content/media/gstreamer/GStreamerDecoder.cpp
@@ -15,13 +15,14 @@ MediaDecoderStateMachine* GStreamerDecod
 {
   return new MediaDecoderStateMachine(this, new GStreamerReader(this));
 }
 
 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
 
--- a/content/media/gstreamer/GStreamerLoader.cpp
+++ b/content/media/gstreamer/GStreamerLoader.cpp
@@ -39,17 +39,17 @@ load_gstreamer()
   return true;
 #endif
   static bool loaded = false;
 
   if (loaded) {
     return true;
   }
 
-  void *gstreamerLib = nullptr;
+  void *gstreamerLib = NULL;
   guint major = 0;
   guint minor = 0;
   guint micro, nano;
 
   typedef typeof(::gst_version) VersionFuncType;
   if (VersionFuncType *versionFunc = (VersionFuncType*)dlsym(RTLD_DEFAULT, "gst_version")) {
     versionFunc(&major, &minor, &micro, &nano);
   }
--- a/content/media/test/manifest.js
+++ b/content/media/test/manifest.js
@@ -690,27 +690,33 @@ function mediaTestCleanup() {
 (function() {
   // Ensure that preload preferences are comsistent
   var prefService = SpecialPowers.wrap(SpecialPowers.Components)
                                  .classes["@mozilla.org/preferences-service;1"]
                                  .getService(SpecialPowers.Ci.nsIPrefService);
   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)
       branch.setBoolPref("opus.enabled", oldOpus);
   }, false);
  })();
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -183,17 +183,17 @@ pref("media.wave.enabled", true);
 #endif
 #ifdef MOZ_WEBM
 pref("media.webm.enabled", true);
 #endif
 #ifdef MOZ_DASH
 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);
 pref("media.navigator.video.default_width",640);
 pref("media.navigator.video.default_height",480);
 pref("media.navigator.video.default_fps",30);
 pref("media.navigator.video.default_minfps",10);
 pref("media.peerconnection.enabled", true);