Initial commit.
[qtgstreamer:qtgstreamer.git] / src / qgstelement.h
1 /*
2     Copyright (C) 2009  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 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 _QTGSTREAMER_QGSTELEMENT_H
18 #define _QTGSTREAMER_QGSTELEMENT_H
19
20 #include "qgstobject.h"
21 typedef struct _GstElement GstElement;
22
23 namespace QtGstreamer {
24
25 class QGstElement : public QGstObject
26 {
27     Q_OBJECT
28     Q_DISABLE_COPY(QGstElement)
29 public:
30     enum State { VoidPending, Null, Ready, Paused, Playing };
31
32     explicit QGstElement(GstElement *gstElement, QObject *parent = 0);
33     virtual ~QGstElement();
34
35     //FIXME those functions need some love to match the gstreamer api
36     State currentState() const;
37     void setState(State state);
38
39     static bool link(QGstElement *element1, QGstElement *element2,
40                      QGstElement *element3 = NULL, QGstElement *element4 = NULL,
41                      QGstElement *element5 = NULL, QGstElement *element6 = NULL,
42                      QGstElement *element7 = NULL, QGstElement *element8 = NULL,
43                      QGstElement *element9 = NULL, QGstElement *element10 = NULL);
44
45     static void unlink(QGstElement *element1, QGstElement *element2,
46                        QGstElement *element3 = NULL, QGstElement *element4 = NULL,
47                        QGstElement *element5 = NULL, QGstElement *element6 = NULL,
48                        QGstElement *element7 = NULL, QGstElement *element8 = NULL,
49                        QGstElement *element9 = NULL, QGstElement *element10 = NULL);
50 };
51
52 }
53
54 #endif