mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-12 01:40:04 +01:00
decode: add a mechanism for performing delayed processing on the decoded frames
This will be useful in the CUVID hwaccel.
Merges Libav commit badf0951f5.
This commit is contained in:
committed by
Timo Rothenpieler
parent
9f1cfd88af
commit
7fa64514c8
@@ -620,6 +620,18 @@ static int decode_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame)
|
||||
av_assert0((frame->private_ref && frame->private_ref->size == sizeof(FrameDecodeData)) ||
|
||||
!(avctx->codec->capabilities & AV_CODEC_CAP_DR1));
|
||||
|
||||
if (frame->private_ref) {
|
||||
FrameDecodeData *fdd = (FrameDecodeData*)frame->private_ref->data;
|
||||
|
||||
if (fdd->post_process) {
|
||||
ret = fdd->post_process(avctx, frame);
|
||||
if (ret < 0) {
|
||||
av_frame_unref(frame);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
av_buffer_unref(&frame->private_ref);
|
||||
}
|
||||
|
||||
@@ -1566,6 +1578,9 @@ static void decode_data_free(void *opaque, uint8_t *data)
|
||||
{
|
||||
FrameDecodeData *fdd = (FrameDecodeData*)data;
|
||||
|
||||
if (fdd->post_process_opaque_free)
|
||||
fdd->post_process_opaque_free(fdd->post_process_opaque);
|
||||
|
||||
av_freep(&fdd);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user