Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • videolan/vlc
  • chouquette/vlc
  • bakiewicz.marek122/vlc
  • devnexen/vlc
  • rohanrajpal/vlc
  • blurrrb/vlc
  • gsoc/gsoc2019/darkapex/vlc
  • b1ue/vlc
  • fkuehne/vlc
  • magsoft/vlc
  • chub/vlc
  • cramiro9/vlc
  • robUx4/vlc
  • rom1v/vlc
  • akshayaky/vlc
  • tmk907/vlc
  • akymaster/vlc
  • govind.sharma/vlc
  • psilokos/vlc
  • xjbeta/vlc
  • jahan/vlc
  • 1480c1/vlc
  • amanchande/vlc
  • aaqib/vlc
  • rist/vlc
  • apol/vlc
  • mindfreeze/vlc
  • alexandre-janniaux/vlc
  • sandsmark/vlc
  • jagannatharjun/vlc
  • gsoc/gsoc2020/matiaslgonzalez/vlc
  • gsoc/gsoc2020/jagannatharjun/vlc
  • mstorsjo/vlc
  • gsoc/gsoc2020/vedenta/vlc
  • gsoc/gsoc2020/arnav-ishaan/vlc
  • gsoc/gsoc2020/andreduong/vlc
  • fuzun/vlc
  • gsoc/gsoc2020/vatsin/vlc
  • gsoc/gsoc2020/sagid/vlc
  • yaron/vlc
  • Phoenix/vlc
  • Garf/vlc
  • ePiratWorkarounds/vlc
  • tguillem/vlc
  • jnqnfe/vlc
  • mdc/vlc
  • Vedaa/vlc
  • rasa/vlc
  • quink/vlc
  • yealo/vlc
  • aleksey_ak/vlc
  • ePirat/vlc
  • ilya.yanok/vlc
  • asenat/vlc
  • m/vlc
  • bunjee/vlc
  • BLumia/vlc
  • sagudev/vlc
  • hamedmonji30/vlc
  • nullgemm/vlc
  • DivyamAhuja/vlc
  • thesamesam/vlc
  • dag7/vlc
  • snehil101/vlc
  • haasn/vlc
  • jbk/vlc
  • ValZapod/vlc
  • mfkl/vlc
  • WangChuan/vlc
  • core1024/vlc
  • GhostVaibhav/vlc
  • dfuhrmann/vlc
  • davide.prade/vlc
  • tmatth/vlc
  • Courmisch/vlc
  • zouya/vlc
  • hpi/vlc
  • EwoutH/vlc
  • aleung27/vlc
  • hengwu0/vlc
  • saladin/vlc
  • ashuio/vlc
  • richselwood/vlc
  • verma16Ayush/vlc
  • chemicalflash/vlc
  • PoignardAzur/vlc
  • huangjieNT/vlc
  • Blake-Haydon/vlc
  • AnuthaDev/vlc
  • gsoc/gsoc2021/mpd/vlc
  • nicolas_lequec/vlc
  • sambassaly/vlc
  • thresh/vlc
  • bonniegong/vlc
  • myaashish/vlc
  • stavros.vagionitis/vlc
  • ileoo/vlc
  • louis-santucci/vlc
  • cchristiansen/vlc
  • sabyasachi07/vlc
  • AbduAmeen/vlc
  • ashishb0410/vlc
  • urbanhusky/vlc
  • davidepietrasanta/vlc
  • riksleutelstad/vlc
  • jeremyVignelles/vlc
  • komh/vlc
  • iamjithinjohn/vlc
  • JohannesKauffmann/vlc2
  • kunglao/vlc
  • natzberg/vlc
  • jill/vlc
  • cwendling/vlc
  • adufou/vlc
  • ErwanAirone/vlc
  • HasinduDilshan10/vlc
  • vagrantc/vlc
  • rafiv/macos-bigsur-icon
  • Aymeriic/vlc
  • saranshg20/vlc
  • metzlove24/vlc
  • linkfanel/vlc
  • Ds886/vlc
  • metehan-arslan/vlc
  • Skantes/vlc
  • kgsandundananjaya96/vlc
  • mitchcapper/vlc
  • advaitgupta/vlc
  • StefanBruens/vlc
  • ratajs/vlc
  • T.M.F.B.3761/vlc
  • m222059/vlc
  • casemerrick/vlc
  • joshuaword2alt/vlc
  • sjwaddy/vlc
  • dima/vlc
  • Ybalrid/vlc
  • umxprime/vlc
  • eschmidt/vlc
  • vannieuwenhuysenmichelle/vlc
  • badcf00d/vlc
  • wesinator/vlc
  • louis/vlc
  • xqq/vlc
  • EmperorYP7/vlc
  • NicoLiam/vlc
  • loveleen/vlc
  • rofferom/vlc
  • rbultje/vlc
  • TheUnamed/vlc
  • pratiksharma341/vlc
  • Saurab17/vlc
  • purist.coder/vlc
  • Shuicheng/vlc
  • mdrrubel292/vlc
  • silverbleu00/vlc
  • metif12/vlc
  • asher-m/vlc
  • jeffk/vlc
  • Brandonbr1/vlc
  • beautyyuyanli/vlc
  • rego21/vlc
  • muyangren907/vlc
  • collectionbylawrencejason/vlc
  • evelez/vlc
  • GSMgeeth/vlc
  • Oneric/vlc
  • TJ5/vlc
  • XuanTung95/vlc
  • darrenjenny21/vlc
  • Trenly/vlc
  • RockyTDR/vlc
  • mjakubowski/vlc
  • caprica/vlc
  • ForteFrankie/vlc
  • seannamiller19/vlc
  • junlon2006/vlc
  • kiwiren6666/vlc
  • iuseiphonexs/vlc
  • fenngtun/vlc
  • Rajdutt999/vlc
  • typx/vlc
  • leon.vitanos/vlc
  • robertogarci0938/vlc
  • gsoc/gsoc2022/luc65r/vlc-mpd
  • skeller/vlc
  • MCJack123/vlc
  • luc65r/vlc-mpd
  • popov895/vlc
  • claucambra/vlc
  • brad/vlc
  • matthewmurua88/vlc
  • Tomas8874/vlc
  • philenotfound/vlc
  • makita-do3/vlc
  • LZXCorp/vlc
  • mar0x/vlc
  • senojetkennedy0102/vlc
  • shaneb243/vlc
  • ahmadbader/vlc
  • rajduttcse26/vlc-audio-filters
  • Juniorzito8415/vlc
  • achernyakov/vlc
  • lucasjetgroup/vlc
  • pupdoggy666/vlc
  • gmde9363/vlc
  • alexnwayne/vlc
  • bahareebrahimi781/vlc
  • hamad633666/vlc
  • umghof3112/vlc
  • joe0199771874/vlc
  • Octocats66666666/vlc
  • jjm_223/vlc
  • btech10110.19/vlc
  • sunnykfc028/vlc-audio-filters
  • loic/vlc
  • nguyenminhducmx1/vlc
  • JanekKrueger/vlc
  • bstubbington2/vlc
  • rcombs/vlc
  • Ordissimo/vlc
  • king7532/vlc
  • noobsauce101/vlc
  • schong0525/vlc
  • myQwil/vlc
  • apisbg91/vlc
  • geeboy0101017/vlc
  • kim.faughey/vlc
  • nurupo/vlc
  • yyusea/vlc
  • 0711235879.khco/vlc
  • ialo/vlc
  • iloveyeye2/vlc
  • gdtdftdqtd/vlc
  • leandroconsiglio/vlc
  • AndyHTML2012/vlc
  • ncz/vlc
  • lucenticus/vlc
  • knr1931/vlc
  • kjoonlee/vlc
  • chandrakant100/vlc-qt
  • johge42/vlc
  • polter/vlc
  • hexchain/vlc
  • Tushwrld/vlc
  • mztea928/vlc
  • jbelloncastro/vlc
  • alvinhochun/vlc
  • ghostpiratecrow/vlc
  • ujjwaltwitx/vlc
  • alexsonarin06/vlc
  • adrianbon76/vlc
  • altsod/vlc
  • damien.lucas44/vlc
  • dmytrivtaisa/vlc
  • utk202/vlc
  • aaxhrj/vlc
  • thomas.hermes/vlc
  • structurenewworldorder/vlc
  • slomo/vlc
  • wantlamy/vlc
  • musc.o3cminc/vlc
  • thebarshablog/vlc
  • kerrick/vlc
  • kratos142518/vlc
  • leogps/vlc
  • vacantron/vlc
  • luna_koly/vlc
  • Ratio2/vlc
  • anuoshemohammad/vlc
  • apsun/vlc
  • aaa1115910/vlc
  • alimotmoyo/vlc
  • Ambossmann/vlc
  • Sam-LearnsToCode/vlc
  • Chilledheart/vlc
  • Labnann/vlc
  • ktcoooot1/vlc
  • mohit-marathe/vlc
  • johnddx/vlc
  • manstabuk/vlc
  • Omar-ahmed314/vlc
  • vineethkm/vlc
  • 9Enemi86/vlc
  • radoslav.m.panteleev/vlc
  • ashishami2002/vlc
  • Corbax/vlc
  • firnasahmed/vlc
  • pelayarmalam4/vlc
  • c0ff330k/vlc
  • shikhindahikar/vlc
  • l342723951/vlc
  • christianschwandner/vlc
  • douniwan5788/vlc
  • 7damian7/vlc
  • ferdnyc/vlc
  • f.ales1/vlc
  • pandagby/vlc
  • BaaBaa/vlc
  • jewe37/vlc
  • w00drow/vlc
  • russelltg/vlc
  • ironicallygod/vlc
  • soumyaDghosh/vlc
  • linzihao1999/vlc
  • deyayush6/vlc
  • mibi88/vlc
  • newabdallah10/vlc
  • jhorbincolombia/vlc
  • rimvihaqueshupto/vlc
  • andrewkhon98/vlc
  • fab78/vlc
  • lapaz17/vlc
  • amanna13/vlc
  • mdakram28/vlc
  • 07jw1980/vlc
  • sohamgupta/vlc
  • Eson-Jia1/vlc
  • Sumou/vlc
  • vikram-kangotra/vlc
  • chalice191/vlc
  • olivercalder/vlc
  • aaasg4001/vlc
  • zipdox/vlc
  • kwizart/vlc
  • Dragon-S/vlc
  • jdemeule/vlc
  • gabriel_lt/vlc
  • locutusofborg/vlc
  • sammirata/vlc-librist
  • another/vlc
  • Benjamin_Loison/vlc
  • ahmedmoselhi/vlc
  • petergaal/vlc
  • huynhsontung/vlc
  • dariusmihut/vlc
  • tvermaashutosh/vlc
  • buti/vlc
  • Niram7777/vlc
  • rohan-here/vlc
  • balaji-sivasakthi/vlc
  • rlindner81/vlc
  • Kakadus/vlc
  • djain/vlc
  • ABBurmeister/vlc
  • craighuggins/vlc
  • orbea/vlc
  • maxos/vlc
  • aakarshmj/vlc
  • kblaschke/vlc
  • ankitm/vlc
  • advait-0/vlc
  • mohak2003/vlc
  • yselkowitz/vlc
  • AZM999/vlc-azm
  • andrey.turkin/vlc
  • Disha-Baghel/vlc
  • nowrep/vlc
  • Apeng/vlc
  • Choucroute_melba/vlc
  • autra/vlc
  • eclipseo/vlc
  • fhuber/vlc
  • olafhering/vlc
  • sdasda7777/vlc
  • 1div0/vlc
  • skosnits/vlc-extended-playlist-support
  • dnicolson/vlc
  • Timshel/vlc
  • octopols/vlc
  • MangalK/vlc
  • nima64/vlc
  • misawai/vlc
  • Alexander-Wilms/vlc
  • Maxime2/vlc-fork-for-visualizer
  • ww/vlc
  • jeske/vlc
  • sgross-emlix/vlc
  • morenonatural/vlc
  • freakingLovesVLC/vlc
  • borisgolovnev/vlc
  • mpromonet/vlc
  • diogo.simao-marques/vlc
  • masstock/vlc
  • pratikpatel8982/vlc
  • hugok79/vlc
  • longervision/vlc
  • abhiudaysurya/vlc
  • rishabhgarg/vlc
  • tumic/vlc
  • cart/vlc
  • shubham442/vlc
  • Aditya692005/vlc
  • sammirata/vlc4
  • syrykh/vlc
  • Vvorcun/macos-new-icon
  • AyaanshC/vlc
  • nasso/vlc
  • Quark/vlc
  • sebastinas/vlc
  • rhstone/vlc
  • talregev/vlc
  • Managor/vlc
