video/audio playback:prepare & start

本文详细解析了Android系统中音视频播放的过程,包括从准备阶段到解码播放的全过程。重点介绍了AwesomePlayer如何处理不同类型的URL,如HTTP、RTSP等,并针对mAudioTrack和mVideoTrack进行分离和解码。

 

prepare:启动mQueue,对http://,rtsp://gtalk/,fmradio://rx 之类的url进行mAudioTrack/mVideoTrack分离,并根据mAudioTrack/mVideoTrack编码类型选择相应的decode

1.framework/base/media/libmediaplayerservice/MediaPlayerService.cpp

status_t MediaPlayerService::Client::prepareAsync()

{….

sp<MediaPlayerBase> p = getPlayer(); …….. setDataSource时创建的stagefrightplayer

if (p == 0) return UNKNOWN_ERROR;

status_t ret = p->prepareAsync();

……

return ret;

}

2.framework/base/media/libmediaplayerservice/stagefrightplayer

status_t StagefrightPlayer::prepareAsync() {

return mPlayer->prepareAsync();…………mPlayer--->AwesomePlayer

}

3:framework/base/media/libstagefright/awesomePlayer

status_t AwesomePlayer::prepareAsync() {

…….

return prepareAsync_l();

}

启动mQueue,onPrepareAsyncEvent被触发

status_t AwesomePlayer::prepareAsync_l() {……

if (!mQueueStarted) {

mQueue.start();

mQueueStarted = true;

}

….

mAsyncPrepareEvent = new AwesomeEvent(

this, &AwesomePlayer::onPrepareAsyncEvent);

mQueue.postEvent(mAsyncPrepareEvent);

return OK;

}



void AwesomePlayer::onPrepareAsyncEvent() {

….

if (mUri.size() > 0) {

status_t err = finishSetDataSource_l();………….对http://之类的url进行mAudioTrack/mVideoTrack分离

if (mVideoTrack != NULL && mVideoSource == NULL) {

status_t err = initVideoDecoder();……………………decode video

}



if (mAudioTrack != NULL && mAudioSource == NULL) {

status_t err = initAudioDecoder();…………………….decode audio

return;

}

}

if (mCachedSource != NULL || mRTSPController != NULL) {

postBufferingEvent_l();………………..触发mBufferingEvent,对应的实现在void AwesomePlayer::onBufferingUpdate()

}

}



start:解码并播放

1,framework/base/media/libmedia/mediaPlayer.cpp

status_t MediaPlayer::start()

