The MovieClip plays back a video file. More...
#include <foleys_MovieClip.h>
Inheritance diagram for MovieClip:Public Member Functions | |
| MovieClip (VideoEngine &videoEngine) | |
| juce::String | getClipType () const override |
| Used to identify the clip type to the user. | |
| juce::String | getDescription () const override |
| returns a string describing the clip. | |
| bool | openFromFile (const juce::File file) |
| juce::URL | getMediaFile () const override |
| returns the original media file to restore | |
| void | setReader (std::unique_ptr< AVReader > reader) |
| void | setThumbnailReader (std::unique_ptr< AVReader > reader) |
| Size | getVideoSize () const override |
| returns the pixel size of the media as a tuple. | |
| double | getLengthInSeconds () const override |
| Returns the length of the clip in seconds. | |
| double | getCurrentTimeInSeconds () const override |
| Return the clip's read position in seconds. | |
| VideoFrame & | getFrame (double pts) override |
| Returns the frame for a certain timecode. | |
| bool | isFrameAvailable (double pts) const override |
| Checks, if a frame is available. | |
| void | render (juce::Graphics &view, juce::Rectangle< float > area, double pts, float rotation=0.0f, float zoom=100.0f, juce::Point< float > translation=juce::Point< float >(), float alpha=1.0f) override |
| This is the virtual render() method for OpenGL rendering. | |
| void | prepareToPlay (int samplesPerBlockExpected, double sampleRate) override |
| void | releaseResources () override |
| void | getNextAudioBlock (const juce::AudioSourceChannelInfo &) override |
| void | setNextReadPosition (juce::int64 samples) override |
| juce::int64 | getNextReadPosition () const override |
| juce::int64 | getTotalLength () const override |
| bool | isLooping () const override |
| void | setLooping (bool shouldLoop) override |
| juce::Image | getStillImage (double seconds, Size size) override |
| This returns a still frame on the selected position. | |
| juce::TimeSliceClient * | getBackgroundJob () override |
| bool | hasVideo () const override |
| Returns true, if this clip will produce visual frames. | |
| bool | hasAudio () const override |
| Returns true, if this clip will produce audio. | |
| double | getFrameDurationInSeconds () const override |
| Returns the duration of a frame in seconds. | |
| std::shared_ptr< AVClip > | createCopy (StreamTypes types) override |
| This returns a copy of the clip. | |
| double | getSampleRate () const override |
| This is the samplerate supplied from prepareToPlay and the sample rate this clip will produce audio and use as clock source. | |
| bool | waitForSamplesReady (int samples, int timeout=1000) override |
| When rendering non realtime (bounce), use this to wait for background threads to read ahead. | |
| bool | waitForFrameReady (double pts, int timeout=1000) override |
| When rendering non realtime (bounce), use this to wait for background threads to read ahead. | |
Public Member Functions inherited from AVClip | |
| AVClip (VideoEngine &videoEngine) | |
| virtual | ~AVClip ()=default |
| void | renderFrame (juce::Graphics &g, juce::Rectangle< float > area, VideoFrame &frame, float rotation, float zoom, juce::Point< float > translation, float alpha) |
| Renders a frame on the OpenGLView. | |
| void | setAspectType (Aspect type) |
| const ParameterMap & | getVideoParameters () |
| const ParameterMap & | getAudioParameters () |
| VideoEngine * | getVideoEngine () const |
Public Member Functions inherited from TimeCodeAware | |
| TimeCodeAware ()=default | |
| virtual | ~TimeCodeAware ()=default |
| void | addTimecodeListener (Listener *listener) |
| Register a TimecodeListener to be notified, when the visual frame changes. | |
| void | removeTimecodeListener (Listener *listener) |
| Unregister a TimecodeListener. | |
Additional Inherited Members | |
Static Public Member Functions inherited from AVClip | |
| static void | addDefaultAudioParameters (AVClip &clip) |
| static void | addDefaultVideoParameters (AVClip &clip) |
Protected Member Functions inherited from AVClip | |
| void | addAudioParameter (std::unique_ptr< ProcessorParameter > parameter) |
| void | addVideoParameter (std::unique_ptr< ProcessorParameter > parameter) |
Protected Member Functions inherited from TimeCodeAware | |
| void | sendTimecode (int64_t count, double seconds, juce::NotificationType nt) |
| Subclasses can call this to notify displays, that the time code has changed, e.g. | |
The MovieClip plays back a video file.
It buffers an amount of audio and video frames ahead of time. To check, you can call isFrameAvailable(), in case you need to wait for the frame, e.g. for offline bouncing.
When you created a shared_ptr of an MovieClip, call manageLifeTime() on the VideoEngine, that will add it to the auto release pool and register possible background jobs with the TimeSliceThreads.
| MovieClip | ( | VideoEngine & | videoEngine | ) |
References AVClip::addDefaultAudioParameters(), and AVClip::addDefaultVideoParameters().
|
overridevirtual |
Used to identify the clip type to the user.
Implements AVClip.
|
overridevirtual |
returns a string describing the clip.
This could be the filename of the original media file
Implements AVClip.
| bool openFromFile | ( | const juce::File | file | ) |
|
overridevirtual |
returns the original media file to restore
Reimplemented from AVClip.
Referenced by MovieClip::createCopy().
| void setReader | ( | std::unique_ptr< AVReader > | reader | ) |
| void setThumbnailReader | ( | std::unique_ptr< AVReader > | reader | ) |
Referenced by MovieClip::openFromFile().
|
overridevirtual |
returns the pixel size of the media as a tuple.
In some video files this can change at any frame.
Implements AVClip.
|
overridevirtual |
Returns the length of the clip in seconds.
Implements AVClip.
|
overridevirtual |
Return the clip's read position in seconds.
Implements TimeCodeAware.
|
overridevirtual |
Returns the frame for a certain timecode.
Implements AVClip.
References VideoFifo::getFrameSeconds().
Referenced by MovieClip::render().
|
overridevirtual |
|
overridevirtual |
This is the virtual render() method for OpenGL rendering.
Implements AVClip.
References MovieClip::getFrame(), and AVClip::renderFrame().
|
override |
References AudioFifo::setNumSamples(), and AudioFifo::setSampleRate().
|
override |
|
override |
References foleys::IDs::gain, AVClip::getAudioParameters(), and AudioFifo::pullSamples().
|
override |
References VideoFifo::clear(), and AudioFifo::setPosition().
|
override |
|
override |
|
override |
|
override |
|
overridevirtual |
This returns a still frame on the selected position.
Don't use this method for streaming a video, because it will be slow
Implements AVClip.
|
overridevirtual |
Reimplemented from AVClip.
|
overridevirtual |
Returns true, if this clip will produce visual frames.
Implements AVClip.
Referenced by MovieClip::setReader().
|
overridevirtual |
Returns true, if this clip will produce audio.
Implements AVClip.
|
overridevirtual |
Returns the duration of a frame in seconds.
This is the inverse of frame rate.
Reimplemented from AVClip.
|
overridevirtual |
This returns a copy of the clip.
Note that this will not work properly if the clip is not properly registered in the engine, because the copy will automatically be registered with the engine as well.
Implements AVClip.
References MovieClip::getMediaFile(), and AVClip::getVideoEngine().
|
overridevirtual |
This is the samplerate supplied from prepareToPlay and the sample rate this clip will produce audio and use as clock source.
Implements AVClip.
|
overridevirtual |
When rendering non realtime (bounce), use this to wait for background threads to read ahead.
Reimplemented from AVClip.
References AudioFifo::getAvailableSamples().
|
overridevirtual |
When rendering non realtime (bounce), use this to wait for background threads to read ahead.
Reimplemented from AVClip.
References VideoFifo::isFrameAvailable().