Bug 1061046. Part 8: Remove PeerConnectionMedia's USECS_PER_S video rate and use the GraphRate instead. r=karlt
authorRobert O'Callahan <robert@ocallahan.org>
Thu, 18 Sep 2014 11:50:01 +1200
changeset 216622 00e5373b168b5bed8cf782702839bbd4b0bc0fa1
parent 216621 293cf7053cc66f26e5e3e833362ced46219c8602
child 216623 f5a92023aa1457b2bc50c1b225dc9d802f86372d
push id10072
push userkwierso@gmail.com
push dateFri, 21 Nov 2014 02:07:06 +0000
treeherderfx-team@e5b26d5a9a52 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt
bugs1061046
milestone36.0a1
Bug 1061046. Part 8: Remove PeerConnectionMedia's USECS_PER_S video rate and use the GraphRate instead. r=karlt
media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h
@@ -102,17 +102,18 @@ class Fake_VideoGenerator {
   explicit Fake_VideoGenerator(DOMMediaStream* aStream) {
     mStream = aStream;
     mCount = 0;
     mTimer = do_CreateInstance("@mozilla.org/timer;1");
     MOZ_ASSERT(mTimer);
 
     // Make a track
     mozilla::VideoSegment *segment = new mozilla::VideoSegment();
-    mStream->GetStream()->AsSourceStream()->AddTrack(1, mozilla::USECS_PER_S, 0, segment);
+    mStream->GetStream()->AsSourceStream()->AddTrack(1,
+        mStream->GetStream()->GraphRate(), 0, segment);
     mStream->GetStream()->AsSourceStream()->AdvanceKnownTracksTime(mozilla::STREAM_TIME_MAX);
 
     // Set the timer. Set to 10 fps.
     mTimer->InitWithFuncCallback(Callback, this, 100, nsITimer::TYPE_REPEATING_SLACK);
   }
 
   static void Callback(nsITimer* timer, void *arg) {
     Fake_VideoGenerator* gen = static_cast<Fake_VideoGenerator*>(arg);
@@ -152,17 +153,18 @@ class Fake_VideoGenerator {
 
     // SetData copies data, so we can free the frame
     planar->SetData(data);
     PR_Free(frame);
 
     // AddTrack takes ownership of segment
     mozilla::VideoSegment *segment = new mozilla::VideoSegment();
     // 10 fps.
-    segment->AppendFrame(image.forget(), mozilla::USECS_PER_S / 10,
+    segment->AppendFrame(image.forget(),
+                         gen->mStream->GetStream()->GraphRate() / 10,
                          IntSize(WIDTH, HEIGHT));
 
     gen->mStream->GetStream()->AsSourceStream()->AppendToTrack(1, segment);
   }
 
  private:
   nsCOMPtr<nsITimer> mTimer;
   nsRefPtr<DOMMediaStream> mStream;