Commit Graph

1908 Commits (4993f2fa22c35542beb3c0c22b4df4656892267f)

Author SHA1 Message Date
jp9000 4993f2fa22 UI: Use VScrollArea for volume control area 2015-01-03 03:02:23 -08:00
jp9000 2c796e4b7b UI: Add vertical scroll area subclass
The regular scroll area can expand horizontally, but the problem with
this is that sometimes there are controls within it that expand way too
big.

For example, the properties window for window capture can have a list of
windows where the titles of the windows are really really long, and it
causes the properties to extend way too far to the right, making the
window look really unusual.

Another example are the volume controls in the main window that can
expand way to the right if the name of a source is really long, causing
the volume control to stretch way too far to the right, making the
volume controls difficult to use when that happens.

So this just makes it so it sets the maximum width of a scroll area's
internal widget to the actual width of the scroll area, preventing it
from going off the side of the scroll area.
2015-01-03 02:42:57 -08:00
jp9000 824c7b02c9 UI: Add crash report dialog
This crash report dialog is mostly just for the windows crash handling
code.  If a crash occurs, the user will be able to view the crash report
and post it on the forums or give it to a developer for debugging
purposes.
2015-01-03 02:37:21 -08:00
jp9000 e3068ed985 libobs: Add win32 crash handler
A slightly refactored version of R1CH's crash handler, allows crash
handling for windows which provides stack traces of all threads and a
list of all loaded modules.  Also shows the processor, windows version,
and current libobs version.
2015-01-03 02:37:21 -08:00
jp9000 f93b2fe794 Set various thread names
Helps identify which threads are which when debugging
2015-01-03 02:37:20 -08:00
jp9000 144fb925ff libobs: Add ability to set thread names 2015-01-03 02:37:20 -08:00
jp9000 3259a6831b obs-x264: Fix color space/range not being set
I originally had it set the color space and color range in the video
info callback, but I forgot that it's a function that's called after the
encoder is initialized.  You can change the color space and color range,
but you have to reconfigure the encoder, and there's no real reason to
do that.
2015-01-03 02:37:19 -08:00
jp9000 92c154017b libobs: Use def. colorspace when scaling encoder
When the encoder is set to scale to a different resolution than the obs
output resolution, make sure it uses the current video colorspace and
range by default.
2015-01-03 02:37:19 -08:00
jp9000 f466e9ec1c win-capture: Add win8+ monitor capture
Uses the output duplicator API in order to get a high performance
monitor capture on windows 8+.  This is actually designed to be
interchangeable with regular GDI-based monitor capture (uses the same
source id).
2015-01-03 02:37:18 -08:00
jp9000 d3abdf39a2 win-capture: Don't draw cursor if outside area 2015-01-03 02:37:18 -08:00
jp9000 d6e98829ca win-dshow: Add buffering options
Allow the user to select whether to buffer the source or not.  The
settings are auto-detect, on, and off.  Auto-Detect turns it off for
non-encoded devices, and on for encoded devices.

