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}
This commit is contained in:
philipel
2016-08-03 10:59:32 +02:00
parent 17dfa7425f
commit 4f6cd6ac59
4 changed files with 68 additions and 20 deletions

View File

@ -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 @@ class FrameBuffer {
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 @@ class FrameBuffer {
// 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 @@ class FrameBuffer {
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);
};