summaryrefslogtreecommitdiff
path: root/src/object.h
blob: 059d55ebaa3cdee481c2bb358e9b70c7ae9508f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef QQUICKSTREAMER_OBJECT_H
#define QQUICKSTREAMER_OBJECT_H

#include <QObject>

typedef unsigned long               GType;
typedef struct _GParamSpec          GParamSpec;
typedef struct _GstElementFactory   GstElementFactory;
typedef struct _GstObject           GstObject;

namespace QQuickStreamer {

class Object : public QObject
{
public:
    Q_OBJECT_CHECK

    explicit Object(GstObject *target, QObject *parent = Q_NULLPTR);
    Object(const Object &other);

    ~Object();

    static int registerElementFactory(GstElementFactory *factory);
    static int registerObjectClass(GType type);

    const QMetaObject *metaObject() const Q_DECL_OVERRIDE;
    void *qt_metacast(const char *classname) Q_DECL_OVERRIDE;
    int qt_metacall(QMetaObject::Call call, int id, void **args) Q_DECL_OVERRIDE;

protected:
    int readProperty(int id, QVariant *value);
    int writeProperty(int id, const QVariant &value);
    static void emitPropertyChanged(Object *self, GParamSpec *pspec);

private:
    GstObject *const m_target;
};

} // namespace QQuickStreamer

#endif // QQUICKSTREAMEROBJECT_H