Bug 1417794 - move Adts.h, AnnexB.h and H264.h to dom/media/platform/agnostic/bytestreams. r?kinetik draft
authorAlfredo.Yang <ayang@mozilla.com>
Thu, 16 Nov 2017 15:05:17 +0800
changeset 699479 3d76325276aea50003b675ebb456e49112769803
parent 699096 a3f183201f7f183c263d554bfb15fbf0b0ed2ea4
child 740642 25a7cb135533ab6445b1dfee731fa0e4429906db
push id89587
push userbmo:ayang@mozilla.com
push dateFri, 17 Nov 2017 08:21:47 +0000
reviewerskinetik
bugs1417794
milestone59.0a1
Bug 1417794 - move Adts.h, AnnexB.h and H264.h to dom/media/platform/agnostic/bytestreams. r?kinetik MozReview-Commit-ID: LUqvIdCD2XD
dom/media/gmp/ChromiumCDMParent.cpp
dom/media/mp4/DecoderData.cpp
dom/media/mp4/MP4Demuxer.cpp
dom/media/platforms/PDMFactory.cpp
dom/media/platforms/agnostic/DummyMediaDataDecoder.cpp
dom/media/platforms/agnostic/bytestreams/Adts.cpp
dom/media/platforms/agnostic/bytestreams/Adts.h
dom/media/platforms/agnostic/bytestreams/AnnexB.cpp
dom/media/platforms/agnostic/bytestreams/AnnexB.h
dom/media/platforms/agnostic/bytestreams/H264.cpp
dom/media/platforms/agnostic/bytestreams/H264.h
dom/media/platforms/agnostic/bytestreams/moz.build
dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
dom/media/platforms/agnostic/mp4_demuxer/Adts.cpp
dom/media/platforms/agnostic/mp4_demuxer/Adts.h
dom/media/platforms/agnostic/mp4_demuxer/AnnexB.cpp
dom/media/platforms/agnostic/mp4_demuxer/AnnexB.h
dom/media/platforms/agnostic/mp4_demuxer/H264.cpp
dom/media/platforms/agnostic/mp4_demuxer/H264.h
dom/media/platforms/agnostic/mp4_demuxer/moz.build
dom/media/platforms/apple/AppleATDecoder.cpp
dom/media/platforms/apple/AppleVTDecoder.cpp
dom/media/platforms/moz.build
dom/media/platforms/wrappers/H264Converter.cpp
--- a/dom/media/gmp/ChromiumCDMParent.cpp
+++ b/dom/media/gmp/ChromiumCDMParent.cpp
@@ -13,18 +13,18 @@
 #include "GMPContentParent.h"
 #include "GMPLog.h"
 #include "GMPUtils.h"
 #include "MediaPrefs.h"
 #include "mozilla/dom/MediaKeyMessageEventBinding.h"
 #include "mozilla/gmp/GMPTypes.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/Unused.h"
