CTR Pia  4.11.3
Game Communication Engine
chat_types.h
1 /*---------------------------------------------------------------------------*
2  Project: Pia
3  File: chat_types.h
4 
5  Copyright Nintendo. All rights reserved.
6 
7  These coded instructions, statements, and computer programs contain
8  proprietary information of Nintendo of America Inc. and/or Nintendo
9  Company Ltd., and are protected by Federal copyright law. They may
10  not be disclosed to third parties or copied or duplicated in any form,
11  in whole or in part, without the prior written consent of Nintendo.
12  *---------------------------------------------------------------------------*/
13 
14 
15 #pragma once
16 
17 
18 namespace nn
19 {
20 namespace pia
21 {
22 namespace chat
23 {
24 
25 
26 /*!
27 @brief Enumerates audio codecs.
28 */
29 enum Codec
30 {
31  CODEC_8BIT_RAW, //!< Specifies 8-bit 8 kHz raw audio (unsupported).
32  CODEC_G711_ULAW, //!< Specifies G711 u-Law (unsupported).
33  CODEC_2BIT_ADPCM, //!< Specifies 2-bit IMA-ADPCM (non-standard format).
34  CODEC_3BIT_ADPCM, //!< Specifies 3-bit IMA-ADPCM (unsupported).
35  CODEC_4BIT_ADPCM, //!< Specifies 4-bit IMA-ADPCM.
36  CODEC_END
37 };
38 
39 /*!
40 @brief Enumerates the modes of echo cancellation.
41 */
42 #if NN_PIA_CTR
43 enum EcMode
44 {
45  EC_STANDARD, //!< Specifies standard echo cancellation.
46  EC_HIGHPERFORMANCE //!< Specifies advanced echo cancellation (only usable in debug mode).
47 };
48 #elif NN_PIA_CAFE
49 enum EcMode
50 {
51  EC_VOID = -1, //!< Indicates an invalid mode.
52  EC_PERFORMANCE, //!< A mode that prioritizes echo suppression. Sounds may become distorted, however.
53  EC_STANDARD, //!< An intermediate mode between <tt>EC_PERFORMANCE</tt> and <tt>EC_SOUNDQUALITY</tt>.
54  EC_SOUNDQUALITY, //!< A mode that emphasizes not distorting the sound and prioritizes sound quality. Echos may be slightly more frequent, however.
55 };
56 #endif
57 
58 
59 /*!
60 @brief Contains audio streaming information.
61 */
62 struct AudioInfo
63 {
64  Codec codec; /*!< Specifies the audio codec of the peer. */
65  u8 padding0_[3]; // Represents a reserved region.
66 
67  u32 sequence; /*!< Specifies the current audio packet sequence number. */
68 
69 #if NN_PIA_CAFE
70  OSTime bufferLatency; /*!< Specifies the jitter buffer latency. */
71  OSTime jitter; /*!< Specifies the maximum jitter buffer latency (in ticks). */
72  OSTime clockSkew; /*!< Specifies the clock skew (in ticks). */
73 #elif NN_PIA_CTR
74  nn::os::Tick bufferLatency; /*!< Specifies the jitter buffer latency. */
75  nn::os::Tick jitter; /*!< Specifies the maximum jitter buffer latency (in ticks). */
76  nn::os::Tick clockSkew; /*!< Specifies the clock skew (in ticks). */
77 #endif
78 
79  u32 internalLatency; /*!< Specifies the internal receive latency amount. */
80  u32 bufferCount; /*!< Specifies the number of packets in the jitter buffer. */
81  u32 dropCount; /*!< Specifies the number of packets that were dropped. */
82  u32 continuousDrop; /*!< Specifies the most recent number of consecutive dropped packets. */
83 
84  u32 jamCount; /*!< Specifies the number of packets that did not arrive in order. */
85  u32 duplicateCount; /*!< Specifies the number of duplicate packets. */
86  u32 waitCount; /*!< Specifies the number of times packet playback was deferred and drop recovery attempted. */
87  u32 lateCount; /*!< Specifies the number of packets that were late due to network congestion or another reason. */
88 
89  u32 recentLateCount; /*!< Specifies the number of packets that were late recently. */
90  u32 recentReceiveCount; /*!< Specifies the number of packets received recently. */
91  u32 recentLateRatio; /*!< Specifies the ratio of packets that were late recently (<tt>recentLateCount / recentReceiveCount</tt>). */
92  u32 recoverCount; /*!< Specifies the number of recovered packets. */
93 
94  u32 recoverUsingSpareCount; /*!< Specifies the number of packets that were recovered using spare packets. */
95  u32 padding1_; // Represents a reserved region.
96 };
97 }
98 }
99 }
u32 lateCount
Definition: chat_types.h:87
u32 jamCount
Definition: chat_types.h:84
Codec codec
Definition: chat_types.h:64
u32 recoverUsingSpareCount
Definition: chat_types.h:94
nn::os::Tick bufferLatency
Definition: chat_types.h:74
Definition: assert.h:115
Specifies 8-bit 8 kHz raw audio (unsupported).
Definition: chat_types.h:31
nn::os::Tick clockSkew
Definition: chat_types.h:76
u32 sequence
Definition: chat_types.h:67
u32 waitCount
Definition: chat_types.h:86
Specifies 3-bit IMA-ADPCM (unsupported).
Definition: chat_types.h:34
Specifies 4-bit IMA-ADPCM.
Definition: chat_types.h:35
u32 dropCount
Definition: chat_types.h:81
Specifies G711 u-Law (unsupported).
Definition: chat_types.h:32
u32 recentLateCount
Definition: chat_types.h:89
Specifies advanced echo cancellation (only usable in debug mode).
Definition: chat_types.h:46
u32 bufferCount
Definition: chat_types.h:80
Specifies standard echo cancellation.
Definition: chat_types.h:45
u32 continuousDrop
Definition: chat_types.h:82
u32 internalLatency
Definition: chat_types.h:79
EcMode
Enumerates the modes of echo cancellation.
Definition: chat_types.h:43
u32 recentLateRatio
Definition: chat_types.h:91
Contains audio streaming information.
Definition: chat_types.h:62
u32 recentReceiveCount
Definition: chat_types.h:90
u32 recoverCount
Definition: chat_types.h:92
nn::os::Tick jitter
Definition: chat_types.h:75
Specifies 2-bit IMA-ADPCM (non-standard format).
Definition: chat_types.h:33
Codec
Enumerates audio codecs.
Definition: chat_types.h:29
u32 duplicateCount
Definition: chat_types.h:85