FFmpeg
Functions
video_hint.c File Reference
#include <string.h>
#include "avstring.h"
#include "frame.h"
#include "macros.h"
#include "mem.h"
#include "video_hint.h"

Go to the source code of this file.

Functions

AVVideoHintav_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. More...
 
AVVideoHintav_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_FRAME_DATA_VIDEO_HINT_INFO to frame. More...
 

Function Documentation

◆ av_video_hint_alloc()

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.

The side data contains a list of rectangles for the portions of the frame which changed from the last encoded one (and the remainder are assumed to be changed), or, alternately (depending on the type parameter) the unchanged ones (and the remanining ones are those which changed). Macroblocks will thus be hinted either to be P_SKIP-ped or go through the regular encoding procedure.

It's responsibility of the caller to fill the AVRects accordingly, and to set the proper AVVideoHintType field.

Parameters
out_sizeif non-NULL, the size in bytes of the resulting data array is written here
Returns
newly allocated AVVideoHint struct (must be freed by the caller using av_free()) on success, NULL on memory allocation failure

Definition at line 29 of file video_hint.c.

Referenced by av_video_hint_create_side_data().

◆ av_video_hint_create_side_data()

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_FRAME_DATA_VIDEO_HINT_INFO to frame.

Definition at line 58 of file video_hint.c.