Skip to content

Commit

Permalink
requesthandler: Update obs_transform API
Browse files Browse the repository at this point in the history
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
  • Loading branch information
exeldro authored and Lain-B committed Feb 21, 2024
1 parent e94f919 commit bb639f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/requesthandler/RequestHandler_SceneItems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
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
4 changes: 2 additions & 2 deletions src/utils/Obs_ObjectHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit bb639f0

Please sign in to comment.