0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00
Commit Graph

35 Commits

Author SHA1 Message Date
Richard Stanway
8b640fae24
Fix various null pointer issues detected by Coverity 2017-02-25 16:45:45 +01:00
jp9000
c99f65a0df libobs: Add property functions to mod. int/double limits 2016-09-19 07:04:00 -07:00
Michael Fabian Dirks
99b0acf4f0 libobs: Fix possible null pointer dereference 2016-08-02 21:04:55 +02:00
jp9000
ac4bd2aa80 libobs: Add long description to properties
Allows setting a "long" description for detailed explanation of certain
properties that may need them, but don't want to display them on the
user interface by default.
2016-07-20 08:09:45 -07:00
jp9000
07a26b1720 libobs: Add more editable list types
(Note: This commit also modifies the UI)

The editable list only had two types: A type that allows both files and
URLS, and a type that only allows strings.

This changes it so the editable list can have a "files only" type, a
"files and URLs" type, and a "strings only" type.
2016-05-26 10:55:51 -07:00
Palana
1b078f57d8 libobs: Add frame rate property 2015-11-14 15:37:59 +01:00
jp9000
a746c8cdd1 libobs: Remove potential NULL pointer dereference 2015-09-13 11:53:33 -07:00
jp9000
a752b32b83 libobs: Add editable list property
Add an editable list property, primarily used for adding files to a
playlist for example.
2015-06-02 17:01:38 -07:00
jp9000
0a8e3a643c libobs: Add int/float slider properties
This optionally specifies that the int/float value should be displayed
with a slider rather than and up/down control.  UIs are not necessarily
required to implement it, it's meant to be more of a hint.
2015-03-22 19:18:06 -07:00
jp9000
ef4ee1fd1a libobs: Implement flags for properties
OBS_PROPERTIES_DEFER_UPDATE: Makes it so the properties are not updated
until editing of the properties is complete.
2015-03-19 15:57:03 -05:00
jp9000
5d30f268a0 libobs: Return NULL on ending property list string
Instead of returning a valid string value when there are no more strings
available in the list, return NULL to indicate failure.  An empty string
should really be allowed to be a valid value for the list.
2015-01-06 01:27:16 -08:00
jp9000
32ca251bb0 libobs: Add obs_property_set_description
This allows us to change the visible UI name of a property after it's
been created (particularly for a case where I want to change an
'Activate' button to 'Deactivate')
2015-01-03 20:46:18 -08:00
jp9000
a69524a271 libobs: Add obs_property_list_insert_* functions
These functions allow you to insert items at a specific index in a list
instead of being forced to always append to the end.
2014-12-09 14:21:02 -08:00
jp9000
c9df41c1e2 (API Change) Remove pointers from all typedefs
Typedef pointers are unsafe.  If you do:
typedef struct bla *bla_t;
then you cannot use it as a constant, such as: const bla_t, because
that constant will be to the pointer itself rather than to the
underlying data.  I admit this was a fundamental mistake that must
be corrected.

All typedefs that were pointer types will now have their pointers
removed from the type itself, and the pointers will be used when they
are actually used as variables/parameters/returns instead.

This does not break ABI though, which is pretty nice.
2014-09-25 21:48:11 -07:00
jp9000
0bf9736ddd Add font property
Adds the following function:
------------------------------
obs_properties_add_font

This function creates a 'font' property to allow selection of a system
font.  Implementation by the UI should treat the setting as an obs_data
sub-object with four sub-items:
 - face:   face name (string)
 - style:  style name (string)
 - size:   size (integer)
 - flags:  font flags (integer)

'flags' can be any combination of the following values:
 - OBS_FONT_BOLD
 - OBS_FONT_ITALIC
 - OBS_FONT_UNDERLINE
 - OBS_FONT_STRIKEOUT
