Bug 1061046. Part 7: Remove MediaPipeline's USECS_PER_S video rate and use the graph rate instead. r=karlt
authorRobert O'Callahan <robert@ocallahan.org>
Thu, 18 Sep 2014 11:50:01 +1200
changeset 216621 293cf7053cc66f26e5e3e833362ced46219c8602
parent 216620 ed2ea9cfc90c5d66df6fd922d844639667306ebe
child 216622 00e5373b168b5bed8cf782702839bbd4b0bc0fa1
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 7: Remove MediaPipeline's USECS_PER_S video rate and use the graph rate instead. r=karlt
media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
media/webrtc/signaling/test/FakeMediaStreams.h
--- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
+++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
@@ -1454,17 +1454,17 @@ nsresult MediaPipelineReceiveVideo::Init
   static_cast<VideoSessionConduit *>(conduit_.get())->
       AttachRenderer(renderer_);
 
   return MediaPipelineReceive::Init();
 }
 
 MediaPipelineReceiveVideo::PipelineListener::PipelineListener(
   SourceMediaStream* source, TrackID track_id)
-  : GenericReceiveListener(source, track_id, USECS_PER_S),
+  : GenericReceiveListener(source, track_id, source->GraphRate()),
     width_(640),
     height_(480),
 #ifdef MOZILLA_INTERNAL_API
     image_container_(),
     image_(),
 #endif
     monitor_("Video PipelineListener") {
 #ifdef MOZILLA_INTERNAL_API
@@ -1522,17 +1522,20 @@ void MediaPipelineReceiveVideo::Pipeline
 }
 
 void MediaPipelineReceiveVideo::PipelineListener::
 NotifyPull(MediaStreamGraph* graph, StreamTime desired_time) {
   ReentrantMonitorAutoEnter enter(monitor_);
 
 #ifdef MOZILLA_INTERNAL_API
   nsRefPtr<layers::Image> image = image_;
-  TrackTicks target = source_->TimeToTicksRoundUp(USECS_PER_S, desired_time);
+  // our constructor sets track_rate_ to the graph rate
+  MOZ_ASSERT(track_rate_ == source_->GraphRate());
+  TrackTicks target = source_->TimeToTicksRoundUp(
+      source_->GraphRate(), desired_time);
   TrackTicks delta = target - played_ticks_;
 
   // Don't append if we've already provided a frame that supposedly
   // goes past the current aDesiredTime Doing so means a negative
   // delta and thus messes up handling of the graph
   if (delta > 0) {
     VideoSegment segment;
     segment.AppendFrame(image.forget(), delta, IntSize(width_, height_));
--- a/media/webrtc/signaling/test/FakeMediaStreams.h
+++ b/media/webrtc/signaling/test/FakeMediaStreams.h
@@ -324,24 +324,16 @@ private:
 
   // tells the SDP generator about whether this
   // MediaStream probably has audio and/or video
   uint32_t mHintContents;
   nsRefPtr<Fake_MediaStreamTrack> mVideoTrack;
   nsRefPtr<Fake_MediaStreamTrack> mAudioTrack;
 };
 
-class Fake_MediaStreamGraph
-{
-public:
-  virtual ~Fake_MediaStreamGraph() {}
-};
-
-
-
 class Fake_MediaStreamBase : public Fake_MediaStream {
  public:
   Fake_MediaStreamBase() : mPeriodic(new Fake_MediaPeriodic(this)) {}
 
   virtual nsresult Start();
   virtual nsresult Stop();
 
   virtual int GetSegmentsAdded() {