Qt(dialog provider): fix utf8 issue with generic dialog box title
[vlc.git] / src / video_output / statistic.h
blob083b0d7aa74f1c8c5cf0dba1c67c5d6febb272db
1 /*****************************************************************************
2 * statistic.h : vout statistic
3 *****************************************************************************
4 * Copyright (C) 2009 Laurent Aimar
5 * $Id$
7 * Authors: Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation; either version 2.1 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #ifndef LIBVLC_VOUT_STATISTIC_H
25 # define LIBVLC_VOUT_STATISTIC_H
26 # include <vlc_atomic.h>
28 /* NOTE: Both statistics are atomic on their own, so one might be older than
29 * the other one. Currently, only one of them is updated at a time, so this
30 * is a non-issue. */
31 typedef struct {
32 atomic_uint displayed;
33 atomic_uint lost;
34 } vout_statistic_t;
36 static inline void vout_statistic_Init(vout_statistic_t *stat)
38 atomic_init(&stat->displayed, 0);
39 atomic_init(&stat->lost, 0);
42 static inline void vout_statistic_Clean(vout_statistic_t *stat)
44 (void) stat;
47 static inline void vout_statistic_GetReset(vout_statistic_t *stat, int *displayed, int *lost)
49 *displayed = atomic_exchange(&stat->displayed, 0);
50 *lost = atomic_exchange(&stat->lost, 0);
53 static inline void vout_statistic_AddDisplayed(vout_statistic_t *stat,
54 int displayed)
56 atomic_fetch_add(&stat->displayed, displayed);
59 static inline void vout_statistic_AddLost(vout_statistic_t *stat, int lost)
61 atomic_fetch_add(&stat->lost, lost);
64 #endif