Bug 1173463 - Log the content type and url in GStreamerReader. r=edwin
authorRalph Giles <giles@mozilla.com>
Wed, 10 Jun 2015 14:22:00 -0700
changeset 248391 67dff5bcf4fcfa9b2ee67b3f7bf060be49a5d15b
parent 248390 50bae2bd8bf8cbc293672dda72f1a3e9f673a05d
child 248392 25c21f6ebb6526c392faecc06f226eb15982222a
push id28893
push userkwierso@gmail.com
push dateFri, 12 Jun 2015 00:02:58 +0000
treeherderautoland@8cf9d3e497f9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersedwin
bugs1173463
milestone41.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 1173463 - Log the content type and url in GStreamerReader. r=edwin Helps isolate resources we fail to play when debugging gstreamer pipeline issues.
dom/media/gstreamer/GStreamerFormatHelper.cpp
dom/media/gstreamer/GStreamerReader.cpp
--- a/dom/media/gstreamer/GStreamerFormatHelper.cpp
+++ b/dom/media/gstreamer/GStreamerFormatHelper.cpp
@@ -3,23 +3,28 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "GStreamerFormatHelper.h"
 #include "nsCharSeparatedTokenizer.h"
 #include "nsString.h"
 #include "GStreamerLoader.h"
+#include "mozilla/Logging.h"
 #include "mozilla/Preferences.h"
 
 #define ENTRY_FORMAT(entry) entry[0]
 #define ENTRY_CAPS(entry) entry[1]
 
 namespace mozilla {
 
+extern PRLogModuleInfo* gMediaDecoderLog;
+#define LOG(msg, ...) \
+    MOZ_LOG(gMediaDecoderLog, LogLevel::Debug, ("GStreamerFormatHelper " msg, ##__VA_ARGS__))
+
 GStreamerFormatHelper* GStreamerFormatHelper::gInstance = nullptr;
 bool GStreamerFormatHelper::sLoadOK = false;
 
 GStreamerFormatHelper* GStreamerFormatHelper::Instance() {
   if (!gInstance) {
     if ((sLoadOK = load_gstreamer())) {
       gst_init(nullptr, nullptr);
     }
--- a/dom/media/gstreamer/GStreamerReader.cpp
+++ b/dom/media/gstreamer/GStreamerReader.cpp
@@ -369,16 +369,19 @@ nsresult GStreamerReader::ReadMetadata(M
   MOZ_ASSERT(OnTaskQueue());
   nsresult ret = NS_OK;
 
   /*
    * Parse MP3 headers before we kick off the GStreamer pipeline otherwise there
    * might be concurrent stream operations happening on both decoding and gstreamer
    * threads which will screw the GStreamer state machine.
    */
+  LOG(LogLevel::Debug, "content-type: %s %s",
+      mDecoder->GetResource()->GetContentType().get(),
+      mDecoder->GetResource()->GetContentURL().get());
   bool isMP3 = mDecoder->GetResource()->GetContentType().EqualsASCII(AUDIO_MP3);
   if (isMP3) {
     ParseMP3Headers();
   }
 
 
   /* We do 3 attempts here: decoding audio and video, decoding video only,
    * decoding audio only. This allows us to play streams that have one broken