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

3124 Commits

Author SHA1 Message Date
Richard Stanway
55dd8f8726 obs-ffmpeg: Fix a race condition in create_or_fetch_log_context
Another thread could be manipulating the active_log_contexts array while the current thread is trying to read it, resulting in an uninitialized memory crash as the da_push_back call was not protected by the mutex.
2015-10-12 23:21:45 +02:00
Richard Stanway
7630946874 win-capture: Check return values on Windows API functions 2015-10-12 23:21:45 +02:00
Richard Stanway
8f2460525f win-capture: Fix buffer overrun in get_window_class
Detected by Coverity Scan (CID 12856)
2015-10-12 23:21:44 +02: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
Aarni Koskela
6bc7fc65b3 image-source: Check for file changes
Polls for file changes like the text plugin does.  This is an interim
solution; both the text plugin and image source should use a file
monitoring API, preferably implemented through libobs.

Closes jp9000/obs-studio#482
2015-10-08 03:20:29 -07:00
Richard Stanway
d1fbacd784 text-freetype2: Fix loading from files with unicode names 2015-10-08 00:57:12 +02:00
Palana
74e4c33756 libobs: Use IOKit error code when polling hotkeys (OSX)
In case a system authentication prompt is open the actual error code
(via err_get_code) is kIOReturnExclusiveAccess on OSX 10.9; I'm not
100% sure if this makes the "if (!value)" part of the code obsolete,
but that code path shouldn't be triggered under most circumstances
anyway

Fixes https://obsproject.com/mantis/view.php?id=346
2015-10-07 11:06:40 +02:00
jp9000
667768b96b text-freetype2: Fix garbled rendering if face changed
When using a text file with the source and the font face is changed, it
would cause it to fail to update the glyphs and text accordingly.  It
would trigger an error jump at line 392 of text-freetype2.c, ultimately
resulting in the text to render garbled after that.

How to reproduce:
Set the source to get text from a file, then just change the font face
(but not the size or anything else).
2015-10-05 16:31:35 -07:00
Copy Liu
c4f5769df4 text-freetype2: Refresh glype cache after file update
When updating text from file periodically, newer glyphs that weren't
already cached would not end up being rendered.  This fixes the issue by
calling cache_glyphs after the file has been updated.

How to reproduce the original issue:
Set a text-freetype2 source to load an english-only text file.  Then
overwrite the text in the file with non-english characters.  The
non-english characters will then fail to render.

Reported at https://obsproject.com/mantis/view.php?id=336

