Browse Source

libobs: Remove obs_scene_sceneitem_from_source

Use obs_scene_enum_items to find sources instead.

Deprecated since 4dd3cf675834bbbd786a638f4427766021dd976d (31.0).
Sebastian Beckmann 2 months ago
parent
commit
d283181c83
3 changed files with 0 additions and 23 deletions
  1. 0 13
      docs/sphinx/reference-scenes.rst
  2. 0 7
      libobs/obs-scene.c
  3. 0 3
      libobs/obs.h

+ 0 - 13
docs/sphinx/reference-scenes.rst

@@ -320,19 +320,6 @@ Scene Item Functions
 
 ---------------------
 
-.. function:: obs_sceneitem_t *obs_scene_sceneitem_from_source(obs_scene_t *scene, obs_source_t *source)
-
-   This will add a reference to the sceneitem.
-
-   :return: The sceneitem associated with a source in a scene. Returns NULL if not found.
-
-   .. deprecated:: 31.0
-      This function is problematic because there can be multiple items of the same source in a scene.
-      In that case, which of those this function will return is undefined.
-      If this is the behavior you need, manually use :c:func:`obs_scene_enum_items` instead.
-
----------------------
-
 .. function:: void obs_sceneitem_set_id(obs_sceneitem_t *item);
 
    Sets the unique numeric identifier of the sceneitem. This is dangerous function and should not

+ 0 - 7
libobs/obs-scene.c

@@ -2185,13 +2185,6 @@ bool check_sceneitem_exists(obs_scene_t *scene, obs_sceneitem_t *item, void *vp_
 	return true;
 }
 
-obs_sceneitem_t *obs_scene_sceneitem_from_source(obs_scene_t *scene, obs_source_t *source)
-{
-	struct sceneitem_check check = {source, NULL};
-	obs_scene_enum_items(scene, check_sceneitem_exists, (void *)&check);
-	return check.item_out;
-}
-
 obs_sceneitem_t *obs_scene_find_sceneitem_by_id(obs_scene_t *scene, int64_t id)
 {
 	struct obs_scene_item *item;

+ 0 - 3
libobs/obs.h

@@ -1671,9 +1671,6 @@ EXPORT void obs_sceneitem_save(obs_sceneitem_t *item, obs_data_array_t *arr);
 /** Set the ID of a sceneitem */
 EXPORT void obs_sceneitem_set_id(obs_sceneitem_t *sceneitem, int64_t id);
 
-/** Tries to find the sceneitem of the source in a given scene. Returns NULL if not found */
-OBS_DEPRECATED EXPORT obs_sceneitem_t *obs_scene_sceneitem_from_source(obs_scene_t *scene, obs_source_t *source);
-
 /** Save all the transform states for a current scene's sceneitems */
 EXPORT obs_data_t *obs_scene_save_transform_states(obs_scene_t *scene, bool all_items);