OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 import "media/mojo/interfaces/media_types.mojom" |
| 6 |
| 7 module mojo { |
| 8 |
| 9 [Client=MediaRendererClient] |
| 10 interface MediaRenderer { |
| 11 // Initializes the Renderer, calling back with status upon completion. |
| 12 Initialize() => (bool succeeded); |
| 13 |
| 14 // Decode and render |buffer|, calling back when more data is required. |
| 15 // TODO(tim): Switch decoding model to use framed data pipe when available. |
| 16 // In that world, the signalling for more would be implicit by a writable |
| 17 // pipe handle on the client side so this entire method + callback goes away. |
| 18 DecodeAndRender(MediaDecoderBuffer buffer) => (); |
| 19 |
| 20 // Discards any buffered data, executing callback when completed. |
| 21 Flush() => (); |
| 22 |
| 23 // Starts rendering from |time|. |
| 24 StartPlayingFrom(int64 time_delta_usec); |
| 25 |
| 26 // Updates the current playback rate. The default playback rate should be 1. |
| 27 SetPlaybackRate(float playback_rate); |
| 28 |
| 29 // Sets the output volume. The default volume should be 1. |
| 30 SetVolume(float volume); |
| 31 }; |
| 32 |
| 33 interface MediaRendererClient { |
| 34 // Called whenever rendering has advanced time by |time_delta_usec|. |
| 35 OnTimeUpdate(int64 time_delta_usec); |
| 36 |
| 37 // Called to report buffering state changes, see media_types.mojom. |
| 38 OnBufferingStateChange(BufferingState state); |
| 39 |
| 40 // Executed when rendering has reached the end of stream. |
| 41 OnEnded(); |
| 42 |
| 43 // Executed if any error was encountered during decode or rendering. |
| 44 OnError(); |
| 45 }; |
| 46 |
| 47 } // module mojo |
OLD | NEW |