我正在尝试阅读示例性 ADTF 文件。在读取块头时,我看到块大小为 96 字节,减去头长度 (32) 后,我们得到了 64 字节的实际数据。
现在流的数据结构表明我们只需要 43 个字节来表达数据。我不确定如何在那里应用填充。实际的 64 字节数据似乎有一些填充 - 我不能只读取数据并将其推送到结构中。我不确定如何猜测额外的填充大小。所有提取的值都应等于 41(十进制)。
<stream description="streamid_2" name="NESTED_STRUCT" type="adtf.core.media_type">
<struct bytepos="0" name="tNestedStruct" type="tNestedStruct"/>
</stream>
<struct alignment="1" name="tNestedStruct" version="1">
<element alignment="1" arraysize="1" byteorder="LE" bytepos="0" name="sHeaderStruct" type="tHeaderStruct"/>
<element alignment="1" arraysize="1" byteorder="LE" bytepos="12" name="sSimpleStruct" type="tSimpleStruct"/>
</struct>
<struct alignment="1" name="tHeaderStruct" version="1">
<element alignment="1" arraysize="1" byteorder="LE" bytepos="0" name="ui32HeaderVal" type="tUInt32"/>
<element alignment="1" arraysize="1" byteorder="LE" bytepos="4" name="f64HeaderVal" type="tFloat64"/>
</struct>
<struct alignment="1" name="tSimpleStruct" version="1">
<element alignment="1" arraysize="1" byteorder="LE" bytepos="0" name="ui8Val" type="tUInt8"/>
<element alignment="1" arraysize="1" byteorder="LE" bytepos="1" name="ui16Val" type="tUInt16"/>
<element alignment="1" arraysize="1" byteorder="LE" bytepos="3" name="ui32Val" type="tUInt32"/>
<element alignment="1" arraysize="1" byteorder="LE" bytepos="7" name="i32Val" type="tInt32"/>
<element alignment="1" arraysize="1" byteorder="LE" bytepos="11" name="i64Val" type="tInt64"/>
<element alignment="1" arraysize="1" byteorder="LE" bytepos="19" name="f64Val" type="tFloat64"/>
<element alignment="1" arraysize="1" byteorder="LE" bytepos="27" name="f32Val" type="tFloat32"/>
</struct>
以下是 64 个数据字节:
index = value (decimal)
0 = 3
1 = 43
2 = 0
3 = 0
4 = 0
5 = -57
6 = -120
7 = 31
8 = 0
9 = 0
10 = 0
11 = 0
12 = 0
13 = 0
14 = 0
15 = 0
16 = 0
17 = 41
18 = 0
19 = 0
20 = 0
21 = 0
22 = 0
23 = 0
24 = 0
25 = 0
26 = -128
27 = 68
28 = 64
29 = 41
30 = 41
31 = 0
32 = 41
33 = 0
34 = 0
35 = 0
36 = 41
37 = 0
38 = 0
39 = 0
40 = 41
41 = 0
42 = 0
43 = 0
44 = 0
45 = 0
46 = 0
47 = 0
48 = 0
49 = 0
50 = 0
51 = 0
52 = 0
53 = -128
54 = 68
55 = 64
56 = 0
57 = 0
58 = 36
59 = 66
60 = 0
61 = 0
62 = 0
63 = 0