summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/omx/OMX.cpp
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2009-11-12 10:32:26 -0800
committerAndreas Huber <andih@google.com>2009-11-12 10:32:26 -0800
commit53f45f0367d9563278f427db106736dcd1a433d1 (patch)
tree7e7a696b98534e1699696227a4159b6592f2f937 /media/libstagefright/omx/OMX.cpp
parentca4bea0965f870c7d1d92357d860f50c6c18d51d (diff)
parent1dfc99f22fb9d8c798065938c24eeb4eb9691747 (diff)
downloadframeworks_av-53f45f0367d9563278f427db106736dcd1a433d1.zip
frameworks_av-53f45f0367d9563278f427db106736dcd1a433d1.tar.gz
frameworks_av-53f45f0367d9563278f427db106736dcd1a433d1.tar.bz2
resolved conflicts for merge of c66d53f9 to eclair-mr2
Diffstat (limited to 'media/libstagefright/omx/OMX.cpp')
-rw-r--r--media/libstagefright/omx/OMX.cpp50
1 files changed, 29 insertions, 21 deletions
diff --git a/media/libstagefright/omx/OMX.cpp b/media/libstagefright/omx/OMX.cpp
index e361018..5b3cc1b 100644
--- a/media/libstagefright/omx/OMX.cpp
+++ b/media/libstagefright/omx/OMX.cpp
@@ -24,9 +24,7 @@
#include "pv_omxcore.h"
#include "../include/OMXNodeInstance.h"
-#include "../include/QComHardwareRenderer.h"
#include "../include/SoftwareRenderer.h"
-#include "../include/TIHardwareRenderer.h"
#include <binder/IMemory.h>
#include <media/stagefright/MediaDebug.h>
@@ -431,27 +429,37 @@ sp<IOMXRenderer> OMX::createRenderer(
OMX_COLOR_FORMATTYPE colorFormat,
size_t encodedWidth, size_t encodedHeight,
size_t displayWidth, size_t displayHeight) {
+ Mutex::Autolock autoLock(mLock);
+
VideoRenderer *impl = NULL;
- static const int OMX_QCOM_COLOR_FormatYVU420SemiPlanar = 0x7FA30C00;
-
- if (colorFormat == OMX_QCOM_COLOR_FormatYVU420SemiPlanar
- && !strncmp(componentName, "OMX.qcom.video.decoder.", 23)) {
- LOGW("Using QComHardwareRenderer.");
- impl =
- new QComHardwareRenderer(
- surface,
- displayWidth, displayHeight,
- encodedWidth, encodedHeight);
- } else if (colorFormat == OMX_COLOR_FormatCbYCrY
- && !strcmp(componentName, "OMX.TI.Video.Decoder")) {
- LOGW("Using TIHardwareRenderer.");
- impl =
- new TIHardwareRenderer(
- surface,
- displayWidth, displayHeight,
- encodedWidth, encodedHeight);
- } else {
+ static void *libHandle = NULL;
+
+ if (!libHandle) {
+ libHandle = dlopen("libstagefrighthw.so", RTLD_NOW);
+ }
+
+ if (libHandle) {
+ typedef VideoRenderer *(*CreateRendererFunc)(
+ const sp<ISurface> &surface,
+ const char *componentName,
+ OMX_COLOR_FORMATTYPE colorFormat,
+ size_t displayWidth, size_t displayHeight,
+ size_t decodedWidth, size_t decodedHeight);
+
+ CreateRendererFunc func =
+ (CreateRendererFunc)dlsym(
+ libHandle,
+ "_Z14createRendererRKN7android2spINS_8ISurfaceEEEPKc20"
+ "OMX_COLOR_FORMATTYPEjjjj");
+
+ if (func) {
+ impl = (*func)(surface, componentName, colorFormat,
+ displayWidth, displayHeight, encodedWidth, encodedHeight);
+ }
+ }
+
+ if (!impl) {
LOGW("Using software renderer.");
impl = new SoftwareRenderer(
colorFormat,