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..faea05f0981d5f435950de779c92bfc475907645 |
--- /dev/null |
+++ b/components/arc/common/video_accelerator.mojom |
@@ -0,0 +1,93 @@ |
+// 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 { |
+ HAL_PIXEL_FORMAT_H264 = 0x34363248, |
+ HAL_PIXEL_FORMAT_VP8 = 0x00385056, |
+}; |
+ |
+enum PortType { |
+ PORT_INPUT = 0, |
+ PORT_OUTPUT = 1, |
+}; |
+ |
+// TODO(kcwu): move into VideoAcceleratorService |
+enum DeviceType { |
+ DEVICE_ENCODER = 0, |
+ DEVICE_DECODER = 1, |
+}; |
+ |
+// TODO(kcwu): move into BufferFormat |
+enum MemoryType { |
+ MEMORY_SHARED_MEMORY = 1, |
+ MEMORY_DMABUF = 2, |
+}; |
+ |
+enum BufferFlag { |
+ BUFFER_FLAG_EOS = 1, |
+}; |
+ |
+struct BufferMetadata { |
+ int64 timestamp; // in microseconds |
+ uint32 flags; |
+ uint32 bytes_used; |
+}; |
+ |
+struct BufferFormat { |
+ uint32 pixel_format; // the v4l2 fourcc format |
+ MemoryType memory_type; |
+}; |
+ |
+struct VideoFormat { |
+ uint32 pixel_format; |
+ uint32 image_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; |
+}; |
+ |
+interface VideoAcceleratorService { |
+ Initialize(DeviceType device) => (bool result); |
+ |
+ BindSharedMemory(PortType port, uint32 index, handle ashmem_fd, |
+ uint64 offset, uint64 length) => (bool result); |
+ |
+ BindDmabuf(PortType port, uint32 index, handle dmabuf_fd) => (bool result); |
+ |
+ UseBuffer(PortType port, uint32 index, BufferMetadata metadata); |
+ |
+ SetBufferCount(PortType port, uint64 set_count) => (bool result, uint64 reply_count); |
+ |
+ Reset() => (); |
+ |
+ SetBufferFormat(PortType port, BufferFormat format) => (bool result); |
+}; |
+ |
+interface VideoAcceleratorServiceClient { |
+ enum Error { |
+ NO_ERROR = 0, |
+ ILLEGAL_STATE = 1, |
+ INVALID_ARGUMENT = 2, |
+ UNREADABLE_INPUT = 3, |
+ PLATFORM_FAILURE = 4, |
+ }; |
+ |
+ SetService(VideoAcceleratorService service_ptr); |
+ |
+ OnError(Error error); |
+ |
+ OnBufferDone(PortType port, uint32 index, BufferMetadata metadata); |
+ |
+ OnOutputFormatChanged(VideoFormat format); |
+}; |