Commit Graph

332 Commits (1755511b2f5afd95d6ae6657eff2e2ddc387f0bc)

Author SHA1 Message Date
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 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
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 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
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
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 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 5ba8333da3 UI: Add more potential recording errors 2015-09-19 08:20:19 -07: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 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 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 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 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 2ee4cc53be UI: Implement scene duplication (context menu) 2015-08-28 15:01:39 -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 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
Palana 8d3db084e8 UI: Profile initialization 2015-08-12 15:30:28 +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 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 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 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
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 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
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
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 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
jp9000 b4fe4ae5b4 UI: Remove unused default config values 2015-07-03 09:57:53 -07:00
jp9000 daa4706eb7 UI: Move adv. rec. tracks if updating from 0.10.1 2015-07-03 09:57:52 -07:00
jp9000 44afc71636 UI: Log when output starts/stops 2015-07-02 18:18:34 -07:00
jp9000 da358da9a7 UI: Save project only on new changes 2015-07-02 18:08:55 -07:00
jp9000 4b93b42ded UI: Do not save at intervals
Saving at intervals is a poor way to handle saving issues in general.
Best to just save when something has been modified instead.
2015-07-02 18:08:54 -07:00