1
1
mirror of https://github.com/wader/fq.git synced 2024-12-03 01:33:02 +03:00
fq/format/av1/av1_frame.go

35 lines
1.0 KiB
Go
Raw Normal View History

2020-06-08 03:29:51 +03:00
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/format/registry"
"github.com/wader/fq/pkg/decode"
2020-06-08 03:29:51 +03:00
)
var obuFormat []*decode.Format
func init() {
registry.MustRegister(&decode.Format{
Name: format.AV1_FRAME,
Description: "AV1 frame",
DecodeFn: frameDecode,
RootArray: true,
2021-09-16 17:26:31 +03:00
RootName: "frame",
2020-06-08 03:29:51 +03:00
Dependencies: []decode.Dependency{
{Names: []string{format.AV1_OBU}, Formats: &obuFormat},
},
})
}
func frameDecode(d *decode.D, in interface{}) interface{} {
2021-09-16 17:26:31 +03:00
for d.NotEnd() {
d.FieldFormat("obu", obuFormat, nil)
}
2020-06-08 03:29:51 +03:00
return nil
}