void OnPrepareEvent(std::shared_ptr<screen_connector::RawImage> image,
uint32_t serial) override {
- raw_image_ = std::move(image);
if (ops_.prepare) {
- ops_.prepare(reinterpret_cast<void*>(&raw_image_), serial, user_data_);
+ ops_.prepare(reinterpret_cast<void*>(image.get()), serial,
+ user_data_);
}
+ raw_image_ = std::move(image);
}
void OnStopEvent(uint32_t serial) override {
return -EINVAL;
}
- auto img_ptr =
- reinterpret_cast<std::shared_ptr<screen_connector::RawImage>*>(handle);
- auto img = img_ptr->get();
- if (img == nullptr) {
- _E("Invalid parameter");
- return -EINVAL;
- }
-
+ auto img = reinterpret_cast<screen_connector::RawImage*>(handle);
*direction = __convert_direction(img->GetDirection());
return 0;
return -EINVAL;
}
- auto img_ptr =
- reinterpret_cast<std::shared_ptr<screen_connector::RawImage>*>(handle);
- auto img = img_ptr->get();
- if (img == nullptr) {
- _E("Invalid parameter");
- return -EINVAL;
- }
-
+ auto img = reinterpret_cast<screen_connector::RawImage*>(handle);
*image_type = __convert_image_type(img->GetImageType());
return 0;
return -EINVAL;
}
- auto img_ptr =
- reinterpret_cast<std::shared_ptr<screen_connector::RawImage>*>(handle);
- auto img = img_ptr->get();
- if (img == nullptr) {
- _E("Invalid parameter");
- return -EINVAL;
- }
-
+ auto img = reinterpret_cast<screen_connector::RawImage*>(handle);
*x = img->GetPositionX();
return 0;
return -EINVAL;
}
- auto img_ptr =
- reinterpret_cast<std::shared_ptr<screen_connector::RawImage>*>(handle);
- auto img = img_ptr->get();
- if (img == nullptr) {
- _E("Invalid parameter");
- return -EINVAL;
- }
-
+ auto img = reinterpret_cast<screen_connector::RawImage*>(handle);
*y = img->GetPositionY();
return 0;
return -EINVAL;
}
- auto img_ptr =
- reinterpret_cast<std::shared_ptr<screen_connector::RawImage>*>(handle);
- auto img = img_ptr->get();
- if (img == nullptr) {
- _E("Invalid parameter");
- return -EINVAL;
- }
-
+ auto img = reinterpret_cast<screen_connector::RawImage*>(handle);
*shared_widget_info = strdup(img->GetSharedWidgetInfo().c_str());
if (*shared_widget_info == nullptr) {
_E("Out of memory");
return -EINVAL;
}
- auto img_ptr =
- reinterpret_cast<std::shared_ptr<screen_connector::RawImage>*>(handle);
- auto img = img_ptr->get();
- if (img == nullptr) {
- _E("Invalid parameter");
- return -EINVAL;
- }
-
+ auto img = reinterpret_cast<screen_connector::RawImage*>(handle);
*tbm_surface = img->GetWlBuffer()->GetTbmSurface();
return 0;
return -EINVAL;
}
- auto img_ptr =
- reinterpret_cast<std::shared_ptr<screen_connector::RawImage>*>(handle);
- auto img = img_ptr->get();
- if (img == nullptr) {
- _E("Invalid parameter");
- return -EINVAL;
- }
-
+ auto img = reinterpret_cast<screen_connector::RawImage*>(handle);
*tbm_surface_info = img->GetWlBuffer()->GetTbmSurfaceInfo();
return 0;
return -EINVAL;
}
- auto img_ptr =
- reinterpret_cast<std::shared_ptr<screen_connector::RawImage>*>(handle);
- auto img = img_ptr->get();
- if (img == nullptr) {
- _E("Invalid parameter");
- return -EINVAL;
- }
-
+ auto img = reinterpret_cast<screen_connector::RawImage*>(handle);
*fd = img->GetImageFile()->GetRaw();
*size = img->GetImageFile()->GetSize();
return -EINVAL;
}
- auto img_ptr =
- reinterpret_cast<std::shared_ptr<screen_connector::RawImage>*>(handle);
- auto img = img_ptr->get();
- if (img == nullptr) {
- _E("Invalid parameter");
- return -EINVAL;
- }
-
+ auto img = reinterpret_cast<screen_connector::RawImage*>(handle);
*file_path = strdup(img->GetFilePath().c_str());
if (*file_path == nullptr) {
_E("Out of memory");
return -EINVAL;
}
- auto img_ptr =
- reinterpret_cast<std::shared_ptr<screen_connector::RawImage>*>(handle);
- auto img = img_ptr->get();
- if (img == nullptr) {
- _E("Invalid parameter");
- return -EINVAL;
- }
-
+ auto img = reinterpret_cast<screen_connector::RawImage*>(handle);
*file_group = strdup(img->GetFileGroup().c_str());
if (*file_group == nullptr) {
_E("Out of memory");