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_aes.go Normal file
View File

@@ -0,0 +1,26 @@
package ffmpeg
/*
#include <libavutil/aes.h>
*/
import "C"
// AVAES
type AVAES C.struct_AVAES
// AvAesAlloc allocates an AVAES context.
func AvAesAlloc() *AVAES {
return (*AVAES)(C.av_aes_alloc())
}
// AvAesInit initializes an AVAES context.
func AvAesInit(a *AVAES, key *uint8, keyBits, decrypt int32) int32 {
return (int32)(C.av_aes_init((*C.struct_AVAES)(a), (*C.uint8_t)(key),
(C.int)(keyBits), (C.int)(decrypt)))
}
// AvAesCrypt encrypts or decrypts a buffer using a previously initialized context.
func AvAesCrypt(a *AVAES, dst, src *uint8, count int32, iv *uint8, decrypt int32) {
C.av_aes_crypt((*C.struct_AVAES)(a), (*C.uint8_t)(dst), (*C.uint8_t)(src),
(C.int)(count), (*C.uint8_t)(iv), (C.int)(decrypt))
}