Skip to content

Commit

Permalink
Code cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
hyue7 committed Aug 24, 2023
1 parent 2f2304f commit fb72684
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions packages/video_player/tizen/src/video_player.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <dlfcn.h>
#include <flutter/event_stream_handler_functions.h>
#include <flutter/standard_method_codec.h>
#include <system_info.h>

#include <algorithm>

Expand Down Expand Up @@ -83,28 +82,28 @@ FlutterDesktopGpuSurfaceDescriptor *VideoPlayer::ObtainGpuSurface(
void VideoPlayer::InitScreenSaverApi() {
screensaver_handle_ = dlopen("libcapi-screensaver.so", RTLD_LAZY);
if (!screensaver_handle_) {
LOG_INFO("[VideoPlayer] dlopen failed: %s", dlerror());
LOG_ERROR("[VideoPlayer] dlopen failed: %s", dlerror());
return;
}

screensaver_reset_timeout_ = reinterpret_cast<ScreensaverResetTimeout>(
dlsym(screensaver_handle_, "screensaver_reset_timeout"));
if (!screensaver_reset_timeout_) {
LOG_INFO("[VideoPlayer] Symbol not found: %s", dlerror());
LOG_ERROR("[VideoPlayer] Symbol not found: %s", dlerror());
return;
}

ScreensaverOverrideReset screensaver_override_reset =
reinterpret_cast<ScreensaverOverrideReset>(
dlsym(screensaver_handle_, "screensaver_override_reset"));
if (!screensaver_override_reset) {
LOG_INFO("[VideoPlayer] Symbol not found: %s", dlerror());
LOG_ERROR("[VideoPlayer] Symbol not found: %s", dlerror());
return;
}

int ret = screensaver_override_reset(false);
if (ret != 0) {
LOG_INFO("screensaver_override_reset failed", get_error_message(ret));
LOG_ERROR("screensaver_override_reset failed: %s", get_error_message(ret));
return;
}
}
Expand Down Expand Up @@ -435,7 +434,7 @@ Eina_Bool VideoPlayer::ResetScreensaverTimeout(void *data) {
}
int ret = player->screensaver_reset_timeout_();
if (ret != 0) {
LOG_INFO("screensaver_reset_timeout failed", get_error_message(ret));
LOG_ERROR("screensaver_reset_timeout failed: %s", get_error_message(ret));
return ECORE_CALLBACK_CANCEL;
}

Expand Down

0 comments on commit fb72684

Please sign in to comment.