summaryrefslogtreecommitdiffstats
path: root/libstagefrighthw
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-09-21 16:07:36 -0700
committerAndreas Huber <andih@google.com>2010-09-21 16:07:36 -0700
commit4c5e27152cfeb6d452930046fe529023c3dbe6b3 (patch)
tree8efdda0f1fc3da3a59c25488726ae32a388edd64 /libstagefrighthw
parentac3afb23b5a9f45e82cc3684b3f91dfc14666965 (diff)
downloaddevice_samsung_crespo-4c5e27152cfeb6d452930046fe529023c3dbe6b3.zip
device_samsung_crespo-4c5e27152cfeb6d452930046fe529023c3dbe6b3.tar.gz
device_samsung_crespo-4c5e27152cfeb6d452930046fe529023c3dbe6b3.tar.bz2
Don't use zero-copy mode if the buffers to be rendered are not coming from the hardware decoders.
Change-Id: Icc1c26ba6390a94e07ef060a25ebc1e3f0abeeea
Diffstat (limited to 'libstagefrighthw')
-rw-r--r--libstagefrighthw/SecHardwareRenderer.cpp16
-rw-r--r--libstagefrighthw/SecHardwareRenderer.h3
-rw-r--r--libstagefrighthw/stagefright_overlay_output.cpp5
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;