25 constexpr
const double kMinVideoDelay = 1.0 / 120;
28 constexpr
const double kMaxVideoDelay = 1.0 / 15;
33 : mutex_(
"VideoRendererCommon"),
46 return fill_mode_.load(std::memory_order_relaxed);
50 std::shared_ptr<DecodedFrame>*
frame) {
51 std::unique_lock<Mutex> lock(mutex_);
53 if (!player_ || !input_ ||
57 return kMinVideoDelay;
63 return kMinVideoDelay;
72 const double total_delay = next_frame ? next_frame->pts - time : 0;
74 std::max(std::min(total_delay, kMaxVideoDelay), kMinVideoDelay);
76 if (prev_time_ >= 0) {
81 if (ideal_frame->pts != prev_time_)
86 prev_time_ = ideal_frame->pts;
91 void VideoRendererCommon::OnSeeking() {
92 std::unique_lock<Mutex> lock(mutex_);
97 std::unique_lock<Mutex> lock(mutex_);
107 std::unique_lock<Mutex> lock(mutex_);
112 std::unique_lock<Mutex> lock(mutex_);
117 std::unique_lock<Mutex> lock(mutex_);
122 fill_mode_.store(mode, std::memory_order_relaxed);
std::shared_ptr< shaka::media::DecodedFrame > frame