X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=core%2Fframe%2Fdraw_frame.cpp;h=7284a8d7e5748d144433a7f5b65beab8d5e115ec;hb=cfc2713aa265cf40fb255584ad232e0db32cf236;hp=a986f7c54173649a3fe1a46cb4cbbbc0ba609ed2;hpb=f8f6a249b84f66e057c1a954eaea05fc5fbfc331;p=casparcg diff --git a/core/frame/draw_frame.cpp b/core/frame/draw_frame.cpp index a986f7c54..7284a8d7e 100644 --- a/core/frame/draw_frame.cpp +++ b/core/frame/draw_frame.cpp @@ -19,12 +19,10 @@ * Author: Robert Nagy, ronag89@gmail.com */ -#include "../stdafx.h" +#include "../StdAfx.h" #include "draw_frame.h" - #include "frame.h" - #include "frame_transform.h" namespace caspar { namespace core { @@ -41,7 +39,7 @@ struct draw_frame::impl { std::shared_ptr frame_; std::vector frames_; - core::frame_transform frame_transform_; + core::frame_transform frame_transform_; public: impl() @@ -91,6 +89,22 @@ public: frame_ == other.frame_ && frame_transform_ == other.frame_transform_; } + + int64_t get_and_record_age_millis(const draw_frame& self) + { + int64_t result = 0; + + for (auto& frame : frames_) + { + if (frame != self) + result = std::max(result, frame.get_and_record_age_millis()); + } + + if (frame_) + result = std::max(result, frame_->get_age_millis()); + + return result; + } }; draw_frame::draw_frame() : impl_(new impl()){} @@ -110,6 +124,7 @@ void draw_frame::swap(draw_frame& other){impl_.swap(other.impl_);} const core::frame_transform& draw_frame::transform() const { return impl_->frame_transform_;} core::frame_transform& draw_frame::transform() { return impl_->frame_transform_;} void draw_frame::accept(frame_visitor& visitor) const{impl_->accept(visitor);} +int64_t draw_frame::get_and_record_age_millis() { return impl_->get_and_record_age_millis(*this); } bool draw_frame::operator==(const draw_frame& other)const{return *impl_ == *other.impl_;} bool draw_frame::operator!=(const draw_frame& other)const{return !(*this == other);} @@ -174,8 +189,8 @@ draw_frame late_frame(const_frame(0)); draw_frame draw_frame::still(draw_frame frame) { - frame.transform().image_transform.is_still = true; - frame.transform().audio_transform.is_still = true; + frame.transform().image_transform.is_still = true; + frame.transform().audio_transform.is_still = true; return frame; } @@ -190,4 +205,4 @@ const draw_frame& draw_frame::late() } -}} \ No newline at end of file +}}