diff mbox series

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

Message ID 1595948614-10861-3-git-send-email-lance.lmwang@gmail.com
State Superseded
Headers show
Series [FFmpeg-devel,1/5] API: add AV_PKT_DATA_MPEGTS_DESC_6A to AVPacketSideDataType
Related show

Checks

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

Commit Message

Limin Wang July 28, 2020, 3:03 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(+)
diff mbox series

Patch

diff --git a/libavformat/dump.c b/libavformat/dump.c
index 6d29d85..b2e9721 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);