(Note: This commit also changes the UI)
Changed:
-------------------
void obs_load_sources(obs_data_array_t *sources_list);
To:
-------------------
void obs_load_sources(obs_data_array_t *sources_list,
obs_source_load_cb callback, void *private_data);
Signals should really never be required to use to make some function
work properly. The "source_load" signal was required for the
obs_load_sources function, but it's meant more for loading private data
in the settings, not for general loading of sources.
This changes it so that a callback is explicitly required to load the
sources.
Implements transitions, and introduces "Studio Mode" which allows live
editing of the same or different scenes while preserving what's
currently being displayed.
Studio Mode offers a number of new features:
- The ability to edit different scenes or the same scene without
modifying what's currently being displayed (of course)
- The ability to set up "quick transitions" with a desired transition
and duration that can be assigned hotkeys
- The option to create full copies of all sources in the program scene
to allow editing of source properties of the same scene live without
modifying the output, or (by default) just use references. (Note
however that certain sources cannot be duplicated, such as capture
sources, media sources, and device sources)
- Swap Mode (enabled by default) which swaps the program scene with
the preview scene when a transition completes
Currently, only non-configurable transitions (transitions without
properties) are listed, and the only transitions available as of this
writing are fade and cut. In future versions more transitions will be
added, such as swipe, stingers, and many other various sort of
transitions, and the UI will support being able to add/configure/remove
those sort of configurable transitions.
When right-clicking items in the preview window and getting context
menus for them, it would often make the wrong scene item be associated
with the context menu because of the fact that it was using
QListWidget::currentItem instead of querying the actual selected list.
You must query the actual selection list via QListWidget::selectedItems
because QListWidget::currentItem does not work properly for
multi-selection list widgets.
Prunes code used to workaround libobs "user sources" (such as
sourceSceneRefs) and instead simply holds its own references and saves
sources it chooses with obs_save_sources_filtered.
Having sleep or screensavers inhibited at all times was causing some
annoyances for people. Sleep/screensavers are now only inhibited when
the program is active or when a projector is open.
This reverts commit 35b2ce565a.
There is far too much potential for issues to occur if the first-time
start creates a display capture by default on linux and windows.
Display capture on windows laptops will not be guaranteed to capture
properly, leaving the user with a blank screen. Display capture on
linux downloads its image off the graphics processor, so it's quite
inefficient to have on by default.
So certain high-profile individuals were complaining that it was
difficult to configure recording settings for quality in OBS. So, I
decided to add a very easy-to-use auto-configuration for high quality
encoding -- including lossless encoding. This feature will
automatically configure ideal recording settings based upon a specified
quality level.
Recording quality presets added to simple output:
- Same as stream: Copies the encoded streaming data with no extra usage
hit.
- High quality: uses a higher CRF value (starting at 23) if using x264.
- Indistinguishable quality: uses a low CRF value (starting at 16) if
using x264.
- Lossless will spawn an FFmpeg output that uses huffyuv encoding. If a
user tries to select lossless, they will be warned both via a dialog
prompt and a warning message in the settings window to ensure they
understand that it requires tremendous amounts of free space. It will
always use the AVI file format.
Extra Notes:
- When High/Indistinguishable quality is set, it will allow you to
select the recording encoder. Currently, it just allows you to select
x264 (at either veryfast or ultrafast). Later on, it'll be useful to
be able to set up pre-configured presets for hardware encoders once
more are implemented and tested.
- I decided to allow the use of x264 at both veryfast or ultrafast
presets. The reasoning is two-fold:
1.) ultrafast is perfectly viable even for near indistinguishable
quality as long as it has the appropriate CRF value. It's nice if you
want to record but would like to or need to reduce the impact of
encoding on the CPU. It will automatically compensate for the preset at
the cost of larger file size.
2.) It was suggested to just always use ultrafast, but ultrafast
requires 2-4x as much disk space for the same CRF (most likely due to
x264 compensating for the preset). Providing veryfast is important if
you really want to reduce file size and/or reduce blocking at lower
quality levels.
- When a recording preset is used, a secondary audio encoder is also
spawned at 192 bitrate to ensure high quality audio. I chose 192
because that's the limit of the media foundation aac encoder on
windows, which I want to make sure is used if available due to its
high performance.
- The CRF calculation is based upon resolution, quality, and whether
it's set to ultrafast. First, quality sets the base CRF, 23 for
"good" quality, 16 for "very high" quality. If set to ultrafast,
it'll subtract 2 points from the CRF value to help compensate. Lower
resolutions will also lower the CRF value to help improve higher
details with a smaller pixel ratio.
The user may not want their audio or their display to be captured when
creating a new scene collection. Make new scene collections default to
fully empty.
For the sake of consistency, always create a display capture source on
the very first run of the program, just to have something displayed.
(NOTE: The only exception here is on windows 7/vista, which isn't ideal
for display capture, so it'll continue to be left blank)
When stream delay is active, the "Start/Stop Streaming" button is
changed in to a menu button, which allows the user to select either the
option to stop the stream (which causes it to count down), or forcibly
stop the stream (which immediately stops the stream and cuts off all
delayed data).
If the user decides they want to start the stream again while in the
process of counting down, they can safely do so without having to wait
for it to stop, and it will schedule it to start up again with the same
delay after the stop.
On the status bar, it will now show whether delay is active, and its
duration. If the stream is in the process of stopping/starting, it will
count down to the stop/start.
If the option to preserve stream cutoff point on unexpected
disconnections/reconnections is enabled, it will update the current
delay duration accordingly.
Found via clang-3.6, actual warning:
window-basic-main.hpp:406:14: warning: 'GetProfilePath' overrides
a member function but is not marked 'override'
[-Winconsistent-missing-override]
This temporarily fixes an issue where potential (for whatever reason)
stray sources that aren't associated with any scenes could be saved and
then persist with the save data on load.
SaveProject calls obs functions that locks certain mutexes, and because
I made it so that SaveProject was being called inside of certain signal
handlers (which could already be locked in other mutexes), it could
cause a mutual deadlock with other threads.
This fix puts the main project saving code in to SaveProjectDeferred,
then pushes it on to the Qt message queue to safely save outside of
those locks. It's a function that's perfectly safe to put on the
message queue because it will automatically be disabled in certain
circumstances where it would be unsafe to call, such as on shutdown.
This code will also make it so that the project will not needlessly be
saved more than once if the SaveProjectDeferred call was pushed multiple
times on to the queue.
Adds setting profiles to the basic user interface. For each profile, a
subdirectory for the profile will be created in
[config_dir]/obs-studio/basic/profiles which will contain the settings
data for each profile.
Adds scene collections to the menu bar, which allows you to duplicate,
rename, remove, or add clean new scene collections.
Scene files are now stored in ./obs-studio/basic/scenes directory with
filesystem-safe names.
This prevents the weird stretching effect that occurs whenever a windows
is in the process of being resized by the user.
Originally it was intended as an optimization, but even on half-decent
computers it doesn't really have much benefit.
Add a central function for clearing all data: scenes, sources, widgets
such as lists that may contain source references in their sub-items,
dialogs which may contain source references. In certain circumstances
this data must be fully released and manually freed to ensure that there
are no outstanding references to obs data (such as on shutdown, where
all data should be properly freed).
Right now, information about global audio sources is stored in both
scene files and in the config. These must be separated; there's no need
to store them in both when they can just be stored in the scenes file.
Use the config button on volume controls to allow the ability for
filters/properties to be accessed via the mixer. Particularly useful
for the purpose of accessing filters/properties of global audio outputs
that are added via audio settings.
This simply saves/loads the actual list widget item order.
The reason why this is done is because internally, libobs doesn't have a
list of scenes, it only has a list of sources. The list of scenes is
actually something artificially implemented by the basic window user
interface.
The Qt5Network classes seem to only support OpenSSL, and because OpenSSL
isn't available on windows, we would have to distribute it with the
program to get SSL access working. The problem with that is that
OpenSSL is not GPL-compatible, so we cannot distribute OpenSSL with the
program, which means we have to find a better (and preferably superior)
library for accessing remote files that can use the windows SSPI for our
SSL needs, which comes with the operating system.
Fortunately, libcurl is probably the best library out there, and can be
compiled with SSPI instead of OpenSSL, so we're just going to switch to
libcurl instead. Originally I thought it didn't support SSPI, otherwise
I would have implemented it sooner.
As a side note, this will make it so we'll able to get files from the
internet via plugins, which will be quite useful.