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