You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Added pausing, rewind, fast forward, and playing (and different speeds). Still a bit buggy and experimental with fast forward and rewinding (due to seek bugs in readers).
This commit is contained in:
@@ -31,16 +31,19 @@
|
||||
|
||||
namespace openshot
|
||||
{
|
||||
// Constructor
|
||||
VideoPlaybackThread::VideoPlaybackThread(RendererBase *rb)
|
||||
: Thread("video-playback"), renderer(rb)
|
||||
, render(), reset(false)
|
||||
{
|
||||
}
|
||||
|
||||
// Destructor
|
||||
VideoPlaybackThread::~VideoPlaybackThread()
|
||||
{
|
||||
}
|
||||
|
||||
// Get the currently playing frame number (if any)
|
||||
int VideoPlaybackThread::getCurrentFramePosition()
|
||||
{
|
||||
if (frame)
|
||||
@@ -49,11 +52,15 @@ namespace openshot
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Start the thread
|
||||
void VideoPlaybackThread::run()
|
||||
{
|
||||
while (!threadShouldExit()) {
|
||||
render.wait();
|
||||
// Make other threads wait on the render event
|
||||
render.wait();
|
||||
// Render the frame to the screen
|
||||
renderer->paint(frame);
|
||||
// Signal to other threads that the rendered event has completed
|
||||
rendered.signal();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user