Commit Graph

8 Commits

Author SHA1 Message Date
Yoann Lopes
46a83d5b86 AVFoundation: render camera frames using OpenGL textures on iOS.
OpenGL textures can easily be created from a CVImageBuffer using
Apple APIs. It avoids having to map the buffer to main memory and
therefore greatly improves rendering performances.

We could do the same on OSX, but there, the textures are always of
the GL_TEXTURE_RECTANGLE target type and changes need to be
done to the QVideoFrame API and to the video node implementations
to support that.

Change-Id: I6dde7e8d7a27460e41523cd474c3c741affc1480
Reviewed-by: James Turner <james.turner@kdab.com>
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-09-17 13:10:28 +00:00
Yoann Lopes
aeb79d4a8b AVFoundation: fix default camera viewfinder pixel format.
It was hardcoded to ARGB32, which is not a good idea, at least on iOS
where the necessary conversion is slow.
We now pick the QAbstractVideoSurface's preferred format, or if no
surface is set, we pick the default from AVFoundation.

As a result, the QML VideoOutput will now always use the NV12 format.

Change-Id: I65205c706455502883b8098f0b5c0577b4106e01
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
2015-05-29 11:09:17 +00:00
Yoann Lopes
008d57e1d7 AVFoundation: additional build fixes for OSX < 10.9.
0df8d839 didn't fix all of the problems.

Task-number: QTBUG-46159
Change-Id: I4f2a390da1cca13775302aeef60c522e0da55a1a
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
2015-05-27 12:18:34 +00:00
Yoann Lopes
0df8d83932 AVFoundation: fix compilation on OSX < 10.9.
AVCaptureConnection.videoMaxFrameDuration is supported only since 10.9.

Task-number: QTBUG-46159
Change-Id: I8ea57b69e97ea3802b5c444c57ab090c4edf31e2
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
2015-05-19 13:22:15 +00:00
Timur Pocheptsov
09afe9377d AVFCameraViewfinderSettings - add NV12 format
Add QVideoFrame::Format_NV12 (AVFoundation has kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange
and kCVPixelFormatType_420YpCbCr8BiPlanarFullRange). Report it (set it) only if
it's supported by renderer's surface. Add bi-planar format support into CVPixelBufferVideoBuffer.

Change-Id: Ibc1c2be056bddf5cf3b595570fc40c626ee3ccf5
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-03-20 13:23:00 +00:00
Timur Pocheptsov
f839f9e3eb AVCaptureDeviceFormat - avoid duplicates (OS X/iOS)
Excluding video range (iOS) is not the right way to avoid "duplicates" - with
other devices there can be also duplicates (formats with the same resolutions),
but completely different pixel formats. Since we do not know what they will be in advance,
we take the media subtype from the initial preset for a capture device and use it
as a filter. Update viewfinder and image encoder settings controls.

Change-Id: If20aea24b19b43574d5c3e9bf2ba85f50fc08916
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-03-10 16:35:59 +00:00
Timur Pocheptsov
985ee3261b Viewfinder settings control (1) for OS X/iOS
QCameraViewfinderSettingsControl - version for AVFoundation plugin
('obsolete' viewfinder settings control interface, camera session uses v2
instead). v1 is implemented using v2 (the v2 object from camera service).

Change-Id: I81207b52b0ba5a67e64465f0e5e0c80d7267df3e
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-03-02 12:44:41 +00:00
Timur Pocheptsov
0d783b7303 Viewfinder settings control (2) - version for iOS/OS X
QCameraViewfinderSettingsControl2 - version for AV foundation plugin
(the new settings control interface implemented).

Change-Id: I3fbfb87925e57c914d43eb711fa5422e26981207
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-03-02 12:44:29 +00:00