diff options
author | Andreas Huber <andih@google.com> | 2010-09-21 16:44:59 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-09-21 16:44:59 -0700 |
commit | 86eb5758b44ffce96f8cae30bf5ead1e2e67e8d1 (patch) | |
tree | c17c1674b8f8d4b8df175eb159bbcae29a816a96 | |
parent | 012d0d8812d7532048ab00b976229f6519092ef5 (diff) | |
parent | 4c5e27152cfeb6d452930046fe529023c3dbe6b3 (diff) | |
download | device_samsung_crespo-86eb5758b44ffce96f8cae30bf5ead1e2e67e8d1.zip device_samsung_crespo-86eb5758b44ffce96f8cae30bf5ead1e2e67e8d1.tar.gz device_samsung_crespo-86eb5758b44ffce96f8cae30bf5ead1e2e67e8d1.tar.bz2 |
Merge "Don't use zero-copy mode if the buffers to be rendered are not coming from the hardware decoders." into gingerbread
-rw-r--r-- | libstagefrighthw/SecHardwareRenderer.cpp | 16 | ||||
-rw-r--r-- | libstagefrighthw/SecHardwareRenderer.h | 3 | ||||
-rw-r--r-- | libstagefrighthw/stagefright_overlay_output.cpp | 5 |
3 files changed, 17 insertions, 7 deletions
diff --git a/libstagefrighthw/SecHardwareRenderer.cpp b/libstagefrighthw/SecHardwareRenderer.cpp index 28a589b..d975462 100644 --- a/libstagefrighthw/SecHardwareRenderer.cpp +++ b/libstagefrighthw/SecHardwareRenderer.cpp @@ -42,7 +42,8 @@ SecHardwareRenderer::SecHardwareRenderer( const sp<ISurface> &surface, size_t displayWidth, size_t displayHeight, size_t decodedWidth, size_t decodedHeight, - OMX_COLOR_FORMATTYPE colorFormat) + OMX_COLOR_FORMATTYPE colorFormat, + bool fromHardwareDecoder) : mISurface(surface), mDisplayWidth(displayWidth), mDisplayHeight(displayHeight), @@ -66,12 +67,17 @@ SecHardwareRenderer::SecHardwareRenderer( return; } + sp<OverlayRef> ref; + #if defined (USE_ZERO_COPY) - sp<OverlayRef> ref = mISurface->createOverlay( - mDecodedWidth, mDecodedHeight, HAL_PIXEL_FORMAT_CUSTOM_YCbCr_420_SP, 0); - mCustomFormat = true; + if (fromHardwareDecoder) { + ref = mISurface->createOverlay( + mDecodedWidth, mDecodedHeight, + HAL_PIXEL_FORMAT_CUSTOM_YCbCr_420_SP, 0); + mCustomFormat = true; + } else #else - sp<OverlayRef> ref = mISurface->createOverlay( + ref = mISurface->createOverlay( mDecodedWidth, mDecodedHeight, HAL_PIXEL_FORMAT_YCbCr_420_P, 0); #endif diff --git a/libstagefrighthw/SecHardwareRenderer.h b/libstagefrighthw/SecHardwareRenderer.h index a353cd6..42f93b2 100644 --- a/libstagefrighthw/SecHardwareRenderer.h +++ b/libstagefrighthw/SecHardwareRenderer.h @@ -38,7 +38,8 @@ public: const sp<ISurface> &surface, size_t displayWidth, size_t displayHeight, size_t decodedWidth, size_t decodedHeight, - OMX_COLOR_FORMATTYPE colorFormat); + OMX_COLOR_FORMATTYPE colorFormat, + bool fromHardwareDecoder); virtual ~SecHardwareRenderer(); diff --git a/libstagefrighthw/stagefright_overlay_output.cpp b/libstagefrighthw/stagefright_overlay_output.cpp index ac5fbdb..3ac46a6 100644 --- a/libstagefrighthw/stagefright_overlay_output.cpp +++ b/libstagefrighthw/stagefright_overlay_output.cpp @@ -30,11 +30,14 @@ VideoRenderer *createRenderer( size_t decodedWidth, size_t decodedHeight) { using android::SecHardwareRenderer; + bool fromHardwareDecoder = !strncmp(componentName, "OMX.SEC.", 8); + SecHardwareRenderer *renderer = new SecHardwareRenderer( surface, displayWidth, displayHeight, decodedWidth, decodedHeight, - colorFormat); + colorFormat, + fromHardwareDecoder); if (renderer->initCheck() != android::OK) { delete renderer; |