Browse Source

docs: Clarify enum functions return value

CodeYan01 2 years ago
parent
commit
f9fd1c0967
2 changed files with 30 additions and 0 deletions
  1. 17 0
      docs/sphinx/reference-core.rst
  2. 13 0
      docs/sphinx/reference-scenes.rst

+ 17 - 0
docs/sphinx/reference-core.rst

@@ -299,12 +299,26 @@ Libobs Objects
 
    Enumerates outputs.
 
+   Callback function returns true to continue enumeration, or false to end
+   enumeration.
+
+   Use :c:func:`obs_output_get_ref()` or
+   :c:func:`obs_output_get_weak_output()` if you want to retain a
+   reference after obs_enum_outputs finishes.
+
 ---------------------
 
 .. function:: void obs_enum_encoders(bool (*enum_proc)(void*, obs_encoder_t*), void *param)
 
    Enumerates encoders.
 
+   Callback function returns true to continue enumeration, or false to end
+   enumeration.
+
+   Use :c:func:`obs_encoder_get_ref()` or
+   :c:func:`obs_encoder_get_weak_encoder()` if you want to retain a
+   reference after obs_enum_encoders finishes.
+
 ---------------------
 
 .. function:: obs_source_t *obs_get_source_by_name(const char *name)
@@ -505,6 +519,9 @@ Video, Audio, and Graphics
 
    Enumerates audio devices which can be used for audio monitoring.
 
+   Callback function returns true to continue enumeration, or false to end
+   enumeration.
+
    Relevant data types used with this function:
 
 .. code:: cpp

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

@@ -266,6 +266,12 @@ General Scene Functions
 
    Enumerates scene items within a scene.
 
+   Callback function returns true to continue enumeration, or false to end
+   enumeration.
+
+   Use :c:func:`obs_sceneitem_addref()` if you want to retain a
+   reference after obs_scene_enum_items finishes.
+
    For scripting, use :py:func:`obs_scene_enum_items`.
 
 ---------------------
@@ -745,6 +751,13 @@ Scene Item Group Functions
 
    Enumerates scene items within a group.
 
+   Callback function returns true to continue enumeration, or false to end
+   enumeration.
+
+   Use :c:func:`obs_sceneitem_addref()` if you want to retain a
+   reference after obs_sceneitem_group_enum_items finishes.
+
+
 ---------------------
 
 .. function:: void obs_sceneitem_defer_group_resize_begin(obs_sceneitem_t *item)