Re: [FFmpeg-devel] [PATCH] avformat/mpegts: set AV_DISPOSITION_DEPENDENT for mix_type=0 supplementary audio

2018-02-21 Thread Michael Niedermayer
On Fri, Feb 16, 2018 at 11:06:39AM -0800, Aman Gupta wrote:
> From: Aman Gupta 
> 
> ---
>  fftools/ffmpeg.c   | 1 +
>  libavformat/avformat.h | 1 +
>  libavformat/dump.c | 2 ++
>  libavformat/mpegts.c   | 3 +++
>  4 files changed, 7 insertions(+)
> 
> diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
> index a37de2ff98..bea922b0aa 100644
> --- a/fftools/ffmpeg.c
> +++ b/fftools/ffmpeg.c
> @@ -3592,6 +3592,7 @@ static int init_output_stream(OutputStream *ost, char 
> *error, int error_len)
>  { "clean_effects"   , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 
> AV_DISPOSITION_CLEAN_EFFECTS },.unit = "flags" },
>  { "captions", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 
> AV_DISPOSITION_CAPTIONS  },.unit = "flags" },
>  { "descriptions", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 
> AV_DISPOSITION_DESCRIPTIONS  },.unit = "flags" },
> +{ "dependent"   , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 
> AV_DISPOSITION_DEPENDENT },.unit = "flags" },
>  { "metadata", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 
> AV_DISPOSITION_METADATA  },.unit = "flags" },
>  { NULL },
>  };


> diff --git a/libavformat/avformat.h b/libavformat/avformat.h
> index 4ea1b5ab72..78e87be8fb 100644
> --- a/libavformat/avformat.h
> +++ b/libavformat/avformat.h
> @@ -845,6 +845,7 @@ typedef struct AVStreamInternal AVStreamInternal;
>  #define AV_DISPOSITION_CAPTIONS 0x1
>  #define AV_DISPOSITION_DESCRIPTIONS 0x2
>  #define AV_DISPOSITION_METADATA 0x4
> +#define AV_DISPOSITION_DEPENDENT0x8
>  

These all should have more documentation (relevant for teh patch is just the
newly added one of course)

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Does the universe only have a finite lifespan? No, its going to go on
forever, its just that you wont like living in it. -- Hiranya Peiri


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/mpegts: set AV_DISPOSITION_DEPENDENT for mix_type=0 supplementary audio

2018-02-19 Thread Aman Gupta
On Fri, Feb 16, 2018 at 11:06 AM, Aman Gupta  wrote:

> From: Aman Gupta 
>
> ---
>  fftools/ffmpeg.c   | 1 +
>  libavformat/avformat.h | 1 +
>  libavformat/dump.c | 2 ++
>  libavformat/mpegts.c   | 3 +++
>  4 files changed, 7 insertions(+)
>
> diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
> index a37de2ff98..bea922b0aa 100644
> --- a/fftools/ffmpeg.c
> +++ b/fftools/ffmpeg.c
> @@ -3592,6 +3592,7 @@ static int init_output_stream(OutputStream *ost,
> char *error, int error_len)
>  { "clean_effects"   , NULL, 0, AV_OPT_TYPE_CONST, { .i64
> = AV_DISPOSITION_CLEAN_EFFECTS },.unit = "flags" },
>  { "captions", NULL, 0, AV_OPT_TYPE_CONST, { .i64
> = AV_DISPOSITION_CAPTIONS  },.unit = "flags" },
>  { "descriptions", NULL, 0, AV_OPT_TYPE_CONST, { .i64
> = AV_DISPOSITION_DESCRIPTIONS  },.unit = "flags" },
> +{ "dependent"   , NULL, 0, AV_OPT_TYPE_CONST, { .i64
> = AV_DISPOSITION_DEPENDENT },.unit = "flags" },
>  { "metadata", NULL, 0, AV_OPT_TYPE_CONST, { .i64
> = AV_DISPOSITION_METADATA  },.unit = "flags" },
>  { NULL },
>  };
> diff --git a/libavformat/avformat.h b/libavformat/avformat.h
> index 4ea1b5ab72..78e87be8fb 100644
> --- a/libavformat/avformat.h
> +++ b/libavformat/avformat.h
> @@ -845,6 +845,7 @@ typedef struct AVStreamInternal AVStreamInternal;
>  #define AV_DISPOSITION_CAPTIONS 0x1
>  #define AV_DISPOSITION_DESCRIPTIONS 0x2
>  #define AV_DISPOSITION_METADATA 0x4
> +#define AV_DISPOSITION_DEPENDENT0x8
>

I know there's a limited number of bits available for flags, but I think
this one makes sense to add and doesn't overlap with any of the existing
options.

Any objections?

Aman


>
>  /**
>   * Options for behavior on timestamp wrap detection.
> diff --git a/libavformat/dump.c b/libavformat/dump.c
> index ef143fd4e2..3a1379c356 100644
> --- a/libavformat/dump.c
> +++ b/libavformat/dump.c
> @@ -547,6 +547,8 @@ static void dump_stream_format(AVFormatContext *ic,
> int i,
>  av_log(NULL, AV_LOG_INFO, " (visual impaired)");
>  if (st->disposition & AV_DISPOSITION_CLEAN_EFFECTS)
>  av_log(NULL, AV_LOG_INFO, " (clean effects)");
> +if (st->disposition & AV_DISPOSITION_DEPENDENT)
> +av_log(NULL, AV_LOG_INFO, " (dependent)");
>  av_log(NULL, AV_LOG_INFO, "\n");
>
>  dump_metadata(NULL, st->metadata, "");
> diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
> index e5d0e1eefb..5f547b591b 100644
> --- a/libavformat/mpegts.c
> +++ b/libavformat/mpegts.c
> @@ -1904,6 +1904,9 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc,
> AVStream *st, int stream_type
>  return AVERROR_INVALIDDATA;
>  flags = get8(pp, desc_end);
>
> +if ((flags & 0x80) == 0) /* mix_type */
> +st->disposition |= AV_DISPOSITION_DEPENDENT;
> +
>  switch ((flags >> 2) & 0x1F) {
>  case 0x01:
>  st->disposition |= AV_DISPOSITION_VISUAL_IMPAIRED;
> --
> 2.14.2
>
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel