From 7fc329e2dd6226dfecaa4a1d7adf353bf2773726 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 22 Mar 2016 19:09:53 +0100 Subject: lavc: introduce a new decoding/encoding API with decoupled input/output Until now, the decoding API was restricted to outputting 0 or 1 frames per input packet. It also enforces a somewhat rigid dataflow in general. This new API seeks to relax these restrictions by decoupling input and output. Instead of doing a single call on each decode step, which may consume the packet and may produce output, the new API requires the user to send input first, and then ask for output. For now, there are no codecs supporting this API. The API can work with codecs using the old API, and most code added here is to make them interoperate. The reverse is not possible, although for audio it might. From Libav commit 05f66706d182eb0c36af54d72614bf4c33e957a9. Signed-off-by: Anton Khirnov --- libavcodec/internal.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'libavcodec/internal.h') diff --git a/libavcodec/internal.h b/libavcodec/internal.h index 6c0efec8b1..be54471ef6 100644 --- a/libavcodec/internal.h +++ b/libavcodec/internal.h @@ -160,6 +160,19 @@ typedef struct AVCodecInternal { * hwaccel-specific private data */ void *hwaccel_priv_data; + + /** + * checks API usage: after codec draining, flush is required to resume operation + */ + int draining; + + /** + * buffers for using new encode/decode API through legacy API + */ + AVPacket *buffer_pkt; + int buffer_pkt_valid; // encoding: packet without data can be valid + AVFrame *buffer_frame; + int draining_done; } AVCodecInternal; struct AVCodecDefault { -- cgit v1.2.3