[FFmpeg-devel] [PATCH 1/4] lavf: add write_uncoded_frame() API.
Nicolas George
george at nsup.org
Tue Jan 14 20:21:28 CET 2014
Le quintidi 25 nivôse, an CCXXII, Michael Niedermayer a écrit :
> this mismatches what we do with packets
This is true, I see it now, but it is somewhat inconsistent.
av_interleaved_write_frame() takes ownership of the buffer reference, but
av_write_frame() does not.
As for other similar functions: avcodec_encode_{audio,video}2(), AFAIK, do
not, and avcodec_decode_{video2,audio4}() do not take ownership of the
AVFrame either.
This state of inconsistency has legitimate reasons, but it is probably a bit
confusing and would need documenting.
> besides this consider a device that wants to display subtitles
> if the AVFrame to be output has its memory still owned by the caller
> then the device cannot write into the buffer but if the caller gave
> up ownership (unless he has a explicit 2nd reference to the memory)
> then the device could render subtitles into the AVFrame before
> display
That is a convincing argument, on top of the rest. I will make the change,
along with a few more fixes I need to add, and re-submit the series.
> this looks too convoluted
> a uncoded frame should always have pkt.pts = pkt.dts i think
> the pts != dts is a artfact of frame reordering and B frames which
> are all specific to compressed frames
You are entirely right.
Regards,
--
Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140114/d8c3644c/attachment.asc>
More information about the ffmpeg-devel
mailing list