From 155aa8555b436f547fb73c4de11164d4d166e80d Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Thu, 14 Jul 2016 13:25:16 +0200 Subject: GStreamer: improve QGstCodecsInfo - The class now works with GStreamer < 0.10.31. - New codecElement() function that returns the GStreamer encoder name for a given codec. - New codecOptions() function that returns the list of available GStreamer properties for a given codec. - Don't return duplicate codecs (when several GStreamer plugins are available for a given codec). We now only use the highest ranked one. Change-Id: I4a79099d4469907c73046d7e78df737fe4ed036c Reviewed-by: Christian Stromme --- src/multimedia/gsttools_headers/qgstcodecsinfo_p.h | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'src/multimedia/gsttools_headers/qgstcodecsinfo_p.h') diff --git a/src/multimedia/gsttools_headers/qgstcodecsinfo_p.h b/src/multimedia/gsttools_headers/qgstcodecsinfo_p.h index 64e9ac21f..af1a4486f 100644 --- a/src/multimedia/gsttools_headers/qgstcodecsinfo_p.h +++ b/src/multimedia/gsttools_headers/qgstcodecsinfo_p.h @@ -63,22 +63,28 @@ class QGstCodecsInfo public: enum ElementType { AudioEncoder, VideoEncoder, Muxer }; + struct CodecInfo { + QString description; + QByteArray elementName; + GstRank rank; + }; + QGstCodecsInfo(ElementType elementType); QStringList supportedCodecs() const; QString codecDescription(const QString &codec) const; - -#if GST_CHECK_VERSION(0,10,31) - static GstCaps* supportedElementCaps(GstElementFactoryListType elementType, - GstRank minimumRank = GST_RANK_MARGINAL, - GstPadDirection padDirection = GST_PAD_SRC); -#endif + QByteArray codecElement(const QString &codec) const; + QStringList codecOptions(const QString &codec) const; private: + void updateCodecs(ElementType elementType); + GList *elementFactories(ElementType elementType) const; + QStringList m_codecs; - QMap m_codecDescriptions; + QMap m_codecInfo; }; +Q_DECLARE_TYPEINFO(QGstCodecsInfo::CodecInfo, Q_MOVABLE_TYPE); QT_END_NAMESPACE -- cgit v1.2.3