Commit Graph

877 Commits (763094687453523aa65dc9d9976058f6c4e3ccd8)

Author SHA1 Message Date
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
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
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 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 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
jp9000 ef4b826e97 win-dshow: Update to libdshowcapture 0.5.6
Adds LGP Lite capture support
2015-09-22 20:49:03 -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 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 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 ec5059cee1 win-capture: Always have some capture FPS limit
For game capture, if a game is running at for example 800 FPS and limit
capture framerate is off, it would try to capture all 800 of those
frames, dramatically reducing performance more than what would ever be
necessary.

When limit capture framerate is off, instead of capturing all frames,
capture frames at an interval of twice the OBS FPS, identical to how
OBS1 works by default.  This should greatly increase performance under
that circumstance.
2015-09-19 09:42:29 -07:00
jp9000 ddcf2436c1 obs-x264: Adjust log message
Use the actual parameter from the x264 params for CRF, and also make
sure to specify that CRF is meant to be 0 if CBR is enabled.
2015-09-19 09:42:24 -07:00
jp9000 606a0fc695 obs-x264: Log CRF value 2015-09-19 08:20:18 -07:00
jp9000 e54118592b obs-ffmpeg: Set colorspace/range hints
Sets the color range/space for FFmpeg output encoders that support it.
2015-09-19 08:20:17 -07:00
jp9000 8d0edc1377 obs-ffmpeg: Send stop signal on unexpected stop
This also adds the ability to detect whether it stopped due to lack of
space or not -- particularly useful for the FFmpeg output due to
lossless file format support.
2015-09-19 08:20:07 -07:00
jp9000 b96f15a625 obs-ffmpeg: Do not require encoder ids to be set
For the FFmpeg output, the encoder ids are sort of superfluous.  They
really should be optional.  If they're not set, it should use the
encoder name string instead to determine the ids automatically.
2015-09-18 22:11:49 -07:00
jp9000 e077880ab5 win-mf: Clean up encoder logging 2015-09-17 17:41:03 -07:00
jp9000 8280dbc596 win-mf: Do not register encoder if it can't create
It seems that certain encoders (quicksync) do not have proper back-end
support in the windows media foundation libraries for certain CPUs.
Quicksync doesn't appear to support CPUs that are not haswell (4xxx) or
above.  It's really annoying, but there's not much we can do about it
until we implement our own custom quicksync implementation.

This check simply makes it attempt to spawn an encoder to check to see
whether the encoder can actually be created before registering an
encoder.
2015-09-17 16:52:53 -07:00
jp9000 c107181b9f obs-outputs: Stop output after joining send thread
The encoders were stopping before processing was completed, which could
cause the output to access data that's potentially invalidated.
2015-09-17 14:17:41 -07:00
jp9000 88996aef73 win-mf: Fix more issues on encoder shutdown
The previous commit (672378d20) was supposed to fix issues with the
encoder releasing while data was still being processed, but did not
account for when the encoder has never started up.  That was my fault.

Furthermore, the way in which it was waiting to drain events was
incorrect.  The encoder may still be active even though there aren't any
events queued.  The proper way to wait for an async encoder to finish up
is to process output samples until it requests more input samples.
2015-09-17 13:42:43 -07:00
jp9000 672378d202 win-mf: Drain events before releasing encoder
After I made it so that the encoder internal data gets destroyed when
all outputs stop using it (fa7286f8), the media foundation h264 encoder
started having crashes on shutdown.  After a lot of testing, I realized
that the reason it started happening is almost assuredly because active
encoding events had not yet been completed.

After making it wait on those events by calling DrainEvents(true), the
crashes stopped.  So asynchronous actions were clearly still occurring
and it was shutting down while data was still being processed, thus
leading to a crash.
2015-09-16 19:34:53 -07:00
Jim 7788ccdd86 Merge pull request #476 from bssteph/master
Clean up Intensity Pro 4K commit a bit
2015-09-16 17:48:36 -07:00
kc5nra 595f451eb7 mac-vth264: Add Apple H264 encoder
Adds a VideoToolbox based H264 encoder for OSX, which most notably
allows the use of hardware encoding (Quicksync).

NOTES:
- Hardware encoding is handled by Apple itself internally.  The plugin
  itself has little control over many details due to the way that Apple
  designed the VideoToolbox interface.  Generally however, quicksync is
  used if available on the CPU, and quicksync is almost always available
  due to the fact that macs are exclusively Intel.

- The VideoToolbox does not seem to implement CBR, so it won't be
  available.  These encoders are generally not recommended for
  streaming.
2015-09-16 16:43:53 -07:00
jp9000 afa2985f64 win-mf: Add media foundation h264 encoder
Implements hardware encoders through the Media Foundation interface
provided by Microsoft.

