A decoded video and its audio, with bounded frame buffering.
More...
#include <videoplayer.h>
|
| | ~VideoPlayer () |
| | Release decoder, texture, and audio resources.
|
| | VideoPlayer (const VideoPlayer &)=delete |
| | Prevent copying decoder resources.
|
| VideoPlayer & | operator= (const VideoPlayer &)=delete |
| | Prevent assigning decoder resources.
|
| bool | Update (double seconds, float volume) |
| | Decode through elapsed movie time and update audio gain.
|
| std::optional< double > | Seek (double seconds) |
| | Seek to a movie position and discard buffered video and audio.
|
| void | SetPaused (bool paused) |
| | Pause or resume audio and change the current frame to dim greyscale while paused.
|
| double | Duration () const |
| const RenderTexture * | Texture () const |
A decoded video and its audio, with bounded frame buffering.
◆ ~VideoPlayer()
| coastline::VideoPlayer::~VideoPlayer |
( |
| ) |
|
Release decoder, texture, and audio resources.
◆ VideoPlayer()
| coastline::VideoPlayer::VideoPlayer |
( |
const VideoPlayer & | | ) |
|
|
delete |
Prevent copying decoder resources.
◆ Open()
Open a local movie without starting its clock.
- Parameters
-
| renderer | The renderer used for video textures. |
| path | The movie file. |
- Returns
- The player, or null if decoding is unavailable or opening fails.
◆ operator=()
Prevent assigning decoder resources.
◆ Update()
| bool coastline::VideoPlayer::Update |
( |
double | seconds, |
|
|
float | volume ) |
Decode through elapsed movie time and update audio gain.
- Parameters
-
| seconds | Nonnegative elapsed seconds since opening. |
| volume | Audio gain from zero through one. |
- Returns
- Whether playback should continue; false on completion or a decoding error.
◆ Seek()
| std::optional< double > coastline::VideoPlayer::Seek |
( |
double | seconds | ) |
|
Seek to a movie position and discard buffered video and audio.
- Parameters
-
| seconds | Requested movie time, clamped to [0, 86400]. A known duration caps the result at max(0, duration - 0.05) seconds. |
- Returns
- The selected time in seconds, or an empty optional on failure or non-finite input.
◆ SetPaused()
| void coastline::VideoPlayer::SetPaused |
( |
bool | paused | ) |
|
Pause or resume audio and change the current frame to dim greyscale while paused.
- Parameters
-
| paused | Whether playback is paused. The caller must also stop its playback clock. |
◆ Duration()
| double coastline::VideoPlayer::Duration |
( |
| ) |
const |
- Returns
- Movie duration in seconds, or zero when unavailable.
◆ Texture()
- Returns
- The borrowed video texture, initially blank and valid until player destruction.
The documentation for this class was generated from the following file: