Skip to content

Commit 790dd18

Browse files
committed
chore(bindings): regenerate bindings with NixOS header discovery
- Remove standard math constants (M_E, M_PI, M_LN2, etc.) that are now provided by system headers on Linux/NixOS - Retain FFmpeg-specific math constants (M_LOG2_10, M_PHI) - Fix type correctness in AVPixFmtDescriptor: - nb_components, log2_chroma_w/h: int → uint8 - flags: int → uint64 - Minor comment updates for skipped functions These changes reflect the correct behavior where standard math constants come from system headers rather than FFmpeg's conditional definitions. The type corrections improve type safety by matching the actual C types.
1 parent 60888b1 commit 790dd18

3 files changed

Lines changed: 14 additions & 80 deletions

File tree

constants.gen.go

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -2195,24 +2195,6 @@ const AVLzoInputPadding = C.AV_LZO_INPUT_PADDING
21952195
// AVLzoOutputPadding wraps AV_LZO_OUTPUT_PADDING.
21962196
const AVLzoOutputPadding = C.AV_LZO_OUTPUT_PADDING
21972197

2198-
// ME wraps M_E.
2199-
const ME = C.M_E
2200-
2201-
// MEf wraps M_Ef.
2202-
const MEf = C.M_Ef
2203-
2204-
// MLn2 wraps M_LN2.
2205-
const MLn2 = C.M_LN2
2206-
2207-
// MLn2F wraps M_LN2f.
2208-
const MLn2F = C.M_LN2f
2209-
2210-
// MLn10 wraps M_LN10.
2211-
const MLn10 = C.M_LN10
2212-
2213-
// MLn10F wraps M_LN10f.
2214-
const MLn10F = C.M_LN10f
2215-
22162198
// MLog210 wraps M_LOG2_10.
22172199
const MLog210 = C.M_LOG2_10
22182200

@@ -2225,54 +2207,6 @@ const MPhi = C.M_PHI
22252207
// MPhif wraps M_PHIf.
22262208
const MPhif = C.M_PHIf
22272209

2228-
// MPi wraps M_PI.
2229-
const MPi = C.M_PI
2230-
2231-
// MPif wraps M_PIf.
2232-
const MPif = C.M_PIf
2233-
2234-
// MPi2 wraps M_PI_2.
2235-
const MPi2 = C.M_PI_2
2236-
2237-
// MPi2F wraps M_PI_2f.
2238-
const MPi2F = C.M_PI_2f
2239-
2240-
// MPi4 wraps M_PI_4.
2241-
const MPi4 = C.M_PI_4
2242-
2243-
// MPi4F wraps M_PI_4f.
2244-
const MPi4F = C.M_PI_4f
2245-
2246-
// M1Pi wraps M_1_PI.
2247-
const M1Pi = C.M_1_PI
2248-
2249-
// M1Pif wraps M_1_PIf.
2250-
const M1Pif = C.M_1_PIf
2251-
2252-
// M2Pi wraps M_2_PI.
2253-
const M2Pi = C.M_2_PI
2254-
2255-
// M2Pif wraps M_2_PIf.
2256-
const M2Pif = C.M_2_PIf
2257-
2258-
// M2Sqrtpi wraps M_2_SQRTPI.
2259-
const M2Sqrtpi = C.M_2_SQRTPI
2260-
2261-
// M2Sqrtpif wraps M_2_SQRTPIf.
2262-
const M2Sqrtpif = C.M_2_SQRTPIf
2263-
2264-
// MSqrt12 wraps M_SQRT1_2.
2265-
const MSqrt12 = C.M_SQRT1_2
2266-
2267-
// MSqrt12F wraps M_SQRT1_2f.
2268-
const MSqrt12F = C.M_SQRT1_2f
2269-
2270-
// MSqrt2 wraps M_SQRT2.
2271-
const MSqrt2 = C.M_SQRT2
2272-
2273-
// MSqrt2F wraps M_SQRT2f.
2274-
const MSqrt2F = C.M_SQRT2f
2275-
22762210
// AVOptFlagEncodingParam wraps AV_OPT_FLAG_ENCODING_PARAM.
22772211
const AVOptFlagEncodingParam = C.AV_OPT_FLAG_ENCODING_PARAM
22782212

