QtGStreamer 0.10.1
|
00001 /* 00002 Copyright (C) 2010 George Kiagiadakis <kiagiadakis.george@gmail.com> 00003 00004 This library is free software; you can redistribute it and/or modify 00005 it under the terms of the GNU Lesser General Public License as published 00006 by the Free Software Foundation; either version 2.1 of the License, or 00007 (at your option) any later version. 00008 00009 This program is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 GNU General Public License for more details. 00013 00014 You should have received a copy of the GNU Lesser General Public License 00015 along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 #include "object.h" 00018 #include "../QGlib/string_p.h" 00019 #include <gst/gstobject.h> 00020 00021 namespace QGst { 00022 00023 QString Object::name() const 00024 { 00025 return QGlib::Private::stringFromGCharPtr(gst_object_get_name(object<GstObject>())); 00026 } 00027 00028 bool Object::setName(const char *name) 00029 { 00030 return gst_object_set_name(object<GstObject>(), name); 00031 } 00032 00033 ObjectPtr Object::parent() const 00034 { 00035 return ObjectPtr::wrap(gst_object_get_parent(object<GstObject>()), false); 00036 } 00037 00038 bool Object::setParent(const ObjectPtr & parent) 00039 { 00040 return gst_object_set_parent(object<GstObject>(), parent); 00041 } 00042 00043 void Object::unparent() 00044 { 00045 gst_object_unparent(object<GstObject>()); 00046 } 00047 00048 bool Object::isAncestorOf(const ObjectPtr & obj) const 00049 { 00050 return gst_object_has_ancestor(obj, object<GstObject>()); 00051 } 00052 00053 QString Object::pathString() const 00054 { 00055 return QGlib::Private::stringFromGCharPtr(gst_object_get_path_string(object<GstObject>())); 00056 } 00057 00058 void Object::ref(bool increaseRef) 00059 { 00060 if (increaseRef) { 00061 gst_object_ref(m_object); 00062 } 00063 } 00064 00065 void Object::unref() 00066 { 00067 gst_object_unref(m_object); 00068 } 00069 00070 }