From: James Wise Date: Wed, 15 Feb 2017 23:09:00 +0000 (+1100) Subject: Merge commit 'fcda9226c39ea7752abb74d40f9e20fa79e88848' into 2.1.0 X-Git-Tag: 2.1.0_Beta2~48^2^2~1 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=b100395cec89c77982579b8abf3b8639ec9b56f4;hp=fcda9226c39ea7752abb74d40f9e20fa79e88848;p=casparcg Merge commit 'fcda9226c39ea7752abb74d40f9e20fa79e88848' into 2.1.0 --- diff --git a/dependencies64/bluefish/include/BlueC_Api.h b/dependencies64/bluefish/include/BlueC_Api.h deleted file mode 100644 index 80fd7cc43..000000000 --- a/dependencies64/bluefish/include/BlueC_Api.h +++ /dev/null @@ -1,107 +0,0 @@ -// The following ifdef block is the standard way of creating macros which make exporting -// from a DLL simpler. All files within this DLL are compiled with the BLUEC_API_EXPORTS -// symbol defined on the command line. this symbol should not be defined on any project -// that uses this DLL. This way any other project whose source files include this file see -// BLUEC_API_API functions as being imported from a DLL, whereas this DLL sees symbols -// defined with this macro as being exported. -#ifdef BLUEFISH_EXPORTS -#define BLUE_CSDK_API __declspec(dllexport) -#else -#define BLUE_CSDK_API __declspec(dllimport) -#endif -#include "BlueTypes.h" -#include "BlueDriver_p.h" - -#define IGNORE_SYNC_WAIT_TIMEOUT_VALUE (0xFFFFFFFF) - - -#pragma once - -// -//typedef enum _blue_video_engine_flags -//{ -// BLUE_CAPTURE_PREVIEW_ON_OUTPUT_CHANNEL_A=0x1, -// BLUE_CAPTURE_PREVIEW_ON_OUTPUT_CHANNEL_B=0x2, -// BLUE_CAPTURE_PREVIEW_ON_OUTPUT_CHANNEL_C=0x3, -// BLUE_CAPTURE_PREVIEW_ON_OUTPUT_CHANNEL_D=0x4 -//}blue_video_engine_flags; -// -typedef enum _EBLUEDMA_DIRECTION -{ - BLUEDMA_WRITE=0, - BLUEDMA_READ=1, - BLUEDMA_INVALID=3 -}EBLUEDMA_DIRECTION; - -typedef struct _EBlueConnectorPropertySetting -{ - EBlueVideoChannel channel; - EBlueConnectorIdentifier connector; - EBlueConnectorSignalDirection signaldirection; - EBlueConnectorProperty propType; - VARIANT Value; -}EBlueConnectorPropertySetting; - - -typedef struct _blue_card_property -{ - EBlueVideoChannel video_channel; - EBlueCardProperty prop; - VARIANT value; -}blue_card_property; - - -extern "C" { -BLUE_CSDK_API unsigned int blue_device_count(); -BLUE_CSDK_API void * blue_attach_to_device(int device_id); -BLUE_CSDK_API BERR blue_detach_from_device(void ** device_handle); - -// -//BLUE_CSDK_API BERR blue_set_video_engine( void * device_handle, -// EBlueVideoChannel video_channel, -// EEngineMode * video_engine, -// BLUE_UINT32 video_engine_flag); -BLUE_CSDK_API BERR blue_video_dma( void * device_handle, - EBLUEDMA_DIRECTION dma_direction, - void * pFrameBuffer, - BLUE_UINT32 FrameSize, - BLUE_UINT32 BufferId, - BLUE_UINT32 * dma_bytes_transferred, - BLUE_UINT32 CardFrameOffset, - OVERLAPPED * pAsync - ); - - -/* - functions used to set the card property . This includes the video property - and the video connection/routing property. -*/ -BLUE_CSDK_API BERR blue_set_video_property( void * device_handle, - BLUE_UINT32 prop_count, - blue_card_property * card_prop); - -BLUE_CSDK_API BERR blue_get_video_property( void * device_handle, - BLUE_UINT32 prop_count, - blue_card_property * card_prop); - -BLUE_CSDK_API BERR blue_get_connector_property(void * device_handle, - BLUE_UINT32 VideoChannel, - BLUE_UINT32 *settingsCount, // In: element count of settings array - // Out: if settings is non-NULL, number of valid elements - // Out: if settings is NULL, number of elements required - EBlueConnectorPropertySetting *settings // Caller allocates/frees memory - ); - -BLUE_CSDK_API BERR blue_set_connector_property( - void * device_handle, - BLUE_UINT32 settingsCount, - EBlueConnectorPropertySetting *settings - ); - -//BLUE_CSDK_API BERR blue_wait_video_interrupt(void * device_handle, -// EBlueVideoChannel video_channel, -// EUpdateMethod upd_fmt, -// BLUE_UINT32 field_wait_count, -// BLUE_UINT32 *field_count -// ); -} \ No newline at end of file diff --git a/dependencies64/bluefish/include/BlueDriver_p.h b/dependencies64/bluefish/include/BlueDriver_p.h index 2b4d10322..e183a0168 100644 --- a/dependencies64/bluefish/include/BlueDriver_p.h +++ b/dependencies64/bluefish/include/BlueDriver_p.h @@ -1,29 +1,27 @@ -/* - $Id: BlueDriver_p.h,v 1.62.2.16 2011/10/26 05:33:18 tim Exp $ -*/ -#pragma once +#pragma once #define _BLUEDRIVER_P_H__ -#define BLUE_UINT32 unsigned int -#define BLUE_INT32 int -#define BLUE_UINT8 unsigned char -#define BLUE_INT8 char +#define BLUE_UINT32 unsigned int +#define BLUE_INT32 int +#define BLUE_UINT8 unsigned char +#define BLUE_INT8 char #define BLUE_UINT16 unsigned short #define BLUE_INT16 short -#pragma once -#ifdef BLUE_LINUX_CODE -#define BLUE_UINT64 unsigned long long -//#include -#else -#define BLUE_UINT64 unsigned __int64 -#endif -//#define ORAC_FILMPOST_FIRMWARE_PRODUCTID (0x1) -//#define ORAC_BROADCAST_FIRMWARE_PRODUCTID (0x2) -//#define ORAC_ASI_FIRMWARE_PRODUCTID (0x3) -//#define ORAC_4SDIINPUT_FIRMWARE_PRODUCTID (0x4) -//#define ORAC_4SDIOUTPUT_FIRMWARE_PRODUCTID (0x5) +#if defined __linux__ + #define BLUE_UINT64 unsigned long long + #define ULONG unsigned long +#elif defined (__APPLE__) + #define BLUE_UINT64 unsigned long long + #define UINT32 BLUE_UINT32 + #define INT32 BLUE_INT32 + #define ULONG unsigned long + #define BOOLEAN BOOL +#elif defined (_WIN32) + #define BLUE_UINT64 unsigned __int64 +#endif + /** * This contains the enumerators that can be used to set the cards \n @@ -76,7 +74,10 @@ typedef enum _EVideoMode VID_FMT_2048_1080P_5000=39, VID_FMT_2048_1080P_5994=40, VID_FMT_2048_1080P_6000=41, - VID_FMT_INVALID=42 + VID_FMT_1080P_4800=42, + VID_FMT_2048_1080P_4800=43, + + VID_FMT_INVALID=44 } EVideoMode; /** @@ -99,12 +100,28 @@ typedef enum _EMemoryFormat MEM_FMT_2VUY=8, MEM_FMT_BGR=9, MEM_FMT_BGR_16_16_16=10, + MEM_FMT_BGR_48 = MEM_FMT_BGR_16_16_16, MEM_FMT_BGRA_16_16_16_16=11, + MEM_FMT_BGRA_64 = MEM_FMT_BGRA_16_16_16_16, MEM_FMT_VUYA_4444=12, MEM_FMT_V216=13, MEM_FMT_Y210=14, MEM_FMT_Y216=15, - MEM_FMT_INVALID=16 + MEM_FMT_RGB=16, + MEM_FMT_YUV_ALPHA=17, + MEM_FMT_RGB_16_16_16=18, + MEM_FMT_RGB_48 = MEM_FMT_RGB_16_16_16, + MEM_FMT_RGBA_16_16_16_16=19, + MEM_FMT_RGBA_64 = MEM_FMT_RGBA_16_16_16_16, + MEM_FMT_YCA8 = 20, + MEM_FMT_CYA8 = 21, + MEM_FMT_YUV_ALPHA_10 = 22, + MEM_FMT_YCA10 = 23, + MEM_FMT_CYA10 = 24, + MEM_FMT_YAC10 = 25, + MEM_FMT_CAY10 = 26, + + MEM_FMT_INVALID = 27 } EMemoryFormat; /** @@ -170,6 +187,10 @@ typedef enum _ECardType CRD_BLUE_CREATE_3D = CRD_BLUE_CREATE_2K, CRD_BLUE_CREATE_3D_ULTRA = CRD_BLUE_CREATE_2K_ULTRA, CRD_BLUE_SUPER_NOVA, + CRD_BLUE_SUPER_NOVA_S_PLUS, + CRD_BLUE_SUPER_NOVA_MICRO, + CRD_BLUE_NEUTRON = CRD_BLUE_SUPER_NOVA_MICRO, + CRD_BLUE_EPOCH_CG, CRD_INVALID } ECardType; @@ -186,12 +207,29 @@ typedef enum _EHDCardSubType enum EEpochFirmwareProductID { - ORAC_FILMPOST_FIRMWARE_PRODUCTID=(0x1), //Epoch/Create, standard firmware - ORAC_BROADCAST_FIRMWARE_PRODUCTID=(0x2), //Epoch - ORAC_ASI_FIRMWARE_PRODUCTID=(0x3), //Epoch - ORAC_4SDIINPUT_FIRMWARE_PRODUCTID=(0x4), //SuperNova - ORAC_4SDIOUTPUT_FIRMWARE_PRODUCTID=(0x5), //SuperNova - ORAC_2SDIINPUT_2SDIOUTPUT_FIRMWARE_PRODUCTID=(0x6), //SuperNova + ORAC_FILMPOST_FIRMWARE_PRODUCTID = (0x01), //Epoch (2K) Horizon/Core/Ultra, Create/Create3D/Create3D Ultra + ORAC_BROADCAST_FIRMWARE_PRODUCTID = (0x02), //Epoch (2K) Horizon/Core/Ultra, Create/Create3D/Create3D Ultra + ORAC_ASI_FIRMWARE_PRODUCTID = (0x03), //Epoch (2K) Horizon/Core/Ultra + ORAC_4SDIINPUT_FIRMWARE_PRODUCTID = (0x04), //Epoch Supernova/Supernova S+ + ORAC_4SDIOUTPUT_FIRMWARE_PRODUCTID = (0x05), //Epoch Supernova/Supernova S+ + ORAC_2SDIINPUT_2SDIOUTPUT_FIRMWARE_PRODUCTID = (0x06), //Epoch Supernova/Supernova S+ + ORAC_1SDIINPUT_3SDIOUTPUT_FIRMWARE_PRODUCTID = (0x08), //Epoch Supernova/Supernova S+, deprecated + ORAC_INPUT_1SDI_1CHANNEL_OUTPUT_4SDI_3CHANNEL_FIRMWARE_PRODUCTID = (0x09), //Epoch Supernova/Supernova S+ + ORAC_INPUT_2SDI_2CHANNEL_OUTPUT_3SDI_2CHANNEL_FIRMWARE_PRODUCTID = (0x0A), //Epoch Supernova/Supernova S+, deprecated + ORAC_INPUT_3SDI_3CHANNEL_OUTPUT_1SDI_1CHANNEL_FIRMWARE_PRODUCTID = (0x0B), //Epoch Supernova/Supernova S+ + ORAC_BNC_ASI_FIRMWARE_PRODUCTID = (0x0C), //Epoch Supernova/Supernova S+ + ORAC_NEUTRON_2_IN_0_OUT_FIRMWARE_PRODUCTID = (0x0D), //Epoch Neutron + ORAC_NEUTRON_0_IN_2_OUT_FIRMWARE_PRODUCTID = (0x0E), //Epoch Neutron + ORAC_NEUTRON_1_IN_1_OUT_FIRMWARE_PRODUCTID = (0x0F), //Epoch Neutron + ORAC_NEUTRON_2_IN_0_OUT_SCALER_FIRMWARE_PRODUCTID = (0x10), //Epoch Neutron + ORAC_NEUTRON_0_IN_2_OUT_SCALER_FIRMWARE_PRODUCTID = (0x11), //Epoch Neutron + ORAC_NEUTRON_1_IN_1_OUT_SCALER_FIRMWARE_PRODUCTID = (0x12), //Epoch Neutron + ORAC_NEUTRON_ASI_FIRMWARE_PRODUCTID = (0x13), //Epoch Neutron + ORAC_INPUT_1SDI_1CHANNEL_OUTPUT_3SDI_3CHANNEL_FIRMWARE_PRODUCTID = (0x14), //Epoch Supernova/Supernova S+ + ORAC_NEUTRON_1_IN_2_OUT_FIRMWARE_PRODUCTID = (0x15), //Epoch Neutron + ORAC_NEUTRON_3_IN_0_OUT_FIRMWARE_PRODUCTID = (0x16), //Epoch Neutron + ORAC_NEUTRON_0_IN_3_OUT_FIRMWARE_PRODUCTID = (0x17), //Epoch Neutron + ORAC_INPUT_1SDI_1CHANNEL_OUTPUT_3SDI_2CHANNEL_FIRMWARE_PRODUCTID = (0x18), //Epoch Supernova/Supernova S+ }; /**< @brief Use this enumerator to select the audio channels that should be captured or played back. @@ -245,18 +283,18 @@ This enumerator works only when used with ReadAudioSample function. */ typedef enum { - BLUE_AUDIO_AES=0, /**< Used to select All 8 channels of Digital Audio using AES/AES3id connector*/ - BLUE_AUDIO_ANALOG=1,/**< Used to select Analog audio*/ - BLUE_AUDIO_SDIA=2, /**< Used to select Emb audio from SDI A */ - BLUE_AUDIO_EMBEDDED=BLUE_AUDIO_SDIA, - BLUE_AUDIO_SDIB=3, /**< Used to select Emb audio from SDI B */ - BLUE_AUDIO_AES_PAIR0=4, /**< Used to select stereo pair 0 as audio input source. This is only supported on SD Greed Derivative cards.*/ - BLUE_AUDIO_AES_PAIR1=5,/**< Used to select stereo pair 1 as audio input source. This is only supported on SD Greed Derivative cards.*/ - BLUE_AUDIO_AES_PAIR2=6,/**< Used to select stereo pair 2 as audio input source. This is only supported on SD Greed Derivative cards.*/ - BLUE_AUDIO_AES_PAIR3=7,/**< Used to select stereo pair 3 as audio input source. This is only supported on SD Greed Derivative cards.*/ - BLUE_AUDIO_SDIC=8, /**< Used to select Emb audio from SDI C */ - BLUE_AUDIO_SDID=9, /**< Used to select Emb audio from SDI D */ - BLUE_AUDIO_INVALID=10 + BLUE_AUDIO_AES = 0, /** 8 channels of AES */ + BLUE_AUDIO_ANALOG = 1, /** 2 channels of analog audio */ + BLUE_AUDIO_SDIA = 2, /** deprecated, do not use */ + BLUE_AUDIO_EMBEDDED = BLUE_AUDIO_SDIA, /** use BLUE_AUDIO_EMBEDDED for any embedded audio stream; the stream is associated with the SDK object (BlueVelvet4/BlueVelvetC) */ + BLUE_AUDIO_SDIB = 3, /** deprecated, do not use */ + BLUE_AUDIO_AES_PAIR0 = 4, /** deprecated, do not use */ + BLUE_AUDIO_AES_PAIR1 = 5, /** deprecated, do not use */ + BLUE_AUDIO_AES_PAIR2 = 6, /** deprecated, do not use */ + BLUE_AUDIO_AES_PAIR3 = 7, /** deprecated, do not use */ + BLUE_AUDIO_SDIC = 8, /** deprecated, do not use */ + BLUE_AUDIO_SDID = 9, /** deprecated, do not use */ + BLUE_AUDIO_INVALID = 10 } Blue_Audio_Connector_Type; typedef enum _EAudioRate @@ -284,26 +322,25 @@ typedef enum _EConnectorSignalColorSpace */ typedef enum _EDualLinkSignalFormatType { - Signal_FormatType_4224=0, /**< sets the card to work in 4:2:2:4 mode*/ - Signal_FormatType_4444=1,/**< sets the card to work in 4:4:4 10 bit dual link mode*/ - Signal_FormatType_444_10BitSDI=Signal_FormatType_4444,/**< sets the card to work in 10 bit 4:4:4 dual link mode*/ - Signal_FormatType_444_12BitSDI=0x4,/**< sets the card to work in 4:4:4 12 bit dual link mode*/ - Signal_FormatType_Independent_422 = 0x2, - Signal_FormatType_Key_Key=0x8000/**< not used currently on epoch cards */ + Signal_FormatType_4224 = 0, /**< sets the card to work in 4:2:2:4 mode*/ + Signal_FormatType_4444 = 1, /**< sets the card to work in 4:4:4 10 bit dual link mode*/ + Signal_FormatType_444_10BitSDI = Signal_FormatType_4444, + Signal_FormatType_444_12BitSDI = 0x4, /**< sets the card to work in 4:4:4 12 bit dual link mode*/ + Signal_FormatType_Independent_422 = 0x2, + Signal_FormatType_Key_Key = 0x8000 /**< not used currently on epoch cards */ }EDualLinkSignalFormatType; - enum ECardOperatingMode { - CardOperatingMode_SingleLink=0x0, - CardOperatingMode_Independent_422=CardOperatingMode_SingleLink, - CardOperatingMode_DualLink=0x1, - CardOperatingMode_StereoScopic_422=0x3, - CardOperatingMode_Dependent_422=CardOperatingMode_StereoScopic_422,/**< not used currently on epoch cards */ + CardOperatingMode_SingleLink = 0x0, + CardOperatingMode_Independent_422 = CardOperatingMode_SingleLink, + CardOperatingMode_DualLink = 0x1, + CardOperatingMode_StereoScopic_422 = 0x3, + CardOperatingMode_Dependent_422 = CardOperatingMode_StereoScopic_422, /**< not used currently on epoch cards */ + CardOperatingMode_DualLink_Dual3G = 0x4, }; - typedef enum _EPreDefinedColorSpaceMatrix { UNITY_MATRIX=0, @@ -328,7 +365,6 @@ typedef enum _EPreDefinedColorSpaceMatrix MATRIX_USER_DEFINED=15, }EPreDefinedColorSpaceMatrix; -#ifndef BLUE_LINUX_CODE /**< @brief this enumerator contains the status of the driver video/hanc fifo */ @@ -339,8 +375,8 @@ typedef enum BLUE_FIFO_RUNNING=2,/**< Fifo is running */ BLUE_FIFO_STOPPING=3,/**< Fifo is in the process of stopping */ BLUE_FIFO_PASSIVE=5,/**< Fifo is currently stopped or not active*/ + BLUE_FIFO_STATUS_INVALID=10 }BlueVideoFifoStatus; -#endif /**< @brief use this enumerator to define the data range of the RGB video frame data. @@ -374,16 +410,19 @@ typedef enum _EImageOrientation */ typedef enum _EBlueGenlockSource { - BlueGenlockBNC=0, /**< Genlock is used as reference signal source */ - BlueSDIBNC=0x10000, /**< SDI input B is used as reference signal source */ - BlueSDI_B_BNC=BlueSDIBNC, - BlueSDI_A_BNC=0x20000,/**< SDI input A is used as reference signal source */ - BlueAnalog_BNC=0x40000, /**< Analog input is used as reference signal source */ - BlueSoftware=0x80000, + BlueGenlockBNC = 0, /** Genlock is used as reference signal source */ + BlueSDIBNC = 0x10000, /** SDI input B is used as reference signal source */ + BlueSDI_B_BNC = BlueSDIBNC, + BlueSDI_A_BNC = 0x20000, /** SDI input A is used as reference signal source */ + BlueAnalog_BNC = 0x40000, /** Analog input is used as reference signal source */ + BlueSoftware = 0x80000, + BlueFreeRunning = BlueSoftware, + BlueGenlockAux = 0x100000, /** auxiliary genlock connector on Epoch Neutron cards */ + BlueInterlock = 0x200000, /** interlock connector on Epoch Neutron cards */ }EBlueGenlockSource; -typedef enum _EBlueVideoChannel +typedef enum _EBlueVideoChannel { BLUE_VIDEOCHANNEL_A=0, BLUE_VIDEO_OUTPUT_CHANNEL_A=BLUE_VIDEOCHANNEL_A, @@ -522,6 +561,14 @@ typedef enum _EBlueConnectorSignalDirection BLUE_CONNECTOR_SIGNAL_OUTPUT=1, }EBlueConnectorSignalDirection; +typedef enum _EBlueDynamicConnectorType +{ + BLUE_DYNAMIC_CONNECTOR_TYPE_INVALID = 0, + BLUE_DYNAMIC_CONNECTOR_TYPE_OUTPUT = 1, + BLUE_DYNAMIC_CONNECTOR_TYPE_INPUT = 2, + BLUE_DYNAMIC_CONNECTOR_TYPE_GENLOCK = 3, +}EBlueDynamicConnectorType; + typedef enum _EBlueConnectorProperty { BLUE_INVALID_CONNECTOR_PROPERTY = -1, @@ -619,8 +666,8 @@ typedef enum _EBlueCardProperty For SD cards this property will set the input and the output to the specified value. For Epoch/Create/SuperNova cards this property will only set the output to the specified value. For setting the input on Epoch/Create/SuperNova cards see EPOCH_VIDEO_INPUT_RGB_DATA_RANGE*/ - VIDEO_KEY_OVER_BLACK=14,/**< this property is deprecated and no longer supported on epoch/create range of cards.*/ - VIDEO_KEY_OVER_INPUT_SIGNAL=15, + VIDEO_KEY_OVER_BLACK=14, /**< this property is deprecated and no longer supported on epoch/create range of cards.*/ + VIDEO_KEY_OVER_INPUT_SIGNAL=15, /**< this property is deprecated and no longer supported on epoch/create range of cards.*/ VIDEO_SET_DOWN_CONVERTER_VIDEO_MODE=16,/**< this property is deprecated and no longer supported on epoch/create range of cards. EHD_XCONNECTOR_MODE */ @@ -631,9 +678,16 @@ typedef enum _EBlueCardProperty VIDEO_PILLOR_BOX_BOTTOM=21, VIDEO_SAFE_PICTURE=22, VIDEO_SAFE_TITLE=23, - VIDEO_INPUT_SIGNAL_VIDEO_MODE=24,/**< Use this property to retreive the video input signal information on the - default video input channel used by that SDK object. - */ + VIDEO_INPUT_SIGNAL_VIDEO_MODE=24, /**< Use this property to retreive the video input signal information on the + default video input channel used by that SDK object. + When calling SetCardProperty with a valid video mode on this property, the SDK + will will use this video mode "Hint" if the card buffers are set up despite there being a valid + input signal; the card buffers will be set up when calling one of these card properties: + VIDEO_INPUT_MEMORY_FORMAT + VIDEO_INPUT_UPDATE_TYPE + VIDEO_INPUT_ENGINE + Note: QueryCardProperty(VIDEO_INPUT_SIGNAL_VIDEO_MODE) will still return the actual video input signal + */ VIDEO_COLOR_MATRIX_MODE=25, VIDEO_OUTPUT_MAIN_LUT=26,/**< this property is deprecated and no longer supported on epoch/create range of cards.*/ VIDEO_OUTPUT_AUX_LUT=27,/**< this property is deprecated and no longer supported on epoch/create range of cards.*/ @@ -651,16 +705,13 @@ typedef enum _EBlueCardProperty video input channels when it is capturing a frame from video input source. Possible values this property can accept is defined in the enumerator EMemoryFormat */ - VIDEO_GENLOCK_SIGNAL=35,/**< Use this property to retrieve video signal of the reference source that is used by the card. - This can also be used to select the reference signal source that should be used. - */ - + VIDEO_GENLOCK_SIGNAL=35, /**< Use this property to retrieve video signal of the reference source that is used by the card. + This can also be used to select the reference signal source that should be used. + See application note AN004_Genlock.pdf for more information */ AUDIO_OUTPUT_PROP=36, /**< this can be used to route PCM audio data onto respective audio output connectors. */ AUDIO_CHANNEL_ROUTING=AUDIO_OUTPUT_PROP, - AUDIO_INPUT_PROP=37,/**< Use this property to select audio input source that should be used when doing - an audio capture. - Possible values this property can accept is defined in the enumerator Blue_Audio_Connector_Type. - */ + AUDIO_INPUT_PROP=37, /**< Use this property to select audio input source that should be used when doing an audio capture. + Possible values this property can accept is defined in the enumerator Blue_Audio_Connector_Type. */ VIDEO_ENABLE_LETTERBOX=38, VIDEO_DUALLINK_OUTPUT_INVERT_KEY_COLOR=39,/**< this property is deprecated and no longer supported on epoch/create range of cards.*/ VIDEO_DUALLINK_OUTPUT_DEFAULT_KEY_COLOR=40,/**< this property is deprecated and no longer supported on epoch/create range of cards.*/ @@ -681,8 +732,10 @@ typedef enum _EBlueCardProperty VIDEO_PLAYBACK_FIFO_FREE_STATUS=48, /**< this will return the number of free buffer in the fifo. If the video engine is framestore this will give you the number of buffers that the framestore mode can you use with that video output channel.*/ - VIDEO_IMAGE_WIDTH=49, /**< only for selective DMA of a smaller image onto video output raster; size in bytes (not pixels) */ - VIDEO_IMAGE_HEIGHT=50, /**< only for selective DMA of a smaller image onto video output raster; number of lines */ + VIDEO_IMAGE_WIDTH=49, /**< selective output DMA: see application note AN008_SelectiveDMA.pdf for more details */ + VIDEO_IMAGE_HEIGHT=50, /**< selective output DMA: see application note AN008_SelectiveDMA.pdf for more details */ + VIDEO_SELECTIVE_OUTPUT_DMA_DST_PITCH = VIDEO_IMAGE_WIDTH, //pitch (bytes per line) of destination buffer (card memory) + VIDEO_SELECTIVE_OUTPUT_DMA_SRC_LINES = VIDEO_IMAGE_HEIGHT, //number of video lines to extract from source image (system memory) VIDEO_SCALER_MODE=51, AVAIL_AUDIO_INPUT_SAMPLE_COUNT=52, VIDEO_PLAYBACK_FIFO_ENGINE_STATUS=53, /**< this will return the playback fifo status. The values returned by this property @@ -706,12 +759,16 @@ typedef enum _EBlueCardProperty Normally video playback fifo is started on the next video interrupt after the video_playback_start call.*/ GENLOCK_TIMING=62, - VIDEO_IMAGE_PITCH=63, - VIDEO_IMAGE_OFFSET=64, - VIDEO_INPUT_IMAGE_WIDTH=65, - VIDEO_INPUT_IMAGE_HEIGHT=66, - VIDEO_INPUT_IMAGE_PITCH=67, - VIDEO_INPUT_IMAGE_OFFSET=68, + VIDEO_IMAGE_PITCH=63, /**< selective output DMA: see application note AN008_SelectiveDMA.pdf for more details */ + VIDEO_IMAGE_OFFSET=64, /**< currently not used; selective output DMA: see application note AN008_SelectiveDMA.pdf for more details */ + VIDEO_SELECTIVE_OUTPUT_DMA_SRC_PITCH = VIDEO_IMAGE_PITCH, //pitch (bytes per line) of source buffer (system memory) + VIDEO_INPUT_IMAGE_WIDTH=65, /**< selective input DMA: see application note AN008_SelectiveDMA.pdf for more details */ + VIDEO_INPUT_IMAGE_HEIGHT=66, /**< selective input DMA: see application note AN008_SelectiveDMA.pdf for more details */ + VIDEO_INPUT_IMAGE_PITCH=67, /**< selective input DMA: see application note AN008_SelectiveDMA.pdf for more details */ + VIDEO_INPUT_IMAGE_OFFSET=68, /**< currently not used; selective input DMA: see application note AN008_SelectiveDMA.pdf for more details */ + VIDEO_SELECTIVE_INPUT_DMA_SRC_PITCH = VIDEO_INPUT_IMAGE_WIDTH, //pitch (bytes per line) of source buffer (card memory) + VIDEO_SELECTIVE_INPUT_DMA_SRC_LINES = VIDEO_INPUT_IMAGE_HEIGHT, //number of video lines to extract from source image (card memory) + VIDEO_SELECTIVE_INPUT_DMA_DST_PITCH = VIDEO_INPUT_IMAGE_PITCH, //pitch (bytes per line) of destination buffer (system memory) TIMECODE_RP188=69, /**< this property is deprecated and no longer supported on epoch/create range of cards.*/ BOARD_TEMPERATURE=70,/** @@ -811,28 +868,84 @@ typedef enum _EBlueCardProperty EPOCH_OUTPUT_CHANNEL_AV_OFFSET=90, EPOCH_SCALER_CHANNEL_MUX_MODE=91, EPOCH_INPUT_CHANNEL_AV_OFFSET=92, - EPOCH_AUDIOOUTPUT_MANUAL_UCZV_GENERATION=93,/* ASI firmware only */ - EPOCH_SAMPLE_RATE_CONVERTER_BYPASS=94, - EPOCH_GET_PRODUCT_ID=95, /* returns the enum for the firmware type EEpochFirmwareProductID */ + EPOCH_AUDIOOUTPUT_MANUAL_UCZV_GENERATION=93, /* ASI firmware only */ + EPOCH_SAMPLE_RATE_CONVERTER_BYPASS=94, /** bypasses the sample rate converter for AES audio; only turn on for Dolby-E support + * pass in a flag to signal which audio stereo pair should be bypassed: + * bit 0: AES channels 0 and 1 + * bit 1: AES channels 2 and 3 + * bit 2: AES channels 4 and 5 + * bit 3: AES channels 6 and 7 + * For example: bypass the sample rate converter for channels 0 to 3: flag = 0x3; */ + EPOCH_GET_PRODUCT_ID=95, /* returns the enum for the firmware type EEpochFirmwareProductID */ EPOCH_GENLOCK_IS_LOCKED=96, - EPOCH_DVB_ASI_OUTPUT_PACKET_COUNT=97, /* ASI firmware only */ - EPOCH_DVB_ASI_OUTPUT_BIT_RATE=98, /* ASI firmware only */ - EPOCH_DVB_ASI_DUPLICATE_OUTPUT_A=99, /* ASI firmware only */ - EPOCH_DVB_ASI_DUPLICATE_OUTPUT_B=100, /* ASI firmware only */ - EPOCH_SCALER_HORIZONTAL_FLIP=101, /* see SideBySide_3D sample application */ - EPOCH_CONNECTOR_DIRECTION=102, /* see application notes */ - EPOCH_AUDIOOUTPUT_VALIDITY_BITS=103, /* ASI firmware only */ + EPOCH_DVB_ASI_OUTPUT_PACKET_COUNT=97, /* ASI firmware only */ + EPOCH_DVB_ASI_OUTPUT_BIT_RATE=98, /* ASI firmware only */ + EPOCH_DVB_ASI_DUPLICATE_OUTPUT_A=99, /* ASI firmware only */ + EPOCH_DVB_ASI_DUPLICATE_OUTPUT_B=100, /* ASI firmware only */ + EPOCH_SCALER_HORIZONTAL_FLIP=101, /* see SideBySide_3D sample application */ + EPOCH_CONNECTOR_DIRECTION=102, /* see application notes */ + EPOCH_AUDIOOUTPUT_VALIDITY_BITS=103, /* ASI firmware only */ EPOCH_SIZEOF_DRIVER_ALLOCATED_MEMORY=104, /* video buffer allocated in Kernel space; accessible in userland via system_buffer_map() */ INVALID_VIDEO_MODE_FLAG=105, /* returns the enum for VID_FMT_INVALID that this SDK/Driver was compiled with; it changed between 5.9.x.x and 5.10.x.x driver branch and has to be handled differently for each driver if the application wants to use the VID_FMT_INVALID flag and support both driver branches */ - EPOCH_VIDEO_INPUT_VPID=106, /* returns the VPID for the current video input signal */ - EPOCH_LOW_LATENCY_DMA=107, /* not fully supported yet */ + EPOCH_VIDEO_INPUT_VPID=106, /* returns the VPID for the current video input signal. Input value is of type EBlueConnectorIdentifier */ + EPOCH_LOW_LATENCY_DMA=107, /* deprecated; use new feature EPOCH_SUBFIELD_INPUT_INTERRUPTS instead */ EPOCH_VIDEO_INPUT_RGB_DATA_RANGE=108, - - VIDEO_CARDPROPERTY_INVALID=1000 + EPOCH_DVB_ASI_OUTPUT_PACKET_SIZE=109, /* firmware supports either 188 or 204 bytes per ASI packet; set to either + enum_blue_dvb_asi_packet_size_188_bytes or + enum_blue_dvb_asi_packet_size_204_bytes */ + EPOCH_SUBFIELD_INPUT_INTERRUPTS=110, /* similar to the EPOCH_LOW_LATENCY_DMA card feature, but this doesn't influence the DMA; + it simply adds interrupts between the frame/field interrupts that trigger when a corresponding + video chunk has been captured + required minimum driver: 5.10.1.8*/ + EPOCH_AUDIOOUTPUT_METADATA_SETTINGS = 111, /* Use the EAudioMetaDataSettings enumerator to change the audio output metadata settings */ + EPOCH_HD_SDI_TRANSPORT = 112, /* output only: available modes are defined in the enum EHdSdiTransport; for inputs see EPOCH_HD_SDI_TRANSPORT_INPUT */ + CARD_FEATURE_STREAM_INFO = 113, /* only supported from driver 5.10.2.x; info on how many in/out SDI/ASI streams are supported */ + CARD_FEATURE_CONNECTOR_INFO = 114, /* only supported from driver 5.10.2.x; info on which connectors are supported: SDI in/out, AES, RS422, LTC, GPIO */ + EPOCH_HANC_INPUT_FLAGS = 115, /* this property can be queried to test flags being set in the HANC space (e.g. HANC_FLAGS_IS_ARRI_RECORD_FLAG_SET) */ + EPOCH_INPUT_VITC = 116, /* this property retrieves the current input VITC timecode; set .vt = VT_UI8 as this is a 64bit value; + only supported by SuperNova 2i/2o firmware version 75 and above */ + EPOCH_RAW_VIDEO_INPUT_TYPE = 117, /* specifies if the raw/bayer input is ARRI 10/12 bit or Weisscam; set to 0 to revert back to normal SDI mode */ + EPOCH_PCIE_CONFIG_INFO = 118, /* only supported from driver 5.10.2.x; provides info on PCIE maximum payload size and maximum read request siize */ + EPOCH_4K_QUADLINK_CHANNEL = 119, /* use this property to set the 4K quadrant number for the current channel in 4K output mode; quadrant numbers are 1 - 4 */ + EXTERNAL_LTC_SOURCE_SELECTION = 120, /* use the enum EBlueExternalLtcSource to set the input source for the external LTC */ + EPOCH_HD_SDI_TRANSPORT_INPUT = 121, /* can only be queried; return values are defined in the enum EHdSdiTransport. Input value is of type EBlueConnectorIdentifier */ + CARD_CONNECTED_VIA_TB = 122, /* MAC only: use this to check if the Card is connected via ThunderBolt */ + INTERLOCK_REFERENCE = 123, /* this feature is only supported on Epoch Neutron cards; check application note AN004_Genlock.pdf for more information */ + VIDEO_ONBOARD_KEYER = 124, /* this property is currently only supported by Epoch Neutron cards; use the VIDEO_ONBOARD_KEYER_GET_STATUS macros for this property*/ + EPOCH_OUTPUT_VITC_MANUAL_CONTROL = 125, /* Epoch Neutron only: this property enables the feature to allow output of a custom VITC timecode on a field by field basis (low frame rates only); for high frame rates the conventional way (using the HANC buffer) must be used */ + EPOCH_OUTPUT_VITC = 126, /* Epoch Neutron only: this property sets the custom VITC timecode (64 bit value) on a field by field basis (for low frame rates only); set .vt = VT_UI8 as this is a 64bit value; */ + EPOCH_INPUT_VITC_SOURCE = 127, /* this property selects the source for the card property EPOCH_INPUT_VITC for SD video modes; in SD video modes the VITC source can be either + from VBI space or from RP188 packets; the default (value = 0) is set to RP188; setting this to 1 will select VBI space as the source for EPOCH_INPUT_VITC; set .vt = VT_UI4 */ + TWO_SAMPLE_INTERLEAVE_OUTPUT = 128, /* enables two sample interleave mode for 4K video modes using two output channels; options are: 0 = turn feature off, 1 = turn feature on */ + TWO_SAMPLE_INTERLEAVE_INPUT = 129, /* enables two sample interleave mode for 4K video modes using two input channels; options are: 0 = turn feature off, 1 = turn feature on */ + BTC_TIMER = 130, /* BTC: Coordinated Bluefish Time; this timer has microsecond granularity and is started/reset when the driver starts; set .vt = VT_UI8 as this is a 64bit value; */ + BFLOCK_SIGNAL_ENABLE = 131, /* S+ cards can generate a proprietary lock signal on the S+ connector (connector 0); options are 0 = turn off signal (connector 0 will be copy of SDI A output); 1 = turn on lock signal output; set .vt = VT_UI4 */ + AES_OUTPUT_ROUTING = 132, /* set the stream source and source channels for the AES output; .vt = VT_UI4 */ + MUTE_AES_OUTPUT_CHANNEL = 133, /* mute any of the AES output channels (0..7); to enable/disable mute use the SET_MUTE_AES_OUTPUT_CHANNEL macro; to query an AES output channels mute status + set VT.ulVal to the AES output channel number (0..7) then call QueryCardProperty(); the return value will be 1 = muted or 0 = enabled; set .vt to VT_UI4 */ + FORCE_SD_VBI_OUTPUT_BUFFER_TO_V210 = 134, /* this card property forces the VBI buffer to V210 memory format in SD video modes (default for HD video modes) so that it can handle 10 bit VANC packets. + set 1 = force to V210 or 0 = follow video memory fomat (default); set .vt to VT_UI4; when changing this property the video output mode and video output engine need to be set again manually! */ + EMBEDDED_AUDIO_INPUT_INFO = 135, /* this card property returns info on how which embedded audio input channels are available (channel mask for channels 1 - 16 in lower 16 bits). + it also returns the data payload for each channel (1 - 16) in the upper 16 bits (0 = embedded audio, 1 = other (e.g. Dolby Digital)) */ + + VIDEO_CARDPROPERTY_INVALID = 1000 }EBlueCardProperty; +typedef enum _EHdSdiTransport +{ + HD_SDI_TRANSPORT_1_5G = 0x1, /* HD as 1.5G */ + HD_SDI_TRANSPORT_3G_LEVEL_A = 0x2, /* 3G Level A */ + HD_SDI_TRANSPORT_3G_LEVEL_B = 0x3, /* 3G Level B */ +}EHdSdiTransport; + +typedef enum _EAudioMetaDataSettings +{ + AUDIO_METADATA_KEEP_ALIVE = 0x1 /* When setting this bit for the EPOCH_AUDIOOUTPUT_METADATA_SETTINGS card property the audio meta data (like RP188 timecode + will still be played out even after stopping audio playback; this is a static settings and only needs to be set once; + it is channel based and can be changed for all output channels independently */ +}EAudioMetaDataSettings; typedef enum _EAnalogConnectorSignalType { @@ -1075,6 +1188,7 @@ typedef enum _MatrixColType #define GetCardBufferType(value) ((value & 0xF000) >> BLUE_CARD_BUFFER_TYPE_OFFSET) #define GetDMADataType(value) ((value & 0xF0000) >> BLUE_DMA_DATA_TYPE_OFFSET) #define GetDMAFlags(value) ((value & 0xF00000) >> (BLUE_DMA_FLAGS_OFFSET)) +#define GetEpochDMAFlags(value) ((value & 0xFF00000) >> (BLUE_DMA_FLAGS_OFFSET)) #define Blue_DMABuffer(CardBufferType,BufferId,DataType) ( (((ULONG)DataType&0xF)<<(ULONG)BLUE_DMA_DATA_TYPE_OFFSET)| \ @@ -1157,14 +1271,24 @@ typedef enum _EBlueVideoAuxInfoType }EBlueVideoAuxInfoType; // Max of 4 bits +//AUDIO_OUTPUT_PROP/AUDIO_CHANNEL_ROUTING #define GET_ANALOG_AUDIO_LEFT_ROUTINGCHANNEL(value) (value&0xFF) #define GET_ANALOG_AUDIO_RIGHT_ROUTINGCHANNEL(value) ((value&0xFF00)>>8) #define SET_ANALOG_AUDIO_ROUTINGCHANNEL(left,right) (((right & 0xFF)<<8)|(left & 0xFF)) -#define SET_AUDIO_OUTPUT_ROUTINGCHANNEL(output_type,src_channel_id,_output_channel_id) ((1<<31)|((output_type&3)<<29)|((src_channel_id & 0x7F)<<16)|((_output_channel_id &0x3f)<<23)) -#define GET_AUDIO_OUTPUT_SRC_CHANNEL_ROUTING(value) ((value>>16) & 0x7F) +#define SET_AUDIO_OUTPUT_ROUTINGCHANNEL(output_type,src_channel_id,_output_channel_id) ((1<<31)|((output_type&3)<<29)|((_output_channel_id &0x3F)<<23)|((src_channel_id & 0x3F)<<16)) +#define GET_AUDIO_OUTPUT_SRC_CHANNEL_ROUTING(value) ((value>>16) & 0x3F) #define GET_AUDIO_OUTPUT_CHANNEL_ROUTING(value) ((value>>23) & 0x3F) #define GET_AUDIO_OUTPUT_TYPE_ROUTING(value) ((value & 0x60000000)>>29) +//AES_OUTPUT_ROUTING +#define SET_AES_OUTPUT_ROUTING(OutputVideoChannel, AudioSrcChannel, AudioDstChannel) (((OutputVideoChannel & 0xFF) << 16) | ((AudioDstChannel & 0xFF) << 8) | (AudioSrcChannel & 0xFF)) +#define GET_AES_OUTPUT_ROUTING_STREAM(value) ((value >> 16) & 0xFF) +#define GET_AES_OUTPUT_ROUTING_DST_CHANNEL(value) ((value >> 8) & 0xFF) +#define GET_AES_OUTPUT_ROUTING_SRC_CHANNEL(value) (value & 0xFF) + +//MUTE_AES_OUTPUT_CHANNEL +#define SET_MUTE_AES_OUTPUT_CHANNEL(AudioDstChannel, Mute) (((Mute & 0x1) << 31) | AudioDstChannel & 0xFF) + #define AUDIO_INPUT_SOURCE_SELECT_FLAG (1<<16) #define AUDIO_INPUT_SOURCE_SELECT(SynchCount,AudioInputSource) (AUDIO_INPUT_SOURCE_SELECT_FLAG|(SynchCount)|(AudioInputSource<<17)) @@ -1179,15 +1303,25 @@ struct blue_video_connection_routing_struct #pragma pack(push, video_sync_struct, 1) typedef struct _blue_video_sync_struct { - BLUE_UINT32 sync_wait_type;// field or frame - BLUE_UINT32 video_channel; // which video channel interrupt should the interrupt wait for - BLUE_UINT32 timeout_video_msc; //if the current video msc is equal to this one insert it into the queue. - BLUE_UINT32 video_msc; //current video msc - BLUE_UINT32 current_display_frame_id; // would give you the current frame id which is being displayed - BLUE_UINT32 current_display_frame_uniqueid; // would give you the unique id associated with current frame id which is being displayed + BLUE_UINT32 sync_wait_type; // field or frame (UPD_FMT_FIELD or UPD_FMT_FRAME) + BLUE_UINT32 video_channel; // which video channel interrupt should the interrupt wait for, e.g. BLUE_VIDEO_INPUT_CHANNEL_A, BLUE_VIDEO_OUTPUT_CHANNEL_A, etc. + BLUE_UINT32 timeout_video_msc; // field count when to return or IGNORE_SYNC_WAIT_TIMEOUT_VALUE to return at next field/frame sync + BLUE_UINT32 video_msc; // current video msc (field count) + BLUE_UINT32 current_display_frame_id; // current buffer id which is being displayed + BLUE_UINT32 current_display_frame_uniqueid; // unique id associated with current buffer id which is being displayed // this is only valid when using fifo modes. - BLUE_UINT8 pad[24]; + BLUE_UINT16 subfield_interrupt; // subfield interrupt number; 0 == main frame sync + BLUE_UINT16 subfield_lines; // number of lines of video captured at this subfield interrupt + BLUE_UINT64 btcTimeStamp; // Coordinated Bluefish Time timestamp of field/frame which is currently being displayed + BLUE_UINT8 pad[12]; }blue_video_sync_struct; + +struct blue_external_ltc_input_sync_struct +{ + BLUE_UINT64 TimeCodeValue; + BLUE_UINT32 TimeCodeIsValid; + BLUE_UINT8 pad[20]; +}; #pragma pack(pop,video_sync_struct) @@ -1223,17 +1357,20 @@ struct blue_videoframe_info struct blue_videoframe_info_ex { - BLUE_UINT64 ltcTimeCode; //LTC timecode - unsigned long videochannel; //the channel this frame was captured from - long BufferId; //this buffer contains the captured frame - unsigned long Count; //total captured frames - unsigned long DroppedFrameCount; //dropped frame count - unsigned long nFrameTimeStamp; //field count the frame was captured at - unsigned long nVideoSignalType; //video mode of this frame - unsigned int nASIPktCount; //only for DVB-ASI; how many ASI packets are in this frame - unsigned int nASIPktSize; //only for DVB-ASI; how many bytes per packet - unsigned int nAudioValidityBits; //part of the channels status block for audio - unsigned char pad[20]; //not used + BLUE_UINT64 ltcTimeCode; //LTC timecode, not used + unsigned long videochannel; //the channel this frame was captured from + long BufferId; //this buffer contains the captured frame + unsigned long Count; //total captured frames + unsigned long DroppedFrameCount; //dropped frame count + unsigned long nFrameTimeStamp; //field count the frame was captured at + unsigned long nVideoSignalType; //video mode of this frame + unsigned int nASIPktCount; //only for DVB-ASI; how many ASI packets are in this frame + unsigned int nASIPktSize; //only for DVB-ASI; how many bytes per packet + unsigned int nAudioValidityBits; //part of the channels status block for audio + BLUE_UINT64 btcTimeStamp; //Coordinated Bluefish Time timestamp + unsigned char ucVideoModeLinkA; //only used in 1.5G dual link mode + unsigned char ucVideoModeLinkB; //only used in 1.5G dual link mode + unsigned char pad[10]; //not used }; struct blue_1d_lookup_table_struct @@ -1310,7 +1447,10 @@ struct blue_video_scaler_param_struct BLUE_UINT32 nVScaleFactor; BLUE_UINT32 nScalerOutputVideoMode; BLUE_UINT32 nScalerParamFlags; - BLUE_UINT32 pad[128]; + BLUE_UINT32 nScalerOutputRasterVideoMode; + BLUE_UINT32 nScalerOutputRasterHeight; + BLUE_UINT32 nScalerOutputRasterWidth; + BLUE_UINT32 pad[125]; }; #ifndef EXCLUDE_USERLAND_STRUCT struct blue_color_matrix_struct{ @@ -1327,17 +1467,18 @@ struct blue_color_matrix_struct{ typedef enum _blue_output_hanc_ioctl_enum { - blue_get_output_hanc_buffer=0, - blue_put_output_hanc_buffer=1, - blue_get_valid_silent_hanc_data_status=3, - blue_set_valid_silent_hanc_data_status=4, - blue_start_output_fifo=5, - blue_stop_output_fifo=6, - blue_init_output_fifo=7, - blue_get_queues_info=8, + blue_get_output_hanc_buffer = 0, + blue_put_output_hanc_buffer = 1, + blue_get_valid_silent_hanc_data_status = 3, + blue_set_valid_silent_hanc_data_status = 4, + blue_start_output_fifo = 5, + blue_stop_output_fifo = 6, + blue_init_output_fifo = 7, + blue_get_queues_info = 8, blue_get_output_fifo_info=blue_get_queues_info, - blue_get_output_fifo_status=9, - + blue_get_output_fifo_status = 9, + blue_start_output_fifo_no_auto_turn_off = 10 // this is used when we don't really use the FIFO, but handle audio playback ourselves in DirectShow; + // need to make sure that our HANC output FIFO doesn't turn off audio as there are never any HANC frames to be played }blue_output_hanc_ioctl_enum; typedef enum _blue_input_hanc_ioctl_enum @@ -1415,11 +1556,21 @@ typedef enum _EEpochRoutingElements EPOCH_SRC_SDI_INPUT_C, EPOCH_SRC_SDI_INPUT_D, + EPOCH_SRC_SDI_INPUT_A_3GB_LINK_A = EPOCH_SRC_SDI_INPUT_A, + EPOCH_SRC_SDI_INPUT_B_3GB_LINK_A = EPOCH_SRC_SDI_INPUT_B, + EPOCH_SRC_SDI_INPUT_C_3GB_LINK_A = EPOCH_SRC_SDI_INPUT_C, + EPOCH_SRC_SDI_INPUT_D_3GB_LINK_A = EPOCH_SRC_SDI_INPUT_D, + EPOCH_DEST_SDI_OUTPUT_A, EPOCH_DEST_SDI_OUTPUT_B, EPOCH_DEST_SDI_OUTPUT_C, EPOCH_DEST_SDI_OUTPUT_D, + EPOCH_DEST_SDI_OUTPUT_A_3GB_LINK_A = EPOCH_DEST_SDI_OUTPUT_A, + EPOCH_DEST_SDI_OUTPUT_B_3GB_LINK_A = EPOCH_DEST_SDI_OUTPUT_B, + EPOCH_DEST_SDI_OUTPUT_C_3GB_LINK_A = EPOCH_DEST_SDI_OUTPUT_C, + EPOCH_DEST_SDI_OUTPUT_D_3GB_LINK_A = EPOCH_DEST_SDI_OUTPUT_D, + EPOCH_SRC_OUTPUT_MEM_INTERFACE_CHA, EPOCH_SRC_OUTPUT_MEM_INTERFACE_CHB, @@ -1440,6 +1591,20 @@ typedef enum _EEpochRoutingElements EPOCH_SRC_OUTPUT_MEM_INTERFACE_CHC, EPOCH_SRC_OUTPUT_MEM_INTERFACE_CHD, + EPOCH_SRC_SDI_INPUT_A_3GB_LINK_B, + EPOCH_SRC_SDI_INPUT_B_3GB_LINK_B, + EPOCH_SRC_SDI_INPUT_C_3GB_LINK_B, + EPOCH_SRC_SDI_INPUT_D_3GB_LINK_B, + + EPOCH_DEST_SDI_OUTPUT_A_3GB_LINK_B, + EPOCH_DEST_SDI_OUTPUT_B_3GB_LINK_B, + EPOCH_DEST_SDI_OUTPUT_C_3GB_LINK_B, + EPOCH_DEST_SDI_OUTPUT_D_3GB_LINK_B, + + EPOCH_DEST_HDMI_OUTPUT, + EPOCH_DEST_HDMI_OUTPUT_LINK_A = EPOCH_DEST_HDMI_OUTPUT, + EPOCH_DEST_HDMI_OUTPUT_LINK_B, + }EEpochRoutingElements; @@ -1456,6 +1621,20 @@ typedef enum _EBlueScalerFilterType }EBlueScalerFilterType; +typedef enum _EBFLockSignalType +{ + BFLOCK_SIGNAL_UNKNOWN = 0x1000, + BFLOCK_SIGNAL_2398 = 0x1001, + BFLOCK_SIGNAL_2400 = 0x1002, + BFLOCK_SIGNAL_2500 = 0x1003, + BFLOCK_SIGNAL_2997 = 0x1004, + BFLOCK_SIGNAL_3000 = 0x1005, + BFLOCK_SIGNAL_4795 = 0x1006, + BFLOCK_SIGNAL_4800 = 0x1007, + BFLOCK_SIGNAL_5000 = 0x1008, + BFLOCK_SIGNAL_5994 = 0x1009, + BFLOCK_SIGNAL_6000 = 0x100A, +}EBFLockSignalType; #define SET_EPOCH_SCALER_MODE(scaler_id,video_mode) ((scaler_id <<16)|video_mode) #define GET_EPOCH_SCALER_MODE(value) (value&0xFFFF) @@ -1464,7 +1643,7 @@ typedef enum _EBlueScalerFilterType // use these macros for retreiving the temp and fan speed. // on epoch range of cards. -#define EPOCH_CORE_TEMP(value) (value & 0xFFFF) +#define EPOCH_CORE_TEMP(value) (value & 0xFF) #define EPOCH_BOARD_TEMP(value) ((value>>16) & 0xFF) #define EPOCH_FAN_SPEED(value) ((value>>24) & 0xFF) @@ -1530,6 +1709,12 @@ enum enum_blue_dvb_asi_packing_format enum_blue_dvb_asi_256byte_container_format_with_timestamp=4 }; +enum enum_blue_dvb_asi_packet_size +{ + enum_blue_dvb_asi_packet_size_188_bytes = 1, + enum_blue_dvb_asi_packet_size_204_bytes = 2 +}; + #define RS422_SERIALPORT_FLAG(timeout,port,RxFlushBuffer) (((unsigned long)(timeout)<<16)|(port & 0x3) | (RxFlushBuffer<<15)) // use this macro with Wait_For_SerialPort_InputData, @@ -1543,3 +1728,57 @@ typedef enum _blue_blackgenerator_status ENUM_BLACKGENERATOR_ON = 1, //producing black video output ENUM_BLACKGENERATOR_SDI_SYNC_OFF = 2 //no valid SDI signal is coming out of our SDI output connector; only available in Epoch ASI firmware }blue_blackgenerator_status; + +typedef enum _EBlueExternalLtcSource +{ + EXT_LTC_SRC_BREAKOUT_HEADER = 0, //default; header on the PCB board/Shield + EXT_LTC_SRC_GENLOCK_BNC = 1 //Genlock BNC connector +}EBlueExternalLtcSource; + +////the following macros are used with card property INTERLOCK_REFERENCE +#define INTERLOCK_REFERENCE_GET_OUTPUT_ENABLED(value) ((value) & 0x01) +#define INTERLOCK_REFERENCE_GET_INPUT_DETECTED(value) ((value >> 1) & 0x01) +#define INTERLOCK_REFERENCE_GET_SLAVE_POSITION(value) ((value >> 2) & 0x1F) + +//the following macros are used with card property CARD_FEATURE_STREAM_INFO +#define CARD_FEATURE_GET_SDI_OUTPUT_STREAM_COUNT(value) ((value) & 0xF) +#define CARD_FEATURE_GET_SDI_INPUT_STREAM_COUNT(value) ((value >> 4) & 0xF) +#define CARD_FEATURE_GET_ASI_OUTPUT_STREAM_COUNT(value) ((value >> 8) & 0xF) +#define CARD_FEATURE_GET_ASI_INPUT_STREAM_COUNT(value) ((value >> 12) & 0xF) +#define CARD_FEATURE_GET_3G_SUPPORT(value) ((value >> 13) & 0xF) + +//the following macros are used with card property CARD_FEATURE_CONNECTOR_INFO +#define CARD_FEATURE_GET_SDI_OUTPUT_CONNECTOR_COUNT(value) ((value) & 0xF) +#define CARD_FEATURE_GET_SDI_INPUT_CONNECTOR_COUNT(value) ((value >> 4) & 0xF) +#define CARD_FEATURE_GET_AES_CONNECTOR_SUPPORT(value) ((value >> 8) & 0x1) +#define CARD_FEATURE_GET_RS422_CONNECTOR_SUPPORT(value) ((value >> 9) & 0x1) +#define CARD_FEATURE_GET_LTC_CONNECTOR_SUPPORT(value) ((value >> 10) & 0x1) +#define CARD_FEATURE_GET_GPIO_CONNECTOR_SUPPORT(value) ((value >> 11) & 0x1) +#define CARD_FEATURE_GET_HDMI_CONNECTOR_SUPPORT(value) ((value >> 12) & 0x1) + +//the following macros are used with card property VIDEO_ONBOARD_KEYER +#define VIDEO_ONBOARD_KEYER_GET_STATUS_ENABLED(value) ((value) & 0x1) +#define VIDEO_ONBOARD_KEYER_GET_STATUS_OVER_BLACK(value) ((value) & 0x2) +#define VIDEO_ONBOARD_KEYER_GET_STATUS_USE_INPUT_ANCILLARY(value) ((value) & 0x4) +#define VIDEO_ONBOARD_KEYER_GET_STATUS_DATA_IS_PREMULTIPLIED(value) ((value) & 0x8) +#define VIDEO_ONBOARD_KEYER_SET_STATUS_ENABLED(value) (value |= 0x1) +#define VIDEO_ONBOARD_KEYER_SET_STATUS_DISABLED(value) (value &= ~(0x1)) +#define VIDEO_ONBOARD_KEYER_SET_STATUS_ENABLE_OVER_BLACK(value) (value |= 0x2) +#define VIDEO_ONBOARD_KEYER_SET_STATUS_DISABLE_OVER_BLACK(value) (value &= ~(0x2)) +#define VIDEO_ONBOARD_KEYER_SET_STATUS_USE_INPUT_ANCILLARY(value) (value |= 0x4) //only use this setting when keying over valid input (input must also match output video mode), includes HANC and VANC +#define VIDEO_ONBOARD_KEYER_SET_STATUS_USE_OUTPUT_ANCILLARY(value) (value &= ~(0x4)) +#define VIDEO_ONBOARD_KEYER_SET_STATUS_DATA_IS_PREMULTIPLIED(value) (value |= 0x8) +#define VIDEO_ONBOARD_KEYER_SET_STATUS_DATA_IS_NOT_PREMULTIPLIED(value) (value &= ~(0x8)) + +//the following macros are used with card property EPOCH_HANC_INPUT_FLAGS +#define HANC_FLAGS_IS_ARRI_RECORD_FLAG_SET(value) ((value) & 0x1) + +//the following macros are used with card property EPOCH_RAW_VIDEO_INPUT_TYPE +#define RAW_VIDEO_INPUT_TYPE_IS_10BIT (0x01) +#define RAW_VIDEO_INPUT_TYPE_IS_12BIT (0x02) +#define RAW_VIDEO_INPUT_TYPE_IS_WEISSCAM (0x10) +#define RAW_VIDEO_INPUT_TYPE_IS_ARRI (0x20) + +//the following macros are used with card property EPOCH_PCIE_CONFIG_INFO +#define PCIE_CONFIG_INFO_GET_MAX_PAYLOAD_SIZE(value) ((value) & 0xFFFF) +#define PCIE_CONFIG_INFO_GET_MAX_READREQUEST_SIZE(value) ((value >> 16) & 0xFFFF) diff --git a/dependencies64/bluefish/include/BlueHANC.h b/dependencies64/bluefish/include/BlueHANC.h deleted file mode 100644 index 63ea3d2cc..000000000 --- a/dependencies64/bluefish/include/BlueHANC.h +++ /dev/null @@ -1,372 +0,0 @@ -#pragma once -#include "BlueDriver_p.h" - -#ifdef _WINDOWS -#pragma pack(push,1) -#endif - -#define BLUE_HANC_INVALID_DID (0x0) - -#define BLUE_HANC_AUDIOGROUP1 (0x2FF) -#define BLUE_HANC_AUDIOGROUP2 (0x1FD) -#define BLUE_HANC_AUDIOGROUP3 (0x1FB) -#define BLUE_HANC_AUDIOGROUP4 (0x2F9) -#define BLUE_HANC_RP188 (0x260) -#define BLUE_HANC_AUDIOGROUP1_CONTROL (0x1EF) -#define BLUE_HANC_AUDIOGROUP2_CONTROL (0x2EE) -#define BLUE_HANC_AUDIOGROUP3_CONTROL (0x2ED) -#define BLUE_HANC_AUDIOGROUP4_CONTROL (0x1EC) -#define BLUE_HANC_AUDIOGROUP1_EXTENDED (0x1FE) -#define BLUE_HANC_AUDIOGROUP2_EXTENDED (0x2FC) -#define BLUE_HANC_AUDIOGROUP3_EXTENDED (0x2FA) -#define BLUE_HANC_AUDIOGROUP4_EXTENDED (0x1F8) - - -#define HANC_PACKET_HEADER_CONST (0xBFFFFC00) - -#define BLUE_HANC_START_NEWLINE(line_number) ((0xC0000000)| (line_number << 16)) - -#define BLUE_HANC_CONTROL_WORD (0xC0000000) -#define BLUE_HANC_3DATA_PACKET_WORD (0x80000000) -#define BLUE_HANC_2DATA_PACKET_WORD (0x40000000) -#define BLUE_HANC_1DATA_PACKET_WORD (0x00000000) -#define BLUE_HANC_ENDOF_FRAME() ((0xC0000000)| (1 << 15)) - - -#define AESAUDIO_DATA_BLOCKSIZE (192) -#define MAX_HANC_BUFFER_SIZE (65536) //256*256 -#define MAX_HANC_BUFFER_SIZE_WITHOUT_HEADER (65536 - 0x20/4) //32 bytes = 8 * 4 (8 * UINT32) -#define MAX_HANC_BUFFER_SIZE_BYTES (256*1024) -#define MAX_HANC_BUFFER_SIZE_WITHOUT_HEADER_BYTES (256*1024 - 0x20) -/* -HANC Packet header structure -Contains 2 type of structure , -which makes it easier to parse the data -*/ - -struct GenericV210_structure -{ -#if defined(__LITTLE_ENDIAN__) || defined(_WINDOWS) || defined(BLUE_LINUX_CODE) - BLUE_UINT32 first_word:10,second_word:10,third_word:10,unused:2; -#else - BLUE_UINT32 unused:2,third_word:10,second_word:10,first_word:10; -#endif -#ifndef _WINDOWS -}__attribute__((packed)); -#else -}; -#endif - -union GenericV210_union -{ - struct GenericV210_structure v210_struct; - BLUE_UINT32 v210_word; -}; - -/* HANC packet header*/ -struct HancPacketHeaderStruct -{ -#if defined(__LITTLE_ENDIAN__) || defined(_WINDOWS) || defined(BLUE_LINUX_CODE) - union GenericV210_union ancillary_data_flag; // 0x0,0x3FF,0x3FF, This is a constant defined by smpte - union GenericV210_union packet_info; // first 10 bit word --> Data ID - // Commonly used Data ID packet values are - // 1) 0x2FF --> Group1 Embedded Audio packet - // 2) 0x1FD --> Group2 Embedded Audio Packet - // 3) 0x1FB --> Group3 Embedded Audio Packet - // 4) 0x2F9 --> Group4 Embedded Audio packet - // second 10 bit word --> Data Block Number - // This is used for type 1 packets. - // third 10 bit word --> Data Count - // This 10 bit word specifies the amount of user data - // that this hanc will contain. -#else - union GenericV210_union packet_info; - union GenericV210_union ancillary_data_flag; -#endif -#ifndef _WINDOWS -}__attribute__((packed)); -#else -}; -#endif - - -/* Audio SubFrame Packet */ -struct BlueAudioSubFrameStruct -{ -#if defined(__LITTLE_ENDIAN__) || defined(_WINDOWS) || defined(BLUE_LINUX_CODE) - BLUE_UINT32 ZBit:1, //bit 0 set to declare start of channel status word - Channel:2, //bit 1-2 - AudioData_0_5:6, //bit 3-8 - NotBit8:1, //bit 9 - AudioData_6_14:9, //bit 10-18 - NotBit18:1, //bit 19 use same value as NotBit8 (bit 9) - AudioData_15_19:5, //bit 20-24 - AESSampleValidityBit:1, //bit 25 - AESUserBit:1, //bit 26 - AESAudioChannelStatusBit:1, //bit 27 one bit of the channel status word - ParityBit:1, //bit 28 xor of all bits except (NotBit8 (bit 9) and NotBit18 (bit 19)) - NotBit31:1, //bit 29 not of ParityBit (bit 28) - akiraControlBits:2; //bit 30-31 -#else - BLUE_UINT32 akiraControlBits:2, - NotBit31:1, - ParityBit:1, - AESAudioChannelStatusBit:1, - AESUserBit:1, - AESSampleValidityBit:1, - AudioData_15_19:5, - NotBit18:1, - AudioData_6_14:9, - NotBit8:1, - AudioData_0_5:6, - Channel:2, - ZBit:1; -#endif - -#ifndef _WINDOWS -}__attribute__((packed)); -#else -}; -#endif - -union BlueAudioSubFrameHeader -{ - struct BlueAudioSubFrameStruct audioSubFrame; - BLUE_UINT32 BlueAudioSubFrameWord; - struct GenericV210_structure audioSubFrame_v210; -}; - -#define MAX_AUDIO_SUBFRAMES_IN_A_LINE (64) // 4 samples per audio group and 4 channesl for each audio group per sample - - -/* -Time code structure that the function expects is the same format as LTC time code -bits 0 - 3 :units of frame -bits 4 - 7: binary group1 -bits 8 - 9: tens of frame -bits 10 -11: flags -bits 12 -15: binary group2 -bits 16-19 : units of seconds -bits 20-23 : binary group3 - -bits 24 - 26: tens of seconds -bit 27 : flag -bits 28 - 31: group binary4 -bits 32 -35: units of minutes - -bits 36 - 39 :binary5 -bits 40 - 42: tens of minutes -bit 43 : flag -bits 44 - 47: binary group6 - -bits 48 - 51: units of hours -bits 52 - 55: binary group7 -bits 56 - 57: tens of hours -bits 58 - 59: flag -bits 60 - 63: binary8 - -*/ -struct LTC_TimeCode -{ -#if defined(__LITTLE_ENDIAN__) || defined(_WINDOWS) || defined(BLUE_LINUX_CODE) - BLUE_UINT64 unit_frame:4,binary1:4,ten_frame:2,drop_frame_flag:1,color_frame_flag:1, - binary2:4,unit_second:4,binary3:4,ten_second:3,unsued_1:1,binary4:4, - unit_minute:4,binary5:4,ten_minute:3,unsued_2:1,binary6:4,unit_hours:4, - binary7:4,ten_hours:2,unsued_3:2,binary8:4; -#else - BLUE_UINT64 binary8:4,unsued_3:2,ten_hours:2,binary7:4, - unit_hours:4,binary6:4,unused_2:1,ten_minute:3,binary5:4,unit_minute:4, - binary4:4,unused_1:1,ten_second:3,binary3:4,unit_second:4,binary2:4, - color_frame_flag:1,drop_frame_flag:1,ten_frame:2,binary1:4,unit_frame:4; -#endif - -#ifndef _WINDOWS -}__attribute__((packed)); -#else -}; -#endif - -struct LTC_TimeCode_union -{ - union - { - struct LTC_TimeCode struct_ltc; - BLUE_UINT64 lt_64_value; - }; -}; - -/* - This is used to unpack the timecode word properly and quickly - in RP188 each 4 bits of the timecode is put into a 10 bit word. - So this structure helps in decoding -*/ -struct nibble_struct -{ - BLUE_UINT8 first_half:4,second_half:4; - -#ifndef _WINDOWS -}__attribute__((packed)); -#else -}; -#endif - -struct TimeCode -{ - union - { - struct LTC_TimeCode struct_ltc; - BLUE_UINT64 ltc; - struct nibble_struct ltc_char[8]; - }; - -#ifndef _WINDOWS -}__attribute__((packed)); -#else -}; -#endif - -struct HANCTimeCodeStruct -{ -#if defined(__LITTLE_ENDIAN__) || defined(_WINDOWS) || defined(BLUE_LINUX_CODE) - BLUE_UINT32 zero_0:3, - DBB_0:1, - ANC_0:4, - partiy_0:1, - NotBit8_0:1, - zero_1:3, - DBB_1:1, - ANC_1:4, - partiy_1:1, - NotBit8_1:1, - zero_2:3, - DBB_2:1, - ANC_2:4, - partiy_2:1, - NotBit8_2:1, - akiraControlBits:2; -#else - BLUE_UINT32 akiraControlBits:2, - Notbit8_2:1, - partiy_2:1, - ANC_2:4, - DBB_2:1, - zero_2:3, - NotBit81_1:1, - partiy_1:1, - ANC_1:4, - DBB_1:1, - zero_1:3, - NotBit8_0:1, - partiy_0:1, - ANC_0:4, - DBB_0:1, - zero_0:3; -#endif - -#ifndef _WINDOWS -}__attribute__((packed)); -#else -}; -#endif - -union HANCTimeCode -{ - struct HANCTimeCodeStruct hanc_struct; - BLUE_UINT32 hanc_word; -}; - -struct BAG2VancTimeCodeStruct -{ -#if defined(__LITTLE_ENDIAN__) || defined(_WINDOWS) || defined(BLUE_LINUX_CODE) - BLUE_UINT16 zero_0:3, - DBB_0:1, - ANC_0:4, - partiy_0:1, - NotBit8_0:1; -#else - BLUE_UINT16 NotBit8_0:1, - partiy_0:1, - ANC_0:4, - DBB_0:1, - zero_0:3; -#endif - -#ifndef _WINDOWS -}__attribute__((packed)); -#else -}; -#endif - -union BAG2VancTimeCode -{ - struct BAG2VancTimeCodeStruct vanc_struct; - BLUE_UINT16 vanc_word; -}; - - -inline BLUE_UINT64 convert_countto_timecode(BLUE_UINT32 frame_count,BLUE_UINT32 framePerSec) -{ - unsigned int frames ,second,minutes ,hour ; - struct TimeCode rp188_timcode; - hour = frame_count/(60*60*framePerSec); - minutes = frame_count%(60*60*framePerSec); - second = minutes%(60*framePerSec); - frames = second %framePerSec; - second = second/(framePerSec); - minutes=minutes/(60*framePerSec); - rp188_timcode.ltc = 0; - rp188_timcode.struct_ltc.unit_frame = (frames%10); - rp188_timcode.struct_ltc.ten_frame = (frames/10); - rp188_timcode.struct_ltc.unit_second = (second%10); - rp188_timcode.struct_ltc.ten_second = (second/10); - rp188_timcode.struct_ltc.unit_minute = (minutes%10); - rp188_timcode.struct_ltc.ten_minute = (minutes/10); - rp188_timcode.struct_ltc.unit_hours = (hour%10); - rp188_timcode.struct_ltc.ten_hours = (hour/10); - - return rp188_timcode.ltc; -} - - -inline BLUE_UINT64 convert_timecode_to_count(BLUE_UINT64 timecode, - BLUE_UINT32 framePerSec, - unsigned int & frames , - unsigned int & second, - unsigned int & minutes , - unsigned int & hours) -{ - - struct TimeCode rp188_timecode; - rp188_timecode.ltc = timecode; - hours = (BLUE_UINT32)((unsigned int)rp188_timecode.struct_ltc.ten_hours*10)+(unsigned int)rp188_timecode.struct_ltc.unit_hours; - minutes = (BLUE_UINT32)((unsigned int)rp188_timecode.struct_ltc.ten_minute*10)+(unsigned int)rp188_timecode.struct_ltc.unit_minute; - second = (BLUE_UINT32)((unsigned int)rp188_timecode.struct_ltc.ten_second*10)+(unsigned int)rp188_timecode.struct_ltc.unit_second; - frames = (BLUE_UINT32)((unsigned int)rp188_timecode.struct_ltc.ten_frame*10)+(unsigned int)rp188_timecode.struct_ltc.unit_frame; - return rp188_timecode.ltc; -} - -// Determine endianess at run-time -inline BLUE_UINT32 Int32SwapBigLittle(const BLUE_UINT32 i) -{ - unsigned char c1, c2, c3, c4; - const int endian = 1; - #define is_bigendian() ( (*(char*) & endian) == 0 ) - - if (is_bigendian()) - { - c1 = i & 255; - c2 = (i >> 8) & 255; - c3 = (i >> 16) & 255; - c4 = (i >> 24) & 255; - - return ((int)c1 << 24) + ((int)c2 << 16) + ((int)c3 << 8) + c4; - } - else - { - return i; - } -} - -#ifdef _WINDOWS -#pragma pack(pop) -#endif \ No newline at end of file diff --git a/dependencies64/bluefish/include/BlueTypes.h b/dependencies64/bluefish/include/BlueTypes.h deleted file mode 100644 index 961880847..000000000 --- a/dependencies64/bluefish/include/BlueTypes.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#define BERR int -#define BLUE_UINT32 unsigned int -#define BLUE_INT32 int -#define BLUE_UINT64 unsigned __int64 -#define BLUE_UINT8 unsigned char -#define BLUE_INT8 char -#define BLUE_UINT16 unsigned short diff --git a/dependencies64/bluefish/include/BlueVelvet.h b/dependencies64/bluefish/include/BlueVelvet.h deleted file mode 100644 index cecbdcae7..000000000 --- a/dependencies64/bluefish/include/BlueVelvet.h +++ /dev/null @@ -1,1340 +0,0 @@ -/* -// ========================================================================== -// Bluefish444 BlueVelvet SDK library -// -// BlueVelvet.h -// Public Header -// -// developed by : Cameron Duffy (C) 2002 Bluefish444 P/L -// -// derived from work begun by Vizrt Austria (C) 2001. -// -// ========================================================================== - - $Id: BlueVelvet.h,v 1.32.8.1 2011/08/04 03:34:36 tim Exp $ -*/ -#ifndef _BLUEVELVET_H -#define _BLUEVELVET_H - -#ifdef BLUEFISH_EXPORTS -#define BLUEFISH_API __declspec(dllexport) -#else -#define BLUEFISH_API __declspec(dllimport) -#endif - -//#include "BlueVelvet_c.h" - -#define BLUE_UINT32 unsigned int -#define BLUE_INT32 int -#define BLUE_UINT8 unsigned char -#define BLUE_INT8 char -#define BLUE_UINT16 unsigned short -#define BLUE_INT16 short -#define BLUE_UINT64 unsigned __int64 - - -#ifndef BLUEVELVET_2_DLL -#define BLUEVELVET_SDK_VERSION3 -#endif - -#include "BlueDriver_p.h" - - -//---------------------------------------------------------------------------- -// Some simple macros and definitions -#define BLUEVELVET_MAX_DEVICES (5) // Maximum number of Blue Cards recognised by driver - -typedef int BErr; - -#define BLUE_OK(a) (!a) // Test for succcess of a method returning BErr -#define BLUE_FAIL(a) (a) // Test for failure of a method returning BErr -#define BLUE_PASS(a) (a>=0) // Use this where +ve return values still indicate success - - -//---------------------------------------------------------------------------- -// The class definition -class BLUEFISH_API CBlueVelvet -{ -public: - // 4.1 Startup Functions - //--------------------------------- - // 4.1.1 device_enumerate - // Counts accessible blue cards in target system. - virtual - BErr device_enumerate( - int& Devices - ) = 0; - - // 4.1.2 device_attach - // Attach the class instance to the indexed device. - virtual - BErr device_attach( - int DeviceId, - int do_audio // DEPRECATED; SET TO 0 - ) = 0; - - // 4.1.3 device_detach - // Detach the current device from the class instance. - virtual - BErr device_detach( - void - ) = 0; - - // 4.1.4 device_attach_audio - // Attach the class instance to the audio I/O component of the current device. - // DEPRECATED; DO NOT USE! - virtual - BErr device_attach_audio( - void - ) = 0; - - // 4.1.5 device_detach_audio - // Remove audio I/O components of the current device from the class instance. - // DEPRECATED; DO NOT USE! - virtual - BErr device_detach_audio( - void - ) = 0; - - // 4.1.6 device_attach_audio_in - // Attach the class instance to the audio IINPUT component of the current device. - // DEPRECATED; DO NOT USE! - virtual - BErr device_attach_audio_in( - void - ) = 0; - - // 4.1.7 device_detach_audio_in - // Remove audio INPUT component of the current device from the class instance. - // DEPRECATED; DO NOT USE! - virtual - BErr device_detach_audio_in( - void - ) = 0; - - // 4.1.8 device_attach_audio_out - // Attach the class instance to the audio OUTPUT component of the current device. - // DEPRECATED; DO NOT USE! - virtual - BErr device_attach_audio_out( - void - ) = 0; - - // 4.1.9 device_detach_audio_out - // Remove audio OUTPUT component of the current device from the class instance. - // DEPRECATED; DO NOT USE! - virtual - BErr device_detach_audio_out( - void - ) = 0; - - // 4.1.10 device_get_bar - // Get device Bar assets from driver - virtual - BErr device_get_bar( - unsigned long BarN, - void** ppAddress, - unsigned long& Length - ) = 0; - - - - // 4.2 Feature Assessment Functions - //--------------------------------- - // 4.2.1 has_timing_adjust - virtual - int has_timing_adjust( - int DeviceId=0 - ) = 0; - - // 4.2.2 has_vertical_flip - virtual - int has_vertical_flip( - int DeviceId=0 - ) = 0; - - // 4.2.3 has_half_res - virtual - int has_half_res( - int DeviceId=0 - ) = 0; - - // 4.2.4 has_dissolve - virtual - int has_dissolve( - int DeviceId=0 - ) = 0; - - // 4.2.5 has_aperture - virtual - int has_aperture( - int DeviceId=0 - ) = 0; - - // 4.2.6 has_input_sdi - virtual - int has_input_sdi( - int DeviceId=0 - ) = 0; - - // 4.2.7 has_output_sdi - virtual - int has_output_sdi( - int DeviceId=0 - ) = 0; - - // 4.2.8 has_input_composite - virtual - int has_input_composite( - int DeviceId=0 - ) = 0; - - // 4.2.9 has_output_composite - virtual - int has_output_composite( - int DeviceId=0 - ) = 0; - - // 4.2.10 has_input_yuv - virtual - int has_input_yuv( - int DeviceId=0 - ) = 0; - - // 4.2.11 has_output_yuv - virtual - int has_output_yuv( - int DeviceId=0 - ) = 0; - - // 4.2.12 has_output_rgb - virtual - int has_output_rgb( - int DeviceId=0 - ) = 0; - - // 4.2.13 has_input_svideo - virtual - int has_input_svideo( - int DeviceId=0 - ) = 0; - - // 4.2.14 has_output_svideo - virtual - int has_output_svideo( - int DeviceId=0 - ) = 0; - - // 4.2.15 has_output_key - virtual - int has_output_key( - int DeviceId=0 - ) = 0; - - // 4.2.16 has_output_key_v4444 - virtual - int has_output_key_v4444( - int DeviceId=0 - ) = 0; - - // 4.2.17 has_letterbox - virtual - int has_letterbox( - int DeviceId=0 - ) = 0; - - // 4.2.18 has_video_memory - virtual - int has_video_memory( - int DeviceId=0 - ) = 0; - - // 4.2.18 has_video_memory_base - virtual - int has_video_memory_base( - int DeviceId=0 - ) = 0; - - // 4.2.19 has_video_cardtype - virtual - int has_video_cardtype( - int DeviceId=0 - ) = 0; - - // 4.2.20 count_video_mode - virtual - int count_video_mode( - int DeviceId=0 - ) = 0; - - // 4.2.21 enum_video_mode - virtual - EVideoMode enum_video_mode( - int Index, - int DeviceId=0 - ) = 0; - - // 4.2.22 count_memory_format - virtual - int count_memory_format( - int DeviceId=0 - ) = 0; - - // 4.2.23 enum_memory_format - virtual - EMemoryFormat enum_memory_format( - int Index, - int DeviceId=0 - ) = 0; - - // 4.2.24 count_update_method - virtual - int count_update_method ( - int DeviceId=0 - ) = 0; - - // 4.2.25 enum_update_method - virtual - EUpdateMethod enum_update_method( - int Index, - int DeviceId=0 - ) = 0; - - // 4.2.26 has_audio_input - virtual - int has_audio_input( - int DeviceId=0 - ) = 0; - - // 4.2.27 has_audio_output - virtual - int has_audio_output( - int DeviceId=0 - ) = 0; - - // 4.2.28 count_audio_input_rate - virtual - int count_audio_input_rate( - int DeviceId=0 - ) = 0; - - // 4.2.29 count_audio_output_rate - virtual - int count_audio_output_rate( - int DeviceId=0 - ) = 0; - - // 4.2.30 enum_audio_input_rate - // Returns the enumeration for the Ith supported audio input rate. - virtual - EAudioRate enum_audio_input_rate( - int Index, - int DeviceId=0 - ) = 0; - - // 4.2.31 enum_audio_output_rate - // Returns the enumeration for the Ith supported audio output rate. - virtual - EAudioRate enum_audio_output_rate( - int Index, - int DeviceId=0 - ) = 0; - - - // 4.2.32 has_audio_playthru - virtual - int has_audio_playthru( - int DeviceId=0 - ) = 0; - - // 4.2.33 has_dma_control - virtual - int has_dma_control( - int DeviceId=0 - ) = 0; - - // 4.2.34 has_scaled_rgb - virtual - int has_scaled_rgb( - int DeviceId=0 - ) = 0; - - // 4.3 Control Functions - //--------------------------------- - // 4.3.1 set_timing_adjust - // Determines the video format of a signal applied to the Link A input. - virtual - BErr set_timing_adjust( - unsigned int HPhase, - unsigned int VPhase - ) = 0; - - // 4.3.2 set_vertical_flip - virtual - BErr set_vertical_flip( - int& On - ) = 0; - - // 4.3.3 set_output_key - virtual - BErr set_output_key( - int& On, - int& v4444, - int& Invert, - int& White - ) = 0; - - // 4.3.4 set_output_key_on - virtual - BErr set_output_key_on( - int& On - ) = 0; - - // 4.3.5 set_output_key_v4444 - virtual - BErr set_output_key_v4444( - int& v4444 - ) = 0; - - // 4.3.6 set_output_key_invert - virtual - BErr set_output_key_invert( - int& Invert - ) = 0; - - // 4.3.7 set_output_key_white - virtual - BErr set_output_key_white( - int& White - ) = 0; - - // 4.3.8 set_letterbox - virtual - BErr set_letterbox( - unsigned int& Lines, - int& Black - ) = 0; - - // 4.3.9 set_letterbox_lines - virtual - BErr set_letterbox_lines( - unsigned int& Lines - ) = 0; - - // 4.3.10 set_letterbox_black - virtual - BErr set_letterbox_black( - int& Black - ) = 0; - - // 4.3.11 set_safearea - virtual - BErr set_safearea( - int& Title, - int& Picture - ) = 0; - - // 4.3.12 set_safearea_title - virtual - BErr set_safearea_title( - int& Title - ) = 0; - - // 4.3.13 set_safearea_picture - virtual - BErr set_safearea_picture( - int& Picture - ) = 0; - - // 4.3.14 set_output_video - virtual - BErr set_output_video( - int& Enable - ) = 0; - - // 4.3.15 set_audio_rate - virtual - BErr set_audio_rate( - unsigned long& Rate - ) = 0; - - // 4.3.16 set_audio_playthrough - virtual - BErr set_audio_playthrough( - int& Playthru - ) = 0; - - // 4.3.17 wait_output_video_synch - virtual - BErr wait_output_video_synch( - unsigned long UpdFmt, - unsigned long& FieldCount - ) = 0; - - // 4.3.18 get_output_video_synch_count - virtual - BErr get_output_video_synch_count( - unsigned long& FieldCount - ) = 0; - - // 4.3.19 set_scaled_rgb - virtual - BErr set_scaled_rgb( - unsigned long& On - ) = 0; - - // 4.3.20 wait_pci_interrupt - virtual - BErr wait_pci_interrupt( - unsigned long Wait - ) = 0; - - // 4.3.21 get_audio_rate - virtual - BErr get_audio_rate( - unsigned long& Rate - ) = 0; - - // 4.3.22 wait_input_video_synch - virtual - BErr wait_input_video_synch( - unsigned long UpdFmt, - unsigned long& FieldCount - ) = 0; - - // 4.3.23 get_input_video_synch_count - virtual - BErr get_input_video_synch_count( - unsigned long& FieldCount - ) = 0; - - - // 4.4 Video STYLE Functions - //--------------------------------- - // 4.4.1 get_video_input_format - // Determines the video format of a signal applied to the Link A input. - virtual - BErr get_video_input_format( - unsigned long& VidFmt - ) = 0; - - // 4.4.2 get_video_genlock_format - // Determines the video format of a signal applied to the GENLOCK input. - virtual - BErr get_video_genlock_format( - unsigned long& VidFmt - ) = 0; - - // 4.4.3 get_video_output_format - // Determines the video format of the output signal. - virtual - BErr get_video_output_format( - unsigned long& VidFmt - ) = 0; - - // 4.4.4 set_video_output_format - // Changes the output signal video format of Link A output. - virtual - BErr set_video_output_format( - unsigned long& VidFmt - ) = 0; - - // 4.4.5 get_video_memory_format - // Determines the pixel format for blue card video buffers. - virtual - BErr get_video_memory_format( - unsigned long& MemFmt - ) = 0; - - // 4.4.6 set_video_memory_format - // Changes the pixel format for blue card video buffers. - virtual - BErr set_video_memory_format( - unsigned long& MemFmt - ) = 0; - - // 4.4.7 get_video_update_format - // Determines the update synchronisation style of the video buffers. - virtual - BErr get_video_update_format( - unsigned long& UpdFmt - ) = 0; - - // 4.4.8 set_video_update_format - // Changes the video synchronisation method. - virtual - BErr set_video_update_format( - unsigned long& UpdFmt - ) = 0; - // 4.4.9 get_video_zoom_format - // Determines the video resolution style of the video buffers. - virtual - BErr get_video_zoom_format( - unsigned long& ResFmt - ) = 0; - - // 4.4.10 set_video_zoom_format - // Changes the video resolution style of the video buffers. - virtual - BErr set_video_zoom_format( - unsigned long& ResFmt - ) = 0; - // 4.4.11 get_video_framestore_style - // Determines the video mode, memory format and update synchronisation - // styles of the blue card video buffers. - virtual - BErr get_video_framestore_style( - unsigned long& VidFmt, - unsigned long& MemFmt, - unsigned long& UpdFmt, - unsigned long& ResFmt - ) = 0; - - // 4.4.12 set_video_framestore_style - // Changes the video mode, memory format and update synchronisation styles. - virtual - BErr set_video_framestore_style( - unsigned long& VidFmt, - unsigned long& MemFmt, - unsigned long& UpdFmt, - unsigned long& ResFmt - ) = 0; - - // 4.4.13 get_video_engine - // Instruct the device driver to change the operational mode of the - // video engine. - virtual - BErr get_video_engine( - unsigned long& Mode - ) = 0; - - // 4.4.14 set_video_engine - // Instruct the device driver to change the operational mode of the - // video engine. - virtual - BErr set_video_engine( - unsigned long& Mode - ) = 0; - - - // 4.5 DMA Memory Functions - //--------------------------------- - // 4.5.1 system_buffer_map - // Obtains the virtual address of one of the driver managed system buffers. - virtual - BErr system_buffer_map( - void** ppAddress, - int BufferId - ) = 0; - - // 4.5.2 system_buffer_unmap - // Unmaps the virtual address of one of the driver managed system buffers - // from the process address space. - virtual - BErr system_buffer_unmap( - void* pAddress - ) = 0; - - // 4.5.3 system_buffer_assign - // Assign an arbitrary usermode buffer to a particular DMA function. - virtual - BErr system_buffer_assign( - void* pAddress, - unsigned long Id, - unsigned long Length, - unsigned long Target - ) = 0; - - // 4.5.4 system_buffer_write - // Instructs the DMA engine to begin a DMA write operation to the - // active blue card host buffer. - // DEPRECATED; DO NOT USE! USE system_buffer_write_async() instead - virtual - int system_buffer_write( - unsigned char* pPixels, - unsigned long Size, - unsigned long Offset=0 - ) = 0; - - // 4.5.5 system_buffer_read - // Instructs the DMA engine to begin a DMA read operation from the - // active blue card host buffer. - // DEPRECATED; DO NOT USE! USE system_buffer_read_async() instead - virtual - int system_buffer_read( - unsigned char* pPixels, - unsigned long Size, - unsigned long Offset=0 - ) = 0; - - virtual - int system_buffer_write_async( - unsigned char* pPixels, - unsigned long Size, - OVERLAPPED * pAsync, - unsigned long BufferID, - unsigned long Offset=0 - ) = 0; - - // 4.5.5 system_buffer_read - // Instructs the DMA engine to begin a DMA read operation from the - // active blue card host buffer. - virtual - int system_buffer_read_async( - unsigned char* pPixels, - unsigned long Size, - OVERLAPPED * pAsync, - unsigned long BufferID, - unsigned long Offset=0 - ) = 0; - - - // 4.6 Framestore Functions - //--------------------------------- - // 4.6.1 render_buffer_count - // Determines the number of buffers the blue card memory has been partitioned into. - virtual - BErr render_buffer_count( - unsigned long& Count - ) = 0; - - // 4.6.2 render_buffer_update - // Instructs the video digitiser to select a blue card buffer to rasterise. - virtual - BErr render_buffer_update( - unsigned long BufferId - ) = 0; - - // 4.6.3 render_buffer_update_b - // Instructs the video digitiser to select a blue card buffer as the video - // channel B source for real-time dissolves. - virtual - BErr render_buffer_update_b( - unsigned long BufferId - ) = 0; - - // 4.6.4 render_buffer_dissolve - // Set the percentage of Channel A over Channel B for real-time dissolve. - virtual - BErr render_buffer_dissolve( - unsigned long Dissolve - ) = 0; - - // 4.6.5 render_buffer_dissolve_a_b - // Set the video source for Channel A and Channel B and the dissolve - // percentage between them. - virtual - BErr render_buffer_dissolve_a_b( - unsigned long BufferId_A, - unsigned long BufferId_B, - unsigned long Dissolve - ) = 0; - - // 4.6.6 render_buffer_map - // Get the virtual address of the indexed blue card buffer. - virtual - BErr render_buffer_map( - void** pAddress, - unsigned long BufferId - ) = 0; - - // 4.6.7 render_buffer_map_aperture - // Get the virtual address of the 8-bit aperture for the indexed blue card buffer. - virtual - BErr render_buffer_map_aperture( - void** pAddress, - unsigned long BufferId - ) = 0; - - // 4.6.8 render_buffer_map_all - // Generates a table of the virtual addresses for all blue card buffers. - virtual - BErr render_buffer_map_all( - void** pTable, - unsigned long& Count - ) = 0; - - - // 4.6.9 render_buffer_map_aperture_all - // Generates a table of the virtual addresses for the 8-bit aperture - // of all blue card buffers. - virtual - BErr render_buffer_map_aperture_all( - void** pTable, - unsigned long& Count - ) = 0; - - // 4.6.10 render_buffer_select - // Specify which blue card buffer will become the target of future DMA transactions. - virtual - BErr render_buffer_select( - unsigned long BufferId - ) = 0; - - // 4.6.11 render_buffer_capture - // Specify which blue card buffer will be used for capture. - virtual - BErr render_buffer_capture( - unsigned long BufferId, - int On - ) = 0; - - // 4.6.12 render_buffer_sizeof - // Determine the maximum byte size of each blue card memory partition. - virtual - BErr render_buffer_sizeof( - unsigned long& Count, - unsigned long& Length, - unsigned long& Actual, - unsigned long& Golden - ) = 0; - - // 4.6.13 render_buffer_quantise - // Control whether blue card memory is repartitioned on style changes. - virtual - BErr render_buffer_quantise( - int On - ) = 0; - - // 4.7 Audio Functions - //--------------------------------- - // 4.7.1 audio_playback_start - // Start audio playback. - // DEPRECATED; DO NOT USE! - virtual - BErr audio_playback_start( - unsigned long Synch - ) = 0; - - // 4.7.2 audio_playback_stop - // Stop audio playback. - // DEPRECATED; DO NOT USE! - virtual - BErr audio_playback_stop( - void - ) = 0; - - // 4.7.3 audio_playback_stream - // Register a native interleaved audio file for playback. - // DEPRECATED; DO NOT USE! - virtual - BErr audio_playback_stream( - char* pName, - int Offset, - int Flags - ) = 0; - - // 4.7.4 audio_playback_stream_mono - // Register a native monophonic audio file for playback. - // DEPRECATED; DO NOT USE! - virtual - BErr audio_playback_stream_mono( - unsigned long Chan, - char* pName, - int Offset, - int Flags - ) = 0; - - // 4.7.5 audio_playback_stream_stereo - // Register a native stereophonic audio file for playback. - // DEPRECATED; DO NOT USE! - virtual - BErr audio_playback_stream_stereo( - unsigned long Pair, - char* pName, - int Offset, - int Flags - ) = 0; - - // 4.7.6 audio_playback_buffer - // Register a native 6-channel interleaved audio buffer for playback. - // DEPRECATED; DO NOT USE! - virtual - BErr audio_playback_buffer( - void* pGlobal, - unsigned long* pBuffer, - unsigned long Length, - unsigned long Chunk, - int (*pFunc)(void* pGlobal, unsigned long* pBuffer, int Offset, int Length), - int Flags - ) = 0; - - // 4.7.7 audio_playback_buffer_mono - // Register a native monophonic audio buffer for playback. - // DEPRECATED; DO NOT USE! - virtual - BErr audio_playback_buffer_mono( - unsigned long Chan, - void* pGlobal, - unsigned long* pBuffer, - unsigned long Length, - unsigned long Chunk, - int (*pFunc)(void* pGlobal, unsigned long* pBuffer, int Offset, int Length), - int Flags - ) = 0; - - // 4.7.8 audio_playback_buffer_stereo - // Register a native stereophonic audio buffer for playback. - // DEPRECATED; DO NOT USE! - virtual - BErr audio_playback_buffer_stereo( - unsigned long Pair, - void* pGlobal, - unsigned long* pBuffer, - unsigned long Length, - unsigned long Chunk, - int (*pFunc)(void* pGlobal, unsigned long* pBuffer, int Offset, int Length), - int Flags - ) = 0; - - // 4.7.9 audio_playback_deregister - // De-registers a native 6-channel interleaved audio source from playback. - // DEPRECATED; DO NOT USE! - virtual - BErr audio_playback_deregister( - void - ) = 0; - - // 4.7.10 audio_playback_deregister_mono - // De-registers a native monophonic audio source from playback. - // DEPRECATED; DO NOT USE! - virtual - BErr audio_playback_deregister_mono( - unsigned long Chan - ) = 0; - - // 4.7.11 audio_playback_deregister_stereo - // De-registers a native stereophonic audio source from playback. - // DEPRECATED; DO NOT USE! - virtual - BErr audio_playback_deregister_stereo( - unsigned long Pair - ) = 0; - - // 4.7.12 AudioHandlerPlay - // Moves source audio data streams into the playback buffer. - // DEPRECATED; DO NOT USE! - virtual - BErr AudioHandlerPlay( - unsigned long& Snooze - ) = 0; - - // 4.7.13 audio_capture_start - // Begin capturing audio. - virtual - BErr audio_capture_start( - unsigned long Synch, - unsigned long PlayThru - ) = 0; - - // 4.7.14 audio_capture_stop - // Stop capturing audio. - virtual - BErr audio_capture_stop( - void - ) = 0; - // 4.7.15 audio_capture_stream - // Register a file for capture of native interleaved audio. - // DEPRECATED; DO NOT USE! - virtual - BErr audio_capture_stream ( - char* pName, - int Offset, - int Flags - ) = 0; - - // 4.7.16 audio_capture_stream_mono - // Register a file for capture of native monophonic audio. - // DEPRECATED; DO NOT USE! - virtual - BErr audio_capture_stream_mono( - unsigned long Chan, - char* pName, - int Offset, - int Flags - ) = 0; - - // 4.7.17 audio_capture_stream_stereo - // Register a file for capture of native stereophonic audio. - // DEPRECATED; DO NOT USE! - virtual - BErr audio_capture_stream_stereo( - unsigned long Pair, - char* pName, - int Offset, - int Flags - ) = 0; - - // 4.7.18 audio_capture_buffer - // Register a buffer for capture of native interleaved audio. - // DEPRECATED; DO NOT USE! - virtual - BErr audio_capture_buffer( - void* pGlobal, - unsigned long* pBuffer, - unsigned long Length, - unsigned long Chunk, - int (*pFunc)(void* pGlobal, unsigned long* pBuffer, int Offset, int Length), - int Flags - ) = 0; - - // 4.7.19 audio_capture_buffer_mono - // Register a buffer for capture of native monophonic audio. - // DEPRECATED; DO NOT USE! - virtual - BErr audio_capture_buffer_mono( - unsigned long Chan, - void* pGlobal, - unsigned long* pBuffer, - unsigned long Length, - unsigned long Chunk, - int (*pFunc)(void* pGlobal, unsigned long* pBuffer, int Offset, int Length), - int Flags - ) = 0; - - // 4.7.20 audio_capture_buffer_stereo - // Register a buffer for capture of native stereophonic audio. - // DEPRECATED; DO NOT USE! - virtual - BErr audio_capture_buffer_stereo( - unsigned long Pair, - void* pGlobal, - unsigned long* pBuffer, - unsigned long Length, - unsigned long Chunk, - int (*pFunc)(void* pGlobal, unsigned long* pBuffer, int Offset, int Length), - int Flags - ) = 0; - - // 4.7.21 audio_capture_deregister - // De-registers a buffer from capture monitor thread. - // DEPRECATED; DO NOT USE! - virtual - BErr audio_capture_deregister( - void - ) = 0; - - // 4.7.22 audio_capture_deregister_mono - // De-registers a single monophonic audio buffer from capture monitor thread. - // DEPRECATED; DO NOT USE! - virtual - BErr audio_capture_deregister_mono( - unsigned long Chan - ) = 0; - - // 4.7.23 audio_capture_deregister_stereo - // De-registers a stereophonic audio buffer from capture monitor thread. - // DEPRECATED; DO NOT USE! - virtual - BErr audio_capture_deregister_stereo( - unsigned long Pair - ) = 0; - - - // 4.7.24 audio_playback_threshold - // Adjust the Chunk and Snooze times for the Audio Playback Monitor Thread - // DEPRECATED; DO NOT USE! - virtual - BErr audio_playback_threshold( - unsigned long Chunk, - unsigned long Snooze - ) = 0; - - // 4.7.25 audio_capture_sample_count - // Number of samples captured. - // DEPRECATED; DO NOT USE! - virtual - ULONG audio_capture_sample_count() = 0; - - // 4.7.26 audio_capture_sample_count_mono - // Number of samples captured. - // DEPRECATED; DO NOT USE! - virtual - ULONG audio_capture_sample_count_mono(unsigned long Chan) = 0; - - // 4.7.27 audio_capture_sample_count_stereo - // Number of samples captured. - // DEPRECATED; DO NOT USE! - virtual - ULONG audio_capture_sample_count_stereo(unsigned long Pair) = 0; - - // 4.7.28 audio_playback_blip - // Channel is to be blipped - // DEPRECATED; DO NOT USE! - virtual - BErr audio_playback_blip( - int Channel - ) = 0; - - // 4.8 Video Engine Functions - //--------------------------------- - // 4.8.1 video_playback_start - // Start video playback. - virtual - BErr video_playback_start( - int Step, - int Loop - ) = 0; - - // 4.8.2 video_playback_stop - // Halts the video playback engine. - virtual - BErr video_playback_stop( - int Wait, - int Flush - ) = 0; - - // 4.8.3 video_playback_flush - // Flush all pending display requests from all Channels. - virtual - BErr video_playback_flush( - void - ) = 0; - - // 4.8.4 video_playback_flush_A - // Flush all pending display requests from Channel A. - // DEPRECATED; DO NOT USE! - virtual - BErr video_playback_flush_A( - void - ) = 0; - - // 4.8.5 video_playback_flush_B - // Flush all pending display requests from Channel-B. - // DEPRECATED; DO NOT USE! - virtual - BErr video_playback_flush_B( - void - ) = 0; - - // 4.8.6 video_playback_allocate - // Obtain the address of the next available video memory buffer. - virtual - BErr video_playback_allocate( - void** pAddress, - unsigned long& BufferId, - unsigned long& Underrun - ) = 0; - - // 4.8.7 video_playback_release - // Release physical blue card video buffer. - virtual - BErr video_playback_release( - unsigned long BufferId - ) = 0; - - // 4.8.8 video_playback_flush_display - // Remove a unique display request from the display lists. - virtual - BErr video_playback_flush_display( - unsigned long UniqueId - ) = 0; - - // 4.8.9 video_playback_release_flush - // Purges all pending display requests and returns the frame to the free list. - virtual - BErr video_playback_release_flush( - unsigned long BufferId - ) = 0; - - // 4.8.10 video_playback_present - // Present a buffer to the video playback engine Channel-A. - virtual - BErr video_playback_present( - unsigned long& UniqueId, - unsigned long BufferId, - unsigned long Count, - int Keep, - int Odd=0 - ) = 0; - - // 4.8.11 video_playback_present_dissolve - // Present a frame with a dissolve value to the video playback engine. - virtual - BErr video_playback_present_dissolve( - unsigned long& UniqueId, - unsigned long BufferId, - unsigned long Count, - unsigned long Dissolve, - int Keep, - int Odd=0 - ) = 0; - - // 4.8.12 video_playback_present_A - // Present a frame to the video playback engine that will be inserted into Channel-A. - // DEPRECATED; DO NOT USE! - virtual - BErr video_playback_present_A( - unsigned long& UniqueId, - unsigned long BufferId, - unsigned long Count, - unsigned long Dissolve, - int Synch_B, - int Keep, - int Odd=0 - ) = 0; - - // 4.8.13 video_playabck_present_B - // Present a frame to the video playback engine that will be inserted into Channel-B. - // DEPRECATED; DO NOT USE! - virtual - BErr video_playback_present_B( - unsigned long& UniqueId, - unsigned long BufferId, - unsigned long Count, - unsigned long Dissolve, - int Synch_A, - int Keep, - int Odd=0 - ) = 0; - - // 4.8.14 video_playback_present_detail - // The general purpose presentation function. - // DEPRECATED; DO NOT USE! - virtual - BErr video_playback_present_detail( - unsigned long& UniqueId, - unsigned long BufferId, - unsigned long Count, - unsigned long Dissolve, - unsigned long Flags - ) = 0; - - // 4.8.15 video_capture_start - // Instruct the device driver to begin capturing images into the video framestore. - virtual - BErr video_capture_start( - int Step=0 - ) = 0; - - // 4.8.16 video_capture_stop - // Instruct the device driver to stop the video capture. - virtual - BErr video_capture_stop( - void - ) = 0; - - // 4.8.17 video_capture_harvest - // Get the details about the next frame in a capture sequence. - virtual - BErr video_capture_harvest( - void** ppAddress, - unsigned long& BufferId, - unsigned long& Count, - unsigned long& Frames, - int CompostLater=0 - ) = 0; - - // not used for anything important... - // DEPRECATED; DO NOT USE! - virtual - BErr nudge_frame(LONG nudge) = 0; - - // 4.8.18 video_playback_pause - // Suspend or Resume playback - virtual - BErr video_playback_pause( - int Suspend - ) = 0; - - // 4.8.19 video_capture_compost - // Return a harvested frame for recycling - virtual - BErr video_capture_compost( - unsigned long BufferId - ) = 0; - -#ifdef BLUEVELVET_SDK_VERSION3 - virtual BErr set_onboard_keyer(int & On)=0; - virtual BErr get_onboard_keyer_status(int &On)=0; - virtual BErr get_timing_adjust(unsigned int & HPhase,unsigned int & VPhase,unsigned int & MaxHPhase,unsigned int & MaxVPhase) = 0; - virtual BErr get_letterbox_values(unsigned int& Lines,int & bBlackEnableFlag)=0; - virtual BErr get_safearea_info(int& Title,int& Picture)=0; - virtual int has_downconverter_bnc(int deviceId)=0; - virtual int has_onboard_keyer(int deviceId)=0; - virtual int has_duallink_input(int deviceId)=0; - virtual int has_programmable_colorspace_matrix(int deviceId)=0; - - virtual BErr SetMatrix_Col_Green_Y(double CoeffG_R,double CoeffG_G,double CoeffG_B,double constG)=0; - virtual BErr GetMatrix_Col_Green_Y(double & CoeffG_R,double & CoeffG_G,double & CoeffG_B,double & constG)=0; - - virtual BErr SetMatrix_Col_Red_PR(double CoeffR_R,double CoeffR_G,double CoeffR_B,double constR)=0; - virtual BErr GetMatrix_Col_Red_PR(double & CoeffR_R,double & CoeffR_G,double & CoeffR_B,double & constR)=0; - - virtual BErr SetMatrix_Col_Blue_PB(double CoeffB_R,double CoeffB_G,double CoeffB_B,double constB)=0; - virtual BErr GetMatrix_Col_Blue_PB(double & CoeffB_R,double & CoeffB_G,double & CoeffB_B,double & constB)=0; - - virtual BErr SetDualLink_Output_Conn_SignalColorSpace(unsigned long & signalType,unsigned long updateMatrixFlag)=0; - virtual BErr SetDualLink_Input(unsigned long & EnableDualLink)=0; - virtual BErr SetDualLink_Input_SignalFormatType(unsigned long &v4444)=0; - virtual BErr GetDualLink_InputProperty(unsigned long & DualLink,unsigned long & connSignalColorSpace,unsigned long & v4444)=0; - virtual BErr GetDualLink_OutputProperty(unsigned long & DualLink,unsigned long & connSignalColorSpace,unsigned long & v4444)=0; - - virtual BErr Set_DownConverterSignalType(unsigned long type)=0; - virtual BErr GetDownConverterSignalType(unsigned long & connSignalType)=0; - - virtual BErr SetDualLink_Input_Conn_SignalColorSpace(unsigned long & signalType)=0; - virtual int GetHDCardType(int nDeviceId)=0; - - // New Audio Interface - virtual BErr MaxAudioOutBufferSize(long & nSampleCount)=0; - virtual BErr GetAudioOutBufferFreeSpace(long & nSampleCount)=0; - virtual BErr wait_audio_output_interrupt(unsigned long & noQueuedSample,unsigned long & noFreeSample) = 0; - virtual BErr InitAudioPlaybackMode()=0; - virtual BErr StartAudioPlayback(int syncCount)=0; - virtual BErr StopAudioPlayback()=0; - virtual BErr WriteAudioSample(int nSampleType,void * pBuffer,long nNoSample,int bFlag,long nNoSamplesWritten)=0; - virtual BErr EndAudioPlaybackMode()=0; - virtual int GetPCIRevId()=0; -#endif - - // Need this so that derived destructor gets called - virtual ~CBlueVelvet(){} - HANDLE m_hDevice; // Handle to the blue card device driver -}; - - -//------------------------------------------------------------------------------------------------------------ -extern "C" { -//------------------------------------------------------------------------------------------------------------ -// 4.0.0 The Blue Velvet factory -BLUEFISH_API CBlueVelvet* BlueVelvetFactory(); - - -// 4.0.1 Who am I -BLUEFISH_API const char* BlueVelvetVersion(); - -// 4.0.2 Golden Value calculation -BLUEFISH_API unsigned long BlueVelvetGolden( - unsigned long VidFmt, - unsigned long MemFmt, - unsigned long UpdFmt - ); -// 4.0.3 Bytes Per Line calculation -BLUEFISH_API unsigned long BlueVelvetLineBytes( - unsigned long VidFmt, - unsigned long MemFmt - ); -// 4.0.4 Bytes Per Frame calculation -BLUEFISH_API unsigned long BlueVelvetFrameBytes( - unsigned long VidFmt, - unsigned long MemFmt, - unsigned long UpdFmt - ); - -// 4.0.5 Lines Per Frame calculation -BLUEFISH_API unsigned long BlueVelvetFrameLines( - unsigned long VidFmt, - unsigned long UpdFmt - ); - -// 4.0.6 Pixels per Line calculation -BLUEFISH_API unsigned long BlueVelvetLinePixels( - unsigned long VidFmt - ); - -BLUEFISH_API unsigned long BlueVelvetVBILines(unsigned long VidFmt,unsigned long FrameType); - -} - -#endif //_BLUEVELVET_H diff --git a/dependencies64/bluefish/include/BlueVelvet4.h b/dependencies64/bluefish/include/BlueVelvet4.h deleted file mode 100644 index e4fa4b751..000000000 --- a/dependencies64/bluefish/include/BlueVelvet4.h +++ /dev/null @@ -1,146 +0,0 @@ -#ifndef _BLUEVELVET4_H -#define _BLUEVELVET4_H - -#include "BlueVelvet.h" -#include "BlueC_Api.h" -typedef struct -{ - VARIANT maxRange; - VARIANT minRange; - VARIANT currentValue; - unsigned long uniqueSteps; -}AnalogPropertyValue; - - -class BLUEFISH_API CBlueVelvet4: virtual public CBlueVelvet -{ -public: - // Functions for new Analog Card Property - virtual BErr SetAnalogCardProperty(int propType,VARIANT & propValue)=0; - virtual BErr GetAnalogCardProperty(int propType,AnalogPropertyValue & propValue)=0; - virtual BErr GetAnalogCardProperty(int propType,VARIANT & propValue)=0; - - virtual BErr has_analog_connector(int DeviceId) = 0; - virtual int has_svideo_input(int DeviceId) = 0; - virtual int has_component_input(int DeviceId)=0; - virtual int has_composite_input(int DeviceId)=0; - virtual int has_svideo_output(int DeviceId)=0; - virtual int has_component_output(int DeviceId)=0; - virtual int has_analog_rgb_output(int DeviceId)=0; - virtual int has_composite_output(int DeviceId)=0; - - // Functions for new Audio Input architecture - // Functions for Future use not implemented - virtual BErr wait_audio_input_interrupt(unsigned long & noQueuedSample,unsigned long & noFreeSample) = 0; - virtual BErr InitAudioCaptureMode()=0; - virtual BErr StartAudioCapture(int syncCount)=0; - virtual BErr StopAudioCapture()=0; - virtual BErr ReadAudioSample(int nSampleType,void * pBuffer,long nNoSample,int bFlag,long nNoSamplesWritten)=0; - virtual BErr EndAudioCaptureMode()=0; - - - virtual BErr SetCardProperty(int propType,VARIANT & Value)=0; - virtual BErr QueryCardProperty(int propType,VARIANT & Value)=0; - - // RS422 Serial Port Functions - // Functions for Future use not implemented - virtual BErr Wait_For_SerialPort_InputData(unsigned long bFlag,unsigned long & NoDataAvailable)=0; - virtual int IsSerialPort_OutputBuffer_Full(unsigned long bFlag)=0; - virtual int Read_From_SerialPort(unsigned long bFlag,unsigned char * pBuffer,unsigned long ReadLength)=0; - virtual int Write_To_SerialPort(unsigned long bFlag,unsigned char * pBuffer,unsigned long WriteLength)=0; -}; - - - - -extern "C" { -BLUEFISH_API CBlueVelvet4* BlueVelvetFactory4(); -BLUEFISH_API void BlueVelvetDestroy(CBlueVelvet4* pObj); -// this would give you number of VANC/VBI line -BLUEFISH_API unsigned int BlueVelvetVANCLineCount(unsigned int CardType,unsigned long VidFmt,unsigned long FrameType); - -// this would give you golden value for the VANC frame size -BLUEFISH_API unsigned int BlueVelvetVANCGoldenValue( unsigned int CardType, - unsigned long VidFmt, - unsigned long MemFmt, - unsigned long FrameType); - -// this would give you number of bytes contained in a VANC line -BLUEFISH_API unsigned int BlueVelvetVANCLineBytes( unsigned int CardType, - unsigned long VidFmt, - unsigned long MemFmt); - -BLUEFISH_API unsigned int BlueVelvetBytesForGroupPixels(unsigned long MemFmt,unsigned int nPixelCount); -BLUEFISH_API BErr SetVideo_MetaDataInfo(CBlueVelvet4 * pSdk,LPOVERLAPPED pOverLap,ULONG FrameId,ULONG prop,VARIANT value); - -BLUEFISH_API BErr GetVideo_CaptureFrameInfo(CBlueVelvet4 * pSdk,LPOVERLAPPED pOverlap,struct blue_videoframe_info & video_capture_frame,int CompostLater); -BLUEFISH_API BErr GetVideo_CaptureFrameInfoEx(CBlueVelvet4 * pSdk,LPOVERLAPPED pOverlap,struct blue_videoframe_info_ex & video_capture_frame,int CompostLater,unsigned int *capture_fifo_size); - -BLUEFISH_API int GetHancQueuesInfo(CBlueVelvet4 * pSdk, LPOVERLAPPED pOverlap, UINT32 video_channel, UINT32* pFreeBuffers, UINT32* pMaximumBuffers, UINT32* pStatus); -BLUEFISH_API int GetHancBuffer(CBlueVelvet4 * pSdk,LPOVERLAPPED pOverlap,UINT32 video_channel); -BLUEFISH_API BERR PutHancBuffer(CBlueVelvet4 * pSdk,LPOVERLAPPED pOverlap,int hanc_buffer_id,UINT32 video_channel); -BLUEFISH_API BERR HancInputFifoControl(CBlueVelvet4 * pSdk,LPOVERLAPPED pOverlap,UINT32 video_channel, UINT32 control); -BLUEFISH_API BERR HancOutputFifoControl(CBlueVelvet4 * pSdk,LPOVERLAPPED pOverlap,UINT32 video_channel, UINT32 control); -BLUEFISH_API int GetHancInputBuffer(CBlueVelvet4* pSdk,LPOVERLAPPED pOverlap,UINT32 video_channel,UINT32* signal_type, UINT32* field_count); -BLUEFISH_API BLUE_UINT32 emb_audio_decoder( BLUE_UINT32 * src_hanc_buffer, - void * dest_data_ptr, - BLUE_UINT32 req_audio_sample_count, - BLUE_UINT32 required_audio_channels, - BLUE_UINT32 sample_type); -BLUEFISH_API BERR blue_wait_video_sync_async(CBlueVelvet4 * pSdk, - LPOVERLAPPED pOverlap, - blue_video_sync_struct * sync_struct); -BLUEFISH_API BERR blue_dma_read_async( CBlueVelvet4 * pSdk, - LPOVERLAPPED pOverlap, - struct blue_dma_request_struct *pUserDmaRequest); - - -BLUEFISH_API BERR blue_load_1D_lookup_table(CBlueVelvet4 * pSdk, struct blue_1d_lookup_table_struct * lut); - -BLUEFISH_API BERR blue_control_video_scaler(CBlueVelvet4 * pSdk, unsigned int nScalerId, - bool bOnlyReadValue, - float *pSrcVideoHeight, - float *pSrcVideoWidth, - float *pSrcVideoYPos, - float *pSrcVideoXPos, - float *pDestVideoHeight, - float *pDestVideoWidth, - float *pDestVideoYPos, - float *pDestVideoXPos); - -BLUEFISH_API BERR blue_Epoch_GetTimecodes(CBlueVelvet4 * pSdk, UINT32 VideoChannel, UINT64* pArray, UINT32* FieldCount); - -BLUEFISH_API unsigned int count_scaler_video_mode(CBlueVelvet4 * pSdk, - int device_id, - unsigned int video_channel, - unsigned int video_mode); -BLUEFISH_API EVideoMode enum_scaler_video_mode(CBlueVelvet4 * pSdk, - int device_id, - unsigned int video_channel, - unsigned int video_mode, - unsigned int index); -BLUEFISH_API BERR blue_video_scaler_filter_coefficent( CBlueVelvet4 * pSdk, - unsigned int nScalerId, - bool bOnlyReadValue, - unsigned int nFilterType, - float *pCoefficentWeightArray, - unsigned int nArrayElementCount - ); -BLUEFISH_API BERR blue_audioplayback_pause(CBlueVelvet4 * pSdk); -BLUEFISH_API BERR blue_audioplayback_resume(CBlueVelvet4 * pSdk, int syncCount); -BLUEFISH_API BERR GetHancQueuesInfoEx(CBlueVelvet4 * pSdk, - LPOVERLAPPED pOverlap, - UINT32 video_channel, - UINT32* pFreeBuffers, - UINT32* pMaximumBuffers, - UINT32 * pStatus, - UINT32 * pSamplesUsed, - UINT64 *pStartHancFifoTimeStamp, - UINT64 *pVideoSyncTimeStamp); - - -BLUEFISH_API BERR blue_color_matrix(CBlueVelvet4 * pSdk,bool bGetValue,blue_color_matrix_struct * color_matrix_ptr); -} - - -#endif //_BLUEVELVET4_H \ No newline at end of file diff --git a/dependencies64/bluefish/include/BlueVelvetC.h b/dependencies64/bluefish/include/BlueVelvetC.h new file mode 100644 index 000000000..c6138803d --- /dev/null +++ b/dependencies64/bluefish/include/BlueVelvetC.h @@ -0,0 +1,186 @@ +// +// Copyright (c) 2014 Bluefish444. All rights reserved. +// + +#ifndef HG_BLUEVELVET_C +#define HG_BLUEVELVET_C + + +#if defined (_WIN32) + #include "BlueDriver_p.h" + #include "BlueHancUtils.h" + #ifdef BLUEVELVETC_EXPORTS + #define BLUEVELVETC_API __declspec(dllexport) + #else + #define BLUEVELVETC_API __declspec(dllimport) + #endif +#elif defined (__APPLE__) + #define DLLEXPORT __attribute__ ((visibility("default"))) + #define DLLLOCAL __attribute__ ((visibility("hidden"))) + #define BLUEVELVETC_API DLLEXPORT + + #include + #include "BlueDriver_p.h" + #include "BlueVelvetCDefines.h" +#elif defined (__linux__) + #define BLUEVELVETC_API + + #include + #include "BlueVelvetCDefines.h" +#endif + + +//---------------------------------------------------------------------------- +typedef void* BLUEVELVETC_HANDLE; + +typedef int BErr; + +#define BLUE_OK(a) (!a) // Test for succcess of a method returning BErr +#define BLUE_FAIL(a) (a) // Test for failure of a method returning BErr +//---------------------------------------------------------------------------- + + +#if defined (_WIN32) || defined (__linux__) +extern "C" { +#endif + + BLUEVELVETC_API const char* bfcGetVersion(); + BLUEVELVETC_API const wchar_t* bfcGetVersionW(); + BLUEVELVETC_API BLUEVELVETC_HANDLE bfcFactory(); + BLUEVELVETC_API void bfcDestroy(BLUEVELVETC_HANDLE pHandle); + BLUEVELVETC_API BErr bfcEnumerate(BLUEVELVETC_HANDLE pHandle, int& iDevices); + +// Get the card type of the Card indicated by iDeviceID, if iDeviceID is 0, then get the cardtype for that card that this pHandle is attached to. + BLUEVELVETC_API BErr bfcQueryCardType(BLUEVELVETC_HANDLE pHandle, int& iCardType, int iDeviceID = 0); + BLUEVELVETC_API BErr bfcAttach(BLUEVELVETC_HANDLE pHandle, int iDeviceId); + BLUEVELVETC_API BErr bfcDetach(BLUEVELVETC_HANDLE pHandle); + + BLUEVELVETC_API BErr bfcQueryCardProperty32(BLUEVELVETC_HANDLE pHandle, const int iProperty, unsigned int& nValue); + BLUEVELVETC_API BErr bfcSetCardProperty32(BLUEVELVETC_HANDLE pHandle, const int iProperty, const unsigned int nValue); + BLUEVELVETC_API BErr bfcQueryCardProperty64(BLUEVELVETC_HANDLE pHandle, const int iProperty, unsigned long long& ullValue); + BLUEVELVETC_API BErr bfcSetCardProperty64(BLUEVELVETC_HANDLE pHandle, const int iProperty, const unsigned long long ullValue); + + BLUEVELVETC_API BErr bfcGetCardSerialNumber(BLUEVELVETC_HANDLE pHandle, char* pSerialNumber, unsigned int nStringSize); //nStringSize must be at least 20 + BLUEVELVETC_API BErr bfcGetCardFwVersion(BLUEVELVETC_HANDLE pHandle, unsigned int& nValue); + + //Interrupt related functions +#if defined(_WIN32) + BLUEVELVETC_API BErr bfcWaitVideoSyncAsync(BLUEVELVETC_HANDLE pHandle, OVERLAPPED* pOverlap, blue_video_sync_struct* pSyncData); +#endif + BLUEVELVETC_API BErr bfcWaitVideoInputSync(BLUEVELVETC_HANDLE pHandle, unsigned long ulUpdateType, unsigned long& ulFieldCount); + BLUEVELVETC_API BErr bfcWaitVideoOutputSync(BLUEVELVETC_HANDLE pHandle, unsigned long ulUpdateType, unsigned long& ulFieldCount); + BLUEVELVETC_API BErr bfcGetVideoOutputCurrentFieldCount(BLUEVELVETC_HANDLE pHandle, unsigned long& ulFieldCount); + BLUEVELVETC_API BErr bfcGetVideoInputCurrentFieldCount(BLUEVELVETC_HANDLE pHandle, unsigned long& ulFieldCount); + + //FIFO functions + BLUEVELVETC_API BErr bfcVideoCaptureStart(BLUEVELVETC_HANDLE pHandle); + BLUEVELVETC_API BErr bfcVideoCaptureStop(BLUEVELVETC_HANDLE pHandle); + BLUEVELVETC_API BErr bfcVideoPlaybackStart(BLUEVELVETC_HANDLE pHandle, int iStep, int iLoop); + BLUEVELVETC_API BErr bfcVideoPlaybackStop(BLUEVELVETC_HANDLE pHandle, int iWait, int iFlush); + BLUEVELVETC_API BErr bfcVideoPlaybackAllocate(BLUEVELVETC_HANDLE pHandle, void** pAddress, unsigned long& ulBufferID, unsigned long& ulUnderrun); + BLUEVELVETC_API BErr bfcVideoPlaybackPresent(BLUEVELVETC_HANDLE pHandle, unsigned long& ulUniqueID, unsigned long ulBufferID, unsigned long ulCount, int iKeep, int iOdd=0); + BLUEVELVETC_API BErr bfcVideoPlaybackRelease(BLUEVELVETC_HANDLE pHandle, unsigned long ulBufferID); + +#if defined (_WIN32) + BLUEVELVETC_API BErr bfcGetCaptureVideoFrameInfoEx(BLUEVELVETC_HANDLE pHandle, OVERLAPPED* pOverlap, struct blue_videoframe_info_ex& VideoFrameInfo, int iCompostLater, unsigned int* nCaptureFifoSize); +#elif defined (__APPLE__) + BLUEVELVETC_API BErr bfcGetCaptureVideoFrameInfoEx(BLUEVELVETC_HANDLE pHandle, struct blue_videoframe_info_ex& VideoFrameInfo, int iCompostLater, unsigned int* nCaptureFifoSize); +#elif defined(__linux__) + BLUEVELVETC_API BErr bfcGetCaptureVideoFrameInfoEx(BLUEVELVETC_HANDLE pHandle, struct blue_videoframe_info_ex& VideoFrameInfo); +#endif + + //FRAMESTORE functions + BLUEVELVETC_API BErr bfcRenderBufferCapture(BLUEVELVETC_HANDLE pHandle, unsigned long ulBufferID); + BLUEVELVETC_API BErr bfcRenderBufferUpdate(BLUEVELVETC_HANDLE pHandle, unsigned long ulBufferID); + BLUEVELVETC_API BErr bfcGetRenderBufferCount(BLUEVELVETC_HANDLE pHandle, unsigned long& ulCount); + + //AUDIO Helper functions (BlueHancUtils) + BLUEVELVETC_API BErr bfcEncodeHancFrameEx(BLUEVELVETC_HANDLE pHandle, unsigned int nCardType, struct hanc_stream_info_struct* pHancEncodeInfo, void* pAudioBuffer, unsigned int nAudioChannels, unsigned int nAudioSamples, unsigned int nSampleType, unsigned int nAudioFlags); + BLUEVELVETC_API BErr bfcDecodeHancFrameEx(BLUEVELVETC_HANDLE pHandle, unsigned int nCardType, unsigned int* pHancBuffer, struct hanc_decode_struct* pHancDecodeInfo); + + //DMA functions +#if defined(_WIN32) + BLUEVELVETC_API BErr bfcSystemBufferReadAsync(BLUEVELVETC_HANDLE pHandle, unsigned char* pPixels, unsigned long ulSize, OVERLAPPED* pOverlap, unsigned long ulBufferID, unsigned long ulOffset=0); + BLUEVELVETC_API BErr bfcSystemBufferWriteAsync(BLUEVELVETC_HANDLE pHandle, unsigned char* pPixels, unsigned long ulSize, OVERLAPPED* pOverlap, unsigned long ulBufferID, unsigned long ulOffset=0); +#elif defined(__APPLE__) || defined (__linux__) + BLUEVELVETC_API BErr bfcSystemBufferRead(BLUEVELVETC_HANDLE pHandle, unsigned char* pPixels, unsigned long ulSize, unsigned long ulBufferID, unsigned long ulOffset=0); + BLUEVELVETC_API BErr bfcSystemBufferWrite(BLUEVELVETC_HANDLE pHandle, unsigned char* pPixels, unsigned long ulSize, unsigned long ulBufferID, unsigned long ulOffset=0); +#endif + +#if defined(__APPLE__) + BLUEVELVETC_API BErr bfcSystemBufferReadAsync(BLUEVELVETC_HANDLE pHandle, unsigned char* pPixels, unsigned long ulSize, dispatch_semaphore_t* sem, unsigned long ulBufferID, unsigned long ulOffset=0); + BLUEVELVETC_API BErr bfcSystemBufferWriteAsync(BLUEVELVETC_HANDLE pHandle, unsigned char* pPixels, unsigned long ulSize, dispatch_semaphore_t* sem, unsigned long ulBufferID, unsigned long ulOffset=0); +#endif + + // RS422 Serial Port Functions + BLUEVELVETC_API BErr bfcSerialPortWaitForInputData(BLUEVELVETC_HANDLE pHandle, unsigned int nPortFlags, unsigned int& nBufferLength); + BLUEVELVETC_API BErr bfcSerialPortRead(BLUEVELVETC_HANDLE pHandle, unsigned int nPortFlags, unsigned char* pBuffer, unsigned int nReadLength); + BLUEVELVETC_API BErr bfcSerialPortWrite(BLUEVELVETC_HANDLE pHandle, unsigned int nPortFlags, unsigned char* pBuffer, unsigned int nWriteLength); + +#if defined (_WIN32) + //Miscellaneous functions + BLUEVELVETC_API BErr bfcGetReferenceClockPhaseSettings(BLUEVELVETC_HANDLE pHandle, unsigned int& nHPhase, unsigned int& nVPhase, unsigned int& nHPhaseMax, unsigned int& nVPhaseMax); + BLUEVELVETC_API BErr bfcLoadOutputLUT1D(BLUEVELVETC_HANDLE pHandle, struct blue_1d_lookup_table_struct* pLutData); + BLUEVELVETC_API BErr bfcControlVideoScaler(BLUEVELVETC_HANDLE pHandle, unsigned int nScalerId, + bool bOnlyReadValue, + float* pSrcVideoHeight, + float* pSrcVideoWidth, + float* pSrcVideoYPos, + float* pSrcVideoXPos, + float* pDestVideoHeight, + float* pDestVideoWidth, + float* pDestVideoYPos, + float* pDestVideoXPos); +#endif + + // Video mode and Format information functions + BLUEVELVETC_API BErr bfcGetBytesForGroupPixels(EMemoryFormat nMemoryFormat, unsigned int nVideoWidth, unsigned int& nVideoPitchBytes); + BLUEVELVETC_API BErr bfcGetPixelsPerLine(EVideoMode nVideoMode, unsigned int& nPixelsPerLine); + BLUEVELVETC_API BErr bfcGetLinesPerFrame(EVideoMode nVideoMode, EUpdateMethod nUpdateMethod, unsigned int& nLinesPerFrame); + BLUEVELVETC_API BErr bfcGetBytesPerLine(EVideoMode nVideoMode, EMemoryFormat nMemoryFormat, unsigned int& nBytesPerLine); + BLUEVELVETC_API BErr bfcGetBytesPerFrame(EVideoMode nVideoMode, EMemoryFormat nMemoryFormat, EUpdateMethod nUpdateMethod, unsigned int& nBytesPerFrame); + BLUEVELVETC_API BErr bfcGetGoldenValue(EVideoMode nVideoMode, EMemoryFormat nMemoryFormat, EUpdateMethod nUpdateMethod, unsigned int& nGoldenFrameSize); + BLUEVELVETC_API BErr bfcGetVBILines(EVideoMode nVideoMode, EUpdateMethod nUpdateMethod, unsigned int& nVBILinesPerFrame); + + BLUEVELVETC_API BErr bfcGetVANCGoldenValue(unsigned int nCardType, EVideoMode nVideoMode, EMemoryFormat nMemoryFormat, EDMADataType nDataFormat, unsigned int& nVANCGoldenValue); + BLUEVELVETC_API BErr bfcGetVANCLineBytes(unsigned int nCardType, EVideoMode nVideoMode, EMemoryFormat nMemoryFormat, unsigned int& nVANCLineBytes); + BLUEVELVETC_API BErr bfcGetVANCLineCount(unsigned int nCardType, EVideoMode nVideoMode, EDMADataType nDataFormat, unsigned int& nVANCLineCount); + + +#if defined (_WIN32) + //AMD SDI-Link support + BLUEVELVETC_API BErr bfcDmaWaitMarker(BLUEVELVETC_HANDLE pHandle, OVERLAPPED* pOverlap, + unsigned int nVideoChannel, + unsigned int nBufferId, + unsigned int nMarker); + BLUEVELVETC_API BErr bfcDmaReadToBusAddressWithMarker( BLUEVELVETC_HANDLE pHandle, + unsigned int nVideoChannel, + unsigned long long n64DataAddress, + unsigned int nSize, + OVERLAPPED* pOverlap, + unsigned int BufferID, + unsigned long Offset, + unsigned long long n64MarkerAddress, + unsigned int nMarker); + BLUEVELVETC_API BErr bfcDmaReadToBusAddress( BLUEVELVETC_HANDLE pHandle, + unsigned int nVideoChannel, + unsigned long long n64DataAddress, + unsigned int nSize, + OVERLAPPED* pOverlap, + unsigned int BufferID, + unsigned long Offset); + BLUEVELVETC_API BErr bfcDmaWriteMarker( BLUEVELVETC_HANDLE pHandle, + unsigned long long n64MarkerAddress, + unsigned int nMarker); + + //misc + BLUEVELVETC_API BErr bfcGetWindowsDriverHandle(BLUEVELVETC_HANDLE pHandle, HANDLE* pDriverHandle); + BLUEVELVETC_API BErr bfcSetDynamicMemoryFormatChange(BLUEVELVETC_HANDLE pHandle, OVERLAPPED* pOverlap, unsigned int nUniqueId, EMemoryFormat nMemoryFormat); +#endif + + +#if defined (_WIN32) || defined (__linux__) +} //extern "C" +#endif + +#endif //HG_BLUEVELVET_C diff --git a/dependencies64/bluefish/include/BlueVelvetCUtils.h b/dependencies64/bluefish/include/BlueVelvetCUtils.h new file mode 100644 index 000000000..69c8b5b47 --- /dev/null +++ b/dependencies64/bluefish/include/BlueVelvetCUtils.h @@ -0,0 +1,158 @@ +// +// BlueVelvetCUtils.h +// BlueVelvetC +// +// Created by James on 21/05/2014. +// Copyright (c) 2014 Bluefish444. All rights reserved. +// +// A file that contains useful Util functions that can ssist in general development. +// indente to be included as-is into BlueVelvetC projects and not part of a library. + +#ifndef BlueVelvetC_BlueVelvetCUtils_h +#define BlueVelvetC_BlueVelvetCUtils_h + +#include "BlueVelvetC.h" + + +#if defined (_WIN32) +extern "C" { +#endif + +// Memory Allocation and Free'ing of page Aligned memory + BLUEVELVETC_API void* bfAlloc(unsigned int nMemorySize); + BLUEVELVETC_API void bfFree(unsigned int nMemSize, void* pMemory); + +// Get strings that give information about the card or card state + BLUEVELVETC_API const char* bfcUtilsGetStringForCardType(const int iCardType); + BLUEVELVETC_API const wchar_t* bfcUtilsGetWStringForCardType(const int iCardType); + + BLUEVELVETC_API const char* bfcUtilsGetStringForBlueProductId(const unsigned int nProductId); + BLUEVELVETC_API const wchar_t* bfcUtilsGetWStringForBlueProductId(const unsigned int nProductId); + + BLUEVELVETC_API const char* bfcUtilsGetStringForVideoMode(const unsigned int nVideoMode); + BLUEVELVETC_API const wchar_t* bfcUtilsGetWStringForVideoMode(const unsigned int nVideoMode); + + BLUEVELVETC_API const char* bfcUtilsGetStringForMemoryFormat(const unsigned int nMemoryFormat); + BLUEVELVETC_API const wchar_t* bfcUtilsGetWStringForMemoryFormat(const unsigned int nMemoryFormat); + +// Get/Set MR2 Video mode info + BLUEVELVETC_API int bfcUtilsGetScalerVideoMode(const BLUEVELVETC_HANDLE pHandle, const unsigned int nScalerMR2Node, unsigned int& nVideoMode); + BLUEVELVETC_API int bfcUtilsSetScalerVideoMode(const BLUEVELVETC_HANDLE pHandle, const unsigned int nScalerMR2Node, unsigned int nVideoMode); + +// Change MR2 Routing using the EEpochRoutingElements enum values as src and dest + BLUEVELVETC_API int bfcUtilsGetMR2Routing(const BLUEVELVETC_HANDLE pHandle, unsigned int& nSrcNode, const unsigned int nDestNode, unsigned int& nLinkType); + BLUEVELVETC_API int bfcUtilsSetMR2Routing(const BLUEVELVETC_HANDLE pHandle, const unsigned int nSrcNode, const unsigned int nDestNode, const unsigned int nLinkType); + +// Get/Set Audio routing. + BLUEVELVETC_API int bfcUtilsGetAudioOutputRouting(const BLUEVELVETC_HANDLE pHandle, const unsigned int nAudioConnectorType, unsigned int& nAudioSourceChannelId, unsigned int nAudioConnectorId); + BLUEVELVETC_API int bfcUtilsSetAudioOutputRouting(const BLUEVELVETC_HANDLE pHandle, const unsigned int nAudioConnectorType, unsigned int nAudioSourceChannelId, unsigned int nAudioConnectorId); + +// General Video format helper funcs + BLUEVELVETC_API bool bfcUtilsIsVideoModeProgressive(const unsigned int nVideoMode); + BLUEVELVETC_API bool bfcUtilsIsVideoMode1001Framerate(const unsigned int nVideoMode); + BLUEVELVETC_API int bfcUtilsGetFpsForVideoMode(const unsigned int nVideoMode); // returns closest interger FPS, use bfcUtilsIsVideoMode1001Framerate(), to determine if div 1001 is needed. + +// Get the Bluefish _EVideoMode for the given width, height and fps + BLUEVELVETC_API int bfcUtilsGetVideoModeForFrameInfo(const BLUE_UINT32 nWidth, const BLUE_UINT32 nHeight, const BLUE_UINT32 nRate, const BLUE_UINT32 bIs1001, const BLUE_UINT32 bIsProgressive, BLUE_UINT32& nVideoMode); + BLUEVELVETC_API int bfcUtilsGetFrameInfoForVideoMode(const BLUE_UINT32 nVideoMode, BLUE_UINT32& nWidth, BLUE_UINT32& nHeight, BLUE_UINT32& nRate, BLUE_UINT32& bIs1001, BLUE_UINT32& bIsProgressive); + + +// Get the number of Audio Packets for a given frame of video in a specific mode. + BLUEVELVETC_API int bfcUtilsGetAudioSamplesPerFrame(const BLUE_UINT32 nVideoMode, const BLUE_UINT32 nFrameNo); + + +// HANC / VANC utils + +/** + @brief enumerator used by VANC manipulation function on HD cards to notify whether + VANC pakcet shoule be inserted/extracted from VANC Y buffers or VANC CbCr buffer. + This enumerator will only be used on HD video modes as it is the only with + 2 type of ANC bufers ir Y and CbCr. On SD Modes the ANC data is inserted across + both Y anc CbCr values. + + */ + enum BlueVancPktTypeEnum + { + BlueVancPktYComp=0, /**< ANC pkt should be inserted/extracted from the Y component buffer*/ + BlueVancPktCbcrComp=1, /**< ANC pkt should be inserted/extracted from the CbCr component buffer*/ + BlueVancPktAllComp=2 /**< ANC pkt should be inserted/extracted from all components (SD video modes)*/ + }; + +/*! + @brief Use this function to initialise VANC buffer before inserting any packets into the buffer + @param CardType type of bluefish card to which this vanc buffer was transferred to. + @param nVideoMode video mode under which this vanc buffer will be used. + @param pixels_per_line width in pixels of the vanc buffer that has to be initialised. + @param lines_per_frame height of the vanc buffer that has to be initialised. + @param pVancBuffer vanc buffer which has to be initialised. + @remarks. + + */ + BLUEVELVETC_API BLUE_UINT32 bfcUtilsInitVancBuffer(BLUE_UINT32 nCardType, + BLUE_UINT32 nVideoMode, + BLUE_UINT32 nPixelsPerLine, + BLUE_UINT32 nLinesPerFrame, + BLUE_UINT32* pVancBuffer); + +/*! + @brief this function can be used to extract ANC packet from HD cards. Currently we can only extract packets in the VANC space. + @param CardType type of the card from which the vanc buffer was captured. + @param vanc_pkt_type This parameter denotes whether to search for the VANC packet in Y Space or Cb/Cr Space. + The values this parameter accepts are defined in the enumerator #BlueVancPktTypeEnum + @param src_vanc_buffer Vanc buffer which was captured from bluefish card + @param src_vanc_buffer_size size of the vanc buffer which should be parsed for the specified vanc packet + @param pixels_per_line specifies how many pixels are there in each line of VANC buffer + @param vanc_pkt_did specifies the DID of the Vanc packet which should be extracted from the buffer + @param vanc_pkt_sdid Returns the SDID of the extracted VANC packet + @param vanc_pkt_data_length returns the size of the extracted VANC packet. The size is specifed as number of UDW words + that was contained in the packet + @param vanc_pkt_data_ptr pointer to UDW of the VANC packets . The 10 bit UDW words are packed in a 16 bit integer. The bottom 10 bit of the + 16 bit word contains the UDW data. + @param vanc_pkt_line_no line number where the packet was found . + + @remarks. + + */ + BLUEVELVETC_API BLUE_INT32 bfcUtilsVancPktExtract(BLUE_UINT32 nCardType, + BLUE_UINT32 nVancPktType, + BLUE_UINT32* pSrcVancBuffer, + BLUE_UINT32 nSrcVancBufferSize, + BLUE_UINT32 nPixelsPerLine, + BLUE_UINT32 nVancPktDid, + BLUE_UINT16* pVancPktSdid, + BLUE_UINT16* pVancPktDataLength, + BLUE_UINT16* pVancPktData, + BLUE_UINT16* pVancPktLineNo); + +/** + @brief use this function to insert ANC packets into the VANC space of the HD cards. + @param CardType type of the card from which the vanc buffer was captured. + @param vanc_pkt_type This parameter denotes whether to search for the VANC packet in Y Space or Cb/Cr Space. + The values this parameter accepts are defined in the enumerator #blue_vanc_pkt_type_enum + @param vanc_pkt_line_no line in th VANC buffer where the ANC packet should inserted. + @param vanc_pkt_buffer vanc ANC packet which should be inserted into the VANC buffer. + @param vanc_pkt_buffer_size size of the ANC packet including the checksum ,ADF , SDID, DID and Data Count + @param dest_vanc_buffer VANC buffer into which the ANC packet will be inserted into. + @param pixels_per_line specifies how many pixels are there in each line of VANC buffer + */ + BLUEVELVETC_API BLUE_INT32 bfcUtilsVancPktInsert(BLUE_UINT32 nCardType, + BLUE_UINT32 nVancPktType, + BLUE_UINT32 nVancPktLineNumber, + BLUE_UINT32* pVancPktBuffer, + BLUE_UINT32 nVancPktBufferSize, + BLUE_UINT32* pDestVancBuffer, + BLUE_UINT32 nPixelsPerLine); + +/** @} */ + +/** + @defgroup vanc_decode_encoder_helper ANC encoder/decoder + @{ + */ + BLUEVELVETC_API BLUE_UINT32 bfcUtilsDecodeEia708bPkt(BLUE_UINT32 nCardType, BLUE_UINT16* pVancPktData, BLUE_UINT16 usPktUdwCount, BLUE_UINT16 usEiaPktSubtype, BLUE_UINT8* pDecodedChStr); + +#if defined (_WIN32) +} //extern "C" +#endif + +#endif // BlueVelvetC_BlueVelvetCUtils_h \ No newline at end of file diff --git a/dependencies64/bluefish/include/BlueVelvet_c.h b/dependencies64/bluefish/include/BlueVelvet_c.h deleted file mode 100644 index 3e7a0caab..000000000 --- a/dependencies64/bluefish/include/BlueVelvet_c.h +++ /dev/null @@ -1,131 +0,0 @@ -/* -// ========================================================================== -// Bluefish444 BlueVelvet SDK library -// -// BlueSD_c.h -// Constants header -// LARGELY superseded by dynamic calculations - - - $Id: BlueVelvet_c.h,v 1.4 2002/10/02 00:29:53 cameron Exp $ -// -// developed by : Cameron Duffy (C) 2002 Bluefish444 P/L -// ========================================================================== -// -*/ - -//---------------------------------------------------------------------------- -#ifndef _BLUEVELVET_C_H -#define _BLUEVELVET_C_H - -//---------------------------------------------------------------------------------------------------------------------- -// File SUB-types supported -// -typedef enum -{ - EBlue_10BIT_NTSC=0, // 10 BIT NTSC - EBlue_10BIT_PAL, // 10 BIT PAL - EBlue_08BIT_NTSC, // 8 BIT NTSC - EBlue_08BIT_PAL, // 8 BIT PAL - EBlue_32BIT_NTSC, // 32 BIT NTSC (ARGB - uncompressed) - EBlue_32BIT_PAL // 32 BIT PAL (ARGB - uncompressed) -} EBlueFileId; - -// File subtype ID;s -#define BLUE_FILE_10BIT_NTSC 0 // 10 BIT NTSC -#define BLUE_FILE_10BIT_PAL 1 // 10 BIT PAL -#define BLUE_FILE_08BIT_NTSC 2 // 8 BIT NTSC -#define BLUE_FILE_08BIT_PAL 3 // 8 BIT PAL -#define BLUE_FILE_32BIT_NTSC 4 // 32 BIT NTSC (ARGB - uncompressed) -#define BLUE_FILE_32BIT_PAL 5 // 32 BIT PAL (ARGB - uncompressed) - -// File subtype FOURCC -#define BLUE_SUBTYPE_10BIT_NTSC 0x52594e5f //'RYN_' // 10 BIT NTSC -#define BLUE_SUBTYPE_10BIT_PAL 0x5259515f //'RYP_' // 10 BIT PAL -#define BLUE_SUBTYPE_08BIT_NTSC 0x52384e5f //'R8N_' // 8 BIT NTSC -#define BLUE_SUBTYPE_08BIT_PAL 0x5238515f //'R8P_' // 8 BIT PAL -#define BLUE_SUBTYPE_32BIT_NTSC 0x52524e5f //'RRN_' // 32 BIT NTSC (ARGB - uncompressed) -#define BLUE_SUBTYPE_32BIT_PAL 0x5252415f //'RRP_' // 32 BIT PAL (ARGB - uncompressed) - -#define BLUE_ROOTED_SUBTYPE 0x62626262 //'XXXX' -#define BLUE_FILE_NOVIDEO 0x62626262 //'XXXX' -#define BLUE_FILE_TYPE 0x5244565f //'RDV_' -#define BLUE_CLASS_ID 0x52444456 //'RDDV' - -// align this structure on 512 byte boundary! -typedef struct -{ - char name[20]; // "PREMIERE RDV_FILE"; - ULONG hasAudio; // See BLUE_SUBTYPE_??? - ULONG VideoSubtype; // See BLUE_SUBTYPE_??? - ULONG width; // width of frame in pixels - ULONG height; // height of frame in pixels (can get video mode) - ULONG rowbytes; // total bytes in row (can get mem format from this and width) - ULONG numFrames; // number of frames in file - ULONG frameOffset; // GOLDEN frame size - ULONG duration; // TDB - value = total number of frames - long scale; // TDB - scale = scale / samplesize = timebase - long sampleSize; // TDB - sampleSize = 1 or 100 if 29.97 fps - - ULONG gFmtVid; - ULONG gFmtMem; - ULONG gFmtUpd; - ULONG gFmtRes; - // 76 bytes - char orgtime[20]; // These fields map directly to those in imTimeInfoRec. - char alttime[20]; - char orgreel[40]; - char altreel[40]; - // 196 bytes - char logcomment[256]; - // 452 bytes -// char pad[512-452-4]; - char pad[56]; - // For disk speed to work, this structure MUST be a multiple of sector size - ULONG len; // Length of TRAILER, *always* last! -} RDV_File2_OLD; -//#define SIZE_RDV_FILE 512 - -#define kGoldenPageSize 4096 - -typedef struct -{ - char name[20]; // "PREMIERE RDV_FILE "; - ULONG hasAudio; // See BLUE_SUBTYPE_??? - ULONG VideoSubtype; // See BLUE_SUBTYPE_??? - ULONG width; // width of frame in pixels - ULONG height; // height of frame in pixels (can get video mode) - ULONG rowbytes; // total bytes in row (can get mem format from this and width) - ULONG numFrames; // number of frames in file - ULONG frameOffset; // GOLDEN frame size - ULONG duration; // TDB - value = total number of frames - long scale; // TDB - scale = scale / samplesize = timebase - long sampleSize; // TDB - sampleSize = 1 or 100 if 29.97 fps - - ULONG gFmtVid; - ULONG gFmtMem; - ULONG gFmtUpd; - ULONG gFmtRes; - // 76 bytes - char orgtime[20]; // These fields map directly to those in imTimeInfoRec. - char alttime[20]; - char orgreel[40]; - char altreel[40]; - // 196 bytes - char logcomment[256]; - // 452 bytes -// char pad[512-452-4]; - ULONG audioSampleRate; // 48000 or 96000 - ULONG numChannels; // 2, 4, or 6 - ULONG numAudioBlocks; // how many in the file? - // 464 bytes - char pad[36]; - - _int64 audioBlockOffsets[kGoldenPageSize * 4]; // something like 4.5 hours max length (enough for now I guess) - ULONG audioBlockSizes[kGoldenPageSize * 4]; - - // For disk speed to work, this structure MUST be a multiple of sector size - ULONG len; // Length of TRAILER, *always* last! -} RDV_File2; - -#endif //_BLUEVELVET_C_H diff --git a/dependencies64/bluefish/lib/BlueFishFilters.lib b/dependencies64/bluefish/lib/BlueFishFilters.lib deleted file mode 100644 index df9d7ae29..000000000 Binary files a/dependencies64/bluefish/lib/BlueFishFilters.lib and /dev/null differ diff --git a/dependencies64/bluefish/lib/BlueFishFilters.tlb b/dependencies64/bluefish/lib/BlueFishFilters.tlb deleted file mode 100644 index 375f0d0db..000000000 Binary files a/dependencies64/bluefish/lib/BlueFishFilters.tlb and /dev/null differ diff --git a/dependencies64/bluefish/lib/BlueFishFilters64.lib b/dependencies64/bluefish/lib/BlueFishFilters64.lib deleted file mode 100644 index d025f74a4..000000000 Binary files a/dependencies64/bluefish/lib/BlueFishFilters64.lib and /dev/null differ diff --git a/dependencies64/bluefish/lib/BlueFishFilters64.tlb b/dependencies64/bluefish/lib/BlueFishFilters64.tlb deleted file mode 100644 index 03488f16a..000000000 Binary files a/dependencies64/bluefish/lib/BlueFishFilters64.tlb and /dev/null differ diff --git a/dependencies64/bluefish/lib/BlueHancUtils.lib b/dependencies64/bluefish/lib/BlueHancUtils.lib deleted file mode 100644 index 3a12d245c..000000000 Binary files a/dependencies64/bluefish/lib/BlueHancUtils.lib and /dev/null differ diff --git a/dependencies64/bluefish/lib/BlueHancUtils64.lib b/dependencies64/bluefish/lib/BlueHancUtils64.lib deleted file mode 100644 index 802c71c63..000000000 Binary files a/dependencies64/bluefish/lib/BlueHancUtils64.lib and /dev/null differ diff --git a/dependencies64/bluefish/lib/BlueHancUtils64_d.lib b/dependencies64/bluefish/lib/BlueHancUtils64_d.lib deleted file mode 100644 index 8e4e91b7d..000000000 Binary files a/dependencies64/bluefish/lib/BlueHancUtils64_d.lib and /dev/null differ diff --git a/dependencies64/bluefish/lib/BlueHancUtils_d.lib b/dependencies64/bluefish/lib/BlueHancUtils_d.lib deleted file mode 100644 index 81b767226..000000000 Binary files a/dependencies64/bluefish/lib/BlueHancUtils_d.lib and /dev/null differ diff --git a/dependencies64/bluefish/lib/BlueVelvet3.lib b/dependencies64/bluefish/lib/BlueVelvet3.lib deleted file mode 100644 index 7a901fad5..000000000 Binary files a/dependencies64/bluefish/lib/BlueVelvet3.lib and /dev/null differ diff --git a/dependencies64/bluefish/lib/BlueVelvet3_d.lib b/dependencies64/bluefish/lib/BlueVelvet3_d.lib deleted file mode 100644 index 0c01b58fd..000000000 Binary files a/dependencies64/bluefish/lib/BlueVelvet3_d.lib and /dev/null differ diff --git a/dependencies64/bluefish/lib/BlueVelvet64.lib b/dependencies64/bluefish/lib/BlueVelvet64.lib deleted file mode 100644 index 2433a6eef..000000000 Binary files a/dependencies64/bluefish/lib/BlueVelvet64.lib and /dev/null differ diff --git a/dependencies64/bluefish/lib/BlueVelvet64_d.lib b/dependencies64/bluefish/lib/BlueVelvet64_d.lib deleted file mode 100644 index daa16a5ac..000000000 Binary files a/dependencies64/bluefish/lib/BlueVelvet64_d.lib and /dev/null differ diff --git a/dependencies64/bluefish/lib/BlueVelvetCom.lib b/dependencies64/bluefish/lib/BlueVelvetCom.lib deleted file mode 100644 index 7b60e7a47..000000000 Binary files a/dependencies64/bluefish/lib/BlueVelvetCom.lib and /dev/null differ diff --git a/dependencies64/bluefish/lib/BlueVelvetCom.tlb b/dependencies64/bluefish/lib/BlueVelvetCom.tlb deleted file mode 100644 index 49d16e62b..000000000 Binary files a/dependencies64/bluefish/lib/BlueVelvetCom.tlb and /dev/null differ diff --git a/dependencies64/bluefish/lib/BlueVelvetConstant.tlb b/dependencies64/bluefish/lib/BlueVelvetConstant.tlb deleted file mode 100644 index c9659007b..000000000 Binary files a/dependencies64/bluefish/lib/BlueVelvetConstant.tlb and /dev/null differ diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index 8dd4a8420..72710af37 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -7,7 +7,7 @@ add_subdirectory(oal) if (MSVC) add_subdirectory(bluefish) -endif () +endif () add_subdirectory(decklink) add_subdirectory(screen) diff --git a/modules/bluefish/CMakeLists.txt b/modules/bluefish/CMakeLists.txt index 0551dd056..fd95da741 100644 --- a/modules/bluefish/CMakeLists.txt +++ b/modules/bluefish/CMakeLists.txt @@ -3,18 +3,14 @@ project (bluefish) set(SOURCES consumer/bluefish_consumer.cpp - util/blue_velvet.cpp - bluefish.cpp StdAfx.cpp ) set(HEADERS consumer/bluefish_consumer.h - util/blue_velvet.h util/memory.h - bluefish.h StdAfx.h ) @@ -26,13 +22,14 @@ include_directories(..) include_directories(../..) include_directories(${BOOST_INCLUDE_PATH}) include_directories(${TBB_INCLUDE_PATH}) -include_directories(${BLUEFISH_INCLUDE_PATH}) include_directories(${RXCPP_INCLUDE_PATH}) include_directories(${ASMLIB_INCLUDE_PATH}) +include_directories(${BLUEFISH_INCLUDE_PATH}) set_target_properties(bluefish PROPERTIES FOLDER modules) source_group(sources ./*) source_group(sources\\consumer consumer/*) +source_group(sources\\util util/*) target_link_libraries(bluefish common core) diff --git a/modules/bluefish/bluefish.cpp b/modules/bluefish/bluefish.cpp index 8fb124efe..cf50a7b24 100644 --- a/modules/bluefish/bluefish.cpp +++ b/modules/bluefish/bluefish.cpp @@ -42,17 +42,13 @@ std::wstring version() { try { - blue_initialize(); + bvc_wrapper blue; + return u16(blue.get_version()); } catch(...) { return L"Not found"; } - - if(!BlueVelvetVersion) - return L"Unknown"; - - return u16(BlueVelvetVersion()); } std::vector device_list() @@ -61,14 +57,15 @@ std::vector device_list() try { - blue_initialize(); - - auto blue = create_blue(); + bvc_wrapper blue; + int numCards = 0; + blue.enumerate(numCards); - for(int n = 1; BLUE_PASS(blue->device_attach(n, FALSE)); ++n) + for(int n = 1; n < (numCards+1); n++) { - devices.push_back(std::wstring(get_card_desc(*blue)) + L" [" + boost::lexical_cast(n) + L"]"); - blue->device_detach(); + blue.attach(n); + devices.push_back(std::wstring(get_card_desc(blue, n)) + L" [" + boost::lexical_cast(n) + L"]"); + blue.detach(); } } catch(...){} @@ -80,7 +77,9 @@ void init(core::module_dependencies dependencies) { try { - blue_initialize(); + bvc_wrapper blue; + int num_cards = 0; + blue.enumerate(num_cards); } catch(...){} @@ -93,6 +92,8 @@ void init(core::module_dependencies dependencies) for (auto device : device_list()) info.add(L"system.bluefish.device", device); }); + } -}} \ No newline at end of file +}} + diff --git a/modules/bluefish/consumer/bluefish_consumer.cpp b/modules/bluefish/consumer/bluefish_consumer.cpp index a51b9dc80..d41f74057 100644 --- a/modules/bluefish/consumer/bluefish_consumer.cpp +++ b/modules/bluefish/consumer/bluefish_consumer.cpp @@ -56,34 +56,103 @@ #include namespace caspar { namespace bluefish { - + +#define BLUEFISH_HW_BUFFER_DEPTH 1 +#define BLUEFISH_SOFTWARE_BUFFERS 4 + +enum class hardware_downstream_keyer_mode +{ + disable = 0, + external = 1, + internal = 2, // Bluefish dedicated HW keyer - only available on some models. +}; + +enum class hardware_downstream_keyer_audio_source +{ + SDIVideoInput = 1, + VideoOutputChannel = 2 +}; + +enum class bluefish_hardware_output_channel +{ + channel_a, + channel_b, + channel_c, + channel_d, + default_output_channel = channel_a +}; + +EBlueVideoChannel get_bluesdk_videochannel_from_streamid(bluefish_hardware_output_channel streamid) +{ + /*This function would return the corresponding EBlueVideoChannel from the device output channel*/ + switch (streamid) + { + case bluefish_hardware_output_channel::channel_a: return BLUE_VIDEO_OUTPUT_CHANNEL_A; + case bluefish_hardware_output_channel::channel_b: return BLUE_VIDEO_OUTPUT_CHANNEL_B; + case bluefish_hardware_output_channel::channel_c: return BLUE_VIDEO_OUTPUT_CHANNEL_C; + case bluefish_hardware_output_channel::channel_d: return BLUE_VIDEO_OUTPUT_CHANNEL_D; + default: return BLUE_VIDEO_OUTPUT_CHANNEL_A; + } +} + +bool get_videooutput_channel_routing_info_from_streamid(bluefish_hardware_output_channel streamid, + EEpochRoutingElements & channelSrcElement, + EEpochRoutingElements & sdioutputDstElement) +{ + switch (streamid) + { + case bluefish_hardware_output_channel::channel_a: channelSrcElement = EPOCH_SRC_OUTPUT_MEM_INTERFACE_CHA; + sdioutputDstElement = EPOCH_DEST_SDI_OUTPUT_A; + break; + case bluefish_hardware_output_channel::channel_b: channelSrcElement = EPOCH_SRC_OUTPUT_MEM_INTERFACE_CHB; + sdioutputDstElement = EPOCH_DEST_SDI_OUTPUT_B; + break; + case bluefish_hardware_output_channel::channel_c: channelSrcElement = EPOCH_SRC_OUTPUT_MEM_INTERFACE_CHC; + sdioutputDstElement = EPOCH_DEST_SDI_OUTPUT_C; + break; + case bluefish_hardware_output_channel::channel_d: channelSrcElement = EPOCH_SRC_OUTPUT_MEM_INTERFACE_CHD; + sdioutputDstElement = EPOCH_DEST_SDI_OUTPUT_D; + break; + default: return false; + } + return true; +} + struct bluefish_consumer : boost::noncopyable { - spl::shared_ptr blue_; - const unsigned int device_index_; - const core::video_format_desc format_desc_; - const core::audio_channel_layout channel_layout_; - core::audio_channel_remapper channel_remapper_; - const int channel_index_; - - const std::wstring model_name_; - - spl::shared_ptr graph_; - boost::timer frame_timer_; - boost::timer tick_timer_; - boost::timer sync_timer_; + spl::shared_ptr blue_; + const unsigned int device_index_; + const core::video_format_desc format_desc_; + const core::audio_channel_layout channel_layout_; + core::audio_channel_remapper channel_remapper_; + const int channel_index_; + + const std::wstring model_name_; + + spl::shared_ptr graph_; + boost::timer frame_timer_; + boost::timer tick_timer_; + boost::timer sync_timer_; - unsigned int vid_fmt_; + unsigned int vid_fmt_; - std::array reserved_frames_; - tbb::concurrent_bounded_queue frame_buffer_; - tbb::atomic presentation_delay_millis_; - core::const_frame previous_frame_ = core::const_frame::empty(); + std::array all_frames_; + tbb::concurrent_bounded_queue reserved_frames_; + tbb::concurrent_bounded_queue live_frames_; + std::shared_ptr dma_present_thread_; + tbb::atomic end_dma_thread_; - const bool embedded_audio_; - const bool key_only_; + tbb::concurrent_bounded_queue frame_buffer_; + tbb::atomic presentation_delay_millis_; + core::const_frame previous_frame_ = core::const_frame::empty(); + + const bool embedded_audio_; + const bool key_only_; - executor executor_; + executor executor_; + hardware_downstream_keyer_mode hardware_keyer_; + hardware_downstream_keyer_audio_source keyer_audio_source_; + bluefish_hardware_output_channel device_output_channel_; public: bluefish_consumer( const core::video_format_desc& format_desc, @@ -92,63 +161,66 @@ public: int device_index, bool embedded_audio, bool key_only, - int channel_index) + hardware_downstream_keyer_mode keyer, + hardware_downstream_keyer_audio_source keyer_audio_source, + int channel_index, + bluefish_hardware_output_channel device_output_channel) : blue_(create_blue(device_index)) , device_index_(device_index) , format_desc_(format_desc) , channel_layout_(out_channel_layout) , channel_remapper_(in_channel_layout, out_channel_layout) , channel_index_(channel_index) - , model_name_(get_card_desc(*blue_)) + , model_name_(get_card_desc(*blue_, device_index)) , vid_fmt_(get_video_mode(*blue_, format_desc)) , embedded_audio_(embedded_audio) + , hardware_keyer_(keyer) + , keyer_audio_source_(keyer_audio_source) , key_only_(key_only) , executor_(print()) + , device_output_channel_(device_output_channel) { executor_.set_capacity(1); presentation_delay_millis_ = 0; + reserved_frames_.set_capacity(BLUEFISH_SOFTWARE_BUFFERS); + live_frames_.set_capacity(BLUEFISH_SOFTWARE_BUFFERS); + graph_->set_color("tick-time", diagnostics::color(0.0f, 0.6f, 0.9f)); graph_->set_color("sync-time", diagnostics::color(1.0f, 0.0f, 0.0f)); graph_->set_color("frame-time", diagnostics::color(0.5f, 1.0f, 0.2f)); graph_->set_text(print()); diagnostics::register_graph(graph_); - - //Setting output Video mode - if(BLUE_FAIL(set_card_property(blue_, VIDEO_MODE, vid_fmt_))) + + // Specify the video channel + setup_hardware_output_channel(); + + // Setting output Video mode + if (BLUE_FAIL(blue_->set_card_property32(VIDEO_MODE, vid_fmt_))) CASPAR_THROW_EXCEPTION(caspar_exception() << msg_info(print() + L" Failed to set videomode.")); - //Select Update Mode for output - if(BLUE_FAIL(set_card_property(blue_, VIDEO_UPDATE_TYPE, UPD_FMT_FRAME))) + // Select Update Mode for output + if(BLUE_FAIL(blue_->set_card_property32(VIDEO_UPDATE_TYPE, UPD_FMT_FRAME))) CASPAR_THROW_EXCEPTION(caspar_exception() << msg_info(print() + L" Failed to set update type.")); disable_video_output(); - - //Enable dual link output - if(BLUE_FAIL(set_card_property(blue_, VIDEO_DUAL_LINK_OUTPUT, 1))) - CASPAR_THROW_EXCEPTION(caspar_exception() << msg_info(print() + L" Failed to enable dual link.")); - - if(BLUE_FAIL(set_card_property(blue_, VIDEO_DUAL_LINK_OUTPUT_SIGNAL_FORMAT_TYPE, Signal_FormatType_4224))) - CASPAR_THROW_EXCEPTION(caspar_exception() << msg_info(print() + L" Failed to set dual link format type to 4:2:2:4.")); + setup_hardware_output_channel_routing(); //Select output memory format - if(BLUE_FAIL(set_card_property(blue_, VIDEO_MEMORY_FORMAT, MEM_FMT_ARGB_PC))) + if(BLUE_FAIL(blue_->set_card_property32(VIDEO_MEMORY_FORMAT, MEM_FMT_ARGB_PC))) CASPAR_THROW_EXCEPTION(caspar_exception() << msg_info(print() + L" Failed to set memory format.")); //Select image orientation - if(BLUE_FAIL(set_card_property(blue_, VIDEO_IMAGE_ORIENTATION, ImageOrientation_Normal))) + if(BLUE_FAIL(blue_->set_card_property32(VIDEO_IMAGE_ORIENTATION, ImageOrientation_Normal))) CASPAR_LOG(warning) << print() << L" Failed to set image orientation to normal."; // Select data range - if(BLUE_FAIL(set_card_property(blue_, VIDEO_RGB_DATA_RANGE, CGR_RANGE))) + if(BLUE_FAIL(blue_->set_card_property32(VIDEO_RGB_DATA_RANGE, CGR_RANGE))) CASPAR_LOG(warning) << print() << L" Failed to set RGB data range to CGR."; - if(BLUE_FAIL(set_card_property(blue_, VIDEO_PREDEFINED_COLOR_MATRIX, vid_fmt_ == VID_FMT_PAL ? MATRIX_601_CGR : MATRIX_709_CGR))) - CASPAR_LOG(warning) << print() << L" Failed to set colormatrix to " << (vid_fmt_ == VID_FMT_PAL ? L"601 CGR" : L"709 CGR") << L"."; - - if(!embedded_audio_) + if(!embedded_audio_ || (hardware_keyer_ == hardware_downstream_keyer_mode::internal && keyer_audio_source_ == hardware_downstream_keyer_audio_source::SDIVideoInput) ) { - if(BLUE_FAIL(set_card_property(blue_, EMBEDEDDED_AUDIO_OUTPUT, 0))) + if(BLUE_FAIL(blue_->set_card_property32(EMBEDEDDED_AUDIO_OUTPUT, 0))) CASPAR_LOG(warning) << TEXT("BLUECARD ERROR: Failed to disable embedded audio."); CASPAR_LOG(info) << print() << TEXT(" Disabled embedded-audio."); } @@ -166,27 +238,24 @@ public: if (channel_layout_.num_channels > 12) audio_value |= blue_emb_audio_group4_enable; - if(BLUE_FAIL(set_card_property(blue_, EMBEDEDDED_AUDIO_OUTPUT, audio_value))) + if(BLUE_FAIL(blue_->set_card_property32(EMBEDEDDED_AUDIO_OUTPUT, audio_value))) CASPAR_LOG(warning) << print() << TEXT(" Failed to enable embedded audio."); CASPAR_LOG(info) << print() << TEXT(" Enabled embedded-audio."); } - - if (blue_->has_output_key()) - { - int dummy = TRUE; int v4444 = FALSE; int invert = FALSE; int white = FALSE; - blue_->set_output_key(dummy, v4444, invert, white); - } - if(blue_->GetHDCardType(device_index_) != CRD_HD_INVALID) - blue_->Set_DownConverterSignalType(vid_fmt_ == VID_FMT_PAL ? SD_SDI : HD_SDI); - - if(BLUE_FAIL(set_card_property(blue_, VIDEO_OUTPUT_ENGINE, VIDEO_ENGINE_FRAMESTORE))) - CASPAR_LOG(warning) << print() << TEXT(" Failed to set video engine."); - + if(BLUE_FAIL(blue_->set_card_property32(VIDEO_OUTPUT_ENGINE, VIDEO_ENGINE_PLAYBACK))) + CASPAR_LOG(warning) << print() << TEXT(" Failed to set video engine."); + + if (is_epoch_card((*blue_))) + setup_hardware_downstream_keyer(hardware_keyer_, keyer_audio_source_); + enable_video_output(); int n = 0; - boost::range::generate(reserved_frames_, [&]{return std::make_shared(static_cast(format_desc_.size), n++);}); + boost::range::generate(all_frames_, [&]{return std::make_shared(static_cast(format_desc_.size), n++);}); + + for (size_t i = 0; i < all_frames_.size(); i++) + reserved_frames_.push(all_frames_[i]); } ~bluefish_consumer() @@ -195,8 +264,12 @@ public: { executor_.invoke([&] { + end_dma_thread_ = true; disable_video_output(); - blue_->device_detach(); + blue_->detach(); + + if (dma_present_thread_) + dma_present_thread_->join(); }); } catch(...) @@ -204,22 +277,174 @@ public: CASPAR_LOG_CURRENT_EXCEPTION(); } } - + + void setup_hardware_output_channel() + { + // This function would be used to setup the logic video channel in the bluefish hardware + EBlueVideoChannel out_vid_channel = get_bluesdk_videochannel_from_streamid(device_output_channel_); + if (is_epoch_card((*blue_))) + { + if (out_vid_channel != BLUE_VIDEOCHANNEL_INVALID) + { + if (BLUE_FAIL(blue_->set_card_property32(DEFAULT_VIDEO_OUTPUT_CHANNEL, out_vid_channel))) + CASPAR_THROW_EXCEPTION(caspar_exception() << msg_info(" Failed to set video stream.")); + + blue_->video_playback_stop(0, 0); + } + } + } + + void setup_hardware_output_channel_routing() + { + //This function would be used to setup the dual link and any other routing that would be required . + if (is_epoch_card(*blue_)) + { + EBlueVideoChannel blueVideoOutputChannel = get_bluesdk_videochannel_from_streamid(device_output_channel_); + EEpochRoutingElements src_element = (EEpochRoutingElements)0; + EEpochRoutingElements dst_element = (EEpochRoutingElements)0; + get_videooutput_channel_routing_info_from_streamid(device_output_channel_, src_element, dst_element); + bool duallink_4224_enabled = false; + + if ((device_output_channel_ == bluefish_hardware_output_channel::channel_a || device_output_channel_ == bluefish_hardware_output_channel::channel_c) && + (hardware_keyer_ == hardware_downstream_keyer_mode::external) || (hardware_keyer_ == hardware_downstream_keyer_mode::internal) ) + { + duallink_4224_enabled = true; + } + + // Enable/Disable dual link output + if (BLUE_FAIL(blue_->set_card_property32(VIDEO_DUAL_LINK_OUTPUT, duallink_4224_enabled))) + CASPAR_THROW_EXCEPTION(caspar_exception() << msg_info(print() + L" Failed to enable/disable dual link.")); + + if (!duallink_4224_enabled) + { + if (BLUE_FAIL(blue_->set_card_property32(VIDEO_DUAL_LINK_OUTPUT_SIGNAL_FORMAT_TYPE, Signal_FormatType_Independent_422))) + CASPAR_THROW_EXCEPTION(caspar_exception() << msg_info(print() + L" Failed to set dual link format type to 4:2:2.")); + + ULONG routingValue = EPOCH_SET_ROUTING(src_element, dst_element, BLUE_CONNECTOR_PROP_SINGLE_LINK); + if (BLUE_FAIL(blue_->set_card_property32(MR2_ROUTING, routingValue))) + CASPAR_THROW_EXCEPTION(caspar_exception() << msg_info(" Failed to MR 2 routing.")); + + // If single link 422, but on second channel AND on Neutron we need to set Genlock to Aux. + if (is_epoch_neutron_1i2o_card((*blue_))) + { + if (blueVideoOutputChannel == BLUE_VIDEO_OUTPUT_CHANNEL_B) + { + ULONG genLockSource = BlueGenlockAux; + if (BLUE_FAIL(blue_->set_card_property32(VIDEO_GENLOCK_SIGNAL, genLockSource))) + CASPAR_THROW_EXCEPTION(caspar_exception() << msg_info("Failed to set GenLock to Aux Input.")); + } + } + if (is_epoch_neutron_3o_card((*blue_))) + { + if (blueVideoOutputChannel == BLUE_VIDEO_OUTPUT_CHANNEL_C) + { + ULONG genLockSource = BlueGenlockAux; + if (BLUE_FAIL(blue_->set_card_property32(VIDEO_GENLOCK_SIGNAL, genLockSource))) + CASPAR_THROW_EXCEPTION(caspar_exception() << msg_info("Failed to set GenLock to Aux Input.")); + } + } + } + else // dual Link IS enabled, ie. 4224 Fill and Key + { + if (BLUE_FAIL(blue_->set_card_property32(VIDEO_DUAL_LINK_OUTPUT_SIGNAL_FORMAT_TYPE, Signal_FormatType_4224))) + CASPAR_THROW_EXCEPTION(caspar_exception() << msg_info(print() + L" Failed to set dual link format type to 4:2:2:4.")); + + if (is_epoch_neutron_1i2o_card((*blue_))) // Neutron cards require setting the Genlock conector to Aux to enable them to do Dual-Link + { + ULONG genLockSource = BlueGenlockAux; + if (BLUE_FAIL(blue_->set_card_property32(VIDEO_GENLOCK_SIGNAL, genLockSource))) + CASPAR_THROW_EXCEPTION(caspar_exception() << msg_info("Failed to set GenLock to Aux Input.")); + } + else if (is_epoch_neutron_3o_card((*blue_))) + { + if (blueVideoOutputChannel == BLUE_VIDEO_OUTPUT_CHANNEL_C) + { + ULONG genLockSource = BlueGenlockAux; + if (BLUE_FAIL(blue_->set_card_property32(VIDEO_GENLOCK_SIGNAL, genLockSource))) + CASPAR_THROW_EXCEPTION(caspar_exception() << msg_info("Failed to set GenLock to Aux Input.")); + } + } + } + } + } + + void setup_hardware_downstream_keyer(hardware_downstream_keyer_mode keyer, hardware_downstream_keyer_audio_source audio_source) + { + unsigned int keyer_control_value = 0, card_feature_value = 0; + unsigned int card_connector_value = 0; + unsigned int nOutputStreams = 0; + unsigned int nInputStreams = 0; + unsigned int nInputSDIConnector = 0; + unsigned int nOutputSDIConnector = 0; + if (BLUE_OK(blue_->get_card_property32(CARD_FEATURE_STREAM_INFO, card_feature_value))) + { + nOutputStreams = CARD_FEATURE_GET_SDI_OUTPUT_STREAM_COUNT(card_feature_value); + nInputStreams = CARD_FEATURE_GET_SDI_INPUT_STREAM_COUNT(card_feature_value); + } + if (BLUE_OK(blue_->get_card_property32(CARD_FEATURE_CONNECTOR_INFO, card_connector_value))) + { + nOutputSDIConnector = CARD_FEATURE_GET_SDI_OUTPUT_CONNECTOR_COUNT(card_connector_value); + nInputSDIConnector = CARD_FEATURE_GET_SDI_INPUT_CONNECTOR_COUNT(card_connector_value); + } + if (nInputSDIConnector == 0 || nInputStreams == 0) + return; + + if (keyer == hardware_downstream_keyer_mode::disable || keyer == hardware_downstream_keyer_mode::external) + { + keyer_control_value = VIDEO_ONBOARD_KEYER_SET_STATUS_DISABLED(keyer_control_value); + keyer_control_value = VIDEO_ONBOARD_KEYER_SET_STATUS_DISABLE_OVER_BLACK(keyer_control_value); + } + else if (keyer == hardware_downstream_keyer_mode::internal) + { + unsigned int invalidVideoModeFlag = 0; + unsigned int inputVideoSignal = 0; + if (BLUE_FAIL(blue_->get_card_property32(INVALID_VIDEO_MODE_FLAG, invalidVideoModeFlag))) + CASPAR_THROW_EXCEPTION(caspar_exception() << msg_info(" Failed to get invalid video mode flag")); + + // The bluefish HW keyer is NOT going to pre-multiply the RGB with the A. + keyer_control_value = VIDEO_ONBOARD_KEYER_SET_STATUS_DATA_IS_PREMULTIPLIED(keyer_control_value); + + keyer_control_value = VIDEO_ONBOARD_KEYER_SET_STATUS_ENABLED(keyer_control_value); + if (BLUE_FAIL(blue_->get_card_property32(VIDEO_INPUT_SIGNAL_VIDEO_MODE, inputVideoSignal))) + CASPAR_THROW_EXCEPTION(caspar_exception() << msg_info(" Failed to get video input signal mode")); + + if (inputVideoSignal >= invalidVideoModeFlag) + keyer_control_value = VIDEO_ONBOARD_KEYER_SET_STATUS_ENABLE_OVER_BLACK(keyer_control_value); + else + keyer_control_value = VIDEO_ONBOARD_KEYER_SET_STATUS_DISABLE_OVER_BLACK(keyer_control_value); + + // lock to input + if (BLUE_FAIL(blue_->set_card_property32(VIDEO_GENLOCK_SIGNAL, BlueSDI_A_BNC))) + CASPAR_THROW_EXCEPTION(caspar_exception() << msg_info(" Failed to set the genlock to the input for the HW keyer")); + } + + if (audio_source == hardware_downstream_keyer_audio_source::SDIVideoInput && (keyer == hardware_downstream_keyer_mode::internal)) + keyer_control_value = VIDEO_ONBOARD_KEYER_SET_STATUS_USE_INPUT_ANCILLARY(keyer_control_value); + else if (audio_source == hardware_downstream_keyer_audio_source::VideoOutputChannel) + keyer_control_value = VIDEO_ONBOARD_KEYER_SET_STATUS_USE_OUTPUT_ANCILLARY(keyer_control_value); + + if (BLUE_FAIL(blue_->set_card_property32(VIDEO_ONBOARD_KEYER, keyer_control_value))) + CASPAR_LOG(error) << print() << TEXT(" Failed to set keyer control."); + } + void enable_video_output() { - if(!BLUE_PASS(set_card_property(blue_, VIDEO_BLACKGENERATOR, 0))) + if(BLUE_FAIL(blue_->set_card_property32(VIDEO_BLACKGENERATOR, 0))) CASPAR_LOG(error) << print() << TEXT(" Failed to disable video output."); } void disable_video_output() { blue_->video_playback_stop(0,0); - if(!BLUE_PASS(set_card_property(blue_, VIDEO_BLACKGENERATOR, 1))) - CASPAR_LOG(error)<< print() << TEXT(" Failed to disable video output."); + if(BLUE_FAIL(blue_->set_card_property32(VIDEO_BLACKGENERATOR, 1))) + CASPAR_LOG(error)<< print() << TEXT(" Failed to disable video output."); + if (BLUE_FAIL(blue_->set_card_property32(EMBEDEDDED_AUDIO_OUTPUT, 0))) + CASPAR_LOG(error) << print() << TEXT(" Failed to disable audio output."); + } std::future send(core::const_frame& frame) - { + { return executor_.begin_invoke([=]() -> bool { try @@ -237,73 +462,129 @@ public: }); } - void display_frame(core::const_frame frame) + void dma_present_thread_actual() { - // Sync + bvc_wrapper wait_b; + wait_b.attach(device_index_); + EBlueVideoChannel out_vid_channel = get_bluesdk_videochannel_from_streamid(device_output_channel_); + wait_b.set_card_property32(DEFAULT_VIDEO_OUTPUT_CHANNEL, out_vid_channel); + int frames_to_buffer = BLUEFISH_HW_BUFFER_DEPTH; + unsigned long buffer_id = 0; + unsigned long underrun = 0; + + while (!end_dma_thread_) + { + blue_dma_buffer_ptr buf = nullptr; + if (live_frames_.try_pop(buf) && BLUE_OK(blue_->video_playback_allocate(buffer_id, underrun))) + { + // Send and display + if (embedded_audio_) + { + // Do video first, then do hanc DMA... + blue_->system_buffer_write(const_cast(buf->image_data()), + static_cast(buf->image_size()), + BlueImage_HANC_DMABuffer(buffer_id, BLUE_DATA_IMAGE), + 0); + + blue_->system_buffer_write(buf->hanc_data(), + static_cast(buf->hanc_size()), + BlueImage_HANC_DMABuffer(buffer_id, BLUE_DATA_HANC), + 0); + + if (BLUE_FAIL(blue_->video_playback_present(BlueBuffer_Image_HANC(buffer_id), 1, 0, 0))) + { + CASPAR_LOG(warning) << print() << TEXT(" video_playback_present failed."); + } + } + else + { + blue_->system_buffer_write(const_cast(buf->image_data()), + static_cast(buf->image_size()), + BlueImage_DMABuffer(buffer_id, BLUE_DATA_IMAGE), + 0); + + if (BLUE_FAIL(blue_->video_playback_present(BlueBuffer_Image(buffer_id), 1, 0, 0))) + CASPAR_LOG(warning) << print() << TEXT(" video_playback_present failed."); + } + + reserved_frames_.push(buf); + } + else + { + // do WFS + unsigned long n_field = 0; + wait_b.wait_video_output_sync(UPD_FMT_FRAME, n_field); + } - sync_timer_.restart(); - unsigned long n_field = 0; - blue_->wait_output_video_synch(UPD_FMT_FRAME, n_field); - graph_->set_value("sync-time", sync_timer_.elapsed()*format_desc_.fps*0.5); - + if (frames_to_buffer > 0) + { + frames_to_buffer--; + if (frames_to_buffer == 0) + { + if (BLUE_FAIL(blue_->video_playback_start(0, 0))) + CASPAR_LOG(warning) << print() << TEXT("Error video playback start failed"); + } + } + } + wait_b.detach(); + } + + void display_frame(core::const_frame frame) + { frame_timer_.restart(); if (previous_frame_ != core::const_frame::empty()) presentation_delay_millis_ = previous_frame_.get_age_millis(); previous_frame_ = frame; + blue_dma_buffer_ptr buf = nullptr; // Copy to local buffers - - if(!frame.image_data().empty()) + if (reserved_frames_.try_pop(buf)) { - if(key_only_) - aligned_memshfl(reserved_frames_.front()->image_data(), frame.image_data().begin(), frame.image_data().size(), 0x0F0F0F0F, 0x0B0B0B0B, 0x07070707, 0x03030303); + void* dest = buf->image_data(); + if (!frame.image_data().empty()) + { + if (key_only_) + aligned_memshfl(dest, frame.image_data().begin(), frame.image_data().size(), 0x0F0F0F0F, 0x0B0B0B0B, 0x07070707, 0x03030303); + else + A_memcpy(dest, frame.image_data().begin(), frame.image_data().size()); + } else - A_memcpy(reserved_frames_.front()->image_data(), frame.image_data().begin(), frame.image_data().size()); - } - else - A_memset(reserved_frames_.front()->image_data(), 0, reserved_frames_.front()->image_size()); - + A_memset(dest, 0, buf->image_size()); - // Send and display + frame_timer_.restart(); - if(embedded_audio_) - { - auto remapped_audio = channel_remapper_.mix_and_rearrange(frame.audio_data()); - auto frame_audio = core::audio_32_to_24(remapped_audio); - encode_hanc(reinterpret_cast(reserved_frames_.front()->hanc_data()), - frame_audio.data(), - static_cast(frame.audio_data().size()/channel_layout_.num_channels), - static_cast(channel_layout_.num_channels)); - - blue_->system_buffer_write_async(const_cast(reserved_frames_.front()->image_data()), - static_cast(reserved_frames_.front()->image_size()), - nullptr, - BlueImage_HANC_DMABuffer(reserved_frames_.front()->id(), BLUE_DATA_IMAGE)); - - blue_->system_buffer_write_async(reserved_frames_.front()->hanc_data(), - static_cast(reserved_frames_.front()->hanc_size()), - nullptr, - BlueImage_HANC_DMABuffer(reserved_frames_.front()->id(), BLUE_DATA_HANC)); - - if(BLUE_FAIL(blue_->render_buffer_update(BlueBuffer_Image_HANC(reserved_frames_.front()->id())))) - CASPAR_LOG(warning) << print() << TEXT(" render_buffer_update failed."); - } - else - { - blue_->system_buffer_write_async(const_cast(reserved_frames_.front()->image_data()), - static_cast(reserved_frames_.front()->image_size()), - nullptr, - BlueImage_DMABuffer(reserved_frames_.front()->id(), BLUE_DATA_IMAGE)); - - if(BLUE_FAIL(blue_->render_buffer_update(BlueBuffer_Image(reserved_frames_.front()->id())))) - CASPAR_LOG(warning) << print() << TEXT(" render_buffer_update failed."); - } + // remap, encode and copy hanc data + if (embedded_audio_) + { + auto remapped_audio = channel_remapper_.mix_and_rearrange(frame.audio_data()); + auto frame_audio = core::audio_32_to_24(remapped_audio); + encode_hanc(reinterpret_cast(buf->hanc_data()), + frame_audio.data(), + static_cast(frame.audio_data().size() / channel_layout_.num_channels), + static_cast(channel_layout_.num_channels)); + } + live_frames_.push(buf); - boost::range::rotate(reserved_frames_, std::begin(reserved_frames_)+1); - + // start the thread if required. + if (dma_present_thread_ == 0) + { + end_dma_thread_ = false; + dma_present_thread_ = std::make_shared([this] {dma_present_thread_actual(); }); +#if defined(_WIN32) + HANDLE handle = (HANDLE)dma_present_thread_->native_handle(); + SetThreadPriority(handle, THREAD_PRIORITY_HIGHEST); +#endif + } + } graph_->set_value("frame-time", static_cast(frame_timer_.elapsed()*format_desc_.fps*0.5)); + + // Sync + sync_timer_.restart(); + unsigned long n_field = 0; + blue_->wait_video_output_sync(UPD_FMT_FRAME, n_field); + graph_->set_value("sync-time", sync_timer_.elapsed()*format_desc_.fps*0.5); } void encode_hanc(BLUE_UINT32* hanc_data, void* audio_data, int audio_samples, int audio_nchannels) @@ -330,10 +611,9 @@ public: hanc_stream_info.hanc_data_ptr = hanc_data; hanc_stream_info.video_mode = vid_fmt_; - if (!is_epoch_card(*blue_)) - encode_hanc_frame(&hanc_stream_info, audio_data, audio_nchannels, audio_samples, sample_type, emb_audio_flag); - else - encode_hanc_frame_ex(blue_->has_video_cardtype(), &hanc_stream_info, audio_data, audio_nchannels, audio_samples, sample_type, emb_audio_flag); + int cardType = CRD_INVALID; + blue_->query_card_type(cardType, device_index_); + blue_->encode_hanc_frame(cardType, &hanc_stream_info, audio_data, audio_nchannels, audio_samples, sample_type, emb_audio_flag); } std::wstring print() const @@ -350,25 +630,38 @@ public: struct bluefish_consumer_proxy : public core::frame_consumer { - core::monitor::subject monitor_subject_; + core::monitor::subject monitor_subject_; - std::unique_ptr consumer_; - const int device_index_; - const bool embedded_audio_; - const bool key_only_; + std::unique_ptr consumer_; + const int device_index_; + const bool embedded_audio_; + const bool key_only_; - std::vector audio_cadence_; - core::video_format_desc format_desc_; - core::audio_channel_layout in_channel_layout_ = core::audio_channel_layout::invalid(); - core::audio_channel_layout out_channel_layout_; + std::vector audio_cadence_; + core::video_format_desc format_desc_; + core::audio_channel_layout in_channel_layout_ = core::audio_channel_layout::invalid(); + core::audio_channel_layout out_channel_layout_; + hardware_downstream_keyer_mode hardware_keyer_; + hardware_downstream_keyer_audio_source hardware_keyer_audio_source_; + bluefish_hardware_output_channel hardware_output_channel_; public: - bluefish_consumer_proxy(int device_index, bool embedded_audio, bool key_only, const core::audio_channel_layout& out_channel_layout) + bluefish_consumer_proxy(int device_index, + bool embedded_audio, + bool key_only, + hardware_downstream_keyer_mode keyer, + hardware_downstream_keyer_audio_source keyer_audio_source, + const core::audio_channel_layout& out_channel_layout, + bluefish_hardware_output_channel hardware_output_channel) + : device_index_(device_index) , embedded_audio_(embedded_audio) , key_only_(key_only) + , hardware_keyer_(keyer) + , hardware_keyer_audio_source_(keyer_audio_source) , out_channel_layout_(out_channel_layout) + , hardware_output_channel_(hardware_output_channel) { } @@ -384,7 +677,16 @@ public: out_channel_layout_ = in_channel_layout_; consumer_.reset(); - consumer_.reset(new bluefish_consumer(format_desc, in_channel_layout_, out_channel_layout_, device_index_, embedded_audio_, key_only_, channel_index)); + consumer_.reset(new bluefish_consumer( format_desc, + in_channel_layout_, + out_channel_layout_, + device_index_, + embedded_audio_, + key_only_, + hardware_keyer_, + hardware_keyer_audio_source_, + channel_index, + hardware_output_channel_)); } std::future send(core::const_frame frame) override @@ -417,7 +719,7 @@ public: int buffer_depth() const override { - return 1; + return BLUEFISH_HW_BUFFER_DEPTH; } int index() const override @@ -440,36 +742,49 @@ public: void describe_consumer(core::help_sink& sink, const core::help_repository& repo) { sink.short_description(L"Sends video on an SDI output using Bluefish video cards."); - sink.syntax(L"BLUEFISH {[device_index:int]|1} {[embedded_audio:EMBEDDED_AUDIO]} {[key_only:KEY_ONLY]} {CHANNEL_LAYOUT [channel_layout:string]}"); + sink.syntax(L"BLUEFISH {[device_index:int]|1} {[sdi_device:int]|a} {[embedded_audio:EMBEDDED_AUDIO]} {[key_only:KEY_ONLY]} {CHANNEL_LAYOUT [channel_layout:string]} {[keyer:string|disabled]} "); sink.para() - ->text(L"Sends video on an SDI output using Bluefish video cards. Multiple video cards can be ") + ->text(L"Sends video on an SDI output using Bluefish video cards. Multiple devices can be ") ->text(L"installed in the same machine and used at the same time, they will be addressed via ") ->text(L"different ")->code(L"device_index")->text(L" parameters."); + sink.para()->text(L"Multiple output channels can be accessed via the ")->code(L"sdi_device")->text(L" parameter."); sink.para()->text(L"Specify ")->code(L"embedded_audio")->text(L" to embed audio into the SDI signal."); sink.para() ->text(L"Specifying ")->code(L"key_only")->text(L" will extract only the alpha channel from the ") ->text(L"channel. This is useful when you have two SDI video cards, and neither has native support ") ->text(L"for separate fill/key output"); sink.para()->text(L"Specify ")->code(L"channel_layout")->text(L" to output a different audio channel layout than the channel uses."); + sink.para()->text(L"Specify ")->code(L"keyer")->text(L" to control the output channel configuration and hardware keyer") + ->text(L"disabled results in a single SDI stream of 422 output - This is the default") + ->text(L"external results in a 4224 stream across 2 SDI connectors, ") + ->text(L"internal results in a 422 output keyed over the incoming SDI input using the dedicated hardware keyer on the Bleufish hadrware"); + sink.para()->text(L"Specify ")->code(L"internal-keyer-audio-source")->text(L" to control the source of the audio and ANC data when using the internal/hardware keyer"); + sink.para()->text(L"Examples:"); sink.example(L">> ADD 1 BLUEFISH", L"uses the default device_index of 1."); sink.example(L">> ADD 1 BLUEFISH 2", L"for device_index 2."); sink.example( L">> ADD 1 BLUEFISH 1 EMBEDDED_AUDIO\n" + L">> ADD 1 BLUEFISH 2 KEY_ONLY", L"uses device with index 1 as fill output with audio and device with index 2 as key output."); + } -spl::shared_ptr create_consumer( - const std::vector& params, core::interaction_sink*, std::vector> channels) + +spl::shared_ptr create_consumer( const std::vector& params, + core::interaction_sink*, + std::vector> channels) { if(params.size() < 1 || !boost::iequals(params.at(0), L"BLUEFISH")) return core::frame_consumer::empty(); - const auto device_index = params.size() > 1 ? boost::lexical_cast(params.at(1)) : 1; - - const auto embedded_audio = contains_param( L"EMBEDDED_AUDIO", params); - const auto key_only = contains_param( L"KEY_ONLY", params); - const auto channel_layout = get_param( L"CHANNEL_LAYOUT", params); + const auto device_index = params.size() > 1 ? boost::lexical_cast(params.at(1)) : 1; + const auto device_stream = contains_param( L"SDI-STREAM", params); + const auto embedded_audio = contains_param( L"EMBEDDED_AUDIO", params); + const auto key_only = contains_param( L"KEY_ONLY", params); + const auto channel_layout = get_param( L"CHANNEL_LAYOUT", params); + const auto keyer_option = contains_param( L"KEYER", params); + const auto keyer_audio_option = contains_param( L"INTERNAL-KEYER-AUDIO-SOURCE", params); auto layout = core::audio_channel_layout::invalid(); @@ -483,17 +798,46 @@ spl::shared_ptr create_consumer( layout = *found_layout; } - return spl::make_shared(device_index, embedded_audio, key_only, layout); + bluefish_hardware_output_channel device_output_channel = bluefish_hardware_output_channel::channel_a; + if (contains_param(L"A", params)) + device_output_channel = bluefish_hardware_output_channel::channel_a; + else if (contains_param(L"B", params)) + device_output_channel = bluefish_hardware_output_channel::channel_b; + else if (contains_param(L"C", params)) + device_output_channel = bluefish_hardware_output_channel::channel_c; + else if (contains_param(L"D", params)) + device_output_channel = bluefish_hardware_output_channel::channel_d; + + hardware_downstream_keyer_mode keyer = hardware_downstream_keyer_mode::disable; + if (contains_param(L"DISABLED", params)) + keyer = hardware_downstream_keyer_mode::disable; + else if (contains_param(L"EXTERNAL", params)) + keyer = hardware_downstream_keyer_mode::external; + else if (contains_param(L"INTERNAL", params)) + keyer = hardware_downstream_keyer_mode::internal; + + hardware_downstream_keyer_audio_source keyer_audio_source = hardware_downstream_keyer_audio_source::VideoOutputChannel; + if (contains_param(L"SDIVIDEOINPUT", params)) + keyer_audio_source = hardware_downstream_keyer_audio_source::SDIVideoInput; + else + if (contains_param(L"VIDEOOUTPUTCHANNEL", params)) + keyer_audio_source = hardware_downstream_keyer_audio_source::VideoOutputChannel; + + return spl::make_shared(device_index, embedded_audio, key_only, keyer, keyer_audio_source, layout, device_output_channel); } spl::shared_ptr create_preconfigured_consumer( - const boost::property_tree::wptree& ptree, core::interaction_sink*, std::vector> channels) -{ + const boost::property_tree::wptree& ptree, core::interaction_sink*, + std::vector> channels) +{ const auto device_index = ptree.get( L"device", 1); + const auto device_stream = ptree.get( L"sdi-stream", L"a"); const auto embedded_audio = ptree.get( L"embedded-audio", false); const auto key_only = ptree.get( L"key-only", false); const auto channel_layout = ptree.get_optional( L"channel-layout"); - + const auto hardware_keyer_value = ptree.get( L"keyer", L"disabled"); + const auto keyer_audio_source_value = ptree.get( L"internal-keyer-audio-source", L"videooutputchannel"); + auto layout = core::audio_channel_layout::invalid(); if (channel_layout) @@ -508,7 +852,32 @@ spl::shared_ptr create_preconfigured_consumer( layout = *found_layout; } - return spl::make_shared(device_index, embedded_audio, key_only, layout); + bluefish_hardware_output_channel device_output_channel = bluefish_hardware_output_channel::channel_a; + if (device_stream == L"a") + device_output_channel = bluefish_hardware_output_channel::channel_a; + else if (device_stream == L"b") + device_output_channel = bluefish_hardware_output_channel::channel_b; + else if (device_stream == L"c") + device_output_channel = bluefish_hardware_output_channel::channel_c; + else if (device_stream == L"d") + device_output_channel = bluefish_hardware_output_channel::channel_d; + + hardware_downstream_keyer_mode keyer_mode = hardware_downstream_keyer_mode::disable; + if (hardware_keyer_value == L"disabled") + keyer_mode = hardware_downstream_keyer_mode::disable; + else if (hardware_keyer_value == L"external") + keyer_mode = hardware_downstream_keyer_mode::external; + else if (hardware_keyer_value == L"internal") + keyer_mode = hardware_downstream_keyer_mode::internal; + + hardware_downstream_keyer_audio_source keyer_audio_source = hardware_downstream_keyer_audio_source::VideoOutputChannel; + if (keyer_audio_source_value == L"videooutputchannel") + keyer_audio_source = hardware_downstream_keyer_audio_source::VideoOutputChannel; + else + if (keyer_audio_source_value == L"sdivideoinput") + keyer_audio_source = hardware_downstream_keyer_audio_source::SDIVideoInput; + + return spl::make_shared(device_index, embedded_audio, key_only, keyer_mode, keyer_audio_source, layout, device_output_channel); } }} \ No newline at end of file diff --git a/modules/bluefish/consumer/bluefish_consumer.h b/modules/bluefish/consumer/bluefish_consumer.h index bcdc48bdd..dab1c4e95 100644 --- a/modules/bluefish/consumer/bluefish_consumer.h +++ b/modules/bluefish/consumer/bluefish_consumer.h @@ -32,11 +32,14 @@ namespace caspar { namespace bluefish { void describe_consumer(core::help_sink& sink, const core::help_repository& repo); -spl::shared_ptr create_consumer( - const std::vector& params, core::interaction_sink*, - std::vector> channels); -spl::shared_ptr create_preconfigured_consumer( - const boost::property_tree::wptree& ptree, core::interaction_sink*, - std::vector> channels); -}} + +spl::shared_ptr create_consumer( const std::vector& params, + core::interaction_sink*, + std::vector> channels); + + +spl::shared_ptr create_preconfigured_consumer( + const boost::property_tree::wptree& ptree, core::interaction_sink*, + std::vector> channels); +}} \ No newline at end of file diff --git a/modules/bluefish/util/blue_velvet.cpp b/modules/bluefish/util/blue_velvet.cpp index e1802c6d5..5be4716b4 100644 --- a/modules/bluefish/util/blue_velvet.cpp +++ b/modules/bluefish/util/blue_velvet.cpp @@ -20,67 +20,222 @@ */ #include "../StdAfx.h" - #include "blue_velvet.h" +#include +#include +#include -#include +#if defined(__APPLE__) +#include +#endif -#include +#if defined(_WIN32) + #define GET_PROCADDR_FOR_FUNC(name, module) { name = (pFunc_##name)GetProcAddress(reinterpret_cast(module), #name); if(!name) { return false; } } +#elif defined(__APPLE__) + #define GET_PROCADDR_FOR_FUNC(name, module) { name = (pFunc_##name)dlsym(module, #name); if(!name) { return false; } } +#endif namespace caspar { namespace bluefish { - -CBlueVelvet4* (*BlueVelvetFactory4)() = nullptr; -void (*BlueVelvetDestroy)(CBlueVelvet4* pObj) = nullptr; -const char* (*BlueVelvetVersion)() = nullptr; -BLUE_UINT32 (*encode_hanc_frame)(struct hanc_stream_info_struct * hanc_stream_ptr, void * audio_pcm_ptr,BLUE_UINT32 no_audio_ch,BLUE_UINT32 no_audio_samples,BLUE_UINT32 nTypeOfSample,BLUE_UINT32 emb_audio_flag) = nullptr; -BLUE_UINT32 (*encode_hanc_frame_ex)(BLUE_UINT32 card_type, struct hanc_stream_info_struct * hanc_stream_ptr, void * audio_pcm_ptr, BLUE_UINT32 no_audio_ch, BLUE_UINT32 no_audio_samples, BLUE_UINT32 nTypeOfSample, BLUE_UINT32 emb_audio_flag) = nullptr; -void blue_velvet_initialize() -{ + bvc_wrapper::bvc_wrapper() + { + if(!init_function_pointers()) + CASPAR_THROW_EXCEPTION(not_supported() << msg_info("Bluefish drivers not found. Unable to init Funcion Pointers")); + + bvc_ = std::shared_ptr(bfcFactory(), bfcDestroy); + + if (!bvc_) + CASPAR_THROW_EXCEPTION(not_supported() << msg_info("Bluefish drivers not found.")); + } + + bool bvc_wrapper::init_function_pointers() + { + bool res = false; +#if defined(_WIN32) #ifdef _DEBUG - std::string module_str = "BlueVelvet64_d.dll"; + h_module_ = std::shared_ptr(LoadLibraryExA("BlueVelvetC64_d.dll", NULL, 0), FreeLibrary); #else - std::string module_str = "BlueVelvet64.dll"; + h_module_ = std::shared_ptr(LoadLibraryExA("BlueVelvetC64.dll", NULL, 0), FreeLibrary); +#endif + +#elif defined(__APPLE__) + // Look for the framework and load it accordingly. + char* libraryPath("/Library/Frameworks/BlueVelvetC.framework"); // full path may not be required, OSX might check in /l/f by default - MUST TEST! + h_module_ = std::shared_ptr(dlopen(libraryPath, RTLD_NOW), dlclose); #endif + + if (h_module_) + { + GET_PROCADDR_FOR_FUNC(bfcGetVersion, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcFactory, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcDestroy, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcEnumerate, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcQueryCardType, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcAttach, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcDetach, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcQueryCardProperty32, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcQueryCardProperty64, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcSetCardProperty32, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcSetCardProperty64, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcGetCardSerialNumber, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcGetCardFwVersion, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcWaitVideoSyncAsync, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcWaitVideoInputSync, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcWaitVideoOutputSync, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcGetVideoOutputCurrentFieldCount, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcGetVideoInputCurrentFieldCount, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcVideoCaptureStart, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcVideoCaptureStop, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcVideoPlaybackStart, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcVideoPlaybackStop, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcVideoPlaybackAllocate, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcVideoPlaybackPresent, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcVideoPlaybackRelease, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcGetCaptureVideoFrameInfoEx, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcRenderBufferCapture, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcRenderBufferUpdate, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcGetRenderBufferCount, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcEncodeHancFrameEx, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcDecodeHancFrameEx, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcSystemBufferReadAsync, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcSystemBufferWriteAsync, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcGetBytesForGroupPixels, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcGetPixelsPerLine, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcGetLinesPerFrame, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcGetBytesPerLine, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcGetBytesPerFrame, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcGetGoldenValue, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcGetVBILines, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcGetVANCGoldenValue, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcGetVANCLineBytes, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcGetVANCLineCount, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcGetWindowsDriverHandle, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcUtilsGetStringForCardType, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcUtilsGetStringForBlueProductId, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcUtilsGetStringForVideoMode, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcUtilsGetStringForMemoryFormat, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcUtilsGetMR2Routing, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcUtilsSetMR2Routing, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcUtilsGetAudioOutputRouting, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcUtilsSetAudioOutputRouting, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcUtilsIsVideoModeProgressive, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcUtilsIsVideoMode1001Framerate, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcUtilsGetFpsForVideoMode, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcUtilsGetVideoModeForFrameInfo, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcUtilsGetFrameInfoForVideoMode, h_module_.get()); + GET_PROCADDR_FOR_FUNC(bfcUtilsGetAudioSamplesPerFrame, h_module_.get()); + res = true; + } + return res; + } - auto module = LoadLibrary(u16(module_str).c_str()); - if(!module) - LoadLibrary(u16(std::string(getenv("SystemDrive")) + "\\Program Files\\Bluefish444\\Driver\\" + module_str).c_str()); - if(!module) - LoadLibrary(u16(std::string(getenv("SystemDrive")) + "\\Program Files (x86)\\BlueFish444\\Driver\\" + module_str).c_str()); - if(!module) - CASPAR_THROW_EXCEPTION(file_not_found() << msg_info("Could not find BlueVelvet3.dll. Required drivers are not installed.")); - static std::shared_ptr lib(module, FreeLibrary); - BlueVelvetFactory4 = reinterpret_cast(GetProcAddress(module, "BlueVelvetFactory4")); - BlueVelvetDestroy = reinterpret_cast(GetProcAddress(module, "BlueVelvetDestroy")); - BlueVelvetVersion = reinterpret_cast(GetProcAddress(module, "BlueVelvetVersion")); -} + const char * bvc_wrapper::get_version() + { + return bfcGetVersion(); + } -void blue_hanc_initialize() -{ -#ifdef _DEBUG - std::string module_str = "BlueHancUtils64_d.dll"; -#else - std::string module_str = "BlueHancUtils64.dll"; -#endif - - auto module = LoadLibrary(u16(module_str).c_str()); - if(!module) - LoadLibrary(u16(std::string(getenv("SystemDrive")) + "\\Program Files\\Bluefish444\\Driver\\" + module_str).c_str()); - if(!module) - LoadLibrary(u16(std::string(getenv("SystemDrive")) + "\\Program Files (x86)\\BlueFish444\\Driver\\" + module_str).c_str()); - if(!module) - CASPAR_THROW_EXCEPTION(file_not_found() << msg_info("Could not find BlueHancUtils.dll. Required drivers are not installed.")); - static std::shared_ptr lib(module, FreeLibrary); - encode_hanc_frame = reinterpret_cast(GetProcAddress(module, "encode_hanc_frame")); - encode_hanc_frame_ex = reinterpret_cast(GetProcAddress(module, "encode_hanc_frame_ex")); -} + BLUE_UINT32 bvc_wrapper::attach(int iDeviceId) + { + return bfcAttach(bvc_.get(), iDeviceId); + } + + BLUE_UINT32 bvc_wrapper::detach() + { + return bfcDetach(bvc_.get()); + } + + BLUE_UINT32 bvc_wrapper::get_card_property32(const int iProperty, unsigned int & nValue) + { + return (BLUE_UINT32)bfcQueryCardProperty32(bvc_.get(), iProperty, nValue); + } + + BLUE_UINT32 bvc_wrapper::set_card_property32(const int iProperty, const unsigned int nValue) + { + return bfcSetCardProperty32(bvc_.get(), iProperty, nValue); + } + + BLUE_UINT32 bvc_wrapper::enumerate(int & iDevices) + { + return bfcEnumerate(bvc_.get(), iDevices); + } + + BLUE_UINT32 bvc_wrapper::query_card_type(int & iCardType, int iDeviceID) + { + return bfcQueryCardType(bvc_.get(), iCardType, iDeviceID); + } + + BLUE_UINT32 bvc_wrapper::system_buffer_write(unsigned char * pPixels, unsigned long ulSize, unsigned long ulBufferID, unsigned long ulOffset) + { + return bfcSystemBufferWriteAsync(bvc_.get(), pPixels, ulSize, nullptr, ulBufferID, ulOffset); + } + + BLUE_UINT32 bvc_wrapper::system_buffer_read(unsigned char* pPixels, unsigned long ulSize, unsigned long ulBufferID, unsigned long ulOffset) + { + return bfcSystemBufferReadAsync(bvc_.get(), pPixels, ulSize, nullptr, ulBufferID, ulOffset); + } + + BLUE_UINT32 bvc_wrapper::video_playback_stop(int iWait, int iFlush) + { + return bfcVideoPlaybackStop(bvc_.get(), iWait, iFlush); + } + + BLUE_UINT32 bvc_wrapper::video_playback_start(int step, int loop) + { + return bfcVideoPlaybackStart(bvc_.get(), step, loop); + } + + BLUE_UINT32 bvc_wrapper::video_playback_allocate(unsigned long& buffer_id, unsigned long& underrun) + { + void* unused = nullptr; + return bfcVideoPlaybackAllocate(bvc_.get(), &unused, buffer_id, underrun); + } + + BLUE_UINT32 bvc_wrapper::video_playback_present(unsigned long buffer_id, unsigned long count, unsigned long keep, unsigned long odd) + { + unsigned long unique_id; + return bfcVideoPlaybackPresent(bvc_.get(), unique_id, buffer_id, count, keep, odd); + } + + BLUE_UINT32 bvc_wrapper::wait_video_output_sync(unsigned long ulUpdateType, unsigned long & ulFieldCount) + { + return bfcWaitVideoOutputSync(bvc_.get(), ulUpdateType, ulFieldCount); + } + + BLUE_UINT32 bvc_wrapper::wait_video_input_sync(unsigned long ulUpdateType, unsigned long & ulFieldCount) + { + return bfcWaitVideoInputSync(bvc_.get(), ulUpdateType, ulFieldCount); + } + + BLUE_UINT32 bvc_wrapper::render_buffer_update( unsigned long ulBufferID) + { + return bfcRenderBufferUpdate(bvc_.get(), ulBufferID); + } + + BLUE_UINT32 bvc_wrapper::render_buffer_capture(unsigned long ulBufferID) + { + return bfcRenderBufferCapture(bvc_.get(), ulBufferID); + } + + BLUE_UINT32 bvc_wrapper::encode_hanc_frame(unsigned int nCardType, hanc_stream_info_struct * pHancEncodeInfo, void * pAudioBuffer, unsigned int nAudioChannels, unsigned int nAudioSamples, unsigned int nSampleType, unsigned int nAudioFlags) + { + return bfcEncodeHancFrameEx(bvc_.get(), CRD_BLUE_NEUTRON, pHancEncodeInfo, pAudioBuffer, nAudioChannels, nAudioSamples, nSampleType, nAudioFlags); + } + + BLUE_UINT32 bvc_wrapper::decode_hanc_frame(unsigned int nCardType, unsigned int * pHancBuffer, hanc_decode_struct * pHancDecodeInfo) + { + return bfcDecodeHancFrameEx(bvc_.get(), CRD_BLUE_NEUTRON, pHancBuffer, pHancDecodeInfo); + } + + BLUE_UINT32 bvc_wrapper::get_frame_info_for_video_mode(const unsigned int nVideoMode, unsigned int& nWidth, unsigned int& nHeight, unsigned int& nRate, unsigned int& bIs1001, unsigned int& bIsProgressive) + { + return bfcUtilsGetFrameInfoForVideoMode(nVideoMode, nWidth, nHeight, nRate, bIs1001, bIsProgressive); + } + + BLUE_UINT32 bvc_wrapper::get_bytes_per_frame(EVideoMode nVideoMode, EMemoryFormat nMemoryFormat, EUpdateMethod nUpdateMethod, unsigned int& nBytesPerFrame) + { + return bfcGetBytesPerFrame(nVideoMode, nMemoryFormat, nUpdateMethod, nBytesPerFrame); + } -void blue_initialize() -{ - blue_hanc_initialize(); - blue_velvet_initialize(); -} EVideoMode vid_fmt_from_video_format(const core::video_format& fmt) { @@ -112,100 +267,269 @@ EVideoMode vid_fmt_from_video_format(const core::video_format& fmt) } } -bool is_epoch_card(CBlueVelvet4& blue) +bool is_epoch_card(bvc_wrapper& blue) { - switch(blue.has_video_cardtype()) - { - case CRD_BLUE_EPOCH_HORIZON: - case CRD_BLUE_EPOCH_CORE: - case CRD_BLUE_EPOCH_ULTRA: - case CRD_BLUE_EPOCH_2K_HORIZON: - case CRD_BLUE_EPOCH_2K_CORE: - case CRD_BLUE_EPOCH_2K_ULTRA: - case CRD_BLUE_CREATE_HD: - case CRD_BLUE_CREATE_2K: - case CRD_BLUE_CREATE_2K_ULTRA: - case CRD_BLUE_SUPER_NOVA: + int device_id = 1; + int card_type = 0; + blue.query_card_type(card_type, device_id); + + switch(card_type) + { + case CRD_BLUE_EPOCH_HORIZON: + case CRD_BLUE_EPOCH_CORE: + case CRD_BLUE_EPOCH_ULTRA: + case CRD_BLUE_EPOCH_2K_HORIZON: + case CRD_BLUE_EPOCH_2K_CORE: + case CRD_BLUE_EPOCH_2K_ULTRA: + case CRD_BLUE_CREATE_HD: + case CRD_BLUE_CREATE_2K: + case CRD_BLUE_CREATE_2K_ULTRA: + case CRD_BLUE_SUPER_NOVA: + case CRD_BLUE_SUPER_NOVA_S_PLUS: + case CRD_BLUE_NEUTRON: + case CRD_BLUE_EPOCH_CG: return true; default: return false; } } -std::wstring get_card_desc(CBlueVelvet4& blue) +bool is_epoch_neutron_1i2o_card(bvc_wrapper& blue) { - switch(blue.has_video_cardtype()) - { - case CRD_BLUEDEEP_LT: return L"Deepblue LT";// D64 Lite - case CRD_BLUEDEEP_SD: return L"Iridium SD";// Iridium SD - case CRD_BLUEDEEP_AV: return L"Iridium AV";// Iridium AV - case CRD_BLUEDEEP_IO: return L"Deepblue IO";// D64 Full - case CRD_BLUEWILD_AV: return L"Wildblue AV";// D64 AV - case CRD_IRIDIUM_HD: return L"Iridium HD";// * Iridium HD - case CRD_BLUEWILD_RT: return L"Wildblue RT";// D64 RT - case CRD_BLUEWILD_HD: return L"Wildblue HD";// * BadAss G2 - case CRD_REDDEVIL: return L"Iridium Full";// Iridium Full - case CRD_BLUEDEEP_HD: - case CRD_BLUEDEEP_HDS: return L"Reserved for \"BasAss G2";// * BadAss G2 variant, proposed, reserved - case CRD_BLUE_ENVY: return L"Blue Envy"; // Mini Din - case CRD_BLUE_PRIDE: return L"Blue Pride";//Mini Din Output - case CRD_BLUE_GREED: return L"Blue Greed"; - case CRD_BLUE_INGEST: return L"Blue Ingest"; - case CRD_BLUE_SD_DUALLINK: return L"Blue SD Duallink"; - case CRD_BLUE_CATALYST: return L"Blue Catalyst"; - case CRD_BLUE_SD_DUALLINK_PRO: return L"Blue SD Duallink Pro"; - case CRD_BLUE_SD_INGEST_PRO: return L"Blue SD Ingest pro"; - case CRD_BLUE_SD_DEEPBLUE_LITE_PRO: return L"Blue SD Deepblue lite Pro"; - case CRD_BLUE_SD_SINGLELINK_PRO: return L"Blue SD Singlelink Pro"; - case CRD_BLUE_SD_IRIDIUM_AV_PRO: return L"Blue SD Iridium AV Pro"; - case CRD_BLUE_SD_FIDELITY: return L"Blue SD Fidelity"; - case CRD_BLUE_SD_FOCUS: return L"Blue SD Focus"; - case CRD_BLUE_SD_PRIME: return L"Blue SD Prime"; - case CRD_BLUE_EPOCH_2K_CORE: return L"Blue Epoch 2K Core"; - case CRD_BLUE_EPOCH_2K_ULTRA: return L"Blue Epoch 2K Ultra"; - case CRD_BLUE_EPOCH_HORIZON: return L"Blue Epoch Horizon"; - case CRD_BLUE_EPOCH_CORE: return L"Blue Epoch Core"; - case CRD_BLUE_EPOCH_ULTRA: return L"Blue Epoch Ultra"; - case CRD_BLUE_CREATE_HD: return L"Blue Create HD"; - case CRD_BLUE_CREATE_2K: return L"Blue Create 2K"; - case CRD_BLUE_CREATE_2K_ULTRA: return L"Blue Create 2K Ultra"; - default: return L"Unknown"; - } + BLUE_UINT32 val = 0; + blue.get_card_property32(EPOCH_GET_PRODUCT_ID, val); + if (val == ORAC_NEUTRON_1_IN_2_OUT_FIRMWARE_PRODUCTID) + return true; + else + return false; } -EVideoMode get_video_mode(CBlueVelvet4& blue, const core::video_format_desc& format_desc) +bool is_epoch_neutron_3o_card(bvc_wrapper& blue) { - EVideoMode vid_fmt = VID_FMT_INVALID; - auto desiredVideoFormat = vid_fmt_from_video_format(format_desc.format); - int videoModeCount = blue.count_video_mode(); - for(int videoModeIndex = 1; videoModeIndex <= videoModeCount; ++videoModeIndex) + BLUE_UINT32 val = 0; + blue.get_card_property32(EPOCH_GET_PRODUCT_ID, val); + + if (val == ORAC_NEUTRON_0_IN_3_OUT_FIRMWARE_PRODUCTID) + return true; + else + return false; +} + +std::wstring get_card_desc(bvc_wrapper& blue, int device_id) +{ + int card_type = 0; + blue.query_card_type(card_type, device_id); + + switch(card_type) { - EVideoMode videoMode = blue.enum_video_mode(videoModeIndex); - if(videoMode == desiredVideoFormat) - vid_fmt = videoMode; + case CRD_BLUEDEEP_LT: return L"Deepblue LT";// D64 Lite + case CRD_BLUEDEEP_SD: return L"Iridium SD";// Iridium SD + case CRD_BLUEDEEP_AV: return L"Iridium AV";// Iridium AV + case CRD_BLUEDEEP_IO: return L"Deepblue IO";// D64 Full + case CRD_BLUEWILD_AV: return L"Wildblue AV";// D64 AV + case CRD_IRIDIUM_HD: return L"Iridium HD";// * Iridium HD + case CRD_BLUEWILD_RT: return L"Wildblue RT";// D64 RT + case CRD_BLUEWILD_HD: return L"Wildblue HD";// * BadAss G2 + case CRD_REDDEVIL: return L"Iridium Full";// Iridium Full + case CRD_BLUEDEEP_HD: + case CRD_BLUEDEEP_HDS: return L"Reserved for \"BasAss G2";// * BadAss G2 variant, proposed, reserved + case CRD_BLUE_ENVY: return L"Blue Envy"; // Mini Din + case CRD_BLUE_PRIDE: return L"Blue Pride";//Mini Din Output + case CRD_BLUE_GREED: return L"Blue Greed"; + case CRD_BLUE_INGEST: return L"Blue Ingest"; + case CRD_BLUE_SD_DUALLINK: return L"Blue SD Duallink"; + case CRD_BLUE_CATALYST: return L"Blue Catalyst"; + case CRD_BLUE_SD_DUALLINK_PRO: return L"Blue SD Duallink Pro"; + case CRD_BLUE_SD_INGEST_PRO: return L"Blue SD Ingest pro"; + case CRD_BLUE_SD_DEEPBLUE_LITE_PRO: return L"Blue SD Deepblue lite Pro"; + case CRD_BLUE_SD_SINGLELINK_PRO: return L"Blue SD Singlelink Pro"; + case CRD_BLUE_SD_IRIDIUM_AV_PRO: return L"Blue SD Iridium AV Pro"; + case CRD_BLUE_SD_FIDELITY: return L"Blue SD Fidelity"; + case CRD_BLUE_SD_FOCUS: return L"Blue SD Focus"; + case CRD_BLUE_SD_PRIME: return L"Blue SD Prime"; + case CRD_BLUE_EPOCH_2K_CORE: return L"Blue Epoch 2K Core"; + case CRD_BLUE_EPOCH_2K_ULTRA: return L"Blue Epoch 2K Ultra"; + case CRD_BLUE_EPOCH_HORIZON: return L"Blue Epoch Horizon"; + case CRD_BLUE_EPOCH_CORE: return L"Blue Epoch Core"; + case CRD_BLUE_EPOCH_ULTRA: return L"Blue Epoch Ultra"; + case CRD_BLUE_CREATE_HD: return L"Blue Create HD"; + case CRD_BLUE_CREATE_2K: return L"Blue Create 2K"; + case CRD_BLUE_CREATE_2K_ULTRA: return L"Blue Create 2K Ultra"; + case CRD_BLUE_SUPER_NOVA: return L"Blue SuperNova"; + case CRD_BLUE_SUPER_NOVA_S_PLUS: return L"Blue SuperNova s+"; + case CRD_BLUE_NEUTRON: return L"Blue Neutron 4k"; + case CRD_BLUE_EPOCH_CG: return L"Blue Epopch CG"; + default: return L"Unknown"; } - if(vid_fmt == VID_FMT_INVALID) +} + +EVideoMode get_video_mode(bvc_wrapper& blue, const core::video_format_desc& format_desc) +{ + EVideoMode vid_fmt = VID_FMT_INVALID; + BLUE_UINT32 invalid_fmt = 0; + BErr err = 0; + err = blue.get_card_property32(INVALID_VIDEO_MODE_FLAG, invalid_fmt); + vid_fmt = vid_fmt_from_video_format(format_desc.format); + + if (vid_fmt == VID_FMT_INVALID) CASPAR_THROW_EXCEPTION(not_supported() << msg_info(L"video-mode not supported: " + format_desc.name)); + + if ((unsigned int)vid_fmt >= invalid_fmt) + CASPAR_THROW_EXCEPTION(not_supported() << msg_info(L"video-mode not supported - Outside of valid range: " + format_desc.name)); + return vid_fmt; } -spl::shared_ptr create_blue() +spl::shared_ptr create_blue() { - if(!BlueVelvetFactory4 || !encode_hanc_frame) - CASPAR_THROW_EXCEPTION(not_supported() << msg_info("Bluefish drivers not found.")); - - return spl::shared_ptr(BlueVelvetFactory4(), BlueVelvetDestroy); + auto pWrap = new bvc_wrapper(); + return spl::shared_ptr(pWrap); } -spl::shared_ptr create_blue(int device_index) +spl::shared_ptr create_blue(int device_index) { auto blue = create_blue(); - if(BLUE_FAIL(blue->device_attach(device_index, FALSE))) + if(BLUE_FAIL(blue->attach(device_index))) CASPAR_THROW_EXCEPTION(caspar_exception() << msg_info("Failed to attach device.")); return blue; } +core::video_format video_format_from_vid_fmt(EVideoMode fmt) +{ + switch (fmt) + { + case VID_FMT_PAL: return core::video_format::pal; + case VID_FMT_NTSC: return core::video_format::ntsc; + case VID_FMT_720P_2398: return core::video_format::x720p2398; + case VID_FMT_720P_2400: return core::video_format::x720p2400; + case VID_FMT_720P_2500: return core::video_format::x720p2500; + case VID_FMT_720P_5000: return core::video_format::x720p5000; + case VID_FMT_720P_2997: return core::video_format::x720p2997; + case VID_FMT_720P_5994: return core::video_format::x720p5994; + case VID_FMT_720P_3000: return core::video_format::x720p3000; + case VID_FMT_720P_6000: return core::video_format::x720p6000; + case VID_FMT_1080P_2397: return core::video_format::x1080p2398; + case VID_FMT_1080P_2400: return core::video_format::x1080p2400; + case VID_FMT_1080I_5000: return core::video_format::x1080i5000; + case VID_FMT_1080I_5994: return core::video_format::x1080i5994; + case VID_FMT_1080I_6000: return core::video_format::x1080i6000; + case VID_FMT_1080P_2500: return core::video_format::x1080p2500; + case VID_FMT_1080P_2997: return core::video_format::x1080p2997; + case VID_FMT_1080P_3000: return core::video_format::x1080p3000; + case VID_FMT_1080P_5000: return core::video_format::x1080p5000; + case VID_FMT_1080P_5994: return core::video_format::x1080p5994; + case VID_FMT_1080P_6000: return core::video_format::x1080p6000; + default: return core::video_format::invalid; + } +} + +core::video_format_desc get_format_desc(bvc_wrapper& blue, EVideoMode vid_fmt, EMemoryFormat mem_fmt) +{ + core::video_format_desc fmt; + unsigned int width, height, duration = 0, time_scale = 0, rate = 0, bIs1001 = 0, bIsProgressive = 0, size = 0; + std::vector audio_cadence; + core::field_mode video_field_mode = core::field_mode::progressive; + + blue.get_frame_info_for_video_mode(vid_fmt, width, height, rate, bIs1001, bIsProgressive); + blue.get_bytes_per_frame(vid_fmt, mem_fmt, UPD_FMT_FRAME, size); + + switch (vid_fmt) + { + case VID_FMT_NTSC: + case VID_FMT_1080I_5994: + duration = 30000; + time_scale = 1001; + audio_cadence = { 1601,1602,1601,1602,1602 }; + video_field_mode = core::field_mode::upper; + break; + case VID_FMT_2048_1080P_2500: + case VID_FMT_2048_1080PSF_2500: + case VID_FMT_576I_5000: + case VID_FMT_1080P_2500: + case VID_FMT_1080I_5000: + case VID_FMT_1080PSF_2500: + case VID_FMT_720P_2500: + duration = 25000; + time_scale = 1000; + audio_cadence = { 1920,1920,1920,1920,1920 }; + break; + + case VID_FMT_720P_5994: + case VID_FMT_2048_1080P_5994: + case VID_FMT_1080P_5994: + duration = 60000; + time_scale = 1001; + audio_cadence = { 801,800,801,800,800 }; + break; + + case VID_FMT_1080P_6000: + case VID_FMT_2048_1080P_6000: + case VID_FMT_720P_6000: + duration = 60000; + time_scale = 1000; + audio_cadence = { 801,800,801,800,800 }; + break; + + case VID_FMT_1080PSF_2397: + case VID_FMT_1080P_2397: + case VID_FMT_720P_2398: + case VID_FMT_2048_1080PSF_2397: + case VID_FMT_2048_1080P_2397: + duration = 24000; + time_scale = 1000; + break; + + case VID_FMT_1080PSF_2400: + case VID_FMT_1080P_2400: + case VID_FMT_720P_2400: + case VID_FMT_2048_1080PSF_2400: + case VID_FMT_2048_1080P_2400: + duration = 24000; + time_scale = 1000; + break; + + case VID_FMT_1080I_6000: + case VID_FMT_1080PSF_3000: + duration = 30000; + time_scale = 1000; + break; + + case VID_FMT_720P_2997: + case VID_FMT_1080P_2997: + case VID_FMT_2048_1080PSF_2997: + case VID_FMT_2048_1080P_2997: + case VID_FMT_1080PSF_2997: + duration = 30000; + time_scale = 1001; + break; + + case VID_FMT_720P_3000: + case VID_FMT_1080P_3000: + case VID_FMT_2048_1080PSF_3000: + case VID_FMT_2048_1080P_3000: + duration = 30000; + time_scale = 1001; + break; + + case VID_FMT_720P_5000: + case VID_FMT_1080P_5000: + case VID_FMT_2048_1080P_5000: + audio_cadence = { 960,960,960,960,960 }; + duration = 50000; + time_scale = 1000; + break; + /*case VID_FMT_1080P_4800: + case VID_FMT_2048_1080P_4800: + fmt.duration = 48000; + fmt.time_scale = 1000; + break;*/ + } + fmt = core::video_format_desc(video_format_from_vid_fmt(vid_fmt), width, height, width, height, video_field_mode, time_scale, duration, std::wstring(L""), audio_cadence); + fmt.size = size; + return fmt; +} + }} \ No newline at end of file diff --git a/modules/bluefish/util/blue_velvet.h b/modules/bluefish/util/blue_velvet.h index b20f97ba6..c4008f70d 100644 --- a/modules/bluefish/util/blue_velvet.h +++ b/modules/bluefish/util/blue_velvet.h @@ -23,8 +23,7 @@ #include -#include -#include +#include #include #include @@ -33,25 +32,193 @@ namespace caspar { namespace bluefish { -extern const char* (*BlueVelvetVersion)(); -extern BLUE_UINT32 (*encode_hanc_frame)(struct hanc_stream_info_struct * hanc_stream_ptr, void * audio_pcm_ptr,BLUE_UINT32 no_audio_ch,BLUE_UINT32 no_audio_samples,BLUE_UINT32 nTypeOfSample,BLUE_UINT32 emb_audio_flag); -extern BLUE_UINT32 (*encode_hanc_frame_ex)(BLUE_UINT32 card_type, struct hanc_stream_info_struct * hanc_stream_ptr, void * audio_pcm_ptr, BLUE_UINT32 no_audio_ch, BLUE_UINT32 no_audio_samples, BLUE_UINT32 nTypeOfSample, BLUE_UINT32 emb_audio_flag); +class bvc_wrapper +{ + // Define a different type for each of the function ptrs. + typedef const char* (__cdecl *pFunc_bfcGetVersion)(); + typedef BLUEVELVETC_HANDLE(__cdecl *pFunc_bfcFactory)(); + typedef void(__cdecl *pFunc_bfcDestroy)(BLUEVELVETC_HANDLE pHandle); + typedef int(__cdecl *pFunc_bfcEnumerate)(BLUEVELVETC_HANDLE pHandle, int& iDevices); + typedef int(__cdecl *pFunc_bfcQueryCardType)(BLUEVELVETC_HANDLE pHandle, int& iCardType, int iDeviceID); + typedef int(__cdecl *pFunc_bfcAttach)(BLUEVELVETC_HANDLE pHandle, int iDeviceId); + typedef int(__cdecl *pFunc_bfcDetach)(BLUEVELVETC_HANDLE pHandle); + typedef int(__cdecl *pFunc_bfcQueryCardProperty32)(BLUEVELVETC_HANDLE pHandle, const int iProperty, unsigned int& nValue); + typedef int(__cdecl *pFunc_bfcQueryCardProperty64)(BLUEVELVETC_HANDLE pHandle, const int iProperty, unsigned long long& ullValue); + typedef int(__cdecl *pFunc_bfcSetCardProperty32)(BLUEVELVETC_HANDLE pHandle, const int iProperty, const unsigned int nValue); + typedef int(__cdecl *pFunc_bfcSetCardProperty64)(BLUEVELVETC_HANDLE pHandle, const int iProperty, const unsigned long long ullValue); + typedef int(__cdecl *pFunc_bfcGetCardSerialNumber)(BLUEVELVETC_HANDLE pHandle, char* pSerialNumber, unsigned int nStringSize); + typedef int(__cdecl *pFunc_bfcGetCardFwVersion)(BLUEVELVETC_HANDLE pHandle, unsigned int& nValue); + typedef int(__cdecl *pFunc_bfcWaitVideoSyncAsync)(BLUEVELVETC_HANDLE pHandle, OVERLAPPED* pOverlap, blue_video_sync_struct* pSyncData); + typedef int(__cdecl *pFunc_bfcWaitVideoInputSync)(BLUEVELVETC_HANDLE pHandle, unsigned long ulUpdateType, unsigned long& ulFieldCount); + typedef int(__cdecl *pFunc_bfcWaitVideoOutputSync)(BLUEVELVETC_HANDLE pHandle, unsigned long ulUpdateType, unsigned long& ulFieldCount); + typedef int(__cdecl *pFunc_bfcGetVideoOutputCurrentFieldCount)(BLUEVELVETC_HANDLE pHandle, unsigned long& ulFieldCount); + typedef int(__cdecl *pFunc_bfcGetVideoInputCurrentFieldCount)(BLUEVELVETC_HANDLE pHandle, unsigned long& ulFieldCount); + typedef int(__cdecl *pFunc_bfcVideoCaptureStart)(BLUEVELVETC_HANDLE pHandle); + typedef int(__cdecl *pFunc_bfcVideoCaptureStop)(BLUEVELVETC_HANDLE pHandle); + typedef int(__cdecl *pFunc_bfcVideoPlaybackStart)(BLUEVELVETC_HANDLE pHandle, int iStep, int iLoop); + typedef int(__cdecl *pFunc_bfcVideoPlaybackStop)(BLUEVELVETC_HANDLE pHandle, int iWait, int iFlush); + typedef int(__cdecl *pFunc_bfcVideoPlaybackAllocate)(BLUEVELVETC_HANDLE pHandle, void** pAddress, unsigned long& ulBufferID, unsigned long& ulUnderrun); + typedef int(__cdecl *pFunc_bfcVideoPlaybackPresent)(BLUEVELVETC_HANDLE pHandle, unsigned long& ulUniqueID, unsigned long ulBufferID, unsigned long ulCount, int iKeep, int iOdd); + typedef int(__cdecl *pFunc_bfcVideoPlaybackRelease)(BLUEVELVETC_HANDLE pHandle, unsigned long ulBufferID); + typedef int(__cdecl *pFunc_bfcGetCaptureVideoFrameInfoEx)(BLUEVELVETC_HANDLE pHandle, OVERLAPPED* pOverlap, struct blue_videoframe_info_ex& VideoFrameInfo, int iCompostLater, unsigned int* nCaptureFifoSize); + typedef int(__cdecl *pFunc_bfcRenderBufferCapture)(BLUEVELVETC_HANDLE pHandle, unsigned long ulBufferID); + typedef int(__cdecl *pFunc_bfcRenderBufferUpdate)(BLUEVELVETC_HANDLE pHandle, unsigned long ulBufferID); + typedef int(__cdecl *pFunc_bfcGetRenderBufferCount)(BLUEVELVETC_HANDLE pHandle, unsigned long& ulCount); + typedef int(__cdecl *pFunc_bfcEncodeHancFrameEx)(BLUEVELVETC_HANDLE pHandle, unsigned int nCardType, struct hanc_stream_info_struct* pHancEncodeInfo, void* pAudioBuffer, unsigned int nAudioChannels, unsigned int nAudioSamples, unsigned int nSampleType, unsigned int nAudioFlags); + typedef int(__cdecl *pFunc_bfcDecodeHancFrameEx)(BLUEVELVETC_HANDLE pHandle, unsigned int nCardType, unsigned int* pHancBuffer, struct hanc_decode_struct* pHancDecodeInfo); +#if defined(_WIN32) + typedef int(__cdecl *pFunc_bfcSystemBufferReadAsync)(BLUEVELVETC_HANDLE pHandle, unsigned char* pPixels, unsigned long ulSize, OVERLAPPED* pOverlap, unsigned long ulBufferID, unsigned long ulOffset); + typedef int(__cdecl *pFunc_bfcSystemBufferWriteAsync)(BLUEVELVETC_HANDLE pHandle, unsigned char* pPixels, unsigned long ulSize, OVERLAPPED* pOverlap, unsigned long ulBufferID, unsigned long ulOffset); +#else + typedef int(__cdecl *pFunc_bfcSystemBufferRead)(BLUEVELVETC_HANDLE pHandle, unsigned char* pPixels, unsigned long ulSize, unsigned long ulBufferID, unsigned long ulOffset; + typedef int(__cdecl *pFunc_bfcSystemBufferWrite)(BLUEVELVETC_HANDLE pHandle, unsigned char* pPixels, unsigned long ulSize, unsigned long ulBufferID, unsigned long ulOffset; +#endif + typedef int(__cdecl *pFunc_bfcGetBytesForGroupPixels)(EMemoryFormat nMemoryFormat, unsigned int nVideoWidth, unsigned int& nVideoPitchBytes); + typedef int(__cdecl *pFunc_bfcGetPixelsPerLine)(EVideoMode nVideoMode, unsigned int& nPixelsPerLine); + typedef int(__cdecl *pFunc_bfcGetLinesPerFrame)(EVideoMode nVideoMode, EUpdateMethod nUpdateMethod, unsigned int& nLinesPerFrame); + typedef int(__cdecl *pFunc_bfcGetBytesPerLine)(EVideoMode nVideoMode, EMemoryFormat nMemoryFormat, unsigned int& nBytesPerLine); + typedef int(__cdecl *pFunc_bfcGetBytesPerFrame)(EVideoMode nVideoMode, EMemoryFormat nMemoryFormat, EUpdateMethod nUpdateMethod, unsigned int& nBytesPerFrame); + typedef int(__cdecl *pFunc_bfcGetGoldenValue)(EVideoMode nVideoMode, EMemoryFormat nMemoryFormat, EUpdateMethod nUpdateMethod, unsigned int& nGoldenFrameSize); + typedef int(__cdecl *pFunc_bfcGetVBILines)(EVideoMode nVideoMode, EDMADataType nDataType, unsigned int& nVBILinesPerFrame); + typedef int(__cdecl *pFunc_bfcGetVANCGoldenValue)(unsigned int nCardType, EVideoMode nVideoMode, EMemoryFormat nMemoryFormat, EDMADataType nDataFormat, unsigned int& nVANCGoldenValue); + typedef int(__cdecl *pFunc_bfcGetVANCLineBytes)(unsigned int nCardType, EVideoMode nVideoMode, EMemoryFormat nMemoryFormat, unsigned int& nVANCLineBytes); + typedef int(__cdecl *pFunc_bfcGetVANCLineCount)(unsigned int nCardType, EVideoMode nVideoMode, EDMADataType nDataFormat, unsigned int& nVANCLineCount); + typedef int(__cdecl *pFunc_bfcGetWindowsDriverHandle)(BLUEVELVETC_HANDLE pHandle, HANDLE* pDriverHandle); + typedef int(__cdecl *pFunc_bfcSetDynamicMemoryFormatChange)(BLUEVELVETC_HANDLE pHandle, OVERLAPPED* pOverlap, unsigned int nUniqueId, EMemoryFormat nMemoryFormat); -void blue_initialize(); + //BlueVelvetC utils functions + typedef char*(__cdecl *pFunc_bfcUtilsGetStringForCardType)(const int iCardType); + typedef char*(__cdecl *pFunc_bfcUtilsGetStringForBlueProductId)(const unsigned int nProductId); + typedef char*(__cdecl *pFunc_bfcUtilsGetStringForVideoMode)(const unsigned int nVideoMode); + typedef char*(__cdecl *pFunc_bfcUtilsGetStringForMemoryFormat)(const unsigned int nMemoryFormat); + typedef int(__cdecl *pFunc_bfcUtilsGetMR2Routing)(const BLUEVELVETC_HANDLE pHandle, unsigned int& nSrcNode, const unsigned int nDestNode, unsigned int& nLinkType); + typedef int(__cdecl *pFunc_bfcUtilsSetMR2Routing)(const BLUEVELVETC_HANDLE pHandle, const unsigned int nSrcNode, const unsigned int nDestNode, const unsigned int nLinkType); + typedef int(__cdecl *pFunc_bfcUtilsGetAudioOutputRouting)(const BLUEVELVETC_HANDLE pHandle, const unsigned int nAudioConnectorType, unsigned int& nAudioSourceChannelId, unsigned int nAudioConnectorId); + typedef int(__cdecl *pFunc_bfcUtilsSetAudioOutputRouting)(const BLUEVELVETC_HANDLE pHandle, const unsigned int nAudioConnectorType, unsigned int nAudioSourceChannelId, unsigned int nAudioConnectorId); + typedef bool(__cdecl *pFunc_bfcUtilsIsVideoModeProgressive)(const unsigned int nVideoMode); + typedef bool(__cdecl *pFunc_bfcUtilsIsVideoMode1001Framerate)(const unsigned int nVideoMode); + typedef int(__cdecl *pFunc_bfcUtilsGetFpsForVideoMode)(const unsigned int nVideoMode); + typedef int(__cdecl *pFunc_bfcUtilsGetVideoModeForFrameInfo)(const BLUE_UINT32 nWidth, const BLUE_UINT32 nHeight, const BLUE_UINT32 nRate, const BLUE_UINT32 bIs1001, const BLUE_UINT32 bIsProgressive, BLUE_UINT32& nVideoMode); + typedef int(__cdecl *pFunc_bfcUtilsGetFrameInfoForVideoMode)(const BLUE_UINT32 nVideoMode, BLUE_UINT32& nWidth, BLUE_UINT32& nHeight, BLUE_UINT32& nRate, BLUE_UINT32& bIs1001, BLUE_UINT32& bIsProgressive); + typedef int(__cdecl *pFunc_bfcUtilsGetAudioSamplesPerFrame)(const BLUE_UINT32 nVideoMode, const BLUE_UINT32 nFrameNo); -spl::shared_ptr create_blue(); -spl::shared_ptr create_blue(int device_index); -bool is_epoch_card(CBlueVelvet4& blue); -std::wstring get_card_desc(CBlueVelvet4& blue); -EVideoMode get_video_mode(CBlueVelvet4& blue, const core::video_format_desc& format_desc); -template -int set_card_property(T& pSdk, ULONG prop, ULONG value) -{ - VARIANT variantValue; - variantValue.vt = VT_UI4; - variantValue.ulVal = value; - return (pSdk->SetCardProperty(prop,variantValue)); -} +public: + + bvc_wrapper(); // bfcFactory + function pointer lookups + + const char* get_version(); + + BLUE_UINT32 enumerate(int& iDevices); + BLUE_UINT32 query_card_type(int& iCardType, int iDeviceID); + + BLUE_UINT32 attach(int iDeviceId); + BLUE_UINT32 detach(); + + BLUE_UINT32 get_card_property32(const int iProperty, unsigned int& nValue); + BLUE_UINT32 set_card_property32(const int iProperty, const unsigned int nValue); + + BLUE_UINT32 system_buffer_write(unsigned char* pPixels, unsigned long ulSize, unsigned long ulBufferID, unsigned long ulOffset); + BLUE_UINT32 system_buffer_read(unsigned char* pPixels, unsigned long ulSize, unsigned long ulBufferID, unsigned long ulOffset); + + BLUE_UINT32 video_playback_stop(int iWait, int iFlush); + BLUE_UINT32 video_playback_start(int wait, int loop); + BLUE_UINT32 video_playback_allocate(unsigned long& buffer_id, unsigned long& underrun); + BLUE_UINT32 video_playback_present(unsigned long buffer_id, unsigned long count, unsigned long keep, unsigned long odd); + + BLUE_UINT32 wait_video_output_sync(unsigned long ulUpdateType, unsigned long& ulFieldCount); + BLUE_UINT32 wait_video_input_sync(unsigned long ulUpdateType, unsigned long & ulFieldCount); + + BLUE_UINT32 render_buffer_update(unsigned long ulBufferID); + BLUE_UINT32 render_buffer_capture(unsigned long ulBufferID); + + BLUE_UINT32 encode_hanc_frame(unsigned int nCardType, struct hanc_stream_info_struct* pHancEncodeInfo, void* pAudioBuffer, unsigned int nAudioChannels, unsigned int nAudioSamples, unsigned int nSampleType, unsigned int nAudioFlags); + BLUE_UINT32 decode_hanc_frame(unsigned int nCardType, unsigned int* pHancBuffer, struct hanc_decode_struct* pHancDecodeInfo); + + BLUE_UINT32 get_frame_info_for_video_mode(const unsigned int nVideoMode, unsigned int& nWidth, unsigned int& nHeight, unsigned int& nRate, unsigned int& bIs1001, unsigned int& bIsProgressive); + BLUE_UINT32 get_bytes_per_frame(EVideoMode nVideoMode, EMemoryFormat nMemoryFormat, EUpdateMethod nUpdateMethod, unsigned int& nBytesPerFrame); + +private: + bool init_function_pointers(); + + std::shared_ptr h_module_; + std::shared_ptr bvc_; + +//BlueVelvetC function pointers members + pFunc_bfcGetVersion bfcGetVersion = nullptr; + pFunc_bfcFactory bfcFactory = nullptr; + pFunc_bfcDestroy bfcDestroy = nullptr; + pFunc_bfcEnumerate bfcEnumerate = nullptr; + pFunc_bfcQueryCardType bfcQueryCardType = nullptr; + pFunc_bfcAttach bfcAttach = nullptr; + pFunc_bfcDetach bfcDetach = nullptr; + pFunc_bfcQueryCardProperty32 bfcQueryCardProperty32 = nullptr; + pFunc_bfcQueryCardProperty64 bfcQueryCardProperty64 = nullptr; + pFunc_bfcSetCardProperty32 bfcSetCardProperty32 = nullptr; + pFunc_bfcSetCardProperty64 bfcSetCardProperty64 = nullptr; + pFunc_bfcGetCardSerialNumber bfcGetCardSerialNumber = nullptr; + pFunc_bfcGetCardFwVersion bfcGetCardFwVersion = nullptr; + pFunc_bfcWaitVideoSyncAsync bfcWaitVideoSyncAsync = nullptr; + pFunc_bfcWaitVideoInputSync bfcWaitVideoInputSync = nullptr; + pFunc_bfcWaitVideoOutputSync bfcWaitVideoOutputSync = nullptr; + pFunc_bfcGetVideoOutputCurrentFieldCount bfcGetVideoOutputCurrentFieldCount = nullptr; + pFunc_bfcGetVideoInputCurrentFieldCount bfcGetVideoInputCurrentFieldCount = nullptr; + pFunc_bfcVideoCaptureStart bfcVideoCaptureStart = nullptr; + pFunc_bfcVideoCaptureStop bfcVideoCaptureStop = nullptr; + pFunc_bfcVideoPlaybackStart bfcVideoPlaybackStart = nullptr; + pFunc_bfcVideoPlaybackStop bfcVideoPlaybackStop = nullptr; + pFunc_bfcVideoPlaybackAllocate bfcVideoPlaybackAllocate = nullptr; + pFunc_bfcVideoPlaybackPresent bfcVideoPlaybackPresent = nullptr; + pFunc_bfcVideoPlaybackRelease bfcVideoPlaybackRelease = nullptr; + pFunc_bfcGetCaptureVideoFrameInfoEx bfcGetCaptureVideoFrameInfoEx = nullptr; + pFunc_bfcRenderBufferCapture bfcRenderBufferCapture = nullptr; + pFunc_bfcRenderBufferUpdate bfcRenderBufferUpdate = nullptr; + pFunc_bfcGetRenderBufferCount bfcGetRenderBufferCount = nullptr; + pFunc_bfcEncodeHancFrameEx bfcEncodeHancFrameEx = nullptr; + pFunc_bfcDecodeHancFrameEx bfcDecodeHancFrameEx = nullptr; +#if defined(_WIN32) + pFunc_bfcSystemBufferReadAsync bfcSystemBufferReadAsync = nullptr; + pFunc_bfcSystemBufferWriteAsync bfcSystemBufferWriteAsync = nullptr; +#else + pFunc_bfcSystemBufferRead bfcSystemBufferRead = nullptr; + pFunc_bfcSystemBufferWrite bfcSystemBufferWrite = nullptr; +#endif + pFunc_bfcGetBytesForGroupPixels bfcGetBytesForGroupPixels = nullptr; + pFunc_bfcGetPixelsPerLine bfcGetPixelsPerLine = nullptr; + pFunc_bfcGetLinesPerFrame bfcGetLinesPerFrame = nullptr; + pFunc_bfcGetBytesPerLine bfcGetBytesPerLine = nullptr; + pFunc_bfcGetBytesPerFrame bfcGetBytesPerFrame = nullptr; + pFunc_bfcGetGoldenValue bfcGetGoldenValue = nullptr; + pFunc_bfcGetVBILines bfcGetVBILines = nullptr; + pFunc_bfcGetVANCGoldenValue bfcGetVANCGoldenValue = nullptr; + pFunc_bfcGetVANCLineBytes bfcGetVANCLineBytes = nullptr; + pFunc_bfcGetVANCLineCount bfcGetVANCLineCount = nullptr; + pFunc_bfcGetWindowsDriverHandle bfcGetWindowsDriverHandle = nullptr; + pFunc_bfcUtilsGetStringForCardType bfcUtilsGetStringForCardType = nullptr; + pFunc_bfcUtilsGetStringForBlueProductId bfcUtilsGetStringForBlueProductId = nullptr; + pFunc_bfcUtilsGetStringForVideoMode bfcUtilsGetStringForVideoMode = nullptr; + pFunc_bfcUtilsGetStringForMemoryFormat bfcUtilsGetStringForMemoryFormat = nullptr; + pFunc_bfcUtilsGetMR2Routing bfcUtilsGetMR2Routing = nullptr; + pFunc_bfcUtilsSetMR2Routing bfcUtilsSetMR2Routing = nullptr; + pFunc_bfcUtilsGetAudioOutputRouting bfcUtilsGetAudioOutputRouting = nullptr; + pFunc_bfcUtilsSetAudioOutputRouting bfcUtilsSetAudioOutputRouting = nullptr; + pFunc_bfcUtilsIsVideoModeProgressive bfcUtilsIsVideoModeProgressive = nullptr; + pFunc_bfcUtilsIsVideoMode1001Framerate bfcUtilsIsVideoMode1001Framerate = nullptr; + pFunc_bfcUtilsGetFpsForVideoMode bfcUtilsGetFpsForVideoMode = nullptr; + pFunc_bfcUtilsGetVideoModeForFrameInfo bfcUtilsGetVideoModeForFrameInfo = nullptr; + pFunc_bfcUtilsGetFrameInfoForVideoMode bfcUtilsGetFrameInfoForVideoMode = nullptr; + pFunc_bfcUtilsGetAudioSamplesPerFrame bfcUtilsGetAudioSamplesPerFrame = nullptr; + +}; + +spl::shared_ptr create_blue(); +spl::shared_ptr create_blue(int device_index); + +bool is_epoch_card(bvc_wrapper& blue); +bool is_epoch_neutron_1i2o_card(bvc_wrapper& blue); +bool is_epoch_neutron_3o_card(bvc_wrapper& blue); +std::wstring get_card_desc(bvc_wrapper& blue, int device_id); +EVideoMode get_video_mode(bvc_wrapper& blue, const core::video_format_desc& format_desc); +core::video_format_desc get_format_desc(bvc_wrapper& blue, EVideoMode vid_fmt, EMemoryFormat mem_fmt); }} \ No newline at end of file diff --git a/modules/bluefish/util/memory.h b/modules/bluefish/util/memory.h index 994cb8aee..79894cec2 100644 --- a/modules/bluefish/util/memory.h +++ b/modules/bluefish/util/memory.h @@ -23,8 +23,6 @@ #include -#include - #include #include diff --git a/shell/casparcg.config b/shell/casparcg.config index c549e44aa..b57073618 100644 --- a/shell/casparcg.config +++ b/shell/casparcg.config @@ -87,9 +87,12 @@ [1..] + a[a|b|c|d] false [true|false] stereo [mono|stereo|matrix|film|smpte|ebu_r123_8a|ebu_r123_8b|8ch|16ch] false [true|false] + disabled [external|internal|disabled] (external only supported on channels a and c, using c requires 4 out connectors) ( internal only available on devices with a hardware keyer) + videooutputchannel [videooutputchannel|sdivideoinput] ( only valid when using internal keyer option) stereo [mono|stereo|matrix]