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/pkg/decode"
|
2022-07-16 19:39:57 +03:00
|
|
|
"github.com/wader/fq/pkg/interp"
|
2020-06-08 03:29:51 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
2023-03-29 01:36:55 +03:00
|
|
|
interp.RegisterFormat(
|
2023-05-01 14:19:04 +03:00
|
|
|
format.VPX_CCR,
|
2023-03-29 01:36:55 +03:00
|
|
|
&decode.Format{
|
|
|
|
Description: "VPX Codec Configuration Record",
|
|
|
|
DecodeFn: vpxCCRDecode,
|
|
|
|
})
|
2020-06-08 03:29:51 +03:00
|
|
|
}
|
|
|
|
|
2023-02-18 23:10:48 +03:00
|
|
|
func vpxCCRDecode(d *decode.D) any {
|
2020-06-08 03:29:51 +03:00
|
|
|
d.FieldU8("profile")
|
2021-12-02 00:48:25 +03:00
|
|
|
d.FieldU8("level", vpxLevelNames)
|
2020-06-08 03:29:51 +03:00
|
|
|
d.FieldU4("bit_depth")
|
2021-12-02 00:48:25 +03:00
|
|
|
d.FieldU3("chroma_subsampling", vpxChromeSubsamplingNames)
|
2020-06-08 03:29:51 +03:00
|
|
|
d.FieldU1("video_full_range_flag")
|
2021-12-02 00:48:25 +03:00
|
|
|
d.FieldU8("colour_primaries", format.ISO_23091_2_ColourPrimariesMap)
|
|
|
|
d.FieldU8("transfer_characteristics", format.ISO_23091_2_TransferCharacteristicMap)
|
|
|
|
d.FieldU8("matrix_coefficients", format.ISO_23091_2_MatrixCoefficients)
|
2021-09-06 16:37:55 +03:00
|
|
|
_ = d.FieldU16("codec_initialization_data_size")
|
2021-11-05 17:04:26 +03:00
|
|
|
// d.FieldRawLen("codec_initialization_data", int64(initDataSize)*8)
|
2020-06-08 03:29:51 +03:00
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|