From patchwork Fri Jan 14 01:13:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aman Karmani X-Patchwork-Id: 33563 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp984815iog; Thu, 13 Jan 2022 17:14:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJwK9OxQd2X5Iu8UXD5kye1EN+Z3yApBGQuxtwuhzgrh7N/81gUXV/6ea6QW0fPzMJ5W8X85 X-Received: by 2002:a17:906:c156:: with SMTP id dp22mr5751195ejc.109.1642122840939; Thu, 13 Jan 2022 17:14:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642122840; cv=none; d=google.com; s=arc-20160816; b=P40oeoMWe7gt6W48mnZAuXOWpviyXf6FoR7xGwK06A5bA+cDn3xs48/M3SK9eEuVEU TsZ31dJfTehfSk+OOTq3GOQp/h6wM65W587d0qV9+F2CzXM7lAaCoWGqvBEieqWuiKXj NcyvuEoW2Li37vq6/k/d/JHNaHNNGweGRXb/a5W9fkHusQcab2FLntCkHc8uUNMNzV4Q ++Fz8OcdBIxze1FAloH6HgOjRKaB/0PkfZ9fT+kqAAXj6d3gz9fRcOTFOiMelTh85rV1 nPG5BF/boSrP8d+EgWcOUDjUvDoDY/LLVBbAPhfMhUiDCp1g9Vd6QCyPie6f+OSzPP6/ ccnA== 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:from:references :in-reply-to:message-id:dkim-signature:delivered-to; bh=TQnAen+DV7aFtFioRK0/NUkuJCcuI8VKgLfAztqjzmg=; b=sAbrnWI2+K4DDufAgMcTF1rq1NmJPufV5BKBl7A1OOMkqHbQ6KpAC+NqGszPL/2ycN WVBjFKp+cKy0RdCmrT63yTxwWX/B9oCkHtcG3Fv5XNjYjYFgNuFs4VkpAJZnzCOln4Va z3KsXZgSk1pdWE43oyQBWWjvoSSh8qMxMe15e0NrXEElq7R5UJR5/isIeVtWphAKayUx GHbIOJ/+Yn/Pbt44Jxr5hzioynf2/YI9AocK20LW6u8G3pOjMV27fjWKGTDVzlVoDu9u 6NcNiVN6PLWhwjTcUzzyGhOqh8z7EWY/EJ7PF2bSj9pm8n+FpyjKja3/Udf5nWskONGz EWHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=UVqhyVxR; 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 ay21si2099266ejb.502.2022.01.13.17.14.00; Thu, 13 Jan 2022 17:14:00 -0800 (PST) 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=UVqhyVxR; 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 EEB7168B510; Fri, 14 Jan 2022 03:13:45 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 977EF68A86C for ; Fri, 14 Jan 2022 03:13:38 +0200 (EET) Received: by mail-pj1-f44.google.com with SMTP id i8-20020a17090a138800b001b3936fb375so20561473pja.1 for ; Thu, 13 Jan 2022 17:13:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=TpUPukYaZVM59oxufUEiMOrqpC19LS0P3MvaA/WmbiM=; b=UVqhyVxRNuP//ltywCEJDclI5sKghUH0Yc0i7wm5VOvmMwFaBbI4KIxxBJ0I0rvm3g bX+Bu+0fs+y7KXjomsSvgnnTASgdw5x8wGT9oOR9HgNHq21OLNoQw+4SYq8329is+MhC 05v2J/nNUt6lVH255LRB23CEpoBxOQJUwnw7MsKS1j5qZoMPuri6qsxOWGt16SyDHIiV 1/1K8v4jVWY5XfRR91mdMhlqAAQVy8Cm3aJwV7Sn5QfxeQHytMruI4pIMzG9qdbZg5xq Ld9nhPffw4ZwKscPMI4NHI+S/gjKDYq2IS+prPG7JmbJhnfg2mWT38n42/gffgzBvdrG JGEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=TpUPukYaZVM59oxufUEiMOrqpC19LS0P3MvaA/WmbiM=; b=Me4DkLI3/4eKTzJ/KbE/vgsPhHgrt5SlSQ4UnBV4Nl5JAS2+HgK8XsfOWbXAuBi4lp SjIRnlM1JS+yUelAz2uY/opzN0mFMrx3pUKdPIuqW/mhhPQBof2qPrNoyjOMJ3eGQTNH l3X1xO5STNw2xGh6MjhERbpj5IVnfax6Pf0ymzXuszxEJdZzOxO1fXwbtMdSyiMNrqec DNg9c47m5CtKisZoe9DF/sJRYndtMKFmR9R9MYPGXgRMFR5NrodvcX+Udf6kOPHgPZWv uMb6pI2d8qld4Bq5qfTR7eJWG57WdEu70YBVJOCJINBlnRMidTY6e3cUnEf8G9Zs+r2f Q4iw== X-Gm-Message-State: AOAM531Bj6MmdVLa0FSurjO3U3fNxFJ2j3Sg3R8T7ojHZ15x+n4324JP djXWtTR45qVWhOMBjDUzD8GqQFUMkW4nBA== X-Received: by 2002:a17:902:820a:b0:14a:171d:8e35 with SMTP id x10-20020a170902820a00b0014a171d8e35mr6976635pln.136.1642122816868; Thu, 13 Jan 2022 17:13:36 -0800 (PST) Received: from [127.0.0.1] (master.gitmailbox.com. [34.83.118.50]) by smtp.gmail.com with ESMTPSA id p10sm3909456pfw.69.2022.01.13.17.13.36 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jan 2022 17:13:36 -0800 (PST) Message-Id: <13b9a26b25af71def101a29c2c079fb5bd37dbff.1642122814.git.ffmpegagent@gmail.com> In-Reply-To: References: From: ffmpegagent Date: Fri, 14 Jan 2022 01:13:10 +0000 Fcc: Sent MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH 01/24] 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: softworkz Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 4CpV+9wSxXyl 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 ec1a0566a4..fe5a83cf85 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" @@ -2238,24 +2239,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 d17876df1a..ce644f4d48 100644 --- a/libavutil/Makefile +++ b/libavutil/Makefile @@ -74,6 +74,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 953aac9d94..5bf48f6304 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -110,6 +110,7 @@ #define FF_API_COLORSPACE_NAME (LIBAVUTIL_VERSION_MAJOR < 58) #define FF_API_AV_MALLOCZ_ARRAY (LIBAVUTIL_VERSION_MAJOR < 58) #define FF_API_FIFO_PEEK2 (LIBAVUTIL_VERSION_MAJOR < 58) +#define FF_API_OLD_SUBTITLES (LIBAVUTIL_VERSION_MAJOR < 58) /** * @}