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..aec5a9b33cc84cd6100303ea6268faa655b75aa9 |
--- /dev/null |
+++ b/media/gpu/mojo/jpeg_decoder.mojom |
@@ -0,0 +1,46 @@ |
+// 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 { |
xhwang
2017/06/01 16:59:01
This struct is not documented. You probably want t
Chandan
2017/06/01 18:38:22
Sure. I will add comments wherever necessary in th
|
+ 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); |
xhwang
2017/06/01 16:59:01
I see that you copied the old comments here. But I
Chandan
2017/06/01 18:38:23
I am new to this part of the code. However, as I s
|
+}; |
+ |
+// Initialize() must be called before using Decode(). |
+interface GpuJpegDecodeAccelerator { |
+ [Sync] |
Chandan
2017/06/01 13:37:50
Sorry, didn't realize that the existing equivalent
xhwang
2017/06/01 16:59:01
Is there a compelling reason why this must be sync
Chandan
2017/06/01 18:38:23
Since the existing implementation is synchronous,
xhwang
2017/06/01 18:49:18
I see. It's probably because it's copying the patt
|
+ Initialize(GpuJpegDecodeAcceleratorClient client) => (bool success); |
+ |
+ // Decode one JPEG image from shared memory |input_buffer.memory_handle| with |
+ // size |input_buffer.size|. The input buffer is associated with |
+ // |input_buffer.id|and the and the size of JPEG image is |coded_size|. |
+ // Decoded I420 frame data will be put onto shared memory associated with |
+ // |output_handle| with size limit |output_buffer_size|. |
xhwang
2017/06/01 16:59:01
For |output_buffer_size|, if it's a limit, it shou
xhwang
2017/06/01 16:59:01
I know you are copying this from the IPC message.
Chandan
2017/06/01 18:38:23
Sure.
xhwang
2017/06/01 18:49:18
You don't need a struct if you only have 4 paramet
|
+ Decode(JpegDecodeInfo info); |
+ |
+ // TODO(c.padhi): This method might not be required, see |
+ // http://crbug.com/699255. |
+ Uninitialize(); |
+}; |