Commit Graph

1818 Commits (4ad41004e03076d189e21ec3084338ee4855df31)

Author SHA1 Message Date
Jim 328bebb2cb Merge pull request #304 from fryshorts/obs-audio-controls
Add advanced audio controls
2014-11-26 19:23:23 -08:00
jp9000 7e78d08c75 Clean up CONTRIBUTING file
There's a little too much junk in the CONTRIBUTING file.  I feel like
it's unnecessary to say some of the things that were being said in
there.  It really needs to be to the point
2014-11-26 18:27:36 -08:00
fryshorts 3fea6997a7 obs: Use new fader from libobs for volume control
This replaces the code for volume control with a newer version that
uses the new fader implementation in order to control the fader/slider
position and source volume.
The volume label will now indicate the gain in dB instead of percent,
mainly because it looks cool and is easy to do.
Due to libobs saving the multiplier option for the source instead of
the slider/fader positon, existing volume levels will (mostly) stay
the same with only the slider beeing at a different position.
This is of course within the resolution of the slider (100 steps).
2014-11-26 20:07:26 +01:00
fryshorts 8dcbd77bf2 libobs: Add audio control functions
This adds a new library of audio control functions mainly for the use in
GUIS. For now it includes an implementation of a software fader that can
be attached to sources in order to easily control the volume.
The fader can translate between fader-position, volume in dB and
multiplier with a configurable mapping function.
Currently only a cubic mapping (mul = fader_pos ^ 3) is included, but
different mappings can easily be added.

Due to libobs saving/restoring the source volume from the multiplier,
the volume levels for existing source will stay the same, and live
changing of the mapping will work without changing the source volume.
2014-11-26 20:07:26 +01:00
jp9000 e994d6d498 graphics: Add gs_effect_loop helper function
This function greatly simplifies the use of effects by making it so you
can call this function in a simple loop.  This reduces boilerplate and
makes drawing with effects much easier.  The gs_effect_loop function
will now automatically handle all the functions required to do drawing.

---------------------
Before:

gs_technique_t *technique = gs_effect_get_technique("technique");

size_t passes = gs_technique_begin(technique);
for (size_t pass = 0; pass < passes; pass++) {
	gs_technique_begin_pass(technique, pass);

	[draw]

	gs_technique_end_pass(technique);
}
gs_technique_end(technique);

---------------------
After:

while (gs_effect_loop(effect, "technique")) {
	[draw]
}
2014-11-19 19:46:27 -08:00
jp9000 cdf36cf8ba Add helper functions for drawing sources
If you look at the previous commits, you'll see I had added
obs_source_draw before.  For custom drawn sources in particular, each
time obs_source_draw was called, it would restart the effect and its
passes for each draw call, which was not optimal.  It should really use
the effect functions for that.  I'll have to add a function to simplify
effect usage.

I also realized that including the color matrix parameters in
obs_source_draw made the function kind of messy to use; instead,
separating the color matrix stuff out to
obs_source_draw_set_color_matrix feels a lot more clean.

On top of that, having the ability to set the position would be nice to
have as well, rather than having to mess with the matrix stuff each
time, so I also added that for the sake of convenience.

obs_source_draw will draw a texture sprite, optionally of a specific
size and/or at a specific position, as well as optionally inverted.  The
texture used will be set to the 'image' parameter of whatever effect is
currently active.

obs_source_draw_set_color_matrix will set the color matrix value if the
drawing requires color matrices.  It will set the 'color_matrix',
'color_range_min', and 'color_range_max' parameters of whatever effect
is currently active.

