mirror of
https://github.com/qrtc/ffmpeg-dev-go.git
synced 2025-10-08 00:51:20 +08:00
2023-10-22 11:46:19 CST W43D0
This commit is contained in:
26
avutil_base64.go
Normal file
26
avutil_base64.go
Normal 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
|
||||
}
|
Reference in New Issue
Block a user