2014-08-18 00:14:02 -07:00
jp9000
4812a6130c libobs: Fill in rest of 'path' property code
A path should have a filter, default search directory, and a way to
indicate whether or not a directory or file is desired.
2014-06-28 10:12:57 -07:00
jp9000
74b4743bce Remove 'locale' from properties
Having the value stored here is somewhat pointless, so this is one step
in fixing the locale handling.  Locale should be handled by the modules
themselves with their own loaded locale lookup information.
2014-06-25 12:36:26 -07:00
Palana
e007d02c21 Allow property list entries to be disabled
This allows, for example, disconnected devices for dshow/avcapture to
be listed (and to stay selected in the user config) while making them
unavailable for selection in new sources
2014-06-17 17:03:27 +02:00
Palana
ed7b37b522 Return index of added property list entry 2014-06-17 17:03:27 +02:00
jp9000
85dcfcaa34 libobs: Add button support to properties
This adds button support to properties, which will allow a properties
pane to let the user click a button to activate something with a
particular obs context.  When pressed, the button will execute the
callback given, with the context's private data as a parameter.
2014-05-30 02:16:46 -07:00
jp9000
7a60694159 obs-properties: Add a few features
Just wanted the ability to be able to add private data to the properties
data.  Makes it a little easier to manage data if you get updates from
controls.
2014-04-19 20:29:11 -07:00
jp9000
1bca7e0a3e Improve properties API
Improve the properties API so that it can actually respond somewhat to
user input.  Maybe later this might be further improved or replaced with
something script-based.

When creating a property, you can now add a callback to that property
that notifies when the property has been changed in the user interface.
Return true if you want the properties to be refreshed, or false if not.
Though now that I think about it I doubt there would ever be a case
where you would have this callback and *not* refresh the properties.

Regardless, this allows functions to change the values of properties or
settings, or enable/disable/hide other property controls from view
dynamically.
2014-04-04 00:30:37 -07:00
jp9000
4a652ec82d obs-output module: Fill out more functions
- Add start/stop code to obs-output module

 - Use a circular buffer for the buffered encoder packets instead of a
   dynamic array

 - Add pthreads.lib as a dependency to obs-output module on windows in
   visual studio project files

 - Fix an windows export bug for avc parsing functions on windows.
   Also, rename those functions to be more consistent with each other.

 - Make outputs use a single function for encoded data rather than
   multiple functions

 - Add the ability to make 'text' properties be passworded
2014-04-02 00:42:12 -07:00
jp9000
d9251f9e87 Add source properties window (very preliminary)
- Add a properties window for sources so that you can now actually edit
   the settings for sources.  Also, display the source by itself in the
   window (Note: not working on mac, and possibly not working on linux).

   When changing the settings for a source, it will call
   obs_source_update on that source when you have modified any values
   automatically.

 - Add a properties 'widget', eventually I want to turn this in to a
   regular nice properties view like you'd see in the designer, but
   right now it just uses a form layout in a QScrollArea with regular
   controls to display the properties.  It's clunky but works for the
   time being.

 - Make it so that swap chains and the main graphics subsystem will
   automatically use at least one backbuffer if none was specified

 - Fix bug where displays weren't added to the main display array

 - Make it so that you can get the properties of a source via the actual
   pointer of a source/encoder/output in addition to being able to look
   up properties via identifier.

 - When registering source types, check for required functions (wasn't
   doing it before).  getheight/getwidth should not be optional if it's
   a video source as well.

 - Add an RAII OBSObj wrapper to obs.hpp for non-reference-counted
   libobs pointers

 - Add an RAII OBSSignal wrapper to obs.hpp for libobs signals to
   automatically disconnect them on destruction

 - Move the "scale and center" calculation in window-basic-main.cpp to
   its own function and in its own source file

 - Add an 'update' callback to WASAPI audio sources
2014-03-23 01:07:54 -07:00
jp9000
a9f5959b3c Fix an error and a few warnings
The strings didn't have ending double quotes.  No clue why this didn't
fail in GCC and VC.  Well, VC is horrible but I expected better out of
GCC.
2014-03-07 17:19:26 -07:00
jp9000
2448d0f229 Load up the lists of audio devices in settings
It will now load up a the list of audio input/output devices in the
combo boxes in audio settings.
2014-03-06 07:02:25 -07:00
jp9000
348588254c Add WASAPI audio capture
- Add WASAPI audio capture for windows, input and output

 - Check for null pointer in os_dlopen

 - Add exception-safe 'WinHandle' and 'CoTaskMemPtr' helper classes that
   will automatically call CloseHandle on handles and call CoTaskMemFree
   on certain types of memory returned from windows functions

 - Changed the wide <-> MBS/UTF8 conversion functions so that you use
   buffers (like these functions are *supposed* to behave), and changed
   the ones that allocate to a different naming scheme to be safe
