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

Android 下的PVPlayer的实现

 2010-09-10 01:08:00 来源:WEB开发网   
核心提示:// a sequence of commands and only the PLAYER_PREPARE command needs// to be run.if (!mIsDataSourceSet) {//首先看我们的源设置了没有,需不需要重新设置// set data sourceLOGV("prep

// a sequence of commands and only the PLAYER_PREPARE command needs

// to be run.

if (!mIsDataSourceSet) {//首先看我们的源设置了没有,需不需要重新设置

// set data source

LOGV("prepare");

LOGV(" data source = %s", mDataSourcePath);

ret = mPlayerDriver->enqueueCommand(new PlayerSetDataSource(mDataSourcePath,0,0));//如果需要,首先发送设置源的命令

if (ret != OK)

return ret;

// init然后是初始化的命令

LOGV(" init");

ret = mPlayerDriver->enqueueCommand(new PlayerInit(0,0));

if (ret != OK)

return ret;

// set video surface, if there is one然后设置显示面

if (mSurface != NULL) {

LOGV(" set video surface");

ret = mPlayerDriver->enqueueCommand(new PlayerSetVideoSurface(mSurface,0,0));

if (ret != OK)

return ret;

}

// set audio output然后设置音频

// If we ever need to expose selectable audio output setup, this can be broken

// out. In the meantime, however, system audio routing APIs should suffice.

LOGV(" set audio sink");

ret = mPlayerDriver->enqueueCommand(new PlayerSetAudioSink(mAudioSink,0,0));

if (ret != OK)

return ret;

// New data source has been set successfully.

mIsDataSourceSet = true;

}

// prepare 一些列的搞好了之后,才发送准备命令

LOGV(" prepare");

return mPlayerDriver->enqueueCommand(new PlayerPrepare(0,0));

}

如果是异步的话 就涉及到回调

status_t PVPlayer::prepareAsync()

{

LOGV("prepareAsync");

status_t ret = OK;

if (!mIsDataSourceSet) { // If data source has NOT been set.

// Set our data source as cached in setDataSource() above.

LOGV(" data source = %s", mDataSourcePath);

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

Tags:Android PVPlayer 实现

编辑录入:coldstar [复制链接] [打 印]
[]
  • 好
  • 好的评价 如果觉得好,就请您
      0%(0)
  • 差
  • 差的评价 如果觉得差,就请您
      0%(0)
赞助商链接