Overte C++ Documentation
AudioStreamStats.h
1 //
2 // AudioStreamStats.h
3 // libraries/audio/src
4 //
5 // Created by Yixin Wang on 6/25/2014
6 // Copyright 2014 High Fidelity, Inc.
7 //
8 // Distributed under the Apache License, Version 2.0.
9 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
10 //
11 
12 #ifndef hifi_AudioStreamStats_h
13 #define hifi_AudioStreamStats_h
14 
15 #include "SequenceNumberStats.h"
16 
17 class AudioStreamStats {
18 public:
19  // Intermediate packets should have no flag set
20  // Unique packets should have both flags set
21  enum AppendFlag : quint8 {
22  START = 1,
23  END = 2
24  };
25 
26  AudioStreamStats()
27  : _streamType(-1),
28  _streamIdentifier(),
29  _timeGapMin(0),
30  _timeGapMax(0),
31  _timeGapAverage(0.0f),
32  _timeGapWindowMin(0),
33  _timeGapWindowMax(0),
34  _timeGapWindowAverage(0.0f),
35  _framesAvailable(0),
36  _framesAvailableAverage(0),
37  _desiredJitterBufferFrames(0),
38  _starveCount(0),
39  _consecutiveNotMixedCount(0),
40  _overflowCount(0),
41  _framesDropped(0),
42  _packetStreamStats(),
43  _packetStreamWindowStats()
44  {}
45 
46  qint32 _streamType;
47  QUuid _streamIdentifier;
48 
49  quint64 _timeGapMin;
50  quint64 _timeGapMax;
51  float _timeGapAverage;
52  quint64 _timeGapWindowMin;
53  quint64 _timeGapWindowMax;
54  float _timeGapWindowAverage;
55 
56  quint32 _framesAvailable;
57  quint16 _framesAvailableAverage;
58  quint16 _unplayedMs;
59  quint16 _desiredJitterBufferFrames;
60  quint32 _starveCount;
61  quint32 _consecutiveNotMixedCount;
62  quint32 _overflowCount;
63  quint32 _framesDropped;
64 
65  PacketStreamStats _packetStreamStats;
66  PacketStreamStats _packetStreamWindowStats;
67 };
68 
69 static_assert(sizeof(AudioStreamStats) == 152, "AudioStreamStats size isn't right");
70 
71 #endif // hifi_AudioStreamStats_h