sipxmedialib  Version 3.3
MpTypes.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2006 SIPez LLC.
3 // Licensed to SIPfoundry under a Contributor Agreement.
4 //
5 // Copyright (C) 2004-2006 SIPfoundry Inc.
6 // Licensed by SIPfoundry under the LGPL license.
7 //
8 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
9 // Licensed to SIPfoundry under a Contributor Agreement.
10 //
11 // $$
13 
14 
15 #ifndef _INCLUDED_MPTYPES_H /* [ */
16 #define _INCLUDED_MPTYPES_H
17 
18 #include <utl/UtlDefs.h>
19 #include <os/OsIntTypes.h>
20 
21 /**************************************************************************/
22 /* One of these should be defined, and the other should undefined!!!!! */
23 /* These are used to determine whether 16 bit samples need to be byte */
24 /* swapped. All hosts (SA1100 and WinTel) are currently little endian */
25 #ifdef _VXWORKS /* [ */
26 #undef _BYTE_ORDER_IS_LITTLE_ENDIAN
27 #undef _BYTE_ORDER_IS_BIG_ENDIAN
28 #define _BYTE_ORDER_IS_LITTLE_ENDIAN
29 #else /* _VXWORKS ] [ */
30 #undef _BYTE_ORDER_IS_LITTLE_ENDIAN
31 #undef _BYTE_ORDER_IS_BIG_ENDIAN
32 #define _BYTE_ORDER_IS_LITTLE_ENDIAN
33 #endif /* _VXWORKS ] */
34 /*/////////////////////////////////////////////////////////////////////// */
35 
36 #ifdef _VXWORKS /* [ */
37 #include "vxWorks.h"
38 #else /* _VXWORKS ] [ */
39 typedef int STATUS;
40 typedef void * MSG_Q_ID;
41 typedef void * SEM_ID;
42 #endif /* _VXWORKS ] */
43 
44 typedef int16_t MpAudioSample;
45 #define MP_AUDIO_SAMPLE_SIZE 16
47 
48 typedef int MpInputDeviceHandle;
49 typedef int MpOutputDeviceHandle;
51 #define MP_INVALID_OUTPUT_DEVICE_HANDLE -1
53 typedef uint32_t MpFrameTime;
54 
56 typedef int MpConnectionID;
57 #define MP_INVALID_CONNECTION_ID -1
58 
59 typedef uint16_t RtpSeq;
60 typedef uint32_t RtpTimestamp;
61 typedef uint32_t RtpSRC;
62 
63 
65 typedef enum {
72 } MpSpeechType;
73 
75 {
76 #ifdef __cplusplus
77  typedef enum {
78  MAX_AMPLITUDE = INT16_MAX
79  } MpSpeechParamsConsts;
80 
85  , mIsClipped(FALSE)
86  , mFrameEnergy(-1)
87  , mSpeakerRank(0)
88  , mSpeakerWeight(0)
89  {
90  };
91 #else
92 # define MAX_AMPLITUDE INT16_MAX
93 #endif
94 
97  UtlBoolean mIsClipped;
99  unsigned mSpeakerRank;
101  double mSpeakerWeight;
103 };
105 
106 /* ============================== FUNCTIONS ============================== */
107 
109 static inline
110 UtlBoolean isActiveAudio(MpSpeechType speechType);
111 
114 
115 /* =========================== INLINE FUNCTIONS =========================== */
116 
117 UtlBoolean isActiveAudio(MpSpeechType speechType)
118 {
119  switch (speechType) {
120  case MP_SPEECH_SILENT:
122  case MP_SPEECH_MUTED:
123  return FALSE;
124  case MP_SPEECH_UNKNOWN:
125  case MP_SPEECH_ACTIVE:
126  case MP_SPEECH_TONE:
127  default:
128  return TRUE;
129  };
130 }
131 
132 #endif /* _INCLUDED_MPTYPES_H ] */
MpAudioSample mAmplitude
Amplitude of the audio data in this buffer.
Definition: MpTypes.h:96
MpSpeechType mSpeechType
Whether buffer contains speech.
Definition: MpTypes.h:95
void * SEM_ID
Definition: MpTypes.h:41
Definition: MpTypes.h:74
uint32_t MpFrameTime
Definition: MpTypes.h:53
#define MAX_AMPLITUDE
Maximum possible amplitude.
Definition: MpTypes.h:92
found to contain no speech
Definition: MpTypes.h:67
double mSpeakerWeight
Definition: MpTypes.h:102
int16_t MpAudioSample
Definition: MpTypes.h:44
uint32_t RtpTimestamp
RTP timestamp.
Definition: MpTypes.h:60
is yet undetermined
Definition: MpTypes.h:66
found to contain speech
Definition: MpTypes.h:69
MpSpeechType
Type of audio data.
Definition: MpTypes.h:65
int mFrameEnergy
Definition: MpTypes.h:98
int MpOutputDeviceHandle
Definition: MpTypes.h:50
uint16_t RtpSeq
RTP sequence number.
Definition: MpTypes.h:59
int STATUS
Definition: MpTypes.h:39
void * MSG_Q_ID
Definition: MpTypes.h:40
unsigned mSpeakerRank
Definition: MpTypes.h:100
UtlBoolean mIsClipped
Is data in this buffer clipped or not?
Definition: MpTypes.h:97
MpSpeechType mixSpeechTypes(MpSpeechType src1, MpSpeechType src2)
Determine type of speech after mixing two frames of given type.
Definition: MpTypes.cpp:20
int MpInputDeviceHandle
Definition: MpTypes.h:48
int MpConnectionID
Flowgraph connection ID.
Definition: MpTypes.h:56
uint32_t RtpSRC
RTP SSRC or CSRC identifier.
Definition: MpTypes.h:61
may contain speech, but must be muted
Definition: MpTypes.h:70
filled with active (not silent) tone data
Definition: MpTypes.h:71
#define TRUE
Definition: PlgDefsV1.h:41
#define FALSE
Definition: PlgDefsV1.h:37
to be replaced by comfort noise
Definition: MpTypes.h:68