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.
Certain output formats don't support multiple tracks, so it's important
to warn the user if they select multiple tracks.
Also warn the user if they select no tracks.
The audio bitrate required is insignificant relative to the video
bitrate, and due to the fact that it's possible that a lower-quality
encoder may be in use (such as FFmpeg's AAC encoder), setting the
default to 160 is really more ideal to reducee any potential quality
loss.
Ensures that the "Show Recordings" an "Remux Recordings" file menu
items will open the recordings folder from the currently active
output mode rather than always the simple output mode.
On windows vista/7, you cannot really use display capture efficiently
without disabling aero, so this will add an option to settings to allow
it to be disabled and cause it to be disabled on startup.
Portable mode can be enabled via command line options (--portable or -p)
or by having any of the following files present in the base directory of
a portable install:
portable_mode
obs_portable_mode
portable_mode.txt
obs_portable_mode.txt
Portable mode is omitted when obs is built with a unix program
structure.
In my recent update to add a "show" button to the passworded text
property, I neglected to connect the edit widget to
WidgetInfo::ControlChanged, so it isn't able to detect when the text is
changed by the user.
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.
The RemoteTextThread class is a QThread that is used to get text
remotely in a separate thread with libcurl. This is intended to replace
the Qt5Network classes because of their dependency on OpenSSL, which we
can't distribute.
Reduces required scrolling when lots of new audio sources are added
(e.g. aux devices being enabled in the same dialog) when the dialog
was opened with just a few audio sources being present. Unfortunately,
the "restart required" warning is pushed all the way to the bottom
even if the source list is empty
This should allow entering alt + numpad N (N > 0) on windows since there
doesn't seem to be a way to completely ignore input events generated
from "alt codes"
UI supplied per scene hotkey to allow switching between scenes; this
has to be done in the UI since it's up to the application to define
what exactly "changing/selecting a scene" means (changing the output
of channel 0 may not be enough for other applications)
OBSHotkeyEdit is similar to QKeySequenceEdit, except less terribad on OSX, while
OBSHotkeyWidget provides a container that automagically encapsulates multiple
bindings per hotkey
OBSHotkeyLabel in combination with OBSHotkeyWidget provides mechanisms for
dealing with hotkey pairs (see upcoming usage in window-basic-settings.cpp)
When a reconnect is occurring, the user doesn't really know that the
program is waiting to reconnect to the server or not, nor does the user
know how many seconds are remaining until that next attempt. This will
show the reconnect timeout countdown as it's occurring.
NoFocusFrameStyle was meant to disable focus frames around the scenes/sources
list (on OSX); unfortunately it also removed focus frames from controls that
should have focus frames like input boxes in the settings window
Non-NV12 video formats are primarily intended for recording. For
streaming, if the libobs color format is not set to NV12, it's likely
that the video frames will have to be converted to NV12, which will use
extra CPU usage. Due to that fact, it's important to warn the user of
that potential extra increased CPU usage that may be required when
streaming.
This allows using NV12, I420, or RGB output video formats. This option
will set what obs itself outputs frames as.
It's important to note that this is only ideal for specific FFmpeg
encoders that support the desired video format; for example, if you use
RGB and use the huffyuv encoder, huffyuv will now properly output in RGB
instead of YUV NV12/I420.
I420 is useful for eliminating the NV12->I420 conversion for the
AVerMedia encoders, as AVerMedia encoders only support I420 input.
A second even more important note about RGB is that if the encoder does
not support the format you are using, it will be converted on the CPU to
a format that the encoder supports as it's encoded; so for example
setting the obs output format to RGB and then using x264 will be futile
and end up using needless amounts of extra CPU than if you just had obs
set to NV12, which is the most common and ideal format for x264.
In the future, native output of other YUV formats might be implemented
(such as YUV 4:2:2).
When this class is used in conjunction with a QSlider control, allows
direct setting of the slider handle position when clicking in an area
other than the slider handle. The default QSlider handle behavior is to
step towards clicked position.
Fix warning encountered on clang-504.0.40 on OSX 10.9:
obs/window-basic-main.cpp:2884:22: warning: suggest braces around
initialization of subobject [-Wmissing-braces]
struct vec2 dir = {0.0f, 0.0f};
Use std::abs instead of abs to avoid loss in precision and also fix
the corresponding warning from clang (3.5.0):
warning: using integer absolute value function 'abs' when argument is
of floating point type [-Wabsolute-value]
Closesjp9000/obs-studio#414
All audio encoders are currently having the service-specific settings
applied to them, so this makes it so that it checks which track the
stream is set to and only applies it to that specific encoder.
There was an issue where the position/size would keep changing every
time the program opened/closed, was due to the fact that we were not
calling setGeometry to restore the position/size.
Adds a visibility checkbox to the main sources list so that users can
temporarily disable/re-enable sources. Only applies to scene items, not
the sources themselves.
The FocusList subclass of QListWidget emits a GotFocus signal when it
gets focus -- used for the filters window to know when a specific filter
list gets focus.
This is used to allow the user to temporarily disable sources/filters.
For each item in the list box, it displays a visibility checkbox (with
eye icon) that the user can click to disable/re-enable sources or
filters.
I did not end up using the Qt::ItemIsUserCheckable flag with the list
items for a few reasons:
- We could not style the checkbox indicator without qss screwing up
other parts of the list widget style on certain operating systems
- We could not get the icon to properly invert on active selection like
the text does on mac/linux, which made it look strange
- Clicking the checkbox too fast would cause it to signal a double-click
on the icon, opening the properties for a source in the source list
This checkbox gives an 'eye' icon that indicates whether something is
visible or not. The color of the icon is influenced by the current
style's foreground color.
Sometimes events with rogue source references are in the event queue
when the program is shutting down. This can cause the program to
reference freed data. Processing those remaining events before shutting
down solves the issue.
This fixes an issue where the borders for certain types of windows would
not match the intended border style/color. It was supposed to be 1
through 6 for frameShape, but I ended up putting 5 twice.
Core API functions changed:
-----------------------------
EXPORT bool obs_reset_audio(struct audio_output_info *aoi);
EXPORT bool obs_get_audio_info(struct audio_output_info *aoi);
To:
-----------------------------
EXPORT bool obs_reset_audio(const struct obs_audio_info *oai);
EXPORT bool obs_get_audio_info(struct obs_audio_info *oai);
Core structure added:
-----------------------------
struct obs_audio_info {
uint32_t samples_per_sec;
enum speaker_layout speakers;
uint64_t buffer_ms;
};
Non-interleaved (planar) floating point output is standard with audio
filtering, so to prevent audio filters from having to worry about
different audio format implementations and for the sake consistency
between user interfaces, make it so that audio is always set to
non-interleaved floating point output.
OBS will offer the user a list of themes which are .qss files inside
data/obs-studio/themes. If no theme is found in the configuration, it
loads the default theme for the system.
Instead of trying to replace this icon, I feel like just giving it a
white border is sufficient to make it usable in both light and dark
themes.
The only other option is to add icon changing code for themes for this
particular type of widget, and I felt it was best to not go down that
route due to the complexity involved.
API changed from:
------------------------
EXPORT void obs_service_apply_encoder_settings(obs_service_t *service,
obs_encoder_t *video_encoder,
obs_encoder_t *audio_encoder);
void obs_service_info::apply_encoder_settings(void *data
obs_encoder_t *video_encoder,
obs_encoder_t *audio_encoder);
To:
------------------------
EXPORT void obs_service_apply_encoder_settings(obs_service_t *service,
obs_data_t *video_encoder_settings,
obs_data_t *audio_encoder_settings);
void obs_service_info::apply_encoder_settings(void *data
obs_data_t *video_encoder_settings,
obs_data_t *audio_encoder_settings);
These changes make it so that instead of an encoder potentially being
updated more than once with different settings, that these functions
will be called for the specific settings being used, and the settings
will be updated according to what's required by the service.
This fixes that design flaw and ensures that there's no case where
obs_encoder_update is called where the settings might not have
service-specific settings applied.
The update_properties signal is created before the view itself is
created, therefore it was possible for the callback to trigger when the
view was invalid.
When viewing the properties of a source, there's no way to specify that
a source is actually being shown or not to the core. This uses the new
obs_source_inc_showing and obs_source_dec_showing to tell the source
that it's being shown/hidden in this part of the program without
necessarily having to use a new render view just to render it.
Since the file being logged to changes with each run, opening a log
file is a tad more involved than desirable when it's necessary to view
the log each time OBS is run. This new menu entry shortcuts opening the
file from the file system manually.
Remove the close_float check for values that are set through the
advanced UI. If the difference of the integer was 1 this would sometimes
cause the input to be ignored.
Add rounding to values that are set through the signal system, since
casting alone will act like floor, which is not desirable in this case.
Currently, this allows the setting of values such as:
- Audio buffering time
- Color format (still somewhat unsupported)
- YUV color space (if a YUV format)
= YUV color range (if a YUV format)
More color formats will be added in the future, such as RGB and YUV
4:2:2 formats.
This fixes the issue where the labels wouldn't have enough space for
localization text in certain circumstances, and also fixes some issues
with alignment
Add a checkbox named "Enforce streaming service encoder settings"
checkbox to advanced output. Disabling this checkbox allows the user to
optionally disable the enforcement of streaming service encoder
settings. I had a user complain that they didn't want to always have
the service's preferred encoder settings forced on them.
Ensures that the current service's encoder settings are applied to the
encoders used with the simple output. This is always on for simple
output so users don't have to mess with it themselves.
clicked() is the wrong signal to use, it only activates on actual user
click, not when the value is changed. toggle() activates whenever the
value itself is changed.
For the 'output resolution' setting in video settings, do not show
values in the list that it does not support (width must be aligned to a
128bit boundry, and height must be divisible by two)
For the 'rescale' settings in advanced outputs, the scales must all be
divisible by two.
The 'rescale' values in advanced output section are supposed to be based
upon the output resolution of the program. Meaning they should not be
used for scaling up, because the resolution downloaded from the graphics
processor is the output resolution set in video settings; thus any
resolution you set for the 'rescale' values is scaled from that.
The "rescale" option for streaming in the advanced output settings was
not properly checking the parameter output of sscanf. sscanf returns
the number of values that were found, not the number of string matches.
To prevent from causing confusion/issues for our most awesome and
respected locale editors, only localize and translate the relevant text
rather than the extensions of the filter.
Before: After:
obs_service_gettype obs_service_get_type
It seems there was an API function that was missed when we were doing
our big API consistency update. Unsquishes obs_service_gettype to
obs_service_get_type.
Currently service settings are updated in real time via the properties
view, which means that OK/Cancel/Apply have no effect. This fixes that
by using the new type of properties view that operates only on settings
data, not an object.
Add a button to the main window to access advanced audio properties to
make it a bit more visible to users.
To facilitate this, the bottom part of the window was switched to a grid
layout.
Adds an 'advanced' mode to the output settings to allow more powerful
and complex streaming and recording options:
- Optionally use a different encoder for recording than for streaming to
allow the recording to use a different encoder or encoder settings if
desired (though at the cost if increased CPU usage depending on the
encoders being used)
- Use encoders other than x264
- Rescale the recording or streaming encoders in case the user wishes to
stream and record at different resolutions
- Select the specific mixer to use for recording and for streaming,
allowing the stream and recording to use separate mixers (to for
example allow a user to stream the game/mic audio but only record the
game audio)
- Use FFmpeg output for the recording button instead of only recording
h264/aac to FLV, allowing the user to output to various different
types of file formats or remote URLs, as well as allowing the user to
select and use different encoders and encoder settings that are
available in the FFmpeg library
- Optionally allow the use of multiple audio tracks in a single output
if the file formats or stream services support it
To accommodate multiple types of outputs, there has to be some level of
abstraction. The BasicOutputHandler structure will give us a way that
we can switch between different output configurations.
If the properties view is scrolled down or right and a widget triggers
it to repaint, it would reset its scroll position, making editing a bit
awkward. This simply saved/restores the position before and after
rebuilding the properties view.
Allows a properties view control to be created only with an identifier
string instead of only being created with a pointer to an object. This
way, we don't necessarily have to have an object for some arbitrary
settings we want the user to be able to modify.
Implement the signals for the mixer checkboxes in the advanced audio
control so that it properly relays the values to/from the source when
the mixers are changed in obs or when the mixers are changed by the
user.
In the advanced audio properties, the last set of controls designate
what tracks the audio of a specific source is applied to, but for some
reason I named it 'Media Channels'. It feels a bit confusing of a name.
I feel like it should really just be called 'Tracks' here for lack of a
better term.
API changed:
--------------------------
void obs_output_set_audio_encoder(
obs_output_t *output,
obs_encoder_t *encoder);
obs_encoder_t *obs_output_get_audio_encoder(
const obs_output_t *output);
obs_encoder_t *obs_audio_encoder_create(
const char *id,
const char *name,
obs_data_t *settings);
Changed to:
--------------------------
/* 'idx' specifies the track index of the output */
void obs_output_set_audio_encoder(
obs_output_t *output,
obs_encoder_t *encoder,
size_t idx);
/* 'idx' specifies the track index of the output */
obs_encoder_t *obs_output_get_audio_encoder(
const obs_output_t *output,
size_t idx);
/* 'mixer_idx' specifies the mixer index to capture audio from */
obs_encoder_t *obs_audio_encoder_create(
const char *id,
const char *name,
obs_data_t *settings,
size_t mixer_idx);
Overview
--------------------------
This feature allows multiple audio mixers to be used at a time. This
capability was able to be added with surprisingly very little extra
overhead. Audio will not be mixed unless it's assigned to a specific
mixer, and mixers will not mix unless they have an active mix
connection.
Mostly this will be useful for being able to separate out specific audio
for recording versus streaming, but will also be useful for certain
streaming services that support multiple audio streams via RTMP.
I didn't want to use a variable amount of mixers due to the desire to
reduce heap allocations, so currently I set the limit to 4 simultaneous
mixers; this number can be increased later if needed, but honestly I
feel like it's just the right number to use.
Sources:
Sources can now specify which audio mixers their audio is mixed to; this
can be a single mixer or multiple mixers at a time. The
obs_source_set_audio_mixers function sets the audio mixer which an audio
source applies to. For example, 0xF would mean that the source applies
to all four mixers.
Audio Encoders:
Audio encoders now must specify which specific audio mixer they use when
they encode audio data.
Outputs:
Outputs that use encoders can now support multiple audio tracks at once
if they have the OBS_OUTPUT_MULTI_TRACK capability flag set. This is
mostly only useful for certain types of RTMP transmissions, though may
be useful for file formats that support multiple audio tracks as well
later on.
This allows the usage of other resources in the style sheet, like
icons/etc, relative to the style sheet location. For example, to change
the main window app icon, add #OBSBasic { qproperty-windowIcon:
url("basic/newicon.png") } in the style sheet, where "basic/newicon.png"
is a path relative to the qss file location.
When you launch the source properties for the first time, the settings
for the source are empty and default values are used. With the new
OK/Cancel buttons that were recently merged, it first saves the old
settings, then if the user cancels applies those old settings.
However, because the first settings are always empty, obs_source_update
will try to apply the old settings (which are empty) to the modified
settings, but it can't reset to those settings because it's technically
not applying any settings at all.
In other words, when you create the source and modified the properties
for your first time, pressing cancel would not reset anything at all.
This fixes that issue by clearing the current settings with
obs_data_clear before updating the source with the old settings, which
ensures that any settings that were empty are reset to an empty status.
This will allow obs to load stylesheet.qss (Qt stylesheet). It enables
users to theme obs how they please within Qt stylesheet guidelines. A
default stylesheet is not yet available.
The class members were listed in the wrong order, causing GCC to throw
up a reorder warning signifying that they cannot be initialized in the
order they were listed in the constructor initializer list.
Changed:
char *os_get_config_path(const char *name);
To:
int os_get_config_path(char *dst, size_t size, const char *name);
Also added:
char *os_get_config_path_ptr(const char *name);
I don't like this function returning an allocation by default.
Similarly to what was done with the wide character conversion functions,
this function now operates on an array argument, and if you really want
to just get a pointer for convenience, you use the *_ptr version of the
function that clearly indicates that it's returning an allocation.
Use QDialogButtonBox to add "Okay" and "Cancel" buttons to the
properties dialog. The core functionality of the dialog is not changed;
I.E. the settings are still applied to the source as the user changes
them. If the user clicks "Okay", the dialog simply exits. If the user
clicks "Cancel", the original settings are reapplied to the source then
the dialog exits. If the window is closed by any other means (I.E. by
the main obs window closing) then the properties dialog prompts the user
if they changed anything and asks if they wish to save their settings.
In order to implement this last feature, a method of checking for open
dialogs and sending each a quit message is added to the closeEvent()
method for OBSBasic.
This does a few small things
-Moves buttons down 20px to the same height as the list boxes
-Adds a QFrame around scrollArea for mixer list.
Q: Why was this done?
A: When you go to style the mixer list in regards to adding a border,
shadow, or glow, it needs to be done on the QFrame. If you do it on the
scrollArea itself, the scrollbars will overlap the bottom of the border,
causing the border to look cut-off. Additionally, the other two sources
and scenes list widgets already had frames, so they did not have this
problem.
This will allow styling of the volume meters so that users are not stuck
with the default colors when they style a theme. Volume meters' colors can
be changed in stylesheet.qss using the following format as an example:
VolumeMeter {
qproperty-bkColor: #DDDDDD;
qproperty-magColor: #207D17;
qproperty-peakColor: #3EF12B;
qproperty-peakHoldColor: #000000;
}
Because libobs-opengl is a public library, it's customary to have SONAME
embedded in the library file. Also remove the prefix override and
remove the prefixing "lib" from the output name. This also requires us
to pass the library file name to dlopen invocations.