Commit Graph

439 Commits (caf8ca9ba8a1ab5c3d5d6067b8a2d7baf4a0919e)

Author SHA1 Message Date
jp9000 caf8ca9ba8 Remove 'shader' param from shader param functions 2014-06-25 19:50:08 -07:00
jp9000 27010a2f56 Add a 'flush' command to graphics subsystem
...I'm actually concerned that I went a bit overkill trying to prevent
backwards compatibility issues with this abstraction design, because
this is a large number of files that have to be modified just to add a
single graphics subsystem export.  Someone's going to strangle me, and
when you know that someone might strangle you, that means that you did
something wrong.  We'll have to look in to simplifying this in the
future without killing backward compatibility safety.
2014-06-25 19:32:34 -07:00
jp9000 749cff2e3a Fix device_copy_texture_region export formatting 2014-06-25 18:45:27 -07:00
jp9000 77edf6f263 Remove unused parameter for texture file loading 2014-06-25 18:34:23 -07:00
jp9000 16f45e7244 Remove unused texture file loading functions
Getting cubemaps and volume textures from file is very unlikely to ever
happen for our purposes.
2014-06-25 18:33:03 -07:00
Palana 603c87cd8f Fix b(w)strdup_n returning NULL for empty strings 2014-06-25 23:18:18 +02:00
Jim 2ea50cab36 Merge pull request #124 from jp9000/new-locale-handling
Update to new module locale API
2014-06-25 12:58:05 -07:00
jp9000 1abf91577e Add module callbacks for loading locale data
The module callback obs_module_set_locale will be called after loading
the module, and any time the locale is manually changed via core API.

When this function is called, the module is expected to load new text
lookup values for all the text it uses based upon the current locale.
2014-06-25 12:37:06 -07:00
jp9000 0b4a259e56 Remove 'locale' parameter from all callbacks
The locale parameter was a mistake, because it puts extra needless
burden upon the module developer to have to handle this variable for
each and every single callback function.  The parameter is being removed
in favor of a single centralized module callback function that
specifically updates locale information for a module only when needed.
2014-06-25 12:36:26 -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
jp9000 899f053034 Add API for setting/getting current locale
This API is used to set the current locale for libobs, which it will set
for all modules when a module is loaded or specifically when the locale
is manually changed.
2014-06-25 12:36:17 -07:00
Palana 070f6cb6a6 Add DStr move assignment operator 2014-06-25 17:00:02 +02:00
Palana 5afedb1092 Fix DStr move constructor
Previously dstr_move would try to free the uninitialized value in
DStr::str::array
2014-06-25 17:00:01 +02:00
Palana 113454a2c8 Fix export for obs_property_list_item_remove 2014-06-25 15:29:00 +02:00
jp9000 8aa49cc9ad Remove unused graphics subsystem functions
These functions were mostly related to being able to set true fullscreen
mode -- however, this has no place for our purposes, and these functions
were just sitting empty and unused, so they should be removed.

Besides, fullscreen mode only applies to the windows operating system.
2014-06-25 01:54:32 -07:00
jp9000 f4e7a893c5 Remove 'rebuild' variable from vertexbuffer_flush
This variable is currently somewhat pointless, I was originally going to
use it to tell the graphics subsystem to completely rebuild the internal
vertex buffers, but it would be bad/inefficient to allow that
functionality.
2014-06-25 01:54:32 -07:00
Palana c2bb95250b Add obs-data autoselect functions
These are meant to reflect auto-detection configuration changes that
should not be written to the config, for example, frame rate changes
for a camera where the (user-/config-file-)configured frame rate isn't
available but a similar frame rate can be automatically chosen
2014-06-22 01:32:09 +02:00
Palana 7f172eb1b4 Change semantics of obs-data default values
Default values are now permanently stored in the obs_data_items and
can be accessed via the new get_default functions

