From bb639f0d4dd130efcd4a9068402a6718dc128ae9 Mon Sep 17 00:00:00 2001 From: Exeldro Date: Mon, 19 Feb 2024 22:51:32 +0100 Subject: [PATCH] requesthandler: Update obs_transform API Updates: obs_transform_info to obs_transform_info2 obs_sceneitem_get_info to obs_sceneitem_get_info2 obs_sceneitem_set_info to obs_sceneitem_set_info2 Ensures that we're using the latest versions of these functions in order to prevent future deprecation --- src/requesthandler/RequestHandler_SceneItems.cpp | 10 +++++----- src/utils/Obs_ObjectHelper.cpp | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/requesthandler/RequestHandler_SceneItems.cpp b/src/requesthandler/RequestHandler_SceneItems.cpp index ea70ca7b9..6bfee6ab0 100644 --- a/src/requesthandler/RequestHandler_SceneItems.cpp +++ b/src/requesthandler/RequestHandler_SceneItems.cpp @@ -306,9 +306,9 @@ RequestResult RequestHandler::DuplicateSceneItem(const Request &request) // Get scene item details OBSSource sceneItemSource = obs_sceneitem_get_source(sceneItem); bool sceneItemEnabled = obs_sceneitem_visible(sceneItem); - obs_transform_info sceneItemTransform; + obs_transform_info2 sceneItemTransform; obs_sceneitem_crop sceneItemCrop; - obs_sceneitem_get_info(sceneItem, &sceneItemTransform); + obs_sceneitem_get_info2(sceneItem, &sceneItemTransform); obs_sceneitem_get_crop(sceneItem, &sceneItemCrop); // Create the new item @@ -384,9 +384,9 @@ RequestResult RequestHandler::SetSceneItemTransform(const Request &request) bool transformChanged = false; bool cropChanged = false; - obs_transform_info sceneItemTransform; + obs_transform_info2 sceneItemTransform; obs_sceneitem_crop sceneItemCrop; - obs_sceneitem_get_info(sceneItem, &sceneItemTransform); + obs_sceneitem_get_info2(sceneItem, &sceneItemTransform); obs_sceneitem_get_crop(sceneItem, &sceneItemCrop); OBSSource source = obs_sceneitem_get_source(sceneItem); @@ -503,7 +503,7 @@ RequestResult RequestHandler::SetSceneItemTransform(const Request &request) return RequestResult::Error(RequestStatus::CannotAct, "You have not provided any valid transform changes."); if (transformChanged) - obs_sceneitem_set_info(sceneItem, &sceneItemTransform); + obs_sceneitem_set_info2(sceneItem, &sceneItemTransform); if (cropChanged) obs_sceneitem_set_crop(sceneItem, &sceneItemCrop); diff --git a/src/utils/Obs_ObjectHelper.cpp b/src/utils/Obs_ObjectHelper.cpp index 6679c2c12..c0568a1de 100644 --- a/src/utils/Obs_ObjectHelper.cpp +++ b/src/utils/Obs_ObjectHelper.cpp @@ -48,9 +48,9 @@ json Utils::Obs::ObjectHelper::GetSceneItemTransform(obs_sceneitem_t *item) { json ret; - obs_transform_info osi; + obs_transform_info2 osi; obs_sceneitem_crop crop; - obs_sceneitem_get_info(item, &osi); + obs_sceneitem_get_info2(item, &osi); obs_sceneitem_get_crop(item, &crop); OBSSource source = obs_sceneitem_get_source(item);