Soft Works: > Root commit for adding subtitle filtering capabilities. > In detail: > > - Add type (AVMediaType) field to AVFrame > Replaces previous way of distinction which was based on checking > width and height to determine whether a frame is audio or video > - Add subtitle fields to AVFrame > - Add new struct AVSubtitleArea, similar to AVSubtitleRect, but different > allocation logic. Cannot and must not be used interchangeably, hence > the new struct > > Signed-off-by: softworkz <softwo...@hotmail.com> > --- > libavutil/Makefile | 1 + > libavutil/frame.c | 211 ++++++++++++++++++++++++++++++++++++++++----- > libavutil/frame.h | 78 ++++++++++++++++- > libavutil/subfmt.c | 50 +++++++++++ > libavutil/subfmt.h | 48 +++++++++++ > 5 files changed, 364 insertions(+), 24 deletions(-) > create mode 100644 libavutil/subfmt.c > > diff --git a/libavutil/subfmt.c b/libavutil/subfmt.c > new file mode 100644 > index 0000000000..3998a6d486 > --- /dev/null > +++ b/libavutil/subfmt.c > @@ -0,0 +1,50 @@ > +/* > + * Copyright (c) 2021 softworkz > + * > + * This file is part of FFmpeg. > + * > + * FFmpeg is free software; you can redistribute it and/or > + * modify it under the terms of the GNU Lesser General Public > + * License as published by the Free Software Foundation; either > + * version 2.1 of the License, or (at your option) any later version. > + * > + * FFmpeg is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + * Lesser General Public License for more details. > + * > + * You should have received a copy of the GNU Lesser General Public > + * License along with FFmpeg; if not, write to the Free Software > + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 > USA > + */ > + > +#include <string.h> > +#include "common.h" > +#include "subfmt.h" > + > +typedef struct SubtitleFmtInfo { > + enum AVSubtitleType fmt; > + const char* name; > +} SubtitleFmtInfo;
This struct is unused now. > + > +static const char sub_fmt_info[AV_SUBTITLE_FMT_NB][24] = { > + [AV_SUBTITLE_FMT_UNKNOWN] = "Unknown subtitle format", > + [AV_SUBTITLE_FMT_BITMAP] = "Graphical subtitles", > + [AV_SUBTITLE_FMT_TEXT] = "Text subtitles (plain)", > + [AV_SUBTITLE_FMT_ASS] = "Text subtitles (ass)", > +}; > + > +const char *av_get_subtitle_fmt_name(enum AVSubtitleType sub_fmt) > +{ > + if (sub_fmt < 0 || sub_fmt >= AV_SUBTITLE_FMT_NB) > + return NULL; > + return sub_fmt_info[sub_fmt]; > +} > + > +enum AVSubtitleType av_get_subtitle_fmt(const char *name) > +{ > + for (int i = 0; i < AV_SUBTITLE_FMT_NB; i++) > + if (!strcmp(sub_fmt_info[i], name)) > + return i; > + return AV_SUBTITLE_FMT_NONE; > +} _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".