0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00
Commit Graph

971 Commits

Author SHA1 Message Date
jp9000
6e20310945 UI: Use flac for lossless audio
It was mistakenly using ac3 at a high bitrate -- lossless should be
lossless, both video and audio.
2016-02-04 11:56:20 -08:00
jp9000
a071c03470 UI: Fix studio mode always duplicating scene
If scene duplication mode is disabled and studio mode is turned on, it
would always initially duplicate scene regardless of whether scene
duplication mode was activated or not.
2016-02-04 10:11:50 -08:00
jp9000
fddb7d283d UI: Fix settings window data always being "changed"
Fixes a bug introduced in 6407707a04 where if you open the settings
window the settings would always think there were new changes.  It was
marking a control as changed when it shouldn't be
2016-01-31 15:32:43 -08:00
dodgepong
ea9db8249b Add latest translations from CrowdIn 2016-01-31 18:28:35 -05:00
jp9000
6407707a04 UI: Ensure the output res. is modified along with base 2016-01-31 00:55:05 -08:00
jp9000
3ca327fd76 UI: Resize program view if resolution settings changed 2016-01-31 00:55:04 -08:00
jp9000
48a3230b07 UI: Fix a wrong label alignment in settings window 2016-01-31 00:54:56 -08:00
jp9000
9e17328392 UI: Fix Delete shortcut for scenes/sources listboxes
When the new UI was put in, the action shortcuts were unintentionally
removed from the list boxes.
2016-01-31 00:54:50 -08:00
boombatower
8593c4bacd UI: Fix GCC 4.8 compilation issue
Apparently using QPointer container for the QObject being given to the
connect function makes it so it can't find the actual function to use.
I'm guessing this is incomplete functionality or a bug that existed in
GCC 4.8.  Doesn't happen in 4.9+.
2016-01-29 14:09:13 -06:00
jp9000
544953c870 UI: Implement transitions and preview/program mode
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.
2016-01-26 11:49:56 -08:00
jp9000
a61933dd8e (API Change) libobs: Add 'type' to obs_scene_duplicate
(Note: This commit also modifies the UI)

Allows the ability to duplicate sources fully copied, and/or have the
scene and its duplicates be private sources
2016-01-26 11:49:52 -08:00
jp9000
669da7ba36 libobs: Do not use signals with audio capture/controls
(Note: This commit also modifies UI)

Instead of using signals, use designated callback lists for audio
capture and audio control helpers.  Signals aren't suitable here due to
the fact that signals aren't meant for things that happen every frame or
things that happen every time audio/video is received.  Also prevents
audio from being allocated every time these functions are called due to
the calldata structure.
2016-01-26 11:49:47 -08:00
jp9000
b0104fcee0 (API Change) libobs: Remove source_type param from functions
(Note: test and UI are also modified by this commit)

API Changed (removed "enum obs_source_type type" parameter):
-------------------------
obs_source_get_display_name
obs_source_create
obs_get_source_output_flags
obs_get_source_defaults
obs_get_source_properties

Removes the "type" parameter from these functions.  The "type" parameter
really doesn't serve much of a purpose being a parameter in any of these
cases, the type is just to indicate what it's used for.
2016-01-26 11:49:37 -08:00
jp9000
adcbf9311b UI: Remove "audio buffering time" (skip)
(Note: This commit breaks libobs compilation.  Skip if bisecting)
2016-01-26 11:49:30 -08:00
bla
f32f65bb1f UI: Don't create sources popup menu if no scenes
Closes jp9000/obs-studio#499
2016-01-26 11:48:53 -08:00
jp9000
832043fc7f UI: Disable OSX V-Sync when program is open
OSX has an annoying feature called "BeamSync", which on later versions
of OSX is always on.  For whatever reason, Apple devs decided to force
this feature to always be on, so applications must always render with
v-sync regardless of what they set their swap interval to.

This issue would cause syncing to the vertical refresh for each
additional active display, and wouldn't allow rendering above the
current refresh rate.  This caused major rendering stalls and prevented
video frame timing from being accurate.

This fixes the issue by using an undocumented set of functions to
disable BeamSync.  Note that because this is an undocumented method of
working around the issue, its existence cannot be guaranteed.  If the
functions no longer exist for whatever reason, it will safely do
nothing.
2016-01-25 17:44:41 -08:00
jp9000
c072ba55b2 UI: Hide renderer/adapter when not on windows
Also hide adapter list if not using Direct3D.
2016-01-25 17:29:11 -08:00
jp9000
22f7e6a82d UI: Move Renderer/Adapter to advanced
These really are advanced options that users shouldn't need to change
normally, so moving them to advanced makes sense, and keeps them away
from users who don't know what they're doing.
2016-01-25 17:29:11 -08:00
jp9000
9e4761347d UI: Fix a case where output res. stays invalid
If the base resolution is set to an invalid resolution, it would cause
the output resolution to automatically change to an invalid resolution.
After the invalid resolution was set for the output resolution, it would
stay at that invalid resolution.

This fixes it so it always tries to find the output resolution closest
to what was last actually set or actually edited.
2016-01-25 17:29:10 -08:00
jp9000
9b5ac1fbd2 UI: Fix preview right-click menu getting wrong source
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.
2016-01-25 17:29:10 -08:00
jp9000
e5fc4dbbcd UI: Warn if high resource usage when encoding
Shows a warning stating that encoding is stalling, and shows the number
and percentage of frames that were skipped due to encoding.
2016-01-25 17:29:10 -08:00
jp9000
3749436cd5 UI: Fix "invalid" audio devices in audio settings
If a global audio device is disconnected or for whatever reason is no
longer available when audio settings is opened, it will erroneously
select index 0 of the combo box ("Disabled") by default because it can't
find it in the combo box.  This fixes that issue by making it insert an
item in to the combo box specifying that the previously available audio
device is no longer available, and properly preserving the user's
settings.
2016-01-25 17:29:10 -08:00
jp9000
bbbdd4442c UI: Add options to enable/disable stream confirm dialogs
Some streamers would accidentally hit start/stop streaming, which on
certain services would send out mass emails to all their followers.
This just adds options to general settings to optionally enable dialogs
that confirm whether to actually start/stop streaming when the button is
clicked.
2016-01-25 17:29:10 -08:00
jp9000
213d8ce154 UI: Add "Always On Top" option to file menu 2016-01-25 17:29:10 -08:00
jp9000
9991f6a7ec UI: Fix advanced audio properties duplication bug
Because of the patch that removed the "user sources list" in libobs
(70fec7ae8), obs_enum_sources will now enumerate the global audio
sources, where it didn't before.  In the advanced audio properties
dialog, before the patch I had to use code to manually include them, but
I neglected to remove that code when I made that patch, so it would
cause them to be added more than once.  This just removes that code.
2016-01-25 17:29:10 -08:00
jp9000
6da742ba02 UI: Fix bug where default scene would not be added to list 2016-01-25 17:29:10 -08:00
jp9000
db48e3471e UI: Add GetCurrentSceneSource inline function 2016-01-25 17:29:10 -08:00
jp9000
b8547aa811 UI: Add menu button (split button) class
When you assign a menu to a normal QPushButton, it becomes a button that
only allows you to have a menu.  This class lets you click the button
and have a menu at the same time.
2016-01-25 17:29:10 -08:00
jp9000
370761ba29 UI: Add helper to delete layout and layout contents 2016-01-25 17:29:09 -08:00
jp9000
6262abc2c8 UI: Resize main preview on the widget's resize signal
Fixes a bug where the preview's size calculations wouldn't update if the
widget itself was resizes but the window wasn't resized.
2016-01-25 17:29:09 -08:00
jp9000
d7d5e55d2c UI: Add splitter to main window
Allows adjusting the size of the bottom section of the main window
2016-01-25 17:29:09 -08:00
jp9000
3c83be374e UI: Remove obs_source_add and sourceSceneRefs variable
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.
2015-12-22 05:49:01 -08:00
jp9000
e3795a2187 UI: Hold ref when storing signals (skip)
(Note: This commit breaks UI compilation.  Skip if bisecting)

