2018-09-08 03:50:56 +08:00
|
|
|
/*****************************************************************************
|
|
|
|
* vlc_decklink.h: Decklink Common includes
|
|
|
|
*****************************************************************************
|
|
|
|
* Copyright (C) 2018 LTN Global Communications
|
|
|
|
*
|
|
|
|
* Authors: Devin Heitmueller <dheitmueller@ltnglobal.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU Lesser General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2.1 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef VLC_DECKLINK_H
|
|
|
|
#define VLC_DECKLINK_H 1
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \file
|
|
|
|
* This file defines Decklink portability macros and other functions
|
|
|
|
*/
|
|
|
|
|
2021-11-09 20:46:38 +08:00
|
|
|
#ifdef _WIN32
|
|
|
|
#include <initguid.h>
|
|
|
|
#endif
|
2018-09-08 03:50:56 +08:00
|
|
|
#include <DeckLinkAPI.h>
|
|
|
|
|
|
|
|
/* Portability code to deal with differences how the Blackmagic SDK
|
|
|
|
handles strings on various platforms */
|
2021-09-15 18:12:09 +08:00
|
|
|
#if defined(__APPLE__)
|
2018-10-21 02:46:18 +08:00
|
|
|
#include <vlc_common.h>
|
|
|
|
#include <vlc_charset.h>
|
2019-01-19 00:16:56 +08:00
|
|
|
typedef CFStringRef decklink_str_t;
|
2018-10-21 02:46:18 +08:00
|
|
|
#define DECKLINK_STRDUP(s) FromCFString(s, kCFStringEncodingUTF8)
|
2018-09-08 03:50:56 +08:00
|
|
|
#define DECKLINK_FREE(s) CFRelease(s)
|
2021-11-09 21:43:01 +08:00
|
|
|
#define PRIHR "X"
|
2021-11-09 20:46:38 +08:00
|
|
|
#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)
|
2021-11-09 21:43:01 +08:00
|
|
|
#define PRIHR "lX"
|
2021-11-09 20:46:38 +08:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2018-09-08 03:50:56 +08:00
|
|
|
#else
|
2018-10-22 15:27:21 +08:00
|
|
|
typedef const char* decklink_str_t;
|
2021-11-09 20:46:38 +08:00
|
|
|
#define DECKLINK_STRDUP(s) strdup(s)
|
2018-09-08 03:50:56 +08:00
|
|
|
#define DECKLINK_FREE(s) free((void *) s)
|
2021-11-09 21:43:01 +08:00
|
|
|
#define PRIHR "X"
|
2018-09-08 03:50:56 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* VLC_DECKLINK_H */
|
|
|
|
|