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.
5 module media.interfaces;
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 interface DemuxerStream {
13 // See media::DemuxerStream for descriptions.
21 // See media::DemuxerStream for descriptions.
28 // Initializes the DemuxerStream. Read() can only be called after the callback
29 // is received. The returned |pipe| will be used to fill out the data section
30 // of the media::DecoderBuffer returned via DemuxerStream::Read(). Only the
31 // config for |type| should be non-null, which is the initial config of the
33 Initialize() => (Type type,
34 handle<data_pipe_consumer> pipe,
35 AudioDecoderConfig? audio_config,
36 VideoDecoderConfig? video_config);
38 // Requests a DecoderBuffer from this stream for decoding and rendering.
39 // See media::DemuxerStream::ReadCB for a general explanation of the fields.
41 // Notes on the callback:
42 // - If |status| is OK, |buffer| should be non-null and clients must fill out
43 // the data section of the returned media::DecoderBuffer by reading from
44 // the |pipe| provided during Initialize().
45 // - If |status| is ABORTED, all other fields should be null.
46 // - If |status| is CONFIG_CHANGED, the config for the stream type should be
49 // TODO(dalecurtis): Remove this method in favor of serializing everything
50 // into the DataPipe given to Initialize() once DataPipe supports framed data
51 // in a nicer fashion.
52 Read() => (Status status,
53 DecoderBuffer? buffer,
54 AudioDecoderConfig? audio_config,
55 VideoDecoderConfig? video_config);