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 module arc; | |
6 | |
7 [Extensible] | |
8 enum HalPixelFormatExtension { | |
9 HAL_PIXEL_FORMAT_H264 = 0x34363248, | |
10 HAL_PIXEL_FORMAT_VP8 = 0x00385056, | |
11 }; | |
12 | |
13 enum PortType { | |
14 PORT_INPUT = 0, | |
15 PORT_OUTPUT = 1, | |
16 }; | |
17 | |
18 [Extensible] | |
dcheng
2016/04/10 05:01:23
Extensible means that mojo won't do any verificati
kcwu
2016/04/11 04:07:32
I could remove Extensible from Error. Other enums
dcheng
2016/04/11 04:26:32
Can you help me understand why HalPixelFormatExten
kcwu
2016/04/11 04:44:33
I don't fully understand "Extensible". Luis sugges
dcheng
2016/04/11 04:56:54
Hmm, this is surprising to me. In the interest of
| |
19 enum BufferFlag { | |
20 BUFFER_FLAG_EOS = 1, | |
21 }; | |
22 | |
23 struct BufferMetadata { | |
24 int64 timestamp; // in microseconds | |
25 uint32 flags; | |
26 uint32 bytes_used; | |
27 }; | |
28 | |
29 struct VideoFormat { | |
30 uint32 pixel_format; | |
31 uint32 buffer_size; | |
32 | |
33 // minimal number of buffers required to process the video. | |
34 uint32 min_num_buffers; | |
35 uint32 coded_width; | |
36 uint32 coded_height; | |
37 uint32 crop_left; | |
38 uint32 crop_width; | |
39 uint32 crop_top; | |
40 uint32 crop_height; | |
41 }; | |
42 | |
43 struct ArcVideoAcceleratorConfig { | |
44 enum DeviceType { | |
45 DEVICE_ENCODER = 0, | |
46 DEVICE_DECODER = 1, | |
47 }; | |
48 | |
49 DeviceType device_type; | |
50 uint32 num_input_buffers; | |
51 uint32 input_pixel_format; | |
52 }; | |
53 | |
54 interface VideoAcceleratorService { | |
55 Initialize@0(ArcVideoAcceleratorConfig config) => (bool result); | |
dcheng
2016/04/10 05:01:23
Please add comments to the interface for what the
kcwu
2016/04/11 04:07:32
This mojom file is the clone of ArcVideoAccelerato
dcheng
2016/04/11 04:26:32
Sounds good.
| |
56 | |
57 BindSharedMemory@1(PortType port, uint32 index, handle ashmem_fd, | |
58 uint32 offset, uint32 length); | |
59 | |
60 BindDmabuf@2(PortType port, uint32 index, handle dmabuf_fd); | |
61 | |
62 UseBuffer@3(PortType port, uint32 index, BufferMetadata metadata); | |
63 | |
64 SetNumberOfOutputBuffers@4(uint32 number); | |
65 | |
66 Reset@5(); | |
67 }; | |
68 | |
69 interface VideoAcceleratorServiceClient { | |
70 [Extensible] | |
71 enum Error { | |
72 NO_ERROR = 0, | |
73 ILLEGAL_STATE = 1, | |
74 INVALID_ARGUMENT = 2, | |
75 UNREADABLE_INPUT = 3, | |
76 PLATFORM_FAILURE = 4, | |
77 }; | |
78 | |
79 Init@0(VideoAcceleratorService service_ptr); | |
80 | |
81 OnError@1(Error error); | |
82 | |
83 OnBufferDone@2(PortType port, uint32 index, BufferMetadata metadata); | |
84 | |
85 OnResetDone@3(); | |
86 | |
87 OnOutputFormatChanged@4(VideoFormat format); | |
88 }; | |
OLD | NEW |