OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file defined the mojo interface between Android and Chromium for video | 5 // This file defined the mojo interface between Android and Chromium for video |
6 // decoding and encoding. See comments of ArcVideoAccelerator for more info. | 6 // decoding and encoding. See comments of ArcVideoAccelerator for more info. |
7 | 7 |
8 module arc.mojom; | 8 module arc.mojom; |
9 | 9 |
10 [Extensible] | 10 [Extensible] |
11 enum HalPixelFormatExtension { | 11 enum HalPixelFormatExtension { |
12 HAL_PIXEL_FORMAT_YCbCr_420_888 = 0x23, | 12 HAL_PIXEL_FORMAT_YCbCr_420_888 = 0x23, |
13 HAL_PIXEL_FORMAT_H264 = 0x34363248, | 13 HAL_PIXEL_FORMAT_H264 = 0x34363248, |
14 HAL_PIXEL_FORMAT_VP8 = 0x00385056, | 14 HAL_PIXEL_FORMAT_VP8 = 0x00385056, |
15 }; | 15 }; |
16 | 16 |
17 enum PortType { | 17 enum PortType { |
18 PORT_INPUT = 0, | 18 PORT_INPUT = 0, |
19 PORT_OUTPUT = 1, | 19 PORT_OUTPUT = 1, |
20 }; | 20 }; |
21 | 21 |
22 [Extensible] | |
23 enum BufferFlag { | |
24 BUFFER_FLAG_EOS = 1, | |
25 }; | |
26 | |
27 struct BufferMetadata { | 22 struct BufferMetadata { |
28 int64 timestamp; // in microseconds | 23 int64 timestamp; // in microseconds |
29 uint32 flags; | |
30 uint32 bytes_used; | 24 uint32 bytes_used; |
31 }; | 25 }; |
32 | 26 |
33 struct VideoFormat { | 27 struct VideoFormat { |
34 uint32 pixel_format; | 28 uint32 pixel_format; |
35 uint32 buffer_size; | 29 uint32 buffer_size; |
36 | 30 |
37 // minimal number of buffers required to process the video. | 31 // minimal number of buffers required to process the video. |
38 uint32 min_num_buffers; | 32 uint32 min_num_buffers; |
39 uint32 coded_width; | 33 uint32 coded_width; |
(...skipping 21 matching lines...) Expand all Loading... |
61 BindSharedMemory@1(PortType port, uint32 index, handle ashmem_fd, | 55 BindSharedMemory@1(PortType port, uint32 index, handle ashmem_fd, |
62 uint32 offset, uint32 length); | 56 uint32 offset, uint32 length); |
63 | 57 |
64 BindDmabuf@2(PortType port, uint32 index, handle dmabuf_fd); | 58 BindDmabuf@2(PortType port, uint32 index, handle dmabuf_fd); |
65 | 59 |
66 UseBuffer@3(PortType port, uint32 index, BufferMetadata metadata); | 60 UseBuffer@3(PortType port, uint32 index, BufferMetadata metadata); |
67 | 61 |
68 SetNumberOfOutputBuffers@4(uint32 number); | 62 SetNumberOfOutputBuffers@4(uint32 number); |
69 | 63 |
70 Reset@5(); | 64 Reset@5(); |
| 65 |
| 66 Flush@6(); |
71 }; | 67 }; |
72 | 68 |
73 interface VideoAcceleratorServiceClient { | 69 interface VideoAcceleratorServiceClient { |
74 enum Error { | 70 enum Error { |
75 NO_ERROR = 0, | 71 NO_ERROR = 0, |
76 ILLEGAL_STATE = 1, | 72 ILLEGAL_STATE = 1, |
77 INVALID_ARGUMENT = 2, | 73 INVALID_ARGUMENT = 2, |
78 UNREADABLE_INPUT = 3, | 74 UNREADABLE_INPUT = 3, |
79 PLATFORM_FAILURE = 4, | 75 PLATFORM_FAILURE = 4, |
80 }; | 76 }; |
81 | 77 |
82 Init@0(VideoAcceleratorService service_ptr); | 78 Init@0(VideoAcceleratorService service_ptr); |
83 | 79 |
84 OnError@1(Error error); | 80 OnError@1(Error error); |
85 | 81 |
86 OnBufferDone@2(PortType port, uint32 index, BufferMetadata metadata); | 82 OnBufferDone@2(PortType port, uint32 index, BufferMetadata metadata); |
87 | 83 |
88 OnResetDone@3(); | 84 OnResetDone@3(); |
89 | 85 |
90 OnOutputFormatChanged@4(VideoFormat format); | 86 OnOutputFormatChanged@4(VideoFormat format); |
| 87 |
| 88 OnFlushDone@5(); |
91 }; | 89 }; |
OLD | NEW |