Commit graph

56 commits

Author SHA1 Message Date
PatTheMav cb1a4c1c61 libobs: Fix relocatable Linux builds using legacy portable build flag 2024-04-16 12:46:51 -04:00
PatTheMav 0af0de26eb libobs: Add changes for CMake build framework 3.0
New code path only taken if OBS_CMAKE_VERSION is set to 3.0.0 or
greater, old functionality remains unchanged.
2024-04-13 23:48:38 -04:00
Lain 106c7aa61f Update copyrights/names 2023-05-20 01:31:18 -07:00
cg2121 1ac609f1ff UI, libobs: Fix not handled in switch warnings
These warnings were being spit out by GCC on Linux.
2023-03-26 10:47:01 +11:00
tytan652 cb6b5cc249 libobs: Add desktop environment to Linux log 2023-02-11 16:19:12 -08:00
tytan652 eacc246584 libobs: Add Flatpak info logging 2023-02-11 16:19:12 -08:00
tytan652 7de0bd350f libobs,plugins: Remove one-case switches 2023-01-16 11:43:47 +01:00
Ed Maste 25d308c727 libobs: Read /etc/os-release on FreeBSD
Previously FreeBSD had an optional port that installed /etc/os-release
so it was already available on many FreeBSD systems, but os-release is
now provided by the base system and will be universally available.
2022-08-16 18:40:48 -04:00
Georges Basile Stavracas Neto ca2d02c2ce Drop GLX renderer
"They must often change, who would be constant in happiness or wisdom"

 - Confucius
2022-05-24 14:31:48 -03:00
PatTheMav 1fd7770548
libobs: Update CMakeLists.txt for libobs and associated libraries
Also updates libobs-opengl, libobs-d3d11, libobs-winrt
2022-03-16 23:11:08 +01:00
Georges Basile Stavracas Neto 712478f48c libobs/nix: List Flatpak search paths
The proposed way to handle plugin distribution
through Flatpak depends on these directories to
be read. It goes as follows:

 1. Flatpak's extension point merges the 'lib'
    and 'share' directories at /app/plugin

 2. Plugins prefix their install paths in the
    Flatpak manifest to /app/plugins/<plugin name>

 3. OBS Studio lists /app/plugin as one of the
    search paths in OBS Studio code

This commit implements the third step of this
process, which is the only one that actually
involves OBS Studio itself.

With that, it is possible to distribute plugins
as Flatpak extensions, which in turn allows them
to be listed at app stores such as GNOME Software,
elementary's app store, and KDE's Discover.

Related: https://github.com/flathub/com.obsproject.Studio/issues/135
2021-07-08 10:53:15 -07:00
Georges Basile Stavracas Neto 2b3cb54771 libobs: Add a Wayland platform
Introduce the OBS_NIX_PLATFORM_WAYLAND enum value, and try to detect
it when OBS Studio runs by looking into the platform name.
2021-02-09 09:39:04 -03:00
Georges Basile Stavracas Neto 506b950d02 libobs: Introduce the concept of a Unix platform
This is a Unix-specific code. The only available platforms
at this point are the X11/GLX and X11/EGL platforms.

The concept of a platform display is also introduced. Again,
the only display that is set right now is the X11 display.
2021-02-01 19:05:10 -03:00
Georges Basile Stavracas Neto 510c747459 libobs/nix: Move X11-specific code to obs-nix-x11.c
Currently, obs-nix.c is highly tied to the X11 display
server. It includes X11 headers directly, and make use
of X11 functions. Most of the code inside obs-nix.c that
is X11-specific is related to hotkeys handling.

Introduce a new vtable for hotkeys callbacks, that will
used by X11 and Wayland to expose their specific routines.
In this commit, only the X11 hotkeys vtable is implemented.

Move all the X11-specific code to obs-nix-x11.c, and add
a new function to retrieve the X11 hotkeys vtable.
2021-02-01 19:03:43 -03:00
Vadim Zhukov 0d222b6b56 Add OpenBSD support 2020-11-14 11:55:22 -08:00
Florian Zwoch 0c39fd08c7 libobs: Add desktop session type to Linux log
Add the content of the XDG_SESSION_TYPE environment variable to
the output log if it is set. This is usually set on modern Linux
distributions and typically carry either "x11" or "wayland" when
run from a desktop environment.

