2011-06-06 04:24:58 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 2011 David Schleef <ds@schleef.org>
|
2014-12-13 16:23:31 +00:00
|
|
|
* Copyright (C) 2014 Sebastian Dröge <sebastian@centricular.com>
|
2015-01-06 13:02:38 +00:00
|
|
|
* Copyright (C) 2015 Florian Langlois <florian.langlois@fr.thalesgroup.com>
|
2020-02-27 14:10:16 +00:00
|
|
|
* Copyright (C) 2020 Sohonet <dev@sohonet.com>
|
2011-06-06 04:24:58 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library 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
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
2012-11-03 20:38:00 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2011-06-06 04:24:58 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _GST_DECKLINK_H_
|
|
|
|
#define _GST_DECKLINK_H_
|
|
|
|
|
|
|
|
#include <gst/gst.h>
|
2016-04-14 15:26:33 +00:00
|
|
|
#include <gst/video/video.h>
|
2017-01-27 17:11:02 +00:00
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2011-08-22 01:44:43 +00:00
|
|
|
#ifdef G_OS_WIN32
|
|
|
|
#include "win/DeckLinkAPI.h"
|
2011-07-07 20:44:31 +00:00
|
|
|
|
2017-07-20 12:39:15 +00:00
|
|
|
#include <stdio.h>
|
2011-07-07 20:44:31 +00:00
|
|
|
#include <comutil.h>
|
|
|
|
|
|
|
|
#define bool BOOL
|
2017-05-04 22:32:29 +00:00
|
|
|
#define COMSTR_T BSTR
|
2017-05-04 23:00:59 +00:00
|
|
|
/* MinGW does not have comsuppw.lib, so no _com_util::ConvertBSTRToString */
|
|
|
|
# ifdef __MINGW32__
|
2019-11-21 14:59:29 +00:00
|
|
|
# define CONVERT_COM_STRING(s) G_STMT_START { BSTR _s = (BSTR)s; s = (char*) malloc(100); wcstombs(s, _s, 100); ::SysFreeString(_s); } G_STMT_END
|
2017-05-04 23:00:59 +00:00
|
|
|
# define FREE_COM_STRING(s) free(s);
|
2022-06-28 13:40:55 +00:00
|
|
|
# define CONVERT_TO_COM_STRING(s) G_STMT_START { char * _s = (char *)s; s = (BSTR) malloc(100); mbstowcs(s, _s, 100); g_free(_s); } G_STMT_END
|
2017-05-04 23:00:59 +00:00
|
|
|
# else
|
2019-11-21 14:59:29 +00:00
|
|
|
# define CONVERT_COM_STRING(s) G_STMT_START { BSTR _s = (BSTR)s; s = _com_util::ConvertBSTRToString(_s); ::SysFreeString(_s); } G_STMT_END
|
|
|
|
# define FREE_COM_STRING(s) G_STMT_START { delete[] s; } G_STMT_END
|
2022-06-28 13:40:55 +00:00
|
|
|
# define CONVERT_TO_COM_STRING(s) G_STMT_START { char * _s = (char *)s; s = _com_util::ConvertStringToBSTR(_s); g_free(_s); } G_STMT_END
|
2017-07-18 22:44:13 +00:00
|
|
|
# endif /* __MINGW32__ */
|
2023-05-30 10:22:44 +00:00
|
|
|
#elif defined(__APPLE__)
|
2023-05-30 12:27:21 +00:00
|
|
|
#include "osx/DeckLinkAPI.h"
|
2023-05-30 10:22:44 +00:00
|
|
|
|
|
|
|
#define COMSTR_T CFStringRef
|
|
|
|
#define CONVERT_COM_STRING(s) G_STMT_START { CFStringRef _s = (CFStringRef)s; s = (char*) malloc(100); CFStringGetCString(_s, s, 100, kCFStringEncodingUTF8); CFRelease(_s); } G_STMT_END
|
|
|
|
#define FREE_COM_STRING(s) free(s);
|
|
|
|
#define CONVERT_TO_COM_STRING(s) G_STMT_START { char * _s = (char *)s; s = CFStringCreateWithCString(kCFAllocatorDefault, _s, kCFStringEncodingUTF8); g_free(_s); } G_STMT_END
|
|
|
|
#define WINAPI
|
|
|
|
#else /* Linux */
|
2023-05-30 12:27:21 +00:00
|
|
|
#include "linux/DeckLinkAPI.h"
|
|
|
|
|
2017-01-27 17:24:03 +00:00
|
|
|
#define COMSTR_T const char*
|
2011-07-07 20:44:31 +00:00
|
|
|
#define CONVERT_COM_STRING(s)
|
2022-06-28 13:40:55 +00:00
|
|
|
#define CONVERT_TO_COM_STRING(s)
|
2023-05-30 10:23:28 +00:00
|
|
|
/* While this is a const char*, the string still has to be freed */
|
|
|
|
#define FREE_COM_STRING(s) free(s);
|
2017-07-18 22:44:13 +00:00
|
|
|
#define WINAPI
|
2017-05-04 23:00:59 +00:00
|
|
|
#endif /* G_OS_WIN32 */
|
2011-06-06 04:24:58 +00:00
|
|
|
|
2021-03-26 10:00:50 +00:00
|
|
|
void decklink_element_init (GstPlugin * plugin);
|
|
|
|
|
2011-06-06 04:24:58 +00:00
|
|
|
typedef enum {
|
2015-01-08 15:42:31 +00:00
|
|
|
GST_DECKLINK_MODE_AUTO,
|
|
|
|
|
2011-06-06 04:24:58 +00:00
|
|
|
GST_DECKLINK_MODE_NTSC,
|
2011-06-29 06:47:18 +00:00
|
|
|
GST_DECKLINK_MODE_NTSC2398,
|
2011-06-06 04:24:58 +00:00
|
|
|
GST_DECKLINK_MODE_PAL,
|
2011-06-29 06:47:18 +00:00
|
|
|
GST_DECKLINK_MODE_NTSC_P,
|
|
|
|
GST_DECKLINK_MODE_PAL_P,
|
|
|
|
|
|
|
|
GST_DECKLINK_MODE_1080p2398,
|
|
|
|
GST_DECKLINK_MODE_1080p24,
|
|
|
|
GST_DECKLINK_MODE_1080p25,
|
|
|
|
GST_DECKLINK_MODE_1080p2997,
|
|
|
|
GST_DECKLINK_MODE_1080p30,
|
|
|
|
|
2011-06-06 04:24:58 +00:00
|
|
|
GST_DECKLINK_MODE_1080i50,
|
2011-06-29 06:47:18 +00:00
|
|
|
GST_DECKLINK_MODE_1080i5994,
|
2011-06-06 04:24:58 +00:00
|
|
|
GST_DECKLINK_MODE_1080i60,
|
2011-06-29 06:47:18 +00:00
|
|
|
|
|
|
|
GST_DECKLINK_MODE_1080p50,
|
|
|
|
GST_DECKLINK_MODE_1080p5994,
|
|
|
|
GST_DECKLINK_MODE_1080p60,
|
|
|
|
|
2011-06-06 04:24:58 +00:00
|
|
|
GST_DECKLINK_MODE_720p50,
|
2011-06-29 06:47:18 +00:00
|
|
|
GST_DECKLINK_MODE_720p5994,
|
2014-11-24 13:07:19 +00:00
|
|
|
GST_DECKLINK_MODE_720p60,
|
|
|
|
|
2015-05-11 10:18:28 +00:00
|
|
|
GST_DECKLINK_MODE_1556p2398,
|
|
|
|
GST_DECKLINK_MODE_1556p24,
|
|
|
|
GST_DECKLINK_MODE_1556p25,
|
2014-12-29 10:49:51 +00:00
|
|
|
|
2020-02-27 14:10:16 +00:00
|
|
|
GST_DECKLINK_MODE_2KDCI2398,
|
|
|
|
GST_DECKLINK_MODE_2KDCI24,
|
|
|
|
GST_DECKLINK_MODE_2KDCI25,
|
|
|
|
GST_DECKLINK_MODE_2KDCI2997,
|
|
|
|
GST_DECKLINK_MODE_2KDCI30,
|
|
|
|
GST_DECKLINK_MODE_2KDCI50,
|
|
|
|
GST_DECKLINK_MODE_2KDCI5994,
|
|
|
|
GST_DECKLINK_MODE_2KDCI60,
|
|
|
|
|
2015-05-11 10:02:47 +00:00
|
|
|
GST_DECKLINK_MODE_2160p2398,
|
|
|
|
GST_DECKLINK_MODE_2160p24,
|
|
|
|
GST_DECKLINK_MODE_2160p25,
|
|
|
|
GST_DECKLINK_MODE_2160p2997,
|
|
|
|
GST_DECKLINK_MODE_2160p30,
|
|
|
|
GST_DECKLINK_MODE_2160p50,
|
|
|
|
GST_DECKLINK_MODE_2160p5994,
|
2020-08-05 07:52:08 +00:00
|
|
|
GST_DECKLINK_MODE_2160p60,
|
|
|
|
|
|
|
|
GST_DECKLINK_MODE_NTSC_WIDESCREEN,
|
|
|
|
GST_DECKLINK_MODE_NTSC2398_WIDESCREEN,
|
|
|
|
GST_DECKLINK_MODE_PAL_WIDESCREEN,
|
|
|
|
GST_DECKLINK_MODE_NTSC_P_WIDESCREEN,
|
2022-06-08 07:42:18 +00:00
|
|
|
GST_DECKLINK_MODE_PAL_P_WIDESCREEN,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GstDecklinkModes::4kdcip2398:
|
|
|
|
*
|
|
|
|
* Since: 1.22
|
|
|
|
*/
|
|
|
|
GST_DECKLINK_MODE_4Kp2398,
|
|
|
|
/**
|
|
|
|
* GstDecklinkModes::4kdcip24:
|
|
|
|
*
|
|
|
|
* Since: 1.22
|
|
|
|
*/
|
|
|
|
GST_DECKLINK_MODE_4Kp24,
|
|
|
|
/**
|
|
|
|
* GstDecklinkModes::4kdcip25:
|
|
|
|
*
|
|
|
|
* Since: 1.22
|
|
|
|
*/
|
|
|
|
GST_DECKLINK_MODE_4Kp25,
|
|
|
|
/**
|
|
|
|
* GstDecklinkModes::4kdcip2997:
|
|
|
|
*
|
|
|
|
* Since: 1.22
|
|
|
|
*/
|
|
|
|
GST_DECKLINK_MODE_4Kp2997,
|
|
|
|
/**
|
|
|
|
* GstDecklinkModes::4kdcip30:
|
|
|
|
*
|
|
|
|
* Since: 1.22
|
|
|
|
*/
|
|
|
|
GST_DECKLINK_MODE_4Kp30,
|
|
|
|
/**
|
|
|
|
* GstDecklinkModes::4kdcip50:
|
|
|
|
*
|
|
|
|
* Since: 1.22
|
|
|
|
*/
|
|
|
|
GST_DECKLINK_MODE_4Kp50,
|
|
|
|
/**
|
|
|
|
* GstDecklinkModes::4kdcip5994:
|
|
|
|
*
|
|
|
|
* Since: 1.22
|
|
|
|
*/
|
|
|
|
GST_DECKLINK_MODE_4Kp5994,
|
|
|
|
/**
|
|
|
|
* GstDecklinkModes::4kdcip60:
|
|
|
|
*
|
|
|
|
* Since: 1.22
|
|
|
|
*/
|
|
|
|
GST_DECKLINK_MODE_4Kp60,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GstDecklinkModes::8kp2398:
|
|
|
|
*
|
|
|
|
* Since: 1.22
|
|
|
|
*/
|
|
|
|
GST_DECKLINK_MODE_4320p2398,
|
|
|
|
/**
|
|
|
|
* GstDecklinkModes::8kp24:
|
|
|
|
*
|
|
|
|
* Since: 1.22
|
|
|
|
*/
|
|
|
|
GST_DECKLINK_MODE_4320p24,
|
|
|
|
/**
|
|
|
|
* GstDecklinkModes::8kp25:
|
|
|
|
*
|
|
|
|
* Since: 1.22
|
|
|
|
*/
|
|
|
|
GST_DECKLINK_MODE_4320p25,
|
|
|
|
/**
|
|
|
|
* GstDecklinkModes::8kp2997:
|
|
|
|
*
|
|
|
|
* Since: 1.22
|
|
|
|
*/
|
|
|
|
GST_DECKLINK_MODE_4320p2997,
|
|
|
|
/**
|
|
|
|
* GstDecklinkModes::8kp30:
|
|
|
|
*
|
|
|
|
* Since: 1.22
|
|
|
|
*/
|
|
|
|
GST_DECKLINK_MODE_4320p30,
|
|
|
|
/**
|
|
|
|
* GstDecklinkModes::8kp50:
|
|
|
|
*
|
|
|
|
* Since: 1.22
|
|
|
|
*/
|
|
|
|
GST_DECKLINK_MODE_4320p50,
|
|
|
|
/**
|
|
|
|
* GstDecklinkModes::8kp5994:
|
|
|
|
*
|
|
|
|
* Since: 1.22
|
|
|
|
*/
|
|
|
|
GST_DECKLINK_MODE_4320p5994,
|
|
|
|
/**
|
|
|
|
* GstDecklinkModes::8kp60:
|
|
|
|
*
|
|
|
|
* Since: 1.22
|
|
|
|
*/
|
|
|
|
GST_DECKLINK_MODE_4320p60,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GstDecklinkModes::8kdcip2398:
|
|
|
|
*
|
|
|
|
* Since: 1.22
|
|
|
|
*/
|
|
|
|
GST_DECKLINK_MODE_8Kp2398,
|
|
|
|
/**
|
|
|
|
* GstDecklinkModes::8kdcip24:
|
|
|
|
*
|
|
|
|
* Since: 1.22
|
|
|
|
*/
|
|
|
|
GST_DECKLINK_MODE_8Kp24,
|
|
|
|
/**
|
|
|
|
* GstDecklinkModes::8kdcip25:
|
|
|
|
*
|
|
|
|
* Since: 1.22
|
|
|
|
*/
|
|
|
|
GST_DECKLINK_MODE_8Kp25,
|
|
|
|
/**
|
|
|
|
* GstDecklinkModes::8kdcip2997:
|
|
|
|
*
|
|
|
|
* Since: 1.22
|
|
|
|
*/
|
|
|
|
GST_DECKLINK_MODE_8Kp2997,
|
|
|
|
/**
|
|
|
|
* GstDecklinkModes::8kdcip30:
|
|
|
|
*
|
|
|
|
* Since: 1.22
|
|
|
|
*/
|
|
|
|
GST_DECKLINK_MODE_8Kp30,
|
|
|
|
/**
|
|
|
|
* GstDecklinkModes::8kdcip50:
|
|
|
|
*
|
|
|
|
* Since: 1.22
|
|
|
|
*/
|
|
|
|
GST_DECKLINK_MODE_8Kp50,
|
|
|
|
/**
|
|
|
|
* GstDecklinkModes::8kdcip5994:
|
|
|
|
*
|
|
|
|
* Since: 1.22
|
|
|
|
*/
|
|
|
|
GST_DECKLINK_MODE_8Kp5994,
|
|
|
|
/**
|
|
|
|
* GstDecklinkModes::8kdcip60:
|
|
|
|
*
|
|
|
|
* Since: 1.22
|
|
|
|
*/
|
|
|
|
GST_DECKLINK_MODE_8Kp60
|
2011-06-06 04:24:58 +00:00
|
|
|
} GstDecklinkModeEnum;
|
|
|
|
#define GST_TYPE_DECKLINK_MODE (gst_decklink_mode_get_type ())
|
|
|
|
GType gst_decklink_mode_get_type (void);
|
|
|
|
|
2011-06-20 07:38:05 +00:00
|
|
|
typedef enum {
|
2015-01-08 11:17:45 +00:00
|
|
|
GST_DECKLINK_CONNECTION_AUTO,
|
2011-06-20 07:38:05 +00:00
|
|
|
GST_DECKLINK_CONNECTION_SDI,
|
|
|
|
GST_DECKLINK_CONNECTION_HDMI,
|
|
|
|
GST_DECKLINK_CONNECTION_OPTICAL_SDI,
|
|
|
|
GST_DECKLINK_CONNECTION_COMPONENT,
|
|
|
|
GST_DECKLINK_CONNECTION_COMPOSITE,
|
|
|
|
GST_DECKLINK_CONNECTION_SVIDEO
|
|
|
|
} GstDecklinkConnectionEnum;
|
|
|
|
#define GST_TYPE_DECKLINK_CONNECTION (gst_decklink_connection_get_type ())
|
|
|
|
GType gst_decklink_connection_get_type (void);
|
2011-06-06 04:24:58 +00:00
|
|
|
|
2011-07-07 23:07:50 +00:00
|
|
|
typedef enum {
|
|
|
|
GST_DECKLINK_AUDIO_CONNECTION_AUTO,
|
|
|
|
GST_DECKLINK_AUDIO_CONNECTION_EMBEDDED,
|
|
|
|
GST_DECKLINK_AUDIO_CONNECTION_AES_EBU,
|
2015-01-08 11:23:53 +00:00
|
|
|
GST_DECKLINK_AUDIO_CONNECTION_ANALOG,
|
|
|
|
GST_DECKLINK_AUDIO_CONNECTION_ANALOG_XLR,
|
|
|
|
GST_DECKLINK_AUDIO_CONNECTION_ANALOG_RCA
|
2011-07-07 23:07:50 +00:00
|
|
|
} GstDecklinkAudioConnectionEnum;
|
|
|
|
#define GST_TYPE_DECKLINK_AUDIO_CONNECTION (gst_decklink_audio_connection_get_type ())
|
|
|
|
GType gst_decklink_audio_connection_get_type (void);
|
|
|
|
|
2017-01-03 15:30:07 +00:00
|
|
|
typedef enum {
|
2017-01-18 15:53:00 +00:00
|
|
|
GST_DECKLINK_AUDIO_CHANNELS_MAX = 0,
|
2017-01-03 15:30:07 +00:00
|
|
|
GST_DECKLINK_AUDIO_CHANNELS_2 = 2,
|
|
|
|
GST_DECKLINK_AUDIO_CHANNELS_8 = 8,
|
|
|
|
GST_DECKLINK_AUDIO_CHANNELS_16 = 16
|
|
|
|
} GstDecklinkAudioChannelsEnum;
|
|
|
|
#define GST_TYPE_DECKLINK_AUDIO_CHANNELS (gst_decklink_audio_channels_get_type ())
|
|
|
|
GType gst_decklink_audio_channels_get_type (void);
|
|
|
|
|
2016-04-14 15:26:33 +00:00
|
|
|
typedef enum {
|
|
|
|
GST_DECKLINK_VIDEO_FORMAT_AUTO,
|
|
|
|
GST_DECKLINK_VIDEO_FORMAT_8BIT_YUV, /* bmdFormat8BitYUV */
|
|
|
|
GST_DECKLINK_VIDEO_FORMAT_10BIT_YUV, /* bmdFormat10BitYUV */
|
|
|
|
GST_DECKLINK_VIDEO_FORMAT_8BIT_ARGB, /* bmdFormat8BitARGB */
|
|
|
|
GST_DECKLINK_VIDEO_FORMAT_8BIT_BGRA, /* bmdFormat8BitBGRA */
|
2023-04-04 10:22:31 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GstDecklinkVideoFormat::10bit-rgb:
|
|
|
|
*
|
|
|
|
* Since: 1.22.2
|
|
|
|
*/
|
2016-04-14 15:26:33 +00:00
|
|
|
GST_DECKLINK_VIDEO_FORMAT_10BIT_RGB, /* bmdFormat10BitRGB */
|
2023-04-04 10:22:31 +00:00
|
|
|
/* Not yet supported */
|
|
|
|
#if 0
|
2016-04-14 15:26:33 +00:00
|
|
|
GST_DECKLINK_VIDEO_FORMAT_12BIT_RGB, /* bmdFormat12BitRGB */
|
|
|
|
GST_DECKLINK_VIDEO_FORMAT_12BIT_RGBLE, /* bmdFormat12BitRGBLE */
|
|
|
|
GST_DECKLINK_VIDEO_FORMAT_10BIT_RGBXLE, /* bmdFormat10BitRGBXLE */
|
|
|
|
GST_DECKLINK_VIDEO_FORMAT_10BIT_RGBX, /* bmdFormat10BitRGBX */
|
2023-04-04 10:22:31 +00:00
|
|
|
#endif
|
2016-04-14 15:26:33 +00:00
|
|
|
} GstDecklinkVideoFormat;
|
|
|
|
#define GST_TYPE_DECKLINK_VIDEO_FORMAT (gst_decklink_video_format_get_type ())
|
|
|
|
GType gst_decklink_video_format_get_type (void);
|
|
|
|
|
2019-03-03 18:34:06 +00:00
|
|
|
typedef enum {
|
2020-10-25 11:30:55 +00:00
|
|
|
GST_DECKLINK_PROFILE_ID_DEFAULT,
|
2019-06-25 09:51:32 +00:00
|
|
|
GST_DECKLINK_PROFILE_ID_ONE_SUB_DEVICE_FULL_DUPLEX, /* bmdProfileOneSubDeviceFullDuplex */
|
|
|
|
GST_DECKLINK_PROFILE_ID_ONE_SUB_DEVICE_HALF_DUPLEX, /* bmdProfileOneSubDeviceHalfDuplex */
|
|
|
|
GST_DECKLINK_PROFILE_ID_TWO_SUB_DEVICES_FULL_DUPLEX, /* bmdProfileTwoSubDevicesFullDuplex */
|
|
|
|
GST_DECKLINK_PROFILE_ID_TWO_SUB_DEVICES_HALF_DUPLEX, /* bmdProfileTwoSubDevicesHalfDuplex */
|
|
|
|
GST_DECKLINK_PROFILE_ID_FOUR_SUB_DEVICES_HALF_DUPLEX, /* bmdProfileFourSubDevicesHalfDuplex */
|
|
|
|
} GstDecklinkProfileId;
|
|
|
|
#define GST_TYPE_DECKLINK_PROFILE_ID (gst_decklink_profile_id_get_type ())
|
|
|
|
GType gst_decklink_profile_id_get_type (void);
|
2019-03-03 18:34:06 +00:00
|
|
|
|
2022-06-02 14:32:28 +00:00
|
|
|
typedef enum {
|
|
|
|
GST_DECKLINK_MAPPING_FORMAT_DEFAULT,
|
|
|
|
GST_DECKLINK_MAPPING_FORMAT_LEVEL_A, /* bmdDeckLinkConfigSMPTELevelAOutput = true */
|
|
|
|
GST_DECKLINK_MAPPING_FORMAT_LEVEL_B, /* bmdDeckLinkConfigSMPTELevelAOutput = false */
|
|
|
|
} GstDecklinkMappingFormat;
|
|
|
|
#define GST_TYPE_DECKLINK_MAPPING_FORMAT (gst_decklink_mapping_format_get_type ())
|
|
|
|
GType gst_decklink_mapping_format_get_type (void);
|
|
|
|
|
2016-05-15 13:04:14 +00:00
|
|
|
typedef enum {
|
|
|
|
GST_DECKLINK_TIMECODE_FORMAT_RP188VITC1, /*bmdTimecodeRP188VITC1 */
|
|
|
|
GST_DECKLINK_TIMECODE_FORMAT_RP188VITC2, /*bmdTimecodeRP188VITC2 */
|
|
|
|
GST_DECKLINK_TIMECODE_FORMAT_RP188LTC, /*bmdTimecodeRP188LTC */
|
|
|
|
GST_DECKLINK_TIMECODE_FORMAT_RP188ANY, /*bmdTimecodeRP188Any */
|
|
|
|
GST_DECKLINK_TIMECODE_FORMAT_VITC, /*bmdTimecodeVITC */
|
|
|
|
GST_DECKLINK_TIMECODE_FORMAT_VITCFIELD2, /*bmdTimecodeVITCField2 */
|
|
|
|
GST_DECKLINK_TIMECODE_FORMAT_SERIAL /* bmdTimecodeSerial */
|
|
|
|
} GstDecklinkTimecodeFormat;
|
|
|
|
#define GST_TYPE_DECKLINK_TIMECODE_FORMAT (gst_decklink_timecode_format_get_type ())
|
|
|
|
GType gst_decklink_timecode_format_get_type (void);
|
|
|
|
|
2017-08-15 00:57:03 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
GST_DECKLINK_KEYER_MODE_OFF,
|
|
|
|
GST_DECKLINK_KEYER_MODE_INTERNAL,
|
|
|
|
GST_DECKLINK_KEYER_MODE_EXTERNAL
|
|
|
|
} GstDecklinkKeyerMode;
|
|
|
|
#define GST_TYPE_DECKLINK_KEYER_MODE (gst_decklink_keyer_mode_get_type ())
|
|
|
|
GType gst_decklink_keyer_mode_get_type (void);
|
|
|
|
|
|
|
|
/* Enum BMDKeyerMode options of off, internal and external @@@ DJ @@@ */
|
|
|
|
|
|
|
|
typedef uint32_t BMDKeyerMode;
|
|
|
|
enum _BMDKeyerMode
|
|
|
|
{
|
|
|
|
bmdKeyerModeOff = /* 'off' */ 0,
|
|
|
|
bmdKeyerModeInternal = /* 'int' */ 1,
|
|
|
|
bmdKeyerModeExternal = /* 'ext' */ 2
|
|
|
|
};
|
|
|
|
|
2016-04-14 15:26:33 +00:00
|
|
|
const BMDPixelFormat gst_decklink_pixel_format_from_type (GstDecklinkVideoFormat t);
|
|
|
|
const gint gst_decklink_bpp_from_type (GstDecklinkVideoFormat t);
|
|
|
|
const GstDecklinkVideoFormat gst_decklink_type_from_video_format (GstVideoFormat f);
|
2018-03-09 11:23:04 +00:00
|
|
|
GstVideoFormat gst_decklink_video_format_from_type (BMDPixelFormat pf);
|
2016-05-15 13:04:14 +00:00
|
|
|
const BMDTimecodeFormat gst_decklink_timecode_format_from_enum (GstDecklinkTimecodeFormat f);
|
|
|
|
const GstDecklinkTimecodeFormat gst_decklink_timecode_format_to_enum (BMDTimecodeFormat f);
|
2019-06-25 09:51:32 +00:00
|
|
|
const BMDProfileID gst_decklink_profile_id_from_enum (GstDecklinkProfileId p);
|
|
|
|
const GstDecklinkProfileId gst_decklink_profile_id_to_enum (BMDProfileID p);
|
2017-08-15 00:57:03 +00:00
|
|
|
const BMDKeyerMode gst_decklink_keyer_mode_from_enum (GstDecklinkKeyerMode m);
|
|
|
|
const GstDecklinkKeyerMode gst_decklink_keyer_mode_to_enum (BMDKeyerMode m);
|
2016-04-14 15:26:33 +00:00
|
|
|
|
2011-06-06 04:24:58 +00:00
|
|
|
typedef struct _GstDecklinkMode GstDecklinkMode;
|
|
|
|
struct _GstDecklinkMode {
|
|
|
|
BMDDisplayMode mode;
|
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
int fps_n;
|
|
|
|
int fps_d;
|
|
|
|
gboolean interlaced;
|
2011-06-29 06:47:18 +00:00
|
|
|
int par_n;
|
|
|
|
int par_d;
|
|
|
|
gboolean tff;
|
2015-01-13 18:56:24 +00:00
|
|
|
const gchar *colorimetry;
|
2011-06-06 04:24:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const GstDecklinkMode * gst_decklink_get_mode (GstDecklinkModeEnum e);
|
2015-01-08 15:42:31 +00:00
|
|
|
const GstDecklinkModeEnum gst_decklink_get_mode_enum_from_bmd (BMDDisplayMode mode);
|
2015-01-06 13:02:38 +00:00
|
|
|
const BMDVideoConnection gst_decklink_get_connection (GstDecklinkConnectionEnum e);
|
2016-11-28 15:17:43 +00:00
|
|
|
GstCaps * gst_decklink_mode_get_caps (GstDecklinkModeEnum e, BMDPixelFormat f, gboolean input);
|
|
|
|
GstCaps * gst_decklink_mode_get_template_caps (gboolean input);
|
2011-06-06 04:24:58 +00:00
|
|
|
|
2014-12-13 16:23:31 +00:00
|
|
|
typedef struct _GstDecklinkOutput GstDecklinkOutput;
|
|
|
|
struct _GstDecklinkOutput {
|
|
|
|
IDeckLink *device;
|
|
|
|
IDeckLinkOutput *output;
|
2019-06-25 09:51:32 +00:00
|
|
|
IDeckLinkProfileAttributes *attributes;
|
2017-08-15 00:57:03 +00:00
|
|
|
IDeckLinkKeyer *keyer;
|
2017-10-04 11:53:35 +00:00
|
|
|
|
|
|
|
gchar *hw_serial_number;
|
2022-09-26 11:57:15 +00:00
|
|
|
gint64 persistent_id;
|
2017-10-04 11:53:35 +00:00
|
|
|
|
2014-12-13 16:23:31 +00:00
|
|
|
GstClock *clock;
|
2015-09-23 13:56:26 +00:00
|
|
|
GstClockTime clock_start_time, clock_last_time, clock_epoch;
|
2015-01-28 13:21:40 +00:00
|
|
|
GstClockTimeDiff clock_offset;
|
2017-11-22 08:42:37 +00:00
|
|
|
gboolean started;
|
|
|
|
gboolean clock_restart;
|
2014-12-13 16:23:31 +00:00
|
|
|
|
|
|
|
/* Everything below protected by mutex */
|
|
|
|
GMutex lock;
|
2017-11-22 08:42:37 +00:00
|
|
|
GCond cond;
|
2014-12-13 16:23:31 +00:00
|
|
|
|
2014-12-19 11:03:09 +00:00
|
|
|
/* Set by the video source */
|
|
|
|
/* Configured mode or NULL */
|
|
|
|
const GstDecklinkMode *mode;
|
|
|
|
|
2014-12-13 16:23:31 +00:00
|
|
|
GstElement *audiosink;
|
2015-01-28 13:21:40 +00:00
|
|
|
gboolean audio_enabled;
|
2014-12-13 16:23:31 +00:00
|
|
|
GstElement *videosink;
|
2015-01-28 13:21:40 +00:00
|
|
|
gboolean video_enabled;
|
2015-01-28 14:48:26 +00:00
|
|
|
void (*start_scheduled_playback) (GstElement *videosink);
|
2014-12-13 16:23:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _GstDecklinkInput GstDecklinkInput;
|
|
|
|
struct _GstDecklinkInput {
|
|
|
|
IDeckLink *device;
|
|
|
|
IDeckLinkInput *input;
|
|
|
|
IDeckLinkConfiguration *config;
|
2019-06-25 09:51:32 +00:00
|
|
|
IDeckLinkProfileAttributes *attributes;
|
2014-12-13 16:23:31 +00:00
|
|
|
|
2017-10-04 11:53:35 +00:00
|
|
|
gchar *hw_serial_number;
|
2022-09-26 11:57:15 +00:00
|
|
|
gint64 persistent_id;
|
2017-10-04 11:53:35 +00:00
|
|
|
|
2014-12-13 16:23:31 +00:00
|
|
|
/* Everything below protected by mutex */
|
|
|
|
GMutex lock;
|
|
|
|
|
2014-12-18 16:31:20 +00:00
|
|
|
/* Set by the video source */
|
2017-09-28 10:55:18 +00:00
|
|
|
void (*got_video_frame) (GstElement *videosrc, IDeckLinkVideoInputFrame * frame, GstDecklinkModeEnum mode, GstClockTime capture_time, GstClockTime stream_time, GstClockTime stream_duration, GstClockTime hardware_time, GstClockTime hardware_duration, IDeckLinkTimecode *dtc, gboolean no_signal);
|
2014-12-19 11:03:09 +00:00
|
|
|
/* Configured mode or NULL */
|
|
|
|
const GstDecklinkMode *mode;
|
2016-01-13 21:05:49 +00:00
|
|
|
BMDPixelFormat format;
|
2022-08-17 15:42:09 +00:00
|
|
|
gboolean auto_format;
|
2014-12-18 16:31:20 +00:00
|
|
|
|
2014-12-13 16:23:31 +00:00
|
|
|
/* Set by the audio source */
|
2017-09-28 10:55:18 +00:00
|
|
|
void (*got_audio_packet) (GstElement *videosrc, IDeckLinkAudioInputPacket * packet, GstClockTime capture_time, GstClockTime stream_time, GstClockTime stream_duration, GstClockTime hardware_time, GstClockTime hardware_duration, gboolean no_signal);
|
2014-12-13 16:23:31 +00:00
|
|
|
|
|
|
|
GstElement *audiosrc;
|
2015-01-28 13:21:40 +00:00
|
|
|
gboolean audio_enabled;
|
2014-12-13 16:23:31 +00:00
|
|
|
GstElement *videosrc;
|
2015-01-28 13:21:40 +00:00
|
|
|
gboolean video_enabled;
|
2015-01-28 14:26:17 +00:00
|
|
|
void (*start_streams) (GstElement *videosrc);
|
2014-12-13 16:23:31 +00:00
|
|
|
};
|
|
|
|
|
2022-09-26 11:57:15 +00:00
|
|
|
GstDecklinkOutput * gst_decklink_acquire_nth_output (gint n, gint64 persistent_id, GstElement * sink, gboolean is_audio);
|
|
|
|
void gst_decklink_release_nth_output (gint n, gint64 persistent_id, GstElement * sink, gboolean is_audio);
|
2014-12-13 16:23:31 +00:00
|
|
|
|
2022-09-26 11:57:15 +00:00
|
|
|
GstDecklinkInput * gst_decklink_acquire_nth_input (gint n, gint64 persistent_id, GstElement * src, gboolean is_audio);
|
|
|
|
void gst_decklink_release_nth_input (gint n, gint64 persistent_id, GstElement * src, gboolean is_audio);
|
2014-12-18 16:31:20 +00:00
|
|
|
|
2015-12-17 15:26:29 +00:00
|
|
|
const GstDecklinkMode * gst_decklink_find_mode_for_caps (GstCaps * caps);
|
2016-04-14 15:26:33 +00:00
|
|
|
const GstDecklinkMode * gst_decklink_find_mode_and_format_for_caps (GstCaps * caps, BMDPixelFormat * format);
|
2016-11-28 15:17:43 +00:00
|
|
|
GstCaps * gst_decklink_mode_get_caps_all_formats (GstDecklinkModeEnum e, gboolean input);
|
|
|
|
GstCaps * gst_decklink_pixel_format_get_caps (BMDPixelFormat f, gboolean input);
|
2015-12-17 15:26:29 +00:00
|
|
|
|
2019-11-21 14:59:29 +00:00
|
|
|
#define GST_TYPE_DECKLINK_DEVICE gst_decklink_device_get_type()
|
|
|
|
#define GST_DECKLINK_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DECKLINK_DEVICE,GstDecklinkDevice))
|
|
|
|
|
|
|
|
typedef struct _GstDecklinkDevice GstDecklinkDevice;
|
|
|
|
typedef struct _GstDecklinkDeviceClass GstDecklinkDeviceClass;
|
|
|
|
|
|
|
|
struct _GstDecklinkDeviceClass
|
|
|
|
{
|
|
|
|
GstDeviceClass parent_class;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _GstDecklinkDevice
|
|
|
|
{
|
|
|
|
GstDevice parent;
|
|
|
|
gboolean video;
|
|
|
|
gboolean capture;
|
2022-09-26 11:57:15 +00:00
|
|
|
gint64 persistent_id;
|
2019-11-21 14:59:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
GType gst_decklink_device_get_type (void);
|
|
|
|
|
|
|
|
GList * gst_decklink_get_devices (void);
|
|
|
|
|
2011-06-06 04:24:58 +00:00
|
|
|
#endif
|