diff mbox series

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

Message ID AS8PR01MB794453C6364CE2E7786E0F918FC29@AS8PR01MB7944.eurprd01.prod.exchangelabs.com
State New
Headers show
Series [FFmpeg-devel] avformat/avformat: Schedule AVOutputFormat.data_codec for removal | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt May 5, 2022, 12:46 p.m. UTC
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@outlook.com>
---
 libavformat/avformat.h | 2 ++
 libavformat/format.c   | 2 --
 libavformat/utils.c    | 3 +--
 3 files changed, 3 insertions(+), 4 deletions(-)

Comments

Diederick C. Niehorster May 5, 2022, 12:54 p.m. UTC | #1
Hi Andreas,

On Thu, May 5, 2022 at 2:47 PM Andreas Rheinhardt
<andreas.rheinhardt@outlook.com> wrote:
>
> 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.

Since you bring up the libavdevice<->libavformat situation, allow me
to plug this patch again
https://ffmpeg.org/pipermail/ffmpeg-devel/2022-March/294747.html.
https://ffmpeg.org/pipermail/ffmpeg-devel/2022-March/294746.html has
links to previous discussions of the issue.

I hope you and others who chimed in before (e.g., Nicolas, Anton) have
a chance to look at this potential solution.

Thanks and all the best,
Dee
diff mbox series

Patch

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;