Ensures that a reference is kept until the signals associated with that
reference are disconnected.
2015-12-22 05:49:00 -08:00
Palana
124ccb68de UI: Allow file name generation without spaces
This will probably go away once proper file name formatting is
implemented (https://obsproject.com/mantis/view.php?id=361)
2015-11-27 15:48:30 +01:00
Palana
feb0ccd858 UI: Add HLS entries for ffmpeg-mux output 2015-11-27 15:48:29 +01:00
Palana
d4c4a0d1aa UI: Add custom muxer settings for ffmpeg-mux 2015-11-27 15:48:29 +01:00
Gol-D-Ace
2ee1d82860 Add latest translations from Crowdin 2015-11-16 21:04:55 +01:00
jp9000
34bbc444eb UI: Only inhibit when active or if projector open
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.
2015-11-16 09:08:55 -08:00
jp9000
24d217f799 UI: Fix "unreferenced local function" warning
Fixes the following warning:

warning C4505: 'operator ==' : unreferenced local function has been
removed

This function actually is used despite this warning, so the only way to
get rid of the warning is to disable the warning itself in this
particular case.
2015-11-15 09:49:23 -08:00
jp9000
6ba723a997 UI: Fix multi-item selection
Allows changing item selection via list box or via preview window, and
keeps their selection status in sync with each other.
2015-11-15 09:49:22 -08:00
jp9000
c1b9901b6a UI: Add signal blocker helper class 2015-11-15 09:49:14 -08:00
Palana
ddfe6483b3 UI: Add OBS_PROPERTY_FRAME_RATE implementation 2015-11-14 15:57:21 +01:00
Palana
f4aae94fe2 UI: Remove "unsupported" part from AutoSelect message
The unsupported part should basically be signaled via making that
value inaccessible
2015-11-14 15:34:46 +01:00
Palana
dd825f7d33 UI: Change CenterToScreen shortcut to ctrl+d 2015-11-14 15:34:46 +01:00
Palana
3fc7453933 UI: Clear ListItem selection before deleting widgets
This works around a crash in the "widget->clear()" call in
ClearListItems under the following circumstances:
- Create at least two scenes
- Create at least one source in both scenes
- Have at least one source selected in both scenes
- Set the same "Switch to scene" hotkey on both scenes
- Use "Switch to scene" hotkey

Reduced stack trace on my machine:
    frame #0: 0x00000001004bac2d QtWidgets`QWidget::show() + 93
    frame #1: 0x00000001006d32a2 QtWidgets`QAbstractItemView::updateEditorGeometries() + 690
    frame #2: 0x00000001006d36d7 QtWidgets`QAbstractItemView::updateGeometries() + 23
    frame #3: 0x00000001006f1ae6 QtWidgets`QListView::updateGeometries() + 438
    frame #4: 0x00000001006ccdce QtWidgets`QAbstractItemView::doItemsLayout() + 46
    frame #5: 0x00000001006f1916 QtWidgets`QListView::doItemsLayout() + 214
    frame #6: 0x00000001006f9cf3 QtWidgets`QListViewPrivate::rectForIndex(QModelIndex const&) const + 611
    frame #7: 0x00000001006eb48d QtWidgets`QListView::visualRect(QModelIndex const&) const + 29
    frame #8: 0x00000001006f1567 QtWidgets`QListView::visualRegionForSelection(QItemSelection const&) const + 1863
    frame #9: 0x00000001006d7ba9 QtWidgets`QAbstractItemView::selectionChanged(QItemSelection const&, QItemSelection const&) + 73
    frame #10: 0x00000001006f97d2 QtWidgets`QListView::selectionChanged(QItemSelection const&, QItemSelection const&) + 674
    frame #11: 0x00000001006d9b9e QtWidgets`QAbstractItemView::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) + 1246
    frame #12: 0x0000000102b10372 QtCore`QMetaObject::activate(QObject*, int, int, void**) + 2994
    frame #13: 0x0000000102aa001c QtCore`QItemSelectionModel::emitSelectionChanged(QItemSelection const&, QItemSelection const&) + 300
    frame #14: 0x0000000102a9fe6c QtCore`QItemSelectionModel::select(QItemSelection const&, QFlags<QItemSelectionModel::SelectionFlag>) + 748
    frame #15: 0x0000000102aa048b QtCore`QItemSelectionModel::clear() + 75
    frame #16: 0x000000010072e9d8 QtWidgets`QListWidget::clear() + 24
    frame #17: 0x000000010015759d obs`ClearListItems(widget=0x000000010683afa0) + 141 at item-widget-helpers.cpp:43
    frame #18: 0x000000010003424b obs`OBSBasic::UpdateSources(this=0x0000000105f5bf50, scene=(val = obs_scene * = 0x0000000110679440)), &(obs_scene_release)>) + 75 at window-basic-main.cpp:1254
    frame #19: 0x0000000100036a96 obs`OBSBasic::UpdateSceneSelection(this=0x0000000105f5bf50, source=<unavailable>), &(obs_source_release)>) + 422 at window-basic-main.cpp:1473
    frame #20: 0x0000000100175c48 obs`OBSBasic::qt_static_metacall(_o=0x0000000105f5bf50, _c=InvokeMetaMethod, _id=17, _a=0x00007fff5fbfb640) + 776 at moc_window-basic-main.cpp:494

This crash was reported at
https://obsproject.com/mantis/view.php?id=364
2015-11-06 11:36:51 +01:00
Palana
6c193435cc UI: Move properties window creation for new sources
Currently creating new sources can cause a deadlock:
OBSBasicSourceSelect locks the scene mutex when adding a new source
(required to add invisible sources), and later OBSBasic tries to
lock the graphics mutex (via CreatePropertiesWindow); meanwhile the
graphics thread is holding the graphics mutex and tries to lock each
scene as it renders them, resulting in a (non-obvious from the code)
lock ordering conflict.

Moving the CreatePropertiesWindow call out of the locked scene mutex
restores the previous lock ordering; in addition, the requirement
for keeping sourceSceneRefs for opening that initial properties
window is removed
2015-10-30 10:15:42 +01:00
jp9000
8d895eaa6a UI: Prevent calling of obs functions with NULL params 2015-10-21 06:30:33 -07:00
jp9000
6ad8df8adb (API Change) libobs: Use single func for base effects
API removed:
--------------------
gs_effect_t *obs_get_default_effect(void);
gs_effect_t *obs_get_default_rect_effect(void);
gs_effect_t *obs_get_opaque_effect(void);
gs_effect_t *obs_get_solid_effect(void);
gs_effect_t *obs_get_bicubic_effect(void);
gs_effect_t *obs_get_lanczos_effect(void);
gs_effect_t *obs_get_bilinear_lowres_effect(void);

API added:
--------------------
gs_effect_t *obs_get_base_effect(enum obs_base_effect effect);

Summary:
--------------------
Combines multiple near-identical functions into a single function with
an enum parameter.
2015-10-19 00:52:45 -07:00
jp9000
c59a796a8f UI: Use byte sequence for non-breaking spaces
Use explicit UTF-8 byte sequence for the "no-break space" character.

Prevents issues with certain editors, and fixes the following compiler
warning on Visual C++:

warning C4819: The file contains a character that cannot be represented
in the current code page (X). Save the file in Unicode format to prevent
data loss
2015-10-15 01:31:38 -07:00
wayne wang
2be5291a3e UI: Fix non-standard string character in source
(Jim) For some reason a character outside of the standard ASCII
character set was used in this source file.  "Eight Spoked Asterisk",
Unicode character 0x02733.  Non-ASCII characters should probably not be
used directly in source files due to potential character encoding
issues that can occur depending on the operating system and compiler.

Closes jp9000/obs-studio#485
2015-10-14 01:18:06 -07:00
Christoph Hohmann
fc063444ca UI: Add checkbox for visibility of new scene items
Note: This functionality should probably be considered as a temporary
solution.  Ideally, sources should not be visible on creation until the
user presses "OK" in the initial properties dialog.  Also, the problem
of initial visibility can additionally be solved by implementing the
preview/program functionality.  Once preview/program is implemented the
need for this patch will be negated, and the option should probably be
removed.

Closes jp9000/obs-studio#483
2015-10-11 11:42:40 -07:00
Palana
80b20abde2 UI: Fix removing wrong scene from list
RemoveScene would always remove the currently selected item from the
scenes list, even if that item didn't reference the actual scene being
removed; finding the proper item via its OBSRef fixes this issue.

How to reproduce the original issue:
Create two scenes "a" and "b", set a hotkey for switching to scene "a",
select scene "b" and press the remove scene button, then while the
confirmation dialog is up press the hotkey while the UI is out of focus.
The active scene should have switched to "a", while the dialog still
displays "b" as its target; now confirm the removal of "b". Note how "a"
was removed from the scenes list instead.

Reported at https://obsproject.com/mantis/view.php?id=333
2015-09-24 10:11:49 +02:00
jp9000
ecb8c2c045 Revert "UI: Always create a display capture on first run"
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.
2015-09-23 08:53:41 -07:00
dodgepong
76c18b079b Latest translations from CrowdIn 2015-09-22 23:33:29 -04:00
jp9000
0b119ba1e8 UI: Remove 22.05khz
22.05khz audio really doesn't make sense to have available, and causes
issues with encoders (primarily CoreAudio)
2015-09-21 19:31:08 -07:00
jp9000
17fa004104 UI: If audio bitrate not available, use closest
When an encoder has been removed (such as CoreAudio) and the audio
bitrates currently configured no longer are available to the current
audio encoders anymore, it would cause GetAACEncoderForBitrate to return
false with no encoder available.

To fix the issue, instead just choose the closest bitrate relative to
the current bitrate (rounded up).
2015-09-21 18:49:07 -07:00
jp9000
718035efa2 UI: Use better default UI icons 2015-09-21 00:01:40 -07:00
jp9000
5d8f07310d UI: Use utvideo for lossless compression
After some more testing, utvideo not only gives better encoding
performance, but also better compression and better decoding
performance.  It's pretty much superior all around over huffyuv.
2015-09-19 21:21:34 -07:00
jp9000
54a3e6696f UI: Add recording presets to simple output
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.
2015-09-19 17:04:22 -07:00
jp9000
27d2860629 UI: Clarify base/scaled resolution text 2015-09-19 15:45:14 -07:00
jp9000
6d9bb63fac UI: Default to colorspace 601 instead of 709
Seems that most decoders that don't read the h264 header tend to expect
601 instead of 709.
2015-09-19 12:29:27 -07:00
jp9000
165766254a UI: Remove duplicate widget connection 2015-09-19 08:20:20 -07:00
jp9000
5ba8333da3 UI: Add more potential recording errors 2015-09-19 08:20:19 -07:00
Palana
cf69f24917 UI: Fix crash when saving advanced FFmpeg output
Selecting any supported FFmpeg format where ff_format_desc_extensions
returns NULL would crash the std::string constructor, so we pass an
empty extension instead (rtsp is one candidate format that triggers
the crash, on my machine at least)
2015-09-16 16:25:47 +02:00
Palana
edec540695 UI: Add custom muxer settings to advanced FFmpeg output 2015-09-16 10:47:58 +02:00
jp9000
274841860b UI: Inhibit sleep/screensavers while active 2015-09-12 22:08:06 -07:00
jp9000
01e7a3c621 UI: Use empty scene for new scene collection
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.
2015-09-11 21:51:09 -07:00
jp9000
35b2ce565a UI: Always create a display capture on first run
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)
2015-09-11 21:49:21 -07:00
jp9000
f10fb07f0e UI: Log an error if loading of a scene file failed 2015-09-11 21:45:51 -07:00
jp9000
44b34431be UI: Create default scene if no file found 2015-09-11 21:45:06 -07:00
jp9000
b574407c74 UI: Remove cbr/bufsize from simple output mode
CBR is now always on by default for streaming, so there's no reason to
have a setting for this in particular.  Still available in advanced
output settings of course, but simple output mode really should be kept
as simple as possible.
2015-09-11 08:43:10 -07:00
jp9000
6b4d267682 UI: Clear reconnect timeout if reconnect canceled 2015-09-11 08:23:03 -07:00
jp9000
a4f8d18948 UI: Move reconnect options to advanced settings
This is mostly just to remove the unnecessary clutter from the output
sections.  The reconnect settings are generally rarely modified by users
as it is.
2015-09-10 21:54:11 -07:00
jp9000
981ead18a3 UI: Refactor upgrade_settings function
This is a refactor to move the config file open/saving out of the
individual settings upgrade functions that may be called per file.
2015-09-10 19:56:29 -07:00
jp9000
fe164eca87 UI: Rename FFmpeg update func to upgrade_settings
This function should really be considered a function that upgrades
general config file settings.
2015-09-10 19:06:18 -07:00
jp9000
f592c33eec UI: Implement stream delay
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.
2015-09-10 12:13:40 -07:00
jp9000
d1293b2b8a UI: Add stream delay options to advanced settings
I added stream delay options to advanced settings not just because I
feel it's an advanced option, but also to reduce clutter in the outputs
section and its sub-sections, which already have far too many options as
it is.
2015-09-10 12:13:40 -07:00
jp9000
84d5938af2 Revert "UI: Add confirmation when clicking stop stream"
This reverts commit a508c17f0a.

