Files
qtmultimedia/src/plugins/gstreamer/camerabin/camerabinvideoencoder.h
Yoann Lopes 7c4574a698 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>
2015-11-19 11:59:20 +00:00

103 lines
3.3 KiB
C++

/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef CAMERABINVIDEOENCODE_H
#define CAMERABINVIDEOENCODE_H
#include <qvideoencodersettingscontrol.h>
#include <QtCore/qstringlist.h>
#include <QtCore/qmap.h>
#include <QtCore/qset.h>
#include <gst/gst.h>
#include <gst/pbutils/pbutils.h>
#ifdef HAVE_GST_ENCODING_PROFILES
#include <gst/pbutils/encoding-profile.h>
#include <private/qgstcodecsinfo_p.h>
#endif
QT_BEGIN_NAMESPACE
class CameraBinSession;
class CameraBinVideoEncoder : public QVideoEncoderSettingsControl
{
Q_OBJECT
public:
CameraBinVideoEncoder(CameraBinSession *session);
virtual ~CameraBinVideoEncoder();
QList<QSize> supportedResolutions(const QVideoEncoderSettings &settings = QVideoEncoderSettings(),
bool *continuous = 0) const;
QList< qreal > supportedFrameRates(const QVideoEncoderSettings &settings = QVideoEncoderSettings(),
bool *continuous = 0) const;
QPair<int,int> rateAsRational(qreal) const;
QStringList supportedVideoCodecs() const;
QString videoCodecDescription(const QString &codecName) const;
QVideoEncoderSettings videoSettings() const;
void setVideoSettings(const QVideoEncoderSettings &settings);
QVideoEncoderSettings actualVideoSettings() const;
void setActualVideoSettings(const QVideoEncoderSettings&);
void resetActualSettings();
#ifdef HAVE_GST_ENCODING_PROFILES
GstEncodingProfile *createProfile();
#endif
void applySettings(GstElement *encoder);
Q_SIGNALS:
void settingsChanged();
private:
CameraBinSession *m_session;
#ifdef HAVE_GST_ENCODING_PROFILES
QGstCodecsInfo m_codecs;
#endif
QVideoEncoderSettings m_actualVideoSettings;
QVideoEncoderSettings m_videoSettings;
};
QT_END_NAMESPACE
#endif