Bug 1215582 - Rename Blacklist to Block list in GStreamerFormatReader. r=gerald
authorRalph Giles <giles@mozilla.com>
Tue, 20 Oct 2015 15:19:00 -0700
changeset 303918 e129ed7e555e57305734e3de5c7a0a1e3b44123d
parent 303917 2f41484b6005d717622f980b4c1ccc506bca52c4
child 303919 a286c89173e5352fc8831015d7e286fb513fc427
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1215582
milestone44.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 1215582 - Rename Blacklist to Block list in GStreamerFormatReader. r=gerald This term always bothered me. "Block list" sounds more neutral. I've left the name of the actual pref alone to avoid breaking people's customizations.
dom/media/gstreamer/GStreamerFormatHelper.cpp
dom/media/gstreamer/GStreamerFormatHelper.h
dom/media/gstreamer/GStreamerReader.cpp
dom/media/gstreamer/GStreamerReader.h
--- a/dom/media/gstreamer/GStreamerFormatHelper.cpp
+++ b/dom/media/gstreamer/GStreamerFormatHelper.cpp
@@ -67,17 +67,17 @@ static char const * const sDefaultCodecC
   {"video/x-m4v", "video/x-h264"},
   {"video/quicktime", "video/x-h264"},
   {"audio/mp4", "audio/mpeg, mpegversion=(int)4"},
   {"audio/x-m4a", "audio/mpeg, mpegversion=(int)4"},
   {"audio/mp3", "audio/mpeg, layer=(int)3"},
   {"audio/mpeg", "audio/mpeg, layer=(int)3"}
 };
 
-static char const * const sPluginBlacklist[] = {
+static char const * const sPluginBlockList[] = {
   "flump3dec",
   "h264parse",
 };
 
 GStreamerFormatHelper::GStreamerFormatHelper()
   : mFactories(nullptr),
     mCookie(static_cast<uint32_t>(-1))
 {
@@ -212,42 +212,42 @@ GstCaps* GStreamerFormatHelper::ConvertF
     /* appends and frees tmp */
     gst_caps_append(caps, tmp);
   }
 
   return caps;
 }
 
 /* static */ bool