Overall, these feel much more clean to use than the previous iteration.
2014-11-19 19:08:39 -08:00
jp9000 ed2d9936a5 Revert "Add obs_source_draw helper function"
This reverts commit ab5a76901b.
2014-11-19 18:04:38 -08:00
jp9000 8b4120bf7a libobs: Add function to get cur. effect technique 2014-11-19 18:04:38 -08:00
Jim 963f052c2f Merge pull request #303 from fryshorts/xshm-different-xserver
linux-xshm: Allow capturing from a different X server
2014-11-19 16:22:34 -08:00
fryshorts cc56634e91 linux-xshm: Handle missing screens.
This adds a check to the screen enumeration in order to handle missing
screens by adding them to the list but disabling them.
2014-11-20 00:14:10 +01:00
fryshorts 67ca94f7e4 linux-xshm: Add server property.
This adds a property to the source properties which lets the user
specify the X server to capture from. Since this is probably something
thats only useful under certain circumstances it is implemented as
an advanced setting which is only shown when the corresponding option
for advanced settings is checked.
2014-11-20 00:10:11 +01:00
fryshorts 04a7db867f linux-xshm: Refactoring of setup code.
This moves the code to start/stop the capture to respectively named
function in order to clean up the update function.
This means that the capture is stopped/started whenever the settings are
changed. While this increases overhead for some settings, this will also
enable future settings that require a full restart of capture process.
2014-11-18 21:03:50 +01:00
fryshorts a4d09fe742 linux-xshm: Small change for texture update function.
This removes the entering/leaving of the graphics context from this
function and requires the calling code to make sure the context is
present.
2014-11-18 21:03:50 +01:00
fryshorts cc52b432e7 linux-xshm: Improve geometry update function.
This adds the screen id from the source properties to the source
struct and changes the geometry function to use that value instead
of requiring the settings object of the source.
2014-11-18 21:03:50 +01:00
fryshorts 08c9f39220 linux-xshm: Use macro for logging.
This adds a macro to automatically prepend the plugin name to debug
statements like it is done in other plugins.
2014-11-18 21:03:50 +01:00
fryshorts 1a51d5fab7 linux-xshm: Improve source struct.
This adds documentation to the source struct and moves one bool to the
end to avoid a hole due to alignment.
2014-11-18 21:03:50 +01:00
Lexsus a2deddfa77 text-freetype2: Fix CR char. rendering as space
On windows, carriage return characters are used along with line feed
characters. When the carriage return is used, it's rendered as a space.
This removes carriage returns from strings before rendering them via
freetype.
2014-11-18 04:04:54 -08:00
Lexsus 9c34be8af1 obs-outputs: Allow blank RTMP stream key usage
Allows a blank stream key to be used for RTMP streams.
2014-11-18 03:45:49 -08:00
Jim b3312a7657 Merge pull request #300 from fryshorts/audio-perf
libobs: Replace fmaxf with inline comparison.
2014-11-17 10:27:38 -08:00
jp9000 ce99829d01 text-freetype2: Remove null pointer dereference 2014-11-17 06:47:49 -08:00
jp9000 f199e2c096 text-freetype2: Do not call wcslen in loop expr.
Doing this in the expression will cause it to execute the function every
time the expression is evaluated, which is needless cycles wasted.
Instead, call wcslen before the loops begin.
2014-11-17 06:47:49 -08:00
jp9000 ae862c16a6 obs-ffmpeg: If ffaac is used, change cutoff freq
If FFmpeg's experimental aac encoder is used, this changes the cutoff
frequency to better values in order to try to help make up for the
inherent lack of encoder quality a bit.  If FFmpeg is compiled to use
another encoder by default, these settings will not be applied.
2014-11-17 06:47:48 -08:00
jp9000 5888085a8e Allow hex numbers to be used in config data
This allows the 0x* format of hexadecimal integers to be used as config
integers.
2014-11-17 06:47:48 -08:00
jp9000 397dda78f8 Add config_open_string function
This allows opening ini config data from a string.  Before, it was only
possible to load config from a file.
2014-11-17 06:47:48 -08:00
jp9000 ab5a76901b Add obs_source_draw helper function
This function simplifies drawing textures for sources in order to help
reduce boilerplate code.  If a source is a custom drawn source, it will
automatically set up the effect to draw the sprite.  If it's not a
custom drawn source, it will simply draw the sprite as per normal.  If
the source uses a specific color matrix, it will also handle that as
well.
2014-11-17 06:47:47 -08:00
fryshorts ab0c2cf431 libobs: Replace fmaxf with inline comparison.
This replaces the call to fmaxf with the equivalent inline comparison
which is a bit faster (at least on linux).
2014-11-16 22:07:37 +01:00
Jim 4e61dd93c5 Merge pull request #299 from reboot/fix_creating_flipped_textures
Fix creating textures from image data with flipping
2014-11-15 16:14:36 -08:00
Christoph Hohmann 278aa141e3 Fix creating textures from image data with flipping
When the image data is copied into a texture with flipping set to true
each row has to be copied into the (height - row - 1)th row instead of
the row with the same number. Otherwise it will just create an unflipped
copy.
2014-11-15 13:03:04 +01:00
Jim f76ee956c9 Merge pull request #298 from ThoNohT/patch-1
Fixed 2 minor spelling errors.
2014-11-14 01:32:21 -08:00
Eric Bataille b5be8e656c Fixed 2 minor spelling errors. 2014-11-14 09:55:23 +01:00
Zachary Lund ab7fa5bdb4 linux-capture: Add X border option to xcomposite
XComposite, which is currently our only capture method for windows,
doesn't handle X border width. This works in a lot of cases but anytime
there's a border, a bug occurs where the lower right is clipped.  This
patch has two goals:

