/usr/include/Qt5GStreamer/QGst/clocktime.h is in libqt5gstreamer-dev 1.2.0-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | /*
Copyright (C) 2011 Collabora Ltd. <info@collabora.co.uk>
@author George Kiagiadakis <george.kiagiadakis@collabora.co.uk>
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QGST_CLOCKTIME_H
#define QGST_CLOCKTIME_H
#include "global.h"
class QTime;
namespace QGst {
/*! \relates ClockTime
* A datatype to hold a time difference, measured in nanoseconds
*/
typedef qint64 ClockTimeDiff;
/*! \headerfile clocktime.h <QGst/ClockTime>
* \brief A datatype to hold a time, measured in nanoseconds
*
* This is a thin wrapper around a GstClockTime, which is actually a quint64.
*/
class QTGSTREAMER_EXPORT ClockTime
{
public:
/*! Represents an invalid time. \sa isValid() */
static const quint64 None = -1;
inline ClockTime(quint64 t = None) : m_clocktime(t) {}
inline operator quint64() const { return m_clocktime; }
/*! Returns true if this ClockTime is valid, i.e. it is not equal to ClockTime::None */
inline bool isValid() const { return m_clocktime != None; }
/*! This method allows you to convert this ClockTime to a QTime.
* Be careful, as the conversion will lose some precision. ClockTime
* holds nanoseconds, while QTime is only able to hold milliseconds.
*/
QTime toTime() const;
/*! Creates a ClockTime from a QTime */
static ClockTime fromTime(const QTime & time);
/*! Creates a ClockTime from seconds */
inline static ClockTime fromSeconds(quint64 seconds);
/*! Creates a ClockTime from milli seconds */
inline static ClockTime fromMSecs(quint64 msec);
/*! Creates a ClockTime from micro seconds */
inline static ClockTime fromUSecs(quint64 usec);
private:
quint64 m_clocktime;
};
inline ClockTime ClockTime::fromSeconds(quint64 seconds)
{
return ClockTime(seconds * 1000 * 1000 * 1000);
}
inline ClockTime ClockTime::fromMSecs(quint64 msec)
{
return ClockTime(msec * 1000 * 1000);
}
inline ClockTime ClockTime::fromUSecs(quint64 usec)
{
return ClockTime(usec * 1000);
}
} //namspace QGst
QGST_REGISTER_TYPE(QGst::ClockTime)
#endif // QGST_CLOCKTIME_H
|