zou_12345的ChinaUnix博客
zou_12345
全部博文(107)
2014年(2)
2013年(13)
2012年(16)
2011年(76)
yuansy
dodba
flw
prolj
梦洋love
华仔desi
yinliudo
清爽之梦
vanjun20
cynthia
qqqno1
yn_xysnz
MEYEGG
丿奔跑的
ydfivy
mjw88122
zhagnzon
noy0623
分类: Java
2011-04-13 17:59:42
status_t AwesomePlayer::play_l(){ ... mAudioPlayer = new AudioPlayer(mAudioSink, ...); mAudioPlayer->start(...); ...}
status_t AudioPlayer::start(...){ mSource->read(&mFirstBuffer); if (mAudioSink.get() != NULL) { mAudioSink->open(..., &AudioPlayer::AudioSinkCallback, ...); mAudioSink->start(); } else { mAudioTrack = new AudioTrack(..., &AudioPlayer::AudioCallback, ...); mAudioTrack->start(); }}
size_t AudioPlayer::AudioSinkCallback(audioSink, buffer, size, ...){ return fillBuffer(buffer, size);}void AudioPlayer::AudioCallback(..., info){ buffer = info; fillBuffer(buffer->raw, buffer->size);}size_t AudioPlayer::fillBuffer(data, size){ mSource->read(&mInputBuffer, ...); memcpy(data, mInputBuffer->data(), ...);}
上一篇:stagefright框架(五)-Video Rendering
下一篇:tagefright框架(七)-Audio和Video的同步
登录 注册