Skip to content

Commit

Permalink
matroska: Update spec
Browse files Browse the repository at this point in the history
Update generator to support hex values
  • Loading branch information
wader committed Sep 12, 2024
1 parent a683ab4 commit 52e6e1b
Show file tree
Hide file tree
Showing 17 changed files with 718 additions and 712 deletions.
4 changes: 2 additions & 2 deletions format/matroska/ebml/gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,10 @@ func main() {

switch c.Type {
case "integer":
n, _ := strconv.ParseInt(e.Value, 10, 64)
n, _ := strconv.ParseInt(e.Value, 0, 64)
fmt.Printf(" %d:{", n)
case "uinteger":
n, _ := strconv.ParseUint(e.Value, 10, 64)
n, _ := strconv.ParseUint(e.Value, 0, 64)
fmt.Printf(" %d:{", n)
case "string":
fmt.Printf(" %q:{", e.Value)
Expand Down
728 changes: 369 additions & 359 deletions format/matroska/ebml_matroska/ebml_matroska.xml

Large diffs are not rendered by default.

206 changes: 101 additions & 105 deletions format/matroska/ebml_matroska/ebml_matroska_gen.go

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions format/matroska/testdata/aac.fqtest

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions format/matroska/testdata/av1.fqtest

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions format/matroska/testdata/avc.fqtest

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions format/matroska/testdata/decode_samples.fqtest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$ fq -o decode_samples=true 'first(grep_by(.id=="simple_block")) | dv' aac.mkv
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.elements[1].elements[5].elements[2]{}: element 0x227-0x2fb (212)
0x220| a3 | . | id: "simple_block" (0xa3) (Similar to Block) 0x227-0x228 (1)
0x220| a3 | . | id: "simple_block" (0xa3) (Similar to Block ) but without all the extra information) 0x227-0x228 (1)
| | | type: "binary"
0x220| 40 d1 | @. | size: 209 0x228-0x22a (2)
0x220| 81 | . | track_number: 1 0x22a-0x22b (1)
Expand Down Expand Up @@ -40,7 +40,7 @@ $ fq -o decode_samples=true 'first(grep_by(.id=="simple_block")) | dv' aac.mkv
* |until 0x2fa.7 (184) | |
$ fq -o decode_samples=false 'first(grep_by(.id=="simple_block")) | dv' aac.mkv
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.elements[1].elements[5].elements[2]{}: element 0x227-0x2fb (212)
0x220| a3 | . | id: "simple_block" (0xa3) (Similar to Block) 0x227-0x228 (1)
0x220| a3 | . | id: "simple_block" (0xa3) (Similar to Block ) but without all the extra information) 0x227-0x228 (1)
| | | type: "binary"
0x220| 40 d1 | @. | size: 209 0x228-0x22a (2)
0x220| 81 | . | track_number: 1 0x22a-0x22b (1)
Expand Down
32 changes: 16 additions & 16 deletions format/matroska/testdata/flac.fqtest

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions format/matroska/testdata/hevc.fqtest

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions format/matroska/testdata/mp3.fqtest

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions format/matroska/testdata/mpeg2.fqtest

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions format/matroska/testdata/opus.fqtest

Large diffs are not rendered by default.

