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

Unified Diff: media/gpu/mojo/jpeg_decoder.mojom

Issue 2905823002: Add Mojo interfaces for GpuJpegDecodeAccelerator and GpuJpegDecodeAcceleratorHost (Closed)
Patch Set: rebase Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/gpu/mojo/OWNERS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..3264ee7d3b56804b64d0aa28dab85b0b202ca983
--- /dev/null
+++ b/media/gpu/mojo/jpeg_decoder.mojom
@@ -0,0 +1,59 @@
+// 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 "mojo/common/time.mojom";
+import "ui/gfx/geometry/mojo/geometry.mojom";
+
+// Decode errors (see media/video/jpeg_decode_accelerator.h).
+enum Error {
+ NO_ERRORS,
+ INVALID_ARGUMENT,
+ UNREADABLE_INPUT,
+ PARSE_JPEG_FAILED,
+ UNSUPPORTED_JPEG,
+ PLATFORM_FAILURE,
+};
+
+// This defines a mojo transport format for media::BitstreamBuffer (see
+// media/base/bitstream_buffer.h).
+struct BitstreamBuffer {
+ int32 id;
+ handle<shared_buffer> memory_handle;
+ uint32 size;
+ uint64 offset;
+ mojo.common.mojom.TimeDelta timestamp;
+ string key_id;
+ string iv;
+ array<SubsampleEntry> subsamples;
+};
+
+// GPU process interface exposed to the browser for decoding JPEG images.
+interface GpuJpegDecodeAccelerator {
+ // Initializes the JPEG decoder. Should be called once per decoder
+ // construction and before using Decode(). This call returns true if
+ // initialization is successful.
+ // TODO(c.padhi): Make this method asynchronous.
+ [Sync]
+ Initialize() => (bool success);
+
+ // Decodes the given bitstream buffer that contains one JPEG image.
+ // The image is decoded from shared memory |input_buffer.memory_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_handle|
+ // with allocated size |output_buffer_size|.
+ // Returns |bitstream_buffer_id| and |error| in a callback to notify the
+ // decode status. |bitstream_buffer_id| is the id of BitstreamBuffer
+ // |input_buffer| and |error| is the error code.
+ Decode(BitstreamBuffer input_buffer, gfx.mojom.Size coded_size,
+ handle<shared_buffer> output_handle, uint32 output_buffer_size)
+ => (int32 bitstream_buffer_id, Error error);
+
+ // TODO(c.padhi): This method might not be required, see
+ // http://crbug.com/699255.
+ Uninitialize();
+};
« no previous file with comments | « media/gpu/mojo/OWNERS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698