2023-10-29 08:11:29 CST W44D0

This commit is contained in:
aggresss
2023-10-29 08:11:29 +08:00
parent 7a0773ebf2
commit f00ecdba54
138 changed files with 2244 additions and 64 deletions

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
//go:build ffmpeg_hw_d3d11va //go:build ffmpeg_hw_d3d11va
package ffmpeg package ffmpeg

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
//go:build ffmpeg_hw_dvxa2 //go:build ffmpeg_hw_dvxa2
package ffmpeg package ffmpeg

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
//go:build ffmpeg_hw_mediacodec //go:build ffmpeg_hw_mediacodec
package ffmpeg package ffmpeg

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
//go:build ffmpeg_hw_qsv //go:build ffmpeg_hw_qsv
package ffmpeg package ffmpeg

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
//go:build ffmpeg_hw_vaapi //go:build ffmpeg_hw_vaapi
package ffmpeg package ffmpeg

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
//go:build ffmpeg_hw_vdpau //go:build ffmpeg_hw_vdpau
package ffmpeg package ffmpeg

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
//go:build ffmpeg_hw_videotoolbox //go:build ffmpeg_hw_videotoolbox
package ffmpeg package ffmpeg

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
//go:build ffmpeg_hw_xvmc //go:build ffmpeg_hw_xvmc
package ffmpeg package ffmpeg

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*
@@ -88,8 +92,18 @@ func AvGetPictureTypeChar(pictType AVPictureType) string {
} }
// AvXIfNull returns x default pointer in case p is NULL. // AvXIfNull returns x default pointer in case p is NULL.
func AvXIfNull(p, x unsafe.Pointer) unsafe.Pointer { func AvXIfNull[T any](p, x *T) *T {
return C.av_x_if_null(p, x) if p != nil {
return p
}
return x
}
func AvStringIfNull(p, x string) string {
if len(p) != 0 {
return p
}
return x
} }
// AvIntListLengthForSize computes the length of an integer list. // AvIntListLengthForSize computes the length of an integer list.

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
//go:build ffmpeg_hw_cuda //go:build ffmpeg_hw_cuda
package ffmpeg package ffmpeg

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
//go:build ffmpeg_hw_d3d11va //go:build ffmpeg_hw_d3d11va
package ffmpeg package ffmpeg

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
//go:build ffmpeg_hw_drm //go:build ffmpeg_hw_drm
package ffmpeg package ffmpeg

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
//go:build ffmpeg_hw_dxva2 //go:build ffmpeg_hw_dxva2
package ffmpeg package ffmpeg

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
//go:build ffmpeg_hw_mediacodec //go:build ffmpeg_hw_mediacodec
package ffmpeg package ffmpeg

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
//go:build ffmpeg_hw_opencl //go:build ffmpeg_hw_opencl
package ffmpeg package ffmpeg

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
//go:build ffmpeg_hw_qsv //go:build ffmpeg_hw_qsv
package ffmpeg package ffmpeg

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
//go:build ffmpeg_hw_vaapi //go:build ffmpeg_hw_vaapi
package ffmpeg package ffmpeg

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
//go:build ffmpeg_hw_vdpau //go:build ffmpeg_hw_vdpau
package ffmpeg package ffmpeg

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
//go:build ffmpeg_hw_videotoolbox //go:build ffmpeg_hw_videotoolbox
package ffmpeg package ffmpeg

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
//go:build ffmpeg_hw_vulkan //go:build ffmpeg_hw_vulkan
package ffmpeg package ffmpeg

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*
@@ -17,29 +21,29 @@ const (
) )
// AvGcd computes the greatest common divisor of two integer operands. // AvGcd computes the greatest common divisor of two integer operands.
func AvGcd(a, b int64) int64 { func AvGcd[T Integer](a, b T) T {
return (int64)(C.av_gcd((C.int64_t)(a), (C.int64_t)(b))) return (T)(C.av_gcd((C.int64_t)(a), (C.int64_t)(b)))
} }
// AvRescale rescale a 64-bit integer with rounding to nearest. // AvRescale rescale a 64-bit integer with rounding to nearest.
func AvRescale(a, b, c int64) int64 { func AvRescale[T Integer](a, b, c T) T {
return (int64)(C.av_rescale((C.int64_t)(a), (C.int64_t)(b), (C.int64_t)(c))) return (T)(C.av_rescale((C.int64_t)(a), (C.int64_t)(b), (C.int64_t)(c)))
} }
// AvRescaleRnd rescales a 64-bit integer with specified rounding. // AvRescaleRnd rescales a 64-bit integer with specified rounding.
func AvRescaleRnd(a, b, c int64, rnd AVRounding) int64 { func AvRescaleRnd[T Integer](a, b, c T, rnd AVRounding) T {
return (int64)(C.av_rescale_rnd((C.int64_t)(a), (C.int64_t)(b), (C.int64_t)(c), return (T)(C.av_rescale_rnd((C.int64_t)(a), (C.int64_t)(b), (C.int64_t)(c),
(C.enum_AVRounding)(rnd))) (C.enum_AVRounding)(rnd)))
} }
// AvRescaleQ rescales a 64-bit integer by 2 rational numbers. // AvRescaleQ rescales a 64-bit integer by 2 rational numbers.
func AvRescaleQ(a int64, bq, cq AVRational) int64 { func AvRescaleQ[T Integer](a T, bq, cq AVRational) T {
return (int64)(C.av_rescale_q((C.int64_t)(a), (C.struct_AVRational)(bq), (C.struct_AVRational)(cq))) return (T)(C.av_rescale_q((C.int64_t)(a), (C.struct_AVRational)(bq), (C.struct_AVRational)(cq)))
} }
// AvRescaleQRnd rescales a 64-bit integer by 2 rational numbers with specified rounding. // AvRescaleQRnd rescales a 64-bit integer by 2 rational numbers with specified rounding.
func AvRescaleQRnd(a int64, bq, cq AVRational, rnd AVRounding) int64 { func AvRescaleQRnd[T Integer](a T, bq, cq AVRational, rnd AVRounding) T {
return (int64)(C.av_rescale_q_rnd((C.int64_t)(a), (C.struct_AVRational)(bq), (C.struct_AVRational)(cq), return (T)(C.av_rescale_q_rnd((C.int64_t)(a), (C.struct_AVRational)(bq), (C.struct_AVRational)(cq),
(C.enum_AVRounding)(rnd))) (C.enum_AVRounding)(rnd)))
} }

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*
@@ -522,77 +526,88 @@ func AvOptSet(obj CVoidPointer, name string, val string, searchFlags int32) int3
defer nameFunc() defer nameFunc()
valPtr, valFunc := StringCasting(val) valPtr, valFunc := StringCasting(val)
defer valFunc() defer valFunc()
return (int32)(C.av_opt_set(VoidPointer(obj), (*C.char)(namePtr), (*C.char)(valPtr), (C.int)(searchFlags))) return (int32)(C.av_opt_set(VoidPointer(obj), (*C.char)(namePtr),
(*C.char)(valPtr), (C.int)(searchFlags)))
} }
// AvOptSetInt // AvOptSetInt
func AvOptSetInt(obj CVoidPointer, name string, val int64, searchFlags int32) int32 { func AvOptSetInt[T Integer](obj CVoidPointer, name string, val T, searchFlags int32) int32 {
namePtr, nameFunc := StringCasting(name) namePtr, nameFunc := StringCasting(name)
defer nameFunc() defer nameFunc()
return (int32)(C.av_opt_set_int(VoidPointer(obj), (*C.char)(namePtr), (C.int64_t)(val), (C.int)(searchFlags))) return (int32)(C.av_opt_set_int(VoidPointer(obj), (*C.char)(namePtr),
(C.int64_t)(val), (C.int)(searchFlags)))
} }
// AvOptSetDouble // AvOptSetDouble
func AvOptSetDouble(obj CVoidPointer, name string, val float64, searchFlags int32) int32 { func AvOptSetDouble(obj CVoidPointer, name string, val float64, searchFlags int32) int32 {
namePtr, nameFunc := StringCasting(name) namePtr, nameFunc := StringCasting(name)
defer nameFunc() defer nameFunc()
return (int32)(C.av_opt_set_double(VoidPointer(obj), (*C.char)(namePtr), (C.double)(val), (C.int)(searchFlags))) return (int32)(C.av_opt_set_double(VoidPointer(obj), (*C.char)(namePtr),
(C.double)(val), (C.int)(searchFlags)))
} }
// AvOptSetQ // AvOptSetQ
func AvOptSetQ(obj CVoidPointer, name string, val AVRational, searchFlags int32) int32 { func AvOptSetQ(obj CVoidPointer, name string, val AVRational, searchFlags int32) int32 {
namePtr, nameFunc := StringCasting(name) namePtr, nameFunc := StringCasting(name)
defer nameFunc() defer nameFunc()
return (int32)(C.av_opt_set_q(VoidPointer(obj), (*C.char)(namePtr), (C.struct_AVRational)(val), (C.int)(searchFlags))) return (int32)(C.av_opt_set_q(VoidPointer(obj), (*C.char)(namePtr),
(C.struct_AVRational)(val), (C.int)(searchFlags)))
} }
// AvOptSetBin // AvOptSetBin
func AvOptSetBin(obj CVoidPointer, name string, val *uint8, size int32, searchFlags int32) int32 { func AvOptSetBin[U any, V Integer](obj CVoidPointer, name string, val *U, size V, searchFlags int32) int32 {
namePtr, nameFunc := StringCasting(name) namePtr, nameFunc := StringCasting(name)
defer nameFunc() defer nameFunc()
return (int32)(C.av_opt_set_bin(VoidPointer(obj), (*C.char)(namePtr), (*C.uint8_t)(val), (C.int)(size), (C.int)(searchFlags))) return (int32)(C.av_opt_set_bin(VoidPointer(obj), (*C.char)(namePtr),
(*C.uint8_t)(unsafe.Pointer(val)), (C.int)(size), (C.int)(searchFlags)))
} }
// AvOptSetImageSize // AvOptSetImageSize
func AvOptSetImageSize(obj CVoidPointer, name string, w, h int32, searchFlags int32) int32 { func AvOptSetImageSize(obj CVoidPointer, name string, w, h int32, searchFlags int32) int32 {
namePtr, nameFunc := StringCasting(name) namePtr, nameFunc := StringCasting(name)
defer nameFunc() defer nameFunc()
return (int32)(C.av_opt_set_image_size(VoidPointer(obj), (*C.char)(namePtr), (C.int)(w), (C.int)(h), (C.int)(searchFlags))) return (int32)(C.av_opt_set_image_size(VoidPointer(obj), (*C.char)(namePtr),
(C.int)(w), (C.int)(h), (C.int)(searchFlags)))
} }
// AvOptSetPixelFmt // AvOptSetPixelFmt
func AvOptSetPixelFmt(obj CVoidPointer, name string, fmt AVPixelFormat, searchFlags int32) int32 { func AvOptSetPixelFmt(obj CVoidPointer, name string, fmt AVPixelFormat, searchFlags int32) int32 {
namePtr, nameFunc := StringCasting(name) namePtr, nameFunc := StringCasting(name)
defer nameFunc() defer nameFunc()
return (int32)(C.av_opt_set_pixel_fmt(VoidPointer(obj), (*C.char)(namePtr), (C.enum_AVPixelFormat)(fmt), (C.int)(searchFlags))) return (int32)(C.av_opt_set_pixel_fmt(VoidPointer(obj), (*C.char)(namePtr),
(C.enum_AVPixelFormat)(fmt), (C.int)(searchFlags)))
} }
// AvOptSetSampleFmt // AvOptSetSampleFmt
func AvOptSetSampleFmt(obj CVoidPointer, name string, fmt AVSampleFormat, searchFlags int32) int32 { func AvOptSetSampleFmt(obj CVoidPointer, name string, fmt AVSampleFormat, searchFlags int32) int32 {
namePtr, nameFunc := StringCasting(name) namePtr, nameFunc := StringCasting(name)
defer nameFunc() defer nameFunc()
return (int32)(C.av_opt_set_sample_fmt(VoidPointer(obj), (*C.char)(namePtr), (C.enum_AVSampleFormat)(fmt), (C.int)(searchFlags))) return (int32)(C.av_opt_set_sample_fmt(VoidPointer(obj), (*C.char)(namePtr),
(C.enum_AVSampleFormat)(fmt), (C.int)(searchFlags)))
} }
// AvOptSetVideoRate // AvOptSetVideoRate
func AvOptSetVideoRate(obj CVoidPointer, name string, val AVRational, searchFlags int32) int32 { func AvOptSetVideoRate(obj CVoidPointer, name string, val AVRational, searchFlags int32) int32 {
namePtr, nameFunc := StringCasting(name) namePtr, nameFunc := StringCasting(name)
defer nameFunc() defer nameFunc()
return (int32)(C.av_opt_set_video_rate(VoidPointer(obj), (*C.char)(namePtr), (C.struct_AVRational)(val), (C.int)(searchFlags))) return (int32)(C.av_opt_set_video_rate(VoidPointer(obj), (*C.char)(namePtr),
(C.struct_AVRational)(val), (C.int)(searchFlags)))
} }
// AvOptSetChannelLayout // AvOptSetChannelLayout
func AvOptSetChannelLayout(obj CVoidPointer, name string, chLayout int64, searchFlags int32) int32 { func AvOptSetChannelLayout(obj CVoidPointer, name string, chLayout int64, searchFlags int32) int32 {
namePtr, nameFunc := StringCasting(name) namePtr, nameFunc := StringCasting(name)
defer nameFunc() defer nameFunc()
return (int32)(C.av_opt_set_channel_layout(VoidPointer(obj), (*C.char)(namePtr), (C.int64_t)(chLayout), (C.int)(searchFlags))) return (int32)(C.av_opt_set_channel_layout(VoidPointer(obj), (*C.char)(namePtr),
(C.int64_t)(chLayout), (C.int)(searchFlags)))
} }
// AvOptSetDictVal // AvOptSetDictVal
func AvOptSetDictVal(obj CVoidPointer, name string, val *AVDictionary, searchFlags int32) int32 { func AvOptSetDictVal(obj CVoidPointer, name string, val *AVDictionary, searchFlags int32) int32 {
namePtr, nameFunc := StringCasting(name) namePtr, nameFunc := StringCasting(name)
defer nameFunc() defer nameFunc()
return (int32)(C.av_opt_set_dict_val(VoidPointer(obj), (*C.char)(namePtr), (*C.struct_AVDictionary)(val), (C.int)(searchFlags))) return (int32)(C.av_opt_set_dict_val(VoidPointer(obj), (*C.char)(namePtr),
(*C.struct_AVDictionary)(val), (C.int)(searchFlags)))
} }
// AvOptSetIntList sets a binary option to an integer list. // AvOptSetIntList sets a binary option to an integer list.
@@ -621,64 +636,72 @@ func AvOptGet(obj CVoidPointer, name string, searchFlags int32, outVal **uint8)
func AvOptGetInt(obj CVoidPointer, name string, searchFlags int32, outVal *int64) int32 { func AvOptGetInt(obj CVoidPointer, name string, searchFlags int32, outVal *int64) int32 {
namePtr, nameFunc := StringCasting(name) namePtr, nameFunc := StringCasting(name)
defer nameFunc() defer nameFunc()
return (int32)(C.av_opt_get_int(VoidPointer(obj), (*C.char)(namePtr), (C.int)(searchFlags), (*C.int64_t)(outVal))) return (int32)(C.av_opt_get_int(VoidPointer(obj), (*C.char)(namePtr),
(C.int)(searchFlags), (*C.int64_t)(outVal)))
} }
// AvOptGetDouble // AvOptGetDouble
func AvOptGetDouble(obj CVoidPointer, name string, searchFlags int32, outVal *float64) int32 { func AvOptGetDouble(obj CVoidPointer, name string, searchFlags int32, outVal *float64) int32 {
namePtr, nameFunc := StringCasting(name) namePtr, nameFunc := StringCasting(name)
defer nameFunc() defer nameFunc()
return (int32)(C.av_opt_get_double(VoidPointer(obj), (*C.char)(namePtr), (C.int)(searchFlags), (*C.double)(outVal))) return (int32)(C.av_opt_get_double(VoidPointer(obj), (*C.char)(namePtr),
(C.int)(searchFlags), (*C.double)(outVal)))
} }
// AvOptGetQ // AvOptGetQ
func AvOptGetQ(obj CVoidPointer, name string, searchFlags int32, outVal *AVRational) int32 { func AvOptGetQ(obj CVoidPointer, name string, searchFlags int32, outVal *AVRational) int32 {
namePtr, nameFunc := StringCasting(name) namePtr, nameFunc := StringCasting(name)
defer nameFunc() defer nameFunc()
return (int32)(C.av_opt_get_q(VoidPointer(obj), (*C.char)(namePtr), (C.int)(searchFlags), (*C.struct_AVRational)(outVal))) return (int32)(C.av_opt_get_q(VoidPointer(obj), (*C.char)(namePtr),
(C.int)(searchFlags), (*C.struct_AVRational)(outVal)))
} }
// AvOptGetImageSize // AvOptGetImageSize
func AvOptGetImageSize(obj CVoidPointer, name string, searchFlags int32, wOut, hOut *int32) int32 { func AvOptGetImageSize(obj CVoidPointer, name string, searchFlags int32, wOut, hOut *int32) int32 {
namePtr, nameFunc := StringCasting(name) namePtr, nameFunc := StringCasting(name)
defer nameFunc() defer nameFunc()
return (int32)(C.av_opt_get_image_size(VoidPointer(obj), (*C.char)(namePtr), (C.int)(searchFlags), (*C.int)(wOut), (*C.int)(hOut))) return (int32)(C.av_opt_get_image_size(VoidPointer(obj), (*C.char)(namePtr),
(C.int)(searchFlags), (*C.int)(wOut), (*C.int)(hOut)))
} }
// AvOptGetPixelFmt // AvOptGetPixelFmt
func AvOptGetPixelFmt(obj CVoidPointer, name string, searchFlags int32, outFmt *AVPixelFormat) int32 { func AvOptGetPixelFmt(obj CVoidPointer, name string, searchFlags int32, outFmt *AVPixelFormat) int32 {
namePtr, nameFunc := StringCasting(name) namePtr, nameFunc := StringCasting(name)
defer nameFunc() defer nameFunc()
return (int32)(C.av_opt_get_pixel_fmt(VoidPointer(obj), (*C.char)(namePtr), (C.int)(searchFlags), (*C.enum_AVPixelFormat)(outFmt))) return (int32)(C.av_opt_get_pixel_fmt(VoidPointer(obj), (*C.char)(namePtr),
(C.int)(searchFlags), (*C.enum_AVPixelFormat)(outFmt)))
} }
// AvOptGetSampleFmt // AvOptGetSampleFmt
func AvOptGetSampleFmt(obj CVoidPointer, name string, searchFlags int32, outFmt *AVSampleFormat) int32 { func AvOptGetSampleFmt(obj CVoidPointer, name string, searchFlags int32, outFmt *AVSampleFormat) int32 {
namePtr, nameFunc := StringCasting(name) namePtr, nameFunc := StringCasting(name)
defer nameFunc() defer nameFunc()
return (int32)(C.av_opt_get_sample_fmt(VoidPointer(obj), (*C.char)(namePtr), (C.int)(searchFlags), (*C.enum_AVSampleFormat)(outFmt))) return (int32)(C.av_opt_get_sample_fmt(VoidPointer(obj), (*C.char)(namePtr),
(C.int)(searchFlags), (*C.enum_AVSampleFormat)(outFmt)))
} }
// AvOptGetVideoRate // AvOptGetVideoRate
func AvOptGetVideoRate(obj CVoidPointer, name string, searchFlags int32, outVal *AVRational) int32 { func AvOptGetVideoRate(obj CVoidPointer, name string, searchFlags int32, outVal *AVRational) int32 {
namePtr, nameFunc := StringCasting(name) namePtr, nameFunc := StringCasting(name)
defer nameFunc() defer nameFunc()
return (int32)(C.av_opt_get_video_rate(VoidPointer(obj), (*C.char)(namePtr), (C.int)(searchFlags), (*C.struct_AVRational)(outVal))) return (int32)(C.av_opt_get_video_rate(VoidPointer(obj), (*C.char)(namePtr),
(C.int)(searchFlags), (*C.struct_AVRational)(outVal)))
} }
// AvOptGetChannelLayout // AvOptGetChannelLayout
func AvOptGetChannelLayout(obj CVoidPointer, name string, searchFlags int32, outVal *int64) int32 { func AvOptGetChannelLayout(obj CVoidPointer, name string, searchFlags int32, outVal *int64) int32 {
namePtr, nameFunc := StringCasting(name) namePtr, nameFunc := StringCasting(name)
defer nameFunc() defer nameFunc()
return (int32)(C.av_opt_get_channel_layout(VoidPointer(obj), (*C.char)(namePtr), (C.int)(searchFlags), (*C.int64_t)(outVal))) return (int32)(C.av_opt_get_channel_layout(VoidPointer(obj), (*C.char)(namePtr),
(C.int)(searchFlags), (*C.int64_t)(outVal)))
} }
// AvOptGetDictVal // AvOptGetDictVal
func AvOptGetDictVal(obj CVoidPointer, name string, searchFlags int32, outVal **AVDictionary) int32 { func AvOptGetDictVal(obj CVoidPointer, name string, searchFlags int32, outVal **AVDictionary) int32 {
namePtr, nameFunc := StringCasting(name) namePtr, nameFunc := StringCasting(name)
defer nameFunc() defer nameFunc()
return (int32)(C.av_opt_get_dict_val(VoidPointer(obj), (*C.char)(namePtr), (C.int)(searchFlags), return (int32)(C.av_opt_get_dict_val(VoidPointer(obj), (*C.char)(namePtr),
(**C.struct_AVDictionary)(unsafe.Pointer(outVal)))) (C.int)(searchFlags), (**C.struct_AVDictionary)(unsafe.Pointer(outVal))))
} }
// AvOptPtr gets a pointer to the requested field in a struct. // AvOptPtr gets a pointer to the requested field in a struct.

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2023 QRTC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package ffmpeg package ffmpeg
/* /*

Some files were not shown because too many files have changed in this diff Show More