QtGStreamer  0.10.2
 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 longName() const;
40  QString klass() const;
41  QString description() const;
42  QString author() const;
43  QString documentationUri() const;
44  QString iconName() const;
45 
46  uint padTemplatesCount() const;
47  int uriType() const;
48  bool hasInterface(const char *interfaceName) const;
49  bool canSinkCaps(const CapsPtr & caps) const;
50  bool canSrcCaps(const CapsPtr & caps) const;
51 
52  ElementPtr create(const char *elementName = NULL) const;
53 };
54 
55 //static
56 inline ElementFactoryPtr ElementFactory::find(const QString & factoryName)
57 {
58  return find(factoryName.toUtf8().constData());
59 }
60 
61 //static
62 inline ElementPtr ElementFactory::make(const QString & factoryName, const char *elementName)
63 {
64  return make(factoryName.toUtf8().constData(), elementName);
65 }
66 
67 } //namespace QGst
68 
69 QGST_REGISTER_TYPE(QGst::ElementFactory)
70 
71 #endif