OpenGL ESとffmpegを使用して画像からビデオを作成しようとしていますが、iPad(4.3)でクラッシュしますglReadPixels
-(NSData *) glToUIImage {
int numberOfComponents = NUMBER_OF_COMPONENTS; //4
int width = PICTURE_WIDTH;
int height = PICTURE_HEIGHT;
NSInteger myDataLength = width * height * numberOfComponents;
NSMutableData * buffer= [NSMutableData dataWithLength :myDataLength];
[self checkForGLError];
GLenum type = NUMBER_OF_COMPONENTS == 3 ? GL_RGB : GL_RGBA; //RGBA
glReadPixels(0, 0, width, height, type, GL_UNSIGNED_BYTE, [buffer mutableBytes]); //EXC_BAD_ACCESS here
return buffer;
}
iPhone 4(4.3)とiPod Touchで動作しますが、iPhone 3G(3.0)とiPad(4.3)で問題が発生します。この問題を手伝ってもらえますか?
また、iPhone 3G(3.0)とiPad(4.3)でも、ビデオに問題があります。最初の5〜20個のビデオフレームにゴミがあります。多分最適化に問題がありますか?それとも建築?
編集された スタック:
#0 0x33be3964 in void BlockNxN<64ul, 16ul, 1, BLOCK_CONVERTER_NULL_32>(unsigned long, int, int, unsigned long, int, int, unsigned int, unsigned int, unsigned int, unsigned int) ()
#1 0x33be1c76 in glrBIFDetile ()
#2 0x33b586b2 in sgxGetImage(SGXImageReadParams const*) ()
#3 0x33b50d38 in gldReadPixels ()
#4 0x31813e16 in glReadPixels_Exec ()
#5 0x31e3c518 in glReadPixels ()