2023-10-22 11:46:19 CST W43D0

This commit is contained in:
aggresss
2023-10-22 11:46:19 +08:00
parent 0f95831c39
commit e163918619
62 changed files with 2326 additions and 355 deletions

26
avutil_base64.go Normal file
View File

@@ -0,0 +1,26 @@
package ffmpeg
/*
#include <libavutil/base64.h>
*/
import "C"
// AvBase64Decode decodes a base64-encoded string.
func AvBase64Decode(out *uint8, in *int8, outSize int32) int32 {
return (int32)(C.av_base64_decode((*C.uint8_t)(out), (*C.char)(in), (C.int)(outSize)))
}
// AV_BASE64_DECODE_SIZE
func AV_BASE64_DECODE_SIZE[T HelperInteger](x T) T {
return x * 3 / 4
}
// AvBase64Encode encodes data to base64 and null-terminate.
func AvBase64Encode(out *int8, outSize int32, in *uint8, inSize int32) *int8 {
return (*int8)(C.av_base64_encode((*C.char)(out), (C.int)(outSize), (*C.uint8_t)(in), (C.int)(inSize)))
}
// AV_BASE64_SIZE
func AV_BASE64_SIZE[T HelperInteger](x T) T {
return (x+2)/3*4 + 1
}