Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frontend_source_list_free not found in obspython #11538

Open
scwfan06 opened this issue Nov 19, 2024 · 4 comments
Open

frontend_source_list_free not found in obspython #11538

scwfan06 opened this issue Nov 19, 2024 · 4 comments

Comments

@scwfan06
Copy link

scwfan06 commented Nov 19, 2024

Operating System Info

Windows 11

Other OS

No response

OBS Studio Version

30.2.3

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/HtBfW67hMmYYh3GV

OBS Studio Crash Log URL

No response

Expected Behavior

Should free the created list and return True

Current Behavior

AttributeError: module 'obspython' has no attribute 'obs_frontend_source_list_free'

Steps to Reproduce

  1. create a frontend source list via
    scenes = obs.obs_frontend_get_scenes()
  2. Try to free the list via the documented method
    obs.obs_frontend_source_list_free(scenes)

Anything else we should know?

This is my first bug report, if I'm missing something please be kind. :)

@Penwy
Copy link
Contributor

Penwy commented Nov 19, 2024

Documented method is for the C API. Obspython has some added peculiarities as not everything is wrapped, and not everything that's wrapped is wrapped correctly.

scenes_list = obs.obs_frontend_get_scenes()
for source in scenes_list:
    print(obs.obs_source_get_name(source))
    obs.obs_source_release(source)

@scwfan06
Copy link
Author

scwfan06 commented Nov 19, 2024

Documented method is for the C API. Obspython has some added peculiarities as not everything is wrapped, and not everything that's wrapped is wrapped correctly.

scenes_list = obs.obs_frontend_get_scenes()
for source in scenes_list:
    print(obs.obs_source_get_name(source))
    obs.obs_source_release(source)

Thanks for your reply. I was just doing it according to this comment which says to not release the scenes manually.
2024-11-19 20_50_54-OBS Studio Frontend API — OBS Studio 31 0 0 documentation – Mozilla Firefox

@Penwy
Copy link
Contributor

Penwy commented Nov 19, 2024

You shouldn't release the scenes manually if you release the list as a whole.
In obspython, since we cannot release the list as a whole because the function isn't wrapped, the only option we have is to release all the scenes manually.

I will add that in my opinion, in obspython, this function should only be used if you need to get the scenes in the order they are in the scenes dock. If you don't particularly need that order, I consider the more proper way to be obs_enum_sources with a check on whether the source type is a scene.

@scwfan06
Copy link
Author

You shouldn't release the scenes manually if you release the list as a whole. In obspython, since we cannot release the list as a whole because the function isn't wrapped, the only option we have is to release all the scenes manually.

I will add that in my opinion, in obspython, this function should only be used if you need to get the scenes in the order they are in the scenes dock. If you don't particularly need that order, I consider the more proper way to be obs_enum_sources with a check on whether the source type is a scene.

Got you. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants