The VideoEngine is handling the background tasks of the video. More...
#include <foleys_VideoEngine.h>
Inherits Timer.
Public Member Functions | |
| VideoEngine () | |
| ~VideoEngine () override | |
| std::shared_ptr< AVClip > | createClipFromFile (juce::URL url, StreamTypes type=StreamTypes::all()) |
| Use the source file to figure the most appropriate AVClip descendant. | |
| std::unique_ptr< AVReader > | createReaderFor (juce::File file, StreamTypes type=StreamTypes::all()) |
| Find an appropriate AVReader to be used to read a video file. | |
| void | addJob (std::function< void()> job) |
| void | addJob (juce::ThreadPoolJob *job, bool deleteJobWhenFinished) |
| void | cancelJob (juce::ThreadPoolJob *job) |
| juce::ThreadPool & | getThreadPool () |
| void | manageLifeTime (std::shared_ptr< AVClip > clip) |
| This method will add the clip to the background threads and hold an auto release pool to make sure, it won't be deleted in any realtime critical thread. | |
| void | setUndoManager (juce::UndoManager *undoManager) |
| You can set an external undomanager. | |
| juce::UndoManager * | getUndoManager () |
| AVFormatManager & | getFormatManager () |
| Grant access to the AVFormatManager. | |
| AudioPluginManager & | getAudioPluginManager () |
| Grants access to the AudioPluginManager, e.g. | |
| VideoPluginManager & | getVideoPluginManager () |
| Grants access to the VideoPluginManager, e.g. | |
| juce::AudioFormatManager & | getAudioFormatManager () |
| Grants access to the VideoPluginManager, e.g. | |
| std::unique_ptr< VideoProcessor > | createVideoPluginInstance (const juce::String &identifierString, juce::String &error) const |
| Use the VideoPluginManager to create a VideoProcessor instance. | |
| std::unique_ptr< juce::AudioProcessor > | createAudioPluginInstance (const juce::String &identifierString, double sampleRate, int blockSize, juce::String &error) const |
| Use the AudioPluginManager to create a AudioProcessor instance. | |
| juce::TimeSliceThread & | getNextTimeSliceThread () |
| This method will find the TimeSliceThread with the least number of clients to balance the load. | |
The VideoEngine is handling the background tasks of the video.
You should have only one instance.
You can use the VideoEngine to create instances of AVClip, using the built in AVFormatManager. It also manages the lifetime of the clips, managing the auto release pool and the thread pools for reading ahead and for creating the thumbnails.
| VideoEngine | ( | ) |
|
override |
| std::shared_ptr< AVClip > createClipFromFile | ( | juce::URL | url, |
| StreamTypes | type = StreamTypes::all() |
||
| ) |
Use the source file to figure the most appropriate AVClip descendant.
References AVFormatManager::createClipFromFile(), and VideoEngine::manageLifeTime().
Referenced by MainContentComponent::openFile().
| std::unique_ptr< AVReader > createReaderFor | ( | juce::File | file, |
| StreamTypes | type = StreamTypes::all() |
||
| ) |
Find an appropriate AVReader to be used to read a video file.
References AVFormatManager::createReaderFor().
| void addJob | ( | std::function< void()> | job | ) |
Referenced by AudioPluginManager::setPluginDataFile().
| void addJob | ( | juce::ThreadPoolJob * | job, |
| bool | deleteJobWhenFinished | ||
| ) |
| void cancelJob | ( | juce::ThreadPoolJob * | job | ) |
| juce::ThreadPool & getThreadPool | ( | ) |
Referenced by ClipRenderer::cancelRendering(), and ClipRenderer::startRendering().
| void manageLifeTime | ( | std::shared_ptr< AVClip > | clip | ) |
This method will add the clip to the background threads and hold an auto release pool to make sure, it won't be deleted in any realtime critical thread.
When using the engine's factory methods, this is already done for you, if you create a clip manually, calling make_shared, you will have to call this function for the clip to function.
References VideoEngine::getNextTimeSliceThread().
Referenced by VideoEngine::createClipFromFile().
| void setUndoManager | ( | juce::UndoManager * | undoManager | ) |
You can set an external undomanager.
In this case you are responsible for detetion. If you use the undomanager provided by the engine, you don't have to do anything for it's lifetime.
| juce::UndoManager * getUndoManager | ( | ) |
| AVFormatManager & getFormatManager | ( | ) |
Grant access to the AVFormatManager.
The AVFormatManager is responsible to load the different kinds of AVClips from files.
Referenced by MainContentComponent::MainContentComponent(), and ClipRenderer::startRendering().
| AudioPluginManager & getAudioPluginManager | ( | ) |
Grants access to the AudioPluginManager, e.g.
to register AudioProcessor factories
| VideoPluginManager & getVideoPluginManager | ( | ) |
Grants access to the VideoPluginManager, e.g.
to register VideoProcessor factories
| juce::AudioFormatManager & getAudioFormatManager | ( | ) |
Grants access to the VideoPluginManager, e.g.
to register VideoProcessor factories
References AVFormatManager::audioFormatManager.
| std::unique_ptr< VideoProcessor > createVideoPluginInstance | ( | const juce::String & | identifierString, |
| juce::String & | error | ||
| ) | const |
Use the VideoPluginManager to create a VideoProcessor instance.
References VideoPluginManager::createVideoPluginInstance().
| std::unique_ptr< juce::AudioProcessor > createAudioPluginInstance | ( | const juce::String & | identifierString, |
| double | sampleRate, | ||
| int | blockSize, | ||
| juce::String & | error | ||
| ) | const |
Use the AudioPluginManager to create a AudioProcessor instance.
References AudioPluginManager::createAudioPluginInstance().
| juce::TimeSliceThread & getNextTimeSliceThread | ( | ) |
This method will find the TimeSliceThread with the least number of clients to balance the load.
Referenced by VideoEngine::manageLifeTime().