Commit Graph

34 Commits (master)

Author SHA1 Message Date
jp9000 2f8d28f7fa decklink: Keep deckLinkConfiguration while in use
Apparently this annoying, stupid variable was leaking before the ComPtr
was added, which ironically was necessary to ensure devices worked.
After that ComPtr commit some devices stopped capturing properly.
Basically, it implies that this pointer needs to stick around while the
device is in use.

(Jim note: This was one of the most painful things I've ever had to
debug)
2022-09-02 17:09:12 -07:00
Norihiro Kamae 8a41c7298f decklink: Avoid sending 0x0 frame to libobs
When the mode is set to auto, the API sometimes send frames with 0x0
size. Without filtering such frames, which causes libobs to output error
messages.
2022-06-11 16:22:22 -07:00
jpark37 848e128435 libobs,plugins: Replace video matrix function
video_format_get_parameters_for_format provides a more accurate matrix
than video_format_get_parameters.
2022-04-07 19:28:51 -07:00
cg2121 efce0f41d0 decklink: Use ComPtr for variables
This makes sure Decklink variables are automatically released.

Closes https://github.com/obsproject/obs-studio/pull/5508
2022-03-08 03:36:01 -08:00
Colin Edwards 8285141ba5 decklink: Fix automatic pixel format detection 2020-12-20 14:44:14 -08:00
Colin Edwards 5b8f89d86e decklink: Clean up warnings introduced by caption code 2020-11-03 17:00:14 -08:00
Stéphane Cottin 65daf2c86d
decklink: Fix format detection loop
Ignore color space change in format detection to fix endless loop.
Fix #3511
Fix #3277
2020-11-02 22:18:52 +01:00
Colin Edwards 923f06bfa6 decklink: Add ability to ingest/embed cea 708 captions
(This commit also modifies libobs, UI)
2020-11-01 22:28:49 -08:00
jpark37 b6afaceeae Update VIDEO_CS_DEFAULT to mean 709 instead of 601
Consistent with modified default UI setting.
2020-09-06 20:51:28 -07:00
Hans Petter Selasky 0e4ea14ba1 libobs: Implement and use better scaling function for 64-bit integers
As os_gettime_ns() gets large the current scaling methods, mostly by casting
to uint64_t, may lead to numerical overflows. Sweep the code and use
util_mul_div64() where applicable.

Signed-off-by: Hans Petter Selasky <hps@selasky.org>
2020-04-05 20:27:28 +02:00
jp9000 f53df7da64 clang-format: Apply formatting
Code submissions have continually suffered from formatting
inconsistencies that constantly have to be addressed.  Using
clang-format simplifies this by making code formatting more consistent,
and allows automation of the code formatting so that maintainers can
focus more on the code itself instead of code formatting.
2019-06-23 23:49:10 -07:00
jp9000 7d136c3ce1 decklink, win-dshow: Use obs_source_output_video2
Allows the ability to override and use partial range RGB with the
DirectShow and Decklink device sources when partial range RGB is
implemented.  Fixes certain cases where devices could capture RGB in
limited range via HDMI (per the HDMI specs).
2019-04-25 15:12:33 -07:00
Colin Edwards 818001fb59 decklink: Allow selecting input connections. 2019-03-03 13:19:38 -06:00
pkv 05508ac895 decklink: Fix FC<->LFE channel swap for some devices
Fixes mantis issue https://obsproject.com/mantis/view.php?id=1379
For some devices with hdmi input, the Front Center channel and the LFE
channel are swapped. For some others they are not.
To solve the issue a new swap setting is added so that the user can
swap the two channels if needed.
2019-03-03 19:57:27 +01:00
Colin Edwards e296855d14 Decklink: only use RGBA when using keyer 2019-01-04 22:25:08 -06:00
Colin Edwards 19bc92d267 Decklink: Keyer support 2019-01-04 17:34:00 -06:00
Jim a43a4fac7e
Merge pull request #1043 from DDRBoxman/decklinkout
Decklink: Add decklink output
2018-09-25 18:15:14 -07:00
Colin Edwards 21b67cff64 Decklink: add output support 2018-09-25 19:13:25 -05:00
pkviet c7dab6c92b decklink: Remove inactive audio channels (linux, macOs)
Decklink cards accept 2, 8 or 16 audio channels.
If obs audio output is setup to n channels ( 8 >= n > 2), and the
decklink card captures n channels, one needs to squash the silent
channels (n+1, .., 8) or sampling issues occur.
This had been done on windows but is required also on macOs and linux.
The commit adds the fix for macOS and linux.
Some code factoring has also been done.

