mirror of
https://github.com/wader/fq.git
synced 2024-12-23 13:22:58 +03:00
8e0dde03d0
This will allow passing both cli options and format options to sub decoder. Ex: pass keylog option to a tls decoder when decoding a pcap. Ex: pass decode options to a format inside a http body inside a pcap. Add ArgAs method to lookup argument based on type. This also makes the format decode function have same signature as sub decoders in the decode API. This change decode.Format a bit: DecodeFn is now just func(d *D) any DecodeInArg renamed to DefaultInArg
35 lines
1.0 KiB
Go
35 lines
1.0 KiB
Go
package av1
|
|
|
|
// matroska "Low Overhead Bitstream Format syntax" format
|
|
// "Each Block contains one Temporal Unit containing one or more OBUs. Each OBU stored in the Block MUST contain its header and its payload."
|
|
// "The OBUs in the Block follow the [Low Overhead Bitstream Format syntax]. They MUST have the [obu_has_size_field] set to 1 except for the last OBU in the frame, for which [obu_has_size_field] MAY be set to 0, in which case it is assumed to fill the remainder of the frame."
|
|
|
|
import (
|
|
"github.com/wader/fq/format"
|
|
"github.com/wader/fq/pkg/decode"
|
|
"github.com/wader/fq/pkg/interp"
|
|
)
|
|
|
|
var obuFormat decode.Group
|
|
|
|
func init() {
|
|
interp.RegisterFormat(decode.Format{
|
|
Name: format.AV1_FRAME,
|
|
Description: "AV1 frame",
|
|
DecodeFn: frameDecode,
|
|
RootArray: true,
|
|
RootName: "frame",
|
|
Dependencies: []decode.Dependency{
|
|
{Names: []string{format.AV1_OBU}, Group: &obuFormat},
|
|
},
|
|
})
|
|
}
|
|
|
|
func frameDecode(d *decode.D) any {
|
|
for d.NotEnd() {
|
|
d.FieldFormat("obu", obuFormat, nil)
|
|
}
|
|
|
|
return nil
|
|
}
|