94 changes: 47 additions & 47 deletions format/matroska/testdata/sweep-with-DC.mkvmerge13.mka.fqtest

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions format/matroska/testdata/unknown_size.fqtest
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ $ fq -o decode_samples=false dv unknown_size.mkv
0x0f0| 4c 61 76 66 35 39| Lavf59| value: "Lavf59.27.100" 0xfa-0x107 (13)
0x100|2e 32 37 2e 31 30 30 |.27.100 |
| | | [4]{}: element 0x107-0x11a (19)
0x100| 73 a4 | s. | id: "segment_uuid" (0x73a4) (A randomly generated unique ID to identify the Segment amongst many others chosen) 0x107-0x109 (2)
0x100| 73 a4 | s. | id: "segment_uuid" (0x73a4) (A randomly generated UID that identifies the Segment amongst many others v4 RFC4122 with all bits randomly (or pseudorandomly) chosen) 0x107-0x109 (2)
| | | type: "binary"
0x100| 90 | . | size: 16 0x109-0x10a (1)
0x100| 9c a2 35 00 05 c2| ..5...| value: raw bits 0x10a-0x11a (16)
Expand All @@ -164,7 +164,7 @@ $ fq -o decode_samples=false dv unknown_size.mkv
0x120| 01 46 1f| .F.| value: raw bits 0x12d-0x131 (4)
0x130|75 |u |
| | | [1]{}: element 0x131-0xe6c (3387)
0x130| ae | . | id: "track_entry" (0xae) (Describes a track with all Elements) 0x131-0x132 (1)
0x130| ae | . | id: "track_entry" (0xae) (Describes a track with all elements) 0x131-0x132 (1)
| | | type: "master"
0x130| 01 00 00 00 00 00 0d 32 | .......2 | size: 3378 0x132-0x13a (8)
| | | elements[0:9]: 0x13a-0xe6c (3378)
Expand All @@ -174,12 +174,12 @@ $ fq -o decode_samples=false dv unknown_size.mkv
0x130| 81 | . | size: 1 0x13b-0x13c (1)
0x130| 01 | . | value: 1 0x13c-0x13d (1)
| | | [1]{}: element 0x13d-0x148 (11)
0x130| 73 c5 | s. | id: "track_uid" (0x73c5) (A unique ID to identify the Track) 0x13d-0x13f (2)
0x130| 73 c5 | s. | id: "track_uid" (0x73c5) (A UID that identifies the Track) 0x13d-0x13f (2)
| | | type: "uinteger"
0x130| 88| .| size: 8 0x13f-0x140 (1)
0x140|83 ed 1e ef a4 bf 74 c6 |......t. | value: 9506288403059012806 0x140-0x148 (8)
| | | [2]{}: element 0x148-0x14b (3)
0x140| 9c | . | id: "flag_lacing" (0x9c) (Set to 1 if the track **MAY** contain blocks using lacing) 0x148-0x149 (1)
0x140| 9c | . | id: "flag_lacing" (0x9c) (Set to 1 if the track **MAY** contain blocks that use lacing) 0x148-0x149 (1)
| | | type: "uinteger"
0x140| 81 | . | size: 1 0x149-0x14a (1)
0x140| 00 | . | value: 0 0x14a-0x14b (1)
Expand All @@ -190,7 +190,7 @@ $ fq -o decode_samples=false dv unknown_size.mkv
0x140| 75| u| value: "und" 0x14f-0x152 (3)
0x150|6e 64 |nd |
| | | [4]{}: element 0x152-0x155 (3)
0x150| 88 | . | id: "flag_default" (0x88) (Set if that track is eligible for automatic selection by the player) 0x152-0x153 (1)
0x150| 88 | . | id: "flag_default" (0x88) (Set to 1 if the track is eligible for automatic selection by the player) 0x152-0x153 (1)
| | | type: "uinteger"
0x150| 81 | . | size: 1 0x153-0x154 (1)
0x150| 00 | . | value: 0 0x154-0x155 (1)
Expand Down Expand Up @@ -259,7 +259,7 @@ $ fq -o decode_samples=false dv unknown_size.mkv
0xe70| a0 | . | size: 32 0xe79-0xe7a (1)
| | | elements[0:2]: 0xe7a-0xe9a (32)
| | | [0]{}: element 0xe7a-0xe7d (3)
0xe70| 63 c0 | c. | id: "targets" (0x63c0) (Specifies which other elements the metadata represented by the Tag applies to) 0xe7a-0xe7c (2)
0xe70| 63 c0 | c. | id: "targets" (0x63c0) (Specifies which other elements the metadata represented by the tag value applies to) 0xe7a-0xe7c (2)
| | | type: "master"
0xe70| 80 | . | size: 0 0xe7c-0xe7d (1)
| | | elements[0:0]: 0xe7d-0xe7d (0)
Expand All @@ -269,12 +269,12 @@ $ fq -o decode_samples=false dv unknown_size.mkv
0xe70| 9a| .| size: 26 0xe7f-0xe80 (1)
| | | elements[0:2]: 0xe80-0xe9a (26)
| | | [0]{}: element 0xe80-0xe8a (10)
0xe80|45 a3 |E. | id: "tag_name" (0x45a3) (The name of the Tag that is going to be stored) 0xe80-0xe82 (2)
0xe80|45 a3 |E. | id: "tag_name" (0x45a3) (The name of the tag value that is going to be stored) 0xe80-0xe82 (2)
| | | type: "utf8"
0xe80| 87 | . | size: 7 0xe82-0xe83 (1)
0xe80| 45 4e 43 4f 44 45 52 | ENCODER | value: "ENCODER" 0xe83-0xe8a (7)
| | | [1]{}: element 0xe8a-0xe9a (16)
0xe80| 44 87 | D. | id: "tag_string" (0x4487) (The value of the Tag) 0xe8a-0xe8c (2)
0xe80| 44 87 | D. | id: "tag_string" (0x4487) (The tag value) 0xe8a-0xe8c (2)
| | | type: "utf8"
0xe80| 8d | . | size: 13 0xe8c-0xe8d (1)
0xe80| 4c 61 76| Lav| value: "Lavf59.27.100" 0xe8d-0xe9a (13)
Expand All @@ -285,12 +285,12 @@ $ fq -o decode_samples=false dv unknown_size.mkv
0xe90| b5 | . | size: 53 0xe9c-0xe9d (1)
| | | elements[0:2]: 0xe9d-0xed2 (53)
| | | [0]{}: element 0xe9d-0xeab (14)
0xe90| 63 c0 | c. | id: "targets" (0x63c0) (Specifies which other elements the metadata represented by the Tag applies to) 0xe9d-0xe9f (2)
0xe90| 63 c0 | c. | id: "targets" (0x63c0) (Specifies which other elements the metadata represented by the tag value applies to) 0xe9d-0xe9f (2)
| | | type: "master"
0xe90| 8b| .| size: 11 0xe9f-0xea0 (1)
| | | elements[0:1]: 0xea0-0xeab (11)
| | | [0]{}: element 0xea0-0xeab (11)
0xea0|63 c5 |c. | id: "tag_track_uid" (0x63c5) (A unique ID to identify the Track(s) the tags belong to) 0xea0-0xea2 (2)
0xea0|63 c5 |c. | id: "tag_track_uid" (0x63c5) (A UID that identifies the Track(s) that the tags belong to) 0xea0-0xea2 (2)
| | | type: "uinteger"
0xea0| 88 | . | size: 8 0xea2-0xea3 (1)
0xea0| 83 ed 1e ef a4 bf 74 c6 | ......t. | value: 9506288403059012806 0xea3-0xeab (8)
Expand All @@ -300,12 +300,12 @@ $ fq -o decode_samples=false dv unknown_size.mkv
0xea0| a4 | . | size: 36 0xead-0xeae (1)
| | | elements[0:2]: 0xeae-0xed2 (36)
| | | [0]{}: element 0xeae-0xeb8 (10)
0xea0| 45 a3| E.| id: "tag_name" (0x45a3) (The name of the Tag that is going to be stored) 0xeae-0xeb0 (2)
0xea0| 45 a3| E.| id: "tag_name" (0x45a3) (The name of the tag value that is going to be stored) 0xeae-0xeb0 (2)
| | | type: "utf8"
0xeb0|87 |. | size: 7 0xeb0-0xeb1 (1)
0xeb0| 45 4e 43 4f 44 45 52 | ENCODER | value: "ENCODER" 0xeb1-0xeb8 (7)
| | | [1]{}: element 0xeb8-0xed2 (26)
0xeb0| 44 87 | D. | id: "tag_string" (0x4487) (The value of the Tag) 0xeb8-0xeba (2)
0xeb0| 44 87 | D. | id: "tag_string" (0x4487) (The tag value) 0xeb8-0xeba (2)
| | | type: "utf8"
0xeb0| 97 | . | size: 23 0xeba-0xebb (1)
0xeb0| 4c 61 76 63 35| Lavc5| value: "Lavc59.37.100 libvorbis" 0xebb-0xed2 (23)
Expand All @@ -327,7 +327,7 @@ $ fq -o decode_samples=false dv unknown_size.mkv
0xed0| 81| .| size: 1 0xedf-0xee0 (1)
0xee0|00 |. | value: 0 0xee0-0xee1 (1)
| | | [2]{}: element 0xee1-0xf08 (39)
0xee0| a3 | . | id: "simple_block" (0xa3) (Similar to Block) 0xee1-0xee2 (1)
0xee0| a3 | . | id: "simple_block" (0xa3) (Similar to Block ) but without all the extra information) 0xee1-0xee2 (1)
| | | type: "binary"
0xee0| a5 | . | size: 37 0xee2-0xee3 (1)
0xee0| 81 | . | track_number: 1 0xee3-0xee4 (1)
Expand All @@ -342,7 +342,7 @@ $ fq -o decode_samples=false dv unknown_size.mkv
0xef0|01 42 00 a0 dd 71 77 8b ed cd 37 df 7c 33 3a 0c|.B...qw...7.|3:.|
0xf00|c3 30 0c c3 30 d4 50 02 |.0..0.P. |
| | | [3]{}: element 0xf08-0xf80 (120)
0xf00| a3 | . | id: "simple_block" (0xa3) (Similar to Block) 0xf08-0xf09 (1)
0xf00| a3 | . | id: "simple_block" (0xa3) (Similar to Block ) but without all the extra information) 0xf08-0xf09 (1)
| | | type: "binary"
0xf00| f6 | . | size: 118 0xf09-0xf0a (1)
0xf00| 81 | . | track_number: 1 0xf0a-0xf0b (1)
Expand Down
Loading

0 comments on commit 52e6e1b

Please sign in to comment.