Skip to content

Commit

Permalink
Add Mojo interface for AudioDecoder
Browse files Browse the repository at this point in the history
For Spitzer, the audio decoder that supports encryption has to be
instantiated in the GPU process. The decoder has to be split
between a proxy and a service.

This CL contains Mojo interface only.

BUG=542910

Committed: https://crrev.com/cabbc3cc9b0c18f25d91f17bb6cdded528366695
Cr-Commit-Position: refs/heads/master@{#381360}

Review URL: https://codereview.chromium.org/1809483002

Cr-Commit-Position: refs/heads/master@{#381544}
  • Loading branch information
timav authored and Commit bot committed Mar 16, 2016
1 parent 450f772 commit baa96c7
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions media/mojo/interfaces/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import("//mojo/public/tools/bindings/mojom.gni")

mojom("interfaces") {
sources = [
"audio_decoder.mojom",
"content_decryption_module.mojom",
"decryptor.mojom",
"demuxer_stream.mojom",
Expand Down
43 changes: 43 additions & 0 deletions media/mojo/interfaces/audio_decoder.mojom
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

module media.interfaces;

import "media/mojo/interfaces/media_types.mojom";

interface AudioDecoder {
// Status of a decode operation. See media::AudioDecoder for description.
enum DecodeStatus {
OK, // We're all good.
ABORTED, // We aborted as a result of Reset() or destruction.
DECODE_ERROR, // A decoding error occurred.
};

// Initializes the AudioDecoder with the audio codec configuration and CDM id.
// For the unencrypted streams the |cdm_id| is ignored. Executed the callback
// with whether the initialization succeeded, and whether the pipeline needs
// bitstream conversion.
Initialize(AudioDecoderConfig config, int32 cdm_id)
=> (bool success, bool needs_bitstream_conversion);

// Sends the |buffer| to the underlying codec. Should be called only after
// Initialize() succeeds. The callback with the status is called after the
// decoder has accepted corresponding DecoderBuffer, indicating that the
// pipeline can send next buffer to decode.
// If |buffer| is an EOS buffer then the decoder must be flushed, i.e. all
// pending buffers should be processed, the corresponding decoded buffers
// should be returned to the proxy, and only then the service should return
// DecoderStatus.
Decode(DecoderBuffer buffer) => (DecodeStatus status);

// Resets decoder state. Should be called only if Initialize() succeeds.
// All pending Decode() requests will be finished or aborted, then the method
// executes the callback.
Reset() => ();
};

interface AudioDecoderClient {
// Sends the decoded audio buffer back to the proxy.
OnBufferDecoded(AudioBuffer buffer);
};

0 comments on commit baa96c7

Please sign in to comment.