diff options
author | Nicolas George | 2012-07-30 00:34:01 +0200 |
---|---|---|
committer | Nicolas George | 2012-08-28 15:09:49 +0200 |
commit | 786dadc014fd2bb690ec254272c809c1d3f41866 (patch) | |
tree | 990cb9c2875df6afe99a858124eb5df6aa28f3b1 /cmdutils.c | |
parent | 61e262f6d7b86172d56b8363dfc105f70261d233 (diff) |
cmdutils: add -layouts option.
Extract of the output:
| Individual channels:
| NAME DESCRIPTION
| FL front left
| FR front right
| <snip>
| SDR surround direct right
|
| Standard channel layouts:
| NAME DECOMPOSITION
| mono FC
| stereo FL+FR
| <snip>
| octagonal FL+FR+FC+BL+BR+BC+SL+SR
| downmix DL+DR
Diffstat (limited to 'cmdutils.c')
-rw-r--r-- | cmdutils.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/cmdutils.c b/cmdutils.c index a5871c3207..619a4a81e5 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -1087,6 +1087,35 @@ int show_pix_fmts(const char *opt, const char *arg) return 0; } +int show_layouts(const char *opt, const char *arg) +{ + int i = 0; + uint64_t layout, j; + const char *name, *descr; + + printf("Individual channels:\n" + "NAME DESCRIPTION\n"); + for (i = 0; i < 63; i++) { + name = av_get_channel_name((uint64_t)1 << i); + if (!name) + continue; + descr = av_get_channel_description((uint64_t)1 << i); + printf("%-12s%s\n", name, descr); + } + printf("\nStandard channel layouts:\n" + "NAME DECOMPOSITION\n"); + for (i = 0; !av_get_standard_channel_layout(i, &layout, &name); i++) { + if (name) { + printf("%-12s", name); + for (j = 1; j; j <<= 1) + if ((layout & j)) + printf("%s%s", (layout & (j - 1)) ? "+" : "", av_get_channel_name(j)); + printf("\n"); + } + } + return 0; +} + int show_sample_fmts(const char *opt, const char *arg) { int i; |