[FFmpeg-devel] avformat: remove unused MP4A_LATM flag

Submitted by Gyan on June 10, 2018, 3 p.m.

Details

Message ID 225ab88a-809e-2d58-0c19-3922d49054c0@gmail.com
State New
Headers show

Commit Message

Gyan June 10, 2018, 3 p.m.
From 5d3ab077f46fe14eaf5aa1246f975d847cf85e29 Mon Sep 17 00:00:00 2001
From: Gyan Doshi <ffmpeg@gyani.pro>
Date: Sun, 10 Jun 2018 20:18:10 +0530
Subject: [PATCH] avformat: remove unused MP4A_LATM flag

A generic lavf option for AAC LATM packetization for the RTP muxer was
added in ef409645f0 and then made inert 20 days later in 0832122880
when a private muxer option was added and the generic flag no longer
read.
---
 doc/formats.texi            | 2 --
 libavformat/avformat.h      | 1 -
 libavformat/options_table.h | 1 -
 libavformat/rtpenc_chain.c  | 2 +-
 4 files changed, 1 insertion(+), 5 deletions(-)

Comments

Gyan June 12, 2018, 4:59 a.m.
Will push tomorrow.
Hendrik Leppkes June 12, 2018, 8:09 a.m.
On Tue, Jun 12, 2018 at 7:00 AM Gyan Doshi <gyandoshi@gmail.com> wrote:
>
>
> Will push tomorrow.

This flag is part of the public API, and eventhough it is entirely
unused, you cannot remove public API without a proper deprecation
period.

- Hendrik
Gyan June 12, 2018, 8:33 a.m.
On 12-06-2018 01:39 PM, Hendrik Leppkes wrote:

> This flag is part of the public API, and eventhough it is entirely
> unused, you cannot remove public API without a proper deprecation
> period.

Ok, so looking at older flags, I need to

add a define to version.h, something like

#ifndef FF_API_LAVF_MP4A_LATM
#define FF_API_LAVF_MP4A_LATM    (LIBAVFORMAT_VERSION_MAJOR < 59)
#endif

and place the flag under guard in avformat.h

And place same guard in the options table.

Is that correct?

I assume the other changes can be committed as-is.

Thanks,
Gyan
James Almer June 12, 2018, 5:30 p.m.
On 6/12/2018 5:33 AM, Gyan Doshi wrote:
> 
> 
> On 12-06-2018 01:39 PM, Hendrik Leppkes wrote:
> 
>> This flag is part of the public API, and eventhough it is entirely
>> unused, you cannot remove public API without a proper deprecation
>> period.
> 
> Ok, so looking at older flags, I need to
> 
> add a define to version.h, something like
> 
> #ifndef FF_API_LAVF_MP4A_LATM
> #define FF_API_LAVF_MP4A_LATM    (LIBAVFORMAT_VERSION_MAJOR < 59)
> #endif
> 
> and place the flag under guard in avformat.h
> 
> And place same guard in the options table.

Change the description of the option in this table into something like
"Deprecated, does nothing" while at it as well.

> 
> Is that correct?
> 
> I assume the other changes can be committed as-is.

Yes, that should do it.

> 
> Thanks,
> Gyan
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Gyan June 13, 2018, 5:03 a.m.
On 12-06-2018 11:00 PM, James Almer wrote:

>> Is that correct?
>>
>> I assume the other changes can be committed as-is.
> 
> Yes, that should do it.

Revised and pushed.

Thanks,
Gyan

Patch hide | download patch | download mbox

diff --git a/doc/formats.texi b/doc/formats.texi
index ddd7743548..e29bc501c3 100644
--- a/doc/formats.texi
+++ b/doc/formats.texi
@@ -53,8 +53,6 @@  Discard corrupted frames.
 Try to interleave output packets by DTS.
 @item keepside
 Do not merge side data.
-@item latm
-Enable RTP MP4A-LATM payload.
 @item nobuffer
 Reduce the latency introduced by optional buffering
 @item bitexact
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index ade918f99c..875e20e8c4 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1483,7 +1483,6 @@  typedef struct AVFormatContext {
  * This flag is mainly intended for testing.
  */
 #define AVFMT_FLAG_BITEXACT         0x0400
-#define AVFMT_FLAG_MP4A_LATM    0x8000 ///< Enable RTP MP4A-LATM payload
 #define AVFMT_FLAG_SORT_DTS    0x10000 ///< try to interleave outputted packets by dts (using this flag can slow demuxing down)
 #define AVFMT_FLAG_PRIV_OPT    0x20000 ///< Enable use of private options by delaying codec open (this could be made default once all code is converted)
 #if FF_API_LAVF_KEEPSIDE_FLAG
diff --git a/libavformat/options_table.h b/libavformat/options_table.h
index b7a5b3c054..fc6ba4387d 100644
--- a/libavformat/options_table.h
+++ b/libavformat/options_table.h
@@ -52,7 +52,6 @@  static const AVOption avformat_options[] = {
 {"keepside", "deprecated, does nothing", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_KEEP_SIDE_DATA }, INT_MIN, INT_MAX, D, "fflags"},
 #endif
 {"fastseek", "fast but inaccurate seeks", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_FAST_SEEK }, INT_MIN, INT_MAX, D, "fflags"},
-{"latm", "enable RTP MP4A-LATM payload", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_MP4A_LATM }, INT_MIN, INT_MAX, E, "fflags"},
 {"nobuffer", "reduce the latency introduced by optional buffering", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_NOBUFFER }, 0, INT_MAX, D, "fflags"},
 {"bitexact", "do not write random/volatile data", 0, AV_OPT_TYPE_CONST, { .i64 = AVFMT_FLAG_BITEXACT }, 0, 0, E, "fflags" },
 {"shortest", "stop muxing with the shortest stream", 0, AV_OPT_TYPE_CONST, { .i64 = AVFMT_FLAG_SHORTEST }, 0, 0, E, "fflags" },
diff --git a/libavformat/rtpenc_chain.c b/libavformat/rtpenc_chain.c
index e69fdc27cf..d3c1bc96dc 100644
--- a/libavformat/rtpenc_chain.c
+++ b/libavformat/rtpenc_chain.c
@@ -58,7 +58,7 @@  int ff_rtp_chain_mux_open(AVFormatContext **out, AVFormatContext *s,
     rtpctx->max_delay = s->max_delay;
     /* Copy other stream parameters. */
     rtpctx->streams[0]->sample_aspect_ratio = st->sample_aspect_ratio;
-    rtpctx->flags |= s->flags & (AVFMT_FLAG_MP4A_LATM | AVFMT_FLAG_BITEXACT);
+    rtpctx->flags |= s->flags & AVFMT_FLAG_BITEXACT;
 
     /* Get the payload type from the codec */
     if (st->id < RTP_PT_PRIVATE)