2019-04-01 00:10:25 -07:00
|
|
|
#pragma once
|
|
|
|
|
2017-02-05 21:37:35 -08:00
|
|
|
#include <windows.h>
|
|
|
|
#include <mmdeviceapi.h>
|
|
|
|
#include <audioclient.h>
|
|
|
|
|
2018-03-12 16:16:38 -07:00
|
|
|
#ifndef KSAUDIO_SPEAKER_2POINT1
|
2019-06-22 22:13:45 -07:00
|
|
|
#define KSAUDIO_SPEAKER_2POINT1 (KSAUDIO_SPEAKER_STEREO | SPEAKER_LOW_FREQUENCY)
|
2018-03-12 16:16:38 -07:00
|
|
|
#endif
|
|
|
|
|
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-05-26 17:15:54 -07:00
|
|
|
#define KSAUDIO_SPEAKER_SURROUND_AVUTIL \
|
2019-06-22 22:13:45 -07:00
|
|
|
(KSAUDIO_SPEAKER_STEREO | SPEAKER_FRONT_CENTER)
|
2018-03-12 16:16:38 -07:00
|
|
|
|
|
|
|
#ifndef KSAUDIO_SPEAKER_4POINT1
|
2019-06-22 22:13:45 -07:00
|
|
|
#define KSAUDIO_SPEAKER_4POINT1 \
|
|
|
|
(KSAUDIO_SPEAKER_SURROUND | SPEAKER_LOW_FREQUENCY)
|
2018-03-12 16:16:38 -07:00
|
|
|
#endif
|
2017-02-05 21:37:35 -08:00
|
|
|
|
2019-06-22 22:13:45 -07:00
|
|
|
#define safe_release(ptr) \
|
|
|
|
do { \
|
|
|
|
if (ptr) { \
|
2017-02-05 21:37:35 -08:00
|
|
|
ptr->lpVtbl->Release(ptr); \
|
2019-06-22 22:13:45 -07:00
|
|
|
} \
|
2017-02-05 21:37:35 -08:00
|
|
|
} while (false)
|