QtGStreamer  1.2.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
elementfactory.h
1 /*
2  Copyright (C) 2009-2010 George Kiagiadakis <kiagiadakis.george@gmail.com>
3 
4  This library is free software; you can redistribute it and/or modify
5  it under the terms of the GNU Lesser General Public License as published
6  by the Free Software Foundation; either version 2.1 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public License
15  along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17 #ifndef QGST_ELEMENTFACTORY_H
18 #define QGST_ELEMENTFACTORY_H
19 
20 #include "pluginfeature.h"
21 #include "element.h"
22 
23 namespace QGst {
24 
28 class QTGSTREAMER_EXPORT ElementFactory : public PluginFeature
29 {
30  QGST_WRAPPER(ElementFactory)
31 public:
32  static ElementFactoryPtr find(const char *factoryName);
33  static inline ElementFactoryPtr find(const QString & factoryName);
34 
35  static ElementPtr make(const char *factoryName, const char *elementName = NULL);
36  static inline ElementPtr make(const QString & factoryName, const char *elementName = NULL);
37 
38  QGlib::Type elementType() const;
39  QString metadata(const char *key) const;
40 
41  uint padTemplatesCount() const;
42  int uriType() const;
43  bool hasInterface(const char *interfaceName) const;
44  bool canSinkAllCaps(const CapsPtr & caps) const;
45  bool canSrcAllCaps(const CapsPtr & caps) const;
46  bool canSinkAnyCaps(const CapsPtr & caps) const;
47  bool canSrcAnyCaps(const CapsPtr & caps) const;
48 
49  ElementPtr create(const char *elementName = NULL) const;
50 };
51 
52 //static
53 inline ElementFactoryPtr ElementFactory::find(const QString & factoryName)
54 {
55  return find(factoryName.toUtf8().constData());
56 }
57 
58 //static
59 inline ElementPtr ElementFactory::make(const QString & factoryName, const char *elementName)
60 {
61  return make(factoryName.toUtf8().constData(), elementName);
62 }
63 
64 } //namespace QGst
65 
66 QGST_REGISTER_TYPE(QGst::ElementFactory)
67 
68 #endif
Smart pointer class for working with wrapper classes that support reference counting.
Definition: global.h:56
Wrapper class for GstPluginFeature.
Definition: pluginfeature.h:27
Wrapper class for GstElementFactory.
Wrapper class for GType.
Definition: type.h:63