Skip to content

Truly independent web browser

LibMediaCodecs: Allow output callbacks to run under a decoder's locks

Zaggy102488f9596506d7
diff --git a/Libraries/LibMediaCodecs/VideoDecoder.h b/Libraries/LibMediaCodecs/VideoDecoder.h
index bd3098c4e5d..6d9b824572a 100644
--- a/Libraries/LibMediaCodecs/VideoDecoder.h
+++ b/Libraries/LibMediaCodecs/VideoDecoder.h
@@ -25,11 +25,12 @@ public:
virtual ~VideoDecoder() { }
// Both callbacks are installed before any coded data is received, and run on whichever thread frees the storage
- // or finishes the output, without the decoder's locks held.
+ // or finishes the output.
+ // Called without the decoder's locks held.
virtual void set_storage_freed_callback(Function<void()>) = 0;
// Called when output becomes available while no take_next_output() call is waiting for it, so that a caller
// blocked elsewhere knows to come back. Decoders whose output is complete by the time receive_coded_data()
- // returns never call it.
+ // returns never call it. It may be called with the decoder's locks held, so it must not call into the decoder.
virtual void set_output_arrived_callback(Function<void()>) = 0;
virtual DecoderErrorOr<void> receive_coded_data(CodedFrame const&, DecodeIntent) = 0;