Backed out 4 changesets (bug 834835) for making bug 786539 nearly perma-orange.
authorRyan VanderMeulen <ryanvm@gmail.com>
Thu, 18 Apr 2013 10:32:26 -0400
changeset 129202 76fb1757892dbaf4f05fae5fedcb9b81418b62ba
parent 129201 896d943683eb5eb48a08765fbf0a7cc9ff666fec
child 129203 c81d0474b833d7e46a979def2d9806d419f41d56
push id24562
push userryanvm@gmail.com
push dateFri, 19 Apr 2013 01:24:04 +0000
treeherdermozilla-central@f8d27fe5d7c0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs834835, 786539
milestone23.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
Backed out 4 changesets (bug 834835) for making bug 786539 nearly perma-orange.
content/media/AudioStreamTrack.cpp
content/media/AudioStreamTrack.h
content/media/DOMMediaStream.cpp
content/media/DOMMediaStream.h
content/media/Makefile.in
content/media/MediaStreamTrack.cpp
content/media/MediaStreamTrack.h
content/media/VideoStreamTrack.cpp
content/media/VideoStreamTrack.h
content/media/moz.build
content/media/test/Makefile.in
content/media/test/manifest.js
content/media/test/test_mozHasAudio.html
content/media/test/test_streams_tracks.html
dom/bindings/Bindings.conf
dom/webidl/AudioStreamTrack.webidl
dom/webidl/MediaStream.webidl
dom/webidl/MediaStreamTrack.webidl
dom/webidl/VideoStreamTrack.webidl
dom/webidl/WebIDL.mk
deleted file mode 100644
--- a/content/media/AudioStreamTrack.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-/* -*- 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/. */
-
-#include "AudioStreamTrack.h"
-
-#include "mozilla/dom/AudioStreamTrackBinding.h"
-
-namespace mozilla {
-namespace dom {
-
-JSObject*
-AudioStreamTrack::WrapObject(JSContext* aCx, JSObject* aScope)
-{
-  return AudioStreamTrackBinding::Wrap(aCx, aScope, this);
-}
-
-}
-}
deleted file mode 100644
--- a/content/media/AudioStreamTrack.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- 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 AUDIOSTREAMTRACK_H_
-#define AUDIOSTREAMTRACK_H_
-
-#include "MediaStreamTrack.h"
-
-namespace mozilla {
-namespace dom {
-
-class AudioStreamTrack : public MediaStreamTrack {
-public:
-  AudioStreamTrack(DOMMediaStream* aStream, TrackID aTrackID)
-    : MediaStreamTrack(aStream, aTrackID) {}
-
-  virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope);
-
-  virtual AudioStreamTrack* AsAudioStreamTrack() { return this; }
-
-  // WebIDL
-  virtual void GetKind(nsAString& aKind) { aKind.AssignLiteral("audio"); }
-};
-
-}
-}
-
-#endif /* AUDIOSTREAMTRACK_H_ */
--- a/content/media/DOMMediaStream.cpp
+++ b/content/media/DOMMediaStream.cpp
@@ -4,119 +4,34 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "DOMMediaStream.h"
 #include "nsDOMClassInfoID.h"
 #include "nsContentUtils.h"
 #include "mozilla/dom/MediaStreamBinding.h"
 #include "mozilla/dom/LocalMediaStreamBinding.h"
 #include "MediaStreamGraph.h"
-#include "AudioStreamTrack.h"
-#include "VideoStreamTrack.h"
 
 using namespace mozilla;
-using namespace mozilla::dom;
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMMediaStream)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
   NS_INTERFACE_MAP_ENTRY(nsIDOMMediaStream)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMMediaStream)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMMediaStream)
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_2(DOMMediaStream, mWindow, mTracks)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(DOMMediaStream, mWindow)
 
 NS_IMPL_ISUPPORTS_INHERITED1(DOMLocalMediaStream, DOMMediaStream,
                              nsIDOMLocalMediaStream)
 
-class DOMMediaStream::StreamListener : public MediaStreamListener {
-public:
-  StreamListener(DOMMediaStream* aStream)
-    : mStream(aStream)
-  {}
-
-  // Main thread only
-  void Forget() { mStream = nullptr; }
-  DOMMediaStream* GetStream() { return mStream; }
-
-  class TrackChange : public nsRunnable {
-  public:
-    TrackChange(StreamListener* aListener,
-                TrackID aID, TrackTicks aTrackOffset,
-                uint32_t aEvents, MediaSegment::Type aType)
-      : mListener(aListener), mID(aID), mEvents(aEvents), mType(aType)
-    {
-    }
-
-    NS_IMETHOD Run()
-    {
-      NS_ASSERTION(NS_IsMainThread(), "main thread only");
-
-      DOMMediaStream* stream = mListener->GetStream();
-      if (!stream) {
-        return NS_OK;
-      }
-
-      nsRefPtr<MediaStreamTrack> track;
-      if (mEvents & MediaStreamListener::TRACK_EVENT_CREATED) {
-        track = stream->CreateDOMTrack(mID, mType);
-      } else {
-        track = stream->GetDOMTrackFor(mID);
-      }
-      if (mEvents & MediaStreamListener::TRACK_EVENT_ENDED) {
-        track->NotifyEnded();
-      }
-      return NS_OK;
-    }
-
-    StreamTime mEndTime;
-    nsRefPtr<StreamListener> mListener;
-    TrackID mID;
-    uint32_t mEvents;
-    MediaSegment::Type mType;
-  };
-
-  /**
-   * Notify that changes to one of the stream tracks have been queued.
-   * aTrackEvents can be any combination of TRACK_EVENT_CREATED and
-   * TRACK_EVENT_ENDED. aQueuedMedia is the data being added to the track
-   * at aTrackOffset (relative to the start of the stream).
-   * aQueuedMedia can be null if there is no output.
-   */
-  virtual void NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, TrackID aID,
-                                        TrackRate aTrackRate,
-                                        TrackTicks aTrackOffset,
-                                        uint32_t aTrackEvents,
-                                        const MediaSegment& aQueuedMedia)
-  {
-    if (aTrackEvents & (TRACK_EVENT_CREATED | TRACK_EVENT_ENDED)) {
-      nsRefPtr<TrackChange> runnable =
-        new TrackChange(this, aID, aTrackOffset, aTrackEvents,
-                        aQueuedMedia.GetType());
-      NS_DispatchToMainThread(runnable);
-    }
-  }
-
-private:
-  // These fields may only be accessed on the main thread
-  DOMMediaStream* mStream;
-};
-
-DOMMediaStream::DOMMediaStream()
-  : mStream(nullptr), mHintContents(0)
-{
-  SetIsDOMBinding();
-}
-
 DOMMediaStream::~DOMMediaStream()
 {
-  if (mListener) {
-    mListener->Forget();
-  }
   if (mStream) {
     mStream->Destroy();
   }
 }
 
 JSObject*
 DOMMediaStream::WrapObject(JSContext* aCx, JSObject* aScope)
 {
@@ -124,70 +39,38 @@ DOMMediaStream::WrapObject(JSContext* aC
 }
 
 double
 DOMMediaStream::CurrentTime()
 {
   return mStream ? MediaTimeToSeconds(mStream->GetCurrentTime()) : 0.0;
 }
 
-void
-DOMMediaStream::GetAudioTracks(nsTArray<nsRefPtr<AudioStreamTrack> >& aTracks)
-{
-  for (uint32_t i = 0; i < mTracks.Length(); ++i) {
-    AudioStreamTrack* t = mTracks[i]->AsAudioStreamTrack();
-    if (t) {
-      aTracks.AppendElement(t);
-    }
-  }
-}
-
-void
-DOMMediaStream::GetVideoTracks(nsTArray<nsRefPtr<VideoStreamTrack> >& aTracks)
-{
-  for (uint32_t i = 0; i < mTracks.Length(); ++i) {
-    VideoStreamTrack* t = mTracks[i]->AsVideoStreamTrack();
-    if (t) {
-      aTracks.AppendElement(t);
-    }
-  }
-}
-
 bool
 DOMMediaStream::IsFinished()
 {
   return !mStream || mStream->IsFinished();
 }
 
 void
 DOMMediaStream::InitSourceStream(nsIDOMWindow* aWindow, uint32_t aHintContents)
 {
   mWindow = aWindow;
   SetHintContents(aHintContents);
   MediaStreamGraph* gm = MediaStreamGraph::GetInstance();
-  InitStreamCommon(gm->CreateSourceStream(this));
+  mStream = gm->CreateSourceStream(this);
 }
 
 void
 DOMMediaStream::InitTrackUnionStream(nsIDOMWindow* aWindow, uint32_t aHintContents)
 {
   mWindow = aWindow;
   SetHintContents(aHintContents);
   MediaStreamGraph* gm = MediaStreamGraph::GetInstance();
-  InitStreamCommon(gm->CreateTrackUnionStream(this));
-}
-
-void
-DOMMediaStream::InitStreamCommon(MediaStream* aStream)
-{
-  mStream = aStream;
-
-  // Setup track listener
-  mListener = new StreamListener(this);
-  aStream->AddListener(mListener);
+  mStream = gm->CreateTrackUnionStream(this);
 }
 
 already_AddRefed<DOMMediaStream>
 DOMMediaStream::CreateSourceStream(nsIDOMWindow* aWindow, uint32_t aHintContents)
 {
   nsRefPtr<DOMMediaStream> stream = new DOMMediaStream();
   stream->InitSourceStream(aWindow, aHintContents);
   return stream.forget();
@@ -202,50 +85,16 @@ DOMMediaStream::CreateTrackUnionStream(n
 }
 
 bool
 DOMMediaStream::CombineWithPrincipal(nsIPrincipal* aPrincipal)
 {
   return nsContentUtils::CombineResourcePrincipals(&mPrincipal, aPrincipal);
 }
 
-MediaStreamTrack*
-DOMMediaStream::CreateDOMTrack(TrackID aTrackID, MediaSegment::Type aType)
-{
-  MediaStreamTrack* track;
-  switch (aType) {
-  case MediaSegment::AUDIO:
-    track = new AudioStreamTrack(this, aTrackID);
-    break;
-  case MediaSegment::VIDEO:
-    track = new VideoStreamTrack(this, aTrackID);
-    break;
-  default:
-    MOZ_NOT_REACHED("Unhandled track type");
-    return nullptr;
-  }
-
-  mTracks.AppendElement(track);
-  return track;
-}
-
-MediaStreamTrack*
-DOMMediaStream::GetDOMTrackFor(TrackID aTrackID)
-{
-  for (uint32_t i = 0; i < mTracks.Length(); ++i) {
-    MediaStreamTrack* t = mTracks[i];
-    // We may add streams to our track list that are actually owned by
-    // a different DOMMediaStream. Ignore those.
-    if (t->GetTrackID() == aTrackID && t->GetStream() == this) {
-      return t;
-    }
-  }
-  return nullptr;
-}
-
 DOMLocalMediaStream::~DOMLocalMediaStream()
 {
   if (mStream) {
     // Make sure Listeners of this stream know it's going away
     Stop();
   }
 }
 
--- a/content/media/DOMMediaStream.h
+++ b/content/media/DOMMediaStream.h
@@ -6,17 +6,16 @@
 #ifndef NSDOMMEDIASTREAM_H_
 #define NSDOMMEDIASTREAM_H_
 
 #include "nsIDOMMediaStream.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsIPrincipal.h"
 #include "nsWrapperCache.h"
 #include "nsIDOMWindow.h"
-#include "StreamBuffer.h"
 
 class nsXPCClassInfo;
 
 // GetCurrentTime is defined in winbase.h as zero argument macro forwarding to
 // GetTickCount() and conflicts with NS_DECL_NSIDOMMEDIASTREAM, containing
 // currentTime getter.
 #ifdef GetCurrentTime
 #undef GetCurrentTime
@@ -26,51 +25,41 @@ class nsXPCClassInfo;
 #ifdef CurrentTime
 #undef CurrentTime
 #endif
 
 namespace mozilla {
 
 class MediaStream;
 
-namespace dom {
-class MediaStreamTrack;
-class AudioStreamTrack;
-class VideoStreamTrack;
-}
-
 /**
  * DOM wrapper for MediaStreams.
  */
 class DOMMediaStream : public nsIDOMMediaStream,
                        public nsWrapperCache
 {
   friend class DOMLocalMediaStream;
-  typedef dom::MediaStreamTrack MediaStreamTrack;
-  typedef dom::AudioStreamTrack AudioStreamTrack;
-  typedef dom::VideoStreamTrack VideoStreamTrack;
 
 public:
-  DOMMediaStream();
+  DOMMediaStream() : mStream(nullptr), mHintContents(0)
+  {
+    SetIsDOMBinding();
+  }
   virtual ~DOMMediaStream();
 
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMMediaStream)
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
   nsIDOMWindow* GetParentObject() const
   {
     return mWindow;
   }
   virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope) MOZ_OVERRIDE;
 
-  // WebIDL
   double CurrentTime();
-  void GetAudioTracks(nsTArray<nsRefPtr<AudioStreamTrack> >& aTracks);
-  void GetVideoTracks(nsTArray<nsRefPtr<VideoStreamTrack> >& aTracks);
-
   MediaStream* GetStream() { return mStream; }
   bool IsFinished();
   /**
    * Returns a principal indicating who may access this stream. The stream contents
    * can only be accessed by principals subsuming this principal.
    */
   nsIPrincipal* GetPrincipal() { return mPrincipal; }
 
@@ -98,41 +87,30 @@ public:
   void SetHintContents(uint32_t aHintContents) { mHintContents = aHintContents; }
 
   /**
    * Create an nsDOMMediaStream whose underlying stream is a TrackUnionStream.
    */
   static already_AddRefed<DOMMediaStream>
   CreateTrackUnionStream(nsIDOMWindow* aWindow, uint32_t aHintContents = 0);
 
-  // Notifications from StreamListener
-  MediaStreamTrack* CreateDOMTrack(TrackID aTrackID, MediaSegment::Type aType);
-  MediaStreamTrack* GetDOMTrackFor(TrackID aTrackID);
-
 protected:
   void InitSourceStream(nsIDOMWindow* aWindow, uint32_t aHintContents);
   void InitTrackUnionStream(nsIDOMWindow* aWindow, uint32_t aHintContents);
-  void InitStreamCommon(MediaStream* aStream);
-
-  class StreamListener;
-  friend class StreamListener;
 
   // We need this to track our parent object.
   nsCOMPtr<nsIDOMWindow> mWindow;
 
   // MediaStream is owned by the graph, but we tell it when to die, and it won't
   // die until we let it.
   MediaStream* mStream;
   // Principal identifying who may access the contents of this stream.
   // If null, this stream can be used by anyone because it has no content yet.
   nsCOMPtr<nsIPrincipal> mPrincipal;
 
-  nsAutoTArray<nsRefPtr<MediaStreamTrack>,2> mTracks;
-  nsRefPtr<StreamListener> mListener;
-
   // tells the SDP generator about whether this
   // MediaStream probably has audio and/or video
   uint32_t mHintContents;
 };
 
 class DOMLocalMediaStream : public DOMMediaStream,
                             public nsIDOMLocalMediaStream
 {
--- a/content/media/Makefile.in
+++ b/content/media/Makefile.in
@@ -11,37 +11,34 @@ include $(DEPTH)/config/autoconf.mk
 
 LIBRARY_NAME = gkconmedia_s
 LIBXUL_LIBRARY = 1
 ifndef _MSC_VER
 FAIL_ON_WARNINGS := 1
 endif # !_MSC_VER
 
 CPPSRCS = \
-  AudioAvailableEventManager.cpp \
   AudioChannelFormat.cpp \
   AudioNodeEngine.cpp \
   AudioNodeStream.cpp \
   AudioSegment.cpp \
   AudioStream.cpp \
-  AudioStreamTrack.cpp \
   DecoderTraits.cpp \
   DOMMediaStream.cpp \
   FileBlockCache.cpp \
-  MediaCache.cpp \
+  MediaResource.cpp \
+  MediaStreamGraph.cpp \
+  AudioAvailableEventManager.cpp \
   MediaDecoder.cpp \
   MediaDecoderStateMachine.cpp \
   MediaDecoderReader.cpp \
-  MediaResource.cpp \
-  MediaStreamGraph.cpp \
-  MediaStreamTrack.cpp \
+  MediaCache.cpp \
   StreamBuffer.cpp \
   VideoFrameContainer.cpp \
   VideoSegment.cpp \
-  VideoStreamTrack.cpp \
   VideoUtils.cpp \
   $(NULL)
 
 FORCE_STATIC_LIB = 1
 
 include $(topsrcdir)/config/config.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
 include $(topsrcdir)/config/rules.mk
deleted file mode 100644
--- a/content/media/MediaStreamTrack.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- 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/. */
-
-#include "MediaStreamTrack.h"
-
-#include "DOMMediaStream.h"
-#include "nsIUUIDGenerator.h"
-#include "nsServiceManagerUtils.h"
-
-namespace mozilla {
-namespace dom {
-
-MediaStreamTrack::MediaStreamTrack(DOMMediaStream* aStream, TrackID aTrackID)
-  : mStream(aStream), mTrackID(aTrackID), mEnded(false)
-{
-  SetIsDOMBinding();
-
-  memset(&mID, 0, sizeof(mID));
-
-  nsresult rv;
-  nsCOMPtr<nsIUUIDGenerator> uuidgen =
-    do_GetService("@mozilla.org/uuid-generator;1", &rv);
-  if (uuidgen) {
-    uuidgen->GenerateUUIDInPlace(&mID);
-  }
-}
-
-MediaStreamTrack::~MediaStreamTrack()
-{
-}
-
-NS_IMPL_CYCLE_COLLECTION_INHERITED_1(MediaStreamTrack, nsDOMEventTargetHelper,
-                                     mStream)
-
-NS_IMPL_ADDREF_INHERITED(MediaStreamTrack, nsDOMEventTargetHelper)
-NS_IMPL_RELEASE_INHERITED(MediaStreamTrack, nsDOMEventTargetHelper)
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(MediaStreamTrack)
-NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper)
-
-void
-MediaStreamTrack::GetId(nsAString& aID)
-{
-  char chars[NSID_LENGTH];
-  mID.ToProvidedString(chars);
-  aID = NS_ConvertASCIItoUTF16(chars);
-}
-
-}
-}
deleted file mode 100644
--- a/content/media/MediaStreamTrack.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- 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 MEDIASTREAMTRACK_H_
-#define MEDIASTREAMTRACK_H_
-
-#include "nsDOMEventTargetHelper.h"
-#include "nsID.h"
-#include "StreamBuffer.h"
-
-namespace mozilla {
-
-class DOMMediaStream;
-
-namespace dom {
-
-class AudioStreamTrack;
-class VideoStreamTrack;
-
-/**
- * Class representing a track in a DOMMediaStream.
- */
-class MediaStreamTrack : public nsDOMEventTargetHelper {
-public:
-  /**
-   * aTrackID is the MediaStreamGraph track ID for the track in the
-   * MediaStream owned by aStream.
-   */
-  MediaStreamTrack(DOMMediaStream* aStream, TrackID aTrackID);
-  virtual ~MediaStreamTrack();
-
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(MediaStreamTrack, nsDOMEventTargetHelper)
-
-  DOMMediaStream* GetParentObject() const { return mStream; }
-  virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope) = 0;
-
-  DOMMediaStream* GetStream() const { return mStream; }
-  TrackID GetTrackID() const { return mTrackID; }
-  virtual AudioStreamTrack* AsAudioStreamTrack() { return nullptr; }
-  virtual VideoStreamTrack* AsVideoStreamTrack() { return nullptr; }
-
-  // WebIDL
-  virtual void GetKind(nsAString& aKind) = 0;
-  void GetId(nsAString& aID);
-  void GetLabel(nsAString& aLabel) { aLabel.Truncate(); }
-
-  // Notifications from the MediaStreamGraph
-  void NotifyEnded() { mEnded = true; }
-
-protected:
-  nsRefPtr<DOMMediaStream> mStream;
-  TrackID mTrackID;
-  nsID mID;
-  bool mEnded;
-};
-
-}
-}
-
-#endif /* MEDIASTREAMTRACK_H_ */
deleted file mode 100644
--- a/content/media/VideoStreamTrack.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-/* -*- 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/. */
-
-#include "VideoStreamTrack.h"
-
-#include "mozilla/dom/VideoStreamTrackBinding.h"
-
-namespace mozilla {
-namespace dom {
-
-JSObject*
-VideoStreamTrack::WrapObject(JSContext* aCx, JSObject* aScope)
-{
-  return VideoStreamTrackBinding::Wrap(aCx, aScope, this);
-}
-
-}
-}
deleted file mode 100644
--- a/content/media/VideoStreamTrack.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- 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 VIDEOSTREAMTRACK_H_
-#define VIDEOSTREAMTRACK_H_
-
-#include "MediaStreamTrack.h"
-
-namespace mozilla {
-namespace dom {
-
-class VideoStreamTrack : public MediaStreamTrack {
-public:
-  VideoStreamTrack(DOMMediaStream* aStream, TrackID aTrackID)
-    : MediaStreamTrack(aStream, aTrackID) {}
-
-  virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope);
-
-  virtual VideoStreamTrack* AsVideoStreamTrack() { return this; }
-
-  // WebIDL
-  virtual void GetKind(nsAString& aKind) { aKind.AssignLiteral("video"); }
-};
-
-}
-}
-
-#endif /* VIDEOSTREAMTRACK_H_ */
--- a/content/media/moz.build
+++ b/content/media/moz.build
@@ -69,14 +69,8 @@ EXPORTS += [
     'StreamBuffer.h',
     'TimeVarying.h',
     'VideoFrameContainer.h',
     'VideoSegment.h',
     'VideoUtils.h',
     'VorbisUtils.h',
 ]
 
