mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:07:45 +00:00
LibVideo: Add a hook to notify clients upon reaching end of the stream
This commit is contained in:
parent
fe66490399
commit
33047b38ec
2 changed files with 5 additions and 0 deletions
|
@ -129,6 +129,10 @@ void PlaybackManager::dispatch_decoder_error(DecoderError error)
|
|||
case DecoderErrorCategory::EndOfStream:
|
||||
dbgln_if(PLAYBACK_MANAGER_DEBUG, "{}", error.string_literal());
|
||||
TRY_OR_FATAL_ERROR(m_playback_handler->stop());
|
||||
|
||||
if (on_end_of_stream)
|
||||
on_end_of_stream();
|
||||
|
||||
break;
|
||||
default:
|
||||
dbgln("Playback error encountered: {}", error.string_literal());
|
||||
|
|
|
@ -123,6 +123,7 @@ public:
|
|||
|
||||
Function<void(RefPtr<Gfx::Bitmap>)> on_video_frame;
|
||||
Function<void()> on_playback_state_change;
|
||||
Function<void()> on_end_of_stream;
|
||||
Function<void(DecoderError)> on_decoder_error;
|
||||
Function<void(Error)> on_fatal_playback_error;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue