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:
@@ -44,6 +44,7 @@
|
||||
#include <qaudioformat.h>
|
||||
#include <QtCore/qelapsedtimer.h>
|
||||
#include <QtMultimedia/qvideosurfaceformat.h>
|
||||
#include <private/qmultimediautils_p.h>
|
||||
|
||||
#include <gst/audio/audio.h>
|
||||
#include <gst/video/video.h>
|
||||
@@ -1531,6 +1532,15 @@ GList *qt_gst_video_sinks()
|
||||
return list;
|
||||
}
|
||||
|
||||
void qt_gst_util_double_to_fraction(gdouble src, gint *dest_n, gint *dest_d)
|
||||
{
|
||||
#if GST_CHECK_VERSION(0, 10, 26)
|
||||
gst_util_double_to_fraction(src, dest_n, dest_d);
|
||||
#else
|
||||
qt_real_to_fraction(src, dest_n, dest_d);
|
||||
#endif
|
||||
}
|
||||
|
||||
QDebug operator <<(QDebug debug, GstCaps *caps)
|
||||
{
|
||||
if (caps) {
|
||||
|
||||
@@ -152,6 +152,7 @@ GstCaps *qt_gst_caps_normalize(GstCaps *caps);
|
||||
const gchar *qt_gst_element_get_factory_name(GstElement *element);
|
||||
gboolean qt_gst_caps_can_intersect(const GstCaps * caps1, const GstCaps * caps2);
|
||||
GList *qt_gst_video_sinks();
|
||||
void qt_gst_util_double_to_fraction(gdouble src, gint *dest_n, gint *dest_d);
|
||||
|
||||
QDebug operator <<(QDebug debug, GstCaps *caps);
|
||||
|
||||
|
||||
@@ -85,6 +85,10 @@ config_gstreamer_photography {
|
||||
DEFINES += GST_USE_UNSTABLE_API #prevents warnings because of unstable photography API
|
||||
}
|
||||
|
||||
config_gstreamer_encodingprofiles {
|
||||
DEFINES += HAVE_GST_ENCODING_PROFILES
|
||||
}
|
||||
|
||||
OTHER_FILES += \
|
||||
camerabin.json
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -42,10 +42,13 @@
|
||||
|
||||
#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
|
||||
|
||||
#include <qaudioformat.h>
|
||||
#include <private/qgstcodecsinfo_p.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class CameraBinSession;
|
||||
@@ -76,7 +79,9 @@ public:
|
||||
void setActualAudioSettings(const QAudioEncoderSettings&);
|
||||
void resetActualSettings();
|
||||
|
||||
#ifdef HAVE_GST_ENCODING_PROFILES
|
||||
GstEncodingProfile *createProfile();
|
||||
#endif
|
||||
|
||||
void applySettings(GstElement *element);
|
||||
|
||||
@@ -84,7 +89,9 @@ Q_SIGNALS:
|
||||
void settingsChanged();
|
||||
|
||||
private:
|
||||
#ifdef HAVE_GST_ENCODING_PROFILES
|
||||
QGstCodecsInfo m_codecs;
|
||||
#endif
|
||||
|
||||
QAudioEncoderSettings m_actualAudioSettings;
|
||||
QAudioEncoderSettings m_audioSettings;
|
||||
|
||||
@@ -39,8 +39,10 @@
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
CameraBinContainer::CameraBinContainer(QObject *parent)
|
||||
:QMediaContainerControl(parent),
|
||||
m_supportedContainers(QGstCodecsInfo::Muxer)
|
||||
:QMediaContainerControl(parent)
|
||||
#ifdef HAVE_GST_ENCODING_PROFILES
|
||||
, m_supportedContainers(QGstCodecsInfo::Muxer)
|
||||
#endif
|
||||
{
|
||||
//extension for containers hard to guess from mimetype
|
||||
m_fileExtensions["video/x-matroska"] = "mkv";
|
||||
@@ -54,12 +56,21 @@ CameraBinContainer::CameraBinContainer(QObject *parent)
|
||||
|
||||
QStringList CameraBinContainer::supportedContainers() const
|
||||
{
|
||||
#ifdef HAVE_GST_ENCODING_PROFILES
|
||||
return m_supportedContainers.supportedCodecs();
|
||||
#else
|
||||
return QStringList();
|
||||
#endif
|
||||
}
|
||||
|
||||
QString CameraBinContainer::containerDescription(const QString &formatMimeType) const
|
||||
{
|
||||
#ifdef HAVE_GST_ENCODING_PROFILES
|
||||
return m_supportedContainers.codecDescription(formatMimeType);
|
||||
#else
|
||||
Q_UNUSED(formatMimeType)
|
||||
return QString();
|
||||
#endif
|
||||
}
|
||||
|
||||
QString CameraBinContainer::containerFormat() const
|
||||
@@ -69,11 +80,13 @@ QString CameraBinContainer::containerFormat() const
|
||||
|
||||
void CameraBinContainer::setContainerFormat(const QString &format)
|
||||
{
|
||||
#ifdef HAVE_GST_ENCODING_PROFILES
|
||||
if (m_format != format) {
|
||||
m_format = format;
|
||||
m_actualFormat = format;
|
||||
emit settingsChanged();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
QString CameraBinContainer::actualContainerFormat() const
|
||||
@@ -83,7 +96,9 @@ QString CameraBinContainer::actualContainerFormat() const
|
||||
|
||||
void CameraBinContainer::setActualContainerFormat(const QString &containerFormat)
|
||||
{
|
||||
#ifdef HAVE_GST_ENCODING_PROFILES
|
||||
m_actualFormat = containerFormat;
|
||||
#endif
|
||||
}
|
||||
|
||||
void CameraBinContainer::resetActualContainerFormat()
|
||||
@@ -91,6 +106,8 @@ void CameraBinContainer::resetActualContainerFormat()
|
||||
m_actualFormat = m_format;
|
||||
}
|
||||
|
||||
#ifdef HAVE_GST_ENCODING_PROFILES
|
||||
|
||||
GstEncodingContainerProfile *CameraBinContainer::createProfile()
|
||||
{
|
||||
GstCaps *caps;
|
||||
@@ -127,6 +144,8 @@ GstEncodingContainerProfile *CameraBinContainer::createProfile()
|
||||
return profile;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*!
|
||||
Suggest file extension for current container mimetype.
|
||||
*/
|
||||
|
||||
@@ -41,9 +41,11 @@
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/pbutils/pbutils.h>
|
||||
#include <gst/pbutils/encoding-profile.h>
|
||||
|
||||
#ifdef HAVE_GST_ENCODING_PROFILES
|
||||
#include <gst/pbutils/encoding-profile.h>
|
||||
#include <private/qgstcodecsinfo_p.h>
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@@ -66,7 +68,9 @@ public:
|
||||
|
||||
QString suggestedFileExtension(const QString &containerFormat) const;
|
||||
|
||||
#ifdef HAVE_GST_ENCODING_PROFILES
|
||||
GstEncodingContainerProfile *createProfile();
|
||||
#endif
|
||||
|
||||
Q_SIGNALS:
|
||||
void settingsChanged();
|
||||
@@ -76,7 +80,9 @@ private:
|
||||
QString m_actualFormat;
|
||||
QMap<QString, QString> m_fileExtensions;
|
||||
|
||||
#ifdef HAVE_GST_ENCODING_PROFILES
|
||||
QGstCodecsInfo m_supportedContainers;
|
||||
#endif
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
@@ -42,6 +42,8 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#if GST_CHECK_VERSION(0,10,30)
|
||||
|
||||
static QVariant fromGStreamerOrientation(const QVariant &value)
|
||||
{
|
||||
// Note gstreamer tokens either describe the counter clockwise rotation of the
|
||||
@@ -58,6 +60,8 @@ static QVariant fromGStreamerOrientation(const QVariant &value)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static QVariant toGStreamerOrientation(const QVariant &value)
|
||||
{
|
||||
switch (value.toInt()) {
|
||||
@@ -97,7 +101,9 @@ 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));
|
||||
@@ -182,12 +188,14 @@ CameraBinMetaData::CameraBinMetaData(QObject *parent)
|
||||
|
||||
QVariant CameraBinMetaData::metaData(const QString &key) const
|
||||
{
|
||||
#if GST_CHECK_VERSION(0,10,30)
|
||||
if (key == QMediaMetaData::Orientation) {
|
||||
return 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
|
||||
|
||||
Q_FOREACH (const QGStreamerMetaDataKey &metadataKey, *qt_gstreamerMetaDataKeys()) {
|
||||
if (metadataKey.qtName == key)
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
#include "camerabincontainer.h"
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
#include <gst/pbutils/encoding-profile.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@@ -131,6 +130,7 @@ qint64 CameraBinRecorder::duration() const
|
||||
|
||||
void CameraBinRecorder::applySettings()
|
||||
{
|
||||
#ifdef HAVE_GST_ENCODING_PROFILES
|
||||
CameraBinContainer *containerControl = m_session->mediaContainerControl();
|
||||
CameraBinAudioEncoder *audioEncoderControl = m_session->audioEncodeControl();
|
||||
CameraBinVideoEncoder *videoEncoderControl = m_session->videoEncodeControl();
|
||||
@@ -172,8 +172,11 @@ void CameraBinRecorder::applySettings()
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef HAVE_GST_ENCODING_PROFILES
|
||||
|
||||
GstEncodingContainerProfile *CameraBinRecorder::videoProfile()
|
||||
{
|
||||
GstEncodingContainerProfile *containerProfile = m_session->mediaContainerControl()->createProfile();
|
||||
@@ -195,6 +198,8 @@ GstEncodingContainerProfile *CameraBinRecorder::videoProfile()
|
||||
return containerProfile;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void CameraBinRecorder::setState(QMediaRecorder::State state)
|
||||
{
|
||||
if (m_state == state)
|
||||
|
||||
@@ -37,7 +37,10 @@
|
||||
|
||||
#include <qmediarecordercontrol.h>
|
||||
#include "camerabinsession.h"
|
||||
|
||||
#ifdef HAVE_GST_ENCODING_PROFILES
|
||||
#include <gst/pbutils/encoding-profile.h>
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@@ -61,7 +64,10 @@ public:
|
||||
qreal volume() const;
|
||||
|
||||
void applySettings();
|
||||
|
||||
#ifdef HAVE_GST_ENCODING_PROFILES
|
||||
GstEncodingContainerProfile *videoProfile();
|
||||
#endif
|
||||
|
||||
public slots:
|
||||
void setState(QMediaRecorder::State state);
|
||||
|
||||
@@ -308,7 +308,7 @@ static GstCaps *resolutionToCaps(const QSize &resolution,
|
||||
if (frameRate > 0.0) {
|
||||
gint numerator;
|
||||
gint denominator;
|
||||
gst_util_double_to_fraction(frameRate, &numerator, &denominator);
|
||||
qt_gst_util_double_to_fraction(frameRate, &numerator, &denominator);
|
||||
|
||||
gst_caps_set_simple(
|
||||
caps,
|
||||
@@ -404,7 +404,7 @@ void CameraBinSession::setupCaptureResolution()
|
||||
|
||||
if (!qFuzzyIsNull(viewfinderFrameRate)) {
|
||||
int n, d;
|
||||
gst_util_double_to_fraction(viewfinderFrameRate, &n, &d);
|
||||
qt_gst_util_double_to_fraction(viewfinderFrameRate, &n, &d);
|
||||
g_object_set(G_OBJECT(m_videoSrc), "fps-n", n, NULL);
|
||||
g_object_set(G_OBJECT(m_videoSrc), "fps-d", d, NULL);
|
||||
}
|
||||
@@ -798,12 +798,14 @@ void CameraBinSession::start()
|
||||
|
||||
m_recorderControl->applySettings();
|
||||
|
||||
#ifdef HAVE_GST_ENCODING_PROFILES
|
||||
GstEncodingContainerProfile *profile = m_recorderControl->videoProfile();
|
||||
g_object_set (G_OBJECT(m_camerabin),
|
||||
"video-profile",
|
||||
profile,
|
||||
NULL);
|
||||
gst_encoding_profile_unref(profile);
|
||||
#endif
|
||||
|
||||
setAudioCaptureCaps();
|
||||
|
||||
@@ -1065,13 +1067,38 @@ bool CameraBinSession::processBusMessage(const QGstreamerMessage &message)
|
||||
return false;
|
||||
}
|
||||
|
||||
QString CameraBinSession::currentContainerFormat() const
|
||||
{
|
||||
if (!m_muxer)
|
||||
return QString();
|
||||
|
||||
QString format;
|
||||
|
||||
if (GstPad *srcPad = gst_element_get_static_pad(m_muxer, "src")) {
|
||||
if (GstCaps *caps = qt_gst_pad_get_caps(srcPad)) {
|
||||
gchar *capsString = gst_caps_to_string(caps);
|
||||
format = QString::fromLatin1(capsString);
|
||||
if (capsString)
|
||||
g_free(capsString);
|
||||
gst_caps_unref(caps);
|
||||
}
|
||||
gst_object_unref(GST_OBJECT(srcPad));
|
||||
}
|
||||
|
||||
return format;
|
||||
}
|
||||
|
||||
void CameraBinSession::recordVideo()
|
||||
{
|
||||
QString format = currentContainerFormat();
|
||||
if (format.isEmpty())
|
||||
format = m_mediaContainerControl->actualContainerFormat();
|
||||
|
||||
const QString actualFileName = m_mediaStorageLocation.generateFileName(m_sink.isLocalFile() ? m_sink.toLocalFile()
|
||||
: m_sink.toString(),
|
||||
QMediaStorageLocation::Movies,
|
||||
QLatin1String("clip_"),
|
||||
m_mediaContainerControl->suggestedFileExtension(m_mediaContainerControl->actualContainerFormat()));
|
||||
m_mediaContainerControl->suggestedFileExtension(format));
|
||||
|
||||
m_recordingActive = true;
|
||||
m_actualSink = QUrl::fromLocalFile(actualFileName);
|
||||
@@ -1433,14 +1460,28 @@ 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1450,6 +1491,8 @@ void CameraBinSession::elementRemoved(GstBin *, GstElement *element, CameraBinSe
|
||||
session->m_audioEncoder = 0;
|
||||
else if (element == session->m_videoEncoder)
|
||||
session->m_videoEncoder = 0;
|
||||
else if (element == session->m_muxer)
|
||||
session->m_muxer = 0;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
@@ -195,6 +195,8 @@ private:
|
||||
void updateSupportedViewfinderSettings();
|
||||
static void updateBusyStatus(GObject *o, GParamSpec *p, gpointer d);
|
||||
|
||||
QString currentContainerFormat() const;
|
||||
|
||||
static void elementAdded(GstBin *bin, GstElement *element, CameraBinSession *session);
|
||||
static void elementRemoved(GstBin *bin, GstElement *element, CameraBinSession *session);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -42,8 +42,11 @@
|
||||
|
||||
#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
|
||||
|
||||
@@ -74,7 +77,9 @@ public:
|
||||
void setActualVideoSettings(const QVideoEncoderSettings&);
|
||||
void resetActualSettings();
|
||||
|
||||
#ifdef HAVE_GST_ENCODING_PROFILES
|
||||
GstEncodingProfile *createProfile();
|
||||
#endif
|
||||
|
||||
void applySettings(GstElement *encoder);
|
||||
|
||||
@@ -84,7 +89,9 @@ Q_SIGNALS:
|
||||
private:
|
||||
CameraBinSession *m_session;
|
||||
|
||||
#ifdef HAVE_GST_ENCODING_PROFILES
|
||||
QGstCodecsInfo m_codecs;
|
||||
#endif
|
||||
|
||||
QVideoEncoderSettings m_actualVideoSettings;
|
||||
QVideoEncoderSettings m_videoSettings;
|
||||
|
||||
@@ -2,12 +2,9 @@ TEMPLATE = subdirs
|
||||
|
||||
SUBDIRS += \
|
||||
audiodecoder \
|
||||
camerabin \
|
||||
mediaplayer \
|
||||
mediacapture
|
||||
|
||||
config_gstreamer_encodingprofiles {
|
||||
SUBDIRS += camerabin
|
||||
}
|
||||
|
||||
OTHER_FILES += \
|
||||
gstreamer.json
|
||||
|
||||
Reference in New Issue
Block a user