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

89 Commits

Author SHA1 Message Date
jp9000
2f305cb550 win-capture: Use static runtimes for hooks/helpers
(Note: This commit also modifies the ipc-util/seg-service modules)

When compiling the final project, always compile
ipc-util/get-graphics-offsets/graphics-hook/inject-helper/seg-service
with static MSVC runtimes to prevent the need of requiring the MSVC
runtimes for both architectures.
2016-11-23 06:03:00 -08:00
jp9000
7c65337c75 w32-pthreads: Fully export library (MSVC)
Allows the library to be used by external plugins
2016-06-23 20:05:39 -07:00
Richard Stanway
65fcd20242
libff: Improved handling of EOF in the decoder threads
(Also modifies obs-ffmpeg to handle empty frames on EOF)

Previously the demuxer could hit EOF before the decoder threads are
finished, resulting in truncated output. In the worse case scenario the
demuxer could read small files before ff_decoder_refresh even has a chance
to start the clocks, resulting in no output at all.
2016-04-28 23:58:28 +02:00
Richard Stanway
dd6f8120b3
libff: Seek to frame 0 for sources with no duration 2016-04-25 01:05:32 +02:00
jp9000
45015db9d8 file-updater: Fix warning parameter
The parameter was being passed as a pointer instead of being
dereferenced
2016-04-24 12:59:55 -07:00
jp9000
672d0b3716 file-updater: Only use SSL ALPN opt if curl version up to date 2016-04-23 08:17:47 -07:00
Richard Stanway
15bec2a4d2
file-updater: Add missing dstr_free calls 2016-04-22 18:16:53 +02:00
Gol-D-Ace
674706ac6e Merge pull request #533 from sorayuki/patch-1
libff: Fix a race condition crash when handling clocks
2016-04-21 04:18:55 +02:00
sorayuki
a9b9b26afd libff: Fix a race condition crash when handling clocks
How to crash:
1. Use recent ffmpeg shared libraries.
2. Add a ffmpeg_source, a small static picture (e.g. jpeg) with loop
3. After a while of high cpu usage, it crashed. Seems reproduced more
easily on faster computer

Closes #533
2016-04-21 04:12:27 +02:00
Richard Stanway
5ddc3d258e
file-updater: Fix format string 2016-04-21 02:06:23 +02:00
Richard Stanway
f7fce1c802
file-updater: Add support for HTTP 304 Not Modified using ETag, disable ALPN 2016-04-21 02:03:14 +02:00
Richard Stanway
4c0b316130
libff: Small audio decoder loop refactor 2016-04-20 03:05:18 +02:00
Richard Stanway
bebaeaeaa9
libff: Fix heap corruption caused by unnecessary av_dup_packet call
There's no need to duplicate the packet as the reference count will be 1
after the av_read_frame call. Duplicating causes heap corruption when a
synthetic clock packet is duplicated and assigned the buffer from the
stack-based temporary packet which is then double-freed by the decoder
thread.
2016-04-20 03:05:04 +02:00
Christoph Hohmann
5e768990f2 deps/libff: Fix that inputs are not closed when a demuxer is freed
avformat_free_context() only frees the memory used by an AVFormatContext
but it does not close the opened media file. This causes a leaked file
descriptor every time a media source frees a demuxer. Using
avformat_close_input() instead frees the context and closes the media
file.
2016-04-10 18:53:26 +02:00
jp9000
2fd30407e6 deps/libff: Fix warnings with FFmpeg 3.0.0+
Fixes warnings with deprecated packet functions (av_free_packet and
av_dup packet, which were replaced by av_packet_unref and av_packet_ref
respectively)
2016-04-09 18:10:48 -07:00
sorayuki
07ecdaf8d3 deps/libff: Fix incorrect timer triggering (twice)
Sometimes the timer will be triggered twice in one request.  GIF files
can be rendered in wrong speed.

Closes jp9000/obs-studio#513
2016-03-24 02:42:18 -07:00
jp9000
c2f796660d deps/libff: Make libff use default frame discard method 2016-01-26 11:49:24 -08:00
jp9000
aa48c6e9bc deps/glad: Add support for glSwapIntervalMESA
Just in case glSwapIntervalEXT and glSwapIntervalSGI aren't available
for whatever reason.  This entire patch is most likely completely
redundant on modern mesa drivers.
2016-01-25 17:29:09 -08:00
jp9000
4a767e01ec deps/file-updater: Fix warning 2015-08-21 18:37:11 -07:00
jp9000
d3eaeda27c deps/file-updater: Add file updater util. lib
This allows plugins to update and cache data files from a remote source.

