Lines Matching refs:t

124     track_t* t = mState.tracks;  in AudioMixer()  local
126 t->resampler = NULL; in AudioMixer()
127 t->downmixerBufferProvider = NULL; in AudioMixer()
128 t->mReformatBufferProvider = NULL; in AudioMixer()
129 t->mTimestretchBufferProvider = NULL; in AudioMixer()
130 t++; in AudioMixer()
137 track_t* t = mState.tracks; in ~AudioMixer() local
139 delete t->resampler; in ~AudioMixer()
140 delete t->downmixerBufferProvider; in ~AudioMixer()
141 delete t->mReformatBufferProvider; in ~AudioMixer()
142 delete t->mTimestretchBufferProvider; in ~AudioMixer()
143 t++; in ~AudioMixer()
170 track_t* t = &mState.tracks[n]; in getTrackName() local
171 t->needs = 0; in getTrackName()
176 t->volume[0] = UNITY_GAIN_INT; in getTrackName()
177 t->volume[1] = UNITY_GAIN_INT; in getTrackName()
178 t->prevVolume[0] = UNITY_GAIN_INT << 16; in getTrackName()
179 t->prevVolume[1] = UNITY_GAIN_INT << 16; in getTrackName()
180 t->volumeInc[0] = 0; in getTrackName()
181 t->volumeInc[1] = 0; in getTrackName()
182 t->auxLevel = 0; in getTrackName()
183 t->auxInc = 0; in getTrackName()
184 t->prevAuxLevel = 0; in getTrackName()
187 t->mVolume[0] = UNITY_GAIN_FLOAT; in getTrackName()
188 t->mVolume[1] = UNITY_GAIN_FLOAT; in getTrackName()
189 t->mPrevVolume[0] = UNITY_GAIN_FLOAT; in getTrackName()
190 t->mPrevVolume[1] = UNITY_GAIN_FLOAT; in getTrackName()
191 t->mVolumeInc[0] = 0.; in getTrackName()
192 t->mVolumeInc[1] = 0.; in getTrackName()
193 t->mAuxLevel = 0.; in getTrackName()
194 t->mAuxInc = 0.; in getTrackName()
195 t->mPrevAuxLevel = 0.; in getTrackName()
199 t->channelCount = audio_channel_count_from_out_mask(channelMask); in getTrackName()
200 t->enabled = false; in getTrackName()
203 t->channelMask = channelMask; in getTrackName()
204 t->sessionId = sessionId; in getTrackName()
206 t->bufferProvider = NULL; in getTrackName()
207 t->buffer.raw = NULL; in getTrackName()
210 t->hook = NULL; in getTrackName()
211 t->in = NULL; in getTrackName()
212 t->resampler = NULL; in getTrackName()
213 t->sampleRate = mSampleRate; in getTrackName()
215 t->mainBuffer = NULL; in getTrackName()
216 t->auxBuffer = NULL; in getTrackName()
217 t->mInputBufferProvider = NULL; in getTrackName()
218 t->mReformatBufferProvider = NULL; in getTrackName()
219 t->downmixerBufferProvider = NULL; in getTrackName()
220 t->mPostDownmixReformatBufferProvider = NULL; in getTrackName()
221 t->mTimestretchBufferProvider = NULL; in getTrackName()
222 t->mMixerFormat = AUDIO_FORMAT_PCM_16_BIT; in getTrackName()
223 t->mFormat = format; in getTrackName()
224 t->mMixerInFormat = selectMixerInFormat(format); in getTrackName()
225 t->mDownmixRequiresFormat = AUDIO_FORMAT_INVALID; // no format required in getTrackName()
226 t->mMixerChannelMask = audio_channel_mask_from_representation_and_bits( in getTrackName()
228 t->mMixerChannelCount = audio_channel_count_from_out_mask(t->mMixerChannelMask); in getTrackName()
229 t->mPlaybackRate = AUDIO_PLAYBACK_RATE_DEFAULT; in getTrackName()
231 status_t status = t->prepareForDownmix(); in getTrackName()
237 ALOGVV("mMixerFormat:%#x mMixerInFormat:%#x\n", t->mMixerFormat, t->mMixerInFormat); in getTrackName()
238 t->prepareForReformat(); in getTrackName()
932 track_t& t = state->tracks[i]; in process__validate() local
933 (t.enabled ? enabled : disabled) |= mask; in process__validate()
952 track_t& t = state->tracks[i]; in process__validate() local
955 n |= NEEDS_CHANNEL_1 + t.channelCount - 1; in process__validate()
956 if (t.doesResample()) { in process__validate()
959 if (t.auxLevel != 0 && t.auxBuffer != NULL) { in process__validate()
963 if (t.volumeInc[0]|t.volumeInc[1]) { in process__validate()
965 } else if (!t.doesResample() && t.volumeRL == 0) { in process__validate()
968 t.needs = n; in process__validate()
971 t.hook = track__nop; in process__validate()
979 t.hook = getTrackHook(TRACKTYPE_RESAMPLE, t.mMixerChannelCount, in process__validate()
980 t.mMixerInFormat, t.mMixerFormat); in process__validate()
985 t.hook = getTrackHook( in process__validate()
986 (t.mMixerChannelMask == AUDIO_CHANNEL_OUT_STEREO // TODO: MONO_HACK in process__validate()
987 && t.channelMask == AUDIO_CHANNEL_OUT_MONO) in process__validate()
989 t.mMixerChannelCount, in process__validate()
990 t.mMixerInFormat, t.mMixerFormat); in process__validate()
994 t.hook = getTrackHook(TRACKTYPE_NORESAMPLE, t.mMixerChannelCount, in process__validate()
995 t.mMixerInFormat, t.mMixerFormat); in process__validate()
1027 track_t& t = state->tracks[i]; in process__validate() local
1028 if ((t.needs & NEEDS_MUTE) == 0) { in process__validate()
1035 t.mMixerChannelCount, t.mMixerInFormat, t.mMixerFormat); in process__validate()
1057 track_t& t = state->tracks[i]; in process__validate() local
1058 if (!t.doesResample() && t.volumeRL == 0) { in process__validate()
1059 t.needs |= NEEDS_MUTE; in process__validate()
1060 t.hook = track__nop; in process__validate()
1070 track_t& t = state->tracks[i]; in process__validate() local
1073 t.mMixerChannelCount, t.mMixerInFormat, t.mMixerFormat); in process__validate()
1080 void AudioMixer::track__genericResample(track_t* t, int32_t* out, size_t outFrameCount, in track__genericResample() argument
1084 t->resampler->setSampleRate(t->sampleRate); in track__genericResample()
1090 t->resampler->setVolume(UNITY_GAIN_FLOAT, UNITY_GAIN_FLOAT); in track__genericResample()
1091 memset(temp, 0, outFrameCount * t->mMixerChannelCount * sizeof(int32_t)); in track__genericResample()
1092 t->resampler->resample(temp, outFrameCount, t->bufferProvider); in track__genericResample()
1093 if (CC_UNLIKELY(t->volumeInc[0]|t->volumeInc[1]|t->auxInc)) { in track__genericResample()
1094 volumeRampStereo(t, out, outFrameCount, temp, aux); in track__genericResample()
1096 volumeStereo(t, out, outFrameCount, temp, aux); in track__genericResample()
1099 if (CC_UNLIKELY(t->volumeInc[0]|t->volumeInc[1])) { in track__genericResample()
1100 t->resampler->setVolume(UNITY_GAIN_FLOAT, UNITY_GAIN_FLOAT); in track__genericResample()
1102 t->resampler->resample(temp, outFrameCount, t->bufferProvider); in track__genericResample()
1103 volumeRampStereo(t, out, outFrameCount, temp, aux); in track__genericResample()
1108 t->resampler->setVolume(t->mVolume[0], t->mVolume[1]); in track__genericResample()
1109 t->resampler->resample(out, outFrameCount, t->bufferProvider); in track__genericResample()
1114 void AudioMixer::track__nop(track_t* t __unused, int32_t* out __unused, in track__nop()
1119 void AudioMixer::volumeRampStereo(track_t* t, int32_t* out, size_t frameCount, int32_t* temp, in volumeRampStereo() argument
1122 int32_t vl = t->prevVolume[0]; in volumeRampStereo()
1123 int32_t vr = t->prevVolume[1]; in volumeRampStereo()
1124 const int32_t vlInc = t->volumeInc[0]; in volumeRampStereo()
1125 const int32_t vrInc = t->volumeInc[1]; in volumeRampStereo()
1133 int32_t va = t->prevAuxLevel; in volumeRampStereo()
1134 const int32_t vaInc = t->auxInc; in volumeRampStereo()
1148 t->prevAuxLevel = va; in volumeRampStereo()
1157 t->prevVolume[0] = vl; in volumeRampStereo()
1158 t->prevVolume[1] = vr; in volumeRampStereo()
1159 t->adjustVolumeRamp(aux != NULL); in volumeRampStereo()
1162 void AudioMixer::volumeStereo(track_t* t, int32_t* out, size_t frameCount, int32_t* temp, in volumeStereo() argument
1165 const int16_t vl = t->volume[0]; in volumeStereo()
1166 const int16_t vr = t->volume[1]; in volumeStereo()
1169 const int16_t va = t->auxLevel; in volumeStereo()
1191 void AudioMixer::track__16BitsStereo(track_t* t, int32_t* out, size_t frameCount, in track__16BitsStereo() argument
1195 const int16_t *in = static_cast<const int16_t *>(t->in); in track__16BitsStereo()
1201 if (CC_UNLIKELY(t->volumeInc[0]|t->volumeInc[1]|t->auxInc)) { in track__16BitsStereo()
1202 int32_t vl = t->prevVolume[0]; in track__16BitsStereo()
1203 int32_t vr = t->prevVolume[1]; in track__16BitsStereo()
1204 int32_t va = t->prevAuxLevel; in track__16BitsStereo()
1205 const int32_t vlInc = t->volumeInc[0]; in track__16BitsStereo()
1206 const int32_t vrInc = t->volumeInc[1]; in track__16BitsStereo()
1207 const int32_t vaInc = t->auxInc; in track__16BitsStereo()
1223 t->prevVolume[0] = vl; in track__16BitsStereo()
1224 t->prevVolume[1] = vr; in track__16BitsStereo()
1225 t->prevAuxLevel = va; in track__16BitsStereo()
1226 t->adjustVolumeRamp(true); in track__16BitsStereo()
1231 const uint32_t vrl = t->volumeRL; in track__16BitsStereo()
1232 const int16_t va = (int16_t)t->auxLevel; in track__16BitsStereo()
1246 if (CC_UNLIKELY(t->volumeInc[0]|t->volumeInc[1])) { in track__16BitsStereo()
1247 int32_t vl = t->prevVolume[0]; in track__16BitsStereo()
1248 int32_t vr = t->prevVolume[1]; in track__16BitsStereo()
1249 const int32_t vlInc = t->volumeInc[0]; in track__16BitsStereo()
1250 const int32_t vrInc = t->volumeInc[1]; in track__16BitsStereo()
1263 t->prevVolume[0] = vl; in track__16BitsStereo()
1264 t->prevVolume[1] = vr; in track__16BitsStereo()
1265 t->adjustVolumeRamp(false); in track__16BitsStereo()
1270 const uint32_t vrl = t->volumeRL; in track__16BitsStereo()
1280 t->in = in; in track__16BitsStereo()
1283 void AudioMixer::track__16BitsMono(track_t* t, int32_t* out, size_t frameCount, in track__16BitsMono() argument
1287 const int16_t *in = static_cast<int16_t const *>(t->in); in track__16BitsMono()
1291 if (CC_UNLIKELY(t->volumeInc[0]|t->volumeInc[1]|t->auxInc)) { in track__16BitsMono()
1292 int32_t vl = t->prevVolume[0]; in track__16BitsMono()
1293 int32_t vr = t->prevVolume[1]; in track__16BitsMono()
1294 int32_t va = t->prevAuxLevel; in track__16BitsMono()
1295 const int32_t vlInc = t->volumeInc[0]; in track__16BitsMono()
1296 const int32_t vrInc = t->volumeInc[1]; in track__16BitsMono()
1297 const int32_t vaInc = t->auxInc; in track__16BitsMono()
1313 t->prevVolume[0] = vl; in track__16BitsMono()
1314 t->prevVolume[1] = vr; in track__16BitsMono()
1315 t->prevAuxLevel = va; in track__16BitsMono()
1316 t->adjustVolumeRamp(true); in track__16BitsMono()
1320 const int16_t vl = t->volume[0]; in track__16BitsMono()
1321 const int16_t vr = t->volume[1]; in track__16BitsMono()
1322 const int16_t va = (int16_t)t->auxLevel; in track__16BitsMono()
1334 if (CC_UNLIKELY(t->volumeInc[0]|t->volumeInc[1])) { in track__16BitsMono()
1335 int32_t vl = t->prevVolume[0]; in track__16BitsMono()
1336 int32_t vr = t->prevVolume[1]; in track__16BitsMono()
1337 const int32_t vlInc = t->volumeInc[0]; in track__16BitsMono()
1338 const int32_t vrInc = t->volumeInc[1]; in track__16BitsMono()
1352 t->prevVolume[0] = vl; in track__16BitsMono()
1353 t->prevVolume[1] = vr; in track__16BitsMono()
1354 t->adjustVolumeRamp(false); in track__16BitsMono()
1358 const int16_t vl = t->volume[0]; in track__16BitsMono()
1359 const int16_t vr = t->volume[1]; in track__16BitsMono()
1368 t->in = in; in track__16BitsMono()
1428 track_t& t = state->tracks[i]; in process__genericNoResampling() local
1429 t.buffer.frameCount = state->frameCount; in process__genericNoResampling()
1430 t.bufferProvider->getNextBuffer(&t.buffer); in process__genericNoResampling()
1431 t.frameCount = t.buffer.frameCount; in process__genericNoResampling()
1432 t.in = t.buffer.raw; in process__genericNoResampling()
1461 track_t& t = state->tracks[i]; in process__genericNoResampling() local
1464 if (CC_UNLIKELY(t.needs & NEEDS_AUX)) { in process__genericNoResampling()
1465 aux = t.auxBuffer + numFrames; in process__genericNoResampling()
1470 if (t.in == NULL) { in process__genericNoResampling()
1475 size_t inFrames = (t.frameCount > outFrames)?outFrames:t.frameCount; in process__genericNoResampling()
1477 t.hook(&t, outTemp + (BLOCKSIZE - outFrames) * t.mMixerChannelCount, in process__genericNoResampling()
1479 t.frameCount -= inFrames; in process__genericNoResampling()
1485 if (t.frameCount == 0 && outFrames) { in process__genericNoResampling()
1486 t.bufferProvider->releaseBuffer(&t.buffer); in process__genericNoResampling()
1487 t.buffer.frameCount = (state->frameCount - numFrames) - in process__genericNoResampling()
1489 t.bufferProvider->getNextBuffer(&t.buffer); in process__genericNoResampling()
1490 t.in = t.buffer.raw; in process__genericNoResampling()
1491 if (t.in == NULL) { in process__genericNoResampling()
1496 t.frameCount = t.buffer.frameCount; in process__genericNoResampling()
1516 track_t& t = state->tracks[i]; in process__genericNoResampling() local
1517 t.bufferProvider->releaseBuffer(&t.buffer); in process__genericNoResampling()
1552 track_t& t = state->tracks[i]; in process__genericResampling() local
1554 if (CC_UNLIKELY(t.needs & NEEDS_AUX)) { in process__genericResampling()
1555 aux = t.auxBuffer; in process__genericResampling()
1561 if (t.needs & NEEDS_RESAMPLE) { in process__genericResampling()
1562 t.hook(&t, outTemp, numFrames, state->resampleTemp, aux); in process__genericResampling()
1568 t.buffer.frameCount = numFrames - outFrames; in process__genericResampling()
1569 t.bufferProvider->getNextBuffer(&t.buffer); in process__genericResampling()
1570 t.in = t.buffer.raw; in process__genericResampling()
1573 if (t.in == NULL) break; in process__genericResampling()
1578 t.hook(&t, outTemp + outFrames * t.mMixerChannelCount, t.buffer.frameCount, in process__genericResampling()
1580 outFrames += t.buffer.frameCount; in process__genericResampling()
1581 t.bufferProvider->releaseBuffer(&t.buffer); in process__genericResampling()
1600 const track_t& t = state->tracks[i]; in process__OneTrack16BitsStereoNoResampling() local
1602 AudioBufferProvider::Buffer& b(t.buffer); in process__OneTrack16BitsStereoNoResampling()
1604 int32_t* out = t.mainBuffer; in process__OneTrack16BitsStereoNoResampling()
1608 const int16_t vl = t.volume[0]; in process__OneTrack16BitsStereoNoResampling()
1609 const int16_t vr = t.volume[1]; in process__OneTrack16BitsStereoNoResampling()
1610 const uint32_t vrl = t.volumeRL; in process__OneTrack16BitsStereoNoResampling()
1613 t.bufferProvider->getNextBuffer(&b); in process__OneTrack16BitsStereoNoResampling()
1619 if ( AUDIO_FORMAT_PCM_FLOAT == t.mMixerFormat ) { in process__OneTrack16BitsStereoNoResampling()
1621 * t.mMixerChannelCount * audio_bytes_per_sample(t.mMixerFormat)); in process__OneTrack16BitsStereoNoResampling()
1624 * t.mMixerChannelCount * audio_bytes_per_sample(t.mMixerFormat)); in process__OneTrack16BitsStereoNoResampling()
1629 in, i, t.channelCount, t.needs, vrl, t.mVolume[0], t.mVolume[1]); in process__OneTrack16BitsStereoNoResampling()
1634 switch (t.mMixerFormat) { in process__OneTrack16BitsStereoNoResampling()
1672 LOG_ALWAYS_FATAL("bad mixer format: %d", t.mMixerFormat); in process__OneTrack16BitsStereoNoResampling()
1675 t.bufferProvider->releaseBuffer(&b); in process__OneTrack16BitsStereoNoResampling()
1787 const TI *in, TA *aux, bool ramp, AudioMixer::track_t *t) in volumeMix() argument
1791 volumeRampMulti<MIXTYPE>(t->mMixerChannelCount, out, outFrames, in, aux, in volumeMix()
1792 t->mPrevVolume, t->mVolumeInc, &t->prevAuxLevel, t->auxInc); in volumeMix()
1794 t->adjustVolumeRamp(aux != NULL, true); in volumeMix()
1797 volumeMulti<MIXTYPE>(t->mMixerChannelCount, out, outFrames, in, aux, in volumeMix()
1798 t->mVolume, t->auxLevel); in volumeMix()
1802 volumeRampMulti<MIXTYPE>(t->mMixerChannelCount, out, outFrames, in, aux, in volumeMix()
1803 t->prevVolume, t->volumeInc, &t->prevAuxLevel, t->auxInc); in volumeMix()
1805 t->adjustVolumeRamp(aux != NULL); in volumeMix()
1808 volumeMulti<MIXTYPE>(t->mMixerChannelCount, out, outFrames, in, aux, in volumeMix()
1809 t->volume, t->auxLevel); in volumeMix()
1830 track_t *t = &state->tracks[i]; in process_NoResampleOneTrack() local
1831 const uint32_t channels = t->mMixerChannelCount; in process_NoResampleOneTrack()
1832 TO* out = reinterpret_cast<TO*>(t->mainBuffer); in process_NoResampleOneTrack()
1833 TA* aux = reinterpret_cast<TA*>(t->auxBuffer); in process_NoResampleOneTrack()
1834 const bool ramp = t->needsRamp(); in process_NoResampleOneTrack()
1837 AudioBufferProvider::Buffer& b(t->buffer); in process_NoResampleOneTrack()
1840 t->bufferProvider->getNextBuffer(&b); in process_NoResampleOneTrack()
1847 * channels * audio_bytes_per_sample(t->mMixerFormat)); in process_NoResampleOneTrack()
1850 in, t, t->channelCount, t->needs); in process_NoResampleOneTrack()
1856 out, outFrames, in, aux, ramp, t); in process_NoResampleOneTrack()
1865 t->bufferProvider->releaseBuffer(&b); in process_NoResampleOneTrack()
1868 t->adjustVolumeRamp(aux != NULL, is_same<TI, float>::value); in process_NoResampleOneTrack()
1881 void AudioMixer::track__Resample(track_t* t, TO* out, size_t outFrameCount, TO* temp, TA* aux) in track__Resample() argument
1884 t->resampler->setSampleRate(t->sampleRate); in track__Resample()
1885 const bool ramp = t->needsRamp(); in track__Resample()
1890 t->resampler->setVolume(UNITY_GAIN_FLOAT, UNITY_GAIN_FLOAT); in track__Resample()
1891 memset(temp, 0, outFrameCount * t->mMixerChannelCount * sizeof(TO)); in track__Resample()
1892 t->resampler->resample((int32_t*)temp, outFrameCount, t->bufferProvider); in track__Resample()
1895 out, outFrameCount, temp, aux, ramp, t); in track__Resample()
1898 t->resampler->setVolume(t->mVolume[0], t->mVolume[1]); in track__Resample()
1899 t->resampler->resample((int32_t*)out, outFrameCount, t->bufferProvider); in track__Resample()
1912 void AudioMixer::track__NoResample(track_t* t, TO* out, size_t frameCount, in track__NoResample() argument
1916 const TI *in = static_cast<const TI *>(t->in); in track__NoResample()
1919 out, frameCount, in, aux, t->needsRamp(), t); in track__NoResample()
1923 in += (MIXTYPE == MIXTYPE_MONOEXPAND) ? frameCount : frameCount * t->mMixerChannelCount; in track__NoResample()
1924 t->in = in; in track__NoResample()