summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-12-14 16:53:36 +0100
committerLars Knoll <lars.knoll@qt.io>2021-01-20 15:08:51 +0000
commit9c2aecc77b4a4d9734024642556644ab9ca14b7f (patch)
tree507105a5a1d588b72d0fa5926c70a979f29be578 /src/plugins
parent397cb94d6882940114cb6c96a88e8ac0b64203a4 (diff)
Remove gstreamer-0.10 code paths
In fact, require gstreamer 1.12 as the minimum version. Change-Id: Iad7239dc3907ffceca1454b80f982f8f04aea518 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/gstreamer/audiodecoder/qgstreameraudiodecoderserviceplugin.cpp6
-rw-r--r--src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.cpp15
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinexposure.cpp8
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinflash.cpp4
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinfocus.cpp24
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinfocus.h10
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp49
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinimagecapture.h10
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinimageprocessing.cpp34
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinimageprocessing.h4
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinlocks.cpp15
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinlocks.h4
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinmetadata.cpp11
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinsession.cpp54
-rw-r--r--src/plugins/gstreamer/mediacapture/qgstreamercaptureserviceplugin.cpp7
-rw-r--r--src/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp12
-rw-r--r--src/plugins/gstreamer/mediacapture/qgstreamercapturesession.h2
-rw-r--r--src/plugins/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp6
-rw-r--r--src/plugins/gstreamer/mediaplayer/qgstreamerplayerserviceplugin.cpp7
19 files changed, 4 insertions, 278 deletions
diff --git a/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecoderserviceplugin.cpp b/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecoderserviceplugin.cpp
index 463ed2d92..d9e6a2a38 100644
--- a/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecoderserviceplugin.cpp
+++ b/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecoderserviceplugin.cpp
@@ -76,15 +76,9 @@ QMultimedia::SupportEstimate QGstreamerAudioDecoderServicePlugin::hasSupport(con
static bool isDecoderOrDemuxer(GstElementFactory *factory)
{
-#if GST_CHECK_VERSION(0, 10, 31)
return gst_element_factory_list_is_type(factory, GST_ELEMENT_FACTORY_TYPE_DEMUXER)
|| gst_element_factory_list_is_type(factory, GST_ELEMENT_FACTORY_TYPE_DECODER
| GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO);
-#else
- return (factory
- && (qstrcmp(factory->details.klass, "Codec/Decoder/Audio") == 0
- || qstrcmp(factory->details.klass, "Codec/Demux") == 0));
-#endif
}
void QGstreamerAudioDecoderServicePlugin::updateSupportedMimeTypes() const
diff --git a/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.cpp b/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.cpp
index d6b8ad759..185494f65 100644
--- a/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.cpp
+++ b/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.cpp
@@ -451,7 +451,6 @@ QAudioBuffer QGstreamerAudioDecoderSession::read()
const char* bufferData = 0;
int bufferSize = 0;
-#if GST_CHECK_VERSION(1,0,0)
GstSample *sample = gst_app_sink_pull_sample(m_appSink);
GstBuffer *buffer = gst_sample_get_buffer(sample);
GstMapInfo mapInfo;
@@ -459,12 +458,6 @@ QAudioBuffer QGstreamerAudioDecoderSession::read()
bufferData = (const char*)mapInfo.data;
bufferSize = mapInfo.size;
QAudioFormat format = QGstUtils::audioFormatForSample(sample);
-#else
- GstBuffer *buffer = gst_app_sink_pull_buffer(m_appSink);
- bufferData = (const char*)buffer->data;
- bufferSize = buffer->size;
- QAudioFormat format = QGstUtils::audioFormatForBuffer(buffer);
-#endif
if (format.isValid()) {
// XXX At the moment we have to copy data from GstBuffer into QAudioBuffer.
@@ -477,12 +470,8 @@ QAudioBuffer QGstreamerAudioDecoderSession::read()
emit positionChanged(m_position);
}
}
-#if GST_CHECK_VERSION(1,0,0)
gst_buffer_unmap(buffer, &mapInfo);
gst_sample_unref(sample);
-#else
- gst_buffer_unref(buffer);
-#endif
}
return audioBuffer;
@@ -553,11 +542,7 @@ void QGstreamerAudioDecoderSession::addAppSink()
GstAppSinkCallbacks callbacks;
memset(&callbacks, 0, sizeof(callbacks));
-#if GST_CHECK_VERSION(1,0,0)
callbacks.new_sample = &new_sample;
-#else
- callbacks.new_buffer = &new_sample;
-#endif
gst_app_sink_set_callbacks(m_appSink, &callbacks, this, NULL);
gst_app_sink_set_max_buffers(m_appSink, MAX_BUFFERS_IN_QUEUE);
gst_base_sink_set_sync(GST_BASE_SINK(m_appSink), FALSE);
diff --git a/src/plugins/gstreamer/camerabin/camerabinexposure.cpp b/src/plugins/gstreamer/camerabin/camerabinexposure.cpp
index 35d3e7c8f..65a8539d5 100644
--- a/src/plugins/gstreamer/camerabin/camerabinexposure.cpp
+++ b/src/plugins/gstreamer/camerabin/camerabinexposure.cpp
@@ -43,10 +43,6 @@
#include <QDebug>
-#if !GST_CHECK_VERSION(1,0,0)
-typedef GstSceneMode GstPhotographySceneMode;
-#endif
-
QT_BEGIN_NAMESPACE
CameraBinExposure::CameraBinExposure(CameraBinSession *session)
@@ -143,7 +139,6 @@ QVariant CameraBinExposure::actualValue(ExposureParameter parameter) const
return QVariant::fromValue(QCameraExposure::ExposureManual);
case GST_PHOTOGRAPHY_SCENE_MODE_LANDSCAPE:
return QVariant::fromValue(QCameraExposure::ExposureLandscape);
-#if GST_CHECK_VERSION(1, 2, 0)
case GST_PHOTOGRAPHY_SCENE_MODE_SNOW:
return QVariant::fromValue(QCameraExposure::ExposureSnow);
case GST_PHOTOGRAPHY_SCENE_MODE_BEACH:
@@ -166,7 +161,6 @@ QVariant CameraBinExposure::actualValue(ExposureParameter parameter) const
return QVariant::fromValue(QCameraExposure::ExposureCandlelight);
case GST_PHOTOGRAPHY_SCENE_MODE_BARCODE:
return QVariant::fromValue(QCameraExposure::ExposureBarcode);
-#endif
//no direct mapping available so mapping to auto mode
case GST_PHOTOGRAPHY_SCENE_MODE_CLOSEUP:
case GST_PHOTOGRAPHY_SCENE_MODE_AUTO:
@@ -224,7 +218,6 @@ bool CameraBinExposure::setValue(ExposureParameter parameter, const QVariant& va
case QCameraExposure::ExposureLandscape:
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_LANDSCAPE;
break;
-#if GST_CHECK_VERSION(1, 2, 0)
case QCameraExposure::ExposureSnow:
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_SNOW;
break;
@@ -258,7 +251,6 @@ bool CameraBinExposure::setValue(ExposureParameter parameter, const QVariant& va
case QCameraExposure::ExposureBarcode:
sceneMode = GST_PHOTOGRAPHY_SCENE_MODE_BARCODE;
break;
-#endif
default:
break;
}
diff --git a/src/plugins/gstreamer/camerabin/camerabinflash.cpp b/src/plugins/gstreamer/camerabin/camerabinflash.cpp
index 2bf7a2776..d5c32ffdb 100644
--- a/src/plugins/gstreamer/camerabin/camerabinflash.cpp
+++ b/src/plugins/gstreamer/camerabin/camerabinflash.cpp
@@ -43,10 +43,6 @@
#include <QDebug>
-#if !GST_CHECK_VERSION(1,0,0)
-typedef GstFlashMode GstPhotographyFlashMode;
-#endif
-
QT_BEGIN_NAMESPACE
CameraBinFlash::CameraBinFlash(CameraBinSession *session)
diff --git a/src/plugins/gstreamer/camerabin/camerabinfocus.cpp b/src/plugins/gstreamer/camerabin/camerabinfocus.cpp
index 33ac7e3d7..d60a643f6 100644
--- a/src/plugins/gstreamer/camerabin/camerabinfocus.cpp
+++ b/src/plugins/gstreamer/camerabin/camerabinfocus.cpp
@@ -48,19 +48,13 @@
#include <private/qgstutils_p.h>
-#if !GST_CHECK_VERSION(1,0,0)
-typedef GstFocusMode GstPhotographyFocusMode;
-#endif
-
//#define CAMERABIN_DEBUG 1
QT_BEGIN_NAMESPACE
CameraBinFocus::CameraBinFocus(CameraBinSession *session)
:QCameraFocusControl(session),
-#if GST_CHECK_VERSION(1,0,0)
QGstreamerBufferProbe(ProbeBuffers),
-#endif
m_session(session),
m_cameraStatus(QCamera::UnloadedStatus),
m_focusMode(QCameraFocus::AutoFocus),
@@ -146,7 +140,6 @@ void CameraBinFocus::setFocusPointMode(QCameraFocus::FocusPointMode mode)
if (m_focusPointMode == mode || !source)
return;
-#if GST_CHECK_VERSION(1,0,0)
if (m_focusPointMode == QCameraFocus::FocusPointFaceDetection) {
g_object_set (G_OBJECT(source), "detect-faces", FALSE, NULL);
@@ -161,7 +154,6 @@ void CameraBinFocus::setFocusPointMode(QCameraFocus::FocusPointMode mode)
QMutexLocker locker(&m_mutex);
m_faces.clear();
}
-#endif
if (m_focusPointMode != QCameraFocus::FocusPointAuto)
resetFocusPoint();
@@ -170,7 +162,6 @@ void CameraBinFocus::setFocusPointMode(QCameraFocus::FocusPointMode mode)
case QCameraFocus::FocusPointAuto:
case QCameraFocus::FocusPointCustom:
break;
-#if GST_CHECK_VERSION(1,0,0)
case QCameraFocus::FocusPointFaceDetection:
if (g_object_class_find_property(G_OBJECT_GET_CLASS(source), "detect-faces")) {
if (GstPad *pad = gst_element_get_static_pad(source, "vfsrc")) {
@@ -180,7 +171,6 @@ void CameraBinFocus::setFocusPointMode(QCameraFocus::FocusPointMode mode)
}
}
return;
-#endif
default:
return;
}
@@ -196,12 +186,10 @@ bool CameraBinFocus::isFocusPointModeSupported(QCameraFocus::FocusPointMode mode
case QCameraFocus::FocusPointAuto:
case QCameraFocus::FocusPointCustom:
return true;
-#if GST_CHECK_VERSION(1,0,0)
case QCameraFocus::FocusPointFaceDetection:
if (GstElement *source = m_session->cameraSource())
return g_object_class_find_property(G_OBJECT_GET_CLASS(source), "detect-faces");
return false;
-#endif
default:
return false;
}
@@ -242,7 +230,6 @@ QCameraFocusZoneList CameraBinFocus::focusZones() const
if (m_focusPointMode != QCameraFocus::FocusPointFaceDetection) {
zones.append(QCameraFocusZone(m_focusRect, m_focusZoneStatus));
-#if GST_CHECK_VERSION(1,0,0)
} else for (const QRect &face : qAsConst(m_faceFocusRects)) {
const QRectF normalizedRect(
face.x() / qreal(m_viewfinderResolution.width()),
@@ -250,7 +237,6 @@ QCameraFocusZoneList CameraBinFocus::focusZones() const
face.width() / qreal(m_viewfinderResolution.width()),
face.height() / qreal(m_viewfinderResolution.height()));
zones.append(QCameraFocusZone(normalizedRect, m_focusZoneStatus));
-#endif
}
return zones;
}
@@ -312,12 +298,10 @@ void CameraBinFocus::_q_setFocusStatus(QCamera::LockStatus status, QCamera::Lock
emit focusZonesChanged();
}
-#if GST_CHECK_VERSION(1,0,0)
if (m_focusPointMode == QCameraFocus::FocusPointFaceDetection
&& m_focusStatus == QCamera::Unlocked) {
_q_updateFaces();
}
-#endif
emit _q_focusStatusChanged(m_focusStatus, reason);
}
@@ -462,8 +446,6 @@ void CameraBinFocus::updateRegionOfInterest(const QList<QRect> &rectangles)
gst_element_send_event(cameraSource, event);
}
-#if GST_CHECK_VERSION(1,0,0)
-
void CameraBinFocus::_q_updateFaces()
{
if (m_focusPointMode != QCameraFocus::FocusPointFaceDetection
@@ -507,7 +489,6 @@ bool CameraBinFocus::probeBuffer(GstBuffer *buffer)
{
QList<QRect> faces;
-#if GST_CHECK_VERSION(1,1,3)
gpointer state = NULL;
const GstMetaInfo *info = GST_VIDEO_REGION_OF_INTEREST_META_INFO;
@@ -519,9 +500,6 @@ bool CameraBinFocus::probeBuffer(GstBuffer *buffer)
faces.append(QRect(region->x, region->y, region->w, region->h));
}
-#else
- Q_UNUSED(buffer);
-#endif
QMutexLocker locker(&m_mutex);
@@ -535,6 +513,4 @@ bool CameraBinFocus::probeBuffer(GstBuffer *buffer)
return true;
}
-#endif
-
QT_END_NAMESPACE
diff --git a/src/plugins/gstreamer/camerabin/camerabinfocus.h b/src/plugins/gstreamer/camerabin/camerabinfocus.h
index 0fca02c35..40168c183 100644
--- a/src/plugins/gstreamer/camerabin/camerabinfocus.h
+++ b/src/plugins/gstreamer/camerabin/camerabinfocus.h
@@ -58,9 +58,7 @@ class CameraBinSession;
class CameraBinFocus
: public QCameraFocusControl
-#if GST_CHECK_VERSION(1,0,0)
, QGstreamerBufferProbe
-#endif
{
Q_OBJECT
@@ -92,27 +90,19 @@ public Q_SLOTS:
void setViewfinderResolution(const QSize &resolution);
-#if GST_CHECK_VERSION(1,0,0)
protected:
void timerEvent(QTimerEvent *event) override;
-#endif
private Q_SLOTS:
void _q_setFocusStatus(QCamera::LockStatus status, QCamera::LockChangeReason reason);
void _q_handleCameraStatusChange(QCamera::Status status);
-
-#if GST_CHECK_VERSION(1,0,0)
void _q_updateFaces();
-#endif
private:
void resetFocusPoint();
void updateRegionOfInterest(const QRectF &rectangle);
void updateRegionOfInterest(const QList<QRect> &rectangles);
-
-#if GST_CHECK_VERSION(1,0,0)
bool probeBuffer(GstBuffer *buffer) override;
-#endif
CameraBinSession *m_session;
QCamera::Status m_cameraStatus;
diff --git a/src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp b/src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp
index aac5c2c94..d0b34a61d 100644
--- a/src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp
+++ b/src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp
@@ -43,7 +43,6 @@
#include "camerabincapturebufferformat.h"
#include "camerabinsession.h"
#include <private/qgstvideobuffer_p.h>
-#include <private/qvideosurfacegstsink_p.h>
#include <private/qgstutils_p.h>
#include <QtMultimedia/qmediametadata.h>
#include <QtCore/qdebug.h>
@@ -113,16 +112,10 @@ void CameraBinImageCapture::updateState()
}
}
-#if GST_CHECK_VERSION(1,0,0)
GstPadProbeReturn CameraBinImageCapture::encoderEventProbe(
GstPad *, GstPadProbeInfo *info, gpointer user_data)
{
GstEvent * const event = gst_pad_probe_info_get_event(info);
-#else
-gboolean CameraBinImageCapture::encoderEventProbe(
- GstElement *, GstEvent *event, gpointer user_data)
-{
-#endif
CameraBinImageCapture * const self = static_cast<CameraBinImageCapture *>(user_data);
if (event && GST_EVENT_TYPE(event) == GST_EVENT_TAG) {
GstTagList *gstTags;
@@ -156,23 +149,12 @@ gboolean CameraBinImageCapture::encoderEventProbe(
}
}
}
-#if GST_CHECK_VERSION(1,0,0)
return GST_PAD_PROBE_OK;
-#else
- return TRUE;
-#endif
}
void CameraBinImageCapture::EncoderProbe::probeCaps(GstCaps *caps)
{
-#if GST_CHECK_VERSION(1,0,0)
capture->m_bufferFormat = QGstUtils::formatForCaps(caps, &capture->m_videoInfo);
-#else
- int bytesPerLine = 0;
- QVideoSurfaceFormat format = QGstUtils::formatForCaps(caps, &bytesPerLine);
- capture->m_bytesPerLine = bytesPerLine;
- capture->m_bufferFormat = format;
-#endif
}
bool CameraBinImageCapture::EncoderProbe::probeBuffer(GstBuffer *buffer)
@@ -192,11 +174,7 @@ bool CameraBinImageCapture::EncoderProbe::probeBuffer(GstBuffer *buffer)
#ifdef DEBUG_CAPTURE
qDebug() << "imageAvailable(uncompressed):" << format;
#endif
-#if GST_CHECK_VERSION(1,0,0)
QGstVideoBuffer *videoBuffer = new QGstVideoBuffer(buffer, capture->m_videoInfo);
-#else
- QGstVideoBuffer *videoBuffer = new QGstVideoBuffer(buffer, capture->m_bytesPerLine);
-#endif
QVideoFrame frame(
videoBuffer,
@@ -235,7 +213,6 @@ bool CameraBinImageCapture::MuxerProbe::probeBuffer(GstBuffer *buffer)
QSize resolution = capture->m_jpegResolution;
//if resolution is not presented in caps, try to find it from encoded jpeg data:
-#if GST_CHECK_VERSION(1,0,0)
GstMapInfo mapInfo;
if (resolution.isEmpty() && gst_buffer_map(buffer, &mapInfo, GST_MAP_READ)) {
QBuffer data;
@@ -251,18 +228,6 @@ bool CameraBinImageCapture::MuxerProbe::probeBuffer(GstBuffer *buffer)
gst_video_info_set_format(
&info, GST_VIDEO_FORMAT_ENCODED, resolution.width(), resolution.height());
QGstVideoBuffer *videoBuffer = new QGstVideoBuffer(buffer, info);
-#else
- if (resolution.isEmpty()) {
- QBuffer data;
- data.setData(reinterpret_cast<const char*>(GST_BUFFER_DATA(buffer)), GST_BUFFER_SIZE(buffer));
- QImageReader reader(&data, "JPEG");
- resolution = reader.size();
- }
-
- QGstVideoBuffer *videoBuffer = new QGstVideoBuffer(buffer,
- -1); //bytesPerLine is not available for jpegs
-#endif
-
QVideoFrame frame(videoBuffer,
resolution,
@@ -303,10 +268,6 @@ bool CameraBinImageCapture::processBusMessage(const QGstreamerMessage &message)
gchar *name = gst_element_get_name(element);
QString elementName = QString::fromLatin1(name);
g_free(name);
-#if !GST_CHECK_VERSION(1,0,0)
- GstElementClass *elementClass = GST_ELEMENT_GET_CLASS(element);
- QString elementLongName = elementClass->details.longname;
-#endif
if (elementName.contains("jpegenc") && element != m_jpegEncoderElement) {
m_jpegEncoderElement = element;
GstPad *sinkpad = gst_element_get_static_pad(element, "sink");
@@ -316,23 +277,15 @@ bool CameraBinImageCapture::processBusMessage(const QGstreamerMessage &message)
#ifdef DEBUG_CAPTURE
qDebug() << "install metadata probe";
#endif
-#if GST_CHECK_VERSION(1,0,0)
gst_pad_add_probe(
sinkpad, GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM, encoderEventProbe, this, NULL);
-#else
- gst_pad_add_event_probe(sinkpad, G_CALLBACK(encoderEventProbe), this);
-#endif
#ifdef DEBUG_CAPTURE
qDebug() << "install uncompressed buffer probe";
#endif
m_encoderProbe.addProbeToPad(sinkpad, true);
gst_object_unref(sinkpad);
- } else if ((elementName.contains("jifmux")
-#if !GST_CHECK_VERSION(1,0,0)
- || elementLongName == QLatin1String("JPEG stream muxer")
-#endif
- || elementName.startsWith("metadatamux"))
+ } else if ((elementName.contains("jifmux") || elementName.startsWith("metadatamux"))
&& element != m_metadataMuxerElement) {
//Jpeg encoded buffer probe is added after jifmux/metadatamux
//element to ensure the resulting jpeg buffer contains capture metadata
diff --git a/src/plugins/gstreamer/camerabin/camerabinimagecapture.h b/src/plugins/gstreamer/camerabin/camerabinimagecapture.h
index 5e00ab6d5..e86adc4fd 100644
--- a/src/plugins/gstreamer/camerabin/camerabinimagecapture.h
+++ b/src/plugins/gstreamer/camerabin/camerabinimagecapture.h
@@ -48,9 +48,7 @@
#include <private/qgstreamerbufferprobe_p.h>
-#if GST_CHECK_VERSION(1,0,0)
#include <gst/video/video.h>
-#endif
QT_BEGIN_NAMESPACE
@@ -75,11 +73,7 @@ private slots:
void updateState();
private:
-#if GST_CHECK_VERSION(1,0,0)
static GstPadProbeReturn encoderEventProbe(GstPad *, GstPadProbeInfo *info, gpointer user_data);
-#else
- static gboolean encoderEventProbe(GstElement *, GstEvent *event, gpointer user_data);
-#endif
class EncoderProbe : public QGstreamerBufferProbe
{
@@ -109,11 +103,7 @@ private:
CameraBinSession *m_session;
GstElement *m_jpegEncoderElement;
GstElement *m_metadataMuxerElement;
-#if GST_CHECK_VERSION(1,0,0)
GstVideoInfo m_videoInfo;
-#else
- int m_bytesPerLine;
-#endif
int m_requestId;
bool m_ready;
};
diff --git a/src/plugins/gstreamer/camerabin/camerabinimageprocessing.cpp b/src/plugins/gstreamer/camerabin/camerabinimageprocessing.cpp
index 9d281e10c..3629a1336 100644
--- a/src/plugins/gstreamer/camerabin/camerabinimageprocessing.cpp
+++ b/src/plugins/gstreamer/camerabin/camerabinimageprocessing.cpp
@@ -45,11 +45,7 @@
#include "camerabinv4limageprocessing.h"
#endif
-#if GST_CHECK_VERSION(1,0,0)
# include <gst/video/colorbalance.h>
-#else
-# include <gst/interfaces/colorbalance.h>
-#endif
QT_BEGIN_NAMESPACE
@@ -72,30 +68,18 @@ CameraBinImageProcessing::CameraBinImageProcessing(CameraBinSession *session)
unlockWhiteBalance();
}
-#if GST_CHECK_VERSION(1, 0, 0)
m_filterMap.insert(QCameraImageProcessing::ColorFilterNone, GST_PHOTOGRAPHY_COLOR_TONE_MODE_NORMAL);
if (m_session->photography()) {
m_filterMap.insert(QCameraImageProcessing::ColorFilterSepia, GST_PHOTOGRAPHY_COLOR_TONE_MODE_SEPIA);
m_filterMap.insert(QCameraImageProcessing::ColorFilterGrayscale, GST_PHOTOGRAPHY_COLOR_TONE_MODE_GRAYSCALE);
m_filterMap.insert(QCameraImageProcessing::ColorFilterNegative, GST_PHOTOGRAPHY_COLOR_TONE_MODE_NEGATIVE);
m_filterMap.insert(QCameraImageProcessing::ColorFilterSolarize, GST_PHOTOGRAPHY_COLOR_TONE_MODE_SOLARIZE);
-#if GST_CHECK_VERSION(1, 2, 0)
m_filterMap.insert(QCameraImageProcessing::ColorFilterPosterize, GST_PHOTOGRAPHY_COLOR_TONE_MODE_POSTERIZE);
m_filterMap.insert(QCameraImageProcessing::ColorFilterWhiteboard, GST_PHOTOGRAPHY_COLOR_TONE_MODE_WHITEBOARD);
m_filterMap.insert(QCameraImageProcessing::ColorFilterBlackboard, GST_PHOTOGRAPHY_COLOR_TONE_MODE_BLACKBOARD);
m_filterMap.insert(QCameraImageProcessing::ColorFilterAqua, GST_PHOTOGRAPHY_COLOR_TONE_MODE_AQUA);
-#endif
- }
-#else
- m_filterMap.insert(QCameraImageProcessing::ColorFilterNone, GST_PHOTOGRAPHY_COLOUR_TONE_MODE_NORMAL);
- if (m_session->photography()) {
- m_filterMap.insert(QCameraImageProcessing::ColorFilterSepia, GST_PHOTOGRAPHY_COLOUR_TONE_MODE_SEPIA);
- m_filterMap.insert(QCameraImageProcessing::ColorFilterGrayscale, GST_PHOTOGRAPHY_COLOUR_TONE_MODE_GRAYSCALE);
- m_filterMap.insert(QCameraImageProcessing::ColorFilterNegative, GST_PHOTOGRAPHY_COLOUR_TONE_MODE_NEGATIVE);
- m_filterMap.insert(QCameraImageProcessing::ColorFilterSolarize, GST_PHOTOGRAPHY_COLOUR_TONE_MODE_SOLARIZE);
}
#endif
-#endif
#if QT_CONFIG(linux_v4l)
m_v4lImageControl = new CameraBinV4LImageProcessing(m_session);
@@ -185,11 +169,9 @@ bool CameraBinImageProcessing::setWhiteBalanceMode(QCameraImageProcessing::White
#if QT_CONFIG(gstreamer_photography)
if (isWhiteBalanceModeSupported(mode)) {
m_whiteBalanceMode = mode;
-#if GST_CHECK_VERSION(1, 2, 0)
GstPhotographyWhiteBalanceMode currentMode;
if (gst_photography_get_white_balance_mode(m_session->photography(), &currentMode)
&& currentMode != GST_PHOTOGRAPHY_WB_MODE_MANUAL)
-#endif
{
unlockWhiteBalance();
return true;
@@ -313,13 +295,8 @@ QVariant CameraBinImageProcessing::parameter(
case QCameraImageProcessingControl::ColorFilter:
#if QT_CONFIG(gstreamer_photography)
if (GstPhotography *photography = m_session->photography()) {
-#if GST_CHECK_VERSION(1, 0, 0)
GstPhotographyColorToneMode mode = GST_PHOTOGRAPHY_COLOR_TONE_MODE_NORMAL;
gst_photography_get_color_tone_mode(photography, &mode);
-#else
- GstColourToneMode mode = GST_PHOTOGRAPHY_COLOUR_TONE_MODE_NORMAL;
- gst_photography_get_colour_tone_mode(photography, &mode);
-#endif
return QVariant::fromValue(m_filterMap.key(mode, QCameraImageProcessing::ColorFilterNone));
}
#endif
@@ -400,15 +377,9 @@ void CameraBinImageProcessing::setParameter(QCameraImageProcessingControl::Proce
case QCameraImageProcessingControl::ColorFilter:
#if QT_CONFIG(gstreamer_photography)
if (GstPhotography *photography = m_session->photography()) {
-#if GST_CHECK_VERSION(1, 0, 0)
gst_photography_set_color_tone_mode(photography, m_filterMap.value(
value.value<QCameraImageProcessing::ColorFilter>(),
GST_PHOTOGRAPHY_COLOR_TONE_MODE_NORMAL));
-#else
- gst_photography_set_colour_tone_mode(photography, m_filterMap.value(
- value.value<QCameraImageProcessing::ColorFilter>(),
- GST_PHOTOGRAPHY_COLOUR_TONE_MODE_NORMAL));
-#endif
}
#endif
break;
@@ -422,11 +393,8 @@ void CameraBinImageProcessing::setParameter(QCameraImageProcessingControl::Proce
#if QT_CONFIG(gstreamer_photography)
void CameraBinImageProcessing::lockWhiteBalance()
{
-#if GST_CHECK_VERSION(1, 2, 0)
- if (GstPhotography *photography = m_session->photography()) {
+ if (GstPhotography *photography = m_session->photography())
gst_photography_set_white_balance_mode(photography, GST_PHOTOGRAPHY_WB_MODE_MANUAL);
- }
-#endif
}
void CameraBinImageProcessing::unlockWhiteBalance()
diff --git a/src/plugins/gstreamer/camerabin/camerabinimageprocessing.h b/src/plugins/gstreamer/camerabin/camerabinimageprocessing.h
index 259138e91..51e6f7c82 100644
--- a/src/plugins/gstreamer/camerabin/camerabinimageprocessing.h
+++ b/src/plugins/gstreamer/camerabin/camerabinimageprocessing.h
@@ -49,10 +49,6 @@
#if QT_CONFIG(gstreamer_photography)
# include <gst/interfaces/photography.h>
-# if !GST_CHECK_VERSION(1,0,0)
-typedef GstWhiteBalanceMode GstPhotographyWhiteBalanceMode;
-typedef GstColourToneMode GstPhotographyColorToneMode;
-# endif
#endif
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/gstreamer/camerabin/camerabinlocks.cpp b/src/plugins/gstreamer/camerabin/camerabinlocks.cpp
index 89be2ac5d..9891ace84 100644
--- a/src/plugins/gstreamer/camerabin/camerabinlocks.cpp
+++ b/src/plugins/gstreamer/camerabin/camerabinlocks.cpp
@@ -67,7 +67,6 @@ QCamera::LockTypes CameraBinLocks::supportedLocks() const
{
QCamera::LockTypes locks = QCamera::LockFocus;
-#if GST_CHECK_VERSION(1, 2, 0)
if (GstPhotography *photography = m_session->photography()) {
if (gst_photography_get_capabilities(photography) & GST_PHOTOGRAPHY_CAPS_WB_MODE)
locks |= QCamera::LockWhiteBalance;
@@ -79,7 +78,6 @@ QCamera::LockTypes CameraBinLocks::supportedLocks() const
}
}
}
-#endif
return locks;
}
@@ -89,7 +87,6 @@ QCamera::LockStatus CameraBinLocks::lockStatus(QCamera::LockType lock) const
switch (lock) {
case QCamera::LockFocus:
return m_focus->focusStatus();
-#if GST_CHECK_VERSION(1, 2, 0)
case QCamera::LockExposure:
if (m_pendingLocks & QCamera::LockExposure)
return QCamera::Searching;
@@ -98,7 +95,6 @@ QCamera::LockStatus CameraBinLocks::lockStatus(QCamera::LockType lock) const
if (m_pendingLocks & QCamera::LockWhiteBalance)
return QCamera::Searching;
return isWhiteBalanceLocked() ? QCamera::Locked : QCamera::Unlocked;
-#endif
default:
return QCamera::Unlocked;
}
@@ -112,7 +108,6 @@ void CameraBinLocks::searchAndLock(QCamera::LockTypes locks)
m_pendingLocks |= QCamera::LockFocus;
m_focus->_q_startFocusing();
}
-#if GST_CHECK_VERSION(1, 2, 0)
if (!m_pendingLocks)
m_lockTimer.stop();
@@ -134,8 +129,6 @@ void CameraBinLocks::searchAndLock(QCamera::LockTypes locks)
lockWhiteBalance(QCamera::UserRequest);
}
}
-#endif
-
}
void CameraBinLocks::unlock(QCamera::LockTypes locks)
@@ -145,7 +138,6 @@ void CameraBinLocks::unlock(QCamera::LockTypes locks)
if (locks & QCamera::LockFocus)
m_focus->_q_stopFocusing();
-#if GST_CHECK_VERSION(1, 2, 0)
if (!m_pendingLocks)
m_lockTimer.stop();
@@ -153,7 +145,6 @@ void CameraBinLocks::unlock(QCamera::LockTypes locks)
unlockExposure(QCamera::Unlocked, QCamera::UserRequest);
if (locks & QCamera::LockWhiteBalance)
unlockWhiteBalance(QCamera::Unlocked, QCamera::UserRequest);
-#endif
}
void CameraBinLocks::updateFocusStatus(QCamera::LockStatus status, QCamera::LockChangeReason reason)
@@ -161,19 +152,15 @@ void CameraBinLocks::updateFocusStatus(QCamera::LockStatus status, QCamera::Lock
if (status != QCamera::Searching)
m_pendingLocks &= ~QCamera::LockFocus;
-#if GST_CHECK_VERSION(1, 2, 0)
if (status == QCamera::Locked && !m_lockTimer.isActive()) {
if (m_pendingLocks & QCamera::LockExposure)
lockExposure(QCamera::LockAcquired);
if (m_pendingLocks & QCamera::LockWhiteBalance)
lockWhiteBalance(QCamera::LockAcquired);
}
-#endif
emit lockStatusChanged(QCamera::LockFocus, status, reason);
}
-#if GST_CHECK_VERSION(1, 2, 0)
-
void CameraBinLocks::timerEvent(QTimerEvent *event)
{
if (event->timerId() != m_lockTimer.timerId())
@@ -254,6 +241,4 @@ void CameraBinLocks::unlockWhiteBalance(
emit lockStatusChanged(QCamera::LockWhiteBalance, status, reason);
}
-#endif
-
QT_END_NAMESPACE
diff --git a/src/plugins/gstreamer/camerabin/camerabinlocks.h b/src/plugins/gstreamer/camerabin/camerabinlocks.h
index cd592ffd2..dcc960e8e 100644
--- a/src/plugins/gstreamer/camerabin/camerabinlocks.h
+++ b/src/plugins/gstreamer/camerabin/camerabinlocks.h
@@ -69,15 +69,12 @@ public:
void unlock(QCamera::LockTypes locks) override;
protected:
-#if GST_CHECK_VERSION(1, 2, 0)
void timerEvent(QTimerEvent *event) override;
-#endif
private slots:
void updateFocusStatus(QCamera::LockStatus status, QCamera::LockChangeReason reason);
private:
-#if GST_CHECK_VERSION(1, 2, 0)
bool isExposureLocked() const;
void lockExposure(QCamera::LockChangeReason reason);
void unlockExposure(QCamera::LockStatus status, QCamera::LockChangeReason reason);
@@ -85,7 +82,6 @@ private:
bool isWhiteBalanceLocked() const;
void lockWhiteBalance(QCamera::LockChangeReason reason);
void unlockWhiteBalance(QCamera::LockStatus status, QCamera::LockChangeReason reason);
-#endif
CameraBinSession *m_session;
CameraBinFocus *m_focus;
diff --git a/src/plugins/gstreamer/camerabin/camerabinmetadata.cpp b/src/plugins/gstreamer/camerabin/camerabinmetadata.cpp
index afda2346d..fbdc4c440 100644
--- a/src/plugins/gstreamer/camerabin/camerabinmetadata.cpp
+++ b/src/plugins/gstreamer/camerabin/camerabinmetadata.cpp
@@ -74,9 +74,7 @@ static const QGStreamerMetaDataKeys *qt_gstreamerMetaDataKeys()
//metadataKeys->append(QGStreamerMetaDataKey(QMediaMetaData::SubTitle, 0, QVariant::String));
//metadataKeys->append(QGStreamerMetaDataKey(QMediaMetaData::Author, 0, QVariant::String));
metadataKeys->append(QGStreamerMetaDataKey(QMediaMetaData::Comment, GST_TAG_COMMENT, QVariant::String));
-#if GST_CHECK_VERSION(0,10,31)
metadataKeys->append(QGStreamerMetaDataKey(QMediaMetaData::Date, GST_TAG_DATE_TIME, QVariant::DateTime));
-#endif
metadataKeys->append(QGStreamerMetaDataKey(QMediaMetaData::Description, GST_TAG_DESCRIPTION, QVariant::String));
//metadataKeys->append(QGStreamerMetaDataKey(QMediaMetaData::Category, 0, QVariant::String));
metadataKeys->append(QGStreamerMetaDataKey(QMediaMetaData::Genre, GST_TAG_GENRE, QVariant::String));
@@ -105,9 +103,7 @@ static const QGStreamerMetaDataKeys *qt_gstreamerMetaDataKeys()
metadataKeys->append(QGStreamerMetaDataKey(QMediaMetaData::AlbumTitle, GST_TAG_ALBUM, QVariant::String));
metadataKeys->append(QGStreamerMetaDataKey(QMediaMetaData::AlbumArtist, GST_TAG_ARTIST, QVariant::String));
metadataKeys->append(QGStreamerMetaDataKey(QMediaMetaData::ContributingArtist, GST_TAG_PERFORMER, QVariant::String));
-#if GST_CHECK_VERSION(0,10,19)
metadataKeys->append(QGStreamerMetaDataKey(QMediaMetaData::Composer, GST_TAG_COMPOSER, QVariant::String));
-#endif
//metadataKeys->append(QGStreamerMetaDataKey(QMediaMetaData::Conductor, 0, QVariant::String));
//metadataKeys->append(QGStreamerMetaDataKey(QMediaMetaData::Lyrics, 0, QVariant::String));
//metadataKeys->append(QGStreamerMetaDataKey(QMediaMetaData::Mood, 0, QVariant::String));
@@ -132,7 +128,7 @@ static const QGStreamerMetaDataKeys *qt_gstreamerMetaDataKeys()
//metadataKeys->append(QGStreamerMetaDataKey(QMediaMetaData::Director, 0, QVariant::String));
metadataKeys->append(QGStreamerMetaDataKey(QMediaMetaData::LeadPerformer, GST_TAG_PERFORMER, QVariant::String));
//metadataKeys->append(QGStreamerMetaDataKey(QMediaMetaData::Writer, 0, QVariant::String));
-#if GST_CHECK_VERSION(0,10,30)
+
// Photos
metadataKeys->append(QGStreamerMetaDataKey(QMediaMetaData::CameraManufacturer, GST_TAG_DEVICE_MANUFACTURER, QVariant::String));
metadataKeys->append(QGStreamerMetaDataKey(QMediaMetaData::CameraModel, GST_TAG_DEVICE_MODEL, QVariant::String));
@@ -148,7 +144,6 @@ static const QGStreamerMetaDataKeys *qt_gstreamerMetaDataKeys()
metadataKeys->append(QGStreamerMetaDataKey(QMediaMetaData::GPSTrack, GST_TAG_GEO_LOCATION_MOVEMENT_DIRECTION, QVariant::Double));
metadataKeys->append(QGStreamerMetaDataKey(QMediaMetaData::GPSSpeed, GST_TAG_GEO_LOCATION_MOVEMENT_SPEED, QVariant::Double));
metadataKeys->append(QGStreamerMetaDataKey(QMediaMetaData::GPSImgDirection, GST_TAG_GEO_LOCATION_CAPTURE_DIRECTION, QVariant::Double));
-#endif
}
return metadataKeys;
@@ -161,14 +156,12 @@ CameraBinMetaData::CameraBinMetaData(QObject *parent)
QVariant CameraBinMetaData::metaData(const QString &key) const
{
-#if GST_CHECK_VERSION(0,10,30)
if (key == QMediaMetaData::Orientation) {
return QGstUtils::fromGStreamerOrientation(m_values.value(QByteArray(GST_TAG_IMAGE_ORIENTATION)));
} else if (key == QMediaMetaData::GPSSpeed) {
const double metersPerSec = m_values.value(QByteArray(GST_TAG_GEO_LOCATION_MOVEMENT_SPEED)).toDouble();
return (metersPerSec * 3600) / 1000;
}
-#endif
const auto keys = *qt_gstreamerMetaDataKeys();
for (const QGStreamerMetaDataKey &metadataKey : keys) {
@@ -181,7 +174,6 @@ QVariant CameraBinMetaData::metaData(const QString &key) const
void CameraBinMetaData::setMetaData(const QString &key, const QVariant &value)
{
QVariant correctedValue = value;
-#if GST_CHECK_VERSION(0,10,30)
if (value.isValid()) {
if (key == QMediaMetaData::Orientation) {
correctedValue = QGstUtils::toGStreamerOrientation(value);
@@ -190,7 +182,6 @@ void CameraBinMetaData::setMetaData(const QString &key, const QVariant &value)
correctedValue = (value.toDouble() * 1000) / 3600;
}
}
-#endif
const auto keys = *qt_gstreamerMetaDataKeys();
for (const QGStreamerMetaDataKey &metadataKey : keys) {
diff --git a/src/plugins/gstreamer/camerabin/camerabinsession.cpp b/src/plugins/gstreamer/camerabin/camerabinsession.cpp
index 22f5fb116..355f2d247 100644
--- a/src/plugins/gstreamer/camerabin/camerabinsession.cpp
+++ b/src/plugins/gstreamer/camerabin/camerabinsession.cpp
@@ -185,14 +185,10 @@ CameraBinSession::CameraBinSession(GstElementFactory *sourceFactory, QObject *pa
//post image preview in RGB format
g_object_set(G_OBJECT(m_camerabin), POST_PREVIEWS_PROPERTY, TRUE, NULL);
-#if GST_CHECK_VERSION(1,0,0)
GstCaps *previewCaps = gst_caps_new_simple(
"video/x-raw",
"format", G_TYPE_STRING, "RGBx",
NULL);
-#else
- GstCaps *previewCaps = gst_caps_from_string("video/x-raw-rgb");
-#endif
g_object_set(G_OBJECT(m_camerabin), PREVIEW_CAPS_PROPERTY, previewCaps, NULL);
gst_caps_unref(previewCaps);
@@ -441,17 +437,7 @@ void CameraBinSession::setAudioCaptureCaps()
if (sampleRate <= 0 && channelCount <=0)
return;
-#if GST_CHECK_VERSION(1,0,0)
GstStructure *structure = gst_structure_new_empty(QT_GSTREAMER_RAW_AUDIO_MIME);
-#else
- GstStructure *structure = gst_structure_new(
- QT_GSTREAMER_RAW_AUDIO_MIME,
- "endianness", G_TYPE_INT, 1234,
- "signed", G_TYPE_BOOLEAN, TRUE,
- "width", G_TYPE_INT, 16,
- "depth", G_TYPE_INT, 16,
- NULL);
-#endif
if (sampleRate > 0)
gst_structure_set(structure, "rate", G_TYPE_INT, sampleRate, NULL);
if (channelCount > 0)
@@ -997,27 +983,16 @@ bool CameraBinSession::processSyncMessage(const QGstreamerMessage &message)
const GValue *sampleValue = 0;
if (m_captureMode == QCamera::CaptureStillImage
&& gst_structure_has_name(st, "preview-image")
-#if GST_CHECK_VERSION(1,0,0)
&& gst_structure_has_field_typed(st, "sample", GST_TYPE_SAMPLE)
&& (sampleValue = gst_structure_get_value(st, "sample"))) {
GstSample * const sample = gst_value_get_sample(sampleValue);
GstCaps * const previewCaps = gst_sample_get_caps(sample);
GstBuffer * const buffer = gst_sample_get_buffer(sample);
-#else
- && gst_structure_has_field_typed(st, "buffer", GST_TYPE_BUFFER)
- && (sampleValue = gst_structure_get_value(st, "buffer"))) {
- GstBuffer * const buffer = gst_value_get_buffer(sampleValue);
-#endif
QImage image;
-#if GST_CHECK_VERSION(1,0,0)
GstVideoInfo previewInfo;
if (gst_video_info_from_caps(&previewInfo, previewCaps))
image = QGstUtils::bufferToImage(buffer, previewInfo);
-#else
- image = QGstUtils::bufferToImage(buffer);
- gst_buffer_unref(buffer);
-#endif
if (!image.isNull()) {
static QMetaMethod exposedSignal = QMetaMethod::fromSignal(&CameraBinSession::imageExposed);
exposedSignal.invoke(this,
@@ -1314,9 +1289,7 @@ QList< QPair<int,int> > CameraBinSession::supportedFrameRates(const QSize &frame
for (uint i=0; i<gst_caps_get_size(caps); i++) {
GstStructure *structure = gst_caps_get_structure(caps, i);
gst_structure_set_name(structure, "video/x-raw");
-#if GST_CHECK_VERSION(1,2,0)
gst_caps_set_features(caps, i, NULL);
-#endif
const GValue *oldRate = gst_structure_get_value(structure, "framerate");
if (!oldRate)
continue;
@@ -1329,11 +1302,7 @@ QList< QPair<int,int> > CameraBinSession::supportedFrameRates(const QSize &frame
gst_structure_set_value(structure, "framerate", &rate);
g_value_unset(&rate);
}
-#if GST_CHECK_VERSION(1,0,0)
caps = gst_caps_simplify(caps);
-#else
- gst_caps_do_simplify(caps);
-#endif
for (uint i=0; i<gst_caps_get_size(caps); i++) {
GstStructure *structure = gst_caps_get_structure(caps, i);
@@ -1430,9 +1399,7 @@ QList<QSize> CameraBinSession::supportedResolutions(QPair<int,int> rate,
for (uint i=0; i<gst_caps_get_size(caps); i++) {
GstStructure *structure = gst_caps_get_structure(caps, i);
gst_structure_set_name(structure, "video/x-raw");
-#if GST_CHECK_VERSION(1,2,0)
gst_caps_set_features(caps, i, NULL);
-#endif
const GValue *oldW = gst_structure_get_value(structure, "width");
const GValue *oldH = gst_structure_get_value(structure, "height");
if (!oldW || !oldH)
@@ -1453,12 +1420,7 @@ QList<QSize> CameraBinSession::supportedResolutions(QPair<int,int> rate,
g_value_unset(&h);
}
-#if GST_CHECK_VERSION(1,0,0)
caps = gst_caps_simplify(caps);
-#else
- gst_caps_do_simplify(caps);
-#endif
-
for (uint i=0; i<gst_caps_get_size(caps); i++) {
GstStructure *structure = gst_caps_get_structure(caps, i);
@@ -1549,28 +1511,14 @@ void CameraBinSession::elementAdded(GstBin *, GstElement *element, CameraBinSess
g_signal_connect(G_OBJECT(element), "element-removed", G_CALLBACK(elementRemoved), session);
} else if (!factory) {
// no-op
-#if GST_CHECK_VERSION(0,10,31)
} else if (gst_element_factory_list_is_type(factory, GST_ELEMENT_FACTORY_TYPE_AUDIO_ENCODER)) {
-#else
- } else if (strstr(gst_element_factory_get_klass(factory), "Encoder/Audio") != NULL) {
-#endif
session->m_audioEncoder = element;
-
session->m_audioEncodeControl->applySettings(element);
-#if GST_CHECK_VERSION(0,10,31)
} else if (gst_element_factory_list_is_type(factory, GST_ELEMENT_FACTORY_TYPE_VIDEO_ENCODER)) {
-#else
- } else if (strstr(gst_element_factory_get_klass(factory), "Encoder/Video") != NULL) {
-#endif
session->m_videoEncoder = element;
-
session->m_videoEncodeControl->applySettings(element);
-#if GST_CHECK_VERSION(0,10,31)
} else if (gst_element_factory_list_is_type(factory, GST_ELEMENT_FACTORY_TYPE_MUXER)) {
-#else
- } else if (strstr(gst_element_factory_get_klass(factory), "Muxer") != NULL) {
-#endif
- session->m_muxer = element;
+ session->m_muxer = element;
}
}
diff --git a/src/plugins/gstreamer/mediacapture/qgstreamercaptureserviceplugin.cpp b/src/plugins/gstreamer/mediacapture/qgstreamercaptureserviceplugin.cpp
index 2a2dec60a..65f885d80 100644
--- a/src/plugins/gstreamer/mediacapture/qgstreamercaptureserviceplugin.cpp
+++ b/src/plugins/gstreamer/mediacapture/qgstreamercaptureserviceplugin.cpp
@@ -119,15 +119,8 @@ QMultimedia::SupportEstimate QGstreamerCaptureServicePlugin::hasSupport(const QS
static bool isEncoderOrMuxer(GstElementFactory *factory)
{
-#if GST_CHECK_VERSION(0, 10, 31)
return gst_element_factory_list_is_type(factory, GST_ELEMENT_FACTORY_TYPE_MUXER)
|| gst_element_factory_list_is_type(factory, GST_ELEMENT_FACTORY_TYPE_ENCODER);
-#else
- return (factory
- && (qstrcmp(factory->details.klass, "Codec/Encoder/Audio") == 0
- || qstrcmp(factory->details.klass, "Codec/Encoder/Video") == 0
- || qstrcmp(factory->details.klass, "Codec/Muxer") == 0 ));
-#endif
}
void QGstreamerCaptureServicePlugin::updateSupportedMimeTypes() const
diff --git a/src/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp b/src/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp
index 4363f6d3b..26d0999db 100644
--- a/src/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp
+++ b/src/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp
@@ -358,11 +358,7 @@ GstElement *QGstreamerCaptureSession::buildVideoPreview()
void QGstreamerCaptureSession::probeCaps(GstCaps *caps)
{
-#if GST_CHECK_VERSION(1,0,0)
gst_video_info_from_caps(&m_previewInfo, caps);
-#else
- Q_UNUSED(caps);
-#endif
}
bool QGstreamerCaptureSession::probeBuffer(GstBuffer *buffer)
@@ -378,11 +374,7 @@ bool QGstreamerCaptureSession::probeBuffer(GstBuffer *buffer)
m_passImage = false;
-#if GST_CHECK_VERSION(1,0,0)
QImage img = QGstUtils::bufferToImage(buffer, m_previewInfo);
-#else
- QImage img = QGstUtils::bufferToImage(buffer);
-#endif
if (img.isNull())
return true;
@@ -415,15 +407,11 @@ static gboolean saveImageFilter(GstElement *element,
if (!fileName.isEmpty()) {
QFile f(fileName);
if (f.open(QFile::WriteOnly)) {
-#if GST_CHECK_VERSION(1,0,0)
GstMapInfo info;
if (gst_buffer_map(buffer, &info, GST_MAP_READ)) {
f.write(reinterpret_cast<const char *>(info.data), info.size);
gst_buffer_unmap(buffer, &info);
}
-#else
- f.write(reinterpret_cast<const char *>(buffer->data), buffer->size);
-#endif
f.close();
static QMetaMethod savedSignal = QMetaMethod::fromSignal(&QGstreamerCaptureSession::imageSaved);
diff --git a/src/plugins/gstreamer/mediacapture/qgstreamercapturesession.h b/src/plugins/gstreamer/mediacapture/qgstreamercapturesession.h
index e0c9107a7..4e54ecc15 100644
--- a/src/plugins/gstreamer/mediacapture/qgstreamercapturesession.h
+++ b/src/plugins/gstreamer/mediacapture/qgstreamercapturesession.h
@@ -228,9 +228,7 @@ private:
GstElement *m_encodeBin;
-#if GST_CHECK_VERSION(1,0,0)
GstVideoInfo m_previewInfo;
-#endif
public:
bool m_passImage;
diff --git a/src/plugins/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp b/src/plugins/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp
index bd503d3a1..191878c9a 100644
--- a/src/plugins/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp
+++ b/src/plugins/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp
@@ -83,9 +83,7 @@ static const QGstreamerMetaDataKeyLookup *qt_gstreamerMetaDataKeys()
// Music
metadataKeys->insert(GST_TAG_ALBUM, QMediaMetaData::AlbumTitle);
-#if GST_CHECK_VERSION(0, 10, 25)
metadataKeys->insert(GST_TAG_ALBUM_ARTIST, QMediaMetaData::AlbumArtist);
-#endif
metadataKeys->insert(GST_TAG_ARTIST, QMediaMetaData::ContributingArtist);
//metadataKeys->insert(0, QMediaMetaData::Conductor);
//metadataKeys->insert(0, QMediaMetaData::Lyrics);
@@ -100,9 +98,7 @@ static const QGstreamerMetaDataKeyLookup *qt_gstreamerMetaDataKeys()
// Image/Video
metadataKeys->insert("resolution", QMediaMetaData::Resolution);
metadataKeys->insert("pixel-aspect-ratio", QMediaMetaData::PixelAspectRatio);
-#if GST_CHECK_VERSION(0,10,30)
metadataKeys->insert(GST_TAG_IMAGE_ORIENTATION, QMediaMetaData::Orientation);
-#endif
// Video
//metadataKeys->insert(0, QMediaMetaData::VideoFrameRate);
@@ -149,10 +145,8 @@ bool QGstreamerMetaDataProvider::isWritable() const
QVariant QGstreamerMetaDataProvider::metaData(const QString &key) const
{
-#if GST_CHECK_VERSION(0,10,30)
if (key == QMediaMetaData::Orientation)
return QGstUtils::fromGStreamerOrientation(m_tags.value(key));
-#endif
return m_tags.value(key);
}
diff --git a/src/plugins/gstreamer/mediaplayer/qgstreamerplayerserviceplugin.cpp b/src/plugins/gstreamer/mediaplayer/qgstreamerplayerserviceplugin.cpp
index db266a10e..59302f1d2 100644
--- a/src/plugins/gstreamer/mediaplayer/qgstreamerplayerserviceplugin.cpp
+++ b/src/plugins/gstreamer/mediaplayer/qgstreamerplayerserviceplugin.cpp
@@ -90,15 +90,8 @@ QMultimedia::SupportEstimate QGstreamerPlayerServicePlugin::hasSupport(const QSt
static bool isDecoderOrDemuxer(GstElementFactory *factory)
{
-#if GST_CHECK_VERSION(0, 10 ,31)
return gst_element_factory_list_is_type(factory, GST_ELEMENT_FACTORY_TYPE_DEMUXER)
|| gst_element_factory_list_is_type(factory, GST_ELEMENT_FACTORY_TYPE_DECODER);
-#else
- return (factory
- && (qstrcmp(factory->details.klass, "Codec/Decoder/Audio") == 0
- || qstrcmp(factory->details.klass, "Codec/Decoder/Video") == 0
- || qstrcmp(factory->details.klass, "Codec/Demux") == 0 ));
-#endif
}
void QGstreamerPlayerServicePlugin::updateSupportedMimeTypes() const