Real-time asynchronous file preview, not a professional media player. More...
#include <StormByte/multimedia/simple_player.hxx>
Public Member Functions | |
| SimplePlayer (Safe::Shared< Display > display, Safe::Shared< Logger::Log > logger={}) | |
| Construct a preview engine with an application sink. | |
| SimplePlayer (Safe::Shared< Display > display, Safe::Shared< Logger::Log > logger, PreviewBuffering buffering) | |
| Construct with an immutable, per-instance buffering policy. | |
| SimplePlayer (const SimplePlayer &)=delete | |
| SimplePlayer (SimplePlayer &&)=delete | |
| ~SimplePlayer () noexcept | |
| Stop/join workers, close input, release owners without rewinding. | |
| SimplePlayer & | operator= (const SimplePlayer &)=delete |
| SimplePlayer & | operator= (SimplePlayer &&)=delete |
| bool | Open (std::string_view file) |
| Open a locally owned BufferedFileReader; replace any old input. | |
| bool | Open (Safe::Unique< Buffer::IO::BufferedLocationReader > reader) |
| Exclusively take an input; open only if not already open. | |
| void | Acceleration (DecodeAcceleration acceleration) noexcept |
| Selects hardware-assisted video decoding or forces software decoding. | |
| bool | OutputColor (PreviewColorMode mode) |
| Selects SDR tone-mapped or explicit HDR preview output. | |
| bool | Play () |
| Start/resume asynchronous real-time presentation. | |
| bool | Pause () |
| Freeze workers and presentation, retaining queued decode. | |
| bool | Stop () |
| Join workers and rewind the actual reader, keeping it open. | |
| bool | Seek (double seconds) |
| Seek and flush decoders, devices, cues and stale GUI deliveries. | |
| bool | SelectTrack (enum Type type, int index) |
| Switch or disable a media kind at the current position. | |
| int | SelectedTrack (enum Type type) const |
| Read selected stream index. | |
| Safe::Vector< PreviewTrack > | Tracks () const |
| Snapshot selectable stream information. | |
| PlaybackState | State () const |
| Snapshot lifecycle state. | |
| double | Position () const |
| Snapshot audible/video timeline position. | |
| double | Duration () const |
| Read container duration, if known. | |
| Safe::String | Error () const |
| Snapshot the last explicit failure. | |
| PreviewDiagnostics | Diagnostics () const |
| Snapshot actual decoder output and cumulative preview measurements. | |
| bool | Close () |
| Join workers and close/release input, without rewind. | |
| Safe::Unique< Buffer::IO::BufferedLocationReader > | ReleaseReader () |
| Join workers, rewind and transfer the still-open dynamic reader. | |
Real-time asynchronous file preview, not a professional media player.
Control operations are serialized internally. Display callbacks must not reenter player methods. Bool failures and worker failures set Error(); inspect State() while playing. Owns exactly one buffered reader, retaining its dynamic type. Display is mandatory; no native presentation backend is bundled. All provider libraries must outlive Safe owners.
|
explicit |
Construct a preview engine with an application sink.
| display | Nonempty combined presentation sink. |
| logger | Optional shared logger. |
| StormByte::Exception | If display is empty. |
| StormByte::Multimedia::SimplePlayer::SimplePlayer | ( | Safe::Shared< Display > | display, |
| Safe::Shared< Logger::Log > | logger, | ||
| PreviewBuffering | buffering ) |
Construct with an immutable, per-instance buffering policy.
| display | Nonempty combined presentation sink. |
| logger | Optional shared logger. |
| buffering | Positive caps and read horizon; nonnegative preload/audio advance no greater than ReadAhead. Zero preload disables initial buffering. |
| StormByte::Exception | If the sink or policy is invalid. |
|
delete |
|
delete |
|
noexcept |
Stop/join workers, close input, release owners without rewinding.
|
noexcept |
| bool StormByte::Multimedia::SimplePlayer::Close | ( | ) |
Join workers and close/release input, without rewind.
| PreviewDiagnostics StormByte::Multimedia::SimplePlayer::Diagnostics | ( | ) | const |
Snapshot actual decoder output and cumulative preview measurements.
| double StormByte::Multimedia::SimplePlayer::Duration | ( | ) | const |
Read container duration, if known.
| Safe::String StormByte::Multimedia::SimplePlayer::Error | ( | ) | const |
Snapshot the last explicit failure.
| bool StormByte::Multimedia::SimplePlayer::Open | ( | Safe::Unique< Buffer::IO::BufferedLocationReader > | reader | ) |
Exclusively take an input; open only if not already open.
| reader | Dynamic reader owner. Retained even if opening fails. |
| bool StormByte::Multimedia::SimplePlayer::Open | ( | std::string_view | file | ) |
Open a locally owned BufferedFileReader; replace any old input.
| file | Borrowed path, copied only into the reader's Safe::String. |
|
delete |
|
delete |
| bool StormByte::Multimedia::SimplePlayer::OutputColor | ( | PreviewColorMode | mode | ) |
Selects SDR tone-mapped or explicit HDR preview output.
| mode | SDR preserves the RGBA8 Display path; HDR sends PQ/HLG frames to an optional HDRDisplay implementation. |
| bool StormByte::Multimedia::SimplePlayer::Pause | ( | ) |
Freeze workers and presentation, retaining queued decode.
| bool StormByte::Multimedia::SimplePlayer::Play | ( | ) |
Start/resume asynchronous real-time presentation.
| double StormByte::Multimedia::SimplePlayer::Position | ( | ) | const |
Snapshot audible/video timeline position.
| Safe::Unique< Buffer::IO::BufferedLocationReader > StormByte::Multimedia::SimplePlayer::ReleaseReader | ( | ) |
Join workers, rewind and transfer the still-open dynamic reader.
Never closes or reopens a faulted reader as a fallback. Stop/transfer reject faulted sessions before Rewind to preserve remote mount tokens.
| bool StormByte::Multimedia::SimplePlayer::Seek | ( | double | seconds | ) |
Seek and flush decoders, devices, cues and stale GUI deliveries.
| seconds | Nonnegative media seconds. Paused seek displays a new image. |
| int StormByte::Multimedia::SimplePlayer::SelectedTrack | ( | enum Type | type | ) | const |
| bool StormByte::Multimedia::SimplePlayer::SelectTrack | ( | enum Type | type, |
| int | index ) |
Switch or disable a media kind at the current position.
| type | Video, audio or subtitle. |
| index | Stream index, or -1 to disable. |
Selecting the active index is a no-op. During playback, an audio-only invalidation-capable Display preserves video decoding and presentation; other changes and end-of-input reconstruct at the current position.
| PlaybackState StormByte::Multimedia::SimplePlayer::State | ( | ) | const |
Snapshot lifecycle state.
| bool StormByte::Multimedia::SimplePlayer::Stop | ( | ) |
Join workers and rewind the actual reader, keeping it open.
| Safe::Vector< PreviewTrack > StormByte::Multimedia::SimplePlayer::Tracks | ( | ) | const |
Snapshot selectable stream information.