I realized that this would become more of an annoyance for most people
rather than anything helpful.  This has only happened only twice that I
am aware of in all the years that the program has been around.
2015-09-10 12:11:29 -07:00
jp9000
4c3394f7bf UI: Use a default size for the properties window
When I changed the properties window to remove the .ui file, I forgot to
give it a default initial size.  This just sets it to 720x580 by
default.
2015-09-07 18:40:06 -07:00
jp9000
c23c0f4615 UI: Prevent writing endlessly repeating log entries
Limits similar log entries (determined by a simple hash function that
sums the characters) to certain number of lines in a row.  When a
different log entry occurs, it resets the repeat check and logs how many
times the last message was repeated.
2015-09-07 14:06:21 -07:00
jp9000
9d940249bb UI: Remove redundant log message
This log message is already used in the StreamingStop callback.
2015-09-06 16:57:57 -07:00
jp9000
2ebb6e60ce UI: Don't use activeRefs to determine if active
Due to certain design changes for delay, it's better to simply determine
whether outputs are active via booleans rather than an activeRefs
variable, which could get decremented more than once if say, the signal
for stopping the stream gets called more than once for whatever reason
(which may happen in the case of delay due to the way delay works)
2015-09-06 16:33:58 -07:00
jp9000
a508c17f0a UI: Add confirmation when clicking stop stream
I decided to add a confirmation message box simply to prevent cases
where users may accidentally click "Stop Streaming".
2015-09-06 16:33:57 -07:00
jp9000
ee9cb8a931 UI: Increase clarity of exit message 2015-09-06 16:33:56 -07:00
Jim
7e11c01e28 Merge pull request #468 from yogpstop/master
UI: Unify activeRefs changing method
2015-08-28 22:20:58 -07:00
jp9000
2ee4cc53be UI: Implement scene duplication (context menu) 2015-08-28 15:01:39 -07:00
yogpstop
a1d8fb11e2 UI: Unify activeRefs changing method 2015-08-27 17:03:10 +09:00
jp9000
1a81cf46e5 UI: Delete backup file if deleting scene collection
I forgot to make sure that the backup file for a scene collection would
also be deleted if a scene collection is purposely deleted by the user.
2015-08-23 17:22:45 -07:00
jp9000
ebf3abf04e UI: Use saving functions for profiles/scenes
Replaces all the json/config loading/saving functions with safe
variants to reduce the chance of potential file corruption as much as
possible.

