Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(924)

Side by Side Diff: media/mojo/interfaces/audio_decoder.mojom

Issue 1823443002: Use data pipe for encoded buffers in MojoAudioDecoder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@spitzer-audio-service-impl
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/media_types.mojom"; 7 import "media/mojo/interfaces/media_types.mojom";
8 8
9 interface AudioDecoder { 9 interface AudioDecoder {
10 // Status of a decode operation. See media::AudioDecoder for description. 10 // Status of a decode operation. See media::AudioDecoder for description.
11 enum DecodeStatus { 11 enum DecodeStatus {
12 OK, // We're all good. 12 OK, // We're all good.
13 ABORTED, // We aborted as a result of Reset() or destruction. 13 ABORTED, // We aborted as a result of Reset() or destruction.
14 DECODE_ERROR, // A decoding error occurred. 14 DECODE_ERROR, // A decoding error occurred.
15 }; 15 };
16 16
17 // Initializes the AudioDecoder with the audio codec configuration and CDM id. 17 // Initializes the AudioDecoder with the audio codec configuration and CDM id.
18 // For the unencrypted streams the |cdm_id| is ignored. Executed the callback 18 // For the unencrypted streams the |cdm_id| is ignored. Executed the callback
19 // with whether the initialization succeeded, and whether the pipeline needs 19 // with whether the initialization succeeded, and whether the pipeline needs
20 // bitstream conversion. 20 // bitstream conversion.
21 Initialize(AudioDecoderClient client, AudioDecoderConfig config, int32 cdm_id) 21 Initialize(AudioDecoderClient client, AudioDecoderConfig config, int32 cdm_id)
22 => (bool success, bool needs_bitstream_conversion); 22 => (bool success, bool needs_bitstream_conversion);
23 23
24 // Established data connection. Should be called before Decode().
25 SetDataSource(handle<data_pipe_consumer> receive_pipe);
xhwang 2016/03/19 04:57:25 See comment below. I wonder whether it'll be bette
Tima Vaisburd 2016/03/19 22:04:46 I considered that, but thought that we'd like to h
xhwang 2016/03/20 16:15:57 You are right. I remembered that DataPipe creation
26
24 // Sends the |buffer| to the underlying codec. Should be called only after 27 // Sends the |buffer| to the underlying codec. Should be called only after
25 // Initialize() succeeds. The callback with the status is called after the 28 // Initialize() succeeds. The callback with the status is called after the
26 // decoder has accepted corresponding DecoderBuffer, indicating that the 29 // decoder has accepted corresponding DecoderBuffer, indicating that the
27 // pipeline can send next buffer to decode. 30 // pipeline can send next buffer to decode.
28 // If |buffer| is an EOS buffer then the decoder must be flushed, i.e. all 31 // If |buffer| is an EOS buffer then the decoder must be flushed, i.e. all
29 // pending buffers should be processed, the corresponding decoded buffers 32 // pending buffers should be processed, the corresponding decoded buffers
30 // should be returned to the proxy, and only then the service should return 33 // should be returned to the proxy, and only then the service should return
31 // DecoderStatus. 34 // DecoderStatus.
32 Decode(DecoderBuffer buffer) => (DecodeStatus status); 35 Decode(DecoderBuffer buffer) => (DecodeStatus status);
33 36
34 // Resets decoder state. Should be called only if Initialize() succeeds. 37 // Resets decoder state. Should be called only if Initialize() succeeds.
35 // All pending Decode() requests will be finished or aborted, then the method 38 // All pending Decode() requests will be finished or aborted, then the method
36 // executes the callback. 39 // executes the callback.
37 Reset() => (); 40 Reset() => ();
38 }; 41 };
39 42
40 interface AudioDecoderClient { 43 interface AudioDecoderClient {
41 // Sends the decoded audio buffer back to the proxy. 44 // Sends the decoded audio buffer back to the proxy.
42 OnBufferDecoded(AudioBuffer buffer); 45 OnBufferDecoded(AudioBuffer buffer);
43 }; 46 };
OLDNEW
« no previous file with comments | « no previous file | media/mojo/services/mojo_audio_decoder.h » ('j') | media/mojo/services/mojo_audio_decoder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698