OpenShot Library | libopenshot 1.1.1
Loading...
Searching...
No Matches
PlayerPrivate.h
Go to the documentation of this file.
1
9
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"
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
52 PlayerPrivate(openshot::RendererBase *rb);
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
Source file for AudioPlaybackThread class.
Header file for AudioReaderSource class.
Header file for ReaderBase class.
Header file for RendererBase class.
Header file for VideoCacheThread class.
Source file for VideoPlaybackThread class.
The audio playback thread.
friend struct AudioPlaybackThreadTestAccess
The parent class of PlayerPrivate.
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.