summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@theqtcompany.com>2015-09-29 16:04:35 +0200
committerYoann Lopes <yoann.lopes@theqtcompany.com>2015-10-16 12:45:32 +0000
commitd1bf781c66c6754c494f0e156e78d803f135d7a5 (patch)
treec4ea6c2b0ae1745af929c8b16d08cdb67c6b67f7
parent5232c993a1fba72ca04f8bccae23a90fb9370745 (diff)
downloadqtmultimedia-d1bf781c66c6754c494f0e156e78d803f135d7a5.tar.gz
AVFoundation: fix camera frames texture format.
Change-Id: I87ca4abf80a5be9983aefc791b8a0ef0cd4ac33d Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
-rw-r--r--src/plugins/avfoundation/camera/avfcamerarenderercontrol.mm16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/plugins/avfoundation/camera/avfcamerarenderercontrol.mm b/src/plugins/avfoundation/camera/avfcamerarenderercontrol.mm
index 924c62d97..705ec633f 100644
--- a/src/plugins/avfoundation/camera/avfcamerarenderercontrol.mm
+++ b/src/plugins/avfoundation/camera/avfcamerarenderercontrol.mm
@@ -174,7 +174,7 @@ public:
GL_RGBA,
CVPixelBufferGetWidth(m_buffer),
CVPixelBufferGetHeight(m_buffer),
- GL_BGRA,
+ GL_RGBA,
GL_UNSIGNED_BYTE,
0,
&m_texture);
@@ -240,18 +240,8 @@ private:
int width = CVPixelBufferGetWidth(imageBuffer);
int height = CVPixelBufferGetHeight(imageBuffer);
- QVideoFrame::PixelFormat format;
-
-#ifdef Q_OS_IOS
- bool useTexture = m_renderer->supportsTextures()
- && CVPixelBufferGetPixelFormatType(imageBuffer) == kCVPixelFormatType_32BGRA;
-
- if (useTexture)
- format = QVideoFrame::Format_BGRA32;
- else
-#endif
- format = AVFCameraViewfinderSettingsControl2::QtPixelFormatFromCVFormat(CVPixelBufferGetPixelFormatType(imageBuffer));
-
+ QVideoFrame::PixelFormat format =
+ AVFCameraViewfinderSettingsControl2::QtPixelFormatFromCVFormat(CVPixelBufferGetPixelFormatType(imageBuffer));
if (format == QVideoFrame::Format_Invalid)
return;