|
1 | 1 | package riff
|
2 | 2 |
|
3 | 3 | // TODO:
|
4 |
| -// mp3 mappig, samples can span? |
| 4 | +// mp3 mappig, samples can span over sample ranges? |
5 | 5 | // hevc mapping?
|
6 | 6 | // DV handler https://learn.microsoft.com/en-us/windows/win32/directshow/dv-data-in-the-avi-file-format
|
7 | 7 | // palette change
|
@@ -62,11 +62,18 @@ var aviListTypeDescriptions = scalar.StrMapDescription{
|
62 | 62 | "rec ": "Chunk group",
|
63 | 63 | }
|
64 | 64 |
|
| 65 | +const ( |
| 66 | + aviStrhTypeAudio = "auds" |
| 67 | + aviStrhTypeMidi = "mids" |
| 68 | + aviStrhTypeVideo = "vids" |
| 69 | + aviStrhTypeText = "txts" |
| 70 | +) |
| 71 | + |
65 | 72 | var aviStrhTypeDescriptions = scalar.StrMapDescription{
|
66 |
| - "auds": "Audio stream", |
67 |
| - "mids": "MIDI stream", |
68 |
| - "txts": "Text stream", |
69 |
| - "vids": "Video stream", |
| 73 | + aviStrhTypeAudio: "Audio stream", |
| 74 | + aviStrhTypeMidi: "MIDI stream", |
| 75 | + aviStrhTypeText: "Text stream", |
| 76 | + aviStrhTypeVideo: "Video stream", |
70 | 77 | }
|
71 | 78 |
|
72 | 79 | const (
|
@@ -352,7 +359,7 @@ func aviDecode(d *decode.D) any {
|
352 | 359 | typ := stream.typ
|
353 | 360 |
|
354 | 361 | switch typ {
|
355 |
| - case "vids": |
| 362 | + case aviStrhTypeVideo: |
356 | 363 | // BITMAPINFOHEADER
|
357 | 364 | d.BitsLeft()
|
358 | 365 | d.FieldU32("bi_size")
|
@@ -397,7 +404,7 @@ func aviDecode(d *decode.D) any {
|
397 | 404 | stream.hasFormat = true
|
398 | 405 | }
|
399 | 406 |
|
400 |
| - case "auds": |
| 407 | + case aviStrhTypeAudio: |
401 | 408 | // WAVEFORMATEX
|
402 | 409 | formatTag := d.FieldU16("format_tag", format.WAVTagNames)
|
403 | 410 | d.FieldU16("channels")
|
@@ -537,9 +544,9 @@ func aviDecode(d *decode.D) any {
|
537 | 544 | d.FieldValueStr("type", stream.typ)
|
538 | 545 | d.FieldValueStr("handler", stream.handler)
|
539 | 546 | switch stream.typ {
|
540 |
| - case "auds": |
| 547 | + case aviStrhTypeAudio: |
541 | 548 | d.FieldValueUint("format_tag", stream.formatTag, format.WAVTagNames)
|
542 |
| - case "vids": |
| 549 | + case aviStrhTypeVideo: |
543 | 550 | d.FieldValueStr("compression", stream.compression)
|
544 | 551 | }
|
545 | 552 |
|
|
0 commit comments