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 240911 00e5373b168b5bed8cf782702839bbd4b0bc0fa1
parent 240910 293cf7053cc66f26e5e3e833362ced46219c8602
child 240912 f5a92023aa1457b2bc50c1b225dc9d802f86372d
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt
bugs1061046
milestone36.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 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;