35 static const size_t alloc_counts[] = { 0, 1, 4 };
38 printf(
"Testing av_video_hint_alloc()\n");
40 size_t nb = alloc_counts[
i];
43 printf(
"alloc %zu: OK, nb_rects=%zu, size>0=%s\n",
47 printf(
"alloc %zu: FAIL\n", nb);
52 printf(
"\nTesting av_video_hint_get_rect()\n");
58 printf(
"rects: pointer inconsistent with rect_offset\n");
60 for (
int i = 0;
i < 3;
i++) {
64 printf(
"rect %d: pointer inconsistent with rect_offset/rect_size\n",
i);
68 rect->height = 48 +
i;
70 for (
int i = 0;
i < 3;
i++) {
72 printf(
"rect %d: x=%u y=%u w=%u h=%u\n",
80 printf(
"\nTesting type field\n");
91 printf(
"\nTesting av_video_hint_create_side_data()\n");
105 printf(
"side_data: FAIL\n");
111 printf(
"\nTesting OOM paths\n");
114 printf(
"alloc OOM: %s\n", hint ?
"FAIL" :
"OK");
122 printf(
"side_data OOM: %s\n", hint ?
"FAIL" :
"OK");
#define i(width, name, range_min, range_max)
__device__ int printf(const char *,...)
reference-counted frame API
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
void av_max_alloc(size_t max)
Set the maximum size that may be allocated in one block.
Utility Preprocessor macros.
Memory handling functions.
#define FF_ARRAY_ELEMS(a)
This structure describes decoded (raw) audio or video data.
size_t nb_rects
Number of AVVideoRect present.
size_t rect_size
Size in bytes of AVVideoRect.
size_t rect_offset
Offset in bytes from the beginning of this structure at which the array of AVVideoRect starts.
Copyright 2023 Elias Carotti <eliascrt at amazon dot it>
AVVideoHint * av_video_hint_create_side_data(AVFrame *frame, size_t nb_rects)
Same as av_video_hint_alloc(), except newly-allocated AVVideoHint is attached as side data of type AV...
AVVideoHint * av_video_hint_alloc(size_t nb_rects, size_t *out_size)
Allocate memory for the AVVideoHint struct along with an nb_rects-sized arrays of AVVideoRect.
@ AV_VIDEO_HINT_TYPE_CONSTANT
@ AV_VIDEO_HINT_TYPE_CHANGED
static av_always_inline AVVideoRect * av_video_hint_get_rect(const AVVideoHint *hints, size_t idx)
static av_always_inline AVVideoRect * av_video_hint_rects(const AVVideoHint *hints)