From: Alexander Aksenov Date: Wed, 18 Jan 2017 13:27:19 +0000 (+0300) Subject: Load screenshot library on screenshot request X-Git-Tag: accepted/tizen/3.0/common/20170123.132050^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F21%2F110921%2F1;p=platform%2Fcore%2Fsystem%2Fswap-probe.git Load screenshot library on screenshot request Previously it was loaded only on screenshot feature set. Change-Id: Ief460da9be3d8068d110733c8139286e44db3a18 Signed-off-by: Alexander Aksenov --- diff --git a/Makefile b/Makefile index 86cd4e8..d11da7a 100644 --- a/Makefile +++ b/Makefile @@ -152,6 +152,10 @@ PROBE_CAPI_SRCS = \ PROBE_SCREENSHOT_SRCS = ./probe_screenshot/dacapture_generic.c +PROBE_SCREENSHOT_LDFLAGS = \ + -L. \ + -l:da_probe_tizen.so + ifeq ($(TIZEN_FEATURE_WAYLAND),y) PROBE_EVENT_SRCS += ./probe_event/orientation.c CFLAGS += -Wno-deprecated-declarations -Wno-unused-const-variable @@ -161,11 +165,9 @@ CFLAGS += -I/usr/include/wayland-extension/ PROBE_SCREENSHOT_SRCS += ./probe_screenshot/dacapture_wayland.c PROBE_SCREENSHOT_LDFLAGS += \ - -L. \ -lscreenshooter-client \ -lwayland-tbm-client \ - -lwayland-client \ - -l:da_probe_tizen.so + -lwayland-client else @@ -285,10 +287,6 @@ PROBE_CAPI_LDFLAGS = \ -L. \ -l:da_probe_tizen.so -PROBE_SCREENSHOT_LDFLAGS = \ - -L. \ - -l:da_probe_tizen.so - $(PROBE_EVENT_TARGET): LDFLAGS+=$(PROBE_EVENT_LDFLAGS) $(PROBE_EVENT_TARGET): CPPFLAGS+=-DSELF_LIB_NAME="\"/$(INSTALLDIR)/$(PROBE_EVENT_TARGET)\"" -DTIZENAPP $(SWAP_PROBE_DEFS) $(PROBE_EVENT_TARGET): CPPFLAGS+=$(DEBUG_FLAGS) diff --git a/helper/screenshot_iface.c b/helper/screenshot_iface.c index 55737b0..d9965f8 100644 --- a/helper/screenshot_iface.c +++ b/helper/screenshot_iface.c @@ -33,11 +33,6 @@ static void *resolve_symbol(void *handle, const char *name) } -int capture_screen_call(void) -{ - return capture_screen_p ? ((int (*)(void))capture_screen_p)() : -1; -} - void current_angle_set_call(int angle) { if (current_angle_set_p != NULL) @@ -102,3 +97,11 @@ void unload_screenshot_library(void) dlclose(handle); } + +int capture_screen_call(void) +{ + if (capture_screen_p == NULL) + load_screenshot_library(); + + return capture_screen_p ? ((int (*)(void))capture_screen_p)() : -1; +}