[FFmpeg-cvslog] decode: add a per-frame private data for hwaccel use
Anton Khirnov
git at videolan.org
Fri Nov 10 20:48:27 EET 2017
ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Fri Oct 13 18:59:19 2017 +0200| [81c021c6a2d7848c31984d65f225ba54bdd6f560] | committer: Timo Rothenpieler
decode: add a per-frame private data for hwaccel use
This will be useful in the CUVID hwaccel. It should also eventually
replace current decoder-specific mechanisms used by various other
hwaccels.
Merges Libav commit 704311b2946d74a80f65906961cd9baaa18683a3.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=81c021c6a2d7848c31984d65f225ba54bdd6f560
---
libavcodec/decode.c | 3 +++
libavcodec/decode.h | 6 ++++++
2 files changed, 9 insertions(+)
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 8b03f61a22..44b874d4f8 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1581,6 +1581,9 @@ static void decode_data_free(void *opaque, uint8_t *data)
if (fdd->post_process_opaque_free)
fdd->post_process_opaque_free(fdd->post_process_opaque);
+ if (fdd->hwaccel_priv_free)
+ fdd->hwaccel_priv_free(fdd->hwaccel_priv);
+
av_freep(&fdd);
}
diff --git a/libavcodec/decode.h b/libavcodec/decode.h
index 51947b9ec0..03fc783bba 100644
--- a/libavcodec/decode.h
+++ b/libavcodec/decode.h
@@ -44,6 +44,12 @@ typedef struct FrameDecodeData {
int (*post_process)(void *logctx, AVFrame *frame);
void *post_process_opaque;
void (*post_process_opaque_free)(void *opaque);
+
+ /**
+ * Per-frame private data for hwaccels.
+ */
+ void *hwaccel_priv;
+ void (*hwaccel_priv_free)(void *priv);
} FrameDecodeData;
/**
More information about the ffmpeg-cvslog
mailing list