Add zalsa configure flag, enabled by default if possible
[jack2.git] / android / AndroidShm.h
blobb868827a8d3c14c1dff074f46890d7f70df194c7
1 #ifndef ANDROIDSHM
2 #define ANDROIDSHM
4 #include <binder/Parcel.h>
5 #include "BnAndroidShm.h"
6 #include <utils/Log.h>
7 #include <binder/MemoryHeapBase.h>
8 #include "shm.h"
9 #include "android/Shm.h" //android extension of shm.h
11 namespace android {
13 class AndroidShm : public BnAndroidShm
15 #define MAX_SHARED_MEMORY_COUNT 257
16 private:
17 int MemAlloc(unsigned int size);
19 public:
20 virtual ~AndroidShm();
21 static int instantiate();
22 virtual int sendCommand(const char* command);
23 virtual int allocShm(const int size); // if negative return value is error
24 virtual int removeShm(const unsigned int index); // shared memory Á¦°Å
25 virtual int isAllocated(const unsigned int index); // allocated ¿©ºÎ È®ÀÎ
26 virtual int setRegistryIndex(const unsigned int index);
27 virtual int getRegistryIndex();
28 virtual sp<IMemoryHeap> InitSemaphore(const char* name);
29 virtual sp<IMemoryHeap> getBuffer(int index);
30 //virtual status_t onTransact(
31 // uint32_t code,
32 // const Parcel& data,
33 // Parcel* reply,
34 // uint32_t flags);
35 private:
36 int testGetBuffer();
37 int testGetBufferByNewProcess();
38 AndroidShm();
40 sp<MemoryHeapBase> mMemHeap[MAX_SHARED_MEMORY_COUNT];
41 unsigned int mRegistryIndex;
43 // for named semaphore simulation
44 #define MAX_SEMAPHORE_MEMORY_COUNT 300
45 #define MAX_SEMAPHORE_NAME_LENGTH 300
46 sp<MemoryHeapBase> mSemaphore[MAX_SEMAPHORE_MEMORY_COUNT];
47 char mSemaphoreName[MAX_SEMAPHORE_MEMORY_COUNT][MAX_SEMAPHORE_NAME_LENGTH];
51 #endif