OpenShot Library | libopenshot
0.2.2
|
Go to the documentation of this file.
29 #include "../include/Clip.h"
30 #include "../include/FFmpegReader.h"
31 #include "../include/Timeline.h"
32 #include "../include/QtPlayer.h"
33 #include "../include/Qt/PlayerPrivate.h"
34 #include "../include/Qt/VideoRenderer.h"
88 if (
reader && !threads_started) {
91 threads_started =
true;
114 return p->video_position;
120 if (
reader && threads_started && new_frame > 0) {
122 p->videoCache->Seek(new_frame);
125 p->video_position = new_frame;
128 p->last_video_position = 0;
131 p->audioPlayback->Seek(new_frame);
141 if (
reader && threads_started) {
142 p->videoCache->Stop();
143 p->audioPlayback->Stop();
149 p->video_position = 0;
150 threads_started =
false;
158 p->reader = new_reader;
159 p->videoCache->Reader(new_reader);
160 p->audioPlayback->Reader(new_reader);
187 p->speed = new_speed;
188 p->videoCache->setSpeed(new_speed);
190 p->audioPlayback->setSpeed(new_speed);
void Seek(int64_t new_frame)
Seek to a specific frame in the player.
int sample_rate
The number of audio samples per second (44100 is a common sample rate)
void CloseAudioDevice()
Close audio device.
@ PLAYBACK_PLAY
Play the video normally.
int Position()
Get the current frame number being played.
void AddClip(Clip *clip)
Add an openshot::Clip to the timeline.
This namespace is the default namespace for all code in the openshot library.
void Stop()
Stop the video player and clear the cached frames.
ReaderBase * Reader()
Get the current reader, such as a FFmpegReader.
This class represents a clip (used to arrange readers on the timeline)
QtPlayer()
Default constructor.
ChannelLayout channel_layout
The channel layout (mono, stereo, 5 point surround, etc...)
void Play()
Play the video.
int width
The width of the video (in pixesl)
ReaderInfo info
Information about the current media file.
void Loading()
Display a loading animation.
@ PLAYBACK_STOPPED
Stop playing the video (clear cache, done with player)
void DisplayInfo()
Display file information in the standard output stream (stdout)
int height
The height of the video (in pixels)
void Pause()
Pause the video.
The private part of QtPlayer class, which contains an audio thread and video thread,...
bool has_audio
Determines if this file has an audio stream.
PlaybackMode Mode()
Get the current mode.
This class represents a timeline.
PlaybackMode
This enumeration determines the mode of the video player (i.e. playing, paused, etc....
void Open()
Open the reader (and start consuming resources)
static AudioDeviceManagerSingleton * Instance(int numChannels)
Create or get an instance of this singleton (invoke the class with this method)
This class uses the FFmpeg libraries, to open video files and audio files, and return openshot::Frame...
float Speed()
Get the Playback speed.
float Volume()
Get the Volume.
@ PLAYBACK_LOADING
Loading the video (display a loading animation)
void SetQWidget(int64_t qwidget_address)
This is the base class of all Renderers in libopenshot.
Fraction fps
Frames per second, as a fraction (i.e. 24/1 = 24 fps)
virtual ~QtPlayer()
Default destructor.
@ PLAYBACK_PAUSED
Pause the video (holding the last displayed frame)
This is the base class of all Players in libopenshot.
void CloseAudioDevice()
Close audio device.
This abstract class is the base class, used by all readers in libopenshot.
int64_t GetRendererQObject()
Get the Renderer pointer address (for Python to cast back into a QObject)
void SetSource(const std::string &source)
Set the source URL/path of this player (which will create an internal Reader)
int channels
The number of audio channels used in the audio stream.
virtual void OverrideWidget(int64_t qwidget_address)=0
Allow manual override of the QWidget that is used to display.