diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/camera/Camera.h | 4 | ||||
| -rw-r--r-- | include/camera/ICameraService.h | 6 | ||||
| -rw-r--r-- | include/media/stagefright/ACodec.h | 1 | ||||
| -rw-r--r-- | include/media/stagefright/MediaCodec.h | 8 | ||||
| -rw-r--r-- | include/media/stagefright/foundation/ADebug.h | 20 | 
5 files changed, 33 insertions, 6 deletions
diff --git a/include/camera/Camera.h b/include/camera/Camera.h index 25d75f7..2b60842 100644 --- a/include/camera/Camera.h +++ b/include/camera/Camera.h @@ -71,11 +71,11 @@ public:              // construct a camera client from an existing remote      static  sp<Camera>  create(const sp<ICamera>& camera);      static  sp<Camera>  connect(int cameraId, -                                const String16& opPackageName, +                                const String16& clientPackageName,                                  int clientUid);      static  status_t  connectLegacy(int cameraId, int halVersion, -                                     const String16& opPackageName, +                                     const String16& clientPackageName,                                       int clientUid, sp<Camera>& camera);              virtual     ~Camera(); diff --git a/include/camera/ICameraService.h b/include/camera/ICameraService.h index 38bff3e..cad275e 100644 --- a/include/camera/ICameraService.h +++ b/include/camera/ICameraService.h @@ -109,7 +109,7 @@ public:       */      virtual status_t connect(const sp<ICameraClient>& cameraClient,              int cameraId, -            const String16& opPackageName, +            const String16& clientPackageName,              int clientUid,              /*out*/              sp<ICamera>& device) = 0; @@ -117,7 +117,7 @@ public:      virtual status_t connectDevice(              const sp<ICameraDeviceCallbacks>& cameraCb,              int cameraId, -            const String16& opPackageName, +            const String16& clientPackageName,              int clientUid,              /*out*/              sp<ICameraDeviceUser>& device) = 0; @@ -141,7 +141,7 @@ public:       */      virtual status_t connectLegacy(const sp<ICameraClient>& cameraClient,              int cameraId, int halVersion, -            const String16& opPackageName, +            const String16& clientPackageName,              int clientUid,              /*out*/              sp<ICamera>& device) = 0; 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/MediaCodec.h b/include/media/stagefright/MediaCodec.h index 56d2523..82c768d 100644 --- a/include/media/stagefright/MediaCodec.h +++ b/include/media/stagefright/MediaCodec.h @@ -164,6 +164,11 @@ protected:      virtual void onMessageReceived(const sp<AMessage> &msg);  private: +    // used by ResourceManagerClient +    status_t reclaim(); +    friend struct ResourceManagerClient; + +private:      enum State {          UNINITIALIZED,          INITIALIZING, @@ -262,6 +267,7 @@ private:      };      State mState; +    bool mReleasedByResourceManager;      sp<ALooper> mLooper;      sp<ALooper> mCodecLooper;      sp<CodecBase> mCodec; @@ -321,7 +327,7 @@ private:      static status_t PostAndAwaitResponse(              const sp<AMessage> &msg, sp<AMessage> *response); -    static void PostReplyWithError(const sp<AReplyToken> &replyID, int32_t err); +    void PostReplyWithError(const sp<AReplyToken> &replyID, int32_t err);      status_t init(const AString &name, bool nameIsType, bool encoder); 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  | 