This is independent from the QT_QPA_PLATFORM environment variable
which would allow OBS Studio to run inside a wayland session. The
session type it runs on does have an implication on the behavior of
some plugins like screen and window capture. So having this
information exposed here is extremely helpful for diagnosing
issues.
2020-10-30 02:19:21 -07:00
René Rebe fcbe593134 libobs: Add more X.org / Unix hotkey defines 2019-11-09 07:29:16 -08:00
jp9000 f53df7da64 clang-format: Apply formatting
Code submissions have continually suffered from formatting
inconsistencies that constantly have to be addressed.  Using
clang-format simplifies this by making code formatting more consistent,
and allows automation of the code formatting so that maintainers can
focus more on the code itself instead of code formatting.
2019-06-23 23:49:10 -07:00
Colin Edwards 7dacd58aab
Merge pull request #1795 from cg2121/f-keys-linux
libobs: Add support for F25-F35 hotkeys on Linux
2019-04-14 10:48:46 -07:00
Clayton Groeneveld e321005b02 UI: Fix issue where space/esc hotkeys would be blank
This also modifies libobs.

This only happened on Linux.

Fixes https://obsproject.com/mantis/view.php?id=1018
2019-03-31 05:10:02 -05:00
Clayton Groeneveld 9930b294b9 libobs: Add support for F25-F35 hotkeys on Linux
Fixes https://obsproject.com/mantis/view.php?id=1257
2019-03-31 03:41:16 -05:00
Shaolin b8e6e7a9fe libobs: Use xcb-xinput when available for events
This enables extra mouse buttons to be detected by libobs. This allows
up to 29 extra buttons.
2018-05-07 21:31:16 -03:00
Shaolin 47d920e9a2 libobs: Log *nix window manager
This should ease the support task to help with performance and
xcomposite issues on such systems.

Closes obsproject/obs-studio#1194
2018-04-23 04:48:24 -07:00
Jim ee5b371576 Merge pull request #988 from ishitatsuyuki/xcb-segfault
Fix XCB keyboard mapping size calculation
2017-09-12 05:23:15 -07:00
Tatsuyuki Ishi 7d1fde3529 libobs: Fix XCB keyboard mapping size calculation 2017-08-07 17:48:27 +09:00
Ryan Foster d6e43aefc4 libobs: Log *nix system info more like Windows/Mac
Rename "Processor" to "CPU Name" and place it before the number of
cores. Log free RAM for *nix. Log CPU Speed on Linux and FreeBSD. Unify
processor logging on Linux and FreeBSD. Get physical and logical cores
on *nix.

Use the new os_get_logical_cores and os_get_physical_cores function from
commits 6fc74d6 and e4a64f0 to get CPU core counts on *nix systems.
2017-05-26 22:54:12 -04:00
jp9000 3a5d7b1168 libobs: Fix mouse button hotkeys on linux
The screen index returned from XDefaultScreen is 0-based, and we were
decrementing it before the check to see if it had reached 0 rather than
after, so in the default_screen function it would always end up getting
either the wrong screen or no screen.

When xcb_query_pointer and xcb_query_pointer_reply was called with no
valid screen, it would fail with an error, thus making it so that the
mouse buttons could not be properly captured as hotkeys.
2015-05-16 20:10:49 -07:00
jp9000 d0cae31a48 libobs: Add linux hotkey implementation 2015-05-11 20:45:25 +02:00
Palana 5ad553d06d libobs: Add global hotkey support 2015-05-11 20:45:24 +02:00
fryshorts e3901b2072 Revert "libobs: Fix missing getline on FreeBSD"
This is no longer needed since getline is only used in linux specific
functions now.
2015-05-06 21:39:17 +02:00
fryshorts bc38bf641b libobs: Only log distribution info on linux
Add ifdefs to only log the distribution information on linux since this
is a platform specific implementation.
2015-05-06 21:39:17 +02:00
fryshorts ceb1b218f1 libobs: Implement logging processor model on bsd
Implement the log_processor_info function on bsd and add ifdefs to only
build the implementation specific to the platform.
Also add an ifdef around the call to that function to make sure it will
only be called on platforms where it is actually implemented.
2015-05-06 21:39:17 +02:00
fryshorts f5568ff586 libobs: Split up processor logging on nix
Split the function logging the processor information on nix into two
parts. The part logging the number of logical cores is portable and
works on all systems that support POSIX.1 while the other part is
specific to linux.
2015-05-06 21:15:24 +02:00
Kris Moore 013e97ff54 libobs: Fix missing getline on FreeBSD
Add definition on FreeBSD to enable getline in stdio, as it is not
(yet ?) available by default. According to the manpage getline was a
GNU extension but was standardized in POSIX.1-2008.
2015-05-04 21:05:55 +02:00
jp9000 ec0048e05e Revert "Merge pull request #410 from bazukas/nix-modules"
This reverts commit 92d800cc18, reversing
changes made to 35a4acede0.