Closes jp9000/obs-studio#481
2015-10-05 16:00:06 -07:00
jp9000
bdfb52410c text-freetype2: Fix serialized variable size
This variable needs to be the same size for both architectures.  size_t
is 8 on 64bit and 4 on 32bit.
2015-10-05 14:18:56 -07:00
jp9000
b4597218f0 win-capture: Use GetSytemDirectory instead of SH*
Instead of using shell functions to get the windows system directory,
use the kernel32 functions (GetSystemDirectory and
GetSystemWow64Directory).  Reduces a bit of unnecessary overhead.
2015-10-05 14:00:52 -07:00
jp9000
a468777614 libobs: Always use CRLF for crash text
When the crash text is generated, it's generated with LF line endings
only.  Pasting the crash text in to notepad will result in garbled text
on windows (due to the fact that notepad still to this day has not been
programmed to understand anything other than CRLF).  Instead of using
LF, just use CRLF.
2015-10-05 13:07:16 -07:00
jp9000
3c0a309ac5 libobs: Move SymRefreshModuleList to crash handler
There's no need to refresh the actual module list for the crash handler
until a crash has occurred.  Reduces startup time for this function call
from 400ms to 40ms.
2015-10-05 13:04:31 -07:00
jp9000
e91f5384b4 text-freetype2: Cache data to reduce load time
This caches the font list data to a file to minimize load times.  Font
data will be refreshed when any font files are added/removed, based upon
a checksum of the font file names and dates (if available).
2015-10-04 21:16:31 -07:00
jp9000
f29ac7770c win-capture: Cache data to reduce load time
Caches the D3D graphics offsets to file for the sake of improving module
load time.  If the D3D/DXGI DLL versions change, the data will be
refreshed.
2015-10-04 21:16:31 -07:00
jp9000
b038ed8d1d libobs: Profile win32 symbol update call 2015-10-04 21:16:30 -07:00
jp9000
7a15068d96 libobs: Only update symbols after plugins loaded
Reloading symbols after each plugin is causing the load times to
increase a fair bit on some computers, so do it after all plugins are
loaded instead.
2015-10-04 21:16:29 -07:00
jp9000
8a0a28bf27 libobs/util: Add get_dll_ver function (windows)
Used to get the version of a dynamic link library on windows.
2015-10-04 21:16:28 -07:00
jp9000
48550b9691 libobs/util: Add function to calculate CRC32 2015-10-04 21:16:27 -07:00
jp9000
05748195a8 libobs/util: Save filename in config_create
Fixes a bug where config_save could not save the file due to the fact
that it did not store the path of the file as it was supposed to.
2015-10-04 21:16:26 -07:00
jp9000
b3d6d9e49d libobs: Add file serializers 2015-10-04 21:16:25 -07:00
jp9000
8c1fb99e99 libobs/util: Use int64_t as return for serializer
Intended as a means of expressing an error occurred (-1) when performing
a seek or getting a position.
2015-10-04 21:16:24 -07:00
jp9000
af11984314 libobs/util: Call SymInitialize before other Sym*
On the first call to update the symbol paths, pass the path string to
the SymInitializeW function first if it hasn't been called yet.  If it
has been called, then defer to SymSetSearchPathW and then
SymRefreshModuleList.  This is meant to reduce a needless extra call to
the latter two functions on the first use of the function.
2015-10-04 21:16:23 -07:00
jp9000
28947e96d7 win-wasapi: Remove resolved TODO comment 2015-10-04 21:15:54 -07:00
jp9000
18542461f2 win-wasapi: Use system timestamps by default for input
Microphones and other input devices can often have bad or erroneous
timestamps.  Although we handle bad timestamps much better in
obs-studio, there are still lingering issues that can crop up from time
to time with device QPC timestamps that leads to mic data not playing
back properly.  It's best if it be off by default rather than on, which
will now cause it to use system timestamps for input devices by default.
This changes it to the same handling as OBS1 for this case.
2015-10-04 21:15:48 -07:00
Jim
8bf95f1a23 Merge pull request #480 from Gol-D-Ace/vaughn-instagib-ingests
rtmp-services: Update vaughn / instagib ingests
2015-09-28 09:46:58 -07:00
Gol-D-Ace
3dc0f0843a rtmp-services: Update vaughn / instagib ingests 2015-09-28 18:42:51 +02: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
9630c3032c libobs: Update version to 0.12.0 2015-09-22 20:49:04 -07:00
jp9000
ef4b826e97 win-dshow: Update to libdshowcapture 0.5.6
Adds LGP Lite capture support
2015-09-22 20:49:03 -07:00
Jim
fb4fac0442 Merge pull request #477 from dodgepong/latest-crowdin-translations
Latest translations from CrowdIn
2015-09-22 20:34:55 -07:00
dodgepong
76c18b079b Latest translations from CrowdIn 2015-09-22 23:33:29 -04:00
jp9000
e57aa3cab2 win-capture: Do not reset GL capture if cx/cy is 0
It is not necessary to reset the capture when cx or cy is at 0 because 0
means the application is minimized.
2015-09-22 18:08:20 -07:00
jp9000
7010edee9e win-capture: Fix crash with 64bit bounce hook
The new 'offset' value was not being passed back to the caller, which
caused the caller to continue to use the old value and thus would cause
an invalid hook and crash.
2015-09-22 18:07:50 -07:00
jp9000
12985d7493 win-mf: Don't call CoInitializeEx
The call to CoInitializeEx in the win-mf module caused some sort of
conflict with the decklink module, causing the decklink module to crash
on exit.  Instead, let libobs handle COM initialization.
2015-09-22 11:30:39 -07:00
jp9000
088debdef4 libobs: Call CoInitializeEx in libobs
Due to the fact that certain modules may need COM on startup, initialize
COM by default in libobs.
2015-09-22 11:30:38 -07:00
jp9000
51c4480697 win-capture: Fix infinite GL reacquire loop
If the GL capture part of the game capture hook fails to initialized for
whatever reason, it will go in to an infinite reacquire loop.  If it
fails to initialize shared texture capture, try shared memory capture
instead.
2015-09-21 21:40:01 -07:00
jp9000
7c39eb4ea4 win-capture: Don't hook game if source not showing 2015-09-21 21:38:54 -07: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
f3986afcb4 libobs: Add pdb paths for all plugin dirs (win32)
Use SymSetSearchPath to include plugin directories in pdb search paths.
This is important for generating proper crash data and crash logs on
windows.
2015-09-21 18:53:04 -07:00
jp9000
57edd5fb32 libobs: Make minor adjustment to module logging 2015-09-21 18:49:24 -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
e10cf47e0d obs-ffmpeg: Fix 'possible loss of data' warnings
Fixes warning:
warning C4244: 'initializing' : conversion from 'int64_t' to 'int',
possible loss of data
2015-09-21 18:35:27 -07:00
jp9000
718035efa2 UI: Use better default UI icons 2015-09-21 00:01:40 -07:00
jp9000
0a228d0740 libobs/util: Use gzopen* instead of gzdopen
Using gzdopen will not work properly if the C standard library used to
get the descriptor is not the same library as the one that was compiled
with zlib.  When this is the case, it causes zlib to fail to write a
file, and would report a C standard library error.  Use gzopen and
gzopen_w instead to ensure that the file is opened and closed by zlib
itself, ensuring that zlib and the libobs do not have to share the C
standard library between each other.
2015-09-21 00:01:19 -07:00
jp9000
b9d6c649f5 cmake: Copy ogg and vorbis libs with avcodec 2015-09-20 16:58:14 -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