[FFmpeg-devel] [PATCH 08/17] lavfi: add helpers to consume frames from link FIFOs.
Michael Niedermayer
michael at niedermayer.cc
Sun Dec 25 15:31:00 EET 2016
On Sun, Dec 25, 2016 at 11:44:07AM +0100, Nicolas George wrote:
> Le quintidi 5 nivôse, an CCXXV, Michael Niedermayer a écrit :
> > Whats your oppinion on using a explicit av_assert1() in the calling
> > code for this ? (i assume it can be done easily&cleanly)
> >
> > It would explicitly in C code say what is meant, while a
> > "_sure" requires additional knowledge specific to lavfi
>
> You mean, in the caller, instead of:
>
> ret = ff_link_consume_frame_sure(link, &frame);
>
> write:
>
> ret = ff_link_consume_frame(link, &frame);
> av_assert1(ret >= 0);
yes, something like that (or a av_assert1(ret != AVERROR_OUT_OF_FUEL)
>
> Well, it loses us the property that ff_link_consume_frame_sure() cannot
> fail at all (ff_link_consume_samples_sure() can, because it allocates
> memory) and thus do not require getting the return value at all. But I
> was not sure I wanted to make this a promise anyway.
>
> Also, it adds extra tests: one in the code, one in consume() instead of
> just one in the code (not counting the asserts, only present in debug
> builds). But that is just my premature optimizer side talking.
its premature too but if we have expensive checks we could cache the
result in the link
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Dictatorship: All citizens are under surveillance, all their steps and
actions recorded, for the politicians to enforce control.
Democracy: All politicians are under surveillance, all their steps and
actions recorded, for the citizens to enforce control.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20161225/65539fb5/attachment.sig>
More information about the ffmpeg-devel
mailing list