From patchwork Sun Jun 26 16:34:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aman Karmani X-Patchwork-Id: 36456 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:8b27:b0:88:1bbf:7fd2 with SMTP id l39csp1539604pzh; Sun, 26 Jun 2022 09:35:46 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tTovVhBjBY9YUqIPAVrFNA/qlrhQo/RQqB2LsB3YJ1QsS7xmNZaGFm1K3vjSqzyLpY7NxM X-Received: by 2002:a17:906:2bda:b0:726:3b59:3ea9 with SMTP id n26-20020a1709062bda00b007263b593ea9mr8598264ejg.43.1656261346244; Sun, 26 Jun 2022 09:35:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656261346; cv=none; d=google.com; s=arc-20160816; b=F62IUL1jTl7J7u9cl07hbzKpK3AObki03zjo3suivO7JNPX9u+zYFIS9j6D3BichqR vXl+gQj/QEhgHe0hyCpVWt9IDH0tKF8AljOpASvDn0mkOAmsNOwwWsqYvASrrd4vaOBN pXwSVrYlQs6hMjg8zuTHFXLIpFd6HXmU3bXHHsA5YVUUrcB0agbcmIaD+E+sOoi4auJR WKLcGsQKNw4p6+Ar75Z4Sgm/Ce9pJBdDSuKT0zI6tUD6NEtKhZYu+UljZ50ZhRxeS4Bn fwCn5iEJa5x7Yr7O3BKuOHG/q3qr+BcKDXLwKZDphvz6DRvRQ1mvkPDvCvApMoUih6Zp UHSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:to:mime-version:fcc:date:references :in-reply-to:message-id:from:dkim-signature:delivered-to; bh=tS0ZR5+maUg+eNP91Lf48mxfBd53kSE8+ERSFdwgui0=; b=FiOYXAx1J9q0RQgy4VpZ3StarbUB72/qpVQT0Io0YHfMevInpdLZYYPhHVhrTeTq/m lCE1OPYL/Yl8qiWRVd53snWP5ZeOiiFLwPop+UHJzvSG8Un6LJq5ZrrdwId/uh85FzNt 32EPpxXydLxFwG7uvrCDg0ShnXJciy9qvX+S4jT8L84/rhWngWkE9mQVuMdrs7SuJsMO mXi9cKrQS3KRebEjBY9Nq3px8pH0bllmAghw+jzDkdDkxNSBBq5MYtTaNvrdTrKiee8e E9lxTF6RMcnug4AwtG/Ww95sSw26S2S/R7g15t1ngsO+LopXmFL9pEtUO6rbvHaLwyzP bwCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=Q0rFBDgg; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id e12-20020a17090658cc00b007262944c623si8690685ejs.869.2022.06.26.09.35.45; Sun, 26 Jun 2022 09:35:46 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=Q0rFBDgg; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BA52068B7E0; Sun, 26 Jun 2022 19:35:33 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B38D368B74A for ; Sun, 26 Jun 2022 19:35:26 +0300 (EEST) Received: by mail-pl1-f182.google.com with SMTP id r1so6181615plo.10 for ; Sun, 26 Jun 2022 09:35:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:message-id:in-reply-to:references:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=njJkpPnVsYzDGBt9pLbHtES/GiZF+/P3HYrS0CRAI0A=; b=Q0rFBDggu7u79g/5JeFBGSHFMEVPqCXlg2MHrijG9vLoM/p6UabZ8yUunGkAGymK1Q nSNGnprVzzmF2aCJgwf/niDotPYuDBfH4AkXlE6NyEwkS0jp7UfS8/E9Ea4LTrQV3iFN R4zzHo4jRk48iDdtHP18X3qTyXYiAg8ncm00mzlEhOP/19weFN13+sHMhCMaTE/5lPIG 4LGOOO/cw9uBs462RpsuZ+5ibVHEdfpMTJuu7xSerYRdGUISJncqfQp/7ylG/jKPfxqB +8A4g4+fiwo4xKpnxtnKmtv71Oxd3JeefAqvJKuxjNDibXjc0XwXeN1Qvtq7B9yf6bE3 9/2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:message-id:in-reply-to:references:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=njJkpPnVsYzDGBt9pLbHtES/GiZF+/P3HYrS0CRAI0A=; b=eDBtFqdsAjaxUHbtceC5whhyqqhfCryHwuCqrP1rYbZ0Y+pTCez/BW0nrHsChkpqx6 kNfbiDqoSvW/hSG+eUnFOZpmOu2SC6PkM9DX6xh7+jtXFgDLhLenqyr9dyNZyrwuoBlP XqFHAjoH1C/JvlBfNe5Kd8RnDs2ASUyGDOVblkMJhGSBPtUXEKUYU+cocjtrTOvC7pG0 JOdj2lyXX5/C77PUxmwzE6758C6yAubmvSCjSIquLxTJb6327caoKhQ+stJ1uYY4CwL3 lTD5Q60OX8Qx/dFK/QhywC77+nj2XxiLmM+pldQTF2a1XA0hOt1TT5FFbxHy/Pq9tsbk izkg== X-Gm-Message-State: AJIora8eD36e8CW2sjUIQk0dDnNeR0vrFZOrRggsQzLoaQzdN2BW9rD4 yF8Y1C6rkiAY10hGaGZycBjOWa3X3fQGgA== X-Received: by 2002:a17:90a:5104:b0:1ea:e86b:6aed with SMTP id t4-20020a17090a510400b001eae86b6aedmr15871466pjh.69.1656261325031; Sun, 26 Jun 2022 09:35:25 -0700 (PDT) Received: from [127.0.0.1] (master.gitmailbox.com. [34.83.118.50]) by smtp.gmail.com with ESMTPSA id e9-20020a170902784900b001636d95fe59sm5410430pln.172.2022.06.26.09.35.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Jun 2022 09:35:24 -0700 (PDT) From: softworkz X-Google-Original-From: softworkz Message-Id: In-Reply-To: References: Date: Sun, 26 Jun 2022 16:34:58 +0000 Fcc: Sent MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH v6 01/25] avcodec, avutil: Move enum AVSubtitleType to avutil, add new and deprecate old values X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Michael Niedermayer , softworkz , Andriy Gelman , Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: dhWVIAPOVeBH From: softworkz Signed-off-by: softworkz --- libavcodec/avcodec.h | 19 +------------ libavutil/Makefile | 1 + libavutil/subfmt.h | 68 ++++++++++++++++++++++++++++++++++++++++++++ libavutil/version.h | 1 + 4 files changed, 71 insertions(+), 18 deletions(-) create mode 100644 libavutil/subfmt.h diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 4dae23d06e..56d551f92d 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -35,6 +35,7 @@ #include "libavutil/frame.h" #include "libavutil/log.h" #include "libavutil/pixfmt.h" +#include "libavutil/subfmt.h" #include "libavutil/rational.h" #include "codec.h" @@ -2255,24 +2256,6 @@ typedef struct AVHWAccel { * @} */ -enum AVSubtitleType { - SUBTITLE_NONE, - - SUBTITLE_BITMAP, ///< A bitmap, pict will be set - - /** - * Plain text, the text field must be set by the decoder and is - * authoritative. ass and pict fields may contain approximations. - */ - SUBTITLE_TEXT, - - /** - * Formatted text, the ass field must be set by the decoder and is - * authoritative. pict and text fields may contain approximations. - */ - SUBTITLE_ASS, -}; - #define AV_SUBTITLE_FLAG_FORCED 0x00000001 typedef struct AVSubtitleRect { diff --git a/libavutil/Makefile b/libavutil/Makefile index 29c170214c..edec708ff5 100644 --- a/libavutil/Makefile +++ b/libavutil/Makefile @@ -77,6 +77,7 @@ HEADERS = adler32.h \ sha512.h \ spherical.h \ stereo3d.h \ + subfmt.h \ threadmessage.h \ time.h \ timecode.h \ diff --git a/libavutil/subfmt.h b/libavutil/subfmt.h new file mode 100644 index 0000000000..791b45519f --- /dev/null +++ b/libavutil/subfmt.h @@ -0,0 +1,68 @@ +/* + * 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 + */ + +#ifndef AVUTIL_SUBFMT_H +#define AVUTIL_SUBFMT_H + +#include "version.h" + +enum AVSubtitleType { + + /** + * Subtitle format unknown. + */ + AV_SUBTITLE_FMT_NONE = -1, + + /** + * Subtitle format unknown. + */ + AV_SUBTITLE_FMT_UNKNOWN = 0, +#if FF_API_OLD_SUBTITLES + SUBTITLE_NONE = 0, ///< Deprecated, use AV_SUBTITLE_FMT_NONE instead. +#endif + + /** + * Bitmap area in AVSubtitleRect.data, pixfmt AV_PIX_FMT_PAL8. + */ + AV_SUBTITLE_FMT_BITMAP = 1, +#if FF_API_OLD_SUBTITLES + SUBTITLE_BITMAP = 1, ///< Deprecated, use AV_SUBTITLE_FMT_BITMAP instead. +#endif + + /** + * Plain text in AVSubtitleRect.text. + */ + AV_SUBTITLE_FMT_TEXT = 2, +#if FF_API_OLD_SUBTITLES + SUBTITLE_TEXT = 2, ///< Deprecated, use AV_SUBTITLE_FMT_TEXT instead. +#endif + + /** + * Text Formatted as per ASS specification, contained AVSubtitleRect.ass. + */ + AV_SUBTITLE_FMT_ASS = 3, +#if FF_API_OLD_SUBTITLES + SUBTITLE_ASS = 3, ///< Deprecated, use AV_SUBTITLE_FMT_ASS instead. +#endif + + AV_SUBTITLE_FMT_NB, ///< number of subtitle formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions. +}; + +#endif /* AVUTIL_SUBFMT_H */ diff --git a/libavutil/version.h b/libavutil/version.h index 2e9e02dda8..f9f84801a3 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -114,6 +114,7 @@ #define FF_API_XVMC (LIBAVUTIL_VERSION_MAJOR < 58) #define FF_API_OLD_CHANNEL_LAYOUT (LIBAVUTIL_VERSION_MAJOR < 58) #define FF_API_AV_FOPEN_UTF8 (LIBAVUTIL_VERSION_MAJOR < 58) +#define FF_API_OLD_SUBTITLES (LIBAVUTIL_VERSION_MAJOR < 58) /** * @}