diff options
author | Yoann Lopes <yoann.lopes@theqtcompany.com> | 2015-11-13 18:48:19 +0100 |
---|---|---|
committer | Yoann Lopes <yoann.lopes@theqtcompany.com> | 2015-11-19 11:59:20 +0000 |
commit | 7c4574a6985671f14148ad8ee591aee4487f5d4d (patch) | |
tree | 5c1a748ba06c94d6866ecac4bd75409c5ed5f85d /src/plugins/gstreamer/camerabin/camerabinvideoencoder.cpp | |
parent | 4a2c597a0666452a39939339ebd6f87040952cd3 (diff) | |
download | qtmultimedia-7c4574a6985671f14148ad8ee591aee4487f5d4d.tar.gz |
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>
Diffstat (limited to 'src/plugins/gstreamer/camerabin/camerabinvideoencoder.cpp')
-rw-r--r-- | src/plugins/gstreamer/camerabin/camerabinvideoencoder.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/plugins/gstreamer/camerabin/camerabinvideoencoder.cpp b/src/plugins/gstreamer/camerabin/camerabinvideoencoder.cpp index f80ba4a41..2d53af1fb 100644 --- a/src/plugins/gstreamer/camerabin/camerabinvideoencoder.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinvideoencoder.cpp @@ -41,9 +41,11 @@ QT_BEGIN_NAMESPACE CameraBinVideoEncoder::CameraBinVideoEncoder(CameraBinSession *session) - :QVideoEncoderSettingsControl(session), - m_session(session), - m_codecs(QGstCodecsInfo::VideoEncoder) + :QVideoEncoderSettingsControl(session) + , m_session(session) +#ifdef HAVE_GST_ENCODING_PROFILES + , m_codecs(QGstCodecsInfo::VideoEncoder) +#endif { } @@ -81,12 +83,21 @@ QList< qreal > CameraBinVideoEncoder::supportedFrameRates(const QVideoEncoderSet QStringList CameraBinVideoEncoder::supportedVideoCodecs() const { +#ifdef HAVE_GST_ENCODING_PROFILES return m_codecs.supportedCodecs(); +#else + return QStringList(); +#endif } QString CameraBinVideoEncoder::videoCodecDescription(const QString &codecName) const { +#ifdef HAVE_GST_ENCODING_PROFILES return m_codecs.codecDescription(codecName); +#else + Q_UNUSED(codecName) + return QString(); +#endif } QVideoEncoderSettings CameraBinVideoEncoder::videoSettings() const @@ -150,6 +161,8 @@ QPair<int,int> CameraBinVideoEncoder::rateAsRational(qreal frameRate) const return QPair<int,int>(); } +#ifdef HAVE_GST_ENCODING_PROFILES + GstEncodingProfile *CameraBinVideoEncoder::createProfile() { QString codec = m_actualVideoSettings.codec(); @@ -176,6 +189,8 @@ GstEncodingProfile *CameraBinVideoEncoder::createProfile() return (GstEncodingProfile *)profile; } +#endif + void CameraBinVideoEncoder::applySettings(GstElement *encoder) { GObjectClass * const objectClass = G_OBJECT_GET_CLASS(encoder); |