Chromium Code Reviews| Index: media/gpu/mojo/jpeg_decoder.mojom |
| diff --git a/media/gpu/mojo/jpeg_decoder.mojom b/media/gpu/mojo/jpeg_decoder.mojom |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..15a5c92e63eeafd756560f2566f7cfe976fb212a |
| --- /dev/null |
| +++ b/media/gpu/mojo/jpeg_decoder.mojom |
| @@ -0,0 +1,47 @@ |
| +// Copyright 2017 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.mojom; |
| + |
| +import "media/mojo/interfaces/media_types.mojom"; |
| +import "ui/gfx/geometry/mojo/geometry.mojom"; |
| + |
| +enum Error { |
| + NO_ERRORS, |
| + INVALID_ARGUMENT, |
| + UNREADABLE_INPUT, |
| + PARSE_JPEG_FAILED, |
| + UNSUPPORTED_JPEG, |
| + PLATFORM_FAILURE, |
| +}; |
| + |
| +struct JpegDecodeInfo { |
| + BitstreamBuffer input_buffer; |
| + gfx.mojom.Size coded_size; |
| + handle<shared_buffer> output_handle; |
| + uint32 output_buffer_size; |
| +}; |
| + |
| +interface GpuJpegDecodeAcceleratorClient { |
| + // Report decode status. |
| + OnDecodeAck(int32 bitstream_buffer_id, Error error); |
| +}; |
| + |
| +interface GpuJpegDecodeAccelerator { |
| + // Create and initialize a hardware jpeg decoder. |
| + // Created decoder should be freed with Uninitialize() when no longer needed. |
| + Initialize(GpuJpegDecodeAcceleratorClient client) => (bool success); |
|
chfremer
2017/05/30 18:07:24
nit: Comment is slightly confusing. If we say "Cre
Chandan
2017/05/31 13:19:58
Uninitialize() is most likely to be removed. Hence
|
| + |
| + // Decode one JPEG image from shared memory |input_buffer_handle| with size |
| + // |input_buffer_size|. The input buffer is associated with |input_buffer_id| |
| + // and the size of JPEG image is |coded_size|. Decoded I420 frame data will |
| + // be put onto shared memory associated with |output_video_frame_handle| |
| + // with size limit |output_buffer_size|. |
| + Decode(JpegDecodeInfo info); |
| + |
| + // TODO(c.padhi): This method might not be required, see |
| + // http://crbug.com/699255. |
| + // Destroy request to the decoder. |
| + Uninitialize(); |
| +}; |