Skip to content

Commit

Permalink
requesthandler: Update obs sceneitem transform API
Browse files Browse the repository at this point in the history
Updates:
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
  • Loading branch information
exeldro authored and Lain-B committed Feb 21, 2024
1 parent e94f919 commit 6f6c1aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/requesthandler/RequestHandler_SceneItems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ RequestResult RequestHandler::DuplicateSceneItem(const Request &request)
bool sceneItemEnabled = obs_sceneitem_visible(sceneItem);
obs_transform_info 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
Expand Down Expand Up @@ -386,7 +386,7 @@ RequestResult RequestHandler::SetSceneItemTransform(const Request &request)
bool cropChanged = false;
obs_transform_info 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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/Obs_ObjectHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ json Utils::Obs::ObjectHelper::GetSceneItemTransform(obs_sceneitem_t *item)

obs_transform_info 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);
Expand Down

0 comments on commit 6f6c1aa

Please sign in to comment.