VideoPlayer subclass pre-registered with every video/audio codec this library ships a portable decoder for - H264/MJPEG/MPEG-1 video, MP3/AAC/MP2 audio - so it's the "just point it at a file, any common
codec just works" player. Use instead of the base VideoPlayer unless you want to keep these dependencies out of your build (the base class's own multi-decoders start empty - see its class comment).
More...
#include <VideoPlayerFull.h>
VideoPlayer subclass pre-registered with every video/audio codec this library ships a portable decoder for - H264/MJPEG/MPEG-1 video, MP3/AAC/MP2 audio - so it's the "just point it at a file, any common
codec just works" player. Use instead of the base VideoPlayer unless you want to keep these dependencies out of your build (the base class's own multi-decoders start empty - see its class comment).
Pre-registers no container demuxer though - still supply one via the constructor/addDemuxer(), as the base VideoPlayer requires. Pass a MultiVideoDemuxerFull (Video/MultiVideoDemuxerFull.h) for the same "any format just works" convenience one layer down (AVI/MP4/MPG):
WAV is deliberately not included (no external dependency to justify bundling it) - register it yourself if needed: addAudioDecoder(wavDecoder, "audio/vnd.wave").
Dependencies (install via Library Manager):
- Author
- Phil Schatzmann
- Copyright
- GPLv3
◆ VideoPlayerFull() [1/5]
◆ VideoPlayerFull() [2/5]
demuxer is registered the same way VideoPlayer's own matching constructor does (see its class comment) - pass a MultiVideoDemuxerFull here instead of a single concrete demuxer if you want every container format supported too (see this class's own comment).
◆ VideoPlayerFull() [3/5]
◆ VideoPlayerFull() [4/5]
◆ VideoPlayerFull() [5/5]
◆ addAudioDecoder()
| void addAudioDecoder |
( |
AudioDecoder & |
decoder, |
|
|
const char * |
mime = nullptr |
|
) |
| |
|
inlineinherited |
Registers an audio codec with the built-in (initially empty) MultiDecoder - see MultiDecoder::addDecoder() (the mime-only overload). Nothing is registered by default (see the class comment), so this needs at least one call per codec your content's audio track actually uses. Call before begin().
◆ addDemuxer()
| void addDemuxer |
( |
Demuxer & |
demuxer | ) |
|
|
inlineinherited |
◆ addVideoDecoder()
◆ audioDecoder()
The built-in audio multi-decoder (empty until addAudioDecoder() is called - see the class comment) - also useful for diagnostics (e.g. selectedMime()).
◆ begin()
Wires the full pipeline (video decoder -> output via PacedVideoOutput; audio decoder -> [audio clock ->] output, if an audio output was given) and starts the demuxer. source (e.g. an open File) is read from on every subsequent copy() call - the caller owns it and is responsible for closing it once copy()/copyAll() signal end of stream (return 0).
◆ copy()
Reads and demuxes one chunk (setBufferSize(), default 1024 bytes) from the source given to begin() - call this every loop() iteration. Also keeps the video schedule's fps in sync with the demuxer's own parsed rate, since VideoInfo::fps only becomes known partway through (once the container's header has been parsed) - no separate polling needed in the caller's loop(), unlike the *.ino examples this class replaces.
- Returns
- bytes actually copied - 0 once the source is exhausted (or playback is inactive/not begin()'d), matching CodecCopy::copy()'s own "0 means stop" convention every current *.ino example already checks for.
◆ copyAll()
Copies until the source is exhausted (blocking).
◆ demuxer()
The built-in demuxer multi-selector (empty until addDemuxer() is called - see the class comment) - also useful for diagnostics (e.g. selectedDemuxer()/mimeVideo()).
◆ end()
Stops playback and releases the video/audio decoders + the sync task's background render thread. The Stream given to begin() is left for the caller to close.
◆ getStream()
◆ isActive()
True between a successful begin() and end()/setActive(false)/source exhaustion.
◆ operator bool()
◆ registerAudioDecoders()
| void registerAudioDecoders |
( |
| ) |
|
|
inlineprotected |
◆ registerVideoDecoders()
| void registerVideoDecoders |
( |
| ) |
|
|
inlineprotected |
◆ setActive()
| void setActive |
( |
bool |
isActive | ) |
|
|
inlineinherited |
Halts copy()/copyAll() without tearing down the pipeline (unlike end()) - resume with setActive(true).
◆ setAudioOutput() [1/3]
◆ setAudioOutput() [2/3]
◆ setAudioOutput() [3/3]
| void setAudioOutput |
( |
Print & |
out | ) |
|
|
inlineinherited |
Defines the final audio output target and enables the audio path - leave unset entirely for video-only content. Must already be configured/begin()'d. Call before begin(). See the class comment's "Audio clock" section for setUseAudioClock()'s default.
Three overloads, mirroring AudioPlayer::setOutput() - AudioOutput and AudioStream are unrelated types (both derive from Print, neither from the other - see AudioOutput.h's own class comment), so the most specific one actually available should be used: it lets begin() wire the audio clock/EncodedAudioStream via the matching setOutput(
AudioOutput&)/setStream(AudioStream&) overload instead of falling back to the generic Print& one, which is what makes e.g. audio-info change notifications reach the real output.
◆ setBufferSize()
| void setBufferSize |
( |
int |
size | ) |
|
|
inlineinherited |
Sets the read-buffer size (bytes) copy() uses per call (default 1024, same as CodecCopy's own default). Call before begin().
◆ setUseAudioClock()
| void setUseAudioClock |
( |
bool |
active | ) |
|
|
inlineinherited |
See the class comment's "Audio clock" section. Off by default; setAudioOutput() does not change it - opt in explicitly once you know the content has a real audio track. Call before begin().
◆ setVideoOutput()
◆ useAudioClock()
| bool useAudioClock |
( |
| ) |
const |
|
inlineinherited |
◆ videoDecoder()
The built-in video multi-decoder (empty until addVideoDecoder() is called - see the class comment) - also useful for diagnostics (e.g. selectedFormat()).
◆ videoSyncTask()
Escape hatch for tuning beyond this class's own surface - e.g. setTaskParameters()/setQueueBytes()/setMaxQueuedIFrames()/ setIgnorePFrames()/setSchedulingDelayMs(), or the frameCount()/ avgFrameMs()/outputFPS() family of diagnostics.
◆ aac_decoder
◆ active
◆ audio_clock
◆ audio_out
◆ buffer_size
◆ default_audio_decoder
◆ default_demuxer
◆ default_video_decoder
◆ h264_decoder
◆ mjpeg_decoder
◆ mp2_decoder
◆ mp3_decoder
◆ mpeg_decoder
◆ p_audio_output
| Print* p_audio_output = nullptr |
|
protectedinherited |
◆ p_audio_output_typed
◆ p_audio_stream
◆ p_source
◆ p_video_output
◆ use_audio_clock
| bool use_audio_clock = false |
|
protectedinherited |
◆ video_sync
The documentation for this class was generated from the following file: