Commit Graph

326 Commits (master)

Author SHA1 Message Date
Colin Edwards fcea48490f cmake: Do not require X11 on OSX 2017-12-02 22:40:10 -06:00
pkviet 89bc6bdc03 deps/media-playback: Fix compilation with older FFmpeg versions
Fixes an issue where media-playback would not compile with older FFmpeg
versions due to the fact that the AV_PIX_FMT_VIDEOTOOLBOX was
unavailable until version 54.31.100 of libavutil (FFmpeg 2.8).

Fixes mantis issue 1045.

Closes jp9000/obs-studio#1089
2017-12-02 09:09:26 -08:00
pkviet bbac3280c1 libobs: Add surround sound audio support
(This commit also modifies the following modules: UI,
deps/media-playback, coreaudio-encoder, decklink, linux-alsa,
linux-pulseaudio, mac-capture, obs-ffmpeg, obs-filters, obs-libfdk,
obs-outputs, win-dshow, and win-wasapi)

Adds surround sound audio support to the core, core plugins, and user
interface.

Compatible streaming services: Twitch, FB 360 live
Compatible protocols: rtmp / mpeg-ts tcp udp
Compatible file formats: mkv mp4 ts  (others untested)
Compatible codecs: ffmpeg aac, fdk_aac, CoreAudio aac,
		   opus, vorbis, pcm (others untested).
Tested streaming servers: wowza, nginx
	 HLS, mpeg-dash : surround passthrough
Html5 players tested with live surround:
	 videojs, mediaelement, viblast (hls+dash), hls.js
Decklink: on win32, swap channels order for 5.1 7.1
         (due to different channel mapping on wav, mpeg, ffmpeg)
Audio filters: surround working.
Monitoring: surround working (win macOs linux (pulse-audio)).
VST:	 stereo plugins keep in general only the first two channels.
	 surround plugins should work (e.g. mcfx does).
OS: win, macOs, linux (alsa, pulse-audio).
Misc: larger audio bitrates unlocked to accommodate more channels
NB: mf-aac only supports mono and stereo + 5.1 on win 10
         (not implemented due to lack of usefulness)

Closes jp9000/obs-studio#968
2017-11-26 03:41:53 -08:00
pkviet d670d7badb libobs: Fix FFmpeg constants
(This commit also modifies the deps/media-playback, obs-ffmpeg, and
win-dshow modules)

More fixes due to ffmpeg renaming some constants and deprecating
AVFMT_RAWPICTURE and AV_PIX_FMT_VDA_VLD.
Latter replaced by AV_PIX_FMT_VIDEOTOOLBOX per ffmpeg dev advice.

Closes jp9000/obs-studio#1061
2017-11-16 21:38:37 -08:00
Richard Stanway c571ba469b deps/media-playback: Use new ffmpeg constants 2017-10-26 19:16:49 +02:00
Thomas De Schampheleire 379137d039 file-updater: fix crash due to network timeout
If there is no network connection, OBS crashes after 5 minutes idling
with following crash:

*** longjmp causes uninitialized stack frame ***: obs terminated
======= Backtrace: =========
/lib64/libc.so.6(+0x6f1e3)[0x7f8f95f901e3]
/lib64/libc.so.6(__fortify_fail+0x37)[0x7f8f96018ba7]
/lib64/libc.so.6(+0xf7add)[0x7f8f96018add]
/lib64/libc.so.6(__longjmp_chk+0x29)[0x7f8f96018a39]
/usr/lib64/libcurl.so.4(+0xa5d5)[0x7f8f979b75d5]
/lib64/libpthread.so.0(+0x10e30)[0x7f8f962cae30]
/lib64/libc.so.6(__poll+0x2d)[0x7f8f95fff46d]
/usr/lib64/libglib-2.0.so.0(+0x4a64c)[0x7f8f91b5564c]
/usr/lib64/libglib-2.0.so.0(g_main_context_iteration+0x2c)[0x7f8f91b5575c]
/usr/lib64/libQt5Core.so.5(_ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE+0x5f)[0x7f8f9706c1ff]
/usr/lib64/libQt5Core.so.5(_ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE+0xfa)[0x7f8f9701defa]
/usr/lib64/libQt5Core.so.5(_ZN16QCoreApplication4execEv+0x9c)[0x7f8f970258fc]
obs(main+0x5ac)[0x4773dc]
/lib64/libc.so.6(__libc_start_main+0xf0)[0x7f8f95f41700]
obs(_start+0x29)[0x478389]

Internet search [1] revealed that this is a libcurl bug that can be worked
around by asking curl not to install signal handlers.

[1] https://stackoverflow.com/a/10755612
2017-10-05 13:57:27 +02:00
jp9000 c9182a9878 obs-ffmpeg: Fix potential seek issues with media source
(This commit also modifies deps/media-playback)

Before, the media-playback library would detect whether something was
seekable by checking the filename for "://", which is unideal because
there are other cases where targets may not be seekable.  So instead, an
explicit "seekable" property (off by default) is now in place in the
media source when not in "local file" mode.  Seeking will only be
enabled if local file mode is on, or if "seekable" is explicitly checked
by the user.

Closes jp9000/obs-studio#1022
2017-09-17 05:55:56 -07:00
jp9000 f4a1ee3658 deps/media-playback: Add concat playback support
Allows using a makeshift playlist file with media playback.
2017-08-03 02:07:58 -07:00
jp9000 81fa5179cd deps/file-updater: Add func to get single remote file 2017-07-31 13:56:20 -07:00
Shaolin 14f734f631 deps/jansson: Update jansson to version 2.9
Closes jp9000/obs-studio#797
2017-06-26 07:28:59 -07:00
jp9000 d5adfff978 deps/media-playback: Fix playback reset fail after stop
The recent changes in 88ae9af causes av_read_frame to check for
m->stopping, and fail with AVERROR_EXIT if true, which would happen
after each reset.  Moving mp_media_prepare_frames to a line after
m->stopping is reset to false fixes the issue.
2017-06-14 08:20:30 -07:00
jp9000 3f5920ae5d deps/media-playback: Fix AV_NOPTS_VALUE being used as timestamp
With certain media files (wmv in particular), the very last frame will
have a timestamp of AV_NOPTS_VALUE.  This could cause the media to stick
on that frame indefinitely.  Instead, use the estimated next timestamp
that was calculated in the previous frame.
2017-06-14 00:43:31 -07:00
jp9000 c1cf44fd91 deps/media-playback: Add timeout when waiting for frames
Media files that have a very low framerate or very long interval between
frames would cause the media playback to stall indefinitely until the
next frame is played.  This adds a 200ms timeout to ensure that the
media can be destroyed without being forced to wait indefinitely for the
next frame.
2017-06-14 00:39:10 -07:00
jp9000 88ae9aff6e deps/media-playback: Fix lockup issues
Certain functions such as avformat_open_input and av_read_frame can
block, causing the program to someone wait very long periods of time
when a network URL is used with the media source.  The
interrupt_callback member variable in AVFormatContext allows safely
canceling IO operations when trying to shut down or stop the
media-playback interface.
2017-06-04 00:44:04 -07:00
jp9000 f0ff1c481d deps/media-playback: Call stop callback on failure 2017-05-29 19:30:14 -07:00
jp9000 892a6548e7 obs-ffmpeg: Add network buffering property
(Note: This commit also modifies deps/media-playback)

Allows buffering network-based media sources where supported.  Default
is two megabytes of buffering.
2017-05-29 19:30:13 -07:00
jp9000 0302a4e7f7 deps/media-playback: Start decoding regardless of keyframe
Currently, when media-playback is used with a network address, video has
to wait for the first keyframe before it starts decoding.  This is
probably not wise because the first packet of video may contain
additional header information, and because audio is forced to wait and
buffer while waiting for a keyframe, potentially causing a lot of audio
to get backed up unnecessarily which could inadvertently cause sync or
audio playback issues.

So, instead of waiting for a keyframe before decoding starts, decode
right away, and make it wait for a keyframe before calling the video
callback instead.
2017-05-29 19:30:12 -07:00
jp9000 ea6bdf58e0 deps/media-playback: Output av_read_frame error string 2017-05-29 19:30:11 -07:00
jp9000 4217f273a6 deps/media-playback: Fix bug where inverted media would crash
When media returns frames with negative linesizes, it means they're
inverted RGB formats and start from the last line of the image and move
back to the top via the negative linesize number.  This would cause a
crash because this wasn't being taken in to account, and it would
traverse in to invalid memory.
2017-05-20 11:14:58 -07:00
jp9000 4aea3ce7da deps/media-playback: Always check for new frame first
Fixes potential decoding errors with FFmpeg's new decode API.  Because
avcodec_send_packet may process multiple packets, you must call
avcodec_receive_frame continually until no more frames are left.
2017-05-17 17:10:32 -07:00
jp9000 d54b51edf4 deps/media-playback: Use new FFmpeg decode funcs when possible
Prevents potential decoding issues by relying on FFmpeg to manage
sub-packet handling.
2017-05-17 16:58:47 -07:00
jp9000 5ebec76b60 deps/media-playback: Discard packet returns of invalid sizes 2017-05-17 16:23:21 -07:00
jp9000 2b3d619c31 deps/media-playback: Init avformat in thread
Prevents the media playback object from locking the render thread.
2017-05-16 01:55:58 -07:00
jp9000 3b091b1668 deps/media-playback: Do not seek network streams
Will cause avformat to lock up perpetually on av_read_frame.
2017-05-16 01:54:39 -07:00
jp9000 a78daa8a1c deps/media-playback: Include SSE flags 2017-05-16 00:51:04 -07:00
jp9000 b2717132d9 deps/media-playback: Remove unnecessary logging
Failure to decode is unfortunately quite common with certain file types,
and is most of the time safely recoverable.  There's no reason to
actually output a log message for this unless really needed.
2017-05-15 15:17:13 -07:00
jp9000 f4bc778498 deps/libff: Don't build libff (deprecated) 2017-03-31 12:10:35 -07:00
jp9000 a08d5505e6 deps/libff: Remove network init
Isn't really necessary due to libff being deprecated
2017-03-31 12:10:33 -07:00
jp9000 2329c71dac deps: Add media-playback static lib
Intended to replace libff as the media playback library.  Intended to
use less threads and be more extensible.  It was nearly impossible to
modify libff without bursting a vein.
2017-03-31 12:10:31 -07:00
jp9000 54683c981a deps: Add liblmza
Used by the update module on windows.
2017-03-06 03:54:51 -08:00
jp9000 805611615e deps/blake2: Fix compiler warning 2017-03-06 03:54:48 -08:00
derrod ca2bc6b4b0 libff: Add override for codec compatability check
In some cases the result of the compatability check is wrong.
For example the format "mpegts" only shows "mpeg2video" as an
encoder even though other codecs such as h.264 are supported by
ffmpeg's muxer for that container and are used within that container
in some applications.

Closes jp9000/obs-studio#804
2017-02-25 09:08:02 -08:00
Richard Stanway 8b640fae24
Fix various null pointer issues detected by Coverity 2017-02-25 16:45:45 +01:00
Richard Stanway 23a115b0b3 UI: Use blake2b instead of SHA1 for updater 2017-02-24 09:09:20 -08:00
jp9000 679c32086d deps/libff: Fix VP8/VP9/webm alpha support
FFmpeg by default decodes VP8/VP9 via its internal encoders, however
those internal encoders do not support alpha.  Encoded alpha is stored
via meta/side data in the container, so the only way to decode it
properly is via forcing FFmpeg to use libvpx for decoding.
2016-12-28 14:25:30 -08:00
jp9000 4f7ea15f42 Add libcaption library
Manually merging/squashing from: https://github.com/szatmary/libcaption
2016-12-23 10:37:06 -08:00
Kurt Kartaltepe aff26d9840 libff: Allow custom demuxer options 2016-11-28 19:15:30 -06:00
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
John Bradley 3628d3402d deps-libff: Add frame dropping
This, if set, instructs the decoders to drop
frames if a specific timing window is not met.
2015-03-19 14:40:24 -05:00
John Bradley 6b36d39345 deps-libff: Add clock chaining to packets/frames
This attaches clocks to packets and frames and defers
the start time until that particular frame is presented.
Any packets/frames in the future with the same clock
will reference that start time.

This fixes issues when there are multiple start times
in a large buffer (looped video/images/audio) and different
frames need different reference clocks to present correctly.
2015-03-19 14:40:24 -05:00
John Bradley a5e0462a88 deps-libff: set master clock sync type based on default stream 2015-03-19 14:40:24 -05:00
John Bradley 6e42f38386 deps-libff: Add master/slave deferred clock methods
Enables clocks to wait if the main sync clock has not been started yet.  An example of this is a video stream (video/audio) being synced to the video clock.  If an audio frame gets produced before the video clock has started it will wait.
2015-03-19 14:40:19 -05:00
John Bradley 5b3190593c deps-libff: Add reference counting to clock
Add referencing counting to determine when to release a clock Due to no fixed ownership of clocks (packets, frames, decoders and  refresh thread all may own a clock at some point).
2015-03-19 11:56:00 -05:00
kc5nra 164cbeeede deps-libff: Add atomic long inc/dec functions 2015-03-19 11:56:00 -05:00
John Bradley 47783f26c7 deps-libff: Abort timer thread instead of cancelling 2015-03-19 11:56:00 -05:00
John Bradley 7a4a5e3fad deps-libff: Move timer callback outside of lock 2015-03-19 11:55:51 -05:00
John Bradley d9fe44f021 deps-libff: Only sleep if the timed wait didn't expire 2015-03-19 11:55:43 -05:00
John Bradley de574e99e3 deps-libff: Fix bug where rel time was used instead of abs
The bug was undetected because it accidentally fell into an error case that slept the correct amount of time.  pthread_cond_timedwait takes an absolute time in the future to wait until.  The value we were passing was always in the past so it was immediately failing with a TIMEDOUT error code.
2015-03-19 11:55:23 -05:00
John Bradley 2b3d82aeac deps-libff: Add flag whether a decoder is hardware accelerated
This lets the decoder make decisions based on whether it is a hardware decoder or not.  Specifically, hardware decoders are more strict as to which frames can be dropped in an h264 stream.
2015-03-19 11:54:53 -05:00
John Bradley b91a98ed44 deps-libff: Refactor AVPacket into ff_packet
This also replaces AVPacketList with ff_packet_list.
2015-03-19 11:54:51 -05:00
John Bradley a7e81d6f3f deps-libff: (unsigned char *) -> (uint8_t *) cast fix 2015-03-19 11:53:13 -05:00
John Bradley 361522198e deps-libff: Workaround to PNG multithreaded bug in ffmpeg
FFMpeg has an issue where png decoding will not correctly
begin until its optimal-thread-detection finishes in
multi-threaded mode. This unfortunately is after decoding
has begun.
2015-03-10 12:55:53 -05:00
John Bradley b3fddc9f53 obs-ffmpeg: Support interrupt callbacks for both av input styles 2015-03-10 12:47:08 -05:00
kc5nra 5d6a4e5172 deps-libff: Add libff library to deps
This library wraps the ffmpeg library and adds some utility
functions and types.
2015-03-09 21:22:32 -05:00
jp9000 0c1d121ff2 Remove various unused variables
Unused variables detected by mingw
2015-02-09 03:49:13 -08:00
martell 119c06198a deps-glad: don't build with -fPIC on windows
-fPIC generates unwanted warnings in mingw on windows.
2015-02-09 03:41:47 -08:00
martell e869a914b0 cmake: exclude w32-pthreads for mingw-w64
mingw-w64 has its own pthreads library
2015-02-08 06:40:15 -08:00
jp9000 5d9526d98c Add ipc-util static library for IPC functions
Originally I made the "win_pipe" stuff for named pipes on windows but it
was argued that it should be available to all modules and
programs/libraries that the modules might communicate with.

