Wire up VCMTiming in FrameBuffer2.

The VCMTiming class is now used to set the render time for frames.

BUG=webrtc:5514
R=stefan@webrtc.org

Review URL: https://codereview.webrtc.org/2138873003 .

Cr-Commit-Position: refs/heads/master@{#13621}
diff --git a/webrtc/modules/video_coding/frame_buffer2.h b/webrtc/modules/video_coding/frame_buffer2.h
index 3201f62..0af2bf9 100644
--- a/webrtc/modules/video_coding/frame_buffer2.h
+++ b/webrtc/modules/video_coding/frame_buffer2.h
@@ -21,6 +21,8 @@
 #include "webrtc/base/criticalsection.h"
 #include "webrtc/base/event.h"
 #include "webrtc/base/thread_annotations.h"
+#include "webrtc/modules/video_coding/include/video_coding_defines.h"
+#include "webrtc/modules/video_coding/inter_frame_delay.h"
 
 namespace webrtc {
 
@@ -36,7 +38,7 @@
  public:
   FrameBuffer(Clock* clock,
               VCMJitterEstimator* jitter_estimator,
-              const VCMTiming* timing);
+              VCMTiming* timing);
 
   // Insert a frame into the frame buffer.
   void InsertFrame(std::unique_ptr<FrameObject> frame);
@@ -46,6 +48,12 @@
   // unique ptr if there is no available frame for decoding.
   std::unique_ptr<FrameObject> NextFrame(int64_t max_wait_time_ms);
 
+  // Tells the FrameBuffer which protection mode that is in use. Affects
+  // the frame timing.
+  // TODO(philipel): Remove this when new timing calculations has been
+  //                 implemented.
+  void SetProtectionMode(VCMVideoProtection mode);
+
   // Start the frame buffer, has no effect if the frame buffer is started.
   // The frame buffer is started upon construction.
   void Start();
@@ -78,10 +86,12 @@
   rtc::CriticalSection crit_;
   Clock* const clock_;
   rtc::Event frame_inserted_event_;
-  VCMJitterEstimator* const jitter_estimator_;
-  const VCMTiming* const timing_;
+  VCMJitterEstimator* const jitter_estimator_ GUARDED_BY(crit_);
+  VCMTiming* const timing_ GUARDED_BY(crit_);
+  VCMInterFrameDelay inter_frame_delay_ GUARDED_BY(crit_);
   int newest_picture_id_ GUARDED_BY(crit_);
   bool stopped_ GUARDED_BY(crit_);
+  VCMVideoProtection protection_mode_ GUARDED_BY(crit_);
 
   RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(FrameBuffer);
 };