diff mbox series

[FFmpeg-devel,v2,3/5] avformat/dump: dump AV_PKT_DATA_MPEGTS_6A_DESC side data

Message ID 1596121138-20997-3-git-send-email-lance.lmwang@gmail.com
State New
Headers show
Series [FFmpeg-devel,v2,1/5] avutil/mpegts_audio_desc_metadata: add helper function for AC3 descriptor 0x6a | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Lance Wang July 30, 2020, 2:58 p.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavformat/dump.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Comments

Moritz Barsnick Aug. 7, 2020, 6:39 a.m. UTC | #1
On Thu, Jul 30, 2020 at 22:58:56 +0800, lance.lmwang@gmail.com wrote:
>  #include "libavutil/dovi_meta.h"
> +#include "libavutil//mpegts_audio_desc_metadata.h"
                      ^^
A duplicate slash slipped in there.

> +    av_log(ctx, AV_LOG_INFO, "component_type_flag: %u, bsid_flag: %u, "
> +           "mainid_flag: %u, asvc_flag: %u, "
> +           "component_type: %u, bsid: %u, mainid: %u, asvc: %u",
> +           desc6a->component_type_flag, desc6a->bsid_flag,
> +           desc6a->mainid_flag, desc6a->asvc_flag,
> +           desc6a->component_type, desc6a->bsid, desc6a->mainid, desc6a->asvc);
> +}

Would it be more correct to just dump the actually existing values,
i.e. those whose flag is 1? (I understand the flags say whether the
value exists. What is printed for the value if it doesn't exist?)

Moritz
Lance Wang Aug. 7, 2020, 3 p.m. UTC | #2
On Fri, Aug 07, 2020 at 08:39:31AM +0200, Moritz Barsnick wrote:
> On Thu, Jul 30, 2020 at 22:58:56 +0800, lance.lmwang@gmail.com wrote:
> >  #include "libavutil/dovi_meta.h"
> > +#include "libavutil//mpegts_audio_desc_metadata.h"
>                       ^^
> A duplicate slash slipped in there.

Good catch, will fix it if patch will update.

> 
> > +    av_log(ctx, AV_LOG_INFO, "component_type_flag: %u, bsid_flag: %u, "
> > +           "mainid_flag: %u, asvc_flag: %u, "
> > +           "component_type: %u, bsid: %u, mainid: %u, asvc: %u",
> > +           desc6a->component_type_flag, desc6a->bsid_flag,
> > +           desc6a->mainid_flag, desc6a->asvc_flag,
> > +           desc6a->component_type, desc6a->bsid, desc6a->mainid, desc6a->asvc);
> > +}
> 
> Would it be more correct to just dump the actually existing values,
> i.e. those whose flag is 1? (I understand the flags say whether the
> value exists. What is printed for the value if it doesn't exist?)

Sure, it's more correct to print these field which is flag as 1. I consider it's 
more helpful to print the sample rate, channel nuber etc by those field map. But
it'll add more code for the mapping, so I choose to print it only.

> 
> Moritz
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/libavformat/dump.c b/libavformat/dump.c
index 6d29d85..249789a 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -28,6 +28,7 @@ 
 #include "libavutil/log.h"
 #include "libavutil/mastering_display_metadata.h"
 #include "libavutil/dovi_meta.h"
+#include "libavutil//mpegts_audio_desc_metadata.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/opt.h"
 #include "libavutil/avstring.h"
@@ -424,6 +425,19 @@  static void dump_s12m_timecode(void *ctx, const AVPacketSideData *sd)
     }
 }
 
+static void dump_desc6a_conf(void *ctx, const AVPacketSideData *sd)
+{
+    const AVDescriptor6A *desc6a = (const AVDescriptor6A *)sd->data;
+
+    av_log(ctx, AV_LOG_INFO, "component_type_flag: %u, bsid_flag: %u, "
+           "mainid_flag: %u, asvc_flag: %u, "
+           "component_type: %u, bsid: %u, mainid: %u, asvc: %u",
+           desc6a->component_type_flag, desc6a->bsid_flag,
+           desc6a->mainid_flag, desc6a->asvc_flag,
+           desc6a->component_type, desc6a->bsid, desc6a->mainid, desc6a->asvc);
+}
+
+
 static void dump_sidedata(void *ctx, const AVStream *st, const char *indent)
 {
     int i;
@@ -494,6 +508,10 @@  static void dump_sidedata(void *ctx, const AVStream *st, const char *indent)
             av_log(ctx, AV_LOG_INFO, "SMPTE ST 12-1:2014: ");
             dump_s12m_timecode(ctx, sd);
             break;
+        case AV_PKT_DATA_MPEGTS_DESC_6A:
+            av_log(ctx, AV_LOG_INFO, "ETSI 300 468 descriptor 0x6A(AC-3): ");
+            dump_desc6a_conf(ctx, sd);
+            break;
         default:
             av_log(ctx, AV_LOG_INFO,
                    "unknown side data type %d (%d bytes)", sd->type, sd->size);