Bug 1395021 - Move TrackID definition from StreamTracks.h into TrackID.h. r=jwwang
authorChris Pearce <cpearce@mozilla.com>
Wed, 30 Aug 2017 15:24:54 +1200
changeset 427241 620ce0f4d3603361a5e31d26ba044cc3250aa397
parent 427240 7cc985da769f2ba0588ff2af695e073e9c407e86
child 427242 1ed072a5827f2a8661302880ece035fa990178b0
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwwang
bugs1395021
milestone57.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 1395021 - Move TrackID definition from StreamTracks.h into TrackID.h. r=jwwang This means that MediaInfo.h doesn't need to include StreamTracks.h, which pulls in MediaSegment.h and the MSG and a bunch of DOM bindings stuff. MozReview-Commit-ID: 6JSO1dxJq8k
dom/media/MediaInfo.h
dom/media/StreamTracks.h
dom/media/TrackID.h
dom/media/moz.build
--- a/dom/media/MediaInfo.h
+++ b/dom/media/MediaInfo.h
@@ -8,17 +8,17 @@
 
 #include "mozilla/UniquePtr.h"
 #include "mozilla/RefPtr.h"
 #include "nsDataHashtable.h"
 #include "nsString.h"
 #include "nsTArray.h"
 #include "ImageTypes.h"
 #include "MediaData.h"
-#include "StreamTracks.h" // for TrackID
+#include "TrackID.h" // for TrackID
 #include "TimeUnits.h"
 #include "mozilla/gfx/Point.h" // for gfx::IntSize
 #include "mozilla/gfx/Rect.h"  // for gfx::IntRect
 
 namespace mozilla {
 
 class AudioInfo;
 class VideoInfo;
--- a/dom/media/StreamTracks.h
+++ b/dom/media/StreamTracks.h
@@ -3,33 +3,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 MOZILLA_STREAMTRACKS_H_
 #define MOZILLA_STREAMTRACKS_H_
 
 #include "MediaSegment.h"
 #include "nsAutoPtr.h"
+#include "TrackID.h"
 
 namespace mozilla {
 
-/**
- * Unique ID for track within a StreamTracks. Tracks from different
- * StreamTrackss may have the same ID; this matters when appending StreamTrackss,
- * since tracks with the same ID are matched. Only IDs greater than 0 are allowed.
- */
-typedef int32_t TrackID;
-const TrackID TRACK_NONE = 0;
-const TrackID TRACK_INVALID = -1;
-const TrackID TRACK_ANY = -2;
-
-inline bool IsTrackIDExplicit(const TrackID& aId) {
-  return aId > TRACK_NONE;
-}
-
 inline TrackTicks RateConvertTicksRoundDown(TrackRate aOutRate,
                                             TrackRate aInRate,
                                             TrackTicks aTicks)
 {
   NS_ASSERTION(0 < aOutRate && aOutRate <= TRACK_RATE_MAX, "Bad out rate");
   NS_ASSERTION(0 < aInRate && aInRate <= TRACK_RATE_MAX, "Bad in rate");
   NS_ASSERTION(0 <= aTicks && aTicks <= TRACK_TICKS_MAX, "Bad ticks");
   return (aTicks * aOutRate) / aInRate;
new file mode 100644
--- /dev/null
+++ b/dom/media/TrackID.h
@@ -0,0 +1,27 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* 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 MOZILLA_TRACK_ID_H_
+ #define MOZILLA_TRACK_ID_H_
+
+ namespace mozilla {
+
+ /**
+  * Unique ID for track within a StreamTracks. Tracks from different
+  * StreamTrackss may have the same ID; this matters when appending StreamTrackss,
+  * since tracks with the same ID are matched. Only IDs greater than 0 are allowed.
+  */
+ typedef int32_t TrackID;
+ const TrackID TRACK_NONE = 0;
+ const TrackID TRACK_INVALID = -1;
+ const TrackID TRACK_ANY = -2;
+
+ inline bool IsTrackIDExplicit(const TrackID& aId) {
+   return aId > TRACK_NONE;
+ }
+
+} // namespace mozilla
+
+#endif // MOZILLA_TRACK_ID_H_
--- a/dom/media/moz.build
+++ b/dom/media/moz.build
@@ -142,16 +142,17 @@ EXPORTS += [
     'QueueObject.h',
     'SeekJob.h',
     'SeekTarget.h',
     'SelfRef.h',
     'SharedBuffer.h',
     'StreamTracks.h',
     'ThreadPoolCOMListener.h',
     'TimeUnits.h',
+    'TrackID.h',
     'TrackUnionStream.h',
     'VideoFrameContainer.h',
     'VideoLimits.h',
     'VideoSegment.h',
     'VideoUtils.h',
     'VorbisUtils.h',
     'XiphExtradata.h',
 ]