Also default values are no longer serialized to JSON to ease transition
to new default values
2014-06-22 01:32:09 +02:00
Palana a6b52156b2 Move obs-data accessor value handling logic into static helper functions 2014-06-22 01:32:09 +02:00
Palana 7cbc260f90 Unify obs_data_set* and obs_data_item_set* funtion implementations 2014-06-22 01:32:09 +02:00
Palana 92e9284270 Refactor obs-data internals to forward reallocation results to callers 2014-06-22 01:32:09 +02:00
Palana 0d77dc702d Refactor set_item(_def) to only look up items if no item is supplied 2014-06-22 01:32:09 +02:00
Palana 23e2f623f9 Unify obs_data_set* and obs_data_set_default_* function implementations 2014-06-22 01:32:08 +02:00
Palana f29f4d8009 Unify obs_data_get* and obs_data_item_get* functions handling 2014-06-22 01:32:08 +02: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
Palana 56b3685940 Add include for ptrdiff_t 2014-06-17 17:02:28 +02:00
jp9000 9b23914c37 libobs: Add 'initialize' callback to services
The 'initialize' callback is used before the encoders/output start up so
it can adjust encoder settings to required values if needed.

Also added the function 'obs_encoder_active' that returns true or false
depending on whether that encoder is active or not.
2014-06-16 21:37:53 -07:00
Jim dfabbf7936 Merge pull request #111 from antihax/cleanup
Removed unresolved EXPORT from previous revision of volume meter & modified locale not found error.
2014-06-16 18:13:20 -07:00
jp9000 ed5b4f590c Fix a number of warnings
Structures with anonymous unions would a warning when you do a brace
assignment on them.

Also fixed some unused parameters and removed some unused variables.
2014-06-16 17:55:48 -07:00
Danni af1408d84f Removed unresolved EXPORT from previous revision of volume meter 2014-06-16 18:52:55 -05:00
jp9000 452e0695f4 UI: Add scene editing
So, scene editing was interesting (and by interesting I mean
excruciating).  I almost implemented 'manipulator' visuals (ala 3dsmax
for example), and used 3 modes for controlling position/rotation/size,
but in a 2D editing, it felt clunky, so I defaulted back to simply
click-and-drag for movement, and then took a similar though slightly
different looking approach for handling scaling and reszing.

I also added a number of menu item helpers related to positioning,
scaling, rotating, flipping, and resetting the transform back to
default.

There is also a new 'transform' dialog (accessible via menu) which will
allow you to manually edit every single transform variable of a scene
item directly if desired.

If a scene item does not have bounds active, pulling on the sides of a
source will cause it to resize it via base scale rather than by the
bounding box system (if the source resizes that scale will apply).  If
bounds are active, it will modify the bounding box only instead.

How a source scales when a bounding box is active depends on the type of
bounds being used.  You can set it to scale to the inner bounds, the
outer bounds, scale to bounds width only, scale to bounds height only,
and a setting to stretch to bounds (which forces a source to always draw
at the bounding box size rather than be affected by its internal size).
You can also set it to be used as a 'maximum' size, so that the source
doesn't necessarily get scaled unless it extends beyond the bounds.

Like in OBS1, objects will snap to the edges unless the control key is
pressed.  However, this will now happen even if the object is rotated or
oriented in any strange way.  Snapping will also occur when stretching
or changing the bounding box size.
2014-06-15 20:33:13 -07:00
jp9000 b23f8cc6e1 Scenes: Implement more item positioning features
There are a ridiculous number of features related to scaling and
positioning due to requests by a number of people who complained that
they hated the way that OBS1 would always resize their sources when the
source's base size changed.  There were also people who wanted more
control for how the resizing was handled, or the ability to completely
prevent resizing entirely if desired.  So I made it so that you can
optionally use a 'bounds' system, which allows you to specify different
styles of controlling resizing.

If disabled, the source will always automatically resize and only the
base scale is applied.  If enabled, you have a variety of different ways
to limit/control how it can resize within the bounds, or make it so it
can't resize at all.  You can also control alignment within that
bounding box, so you can make it so that a source always aligns to a
side or corner of the box.

