28 #include "../../include/Qt/VideoCacheThread.h" 33 VideoCacheThread::VideoCacheThread()
34 : Thread(
"video-cache"), speed(1), is_playing(false), position(1)
40 VideoCacheThread::~VideoCacheThread()
45 int64_t VideoCacheThread::getCurrentFramePosition()
54 void VideoCacheThread::setCurrentFramePosition(int64_t current_frame_number)
56 current_display_frame = current_frame_number;
60 void VideoCacheThread::Seek(int64_t new_position)
62 position = new_position;
66 void VideoCacheThread::Play() {
72 void VideoCacheThread::Stop() {
78 void VideoCacheThread::run()
80 while (!threadShouldExit() && is_playing) {
83 double frame_time = (1000.0 / reader->info.fps.ToDouble());
87 while (speed == 1 && (position - current_display_frame) < max_frames)
93 ZmqLogger::Instance()->
AppendDebugMethod(
"VideoCacheThread::run (cache frame)",
"position", position,
"current_display_frame", current_display_frame,
"max_frames", max_frames,
"needed_frames", (position - current_display_frame),
"", -1,
"", -1);
96 reader->GetFrame(position);
100 catch (
const OutOfBoundsFrame &
e)
#define OPEN_MP_NUM_PROCESSORS
void AppendDebugMethod(string method_name, string arg1_name, float arg1_value, string arg2_name, float arg2_value, string arg3_name, float arg3_value, string arg4_name, float arg4_value, string arg5_name, float arg5_value, string arg6_name, float arg6_value)
Append debug information.
static ZmqLogger * Instance()
Create or get an instance of this logger singleton (invoke the class with this method) ...
This namespace is the default namespace for all code in the openshot library.