[FFmpeg-devel] [PATCH] avformat: add apic to AVStream

Nicolas George george at nsup.org
Mon Mar 29 15:57:41 EEST 2021


James Almer (12021-03-29):
> The idea for attached_pic afaik was that it's always available and easily
> accessible to the user from the start, instead of just the one time the
> demuxing process would return it in an av_read_frame() call.
> The doxy for AV_DISPOSITION_ATTACHED_PIC even mentions that if you seek the
> relevant packet may not be returned at all.

Yes, but was it a GOOD idea? For the convenience of the few applications
that actually use the attached pictures, libavformat will use memory in
all applications. It does not seem like a good compromise to me.

I think a better design would be some kind of:

int avformat_get_attached_pic(AVStream *st, AVPacket **packet, unsigned flags);

In the short run, it could just access the field, but in the long run it
could seek back to load the packet only when required.

Since applications need to update their API anyway, it is a good time to
decide if we want to change something.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20210329/38a0e825/attachment.sig>


More information about the ffmpeg-devel mailing list