Go to the documentation of this file.00001 #if !defined(libstagefright_foundation) && ANDROID_VER>=400
00002 #define libstagefright_foundation
00003
00004 #include "libutils.h"
00005
00006 namespace android {
00007
00008 struct ALooper : public RefBase {
00009 typedef int32_t handler_id;
00010 ALooper();
00011 status_t start(bool runOnCallingThread = false, bool canCallJava = false, int32_t priority = 0);
00012 void setName(const char *name);
00013 static int64_t GetNowUs();
00014 protected:
00015 virtual ~ALooper();
00016 private:
00017 char __data[sizeof(void*)*64];
00018
00019
00020
00021
00022
00023
00024
00025
00026 };
00027
00028 struct AMessage : public RefBase {
00029 AMessage(uint32_t what = 0, ALooper::handler_id target = 0);
00030 void setInt32(const char *name, int32_t value);
00031 void setFloat(const char *name, float value);
00032 #if (ANDROID_VER>=440)
00033 void setString(const char *name, const char *s, int len = -1);
00034 #else
00035 void setString(const char *name, const char *s, long len = -1);
00036 #endif
00037 protected:
00038 virtual ~AMessage();
00039 private:
00040 char __data[sizeof(void*)*512];
00041
00042
00043
00044
00045
00046
00047 };
00048
00049 struct AHandler : public RefBase {
00050 AHandler() : mID(0) {}
00051 sp<ALooper> looper();
00052 protected:
00053 virtual void onMessageReceived(const sp<AMessage> &msg) = 0;
00054 private:
00055 ALooper::handler_id mID;
00056 };
00057
00058 struct ABuffer : public RefBase {
00059 ABuffer(size_t capacity);
00060 ABuffer(void *data, size_t capacity);
00061 protected:
00062 virtual ~ABuffer();
00063 private:
00064 char __data[sizeof(void*)*64];
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075 };
00076
00077 }
00078
00079 #endif //end of lib