[FFmpeg-devel] [PATCH] avformat/avformat: Schedule AVOutputFormat.data_codec for removal

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Thu May 5 15:46:37 EEST 2022


No AVOutputFormat has this set. It is not removed immediately despite
being private because of the libavdevice<->libavformat situation.
The fact that this field is private is also the reason why no FF_API_*
define has been added.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavformat/avformat.h | 2 ++
 libavformat/format.c   | 2 --
 libavformat/utils.c    | 3 +--
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index f12fa7d904..69d1d0fa3d 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -614,7 +614,9 @@ typedef struct AVOutputFormat {
      * @see avdevice_list_devices() for more details.
      */
     int (*get_device_list)(struct AVFormatContext *s, struct AVDeviceInfoList *device_list);
+#if LIBAVFORMAT_VERSION_MAJOR < 60
     enum AVCodecID data_codec; /**< default data codec */
+#endif
     /**
      * Initialize format. May allocate data here, and set any AVFormatContext or
      * AVStream parameters that need to be set before packets are sent.
diff --git a/libavformat/format.c b/libavformat/format.c
index 4b1f3c2986..76f25ab5a6 100644
--- a/libavformat/format.c
+++ b/libavformat/format.c
@@ -111,8 +111,6 @@ enum AVCodecID av_guess_codec(const AVOutputFormat *fmt, const char *short_name,
         return fmt->audio_codec;
     else if (type == AVMEDIA_TYPE_SUBTITLE)
         return fmt->subtitle_codec;
-    else if (type == AVMEDIA_TYPE_DATA)
-        return fmt->data_codec;
     else
         return AV_CODEC_ID_NONE;
 }
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 3f253c2045..7fbc3a4a18 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1293,8 +1293,7 @@ int avformat_query_codec(const AVOutputFormat *ofmt, enum AVCodecID codec_id,
             return !!av_codec_get_tag2(ofmt->codec_tag, codec_id, &codec_tag);
         else if (codec_id == ofmt->video_codec ||
                  codec_id == ofmt->audio_codec ||
-                 codec_id == ofmt->subtitle_codec ||
-                 codec_id == ofmt->data_codec)
+                 codec_id == ofmt->subtitle_codec)
             return 1;
     }
     return AVERROR_PATCHWELCOME;
-- 
2.32.0



More information about the ffmpeg-devel mailing list