403 results
Show changes
Commits on Source (14)
Showing with 251 additions and 124 deletions
......@@ -2100,14 +2100,17 @@ then
if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
then
VLC_ADD_CPPFLAGS([decklink decklinkoutput stream_out_sdi],[-I${with_decklink_sdk}/include])
elif test -d "${CONTRIB_DIR}/include/decklink"
then
VLC_ADD_CPPFLAGS([decklink decklinkoutput stream_out_sdi],[-I${CONTRIB_DIR}/include/decklink])
fi
VLC_SAVE_FLAGS
CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_decklink}"
AC_LANG_PUSH([C++])
AC_CHECK_HEADERS([DeckLinkAPIDispatch.cpp], [
AC_CHECK_HEADERS([DeckLinkAPI.h], [
have_decklink=yes
AS_IF([test "${SYS}" = "darwin"], [
VLC_ADD_LIBS([decklink decklinkoutput],[-Wl,-framework,CoreFoundation])
VLC_ADD_LIBS([decklink decklinkoutput stream_out_sdi],[-Wl,-framework,CoreFoundation])
])
], [
AS_IF([test "${enable_decklink}" = "yes"], [
......
# decklink OSS version
DECKLINK_VERSION := 1977bf76bb5bde80d171373cf8d80dd01161679b
DECKLINK_GITURL := https://gitlab.com/robUx4/decklink-oss.git
# enable build on supported platforms
ifdef HAVE_LINUX
PKGS += decklink
endif
ifdef HAVE_MACOSX
PKGS += decklink
endif
ifdef HAVE_WIN32
PKGS += decklink
endif
$(TARBALLS)/decklink-$(DECKLINK_VERSION).tar.xz:
$(call download_git,$(DECKLINK_GITURL),,$(DECKLINK_VERSION))
.sum-decklink: $(TARBALLS)/decklink-$(DECKLINK_VERSION).tar.xz
$(call check_githash,$(DECKLINK_VERSION))
touch $@
decklink: decklink-$(DECKLINK_VERSION).tar.xz .sum-decklink
$(UNPACK)
$(MOVE)
.decklink: decklink
mkdir -p -- "$(PREFIX)/include/"
ifdef HAVE_LINUX
cp -R $</Linux/include/ "$(PREFIX)/include/decklink/"
else ifdef HAVE_MACOSX
cp -R $</Mac/include/ "$(PREFIX)/include/decklink/"
else ifdef HAVE_WIN32
cp -R $</Win/include/ "$(PREFIX)/include/decklink/"
else
$(error Decklink SDK contrib not implemented for your OS!)
endif
touch $@
......@@ -127,7 +127,13 @@ EXTRA_LTLIBRARIES += liblinsys_hdsdi_plugin.la liblinsys_sdi_plugin.la
libdecklink_plugin_la_SOURCES = access/decklink.cpp access/sdi.c access/sdi.h access/vlc_decklink.h
libdecklink_plugin_la_CXXFLAGS = $(AM_CXXFLAGS) $(CPPFLAGS_decklink)
libdecklink_plugin_la_LIBADD = $(LIBS_decklink) $(LIBDL) -lpthread
libdecklink_plugin_la_LIBADD = $(LIBS_decklink)
if HAVE_WIN32
libdecklink_plugin_la_LIBADD += $(LIBCOM)
endif
if HAVE_LINUX
libdecklink_plugin_la_LIBADD += $(LIBDL) -lpthread
endif
if HAVE_DECKLINK
access_LTLIBRARIES += libdecklink_plugin.la
endif
......
......@@ -40,7 +40,9 @@
#endif
#include "vlc_decklink.h"
#ifndef _WIN32
#include <DeckLinkAPIDispatch.cpp>
#endif
#include <DeckLinkAPIVersion.h>
#if BLACKMAGIC_DECKLINK_API_VERSION < 0x0b010000
#define IID_IDeckLinkProfileAttributes IID_IDeckLinkAttributes
......@@ -152,7 +154,11 @@ struct demux_sys_t
IDeckLinkConfiguration *config;
IDeckLinkProfileAttributes *attributes;
#ifdef _WIN32
BOOL autodetect;
#else
bool autodetect;
#endif
es_out_id_t *video_es;
es_format_t video_fmt;
......@@ -620,7 +626,7 @@ static int Open(vlc_object_t *p_this)
char str[4];
} u;
u.id = 0;
u.id = bmdModeUnknown;
char *mode;
mode = var_CreateGetNonEmptyString(demux, "decklink-mode");
......@@ -631,7 +637,7 @@ static int Open(vlc_object_t *p_this)
msg_Dbg(demux, "Card supports input format detection");
flags |= bmdVideoInputEnableFormatDetection;
/* Enable a random format, we will reconfigure on format detection */
u.id = htonl(bmdModeHD1080p2997);
u.id = bmdModeHD1080p2997;
} else {
if (!mode || strlen(mode) < 3 || strlen(mode) > 4) {
msg_Err(demux, "Invalid mode: \'%s\'", mode ? mode : "");
......@@ -656,7 +662,11 @@ static int Open(vlc_object_t *p_this)
BMDTimeValue frame_duration, time_scale;
uint32_t field_flags;
const char *field = GetFieldDominance(m->GetFieldDominance(), &field_flags);
BMDDisplayMode id = ntohl(m->GetDisplayMode());
union {
BMDDisplayMode id;
char str[4];
} mode;
mode.id = m->GetDisplayMode();
if (m->GetName(&tmp_name) != S_OK) {
mode_name = "unknown";
......@@ -670,11 +680,11 @@ static int Open(vlc_object_t *p_this)
}
msg_Dbg(demux, "Found mode '%4.4s': %s (%dx%d, %.3f fps%s)",
(char*)&id, mode_name,
mode.str, mode_name,
(int)m->GetWidth(), (int)m->GetHeight(),
double(time_scale) / frame_duration, field);
if (u.id == id) {
if (u.id == mode.id) {
sys->video_fmt = GetModeSettings(demux, m, bmdDetectedVideoInputYCbCr422);
msg_Dbg(demux, "Using that mode");
}
......@@ -683,11 +693,11 @@ static int Open(vlc_object_t *p_this)
mode_it->Release();
if (sys->video_fmt.video.i_width == 0) {
msg_Err(demux, "Unknown video mode `%4.4s\' specified.", (char*)&u.id);
msg_Err(demux, "Unknown video mode `%4.4s\' specified.", u.str);
goto finish;
}
if (sys->input->EnableVideoInput(htonl(u.id), fmt, flags) != S_OK) {
if (sys->input->EnableVideoInput(u.id, fmt, flags) != S_OK) {
msg_Err(demux, "Failed to enable video input");
goto finish;
}
......@@ -716,7 +726,7 @@ static int Open(vlc_object_t *p_this)
}
rate = var_InheritInteger(demux, "decklink-audio-rate");
if (rate > 0 && sys->channels > 0) {
if (sys->input->EnableAudioInput(rate, bmdAudioSampleType16bitInteger, sys->channels) != S_OK) {
if (sys->input->EnableAudioInput(BMDAudioSampleRate(rate), bmdAudioSampleType16bitInteger, sys->channels) != S_OK) {
msg_Err(demux, "Failed to enable audio input");
goto finish;
}
......
......@@ -28,6 +28,9 @@
* This file defines Decklink portability macros and other functions
*/
#ifdef _WIN32
#include <initguid.h>
#endif
#include <DeckLinkAPI.h>
/* Portability code to deal with differences how the Blackmagic SDK
......@@ -38,10 +41,28 @@
typedef CFStringRef decklink_str_t;
#define DECKLINK_STRDUP(s) FromCFString(s, kCFStringEncodingUTF8)
#define DECKLINK_FREE(s) CFRelease(s)
#define PRIHR "X"
#elif defined(_WIN32)
#include <vlc_charset.h> // FromWide
typedef BSTR decklink_str_t;
#define DECKLINK_STRDUP(s) FromWide(s)
#define DECKLINK_FREE(s) SysFreeString(s)
#define PRIHR "lX"
static inline IDeckLinkIterator *CreateDeckLinkIteratorInstance(void)
{
IDeckLinkIterator *decklink_iterator;
if (SUCCEEDED(CoCreateInstance(CLSID_CDeckLinkIterator, nullptr, CLSCTX_ALL,
IID_PPV_ARGS (&decklink_iterator))))
return decklink_iterator;
return nullptr;
}
#else
typedef const char* decklink_str_t;
#define DECKLINK_STRDUP strdup
#define DECKLINK_STRDUP(s) strdup(s)
#define DECKLINK_FREE(s) free((void *) s)
#define PRIHR "X"
#endif
#endif /* VLC_DECKLINK_H */
......
......@@ -53,8 +53,14 @@ sout_LTLIBRARIES = \
libstream_out_udp_plugin.la
if HAVE_DECKLINK
libstream_out_sdi_plugin_la_CXXFLAGS = $(AM_CXXFLAGS) $(CPPFLAGS_decklinkoutput)
libstream_out_sdi_plugin_la_LIBADD = $(LIBS_decklink) $(LIBDL) -lpthread
libstream_out_sdi_plugin_la_CXXFLAGS = $(AM_CXXFLAGS) $(CPPFLAGS_stream_out_sdi)
libstream_out_sdi_plugin_la_LIBADD = $(LIBS_stream_out_sdi)
if HAVE_WIN32
libstream_out_sdi_plugin_la_LIBADD += $(LIBCOM)
endif
if HAVE_LINUX
libstream_out_sdi_plugin_la_LIBADD += $(LIBDL) -lpthread
endif
libstream_out_sdi_plugin_la_SOURCES = stream_out/sdi/sdiout.cpp \
stream_out/sdi/sdiout.hpp \
stream_out/sdi/Ancillary.cpp \
......
......@@ -31,6 +31,7 @@ using namespace sdi_sout;
AES3AudioBuffer::AES3AudioBuffer(vlc_object_t *p_obj, unsigned count)
{
obj = p_obj;
vlc_mutex_init(&bytestream_mutex);
setSubFramesCount(count);
block_BytestreamInit(&bytestream);
toconsume = 0;
......@@ -49,9 +50,8 @@ void AES3AudioBuffer::setSubFramesCount(uint8_t c)
void AES3AudioBuffer::push(block_t *p_block)
{
bytestream_mutex.lock();
vlc_mutex_locker locker(&bytestream_mutex);
block_BytestreamPush(&bytestream, p_block);
bytestream_mutex.unlock();
}
unsigned AES3AudioBuffer::read(void *dstbuf, unsigned count, vlc_tick_t from,
......@@ -92,7 +92,8 @@ unsigned AES3AudioBuffer::read(void *dstbuf, unsigned count, vlc_tick_t from,
assert(count + dstpad <= orig);
#endif
bytestream_mutex.lock();
{
vlc_mutex_locker locker(&bytestream_mutex);
uint8_t *dst = reinterpret_cast<uint8_t *>(dstbuf);
for(unsigned i=0; i<count; i++)
{
......@@ -107,7 +108,7 @@ unsigned AES3AudioBuffer::read(void *dstbuf, unsigned count, vlc_tick_t from,
if(dst)
block_PeekOffsetBytes(&bytestream, srcoffset, &dst[dstoffset], sizeof(uint16_t));
}
bytestream_mutex.unlock();
}
return 0;
}
......@@ -149,12 +150,13 @@ void AES3AudioBuffer::flushConsumed()
if(toconsume)
{
size_t bytes = FramesToBytes(toconsume);
bytestream_mutex.lock();
{
vlc_mutex_locker locker(&bytestream_mutex);
if(block_SkipBytes(&bytestream, bytes) == VLC_SUCCESS)
block_BytestreamFlush(&bytestream);
else
block_BytestreamEmpty(&bytestream);
bytestream_mutex.unlock();
}
#ifdef SDI_MULTIPLEX_DEBUG
msg_Dbg(obj, "%4.4s flushed off %zd -> pts %ld",
reinterpret_cast<const char *>(&i_codec),
......@@ -219,11 +221,10 @@ vlc_fourcc_t AES3AudioBuffer::getCodec() const
vlc_tick_t AES3AudioBuffer::bufferStart() const
{
vlc_tick_t start = VLC_TICK_INVALID;
bytestream_mutex.lock();
vlc_mutex_locker locker(&bytestream_mutex);
if(bytestream.p_block)
start = bytestream.p_block->i_pts +
FramesToDuration(BytesToFrames(bytestream.i_block_offset));
bytestream_mutex.unlock();
return start;
}
......@@ -233,10 +234,12 @@ unsigned AES3AudioBuffer::availableVirtualSamples(vlc_tick_t from) const
if(start == VLC_TICK_INVALID)
return 0;
bytestream_mutex.lock();
unsigned samples;
{
vlc_mutex_locker locker(&bytestream_mutex);
/* FIXME */
unsigned samples = BytesToFrames(block_BytestreamRemaining(&bytestream));
bytestream_mutex.unlock();
samples = BytesToFrames(block_BytestreamRemaining(&bytestream));
}
int offset = OffsetToBufferStart(from);
if(offset > 0)
......
......@@ -23,7 +23,6 @@
#include <vlc_common.h>
#include <vlc_block.h>
#include <vlc_block_helper.h>
#include <mutex>
#include <vlc_es.h>
#define MAX_AES3_AUDIO_FRAMES 8
......@@ -69,7 +68,7 @@ namespace sdi_sout
unsigned BytesToFrames(size_t) const;
unsigned TicksDurationToFrames(vlc_tick_t) const;
block_bytestream_t bytestream;
mutable std::mutex bytestream_mutex;
mutable vlc_mutex_t bytestream_mutex;
uint8_t buffersubframes;
unsigned toconsume;
vlc_fourcc_t i_codec;
......
......@@ -63,26 +63,35 @@ IDeckLinkDisplayMode * Helper::MatchDisplayMode(vlc_object_t *p_obj,
BMDDisplayMode mode_id = p_mode->GetDisplayMode();
BMDTimeValue frameduration;
BMDTimeScale timescale;
const char *psz_mode_name;
char *psz_mode_name;
decklink_str_t tmp_name;
if(p_mode->GetFrameRate(&frameduration, &timescale) == S_OK &&
p_mode->GetName(&tmp_name) == S_OK)
{
BMDDisplayMode modenl = htonl(mode_id);
union {
BMDDisplayMode id;
char str[4];
} mode;
mode.id = mode_id;
psz_mode_name = DECKLINK_STRDUP(tmp_name);
DECKLINK_FREE(tmp_name);
if(i==0)
{
BMDFieldDominance field = htonl(p_mode->GetFieldDominance());
msg_Dbg(p_obj, "Found mode '%4.4s': %s (%ldx%ld, %4.4s, %.3f fps, scale %ld dur %ld)",
(const char*)&modenl, psz_mode_name,
union {
BMDFieldDominance id;
char str[4];
} field;
field.id = p_mode->GetFieldDominance();
msg_Dbg(p_obj, "Found mode '%4.4s': %s (%ldx%ld, %4.4s, %.3f fps, scale %" PRId64 " dur %" PRId64 ")",
mode.str, psz_mode_name,
p_mode->GetWidth(), p_mode->GetHeight(),
(const char *)&field,
field.str,
double(timescale) / frameduration,
timescale, frameduration);
}
free(psz_mode_name);
}
else
{
......@@ -92,8 +101,12 @@ IDeckLinkDisplayMode * Helper::MatchDisplayMode(vlc_object_t *p_obj,
if(forcedmode != bmdModeUnknown && unlikely(!p_selected))
{
BMDDisplayMode modenl = htonl(forcedmode);
msg_Dbg(p_obj, "Forced mode '%4.4s'", (char *)&modenl);
union {
BMDDisplayMode id;
char str[4];
} mode;
mode.id = forcedmode;
msg_Dbg(p_obj, "Forced mode '%4.4s'", mode.str);
if(forcedmode == mode_id)
p_selected = p_mode;
else
......
......@@ -36,7 +36,9 @@
#include "Ancillary.hpp"
#include "V210.hpp"
#ifndef _WIN32
#include <DeckLinkAPIDispatch.cpp>
#endif
#include <DeckLinkAPIVersion.h>
#if BLACKMAGIC_DECKLINK_API_VERSION < 0x0b010000
#define IID_IDeckLinkProfileAttributes IID_IDeckLinkAttributes
......@@ -124,7 +126,7 @@ AbstractStream *DBMSDIOutput::Add(const es_format_t *fmt)
if(psz_err)\
msg_Err(p_stream, message ": %s", psz_err); \
else \
msg_Err(p_stream, message ": 0x%X", result); \
msg_Err(p_stream, message ":0x%" PRIHR, result); \
goto error; \
} \
} while(0)
......@@ -152,7 +154,11 @@ HRESULT STDMETHODCALLTYPE DBMSDIOutput::ScheduledFrameCompleted
else if(result == bmdOutputFrameDisplayedLate)
msg_Warn(p_stream, "late frame");
#ifdef _WIN32
BOOL b_active;
#else
bool b_active;
#endif
vlc_mutex_lock(&feeder.lock);
if((S_OK == p_output->IsScheduledPlaybackRunning(&b_active)) && b_active)
vlc_cond_signal(&feeder.cond);
......@@ -198,13 +204,14 @@ int DBMSDIOutput::Open()
}
decklink_str_t tmp_name;
const char *psz_model_name;
char *psz_model_name;
result = p_card->GetModelName(&tmp_name);
CHECK("Unknown model name");
psz_model_name = DECKLINK_STRDUP(tmp_name);
DECKLINK_FREE(tmp_name);
msg_Dbg(p_stream, "Opened DeckLink PCI card %s", psz_model_name);
free(psz_model_name);
result = p_card->QueryInterface(IID_IDeckLinkOutput, (void**)&p_output);
CHECK("No outputs");
......@@ -316,7 +323,11 @@ static BMDVideoConnection getVConn(const char *psz)
int DBMSDIOutput::ConfigureVideo(const video_format_t *vfmt)
{
HRESULT result;
BMDDisplayMode wanted_mode_id = bmdModeUnknown;
union {
BMDDisplayMode id;
char str[4];
} wanted_mode;
wanted_mode.id = bmdModeUnknown;
IDeckLinkConfiguration *p_config = NULL;
IDeckLinkProfileAttributes *p_attributes = NULL;
IDeckLinkDisplayMode *p_display_mode = NULL;
......@@ -356,9 +367,7 @@ int DBMSDIOutput::ConfigureVideo(const video_format_t *vfmt)
msg_Err(p_stream, "Invalid mode %s", psz_string);
goto error;
}
memset(&wanted_mode_id, ' ', 4);
strncpy((char*)&wanted_mode_id, psz_string, 4);
wanted_mode_id = ntohl(wanted_mode_id);
strncpy(wanted_mode.str, psz_string, 4);
free(psz_string);
}
......@@ -366,24 +375,24 @@ int DBMSDIOutput::ConfigureVideo(const video_format_t *vfmt)
result = p_card->QueryInterface(IID_IDeckLinkProfileAttributes, (void**)&p_attributes);
CHECK("Could not get IDeckLinkAttributes");
int64_t vconn;
result = p_attributes->GetInt(BMDDeckLinkVideoOutputConnections, &vconn); /* reads mask */
#ifdef _WIN32
LONGLONG iconn;
#else
int64_t iconn;
#endif
BMDVideoConnection vconn;
result = p_attributes->GetInt(BMDDeckLinkVideoOutputConnections, &iconn); /* reads mask */
CHECK("Could not get BMDDeckLinkVideoOutputConnections");
psz_string = var_InheritString(p_stream, CFG_PREFIX "video-connection");
vconn = getVConn(psz_string);
free(psz_string);
if (vconn == 0)
{
msg_Err(p_stream, "Invalid video connection specified");
goto error;
}
result = p_config->SetInt(bmdDeckLinkConfigVideoOutputConnection, vconn);
CHECK("Could not set video output connection");
p_display_mode = Decklink::Helper::MatchDisplayMode(VLC_OBJECT(p_stream),
p_output, vfmt, wanted_mode_id);
p_output, vfmt, wanted_mode.id);
if(p_display_mode == NULL)
{
msg_Err(p_stream, "Could not negociate a compatible display mode");
......@@ -391,22 +400,29 @@ int DBMSDIOutput::ConfigureVideo(const video_format_t *vfmt)
}
else
{
BMDDisplayMode mode_id = p_display_mode->GetDisplayMode();
BMDDisplayMode modenl = htonl(mode_id);
msg_Dbg(p_stream, "Selected mode '%4.4s'", (char *) &modenl);
union {
BMDDisplayMode id;
char str[4];
} mode;
mode.id = p_display_mode->GetDisplayMode();
msg_Dbg(p_stream, "Selected mode '%4.4s'", mode.str);
BMDPixelFormat pixelFormat = video.tenbits ? bmdFormat10BitYUV : bmdFormat8BitYUV;
BMDVideoOutputFlags flags = bmdVideoOutputVANC;
if (mode_id == bmdModeNTSC ||
mode_id == bmdModeNTSC2398 ||
mode_id == bmdModePAL)
if (mode.id == bmdModeNTSC ||
mode.id == bmdModeNTSC2398 ||
mode.id == bmdModePAL)
{
flags = bmdVideoOutputVITC;
}
#ifdef _WIN32
BOOL supported;
#else
bool supported;
#endif
#if BLACKMAGIC_DECKLINK_API_VERSION < 0x0b010000
BMDDisplayModeSupport support = bmdDisplayModeNotSupported;
result = p_output->DoesSupportVideoMode(mode_id,
result = p_output->DoesSupportVideoMode(mode.id,
pixelFormat,
flags,
&support,
......@@ -414,7 +430,7 @@ int DBMSDIOutput::ConfigureVideo(const video_format_t *vfmt)
supported = (support != bmdDisplayModeNotSupported);
#else
result = p_output->DoesSupportVideoMode(vconn,
mode_id,
mode.id,
pixelFormat,
bmdSupportedVideoModeDefault,
NULL,
......@@ -437,7 +453,7 @@ int DBMSDIOutput::ConfigureVideo(const video_format_t *vfmt)
&timescale);
CHECK("Could not read frame rate");
result = p_output->EnableVideoOutput(mode_id, flags);
result = p_output->EnableVideoOutput(mode.id, flags);
CHECK("Could not enable video output");
p_output->SetScheduledFrameCompletionCallback(this);
......@@ -681,7 +697,7 @@ int DBMSDIOutput::ProcessAudio(block_t *p_block)
scheduleTime, CLOCK_FREQ, &written);
if (result != S_OK)
msg_Err(p_stream, "Failed to schedule audio sample: 0x%X", result);
msg_Err(p_stream, "Failed to schedule audio sample:0x%" PRIHR, result);
else
{
lasttimestamp = __MAX(p_block->i_pts, lasttimestamp);
......@@ -737,7 +753,7 @@ int DBMSDIOutput::doProcessVideo(picture_t *picture, block_t *p_cc)
video.tenbits ? bmdFormat10BitYUV : bmdFormat8BitYUV,
bmdFrameFlagDefault, &pDLVideoFrame);
if(result != S_OK) {
msg_Err(p_stream, "Failed to create video frame: 0x%X", result);
msg_Err(p_stream, "Failed to create video frame:0x%" PRIHR, result);
goto error;
}
......@@ -752,13 +768,13 @@ int DBMSDIOutput::doProcessVideo(picture_t *picture, block_t *p_cc)
result = p_output->CreateAncillaryData(bmdFormat10BitYUV, &vanc);
if (result != S_OK) {
msg_Err(p_stream, "Failed to create vanc: %d", result);
msg_Err(p_stream, "Failed to create vanc:0x%" PRIHR, result);
goto error;
}
result = vanc->GetBufferForVerticalBlankingLine(ancillary.afd_line, &buf);
if (result != S_OK) {
msg_Err(p_stream, "Failed to get VBI line %u: %d", ancillary.afd_line, result);
msg_Err(p_stream, "Failed to get VBI line %u:0x%" PRIHR, ancillary.afd_line, result);
goto error;
}
......@@ -769,7 +785,7 @@ int DBMSDIOutput::doProcessVideo(picture_t *picture, block_t *p_cc)
{
result = vanc->GetBufferForVerticalBlankingLine(ancillary.captions_line, &buf);
if (result != S_OK) {
msg_Err(p_stream, "Failed to get VBI line %u: %d", ancillary.captions_line, result);
msg_Err(p_stream, "Failed to get VBI line %u:0x%" PRIHR, ancillary.captions_line, result);
goto error;
}
sdi::Captions captions(p_cc->p_buffer, p_cc->i_buffer, timescale, frameduration);
......@@ -781,7 +797,7 @@ int DBMSDIOutput::doProcessVideo(picture_t *picture, block_t *p_cc)
result = pDLVideoFrame->SetAncillaryData(vanc);
vanc->Release();
if (result != S_OK) {
msg_Err(p_stream, "Failed to set vanc: %d", result);
msg_Err(p_stream, "Failed to set vanc:0x%" PRIHR, result);
goto error;
}
}
......@@ -799,7 +815,7 @@ int DBMSDIOutput::doProcessVideo(picture_t *picture, block_t *p_cc)
scheduleTime = picture->date + DECKLINK_SCHED_OFFSET;
result = p_output->ScheduleVideoFrame(pDLVideoFrame, scheduleTime, length, CLOCK_FREQ);
if (result != S_OK) {
msg_Err(p_stream, "Dropped Video frame %" PRId64 ": 0x%x",
msg_Err(p_stream, "Dropped Video frame %" PRId64 ":0x%" PRIHR,
picture->date, result);
goto error;
}
......
......@@ -41,8 +41,8 @@ namespace sdi_sout
virtual HRESULT STDMETHODCALLTYPE QueryInterface (REFIID, LPVOID *);
virtual ULONG STDMETHODCALLTYPE AddRef ();
virtual ULONG STDMETHODCALLTYPE Release ();
virtual HRESULT ScheduledFrameCompleted (IDeckLinkVideoFrame *, BMDOutputFrameCompletionResult);
virtual HRESULT ScheduledPlaybackHasStopped (void);
virtual HRESULT STDMETHODCALLTYPE ScheduledFrameCompleted (IDeckLinkVideoFrame *, BMDOutputFrameCompletionResult);
virtual HRESULT STDMETHODCALLTYPE ScheduledPlaybackHasStopped (void);
protected:
int ProcessVideo(picture_t *, block_t *);
......
......@@ -43,6 +43,7 @@ AbstractStreamOutputBuffer::~AbstractStreamOutputBuffer()
AbstractQueueStreamOutputBuffer::AbstractQueueStreamOutputBuffer()
{
b_draining = false;
vlc_mutex_init(&buffer_mutex);
}
AbstractQueueStreamOutputBuffer::~AbstractQueueStreamOutputBuffer()
......@@ -52,37 +53,32 @@ AbstractQueueStreamOutputBuffer::~AbstractQueueStreamOutputBuffer()
void AbstractQueueStreamOutputBuffer::Enqueue(void *p)
{
buffer_mutex.lock();
vlc_mutex_locker locker(&buffer_mutex);
queued.push(p);
buffer_mutex.unlock();
}
void *AbstractQueueStreamOutputBuffer::Dequeue()
{
void *p = NULL;
buffer_mutex.lock();
vlc_mutex_locker locker(&buffer_mutex);
if(!queued.empty())
{
p = queued.front();
queued.pop();
}
buffer_mutex.unlock();
return p;
}
void AbstractQueueStreamOutputBuffer::Drain()
{
buffer_mutex.lock();
vlc_mutex_locker locker(&buffer_mutex);
b_draining = true;
buffer_mutex.unlock();
}
bool AbstractQueueStreamOutputBuffer::isEOS()
{
buffer_mutex.lock();
bool b = b_draining && queued.empty();
buffer_mutex.unlock();
return b;
vlc_mutex_locker locker(&buffer_mutex);
return b_draining && queued.empty();
}
BlockStreamOutputBuffer::BlockStreamOutputBuffer()
......@@ -139,12 +135,11 @@ void PictureStreamOutputBuffer::FlushQueued()
vlc_tick_t PictureStreamOutputBuffer::NextPictureTime()
{
vlc_tick_t t;
buffer_mutex.lock();
vlc_mutex_locker locker(&buffer_mutex);
if(!queued.empty())
t = reinterpret_cast<picture_t *>(queued.front())->date;
else
t = VLC_TICK_INVALID;
buffer_mutex.unlock();
return t;
}
......@@ -700,6 +695,7 @@ AbstractRawStream::AbstractRawStream(vlc_object_t *p_obj, const StreamID &id,
{
pcr = VLC_TICK_INVALID;
b_draining = false;
vlc_mutex_init(&buffer_mutex);
}
AbstractRawStream::~AbstractRawStream()
......@@ -716,9 +712,8 @@ int AbstractRawStream::Send(block_t *p_block)
outputbuffer->Enqueue(p_block);
else
block_Release(p_block);
buffer_mutex.lock();
vlc_mutex_locker locker(&buffer_mutex);
pcr = std::max(pcr, t);
buffer_mutex.unlock();
return VLC_SUCCESS;
}
......@@ -729,26 +724,22 @@ void AbstractRawStream::Flush()
void AbstractRawStream::Drain()
{
buffer_mutex.lock();
vlc_mutex_locker locker(&buffer_mutex);
b_draining = true;
buffer_mutex.unlock();
}
bool AbstractRawStream::ReachedPlaybackTime(vlc_tick_t t)
{
buffer_mutex.lock();
vlc_mutex_locker locker(&buffer_mutex);
bool b = (pcr != VLC_TICK_INVALID) && t < pcr;
b |= b_draining;
buffer_mutex.unlock();
return b;
}
bool AbstractRawStream::isEOS()
{
buffer_mutex.lock();
bool b = b_draining;
buffer_mutex.unlock();
return b;
vlc_mutex_locker locker(&buffer_mutex);
return b_draining;
}
void AbstractRawStream::FlushQueued()
......
......@@ -25,7 +25,6 @@
#include <vlc_aout.h>
#include <vlc_codec.h>
#include <queue>
#include <mutex>
#include <string>
#include <list>
......@@ -54,7 +53,7 @@ namespace sdi_sout
protected:
bool b_draining;
std::mutex buffer_mutex;
vlc_mutex_t buffer_mutex;
std::queue<void *> queued;
};
......@@ -207,7 +206,7 @@ namespace sdi_sout
virtual bool isEOS(); /* impl */
protected:
std::mutex buffer_mutex;
vlc_mutex_t buffer_mutex;
vlc_tick_t pcr;
bool b_draining;
void FlushQueued();
......
......@@ -22,7 +22,13 @@ libdecklinkoutput_plugin_la_SOURCES = video_output/decklink.cpp \
stream_out/sdi/V210.cpp \
stream_out/sdi/V210.hpp
libdecklinkoutput_plugin_la_CXXFLAGS = $(AM_CXXFLAGS) $(CPPFLAGS_decklinkoutput)
libdecklinkoutput_plugin_la_LIBADD = $(LIBS_decklink) $(LIBDL) -lpthread
libdecklinkoutput_plugin_la_LIBADD = $(LIBS_decklinkoutput)
if HAVE_WIN32
libdecklinkoutput_plugin_la_LIBADD += $(LIBCOM)
endif
if HAVE_LINUX
libdecklinkoutput_plugin_la_LIBADD += $(LIBDL) -lpthread
endif
vout_LTLIBRARIES += libdecklinkoutput_plugin.la
endif
......
......@@ -52,7 +52,9 @@
#include "../stream_out/sdi/Ancillary.hpp"
#include "../stream_out/sdi/DBMHelper.hpp"
#include "../stream_out/sdi/SDIGenerator.hpp"
#ifndef _WIN32
#include <DeckLinkAPIDispatch.cpp>
#endif
#include <DeckLinkAPIVersion.h>
#if BLACKMAGIC_DECKLINK_API_VERSION < 0x0b010000
#define IID_IDeckLinkProfileAttributes IID_IDeckLinkAttributes
......@@ -368,9 +370,9 @@ static void ReleaseDLSys(vlc_object_t *obj, int i_cat)
sys_lock.unlock();
}
static BMDVideoConnection getVConn(vout_display_t *vd, BMDVideoConnection mask)
static BMDVideoConnection getVConn(vout_display_t *vd, int mask)
{
BMDVideoConnection conn = 0;
BMDVideoConnection conn = bmdVideoConnectionUnspecified;
char *psz = var_InheritString(vd, VIDEO_CFG_PREFIX "video-connection");
if (psz)
{
......@@ -386,8 +388,8 @@ static BMDVideoConnection getVConn(vout_display_t *vd, BMDVideoConnection mask)
}
else /* Pick one as default connection */
{
conn = vlc_ctz(mask);
conn = conn ? ( 1 << conn ) : bmdVideoConnectionSDI;
int iconn = vlc_ctz(mask);
conn = iconn ? BMDVideoConnection( 1 << iconn ) : bmdVideoConnectionSDI;
}
return conn;
}
......@@ -404,7 +406,7 @@ static int OpenDecklink(vout_display_t *vd, decklink_sys_t *sys, video_format_t
if(psz_err)\
msg_Err(vd, message ": %s", psz_err); \
else \
msg_Err(vd, message ": 0x%X", result); \
msg_Err(vd, message ":0x%" PRIHR, result); \
goto error; \
} \
} while(0)
......@@ -415,7 +417,11 @@ static int OpenDecklink(vout_display_t *vd, decklink_sys_t *sys, video_format_t
IDeckLinkConfiguration *p_config = NULL;
IDeckLinkProfileAttributes *p_attributes = NULL;
IDeckLink *p_card = NULL;
BMDDisplayMode wanted_mode_id = bmdModeUnknown;
union {
BMDDisplayMode id;
char str[4];
} wanted_mode;
wanted_mode.id = bmdModeUnknown;
vlc_mutex_lock(&sys->lock);
......@@ -436,9 +442,7 @@ static int OpenDecklink(vout_display_t *vd, decklink_sys_t *sys, video_format_t
msg_Err(vd, "Invalid mode %s", mode);
goto error;
}
memset(&wanted_mode_id, ' ', 4);
strncpy((char*)&wanted_mode_id, mode, 4);
wanted_mode_id = ntohl(wanted_mode_id);
strncpy(wanted_mode.str, mode, 4);
free(mode);
}
......@@ -478,8 +482,13 @@ static int OpenDecklink(vout_display_t *vd, decklink_sys_t *sys, video_format_t
result = p_card->QueryInterface(IID_IDeckLinkProfileAttributes, (void**)&p_attributes);
CHECK("Could not get IDeckLinkAttributes");
int64_t vconn;
result = p_attributes->GetInt(BMDDeckLinkVideoOutputConnections, &vconn); /* reads mask */
#ifdef _WIN32
LONGLONG iconn;
#else
int64_t iconn;
#endif
BMDVideoConnection vconn;
result = p_attributes->GetInt(BMDDeckLinkVideoOutputConnections, &iconn); /* reads mask */
CHECK("Could not get BMDDeckLinkVideoOutputConnections");
result = p_card->QueryInterface(IID_IDeckLinkOutput,
......@@ -492,18 +501,18 @@ static int OpenDecklink(vout_display_t *vd, decklink_sys_t *sys, video_format_t
/* Now configure card */
vconn = getVConn(vd, (BMDVideoConnection) vconn);
if (vconn == 0)
vconn = getVConn(vd, iconn);
if (vconn == bmdVideoConnectionUnspecified)
{
msg_Err(vd, "Invalid video connection specified");
goto error;
}
result = p_config->SetInt(bmdDeckLinkConfigVideoOutputConnection, (BMDVideoConnection) vconn);
result = p_config->SetInt(bmdDeckLinkConfigVideoOutputConnection, vconn);
CHECK("Could not set video output connection");
p_display_mode = Decklink::Helper::MatchDisplayMode(VLC_OBJECT(vd), sys->p_output,
vd->source, wanted_mode_id);
vd->source, wanted_mode.id);
if(p_display_mode == NULL)
{
msg_Err(vd, "Could not negociate a compatible display mode");
......@@ -511,22 +520,29 @@ static int OpenDecklink(vout_display_t *vd, decklink_sys_t *sys, video_format_t
}
else
{
BMDDisplayMode mode_id = p_display_mode->GetDisplayMode();
BMDDisplayMode modenl = htonl(mode_id);
msg_Dbg(vd, "Selected mode '%4.4s'", (char *) &modenl);
union {
BMDDisplayMode id;
char str[4];
} mode;
mode.id = p_display_mode->GetDisplayMode();
msg_Dbg(vd, "Selected mode '%4.4s'", mode.str);
BMDPixelFormat pixelFormat = sys->video.tenbits ? bmdFormat10BitYUV : bmdFormat8BitYUV;
BMDVideoOutputFlags flags = bmdVideoOutputVANC;
if (mode_id == bmdModeNTSC ||
mode_id == bmdModeNTSC2398 ||
mode_id == bmdModePAL)
if (mode.id == bmdModeNTSC ||
mode.id == bmdModeNTSC2398 ||
mode.id == bmdModePAL)
{
flags = bmdVideoOutputVITC;
}
#ifdef _WIN32
BOOL supported;
#else
bool supported;
#endif
#if BLACKMAGIC_DECKLINK_API_VERSION < 0x0b010000
BMDDisplayModeSupport support = bmdDisplayModeNotSupported;
result = sys->p_output->DoesSupportVideoMode(mode_id,
result = sys->p_output->DoesSupportVideoMode(mode.id,
pixelFormat,
flags,
&support,
......@@ -534,7 +550,7 @@ static int OpenDecklink(vout_display_t *vd, decklink_sys_t *sys, video_format_t
supported = (support != bmdDisplayModeNotSupported);
#else
result = sys->p_output->DoesSupportVideoMode(vconn,
mode_id,
mode.id,
pixelFormat,
bmdSupportedVideoModeDefault,
NULL,
......@@ -557,7 +573,7 @@ static int OpenDecklink(vout_display_t *vd, decklink_sys_t *sys, video_format_t
&sys->timescale);
CHECK("Could not read frame rate");
result = sys->p_output->EnableVideoOutput(mode_id, flags);
result = sys->p_output->EnableVideoOutput(mode.id, flags);
CHECK("Could not enable video output");
video_format_Copy(fmt, vd->source);
......@@ -575,7 +591,7 @@ static int OpenDecklink(vout_display_t *vd, decklink_sys_t *sys, video_format_t
if (/*decklink_sys->i_channels > 0 &&*/ sys->i_rate > 0)
{
result = sys->p_output->EnableAudioOutput(
sys->i_rate,
BMDAudioSampleRate(sys->i_rate),
bmdAudioSampleType16bitInteger,
/*decklink_sys->i_channels*/ 2,
bmdAudioOutputStreamTimestamped);
......@@ -669,7 +685,7 @@ static void PrepareVideo(vout_display_t *vd, picture_t *picture, subpicture_t *,
bmdFrameFlagDefault, &pDLVideoFrame);
if (result != S_OK) {
msg_Err(vd, "Failed to create video frame: 0x%X", result);
msg_Err(vd, "Failed to create video frame:0x%" PRIHR, result);
pDLVideoFrame = NULL;
goto end;
}
......@@ -686,14 +702,14 @@ static void PrepareVideo(vout_display_t *vd, picture_t *picture, subpicture_t *,
result = sys->p_output->CreateAncillaryData(
sys->video.tenbits ? bmdFormat10BitYUV : bmdFormat8BitYUV, &vanc);
if (result != S_OK) {
msg_Err(vd, "Failed to create vanc: %d", result);
msg_Err(vd, "Failed to create vanc:0x%" PRIHR, result);
goto end;
}
line = var_InheritInteger(vd, VIDEO_CFG_PREFIX "afd-line");
result = vanc->GetBufferForVerticalBlankingLine(line, &buf);
if (result != S_OK) {
msg_Err(vd, "Failed to get VBI line %d: %d", line, result);
msg_Err(vd, "Failed to get VBI line %d:0x%" PRIHR, line, result);
goto end;
}
......@@ -705,7 +721,7 @@ static void PrepareVideo(vout_display_t *vd, picture_t *picture, subpicture_t *,
result = pDLVideoFrame->SetAncillaryData(vanc);
vanc->Release();
if (result != S_OK) {
msg_Err(vd, "Failed to set vanc: %d", result);
msg_Err(vd, "Failed to set vanc:0x%" PRIHR, result);
goto end;
}
}
......@@ -725,7 +741,7 @@ static void PrepareVideo(vout_display_t *vd, picture_t *picture, subpicture_t *,
date, length, CLOCK_FREQ);
if (result != S_OK) {
msg_Err(vd, "Dropped Video frame %" PRId64 ": 0x%x", date, result);
msg_Err(vd, "Dropped Video frame %" PRId64 ":0x%" PRIHR, date, result);
goto end;
}
......@@ -889,7 +905,7 @@ static void PlayAudio(audio_output_t *aout, block_t *audio, vlc_tick_t systempts
audio->p_buffer, sampleFrameCount, systempts, CLOCK_FREQ, &written);
if (result != S_OK)
msg_Err(aout, "Failed to schedule audio sample: 0x%X", result);
msg_Err(aout, "Failed to schedule audio sample:0x%" PRIHR, result);
else if (sampleFrameCount != written)
msg_Err(aout, "Written only %d samples out of %d", written, sampleFrameCount);
......