00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "childproxy.h"
00018 #include <gst/gstobject.h>
00019 #include <gst/gstchildproxy.h>
00020
00021 namespace QGst {
00022
00023 uint ChildProxy::childrenCount() const
00024 {
00025 return gst_child_proxy_get_children_count(object<GstChildProxy>());
00026 }
00027
00028 ObjectPtr ChildProxy::childByName(const char *name) const
00029 {
00030 return ObjectPtr::wrap(gst_child_proxy_get_child_by_name(object<GstChildProxy>(), name), false);
00031 }
00032
00033 ObjectPtr ChildProxy::childByIndex(uint index) const
00034 {
00035 return ObjectPtr::wrap(gst_child_proxy_get_child_by_index(object<GstChildProxy>(), index), false);
00036 }
00037
00038 bool ChildProxy::findChildProperty(const char *name, ObjectPtr *obj, QGlib::ParamSpecPtr *paramSpec) const
00039 {
00040 GstObject *op;
00041 GParamSpec *pp;
00042 bool result = gst_child_proxy_lookup(object<GstObject>(), name, &op, &pp);
00043 if (result) {
00044 *obj = ObjectPtr::wrap(op, false);
00045 *paramSpec = QGlib::ParamSpecPtr::wrap(pp, false);
00046 }
00047 return result;
00048 }
00049
00050 QGlib::Value ChildProxy::childProperty(const char *name) const
00051 {
00052 QGlib::ParamSpecPtr param;
00053 ObjectPtr object;
00054 if (findChildProperty(name, &object, ¶m)) {
00055 return object->property(param->name().toUtf8());
00056 } else {
00057 return QGlib::Value();
00058 }
00059 }
00060
00061 }