-#include "mp4_demuxer/AnnexB.h"
-#include "mp4_demuxer/H264.h"
+#include "AnnexB.h"
+#include "H264.h"
 
 #define NS_DispatchToMainThread(...) CompileError_UseAbstractMainThreadInstead
 
 namespace mozilla {
 namespace gmp {
 
 using namespace eme;
 
--- a/dom/media/mp4/DecoderData.cpp
+++ b/dom/media/mp4/DecoderData.cpp
@@ -1,14 +1,14 @@
 /* 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 "mp4_demuxer/Adts.h"
-#include "mp4_demuxer/AnnexB.h"
+#include "Adts.h"
+#include "AnnexB.h"
 #include "mp4_demuxer/BufferReader.h"
 #include "mp4_demuxer/DecoderData.h"
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/EndianUtils.h"
 #include "VideoUtils.h"
 
 // OpusDecoder header is really needed only by MP4 in rust
 #include "OpusDecoder.h"
--- a/dom/media/mp4/MP4Demuxer.cpp
+++ b/dom/media/mp4/MP4Demuxer.cpp
@@ -8,18 +8,18 @@
 #include <limits>
 #include <stdint.h>
 
 #include "MP4Demuxer.h"
 
 #include "MediaPrefs.h"
 // Used for telemetry
 #include "mozilla/Telemetry.h"
-#include "mp4_demuxer/AnnexB.h"
-#include "mp4_demuxer/H264.h"
+#include "AnnexB.h"
+#include "H264.h"
 #include "mp4_demuxer/MoofParser.h"
 #include "mp4_demuxer/MP4Metadata.h"
 #include "mp4_demuxer/ResourceStream.h"
 #include "mp4_demuxer/BufferStream.h"
 #include "mp4_demuxer/Index.h"
 #include "nsAutoPtr.h"
 #include "nsPrintfCString.h"
 
--- a/dom/media/platforms/PDMFactory.cpp
+++ b/dom/media/platforms/PDMFactory.cpp
@@ -38,17 +38,17 @@
 #include "AgnosticDecoderModule.h"
 #include "EMEDecoderModule.h"
 
 #include "DecoderDoctorDiagnostics.h"
 
 #include "MP4Decoder.h"
 #include "mozilla/dom/RemoteVideoDecoder.h"
 
-#include "mp4_demuxer/H264.h"
+#include "H264.h"
 
 #include <functional>
 
 namespace mozilla {
 
 extern already_AddRefed<PlatformDecoderModule> CreateBlankDecoderModule();
 extern already_AddRefed<PlatformDecoderModule> CreateNullDecoderModule();
 
--- a/dom/media/platforms/agnostic/DummyMediaDataDecoder.cpp
+++ b/dom/media/platforms/agnostic/DummyMediaDataDecoder.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 "DummyMediaDataDecoder.h"
-#include "mp4_demuxer/AnnexB.h"
-#include "mp4_demuxer/H264.h"
+#include "AnnexB.h"
+#include "H264.h"
 #include "MP4Decoder.h"
 
 namespace mozilla {
 
 DummyDataCreator::~DummyDataCreator() {}
 
 DummyMediaDataDecoder::DummyMediaDataDecoder(UniquePtr<DummyDataCreator>&& aCreator,
                                              const nsACString& aDescription,
rename from dom/media/platforms/agnostic/mp4_demuxer/Adts.cpp
rename to dom/media/platforms/agnostic/bytestreams/Adts.cpp
--- a/dom/media/platforms/agnostic/mp4_demuxer/Adts.cpp
+++ b/dom/media/platforms/agnostic/bytestreams/Adts.cpp
@@ -1,13 +1,13 @@
 /* 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 "mp4_demuxer/Adts.h"
+#include "Adts.h"
 #include "MediaData.h"
 #include "mozilla/Array.h"
 #include "mozilla/ArrayUtils.h"
 #include "nsAutoPtr.h"
 
 using namespace mozilla;
 
 namespace mp4_demuxer
rename from dom/media/platforms/agnostic/mp4_demuxer/Adts.h
rename to dom/media/platforms/agnostic/bytestreams/Adts.h
rename from dom/media/platforms/agnostic/mp4_demuxer/AnnexB.cpp
rename to dom/media/platforms/agnostic/bytestreams/AnnexB.cpp
--- a/dom/media/platforms/agnostic/mp4_demuxer/AnnexB.cpp
+++ b/dom/media/platforms/agnostic/bytestreams/AnnexB.cpp
@@ -1,17 +1,17 @@
 /* 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/EndianUtils.h"
 #include "mozilla/ResultExtensions.h"
 #include "mozilla/Unused.h"
-#include "mp4_demuxer/AnnexB.h"
+#include "AnnexB.h"
 #include "mp4_demuxer/BufferReader.h"
 #include "mp4_demuxer/ByteWriter.h"
 #include "MediaData.h"
 #include "nsAutoPtr.h"
 
 using namespace mozilla;
 
 namespace mp4_demuxer
rename from dom/media/platforms/agnostic/mp4_demuxer/AnnexB.h
rename to dom/media/platforms/agnostic/bytestreams/AnnexB.h
rename from dom/media/platforms/agnostic/mp4_demuxer/H264.cpp
rename to dom/media/platforms/agnostic/bytestreams/H264.cpp
--- a/dom/media/platforms/agnostic/mp4_demuxer/H264.cpp
+++ b/dom/media/platforms/agnostic/bytestreams/H264.cpp
@@ -1,20 +1,20 @@
 /* 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 "AnnexB.h"
+#include "H264.h"
 #include <limits>
 #include <cmath>
 
 #define READSE(var, min, max)                                                  \
   {                                                                            \
     int32_t val = br.ReadSE();                                                 \
     if (val < min || val > max) {                                              \
       return false;                                                            \
rename from dom/media/platforms/agnostic/mp4_demuxer/H264.h
rename to dom/media/platforms/agnostic/bytestreams/H264.h
rename from dom/media/platforms/agnostic/mp4_demuxer/moz.build
rename to dom/media/platforms/agnostic/bytestreams/moz.build
--- a/dom/media/platforms/agnostic/mp4_demuxer/moz.build
+++ b/dom/media/platforms/agnostic/bytestreams/moz.build
@@ -2,17 +2,17 @@
 # vim: set filetype=python:
 # 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/.
 
 with Files("**"):
     BUG_COMPONENT = ("Core", "Audio/Video: Playback")
 
-EXPORTS.mp4_demuxer += [
+EXPORTS += [
     'Adts.h',
     'AnnexB.h',
     'H264.h',
 ]
 
 UNIFIED_SOURCES += [
     'Adts.cpp',
     'AnnexB.cpp',
--- a/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
+++ b/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
@@ -4,17 +4,17 @@
  * 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 "GMPVideoDecoder.h"
 #include "GMPDecoderModule.h"
 #include "GMPVideoHost.h"
 #include "MediaData.h"
 #include "mozilla/EndianUtils.h"
-#include "mp4_demuxer/AnnexB.h"
+#include "AnnexB.h"
 #include "MP4Decoder.h"
 #include "prsystem.h"
 #include "VPXDecoder.h"
 
 namespace mozilla {
 
 #if defined(DEBUG)
 static bool IsOnGMPThread()
--- a/dom/media/platforms/apple/AppleATDecoder.cpp
+++ b/dom/media/platforms/apple/AppleATDecoder.cpp
@@ -2,17 +2,17 @@
 /* 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 "AppleATDecoder.h"
 #include "AppleUtils.h"
 #include "MP4Decoder.h"
-#include "mp4_demuxer/Adts.h"
+#include "Adts.h"
 #include "MediaInfo.h"
 #include "mozilla/Logging.h"
 #include "mozilla/SyncRunnable.h"
 #include "mozilla/UniquePtr.h"
 #include "VideoUtils.h"
 
 #define LOG(...) MOZ_LOG(sPDMLog, mozilla::LogLevel::Debug, (__VA_ARGS__))
 #define FourCC2Str(n) ((char[5]){(char)(n >> 24), (char)(n >> 16), (char)(n >> 8), (char)(n), 0})
--- a/dom/media/platforms/apple/AppleVTDecoder.cpp
+++ b/dom/media/platforms/apple/AppleVTDecoder.cpp
@@ -8,17 +8,17 @@
 
 #include "AppleVTDecoder.h"
 #include "AppleCMLinker.h"
 #include "AppleDecoderModule.h"
 #include "AppleUtils.h"
 #include "AppleVTLinker.h"
 #include "MediaData.h"
 #include "mozilla/ArrayUtils.h"
-#include "mp4_demuxer/H264.h"
+#include "H264.h"
 #include "nsAutoPtr.h"
 #include "nsThreadUtils.h"
 #include "mozilla/Logging.h"
 #include "VideoUtils.h"
 #include "gfxPlatform.h"
 
 #define LOG(...) MOZ_LOG(sPDMLog, mozilla::LogLevel::Debug, (__VA_ARGS__))
 
--- a/dom/media/platforms/moz.build
+++ b/dom/media/platforms/moz.build
@@ -32,19 +32,19 @@ UNIFIED_SOURCES += [
     'agnostic/VPXDecoder.cpp',
     'agnostic/WAVDecoder.cpp',
     'PDMFactory.cpp',
     'wrappers/H264Converter.cpp',
     'wrappers/MediaDataDecoderProxy.cpp'
 ]
 
 DIRS += [
+    'agnostic/bytestreams',
     'agnostic/eme',
     'agnostic/gmp',
-    'agnostic/mp4_demuxer',
     'omx'
 ]
 
 if CONFIG['MOZ_WMF']:
     DIRS += [ 'wmf' ];
 
 if CONFIG['MOZ_FFVPX'] or CONFIG['MOZ_FFMPEG']:
     # common code to either FFmpeg or FFVPX
--- a/dom/media/platforms/wrappers/H264Converter.cpp
+++ b/dom/media/platforms/wrappers/H264Converter.cpp
@@ -7,18 +7,18 @@
 #include "H264Converter.h"
 
 #include "DecoderDoctorDiagnostics.h"
 #include "ImageContainer.h"
 #include "MediaInfo.h"
 #include "MediaPrefs.h"
 #include "PDMFactory.h"
 #include "mozilla/TaskQueue.h"
-#include "mp4_demuxer/AnnexB.h"
-#include "mp4_demuxer/H264.h"
+#include "AnnexB.h"
+#include "H264.h"
 
 namespace mozilla
 {
 
 H264Converter::H264Converter(PlatformDecoderModule* aPDM,
                              const CreateDecoderParams& aParams)
   : mPDM(aPDM)
   , mOriginalConfig(aParams.VideoConfig())