Add const to the finders method in MetaData.cpp
o also fixed the MPEG4Writer writeFtypBox() to take a const pointer to MetaData
Change-Id: Iaecdbe6aeab345f6dc72aac0d19f9704b6e0d28a
diff --git a/include/media/stagefright/MPEG4Writer.h b/include/media/stagefright/MPEG4Writer.h
index 64f3560..57624e9 100644
--- a/include/media/stagefright/MPEG4Writer.h
+++ b/include/media/stagefright/MPEG4Writer.h
@@ -161,7 +161,7 @@
void writeCompositionMatrix(int32_t degrees);
void writeMvhdBox(int64_t durationUs);
void writeMoovBox(int64_t durationUs);
- void writeFtypBox(MetaData *param);
+ void writeFtypBox(const MetaData *param);
MPEG4Writer(const MPEG4Writer &);
MPEG4Writer &operator=(const MPEG4Writer &);
diff --git a/include/media/stagefright/MetaData.h b/include/media/stagefright/MetaData.h
index 4044c5d..a300f0e 100644
--- a/include/media/stagefright/MetaData.h
+++ b/include/media/stagefright/MetaData.h
@@ -154,16 +154,16 @@
int32_t left, int32_t top,
int32_t right, int32_t bottom);
- bool findCString(uint32_t key, const char **value);
- bool findInt32(uint32_t key, int32_t *value);
- bool findInt64(uint32_t key, int64_t *value);
- bool findFloat(uint32_t key, float *value);
- bool findPointer(uint32_t key, void **value);
+ bool findCString(uint32_t key, const char **value) const;
+ bool findInt32(uint32_t key, int32_t *value) const;
+ bool findInt64(uint32_t key, int64_t *value) const;
+ bool findFloat(uint32_t key, float *value) const;
+ bool findPointer(uint32_t key, void **value) const;
bool findRect(
uint32_t key,
int32_t *left, int32_t *top,
- int32_t *right, int32_t *bottom);
+ int32_t *right, int32_t *bottom) const;
bool setData(uint32_t key, uint32_t type, const void *data, size_t size);
diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp
index e3c7eb9..9ed08a3 100644
--- a/media/libstagefright/MPEG4Writer.cpp
+++ b/media/libstagefright/MPEG4Writer.cpp
@@ -727,7 +727,7 @@
endBox(); // moov
}
-void MPEG4Writer::writeFtypBox(MetaData *param) {
+void MPEG4Writer::writeFtypBox(const MetaData *param) {
beginBox("ftyp");
int32_t fileType;
diff --git a/media/libstagefright/MetaData.cpp b/media/libstagefright/MetaData.cpp
index 884f3b4..aac94a6 100644
--- a/media/libstagefright/MetaData.cpp
+++ b/media/libstagefright/MetaData.cpp
@@ -83,7 +83,7 @@
return setData(key, TYPE_RECT, &r, sizeof(r));
}
-bool MetaData::findCString(uint32_t key, const char **value) {
+bool MetaData::findCString(uint32_t key, const char **value) const {
uint32_t type;
const void *data;
size_t size;
@@ -96,7 +96,7 @@
return true;
}
-bool MetaData::findInt32(uint32_t key, int32_t *value) {
+bool MetaData::findInt32(uint32_t key, int32_t *value) const {
uint32_t type;
const void *data;
size_t size;
@@ -111,7 +111,7 @@
return true;
}
-bool MetaData::findInt64(uint32_t key, int64_t *value) {
+bool MetaData::findInt64(uint32_t key, int64_t *value) const {
uint32_t type;
const void *data;
size_t size;
@@ -126,7 +126,7 @@
return true;
}
-bool MetaData::findFloat(uint32_t key, float *value) {
+bool MetaData::findFloat(uint32_t key, float *value) const {
uint32_t type;
const void *data;
size_t size;
@@ -141,7 +141,7 @@
return true;
}
-bool MetaData::findPointer(uint32_t key, void **value) {
+bool MetaData::findPointer(uint32_t key, void **value) const {
uint32_t type;
const void *data;
size_t size;
@@ -159,7 +159,7 @@
bool MetaData::findRect(
uint32_t key,
int32_t *left, int32_t *top,
- int32_t *right, int32_t *bottom) {
+ int32_t *right, int32_t *bottom) const {
uint32_t type;
const void *data;
size_t size;