OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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.interfaces; | 5 module media.interfaces; |
6 | 6 |
7 import "media/mojo/interfaces/demuxer_stream.mojom"; | 7 import "media/mojo/interfaces/demuxer_stream.mojom"; |
8 import "media/mojo/interfaces/media_types.mojom"; | 8 import "media/mojo/interfaces/media_types.mojom"; |
9 import "ui/mojo/geometry/geometry.mojom"; | |
9 | 10 |
10 interface Renderer { | 11 interface Renderer { |
11 // Initializes the Renderer with one or both of an audio and video stream, | 12 // Initializes the Renderer with one or both of an audio and video stream, |
12 // executing the callback with whether the initialization succeeded. | 13 // executing the callback with whether the initialization succeeded. |
13 Initialize(RendererClient client, | 14 Initialize(RendererClient client, |
14 DemuxerStream? audio, | 15 DemuxerStream? audio, |
15 DemuxerStream? video) => (bool success); | 16 DemuxerStream? video) => (bool success); |
16 | 17 |
17 // Discards any buffered data, executing callback when completed. | 18 // Discards any buffered data, executing callback when completed. |
18 // NOTE: If an error occurs, RendererClient::OnError() can be called | 19 // NOTE: If an error occurs, RendererClient::OnError() can be called |
(...skipping 17 matching lines...) Expand all Loading... | |
36 interface RendererClient { | 37 interface RendererClient { |
37 // Called to report media time advancement by |time_usec|. | 38 // Called to report media time advancement by |time_usec|. |
38 // |time_usec| and |max_time_usec| can be used to interpolate time between | 39 // |time_usec| and |max_time_usec| can be used to interpolate time between |
39 // calls to OnTimeUpdate(). | 40 // calls to OnTimeUpdate(). |
40 // |max_time_usec| is typically the media timestamp of the last audio frame | 41 // |max_time_usec| is typically the media timestamp of the last audio frame |
41 // buffered by the audio hardware. | 42 // buffered by the audio hardware. |
42 // |max_time_usec| must be greater or equal to |time_usec|. | 43 // |max_time_usec| must be greater or equal to |time_usec|. |
43 OnTimeUpdate(int64 time_usec, int64 max_time_usec); | 44 OnTimeUpdate(int64 time_usec, int64 max_time_usec); |
44 | 45 |
45 // Called to report buffering state changes, see media_types.mojom. | 46 // Called to report buffering state changes, see media_types.mojom. |
46 OnBufferingStateChange(BufferingState state); | 47 OnBufferingStateChange(BufferingState state); |
xhwang
2016/04/12 19:40:37
(not for this CL) This should be OnBufferingStateC
alokp
2016/04/19 00:16:07
added TODO
| |
47 | 48 |
49 // Called to report video natural size change. | |
50 OnNaturalSizeChanged(mojo.Size size); | |
51 | |
48 // Executed when rendering has reached the end of stream. | 52 // Executed when rendering has reached the end of stream. |
49 OnEnded(); | 53 OnEnded(); |
50 | 54 |
51 // Executed if any error was encountered during decode or rendering. If | 55 // Executed if any error was encountered during decode or rendering. If |
52 // this error happens during an operation that has a completion callback, | 56 // this error happens during an operation that has a completion callback, |
53 // OnError() will be called before firing the completion callback. | 57 // OnError() will be called before firing the completion callback. |
54 OnError(); | 58 OnError(); |
55 }; | 59 }; |
OLD | NEW |