我的主要目标是从服务器流式传输视频,并在流式传输时逐帧剪切(以便OpenGL可以使用它).为此,我使用了我在互联网上随处可见的代码(我记得它来自Apple的GLVideoFrame示例代码):
NSArray * tracks = [asset tracks];
NSLog(@"%d", tracks.count);
for(AVAssetTrack* track in tracks) {
NSLog(@"type: %@", [track mediaType]);
initialFPS = track.nominalFrameRate;
width = (GLuint)track.naturalSize.width;
height = (GLuint)track.naturalSize.height;
NSError * error = nil;
// _movieReader is a member variable
@try {
self._movieReader = [[[AVAssetReader alloc] initWithAsset:asset error:&error] autorelease];
}
@catch (NSException *exception) {
NSLog(@"%@ -- %@", [exception name], [exception reason]);
NSLog(@"skipping track");
continue;
}
if (error)
{
NSLog(@"CODE:%d\nDOMAIN:%@\nDESCRIPTION:%@\nFAILURE_REASON:%@", [error code], [error domain], error.localizedDescription, [error localizedFailureReason]);
continue;
}
NSString* key = (NSString*)kCVPixelBufferPixelFormatTypeKey; …Run Code Online (Sandbox Code Playgroud) 当我启动我的应用程序时,我不断收到与PhoneGap相关的警报弹出窗口:gap_callbackServer,gap_poll,getToken等...
最后,"gap_poll"错误不断出现,无论你按"确定"还是"取消",它都会无限期地继续下去.
如果我从我的页面中排除"phonegap.js",一切都很顺利,除了我不能使用PhoneGap的能力.有任何想法吗?