Webcams, internal devices, and other such things on windows do not
really need to be buffered, and buffering incurs a tiny bit of delay, so
turning off buffering is actually a little better for non-encoded
devices.
2015-01-03 02:37:17 -08:00
jp9000 a87fe6d783 libobs: Add wstrstri function
Performs a case-insensitive search for a wide-character string within
another wide-character string.
2015-01-03 02:37:16 -08:00
jp9000 9a91bbc16c libobs: Make astrstri a bit more C-compliant
I actually kind of hate how strstr returns a non-const even though it
takes a const parameter, but I can understand why they made it that way.
They really should have split it in to two functions though, one const
and one non-const or something.  But alas, ultimately for a C programmer
who knows what they're doing it isn't a huge deal.
2015-01-03 02:37:16 -08:00
jp9000 f2287c8a28 libobs: Add obs_source_set_default_flags
This allows sources to set default flags on creation without interfering
with user set flags
2015-01-03 02:37:15 -08:00
jp9000 eac55edca0 libobs: Add obs_source_showing function
This allows the ability to see whether the source is being displayed
somewhere (though not necessarily active in the main output)
2015-01-03 02:37:15 -08:00
jp9000 fd8f8cfda8 libobs: Fix potential null pointer dereference 2015-01-03 02:37:14 -08:00
jp9000 e14050bbe1 libobs: Fix crash if missing plugin for a source
I forgot that the info variable may be intentionally NULL if a source's
plugin in missing.
2015-01-03 02:37:14 -08:00
jp9000 44b8c24f34 libobs: Add output duplicator support
This adds support for the windows 8+ output duplicator feature which
allows the efficient capturing of a specific monitor connected to the
currently used device.
2015-01-03 02:37:13 -08:00
jp9000 a5447b5fd8 libobs-d3d11: Move DXGI -> GS format conversion
Move the DXGI -> GS format conversion function to d3d11-subsystem.hpp
instead of being exclusively in the d3d11-texture2d.cpp function.
2015-01-03 02:37:12 -08:00
Jim 92659ba69b Merge pull request #321 from fryshorts/volume-handling-fixes
Volume change signal fixes
2015-01-02 14:57:20 -08:00
Jim 39034edd52 Merge pull request #320 from 2mac/master
Update INSTALL
2015-01-02 14:52:10 -08:00
fryshorts 10a0b08ec9 obs: Fix signal in advanced volume controls
Suppress signals of the volume input when setting a value. This stops
the volume control from setting the source volume when it receives the
volume changed event from the source.
2015-01-02 20:11:40 +01:00
fryshorts 89792865a1 obs: Fix signal in volume control
Suppress signals of the volume slider when setting a value. This stops
the volume control from setting the source volume when it receives the
volume changed event from the source.
2015-01-02 20:11:28 +01:00
fryshorts 0f8b2faed4 obs: Fix label in volume control
Use a dedicated method for setting the dB label in the volume control
and make sure to call it regardless if the volume was changed through
the slider or from somewhere else.
2015-01-02 19:31:09 +01:00
jp9000 11106c2fce libobs: Redesign/optimize frame encoding handling
Previously, the design for the interaction between the encoder thread
and the graphics thread was that the encoder thread would signal to the
graphics thread when to start drawing each frame.  The original idea
behind this was to prevent mutually cascading stalls of encoding or
graphics rendering (i.e., if rendering took too long, then encoding
would have to catch up, then rendering would have to catch up again, and
so on, cascading upon each other).  The ultimate goal was to prevent
encoding from impacting graphics and vise versa.

However, eventually it was realized that there were some fundamental
flaws with this design.

1. Stray frame duplication.  You could not guarantee that a frame would
   render on time, so sometimes frames would unintentionally be lost if
   there was any sort of minor hiccup or if the thread took too long to
   be scheduled I'm guessing.

2. Frame timing in the rendering thread was less accurate.  The only
   place where frame timing was accurate was in the encoder thread, and
   the graphics thread was at the whim of thread scheduling.  On higher
   end computers it was typically fine, but it was just generally not
   guaranteed that a frame would be rendered when it was supposed to be
   rendered.

So the solution (originally proposed by r1ch and paibox) is to instead
keep the encoding and graphics threads separate as usual, but instead of
the encoder thread controlling the graphics thread, the graphics thread
now controls the encoder thread.  The encoder thread keeps a limited
cache of frames, then the graphics thread copies frames in to the cache
and increments a semaphore to schedule the encoder thread to encode that
data.

In the cache, each frame has an encode counter.  If the frame cache is
full (e.g., the encoder taking too long to return frames), it will not
cache a new frame, but instead will just increment the counter on the
last frame in the cache to schedule that frame to encode again, ensuring
that frames are on time and reducing CPU usage by lowering video
complexity.  If the graphics thread takes too long to render a frame,
then it will add that frame with the count value set to the total amount
of frames that were missed (actual legitimately duplicated frames).

