| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // This file defined the mojo interface between Android and Chromium for video | |
| 6 // decoding and encoding. See comments of ArcVideoAccelerator for more info. | |
| 7 | |
| 8 module arc.mojom; | |
| 9 | |
| 10 [Extensible] | |
| 11 enum HalPixelFormatExtension { | |
| 12 HAL_PIXEL_FORMAT_YCbCr_420_888 = 0x23, | |
| 13 HAL_PIXEL_FORMAT_H264 = 0x34363248, | |
| 14 HAL_PIXEL_FORMAT_VP8 = 0x00385056, | |
| 15 }; | |
| 16 | |
| 17 enum PortType { | |
| 18 PORT_INPUT = 0, | |
| 19 PORT_OUTPUT = 1, | |
| 20 }; | |
| 21 | |
| 22 struct BufferMetadata { | |
| 23 int64 timestamp; // in microseconds | |
| 24 uint32 bytes_used; | |
| 25 }; | |
| 26 | |
| 27 struct VideoFormat { | |
| 28 uint32 pixel_format; | |
| 29 uint32 buffer_size; | |
| 30 | |
| 31 // minimal number of buffers required to process the video. | |
| 32 uint32 min_num_buffers; | |
| 33 uint32 coded_width; | |
| 34 uint32 coded_height; | |
| 35 uint32 crop_left; | |
| 36 uint32 crop_width; | |
| 37 uint32 crop_top; | |
| 38 uint32 crop_height; | |
| 39 }; | |
| 40 | |
| 41 struct ArcVideoAcceleratorConfig { | |
| 42 enum DeviceType { | |
| 43 DEVICE_ENCODER = 0, | |
| 44 DEVICE_DECODER = 1, | |
| 45 }; | |
| 46 | |
| 47 DeviceType device_type; | |
| 48 uint32 num_input_buffers; | |
| 49 uint32 input_pixel_format; | |
| 50 }; | |
| 51 | |
| 52 struct ArcVideoAcceleratorDmabufPlane { | |
| 53 int32 offset; | |
| 54 int32 stride; | |
| 55 }; | |
| 56 | |
| 57 // Next MinVersion: 4 | |
| 58 // Deprecated method IDs: 2, 7 | |
| 59 // Next method ID: 10 | |
| 60 interface VideoAcceleratorService { | |
| 61 enum Result { | |
| 62 SUCCESS = 0, | |
| 63 ILLEGAL_STATE = 1, | |
| 64 INVALID_ARGUMENT = 2, | |
| 65 UNREADABLE_INPUT = 3, | |
| 66 PLATFORM_FAILURE = 4, | |
| 67 INSUFFICIENT_RESOURCES = 5, | |
| 68 }; | |
| 69 | |
| 70 [MinVersion=2] | |
| 71 Initialize@8(ArcVideoAcceleratorConfig config, | |
| 72 VideoAcceleratorServiceClient client) => (Result result); | |
| 73 | |
| 74 BindSharedMemory@1(PortType port, uint32 index, handle ashmem_fd, | |
| 75 uint32 offset, uint32 length); | |
| 76 | |
| 77 [MinVersion=3] | |
| 78 BindDmabuf@9(PortType port, uint32 index, handle dmabuf_fd, | |
| 79 array<ArcVideoAcceleratorDmabufPlane> dmabuf_planes); | |
| 80 | |
| 81 UseBuffer@3(PortType port, uint32 index, BufferMetadata metadata); | |
| 82 | |
| 83 SetNumberOfOutputBuffers@4(uint32 number); | |
| 84 | |
| 85 Reset@5(); | |
| 86 | |
| 87 Flush@6(); | |
| 88 }; | |
| 89 | |
| 90 // Deprecated method IDs: 0 | |
| 91 // Next method ID: 6 | |
| 92 interface VideoAcceleratorServiceClient { | |
| 93 OnError@1(VideoAcceleratorService.Result error); | |
| 94 | |
| 95 OnBufferDone@2(PortType port, uint32 index, BufferMetadata metadata); | |
| 96 | |
| 97 OnResetDone@3(); | |
| 98 | |
| 99 OnOutputFormatChanged@4(VideoFormat format); | |
| 100 | |
| 101 OnFlushDone@5(); | |
| 102 }; | |
| OLD | NEW |