Android 下的PVPlayer的实现
2010-09-10 01:08:00 来源:WEB开发网sp
if (p == NULL) return NO_INIT;
if (!p->hardwareOutput()) {
mAudioOutput = new AudioOutput();
static_cast
}
// now set data source
mStatus = p->setDataSource(fd, offset, length);
if (mStatus == NO_ERROR) mPlayer = p;
return mStatus;
}
3 、status_t MediaPlayerService::Client::setVideoSurface(const
sp
{
LOGV("[%d] setVideoSurface(%p)", mConnId, surface.get());
sp
if (p == 0) return UNKNOWN_ERROR;
return p->setVideoSurface(surface);
}//
由此可见,其实框架把显示的功能并没有替你做下来,因为这个地方很多p->setVideoSurface(surface);返回值都是空的,这个函数只是给你一个接口,把上层的一个
sp
4、5、 都是设置了源,但是在播放前的一些准备工作,一个是同步,一个是异步。
sp
{
LOGV("decode(%s)", url);
sp
sp
// Protect our precious, precious DRMd ringtones by only allowing
// decoding of http, but not filesystem paths or content Uris.
// If the application wants to decode those, it should open a
// filedescriptor for them and use that.
if (url != NULL && strncmp(url, "http:// ", 7) != 0) {
LOGD("Can't decode %s by path, use filedescriptor instead", url);
更多精彩
赞助商链接