sipxmedialib  Version 3.3
MpAndroidAudioBindingInterface.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2010-2013 SIPez LLC. All rights reserved.
3 //
4 // $$
6 
7 // Author: Dan Petrie <dpetrie AT SIPez DOT com>
8 
9 #ifndef _MpAndroidAudioBindingInterface_h_
10 #define _MpAndroidAudioBindingInterface_h_
11 
12 // SIPX INCLUDES
13 #include <os/OsStatus.h>
14 
15 // SYSTEM INCLUDES
16 
17 // DEFINES
18 #define CREATE_ANDROID_AUDIO_BINDING_SYMBOL createAndroidAudioBinding
19 #define CREATE_ANDROID_AUDIO_BINDING_SYMBOL_STRING "createAndroidAudioBinding"
20 
21 // MACROS
22 // EXTERNAL FUNCTIONS
23 
25 
27 
28 // EXTERNAL VARIABLES
29 // CONSTANTS
30 // STRUCTS
31 // TYPEDEFS
32 typedef void (*sipXcallback_t)(int event, void* user, void *info);
33 
34 // FORWARD DECLARATIONS
35 class UtlString;
38 
46 {
47 /* //////////////////////////// PUBLIC //////////////////////////////////// */
48 public:
49  // Look at AudioSystem.h in Android sources for description.
51  {
52  DEFAULT =-1,
54  SYSTEM = 1,
55  RING = 2,
56  MUSIC = 3,
57  ALARM = 4,
60  ENFORCED_AUDIBLE = 7, // Sounds that cannot be muted by user and must be routed to speaker
61  DTMF = 8,
62  TTS = 9,
64  };
65 
66  typedef MpAndroidAudioBindingInterface* (*MpAndroidAudioBindingInterfaceCreator) ();
67 
69 
71 
72  //static OsStatus setAudioTrackCreator();
73 
74 /* ============================ CREATORS ================================== */
76 
77 
80 
82 
83 /* ============================ MANIPULATORS ============================== */
85 
87 
88 /* ============================ ACCESSORS ================================= */
90 
91 
93  OsStatus getStatus() const;
94 
95  static OsStatus getVersionSpecificLibraryName(UtlString& sharedLibraryName);
96 
98  virtual MpAndroidAudioTrack* createAudioTrack(int streamType,
99  uint32_t sampleRate,
100  int format,
101  int channels,
102  int frameCount,
103  uint32_t flags,
104  sipXcallback_t cbf,
105  void* user,
106  int notificationFrames) const;
107 
109  virtual MpAndroidAudioRecord* createAudioRecord() const;
110 
112  virtual int getOutputLatency(uint32_t& outputLatency, StreamType streamType) const;
113 
115 
116 /* ============================ INQUIRY =================================== */
118 
119 
121 
122 /* //////////////////////////// PROTECTED ///////////////////////////////// */
123 protected:
125 
128 
129  OsStatus mStatus;
130 
131 /* //////////////////////////// PRIVATE /////////////////////////////////// */
132 private:
133 
135  MpAndroidAudioBindingInterface(const MpAndroidAudioBindingInterface& rMpAndroidAudioBindingInterface);
136 
139 };
140 
141 /* ============================ INLINE METHODS ============================ */
142 
143 #endif // _MpAndroidAudioBindingInterface_h_
Definition: MpAndroidAudioBindingInterface.h:54
Audio input driver for Android OS.
Definition: MpAndroidAudioTrack.h:37
static MpAndroidAudioBindingInterface * spMpAndroidAudioBindingInterface
Definition: MpAndroidAudioBindingInterface.h:124
static MpAndroidAudioBindingInterfaceCreator spGetAndroidAudioBinding
Definition: MpAndroidAudioBindingInterface.h:70
Definition: MpAndroidAudioBindingInterface.h:57
OsStatus getStatus() const
Get the status of the construction and loading of the Android OS version specific libs...
Definition: MpAndroidAudioBindingInterface.cpp:148
MpAndroidAudioBindingInterface *(* MpAndroidAudioBindingInterfaceCreator)()
Definition: MpAndroidAudioBindingInterface.h:66
friend MpAndroidAudioBindingInterface * stubGetAndroidAudioBindingInterface()
Definition: MpAndroidAudioBindingInterface.cpp:39
Definition: MpAndroidAudioBindingInterface.h:62
Definition: MpAndroidAudioBindingInterface.h:59
MpAndroidAudioBindingInterface & operator=(const MpAndroidAudioBindingInterface &rhs)
Assignment operator (not implemented for this class)
Definition: MpAndroidAudioBindingInterface.h:55
Definition: MpAndroidAudioBindingInterface.h:61
int frameCount
Definition: dmaTaskWnt.cpp:61
OsStatus mStatus
Definition: MpAndroidAudioBindingInterface.h:129
Definition: MpAndroidAudioBindingInterface.h:52
StreamType
Definition: MpAndroidAudioBindingInterface.h:50
Definition: MpAndroidAudioBindingInterface.h:58
Definition: MpAndroidAudioBindingInterface.h:63
virtual int getOutputLatency(uint32_t &outputLatency, StreamType streamType) const
Abstract/stub method to get Android OS version specific implementation to get output latency...
Definition: MpAndroidAudioBindingInterface.cpp:153
void(* sipXcallback_t)(int event, void *user, void *info)
Definition: MpAndroidAudioBindingInterface.h:32
static OsStatus getVersionSpecificLibraryName(UtlString &sharedLibraryName)
Definition: MpAndroidAudioBindingInterface.cpp:97
MpAndroidAudioBindingInterface * stubAndroidAudioBindingInterfaceCreator()
MpAndroidAudioBindingInterface()
Disallow default constructor.
Definition: MpAndroidAudioBindingInterface.cpp:83
Definition: MpAndroidAudioBindingInterface.h:56
virtual ~MpAndroidAudioBindingInterface()
Destructor.
Definition: MpAndroidAudioBindingInterface.cpp:89
Definition: MpAndroidAudioBindingInterface.h:53
virtual MpAndroidAudioTrack * createAudioTrack(int streamType, uint32_t sampleRate, int format, int channels, int frameCount, uint32_t flags, sipXcallback_t cbf, void *user, int notificationFrames) const
Abstract/stub method to get Android OS version specific implementation of AudioTrack.
Definition: MpAndroidAudioBindingInterface.cpp:128
Definition: MpAndroidAudioBindingInterface.h:60
Audio input driver for Android OS.
Definition: MpAndroidAudioRecord.h:34
virtual MpAndroidAudioRecord * createAudioRecord() const
Abstract/stub method to get Android OS version specific implementation of AudioRecord.
Definition: MpAndroidAudioBindingInterface.cpp:141
Audio wrapper interface driver for Android OS version spesific differences.
Definition: MpAndroidAudioBindingInterface.h:45