1
1
mirror of https://github.com/wader/fq.git synced 2024-12-24 22:05:31 +03:00
fq/format/vpx/vpx_ccr.go

33 lines
1018 B
Go
Raw Normal View History

2020-06-08 03:29:51 +03:00
package vpx
// https://www.webmproject.org/vp9/mp4/
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
)
func init() {
registry.MustRegister(decode.Format{
2020-06-08 03:29:51 +03:00
Name: format.VPX_CCR,
Description: "VPX Codec Configuration Record",
DecodeFn: vpxCCRDecode,
})
}
func vpxCCRDecode(d *decode.D, in interface{}) interface{} {
d.FieldU8("profile")
d.FieldU8("level", d.MapUToStrSym(vpxLevelNames))
2020-06-08 03:29:51 +03:00
d.FieldU4("bit_depth")
d.FieldU3("chroma_subsampling", d.MapUToStrSym(vpxChromeSubsamplingNames))
2020-06-08 03:29:51 +03:00
d.FieldU1("video_full_range_flag")
2021-11-29 02:37:22 +03:00
d.FieldU8("colour_primaries", d.MapUToScalar(format.ISO_23091_2_ColourPrimariesMap))
d.FieldU8("transfer_characteristics", d.MapUToScalar(format.ISO_23091_2_TransferCharacteristicMap))
d.FieldU8("matrix_coefficients", d.MapUToScalar(format.ISO_23091_2_MatrixCoefficients))
2021-09-06 16:37:55 +03:00
_ = d.FieldU16("codec_initialization_data_size")
// d.FieldRawLen("codec_initialization_data", int64(initDataSize)*8)
2020-06-08 03:29:51 +03:00
return nil
}