Stub some stuff

This commit is contained in:
Nikita Travkin
2022-11-02 16:40:15 +05:00
committed by Mis012
parent 6a1d2f4ed4
commit c7fcb0f84e
11 changed files with 809 additions and 17 deletions

View File

@@ -1,3 +1,5 @@
#define _LARGEFILE64_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <stdint.h>
@@ -90,6 +92,14 @@ struct AAssetManager * AAssetManager_fromJava(JNIEnv *env, jobject assetManager)
return NULL;
}
int AAsset_read(struct AAsset *asset, void *buf, size_t count) {
return read(asset->fd, buf, count);
}
off64_t AAsset_seek64(struct AAsset *asset, off64_t offset, int whence) {
return lseek64(asset->fd, offset, whence);
}
void AAsset_close(struct AAsset *asset)
{
int fd = asset->fd;

View File

@@ -0,0 +1,23 @@
typedef void AConfiguration;
typedef void AAssetManager;
void AConfiguration_getCountry(AConfiguration* config, char* outCountry) {
/* Assume not set. */
outCountry[0] = 0;
outCountry[1] = 0;
}
void AConfiguration_getLanguage(AConfiguration* config, char* outLanguage) {
/* Assume not set. */
outLanguage[0] = 0;
outLanguage[1] = 0;
}
void AConfiguration_delete(AConfiguration *config) {}
void * AConfiguration_new(void) { return 0; }
void AConfiguration_fromAssetManager(AConfiguration *out, AAssetManager *am)
{
}

View File

@@ -68,41 +68,71 @@ typedef enum {
struct AMediaFormat;
typedef struct AMediaFormat AMediaFormat;
AMediaFormat *AMediaFormat_new();
media_status_t AMediaFormat_delete(AMediaFormat*);
AMediaFormat *AMediaFormat_new()
{
return NULL;
}
media_status_t AMediaFormat_delete(AMediaFormat*)
{
return AMEDIA_ERROR_UNKNOWN;
}
/**
* Human readable representation of the format. The returned string is owned by the format,
* and remains valid until the next call to toString, or until the format is deleted.
*/
const char* AMediaFormat_toString(AMediaFormat*);
const char* AMediaFormat_toString(AMediaFormat*)
{
return NULL;
}
bool AMediaFormat_getInt32(AMediaFormat*, const char *name, int32_t *out)
{
return false;
}
bool AMediaFormat_getInt64(AMediaFormat*, const char *name, int64_t *out)
{
return false;
}
bool AMediaFormat_getFloat(AMediaFormat*, const char *name, float *out)
{
return false;
}
bool AMediaFormat_getInt32(AMediaFormat*, const char *name, int32_t *out);
bool AMediaFormat_getInt64(AMediaFormat*, const char *name, int64_t *out);
bool AMediaFormat_getFloat(AMediaFormat*, const char *name, float *out);
/**
* The returned data is owned by the format and remains valid as long as the named entry
* is part of the format.
*/
bool AMediaFormat_getBuffer(AMediaFormat*, const char *name, void** data, size_t *size);
bool AMediaFormat_getBuffer(AMediaFormat*, const char *name, void** data, size_t *size)
{
return false;
}
/**
* The returned string is owned by the format, and remains valid until the next call to getString,
* or until the format is deleted.
*/
bool AMediaFormat_getString(AMediaFormat*, const char *name, const char **out);
bool AMediaFormat_getString(AMediaFormat*, const char *name, const char **out)
{
return false;
}
void AMediaFormat_setInt32(AMediaFormat*, const char* name, int32_t value);
void AMediaFormat_setInt64(AMediaFormat*, const char* name, int64_t value);
void AMediaFormat_setFloat(AMediaFormat*, const char* name, float value);
void AMediaFormat_setInt32(AMediaFormat*, const char* name, int32_t value) {}
void AMediaFormat_setInt64(AMediaFormat*, const char* name, int64_t value) {}
void AMediaFormat_setFloat(AMediaFormat*, const char* name, float value) {}
/**
* The provided string is copied into the format.
*/
void AMediaFormat_setString(AMediaFormat*, const char* name, const char* value);
void AMediaFormat_setString(AMediaFormat*, const char* name, const char* value) {}
/**
* The provided data is copied into the format.
*/
void AMediaFormat_setBuffer(AMediaFormat*, const char* name, void* data, size_t size);
void AMediaFormat_setBuffer(AMediaFormat*, const char* name, void* data, size_t size) {}