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 media.interfaces; | 5 module media.interfaces; |
6 | 6 |
7 import "media/mojo/interfaces/demuxer_stream.mojom"; | 7 import "media/mojo/interfaces/demuxer_stream.mojom"; |
8 import "media/mojo/interfaces/media_types.mojom"; | 8 import "media/mojo/interfaces/media_types.mojom"; |
9 | 9 |
10 // Interface for decrypting (and decoding) encrypted streams. | 10 // Interface for decrypting (and decoding) encrypted streams. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 InitializeVideoDecoder(VideoDecoderConfig config) => (bool success); | 44 InitializeVideoDecoder(VideoDecoderConfig config) => (bool success); |
45 | 45 |
46 // Decrypts and decodes the |encrypted| buffer and returns the |status| and | 46 // Decrypts and decodes the |encrypted| buffer and returns the |status| and |
47 // the decrypted |audio_buffers| or |video_frame|. | 47 // the decrypted |audio_buffers| or |video_frame|. |
48 // At end-of-stream, this method should be called repeatedly with | 48 // At end-of-stream, this method should be called repeatedly with |
49 // end-of-stream |encrypted| until no buffer/frame can be produced. | 49 // end-of-stream |encrypted| until no buffer/frame can be produced. |
50 // These methods can only be called after the corresponding decoder has | 50 // These methods can only be called after the corresponding decoder has |
51 // been successfully initialized. | 51 // been successfully initialized. |
52 // At most one decrypt-and-decode call is allowed at any time for a | 52 // At most one decrypt-and-decode call is allowed at any time for a |
53 // |stream_type|. | 53 // |stream_type|. |
| 54 // For video, ReleaseSharedBuffer() must be called when the VideoFrame |
| 55 // is shared memory based and the memory is no longer needed. |
54 DecryptAndDecodeAudio(DecoderBuffer encrypted) | 56 DecryptAndDecodeAudio(DecoderBuffer encrypted) |
55 => (Status status, array<AudioBuffer>? audio_buffers); | 57 => (Status status, array<AudioBuffer>? audio_buffers); |
56 DecryptAndDecodeVideo( | 58 DecryptAndDecodeVideo(DecoderBuffer encrypted) |
57 DecoderBuffer encrypted) => (Status status, VideoFrame? video_frame); | 59 => (Status status, VideoFrame? video_frame); |
58 | 60 |
59 // Resets the decoder for |stream_type| to a clean initialized state and | 61 // Resets the decoder for |stream_type| to a clean initialized state and |
60 // cancels any pending decrypt-and-decode operations immediately with ERROR. | 62 // cancels any pending decrypt-and-decode operations immediately with ERROR. |
61 // This method can only be called after the corresponding decoder has been | 63 // This method can only be called after the corresponding decoder has been |
62 // successfully initialized. | 64 // successfully initialized. |
63 ResetDecoder(DemuxerStream.Type stream_type); | 65 ResetDecoder(DemuxerStream.Type stream_type); |
64 | 66 |
65 // Releases decoder resources, deinitializes the decoder, aborts any pending | 67 // Releases decoder resources, deinitializes the decoder, aborts any pending |
66 // initialization (with false) or decrypt-and-decode (with ERROR) for | 68 // initialization (with false) or decrypt-and-decode (with ERROR) for |
67 // |stream_type| immediately. | 69 // |stream_type| immediately. |
68 // This method can be called any time after Initialize{Audio|Video}Decoder() | 70 // This method can be called any time after Initialize{Audio|Video}Decoder() |
69 // has been called (with the correct stream type). | 71 // has been called (with the correct stream type). |
70 // After this operation, the decoder is set to an uninitialized state. | 72 // After this operation, the decoder is set to an uninitialized state. |
71 // The decoder can be reinitialized after it is deinitialized. | 73 // The decoder can be reinitialized after it is deinitialized. |
72 DeinitializeDecoder(DemuxerStream.Type stream_type); | 74 DeinitializeDecoder(DemuxerStream.Type stream_type); |
| 75 |
| 76 // Releases the shared memory. |
| 77 ReleaseSharedBuffer(handle<shared_buffer> buffer, uint64 buffer_size); |
73 }; | 78 }; |
OLD | NEW |