From patchwork Sat Jun 25 09:57:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aman Karmani X-Patchwork-Id: 36424 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:8b27:b0:88:1bbf:7fd2 with SMTP id l39csp825076pzh; Sat, 25 Jun 2022 02:58:14 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t6exhjaHinoCLGLsglhD1tNTomBB6p8qc3euWhkJk05Y66VQLJsCoBBVrTv8U3Fc7Db9QC X-Received: by 2002:a05:6402:40d0:b0:437:3cd1:c4d3 with SMTP id z16-20020a05640240d000b004373cd1c4d3mr4059921edb.414.1656151094541; Sat, 25 Jun 2022 02:58:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656151094; cv=none; d=google.com; s=arc-20160816; b=bz5uWa2nABIh4zMRc2/eYr/3Z+uRVEf26t76cNAc5NTcbGOwGeIRXy5M+waIg+JUr3 qKQ6aJTpkgkwWkS7cCMWFUbk/vj3+hOn5gzPbajT1PbtKkqmE7cHVvuXZ2z7I37Jje69 PPCxBKrQA6/SiMFv/+qN32KQ88uHm1r0Aix3CLY9R0vsyxO6TCclFz1QOWy9jkbsnMBy yRBPqFgpNfI4mo75zch6Do/O4kE4uIK6wxkp9VgFLsFpk9dyRsm0dEen6j73QG907XzH j+epLidfNIdTBBHMTUM1g1qXwVwPfBpG/mN+3CXeXkpRYiK6wkD0suEMPoAuWM2pEJBq SC0A== 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=wekJIXNAKBSBqqXVa4ayFoOHY/vEbWt4qJ/9yz7ytBjKTj8H6WHqTk+Y3oE3uz7jgm sb3HEvmJUHZZI1nEG8N15hvEHuiyASbgA7Y9RHsqJB4IV+VTD+WdeJ7oglV3hAczWkSt cReABJVFQJtT92xJM6Tb9HPd/kEXM2cvni7IlMJlBNj8r1vHnbEhr+QkSAQ2av4DNtOv tZnCSzKcNsTIfavIegCsCxaqPzOVixTDY3JmL7sCwGuQADut4P73+9bPH8M0E1a9kTGy S+Zz1QxS13qGeShjCg8fljCtOkmSnKzKkKn2BaTslRhEybylhKw7kNth2gTEYqkGnYBm Gjiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=Ydvl8jAd; 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 k24-20020aa7d2d8000000b00435b22f8261si5408075edr.78.2022.06.25.02.58.13; Sat, 25 Jun 2022 02:58:14 -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=Ydvl8jAd; 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 4E93E68B7E2; Sat, 25 Jun 2022 12:58:09 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 06C2A68B7CE for ; Sat, 25 Jun 2022 12:58:03 +0300 (EEST) Received: by mail-pf1-f176.google.com with SMTP id a15so4598868pfv.13 for ; Sat, 25 Jun 2022 02:58:02 -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=Ydvl8jAdT8uHGO3JSaIE9i4tHyHb2W8/WFFYIeCWSjpLknnXsEwoS4/d+AaJYefnLM 9Y6ku5KpqjbE+tZVt1qfqi/QLEA8X1PbYzl20NlkESCgHKbJoXbb/oYaK05ZQ1lHpSfL wyODWbDqlOmjWlvgNO+OUBhodoTSOjkt6huDZSf6SFqyJKXr4aZe9iycjAhAKJGDPKzB Nu5u/+tylT4P74ezDND6XMSbqIFAQ4GzkGmgjGAc2Wf7ViaUbbgWOxuEl6ES2BOfEO5B sLxzGVyFF5aeZVNSJuxRe7viaal0t/PtoQyKsan4V0ehRFvb7YOJwa+O9BqIqqFUJyhV teCA== 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=JxOz4v3Xi0qZ5dJzAZQtDZiQX71B9OVZBoaLzBGW1qVZg1xBaJ7UAVF902C4E5Ih2v lsODTYEVmrHiYII3vCPp04cLU6QE+PC5yEXt1eDIBuMxB0FPSIgKzWUgGwJN7V3aHnMp 6Wfqrkgqd9gcWO1cTlDmIKAA1m0MDiN14pOBTxxGEtNvA6FcFfUNTR1hVL6dNGwbmVsG xgyfPPARfp5/Ahd7varn6tBu2XvbamogFl6jFm5Pfip6qlVtwifM3Mi5N1xH8hXUODIz 06eanhMvD775iiW+lQwCA7t5/W+5s4xisQvTvJSHcvoyhklucalLUAg88zbK6rwLNUkA w7gA== X-Gm-Message-State: AJIora/7LGRZhzWerevuMRpQh+fUuJkid69vGyUYgkPreCHGjv8aZveU bccfwl/9JsfQuUj5LTOgmgiG2ewUZMKn3A== X-Received: by 2002:a65:6c10:0:b0:380:437a:c154 with SMTP id y16-20020a656c10000000b00380437ac154mr2907699pgu.549.1656151081202; Sat, 25 Jun 2022 02:58:01 -0700 (PDT) Received: from [127.0.0.1] (master.gitmailbox.com. [34.83.118.50]) by smtp.gmail.com with ESMTPSA id i11-20020a1709026acb00b001640aad2f71sm3276505plt.180.2022.06.25.02.58.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Jun 2022 02:58:00 -0700 (PDT) From: softworkz X-Google-Original-From: softworkz Message-Id: In-Reply-To: References: Date: Sat, 25 Jun 2022 09:57:33 +0000 Fcc: Sent MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH v5 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: 0jzbrgVS2di3 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) /** * @}