{……

if ( (mPlayer != 0) && ( mCurrentState & ( MEDIA_PLAYER_PREPARED |

MEDIA_PLAYER_PLAYBACK_COMPLETE | MEDIA_PLAYER_PAUSED ) ) ) {

mPlayer->setLooping(mLoop);

mPlayer->setVolume(mLeftVolume, mRightVolume);

mPlayer->setAuxEffectSendLevel(mSendLevel);

mCurrentState = MEDIA_PLAYER_STARTED;

status_t ret = mPlayer->start();

……….

}

2,framework/base/media/libmediaPlayerService /mediaPlayerService.cpp

status_t MediaPlayerService::Client::start()

{..

sp<MediaPlayerBase> p = getPlayer();



p->setLooping(mLoop);

return p->start();

}

3,framework/base/media/libmediaPlayerService/stagefrightplayer.cpp



status_t StagefrightPlayer::start() {

return mPlayer->play();

}

4,framework/base/media/libstagefright/awesomePlayer.cpp

tatus_t AwesomePlayer::play() {

………..

return play_l();

}



status_t AwesomePlayer::play_l() {

……

if (mVideoSource != NULL) {

// Kick off video playback

postVideoEvent_l();……..把videoEvent放入mQueue中





}

开始解码播放,并由mVideoRenderer输出,video playback 完成

void AwesomePlayer::onVideoEvent() {……………

status_t err = mVideoSource->read(&mVideoBuffer[mVideoQueueBack], &options);

……….

if (mVideoRenderer != NULL) {

mVideoRenderer->render(mVideoBuffer[mVideoQueueBack]);

}

…..

postVideoEvent_l();

}



audio playerback



1,framework/base/media/libstagefright/awesomePlayer.cpp

status_t AwesomePlayer::play_l() {

if (mAudioSource != NULL) {

if (mAudioPlayer == NULL) {

if (mAudioSink != NULL) {

mWatchForAudioSeekComplete = false;

mAudioPlayer = new AudioPlayer(mAudioSink, this);

mAudioPlayer->setSource(mAudioSource);

…………..

}

}

status_t err = mAudioPlayer->start(

true /* sourceAlreadyStarted */);

………………..

}

2,framework/base/media/libstagefright/audioplayer.cpp

读第一手解析的数据,并开启audio output

status_t AudioPlayer::start(bool sourceAlreadyStarted) {

if (mAudioSink.get() != NULL) {

status_t err = mAudioSink->open(

mSampleRate, numChannels, AudioSystem::PCM_16_BIT,

DEFAULT_AUDIOSINK_BUFFERCOUNT,

&AudioPlayer::AudioSinkCallback, this);

……

mAudioSink->start();

} else {

mAudioTrack = new AudioTrack(

AudioSystem::MUSIC, mSampleRate, AudioSystem::PCM_16_BIT,

(numChannels == 2)

? AudioSystem::CHANNEL_OUT_STEREO

: AudioSystem::CHANNEL_OUT_MONO,

0, 0, &AudioCallback, this, 0);

….

mAudioTrack->start();

}



mStarted = true;



return OK;

}



开启audio output 时后把AudioSinkCallback传给它,每当调用callback时,audioplayer都回去decode 获取解码后的数据

size_t AudioPlayer::AudioSinkCallback(

MediaPlayerBase::AudioSink *audioSink,

void *buffer, size_t size, void *cookie) {

AudioPlayer *me = (AudioPlayer *)cookie;



return me->fillBuffer(buffer, size);

}



size_t AudioPlayer::fillBuffer(void *data, size_t size) {

…..

err = mSource->read(&mInputBuffer, &options);

…..

memcpy((char *)data + size_done,

(const char *)mInputBuffer->data() + mInputBuffer->range_offset(),

copy);

…….



return size_done;

}

http://blog.youkuaiyun.com/tjy1985/article/details/7398193
Use of stream types is deprecated for operations other than volume control 08-06 16:39:08.069037 6748 6748 W MediaPlayer: See the documentation of setAudioStreamType() for what to use instead with android.media.AudioAttributes to qualify your playback use case 08-06 16:39:08.069569 2463 14868 D NuPlayerDriver: seekTo(0xb400007c57522900) (0 ms, 0) at state 4 08-06 16:39:08.070123 6748 10059 D C2NodeImpl: getInputBufferParams: wxh 940x1920, delay 16 08-06 16:39:08.070208 6748 10059 D BufferQueueConsumer: [GraphicBufferSource](id:1a5c00000016,api:0,p:-1,c:6748) setMaxAcquiredBufferCount: 16 08-06 16:39:08.070235 6748 10059 D GraphicBufferSource: setting dataspace: 0x104, acquired=0 08-06 16:39:08.070272 2463 10083 I GenericSource: start 08-06 16:39:08.070320 6748 6748 D MediaPlayer: MediaPlayer start called 08-06 16:39:08.070520 6748 10059 D CCodec : ISConfig not changed 08-06 16:39:08.072474 2463 2463 D NuPlayerDriver: start(0xb400007c57522900)+ state is 4, eos is 0 08-06 16:39:08.072620 2463 2463 D NuPlayerDriver: start(0xb400007c57522900)- 08-06 16:39:08.073196 2463 10083 D OplusNuPlayer: videoSlowSync, onStart, isVideoSlowSync = 0 08-06 16:39:08.073290 6748 6748 I KLog : [I] [Tid: 496529952920] RecorderUtils| isRecordFailedCode: error code match, module:kRecorder, level:kP0, DetailCode:206 08-06 16:39:08.074290 2463 10083 D AtlasEventUploadUtils: setEvent event:atlas_event_audio_filename 08-06 16:39:08.075138 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:1863 deviceIds:[] type:android.media.SoundPool u/pid:10161/4384 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.075223 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:2375 deviceIds:[] type:android.media.SoundPool u/pid:10242/8287 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.075258 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:4167 deviceIds:[] type:android.media.MediaPlayer u/pid:10373/6748 state:idle attr:AudioAttributes: usage=USAGE_UNKNOWN content=CONTENT_TYPE_UNKNOWN flags=0x800 tags= bundle=null sessionId:11417 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.075277 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:143 deviceIds:[] type:android.media.SoundPool u/pid:1000/3377 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.075295 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:1487 deviceIds:[] type:android.media.SoundPool u/pid:10161/4384 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.075522 2463 10083 D NuPlayerDriver: notifySeekComplete(0xb400007c57522900) 08-06 16:39:08.078080 2463 10083 D OplusNuPlayer: videoSlowSync, onStart, isVideoSlowSync = 0 08-06 16:39:08.078120 2463 10083 D AtlasEventUploadUtils: setEvent event:atlas_event_audio_filename 08-06 16:39:08.082494 6748 6748 I KLog : [I] [Tid: 496529952920] FaceMagicLog jni : nativeGetFaceMagicInfo 08-06 16:39:08.083268 14336 14336 I mydevices[core].AudioPlaybackMonitor: (main)notifyPlaybackConfigChanged 08-06 16:39:08.083308 14336 14336 I mydevices[core].AudioPlaybackMonitor: (main)checkPlaybackChanged 08-06 16:39:08.083695 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:4111 deviceIds:[] type:android.media.SoundPool u/pid:10104/730 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.083740 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:4175 deviceIds:[] type:android.media.MediaPlayer u/pid:10373/6748 state:started attr:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0x800 tags= bundle=null sessionId:11425 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.083770 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:151 deviceIds:[] type:android.media.SoundPool u/pid:10242/8287 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.083798 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:1879 deviceIds:[] type:android.media.SoundPool u/pid:10145/21352 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.083815 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:2007 deviceIds:[] type:android.media.SoundPool u/pid:10145/21352 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.083851 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:3671 deviceIds:[2] type:android.media.MediaPlayer u/pid:10356/6308 state:stopped attr:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0x800 tags= bundle=null sessionId:10881 mutedState:streamVolume portVolume FormatInfo{isSpatialized=false, channelMask=0x1, sampleRate=44100} 08-06 16:39:08.083885 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:4055 deviceIds:[] type:android.media.AudioTrack u/pid:10356/6308 state:idle attr:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0xA00 tags= bundle=null sessionId:11265 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.083902 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:159 deviceIds:[] type:android.media.SoundPool u/pid:10242/8287 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.083919 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:2783 deviceIds:[] type:android.media.SoundPool u/pid:1000/30442 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.083937 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:231 deviceIds:[] type:android.media.SoundPool u/pid:10242/8287 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.083952 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:295 deviceIds:[] type:android.media.SoundPool u/pid:10242/8287 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.083971 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:2791 deviceIds:[] type:android.media.SoundPool u/pid:1000/30442 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.084012 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:4071 deviceIds:[2] type:android.media.AudioTrack u/pid:10356/6308 state:started attr:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0xA00 tags= bundle=null sessionId:11281 mutedState:clientVolume FormatInfo{isSpatialized=false, channelMask=0x3, sampleRate=44100} 08-06 16:39:08.084036 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:2735 deviceIds:[] type:android.media.SoundPool u/pid:10361/27907 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.084058 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:3631 deviceIds:[] type:android.media.AudioTrack u/pid:10356/6308 state:paused attr:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0xA00 tags= bundle=null sessionId:10841 mutedState:streamVolume portVolume FormatInfo{isSpatialized=false, channelMask=0x3, sampleRate=44100} 08-06 16:39:08.084092 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:3695 deviceIds:[] type:android.media.AudioTrack u/pid:10356/6308 state:idle attr:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0xA00 tags= bundle=null sessionId:10905 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.084113 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:2295 deviceIds:[] type:android.media.SoundPool u/pid:10136/28604 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.084142 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:2359 deviceIds:[] type:android.media.SoundPool u/pid:10339/27020 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.084172 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:2423 deviceIds:[] type:android.media.SoundPool u/pid:10370/4607 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x801 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.084190 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:3639 deviceIds:[] type:android.media.MediaPlayer u/pid:10356/6308 state:idle attr:AudioAttributes: usage=USAGE_UNKNOWN content=CONTENT_TYPE_UNKNOWN flags=0x800 tags= bundle=null sessionId:10849 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.084206 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:4087 deviceIds:[] type:android.media.MediaPlayer u/pid:10339/27020 state:idle attr:AudioAttributes: usage=USAGE_UNKNOWN content=CONTENT_TYPE_UNKNOWN flags=0x800 tags= bundle=null sessionId:11305 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.084233 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:2239 deviceIds:[] type:android.media.SoundPool u/pid:1000/17557 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.084255 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:3647 deviceIds:[] type:android.media.MediaPlayer u/pid:10356/6308 state:idle attr:AudioAttributes: usage=USAGE_UNKNOWN content=CONTENT_TYPE_UNKNOWN flags=0x800 tags= bundle=null sessionId:10857 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.084337 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:1863 deviceIds:[] type:android.media.SoundPool u/pid:10161/4384 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.084421 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:2375 deviceIds:[] type:android.media.SoundPool u/pid:10242/8287 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.084448 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:4167 deviceIds:[] type:android.media.MediaPlayer u/pid:10373/6748 state:idle attr:AudioAttributes: usage=USAGE_UNKNOWN content=CONTENT_TYPE_UNKNOWN flags=0x800 tags= bundle=null sessionId:11417 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.084464 19578 19643 D MTS_BaseSceneDetector: [m]com.smile.gifmaker audioState: 10881 State: 4 08-06 16:39:08.084517 19578 19643 D MTS_BaseSceneDetector: [m]com.smile.gifmaker audioState: 11281 State: 2 08-06 16:39:08.084531 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:143 deviceIds:[] type:android.media.SoundPool u/pid:1000/3377 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.084542 19578 19643 D MTS_BaseSceneDetector: [m]com.smile.gifmaker audioState: 10841 State: 3 08-06 16:39:08.084561 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:1487 deviceIds:[] type:android.media.SoundPool u/pid:10161/4384 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.084585 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:4111 deviceIds:[] type:android.media.SoundPool u/pid:10104/730 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.084605 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:4175 deviceIds:[] type:android.media.MediaPlayer u/pid:10373/6748 state:started attr:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0x800 tags= bundle=null sessionId:11425 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.084635 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:151 deviceIds:[] type:android.media.SoundPool u/pid:10242/8287 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.084660 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:1879 deviceIds:[] type:android.media.SoundPool u/pid:10145/21352 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.084707 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:2007 deviceIds:[] type:android.media.SoundPool u/pid:10145/21352 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.084759 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:3671 deviceIds:[2] type:android.media.MediaPlayer u/pid:10356/6308 state:stopped attr:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0x800 tags= bundle=null sessionId:10881 mutedState:streamVolume portVolume FormatInfo{isSpatialized=false, channelMask=0x1, sampleRate=44100} 08-06 16:39:08.084779 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:4055 deviceIds:[] type:android.media.AudioTrack u/pid:10356/6308 state:idle attr:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0xA00 tags= bundle=null sessionId:11265 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.084802 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:159 deviceIds:[] type:android.media.SoundPool u/pid:10242/8287 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.084841 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:2783 deviceIds:[] type:android.media.SoundPool u/pid:1000/30442 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.084867 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:231 deviceIds:[] type:android.media.SoundPool u/pid:10242/8287 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.084889 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:295 deviceIds:[] type:android.media.SoundPool u/pid:10242/8287 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.084909 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:2791 deviceIds:[] type:android.media.SoundPool u/pid:1000/30442 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.084927 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:4071 deviceIds:[2] type:android.media.AudioTrack u/pid:10356/6308 state:started attr:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0xA00 tags= bundle=null sessionId:11281 mutedState:clientVolume FormatInfo{isSpatialized=false, channelMask=0x3, sampleRate=44100} 08-06 16:39:08.084957 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:2735 deviceIds:[] type:android.media.SoundPool u/pid:10361/27907 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.084984 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:3631 deviceIds:[] type:android.media.AudioTrack u/pid:10356/6308 state:paused attr:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0xA00 tags= bundle=null sessionId:10841 mutedState:streamVolume portVolume FormatInfo{isSpatialized=false, channelMask=0x3, sampleRate=44100} 08-06 16:39:08.085000 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:3695 deviceIds:[] type:android.media.AudioTrack u/pid:10356/6308 state:idle attr:AudioAttributes: usage=USAGE_MEDIA content=CONTENT_TYPE_UNKNOWN flags=0xA00 tags= bundle=null sessionId:10905 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.085015 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:2295 deviceIds:[] type:android.media.SoundPool u/pid:10136/28604 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.085036 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:2359 deviceIds:[] type:android.media.SoundPool u/pid:10339/27020 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.085052 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:2423 deviceIds:[] type:android.media.SoundPool u/pid:10370/4607 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x801 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.085074 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:3639 deviceIds:[] type:android.media.MediaPlayer u/pid:10356/6308 state:idle attr:AudioAttributes: usage=USAGE_UNKNOWN content=CONTENT_TYPE_UNKNOWN flags=0x800 tags= bundle=null sessionId:10849 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.085103 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:4087 deviceIds:[] type:android.media.MediaPlayer u/pid:10339/27020 state:idle attr:AudioAttributes: usage=USAGE_UNKNOWN content=CONTENT_TYPE_UNKNOWN flags=0x800 tags= bundle=null sessionId:11305 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.085120 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:2239 deviceIds:[] type:android.media.SoundPool u/pid:1000/17557 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null sessionId:0 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.085134 3377 9757 D Telecom : h2: onPlaybackConfigChanged: config=AudioPlaybackConfiguration piid:3647 deviceIds:[] type:android.media.MediaPlayer u/pid:10356/6308 state:idle attr:AudioAttributes: usage=USAGE_UNKNOWN content=CONTENT_TYPE_UNKNOWN flags=0x800 tags= bundle=null sessionId:10857 mutedState:none FormatInfo{isSpatialized=false, channelMask=0x0, sampleRate=0} 08-06 16:39:08.085843 19578 19643 D MTS_BaseSceneDetector: [m]com.smile.gifmaker audioState: 10881 State: 4 08-06 16:39:08.085892 19578 19643 D MTS_BaseSceneDetector: [m]com.smile.gifmaker audioState: 11281 State: 2 08-06 16:39:08.085913 19578 19643 D MTS_BaseSceneDetector: [m]com.smile.gifmaker audioState: 10841 State: 3 08-06 16:39:08.086281 2463 10083 D OplusNuPlayer: already disable oplus avenhancements decoders... 08-06 16:39:08.086298 2463 10083 D OplusNuPlayer: [instantiateDecoder:L574] codeID A:0 V:0 tryffmpeg A:0 V:0 08-06 16:39:08.087111 6748 9240 E KLog : [E] [Tid: 486288987328] [Daenerys][operator()][stats.h:240] last pts:69982187,frame_number:53,cost_time:0,thread_site:2 08-06 16:39:08.089982 19578 19643 W MTS_BaseSceneDetectorFactory: [m]illegal pkgName: com.kuaishou.nebula 08-06 16:39:08.090065 19578 19643 W MTS_AppSceneDetector: [m]create detector fail 08-06 16:39:08.090095 19578 19643 W MTS_AppSceneDetector: [m]detect play change when get detector is null, uid: 10373 08-06 16:39:08.093672 1793 3489 I AHAL: AudioDevice: GetParameters: 3018: enter: is_hw_dec_session_available 08-06 16:39:08.094676 6748 10054 D MediaCodec: [0xb4000070b0571800] setState: 5 08-06 16:39:08.094924 2463 10096 D MediaCodec: CreateByType: mime audio/vorbis, encoder 0, pid 6748 08-06 16:39:08.095213 6748 9244 I KLog : [I] [Tid: 485694878912] MediaRecorderImpl| onCaptureOneVideoFrame 08-06 16:39:08.095264 6748 9244 I KLog : [I] [Tid: 485694878912] CaptureImageController| onPreviewCaptured main bitmap 0 true w*h:996*1920 08-06 16:39:08.095280 6748 9244 I KLog : [I] [Tid: 485694878912] CaptureImageController| main mediaRecorder didFinishCaptureImage 08-06 16:39:08.095392 14336 14336 I mydevices[core].AudioPlaybackMonitor: (main)notifyPlaybackConfigChanged 08-06 16:39:08.095421 10098 10171 I midasd : OplusObrainService::notifyEventIntString eventId:14 iParam:2 strParam:com.kuaishou.nebula 08-06 16:39:08.095660 2463 10096 W libc : Access denied finding property &quot;vendor.debug.stagefright.mediacodec.trace&quot; 08-06 16:39:08.095694 14336 14336 I mydevices[core].AudioPlaybackMonitor: (main)checkPlaybackChanged 08-06 16:39:08.095784 2463 10096 W libc : Access denied finding property &quot;persist.vendor.media.c2.frameworks.buffercount.trace&quot; 08-06 16:39:08.095809 2463 10096 W libc : Access denied finding property &quot;persist.vendor.media.c2.frameworks.buffercount.trace&quot; 08-06 16:39:08.096314 2463 10096 W libc : Access denied finding property &quot;persist.vendor.media.c2.frameworks.buffercount.trace&quot; 08-06 16:39:08.096343 2463 10096 W libc : Access denied finding property &quot;persist.vendor.media.c2.frameworks.buffercount.trace&quot; 08-06 16:39:08.096386 2463 10096 D MediaCodec: [0xb400007c5f5cd800] init: CCodec 0xb400007c57437700, CCodecBufferChannel 0xb400007c7a547018 08-06 16:39:08.096514 2463 10100 D MediaCodec: [0xb400007c5f5cd800] setState: 1 08-06 16:39:08.096561 2463 10100 D CCodec : allocate(c2.android.vorbis.decoder) 08-06 16:39:08.097251 2448 9903 I OplusCameraService: CameraServiceExtImpl.cpp: 5082 getTrdPartyFBJsonValue() getTrdPartyFBJsonValue apkPropName: oplus.video.beauty.com.kuaishou.nebula, prop value: -1 08-06 16:39:08.097270 6748 10080 I KLog : [I] [Tid: 488912553152] FaceMagicLog jni : nativeGetFaceMagicInfo 08-06 16:39:08.097467 12585 32752 I OplusObrain: OplusObrainClientInvoke.nativeGetAudioPackageList 08-06 16:39:08.099245 1865 4191 W QC2Interface: [avcE_712] Failed to query parameters 08-06 16:39:08.101375 1858 1968 I [UAH_CLIENT]: UahPlatformResAcquire 08-06 16:39:08.101405 1858 1968 I [UAH_CLIENT]: UahEventAcquire, cmdid:-3, pkg:1865 4191, identity:qcom-perfd 08-06 16:39:08.101865 2044 2075 I URCC_CORE_SERVER: [urccRequestQueueExec] urccRequest: handle: 117196, uz3M9x5&amp;*ibde*fiai#*79yy5s&amp;*t7vx-u5s46#*6ps9q1vw&amp;*hjj#*us1v&amp;*h#*r916&amp;*wvw5#*sr&amp;i#*s5r&amp;*^jmijijjij#fjaejjj$ 08-06 16:39:08.102267 2044 2075 I URCC_RES_MANAGER: [dumpResourceApplyInfo] urccResUpdate: XKF&amp;^iiciad#jmij#iahjjjj#jmjb$ 08-06 16:39:08.102321 2044 2075 I URCC_RES_MANAGER: [dumpCpuOnline] urccCoreCtrl: [0x1010b90,2,191919,-1] [0x1010ba0,3,191919,-1] [0x1010bb0,1,191919,-1] [0x1010bc0,2,191919,-1] 08-06 16:39:08.102455 1858 1966 E ANDR-PERF-RESOURCEQS: ANDR-PERF-RESOURCEQS: AddAndApply() 125: Resource with major=16, minor=0 not supported 08-06 16:39:08.111151 2463 10100 I CCodec : setting up &#39;default&#39; as default (vendor) store 08-06 16:39:08.111589 6748 6748 D MediaRouter: onRestoreRoute() : route=RouteInfo{ name=手机, description=null, status=null, category=RouteCategory{ name=系统 types=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO groupable=false }, supportedTypes=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO , presentationDisplay=null } 08-06 16:39:08.111680 6748 6748 V MediaRouter: Selecting route: RouteInfo{ name=手机, description=null, status=null, category=RouteCategory{ name=系统 types=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO groupable=false }, supportedTypes=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO , presentationDisplay=null } 08-06 16:39:08.118992 2833 18779 D BufferPoolAccessor2.0: bufferpool2 0xb4000074ba52d428 : 0(0 size) total buffers - 0(0 size) used buffers - 0/0 (recycle/alloc) - 0/0 (fetch/transfer) 08-06 16:39:08.119117 2833 18779 D BufferPoolAccessor2.0: bufferpool2 0xb4000074ba52c828 : 0(0 size) total buffers - 0(0 size) used buffers - 287/334 (recycle/alloc) - 43/294 (fetch/transfer) 08-06 16:39:08.119144 2463 16838 D BufferPoolAccessor2.0: bufferpool2 0xb400007c7a51f628 : 0(0 size) total buffers - 0(0 size) used buffers - 37/45 (recycle/alloc) - 8/86 (fetch/transfer) 08-06 16:39:08.119210 10098 10171 I midasd : OplusObrainService::notifyEventInt eventId:21 iParam:0 08-06 16:39:08.119269 2463 16838 D BufferPoolAccessor2.0: Destruction - bufferpool2 0xb400007c7a51f628 cached: 0/0M, 0/0% in use; allocs: 45, 82% recycled; transfers: 86, 91% unfetched 08-06 16:39:08.119494 1865 10112 W IMGTXRFILTER: [imgTxrF_712] Client has not specified color aspects, setting default for format -1040187392(RGBA8888_UBWC) 08-06 16:39:08.120408 1865 10114 E CVPFilter: [cvpF_712] start: Eva-Dme object couldn&#39;t be constructed! Bypass it 08-06 16:39:08.121769 12585 32752 I OplusObrain: OplusObrainClientInvoke.nativeGetTelephonyInfo 08-06 16:39:08.122279 12585 32752 I OplusObrain: OplusObrainClientInvoke.nativeGetTrafficTypeInfoForNetworkType networkType 0 08-06 16:39:08.122459 3377 9118 D KernelStatsHelper: getKernelStats start! 08-06 16:39:08.124521 2463 10100 I CCodec : Created component [c2.android.vorbis.decoder] for [c2.android.vorbis.decoder] 08-06 16:39:08.124547 2463 10100 D CCodecBufferChannel: [0xb400007c7a547018] setComponent: mName c2.android.vorbis.decoder#444, mPipelineWatcher 0xb400007c7a547500 08-06 16:39:08.124771 2463 10100 D CCodecConfig: read media type: audio/vorbis 08-06 16:39:08.125442 6748 6937 I Ktrace : trace manager create trace with span name 0xb400007247d3c960. 08-06 16:39:08.126590 6748 6937 I Ktrace : Host internal: ReportEvent 08-06 16:39:08.127427 2463 10100 D ReflectedParamUpdater: extent() != 1 for single value type: algo.buffers.max-count.values 08-06 16:39:08.128410 2463 10100 D ReflectedParamUpdater: extent() != 1 for single value type: output.subscribed-indices.values 08-06 16:39:08.128503 2463 10100 D ReflectedParamUpdater: extent() != 1 for single value type: input.buffers.allocator-ids.values 08-06 16:39:08.128570 2463 10100 D ReflectedParamUpdater: extent() != 1 for single value type: output.buffers.allocator-ids.values 08-06 16:39:08.128621 2463 10100 D ReflectedParamUpdater: extent() != 1 for single value type: algo.buffers.allocator-ids.values 08-06 16:39:08.128656 2463 10100 D ReflectedParamUpdater: extent() != 1 for single value type: output.buffers.pool-ids.values 08-06 16:39:08.128689 2463 10100 D ReflectedParamUpdater: extent() != 1 for single value type: algo.buffers.pool-ids.values 08-06 16:39:08.129298 2463 10100 I CCodecConfig: query failed after returning 8 values (BAD_INDEX) 08-06 16:39:08.129350 2448 9903 I OplusCameraService: CameraServiceExtImpl.cpp: 5082 getTrdPartyFBJsonValue() getTrdPartyFBJsonValue apkPropName: oplus.video.beauty.com.kuaishou.nebula, prop value: -1 08-06 16:39:08.129529 2463 10100 D MediaCodec: [0xb400007c5f5cd800] setState: 2 08-06 16:39:08.130283 6748 9223 I KLog : [I] [Tid: 489411302592] [Daenerys][operator()][runloop_processor.h:42] RunloopProcessor frame dropped from_input:1,frame_number:56,pts:69982287 08-06 16:39:08.131641 1249 1249 E lowmemorykiller: device memory 820800 free 60206 file 711926 08-06 16:39:08.131757 3377 8080 D OplusNetlinkSocket: handleNetlinkRecvKernelMessage:nlmsghdr:StructNlMsgHdr{ nlmsg_len{3004}, nlmsg_type{49()}, nlmsg_flags{0()}, nlmsg_seq{0}, nlmsg_pid{221323152} } 08-06 16:39:08.133231 3377 8080 D KernelStatsHelper: get magic :[-1, -1, -1, 77, 65, 71, 73, 67] 08-06 16:39:08.133250 3377 8080 D KernelStatsHelper: magic matched count:86 data_len:4472 08-06 16:39:08.133343 3377 8080 D OplusNetlinkSocket: handleNetlinkRecvKernelMessage:nlmsghdr:StructNlMsgHdr{ nlmsg_len{1532}, nlmsg_type{49()}, nlmsg_flags{0()}, nlmsg_seq{0}, nlmsg_pid{221323152} } 08-06 16:39:08.133357 3377 8080 D KernelStatsHelper: data over! check: true 08-06 16:39:08.135275 1865 4191 W QC2Interface: [avcE_712] Failed to query parameters 08-06 16:39:08.135475 1858 1968 I [UAH_CLIENT]: UahRelease, handle:117196 08-06 16:39:08.135797 2044 2075 I URCC_CORE_SERVER: [urccRequestReleaseExec] urccRelease: handle: 117196, said:-1 08-06 16:39:08.136227 2044 2075 I URCC_RES_MANAGER: [dumpResourceApplyInfo] urccResUpdate: XKF&amp;^iicjeg#jmij#dchjjj#jmjj$ 08-06 16:39:08.137655 2463 10096 W ServiceManagerCppClient: Failed to get isDeclared for media_quality: Status(-1, EX_SECURITY): &#39;SELinux denied for service.&#39; 08-06 16:39:08.137699 2463 10096 E MediaCodec: Media Quality Service not found. 08-06 16:39:08.137803 2463 10096 I MediaCodec: [0xb400007c5f5cd800] [c2.android.vorbis.decoder] configure, format : AMessage(what = 0x00000000) = { string mime = &quot;audio/vorbis&quot; int64_t durationUs = 139546 Buffer csd-0 = { 00000000: 01 76 6f 72 62 69 73 00 00 00 00 01 44 ac 00 00 .vorbis.....D... 00000010: 00 00 00 00 70 11 01 00 00 00 00 00 b8 01 ....p......... } Buffer *csd-1 = 0xb400007c74118100 int32_t bitrate = 70000 int32_t channel-count = 1 int32_t sample-rate = 44100 int32_t channel-mask = 1 int32_t priority = 0 int32_t pcm-encoding = 2 int32_t dataSourceType = 5 int64_t calling-uid = 10373 int64_t calling-pid = 6748 int32_t vendor.qti-ext-dec-drop-corrupt.value = 1 } 日志解释
08-12
/ prepareTracks_l() must be called with ThreadBase::mLock held AudioFlinger::PlaybackThread::mixer_state AudioFlinger::MixerThread::prepareTracks_l( Vector&lt; sp&lt;Track&gt; &gt; *tracksToRemove) { mixer_state mixerStatus = MIXER_IDLE; // find out which tracks need to be processed size_t count = mActiveTracks.size(); size_t mixedTracks = 0; size_t tracksWithEffect = 0; // counts only _active_ fast tracks size_t fastTracks = 0; uint32_t resetMask = 0; // bit mask of fast tracks that need to be reset float masterVolume = mMasterVolume; bool masterMute = mMasterMute; if (masterMute) { masterVolume = 0; } // Delegate master volume control to effect in output mix effect chain if needed sp&lt;EffectChain&gt; chain = getEffectChain_l(AUDIO_SESSION_OUTPUT_MIX); if (chain != 0) { uint32_t v = (uint32_t)(masterVolume * (1 &lt;&lt; 24)); chain-&gt;setVolume_l(&amp;v, &amp;v); masterVolume = (float)((v + (1 &lt;&lt; 23)) &gt;&gt; 24); chain.clear(); } // prepare a new state to push FastMixerStateQueue *sq = NULL; FastMixerState *state = NULL; bool didModify = false; FastMixerStateQueue::block_t block = FastMixerStateQueue::BLOCK_UNTIL_PUSHED; if (mFastMixer != 0) { sq = mFastMixer-&gt;sq(); state = sq-&gt;begin(); } mMixerBufferValid = false; // mMixerBuffer has no valid data until appropriate tracks found. mEffectBufferValid = false; // mEffectBuffer has no valid data until tracks found. for (size_t i=0 ; i&lt;count ; i++) { const sp&lt;Track&gt; t = mActiveTracks[i].promote(); if (t == 0) { continue; } // this const just means the local variable doesn&#39;t change Track* const track = t.get(); // process fast tracks if (track-&gt;isFastTrack()) { // It&#39;s theoretically possible (though unlikely) for a fast track to be created // and then removed within the same normal mix cycle. This is not a problem, as // the track never becomes active so it&#39;s fast mixer slot is never touched. // The converse, of removing an (active) track and then creating a new track // at the identical fast mixer slot within the same normal mix cycle, // is impossible because the slot isn&#39;t marked available until the end of each cycle. int j = track-&gt;mFastIndex; ALOG_ASSERT(0 &lt; j &amp;&amp; j &lt; (int)FastMixerState::sMaxFastTracks); ALOG_ASSERT(!(mFastTrackAvailMask &amp; (1 &lt;&lt; j))); FastTrack *fastTrack = &amp;state-&gt;mFastTracks[j]; // Determine whether the track is currently in underrun condition, // and whether it had a recent underrun. FastTrackDump *ftDump = &amp;mFastMixerDumpState.mTracks[j]; FastTrackUnderruns underruns = ftDump-&gt;mUnderruns; uint32_t recentFull = (underruns.mBitFields.mFull - track-&gt;mObservedUnderruns.mBitFields.mFull) &amp; UNDERRUN_MASK; uint32_t recentPartial = (underruns.mBitFields.mPartial - track-&gt;mObservedUnderruns.mBitFields.mPartial) &amp; UNDERRUN_MASK; uint32_t recentEmpty = (underruns.mBitFields.mEmpty - track-&gt;mObservedUnderruns.mBitFields.mEmpty) &amp; UNDERRUN_MASK; uint32_t recentUnderruns = recentPartial + recentEmpty; track-&gt;mObservedUnderruns = underruns; // don&#39;t count underruns that occur while stopping or pausing // or stopped which can occur when flush() is called while active if (!(track-&gt;isStopping() || track-&gt;isPausing() || track-&gt;isStopped()) &amp;&amp; recentUnderruns &gt; 0) { // FIXME fast mixer will pull &amp; mix partial buffers, but we count as a full underrun track-&gt;mAudioTrackServerProxy-&gt;tallyUnderrunFrames(recentUnderruns * mFrameCount); } else { track-&gt;mAudioTrackServerProxy-&gt;tallyUnderrunFrames(0); } // This is similar to the state machine for normal tracks, // with a few modifications for fast tracks. bool isActive = true; switch (track-&gt;mState) { case TrackBase::STOPPING_1: // track stays active in STOPPING_1 state until first underrun if (recentUnderruns &gt; 0 || track-&gt;isTerminated()) { track-&gt;mState = TrackBase::STOPPING_2; } break; case TrackBase::PAUSING: // ramp down is not yet implemented track-&gt;setPaused(); break; case TrackBase::RESUMING: // ramp up is not yet implemented track-&gt;mState = TrackBase::ACTIVE; break; case TrackBase::ACTIVE: if (recentFull &gt; 0 || recentPartial &gt; 0) { // track has provided at least some frames recently: reset retry count track-&gt;mRetryCount = kMaxTrackRetries; } if (recentUnderruns == 0) { // no recent underruns: stay active break; } // there has recently been an underrun of some kind if (track-&gt;sharedBuffer() == 0) { // were any of the recent underruns &quot;empty&quot; (no frames available)? if (recentEmpty == 0) { // no, then ignore the partial underruns as they are allowed indefinitely break; } // there has recently been an &quot;empty&quot; underrun: decrement the retry counter if (--(track-&gt;mRetryCount) &gt; 0) { break; } // indicate to client process that the track was disabled because of underrun; // it will then automatically call start() when data is available track-&gt;disable(); // remove from active list, but state remains ACTIVE [confusing but true] isActive = false; break; } // fall through case TrackBase::STOPPING_2: case TrackBase::PAUSED: case TrackBase::STOPPED: case TrackBase::FLUSHED: // flush() while active // Check for presentation complete if track is inactive // We have consumed all the buffers of this track. // This would be incomplete if we auto-paused on underrun { size_t audioHALFrames = (mOutput-&gt;stream-&gt;get_latency(mOutput-&gt;stream)*mSampleRate) / 1000; int64_t framesWritten = mBytesWritten / mFrameSize; if (!(mStandby || track-&gt;presentationComplete(framesWritten, audioHALFrames))) { // track stays in active list until presentation is complete break; } } if (track-&gt;isStopping_2()) { track-&gt;mState = TrackBase::STOPPED; } if (track-&gt;isStopped()) { // Can&#39;t reset directly, as fast mixer is still polling this track // track-&gt;reset(); // So instead mark this track as needing to be reset after push with ack resetMask |= 1 &lt;&lt; i; } isActive = false; break; case TrackBase::IDLE: default: LOG_ALWAYS_FATAL(&quot;unexpected track state %d&quot;, track-&gt;mState); } if (isActive) { // was it previously inactive? if (!(state-&gt;mTrackMask &amp; (1 &lt;&lt; j))) { ExtendedAudioBufferProvider *eabp = track; VolumeProvider *vp = track; fastTrack-&gt;mBufferProvider = eabp; fastTrack-&gt;mVolumeProvider = vp; fastTrack-&gt;mChannelMask = track-&gt;mChannelMask; fastTrack-&gt;mFormat = track-&gt;mFormat; fastTrack-&gt;mGeneration++; state-&gt;mTrackMask |= 1 &lt;&lt; j; didModify = true; // no acknowledgement required for newly active tracks } // cache the combined master volume and stream type volume for fast mixer; this // lacks any synchronization or barrier so VolumeProvider may read a stale value track-&gt;mCachedVolume = masterVolume * mStreamTypes[track-&gt;streamType()].volume; ++fastTracks; } else { // was it previously active? if (state-&gt;mTrackMask &amp; (1 &lt;&lt; j)) { fastTrack-&gt;mBufferProvider = NULL; fastTrack-&gt;mGeneration++; state-&gt;mTrackMask &amp;= ~(1 &lt;&lt; j); didModify = true; // If any fast tracks were removed, we must wait for acknowledgement // because we&#39;re about to decrement the last sp&lt;&gt; on those tracks. block = FastMixerStateQueue::BLOCK_UNTIL_ACKED; } else { LOG_ALWAYS_FATAL(&quot;fast track %d should have been active; &quot; &quot;mState=%d, mTrackMask=%#x, recentUnderruns=%u, isShared=%d&quot;, j, track-&gt;mState, state-&gt;mTrackMask, recentUnderruns, track-&gt;sharedBuffer() != 0); } tracksToRemove-&gt;add(track); // Avoids a misleading display in dumpsys track-&gt;mObservedUnderruns.mBitFields.mMostRecent = UNDERRUN_FULL; } continue; } { // local variable scope to avoid goto warning audio_track_cblk_t* cblk = track-&gt;cblk(); // The first time a track is added we wait // for all its buffers to be filled before processing it int name = track-&gt;name(); // make sure that we have enough frames to mix one full buffer. // enforce this condition only once to enable draining the buffer in case the client // app does not call stop() and relies on underrun to stop: // hence the test on (mMixerStatus == MIXER_TRACKS_READY) meaning the track was mixed // during last round size_t desiredFrames; const uint32_t sampleRate = track-&gt;mAudioTrackServerProxy-&gt;getSampleRate(); AudioPlaybackRate playbackRate = track-&gt;mAudioTrackServerProxy-&gt;getPlaybackRate(); desiredFrames = sourceFramesNeededWithTimestretch( sampleRate, mNormalFrameCount, mSampleRate, playbackRate.mSpeed); // TODO: ONLY USED FOR LEGACY RESAMPLERS, remove when they are removed. // add frames already consumed but not yet released by the resampler // because mAudioTrackServerProxy-&gt;framesReady() will include these frames desiredFrames += mAudioMixer-&gt;getUnreleasedFrames(track-&gt;name()); uint32_t minFrames = 1; if ((track-&gt;sharedBuffer() == 0) &amp;&amp; !track-&gt;isStopped() &amp;&amp; !track-&gt;isPausing() &amp;&amp; (mMixerStatusIgnoringFastTracks == MIXER_TRACKS_READY)) { minFrames = desiredFrames; } size_t framesReady = track-&gt;framesReady(); if (ATRACE_ENABLED()) { // I wish we had formatted trace names char traceName[16]; strcpy(traceName, &quot;nRdy&quot;); int name = track-&gt;name(); if (AudioMixer::TRACK0 &lt;= name &amp;&amp; name &lt; (int) (AudioMixer::TRACK0 + AudioMixer::MAX_NUM_TRACKS)) { name -= AudioMixer::TRACK0; traceName[4] = (name / 10) + &#39;0&#39;; traceName[5] = (name % 10) + &#39;0&#39;; } else { traceName[4] = &#39;?&#39;; traceName[5] = &#39;?&#39;; } traceName[6] = &#39;\0&#39;; ATRACE_INT(traceName, framesReady); } if ((framesReady &gt;= minFrames) &amp;&amp; track-&gt;isReady() &amp;&amp; !track-&gt;isPaused() &amp;&amp; !track-&gt;isTerminated()) { ALOGVV(&quot;track %d s=%08x [OK] on thread %p&quot;, name, cblk-&gt;mServer, this); mixedTracks++; // track-&gt;mainBuffer() != mSinkBuffer or mMixerBuffer means // there is an effect chain connected to the track chain.clear(); if (track-&gt;mainBuffer() != mSinkBuffer &amp;&amp; track-&gt;mainBuffer() != mMixerBuffer) { if (mEffectBufferEnabled) { mEffectBufferValid = true; // Later can set directly. } chain = getEffectChain_l(track-&gt;sessionId()); // Delegate volume control to effect in track effect chain if needed if (chain != 0) { tracksWithEffect++; } else { ALOGW(&quot;prepareTracks_l(): track %d attached to effect but no chain found on &quot; &quot;session %d&quot;, name, track-&gt;sessionId()); } } int param = AudioMixer::VOLUME; if (track-&gt;mFillingUpStatus == Track::FS_FILLED) { // no ramp for the first volume setting track-&gt;mFillingUpStatus = Track::FS_ACTIVE; if (track-&gt;mState == TrackBase::RESUMING) { track-&gt;mState = TrackBase::ACTIVE; param = AudioMixer::RAMP_VOLUME; } mAudioMixer-&gt;setParameter(name, AudioMixer::RESAMPLE, AudioMixer::RESET, NULL); // FIXME should not make a decision based on mServer } else if (cblk-&gt;mServer != 0) { // If the track is stopped before the first frame was mixed, // do not apply ramp param = AudioMixer::RAMP_VOLUME; } // compute volume for this track uint32_t vl, vr; // in U8.24 integer format float vlf, vrf, vaf; // in [0.0, 1.0] float format if (track-&gt;isPausing() || mStreamTypes[track-&gt;streamType()].mute) { vl = vr = 0; vlf = vrf = vaf = 0.; if (track-&gt;isPausing()) { track-&gt;setPaused(); } } else { // read original volumes with volume control float typeVolume = mStreamTypes[track-&gt;streamType()].volume; float v = masterVolume * typeVolume; //add for boot video:sync audio for boot char value[PROPERTY_VALUE_MAX] = &quot;&quot;; property_get(&quot;persist.sys.bootvideo.enable&quot;, value, &quot;false&quot;); if(!strcmp(value,&quot;true&quot;)){ property_get(&quot;sys.bootvideo.closed&quot;, value, &quot;1&quot;); if (atoi(value) == 0){ ALOGV(&quot;bootvideo running now,audioflinger no need to control volume&quot;); v = 1.0; } } AudioTrackServerProxy *proxy = track-&gt;mAudioTrackServerProxy; gain_minifloat_packed_t vlr = proxy-&gt;getVolumeLR(); vlf = float_from_gain(gain_minifloat_unpack_left(vlr)); vrf = float_from_gain(gain_minifloat_unpack_right(vlr)); // track volumes come from shared memory, so can&#39;t be trusted and must be clamped if (vlf &gt; GAIN_FLOAT_UNITY) { ALOGV(&quot;Track left volume out of range: %.3g&quot;, vlf); vlf = GAIN_FLOAT_UNITY; } if (vrf &gt; GAIN_FLOAT_UNITY) { ALOGV(&quot;Track right volume out of range: %.3g&quot;, vrf); vrf = GAIN_FLOAT_UNITY; } // now apply the master volume and stream type volume vlf *= v; vrf *= v; // assuming master volume and stream type volume each go up to 1.0, // then derive vl and vr as U8.24 versions for the effect chain const float scaleto8_24 = MAX_GAIN_INT * MAX_GAIN_INT; vl = (uint32_t) (scaleto8_24 * vlf); vr = (uint32_t) (scaleto8_24 * vrf); // vl and vr are now in U8.24 format uint16_t sendLevel = proxy-&gt;getSendLevel_U4_12(); // send level comes from shared memory and so may be corrupt if (sendLevel &gt; MAX_GAIN_INT) { ALOGV(&quot;Track send level out of range: %04X&quot;, sendLevel); sendLevel = MAX_GAIN_INT; } // vaf is represented as [0.0, 1.0] float by rescaling sendLevel vaf = v * sendLevel * (1. / MAX_GAIN_INT); } // Delegate volume control to effect in track effect chain if needed if (chain != 0 &amp;&amp; chain-&gt;setVolume_l(&amp;vl, &amp;vr)) { // Do not ramp volume if volume is controlled by effect param = AudioMixer::VOLUME; // Update remaining floating point volume levels vlf = (float)vl / (1 &lt;&lt; 24); vrf = (float)vr / (1 &lt;&lt; 24); track-&gt;mHasVolumeController = true; } else { // force no volume ramp when volume controller was just disabled or removed // from effect chain to avoid volume spike if (track-&gt;mHasVolumeController) { param = AudioMixer::VOLUME; } track-&gt;mHasVolumeController = false; } // XXX: these things DON&#39;T need to be done each time mAudioMixer-&gt;setBufferProvider(name, track); mAudioMixer-&gt;enable(name); mAudioMixer-&gt;setParameter(name, param, AudioMixer::VOLUME0, &amp;vlf); mAudioMixer-&gt;setParameter(name, param, AudioMixer::VOLUME1, &amp;vrf); mAudioMixer-&gt;setParameter(name, param, AudioMixer::AUXLEVEL, &amp;vaf); mAudioMixer-&gt;setParameter( name, AudioMixer::TRACK, AudioMixer::FORMAT, (void *)track-&gt;format()); mAudioMixer-&gt;setParameter( name, AudioMixer::TRACK, AudioMixer::CHANNEL_MASK, (void *)(uintptr_t)track-&gt;channelMask()); mAudioMixer-&gt;setParameter( name, AudioMixer::TRACK, AudioMixer::MIXER_CHANNEL_MASK, (void *)(uintptr_t)mChannelMask); // limit track sample rate to 2 x output sample rate, which changes at re-configuration uint32_t maxSampleRate = mSampleRate * AUDIO_RESAMPLER_DOWN_RATIO_MAX; uint32_t reqSampleRate = track-&gt;mAudioTrackServerProxy-&gt;getSampleRate(); if (reqSampleRate == 0) { reqSampleRate = mSampleRate; } else if (reqSampleRate &gt; maxSampleRate) { reqSampleRate = maxSampleRate; } mAudioMixer-&gt;setParameter( name, AudioMixer::RESAMPLE, AudioMixer::SAMPLE_RATE, (void *)(uintptr_t)reqSampleRate); AudioPlaybackRate playbackRate = track-&gt;mAudioTrackServerProxy-&gt;getPlaybackRate(); mAudioMixer-&gt;setParameter( name, AudioMixer::TIMESTRETCH, AudioMixer::PLAYBACK_RATE, &amp;playbackRate); /* * Select the appropriate output buffer for the track. * * Tracks with effects go into their own effects chain buffer * and from there into either mEffectBuffer or mSinkBuffer. * * Other tracks can use mMixerBuffer for higher precision * channel accumulation. If this buffer is enabled * (mMixerBufferEnabled true), then selected tracks will accumulate * into it. * */ if (mMixerBufferEnabled &amp;&amp; (track-&gt;mainBuffer() == mSinkBuffer || track-&gt;mainBuffer() == mMixerBuffer)) { mAudioMixer-&gt;setParameter( name, AudioMixer::TRACK, AudioMixer::MIXER_FORMAT, (void *)mMixerBufferFormat); mAudioMixer-&gt;setParameter( name, AudioMixer::TRACK, AudioMixer::MAIN_BUFFER, (void *)mMixerBuffer); // TODO: override track-&gt;mainBuffer()? mMixerBufferValid = true; } else { mAudioMixer-&gt;setParameter( name, AudioMixer::TRACK, AudioMixer::MIXER_FORMAT, (void *)AUDIO_FORMAT_PCM_16_BIT); mAudioMixer-&gt;setParameter( name, AudioMixer::TRACK, AudioMixer::MAIN_BUFFER, (void *)track-&gt;mainBuffer()); } mAudioMixer-&gt;setParameter( name, AudioMixer::TRACK, AudioMixer::AUX_BUFFER, (void *)track-&gt;auxBuffer()); // reset retry count track-&gt;mRetryCount = kMaxTrackRetries; // If one track is ready, set the mixer ready if: // - the mixer was not ready during previous round OR // - no other track is not ready if (mMixerStatusIgnoringFastTracks != MIXER_TRACKS_READY || mixerStatus != MIXER_TRACKS_ENABLED) { mixerStatus = MIXER_TRACKS_READY; } } else { if (framesReady &lt; desiredFrames &amp;&amp; !track-&gt;isStopped() &amp;&amp; !track-&gt;isPaused()) { ALOGV(&quot;track(%p) underrun, framesReady(%zu) &lt; framesDesired(%zd)&quot;, track, framesReady, desiredFrames); track-&gt;mAudioTrackServerProxy-&gt;tallyUnderrunFrames(desiredFrames); } else { track-&gt;mAudioTrackServerProxy-&gt;tallyUnderrunFrames(0); } // clear effect chain input buffer if an active track underruns to avoid sending // previous audio buffer again to effects chain = getEffectChain_l(track-&gt;sessionId()); if (chain != 0) { chain-&gt;clearInputBuffer(); } ALOGVV(&quot;track %d s=%08x [NOT READY] on thread %p&quot;, name, cblk-&gt;mServer, this); if ((track-&gt;sharedBuffer() != 0) || track-&gt;isTerminated() || track-&gt;isStopped() || track-&gt;isPaused()) { // We have consumed all the buffers of this track. // Remove it from the list of active tracks. // TODO: use actual buffer filling status instead of latency when available from // audio HAL size_t audioHALFrames = (latency_l() * mSampleRate) / 1000; int64_t framesWritten = mBytesWritten / mFrameSize; if (mStandby || track-&gt;presentationComplete(framesWritten, audioHALFrames)) { if (track-&gt;isStopped()) { track-&gt;reset(); } tracksToRemove-&gt;add(track); } } else { // No buffers for this track. Give it a few chances to // fill a buffer, then remove it from active list. if (--(track-&gt;mRetryCount) &lt;= 0) { ALOGI(&quot;BUFFER TIMEOUT: remove(%d) from active list on thread %p&quot;, name, this); tracksToRemove-&gt;add(track); // indicate to client process that the track was disabled because of underrun; // it will then automatically call start() when data is available track-&gt;disable(); // If one track is not ready, mark the mixer also not ready if: // - the mixer was ready during previous round OR // - no other track is ready } else if (mMixerStatusIgnoringFastTracks == MIXER_TRACKS_READY || mixerStatus != MIXER_TRACKS_READY) { mixerStatus = MIXER_TRACKS_ENABLED; } } mAudioMixer-&gt;disable(name); } } // local variable scope to avoid goto warning } // Push the new FastMixer state if necessary bool pauseAudioWatchdog = false; if (didModify) { state-&gt;mFastTracksGen++; // if the fast mixer was active, but now there are no fast tracks, then put it in cold idle if (kUseFastMixer == FastMixer_Dynamic &amp;&amp; state-&gt;mCommand == FastMixerState::MIX_WRITE &amp;&amp; state-&gt;mTrackMask &lt;= 1) { state-&gt;mCommand = FastMixerState::COLD_IDLE; state-&gt;mColdFutexAddr = &amp;mFastMixerFutex; state-&gt;mColdGen++; mFastMixerFutex = 0; if (kUseFastMixer == FastMixer_Dynamic) { mNormalSink = mOutputSink; } // If we go into cold idle, need to wait for acknowledgement // so that fast mixer stops doing I/O. block = FastMixerStateQueue::BLOCK_UNTIL_ACKED; pauseAudioWatchdog = true; } } if (sq != NULL) { sq-&gt;end(didModify); sq-&gt;push(block); } #ifdef AUDIO_WATCHDOG if (pauseAudioWatchdog &amp;&amp; mAudioWatchdog != 0) { mAudioWatchdog-&gt;pause(); } #endif // Now perform the deferred reset on fast tracks that have stopped while (resetMask != 0) { size_t i = __builtin_ctz(resetMask); ALOG_ASSERT(i &lt; count); resetMask &amp;= ~(1 &lt;&lt; i); sp&lt;Track&gt; t = mActiveTracks[i].promote(); if (t == 0) { continue; } Track* track = t.get(); ALOG_ASSERT(track-&gt;isFastTrack() &amp;&amp; track-&gt;isStopped()); track-&gt;reset(); } // remove all the tracks that need to be... removeTracks_l(*tracksToRemove); if (getEffectChain_l(AUDIO_SESSION_OUTPUT_MIX) != 0) { mEffectBufferValid = true; } if (mEffectBufferValid) { // as long as there are effects we should clear the effects buffer, to avoid // passing a non-clean buffer to the effect chain memset(mEffectBuffer, 0, mEffectBufferSize); } // sink or mix buffer must be cleared if all tracks are connected to an // effect chain as in this case the mixer will not write to the sink or mix buffer // and track effects will accumulate into it if ((mBytesRemaining == 0) &amp;&amp; ((mixedTracks != 0 &amp;&amp; mixedTracks == tracksWithEffect) || (mixedTracks == 0 &amp;&amp; fastTracks &gt; 0))) { // FIXME as a performance optimization, should remember previous zero status if (mMixerBufferValid) { memset(mMixerBuffer, 0, mMixerBufferSize); // TODO: In testing, mSinkBuffer below need not be cleared because // the PlaybackThread::threadLoop() copies mMixerBuffer into mSinkBuffer // after mixing. // // To enforce this guarantee: // ((mixedTracks != 0 &amp;&amp; mixedTracks == tracksWithEffect) || // (mixedTracks == 0 &amp;&amp; fastTracks &gt; 0)) // must imply MIXER_TRACKS_READY. // Later, we may clear buffers regardless, and skip much of this logic. } // FIXME as a performance optimization, should remember previous zero status memset(mSinkBuffer, 0, mNormalFrameCount * mFrameSize); } // if any fast tracks, then status is ready mMixerStatusIgnoringFastTracks = mixerStatus; if (fastTracks &gt; 0) { mixerStatus = MIXER_TRACKS_READY; } return mixerStatus; } 根据上下文优化这段代码
最新发布
08-14
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值