Backed out 5 changesets for commit message corruption (bug 1065111, bug 1105661). a=dmajor
authorRalph Giles <giles@mozilla.com>
Mon, 15 Dec 2014 13:58:59 -0800
changeset 242425 676eee1ff92cf67d991c71064c2de3724aff440e
parent 242424 05f1c932901512acbf00121a78cc55d92abb151c
child 242426 396b0e2607bcb650b432e358363a302c5d7d9488
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdmajor
bugs1065111, 1105661
milestone36.0a2
backs outeeaa277587ac21a49aaca613332df8d058173945
c2e28f540b1684e55d0c97b7a51410f0e27ad020
40d3a2d82a5e6615010a62a5b7bfe0865da21154
19c1fa7c637ba1ffff7753ee052a1511e7bd029c
a5e654b057590698dc1f3a3b6dd2c36720c30f49
Backed out 5 changesets for commit message corruption (bug 1065111, bug 1105661). a=dmajor Backed out changeset eeaa277587ac (bug 1065111) Backed out changeset c2e28f540b16 (bug 1065111) Backed out changeset 40d3a2d82a5e (bug 1065111) Backed out changeset 19c1fa7c637b (bug 1065111) Backed out changeset a5e654b05759 (bug 1105661)
dom/media/fmp4/apple/AppleDecoderModule.cpp
dom/media/fmp4/apple/AppleUtils.cpp
dom/media/fmp4/apple/AppleUtils.h
dom/media/fmp4/moz.build
media/libstagefright/binding/include/mp4_demuxer/DecoderData.h
--- a/dom/media/fmp4/apple/AppleDecoderModule.cpp
+++ b/dom/media/fmp4/apple/AppleDecoderModule.cpp
@@ -8,27 +8,16 @@
 #include "AppleCMLinker.h"
 #include "AppleDecoderModule.h"
 #include "AppleVDADecoder.h"
 #include "AppleVDALinker.h"
 #include "AppleVTDecoder.h"
 #include "AppleVTLinker.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/DebugOnly.h"