It cannot really be put in to libobs due to the fact that there would
hypothetically be things unrelated to libobs that might want to use it,
so I felt the best option was just to create a simple static library
specific for interprocess communication.

Non-windows versions of these functions are still yet to be implemented.
2014-12-08 01:53:53 -08:00
BtbN 3b26db389d Fix Jansson dependency importing 2014-07-17 18:13:25 +02:00
BtbN 34cf2b0528 Add glad headers to CMakeLists 2014-07-10 14:36:56 +02:00
BtbN 6d8146f6f0 Honor QUIET argument in FindJansson 2014-06-18 06:24:21 +02:00
BtbN 2cc24dccab Add support for external jansson 2014-05-24 15:47:03 +02:00
BtbN ce542525fc Fix dependency on win32-pthreads 2014-05-08 14:43:16 +02:00
BtbN b586240fa0 Stop forcing parameters on jansson. Modify their CMakeLists directly instead 2014-04-20 17:51:06 +02:00
BtbN afd8b63687 Fix w32-pthreads build and string handling 2014-04-20 17:51:05 +02:00
jp9000 2faef6f098 Fix jansson_config.h issue 2014-04-19 21:32:02 -07:00
jp9000 903287a3df Add 'SHARED' to add_library in w32-pthreads cmake 2014-04-19 21:08:38 -07:00
jp9000 92812ba313 Make w32-pthreads and jansson shared libraries 2014-04-19 20:33:45 -07:00
BtbN 334792a62c Add glad opengl loader 2014-04-15 22:19:40 +02:00
jp9000 fdd5b2b3b6 Fix a few warnings with jansson 2014-04-14 13:46:07 -07:00
jp9000 92522d1886 Implement RTMP module (still needs drop code)
- Implement the RTMP output module.  This time around, we just use a
   simple FLV muxer, then just write to the stream with RTMP_Write.
   Easy and effective.

 - Fix the FLV muxer, the muxer now outputs proper FLV packets.

 - Output API:
   * When using encoders, automatically interleave encoded packets
     before sending it to the output.

   * Pair encoders and have them automatically wait for the other to
     start to ensure sync.

   * Change 'obs_output_signal_start_fail' to 'obs_output_signal_stop'
     because it was a bit confusing, and doing this makes a lot more
     sense for outputs that need to stop suddenly (disconnections/etc).

 - Encoder API:
   * Remove some unnecessary encoder functions from the actual API and
     make them internal.  Most of the encoder functions are handled
     automatically by outputs anyway, so there's no real need to expose
     them and end up inadvertently confusing plugin writers.

   * Have audio encoders wait for the video encoder to get a frame, then
     start at the exact data point that the first video frame starts to
     ensure the most accrate sync of video/audio possible.

   * Add a required 'frame_size' callback for audio encoders that
     returns the expected number of frames desired to encode with.  This
     way, the libobs encoder API can handle the circular buffering
     internally automatically for the encoder modules, so encoder
     writers don't have to do it themselves.

 - Fix a few bugs in the serializer interface.  It was passing the wrong
   variable for the data in a few cases.

 - If a source has video, make obs_source_update defer the actual update
   callback until the tick function is called to prevent threading
   issues.
2014-04-07 22:00:10 -07:00
BtbN 45ec80fb7d Full rewrite of all CMakeLists
CMake now works on all platforms
2014-01-24 18:56:32 +01:00
jp9000 b404fb7c75 Update jansson subtree to latest revision 2014-01-20 08:49:48 -07:00
jp9000 aead95f5e3 converted project to vs2013, removed 2010 support (ugh) 2013-12-14 16:01:30 -07:00
jp9000 d8b49034c9 added jansson to the main project 2013-11-22 10:02:57 -07:00
jp9000 12790a40b5 Subtree merged in deps/jansson 2013-11-21 16:04:11 -07:00
jp9000 dc38a1b8fc added a 'deps' directory and moved w32-pthreads into it 2013-10-28 06:20:37 -07:00