QtGStreamer 1.2.0
Loading...
Searching...
No Matches
clock.cpp
1/*
2 Copyright (C) 2010 Collabora Multimedia.
3 @author Mauricio Piacentini <mauricio.piacentini@collabora.co.uk>
4
5 This library is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published
7 by the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18#include "clock.h"
19
20#include <QtCore/QTime>
21#include <gst/gst.h>
22
23namespace QGst {
24
25ClockPtr Clock::systemClock()
26{
27 return ClockPtr::wrap(gst_system_clock_obtain(), false);
28}
29
30ClockTime Clock::clockTime() const
31{
32 GstClockTime t = gst_clock_get_time(object<GstClock>());
33 return t;
34}
35
36ClockTime Clock::resolution() const
37{
38 GstClockTime t = gst_clock_get_resolution(object<GstClock>());
39 return t;
40}
41
42QTime Clock::time() const
43{
44 return clockTime().toTime();
45}
46
47}
static RefPointer< T > wrap(typename T::CType *nativePtr, bool increaseRef=true)
Definition refpointer.h:328
QTime toTime() const
Definition clocktime.cpp:25
Wrappers for GStreamer classes.