QtGStreamer 0.10.1
|
00001 /* 00002 Copyright (C) 2010 Collabora Multimedia. 00003 @author Mauricio Piacentini <mauricio.piacentini@collabora.co.uk> 00004 00005 This library is free software; you can redistribute it and/or modify 00006 it under the terms of the GNU Lesser General Public License as published 00007 by the Free Software Foundation; either version 2.1 of the License, or 00008 (at your option) any later version. 00009 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU Lesser General Public License 00016 along with this program. If not, see <http://www.gnu.org/licenses/>. 00017 */ 00018 #include "clock.h" 00019 00020 #include <QtCore/QTime> 00021 #include <gst/gstclock.h> 00022 #include <gst/gstsystemclock.h> 00023 00024 namespace QGst { 00025 00026 ClockPtr Clock::systemClock() 00027 { 00028 return ClockPtr::wrap(gst_system_clock_obtain(), false); 00029 } 00030 00031 ClockTime Clock::clockTime() const 00032 { 00033 GstClockTime t = gst_clock_get_time(object<GstClock>()); 00034 return t; 00035 } 00036 00037 ClockTime Clock::resolution() const 00038 { 00039 GstClockTime t = gst_clock_get_resolution(object<GstClock>()); 00040 return t; 00041 } 00042 00043 QTime Clock::time() const 00044 { 00045 return clockTime().toTime(); 00046 } 00047 00048 }