OpenShot Library | libopenshot 1.1.1
Loading...
Searching...
No Matches
PlayerPrivate.h
Go to the documentation of this file.
1
10// Copyright (c) 2008-2019 OpenShot Studios, LLC
11//
12// SPDX-License-Identifier: LGPL-3.0-or-later
13
14#ifndef OPENSHOT_PLAYER_PRIVATE_H
15#define OPENSHOT_PLAYER_PRIVATE_H
16
17#include "../ReaderBase.h"
18#include "../RendererBase.h"
19#include "../AudioReaderSource.h"
20#include "../Qt/AudioPlaybackThread.h"
21#include "../Qt/VideoPlaybackThread.h"
22#include "../Qt/VideoCacheThread.h"
23#include <atomic>
24#include <mutex>
25
26namespace openshot
27{
32 class PlayerPrivate : juce::Thread
33 {
34 std::shared_ptr<openshot::Frame> frame;
35 std::mutex frame_mutex;
36 std::atomic<uint64_t> seek_generation{0};
37 int64_t playback_frames;
38 std::atomic<int64_t> video_position;
39 int64_t audio_position;
40 openshot::ReaderBase *reader;
41 openshot::AudioPlaybackThread *audioPlayback;
42 openshot::VideoPlaybackThread *videoPlayback;
43 openshot::VideoCacheThread *videoCache;
44 std::atomic<int> speed;
45 int last_speed;
46 openshot::RendererBase *renderer;
47 std::atomic<int64_t> last_video_position;
48 int max_sleep_ms;
49 std::atomic<bool> is_dirty;
50
54 virtual ~PlayerPrivate();
55
57 void run();
58
60 bool startPlayback();
61
63 void Seek(int64_t new_position);
64
66 void stopPlayback();
67
69 std::shared_ptr<openshot::Frame> getFrame();
70
73 friend class QtPlayer;
74 };
75
76}
77
78#endif // OPENSHOT_PLAYER_PRIVATE_H
The audio playback thread.
The private part of QtPlayer class, which contains an audio thread and video thread,...
friend struct AudioPlaybackThreadTestAccess
The parent class of PlayerPrivate.
This class is used to playback a video from a reader.
Definition QtPlayer.h:36
This abstract class is the base class, used by all readers in libopenshot.
Definition ReaderBase.h:76
This is the base class of all Renderers in libopenshot.
Handles prefetching and caching of video/audio frames for smooth playback.
The video playback class.
This namespace is the default namespace for all code in the openshot library.