Index: components/arc/common/video_accelerator.mojom |
diff --git a/components/arc/common/video_accelerator.mojom b/components/arc/common/video_accelerator.mojom |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b2dc5d25e21cc6f4fb0018e531315b13fdd9d04c |
--- /dev/null |
+++ b/components/arc/common/video_accelerator.mojom |
@@ -0,0 +1,87 @@ |
+// 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 arc; |
+ |
+[Client=VideoAcceleratorServiceClient] |
+ |
+enum HalPixelFormatExtension { |
Luis Héctor Chávez
2016/03/24 17:24:20
Do you think all these enums will need modificatio
kcwu
2016/03/28 13:17:35
Done.
|
+ HAL_PIXEL_FORMAT_H264 = 0x34363248, |
+ HAL_PIXEL_FORMAT_VP8 = 0x00385056, |
+}; |
+ |
+enum PortType { |
+ PORT_INPUT = 0, |
+ PORT_OUTPUT = 1, |
+}; |
+ |
+enum BufferFlag { |
+ BUFFER_FLAG_EOS = 1, |
+}; |
+ |
+struct BufferMetadata { |
+ int64 timestamp; // in microseconds |
+ uint32 flags; |
+ uint32 bytes_used; |
+}; |
+ |
+struct VideoFormat { |
+ uint32 pixel_format; |
+ uint32 buffer_size; |
+ |
+ // minimal number of buffers required to process the video. |
+ uint32 min_num_buffers; |
+ uint32 coded_width; |
+ uint32 coded_height; |
+ uint32 crop_left; |
+ uint32 crop_width; |
+ uint32 crop_top; |
+ uint32 crop_height; |
+}; |
+ |
+struct ArcVideoAcceleratorConfig { |
+ enum DeviceType { |
+ DEVICE_ENCODER = 0, |
+ DEVICE_DECODER = 1, |
+ }; |
+ |
+ DeviceType device_type; |
+ uint64 num_input_buffers; |
+ uint32 input_pixel_format; |
+}; |
+ |
+interface VideoAcceleratorService { |
+ Initialize(ArcVideoAcceleratorConfig config) => (bool result); |
Luis Héctor Chávez
2016/03/24 17:24:20
Can you add explicit ordinals?
kcwu
2016/03/28 13:17:35
Done.
|
+ |
+ BindSharedMemory(PortType port, uint32 index, handle ashmem_fd, |
+ uint64 offset, uint64 length); |
+ |
+ BindDmabuf(PortType port, uint32 index, handle dmabuf_fd); |
+ |
+ UseBuffer(PortType port, uint32 index, BufferMetadata metadata); |
+ |
+ SetNumberOfOutputBuffers(uint64 number); |
+ |
+ Reset(); |
+}; |
+ |
+interface VideoAcceleratorServiceClient { |
+ enum Error { |
+ NO_ERROR = 0, |
+ ILLEGAL_STATE = 1, |
+ INVALID_ARGUMENT = 2, |
+ UNREADABLE_INPUT = 3, |
+ PLATFORM_FAILURE = 4, |
+ }; |
+ |
+ Init(VideoAcceleratorService service_ptr); |
+ |
+ OnError(Error error); |
+ |
+ OnBufferDone(PortType port, uint32 index, BufferMetadata metadata); |
+ |
+ OnResetDone(); |
+ |
+ OnOutputFormatChanged(VideoFormat format); |
+}; |