Chromium Code Reviews| 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 mojo; | 5 module mojo; |
| 6 | 6 |
| 7 import "media/mojo/interfaces/media_types.mojom"; | 7 import "media/mojo/interfaces/media_types.mojom"; |
| 8 | 8 |
| 9 // DemuxerStream is modeled after media::DemuxerStream using mojo in order to | 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 | 10 // enable proxying between a media::Pipeline and media::Renderer living in two |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 23 enum Status { | 23 enum Status { |
| 24 OK = 0, | 24 OK = 0, |
| 25 ABORTED, | 25 ABORTED, |
| 26 CONFIG_CHANGED, | 26 CONFIG_CHANGED, |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 // Request a MediaDecoderBuffer from this stream for decoding and rendering. | 29 // Request a MediaDecoderBuffer from this stream for decoding and rendering. |
| 30 // When available, the callback will be invoked with a Status and |response| | 30 // When available, the callback will be invoked with a Status and |response| |
| 31 // buffer. See media::DemuxerStream::ReadCB for explanation of fields. | 31 // buffer. See media::DemuxerStream::ReadCB for explanation of fields. |
| 32 // | 32 // |
| 33 // TODO(tim): Remove this method in favor of initializing the | 33 // TODO(dalecurtis): Remove this method in favor of serializing everything |
| 34 // DemuxerStreamClient with a DataPipeConsumerHandle once we have a framed | 34 // into the DataPipe given to OnStreamReady() once DataPipe supports framed |
| 35 // DataPipe that we can serialize [|status| | response|]* over directly. | 35 // data in a nicer fashion. |
| 36 Read() => (Status status, MediaDecoderBuffer response); | 36 Read() => (Status status, MediaDecoderBuffer response); |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 interface DemuxerStreamClient { | 39 interface DemuxerStreamClient { |
| 40 // Informs the client that the stream is ready for reading. If |pipe| is | 40 // Informs the client that the stream is ready for reading. If |pipe| is |
|
xhwang
2014/12/06 00:03:44
pipe muse be present now
DaleCurtis
2014/12/06 00:42:59
Done.
| |
| 41 // present, it means the client should read | 41 // present, it means the client should read |
| 42 // | 42 // |
| 43 // [ |DemuxerStream::Status| |MediaDecoderBuffer| ] | 43 // [ |media::DecoderBuffer::data()| ] |
| 44 // | 44 // |
| 45 // payloads from the DataPipe directly. If |pipe| is NULL, it means the | 45 // payloads from the DataPipe directly. If |pipe| is NULL, it means the |
|
xhwang
2014/12/06 00:03:44
pipe cannot be null now.
DaleCurtis
2014/12/06 00:42:59
Done.
| |
| 46 // client needs to use DemuxerStream::Read() directly to obtain buffers. | 46 // client needs to use DemuxerStream::Read() directly to obtain buffers. |
| 47 OnStreamReady(handle<data_pipe_consumer>? pipe); | 47 OnStreamReady(handle<data_pipe_consumer> pipe); |
| 48 | 48 |
| 49 // A new AudioDecoderConfig is available. Will be sent by the DemuxerStream | 49 // A new AudioDecoderConfig is available. Will be sent by the DemuxerStream |
| 50 // whenever a DemuxerStream::STATUS_CONFIG_CHANGED is observed (either | 50 // whenever a DemuxerStream::STATUS_CONFIG_CHANGED is observed (either |
| 51 // in a Read() callback or over the DataPipe). | 51 // in a Read() callback or over the DataPipe). |
| 52 OnAudioDecoderConfigChanged(AudioDecoderConfig config); | 52 OnAudioDecoderConfigChanged(AudioDecoderConfig config); |
| 53 | 53 |
| 54 // A new VideoDecoderConfig is available. Will be sent by the DemuxerStream | 54 // A new VideoDecoderConfig is available. Will be sent by the DemuxerStream |
| 55 // whenever a DemuxerStream::STATUS_CONFIG_CHANGED is observed (either | 55 // whenever a DemuxerStream::STATUS_CONFIG_CHANGED is observed (either |
| 56 // in a Read() callback or over the DataPipe). | 56 // in a Read() callback or over the DataPipe). |
| 57 OnVideoDecoderConfigChanged(VideoDecoderConfig config); | 57 OnVideoDecoderConfigChanged(VideoDecoderConfig config); |
| 58 }; | 58 }; |
| OLD | NEW |