OpenShot Library | libopenshot  0.2.4
VideoPlaybackThread.h
Go to the documentation of this file.
1 /**
2  * @file
3  * @brief Source file for VideoPlaybackThread class
4  * @author Duzy Chan <code@duzy.info>
5  * @author Jonathan Thomas <jonathan@openshot.org>
6  *
7  * @ref License
8  */
9 
10 /* LICENSE
11  *
12  * Copyright (c) 2008-2019 OpenShot Studios, LLC
13  * <http://www.openshotstudios.com/>. This file is part of
14  * OpenShot Library (libopenshot), an open-source project dedicated to
15  * delivering high quality video editing and animation solutions to the
16  * world. For more information visit <http://www.openshot.org/>.
17  *
18  * OpenShot Library (libopenshot) is free software: you can redistribute it
19  * and/or modify it under the terms of the GNU Lesser General Public License
20  * as published by the Free Software Foundation, either version 3 of the
21  * License, or (at your option) any later version.
22  *
23  * OpenShot Library (libopenshot) is distributed in the hope that it will be
24  * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26  * GNU Lesser General Public License for more details.
27  *
28  * You should have received a copy of the GNU Lesser General Public License
29  * along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
30  */
31 
32 #ifndef OPENSHOT_VIDEO_PLAYBACK_THREAD_H
33 #define OPENSHOT_VIDEO_PLAYBACK_THREAD_H
34 
35 #include "../ReaderBase.h"
36 #include "../RendererBase.h"
37 
38 namespace openshot
39 {
40  using juce::Thread;
41  using juce::WaitableEvent;
42 
43  /**
44  * @brief The video playback class.
45  */
46  class VideoPlaybackThread : Thread
47  {
48  RendererBase *renderer;
49  std::shared_ptr<Frame> frame;
50  WaitableEvent render;
51  WaitableEvent rendered;
52  bool reset;
53 
54  /// Constructor
56  /// Destructor
58 
59  /// Get the currently playing frame number (if any)
60  int64_t getCurrentFramePosition();
61 
62  /// Start the thread
63  void run();
64 
65  /// Parent class of VideoPlaybackThread
66  friend class PlayerPrivate;
67  friend class QtPlayer;
68  };
69 
70 }
71 
72 #endif // OPENSHOT_VIDEO_PLAYBACK_THREAD_H
This class is used to playback a video from a reader.
Definition: QtPlayer.h:47
The video playback class.
The private part of QtPlayer class, which contains an audio thread and video thread, and controls the video timing and audio synchronization code.
Definition: PlayerPrivate.h:48
This namespace is the default namespace for all code in the openshot library.
This is the base class of all Renderers in libopenshot.
Definition: RendererBase.h:48