forked from aromadev/libaroma
-
Notifications
You must be signed in to change notification settings - Fork 0
Resource API
Ever-Never edited this page Jul 9, 2018
·
3 revisions
Resource API 主要是从哪里拿到存的数据,在Android 支持多种形式,在MT2523支持两种形式,从内存或者从文件读.android 可以从zip 或者匿名共享内存读取.
/* stream URI max length */
#define LIBAROMA_STREAM_URI_LENGTH 0xff
/*
* Structure : _LIBAROMA_STREAM
* Typedef : LIBAROMA_STREAM, * LIBAROMA_STREAMP
* Descriptions: stream structure
*/
typedef struct _LIBAROMA_STREAM LIBAROMA_STREAM;
typedef struct _LIBAROMA_STREAM * LIBAROMA_STREAMP;
struct _LIBAROMA_STREAM{
bytep data;
int size;
byte ismmap;
byte ismem;
char uri[LIBAROMA_STREAM_URI_LENGTH];
};成员说明
| 成员 | 说明 |
|---|---|
| data | 资源数据 |
| size | 资源的大小 |
| ismmap | 是否为map后的资源(现阶段没用) |
| ismem | 是否为内存数据(不能释放的数据,比如全局数组) |
| uri | 字符窜统一资源定位 |
LIBAROMA_STREAMP libaroma_stream_file(
char * path) ;/*
* Function : libaroma_stream_mem
* Return Value: LIBAROMA_STREAMP
* Descriptions: new stream from memory range
*/
LIBAROMA_STREAMP libaroma_stream_mem(
bytep mem, int mem_sz)参数类型
| 参数 | 说明 |
|---|---|
| mem | 内存首地址 |
| mem_sz | 内存区域的大小 |
LIBAROMA_STREAMP libaroma_stream(
char * uri)参数说明
| 参数 | 说明 |
|---|---|
| uri | 统一资源定位符 |
支持的协议
file://
shmem://
zip://
mem://
/*
* Function : libaroma_stream_close
* Return Value: byte
* Descriptions: close stream
*/
byte libaroma_stream_close(
LIBAROMA_STREAMP a)