Bug 1168435 - Part 3 - Remove separate MP3 name space. r=jya
authorJan Henning <jh+bugzilla@buttercookie.de>
Thu, 15 Jun 2017 15:32:20 +0200
changeset 364570 505412c61184054b8c215a73a982d2267ee833f8
parent 364569 d234d0f6c68bf458c520cdadaa7317894712d318
child 364571 35bc216e83145c998ea604b198f5443fe0fe0ca9
push id32049
push usercbook@mozilla.com
push dateMon, 19 Jun 2017 11:36:23 +0000
treeherdermozilla-central@26d62a1ac0e3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1168435
milestone56.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 1168435 - Part 3 - Remove separate MP3 name space. r=jya MozReview-Commit-ID: D876PpLd93C
dom/media/DecoderTraits.cpp
dom/media/gtest/TestMP3Demuxer.cpp
dom/media/mp3/MP3Decoder.cpp
dom/media/mp3/MP3Demuxer.cpp
dom/media/mp3/MP3Demuxer.h
dom/media/mp3/MP3FrameParser.cpp
dom/media/mp3/MP3FrameParser.h
--- a/dom/media/DecoderTraits.cpp
+++ b/dom/media/DecoderTraits.cpp
@@ -353,17 +353,17 @@ DecoderTraits::CreateReader(const MediaC
 
 #ifdef MOZ_FMP4
   if (MP4Decoder::IsSupportedType(aType,
                                   /* DecoderDoctorDiagnostics* */ nullptr)) {
     decoderReader = new MediaFormatReader(aDecoder, new MP4Demuxer(aDecoder->GetResource()));
   } else
 #endif
   if (MP3Decoder::IsSupportedType(aType)) {
-    decoderReader = new MediaFormatReader(aDecoder, new mp3::MP3Demuxer(aDecoder->GetResource()));
+    decoderReader = new MediaFormatReader(aDecoder, new MP3Demuxer(aDecoder->GetResource()));
   } else
   if (ADTSDecoder::IsSupportedType(aType)) {
     decoderReader = new MediaFormatReader(aDecoder, new ADTSDemuxer(aDecoder->GetResource()));
   } else
   if (WaveDecoder::IsSupportedType(aType)) {
     decoderReader = new MediaFormatReader(aDecoder, new WAVDemuxer(aDecoder->GetResource()));
   } else
   if (FlacDecoder::IsSupportedType(aType)) {
--- a/dom/media/gtest/TestMP3Demuxer.cpp
+++ b/dom/media/gtest/TestMP3Demuxer.cpp
@@ -6,17 +6,16 @@
 #include <gtest/gtest.h>
 #include <vector>
 
 #include "MP3Demuxer.h"
 #include "mozilla/ArrayUtils.h"
 #include "MockMediaResource.h"
 
 using namespace mozilla;
-using namespace mozilla::mp3;
 using media::TimeUnit;
 
 
 // Regular MP3 file mock resource.
 class MockMP3MediaResource : public MockMediaResource {
 public:
   explicit MockMP3MediaResource(const char* aFileName)
     : MockMediaResource(aFileName)
--- a/dom/media/mp3/MP3Decoder.cpp
+++ b/dom/media/mp3/MP3Decoder.cpp
@@ -21,17 +21,17 @@ MP3Decoder::Clone(MediaDecoderInit& aIni
     return nullptr;
   }
   return new MP3Decoder(aInit);
 }
 
 MediaDecoderStateMachine*
 MP3Decoder::CreateStateMachine() {
   RefPtr<MediaDecoderReader> reader =
-      new MediaFormatReader(this, new mp3::MP3Demuxer(GetResource()));
+      new MediaFormatReader(this, new MP3Demuxer(GetResource()));
   return new MediaDecoderStateMachine(this, reader);
 }
 
 /* static */
 bool
 MP3Decoder::IsEnabled() {
   RefPtr<PDMFactory> platform = new PDMFactory();
   return platform->SupportsMimeType(NS_LITERAL_CSTRING("audio/mpeg"),
--- a/dom/media/mp3/MP3Demuxer.cpp
+++ b/dom/media/mp3/MP3Demuxer.cpp
@@ -23,17 +23,16 @@ extern mozilla::LazyLogModule gMediaDemu
   MOZ_LOG(gMediaDemuxerLog, LogLevel::Verbose, ("MP3Demuxer " msg, ##__VA_ARGS__))
 
 using mozilla::media::TimeUnit;
 using mozilla::media::TimeInterval;
 using mozilla::media::TimeIntervals;
 using mp4_demuxer::ByteReader;
 
 namespace mozilla {
-namespace mp3 {
 
 // MP3Demuxer
 
 MP3Demuxer::MP3Demuxer(MediaResource* aSource) : mSource(aSource) { }
 
 bool
 MP3Demuxer::InitInternal()
 {
@@ -769,10 +768,9 @@ MP3TrackDemuxer::AverageFrameLength() co
   const auto& vbr = mParser.VBRInfo();
   if (vbr.IsComplete() && vbr.NumAudioFrames().value() + 1) {
     return static_cast<double>(vbr.NumBytes().value())
            / (vbr.NumAudioFrames().value() + 1);
   }
   return 0.0;
 }
 
-} // namespace mp3
 } // namespace mozilla
--- a/dom/media/mp3/MP3Demuxer.h
+++ b/dom/media/mp3/MP3Demuxer.h
@@ -5,17 +5,16 @@
 #ifndef MP3_DEMUXER_H_
 #define MP3_DEMUXER_H_
 
 #include "MediaDataDemuxer.h"
 #include "MediaResource.h"
 #include "MP3FrameParser.h"
 
 namespace mozilla {
-namespace mp3 {
 
 class MP3TrackDemuxer;
 
 class MP3Demuxer : public MediaDataDemuxer
 {
 public:
   // MediaDataDemuxer interface.
   explicit MP3Demuxer(MediaResource* aSource);
@@ -152,12 +151,11 @@ private:
 
   // Channel count derived from frame headers or 0 if none available.
   int32_t mChannels;
 
   // Audio track config info.
   UniquePtr<AudioInfo> mInfo;
 };
 
-} // namespace mp3
 } // namespace mozilla
 
 #endif
--- a/dom/media/mp3/MP3FrameParser.cpp
+++ b/dom/media/mp3/MP3FrameParser.cpp
@@ -18,17 +18,16 @@ extern mozilla::LazyLogModule gMediaDemu
 #define MP3LOG(msg, ...) \
   MOZ_LOG(gMediaDemuxerLog, LogLevel::Debug, ("MP3Demuxer " msg, ##__VA_ARGS__))
 #define MP3LOGV(msg, ...) \
   MOZ_LOG(gMediaDemuxerLog, LogLevel::Verbose, ("MP3Demuxer " msg, ##__VA_ARGS__))
 
 using mp4_demuxer::ByteReader;
 
 namespace mozilla {
-namespace mp3 {
 
 // FrameParser
 
 namespace frame_header {
 // FrameHeader mRaw byte offsets.
 static const int SYNC1 = 0;
 static const int SYNC2_VERSION_LAYER_PROTECTION = 1;
 static const int BITRATE_SAMPLERATE_PADDING_PRIVATE = 2;
@@ -729,10 +728,9 @@ ID3Parser::ID3Header::Update(uint8_t c)
     mSize |= c;
   }
   if (mPos < SIZE) {
     mRaw[mPos] = c;
   }
   return IsValid(mPos++);
 }
 
-} // namespace mp3
 } // namespace mozilla
--- a/dom/media/mp3/MP3FrameParser.h
+++ b/dom/media/mp3/MP3FrameParser.h
@@ -6,17 +6,16 @@
 #define MP3_FRAME_PARSER_H_
 
 #include <vector>
 
 #include "mozilla/Maybe.h"
 #include "mp4_demuxer/ByteReader.h"
 
 namespace mozilla {
-namespace mp3 {
 
 // ID3 header parser state machine used by FrameParser.
 // The header contains the following format (one byte per term):
 // 'I' 'D' '3' MajorVersion MinorVersion Flags Size1 Size2 Size3 Size4
 // For more details see http://id3.org/id3v2.3.0.
 class ID3Parser
 {
 public:
@@ -333,12 +332,11 @@ private:
 
   // We keep the first parsed frame around for static info access, the
   // previously parsed frame for debugging and the currently parsed frame.
   Frame mFirstFrame;
   Frame mFrame;
   Frame mPrevFrame;
 };
 
-} // namespace mp3
 } // namespace mozilla
 
 #endif