Lines Matching refs:pTrack

579 status_t AudioMixer::initTrackDownmix(track_t* pTrack, int trackName)  in initTrackDownmix()  argument
583 if (pTrack->channelMask != pTrack->mMixerChannelMask in initTrackDownmix()
584 && !(pTrack->channelMask == AUDIO_CHANNEL_OUT_MONO in initTrackDownmix()
585 && pTrack->mMixerChannelMask == AUDIO_CHANNEL_OUT_STEREO)) { in initTrackDownmix()
586 return prepareTrackForDownmix(pTrack, trackName); in initTrackDownmix()
589 unprepareTrackForDownmix(pTrack, trackName); in initTrackDownmix()
593 void AudioMixer::unprepareTrackForDownmix(track_t* pTrack, int trackName __unused) { in unprepareTrackForDownmix() argument
596 if (pTrack->downmixerBufferProvider != NULL) { in unprepareTrackForDownmix()
599 delete pTrack->downmixerBufferProvider; in unprepareTrackForDownmix()
600 pTrack->downmixerBufferProvider = NULL; in unprepareTrackForDownmix()
601 reconfigureBufferProviders(pTrack); in unprepareTrackForDownmix()
607 status_t AudioMixer::prepareTrackForDownmix(track_t* pTrack, int trackName) in prepareTrackForDownmix() argument
609 ALOGV("AudioMixer::prepareTrackForDownmix(%d) with mask 0x%x", trackName, pTrack->channelMask); in prepareTrackForDownmix()
612 unprepareTrackForDownmix(pTrack, trackName); in prepareTrackForDownmix()
614 DownmixerBufferProvider* pDbp = new DownmixerBufferProvider(pTrack->channelMask, in prepareTrackForDownmix()
615 pTrack->mMixerChannelMask, in prepareTrackForDownmix()
617 pTrack->sampleRate, pTrack->sessionId, kCopyBufferFrameCount); in prepareTrackForDownmix()
620 pTrack->mMixerInFormat = AUDIO_FORMAT_PCM_16_BIT; // PCM 16 bit required for downmix in prepareTrackForDownmix()
621 pTrack->downmixerBufferProvider = pDbp; in prepareTrackForDownmix()
622 reconfigureBufferProviders(pTrack); in prepareTrackForDownmix()
629 RemixBufferProvider* pRbp = new RemixBufferProvider(pTrack->channelMask, in prepareTrackForDownmix()
630 pTrack->mMixerChannelMask, pTrack->mMixerInFormat, kCopyBufferFrameCount); in prepareTrackForDownmix()
632 pTrack->downmixerBufferProvider = pRbp; in prepareTrackForDownmix()
633 reconfigureBufferProviders(pTrack); in prepareTrackForDownmix()
637 void AudioMixer::unprepareTrackForReformat(track_t* pTrack, int trackName __unused) { in unprepareTrackForReformat() argument
639 if (pTrack->mReformatBufferProvider != NULL) { in unprepareTrackForReformat()
640 delete pTrack->mReformatBufferProvider; in unprepareTrackForReformat()
641 pTrack->mReformatBufferProvider = NULL; in unprepareTrackForReformat()
642 reconfigureBufferProviders(pTrack); in unprepareTrackForReformat()
646 status_t AudioMixer::prepareTrackForReformat(track_t* pTrack, int trackName) in prepareTrackForReformat() argument
648 ALOGV("AudioMixer::prepareTrackForReformat(%d) with format %#x", trackName, pTrack->mFormat); in prepareTrackForReformat()
650 unprepareTrackForReformat(pTrack, trackName); in prepareTrackForReformat()
652 if (pTrack->mFormat != pTrack->mMixerInFormat) { in prepareTrackForReformat()
653 pTrack->mReformatBufferProvider = new ReformatBufferProvider( in prepareTrackForReformat()
654 audio_channel_count_from_out_mask(pTrack->channelMask), in prepareTrackForReformat()
655 pTrack->mFormat, pTrack->mMixerInFormat, in prepareTrackForReformat()
657 reconfigureBufferProviders(pTrack); in prepareTrackForReformat()
662 void AudioMixer::reconfigureBufferProviders(track_t* pTrack) in reconfigureBufferProviders() argument
664 pTrack->bufferProvider = pTrack->mInputBufferProvider; in reconfigureBufferProviders()
665 if (pTrack->mReformatBufferProvider) { in reconfigureBufferProviders()
666 pTrack->mReformatBufferProvider->setBufferProvider(pTrack->bufferProvider); in reconfigureBufferProviders()
667 pTrack->bufferProvider = pTrack->mReformatBufferProvider; in reconfigureBufferProviders()
669 if (pTrack->downmixerBufferProvider) { in reconfigureBufferProviders()
670 pTrack->downmixerBufferProvider->setBufferProvider(pTrack->bufferProvider); in reconfigureBufferProviders()
671 pTrack->bufferProvider = pTrack->downmixerBufferProvider; in reconfigureBufferProviders()