We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(void) texture:(MDVideoFrame*)frame{ dispatch_sync(dispatch_get_main_queue(), ^{ int planes[3] = { 0, 1, 2 }; const GLsizei widths[3] = { frame->pitches[0], frame->pitches[1], frame->pitches[2] }; const GLsizei heights[3] = { frame->h, frame->h / 2, frame->h / 2 }; const GLubyte *pixels[3] = { frame->pixels[0], frame->pixels[1], frame->pixels[2] };
switch (frame->format) { case SDL_FCC_I420: break; case SDL_FCC_YV12: planes[1] = 2; planes[2] = 1; break; default: NSLog(@"[yuv420p] unexpected format %x\n", frame->format); return; } if ([self beginCommit]) { for (int i = 0; i < 3; ++i) { int plane = planes[i]; glBindTexture(GL_TEXTURE_2D, self.program.mTextureUniformHandle[i]); glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, widths[plane], heights[plane], 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, pixels[plane]); } [self postCommit]; self.mRendererBegin = YES; [self.sizeContext updateTextureWidth:frame->w height:frame->h]; GLenum errorCode = glGetError(); if (errorCode) { printf("glGetError:%d\n", errorCode); //throw; } }
}); } 你好我播放视频的时候报[yuv420p] unexpected format 4254565f 可能是视频分辨率过大导致的 请问该怎么解决呢
The text was updated successfully, but these errors were encountered:
No branches or pull requests
(void) texture:(MDVideoFrame*)frame{
dispatch_sync(dispatch_get_main_queue(), ^{
int planes[3] = { 0, 1, 2 };
const GLsizei widths[3] = { frame->pitches[0], frame->pitches[1], frame->pitches[2] };
const GLsizei heights[3] = { frame->h, frame->h / 2, frame->h / 2 };
const GLubyte *pixels[3] = { frame->pixels[0], frame->pixels[1], frame->pixels[2] };
});
} 你好我播放视频的时候报[yuv420p] unexpected format 4254565f 可能是视频分辨率过大导致的 请问该怎么解决呢
The text was updated successfully, but these errors were encountered: