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 // DemuxerStream is modeled after media::DemuxerStream using mojo in order to |
| 10 // enable proxying between a media::Pipeline and media::Renderer living in two |
| 11 // different applications. |
| 12 [Client=DemuxerStreamClient] |
| 13 interface DemuxerStream { |
| 14 // See media::DemuxerStream for descriptions. |
| 15 enum Type { |
| 16 UNKNOWN, |
| 17 AUDIO, |
| 18 LAST_TYPE = AUDIO |
| 19 }; |
| 20 |
| 21 // See media::DemuxerStream for descriptions. |
| 22 enum Status { |
| 23 OK = 0, |
| 24 ABORTED, |
| 25 CONFIG_CHANGED, |
| 26 }; |
| 27 |
| 28 // Request a MediaDecoderBuffer from this stream for decoding and rendering. |
| 29 // When available, the callback will be invoked with a Status and |response| |
| 30 // buffer. See media::DemuxerStream::ReadCB for explanation of fields. |
| 31 // |
| 32 // TODO(tim): Remove this method in favor of initializing the |
| 33 // DemuxerStreamClient with a DataPipeConsumerHandle once we have a framed |
| 34 // DataPipe that we can serialize [|status| | response|]* over directly. |
| 35 Read() => (Status status, MediaDecoderBuffer response); |
| 36 }; |
| 37 |
| 38 interface DemuxerStreamClient { |
| 39 // Informs the client that the stream is ready for reading. If |pipe| is |
| 40 // present, it means the client should read |
| 41 // |
| 42 // [ |DemuxerStream::Status| |MediaDecoderBuffer| ] |
| 43 // |
| 44 // payloads from the DataPipe directly. If |pipe| is NULL, it means the |
| 45 // client needs to use DemuxerStream::Read() directly to obtain buffers. |
| 46 OnStreamReady(handle<data_pipe_consumer>? pipe); |
| 47 |
| 48 // A new AudioDecoderConfig is available. Will be sent by the DemuxerStream |
| 49 // whenever a DemuxerStream::STATUS_CONFIG_CHANGED is observed (either |
| 50 // in a Read() callback or over the DataPipe). |
| 51 OnAudioDecoderConfigChanged(AudioDecoderConfig config); |
| 52 }; |
| 53 |
| 54 } // module mojo |
OLD | NEW |