sipxmedialib  Version 3.3
MpAndroidAudioTrack.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2010-2011 SIPez LLC.
3 // Licensed under the LGPL license.
4 //
5 // $$
7 
8 // Author: Dan Petrie <dpetrie AT SIPez DOT com>
9 
10 #ifndef _MpAndroidAudioTrack_h_
11 #define _MpAndroidAudioTrack_h_
12 
13 // SIPX INCLUDES
14 #include <os/OsStatus.h>
16 
17 // SYSTEM INCLUDES
18 
19 // DEFINES
20 // MACROS
21 // EXTERNAL FUNCTIONS
22 
24 
25 // EXTERNAL VARIABLES
26 // CONSTANTS
27 // STRUCTS
28 // TYPEDEFS
29 // FORWARD DECLARATIONS
30 
38 {
39 /* //////////////////////////// PUBLIC //////////////////////////////////// */
40 public:
41 
43  uint32_t sampleRate,
44  int format,
45  int channels,
46  int frameCount,
47  uint32_t flags,
48  sipXcallback_t cbf,
49  void* user,
50  int notificationFrames) const;
51 
52  enum event_type {
59  };
60 
61  class Buffer
62  {
63  public:
64  enum {
65  MUTE = 0x00000001
66  };
67  uint32_t flags;
69  int format;
70  size_t frameCount;
71  size_t size;
72  union {
73  void* raw;
74  short* i16;
75  int8_t* i8;
76  };
77  };
78 
79 /* ============================ CREATORS ================================== */
81 
82 
84  virtual ~MpAndroidAudioTrack();
85 
87 
88 /* ============================ MANIPULATORS ============================== */
90 
91  virtual void start();
92 
93  virtual void stop();
94 
96 
97 /* ============================ ACCESSORS ================================= */
99 
100 
101  virtual int /*status_t*/ initCheck() const;
102 
103  virtual uint32_t getSampleRate();
104 
105  virtual int frameSize() const;
106 
107  virtual uint32_t frameCount() const;
108 
109  virtual uint32_t latency() const;
110 
111  virtual void setVolume(float left, float right);
112 
113  virtual void dumpAudioTrack(const char* label);
114 
116 
117 /* ============================ INQUIRY =================================== */
119 
120 
122 
123 /* //////////////////////////// PROTECTED ///////////////////////////////// */
124 protected:
127 
128 /* //////////////////////////// PRIVATE /////////////////////////////////// */
129 private:
130 
132  MpAndroidAudioTrack(const MpAndroidAudioTrack& rMpAndroidAudioTrack);
133 
136 };
137 
138 /* ============================ INLINE METHODS ============================ */
139 
140 #endif // _MpAndroidAudioTrack_h_
MpAndroidAudioTrack & operator=(const MpAndroidAudioTrack &rhs)
Assignment operator (not implemented for this class)
event_type
Definition: MpAndroidAudioTrack.h:52
Audio input driver for Android OS.
Definition: MpAndroidAudioTrack.h:37
virtual void setVolume(float left, float right)
Definition: MpAndroidAudioTrack.cpp:89
Definition: MpAndroidAudioTrack.h:58
int channelCount
Definition: MpAndroidAudioTrack.h:68
Definition: MpAndroidAudioTrack.h:57
Definition: MpAndroidAudioTrack.h:54
MpAndroidAudioTrack()
Disallow default constructor.
Definition: MpAndroidAudioTrack.cpp:33
virtual void start()
Definition: MpAndroidAudioTrack.cpp:45
void * raw
Definition: MpAndroidAudioTrack.h:73
virtual uint32_t getSampleRate()
Definition: MpAndroidAudioTrack.cpp:65
Definition: MpAndroidAudioTrack.h:61
virtual ~MpAndroidAudioTrack()
Destructor.
Definition: MpAndroidAudioTrack.cpp:38
short * i16
Definition: MpAndroidAudioTrack.h:74
void(* sipXcallback_t)(int event, void *user, void *info)
Definition: MpAndroidAudioBindingInterface.h:32
Definition: MpAndroidAudioTrack.h:65
virtual void dumpAudioTrack(const char *label)
Definition: MpAndroidAudioTrack.cpp:94
Definition: MpAndroidAudioTrack.h:56
virtual uint32_t latency() const
Definition: MpAndroidAudioTrack.cpp:83
virtual int initCheck() const
Definition: MpAndroidAudioTrack.cpp:57
virtual uint32_t frameCount() const
Definition: MpAndroidAudioTrack.cpp:77
size_t frameCount
Definition: MpAndroidAudioTrack.h:70
size_t size
Definition: MpAndroidAudioTrack.h:71
Definition: MpAndroidAudioTrack.h:55
int8_t * i8
Definition: MpAndroidAudioTrack.h:75
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
virtual void stop()
Definition: MpAndroidAudioTrack.cpp:50
int format
Definition: MpAndroidAudioTrack.h:69
virtual int frameSize() const
Definition: MpAndroidAudioTrack.cpp:71
uint32_t flags
Definition: MpAndroidAudioTrack.h:67
Definition: MpAndroidAudioTrack.h:53