diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-08-04 11:59:16 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2023-10-07 22:35:05 +0200 |
commit | 3e9b8d14e5d0df72765a1c9ca683c9d0f1d51e1a (patch) | |
tree | fd1b7cbc5358212171beb26f98e21cc0bf02216e /libavcodec/cbs_h264.h | |
parent | 56dd585146288070c98a9429ae85dc3551940a4b (diff) | |
download | ffmpeg-3e9b8d14e5d0df72765a1c9ca683c9d0f1d51e1a.tar.gz |
avcodec/cbs: Use RefStruct-API for unit content
This avoids allocations and error checks etc. as well
as duplicate pointer lists in the CodedBitstreamFooContexts.
It also avoids casting const away for use as opaque,
as the RefStruct API supports const opaques.
The fact that some of the units are not refcounted
(i.e. they are sometimes part of an encoding context
like VAAPIEncodeH264Context) meant that CodedBitstreamUnit
still contains two pointers, one to the content
and another ownership pointer, replacing the AVBufferRef* pointer.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/cbs_h264.h')
-rw-r--r-- | libavcodec/cbs_h264.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libavcodec/cbs_h264.h b/libavcodec/cbs_h264.h index ca9b688c05..db91231337 100644 --- a/libavcodec/cbs_h264.h +++ b/libavcodec/cbs_h264.h @@ -407,10 +407,8 @@ typedef struct CodedBitstreamH264Context { // All currently available parameter sets. These are updated when // any parameter set NAL unit is read/written with this context. - AVBufferRef *sps_ref[H264_MAX_SPS_COUNT]; - AVBufferRef *pps_ref[H264_MAX_PPS_COUNT]; - H264RawSPS *sps[H264_MAX_SPS_COUNT]; - H264RawPPS *pps[H264_MAX_PPS_COUNT]; + H264RawSPS *sps[H264_MAX_SPS_COUNT]; ///< RefStruct references + H264RawPPS *pps[H264_MAX_PPS_COUNT]; ///< RefStruct references // The currently active parameter sets. These are updated when any // NAL unit refers to the relevant parameter set. These pointers |