Video display and composing engine for JUCE
Loading...
Searching...
No Matches
VideoEngine Class Reference

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< AVClipcreateClipFromFile (juce::URL url, StreamTypes type=StreamTypes::all())
 Use the source file to figure the most appropriate AVClip descendant.
 
std::unique_ptr< AVReadercreateReaderFor (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 ()
 
AVFormatManagergetFormatManager ()
 Grant access to the AVFormatManager.
 
AudioPluginManagergetAudioPluginManager ()
 Grants access to the AudioPluginManager, e.g.
 
VideoPluginManagergetVideoPluginManager ()
 Grants access to the VideoPluginManager, e.g.
 
juce::AudioFormatManager & getAudioFormatManager ()
 Grants access to the VideoPluginManager, e.g.
 
std::unique_ptr< VideoProcessorcreateVideoPluginInstance (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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ VideoEngine()

◆ ~VideoEngine()

~VideoEngine ( )
override

Member Function Documentation

◆ createClipFromFile()

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().

◆ createReaderFor()

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().

◆ addJob() [1/2]

void addJob ( std::function< void()>  job)

◆ addJob() [2/2]

void addJob ( juce::ThreadPoolJob *  job,
bool  deleteJobWhenFinished 
)

◆ cancelJob()

void cancelJob ( juce::ThreadPoolJob *  job)

◆ getThreadPool()

juce::ThreadPool & getThreadPool ( )

◆ manageLifeTime()

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().

◆ setUndoManager()

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.

◆ getUndoManager()

juce::UndoManager * getUndoManager ( )

◆ getFormatManager()

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().

◆ getAudioPluginManager()

AudioPluginManager & getAudioPluginManager ( )

Grants access to the AudioPluginManager, e.g.

to register AudioProcessor factories

◆ getVideoPluginManager()

VideoPluginManager & getVideoPluginManager ( )

Grants access to the VideoPluginManager, e.g.

to register VideoProcessor factories

◆ getAudioFormatManager()

juce::AudioFormatManager & getAudioFormatManager ( )

Grants access to the VideoPluginManager, e.g.

to register VideoProcessor factories

References AVFormatManager::audioFormatManager.

◆ createVideoPluginInstance()

std::unique_ptr< VideoProcessor > createVideoPluginInstance ( const juce::String &  identifierString,
juce::String &  error 
) const

◆ createAudioPluginInstance()

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().

◆ getNextTimeSliceThread()

juce::TimeSliceThread & getNextTimeSliceThread ( )

This method will find the TimeSliceThread with the least number of clients to balance the load.

Referenced by VideoEngine::manageLifeTime().


The documentation for this class was generated from the following files: