[FFmpeg-devel] [PATCH v2 1/1] avfilter/frames: Ensure frames are writable when processing in-place

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Wed Sep 29 11:27:30 EEST 2021


Soft Works:
> 
> 
>> -----Original Message-----
>> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of
>> James Almer
>> Sent: Tuesday, 28 September 2021 22:08
>> To: ffmpeg-devel at ffmpeg.org
>> Subject: Re: [FFmpeg-devel] [PATCH v2 1/1] avfilter/frames: Ensure
>> frames are writable when processing in-place
>>
>> On 9/28/2021 4:54 PM, Soft Works wrote:
>>> Signed-off-by: softworkz <softworkz at hotmail.com>
>>> ---
>>> v2: Reduced to cases without AVFILTERPAD_FLAG_NEEDS_WRITABLE
>>
>> Can't this flag used in these filters?
> 
> I mentioned before that I don’t consider this as a good API 
> design. It had even caused a review of my subtitle filters to 
> assume that my filter code would be incorrect, even though I 
> had been using that flag.

Would you please provide a reference for this? Especially after what you
said on IRC I have to presume that this refers to my review of your
textmod filter [1] contained in v5 of your patches. Yet you did not use
said flag in this patch at all (you seem to have never used that flag in
any of your patches); in fact, using that flag would not have worked at
all, as it was only v6 which added support for making subtitle frames
writable in ff_inlink_make_frame_writable(). In v5, not even
av_frame_make_writable() would have worked, as I have explained to you
in [2].

> It provides no other benefit than that it saves you from writing
> two or three lines of code. Minus the one required to specify 
> the flag makes just one or two lines left.
> Much higher than the benefit is the cost that is involved:
> Filtering code (filter_frame) is no longer 1:1 exchangeable 
> between filters (in case of only one having that flag).

Excellent. Just copying code is bad practice anyway.

- Andreas

[1]: https://ffmpeg.org/pipermail/ffmpeg-devel/2021-September/285218.html
[2]: https://ffmpeg.org/pipermail/ffmpeg-devel/2021-September/285220.html


More information about the ffmpeg-devel mailing list