DirectShow: Implement basic QCameraImageProcessingControl interface
This commit implements the contrast, saturation, brightness and sharpening adjustments, using DirectShow backend. Change-Id: I438595550ff804f2a20028b4bc020c566d309127 Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
This commit is contained in:
committed by
Yoann Lopes
parent
1950765b65
commit
7f04598859
@@ -43,6 +43,7 @@
|
||||
#include <QtMultimedia/qvideoframe.h>
|
||||
#include <QtMultimedia/qabstractvideosurface.h>
|
||||
#include <QtMultimedia/qvideosurfaceformat.h>
|
||||
#include <QtMultimedia/qcameraimageprocessingcontrol.h>
|
||||
#include <private/qmediastoragelocation_p.h>
|
||||
|
||||
#include <tchar.h>
|
||||
@@ -97,6 +98,20 @@ public:
|
||||
QList<QCameraViewfinderSettings> supportedViewfinderSettings() const
|
||||
{ return m_supportedViewfinderSettings; }
|
||||
|
||||
bool isImageProcessingParameterSupported(
|
||||
QCameraImageProcessingControl::ProcessingParameter) const;
|
||||
|
||||
bool isImageProcessingParameterValueSupported(
|
||||
QCameraImageProcessingControl::ProcessingParameter,
|
||||
const QVariant &) const;
|
||||
|
||||
QVariant imageProcessingParameter(
|
||||
QCameraImageProcessingControl::ProcessingParameter) const;
|
||||
|
||||
void setImageProcessingParameter(
|
||||
QCameraImageProcessingControl::ProcessingParameter,
|
||||
const QVariant &);
|
||||
|
||||
Q_SIGNALS:
|
||||
void statusChanged(QCamera::Status);
|
||||
void imageExposed(int id);
|
||||
@@ -110,6 +125,21 @@ private Q_SLOTS:
|
||||
void updateReadyForCapture();
|
||||
|
||||
private:
|
||||
struct ImageProcessingParameterInfo {
|
||||
ImageProcessingParameterInfo()
|
||||
: minimumValue(0)
|
||||
, maximumValue(0)
|
||||
, defaultValue(0)
|
||||
, videoProcAmpProperty(VideoProcAmp_Brightness)
|
||||
{
|
||||
}
|
||||
|
||||
LONG minimumValue;
|
||||
LONG maximumValue;
|
||||
LONG defaultValue;
|
||||
VideoProcAmpProperty videoProcAmpProperty;
|
||||
};
|
||||
|
||||
void setStatus(QCamera::Status status);
|
||||
|
||||
void onFrameAvailable(const char *frameData, long len);
|
||||
@@ -120,6 +150,14 @@ private:
|
||||
void disconnectGraph();
|
||||
void updateSourceCapabilities();
|
||||
bool configurePreviewFormat();
|
||||
void updateImageProcessingParametersInfos();
|
||||
|
||||
// These static functions are used for scaling of adjustable parameters,
|
||||
// which have the ranges from -1.0 to +1.0 in the QCameraImageProcessing API.
|
||||
static qreal scaledImageProcessingParameterValue(
|
||||
qint32 sourceValue, const ImageProcessingParameterInfo &sourceValueInfo);
|
||||
static qint32 sourceImageProcessingParameterValue(
|
||||
qreal scaledValue, const ImageProcessingParameterInfo &sourceValueInfo);
|
||||
|
||||
QMutex m_presentMutex;
|
||||
QMutex m_captureMutex;
|
||||
@@ -135,6 +173,7 @@ private:
|
||||
QList<AM_MEDIA_TYPE> m_supportedFormats;
|
||||
QList<QCameraViewfinderSettings> m_supportedViewfinderSettings;
|
||||
AM_MEDIA_TYPE m_sourceFormat;
|
||||
QMap<QCameraImageProcessingControl::ProcessingParameter, ImageProcessingParameterInfo> m_imageProcessingParametersInfos;
|
||||
|
||||
// Preview
|
||||
IBaseFilter *m_previewFilter;
|
||||
|
||||
Reference in New Issue
Block a user