diff options
author | Hwankyu Jhun <h.jhun@samsung.com> | 2020-04-29 09:38:44 +0900 |
---|---|---|
committer | HwanKyu Jhun <h.jhun@samsung.com> | 2020-04-29 07:25:59 +0000 |
commit | 2c839e7806f3e6f2c3d1bd239b0209bddd9b7f50 (patch) | |
tree | 3fc58a15d1893487a91ddc29c616bf93606f0160 /screen_connector_launcher_service | |
parent | edd87a50d5695358e1338c47529a489f049f2658 (diff) | |
download | screen-connector-2c839e7806f3e6f2c3d1bd239b0209bddd9b7f50.tar.gz screen-connector-2c839e7806f3e6f2c3d1bd239b0209bddd9b7f50.tar.bz2 screen-connector-2c839e7806f3e6f2c3d1bd239b0209bddd9b7f50.zip |
Add Reset Function
If the raw image is remote surface type, the launcher service calls
the unredirect method when the reset function is called.
Change-Id: I9ebe7eef50b820873538528420cd97aae90f46b6
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
Diffstat (limited to 'screen_connector_launcher_service')
7 files changed, 36 insertions, 0 deletions
diff --git a/screen_connector_launcher_service/include/screen_connector_launcher_service.h b/screen_connector_launcher_service/include/screen_connector_launcher_service.h index 22029a6..828a73f 100644 --- a/screen_connector_launcher_service/include/screen_connector_launcher_service.h +++ b/screen_connector_launcher_service/include/screen_connector_launcher_service.h @@ -118,6 +118,10 @@ int screen_connector_launcher_service_launch_done( screen_connector_launcher_service_h handle, uint32_t serial); +int screen_connector_launcher_service_reset( + screen_connector_launcher_service_h handle, + uint32_t serial); + int screen_connector_launcher_service_image_get_direction( screen_connector_launcher_service_image_h handle, screen_connector_launcher_service_direction_e* direction); diff --git a/screen_connector_launcher_service/launcher_service.cc b/screen_connector_launcher_service/launcher_service.cc index d486ca3..ced3de5 100644 --- a/screen_connector_launcher_service/launcher_service.cc +++ b/screen_connector_launcher_service/launcher_service.cc @@ -68,6 +68,15 @@ int LauncherService::Impl::LaunchDone(uint32_t serial) { return ret; } +int LauncherService::Impl::Reset(uint32_t serial) { + if (raw_image_->GetImageType() == ImageType::RemoteSurfaceTBM || + raw_image_->GetImageType() == ImageType::RemoteSurfaceImageFile) { + _W("Unredirect()"); + trs_->Unredirect(); + } + return 0; +} + void LauncherService::Impl::OnRawBufferUpdated( std::shared_ptr<WlBuffer> wl_buffer, uint32_t time, @@ -202,4 +211,8 @@ int LauncherService::LaunchDone(uint32_t serial) { return impl_->LaunchDone(serial); } +int LauncherService::Reset(uint32_t serial) { + return impl_->Reset(serial); +} + } // namespace screen_connector diff --git a/screen_connector_launcher_service/launcher_service.h b/screen_connector_launcher_service/launcher_service.h index 3ef2c3a..d7344ea 100644 --- a/screen_connector_launcher_service/launcher_service.h +++ b/screen_connector_launcher_service/launcher_service.h @@ -55,6 +55,7 @@ class EXPORT LauncherService { int Launching(uint32_t serial); int LaunchCancel(uint32_t serial); int LaunchDone(uint32_t serial); + int Reset(uint32_t serial); private: class Impl; diff --git a/screen_connector_launcher_service/launcher_service_implementation.h b/screen_connector_launcher_service/launcher_service_implementation.h index 0afd237..8d18eea 100644 --- a/screen_connector_launcher_service/launcher_service_implementation.h +++ b/screen_connector_launcher_service/launcher_service_implementation.h @@ -82,6 +82,7 @@ class LauncherService::Impl : TizenRemoteSurface::IEventListener, int Launching(uint32_t serial); int LaunchCancel(uint32_t serial); int LaunchDone(uint32_t serial); + int Reset(uint32_t serial); private: friend class LauncherService; diff --git a/screen_connector_launcher_service/stub.cc b/screen_connector_launcher_service/stub.cc index c95d496..507a8f1 100644 --- a/screen_connector_launcher_service/stub.cc +++ b/screen_connector_launcher_service/stub.cc @@ -222,6 +222,18 @@ extern "C" EXPORT int screen_connector_launcher_service_launch_done( return ls->LaunchDone(serial); } +extern "C" EXPORT int screen_connector_launcher_service_reset( + screen_connector_launcher_service_h handle, + uint32_t serial) { + if (handle == nullptr) { + _E("Invalid parameter"); + return -EINVAL; + } + + auto ls = static_cast<LauncherServiceStub*>(handle); + return ls->Reset(serial); +} + extern "C" EXPORT int screen_connector_launcher_service_image_get_direction( screen_connector_launcher_service_image_h handle, screen_connector_launcher_service_direction_e* direction) { diff --git a/screen_connector_launcher_service/tizen_remote_surface_internal.cc b/screen_connector_launcher_service/tizen_remote_surface_internal.cc index 5a6d15e..a13a4c8 100644 --- a/screen_connector_launcher_service/tizen_remote_surface_internal.cc +++ b/screen_connector_launcher_service/tizen_remote_surface_internal.cc @@ -82,6 +82,10 @@ void TizenRemoteSurface::Redirect() { tizen_remote_surface_redirect(GetRaw()); } +void TizenRemoteSurface::Unredirect() { + tizen_remote_surface_unredirect(GetRaw()); +} + void TizenRemoteSurface::BufferUpdatedCB(void* data, struct tizen_remote_surface* trs, struct wl_buffer* buffer, diff --git a/screen_connector_launcher_service/tizen_remote_surface_internal.h b/screen_connector_launcher_service/tizen_remote_surface_internal.h index 2448ecc..95527cd 100644 --- a/screen_connector_launcher_service/tizen_remote_surface_internal.h +++ b/screen_connector_launcher_service/tizen_remote_surface_internal.h @@ -70,6 +70,7 @@ class TizenRemoteSurface : public Handle<struct tizen_remote_surface*> { const std::string& GetSharedWidgetInfo() const; uint32_t GetSerial() const; void Redirect(); + void Unredirect(); private: static void BufferUpdatedCB(void* data, |