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
50
51
52
53
media / mojo / mojom / fuchsia_media.mojom [blame]
// Copyright 2020 The Chromium Authors
// 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 "media/mojo/mojom/video_decoder.mojom";
// Mojo struct for
// `fidl::InterfaceRequest<fuchsia::media::drm::ContentDecryptionModule>`.
struct CdmRequest {
handle<platform> request;
};
// Mojo struct for `fidl::InterfaceRequest<fuchsia::media::StreamProcessor>`.
struct StreamProcessorRequest {
handle<platform> request;
};
enum VideoDecoderSecureMemoryMode {
// Input and output buffers are not protected.
CLEAR,
// Input and output buffers must be allocated in protected memory.
SECURE,
// Input buffers are not protected. Output buffers are protected.
SECURE_OUTPUT,
};
// Interface used by the renderer to connect to CDM and mediacodec resources.
// Instances are document-scoped.
interface FuchsiaMediaCdmProvider {
// Create connection to fuchsia::media::drm::ContentDecryptionModule for
// `key_system`. Implementation should make sure the persistent storage is
// isolated per web origin.
CreateCdm(string key_system, CdmRequest cdm_request);
};
// Interface implemented in the browser process and bound once per set of
// GpuVideoAcceleratorFactories in the renderer to get hardware codec resources.
interface FuchsiaMediaCodecProvider {
// Create connection to fuchsia::media::StreamProcessor for the specified
// `codec`.
CreateVideoDecoder(VideoCodec codec, VideoDecoderSecureMemoryMode secure_mode,
StreamProcessorRequest stream_processor_request);
// Returns video decoder configs that are supported by the driver-based local
// codec factory.
GetSupportedVideoDecoderConfigs() =>
(array<SupportedVideoDecoderConfig> supported_configs);
};