From 34d497283c66b5ef0f8855c007eaa20d7ac8b96d Mon Sep 17 00:00:00 2001 From: Marco Nelissen Date: Wed, 7 May 2014 12:55:18 -0700 Subject: Expand AMediaFormat Remove getDouble and getSize methods, since these are not used and/or not present in the corresponding Java MediaFormat API. Add setBuffer/getBuffer, needed for making formats for encoding, and add other setters. Change-Id: I528d51b4ed571d852b949637f7ae3a95d31da7c1 --- include/ndk/NdkMediaFormat.h | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/ndk/NdkMediaFormat.h b/include/ndk/NdkMediaFormat.h index 4489b78..e0caeab 100644 --- a/include/ndk/NdkMediaFormat.h +++ b/include/ndk/NdkMediaFormat.h @@ -48,14 +48,32 @@ const char* AMediaFormat_toString(AMediaFormat*); 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); -bool AMediaFormat_getDouble(AMediaFormat*, const char *name, double *out); -bool AMediaFormat_getSize(AMediaFormat*, const char *name, size_t *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); /** * 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); + +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); +/** + * The provided data is copied into the format. + */ +void AMediaFormat_setBuffer(AMediaFormat*, const char* name, void* data, size_t size); + + + /** * XXX should these be ints/enums that we look up in a table as needed? */ -- cgit v1.1