overlay: Remove usage of scale header
Remove usage of scale header and do not create or destroy objects.
the programScale() function exported out of libscale.so will
internally manage objects.
This frees up overlay from relying on scale.h which may not be
exported by libscale.so to a known location if only binaries are
shipped.
Change-Id: If6970541e2eb0ee2bdb907c73ed3534fc22e9dd1
diff --git a/liboverlay/overlay.cpp b/liboverlay/overlay.cpp
index d53b46d..defb9dc 100644
--- a/liboverlay/overlay.cpp
+++ b/liboverlay/overlay.cpp
@@ -33,11 +33,6 @@
#include "mdp_version.h"
#include "qdMetaData.h"
-#ifdef USES_QSEED_SCALAR
-#include <scale/scale.h>
-using namespace scale;
-#endif
-
#define PIPE_DEBUG 0
namespace overlay {
@@ -545,39 +540,20 @@
}
void Overlay::initScalar() {
-#ifdef USES_QSEED_SCALAR
if(sLibScaleHandle == NULL) {
sLibScaleHandle = dlopen("libscale.so", RTLD_NOW);
- }
-
- if(sLibScaleHandle) {
- if(sScale == NULL) {
- Scale* (*getInstance)();
- *(void **) &getInstance = dlsym(sLibScaleHandle, "getInstance");
- if(getInstance) {
- sScale = getInstance();
- }
+ if(sLibScaleHandle) {
+ *(void **) &sFnProgramScale =
+ dlsym(sLibScaleHandle, "programScale");
}
}
-#endif
}
void Overlay::destroyScalar() {
-#ifdef USES_QSEED_SCALAR
if(sLibScaleHandle) {
- if(sScale) {
- void (*destroyInstance)(Scale*);
- *(void **) &destroyInstance = dlsym(sLibScaleHandle,
- "destroyInstance");
- if(destroyInstance) {
- destroyInstance(sScale);
- sScale = NULL;
- }
- }
dlclose(sLibScaleHandle);
sLibScaleHandle = NULL;
}
-#endif
}
void Overlay::PipeBook::init() {
@@ -607,6 +583,6 @@
utils::eMdpPipeType Overlay::PipeBook::pipeTypeLUT[utils::OV_MAX] =
{utils::OV_MDP_PIPE_ANY};
void *Overlay::sLibScaleHandle = NULL;
-scale::Scale *Overlay::sScale = NULL;
+int (*Overlay::sFnProgramScale)(struct mdp_overlay_list *) = NULL;
}; // namespace overlay