[FFmpeg-devel] [PATCH 2/2] lavf/dump + lavfi/vf_showinfo: use av_stereo3d formatting functions
Rodger Combs
rodger.combs at gmail.com
Wed Oct 28 03:44:18 CET 2015
---
libavfilter/vf_showinfo.c | 18 ++----------------
libavformat/dump.c | 34 ++--------------------------------
2 files changed, 4 insertions(+), 48 deletions(-)
diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c
index 5125944..9a3708c 100644
--- a/libavfilter/vf_showinfo.c
+++ b/libavfilter/vf_showinfo.c
@@ -48,22 +48,8 @@ static void dump_stereo3d(AVFilterContext *ctx, AVFrameSideData *sd)
stereo = (AVStereo3D *)sd->data;
- av_log(ctx, AV_LOG_INFO, "type - ");
- switch (stereo->type) {
- case AV_STEREO3D_2D: av_log(ctx, AV_LOG_INFO, "2D"); break;
- case AV_STEREO3D_SIDEBYSIDE: av_log(ctx, AV_LOG_INFO, "side by side"); break;
- case AV_STEREO3D_TOPBOTTOM: av_log(ctx, AV_LOG_INFO, "top and bottom"); break;
- case AV_STEREO3D_FRAMESEQUENCE: av_log(ctx, AV_LOG_INFO, "frame alternate"); break;
- case AV_STEREO3D_CHECKERBOARD: av_log(ctx, AV_LOG_INFO, "checkerboard"); break;
- case AV_STEREO3D_LINES: av_log(ctx, AV_LOG_INFO, "interleaved lines"); break;
- case AV_STEREO3D_COLUMNS: av_log(ctx, AV_LOG_INFO, "interleaved columns"); break;
- case AV_STEREO3D_SIDEBYSIDE_QUINCUNX: av_log(ctx, AV_LOG_INFO, "side by side "
- "(quincunx subsampling)"); break;
- default: av_log(ctx, AV_LOG_WARNING, "unknown"); break;
- }
-
- if (stereo->flags & AV_STEREO3D_FLAG_INVERT)
- av_log(ctx, AV_LOG_INFO, " (inverted)");
+ av_log(ctx, av_stereo3d_type_is_valid(stereo->type) ? AV_LOG_INFO : AV_LOG_WARNING,
+ "type - %s", av_stereo3d2str(stereo));
}
static void update_sample_stats(const uint8_t *src, int len, int64_t *sum, int64_t *sum2)
diff --git a/libavformat/dump.c b/libavformat/dump.c
index 7ed7665..96df362 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -259,38 +259,8 @@ static void dump_stereo3d(void *ctx, AVPacketSideData *sd)
stereo = (AVStereo3D *)sd->data;
- switch (stereo->type) {
- case AV_STEREO3D_2D:
- av_log(ctx, AV_LOG_INFO, "2D");
- break;
- case AV_STEREO3D_SIDEBYSIDE:
- av_log(ctx, AV_LOG_INFO, "side by side");
- break;
- case AV_STEREO3D_TOPBOTTOM:
- av_log(ctx, AV_LOG_INFO, "top and bottom");
- break;
- case AV_STEREO3D_FRAMESEQUENCE:
- av_log(ctx, AV_LOG_INFO, "frame alternate");
- break;
- case AV_STEREO3D_CHECKERBOARD:
- av_log(ctx, AV_LOG_INFO, "checkerboard");
- break;
- case AV_STEREO3D_LINES:
- av_log(ctx, AV_LOG_INFO, "interleaved lines");
- break;
- case AV_STEREO3D_COLUMNS:
- av_log(ctx, AV_LOG_INFO, "interleaved columns");
- break;
- case AV_STEREO3D_SIDEBYSIDE_QUINCUNX:
- av_log(ctx, AV_LOG_INFO, "side by side (quincunx subsampling)");
- break;
- default:
- av_log(ctx, AV_LOG_WARNING, "unknown");
- break;
- }
-
- if (stereo->flags & AV_STEREO3D_FLAG_INVERT)
- av_log(ctx, AV_LOG_INFO, " (inverted)");
+ av_log(ctx, av_stereo3d_type_is_valid(stereo->type) ? AV_LOG_INFO : AV_LOG_WARNING,
+ "%s", av_stereo3d2str((AVStereo3D *)sd->data));
}
static void dump_audioservicetype(void *ctx, AVPacketSideData *sd)
--
2.6.2
More information about the ffmpeg-devel
mailing list