Here are the steps that occur when the API initiates an update check:

1.) It checks to see if the local files are greater than the cached
    files.  If the local version is newer (for whatever reason), it
    replaces the cached version(s) with the local version.

2.) A packages.json file is downloaded from the specified URL.  That
    packages.json file contains a version number and a list of files to
    be updated.

3.) If the downloaded package version is greater than the cached
    version, executes step 4-5 on each file.

4.) Checks the version for the file to update in packages.json, and if
    the version is greater than the cached version, proceeds to step 5,
    otherwise repeat step 4-5 for other files.

5.) Calls the callback given to the update function (if any) with the
    file information (file name, buffer, etc), and if the callback
    returns true, allows the cached file to be updated and replaced,
    otherwise goes back to step 4-6 for the rest of the files.

NOTE: Files are never modified directly.  All file saving/modification
is performed in a temporary directory, and then files are moved to their
destination.  This should eliminate any possibility of file corruption
(or at least dramatically reduce the possibility).
2015-08-19 15:48:04 -07:00
kc5nra
ff0c58e963 deps-libff: Adjust start_pts if invalid pts found
If the first guessed pts is less than the start_pts, it could
lead to a negative PTS being returned.

Change the behavior so that the first frame's pts, if zero, is
set to the start_pts.  If more than one frame is less than the
start_pts, the start_pts is determined invalid and set to 0.

Valid start_pts example:
  start_pts = 500

  first frame (pts = 0)
    pts = 500 (< start_pts)
    pts -= 500 (offset by start_pts)

    ret 0

  second frame (pts = 700)
    pts = 700 (no change, > start_pts)
    pts -= 500 (offset by start_pts)

    ret 200

Invalid start_pts example:
  start_pts = 500

  first frame (pts = 0)
    pts = 500 (< start_pts)
    pts -= 500 (offset by start_pts)

    ret 0
  second frame (pts = 300)
    pts = 300 (< start_pts, start_pts set to 0)
    pts -= 0 (start_pts is now 0)

    ret 300
2015-08-02 15:54:35 -05:00
jp9000
c87d3b1f12 cmake: Rename FindFFMpeg to FindFFmpeg
This was sort of driving me crazy: The 'm' in FFmpeg isn't supposed to
be capitalized.
2015-07-18 16:32:26 -07:00
Momcilo Medic
8421051831 deps-w32-pthreads: Update FSF address
Closes jp9000/obs-studio#453
2015-07-11 09:10:27 -07:00
Christoph Hohmann
e96c7c86b6 deps-libff: Fix stack corruption
ff_clock_init expects a parameter with a pointer where it stores the
address of the newly allocated ff_clock, but ff_demuxer_reset does not
provide this parameter. That somehow writes the pointer to the ff_clock
into the packet->base->buf field on the stack of the ff_demuxer_reset
function. This later causes a segmentation fault when the packet is freed.

Closes jp9000/obs-studio#448
2015-07-07 15:23:23 -07:00
jp9000
8ae0cd2492 ipc-util: Fix access rights issue with IPC pipe
This was the reason why game capture could not hook when the hook was
run at administrator level and the game/target was below administrator
level: it was because the plugin created a pipe, and the hook tried to
connect to that pipe, but because the pipe was created as administrator
with default access rights, the pipe did not allow write access for
anything below administrator level, therefor the hook could not connect
to the plugin, and the hook would always fail as a result.

This fixes the issue by creating the pipe with full access rights to
everyone instead of default access rights.
2015-07-05 15:17:08 -07:00
jp9000
6ed694f617 deps-libff: Fix starting timestamp bug
Certain input streams (such as remote streams that are already active)
can start up mid-stream with a very high initial timestamp values.
Because of this, it would cause the libff timer to delay for that
initial timestamp, which often would cause it to not render at all
because it was stuck waiting.

