#include <vlc_charset.h>
#include <vlc_fs.h>
+#include "DeckLinkAPI.h"
+#include "DeckLinkAPIDispatch.cpp"
+
static int Open ( vlc_object_t * );
static void Close( vlc_object_t * );
struct demux_sys_t
{
+ IDeckLink *p_card;
+ IDeckLinkInput *p_input;
es_out_id_t *p_es;
};
msg_Dbg( p_demux, "hello world" );
- /* Declare elementary streams */
+ IDeckLinkIterator *decklink_iterator = CreateDeckLinkIteratorInstance();
+ if ( !decklink_iterator ) {
+ msg_Err( p_demux, "DeckLink drivers not found." );
+ // FIXME: Leak here and several other error paths.
+ return VLC_EGENERIC;
+ }
+
+ HRESULT result;
+ result = decklink_iterator->Next( &p_sys->p_card );
+
+ if ( result != S_OK ) {
+ msg_Err( p_demux, "No DeckLink PCI cards found." );
+ return VLC_EGENERIC;
+ }
+
+ if ( p_sys->p_card->QueryInterface(IID_IDeckLinkInput, (void**)&p_sys->p_input) != S_OK ) {
+ msg_Err( p_demux, "Card has no inputs" );
+ return VLC_EGENERIC;
+ }
+
+ /*eDeclare elementary streams */
es_format_t fmt;
es_format_Init( &fmt, VIDEO_ES, VLC_CODEC_YUYV );
fmt.video.i_width = 720;