老翟的仓库zhaixishan.blog.chinaunix.net
zhaixishan
全部博文(125)
2014年(1)
2013年(1)
2012年(2)
2011年(29)
2010年(92)
along819
fuleru
bremen14
cn_unix
cynthia
浪花小雨
冇二哥
adwsxule
hkm080
分类: WINDOWS
2011-02-09 14:50:36
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 Playback的流程
下一篇:stagefright框架(三)-選擇Video Decoder
登录 注册