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.
7 import "media/mojo/interfaces/media_types.mojom";
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.
22 // See media::DemuxerStream for descriptions.
29 // Request a MediaDecoderBuffer from this stream for decoding and rendering.
30 // When available, the callback will be invoked with a Status and |response|
31 // buffer. See media::DemuxerStream::ReadCB for explanation of fields.
33 // TODO(tim): Remove this method in favor of initializing the
34 // DemuxerStreamClient with a DataPipeConsumerHandle once we have a framed
35 // DataPipe that we can serialize [|status| | response|]* over directly.
36 Read() => (Status status, MediaDecoderBuffer response);
39 interface DemuxerStreamClient {
40 // Informs the client that the stream is ready for reading. If |pipe| is
41 // present, it means the client should read
43 // [ |DemuxerStream::Status| |MediaDecoderBuffer| ]
45 // payloads from the DataPipe directly. If |pipe| is NULL, it means the
46 // client needs to use DemuxerStream::Read() directly to obtain buffers.
47 OnStreamReady(handle<data_pipe_consumer>? pipe);
49 // A new AudioDecoderConfig is available. Will be sent by the DemuxerStream
50 // whenever a DemuxerStream::STATUS_CONFIG_CHANGED is observed (either
51 // in a Read() callback or over the DataPipe).
52 OnAudioDecoderConfigChanged(AudioDecoderConfig config);
54 // A new VideoDecoderConfig is available. Will be sent by the DemuxerStream
55 // whenever a DemuxerStream::STATUS_CONFIG_CHANGED is observed (either
56 // in a Read() callback or over the DataPipe).
57 OnVideoDecoderConfigChanged(VideoDecoderConfig config);