Chromium Code Reviews| 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 // Decodes and renders|buffer|, calling back when more data is required. | |
|
xhwang
2014/09/03 16:09:38
add space after "renders"
tim (not reviewing)
2014/09/03 16:39:46
Done.
| |
| 15 // NOTE: If an error occurs, MediaRendererClient::OnError will be called | |
|
xhwang
2014/09/03 16:09:38
s/OnError/OnError()/
tim (not reviewing)
2014/09/03 16:39:46
Done.
| |
| 16 // before the callback is executed. | |
| 17 // TODO(tim): Switch decoding model to use framed data pipe when available. | |
| 18 // In that world, the signalling for more would be implicit by a writable | |
| 19 // pipe handle on the client side so this entire method + callback goes away. | |
| 20 DecodeAndRender(MediaDecoderBuffer buffer) => (); | |
| 21 | |
| 22 // Discards any buffered data, executing callback when completed. | |
| 23 // NOTE: If an error occurs, MediaRendererClient::OnError can be called | |
|
xhwang
2014/09/03 16:09:38
ditto
tim (not reviewing)
2014/09/03 16:39:46
Done.
| |
| 24 // before the callback is executed. | |
| 25 Flush() => (); | |
| 26 | |
| 27 // Starts rendering from |time_usec|. | |
| 28 StartPlayingFrom(int64 time_usec); | |
| 29 | |
| 30 // Updates the current playback rate. The default playback rate should be 1. | |
| 31 SetPlaybackRate(float playback_rate); | |
| 32 | |
| 33 // Sets the output volume. The default volume should be 1. | |
| 34 SetVolume(float volume); | |
| 35 }; | |
| 36 | |
| 37 interface MediaRendererClient { | |
| 38 // Called to report media time advance of |time_usec|. | |
| 39 OnTimeUpdate(int64 time_delta_usec); | |
|
xhwang
2014/09/03 16:09:38
s/time_delta_usec/time_usec/
tim (not reviewing)
2014/09/03 16:39:46
Done.
| |
| 40 | |
| 41 // Called to report buffering state changes, see media_types.mojom. | |
| 42 OnBufferingStateChange(BufferingState state); | |
| 43 | |
| 44 // Executed when rendering has reached the end of stream. | |
| 45 OnEnded(); | |
| 46 | |
| 47 // Executed if any error was encountered during decode or rendering. If | |
| 48 // this error happens during an operation that has a completion callback, | |
| 49 // OnError() will be called before firing the completion callback. | |
| 50 OnError(); | |
| 51 }; | |
| 52 | |
| 53 } // module mojo | |
| OLD | NEW |