functions.gen.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6152,7 +6152,7 @@ func AVGuessCodec(fmt *AVOutputFormat, shortName *CStr, filename *CStr, mimeType
61526152

61536153
// --- Function av_hex_dump ---
61546154

6155-
// av_hex_dump skipped due to f (non-output primitive pointer)
6155+
// av_hex_dump skipped due to f.
61566156

61576157
// --- Function av_hex_dump_log ---
61586158

@@ -6175,7 +6175,7 @@ func AVHexDumpLog(avcl unsafe.Pointer, level int, buf unsafe.Pointer, size int)
61756175

61766176
// --- Function av_pkt_dump2 ---
61776177

6178-
// av_pkt_dump2 skipped due to f (non-output primitive pointer)
6178+
// av_pkt_dump2 skipped due to f.
61796179

61806180
// --- Function av_pkt_dump_log2 ---
61816181

structs.gen.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26787,15 +26787,15 @@ func (s *AVPixFmtDescriptor) SetName(value *CStr) {
2678726787
// NbComponents gets the nb_components field.
2678826788
//
2678926789
// The number of components each pixel has, (1-4)
26790-
func (s *AVPixFmtDescriptor) NbComponents() int {
26790+
func (s *AVPixFmtDescriptor) NbComponents() uint8 {
2679126791
value := s.ptr.nb_components
26792-
return int(value)
26792+
return uint8(value)
2679326793
}
2679426794

2679526795
// SetNbComponents sets the nb_components field.
2679626796
//
2679726797
// The number of components each pixel has, (1-4)
26798-
func (s *AVPixFmtDescriptor) SetNbComponents(value int) {
26798+
func (s *AVPixFmtDescriptor) SetNbComponents(value uint8) {
2679926799
s.ptr.nb_components = (C.uint8_t)(value)
2680026800
}
2680126801

@@ -26807,9 +26807,9 @@ func (s *AVPixFmtDescriptor) SetNbComponents(value int) {
2680726807
The note above is needed to ensure rounding up.
2680826808
This value only refers to the chroma components.
2680926809
*/
26810-
func (s *AVPixFmtDescriptor) Log2ChromaW() int {
26810+
func (s *AVPixFmtDescriptor) Log2ChromaW() uint8 {
2681126811
value := s.ptr.log2_chroma_w
26812-
return int(value)
26812+
return uint8(value)
2681326813
}
2681426814

2681526815
// SetLog2ChromaW sets the log2_chroma_w field.
@@ -26820,7 +26820,7 @@ func (s *AVPixFmtDescriptor) Log2ChromaW() int {
2682026820
The note above is needed to ensure rounding up.
2682126821
This value only refers to the chroma components.
2682226822
*/
26823-
func (s *AVPixFmtDescriptor) SetLog2ChromaW(value int) {
26823+
func (s *AVPixFmtDescriptor) SetLog2ChromaW(value uint8) {
2682426824
s.ptr.log2_chroma_w = (C.uint8_t)(value)
2682526825
}
2682626826

@@ -26832,9 +26832,9 @@ func (s *AVPixFmtDescriptor) SetLog2ChromaW(value int) {
2683226832
The note above is needed to ensure rounding up.
2683326833
This value only refers to the chroma components.
2683426834
*/
26835-
func (s *AVPixFmtDescriptor) Log2ChromaH() int {
26835+
func (s *AVPixFmtDescriptor) Log2ChromaH() uint8 {
2683626836
value := s.ptr.log2_chroma_h
26837-
return int(value)
26837+
return uint8(value)
2683826838
}
2683926839

2684026840
// SetLog2ChromaH sets the log2_chroma_h field.
@@ -26845,22 +26845,22 @@ func (s *AVPixFmtDescriptor) Log2ChromaH() int {
2684526845
The note above is needed to ensure rounding up.
2684626846
This value only refers to the chroma components.
2684726847
*/
26848-
func (s *AVPixFmtDescriptor) SetLog2ChromaH(value int) {
26848+
func (s *AVPixFmtDescriptor) SetLog2ChromaH(value uint8) {
2684926849
s.ptr.log2_chroma_h = (C.uint8_t)(value)
2685026850
}
2685126851

2685226852
// Flags gets the flags field.
2685326853
//
2685426854
// Combination of AV_PIX_FMT_FLAG_... flags.
26855-
func (s *AVPixFmtDescriptor) Flags() int {
26855+
func (s *AVPixFmtDescriptor) Flags() uint64 {
2685626856
value := s.ptr.flags
26857-
return int(value)
26857+
return uint64(value)
2685826858
}
2685926859

2686026860
// SetFlags sets the flags field.
2686126861
//
2686226862
// Combination of AV_PIX_FMT_FLAG_... flags.
26863-
func (s *AVPixFmtDescriptor) SetFlags(value int) {
26863+
func (s *AVPixFmtDescriptor) SetFlags(value uint64) {
2686426864
s.ptr.flags = (C.uint64_t)(value)
2686526865
}
2686626866

0 commit comments

Comments
 (0)