I also added an alignment value which changes how the source is oriented
relative to the position of the scene item.  For example, setting
bottom-right alignment will make it so that the position of the item is
the bottom right corner of the source.  When the source resizies, it
will resize leftward and upward in that case, which solves the problem
of how a source resizes relative to a desired position.
2014-06-15 20:33:13 -07:00
jp9000 254d830c08 Make a minor OCD tweak to align parameters 2014-06-15 00:14:08 -07:00
jp9000 65f84cf356 Add solid_effect variable to obs_core_video 2014-06-14 23:59:39 -07:00
jp9000 89df81e72d libobs: Add helper functions for math data 2014-06-14 23:57:00 -07:00
jp9000 2a7f202e7e libobs: Add 'solid' effect for basic primitives 2014-06-14 23:55:10 -07:00
jp9000 44066f8e61 Fix null pointer dereference in text lookup
Fix potential null pointer dereference for when splitting a node.
2014-06-14 23:47:22 -07:00
jp9000 4b17bb89ed Allow signal callback deletion while signalling
I encountered a situation where I wanted to delete a callback for a
signal while inside of that signal.  However it would hard lock, and
even after that, it would mess up the loop for the callback list.

So, change the mutex of the individual signals to a recursive-style
mutex, and then if a callback of a signal is deleted while currently in
that signal, just mark it for deletion, which will happen after the
signal is complete.
2014-06-14 23:42:00 -07:00
jp9000 9d66c96299 Fix bug with creating immediate vertex buffers
Check to make sure graphics subsystem pointer isn't null before
derefrencing, and fix bugs when creating vertex buffers from
immediate-style helpers
2014-06-14 23:30:58 -07:00
jp9000 1c2a0524b7 Change graphics subsystem to 4x4 matrices
4x4 matrices aren't as optimal, but are much more sensible to handle
when you want to do more advanced stuff like scaling, skewing, or
inversion.
2014-06-14 23:17:04 -07:00
Danni a91174e2b2 Slight modification of mixing function 2014-06-08 11:48:38 -05:00
jp9000 42a0411f1c libobs: Fix switch warning 2014-06-07 06:04:13 -07:00
jp9000 20a61ace77 libobs: Account for volume with audio levels 2014-06-06 08:56:37 -07:00
Jim 4eb6267372 Merge pull request #90 from antihax/master
Added simple volume meter for reference of input levels.
2014-06-03 05:15:18 -07:00
jp9000 4ccf928ea1 libobs/media-io: Remove obsolete mixing functions
Also, Remove the volume level processing from audio-io.c, it was moved
to obs_source instead.
2014-06-03 04:50:15 -07:00
jp9000 5cd64ce7f2 libobs: Add level/magnitude/peak volume levels
This replaces the older code which simply queried the max volume level
value for any given audio.

I'm still not 100% sure on if this is how I want to approach the
problem, particularly, whether this should be done in obs_source or in
audio_line, but it can always be moved later if needed.

This uses the calculations by the awesome Bill Hamilton that OBS1 used
for its volume levels.  It calculates the current max (level),
magnitude, and current peak.  This data then can be used to create
awesome volume meter controls later on.

NOTE: Will probably need optimization, does one float at a time right
now.

Also, change some of the naming conventions.  I actually need to change
a lot of the naming conventions in general so that all words are
separated by underscores.  Kind of a bad practice there on my part.
2014-06-03 04:48:20 -07:00
jp9000 d891e9772c libobs: Fix signal handler lock bug
There was a return statement within a section of code that had a locked
mutex.
2014-06-03 04:41:12 -07:00
Palana 7d0a1502bd Fix typo in conversion technique name (there is no UYUV, only UYVY) 2014-06-02 16:44:37 +02:00
jp9000 1343d6bdee libobs: Allow deferred source udpate on create
This allows sources to optionally defer update on creation in order to
prevent updates from being called from threads other than the video
thread.
2014-05-30 03:24:15 -07:00