1) To position and size the capture texture correctly in accordance to
the border.

2) Adds a configuration option to allow people to toggle it (which in
most cases will simply do nothing) with a default of not including it.
2014-11-09 22:17:45 -08:00
jp9000 391dc0f267 Update to 0.6.4 2014-11-03 14:18:30 -08:00
jp9000 b4c797bc1d Fix asset crash interleaving with active encoders
Apparently the audio isn't guaranteed to start up past the first video
frame, so it would trigger that assert (which I'm glad I put in).  I
didn't originally have this happen when I was testing because my audio
buffering was not at the default value and didn't trigger it to occur.
A blunder on my part, and once again a fine example of how you should
never make assumptions about possible code path.
2014-11-03 14:13:14 -08:00
jp9000 37ffc7b448 Update to 0.6.3 2014-11-02 16:03:51 -08:00
jp9000 28ac194257 text-freetype2: Fix null pointer dereference
Somehow, there were fonts with empty face names.  Regardless, it's
always important to check your pointers.  Invalid pointers spell doom.
2014-10-31 20:39:37 -07:00
Palana a21a369ec9 mac-syphon: Track inject status and retry injecting if needed
Some applications defer loading OpenGL until after they are visible as
running applications, which causes SyphonInject to not install a server
on the first try (e.g. Minecraft does this)
2014-11-01 03:07:06 +01:00
Palana dfbe7156be mac-syphon: List bundle identifier and pid in case of duplicate names 2014-11-01 03:07:06 +01:00
Palana b766faedb3 mac-syphon: Inject the best match(es) only 2014-11-01 03:07:06 +01:00
Palana 20f805a850 mac-syphon: Keep old inject settings in case of partial match
In some cases the actual application (bundle identifier) would get
overwritten with a wrapper application bundle identifier when the
application names matched (this happened with e.g., Minecraft)
2014-11-01 03:07:05 +01:00
Palana 56d220395e mac-syphon: Move release calls to helper function 2014-11-01 03:07:05 +01:00
Palana afa172feea sparkle-updater: Enable delta update failure fallback
Refer to 53cad36953
for further details
2014-11-01 03:06:26 +01:00
Jim 32da2332fd Merge pull request #291 from dodgepong/latest-crowdin-translations
Add latest translations from CrowdIn
2014-10-31 18:42:33 -07:00
dodgepong 17804ec12f Add latest translations from CrowdIn 2014-10-31 21:02:47 -04:00
Jim ed51fd0efd Merge pull request #287 from fryshorts/doxygen
Add Doxygen configuration for creating api documentation
2014-10-29 20:41:05 -07:00
Jim 10a9133e7c Merge pull request #290 from jp9000/v4l2-improvements
linux-v4l2: Handle reconnection in properties
2014-10-29 10:52:55 -07:00
fryshorts d9a7b9062d linux-v4l2: Update properties when devices change.
This causes the properties for v4l2 sources to be refreshed when a
device is disconnected/connected.
2014-10-29 10:18:21 -07:00
fryshorts ac40408dfa linux-v4l2: Disable properties when device is not there.
This adds helper function to disable/enable all properties which is
used in the device selected callback to enable/disable the properties
when the selected device is available/unavailable.
2014-10-29 10:18:20 -07:00
fryshorts 3a85d662be linux-v4l2: Always display currently selected device.
This adds some code to the device enumeration that checks if the
currently selected device is present. In case it is not it will
add the device but disable it.
2014-10-29 10:18:20 -07:00
fryshorts 24d1495b84 linux-v4l2: Avoid nested device open/close.
This moves the calls to the property modified functions so the old
handler can close the device. Otherwise this would cause the device
to be opened multiple times.
2014-10-29 10:17:59 -07:00
fryshorts 1945804624 linux-v4l2: Make frame counter local.
This replaces the var in the source struct that was used to print out
the number of captured frames with a local one.
2014-10-29 09:41:34 -07:00