Blame src/devtools/strings.h

Packit 5e46da
/*
Packit 5e46da
 * This file is part of libbluray
Packit 5e46da
 * Copyright (C) 2009-2010  John Stebbins
Packit 5e46da
 *
Packit 5e46da
 * This library is free software; you can redistribute it and/or
Packit 5e46da
 * modify it under the terms of the GNU Lesser General Public
Packit 5e46da
 * License as published by the Free Software Foundation; either
Packit 5e46da
 * version 2.1 of the License, or (at your option) any later version.
Packit 5e46da
 *
Packit 5e46da
 * This library is distributed in the hope that it will be useful,
Packit 5e46da
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 5e46da
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 5e46da
 * Lesser General Public License for more details.
Packit 5e46da
 *
Packit 5e46da
 * You should have received a copy of the GNU Lesser General Public
Packit 5e46da
 * License along with this library. If not, see
Packit 5e46da
 * <http://www.gnu.org/licenses/>.
Packit 5e46da
 */
Packit 5e46da
Packit 5e46da
typedef struct {
Packit 5e46da
    int value;
Packit 5e46da
    const char *str;
Packit 5e46da
} VALUE_MAP;
Packit 5e46da
Packit 5e46da
const VALUE_MAP codec_map[] = {
Packit 5e46da
    {0x01, "MPEG-1 Video"},
Packit 5e46da
    {0x02, "MPEG-2 Video"},
Packit 5e46da
    {0x03, "MPEG-1 Audio"},
Packit 5e46da
    {0x04, "MPEG-2 Audio"},
Packit 5e46da
    {0x80, "LPCM"},
Packit 5e46da
    {0x81, "AC-3"},
Packit 5e46da
    {0x82, "DTS"},
Packit 5e46da
    {0x83, "TrueHD"},
Packit 5e46da
    {0x84, "AC-3 Plus"},
Packit 5e46da
    {0x85, "DTS-HD"},
Packit 5e46da
    {0x86, "DTS-HD Master"},
Packit 5e46da
    {0xa1, "AC-3 Plus for secondary audio"},
Packit 5e46da
    {0xa2, "DTS-HD for secondary audio"},
Packit 5e46da
    {0xea, "VC-1"},
Packit 5e46da
    {0x1b, "H.264"},
Packit 5e46da
    {0x20, "H.264 MVC dep."},
Packit 5e46da
    {0x24, "HEVC"},
Packit 5e46da
    {0x90, "Presentation Graphics"},
Packit 5e46da
    {0x91, "Presentation Graphics"},
Packit 5e46da
    {0x92, "Interactive Graphics"},
Packit 5e46da
    {0, NULL}
Packit 5e46da
};
Packit 5e46da
Packit 5e46da
const VALUE_MAP video_format_map[] = {
Packit 5e46da
    {0, "Reserved"},
Packit 5e46da
    {1, "480i"},
Packit 5e46da
    {2, "576i"},
Packit 5e46da
    {3, "480p"},
Packit 5e46da
    {4, "1080i"},
Packit 5e46da
    {5, "720p"},
Packit 5e46da
    {6, "1080p"},
Packit 5e46da
    {7, "576p"},
Packit 5e46da
    {8, "2160p"},
Packit 5e46da
    {0, NULL}
Packit 5e46da
};
Packit 5e46da
Packit 5e46da
const VALUE_MAP video_rate_map[] = {
Packit 5e46da
    {0, "Reserved1"},
Packit 5e46da
    {1, "23.976"},
Packit 5e46da
    {2, "24"},
Packit 5e46da
    {3, "25"},
Packit 5e46da
    {4, "29.97"},
Packit 5e46da
    {5, "Reserved2"},
Packit 5e46da
    {6, "50"},
Packit 5e46da
    {7, "59.94"},
Packit 5e46da
    {0, NULL}
Packit 5e46da
};
Packit 5e46da
Packit 5e46da
const VALUE_MAP audio_format_map[] = {
Packit 5e46da
    {0, "Reserved1"},
Packit 5e46da
    {1, "Mono"},
Packit 5e46da
    {2, "Reserved2"},
Packit 5e46da
    {3, "Stereo"},
Packit 5e46da
    {4, "Reserved3"},
Packit 5e46da
    {5, "Reserved4"},
Packit 5e46da
    {6, "Multi Channel"},
Packit 5e46da
    {12, "Combo"},
Packit 5e46da
    {0, NULL}
Packit 5e46da
};
Packit 5e46da
Packit 5e46da
const VALUE_MAP audio_rate_map[] = {
Packit 5e46da
    {0, "Reserved1"},
Packit 5e46da
    {1, "48 Khz"},
Packit 5e46da
    {2, "Reserved2"},
Packit 5e46da
    {3, "Reserved3"},
Packit 5e46da
    {4, "96 Khz"},
Packit 5e46da
    {5, "192 Khz"},
Packit 5e46da
    {12, "48/192 Khz"},
Packit 5e46da
    {14, "48/96 Khz"},
Packit 5e46da
    {0, NULL}
Packit 5e46da
};
Packit 5e46da
Packit 5e46da
static inline const char *
Packit 5e46da
_lookup_str(const VALUE_MAP *map, int val)
Packit 5e46da
{
Packit 5e46da
    int ii;
Packit 5e46da
Packit 5e46da
    for (ii = 0; map[ii].str; ii++) {
Packit 5e46da
        if (val == map[ii].value) {
Packit 5e46da
            return map[ii].str;
Packit 5e46da
        }
Packit 5e46da
    }
Packit 5e46da
    return "?";
Packit 5e46da
}