-// Copyright 2016 The Chromium Authors. All rights reserved.
+// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
interface VideoFrameHandleReleaser {
// Signals that the VideoFrame identified by |release_token| should be
// released. |release_sync_token| indicates the last use of the VideoFrame
- // (in a GPU command buffer) by the client.
- //
- // TODO(sandersd): Do we need release notification for non-texture
- // VideoFrames? If so, |release_sync_token| should be optional.
+ // (in a GPU command buffer) by the client. If the VideoDecoder outputs frames
+ // that have a callback for releasing mailboxes (i.e.,
+ // VideoFrame::HasReleaseMailboxCB() returns true), the |release_sync_token|
+ // is required but may be empty, and in that case, implementations should let
+ // the about-to-be-released VideoFrame retain whatever SyncToken it has. For
+ // other frames, it's assumed that the frame can be released immediately upon
+ // calling ReleaseVideoFrame() and |release_sync_token| does not need to be
+ // supplied (and should be ignored by implementations if supplied).
ReleaseVideoFrame(mojo_base.mojom.UnguessableToken release_token,
- gpu.mojom.SyncToken release_sync_token);
+ gpu.mojom.SyncToken? release_sync_token);
};
// A Mojo equivalent of media::VideoDecoder. In practice, this is used for
// that does not match an entry in this list.
//
// May be called before Construct().
+ [Sync]
GetSupportedConfigs() =>
(array<SupportedVideoDecoderConfig> supported_configs,
VideoDecoderType decoder_type);
// media::VideoDecoder::Initialize() is renamed to Configure().
Construct(
pending_associated_remote<VideoDecoderClient> client,
- pending_associated_remote<MediaLog> media_log,
+ pending_remote<MediaLog> media_log,
pending_receiver<VideoFrameHandleReleaser> video_frame_handle_releaser,
handle<data_pipe_consumer> decoder_buffer_pipe,
CommandBufferId? command_buffer_id,
// used for unencrypted streams.
Initialize(VideoDecoderConfig config, bool low_delay,
mojo_base.mojom.UnguessableToken? cdm_id)
- => (Status status,
+ => (DecoderStatus status,
bool needs_bitstream_conversion,
int32 max_decode_requests,
VideoDecoderType decoder_type);
// If |buffer| is an EOS buffer, implementations must execute all other
// pending Decode() callbacks and output all pending frames before executing
// the Decode(EOS) callback. (That is, they must flush.)
- Decode(DecoderBuffer buffer) => (Status status);
+ Decode(DecoderBuffer buffer) => (DecoderStatus status);
// Reset the decoder. All ongoing Decode() requests must be completed or
// aborted before executing the callback. This must not be called while there