Supports:
- Quicksync (Intel)
- VCE (AMD)
- NVENC (NVIDIA, might only be supported through MF on Windows 10)

Notes:
- NVENC and VCE do not appear to have proper CBR implementations.  This
  isn't a fault of our code, but the Media Foundation libraries.
  Quicksync however appears to be fine.
2015-09-16 15:16:26 -07:00
jp9000 6285a47726 (API Change) libobs: Pass type data to get_name callbacks
API changed from:
obs_source_info::get_name(void)
obs_output_info::get_name(void)
obs_encoder_info::get_name(void)
obs_service_info::get_name(void)

API changed to:
obs_source_info::get_name(void *type_data)
obs_output_info::get_name(void *type_data)
obs_encoder_info::get_name(void *type_data)
obs_service_info::get_name(void *type_data)

This allows the type data to be used when getting the name of the
object (useful for plugin wrappers primarily).

NOTE: Though a parameter was added, this is backward-compatible with
older plugins due to calling convention.  The new parameter will simply
be ignored by older plugins, and the stack (if used) will be cleaned up
by the caller.
2015-09-16 09:21:12 -07:00
Palana 386ee73443 obs-ffmpeg: Add custom muxer settings
This allows changing e.g. the number of segments in a hls playlist and
its caching behavior with:
"hls_allow_cache=1 hls_list_size=0"
2015-09-16 10:47:58 +02:00
Palana d8723dbd40 obs-ffmpeg: Set FFmpeg AVFormatContext filename
This is used by some muxers that set AVFMT_NOFILE and doesn't seem to
hurt muxers that don't set it; notable this makes the hls muxer output
its m3u8 playlist with the proper filename in the proper directory
2015-09-16 10:27:35 +02:00
Brian S. Stephan ec9d2b42c4 decklink: detect BMDPixelFormat in instance constructor
cleaning up my previous commit a bit. we can just keep the
appropriate BMDPixelFormat as a data member and keep StartCapture() a
bit clearer.

this might also be helpful if (when?) the detection code needs to be
more robust or configurable
2015-09-15 22:48:00 -05:00
Brian S. Stephan 90a138ac13 decklink: capture in RGB for BMI Intensity Pro 4K
detect the device type when initializing the device instance and
determine whether to capture YUV or RGB. tested with a Blackmagic
Intensity Pro and a Blackmagic Intensity Pro 4K in the same machine,
capturing at the same time, on Linux
2015-09-14 23:38:38 -05:00
Mathias Panzenböck b266b563fa obs-ffmpeg: Fix compile error
This fixes the compile error: "'AVDISCARD_NONINTRA' undeclared" when
using a libavcodec version earlier than 55.67.100.

Closes jp9000/obs-studio#469
2015-09-12 22:14:24 -07:00
hwdro fc19d9d11b obs-filters: Fix noise-gate calculation errors
For both cases the cur_level calculations were "wrong". For one channel
case, I assume that was only an oversight, as for two channels case
cur_level "calculation", getting the level from downmixing to mono will
result in an attenuated level than expected. One solution is to use the
highest level of both channels to drive the gate.
2015-09-09 18:07:30 +03:00
Radzaquiel ee62910014 rtmp-services: Update Hitbox servers list
Added: EU-East (Vienna, Austria)
2015-09-05 18:07:29 +02:00
jp9000 13d22645e4 win-capture: Use correct variable for system modules
..This is rather embarrassing.  I used the parameter variable and the
actual variable that I wanted to used went completely unused.  Would
static analysis catch something like this, I wonder?  Would probably
have to be really good static analysis.
2015-08-29 21:03:54 -07:00
Gol-D-Ace 3cc98e734a rtmp-services: Add YouTube Gaming reference
YouTube Gaming is live since today (26 August 2015) and people will ask
for it.
This makes it a bit clearer that YouTube and YouTube Gaming
(which share the same ingestion system) work with OBS MP.
2015-08-26 21:15:50 +02:00
jp9000 657619e642 win-dshow: Update libdshowcapture to 0.5.5 2015-08-23 20:27:26 -07:00
jp9000 be5283bb51 rtmp-services: Fix warnings for updater 2015-08-19 17:47:25 -07:00
jp9000 1a842ecd15 rtmp-services: Automatically update services.json
Uses the file-updater utility library to update the services.json file.
If the remote version is incompatible or corrupted, will reject the
file.
2015-08-19 16:26:22 -07:00
jp9000 68d2dab6fd rtmp-services: Use cached services.json if present
This will use the services.json file present in the cache, or if it has
the wrong format version or is corrupted for whatever reason, uses the
local version instead.

Also a minor refactor, makes it so that you call the open_services_file
function to get the services array, rather than having to get the file
name each time.
2015-08-19 16:21:58 -07:00