2020-06-08 03:29:51 +03:00
|
|
|
package vpx
|
|
|
|
|
|
|
|
// https://www.webmproject.org/vp9/mp4/
|
|
|
|
|
|
|
|
import (
|
2021-08-17 13:06:32 +03:00
|
|
|
"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{
|
|
|
|
Name: format.VPX_CCR,
|
|
|
|
Description: "VPX Codec Configuration Record",
|
|
|
|
DecodeFn: vpxCCRDecode,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func vpxCCRDecode(d *decode.D, in interface{}) interface{} {
|
|
|
|
d.FieldU8("profile")
|
|
|
|
d.FieldStringMapFn("level", vpxLevelNames, "Unknown", d.U8, decode.NumberDecimal)
|
|
|
|
d.FieldU4("bit_depth")
|
|
|
|
d.FieldStringMapFn("chroma_subsampling", vpxChromeSubsamplingNames, "Unknown", d.U3, decode.NumberDecimal)
|
|
|
|
d.FieldU1("video_full_range_flag")
|
|
|
|
d.FieldU8("colour_primaries")
|
|
|
|
d.FieldU8("transfer_characteristics")
|
|
|
|
d.FieldU8("matrix_coefficients")
|
2021-09-06 16:37:55 +03:00
|
|
|
_ = d.FieldU16("codec_initialization_data_size")
|
|
|
|
// d.FieldBitBufLen("codec_initialization_data", int64(initDataSize)*8)
|
2020-06-08 03:29:51 +03:00
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|