-EXPORTS.mozilla.dom += [
-    'AudioStreamTrack.h',
-    'MediaStreamTrack.h',
-    'VideoStreamTrack.h',
-]
-
--- a/content/media/test/Makefile.in
+++ b/content/media/test/Makefile.in
@@ -130,17 +130,16 @@ MOCHITEST_FILES = \
 		test_media_selection.html \
 		test_playback.html \
 		test_seekLies.html \
 		test_media_sniffer.html \
 		contentType.sjs \
 		test_streams_srcObject.html \
 		test_reset_src.html \
 		test_streams_gc.html \
-		test_streams_tracks.html \
 		test_streams_autoplay.html \
 		$(filter disabled-for-intermittent-failures--bug-608634, test_error_in_video_document.html) \
 		$(NULL)
 
 # Disabled on Windows for frequent intermittent failures
 ifneq ($(OS_ARCH), WINNT)
 MOCHITEST_FILES += \
 		test_streams_element_capture.html \
--- a/content/media/test/manifest.js
+++ b/content/media/test/manifest.js
@@ -57,23 +57,22 @@ var gReplayTests = gSmallTests.concat([
 
 // Used by test_paused_after_ended. Need one test file per decoder backend, plus
 // anything for testing bugs that occur when replying a played file.
 var gPausedAfterEndedTests = gSmallTests.concat([
   { name:"r11025_u8_c1.wav", type:"audio/x-wav", duration:1.0 },
   { name:"small-shot.ogg", type:"video/ogg", duration:0.276 }
 ]);
 
-// Test the mozHasAudio property, and APIs that detect different kinds of
-// tracks
-var gTrackTests = [
-  { name:"big.wav", type:"audio/x-wav", duration:9.278981, size:102444, hasAudio:true, hasVideo:false },
-  { name:"320x240.ogv", type:"video/ogg", width:320, height:240, duration:0.266, size:28942, hasAudio:false, hasVideo:true },
-  { name:"short-video.ogv", type:"video/ogg", duration:1.081, hasAudio:true, hasVideo:true },
-  { name:"seek.webm", type:"video/webm", duration:3.966, size:215529, hasAudio:false, hasVideo:true },
+// Test the mozHasAudio property
+var gMozHasAudioTests = [
+  { name:"big.wav", type:"audio/x-wav", duration:9.278981, size:102444, hasAudio:undefined },
+  { name:"320x240.ogv", type:"video/ogg", width:320, height:240, duration:0.266, size:28942, hasAudio:false },
+  { name:"short-video.ogv", type:"video/ogg", duration:1.081, hasAudio:true },
+  { name:"seek.webm", type:"video/webm", duration:3.966, size:215529, hasAudio:false },
   { name:"bogus.duh", type:"bogus/duh" }
 ];
 
 // These are files that we want to make sure we can play through.  We can
 // also check metadata.  Put files of the same type together in this list so if
 // something crashes we have some idea of which backend is responsible.
 // Used by test_playback, which expects no error event and one ended event.
 var gPlayTests = [
--- a/content/media/test/test_mozHasAudio.html
+++ b/content/media/test/test_mozHasAudio.html
@@ -22,20 +22,20 @@ function startTest(test, token) {
   var elemType = /^audio/.test(test.type) ? "audio" : "video";
   var element = document.createElement(elemType);
 
   element.token = token;
   manager.started(token);
 
   element.src = test.name;
   element.name = test.name;
-  element.hasAudio = elemType == "video" ? test.hasAudio : undefined;
+  element.hasAudio = test.hasAudio;
   element.addEventListener("loadedmetadata", onloadedmetadata, false);
 
   element.load();
 }
 
-manager.runTests(gTrackTests, startTest);
+manager.runTests(gMozHasAudioTests, startTest);
 
 </script>
 </pre>
 </body>
 </html>
deleted file mode 100644
--- a/content/media/test/test_streams_tracks.html
+++ /dev/null
@@ -1,54 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test MediaStreamTrack interfaces</title>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-  <script type="text/javascript" src="manifest.js"></script>
-</head>
-<body>
-<pre id="test">
-<script class="testbody" type="text/javascript">
-var manager = new MediaTestManager;
-
-function testTracks(tracks, hasTrack, kind, src) {
-  is(tracks.length, hasTrack ? 1 : 0, "Correct track count for " + src);
-  for (var i = 0; i < tracks.length; ++i) {
-    var track = tracks[i];
-    is(track.kind, kind, "Correct track kind for track " + i + " of " + src);
-    var id = track.id;
-    ok(/\{........-....-....-....-............\}/.test(track.id),
-       "id " + track.id + " for track " + i + " of " + src + " has correct form");
-  }
-}
-
-function onended(e) {
-  var t = e.target;
-  var audioTracks = t.stream.getAudioTracks();
-  var videoTracks = t.stream.getVideoTracks();
-
-  testTracks(audioTracks, t.test.hasAudio, "audio", t.src);
-  testTracks(videoTracks, t.test.hasVideo, "video", t.src);
-
-  manager.finished(t.token);
-}
-
-function startTest(test, token) {
-  var element = document.createElement("video");
-
-  element.token = token;
-  manager.started(token);
-
-  element.src = test.name;
-  element.test = test;
-  element.stream = element.mozCaptureStreamUntilEnded();
-  element.addEventListener("ended", onended, false);
-
-  element.play();
-}
-
-manager.runTests(gTrackTests, startTest);
-</script>
-</pre>
-</body>
-</html>
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -121,19 +121,16 @@ DOMInterfaces = {
 'AudioParam' : {
     'nativeOwnership': 'refcounted'
 },
 
 'BeforeUnloadEvent': {
     'nativeType': 'nsDOMBeforeUnloadEvent',
 },
 
-'AudioStreamTrack': {
-},
-
 'BiquadFilterNode': {
     'resultNotAddRefed': [ 'frequency', 'q', 'gain' ],
 },
 
 'Blob': [
 {
     'headerFile': 'nsIDOMFile.h',
 },
@@ -547,21 +544,16 @@ DOMInterfaces = {
 {
     'nativeType': 'nsIInputStream',
     'notflattened': True
 },
 {
     'workers': True,
 }],
 
-'LocalMediaStream': {
-    'headerFile': 'DOMMediaStream.h',
-    'nativeType': 'mozilla::DOMLocalMediaStream'
-},
-
 'Location': {
     # NOTE: Before you turn on codegen for Location, make sure all the
     # Unforgeable stuff is dealt with.
     'nativeType': 'nsIDOMLocation',
     'skipGen': True,
     'register': False
 },
 
@@ -570,28 +562,29 @@ DOMInterfaces = {
     'nativeType': 'mozilla::DOMMediaStream'
 },
 {
     'nativeType': 'JSObject',
     'workers': True,
     'skipGen': True
 }],
 
+'LocalMediaStream': {
+    'headerFile': 'DOMMediaStream.h',
+    'nativeType': 'mozilla::DOMLocalMediaStream'
+},
+
 'MediaStreamList': {
     'headerFile': 'MediaStreamList.h',
     'wrapperCache': False,
     'nativeOwnership': 'owned',
     'resultNotAddRefed': [ '__indexedGetter' ],
     'binaryNames': { '__indexedGetter': 'IndexedGetter' }
 },
 
-'MediaStreamTrack': {
-    'concrete': False
-},
-
 'MessageEvent': {
     'nativeType': 'nsDOMMessageEvent',
 },
 
 'MouseEvent': {
     'nativeType': 'nsDOMMouseEvent',
     'hasXPConnectImpls': True,
 },
@@ -1020,19 +1013,16 @@ DOMInterfaces = {
 'URL' : [{
     'concrete': False,
 },
 {
     'implicitJSContext': [ 'createObjectURL', 'revokeObjectURL' ],
     'workers': True,
 }],
 
-'VideoStreamTrack': {
-},
-
 'WebGLActiveInfo': {
    'nativeType': 'mozilla::WebGLActiveInfo',
    'headerFile': 'WebGLContext.h',
    'wrapperCache': False
 },
 
 'WebGLBuffer': {
    'nativeType': 'mozilla::WebGLBuffer',
deleted file mode 100644
--- a/dom/webidl/AudioStreamTrack.webidl
+++ /dev/null
@@ -1,16 +0,0 @@
-/* -*- Mode: IDL; 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/.
- *
- * The origin of this IDL file is
- * http://dev.w3.org/2011/webrtc/editor/getusermedia.html
- *
- * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
- * liability, trademark and document use rules apply.
- */
-
-// [Constructor(optional MediaTrackConstraints audioConstraints)]
-interface AudioStreamTrack : MediaStreamTrack {
-//    static sequence<DOMString> getSourceIds ();
-};
--- a/dom/webidl/MediaStream.webidl
+++ b/dom/webidl/MediaStream.webidl
@@ -7,18 +7,18 @@
  * http://dev.w3.org/2011/webrtc/editor/getusermedia.html
  *
  * Copyright � 2012 W3C� (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
 interface MediaStream {
     // readonly attribute DOMString    id;
-    sequence<AudioStreamTrack> getAudioTracks ();
-    sequence<VideoStreamTrack> getVideoTracks ();
+    // sequence<MediaStreamTrack> getAudioTracks ();
+    // sequence<MediaStreamTrack> getVideoTracks ();
     // MediaStreamTrack           getTrackById (DOMString trackId);
     // void                       addTrack (MediaStreamTrack track);
     // void                       removeTrack (MediaStreamTrack track);
     //         attribute boolean      ended;
     //         attribute EventHandler onended;
     //         attribute EventHandler onaddtrack;
     //         attribute EventHandler onremovetrack;
 	readonly attribute double currentTime;
deleted file mode 100644
--- a/dom/webidl/MediaStreamTrack.webidl
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- Mode: IDL; 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/.
- *
- * The origin of this IDL file is
- * http://dev.w3.org/2011/webrtc/editor/getusermedia.html
- *
- * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
- * liability, trademark and document use rules apply.
- */
-
-interface MediaStreamTrack {
-    readonly    attribute DOMString             kind;
-    readonly    attribute DOMString             id;
-    readonly    attribute DOMString             label;
-//                attribute boolean               enabled;
-//    readonly    attribute MediaStreamTrackState readyState;
-//    readonly    attribute SourceTypeEnum        sourceType;
-//    readonly    attribute DOMString             sourceId;
-//                attribute EventHandler          onstarted;
-//                attribute EventHandler          onmute;
-//                attribute EventHandler          onunmute;
-//                attribute EventHandler          onended;
-//    any                    getConstraint (DOMString constraintName, optional boolean mandatory = false);
-//    void                   setConstraint (DOMString constraintName, any constraintValue, optional boolean mandatory = false);
-//    MediaTrackConstraints? constraints ();
-//    void                   applyConstraints (MediaTrackConstraints constraints);
-//    void                   prependConstraint (DOMString constraintName, any constraintValue);
-//    void                   appendConstraint (DOMString constraintName, any constraintValue);
-//                attribute EventHandler          onoverconstrained;
-//    void                   stop ();
-};
deleted file mode 100644
--- a/dom/webidl/VideoStreamTrack.webidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/* -*- Mode: IDL; 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/.
- *
- * The origin of this IDL file is
- * http://dev.w3.org/2011/webrtc/editor/getusermedia.html
- *
- * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
- * liability, trademark and document use rules apply.
- */
-
-// [Constructor(optional MediaTrackConstraints videoConstraints)]
-interface VideoStreamTrack : MediaStreamTrack {
-//    static sequence<DOMString> getSourceIds ();
-//    void                       takePhoto ();
-//                attribute EventHandler onphoto;
-//                attribute EventHandler onphotoerror;
-};
--- a/dom/webidl/WebIDL.mk
+++ b/dom/webidl/WebIDL.mk
@@ -15,17 +15,16 @@ webidl_files = \
   ArchiveRequest.webidl \
   AudioBuffer.webidl \
   AudioBufferSourceNode.webidl \
   AudioContext.webidl \
   AudioDestinationNode.webidl \
   AudioListener.webidl \
   AudioNode.webidl \
   AudioParam.webidl \
-  AudioStreamTrack.webidl \
   Attr.webidl \
   BatteryManager.webidl \
   BeforeUnloadEvent.webidl \
   BiquadFilterNode.webidl \
   Blob.webidl \
   CanvasRenderingContext2D.webidl \
   CaretPosition.webidl \
   CDATASection.webidl \
@@ -150,17 +149,16 @@ webidl_files = \
   IDBVersionChangeEvent.webidl \
   ImageData.webidl \
   InspectorUtils.webidl \
   LinkStyle.webidl \
   LocalMediaStream.webidl \
   Location.webidl \
   MediaError.webidl \
   MediaStream.webidl \
-  MediaStreamTrack.webidl \
   MessageEvent.webidl \
   MouseEvent.webidl \
   MouseScrollEvent.webidl \
   MozActivity.webidl \
   MutationEvent.webidl \
   MutationObserver.webidl \
   NetDashboard.webidl \
   Node.webidl \
@@ -295,17 +293,16 @@ webidl_files = \
   URL.webidl \
   ValidityState.webidl \
   WebComponents.webidl \
   WebSocket.webidl \
   WheelEvent.webidl \
   UndoManager.webidl \
   URLUtils.webidl \
   USSDReceivedEvent.webidl \
-  VideoStreamTrack.webidl \
   XMLDocument.webidl \
   XMLHttpRequest.webidl \
   XMLHttpRequestEventTarget.webidl \
   XMLHttpRequestUpload.webidl \
   XMLSerializer.webidl \
   XMLStylesheetProcessingInstruction.webidl \
   XPathEvaluator.webidl \
   XULCommandEvent.webidl \