On Tue, Jul 30, 2019 at 10:49:00AM -0700, Juan De León wrote: > On Mon, Jul 29, 2019 at 7:59 PM James Almer <jamr...@gmail.com> wrote: > > > Side data, or more specifically, any AVBufferRef, must be a flat array. > > You can't have pointers to some other allocated buffer within them since > > you can't really control their lifetime. > > > Here's a snippet of how I'm doing it right now: > // mb_xy = number of blocks in the frame > size_t buf_size = sizeof(AVQuantizationParamsArray) + mb_xy * > sizeof(AVQuantizationParams); > AVBufferRef *buffer = av_buffer_alloc(buf_size); > AVQuantizationParamsArray *params = (AVQuantizationParamsArray > *)buffer->data; > > // offset memory for qp_block_array in same buffer > params->qp_block_array = (AVQuantizationParams*) (params + 1);
iam not sure this is safe, it would be better if there are no pointers. This would break if the AVQuantizationParamsArray is moved in memory or cloned and the orginal freed or cloned and the clone changed with the expextiaiion that the original stays unchanged thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB You can kill me, but you cannot change the truth.
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".