diff options
-rw-r--r-- | include/media/stagefright/ACodec.h | 6 | ||||
-rw-r--r-- | media/libstagefright/ACodec.cpp | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/include/media/stagefright/ACodec.h b/include/media/stagefright/ACodec.h index 2ca3f1c..05f6786 100644 --- a/include/media/stagefright/ACodec.h +++ b/include/media/stagefright/ACodec.h @@ -145,6 +145,12 @@ private: kFlagIsGrallocUsageProtected = 4, }; + enum { + kVideoGrallocUsage = (GRALLOC_USAGE_HW_TEXTURE + | GRALLOC_USAGE_HW_COMPOSER + | GRALLOC_USAGE_EXTERNAL_DISP), + }; + struct BufferInfo { enum Status { OWNED_BY_US, diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index 4e1f094..e904c49 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -668,8 +668,7 @@ status_t ACodec::handleSetSurface(const sp<Surface> &surface) { return err; } - int ignoredFlags = (GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_HW_COMPOSER - | GRALLOC_USAGE_EXTERNAL_DISP); + int ignoredFlags = kVideoGrallocUsage; // New output surface is not allowed to add new usage flag except ignored ones. if ((usageBits & ~(mNativeWindowUsageBits | ignoredFlags)) != 0) { ALOGW("cannot change usage from %#x to %#x", mNativeWindowUsageBits, usageBits); @@ -905,7 +904,7 @@ status_t ACodec::setupNativeWindowSizeFormatAndUsage( usage |= GRALLOC_USAGE_PROTECTED; } - usage |= GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_EXTERNAL_DISP; + usage |= kVideoGrallocUsage; *finalUsage = usage; ALOGV("gralloc usage: %#x(OMX) => %#x(ACodec)", omxUsage, usage); |