To fix the problem, we should ignore the timestamp difference of the
first frame when it's above a certain threshold.
2015-07-04 22:16:22 -07:00
jp9000
171f0e3d26 deps-libff: Offset start of stream by start pts
Now that we're using the timestamps from the stream for playback,
certain types of streams and certain file formats will not start from a
pts of 0.  This causes the start of the playback to be delayed.  This
code simply ensures that there's no delay on startup.  This is basically
the same code as used in FFmpeg itself for handling this situation.
2015-07-04 16:25:37 -07:00
John Bradley
6c4be20932 deps-libff: Fix pts diffs being adjusted wrongly
Removed code where if a PTS diff was greater than a certain
threshold it was forced to the previous PTS diff.  This breaks
variable length frame media like GIF.
2015-05-13 11:12:10 -05:00
Jim
ee284a56ac Merge pull request #424 from fryshorts/bsd-build-fixes
BSD build fixes
2015-05-05 04:46:16 -07:00
fryshorts
a02f2905b8 deps-jansson: Enable -fPIC for non-gcc compilers
Always use -fPIC when not on WIN32 or APPLE and not just with gcc.
This allows for building obs with clang on linux and FreeBSD
without explicitly specifying -fPIC as compiler flag to cmake.
2015-05-04 19:32:23 +02:00
GoaLitiuM
1e241bd24f jansson: Fix integer and real value formatting with VS2015
This is related to CRT changes in VS2015. All printf related functions
are now defined inline, which breaks the CMake's link time checking.
2015-05-04 19:33:54 +03:00
GoaLitiuM
e251d26560 w32-pthreads: Fix build errors with VS2015 2015-05-04 19:33:54 +03:00
fryshorts
42a9a0af3e deps-glad: Only link to libdl on Linux
Only link to libdl when on Linux. FreeBSD for example has this built
into their libc.
2015-05-03 14:38:24 +02:00
kc5nra
091a002c37 deps-libff: Add extensions to format description 2015-04-26 22:29:11 -05:00
Ethan Lee
fd4f2e29aa Buildfix for older FFmpeg versions (F20 RPMFusion) 2015-04-01 06:50:22 -04:00
kc5nra
0976126ebb deps-libff: Add ff codec/format utility functions
This adds utility functions for determining which
codecs and formats are supported by loaded FFMpeg
libraries.  This includes validating the codecs that
a particular format supports.
2015-03-30 17:30:29 -05:00
kc5nra
9f301cda94 deps-libff: Add extern "C" to all headers 2015-03-30 17:26:15 -05:00
kc5nra
36820a05e0 deps-libff: Link FFmpeg libraries 2015-03-30 17:26:15 -05:00
kc5nra
8effe2c635 deps-libff: Send NULL frame to callback if EOF
A null frame send to the frame callback signals
the end of media being played.  Null frames are not
sent for looped media
2015-03-24 00:18:48 -05:00
kc5nra
94e58057fd deps-libff: Fix sequence-point warning
Silly code that pre-incremented a value while also assigning
it to the same value.
2015-03-23 22:28:08 -05:00
kc5nra
f1f5484b16 deps-libff: Skip further decode refresh if aborted
Skip decode refresh scheduling if the abort flag is
set when the timer fails to start.  This avoids extraneous
refresh scheduling when tearing down the decoders.
2015-03-23 22:16:39 -05:00
kc5nra
f47b02df3f deps-libff: Add proper ff_timer_init error checks 2015-03-23 22:16:39 -05:00
kc5nra
e868af285e deps-libff: Fix mingw using wrong pthread header
When compiling under mingw it was using the w32-pthreads
instead of the shared mingw pthread library.
2015-03-23 22:16:39 -05:00
kc5nra
798f38cf72 deps-libff: Fix if hw accel fails to load codec
Fixes a bug where get_format was overloaded by our own version
when forcing the codec to load with a HW decoder and not
reset to the original get_format if it failed to load.
2015-03-22 18:58:49 -05:00
John Bradley
aa8363bb87 deps-libff: Fix other multithreaded image decoders
In the same manner that PNG doesn't appear to work properly
with multiple threads, TIFF, JPEG2000 and WEBP also appears
to not render correctly (use of FFmpeg's ff_thread_* routines)
if decode is called before the automatic thread detection
has returned a suggested thread count for the decoder.
2015-03-20 17:51:54 -05:00
John Bradley
c78fa63b47 deps-libff: Fix memory leak in ff_demuxer_reset
The reset method unnecessarily malloced a packet passed into
the packet buffer which does a dereferencing copy.
2015-03-20 17:14:23 -05:00
John Bradley
5465fcb4a2 deps-libff: Initialize FFmpeg network
If this is omitted and you use an input that requires the network
you get a warning message about future versions not automatically
doing this for you.
2015-03-19 14:40:24 -05:00
John Bradley
b2d5b47833 deps-libff: Remove extra whitespace 2015-03-19 14:40:24 -05:00
John Bradley
f8c38d1fcf deps-libff: Remove misleading comment 2015-03-19 14:40:24 -05:00
John Bradley
312d59da02 deps-libff: Fix comment formatting 2015-03-19 14:40:24 -05:00