sipxmedialib  Version 3.3
MpAndroidAudioRecord.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 _MpAndroidAudioRecord_h_
10 #define _MpAndroidAudioRecord_h_
11 
12 // SIPX INCLUDES
13 #include <os/OsStatus.h>
15 
16 // SYSTEM INCLUDES
17 
18 // DEFINES
19 // MACROS
20 // EXTERNAL FUNCTIONS
21 
22 // EXTERNAL VARIABLES
23 // CONSTANTS
24 // STRUCTS
25 // TYPEDEFS
26 // FORWARD DECLARATIONS
27 
35 {
36 /* //////////////////////////// PUBLIC //////////////////////////////////// */
37 public:
38 
39  static const int DEFAULT_SAMPLE_RATE = 8000;
40 
42 
43  enum event_type {
48  };
49 
50  class Buffer
51  {
52  public:
53  enum {
54  MUTE = 0x00000001
55  };
56  uint32_t flags;
58  int format;
59  size_t frameCount;
60  size_t size;
61  union {
62  void* raw;
63  short* i16;
64  int8_t* i8;
65  };
66  };
67 
68 /* ============================ CREATORS ================================== */
70 
71 
72 protected:
75 
76 public:
78  virtual ~MpAndroidAudioRecord();
79 
81 
82 /* ============================ MANIPULATORS ============================== */
84 
85  virtual int /*status_t*/ start();
86 
87  virtual void stop();
88 
89  virtual int /*status_t*/ set(int inputSource,
90  int sampleRate,
91  sipXcallback_t audioCallback,
92  void* user,
93  int notificationFrames);
94 
96 
97 /* ============================ ACCESSORS ================================= */
99 
100 
102 
103 /* ============================ INQUIRY =================================== */
105 
106 
108 
109 /* //////////////////////////// PROTECTED ///////////////////////////////// */
110 protected:
111 
112 /* //////////////////////////// PRIVATE /////////////////////////////////// */
113 private:
114 
116  MpAndroidAudioRecord(const MpAndroidAudioRecord& rMpAndroidAudioRecord);
117 
120 };
121 
122 /* ============================ INLINE METHODS ============================ */
123 
124 #endif // _MpAndroidAudioRecord_h_
virtual int start()
Definition: MpAndroidAudioRecord.cpp:40
size_t size
Definition: MpAndroidAudioRecord.h:60
void * raw
Definition: MpAndroidAudioRecord.h:62
Definition: MpAndroidAudioRecord.h:44
Definition: MpAndroidAudioRecord.h:54
Definition: MpAndroidAudioRecord.h:46
int channelCount
Definition: MpAndroidAudioRecord.h:57
virtual ~MpAndroidAudioRecord()
Destructor.
Definition: MpAndroidAudioRecord.cpp:33
Definition: MpAndroidAudioRecord.h:45
Definition: MpAndroidAudioRecord.h:47
event_type
Definition: MpAndroidAudioRecord.h:43
void(* sipXcallback_t)(int event, void *user, void *info)
Definition: MpAndroidAudioBindingInterface.h:32
static const int DEFAULT_SAMPLE_RATE
Definition: MpAndroidAudioRecord.h:39
int format
Definition: MpAndroidAudioRecord.h:58
virtual void stop()
Definition: MpAndroidAudioRecord.cpp:46
uint32_t flags
Definition: MpAndroidAudioRecord.h:56
short * i16
Definition: MpAndroidAudioRecord.h:63
size_t frameCount
Definition: MpAndroidAudioRecord.h:59
MpAndroidAudioRecord()
Disallow direct invocation of constructor, must use factory method.
Definition: MpAndroidAudioRecord.cpp:28
int8_t * i8
Definition: MpAndroidAudioRecord.h:64
Definition: MpAndroidAudioRecord.h:50
MpAndroidAudioRecord & operator=(const MpAndroidAudioRecord &rhs)
Assignment operator (not implemented for this class)
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