Support compiling with GStreamer < 0.10.32 in the camerabin plugin.
The documented minimum GStreamer version for Qt Multimedia is 0.10.24, however, the camerabin plugin actually required 0.10.32 to compile successfully. The reason is mainly due to the GstEncodingProfiles API, which is used to implement the audio and video encoding settings controls. There's no hard requirement for that API anymore and the aforementioned controls simply don't do anything when the GStreamer version used to compile is older than 0.10.32. A few other GStreamer calls had to be ifdef'd or replaced in order to compile with 0.10.24. Note that this patch only makes sure it compiles with older versions, running the camerabin plugin with GStreamer < 0.10.32 is currently untested and it might not work as expected. Task-number: QTBUG-48914 Change-Id: I4ce8e932f24a33e919e29326729e12bbae561faf Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
This commit is contained in:
@@ -33,7 +33,6 @@
|
||||
|
||||
#include "camerabinaudioencoder.h"
|
||||
#include "camerabincontainer.h"
|
||||
#include <private/qgstcodecsinfo_p.h>
|
||||
#include <private/qgstutils_p.h>
|
||||
|
||||
#include <QtCore/qdebug.h>
|
||||
@@ -41,8 +40,10 @@
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
CameraBinAudioEncoder::CameraBinAudioEncoder(QObject *parent)
|
||||
:QAudioEncoderSettingsControl(parent),
|
||||
m_codecs(QGstCodecsInfo::AudioEncoder)
|
||||
:QAudioEncoderSettingsControl(parent)
|
||||
#ifdef HAVE_GST_ENCODING_PROFILES
|
||||
, m_codecs(QGstCodecsInfo::AudioEncoder)
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
@@ -52,12 +53,21 @@ CameraBinAudioEncoder::~CameraBinAudioEncoder()
|
||||
|
||||
QStringList CameraBinAudioEncoder::supportedAudioCodecs() const
|
||||
{
|
||||
#ifdef HAVE_GST_ENCODING_PROFILES
|
||||
return m_codecs.supportedCodecs();
|
||||
#else
|
||||
return QStringList();
|
||||
#endif
|
||||
}
|
||||
|
||||
QString CameraBinAudioEncoder::codecDescription(const QString &codecName) const
|
||||
{
|
||||
#ifdef HAVE_GST_ENCODING_PROFILES
|
||||
return m_codecs.codecDescription(codecName);
|
||||
#else
|
||||
Q_UNUSED(codecName)
|
||||
return QString();
|
||||
#endif
|
||||
}
|
||||
|
||||
QList<int> CameraBinAudioEncoder::supportedSampleRates(const QAudioEncoderSettings &, bool *) const
|
||||
@@ -96,6 +106,8 @@ void CameraBinAudioEncoder::resetActualSettings()
|
||||
m_actualAudioSettings = m_audioSettings;
|
||||
}
|
||||
|
||||
#ifdef HAVE_GST_ENCODING_PROFILES
|
||||
|
||||
GstEncodingProfile *CameraBinAudioEncoder::createProfile()
|
||||
{
|
||||
QString codec = m_actualAudioSettings.codec();
|
||||
@@ -118,6 +130,8 @@ GstEncodingProfile *CameraBinAudioEncoder::createProfile()
|
||||
return profile;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void CameraBinAudioEncoder::applySettings(GstElement *encoder)
|
||||
{
|
||||
GObjectClass * const objectClass = G_OBJECT_GET_CLASS(encoder);
|
||||
|
||||
Reference in New Issue
Block a user