Go to the documentation of this file.
35 static const unsigned int alloc_counts[] = { 0, 1, 4 };
38 printf(
"Testing av_detection_bbox_alloc()\n");
40 unsigned int nb = alloc_counts[
i];
43 printf(
"alloc %u: OK, nb=%u, size>0=%s\n",
44 nb,
header->nb_bboxes,
size > 0 ?
"yes" :
"no");
47 printf(
"alloc %u: FAIL\n", nb);
57 printf(
"\nTesting av_get_detection_bbox()\n");
60 for (
int i = 0;
i < 3;
i++) {
62 if ((uint8_t *)bbox != (uint8_t *)
header +
header->bboxes_offset +
64 printf(
"bbox %d: pointer inconsistent with bboxes_offset/bbox_size\n",
i);
73 for (
int i = 0;
i < 3;
i++) {
75 printf(
"bbox %d: x=%d y=%d w=%d h=%d label=%s conf=%d/%d\n",
76 i, bbox->
x, bbox->
y, bbox->
w, bbox->
h,
85 printf(
"\nTesting classify fields\n");
98 printf(
"classify %d: %s %d/%d\n",
i,
106 printf(
"\nTesting source field\n");
115 printf(
"\nTesting av_detection_bbox_create_side_data()\n");
124 printf(
"side_data bbox 0: x=%d y=%d\n", bbox->
x, bbox->
y);
126 printf(
"side_data: FAIL\n");
__device__ int printf(const char *,...)
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
This structure describes decoded (raw) audio or video data.
char detect_label[AV_DETECTION_BBOX_LABEL_NAME_MAX_SIZE]
Detect result with confidence.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
static av_always_inline AVDetectionBBox * av_get_detection_bbox(const AVDetectionBBoxHeader *header, unsigned int idx)
#define FF_ARRAY_ELEMS(a)
AVRational classify_confidences[AV_NUM_DETECTION_BBOX_CLASSIFY]
Rational number (pair of numerator and denominator).
char classify_labels[AV_NUM_DETECTION_BBOX_CLASSIFY][AV_DETECTION_BBOX_LABEL_NAME_MAX_SIZE]
AVDetectionBBoxHeader * av_detection_bbox_create_side_data(AVFrame *frame, uint32_t nb_bboxes)
Allocates memory for AVDetectionBBoxHeader, plus an array of.
#define i(width, name, range_min, range_max)
static const uint8_t header[24]
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
AVRational detect_confidence
int x
Distance in pixels from the left/top edge of the frame, together with width and height,...
AVDetectionBBoxHeader * av_detection_bbox_alloc(uint32_t nb_bboxes, size_t *out_size)
Allocates memory for AVDetectionBBoxHeader, plus an array of.