FFmpeg
|
#include <assert.h>
#include <stdint.h>
#include "libavutil/avassert.h"
#include "libavutil/channel_layout.h"
#include "libavutil/mem.h"
#include "libavcodec/codec_id.h"
#include "mov_chan.h"
Go to the source code of this file.
Data Structures | |
struct | MovChannelLayoutMap |
Macros | |
#define | TAG(_tag, _cnt) {.tag = _tag} |
#define | ID(_0) {.id = c_##_0} |
#define | CHLIST01(_tag, _1) CHLIST(_tag, 1, ID(_1)) |
#define | CHLIST02(_tag, _1, _2) CHLIST(_tag, 2, ID(_1), ID(_2)) |
#define | CHLIST03(_tag, _1, _2, _3) CHLIST(_tag, 3, ID(_1), ID(_2), ID(_3)) |
#define | CHLIST04(_tag, _1, _2, _3, _4) CHLIST(_tag, 4, ID(_1), ID(_2), ID(_3), ID(_4)) |
#define | CHLIST05(_tag, _1, _2, _3, _4, _5) CHLIST(_tag, 5, ID(_1), ID(_2), ID(_3), ID(_4), ID(_5)) |
#define | CHLIST06(_tag, _1, _2, _3, _4, _5, _6) CHLIST(_tag, 6, ID(_1), ID(_2), ID(_3), ID(_4), ID(_5), ID(_6)) |
#define | CHLIST07(_tag, _1, _2, _3, _4, _5, _6, _7) CHLIST(_tag, 7, ID(_1), ID(_2), ID(_3), ID(_4), ID(_5), ID(_6), ID(_7)) |
#define | CHLIST08(_tag, _1, _2, _3, _4, _5, _6, _7, _8) CHLIST(_tag, 8, ID(_1), ID(_2), ID(_3), ID(_4), ID(_5), ID(_6), ID(_7), ID(_8)) |
#define | CHLIST09(_tag, _1, _2, _3, _4, _5, _6, _7, _8, _9) CHLIST(_tag, 9, ID(_1), ID(_2), ID(_3), ID(_4), ID(_5), ID(_6), ID(_7), ID(_8), ID(_9)) |
#define | CHLIST16(_tag, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16) |
#define | CHLIST21(_tag, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21) |
#define | CHLIST24(_tag, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24) |
#define | MOV_CH_LAYOUT_MAP |
#define | CHLIST(_tag, _cnt, ...) static_assert((_tag & 0xffff) == _cnt, "Channel count of " #_tag " is not " #_cnt); |
#define | CHLIST(_tag, _cnt, ...) TAG(_tag, _cnt), __VA_ARGS__, |
#define | ID(_0) {.id = iso_##_0} |
#define | TAG(_tag, _cnt) {.tag = (_tag << 16) | _cnt} |
Enumerations | |
enum | { c_L = AV_CHAN_FRONT_LEFT, c_R = AV_CHAN_FRONT_RIGHT, c_C = AV_CHAN_FRONT_CENTER, c_LFE = AV_CHAN_LOW_FREQUENCY, c_Rls = AV_CHAN_BACK_LEFT, c_Rrs = AV_CHAN_BACK_RIGHT, c_Lc = AV_CHAN_FRONT_LEFT_OF_CENTER, c_Rc = AV_CHAN_FRONT_RIGHT_OF_CENTER, c_Cs = AV_CHAN_BACK_CENTER, c_Ls = AV_CHAN_SIDE_LEFT, c_Rs = AV_CHAN_SIDE_RIGHT, c_Ts = AV_CHAN_TOP_CENTER, c_Vhl = AV_CHAN_TOP_FRONT_LEFT, c_Vhc = AV_CHAN_TOP_FRONT_CENTER, c_Vhr = AV_CHAN_TOP_FRONT_RIGHT, c_Rlt = AV_CHAN_TOP_BACK_LEFT, c_Rrt = AV_CHAN_TOP_BACK_RIGHT, c_Lt = AV_CHAN_STEREO_LEFT, c_Rt = AV_CHAN_STEREO_RIGHT, c_Lw = AV_CHAN_WIDE_LEFT, c_Rw = AV_CHAN_WIDE_RIGHT, c_Lsd = AV_CHAN_SURROUND_DIRECT_LEFT, c_Rsd = AV_CHAN_SURROUND_DIRECT_RIGHT, c_LFE2 = AV_CHAN_LOW_FREQUENCY_2, c_W = AV_CHAN_AMBISONIC_BASE, c_Y = AV_CHAN_AMBISONIC_BASE + 1, c_Z = AV_CHAN_AMBISONIC_BASE + 2, c_X = AV_CHAN_AMBISONIC_BASE + 3, c_LFE1 = AV_CHAN_LOW_FREQUENCY, c_Csd = AV_CHAN_NONE, c_HI = AV_CHAN_NONE, c_VI = AV_CHAN_NONE, c_Haptic = AV_CHAN_NONE } |
mov 'chan' tag reading/writing. More... | |
enum | { iso_L = AV_CHAN_FRONT_LEFT, iso_R = AV_CHAN_FRONT_RIGHT, iso_C = AV_CHAN_FRONT_CENTER, iso_LFE = AV_CHAN_LOW_FREQUENCY, iso_Lsr = AV_CHAN_BACK_LEFT, iso_Rsr = AV_CHAN_BACK_RIGHT, iso_Lc = AV_CHAN_FRONT_LEFT_OF_CENTER, iso_Rc = AV_CHAN_FRONT_RIGHT_OF_CENTER, iso_Cs = AV_CHAN_BACK_CENTER, iso_Ls = AV_CHAN_SIDE_LEFT, iso_Rs = AV_CHAN_SIDE_RIGHT, iso_Ts = AV_CHAN_TOP_CENTER, iso_Lv = AV_CHAN_TOP_FRONT_LEFT, iso_Cv = AV_CHAN_TOP_FRONT_CENTER, iso_Rv = AV_CHAN_TOP_FRONT_RIGHT, iso_Lvr = AV_CHAN_TOP_BACK_LEFT, iso_Cvr = AV_CHAN_TOP_BACK_CENTER, iso_Rvr = AV_CHAN_TOP_BACK_RIGHT, iso_Lw = AV_CHAN_WIDE_LEFT, iso_Rw = AV_CHAN_WIDE_RIGHT, iso_Lsd = AV_CHAN_SURROUND_DIRECT_LEFT, iso_Rsd = AV_CHAN_SURROUND_DIRECT_RIGHT, iso_LFE2 = AV_CHAN_LOW_FREQUENCY_2, iso_Lvss = AV_CHAN_TOP_SIDE_LEFT, iso_Rvss = AV_CHAN_TOP_SIDE_RIGHT, iso_Cb = AV_CHAN_BOTTOM_FRONT_CENTER, iso_Lb = AV_CHAN_BOTTOM_FRONT_LEFT, iso_Rb = AV_CHAN_BOTTOM_FRONT_RIGHT, iso_Lss = AV_CHAN_SIDE_SURROUND_LEFT, iso_Rss = AV_CHAN_SIDE_SURROUND_RIGHT, iso_Lvs = AV_CHAN_NONE, iso_Rvs = AV_CHAN_NONE } |
Functions | |
static const struct MovChannelLayoutMap * | find_layout_map (uint32_t tag, const struct MovChannelLayoutMap *map) |
static int | mov_get_channel_layout (AVChannelLayout *ch_layout, uint32_t tag, uint64_t omitted_channel_map, const struct MovChannelLayoutMap *map) |
Get the channel layout for the specified non-special channel layout tag if known. More... | |
static enum AVChannel | mov_get_channel_id (uint32_t label) |
static uint32_t | mov_get_channel_label (enum AVChannel channel) |
static int | is_layout_valid_for_tag (const AVChannelLayout *ch_layout, uint32_t tag, const struct MovChannelLayoutMap *map) |
int | ff_mov_get_channel_layout_tag (const AVCodecParameters *par, uint32_t *layout, uint32_t *bitmap, uint32_t **pchannel_desc) |
Get the channel layout tag for the specified codec id and channel layout. More... | |
int | ff_mov_read_chan (AVFormatContext *s, AVIOContext *pb, AVStream *st, int64_t size) |
Read 'chan' tag from the input stream. More... | |
int | ff_mov_get_channel_config_from_layout (const AVChannelLayout *layout, int *config) |
Get ISO/IEC 23001-8 ChannelConfiguration from AVChannelLayout. More... | |
int | ff_mov_get_channel_layout_from_config (int config, AVChannelLayout *layout, uint64_t omitted_channel_map) |
Get AVChannelLayout from ISO/IEC 23001-8 ChannelConfiguration. More... | |
int | ff_mov_get_channel_positions_from_layout (const AVChannelLayout *layout, uint8_t *position, int position_num) |
Get ISO/IEC 23001-8 OutputChannelPosition from AVChannelLayout. More... | |
int | ff_mov_read_chnl (AVFormatContext *s, AVIOContext *pb, AVStream *st) |
Read 'chnl' tag from the input stream. More... | |
Variables | |
static const struct MovChannelLayoutMap | mov_ch_layout_map [] |
static const struct MovChannelLayoutMap | iso_ch_layout_map [] |
static enum MovChannelLayoutTag | mov_ch_layouts_aac [] |
static enum MovChannelLayoutTag | mov_ch_layouts_ac3 [] |
static enum MovChannelLayoutTag | mov_ch_layouts_alac [] |
static enum MovChannelLayoutTag | mov_ch_layouts_wav [] |
struct { | |
enum AVCodecID codec_id | |
enum MovChannelLayoutTag * layouts | |
} | mov_codec_ch_layouts [] |
static enum AVChannel | iso_channel_position [] |
#define TAG | ( | _tag, | |
_cnt | |||
) | {.tag = _tag} |
Definition at line 241 of file mov_chan.c.
#define ID | ( | _0 | ) | {.id = c_##_0} |
Definition at line 240 of file mov_chan.c.
Definition at line 125 of file mov_chan.c.
Definition at line 126 of file mov_chan.c.
Definition at line 127 of file mov_chan.c.
Definition at line 128 of file mov_chan.c.
#define CHLIST05 | ( | _tag, | |
_1, | |||
_2, | |||
_3, | |||
_4, | |||
_5 | |||
) | CHLIST(_tag, 5, ID(_1), ID(_2), ID(_3), ID(_4), ID(_5)) |
Definition at line 129 of file mov_chan.c.
#define CHLIST06 | ( | _tag, | |
_1, | |||
_2, | |||
_3, | |||
_4, | |||
_5, | |||
_6 | |||
) | CHLIST(_tag, 6, ID(_1), ID(_2), ID(_3), ID(_4), ID(_5), ID(_6)) |
Definition at line 130 of file mov_chan.c.
#define CHLIST07 | ( | _tag, | |
_1, | |||
_2, | |||
_3, | |||
_4, | |||
_5, | |||
_6, | |||
_7 | |||
) | CHLIST(_tag, 7, ID(_1), ID(_2), ID(_3), ID(_4), ID(_5), ID(_6), ID(_7)) |
Definition at line 131 of file mov_chan.c.
#define CHLIST08 | ( | _tag, | |
_1, | |||
_2, | |||
_3, | |||
_4, | |||
_5, | |||
_6, | |||
_7, | |||
_8 | |||
) | CHLIST(_tag, 8, ID(_1), ID(_2), ID(_3), ID(_4), ID(_5), ID(_6), ID(_7), ID(_8)) |
Definition at line 132 of file mov_chan.c.
#define CHLIST09 | ( | _tag, | |
_1, | |||
_2, | |||
_3, | |||
_4, | |||
_5, | |||
_6, | |||
_7, | |||
_8, | |||
_9 | |||
) | CHLIST(_tag, 9, ID(_1), ID(_2), ID(_3), ID(_4), ID(_5), ID(_6), ID(_7), ID(_8), ID(_9)) |
Definition at line 133 of file mov_chan.c.
#define CHLIST16 | ( | _tag, | |
_1, | |||
_2, | |||
_3, | |||
_4, | |||
_5, | |||
_6, | |||
_7, | |||
_8, | |||
_9, | |||
_10, | |||
_11, | |||
_12, | |||
_13, | |||
_14, | |||
_15, | |||
_16 | |||
) |
#define CHLIST21 | ( | _tag, | |
_1, | |||
_2, | |||
_3, | |||
_4, | |||
_5, | |||
_6, | |||
_7, | |||
_8, | |||
_9, | |||
_10, | |||
_11, | |||
_12, | |||
_13, | |||
_14, | |||
_15, | |||
_16, | |||
_17, | |||
_18, | |||
_19, | |||
_20, | |||
_21 | |||
) |
#define CHLIST24 | ( | _tag, | |
_1, | |||
_2, | |||
_3, | |||
_4, | |||
_5, | |||
_6, | |||
_7, | |||
_8, | |||
_9, | |||
_10, | |||
_11, | |||
_12, | |||
_13, | |||
_14, | |||
_15, | |||
_16, | |||
_17, | |||
_18, | |||
_19, | |||
_20, | |||
_21, | |||
_22, | |||
_23, | |||
_24 | |||
) |
#define MOV_CH_LAYOUT_MAP |
Definition at line 145 of file mov_chan.c.
#define CHLIST | ( | _tag, | |
_cnt, | |||
... | |||
) | static_assert((_tag & 0xffff) == _cnt, "Channel count of " #_tag " is not " #_cnt); |
Definition at line 232 of file mov_chan.c.
#define CHLIST | ( | _tag, | |
_cnt, | |||
... | |||
) | TAG(_tag, _cnt), __VA_ARGS__, |
Definition at line 232 of file mov_chan.c.
#define ID | ( | _0 | ) | {.id = iso_##_0} |
Definition at line 240 of file mov_chan.c.
#define TAG | ( | _tag, | |
_cnt | |||
) | {.tag = (_tag << 16) | _cnt} |
Definition at line 241 of file mov_chan.c.
anonymous enum |
mov 'chan' tag reading/writing.
Enumerator | |
---|---|
c_L | |
c_R | |
c_C | |
c_LFE | |
c_Rls | |
c_Rrs | |
c_Lc | |
c_Rc | |
c_Cs | |
c_Ls | |
c_Rs | |
c_Ts | |
c_Vhl | |
c_Vhc | |
c_Vhr | |
c_Rlt | |
c_Rrt | |
c_Lt | |
c_Rt | |
c_Lw | |
c_Rw | |
c_Lsd | |
c_Rsd | |
c_LFE2 | |
c_W | |
c_Y | |
c_Z | |
c_X | |
c_LFE1 | |
c_Csd | |
c_HI | |
c_VI | |
c_Haptic |
Definition at line 35 of file mov_chan.c.
anonymous enum |
Definition at line 78 of file mov_chan.c.
|
static |
Definition at line 355 of file mov_chan.c.
Referenced by is_layout_valid_for_tag(), and mov_get_channel_layout().
|
static |
Get the channel layout for the specified non-special channel layout tag if known.
[in,out] | ch_layout | channel layout |
[in] | tag | channel layout tag |
Definition at line 371 of file mov_chan.c.
Referenced by ff_mov_get_channel_layout_from_config(), and ff_mov_read_chan().
|
static |
Definition at line 403 of file mov_chan.c.
Referenced by ff_mov_read_chan().
|
static |
Definition at line 422 of file mov_chan.c.
Referenced by ff_mov_get_channel_layout_tag().
|
static |
Definition at line 441 of file mov_chan.c.
Referenced by ff_mov_get_channel_config_from_layout(), and ff_mov_get_channel_layout_tag().
int ff_mov_get_channel_layout_tag | ( | const AVCodecParameters * | par, |
uint32_t * | layout, | ||
uint32_t * | bitmap, | ||
uint32_t ** | pchannel_desc | ||
) |
Get the channel layout tag for the specified codec id and channel layout.
If the layout tag was not found, use a channel bitmap if possible.
[in] | codec_id | codec id |
[in] | channel_layout | channel layout |
[out] | bitmap | channel bitmap |
Definition at line 463 of file mov_chan.c.
Referenced by mov_write_chan_tag().
int ff_mov_read_chan | ( | AVFormatContext * | s, |
AVIOContext * | pb, | ||
AVStream * | st, | ||
int64_t | size | ||
) |
Read 'chan' tag from the input stream.
s | AVFormatContext |
pb | AVIOContext |
st | The stream to set codec values for |
size | Remaining size in the 'chan' tag |
Definition at line 524 of file mov_chan.c.
Referenced by aiff_read_header(), mov_read_chan(), and read_header().
int ff_mov_get_channel_config_from_layout | ( | const AVChannelLayout * | layout, |
int * | config | ||
) |
Get ISO/IEC 23001-8 ChannelConfiguration from AVChannelLayout.
Definition at line 673 of file mov_chan.c.
Referenced by mov_write_chnl_tag().
int ff_mov_get_channel_layout_from_config | ( | int | config, |
AVChannelLayout * | layout, | ||
uint64_t | omitted_channel_map | ||
) |
Get AVChannelLayout from ISO/IEC 23001-8 ChannelConfiguration.
Definition at line 687 of file mov_chan.c.
Referenced by ff_mov_read_chnl().
int ff_mov_get_channel_positions_from_layout | ( | const AVChannelLayout * | layout, |
uint8_t * | position, | ||
int | position_num | ||
) |
Get ISO/IEC 23001-8 OutputChannelPosition from AVChannelLayout.
Definition at line 702 of file mov_chan.c.
Referenced by mov_write_chnl_tag().
int ff_mov_read_chnl | ( | AVFormatContext * | s, |
AVIOContext * | pb, | ||
AVStream * | st | ||
) |
Read 'chnl' tag from the input stream.
s | AVFormatContext |
pb | AVIOContext |
st | The stream to set codec values for |
Definition at line 729 of file mov_chan.c.
Referenced by mov_read_chnl().
|
static |
Definition at line 233 of file mov_chan.c.
Referenced by ff_mov_get_channel_layout_tag(), and ff_mov_read_chan().
|
static |
Definition at line 244 of file mov_chan.c.
Referenced by ff_mov_get_channel_config_from_layout(), and ff_mov_get_channel_layout_from_config().
|
static |
Definition at line 261 of file mov_chan.c.
|
static |
Definition at line 288 of file mov_chan.c.
|
static |
Definition at line 306 of file mov_chan.c.
|
static |
Definition at line 318 of file mov_chan.c.
enum AVCodecID codec_id |
Definition at line 334 of file mov_chan.c.
Referenced by ff_mov_get_channel_layout_tag().
enum MovChannelLayoutTag* layouts |
Definition at line 335 of file mov_chan.c.
Referenced by aeval_query_formats(), ff_mov_get_channel_layout_tag(), ff_mov_write_chan(), join_query_formats(), main(), print_formats_internal(), and query_formats().
const { ... } mov_codec_ch_layouts[] |
Referenced by ff_mov_get_channel_layout_tag().
|
static |
Definition at line 621 of file mov_chan.c.
Referenced by ff_mov_get_channel_positions_from_layout(), and ff_mov_read_chnl().