Because the cache gives many frames of breathing room for the encoder to
encode frames, this design helps improve results especially when using
encoding presets that have higher complexity and CPU usage, minimizing
the risk of needlessly skipped or duplicated frames.

I also managed to sneak in what should be a bit of an optimization to
reduce copying of frame data, though how much of an optimization it
ultimately ends up being is debatable.

So to sum it up, this commit increases accuracy of frame timing,
completely removes stray frame duplication, gives better results for
higher complexity encoding presets, and potentially optimizes the frame
pipeline a tiny bit.
2014-12-31 04:03:47 -08:00
jp9000 11dd7912ce libobs: Fix bug with frame output handling
The boolean variables which stored whether frames have been
rendered/downloaded/converted/etc were not being reset when video
restarted, causing frames to not be sent in the correct order whenever
video was reset.  This could lead to minor desync of video/audio.
2014-12-31 04:03:46 -08:00
jp9000 a7d2450d8e obs-outputs: Fix FLV corruption bug
The 'sent_headers' member variable of the FLV output would not be reset
when the output was restarted, causing important data to not be written,
thus creating an invalid FLV file.
2014-12-31 04:03:46 -08:00
jp9000 244280335b libobs: Fix potential crash on output stop
In certain circumstances where the output was stopping, and where data
took a long enough time to send (such as when using an encoding preset
that causes high CPU usage), the output would sometimes still send data
even after it was stopped, typically causing the output to crash.
2014-12-31 04:03:45 -08:00
jp9000 8e1549820b libobs/media-io: Add frame copying function 2014-12-31 04:03:45 -08:00
jp9000 5d0551eb27 libobs/media-io: Add #pragma once to video-frame.h 2014-12-31 04:03:44 -08:00
David McMackins II 65fd5d1eb1 Update INSTALL 2014-12-29 20:28:25 -06:00
Jim 903bb137a0 Merge pull request #312 from fryshorts/xshm-xcb-conversion
linux-capture: Xshm plugin xcb conversion
2014-12-28 23:31:32 -08:00
jp9000 caa6251054 libobs: Fix force mono channel count
I unintentionally made it use obs_source::sample_info instead of using
the actual target channel count, which is designated by the OBS output
sampler info.  obs_source::sample_info is actually used to indicate the
currently set sampler information for incoming samples.  So if a source
is outputting 5.1 channel 48khz audio, and OBS is running at stereo
44.1khz, then the obs_source::sample_info value would be set to
5.1/48khz, not the other way around.  It indicates what the source
itself is running at, not what OBS is running at.

I suppose the variable needs a better name because even I used it
incorrectly despite actually having been the one who wrote it.
2014-12-28 03:51:06 -08:00
jp9000 6fc52dfb16 UI: Add advanced audio properties dialog
This dialog gives options such as increasing audio past 100%, forcing
the audio of a source to mono, and setting the audio sync offset of a
source (which was an oft-requested feature)
2014-12-28 01:51:56 -08:00
jp9000 ce6a1146cc libobs: Remove inline on a function
The copy_audio_data function really shouldn't be inlined because it's
being called twice.  It's somewhat unnecessary, I think I left it inline
by accident.
2014-12-28 01:51:55 -08:00
jp9000 63c43b649d libobs: Add flag to force source audio to mono
This flag is actually useful under a number of circumstances, and has
been requested a number of times.
2014-12-28 01:51:55 -08:00
jp9000 c431ac6aa5 libobs: Refactor source volume transition design
This changes the way source volume handles transitioning between being
active and inactive states.

The previous way that transitioning handled volume was that it set the
presentation volume of the source and all of its sub-sources to 0.0 if
the source was inactive, and 1.0 if active.  Transition sources would
then also set the presentation volume for sub-sources to whatever their
transitioning volume was.  However, the problem with this is that the
design didn't take in to account if the source or its sub-sources were
active anywhere else, so because of that it would break if that ever
happened, and I didn't realize that when I was designing it.

