summaryrefslogtreecommitdiff
path: root/chromium/media/mojo/interfaces/renderer_extensions.mojom
blob: 595f0b1950e0b4a5e07eab516c9840ffa5ceba86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// 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/interfaces/media_types.mojom";
import "mojo/public/mojom/base/time.mojom";
import "mojo/public/mojom/base/unguessable_token.mojom";
import "ui/gfx/geometry/mojo/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);
};