blob: bd245a4113092dc67d25aaaa2294dd24c3d5c4e3 [file]
// Copyright 2019 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 "media/mojo/mojom/media_types.mojom";
import "mojo/public/mojom/base/time.mojom";
import "mojo/public/mojom/base/unguessable_token.mojom";
import "ui/gfx/geometry/mojom/geometry.mojom";
// Extension of the mojo::RendererClient communication layer for HLS and Android
// software rendering fallback paths.
// This allows the Browser side to call
// back into the Renderer side. Concretely, the MediaPlayerRenderer uses these
// methods to propagate events it raises to the MediaPlayerRendererClient, which
// lives in the Renderer process.
interface MediaPlayerRendererClientExtension {
// Called when the first time the metadata is updated, and whenever the
// metadata changes.
OnVideoSizeChange(gfx.mojom.Size size);
OnDurationChange(mojo_base.mojom.TimeDelta duration);
};
// Extension of the mojo::RendererClient communication layer for HLS and Android
// software rendering fallback paths.
// This allows the Renderer side to call into the Browser side.
// Concretely, the MediaPlayerRendererClient uses these methods to send commands
// to MediaPlayerRenderer, which lives in the Browser process.
interface MediaPlayerRendererExtension {
// Registers a new request in the ScopedSurfaceRequestManager, and returns
// its token.
// Called once, during media::Renderer initialization, as part of
// StreamTexture's set-up.
InitiateScopedSurfaceRequest()
=> (mojo_base.mojom.UnguessableToken request_token);
};
// Extension of the mojo::RendererClient communication layer for media flinging,
// a.k.a RemotePlayback, when playing media on a remote Cast device.
// This allows the Browser side to call back into the Renderer side.
// Concretely, the FlingingRenderer uses these methods to propagate events it
// raises to the FlingingRendererClient, which lives in the Renderer process.
interface FlingingRendererClientExtension {
// Called when the play state of a casted device goes out of sync with WMPI's
// play state (e.g. when another phone play/pauses a cast device on the same
// network).
OnRemotePlayStateChange(MediaStatusState state);
};
[EnableIf=is_win]
// Extension of the mojo::RendererClient communication layer for MF-based CDM
// Renderer.
// This allows the media::Renderer from Renderer process calling into the
// MediaFoundationRenderer in the "mf_cdm" sandbox'ed Utility process.
// Concretely, the MediaFoundationRendererClient uses these methods to send
// commands to MediaFoundationRenderer, which lives in the mf_cdm LPAC-based
// Utility process.
// Please refer to media/renderers/win/media_foundation_renderer_extension.h
// for its C++ interface equivalence.
interface MediaFoundationRendererExtension {
// Enable Direct Composition video rendering.
[Sync]
SetDCOMPMode(bool enabled) => (bool succeeded);
// Get a Direct Composition Surface handle.
GetDCOMPSurface() => (handle? dcomp_surface);
// Notify renderer whether video is enabled.
SetVideoStreamEnabled(bool enabled);
// Notify renderer of output composition parameters
SetOutputParams(gfx.mojom.Rect rect);
};