blob: 6ddb20e5bc463c9c079d2b579b41e5776b984fa9 [file] [log] [blame]
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module media.mojom;
import "mojo/public/mojom/base/unguessable_token.mojom";
// For Windows MediaFoundation playback, we need to send a DirectComposition
// (DCOMP) surface handle from the MediaFoundationService (utility) process to
// the GPU process which can be later retrievd and set in GLImageDCOMPSurface.
// This interface is used to send the handle to DCOMPSurfaceRegistryBroker in
// the browser process, which then uses GpuService to send it the GPU process.
// The client is MediaFoundationRendererWrapper in the utility process, and the
// implementation is the DCOMPSurfaceRegistryBroker in the browser process.
interface DCOMPSurfaceRegistry {
// Registers a DCOMP surface handle and returns a token. The token will then
// be used by MediaFoundationRendererClient to call DCOMPTexture to set the
// surface in GLImageDCOMPSurface. Null token will be returned upon failure.
RegisterDCOMPSurfaceHandle(handle<platform> surface_handle)
=> (mojo_base.mojom.UnguessableToken? token);
// Unregisters the DCOMP surface handle associated with `token`. This is to
// avoid handle leak in case the handle is not taken during a playback, e.g.
// user closes tab immediately after playback start. No-op if the handle has
// already been taken.
UnregisterDCOMPSurfaceHandle(mojo_base.mojom.UnguessableToken token);
};