Bug 1414991 - Unified build fixes in media. r=gerald draft
authorChris Pearce <cpearce@mozilla.com>
Tue, 07 Nov 2017 12:57:34 +1300
changeset 693892 37b7222bfbadc0836acdeee19ebd82676872b4ea
parent 693772 4ea775c267be77107929d68799628a66027f3172
child 739180 b0a5100b99adead6bc0384e9c8a31b4293b988e6
push id87961
push userbmo:cpearce@mozilla.com
push dateTue, 07 Nov 2017 01:04:47 +0000
reviewersgerald
bugs1414991
milestone58.0a1
Bug 1414991 - Unified build fixes in media. r=gerald MozReview-Commit-ID: KjLeQMSxOfO
dom/media/MediaShutdownManager.cpp
dom/media/mediasink/AudioSinkWrapper.cpp
media/libstagefright/binding/DecoderData.cpp
media/libstagefright/binding/H264.cpp
media/libstagefright/binding/include/mp4_demuxer/AnnexB.h
media/libstagefright/binding/include/mp4_demuxer/DecoderData.h
--- a/dom/media/MediaShutdownManager.cpp
+++ b/dom/media/MediaShutdownManager.cpp
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* 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 "mozilla/Logging.h"
 #include "mozilla/StaticPtr.h"
-#include "nsContentUtils.h"
+#include "mozilla/Services.h"
 
 #include "MediaDecoder.h"
 #include "MediaShutdownManager.h"
 
 namespace mozilla {
 
 #undef LOGW
 
--- a/dom/media/mediasink/AudioSinkWrapper.cpp
+++ b/dom/media/mediasink/AudioSinkWrapper.cpp
@@ -1,16 +1,18 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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 "AudioSink.h"
 #include "AudioSinkWrapper.h"
+#include "nsPrintfCString.h"
+#include "VideoUtils.h"
 
 namespace mozilla {
 namespace media {
 
 AudioSinkWrapper::~AudioSinkWrapper()
 {
 }
 
--- a/media/libstagefright/binding/DecoderData.cpp
+++ b/media/libstagefright/binding/DecoderData.cpp
@@ -82,37 +82,37 @@ FindData(const MetaData* aMetaData, uint
 }
 
 static bool
 FindData(const MetaData* aMetaData, uint32_t aKey, mozilla::MediaByteBuffer* aDest)
 {
   return FindData(aMetaData, aKey, static_cast<nsTArray<uint8_t>*>(aDest));
 }
 
-Result<Ok, nsresult>
+mozilla::Result<mozilla::Ok, nsresult>
 CryptoFile::DoUpdate(const uint8_t* aData, size_t aLength)
 {
   BufferReader reader(aData, aLength);
   while (reader.Remaining()) {
     PsshInfo psshInfo;
     if (!reader.ReadArray(psshInfo.uuid, 16)) {
-      return Err(NS_ERROR_FAILURE);
+      return mozilla::Err(NS_ERROR_FAILURE);
     }
 
     if (!reader.CanReadType<uint32_t>()) {
-      return Err(NS_ERROR_FAILURE);
+      return mozilla::Err(NS_ERROR_FAILURE);
     }
     auto length = reader.ReadType<uint32_t>();
 
     if (!reader.ReadArray(psshInfo.data, length)) {
-      return Err(NS_ERROR_FAILURE);
+      return mozilla::Err(NS_ERROR_FAILURE);
     }
     pssh.AppendElement(psshInfo);
   }
-  return Ok();
+  return mozilla::Ok();
 }
 
 static void
 UpdateTrackInfo(mozilla::TrackInfo& aConfig,
                 const MetaData* aMetaData,
                 const char* aMimeType)
 {
   mozilla::CryptoTrack& crypto = aConfig.mCrypto;
--- a/media/libstagefright/binding/H264.cpp
+++ b/media/libstagefright/binding/H264.cpp
@@ -1,14 +1,15 @@
 /* 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 "mozilla/ArrayUtils.h"
 #include "mozilla/PodOperations.h"
+#include "mozilla/ResultExtensions.h"
 #include "mp4_demuxer/AnnexB.h"
 #include "mp4_demuxer/BitReader.h"
 #include "mp4_demuxer/BufferReader.h"
 #include "mp4_demuxer/ByteWriter.h"
 #include "mp4_demuxer/H264.h"
 #include <media/stagefright/foundation/ABitReader.h>
 #include <limits>
 #include <cmath>
--- a/media/libstagefright/binding/include/mp4_demuxer/AnnexB.h
+++ b/media/libstagefright/binding/include/mp4_demuxer/AnnexB.h
@@ -1,15 +1,18 @@
 /* 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/. */
 
 #ifndef MP4_DEMUXER_ANNEX_B_H_
 #define MP4_DEMUXER_ANNEX_B_H_
 
+#include "mozilla/Result.h"
+#include "ErrorList.h"
+
 template <class T> struct already_AddRefed;
 
 namespace mozilla {
 class MediaRawData;
 class MediaByteBuffer;
 }
 
 namespace mp4_demuxer
--- a/media/libstagefright/binding/include/mp4_demuxer/DecoderData.h
+++ b/media/libstagefright/binding/include/mp4_demuxer/DecoderData.h
@@ -2,19 +2,20 @@
  * 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/. */
 
 #ifndef DECODER_DATA_H_
 #define DECODER_DATA_H_
 
 #include "MediaData.h"
 #include "MediaInfo.h"
+#include "mozilla/RefPtr.h"
+#include "mozilla/Result.h"
 #include "mozilla/Types.h"
 #include "mozilla/Vector.h"
-#include "mozilla/RefPtr.h"
 #include "nsString.h"
 #include "nsTArray.h"
 #include "nsString.h"
 
 namespace stagefright
 {
 class MetaData;
 }