From patchwork Sat May 28 13:25:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aman Karmani X-Patchwork-Id: 35956 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:6914:b0:82:6b11:2509 with SMTP id q20csp1365834pzj; Sat, 28 May 2022 06:25:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxeMF+R7bH9NvsGStTAYp7zrtgXqbE5VtRkiW3Fo/haslbWw/65AizD2kKR4NPbt2Px7H/F X-Received: by 2002:a05:6402:3582:b0:42b:32a8:912b with SMTP id y2-20020a056402358200b0042b32a8912bmr40806306edc.137.1653744338475; Sat, 28 May 2022 06:25:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653744338; cv=none; d=google.com; s=arc-20160816; b=aGv0hXu1EgADnDUk94et3xXOyp0mbAQrn4JRLM3cLCyzj2xcrnvMxhTz4kZK9+99fD N3ajvT1Wvsq8wwaxkoc0/NUFtgoNFPofT9yQWyApWkv1eJGoxiiHgD9ViuQoHfqS3KpL i4MbiirplgpTtwiZrYSF34oU41qhhGS6o7NsPiIUm4nbSH8QpS7jCoDhZ0i3ToWJ23M6 dlkfF7rr2tbw/SaWW46bLRRqAG4uqpM77HIRVUhAlvdNzvVow63UUXlIOp/3d6rMbLoX X5SYxs+Jp9pVpiSZ9CA31RU6wjeYUcCgDcCwbWfJ7y0iaWb4yDS0dl5hVunViq4RLrU8 I8wA== 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=1jykCuDVhwaeo5L4f3kX1M8olexFwDbepwCNobL+y4o=; b=PQFarRw2XDqxiCbmcIQsxRtLMUjDAvTjjDq0RyjaEPLHoU8zcc2f8CDc0aQYvm7Zpk XgBH68DInoF7Fmw/0nE8kHLDrDaxk7Mh3hOQTk7BpaA2CZ/3mzA2ymMhSXP6br/SVOfM wtgdCOy3UNYCPl8lkmSEi0n7KiZ8ZAIB1mrmGJIt4UUHiXnv/wOLZ19OPJzstbGAyiYe fGIUnFswbUFf/sC7/nkulB/SX7QB2CJpsGtSKMDB1h+PvZGViMwt+PrEsrjUFCv4ICKM UrzB4GdGz70ExcrsahCtt8W99bswBKxugVCjZLJ6fChq8uONsti9VyS767VpNDLgacRQ zx1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=UZ1V5z3D; 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 b20-20020a056402351400b0041d70951197si5576150edd.530.2022.05.28.06.25.37; Sat, 28 May 2022 06:25:38 -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=UZ1V5z3D; 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 E57A168B5C6; Sat, 28 May 2022 16:25:34 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id ACB3D68B56B for ; Sat, 28 May 2022 16:25:28 +0300 (EEST) Received: by mail-pj1-f54.google.com with SMTP id w2-20020a17090ac98200b001e0519fe5a8so6644497pjt.4 for ; Sat, 28 May 2022 06:25:28 -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=zrkyrcT8nnxOemP+bVsEo+8DRx2fNfP1JrF6HEN4bls=; b=UZ1V5z3DPHoqZC/oPPMYgnNzpqJ0lj/CH2HPr4BgIVUFkqXqyukGCvhpiK/rkensQv O5yRfhqRr3GsEQeImH5BeS9TIm1+vXY8cZ27rRxzusmRlNOAVFIWlwd/YbU/Cu2rIHQR zEf310Bw/zL5DdnF2RiXopUmF5PmP3RA36BORuzkv8+CGxO4RwnQOc8l0ljszrrOq9FX Rn+WGvwWxbHx91UFX6JkbOinwvuWervcMX4HUV0VnpucPpD384sDpnIYAXMjCTuOB1Zl /GYK/GHmdfkt9r81Su0nQGtwi488Et+RA2wfAiCSnJpcmsNe9yhd+Hzu8M4fdtCb/Jru 5mgA== 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=zrkyrcT8nnxOemP+bVsEo+8DRx2fNfP1JrF6HEN4bls=; b=IQLflhbU6csPBtf4NrfKy7vgBWNkhEW2Juqgr1DVS/XfytvXqrx7v5AJ7IcgZjqkUJ i1dysTf1l0uB/boLwTgGHtfV1kTssfuXcHUUAy+Uwdl98yEjWtsJMHGvrv6C1wIhQ8iD EVKyLpHB0Ncljlk0KSgXwUv71g3+QsPTvhIus7J9N8w1U+Qpyxvd+MaO+aqQti84urIE hT63QiKt714EMR2LbTYRRkLZ6wVXJtj5XOHIZKgX2aOhHCdWi0EfSLNWYQaF+lpV+Y6Q aWctB7SkADtrJQGKchwLJuOBd1cqb1KPDn79nk7JxENmeR3ccuuuv3LJyH+sNkonbu96 SnMA== X-Gm-Message-State: AOAM5333qVlQlvLUG//k1pvn0Pk2GGBbhj9OTazqvLtC05QQLB3CBvuS 5B/Vs0S3JaioCOJGSl7TsDW2liSHo0Hc2A== X-Received: by 2002:a17:902:a9ca:b0:161:54a6:af3f with SMTP id b10-20020a170902a9ca00b0016154a6af3fmr48523387plr.48.1653744326989; Sat, 28 May 2022 06:25:26 -0700 (PDT) Received: from [127.0.0.1] (master.gitmailbox.com. [34.83.118.50]) by smtp.gmail.com with ESMTPSA id jc1-20020a17090325c100b00161b50c3db4sm5615725plb.94.2022.05.28.06.25.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 May 2022 06:25:26 -0700 (PDT) From: softworkz X-Google-Original-From: softworkz Message-Id: <2f3ba171f5261b1d200f396d51f9156637fe54ef.1653744323.git.ffmpegagent@gmail.com> In-Reply-To: References: Date: Sat, 28 May 2022 13:25:01 +0000 Fcc: Sent MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH v4 01/23] 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: GB4fj7uX0dpM 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 234de62a4b..5fcdd68ca8 100644 --- a/libavutil/Makefile +++ b/libavutil/Makefile @@ -76,6 +76,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 1b4b41d81f..11baa362d3 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) /** * @}