linux-pipewire.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* linux-pipewire.c
  2. *
  3. * Copyright 2021 columbarius <[email protected]>
  4. * Copyright 2021 Georges Basile Stavracas Neto <[email protected]>
  5. *
  6. * This program is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. *
  19. * SPDX-License-Identifier: GPL-2.0-or-later
  20. */
  21. #include <obs-module.h>
  22. #include <obs-nix-platform.h>
  23. #include <pipewire/pipewire.h>
  24. #include "screencast-portal.h"
  25. OBS_DECLARE_MODULE()
  26. OBS_MODULE_USE_DEFAULT_LOCALE("linux-pipewire", "en-US")
  27. MODULE_EXPORT const char *obs_module_description(void)
  28. {
  29. return "PipeWire based sources/outputs";
  30. }
  31. bool obs_module_load(void)
  32. {
  33. pw_init(NULL, NULL);
  34. screencast_portal_load();
  35. return true;
  36. }
  37. void obs_module_unload(void)
  38. {
  39. #if PW_CHECK_VERSION(0, 3, 49)
  40. pw_deinit();
  41. #endif
  42. }