Blackberry: Grab viewfinder frames from native window
Since the conversion from NV12 to RGB on the CPU does not scale for larger photo/video resolutions, this patch uses a different approach. It uses the low-level screen API to grab screenshots of the native viewfinder window and provides them as QImage to the QAbstractVideoSurface. Even for large resolutions this is quite performant. Change-Id: I59a7cbe6850b3b07575ea10026f3180cfd22e935 Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
This commit is contained in:
committed by
The Qt Project
parent
13ecd7171b
commit
31b454b8d6
@@ -57,6 +57,7 @@
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class BbCameraOrientationHandler;
|
||||
class WindowGrabber;
|
||||
|
||||
class BbCameraSession : public QObject
|
||||
{
|
||||
@@ -137,10 +138,6 @@ public:
|
||||
QAudioEncoderSettings audioSettings() const;
|
||||
void setAudioSettings(const QAudioEncoderSettings &settings);
|
||||
|
||||
// methods invoked from BB10 camera API callbacks in separated thread
|
||||
void handlePhotoViewFinderData(camera_buffer_t*);
|
||||
void handleVideoViewFinderData(camera_buffer_t*);
|
||||
|
||||
Q_SIGNALS:
|
||||
// camera control
|
||||
void statusChanged(QCamera::Status);
|
||||
@@ -178,6 +175,7 @@ private slots:
|
||||
void handleVideoRecordingResumed();
|
||||
void deviceOrientationChanged(int);
|
||||
void handleCameraPowerUp();
|
||||
void viewfinderFrameGrabbed(const QImage &image);
|
||||
|
||||
private:
|
||||
bool openCamera();
|
||||
@@ -227,6 +225,8 @@ private:
|
||||
BbMediaStorageLocation m_mediaStorageLocation;
|
||||
|
||||
camera_handle_t m_handle;
|
||||
|
||||
WindowGrabber* m_windowGrabber;
|
||||
};
|
||||
|
||||
QDebug operator<<(QDebug debug, camera_error_t error);
|
||||
|
||||
Reference in New Issue
Block a user