mirror of
https://github.com/qrtc/ffmpeg-dev-go.git
synced 2025-09-26 20:01:22 +08:00
21 lines
573 B
Go
21 lines
573 B
Go
// 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
|
|
|
|
/*
|
|
#include <libavutil/random_seed.h>
|
|
*/
|
|
import "C"
|
|
|
|
// AvGetRandomSeed gets a seed to use in conjunction with random functions.
|
|
func AvGetRandomSeed() uint32 {
|
|
return (uint32)(C.av_get_random_seed())
|
|
}
|
|
|
|
// AvRandomBytes gets a seed to use in conjunction with random functions.
|
|
func AvRandomBytes[T Integer](buf *uint8, len T) int32 {
|
|
return (int32)(C.av_random_bytes((*C.uint8_t)(buf), (C.size_t)(len)))
|
|
}
|