summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2015-05-06 11:52:00 -0700
committerLajos Molnar <lajos@google.com>2015-05-07 13:59:14 -0700
commit011778fd4cb9606b68bfea1ed483d73c04fc6dcd (patch)
tree95c668c8b5f3ae6afb072750366e24d53d7be2c6 /include
parentdd248abd2c3e5e82b0049d40c7e9fb741fd4540c (diff)
downloadframeworks_av-011778fd4cb9606b68bfea1ed483d73c04fc6dcd.zip
frameworks_av-011778fd4cb9606b68bfea1ed483d73c04fc6dcd.tar.gz
frameworks_av-011778fd4cb9606b68bfea1ed483d73c04fc6dcd.tar.bz2
stagefright: enable experiments
Bug: 20894716 Change-Id: I8c05b99dca8b3099a3a1b2b465f0f58bef786572
Diffstat (limited to 'include')
-rw-r--r--include/media/stagefright/ACodec.h1
-rw-r--r--include/media/stagefright/foundation/ADebug.h20
2 files changed, 21 insertions, 0 deletions
diff --git a/include/media/stagefright/ACodec.h b/include/media/stagefright/ACodec.h
index 0a54df9..b8327a3 100644
--- a/include/media/stagefright/ACodec.h
+++ b/include/media/stagefright/ACodec.h
@@ -216,6 +216,7 @@ private:
int32_t mChannelMask;
unsigned mDequeueCounter;
bool mStoreMetaDataInOutputBuffers;
+ bool mLegacyAdaptiveExperiment;
int32_t mMetaDataBuffersToSubmit;
size_t mNumUndequeuedBuffers;
diff --git a/include/media/stagefright/foundation/ADebug.h b/include/media/stagefright/foundation/ADebug.h
index 1d0e2cb..a97dd9b 100644
--- a/include/media/stagefright/foundation/ADebug.h
+++ b/include/media/stagefright/foundation/ADebug.h
@@ -108,6 +108,26 @@ struct ADebug {
// remove redundant segments of a codec name, and return a newly allocated
// string suitable for debugging
static char *GetDebugName(const char *name);
+
+ inline static bool isExperimentEnabled(
+ const char *name __unused /* nonnull */, bool allow __unused = true) {
+#ifdef ENABLE_STAGEFRIGHT_EXPERIMENTS
+ if (!strcmp(name, "legacy-adaptive")) {
+ return getExperimentFlag(allow, name, 2, 1); // every other day
+ } else if (!strcmp(name, "legacy-setsurface")) {
+ return getExperimentFlag(allow, name, 3, 1); // every third day
+ } else {
+ ALOGE("unknown experiment '%s' (disabled)", name);
+ }
+#endif
+ return false;
+ }
+
+private:
+ // pass in allow, so we can print in the log if the experiment is disabled
+ static bool getExperimentFlag(
+ bool allow, const char *name, uint64_t modulo, uint64_t limit,
+ uint64_t plus = 0, uint64_t timeDivisor = 24 * 60 * 60 /* 1 day */);
};
} // namespace android