WEB开发网
开发学院手机开发Android 开发 Android 下的PVPlayer的实现 阅读

Android 下的PVPlayer的实现

 2010-09-10 01:08:00 来源:WEB开发网   
核心提示:ret = mPlayerDriver->enqueueCommand(new PlayerSetDataSource(mDataSourcePath,run_init,this));//这里设置了一个回调函数run_init,表明我们的setdatasource完成后会干哈,Android 下的PVPlayer

ret = mPlayerDriver->enqueueCommand(new PlayerSetDataSource(mDataSourcePath,run_init,this));

//这里设置了一个回调函数run_init,表明我们的setdatasource完成后会干哈,

mIsDataSourceSet = true;

} else { // If data source has been already set.

// No need to run a sequence of commands.

// The only command needed to run is PLAYER_PREPARE.

ret = mPlayerDriver->enqueueCommand(new PlayerPrepare(do_nothing, NULL));

}

return ret;

}

初始化的函数

void PVPlayer::run_init(status_t s, void *cookie, bool cancelled)

{

LOGV("run_init s=%d, cancelled=%d", s, cancelled);

if (s == NO_ERROR && !cancelled) {

PVPlayer *p = (PVPlayer*)cookie;

p->mPlayerDriver->enqueueCommand(new PlayerInit(run_set_video_surface, cookie));

}//这里发现初始化完成之后还有下步run_set_video_surface

}

void PVPlayer::run_set_video_surface(status_t s, void *cookie, bool cancelled)

{

LOGV("run_set_video_surface s=%d, cancelled=%d", s, cancelled);

if (s == NO_ERROR && !cancelled) {

// If we don't have a video surface, just skip to the next step.

PVPlayer *p = (PVPlayer*)cookie;

if (p->mSurface == NULL) {

run_set_audio_output(s, cookie, false);

} else {

p->mPlayerDriver->enqueueCommand(new PlayerSetVideoSurface(p->mSurface, run_set_audio_output, cookie));

//设置视频之后还要run_set_audio_output

}

}

}

void PVPlayer::run_set_audio_output(status_t s, void *cookie, bool cancelled)

{

LOGV("run_set_audio_output s=%d, cancelled=%d", s, cancelled);

if (s == NO_ERROR && !cancelled) {

PVPlayer *p = (PVPlayer*)cookie;

p->mPlayerDriver->enqueueCommand(new

上一页  4 5 6 7 8 9 10 11 12 13 14  下一页

Tags:Android PVPlayer 实现

编辑录入:coldstar [复制链接] [打 印]
赞助商链接