2014-03-04 07:07:13 -07:00
jp9000
9c6da6f52d Split output/input audio capture sources
- Split input and output audio captures so that they're different
   sources.  This allows easier handling and enumeration of audio
   devices without having to do some sort of string processing.

   This way the user interface code can handle this a bit more easily,
   and so that it doesn't confuse users either.  This should be done for
   all audio capture sources for all operating systems.  You don't have
   to duplicate any code, you just need to create input/output wrapper
   functions to designate the audio as input or output before creation.

 - Make it detect soundflower and wavtap devices as mac "output" devices
   (even though they're actually input) for the mac output capture, and
   make it so that users can select a default output capture and
   automatically use soundflower or wavtap.

   I'm not entirely happy about having to do this, but because mac is
   designed this way, this is really the only way to handle it that
   makes it easier for users and UI code to deal with.

   Note that soundflower and wavtap are still also designated as input
   devices, so will still show up in input device enumeration.

 - Remove pragma messages because they were kind polluting the other
   compiler messages and just getting in the way.  In the future we can
   just do a grep for TODO to find them.

 - Redo list property again, this time using a safer internal array,
   rather than requiring sketchy array inputs.  Having functions handle
   everything behind the scenes is much safer.

 - Remove the reference counter debug log code, as it was included
   unintentionally in a commit.
2014-03-03 02:56:54 -07:00
jp9000
b4ef6cee91 Remove categories from properties
Categories added an unnecessary complexity to making properties, and
would very likely almost never be used in most cases, and were more of a
display feature.  The main issue is that it made property data more
complex to work with, and I just didn't feel comfortable with that.

Also, added a function to allow you to retrieve a porperty just by its
name.
2014-03-02 21:19:44 -07:00
jp9000
9db52da6a1 Fix non-VS compile issues
As usual, microsoft treats all enums as integers, rather than actually
even checking the enum type.  Worthless compiler.  Just complete
garbage.
2014-03-02 07:41:55 -07:00
jp9000
1eeece5b97 Simplify and improve 'list' property
When a source/output/etc has a property of a 'list' type, there was no
way to get the names associated with its values.  That, and it only
supported lists of either text, or enums (0..[value] only).

Now, you can associate translated names with those values, and use
integer, float, or string values.  Put it all in to one function as well
to simplify its usage.

I plan on using this to help get enumerations from devices/etc for
certain types of sources.  For example, if I get the properties of an
audio source, I'd like to have a list of available devices with it as
well.
2014-03-02 06:32:47 -07:00
jp9000
268e4e7811 Add more checks for NULL pointers 2014-02-23 22:39:33 -07:00
jp9000
b067440f73 Use bzalloc instead of bmalloc then memset
Reduces needless code repetition and still allows for proper memory
alignment.  Cleans up the code a bit.
2014-02-09 12:34:07 -07:00
jp9000
458325fc6f Add property list callbacks
- Add property list callbacks to sources/outputs/encoders so that if
  necessary user interface can be automatically generated or perhaps a
  property list widget can be used for them.

- Change some of the property API names.  obs_property_list_t felt a bit
  awkward when actually using it, so I just renamed it to
  obs_properties_t.

- Removed the getdata/setdata nad getparam/setparam functions from
  sources/services, they will be superseded by the dynamic procedure
  call API.
2014-02-01 22:46:13 -07:00
jp9000
0d17d13116 Implement properties definition interface
Implement a properties definition interface to allow modules to export
general properties associated with objects of libobs.

The properties definition interface allows the option for automatic
settings UI generation (which will make simple plugins easier to develop
without the need for user interface), as well as allow real-time
property editing of values of things like sources/outputs/etc without
having to open property dialogs.  More property types can be added in
the future as needed as well.
2014-02-01 18:01:31 -07:00