summaryrefslogtreecommitdiffstats
path: root/src/multimedia/gsttools_headers
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@qt.io>2016-07-14 13:25:16 +0200
committerYoann Lopes <yoann.lopes@qt.io>2016-08-23 09:17:45 +0000
commit155aa8555b436f547fb73c4de11164d4d166e80d (patch)
tree39814a45c9e0d2ac5d020e05812887b2b52863a2 /src/multimedia/gsttools_headers
parenta8dfa9f254beb3a0ffd767fe7fc66d25b180cade (diff)
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 <christian.stromme@qt.io>
Diffstat (limited to 'src/multimedia/gsttools_headers')
-rw-r--r--src/multimedia/gsttools_headers/qgstcodecsinfo_p.h20
1 files changed, 13 insertions, 7 deletions
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<QString,QString> m_codecDescriptions;
+ QMap<QString, CodecInfo> m_codecInfo;
};
+Q_DECLARE_TYPEINFO(QGstCodecsInfo::CodecInfo, Q_MOVABLE_TYPE);
QT_END_NAMESPACE