summaryrefslogtreecommitdiffstats
path: root/include/ndk
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2014-05-07 12:55:18 -0700
committerMarco Nelissen <marcone@google.com>2014-05-07 12:55:18 -0700
commit34d497283c66b5ef0f8855c007eaa20d7ac8b96d (patch)
tree5f3cc71c9454f4081dd82eb9d42f47261ae11bc1 /include/ndk
parent08aaabe87960c04ecac180db1fe88b5a7bc2ed3b (diff)
downloadframeworks_av-34d497283c66b5ef0f8855c007eaa20d7ac8b96d.zip
frameworks_av-34d497283c66b5ef0f8855c007eaa20d7ac8b96d.tar.gz
frameworks_av-34d497283c66b5ef0f8855c007eaa20d7ac8b96d.tar.bz2
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
Diffstat (limited to 'include/ndk')
-rw-r--r--include/ndk/NdkMediaFormat.h22
1 files changed, 20 insertions, 2 deletions
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?
*/