diff mbox series

[FFmpeg-devel,v19,01/20] avcodec, avutil: Move enum AVSubtitleType to avutil, add new and deprecate old values

Message ID DM8P223MB036544A5BD03CE41FBF5F3D0BA6A9@DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM
State New
Headers show
Series Subtitle Filtering | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/configureppc warning Failed to apply patch

Commit Message

Soft Works Dec. 3, 2021, 7:31 p.m. UTC
Signed-off-by: softworkz <softworkz@hotmail.com>
---
 doc/APIchanges       |  6 ++++
 libavcodec/avcodec.h | 19 +------------
 libavutil/Makefile   |  1 +
 libavutil/subfmt.h   | 66 ++++++++++++++++++++++++++++++++++++++++++++
 libavutil/version.h  |  1 +
 5 files changed, 75 insertions(+), 18 deletions(-)
 create mode 100644 libavutil/subfmt.h

Comments

Michael Niedermayer Dec. 5, 2021, 3:52 p.m. UTC | #1
On Fri, Dec 03, 2021 at 07:31:06PM +0000, Soft Works wrote:
> Signed-off-by: softworkz <softworkz@hotmail.com>
> ---
>  doc/APIchanges       |  6 ++++
>  libavcodec/avcodec.h | 19 +------------
>  libavutil/Makefile   |  1 +
>  libavutil/subfmt.h   | 66 ++++++++++++++++++++++++++++++++++++++++++++
>  libavutil/version.h  |  1 +
>  5 files changed, 75 insertions(+), 18 deletions(-)
>  create mode 100644 libavutil/subfmt.h

Some of the patches in this patchset do not apply cleanly to master anymore
Applying: avcodec, avutil: Move enum AVSubtitleType to avutil, add new and deprecate old values
Using index info to reconstruct a base tree...
M	doc/APIchanges
M	libavutil/version.h
Falling back to patching base and 3-way merge...
Auto-merging libavutil/version.h
Auto-merging doc/APIchanges
CONFLICT (content): Merge conflict in doc/APIchanges
error: Failed to merge in the changes.
Patch failed at 0001 avcodec, avutil: Move enum AVSubtitleType to avutil, add new and deprecate old values
Use 'git am --show-current-patch' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

[...]
Soft Works Dec. 5, 2021, 4:25 p.m. UTC | #2
> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Michael
> Niedermayer
> Sent: Sunday, December 5, 2021 4:53 PM
> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH v19 01/20] avcodec, avutil: Move enum
> AVSubtitleType to avutil, add new and deprecate old values
> 
> On Fri, Dec 03, 2021 at 07:31:06PM +0000, Soft Works wrote:
> > Signed-off-by: softworkz <softworkz@hotmail.com>
> > ---
> >  doc/APIchanges       |  6 ++++
> >  libavcodec/avcodec.h | 19 +------------
> >  libavutil/Makefile   |  1 +
> >  libavutil/subfmt.h   | 66 ++++++++++++++++++++++++++++++++++++++++++++
> >  libavutil/version.h  |  1 +
> >  5 files changed, 75 insertions(+), 18 deletions(-)
> >  create mode 100644 libavutil/subfmt.h
> 
> Some of the patches in this patchset do not apply cleanly to master anymore

Posted a new version. 

Thanks,
sw
diff mbox series

Patch

diff --git a/doc/APIchanges b/doc/APIchanges
index bc9f4e38da..c0e1fde8aa 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -14,6 +14,12 @@  libavutil:     2021-04-27
 
 API changes, most recent first:
 
+2021-12-03 - xxxxxxxxxx - lavu 58.1.100 - subfmt.h
+  Add enum AVSubtitleType (moved from lavc), add new values, deprecate existing
+
+2021-12-03 - xxxxxxxxxx - lavc 60.1.100 - avcodec.h
+  Remove enum AVSubtitleType (moved to lavu)
+
 2021-11-22 - xxxxxxxxxx - lavu 57.9.100 - pixfmt.h
   Add AV_PIX_FMT_P210, AV_PIX_FMT_P410, AV_PIX_FMT_P216, and AV_PIX_FMT_P416.
 
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 7ee8bc2b7c..b05c12e47e 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 529046dbc8..c7843db1e4 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..88078a0d14
--- /dev/null
+++ b/libavutil/subfmt.h
@@ -0,0 +1,66 @@ 
+/*
+ * 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
+
+enum AVSubtitleType {
+
+    /**
+     * Subtitle format unknown.
+     */
+    AV_SUBTITLE_FMT_NONE = -1,
+
+    /**
+     * Subtitle format unknown.
+     */
+    AV_SUBTITLE_FMT_UNKNOWN = 0,
+#ifdef 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,
+#ifdef 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,
+#ifdef 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,
+#ifdef 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 a2615cd299..9edda72411 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -109,6 +109,7 @@ 
 #define FF_API_DECLARE_ALIGNED          (LIBAVUTIL_VERSION_MAJOR < 58)
 #define FF_API_COLORSPACE_NAME          (LIBAVUTIL_VERSION_MAJOR < 58)
 #define FF_API_AV_MALLOCZ_ARRAY         (LIBAVUTIL_VERSION_MAJOR < 58)
+#define FF_API_OLD_SUBTITLES            (LIBAVUTIL_VERSION_MAJOR < 58)
 
 /**
  * @}