Go to the documentation of this file.
36 #include <openssl/rand.h>
62 setvbuf(
fp,
NULL, _IONBF, 0);
63 err = fread(dst, 1,
len,
fp);
82 static uint64_t
i = 0;
83 static uint32_t
buffer[512] = { 0 };
84 unsigned char digest[20];
101 if (last_t + 2*last_td + (CLOCKS_PER_SEC > 1000) >= t) {
102 last_td = t - last_t;
103 buffer[
i & 511] = 1664525*
buffer[
i & 511] + 1013904223 + (last_td % 3294638521
U);
105 last_td = t - last_t;
106 buffer[++
i & 511] += last_td % 3294638521
U;
107 if ((t - init_t) >= CLOCKS_PER_SEC>>5)
108 if (last_i &&
i - last_i > 4 ||
i - last_i > 64 ||
TEST &&
i - last_i > 8)
135 BCRYPT_ALG_HANDLE algo_handle;
136 NTSTATUS
ret = BCryptOpenAlgorithmProvider(&algo_handle, BCRYPT_RNG_ALGORITHM,
137 MS_PRIMITIVE_PROVIDER, 0);
138 if (BCRYPT_SUCCESS(
ret)) {
139 NTSTATUS
ret = BCryptGenRandom(algo_handle, (PUCHAR)buf,
len, 0);
140 BCryptCloseAlgorithmProvider(algo_handle, 0);
141 if (BCRYPT_SUCCESS(
ret))
146 #if HAVE_ARC4RANDOM_BUF
147 arc4random_buf(buf,
len);
156 gcry_randomize(buf,
len, GCRY_VERY_STRONG_RANDOM);
159 if (RAND_bytes(buf,
len) == 1)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
av_cold int av_sha_init(AVSHA *ctx, int bits)
Initialize SHA-1 or SHA-2 hashing.
#define AVERROR_UNKNOWN
Unknown error, typically from an external library.
uint32_t av_get_random_seed(void)
Get a seed to use in conjunction with random functions.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
void av_sha_final(AVSHA *ctx, uint8_t *digest)
Finish hashing and output digest value.
void av_sha_update(struct AVSHA *ctx, const uint8_t *data, size_t len)
Update hash value.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_RB32
#define AVERROR_EXTERNAL
Generic error in an external library.
#define i(width, name, range_min, range_max)
int av_random_bytes(uint8_t *buf, size_t len)
Generate cryptographically secure random data, i.e.
FILE * avpriv_fopen_utf8(const char *path, const char *mode)
Open a file using a UTF-8 filename.
the frame and frame reference mechanism is intended to as much as expensive copies of that data while still allowing the filters to produce correct results The data is stored in buffers represented by AVFrame structures Several references can point to the same frame buffer
static uint32_t get_generic_seed(void)
static int read_random(uint8_t *dst, size_t len, const char *file)