shrincy的ChinaUnix博客shrincy.blog.chinaunix.net
shrincy
全部博文(15)
编译(1)
Stagefright(9)
2014年(1)
2013年(1)
2012年(13)
gxhp1987
qqqno1
wangcong
王楠w_n
酷爱1993
shanegao
仲先生
notsurei
yyxl
分类:
2012-05-07 10:15:45
原文地址:stagefright框架(六)-Audio Playback的流程 作者:zhaixishan
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的流程
登录 注册