Bug 1126499 - Move mp4 code into MOZ_FMP4 compile flag. r=jya
authorKai-Zhen Li <kli@mozilla.com>
Thu, 29 Jan 2015 14:08:58 +0800
changeset 226524 f64e404de9d9319ad98d8fa5762e07173e26bb9b
parent 226523 ef312b4bc6c8ae5ca64ed7bd3cfb02cb493f6f9f
child 226525 d2c1521073378b77b901d539882e09365885fc2b
push id28198
push usercbook@mozilla.com
push dateThu, 29 Jan 2015 15:11:14 +0000
treeherdermozilla-central@0467412f8413 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1126499
milestone38.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 1126499 - Move mp4 code into MOZ_FMP4 compile flag. r=jya
dom/media/mediasource/ContainerParser.cpp
--- a/dom/media/mediasource/ContainerParser.cpp
+++ b/dom/media/mediasource/ContainerParser.cpp
@@ -6,17 +6,19 @@
 
 #include "ContainerParser.h"
 
 #include "WebMBufferedParser.h"
 #include "mozilla/Endian.h"
 #include "mp4_demuxer/MoofParser.h"
 #include "prlog.h"
 #include "MediaData.h"
+#ifdef MOZ_FMP4
 #include "MP4Stream.h"
+#endif
 #include "SourceBufferResource.h"
 
 #ifdef PR_LOGGING
 extern PRLogModuleInfo* GetMediaSourceLog();
 extern PRLogModuleInfo* GetMediaSourceAPILog();
 
 #define MSE_DEBUG(...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, (__VA_ARGS__))
 #define MSE_DEBUGV(...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG+1, (__VA_ARGS__))
@@ -209,16 +211,17 @@ public:
   }
 
 private:
   WebMBufferedParser mParser;
   nsTArray<WebMTimeDataOffset> mOverlappedMapping;
   int64_t mOffset;
 };
 
+#ifdef MOZ_FMP4
 class MP4ContainerParser : public ContainerParser {
 public:
   MP4ContainerParser() :mMonitor("MP4ContainerParser Index Monitor") {}
 
   bool IsInitSegmentPresent(LargeDataBuffer* aData)
   {
     ContainerParser::IsInitSegmentPresent(aData);
     // Each MP4 atom has a chunk size and chunk type. The root chunk in an MP4
@@ -317,23 +320,26 @@ public:
   }
 
 private:
   nsRefPtr<MP4Stream> mStream;
   nsAutoPtr<mp4_demuxer::MoofParser> mParser;
   nsRefPtr<SourceBufferResource> mResource;
   Monitor mMonitor;
 };
+#endif
 
 /*static*/ ContainerParser*
 ContainerParser::CreateForMIMEType(const nsACString& aType)
 {
   if (aType.LowerCaseEqualsLiteral("video/webm") || aType.LowerCaseEqualsLiteral("audio/webm")) {
     return new WebMContainerParser();
   }
 
+#ifdef MOZ_FMP4
   if (aType.LowerCaseEqualsLiteral("video/mp4") || aType.LowerCaseEqualsLiteral("audio/mp4")) {
     return new MP4ContainerParser();
   }
+#endif
   return new ContainerParser();
 }
 
 } // namespace mozilla