* 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 {
{
std::shared_ptr<const_frame> frame_;
std::vector<draw_frame> frames_;
- core::frame_transform frame_transform_;
+ core::frame_transform frame_transform_;
public:
impl()
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()){}
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);}
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;
}
}
-}}
\ No newline at end of file
+}}