So instead, this completely overhauls the design of handling
transitioning volume.  Each frame, it'll go through all sources and
check whether they're active or inactive and set the base volume
accordingly.  If transitions are currently active, it will actually walk
the active source tree and check whether the source is in a
transitioning state somewhere.

 - If the source is a sub-source of a transition, and it's not active
   outside of the transition, then the transition will control the
   volume of the source.

 - If the source is a sub-source of a transition, but it's also active
   outside of the transition, it'll defer to whichever is louder.

This also adds a new callback to the obs_source_info structure for
transition sources, get_transition_volume, which is called to get the
transitioning volume of a sub-source.
2014-12-28 01:51:43 -08:00
jp9000 10f8988667 libobs: Keep transition reference counter
The reason to keep a reference counter for transitions is due to an
optimization I'm planning on when calculating transition volumes.  I'm
planning on walking the source tree to be able to calculate the current
base volume of a source, but *only* if there are transitions active,
because the only time that the volume can be anything other than 1.0
or 0.0 is when there are active transitions, which may change the base
volume of a source.
2014-12-28 01:04:29 -08:00
jp9000 6eab6ceff5 (API Change) libobs: Add _FLAG to source flags
Changes OBS_SOURCE_UNBUFFERED to OBS_SOURCE_FLAG_UNBUFFERED to make
naming a bit better for source flags.
2014-12-28 01:04:28 -08:00
jp9000 fb09db432f libobs: Save/load source audio sync and flags
When a source is being saved, include the audio sync as well as the
flags.
2014-12-28 01:04:28 -08:00
jp9000 48210d41a6 libobs: Do not set presentation volume on children
When the presentation volume is set for a source, it's set for all of
its children and their children.  The original intention for doing this
was to be able to use it for transitioning, but honestly it's just bad
design, and I feel there are better ways to handle transitioning volume.
2014-12-28 01:04:27 -08:00
jp9000 fb6f8721e2 libobs: Add 'audio_sync' source signal
Adds a signal is called when the sync offset has changed for a source.
2014-12-28 01:04:27 -08:00
jp9000 e29a1fd367 libobs: Prevent infinite source recursion
Changed the design from using obs_source::enum_refs to just simply
preventing infinite source recursion in general, rather than allowing it
through the enum_refs variable.  obs_source_add_child has been changed
so that it now returns a boolean, and if the function fails, it means
that the child cannot be added due to that potential recursion.
2014-12-28 01:04:26 -08:00
jp9000 1ed4c2a920 libobs: Remove unused audio level source vars
These variables are no longer used by sources anymore, as they were
removed in favor of the new source audio control handlers.
2014-12-28 01:04:26 -08:00
jp9000 c72284f387 libobs: Fix a few warnings
Two integers are needlessly converted to floating points for what should
be an integer operation.  One of those floats is then used for another
integer operation later, where the original integer value should have
been used.  So essentially there was an int -> float -> int conversion
going on, which could lead to potential loss of data due to floating
point precision.

There were also some general 64bit -> 32bit conversion warnings.
2014-12-28 01:03:10 -08:00
Jim 3816c5a0f5 Merge pull request #316 from fryshorts/qt-stuff
obs: Refactor network requests.
2014-12-27 13:21:49 -08:00
Jim 5a5f865934 Merge pull request #319 from skwerlman/patch-1
fixed debian source install instructions
2014-12-27 13:14:11 -08:00
skwerlman 4103883967 added two missing deps
OBS seems to require libx264-dev and libxinerama0-dev now, so I added them
2014-12-27 07:37:15 -05:00
skwerlman da4577a72b fixed debian source install instructions
missing 'install' on line 180
2014-12-27 07:25:31 -05:00
fryshorts ca8ac4e809 obs: Refactor network requests.
Remove unneeded class members for request and buffer handling.
Let Qt do all the hard work here, keeping track of requests and
associated data.
2014-12-25 14:53:09 +01:00