| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 module media.mojom; | 5 module media.mojom; |
| 6 | 6 |
| 7 import "gpu/ipc/common/sync_token.mojom"; | 7 import "gpu/ipc/common/sync_token.mojom"; |
| 8 import "media/mojo/interfaces/media_log.mojom"; |
| 8 import "media/mojo/interfaces/media_types.mojom"; | 9 import "media/mojo/interfaces/media_types.mojom"; |
| 9 import "mojo/common/unguessable_token.mojom"; | 10 import "mojo/common/unguessable_token.mojom"; |
| 10 | 11 |
| 11 // Identifies a GpuCommandBufferStub. MediaGpuChannelManager is responsible | 12 // Identifies a GpuCommandBufferStub. MediaGpuChannelManager is responsible |
| 12 // for minting |channel_token| objects. | 13 // for minting |channel_token| objects. |
| 13 struct CommandBufferId { | 14 struct CommandBufferId { |
| 14 mojo.common.mojom.UnguessableToken channel_token; | 15 mojo.common.mojom.UnguessableToken channel_token; |
| 15 int32 route_id; | 16 int32 route_id; |
| 16 }; | 17 }; |
| 17 | 18 |
| 18 interface VideoDecoder { | 19 interface VideoDecoder { |
| 19 // Initialize the decoder. This must be called before any other method. | 20 // Initialize the decoder. This must be called before any other method. |
| 20 // | 21 // |
| 21 // |command_buffer_id|, when present, identifies a GpuCommandBufferStub that | 22 // |command_buffer_id|, when present, identifies a GpuCommandBufferStub that |
| 22 // the decoder can use for GL operations. Implementations that require GL will | 23 // the decoder can use for GL operations. Implementations that require GL will |
| 23 // fail Initialize() if |command_buffer_id| is not provided. | 24 // fail Initialize() if |command_buffer_id| is not provided. |
| 24 // | 25 // |
| 25 // |decoder_buffer_pipe| will be used to transfer encoded data for each | 26 // |decoder_buffer_pipe| will be used to transfer encoded data for each |
| 26 // DecoderBuffer. | 27 // DecoderBuffer. |
| 27 // | 28 // |
| 28 // TODO(sandersd): Rename to Initialize() if/when | 29 // TODO(sandersd): Rename to Initialize() if/when |
| 29 // media::VideoDecoder::Initialize() is renamed to Configure(). | 30 // media::VideoDecoder::Initialize() is renamed to Configure(). |
| 30 Construct(associated VideoDecoderClient client, | 31 Construct(associated VideoDecoderClient client, |
| 32 associated MediaLog media_log, |
| 31 handle<data_pipe_consumer> decoder_buffer_pipe, | 33 handle<data_pipe_consumer> decoder_buffer_pipe, |
| 32 CommandBufferId? command_buffer_id); | 34 CommandBufferId? command_buffer_id); |
| 33 | 35 |
| 34 // Configure (or reconfigure) the decoder. This must be called before decoding | 36 // Configure (or reconfigure) the decoder. This must be called before decoding |
| 35 // any frames, and must not be called while there are pending Initialize(), | 37 // any frames, and must not be called while there are pending Initialize(), |
| 36 // Decode(), or Reset() requests. | 38 // Decode(), or Reset() requests. |
| 37 // | 39 // |
| 38 // If |low_delay| is true, the decoder must output frames as soon as possible; | 40 // If |low_delay| is true, the decoder must output frames as soon as possible; |
| 39 // in particular, it must not wait for another Decode() request, except as | 41 // in particular, it must not wait for another Decode() request, except as |
| 40 // required for frame reordering. Implementations must fail initialization if | 42 // required for frame reordering. Implementations must fail initialization if |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 // necessary if the decoder cannot guarantee that it can output another frame, | 83 // necessary if the decoder cannot guarantee that it can output another frame, |
| 82 // for example if output buffers are limited or configuration changes require | 84 // for example if output buffers are limited or configuration changes require |
| 83 // the return of all outstanding frames. | 85 // the return of all outstanding frames. |
| 84 // | 86 // |
| 85 // If |release_token| is provided, the client shall call OnReleaseMailbox() | 87 // If |release_token| is provided, the client shall call OnReleaseMailbox() |
| 86 // when it is finished using the frame. | 88 // when it is finished using the frame. |
| 87 OnVideoFrameDecoded(VideoFrame frame, | 89 OnVideoFrameDecoded(VideoFrame frame, |
| 88 bool can_read_without_stalling, | 90 bool can_read_without_stalling, |
| 89 mojo.common.mojom.UnguessableToken? release_token); | 91 mojo.common.mojom.UnguessableToken? release_token); |
| 90 }; | 92 }; |
| OLD | NEW |