MediaIO sink that plays frames through SDL via FrameSync. More...
#include <sdlplayer.h>


Public Types | |
| using | UPtr = UniquePtr< SDLPlayerMediaIO > |
| Unique-ownership pointer to an SDLPlayerMediaIO. | |
Public Member Functions | |
| SDLPlayerWidget * | widget () const |
| Returns the widget that owns this task. | |
| SDLAudioOutput * | audioOutput () const |
| Returns the configured audio output. | |
| bool | useAudioClock () const |
| True when the audio device drives timing. | |
| void | pause () |
| Pauses playback. | |
| void | resume () |
| Resumes playback after a pause. | |
| void | togglePause () |
| Convenience: calls pause or resume. | |
| bool | isPaused () const |
| Returns true when the playback clock is paused. | |
| Error | describe (MediaIODescription *out) const override |
| Error | proposeInput (const MediaDesc &offered, MediaDesc *preferred) const override |
| void | cancelBlockingWork () override |
Protected Member Functions | |
| Error | executeCmd (MediaIOCommandOpen &cmd) override |
| Error | executeCmd (MediaIOCommandClose &cmd) override |
| Error | executeCmd (MediaIOCommandWrite &cmd) override |
Friends | |
| class | SDLPlayerWidget |
MediaIO sink that plays frames through SDL via FrameSync.
SDLPlayerMediaIO is a write-only MediaIO sink that consumes Frame objects via MediaIO::writeFrame(). It is always owned by an SDLPlayerWidget which provides both the render target and the user-facing controls (play/pause, focus routing, etc.) — clients should construct an SDLPlayerWidget rather than instantiating the backend directly.
executeCmd(Write) decodes compressed images and hands the frame to a FrameSync instance, then returns.writeFrame() calls onto the worker — clients themselves may call from any thread. | void promeki::SDLPlayerMediaIO::pause | ( | ) |
Pauses playback.
Pauses the playback clock (which stops SDL audio consumption via SDLAudioClock::onPause) and tears down the pull thread so it isn't blocked on the clock. Safe to call from any thread; no-ops when no MediaIO is open or playback is already paused.
| void promeki::SDLPlayerMediaIO::resume | ( | ) |
Resumes playback after a pause.
Unpauses the clock and spawns a fresh pull thread. The base Clock's paused-offset accumulator rolls the deadline forward so the next output frame lands where it would have without the pause. No-op when no MediaIO is open or playback is not paused.