diff options
| author | Lajos Molnar <lajos@google.com> | 2015-05-08 18:44:14 +0000 | 
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-05-08 18:44:15 +0000 | 
| commit | 3af8a321d06b3ee59afe159479c58e6b549c7b8f (patch) | |
| tree | f1489cb14319accdd640fa3cb0d0303b147eab07 /include | |
| parent | 635bc8f90429b2fdcaf7f8d43f7f59bcd0fe951c (diff) | |
| parent | 011778fd4cb9606b68bfea1ed483d73c04fc6dcd (diff) | |
| download | frameworks_av-3af8a321d06b3ee59afe159479c58e6b549c7b8f.zip frameworks_av-3af8a321d06b3ee59afe159479c58e6b549c7b8f.tar.gz frameworks_av-3af8a321d06b3ee59afe159479c58e6b549c7b8f.tar.bz2  | |
Merge changes from topic 'codec-surface' into mnc-dev
* changes:
  stagefright: enable experiments
  stagefright: allow connecting to surfaces that attach buffers
Diffstat (limited to 'include')
| -rw-r--r-- | include/media/stagefright/ACodec.h | 1 | ||||
| -rw-r--r-- | include/media/stagefright/foundation/ADebug.h | 20 | 
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  | 