-GStreamerFormatHelper::IsBlacklistEnabled()
+GStreamerFormatHelper::IsBlockListEnabled()
 {
-  static bool sBlacklistEnabled;
-  static bool sBlacklistEnabledCached = false;
+  static bool sBlockListEnabled;
+  static bool sBlockListEnabledCached = false;
 
-  if (!sBlacklistEnabledCached) {
-    Preferences::AddBoolVarCache(&sBlacklistEnabled,
+  if (!sBlockListEnabledCached) {
+    Preferences::AddBoolVarCache(&sBlockListEnabled,
                                  "media.gstreamer.enable-blacklist", true);
-    sBlacklistEnabledCached = true;
+    sBlockListEnabledCached = true;
   }
 
-  return sBlacklistEnabled;
+  return sBlockListEnabled;
 }
 
 /* static */ bool
-GStreamerFormatHelper::IsPluginFeatureBlacklisted(GstPluginFeature *aFeature)
+GStreamerFormatHelper::IsPluginFeatureBlocked(GstPluginFeature *aFeature)
 {
-  if (!IsBlacklistEnabled()) {
+  if (!IsBlockListEnabled()) {
     return false;
   }
 
   const gchar *factoryName =
     gst_plugin_feature_get_name(aFeature);
 
-  for (unsigned int i = 0; i < G_N_ELEMENTS(sPluginBlacklist); i++) {
-    if (!strcmp(factoryName, sPluginBlacklist[i])) {
+  for (unsigned int i = 0; i < G_N_ELEMENTS(sPluginBlockList); i++) {
+    if (!strcmp(factoryName, sPluginBlockList[i])) {
       LOG("rejecting disabled plugin %s", factoryName);
       return true;
     }
   }
 
   return false;
 }
 
@@ -263,17 +263,17 @@ static gboolean FactoryFilter(GstPluginF
   // NB: We skip filtering parsers here, because adding them to
   // the list can give false decoder positives to canPlayType().
   if (!strstr(className, "Decoder") && !strstr(className, "Demux")) {
     return FALSE;
   }
 
   return
     gst_plugin_feature_get_rank(aFeature) >= GST_RANK_MARGINAL &&
-    !GStreamerFormatHelper::IsPluginFeatureBlacklisted(aFeature);
+    !GStreamerFormatHelper::IsPluginFeatureBlocked(aFeature);
 }
 
 /**
  * Returns true if any |aFactory| caps intersect with |aCaps|
  */
 static bool SupportsCaps(GstElementFactory *aFactory, GstCaps *aCaps)
 {
   for (const GList *iter = gst_element_factory_get_static_pad_templates(aFactory); iter; iter = iter->next) {
--- a/dom/media/gstreamer/GStreamerFormatHelper.h
+++ b/dom/media/gstreamer/GStreamerFormatHelper.h
@@ -24,18 +24,18 @@ class GStreamerFormatHelper {
     ~GStreamerFormatHelper();
 
     bool CanHandleMediaType(const nsACString& aMIMEType,
                             const nsAString* aCodecs);
 
     bool CanHandleContainerCaps(GstCaps* aCaps);
     bool CanHandleCodecCaps(GstCaps* aCaps);
 
-    static bool IsBlacklistEnabled();
-    static bool IsPluginFeatureBlacklisted(GstPluginFeature *aFeature);
+    static bool IsBlockListEnabled();
+    static bool IsPluginFeatureBlocked(GstPluginFeature *aFeature);
 
     static GstCaps* ConvertFormatsToCaps(const char* aMIMEType,
                                          const nsAString* aCodecs);
 
     static void Shutdown();
 
   private:
     GStreamerFormatHelper();
--- a/dom/media/gstreamer/GStreamerReader.cpp
+++ b/dom/media/gstreamer/GStreamerReader.cpp
@@ -253,17 +253,17 @@ GValueArray *GStreamerReader::ElementFil
                                             GValueArray *aFactories)
 {
   GValueArray *filtered = g_value_array_new(aFactories->n_values);
 
   for (unsigned int i = 0; i < aFactories->n_values; i++) {
     GValue *value = &aFactories->values[i];
     GstPluginFeature *factory = GST_PLUGIN_FEATURE(g_value_peek_pointer(value));
 
-    if (!GStreamerFormatHelper::IsPluginFeatureBlacklisted(factory)) {
+    if (!GStreamerFormatHelper::IsPluginFeatureBlocked(factory)) {
       g_value_array_append(filtered, value);
     }
   }
 
   return filtered;
 }
 
 void GStreamerReader::PlayBinSourceSetupCb(GstElement* aPlayBin,
@@ -1201,17 +1201,17 @@ void GStreamerReader::Eos(GstAppSink* aS
     mon.NotifyAll();
   }
 }
 
 /**
  * This callback is called while the pipeline is automatically built, after a
  * new element has been added to the pipeline. We use it to find the
  * uridecodebin instance used by playbin and connect to it to apply our
- * blacklist.
+ * block list.
  */
 void
 GStreamerReader::PlayElementAddedCb(GstBin *aBin, GstElement *aElement,
                                     gpointer *aUserData)
 {
   const static char sUriDecodeBinPrefix[] = "uridecodebin";
   gchar *name = gst_element_get_name(aElement);
 
@@ -1238,17 +1238,17 @@ GStreamerReader::ShouldAutoplugFactory(G
     autoplug = true;
   }
 
   return autoplug;
 }
 
 /**
  * This is called by uridecodebin (running inside playbin), after it has found
- * candidate factories to continue decoding the stream. We apply the blacklist
+ * candidate factories to continue decoding the stream. We apply the block list
  * here, disallowing known-crashy plugins.
  */
 GValueArray*
 GStreamerReader::AutoplugSortCb(GstElement* aElement, GstPad* aPad,
                                 GstCaps* aCaps, GValueArray* aFactories)
 {
   if (!aFactories->n_values) {
     return nullptr;
--- a/dom/media/gstreamer/GStreamerReader.h
+++ b/dom/media/gstreamer/GStreamerReader.h
@@ -88,18 +88,18 @@ private:
 
   /* Gst callbacks */
 
   static GstBusSyncReply ErrorCb(GstBus *aBus, GstMessage *aMessage, gpointer aUserData);
   GstBusSyncReply Error(GstBus *aBus, GstMessage *aMessage);
 
   /*
    * We attach this callback to playbin so that when uridecodebin is
-   * constructed, we can then list for its autoplug-sort signal to blacklist
-   * the elements it can construct.
+   * constructed, we can then list for its autoplug-sort signal to block
+   * list the elements it can construct.
    */
   static void ElementAddedCb(GstBin *aPlayBin,
                              GstElement *aElement,
                              gpointer aUserData);
 
   /*
    * Called on the autoplug-sort signal emitted by uridecodebin for filtering
    * the elements it uses.
@@ -189,17 +189,17 @@ private:
   static void PlayElementAddedCb(GstBin *aBin, GstElement *aElement,
                                  gpointer *aUserData);
 
   /* Called during decoding, to decide whether a (sub)stream should be decoded or
    * ignored */
   static bool ShouldAutoplugFactory(GstElementFactory* aFactory, GstCaps* aCaps);
 
   /* Called by decodebin during autoplugging. We use it to apply our
-   * container/codec blacklist.
+   * container/codec block list.
    */
   static GValueArray* AutoplugSortCb(GstElement* aElement,
                                      GstPad* aPad, GstCaps* aCaps,
                                      GValueArray* aFactories);
 
   // Try to find MP3 headers in this stream using our MP3 frame parser.
   nsresult ParseMP3Headers();