MCPcopy Create free account
hub / github.com/clangen/musikcube / resolveChannelLayout

Function resolveChannelLayout

src/plugins/ffmpegdecoder/FfmpegDecoder.cpp:92–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90
91#ifdef USE_FFMPEG7_CHANNEL_LAYOUT
92static AVChannelLayout resolveChannelLayout(size_t channelCount) {
93 AVChannelLayout result;
94 memset(&result, 0, sizeof(result));
95
96 result.nb_channels = channelCount;
97 switch (channelCount) {
98 case 1: result.u.mask = AV_CH_LAYOUT_MONO; break;
99 case 2: result.u.mask = AV_CH_LAYOUT_STEREO; break;
100 case 3: result.u.mask = AV_CH_LAYOUT_2POINT1; break;
101 case 4: result.u.mask = AV_CH_LAYOUT_3POINT1; break;
102 case 5: result.u.mask = AV_CH_LAYOUT_4POINT1; break;
103 case 6: result.u.mask = AV_CH_LAYOUT_5POINT1; break;
104 default: result.u.mask = AV_CH_LAYOUT_STEREO_DOWNMIX; break;
105 }
106
107 return result;
108}
109#endif
110
111static int readCallback(void* opaque, uint8_t* buffer, int bufferSize) {

Callers 2

FfmpegDecoder.cppFile · 0.70
AllocFrameMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected