X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Favcodec.h;h=5bff631a6a44234efbb6d310b50801a3740ab81e;hb=7538ad22483597ede7c5dad452896762277c3f4f;hp=94d4cf06eec5b2496f51eb382083a62ae11298bd;hpb=d7ade20adb71267572b12e11c5292e3363077ae2;p=ffmpeg diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 94d4cf06eec..5bff631a6a4 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -1052,6 +1052,15 @@ enum AVPacketSideDataType { */ AV_PKT_DATA_REPLAYGAIN, + /** + * This side data contains a 3x3 transformation matrix describing an affine + * transformation that needs to be applied to the decoded video frames for + * correct presentation. + * + * See libavutil/display.h for a detailed description of the data. + */ + AV_PKT_DATA_DISPLAYMATRIX, + /** * Recommmends skipping the specified number of samples * @code @@ -2556,6 +2565,7 @@ typedef struct AVCodecContext { int error_concealment; #define FF_EC_GUESS_MVS 1 #define FF_EC_DEBLOCK 2 +#define FF_EC_FAVOR_INTER 256 /** * debug @@ -3233,8 +3243,20 @@ typedef struct AVHWAccel { */ int capabilities; + /***************************************************************** + * No fields below this line are part of the public API. They + * may not be used outside of libavcodec and can be changed and + * removed at will. + * New public fields should be added right above. + ***************************************************************** + */ struct AVHWAccel *next; + /** + * Allocate a custom buffer + */ + int (*alloc_frame)(AVCodecContext *avctx, AVFrame *frame); + /** * Called at the beginning of each frame or field picture. * @@ -3277,13 +3299,13 @@ typedef struct AVHWAccel { int (*end_frame)(AVCodecContext *avctx); /** - * Size of HW accelerator private data. + * Size of per-frame hardware accelerator private data. * * Private data is allocated with av_mallocz() before * AVCodecContext.get_buffer() and deallocated after * AVCodecContext.release_buffer(). */ - int priv_data_size; + int frame_priv_data_size; /** * Called for every Macroblock in a slice. @@ -3295,6 +3317,29 @@ typedef struct AVHWAccel { * @param s the mpeg context */ void (*decode_mb)(struct MpegEncContext *s); + + /** + * Initialize the hwaccel private data. + * + * This will be called from ff_get_format(), after hwaccel and + * hwaccel_context are set and the hwaccel private data in AVCodecInternal + * is allocated. + */ + int (*init)(AVCodecContext *avctx); + + /** + * Uninitialize the hwaccel private data. + * + * This will be called from get_format() or avcodec_close(), after hwaccel + * and hwaccel_context are already uninitialized. + */ + int (*uninit)(AVCodecContext *avctx); + + /** + * Size of the private data to allocate in + * AVCodecInternal.hwaccel_priv_data. + */ + int priv_data_size; } AVHWAccel; /** @@ -3419,9 +3464,8 @@ void avcodec_register(AVCodec *codec); void avcodec_register_all(void); /** - * Allocate an AVCodecContext and set its fields to default values. The - * resulting struct can be deallocated by calling avcodec_close() on it followed - * by av_free(). + * Allocate an AVCodecContext and set its fields to default values. The + * resulting struct should be freed with avcodec_free_context(). * * @param codec if non-NULL, allocate private data and initialize defaults * for the given codec. It is illegal to then call avcodec_open2() @@ -3435,6 +3479,12 @@ void avcodec_register_all(void); */ AVCodecContext *avcodec_alloc_context3(const AVCodec *codec); +/** + * Free the codec context and everything associated with it and write NULL to + * the provided pointer. + */ +void avcodec_free_context(AVCodecContext **avctx); + /** * Set the fields of the given AVCodecContext to default values corresponding * to the given codec (defaults may be codec-dependent).