These commits were originally added to allow multiple user interfaces to
use the same plugins, but I soon realized that multiple user interfaces
can use multiple libobs versions, so each user interface should have its
own set of plugins to manage.  Some user interfaces may not wish to use
certain plugins anyway, so this fixes that issue as well.
2015-04-03 19:54:03 -07:00
Azat Khasanshin 6b066e9bc6 Add $HOME/.obs-plugins as default module search dir on Linux 2015-04-03 19:20:05 +03:00
Jim 6d2226bde8 Merge pull request #326 from azatoth/plugin_lib
use multiarch compatible plugin lib path
2015-01-10 23:50:25 -08:00
jp9000 4ae68b3511 libobs: Whoops, use a 2 here instead of a 3
This file is GPL 2, not GPL 3.
2015-01-10 18:39:57 -08:00
Carl Fürstenberg 1ba39b08ca use multiarch compatible plugin lib path
use OBS_PLUGIN_DESTINATION instead of hardcoded path for module_bin
2015-01-07 00:15:35 +01:00
Christoph Hohmann 3e74e96649 Fix calculation of physical memory on linux systems
As stated in the sysinfo manpage the totalram field in the sysinfo
structure is in mem_unit sizes since Linux 2.3.23. To get the actual
memory in the system the totalram value has to be multiplied with the
mem_unit size.
2014-10-05 13:01:19 -07:00
jp9000 59ea3becf2 (API Change) Refactor module handling
Changed API:
- char *obs_find_plugin_file(const char *sub_path);

  Changed to: char *obs_module_file(const char *file);

  Cahnge it so you no longer need to specify a sub-path such as:
  obs_find_plugin_file("module_name/file.ext")

  Instead, now automatically handle the module data path so all you need
  to do is:
  obs_module_file("file.ext")

- int obs_load_module(const char *name);

  Changed to: int obs_open_module(obs_module_t *module,
                                  const char *path,
                                  const char *data_path);
              bool obs_init_module(obs_module_t module);

  Change the module loading API so that if the front-end chooses, it can
  load modules directly from a specified path, and associate a data
  directory with it on the spot.

  The module will not be initialized immediately; obs_init_module must
  be called on the module pointer in order to fully initialize the
  module.  This is done so a module can be disabled by the front-end if
  the it so chooses.

New API:
- void obs_add_module_path(const char *bin, const char *data);

  These functions allow you to specify new module search paths to add,
  and allow you to search through them, or optionally just load all
  modules from them.  If the string %module% is included, it will
  replace it with the module's name when that string is used as a
  lookup.  Data paths are now directly added to the module's internal
  storage structure, and when obs_find_module_file is used, it will look
  up the pointer to the obs_module structure and get its data directory
  that way.

  Example:
  obs_add_module_path("/opt/obs/my-modules/%module%/bin",
                      "/opt/obs/my-modules/%module%/data");

  This would cause it to additionally look for the binary of a
  hypthetical module named "foo" at /opt/obs/my-modules/foo/bin/foo.so
  (or libfoo.so), and then look for the data in
  /opt/obs/my-modules/foo/data.

  This gives the front-end more flexibility for handling third-party
  plugin modules, or handling all plugin modules in a custom way.

- void obs_find_modules(obs_find_module_callback_t callback, void
                        *param);

  This searches the existing paths for modules and calls the callback
  function when any are found.  Useful for plugin management and custom
  handling of the paths by the front-end if desired.

- void obs_load_all_modules(void);

  Search through the paths and both loads and initializes all modules
  automatically without custom handling.

- void obs_enum_modules(obs_enum_module_callback_t callback,
                        void *param);

  Enumerates currently opened modules.
2014-07-27 17:29:10 -07:00
jp9000 16f2475046 Add functions to specify OS module extensions 2014-07-27 17:28:35 -07:00
BtbN 1098c75d34 Search for plugins without lib prefix
Fixes #213
2014-07-28 01:25:18 +02:00
fryshorts 14e1549f7a Add system information for linux
This adds support for printing system information on linux.
2014-07-15 20:02:09 +02:00
fryshorts 0fa123dc47 Small coding style fixes 2014-07-15 20:01:39 +02:00
jp9000 76ff395aed Log system information on startup 2014-07-12 00:31:42 -07:00
jp9000 268e4e7811 Add more checks for NULL pointers 2014-02-23 22:39:33 -07:00
BtbN 668812ca3e Adjust file finding functions to also search the install root dir on Windows
This is because the installed versions of OBS is allways executed in the install root instead of inside the bin dir.
2014-01-26 02:04:37 +01:00
jp9000 93d15ef254 Fix some formatting issues and fix cmake file 2014-01-25 12:34:37 -07:00
BtbN 6a9dda87bd Restructure installation and package generation 2014-01-25 19:13:33 +01:00