[FFmpeg-devel] [PATCH v5 01/12] avutil/frame: Subtitle Filtering - Add AVMediaType property to AVFrame

Soft Works softworkz at hotmail.com
Sun Sep 12 22:33:17 EEST 2021



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of
> Lynne
> Sent: Sunday, 12 September 2021 13:38
> To: FFmpeg development discussions and patches <ffmpeg-
> devel at ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH v5 01/12] avutil/frame: Subtitle
> Filtering - Add AVMediaType property to AVFrame
> 
> 12 Sept 2021, 13:31 by dev at lynne.ee:
> 
> > 12 Sept 2021, 05:21 by softworkz at hotmail.com:
> >
> >> This is the root commit for adding subtitle filtering
> capabilities.
> >> Adding the media type property to AVFrame replaces the previous
> >> way of distinction which was based on checking width and height
> >> to determine whether a frame is audio or video.
> >>
> >> Signed-off-by: softworkz <softworkz at hotmail.com>
> >>
> >
> > Why do you need a new allocation function av_frame_get_buffer2
> > when it has the same syntax as av_frame_get_buffer?
> > Also, could you please drop all but one of the filter patches
> > when sending new versions? You're overspamming the ML
> > and it's hard to keep up.
> > Finally, why not combine the 2 subtitle overlay filters into one?
> > There's no need for explicitness between text and bitmap subs.
> >
> 
> Just read why (the media type). Says a lot about the ML overload.
> 
> Could the media type be set as unknown during the deprecation
> period by default by the old alloc function for audio and video?

That would defeat the actual purpose of that property.

> Subtitle allocations can set it to _SUBTITLES. That way, you can
> still keep compatibility, as the old users detect AVFrame type based
> on the 'format' field, without adding a new alloc function.

No, they can't use the format field because it is used for both,
audio (sampleformat) and video (pixfmt).
The existing code was checking for width and/or height to distinguish
between video and audio which is now using the type instead:

Before:

if (frame->width) {
	...
}
if (frame->nb_samples) {
	...
}

After:

switch(frame->type) {
case AVMEDIA_TYPE_VIDEO:
	...
case AVMEDIA_TYPE_AUDIO:
	...
case AVMEDIA_TYPE_SUBTITLE:
	...
}


softworkz


More information about the ffmpeg-devel mailing list