Kodi Development 22.0
for Binary and Script based Add-Ons
 
Loading...
Searching...
No Matches
TimingConstants.h
1/*
2 * Copyright (C) 2005-2020 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
8
9#pragma once
10
11#include "../../c-api/addon-instance/inputstream/timing_constants.h"
12
13#ifdef __cplusplus
14
15// Unset the on timing_constants.h given defines
16#undef STREAM_TIME_TO_MSEC
17#undef STREAM_SEC_TO_TIME
18#undef STREAM_MSEC_TO_TIME
19
28constexpr int STREAM_TIME_TO_MSEC(double x)
29{
30 return static_cast<int>(x * 1000 / STREAM_TIME_BASE);
31}
32
41constexpr double STREAM_SEC_TO_TIME(double x)
42{
43 return x * STREAM_TIME_BASE;
44}
45
54constexpr double STREAM_MSEC_TO_TIME(double x)
55{
56 return x * STREAM_TIME_BASE / 1000;
57}
58
59#endif /* __cplusplus */
#define STREAM_TIME_BASE
Time base represented as integer.
Definition timing_constants.h:27