diff options
author | Anton Khirnov <anton@khirnov.net> | 2022-07-16 16:36:23 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2022-08-02 10:46:11 +0200 |
commit | e3838b856f3cfa0a85db0bf427a0f733110c5158 (patch) | |
tree | f999c1f000992123e85a5857e9b111862f8a3c03 /libavcodec/avcodec.h | |
parent | eede1d2927db18b962741e6a09ec1401fdad6277 (diff) | |
download | ffmpeg-e3838b856f3cfa0a85db0bf427a0f733110c5158.tar.gz |
lavc: add API for exporting reconstructed frames from encoders
Diffstat (limited to 'libavcodec/avcodec.h')
-rw-r--r-- | libavcodec/avcodec.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 60b215d2e9..bfd00ec493 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -232,6 +232,16 @@ typedef struct RcOverride{ */ #define AV_CODEC_FLAG_DROPCHANGED (1 << 5) /** + * Request the encoder to output reconstructed frames, i.e. frames that would be + * produced by decoding the encoded bistream. These frames may be retrieved by + * calling avcodec_receive_frame() immediately after a successful call to + * avcodec_receive_packet(). + * + * Should only be used with encoders flagged with the + * AV_CODEC_CAP_ENCODER_RECON_FRAME capability. + */ +#define AV_CODEC_FLAG_RECON_FRAME (1 << 6) +/** * Use internal 2pass ratecontrol in first pass mode. */ #define AV_CODEC_FLAG_PASS1 (1 << 9) @@ -2601,21 +2611,23 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, int avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt); /** - * Return decoded output data from a decoder. + * Return decoded output data from a decoder or encoder (when the + * AV_CODEC_FLAG_RECON_FRAME flag is used). * * @param avctx codec context * @param frame This will be set to a reference-counted video or audio * frame (depending on the decoder type) allocated by the - * decoder. Note that the function will always call + * codec. Note that the function will always call * av_frame_unref(frame) before doing anything else. * * @return * 0: success, a frame was returned * AVERROR(EAGAIN): output is not available in this state - user must try * to send new input - * AVERROR_EOF: the decoder has been fully flushed, and there will be + * AVERROR_EOF: the codec has been fully flushed, and there will be * no more output frames - * AVERROR(EINVAL): codec not opened, or it is an encoder + * AVERROR(EINVAL): codec not opened, or it is an encoder without + * the AV_CODEC_FLAG_RECON_FRAME flag enabled * AVERROR_INPUT_CHANGED: current decoded frame has changed parameters * with respect to first decoded frame. Applicable * when flag AV_CODEC_FLAG_DROPCHANGED is set. |