summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/MediaCodecListOverrides.cpp
diff options
context:
space:
mode:
authorRonghua Wu <ronghuawu@google.com>2015-05-21 10:22:53 -0700
committerRonghua Wu <ronghuawu@google.com>2015-05-22 10:52:13 -0700
commit19352b3287480394aa9963276305d5168a7adf85 (patch)
treed3b4ee14db574676710c26bd490f2865f0ad0d4d /media/libstagefright/MediaCodecListOverrides.cpp
parent8eddd88568fe4da0ca0ceab5072bc488827f01b5 (diff)
downloadframeworks_av-19352b3287480394aa9963276305d5168a7adf85.zip
frameworks_av-19352b3287480394aa9963276305d5168a7adf85.tar.gz
frameworks_av-19352b3287480394aa9963276305d5168a7adf85.tar.bz2
libstagefright: add version string to profile results.
Bug: 21333717 Change-Id: I79966be5ba355633f83885844165b7d9a6b2643f
Diffstat (limited to 'media/libstagefright/MediaCodecListOverrides.cpp')
-rw-r--r--media/libstagefright/MediaCodecListOverrides.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/media/libstagefright/MediaCodecListOverrides.cpp b/media/libstagefright/MediaCodecListOverrides.cpp
index 0d95676..4cb28b8 100644
--- a/media/libstagefright/MediaCodecListOverrides.cpp
+++ b/media/libstagefright/MediaCodecListOverrides.cpp
@@ -20,6 +20,7 @@
#include "MediaCodecListOverrides.h"
+#include <cutils/properties.h>
#include <gui/Surface.h>
#include <media/ICrypto.h>
#include <media/IMediaCodecList.h>
@@ -32,6 +33,15 @@ namespace android {
const char *kProfilingResults = "/data/misc/media/media_codecs_profiling_results.xml";
+AString getProfilingVersionString() {
+ char val[PROPERTY_VALUE_MAX];
+ if (property_get("ro.build.display.id", val, NULL) && (strlen(val) > 0)) {
+ return AStringPrintf("<!-- Profiled-with: %s -->", val);
+ }
+
+ return "<!-- Profiled-with: UNKNOWN_BUILD_ID -->";
+}
+
// a limit to avoid allocating unreasonable number of codec instances in the measurement.
// this should be in sync with the MAX_SUPPORTED_INSTANCES defined in MediaCodecInfo.java.
static const int kMaxInstances = 32;
@@ -307,6 +317,8 @@ void exportResultsToXML(
}
AString overrides;
+ overrides.append(getProfilingVersionString());
+ overrides.append("\n");
overrides.append("<MediaCodecs>\n");
if (global_results.size() > 0) {
overrides.append(" <Settings>\n");