[vlc-devel] [PATCH] access module for BlackMagic SDI cards

Stuart Cunningham stuart8c at gmail.com
Tue Oct 5 08:17:18 CEST 2010

On Mon, Oct 4, 2010 at 3:21 AM, Steinar H. Gunderson
<sgunderson at bigfoot.com> wrote:
> On Sat, Oct 02, 2010 at 04:15:01PM +0200, Laurent Aimar wrote:
>>  Why ? What happens when no signal is detected ?
>>  If the card emulates empty audio *and* video, then I think it would be better
>> to let them pass, this will allow the sout to properly work.
> It appears the card sends black and no audio. It looks a bit weird to me
> (VLC doesn't synthesize fake audio or video normally when there's none, no?),
> but I think I can remove the return S_OK; if you want to.
The DeckLink API does indeed give a black video frame when the video
input signal is missing.

>+    const char *psz_model_name;
>+    result = p_sys->p_card->GetModelName( &psz_model_name );
This will fail to compile under Mac and Windows, since the DeckLink
API uses different string types for those two platforms, namely
CFString for Mac and BSTR for Windows.  So use suitable macros to do
the platform tests - perhaps a static function like
getDeckLinkModelName() returning a const char* could keep the platform
differences away from the flow of Open().  Same problem occurs with

>+    p_sys->i_channels = var_InheritInteger( p_demux, "decklink-audio-channels" );
>+    i_rate = var_InheritInteger( p_demux, "decklink-audio-rate" );
>+    if( i_rate > 0 && p_sys->i_channels > 0 )
>+    {
>+        result = p_sys->p_input->EnableAudioInput( i_rate, bmdAudioSampleType16bitInteger, p_sys->i_channels );
A simpler end-user command-line interface would have just one way of
disabling audio, rather than either audio-rate or audio-channels.  For
me, --decklink-audio-connection=disabled would be a more intuitive way
to disable audio.

I have two questions may have some bearing on this patch:
1)  If one was to write support for DeckLink output, would it cause
any contention for the DeckLink board, e.g. if I wanted to capture
from the DeckLink SDI input, add audio from another input, then
playout over the same board SDI output?  Would output support be added
to this module or should it go into a separate module under

2) One of the things I'd like to try with this module to capture from
four SDI or HDMI inputs and use VLC's wall video filter (or is it
mosaic?) to combine four video inputs into a single video image before
streaming it.  I imagine all that's required is that the module be
thread safe?

Stuart Cunningham

More information about the vlc-devel mailing list