33 printf(
"Testing av_tdrdi_alloc()\n");
36 printf(
"alloc 1: size>0=%s, num_ref_displays=%u\n",
41 if ((uint8_t *)display != (uint8_t *)tdrdi + tdrdi->
entries_offset)
42 printf(
"display 0: pointer inconsistent with entries_offset\n");
50 printf(
"display 0: width_exp=%u width_man=%u left=%u right=%u\n",
58 printf(
"\nTesting multiple displays\n");
62 for (
int i = 0;
i < 3;
i++) {
65 if ((uint8_t *)display != (uint8_t *)tdrdi + tdrdi->
entries_offset +
67 printf(
"display %d: pointer inconsistent\n",
i);
70 for (
int i = 0;
i < 3;
i++) {
72 printf(
"display %d: width_exp=%u\n",
i,
80 printf(
"\nalloc (no size): %s\n", tdrdi ?
"OK" :
"FAIL");
84 printf(
"\nTesting OOM paths\n");
87 printf(
"alloc OOM: %s\n", tdrdi ?
"FAIL" :
"OK");
#define i(width, name, range_min, range_max)
__device__ int printf(const char *,...)
void av_max_alloc(size_t max)
Set the maximum size that may be allocated in one block.
AV3DReferenceDisplaysInfo * av_tdrdi_alloc(unsigned int nb_displays, size_t *out_size)
Allocate a AV3DReferenceDisplaysInfo structure and initialize its fields to default values.
static av_always_inline AV3DReferenceDisplay * av_tdrdi_get_display(AV3DReferenceDisplaysInfo *tdrdi, unsigned int idx)
Memory handling functions.
Data structure for single deference display information.
uint16_t left_view_id
The ViewId of the left view of a stereo pair corresponding to the n-th reference display.
uint8_t mantissa_ref_display_width
The mantissa part of the reference display width of the n-th reference display.
uint8_t exponent_ref_display_width
The exponent part of the reference display width of the n-th reference display.
uint16_t right_view_id
The ViewId of the left view of a stereo pair corresponding to the n-th reference display.
This structure describes information about the reference display width(s) and reference viewing dista...
size_t entry_size
Size of each entry in bytes.
uint8_t num_ref_displays
The number of reference displays that are signalled in this struct.
size_t entries_offset
Offset in bytes from the beginning of this structure at which the array of reference displays starts.