diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2023-09-13 21:32:28 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2023-10-07 22:36:21 +0200 |
commit | c7fb4d0eb6bd6f5c3dd80c9784cb530b9581ce26 (patch) | |
tree | 0b6dd182162182e33b937b8c4bcaf886fcc28941 /libavcodec/nvdec.h | |
parent | 2ec62b1ca60cf7e387412ae0e651a86aac62e75b (diff) | |
download | ffmpeg-c7fb4d0eb6bd6f5c3dd80c9784cb530b9581ce26.tar.gz |
avcodec/nvdec: Use RefStruct API for decoder_ref
Avoids allocations and error checks as well as the boilerplate
code for creating an AVBuffer with a custom free callback.
Also increases type safety.
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Tested-by: Timo Rothenpieler <timo@rothenpieler.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/nvdec.h')
-rw-r--r-- | libavcodec/nvdec.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/nvdec.h b/libavcodec/nvdec.h index 66f3ca59e7..efacb5b691 100644 --- a/libavcodec/nvdec.h +++ b/libavcodec/nvdec.h @@ -46,7 +46,7 @@ typedef struct NVDECFrame { unsigned int ref_idx; AVBufferRef *idx_ref; AVBufferRef *ref_idx_ref; - AVBufferRef *decoder_ref; + struct NVDECDecoder *decoder; ///< RefStruct reference } NVDECFrame; typedef struct NVDECContext { @@ -54,7 +54,7 @@ typedef struct NVDECContext { AVBufferPool *decoder_pool; - AVBufferRef *decoder_ref; + struct NVDECDecoder *decoder; ///< RefStruct reference uint8_t *bitstream; int bitstream_len; |