diff options
author | Vittorio Giovara | 2016-04-21 17:24:07 -0400 |
---|---|---|
committer | Vittorio Giovara | 2016-05-17 12:25:27 -0400 |
commit | 0c4468dc185fa8b9e7d6add914595c5e928b24fd (patch) | |
tree | 72ca617953ba608bf21bb3584058770a353d11e2 /libavformat/dump.c | |
parent | d621b2f795684f7119057f986066060adbe84220 (diff) |
stereo3d: Add API to get name from value or value from name
Use it in av_dump_format() instead of a huge switch case.
Diffstat (limited to 'libavformat/dump.c')
-rw-r--r-- | libavformat/dump.c | 31 |
1 files changed, 2 insertions, 29 deletions
diff --git a/libavformat/dump.c b/libavformat/dump.c index a66e48ca11..bef0e76b80 100644 --- a/libavformat/dump.c +++ b/libavformat/dump.c @@ -233,6 +233,7 @@ static void dump_replaygain(void *ctx, AVPacketSideData *sd) static void dump_stereo3d(void *ctx, AVPacketSideData *sd) { AVStereo3D *stereo; + const char *name; if (sd->size < sizeof(*stereo)) { av_log(ctx, AV_LOG_INFO, "invalid data"); @@ -241,35 +242,7 @@ 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; - } + av_log(ctx, AV_LOG_INFO, "%s", av_stereo3d_type_name(stereo->type)); if (stereo->flags & AV_STEREO3D_FLAG_INVERT) av_log(ctx, AV_LOG_INFO, " (inverted)"); |