Commit Graph

835 Commits (1755511b2f5afd95d6ae6657eff2e2ddc387f0bc)

Author SHA1 Message Date
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