Also does a minor refactor of json writing by using
obs_data_save_json_safe for writing json files instead of manually using
obs_data_get_json and os_quick_write_utf8 each time.
2015-08-21 18:22:25 -07:00
jp9000
2bd8ab7c09 (API Change) libobs: Add global module config path
API Changed:
---------------------------
From:
- bool obs_startup(const char *locale, profiler_name_store_t *store);

To:
- bool obs_startup(const char *locale, const char *module_config_path,
		profiler_name_store_t *store);

Summary:
---------------------------
This allows plugin modules to store plugin-specific configuration data
(rather than only allowing objects to store configuration data).  This
will be useful for things like caching data, for example looking up and
storing ingests from remote (rather than storing locally), or caching
font data (so it doesn't have to build a font cache each time), among
other things.

Also adds a module-specific directory for the UI
2015-08-19 12:16:20 -07:00
jp9000
0ce756acba UI: Update configs for new FFmpeg output changes
If a user was using FFmpeg output before pathc 0.12.0, they had to type
in the full file name to the FFmpeg output URL/Path box, which isn't
exactly compatible with the new settings.

This changes each profile's config file so that the FFmpeg output
detects whether files are used, and then extracts the file's directory
and extension and sets them accordingly to make it compatible with the
new FFmpeg file output handling.
2015-08-19 11:56:18 -07:00
jp9000
75dcd1ffa3 UI: Allow generated filenames for FFmpeg output
This changes the way the advanced output section's FFmpeg output
settings work by allowing the user to select whether they want to output
to a file or output to a URL, and makes it so file names are
automatically generated like other recording outputs.

If they choose to output to a file, it'll only require an output
directory similarly to how other recording outputs work.  They can
select a directory to output to rather than being required to type in a
full path and filename; the filename is automatically generated.  The
extension is also automatically retrieved from libff depending on the
format selected.

Otherwise if they have Output to URL selected, it'll show a simple edit
box where they can type in the target URL.
2015-08-19 11:56:18 -07:00
jp9000
3488039e8c UI: Fix GCC 4.8 compilation issue
Apparently using QPointer container for the QObject being given to the
connect function makes it so it can't find the actual function to use.
I'm guessing this is incomplete functionality or a bug that existed in
GCC 4.8.  Doesn't happen in 4.9+.
2015-08-18 21:52:52 -07:00
jp9000
59592cf030 UI: When setting base res, use closest output res
When settings the base resolution, try to find the closest output
resolution to the old output resolution, and use that for its value.  If
the aspect ratio is about the same, then don't modify the value.  If the
aspect ratio is significantly different, then find the closest
approximation while keeping with the new aspect ratio.

This particular issue has been an annoyance for quite some time.
2015-08-16 14:41:43 -07:00
jp9000
23e60561cb UI: Initialize curl before starting the program
It's best to do the global curl initialization separately before any
curl functions are called.  Prevents initialization threading issues.
2015-08-16 08:08:13 -07:00
Palana
b07b742fd3 UI: Save profiler data on exit 2015-08-12 15:30:30 +02:00
Palana
44b5afbd07 (API Change) libobs: Add profile_name_store_t parameter to obs_startup
Due to all the threads in libobs it wouldn't be safe to make that
parameter reconfigurable after libobs is initialized without adding
even more synchronization. On the other hand, adding a function to set
the name store before calling obs_startup would solve the problem of
passing a name store into libobs, but it can lead to more complicated
semantics for obs_get_profiler_name_store (e.g., should it always return
the current name store even if libobs isn't initialized until someone
calls set_name_store(NULL)? should obs_shutdown call
set_name_store(NULL)? Passing it as obs_startup parameter avoids
these (and hopefully other) potential misunderstandings
2015-08-12 15:30:29 +02:00
Palana
8d3db084e8 UI: Profile initialization 2015-08-12 15:30:28 +02:00
Palana
7c5d93b92a UI: Add basic profiler integration 2015-08-12 15:30:28 +02:00
Palana
2de89bee8c UI: Refactor OBSInit call 2015-08-12 15:30:28 +02:00
Palana
40b7a4c918 UI: Make bitrate map sample rate aware 2015-08-10 16:35:05 +02:00
Palana
979f00fd2d UI: Ignore disabled audio encoder bitrates 2015-08-10 16:35:04 +02:00
jp9000
f3b76a72c7 UI: Recalculate main preview scale on video reset
Fixes a minor bug introduced by the windowless graphics context merge.
When setting a new base resolution, it would not recalculate the preview
size, and the preview would display the wrong size until the main window
was resized by the user.  This patch makes it so that it calls the
recalculation function when the base resolution is changed to prevent
that from happening.
2015-08-08 01:00:20 -07:00
jp9000
1722425f22 UI: Move obs startup/shutdown to obs-app.cpp
Now that we aren't dependent upon a window for our context, we can
safely move the obs context creation/destruction to obs-app.cpp, and use
the OBSContext helper class to automatically shut down obs.
2015-08-05 01:07:22 -07:00
jp9000
6e75c1877f UI: Remove windowless context #error 2015-08-05 01:07:14 -07:00
jp9000
e93ca4cd10 UI: Prune obs_display code from secondary windows
(Non-compiling commit: windowless-context branch)

Now that all obs_display related code has been moved to OBSQTDisplay,
we can prune a whole bunch of boilerplate code that had to be repeated
for the displays of each window.

Affects:
- Properties
- Filters
- Interact
- Projector
2015-08-05 01:07:13 -07:00
jp9000
f0b903435c UI: Change "main preview" to use OBSQTDisplay
(Non-compiling commit: windowless-context branch)

Gets rid of all functions/data related to setting up the main preview to
be associated with obs_reset_video and instead uses OBSQTDisplay for the
main window display (thus associating it with an obs_display object).
2015-08-05 01:07:12 -07:00
jp9000
3422631152 UI: Refactor OBSQTDisplay for windowless context
(Non-compiling commit: windowless-context branch)

This makes it so that OBSQTDisplay now uses/controls an obs_display
object directly (rather than having the owner have to associate an
OBSDisplay with it).  It was separated before because the main window
for the basic UI would was using the "main preview" stuff before the
windowless context and had to be handled differently, so you couldn't
just associate an obs_display object with OBSQTDisplay, meaning that all
"secondary" previews such as properties/filters/etc had to handle the
obs_display alone, which caused a lot of needlessly duplicated code.

Also adds a DisplayCreated signal to allow owners to be able to add
callbacks and such on creation of the actual obs_display context.
2015-08-05 01:07:11 -07:00
jp9000
5c9325f3ea UI: Add windowless context #error 2015-08-05 01:07:07 -07:00
jp9000
2526910eb9 UI: Use get_win_ver (not GetVersionEx) 2015-08-01 14:51:23 -07:00
jp9000
66f7330a58 UI: Remove properties window UI file (not needed)
The properties window UI file has no point at this time.  It's just a
window with a widget inside of it.
2015-07-20 19:11:35 -07:00
Palana
4001767355 UI: Add missing override specifier
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]
2015-07-19 06:30:35 +02:00
Palana
36ad777b8a UI: Add milliseconds to log timestamp when available 2015-07-19 06:30:11 +02:00
jp9000
1f1f03d920 UI: Make plugin search path use arch. bits in name
If on windows/linux, make the plugin search path also include the
architecture bits for its binary search path.
2015-07-16 01:32:14 -07:00
jp9000
b39445f323 UI: Allow QT to be found via cmake variable 2015-07-11 10:11:57 -07:00
jp9000
1efb8491be UI: Use SaveProjectNow for scene collections
This fixes a bug where scene collections would not properly save when
modifying them.
2015-07-09 10:51:27 -07:00
jp9000
3a974f5086 UI: Add SaveProjectNow function
This adds a function that allows saving the project now instead of
deferring it.
2015-07-09 10:51:22 -07:00
Jim
fff323a0d5 Merge pull request #450 from dodgepong/latest-crowdin-translations
Add latest translations from CrowdIn
2015-07-08 12:04:30 -07:00
dodgepong
fb679bdd02 Add latest translations from CrowdIn 2015-07-08 14:56:07 -04:00
jp9000
af1014471d UI: Use os_mkdirs, remove redundant do_mkdir calls 2015-07-08 10:03:39 -07:00
jp9000
d3ba8c8af4 UI: Make XDG config path first if moving to XDG 2015-07-08 10:03:09 -07:00
Carl Fürstenberg
ba02e065fe libobs: Add XDG config directory support
Adding XDG Base Directory Specification support for config dir

http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

Closes jp9000/obs-studio#348
2015-07-08 09:10:53 -07:00
jp9000
3f9578dc33 UI: Make sure aero resets if settings cancelled
Fixes a bug where pressing "Cancel" on the settings window would not
reset aero to its original state.
2015-07-07 23:52:59 -07:00
John R. Bradley
3ae747dd50 win-mf: Add Media Foundation AAC Encoder
Adds Microsoft Media Foundation AAC Encoder that supports
96k to 192k bitrates.  This plugin is only enabled on Microsoft
Windows 8+ due to performance issues found on Windows 7.
2015-07-07 23:05:44 -07:00
jp9000
fab5eb5ba3 UI: Properly ensure save on exit
I broke the save that happens on exit by making all project saves put on
the message queue.  The save on exit would put the save on to the
message queue, then by the time the save occurred obs would already be
shut down.

This just calls the save function directly rather than deferring it to
the message queue.
2015-07-06 19:00:25 -07:00
jp9000
9f6f6d632b UI: Remove all unused user sources on load
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.
2015-07-06 18:50:16 -07:00
jp9000
49501be2a3 UI: Fix potential deadlocks when saving
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.
2015-07-06 17:03:42 -07:00
jp9000
0b7cd0ac38 UI: Log when user changes settings 2015-07-06 17:03:39 -07:00
jp9000
a0e42ff277 UI: Fix stream/recording startup/stop logging
I actually made the mistake of making these messages only display if all
outputs were no longer active.
2015-07-06 17:03:35 -07:00
jp9000
64d9dd77e7 UI: Fix update check logging (non-sparkle)
It currently says "Update check: latest version is x.x.x", which is a
bit confusion.  It should say "Update check: last known remote version
is x.x.x" instead.
2015-07-06 17:03:34 -07:00
jp9000
d0d799465b UI: Add large separator after obs initialization
This makes it so it's a bit more obvious when the primary initialization
has completed in the log file.
2015-07-06 17:03:33 -07:00
jp9000
a5b4330e7a UI: Don't log version in OBSBasic::UpdateTitleBar 2015-07-06 17:03:33 -07:00
jp9000
a903ae3103 UI: Fix logging for profiles/scene collections
This makes it so that the log message for altering scene collections
and/or profiles is now below, and then the separator below that.  This
makes it a bit more apparent that any loading/clearing/etc that happens
before the log message are associated with the log message.
2015-07-06 17:03:32 -07:00
jp9000
5e178c12e7 UI: Insert timestamps after log newlines
It was a bit weird seeing lines in the log without the associated
timestamps, so it should just insert it after every newline instead.
2015-07-06 17:03:31 -07:00
Palana
7bb430efd0 UI: Clean up sourceSceneRefs when removing scenes
Previously the sourceSceneRefs were being cleaned up in
OBSBasic::SceneItemRemoved; due to changes in
e82018579b the signal handler that called
OBSBasic::SceneItemRemoved is now being removed before the scene
triggers its item_remove signals
2015-07-07 02:02:41 +02:00
Palana
9f2566fe69 UI: Fix memory leak when saving stream settings
SetService started using addref in
71abed387f, so we have to release
the extra reference here
2015-07-06 13:39:08 +02:00
Palana
99db4d7577 UI: Toggle password "Show" button text when clicked 2015-07-06 13:38:57 +02:00
Palana
4725641c88 UI: Expose all available audio encoder bitrates 2015-07-04 13:30:13 +02:00
Palana
5bb88634fb UI: Create best matching audio encoder for given bitrate 2015-07-04 13:30:13 +02:00
Palana
8945309b58 UI: Move output handler audio bitrate config access 2015-07-04 13:30:13 +02:00
Palana
6a136ade4f UI: Add (AAC) audio encoder inspection helpers 2015-07-04 13:30:13 +02:00
Palana
473244da3c UI: Release recording/streaming signals before outputs 2015-07-04 08:00:21 +02:00
jp9000
7c97e21a1f UI: Add menu options to open settings folders
Adds "Show Settings Folder" and "Show Profile Folder" items to the file
menu.
2015-07-03 18:35:33 -07:00
jp9000
f9314128ea UI: Add Profiles
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.
2015-07-03 18:35:30 -07:00
jp9000
7d6a12f49e UI: Add scene collections
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.
2015-07-03 18:33:57 -07:00
jp9000
fabb99c35a UI: Add UpdateTitleBar function to basic UI 2015-07-03 18:21:23 -07:00
jp9000
5d826a86cb UI: Add New/Duplicate/Untitled locale text 2015-07-03 18:21:22 -07:00
jp9000
a781c5bdea UI: Add functions to create safe file names
Adds functions to generate safe file names from potentially unsafe
names.  Also a function to ensure that a particular filename isn't
duplicated.
2015-07-03 18:21:21 -07:00
jp9000
650c8faaaf UI: Use default scaled res. of 1280x720 or equiv.
Originally this value defaulted to 1.5 downscaling, but on very high
resolution displays this would cause the default to be above 1280x720,
which is not ideal for streaming/recording due to the CPU usage
requirements.

Instead, it will now find the closest resolution with a pixel count
equivalent to or closest below 1280x720, and use that instead.
2015-07-03 10:26:18 -07:00
jp9000
b566428233 UI: Allow resize without timers
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.
2015-07-03 10:10:58 -07:00