Closes obsproject/obs-studio#1350
2018-09-15 13:21:21 -07:00
pkviet 974e64eb23 decklink: Add 2.1 & 4.1 surround layouts
The list of channel layouts available for decklink input is missing 2.1
& 4.1 layouts.  The commit adds them.  This aligns the decklink input
with the speaker layouts available at outputs.  Having different layouts
as input and output invokes FFmpeg resampler, which remixes the channels
in non trivial way except when downmixing to stereo.  This patch allows
to avoid such uncontrolled remix of channels with decklink input.
2018-01-05 13:44:57 -08:00
pkviet 67e48ecc2c libobs/media-io: Replace quad with 4.0
(also obs, deps/media-playback, libobs/audio-monitoring, decklink,
linux-alsa, linux-pulseaudio, mac-capture, obs-ffmpeg, win-dshow,
win-wasapi)

Default channel layout for 4 channels is 4.0 in FFmpeg.
Replacing quad with 4.0 will improve compatibility since FFmpeg has
better support of its default channel layouts.
2018-01-05 09:48:52 -08:00
pkviet fb580535c9 libobs/media-io: Clean surround API
(also modifies obs-ffmpeg, audio-monitoring, win-wasapi, decklink,
obs-outputs)

Removes speaker layouts which are not exposed in UI.  The speaker
layouts selectable by users in the UI are the most common ones.  It is
not necessary to keep other layouts.  (This basically removes
5POINT1_SURROUND, 7POINT1_SURROUND, SURROUND =3.0).
2018-01-05 09:47:59 -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
jp9000 4330021617 decklink: Use unbuffered by default, and decouple
Use unbuffered async mode by default, and when in unbuffered mode,
decouple audio/video so that audio plays as soon as it's received.

This is a workaround for decklink device drivers having unreliable
video/audio timestamps (audio/video sync drifting over time).  From
testing, it seems that the handling of video and audio is completely
separate in the driver; along with the timestamp calculations.  For
example, when the thread of the decklink audio callback is stalled, it
would cause the timestamps of the audio alone to go out of sync, which
indicates timestamps are calculated more or less on the spot independent
of what video is doing (which is how we replicated the issue fixed by
b63e4b055e).  Because decklink drivers treats the audio and video as
essentially decoupled, we must also treat it as decoupled.  This is what
was causing video/audio to drift out of sync over time.
2017-10-10 07:04:21 -07:00
mntone 41c2f5e13b decklink: Add feature to detect resolution/format
Closes jp9000/obs-studio#879
2017-06-29 15:42:04 -07:00
jp9000 b63e4b055e decklink: Add workaround for audio timestamp jump issue 2017-04-07 19:57:34 -07:00
mntone c459ade360 decklink: Add option to select channel format
Closes jp9000/obs-studio#867
2017-04-07 19:56:28 -07:00
jp9000 c77544f546 decklink: Add option to select pixel format
This replaces the name-based detection of the 4K intensity pro, and
allows other devices to be able to use the BGRA pixel format, if the
user so chooses.
2015-10-13 19:08:01 -07: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
jp9000 595de46e9d decklink: Fix crash (null pointer dereference)
This is my fault; I made an idiotic assumption about the data and it
ended up causing the plugin to crash.  This is definitely one of my more
embarrassing moments.
2015-07-25 09:51:30 -07:00
jp9000 845a9d2f1a decklink: Fix mingw compiler warnings 2015-07-11 14:26:50 -07:00
jp9000 ae733230b7 decklink: Use audio/video timestamps from SDK
System timestamps were being used instead of timestamps from the
audio/video input.  This would cause potential desync as well as
incremental buffering when using devices with the blackmagic video
source.  Using the timestamps direct from the SDK itself fixes those
issues, and causes audio/video to play back properly and in sync.
2015-07-01 20:03:10 -07:00
Skyler Lipthay 4225fa8eee decklink: Add Blackmagic DeckLink capture plugin
This is a cross-platform Blackmagic device capture plugin that makes use
of the manufacturer provided DeckLink SDK.
2015-03-21 16:40:05 -07:00