-#include "prlog.h"
-
-#ifdef PR_LOGGING
-PRLogModuleInfo* GetAppleMediaLog() {
-  static PRLogModuleInfo* log = nullptr;
-  if (!log) {
-    log = PR_NewLogModule("AppleMedia");
-  }
-  return log;
-}
-#endif
 
 namespace mozilla {
 
 bool AppleDecoderModule::sInitialized = false;
 bool AppleDecoderModule::sIsVTAvailable = false;
 bool AppleDecoderModule::sIsVTHWAvailable = false;
 bool AppleDecoderModule::sIsVDAAvailable = false;
 bool AppleDecoderModule::sForceVDA = false;
new file mode 100644
--- /dev/null
+++ b/dom/media/fmp4/apple/AppleUtils.cpp
@@ -0,0 +1,67 @@
+/* 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/. */
+
+// Utility functions to help with Apple API calls.
+
+#include "AppleUtils.h"
+#include "prlog.h"
+#include "nsAutoPtr.h"
+
+#ifdef PR_LOGGING
+PRLogModuleInfo* GetAppleMediaLog() {
+  static PRLogModuleInfo* log = nullptr;
+  if (!log) {
+    log = PR_NewLogModule("AppleMedia");
+  }
+  return log;
+}
+#define WARN(...) PR_LOG(GetAppleMediaLog(), PR_LOG_WARNING, (__VA_ARGS__))
+#else
+#define WARN(...)
+#endif
+
+#define PROPERTY_ID_FORMAT "%c%c%c%c"
+#define PROPERTY_ID_PRINT(x) ((x) >> 24), \
+                             ((x) >> 16) & 0xff, \
+                             ((x) >> 8) & 0xff, \
+                              (x) & 0xff
+
+namespace mozilla {
+
+void
+AppleUtils::SetCFDict(CFMutableDictionaryRef dict,
+                      const char* key,
+                      const char* value)
+{
+  // We avoid using the CFSTR macros because there's no way to release those.
+  AutoCFRelease<CFStringRef> keyRef =
+    CFStringCreateWithCString(NULL, key, kCFStringEncodingUTF8);
+  AutoCFRelease<CFStringRef> valueRef =
+    CFStringCreateWithCString(NULL, value, kCFStringEncodingUTF8);
+  CFDictionarySetValue(dict, keyRef, valueRef);
+}
+
+void
+AppleUtils::SetCFDict(CFMutableDictionaryRef dict,
+                      const char* key,
+                      int32_t value)
+{
+  AutoCFRelease<CFNumberRef> valueRef =
+    CFNumberCreate(NULL, kCFNumberSInt32Type, &value);
+  AutoCFRelease<CFStringRef> keyRef =
+    CFStringCreateWithCString(NULL, key, kCFStringEncodingUTF8);
+  CFDictionarySetValue(dict, keyRef, valueRef);
+}
+
+void
+AppleUtils::SetCFDict(CFMutableDictionaryRef dict,
+                      const char* key,
+                      bool value)
+{
+  AutoCFRelease<CFStringRef> keyRef =
+    CFStringCreateWithCString(NULL, key, kCFStringEncodingUTF8);
+  CFDictionarySetValue(dict, keyRef, value ? kCFBooleanTrue : kCFBooleanFalse);
+}
+
+} // namespace mozilla
--- a/dom/media/fmp4/apple/AppleUtils.h
+++ b/dom/media/fmp4/apple/AppleUtils.h
@@ -2,20 +2,37 @@
  * 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/. */
 
 // Utility functions to help with Apple API calls.
 
 #ifndef mozilla_AppleUtils_h
 #define mozilla_AppleUtils_h
 
+#include <AudioToolbox/AudioToolbox.h>
 #include "mozilla/Attributes.h"
+#include "nsError.h"
 
 namespace mozilla {
 
+struct AppleUtils {
+  // Helper to set a string, string pair on a CFMutableDictionaryRef.
+  static void SetCFDict(CFMutableDictionaryRef dict,
+                        const char* key,
+                        const char* value);
+  // Helper to set a string, int32_t pair on a CFMutableDictionaryRef.
+  static void SetCFDict(CFMutableDictionaryRef dict,
+                        const char* key,
+                        int32_t value);
+  // Helper to set a string, bool pair on a CFMutableDictionaryRef.
+  static void SetCFDict(CFMutableDictionaryRef dict,
+                        const char* key,
+                        bool value);
+};
+
 // Wrapper class to call CFRelease on reference types
 // when they go out of scope.
 template <class T>
 class AutoCFRelease {
 public:
   MOZ_IMPLICIT AutoCFRelease(T aRef)
     : mRef(aRef)
   {
--- a/dom/media/fmp4/moz.build
+++ b/dom/media/fmp4/moz.build
@@ -48,16 +48,17 @@ if CONFIG['MOZ_FFMPEG']:
 if CONFIG['MOZ_APPLEMEDIA']:
   EXPORTS += [
       'apple/AppleDecoderModule.h',
   ]
   UNIFIED_SOURCES += [
       'apple/AppleATDecoder.cpp',
       'apple/AppleCMLinker.cpp',
       'apple/AppleDecoderModule.cpp',
+      'apple/AppleUtils.cpp',
       'apple/AppleVDADecoder.cpp',
       'apple/AppleVDALinker.cpp',
       'apple/AppleVTDecoder.cpp',
       'apple/AppleVTLinker.cpp',
   ]
   OS_LIBS += [
       '-framework AudioToolbox',
   ]
--- a/media/libstagefright/binding/include/mp4_demuxer/DecoderData.h
+++ b/media/libstagefright/binding/include/mp4_demuxer/DecoderData.h
@@ -161,13 +161,13 @@ public:
   size_t size;
 
   CryptoSample crypto;
   nsRefPtr<nsRcTArray<uint8_t>> prefix_data;
 
   void Prepend(const uint8_t* aData, size_t aSize);
 
 private:
-  nsAutoArrayPtr<uint8_t> extra_buffer;
+  nsAutoPtr<uint8_t> extra_buffer;
 };
 }
 
 #endif