/* -LICENSE-START-
 ** Copyright (c) 2024 Blackmagic Design
 **  
 ** Permission is hereby granted, free of charge, to any person or organization 
 ** obtaining a copy of the software and accompanying documentation (the 
 ** "Software") to use, reproduce, display, distribute, sub-license, execute, 
 ** and transmit the Software, and to prepare derivative works of the Software, 
 ** and to permit third-parties to whom the Software is furnished to do so, in 
 ** accordance with:
 ** 
 ** (1) if the Software is obtained from Blackmagic Design, the End User License 
 ** Agreement for the Software Development Kit ("EULA") available at 
 ** https://www.blackmagicdesign.com/EULA/DeckLinkSDK; or
 ** 
 ** (2) if the Software is obtained from any third party, such licensing terms 
 ** as notified by that third party,
 ** 
 ** and all subject to the following:
 ** 
 ** (3) the copyright notices in the Software and this entire statement, 
 ** including the above license grant, this restriction and the following 
 ** disclaimer, must be included in all copies of the Software, in whole or in 
 ** part, and all derivative works of the Software, unless such copies or 
 ** derivative works are solely in the form of machine-executable object code 
 ** generated by a source language processor.
 ** 
 ** (4) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 
 ** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
 ** FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 
 ** SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 
 ** FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 
 ** ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
 ** DEALINGS IN THE SOFTWARE.
 ** 
 ** A copy of the Software is available free of charge at 
 ** https://www.blackmagicdesign.com/desktopvideo_sdk under the EULA.
 ** 
 ** -LICENSE-END-
 */


/*
 * -- AUTOMATICALLY GENERATED - DO NOT EDIT ---
 */

#ifndef BMD_CONST
    #if defined(_MSC_VER)
        #define BMD_CONST __declspec(selectany) static const
    #else
        #define BMD_CONST static const
    #endif
#endif

/* DeckLink API */

import "unknwn.idl";

[uuid(D864517A-EDD5-466D-867D-C819F1C052BB),
version(1.0), helpstring("DeckLink API Library")]
library DeckLinkAPI
{

#include "DeckLinkAPITypes.idl"
#include "DeckLinkAPIModes.idl"
#include "DeckLinkAPIDiscovery.idl"
#include "DeckLinkAPIConfiguration.idl"
#include "DeckLinkAPIDeckControl.idl"
#include "DeckLinkAPIStreaming.idl"

// Type Declarations


// Enumeration Mapping

cpp_quote("typedef unsigned int BMDBufferAccessFlags;")
cpp_quote("typedef unsigned int BMDFrameFlags;")
cpp_quote("typedef unsigned int BMDVideoInputFlags;")
cpp_quote("typedef unsigned int BMDVideoInputFormatChangedEvents;")
cpp_quote("typedef unsigned int BMDDetectedVideoInputFormatFlags;")
cpp_quote("typedef unsigned int BMDDeckLinkCapturePassthroughMode;")
cpp_quote("typedef unsigned int BMDAnalogVideoFlags;")
cpp_quote("typedef unsigned int BMDFormatFlags;")
cpp_quote("typedef unsigned int BMDDeviceBusyState;")
cpp_quote("#if 0")
typedef enum _BMDBufferAccessFlags BMDBufferAccessFlags;
typedef enum _BMDFrameFlags BMDFrameFlags;
typedef enum _BMDVideoInputFlags BMDVideoInputFlags;
typedef enum _BMDVideoInputFormatChangedEvents BMDVideoInputFormatChangedEvents;
typedef enum _BMDDetectedVideoInputFormatFlags BMDDetectedVideoInputFormatFlags;
typedef enum _BMDDeckLinkCapturePassthroughMode BMDDeckLinkCapturePassthroughMode;
typedef enum _BMDAnalogVideoFlags BMDAnalogVideoFlags;
typedef enum _BMDFormatFlags BMDFormatFlags;
typedef enum _BMDDeviceBusyState BMDDeviceBusyState;
cpp_quote("#endif")

/* Enum BMDBufferAccessFlags - Flags to describe access requirements to a video frame buffer */

[v1_enum] enum _BMDBufferAccessFlags {
    bmdBufferAccessReadAndWrite                                  = 1 << 0 | 1 << 1,
    bmdBufferAccessRead                                          = 1 << 0,
    bmdBufferAccessWrite                                         = 1 << 1
};

/* Enum BMDVideoOutputFlags - Flags to control the output of ancillary data along with video. */

typedef [v1_enum] enum _BMDVideoOutputFlags {
    bmdVideoOutputFlagDefault                                    = 0,
    bmdVideoOutputVANC                                           = 1 << 0,
    bmdVideoOutputVITC                                           = 1 << 1,
    bmdVideoOutputRP188                                          = 1 << 2,
    bmdVideoOutputDualStream3D                                   = 1 << 4,
    bmdVideoOutputSynchronizeToPlaybackGroup                     = 1 << 6,
    bmdVideoOutputDolbyVision                                    = 1 << 7
} BMDVideoOutputFlags;

/* Enum BMDSupportedVideoModeFlags - Flags to describe supported video modes */

typedef [v1_enum] enum _BMDSupportedVideoModeFlags {
    bmdSupportedVideoModeDefault                                 = 0,
    bmdSupportedVideoModeKeying                                  = 1 << 0,
    bmdSupportedVideoModeDualStream3D                            = 1 << 1,
    bmdSupportedVideoModeSDISingleLink                           = 1 << 2,
    bmdSupportedVideoModeSDIDualLink                             = 1 << 3,
    bmdSupportedVideoModeSDIQuadLink                             = 1 << 4,
    bmdSupportedVideoModeInAnyProfile                            = 1 << 5,
    bmdSupportedVideoModePsF                                     = 1 << 6,
    bmdSupportedVideoModeDolbyVision                             = 1 << 7
} BMDSupportedVideoModeFlags;

/* Enum BMDPacketType - Type of packet */

typedef [v1_enum] enum _BMDPacketType {
    bmdPacketTypeStreamInterruptedMarker                         = /* 'sint' */ 0x73696E74,	// A packet of this type marks the time when a video stream was interrupted, for example by a disconnected cable
    bmdPacketTypeStreamData                                      = /* 'sdat' */ 0x73646174	// Regular stream data
} BMDPacketType;

/* Enum BMDFrameFlags - Frame flags */

[v1_enum] enum _BMDFrameFlags {
    bmdFrameFlagDefault                                          = 0,
    bmdFrameFlagFlipVertical                                     = 1 << 0,
    bmdFrameFlagMonitorOutOnly                                   = 1 << 3,
    bmdFrameContainsHDRMetadata                                  = 1 << 1,
    bmdFrameContainsDolbyVisionMetadata                          = 1 << 4,

    /* Flags that are applicable only to instances of IDeckLinkVideoInputFrame */

    bmdFrameCapturedAsPsF                                        = 1 << 30,
    bmdFrameHasNoInputSource                                     = 1 << 31
};

/* Enum BMDVideoInputFlags - Flags applicable to video input */

[v1_enum] enum _BMDVideoInputFlags {
    bmdVideoInputFlagDefault                                     = 0,
    bmdVideoInputEnableFormatDetection                           = 1 << 0,
    bmdVideoInputDualStream3D                                    = 1 << 1,
    bmdVideoInputSynchronizeToCaptureGroup                       = 1 << 2
};

/* Enum BMDVideoInputFormatChangedEvents - Bitmask passed to the VideoInputFormatChanged notification to identify the properties of the input signal that have changed */

[v1_enum] enum _BMDVideoInputFormatChangedEvents {
    bmdVideoInputDisplayModeChanged                              = 1 << 0,
    bmdVideoInputFieldDominanceChanged                           = 1 << 1,
    bmdVideoInputColorspaceChanged                               = 1 << 2
};

/* Enum BMDDetectedVideoInputFormatFlags - Flags passed to the VideoInputFormatChanged notification to describe the detected video input signal */

[v1_enum] enum _BMDDetectedVideoInputFormatFlags {
    bmdDetectedVideoInputYCbCr422                                = 1 << 0,
    bmdDetectedVideoInputRGB444                                  = 1 << 1,
    bmdDetectedVideoInputDualStream3D                            = 1 << 2,
    bmdDetectedVideoInput12BitDepth                              = 1 << 3,
    bmdDetectedVideoInput10BitDepth                              = 1 << 4,
    bmdDetectedVideoInput8BitDepth                               = 1 << 5
};

/* Enum BMDDeckLinkCapturePassthroughMode - Enumerates whether the video output is electrically connected to the video input or if the clean switching mode is enabled */

[v1_enum] enum _BMDDeckLinkCapturePassthroughMode {
    bmdDeckLinkCapturePassthroughModeDisabled                    = /* 'pdis' */ 0x70646973,
    bmdDeckLinkCapturePassthroughModeDirect                      = /* 'pdir' */ 0x70646972,
    bmdDeckLinkCapturePassthroughModeCleanSwitch                 = /* 'pcln' */ 0x70636C6E
};

/* Enum BMDOutputFrameCompletionResult - Frame Completion Callback */

typedef [v1_enum] enum _BMDOutputFrameCompletionResult {
    bmdOutputFrameCompleted,
    bmdOutputFrameDisplayedLate,
    bmdOutputFrameDropped,
    bmdOutputFrameFlushed
} BMDOutputFrameCompletionResult;

/* Enum BMDReferenceStatus - GenLock input status */

typedef [v1_enum] enum _BMDReferenceStatus {
    bmdReferenceUnlocked                                         = 0,
    bmdReferenceNotSupportedByHardware                           = 1 << 0,
    bmdReferenceLocked                                           = 1 << 1
} BMDReferenceStatus;

/* Enum BMDAudioFormat - Audio Format */

typedef [v1_enum] enum _BMDAudioFormat {
    bmdAudioFormatPCM                                            = /* 'lpcm' */ 0x6C70636D	// Linear signed PCM samples
} BMDAudioFormat;

/* Enum BMDAudioSampleRate - Audio sample rates supported for output/input */

typedef [v1_enum] enum _BMDAudioSampleRate {
    bmdAudioSampleRate48kHz                                      = 48000
} BMDAudioSampleRate;

/* Enum BMDAudioSampleType - Audio sample sizes supported for output/input */

typedef [v1_enum] enum _BMDAudioSampleType {
    bmdAudioSampleType16bitInteger                               = 16,
    bmdAudioSampleType32bitInteger                               = 32
} BMDAudioSampleType;

/* Enum BMDAudioOutputStreamType - Audio output stream type */

typedef [v1_enum] enum _BMDAudioOutputStreamType {
    bmdAudioOutputStreamContinuous,
    bmdAudioOutputStreamContinuousDontResample,
    bmdAudioOutputStreamTimestamped
} BMDAudioOutputStreamType;

/* Enum BMDAncillaryPacketFormat - Ancillary packet format */

typedef [v1_enum] enum _BMDAncillaryPacketFormat {
    bmdAncillaryPacketFormatUInt8                                = /* 'ui08' */ 0x75693038,
    bmdAncillaryPacketFormatUInt16                               = /* 'ui16' */ 0x75693136,
    bmdAncillaryPacketFormatYCbCr10                              = /* 'v210' */ 0x76323130
} BMDAncillaryPacketFormat;

/* Enum BMDTimecodeFormat - Timecode formats for frame metadata */

typedef [v1_enum] enum _BMDTimecodeFormat {
    bmdTimecodeRP188VITC1                                        = /* 'rpv1' */ 0x72707631,	// RP188 timecode where DBB1 equals VITC1 (line 9)
    bmdTimecodeRP188VITC2                                        = /* 'rp12' */ 0x72703132,	// RP188 timecode where DBB1 equals VITC2 (line 9 for progressive or line 571 for interlaced/PsF)
    bmdTimecodeRP188LTC                                          = /* 'rplt' */ 0x72706C74,	// RP188 timecode where DBB1 equals LTC (line 10)
    bmdTimecodeRP188HighFrameRate                                = /* 'rphr' */ 0x72706872,	// RP188 timecode where DBB1 is an HFRTC (SMPTE ST 12-3), the only timecode allowing the frame value to go above 30
    bmdTimecodeRP188Any                                          = /* 'rp18' */ 0x72703138,	// Convenience for capture, returning the first valid timecode in {HFRTC (if supported), VITC1, VITC2, LTC }
    bmdTimecodeVITC                                              = /* 'vitc' */ 0x76697463,
    bmdTimecodeVITCField2                                        = /* 'vit2' */ 0x76697432,
    bmdTimecodeSerial                                            = /* 'seri' */ 0x73657269
} BMDTimecodeFormat;

/* Enum BMDAnalogVideoFlags - Analog video display flags */

[v1_enum] enum _BMDAnalogVideoFlags {
    bmdAnalogVideoFlagCompositeSetup75                           = 1 << 0,
    bmdAnalogVideoFlagComponentBetacamLevels                     = 1 << 1
};

/* Enum BMDAudioOutputAnalogAESSwitch - Audio output Analog/AESEBU switch */

typedef [v1_enum] enum _BMDAudioOutputAnalogAESSwitch {
    bmdAudioOutputSwitchAESEBU                                   = /* 'aes ' */ 0x61657320,
    bmdAudioOutputSwitchAnalog                                   = /* 'anlg' */ 0x616E6C67
} BMDAudioOutputAnalogAESSwitch;

/* Enum BMDVideoOutputConversionMode - Video/audio conversion mode */

typedef [v1_enum] enum _BMDVideoOutputConversionMode {
    bmdNoVideoOutputConversion                                   = /* 'none' */ 0x6E6F6E65,
    bmdVideoOutputLetterboxDownconversion                        = /* 'ltbx' */ 0x6C746278,
    bmdVideoOutputAnamorphicDownconversion                       = /* 'amph' */ 0x616D7068,
    bmdVideoOutputHD720toHD1080Conversion                        = /* '720c' */ 0x37323063,
    bmdVideoOutputHardwareLetterboxDownconversion                = /* 'HWlb' */ 0x48576C62,
    bmdVideoOutputHardwareAnamorphicDownconversion               = /* 'HWam' */ 0x4857616D,
    bmdVideoOutputHardwareCenterCutDownconversion                = /* 'HWcc' */ 0x48576363,
    bmdVideoOutputHardware720p1080pCrossconversion               = /* 'xcap' */ 0x78636170,
    bmdVideoOutputHardwareAnamorphic720pUpconversion             = /* 'ua7p' */ 0x75613770,
    bmdVideoOutputHardwareAnamorphic1080iUpconversion            = /* 'ua1i' */ 0x75613169,
    bmdVideoOutputHardwareAnamorphic149To720pUpconversion        = /* 'u47p' */ 0x75343770,
    bmdVideoOutputHardwareAnamorphic149To1080iUpconversion       = /* 'u41i' */ 0x75343169,
    bmdVideoOutputHardwarePillarbox720pUpconversion              = /* 'up7p' */ 0x75703770,
    bmdVideoOutputHardwarePillarbox1080iUpconversion             = /* 'up1i' */ 0x75703169
} BMDVideoOutputConversionMode;

/* Enum BMDVideoInputConversionMode - Video input conversion mode */

typedef [v1_enum] enum _BMDVideoInputConversionMode {
    bmdNoVideoInputConversion                                    = /* 'none' */ 0x6E6F6E65,
    bmdVideoInputLetterboxDownconversionFromHD1080               = /* '10lb' */ 0x31306C62,
    bmdVideoInputAnamorphicDownconversionFromHD1080              = /* '10am' */ 0x3130616D,
    bmdVideoInputLetterboxDownconversionFromHD720                = /* '72lb' */ 0x37326C62,
    bmdVideoInputAnamorphicDownconversionFromHD720               = /* '72am' */ 0x3732616D,
    bmdVideoInputLetterboxUpconversion                           = /* 'lbup' */ 0x6C627570,
    bmdVideoInputAnamorphicUpconversion                          = /* 'amup' */ 0x616D7570
} BMDVideoInputConversionMode;

/* Enum BMDVideo3DPackingFormat - Video 3D packing format */

typedef [v1_enum] enum _BMDVideo3DPackingFormat {
    bmdVideo3DPackingSidebySideHalf                              = /* 'sbsh' */ 0x73627368,
    bmdVideo3DPackingLinebyLine                                  = /* 'lbyl' */ 0x6C62796C,
    bmdVideo3DPackingTopAndBottom                                = /* 'tabo' */ 0x7461626F,
    bmdVideo3DPackingFramePacking                                = /* 'frpk' */ 0x6672706B,
    bmdVideo3DPackingLeftOnly                                    = /* 'left' */ 0x6C656674,
    bmdVideo3DPackingRightOnly                                   = /* 'righ' */ 0x72696768
} BMDVideo3DPackingFormat;

/* Enum BMDIdleVideoOutputOperation - Video output operation when not playing video */

typedef [v1_enum] enum _BMDIdleVideoOutputOperation {
    bmdIdleVideoOutputBlack                                      = /* 'blac' */ 0x626C6163,
    bmdIdleVideoOutputLastFrame                                  = /* 'lafa' */ 0x6C616661
} BMDIdleVideoOutputOperation;

/* Enum BMDVideoEncoderFrameCodingMode - Video frame coding mode */

typedef [v1_enum] enum _BMDVideoEncoderFrameCodingMode {
    bmdVideoEncoderFrameCodingModeInter                          = /* 'inte' */ 0x696E7465,
    bmdVideoEncoderFrameCodingModeIntra                          = /* 'intr' */ 0x696E7472
} BMDVideoEncoderFrameCodingMode;

/* Enum BMDDNxHRLevel - DNxHR Levels */

typedef [v1_enum] enum _BMDDNxHRLevel {
    bmdDNxHRLevelSQ                                              = /* 'dnsq' */ 0x646E7371,
    bmdDNxHRLevelLB                                              = /* 'dnlb' */ 0x646E6C62,
    bmdDNxHRLevelHQ                                              = /* 'dnhq' */ 0x646E6871,
    bmdDNxHRLevelHQX                                             = /* 'dhqx' */ 0x64687178,
    bmdDNxHRLevel444                                             = /* 'd444' */ 0x64343434
} BMDDNxHRLevel;

/* Enum BMDLinkConfiguration - Video link configuration */

typedef [v1_enum] enum _BMDLinkConfiguration {
    bmdLinkConfigurationSingleLink                               = /* 'lcsl' */ 0x6C63736C,
    bmdLinkConfigurationDualLink                                 = /* 'lcdl' */ 0x6C63646C,
    bmdLinkConfigurationQuadLink                                 = /* 'lcql' */ 0x6C63716C
} BMDLinkConfiguration;

/* Enum BMDDeviceInterface - Device interface type */

typedef [v1_enum] enum _BMDDeviceInterface {
    bmdDeviceInterfacePCI                                        = /* 'pci ' */ 0x70636920,
    bmdDeviceInterfaceUSB                                        = /* 'usb ' */ 0x75736220,
    bmdDeviceInterfaceThunderbolt                                = /* 'thun' */ 0x7468756E
} BMDDeviceInterface;

/* Enum BMDColorspace - Colorspace */

typedef [v1_enum] enum _BMDColorspace {
    bmdColorspaceRec601                                          = /* 'r601' */ 0x72363031,
    bmdColorspaceRec709                                          = /* 'r709' */ 0x72373039,
    bmdColorspaceRec2020                                         = /* '2020' */ 0x32303230,
    bmdColorspaceDolbyVisionNative                               = /* 'DoVi' */ 0x446F5669,	// For bmdDeckLinkConfigVideoOutputConversionColorspaceDestination with 12-bit RGB
    bmdColorspaceP3D65                                           = /* 'P3D6' */ 0x50334436,	// For bmdDeckLinkConfigVideoOutputConversionColorspaceSource only
    bmdColorspaceUnknown                                         = /* 'Ncol' */ 0x4E636F6C	// For disabling bmdDeckLinkConfigVideoOutputConversionColorspaceDestination
} BMDColorspace;

/* Enum BMDDynamicRange - SDR or HDR */

typedef [v1_enum] enum _BMDDynamicRange {
    bmdDynamicRangeSDR                                           = 0,	// Standard Dynamic Range in accordance with SMPTE ST 2036-1
    bmdDynamicRangeHDRStaticPQ                                   = 1 << 29,	// High Dynamic Range PQ in accordance with SMPTE ST 2084
    bmdDynamicRangeHDRStaticHLG                                  = 1 << 30	// High Dynamic Range HLG in accordance with ITU-R BT.2100-0
} BMDDynamicRange;

/* Enum BMDMezzanineType -  */

typedef [v1_enum] enum _BMDMezzanineType {
    bmdMezzanineTypeNone                                         = 0,	// No mezzanine board
    bmdMezzanineTypeHDMI14OpticalSDI                             = /* 'mza1' */ 0x6D7A6131,	// Mezzanine board with HDMI 1.4 and Optical SDI
    bmdMezzanineTypeQuadSDI                                      = /* 'mz4s' */ 0x6D7A3473,	// Mezzanine board with four SDI connectors
    bmdMezzanineTypeHDMI20OpticalSDI                             = /* 'mza2' */ 0x6D7A6132,	// Mezzanine board with HDMI 2.0 and Optical SDI
    bmdMezzanineTypeHDMI21RS422                                  = /* 'mzhr' */ 0x6D7A6872	// Mezzanine boards with HDMI 2.1 and RS422
} BMDMezzanineType;

/* Enum BMDDeckLinkHDMIInputEDIDID - DeckLink HDMI Input EDID ID */

typedef [v1_enum] enum _BMDDeckLinkHDMIInputEDIDID {

    /* Integers */

    bmdDeckLinkHDMIInputEDIDDynamicRange                         = /* 'HIDy' */ 0x48494479	// Parameter is of type BMDDynamicRange. Default is (bmdDynamicRangeSDR|bmdDynamicRangeHDRStaticPQ)
} BMDDeckLinkHDMIInputEDIDID;

/* Enum BMDDeckLinkFrameMetadataID - DeckLink Frame Metadata ID */

typedef [v1_enum] enum _BMDDeckLinkFrameMetadataID {

    /* Integers */

    bmdDeckLinkFrameMetadataColorspace                           = /* 'cspc' */ 0x63737063,	// Colorspace of video frame (see BMDColorspace)
    bmdDeckLinkFrameMetadataHDRElectroOpticalTransferFunc        = /* 'eotf' */ 0x656F7466,	// EOTF in range 0-7 as per CEA 861.3

    /* Dolby Vision only - Bytes */

    bmdDeckLinkFrameMetadataDolbyVision                          = /* 'dovi' */ 0x646F7669,	// Dolby Vision Metadata

    /* CEA/SMPTE only - HDR Metadata Floats */

    bmdDeckLinkFrameMetadataHDRDisplayPrimariesRedX              = /* 'hdrx' */ 0x68647278,	// Red display primaries in range 0.0 - 1.0
    bmdDeckLinkFrameMetadataHDRDisplayPrimariesRedY              = /* 'hdry' */ 0x68647279,	// Red display primaries in range 0.0 - 1.0
    bmdDeckLinkFrameMetadataHDRDisplayPrimariesGreenX            = /* 'hdgx' */ 0x68646778,	// Green display primaries in range 0.0 - 1.0
    bmdDeckLinkFrameMetadataHDRDisplayPrimariesGreenY            = /* 'hdgy' */ 0x68646779,	// Green display primaries in range 0.0 - 1.0
    bmdDeckLinkFrameMetadataHDRDisplayPrimariesBlueX             = /* 'hdbx' */ 0x68646278,	// Blue display primaries in range 0.0 - 1.0
    bmdDeckLinkFrameMetadataHDRDisplayPrimariesBlueY             = /* 'hdby' */ 0x68646279,	// Blue display primaries in range 0.0 - 1.0
    bmdDeckLinkFrameMetadataHDRWhitePointX                       = /* 'hdwx' */ 0x68647778,	// White point in range 0.0 - 1.0
    bmdDeckLinkFrameMetadataHDRWhitePointY                       = /* 'hdwy' */ 0x68647779,	// White point in range 0.0 - 1.0
    bmdDeckLinkFrameMetadataHDRMaxDisplayMasteringLuminance      = /* 'hdml' */ 0x68646D6C,	// Max display mastering luminance in range 1 cd/m2 - 65535 cd/m2
    bmdDeckLinkFrameMetadataHDRMinDisplayMasteringLuminance      = /* 'hmil' */ 0x686D696C,	// Min display mastering luminance in range 0.0001 cd/m2 - 6.5535 cd/m2
    bmdDeckLinkFrameMetadataHDRMaximumContentLightLevel          = /* 'mcll' */ 0x6D636C6C,	// Maximum Content Light Level in range 1 cd/m2 - 65535 cd/m2
    bmdDeckLinkFrameMetadataHDRMaximumFrameAverageLightLevel     = /* 'fall' */ 0x66616C6C	// Maximum Frame Average Light Level in range 1 cd/m2 - 65535 cd/m2
} BMDDeckLinkFrameMetadataID;

/* Enum BMDEthernetLinkState - The state of the Ethernet link */

typedef [v1_enum] enum _BMDEthernetLinkState {
    bmdEthernetLinkStateDisconnected                             = /* 'elds' */ 0x656C6473,
    bmdEthernetLinkStateConnectedUnbound                         = /* 'elcu' */ 0x656C6375,
    bmdEthernetLinkStateConnectedBound                           = /* 'elcb' */ 0x656C6362
} BMDEthernetLinkState;

/* Enum BMDProfileID - Identifies a profile */

typedef [v1_enum] enum _BMDProfileID {
    bmdProfileOneSubDeviceFullDuplex                             = /* '1dfd' */ 0x31646664,
    bmdProfileOneSubDeviceHalfDuplex                             = /* '1dhd' */ 0x31646864,
    bmdProfileTwoSubDevicesFullDuplex                            = /* '2dfd' */ 0x32646664,
    bmdProfileTwoSubDevicesHalfDuplex                            = /* '2dhd' */ 0x32646864,
    bmdProfileFourSubDevicesHalfDuplex                           = /* '4dhd' */ 0x34646864
} BMDProfileID;

/* Enum BMDHDMITimecodePacking - Packing form of timecode on HDMI */

typedef [v1_enum] enum _BMDHDMITimecodePacking {
    bmdHDMITimecodePackingIEEEOUI000085                          = 0x00008500,
    bmdHDMITimecodePackingIEEEOUI080046                          = 0x08004601,
    bmdHDMITimecodePackingIEEEOUI5CF9F0                          = 0x5CF9F003
} BMDHDMITimecodePacking;

/* Enum BMDInternalKeyingAncillaryDataSource - Source for VANC and timecode data when performing internal keying */

typedef [v1_enum] enum _BMDInternalKeyingAncillaryDataSource {
    bmdInternalKeyingUsesAncillaryDataFromInputSignal            = /* 'ikai' */ 0x696B6169,
    bmdInternalKeyingUsesAncillaryDataFromKeyFrame               = /* 'ikak' */ 0x696B616B
} BMDInternalKeyingAncillaryDataSource;

/* Enum BMDDeckLinkAttributeID - DeckLink Attribute ID */

typedef [v1_enum] enum _BMDDeckLinkAttributeID {

    /* Flags */

    BMDDeckLinkSupportsInternalKeying                            = /* 'keyi' */ 0x6B657969,
    BMDDeckLinkSupportsExternalKeying                            = /* 'keye' */ 0x6B657965,
    BMDDeckLinkSupportsInputFormatDetection                      = /* 'infd' */ 0x696E6664,
    BMDDeckLinkHasReferenceInput                                 = /* 'hrin' */ 0x6872696E,
    BMDDeckLinkHasSerialPort                                     = /* 'hspt' */ 0x68737074,
    BMDDeckLinkHasAnalogVideoOutputGain                          = /* 'avog' */ 0x61766F67,
    BMDDeckLinkCanOnlyAdjustOverallVideoOutputGain               = /* 'ovog' */ 0x6F766F67,
    BMDDeckLinkHasVideoInputAntiAliasingFilter                   = /* 'aafl' */ 0x6161666C,
    BMDDeckLinkHasBypass                                         = /* 'byps' */ 0x62797073,
    BMDDeckLinkSupportsClockTimingAdjustment                     = /* 'ctad' */ 0x63746164,
    BMDDeckLinkSupportsFullFrameReferenceInputTimingOffset       = /* 'frin' */ 0x6672696E,
    BMDDeckLinkSupportsSMPTELevelAOutput                         = /* 'lvla' */ 0x6C766C61,
    BMDDeckLinkSupportsAutoSwitchingPPsFOnInput                  = /* 'apsf' */ 0x61707366,
    BMDDeckLinkSupportsDualLinkSDI                               = /* 'sdls' */ 0x73646C73,
    BMDDeckLinkSupportsQuadLinkSDI                               = /* 'sqls' */ 0x73716C73,
    BMDDeckLinkSupportsIdleOutput                                = /* 'idou' */ 0x69646F75,
    BMDDeckLinkVANCRequires10BitYUVVideoFrames                   = /* 'vioY' */ 0x76696F59,	// Legacy product requires v210 active picture for IDeckLinkVideoFrameAncillaryPackets or 10-bit VANC
    BMDDeckLinkHasLTCTimecodeInput                               = /* 'hltc' */ 0x686C7463,
    BMDDeckLinkSupportsHDRMetadata                               = /* 'hdrm' */ 0x6864726D,
    BMDDeckLinkSupportsColorspaceMetadata                        = /* 'cmet' */ 0x636D6574,
    BMDDeckLinkSupportsHDMITimecode                              = /* 'htim' */ 0x6874696D,
    BMDDeckLinkSupportsHighFrameRateTimecode                     = /* 'HFRT' */ 0x48465254,
    BMDDeckLinkSupportsSynchronizeToCaptureGroup                 = /* 'stcg' */ 0x73746367,
    BMDDeckLinkSupportsSynchronizeToPlaybackGroup                = /* 'stpg' */ 0x73747067,
    BMDDeckLinkHasMonitorOut                                     = /* 'fmoo' */ 0x666D6F6F,

    /* Integers */

    BMDDeckLinkMaximumAudioChannels                              = /* 'mach' */ 0x6D616368,
    BMDDeckLinkMaximumHDMIAudioChannels                          = /* 'mhch' */ 0x6D686368,
    BMDDeckLinkMaximumAnalogAudioInputChannels                   = /* 'iach' */ 0x69616368,
    BMDDeckLinkMaximumAnalogAudioOutputChannels                  = /* 'aach' */ 0x61616368,
    BMDDeckLinkNumberOfSubDevices                                = /* 'nsbd' */ 0x6E736264,
    BMDDeckLinkSubDeviceIndex                                    = /* 'subi' */ 0x73756269,
    BMDDeckLinkPersistentID                                      = /* 'peid' */ 0x70656964,
    BMDDeckLinkDeviceGroupID                                     = /* 'dgid' */ 0x64676964,
    BMDDeckLinkTopologicalID                                     = /* 'toid' */ 0x746F6964,
    BMDDeckLinkVideoOutputConnections                            = /* 'vocn' */ 0x766F636E,	// Returns a BMDVideoConnection bit field
    BMDDeckLinkVideoInputConnections                             = /* 'vicn' */ 0x7669636E,	// Returns a BMDVideoConnection bit field
    BMDDeckLinkAudioOutputConnections                            = /* 'aocn' */ 0x616F636E,	// Returns a BMDAudioConnection bit field
    BMDDeckLinkAudioInputConnections                             = /* 'aicn' */ 0x6169636E,	// Returns a BMDAudioConnection bit field
    BMDDeckLinkVideoIOSupport                                    = /* 'vios' */ 0x76696F73,	// Returns a BMDVideoIOSupport bit field
    BMDDeckLinkDeckControlConnections                            = /* 'dccn' */ 0x6463636E,	// Returns a BMDDeckControlConnection bit field
    BMDDeckLinkDeviceInterface                                   = /* 'dbus' */ 0x64627573,	// Returns a BMDDeviceInterface
    BMDDeckLinkAudioInputRCAChannelCount                         = /* 'airc' */ 0x61697263,
    BMDDeckLinkAudioInputXLRChannelCount                         = /* 'aixc' */ 0x61697863,
    BMDDeckLinkAudioOutputRCAChannelCount                        = /* 'aorc' */ 0x616F7263,
    BMDDeckLinkAudioOutputXLRChannelCount                        = /* 'aoxc' */ 0x616F7863,
    BMDDeckLinkProfileID                                         = /* 'prid' */ 0x70726964,	// Returns a BMDProfileID
    BMDDeckLinkDuplex                                            = /* 'dupx' */ 0x64757078,
    BMDDeckLinkMinimumPrerollFrames                              = /* 'mprf' */ 0x6D707266,
    BMDDeckLinkSupportedDynamicRange                             = /* 'sudr' */ 0x73756472,
    BMDDeckLinkMezzanineType                                     = /* 'mezt' */ 0x6D657A74,

    /* Floats */

    BMDDeckLinkVideoInputGainMinimum                             = /* 'vigm' */ 0x7669676D,
    BMDDeckLinkVideoInputGainMaximum                             = /* 'vigx' */ 0x76696778,
    BMDDeckLinkVideoOutputGainMinimum                            = /* 'vogm' */ 0x766F676D,
    BMDDeckLinkVideoOutputGainMaximum                            = /* 'vogx' */ 0x766F6778,
    BMDDeckLinkMicrophoneInputGainMinimum                        = /* 'migm' */ 0x6D69676D,
    BMDDeckLinkMicrophoneInputGainMaximum                        = /* 'migx' */ 0x6D696778,

    /* Strings */

    BMDDeckLinkSerialPortDeviceName                              = /* 'slpn' */ 0x736C706E,
    BMDDeckLinkVendorName                                        = /* 'vndr' */ 0x766E6472,
    BMDDeckLinkDisplayName                                       = /* 'dspn' */ 0x6473706E,
    BMDDeckLinkModelName                                         = /* 'mdln' */ 0x6D646C6E,
    BMDDeckLinkDeviceHandle                                      = /* 'devh' */ 0x64657668,
    BMDDeckLinkEthernetMACAddress                                = /* 'eMAC' */ 0x654D4143
} BMDDeckLinkAttributeID;

/* Enum BMDDeckLinkAPIInformationID - DeckLinkAPI information ID */

typedef [v1_enum] enum _BMDDeckLinkAPIInformationID {

    /* Integer or String */

    BMDDeckLinkAPIVersion                                        = /* 'vers' */ 0x76657273
} BMDDeckLinkAPIInformationID;

/* Enum BMDDeckLinkStatusID - DeckLink Status ID */

typedef [v1_enum] enum _BMDDeckLinkStatusID {

    /* Integers */

    bmdDeckLinkStatusDetectedVideoInputMode                      = /* 'dvim' */ 0x6476696D,
    bmdDeckLinkStatusDetectedVideoInputFormatFlags               = /* 'dvff' */ 0x64766666,
    bmdDeckLinkStatusDetectedVideoInputFieldDominance            = /* 'dvfd' */ 0x64766664,
    bmdDeckLinkStatusDetectedVideoInputColorspace                = /* 'dscl' */ 0x6473636C,
    bmdDeckLinkStatusDetectedVideoInputDynamicRange              = /* 'dsdr' */ 0x64736472,
    bmdDeckLinkStatusDetectedSDILinkConfiguration                = /* 'dslc' */ 0x64736C63,
    bmdDeckLinkStatusCurrentVideoInputMode                       = /* 'cvim' */ 0x6376696D,
    bmdDeckLinkStatusCurrentVideoInputPixelFormat                = /* 'cvip' */ 0x63766970,
    bmdDeckLinkStatusCurrentVideoInputFlags                      = /* 'cvif' */ 0x63766966,
    bmdDeckLinkStatusCurrentVideoOutputMode                      = /* 'cvom' */ 0x63766F6D,
    bmdDeckLinkStatusCurrentVideoOutputFlags                     = /* 'cvof' */ 0x63766F66,
    bmdDeckLinkStatusEthernetLink                                = /* 'sels' */ 0x73656C73,
    bmdDeckLinkStatusEthernetLinkMbps                            = /* 'sesp' */ 0x73657370,
    bmdDeckLinkStatusPCIExpressLinkWidth                         = /* 'pwid' */ 0x70776964,
    bmdDeckLinkStatusPCIExpressLinkSpeed                         = /* 'plnk' */ 0x706C6E6B,
    bmdDeckLinkStatusLastVideoOutputPixelFormat                  = /* 'opix' */ 0x6F706978,
    bmdDeckLinkStatusReferenceSignalMode                         = /* 'refm' */ 0x7265666D,
    bmdDeckLinkStatusReferenceSignalFlags                        = /* 'reff' */ 0x72656666,
    bmdDeckLinkStatusBusy                                        = /* 'busy' */ 0x62757379,
    bmdDeckLinkStatusInterchangeablePanelType                    = /* 'icpt' */ 0x69637074,
    bmdDeckLinkStatusDeviceTemperature                           = /* 'dtmp' */ 0x64746D70,
    bmdDeckLinkStatusHDMIOutputActualMode                        = /* 'hiam' */ 0x6869616D,
    bmdDeckLinkStatusHDMIOutputActualFormatFlags                 = /* 'hiaf' */ 0x68696166,
    bmdDeckLinkStatusHDMIOutputFRLRate                           = /* 'hiof' */ 0x68696F66,
    bmdDeckLinkStatusHDMIInputFRLRate                            = /* 'hiif' */ 0x68696966,
    bmdDeckLinkStatusHDMIOutputTMDSLineRate                      = /* 'hilr' */ 0x68696C72,

    /* Floats */

    bmdDeckLinkStatusSinkSupportsDolbyVision                     = /* 'dvvr' */ 0x64767672,

    /* Flags */

    bmdDeckLinkStatusVideoInputSignalLocked                      = /* 'visl' */ 0x7669736C,
    bmdDeckLinkStatusReferenceSignalLocked                       = /* 'refl' */ 0x7265666C,

    /* Strings */

    bmdDeckLinkStatusEthernetLocalIPAddress                      = /* 'seip' */ 0x73656970,
    bmdDeckLinkStatusEthernetSubnetMask                          = /* 'sesm' */ 0x7365736D,
    bmdDeckLinkStatusEthernetGatewayIPAddress                    = /* 'segw' */ 0x73656777,
    bmdDeckLinkStatusEthernetPrimaryDNS                          = /* 'sepd' */ 0x73657064,
    bmdDeckLinkStatusEthernetSecondaryDNS                        = /* 'sesd' */ 0x73657364,
    bmdDeckLinkStatusEthernetPTPGrandmasterIdentity              = /* 'spid' */ 0x73706964,
    bmdDeckLinkStatusEthernetVideoOutputAddress                  = /* 'soav' */ 0x736F6176,
    bmdDeckLinkStatusEthernetAudioOutputAddress                  = /* 'soaa' */ 0x736F6161,
    bmdDeckLinkStatusEthernetAncillaryOutputAddress              = /* 'soaA' */ 0x736F6141,
    bmdDeckLinkStatusEthernetAudioInputChannelOrder              = /* 'saco' */ 0x7361636F,

    /* Bytes */

    bmdDeckLinkStatusReceivedEDID                                = /* 'edid' */ 0x65646964
} BMDDeckLinkStatusID;

/* Enum BMDDeckLinkVideoStatusFlags -  */

typedef [v1_enum] enum _BMDDeckLinkVideoStatusFlags {
    bmdDeckLinkVideoStatusPsF                                    = 1 << 0,
    bmdDeckLinkVideoStatusDualStream3D                           = 1 << 1
} BMDDeckLinkVideoStatusFlags;

/* Enum BMDDuplexMode - Duplex of the device */

typedef [v1_enum] enum _BMDDuplexMode {
    bmdDuplexFull                                                = /* 'dxfu' */ 0x64786675,
    bmdDuplexHalf                                                = /* 'dxha' */ 0x64786861,
    bmdDuplexSimplex                                             = /* 'dxsp' */ 0x64787370,
    bmdDuplexInactive                                            = /* 'dxin' */ 0x6478696E
} BMDDuplexMode;

/* Enum BMDPanelType - The type of interchangeable panel */

typedef [v1_enum] enum _BMDPanelType {
    bmdPanelNotDetected                                          = /* 'npnl' */ 0x6E706E6C,
    bmdPanelTeranexMiniSmartPanel                                = /* 'tmsm' */ 0x746D736D
} BMDPanelType;

/* Enum BMDFormatFlags - Flags to describe the video signal */

[v1_enum] enum _BMDFormatFlags {
    bmdFormatRGB444                                              = 1 << 0,
    bmdFormatYUV444                                              = 1 << 1,
    bmdFormatYUV422                                              = 1 << 2,
    bmdFormatYUV420                                              = 1 << 3,
    bmdFormat8BitDepth                                           = 1 << 4,
    bmdFormat10BitDepth                                          = 1 << 5,
    bmdFormat12BitDepth                                          = 1 << 6
};

/* Enum BMDDeviceBusyState - Current device busy state */

[v1_enum] enum _BMDDeviceBusyState {
    bmdDeviceCaptureBusy                                         = 1 << 0,
    bmdDevicePlaybackBusy                                        = 1 << 1,
    bmdDeviceSerialPortBusy                                      = 1 << 2
};

/* Enum BMDVideoIOSupport - Device video input/output support */

typedef [v1_enum] enum _BMDVideoIOSupport {
    bmdDeviceSupportsCapture                                     = 1 << 0,
    bmdDeviceSupportsPlayback                                    = 1 << 1
} BMDVideoIOSupport;

/* Enum BMD3DPreviewFormat - Linked Frame preview format */

typedef [v1_enum] enum _BMD3DPreviewFormat {
    bmd3DPreviewFormatDefault                                    = /* 'defa' */ 0x64656661,
    bmd3DPreviewFormatLeftOnly                                   = /* 'left' */ 0x6C656674,
    bmd3DPreviewFormatRightOnly                                  = /* 'righ' */ 0x72696768,
    bmd3DPreviewFormatSideBySide                                 = /* 'side' */ 0x73696465,
    bmd3DPreviewFormatTopBottom                                  = /* 'topb' */ 0x746F7062
} BMD3DPreviewFormat;

/* Enum BMDIPFlowDirection - BMDIPFlowDirection enumerates the direction of the IP flow. */

typedef [v1_enum] enum _BMDIPFlowDirection {
    bmdDeckLinkIPFlowDirectionOutput                             = 0,
    bmdDeckLinkIPFlowDirectionInput                              = 1
} BMDIPFlowDirection;

/* Enum BMDIPFlowType - BMDIPFlowDirection enumerates the IP flow type. */

typedef [v1_enum] enum _BMDIPFlowType {
    bmdDeckLinkIPFlowTypeVideo                                   = 0,
    bmdDeckLinkIPFlowTypeAudio                                   = 1,
    bmdDeckLinkIPFlowTypeAncillary                               = 2
} BMDIPFlowType;

/* Enum BMDDeckLinkIPFlowAttributeID - DeckLink IP Flow Attribute ID */

typedef [v1_enum] enum _BMDDeckLinkIPFlowAttributeID {

    /* DeckLink IP Flow Attribute Integers */

    bmdDeckLinkIPFlowID                                          = /* '2fai' */ 0x32666169,
    bmdDeckLinkIPFlowDirection                                   = /* '2fad' */ 0x32666164,
    bmdDeckLinkIPFlowType                                        = /* '2fat' */ 0x32666174
} BMDDeckLinkIPFlowAttributeID;

/* Enum BMDDeckLinkIPFlowStatusID - DeckLink IP Flow Attribute ID */

typedef [v1_enum] enum _BMDDeckLinkIPFlowStatusID {

    /* DeckLink IP Flow Status Strings */

    bmdDeckLinkIPFlowSDP                                         = /* '2fas' */ 0x32666173
} BMDDeckLinkIPFlowStatusID;

/* Enum BMDDeckLinkIPFlowSettingID - DeckLink IP Flow Setting ID */

typedef [v1_enum] enum _BMDDeckLinkIPFlowSettingID {

    /* DeckLink IP Flow Setting Strings */

    bmdDeckLinkIPFlowPeerSDP                                     = /* '2fps' */ 0x32667073	// The peer's SDP. Must not be over 1000 bytes large.
} BMDDeckLinkIPFlowSettingID;

/* Enum BMDNotifications - Events that can be subscribed through IDeckLinkNotification */

typedef [v1_enum] enum _BMDNotifications {
    bmdPreferencesChanged                                        = /* 'pref' */ 0x70726566,
    bmdStatusChanged                                             = /* 'stat' */ 0x73746174,
    bmdIPFlowStatusChanged                                       = /* 'bfsc' */ 0x62667363,
    bmdIPFlowSettingChanged                                      = /* 'bfcc' */ 0x62666363
} BMDNotifications;

// Forward Declarations

interface IDeckLinkVideoOutputCallback;
interface IDeckLinkInputCallback;
interface IDeckLinkEncoderInputCallback;
interface IDeckLinkVideoBufferAllocator;
interface IDeckLinkVideoBufferAllocatorProvider;
interface IDeckLinkAudioOutputCallback;
interface IDeckLinkIterator;
interface IDeckLinkAPIInformation;
interface IDeckLinkIPFlowAttributes;
interface IDeckLinkIPFlowStatus;
interface IDeckLinkIPFlowSetting;
interface IDeckLinkIPFlow;
interface IDeckLinkIPFlowIterator;
interface IDeckLinkOutput;
interface IDeckLinkInput;
interface IDeckLinkIPExtensions;
interface IDeckLinkHDMIInputEDID;
interface IDeckLinkEncoderInput;
interface IDeckLinkVideoBuffer;
interface IDeckLinkVideoFrame;
interface IDeckLinkMutableVideoFrame;
interface IDeckLinkVideoFrame3DExtensions;
interface IDeckLinkVideoFrameMetadataExtensions;
interface IDeckLinkVideoFrameMutableMetadataExtensions;
interface IDeckLinkVideoInputFrame;
interface IDeckLinkAncillaryPacket;
interface IDeckLinkAncillaryPacketIterator;
interface IDeckLinkVideoFrameAncillaryPackets;
interface IDeckLinkVideoFrameAncillary;
interface IDeckLinkEncoderPacket;
interface IDeckLinkEncoderVideoPacket;
interface IDeckLinkEncoderAudioPacket;
interface IDeckLinkH265NALPacket;
interface IDeckLinkAudioInputPacket;
interface IDeckLinkScreenPreviewCallback;
interface IDeckLinkGLScreenPreviewHelper;
interface IDeckLinkDX9ScreenPreviewHelper;
interface IDeckLinkWPFDX9ScreenPreviewHelper;
interface IDeckLinkNotificationCallback;
interface IDeckLinkNotification;
interface IDeckLinkProfileAttributes;
interface IDeckLinkProfileIterator;
interface IDeckLinkProfile;
interface IDeckLinkProfileCallback;
interface IDeckLinkProfileManager;
interface IDeckLinkStatus;
interface IDeckLinkKeyer;
interface IDeckLinkVideoConversion;
interface IDeckLinkDeviceNotificationCallback;
interface IDeckLinkDiscovery;

/* Interface IDeckLinkVideoOutputCallback - Frame completion callback. */

[
    object,
    uuid(5BE6DF26-02CE-433E-99D9-9A87C3AC171F),
    helpstring("Frame completion callback.")
] interface IDeckLinkVideoOutputCallback : IUnknown
{
    HRESULT ScheduledFrameCompleted ([in] IDeckLinkVideoFrame* completedFrame, [in] BMDOutputFrameCompletionResult result);
    HRESULT ScheduledPlaybackHasStopped (void);
};

/* Interface IDeckLinkInputCallback - Frame arrival callback. */

[
    object,
    uuid(3A94F075-C37D-4BA8-BCC0-1D778C8F881B),
    helpstring("Frame arrival callback.")
] interface IDeckLinkInputCallback : IUnknown
{
    HRESULT VideoInputFormatChanged ([in] BMDVideoInputFormatChangedEvents notificationEvents, [in] IDeckLinkDisplayMode* newDisplayMode, [in] BMDDetectedVideoInputFormatFlags detectedSignalFlags);
    HRESULT VideoInputFrameArrived ([in] IDeckLinkVideoInputFrame* videoFrame, [in] IDeckLinkAudioInputPacket* audioPacket);
};

/* Interface IDeckLinkEncoderInputCallback - Frame arrival callback. */

[
    object,
    uuid(ACF13E61-F4A0-4974-A6A7-59AFF6268B31),
    helpstring("Frame arrival callback.")
] interface IDeckLinkEncoderInputCallback : IUnknown
{
    HRESULT VideoInputSignalChanged ([in] BMDVideoInputFormatChangedEvents notificationEvents, [in] IDeckLinkDisplayMode* newDisplayMode, [in] BMDDetectedVideoInputFormatFlags detectedSignalFlags);
    HRESULT VideoPacketArrived ([in] IDeckLinkEncoderVideoPacket* videoPacket);
    HRESULT AudioPacketArrived ([in] IDeckLinkEncoderAudioPacket* audioPacket);
};

/* Interface IDeckLinkVideoBufferAllocator - Buffer allocator for video. */

[
    object,
    uuid(3481A4DF-2B11-4E55-AC61-836B87985E9A),
    local,
    helpstring("Buffer allocator for video.")
] interface IDeckLinkVideoBufferAllocator : IUnknown
{
    HRESULT AllocateVideoBuffer ([out] IDeckLinkVideoBuffer** allocatedBuffer);
};

/* Interface IDeckLinkVideoBufferAllocatorProvider - Allows EnableVideoInputWithAllocatorProvider to obtain allocators */

[
    object,
    uuid(08B80403-BFF2-49D0-B448-8C908B9E9FC9),
    local,
    helpstring("Allows EnableVideoInputWithAllocatorProvider to obtain allocators")
] interface IDeckLinkVideoBufferAllocatorProvider : IUnknown
{
    HRESULT GetVideoBufferAllocator ([in] unsigned int bufferSize, [in] unsigned int width, [in] unsigned int height, [in] unsigned int rowBytes, [in] BMDPixelFormat pixelFormat, [out] IDeckLinkVideoBufferAllocator** allocator);
};

/* Interface IDeckLinkAudioOutputCallback - Optional callback to allow audio samples to be pulled as required. */

[
    object,
    uuid(403C681B-7F46-4A12-B993-2BB127084EE6),
    local,
    helpstring("Optional callback to allow audio samples to be pulled as required.")
] interface IDeckLinkAudioOutputCallback : IUnknown
{
    HRESULT RenderAudioSamples ([in] BOOL preroll);
};

/* Interface IDeckLinkIterator - Enumerates installed DeckLink hardware */

[
    object,
    uuid(50FB36CD-3063-4B73-BDBB-958087F2D8BA),
    helpstring("Enumerates installed DeckLink hardware")
] interface IDeckLinkIterator : IUnknown
{
    HRESULT Next ([out] IDeckLink** deckLinkInstance);
};

/* Interface IDeckLinkAPIInformation - DeckLinkAPI attribute interface */

[
    object,
    uuid(7BEA3C68-730D-4322-AF34-8A7152B532A4),
    helpstring("DeckLinkAPI attribute interface")
] interface IDeckLinkAPIInformation : IUnknown
{
    HRESULT GetFlag ([in] BMDDeckLinkAPIInformationID cfgID, [out] BOOL* value);
    HRESULT GetInt ([in] BMDDeckLinkAPIInformationID cfgID, [out] LONGLONG* value);
    HRESULT GetFloat ([in] BMDDeckLinkAPIInformationID cfgID, [out] double* value);
    HRESULT GetString ([in] BMDDeckLinkAPIInformationID cfgID, [out] BSTR* value);
};

/* Interface IDeckLinkIPFlowAttributes -  */

[
    object,
    uuid(CDA938DA-6479-40C6-B2EC-A3579B3AEECD),
    helpstring("")
] interface IDeckLinkIPFlowAttributes : IUnknown
{
    HRESULT GetInt ([in] BMDDeckLinkIPFlowAttributeID attrID, [out] LONGLONG* value);
    HRESULT GetFlag ([in] BMDDeckLinkIPFlowAttributeID attrID, [out] BOOL* value);
    HRESULT GetFloat ([in] BMDDeckLinkIPFlowAttributeID attrID, [out] double* value);
    HRESULT GetString ([in] BMDDeckLinkIPFlowAttributeID attrID, [out] BSTR* value);
};

/* Interface IDeckLinkIPFlowStatus -  */

[
    object,
    uuid(31C41656-4992-4396-BBE9-5F8406AAB5AF),
    helpstring("")
] interface IDeckLinkIPFlowStatus : IUnknown
{
    HRESULT GetInt ([in] BMDDeckLinkIPFlowStatusID statusID, [out] LONGLONG* value);
    HRESULT GetFlag ([in] BMDDeckLinkIPFlowStatusID statusID, [out] BOOL* value);
    HRESULT GetFloat ([in] BMDDeckLinkIPFlowStatusID statusID, [out] double* value);
    HRESULT GetString ([in] BMDDeckLinkIPFlowStatusID statusID, [out] BSTR* value);
};

/* Interface IDeckLinkIPFlowSetting -  */

[
    object,
    uuid(86DD9174-27D3-4032-B2AD-6067C3BB2424),
    helpstring("")
] interface IDeckLinkIPFlowSetting : IUnknown
{
    HRESULT GetInt ([in] BMDDeckLinkIPFlowSettingID settingID, [out] LONGLONG* value);
    HRESULT GetFlag ([in] BMDDeckLinkIPFlowSettingID settingID, [out] BOOL* value);
    HRESULT GetFloat ([in] BMDDeckLinkIPFlowSettingID settingID, [out] double* value);
    HRESULT GetString ([in] BMDDeckLinkIPFlowSettingID settingID, [out] BSTR* value);
    HRESULT SetInt ([in] BMDDeckLinkIPFlowSettingID settingID, [in] LONGLONG value);
    HRESULT SetFlag ([in] BMDDeckLinkIPFlowSettingID settingID, [in] BOOL value);
    HRESULT SetFloat ([in] BMDDeckLinkIPFlowSettingID settingID, [in] double value);
    HRESULT SetString ([in] BMDDeckLinkIPFlowSettingID settingID, [in] BSTR value);
};

/* Interface IDeckLinkIPFlow -  */

[
    object,
    uuid(C5FC83C7-5B8E-42A7-9A40-7C065955D4E1),
    helpstring("")
] interface IDeckLinkIPFlow : IUnknown
{
    HRESULT Enable (void);	// Enables an IP flow to start sending or receiving.
    HRESULT Disable (void);	// Disables an IP flow to stop sending or receiving.
};

/* Interface IDeckLinkIPFlowIterator - Enumerates DeckLink IP Flows */

[
    object,
    uuid(BD296AB2-A5C5-4153-888F-AAB1FDBD8A5C),
    helpstring("Enumerates DeckLink IP Flows")
] interface IDeckLinkIPFlowIterator : IUnknown
{
    HRESULT Next ([out] IDeckLinkIPFlow** deckLinkIPFlowInstance);
};

/* Interface IDeckLinkOutput - Created by QueryInterface from IDeckLink. */

[
    object,
    uuid(1A8077F1-9FE2-4533-8147-2294305E253F),
    local,
    helpstring("Created by QueryInterface from IDeckLink.")
] interface IDeckLinkOutput : IUnknown
{
    HRESULT DoesSupportVideoMode ([in] BMDVideoConnection connection /* If a value of bmdVideoConnectionUnspecified is specified, the caller does not care about the connection */, [in] BMDDisplayMode requestedMode, [in] BMDPixelFormat requestedPixelFormat, [in] BMDVideoOutputConversionMode conversionMode, [in] BMDSupportedVideoModeFlags flags, [out] BMDDisplayMode* actualMode, [out] BOOL* supported);
    HRESULT GetDisplayMode ([in] BMDDisplayMode displayMode, [out] IDeckLinkDisplayMode** resultDisplayMode);
    HRESULT GetDisplayModeIterator ([out] IDeckLinkDisplayModeIterator** iterator);
    HRESULT SetScreenPreviewCallback ([in] IDeckLinkScreenPreviewCallback* previewCallback);

    /* Video Output */

    HRESULT EnableVideoOutput ([in] BMDDisplayMode displayMode, [in] BMDVideoOutputFlags flags);
    HRESULT DisableVideoOutput (void);
    HRESULT CreateVideoFrame ([in] int width, [in] int height, [in] int rowBytes, [in] BMDPixelFormat pixelFormat, [in] BMDFrameFlags flags, [out] IDeckLinkMutableVideoFrame** outFrame);
    HRESULT CreateVideoFrameWithBuffer ([in] int width, [in] int height, [in] int rowBytes, [in] BMDPixelFormat pixelFormat, [in] BMDFrameFlags flags, [in] IDeckLinkVideoBuffer* buffer, [out] IDeckLinkMutableVideoFrame** outFrame);
    HRESULT RowBytesForPixelFormat ([in] BMDPixelFormat pixelFormat, [in] int width, [out] int* rowBytes);
    HRESULT CreateAncillaryData ([in] BMDPixelFormat pixelFormat, [out] IDeckLinkVideoFrameAncillary** outBuffer);	// Use of IDeckLinkVideoFrameAncillaryPackets is preferred
    HRESULT DisplayVideoFrameSync ([in] IDeckLinkVideoFrame* theFrame);
    HRESULT ScheduleVideoFrame ([in] IDeckLinkVideoFrame* theFrame, [in] BMDTimeValue displayTime, [in] BMDTimeValue displayDuration, [in] BMDTimeScale timeScale);
    HRESULT SetScheduledFrameCompletionCallback ([in] IDeckLinkVideoOutputCallback* theCallback);
    HRESULT GetBufferedVideoFrameCount ([out] unsigned int* bufferedFrameCount);

    /* Audio Output */

    HRESULT EnableAudioOutput ([in] BMDAudioSampleRate sampleRate, [in] BMDAudioSampleType sampleType, [in] unsigned int channelCount, [in] BMDAudioOutputStreamType streamType);
    HRESULT DisableAudioOutput (void);
    HRESULT WriteAudioSamplesSync ([in] void* buffer, [in] unsigned int sampleFrameCount, [out] unsigned int* sampleFramesWritten);
    HRESULT BeginAudioPreroll (void);
    HRESULT EndAudioPreroll (void);
    HRESULT ScheduleAudioSamples ([in] void* buffer, [in] unsigned int sampleFrameCount, [in] BMDTimeValue streamTime, [in] BMDTimeScale timeScale, [out] unsigned int* sampleFramesWritten);
    HRESULT GetBufferedAudioSampleFrameCount ([out] unsigned int* bufferedSampleFrameCount);
    HRESULT FlushBufferedAudioSamples (void);
    HRESULT SetAudioCallback ([in] IDeckLinkAudioOutputCallback* theCallback);

    /* Output Control */

    HRESULT StartScheduledPlayback ([in] BMDTimeValue playbackStartTime, [in] BMDTimeScale timeScale, [in] double playbackSpeed);
    HRESULT StopScheduledPlayback ([in] BMDTimeValue stopPlaybackAtTime, [out] BMDTimeValue* actualStopTime, [in] BMDTimeScale timeScale);
    HRESULT IsScheduledPlaybackRunning ([out] BOOL* active);
    HRESULT GetScheduledStreamTime ([in] BMDTimeScale desiredTimeScale, [out] BMDTimeValue* streamTime, [out] double* playbackSpeed);
    HRESULT GetReferenceStatus ([out] BMDReferenceStatus* referenceStatus);

    /* Hardware Timing */

    HRESULT GetHardwareReferenceClock ([in] BMDTimeScale desiredTimeScale, [out] BMDTimeValue* hardwareTime, [out] BMDTimeValue* timeInFrame, [out] BMDTimeValue* ticksPerFrame);
    HRESULT GetFrameCompletionReferenceTimestamp ([in] IDeckLinkVideoFrame* theFrame, [in] BMDTimeScale desiredTimeScale, [out] BMDTimeValue* frameCompletionTimestamp);
};

/* Interface IDeckLinkInput - Created by QueryInterface from IDeckLink. */

[
    object,
    uuid(4095DB82-E294-4B8C-AAA8-3B9E80C49336),
    helpstring("Created by QueryInterface from IDeckLink.")
] interface IDeckLinkInput : IUnknown
{
    HRESULT DoesSupportVideoMode ([in] BMDVideoConnection connection /* If a value of bmdVideoConnectionUnspecified is specified, the caller does not care about the connection */, [in] BMDDisplayMode requestedMode, [in] BMDPixelFormat requestedPixelFormat, [in] BMDVideoInputConversionMode conversionMode, [in] BMDSupportedVideoModeFlags flags, [out] BMDDisplayMode* actualMode, [out] BOOL* supported);
    HRESULT GetDisplayMode ([in] BMDDisplayMode displayMode, [out] IDeckLinkDisplayMode** resultDisplayMode);
    HRESULT GetDisplayModeIterator ([out] IDeckLinkDisplayModeIterator** iterator);
    HRESULT SetScreenPreviewCallback ([in] IDeckLinkScreenPreviewCallback* previewCallback);

    /* Video Input */

    HRESULT EnableVideoInput ([in] BMDDisplayMode displayMode, [in] BMDPixelFormat pixelFormat, [in] BMDVideoInputFlags flags);
    HRESULT EnableVideoInputWithAllocatorProvider ([in] BMDDisplayMode displayMode, [in] BMDPixelFormat pixelFormat, [in] BMDVideoInputFlags flags, [in] IDeckLinkVideoBufferAllocatorProvider* allocatorProvider);
    HRESULT DisableVideoInput (void);
    HRESULT GetAvailableVideoFrameCount ([out] unsigned int* availableFrameCount);

    /* Audio Input */

    HRESULT EnableAudioInput ([in] BMDAudioSampleRate sampleRate, [in] BMDAudioSampleType sampleType, [in] unsigned int channelCount);
    HRESULT DisableAudioInput (void);
    HRESULT GetAvailableAudioSampleFrameCount ([out] unsigned int* availableSampleFrameCount);

    /* Input Control */

    HRESULT StartStreams (void);
    HRESULT StopStreams (void);
    HRESULT PauseStreams (void);
    HRESULT FlushStreams (void);
    HRESULT SetCallback ([in] IDeckLinkInputCallback* theCallback);

    /* Hardware Timing */

    HRESULT GetHardwareReferenceClock ([in] BMDTimeScale desiredTimeScale, [out] BMDTimeValue* hardwareTime, [out] BMDTimeValue* timeInFrame, [out] BMDTimeValue* ticksPerFrame);
};

/* Interface IDeckLinkIPExtensions -  */

[
    object,
    uuid(46CF7903-A9FD-4D0B-8FFC-0103722AB442),
    helpstring("")
] interface IDeckLinkIPExtensions : IUnknown
{
    HRESULT GetDeckLinkIPFlowIterator ([out] IDeckLinkIPFlowIterator** iterator);
    HRESULT GetIPFlowByID ([in] BMDIPFlowID id, [out] IDeckLinkIPFlow** flow);
};

/* Interface IDeckLinkHDMIInputEDID - Created by QueryInterface from IDeckLink. Releasing all references will restore EDID to default */

[
    object,
    uuid(ABBBACBC-45BC-4665-9D92-ACE6E5A97902),
    helpstring("Created by QueryInterface from IDeckLink. Releasing all references will restore EDID to default")
] interface IDeckLinkHDMIInputEDID : IUnknown
{
    HRESULT SetInt ([in] BMDDeckLinkHDMIInputEDIDID cfgID, [in] LONGLONG value);
    HRESULT GetInt ([in] BMDDeckLinkHDMIInputEDIDID cfgID, [out] LONGLONG* value);
    HRESULT WriteToEDID (void);
};

/* Interface IDeckLinkEncoderInput - Created by QueryInterface from IDeckLink. */

[
    object,
    uuid(46C1332E-6FD9-472A-8591-FE59C22192E1),
    helpstring("Created by QueryInterface from IDeckLink.")
] interface IDeckLinkEncoderInput : IUnknown
{
    HRESULT DoesSupportVideoMode ([in] BMDVideoConnection connection /* If a value of bmdVideoConnectionUnspecified is specified, the caller does not care about the connection */, [in] BMDDisplayMode requestedMode, [in] BMDPixelFormat requestedCodec, [in] unsigned int requestedCodecProfile, [in] BMDSupportedVideoModeFlags flags, [out] BOOL* supported);
    HRESULT GetDisplayMode ([in] BMDDisplayMode displayMode, [out] IDeckLinkDisplayMode** resultDisplayMode);
    HRESULT GetDisplayModeIterator ([out] IDeckLinkDisplayModeIterator** iterator);

    /* Video Input */

    HRESULT EnableVideoInput ([in] BMDDisplayMode displayMode, [in] BMDPixelFormat pixelFormat, [in] BMDVideoInputFlags flags);
    HRESULT DisableVideoInput (void);
    HRESULT GetAvailablePacketsCount ([out] unsigned int* availablePacketsCount);

    /* Audio Input */

    HRESULT EnableAudioInput ([in] BMDAudioFormat audioFormat, [in] BMDAudioSampleRate sampleRate, [in] BMDAudioSampleType sampleType, [in] unsigned int channelCount);
    HRESULT DisableAudioInput (void);
    HRESULT GetAvailableAudioSampleFrameCount ([out] unsigned int* availableSampleFrameCount);

    /* Input Control */

    HRESULT StartStreams (void);
    HRESULT StopStreams (void);
    HRESULT PauseStreams (void);
    HRESULT FlushStreams (void);
    HRESULT SetCallback ([in] IDeckLinkEncoderInputCallback* theCallback);

    /* Hardware Timing */

    HRESULT GetHardwareReferenceClock ([in] BMDTimeScale desiredTimeScale, [out] BMDTimeValue* hardwareTime, [out] BMDTimeValue* timeInFrame, [out] BMDTimeValue* ticksPerFrame);
};

/* Interface IDeckLinkVideoBuffer - Interface to encapsulate a video frame buffer; can be caller-implemented. */

[
    object,
    uuid(CCB4B64A-5C86-4E02-B778-885D352709FE),
    local,
    helpstring("Interface to encapsulate a video frame buffer; can be caller-implemented.")
] interface IDeckLinkVideoBuffer : IUnknown
{
    HRESULT GetBytes ([out] void** buffer);
    HRESULT StartAccess ([in] BMDBufferAccessFlags flags);
    HRESULT EndAccess ([in] BMDBufferAccessFlags flags);
};

/* Interface IDeckLinkVideoFrame - Interface to encapsulate a video frame; can be caller-implemented. */

[
    object,
    uuid(6502091C-615F-4F51-BAF6-45C4256DD5B0),
    local,
    helpstring("Interface to encapsulate a video frame; can be caller-implemented.")
] interface IDeckLinkVideoFrame : IUnknown
{
    long GetWidth (void);
    long GetHeight (void);
    long GetRowBytes (void);
    BMDPixelFormat GetPixelFormat (void);
    BMDFrameFlags GetFlags (void);
    HRESULT GetTimecode ([in] BMDTimecodeFormat format, [out] IDeckLinkTimecode** timecode);
    HRESULT GetAncillaryData ([out] IDeckLinkVideoFrameAncillary** ancillary);	// Use of IDeckLinkVideoFrameAncillaryPackets is preferred
};

/* Interface IDeckLinkMutableVideoFrame - Created by IDeckLinkOutput::CreateVideoFrame. */

[
    object,
    uuid(CF9EB134-0374-4C5B-95FA-1EC14819FF62),
    local,
    helpstring("Created by IDeckLinkOutput::CreateVideoFrame.")
] interface IDeckLinkMutableVideoFrame : IDeckLinkVideoFrame
{
    HRESULT SetFlags ([in] BMDFrameFlags newFlags);
    HRESULT SetTimecode ([in] BMDTimecodeFormat format, [in] IDeckLinkTimecode* timecode);
    HRESULT SetTimecodeFromComponents ([in] BMDTimecodeFormat format, [in] unsigned char hours, [in] unsigned char minutes, [in] unsigned char seconds, [in] unsigned char frames, [in] BMDTimecodeFlags flags);
    HRESULT SetAncillaryData ([in] IDeckLinkVideoFrameAncillary* ancillary);
    HRESULT SetTimecodeUserBits ([in] BMDTimecodeFormat format, [in] BMDTimecodeUserBits userBits);
    HRESULT SetInterfaceProvider ([in] REFIID iid, [in] IUnknown* iface);
};

/* Interface IDeckLinkVideoFrame3DExtensions - Optional interface to support 3D frames. */

[
    object,
    uuid(D4DBE9C6-B4D2-49D3-ABF2-B4E86C7391B0),
    local,
    helpstring("Optional interface to support 3D frames.")
] interface IDeckLinkVideoFrame3DExtensions : IUnknown
{
    BMDVideo3DPackingFormat Get3DPackingFormat (void);
    HRESULT GetFrameForRightEye ([out] IDeckLinkVideoFrame** rightEyeFrame);
};

/* Interface IDeckLinkVideoFrameMetadataExtensions - Get frame metadata */

[
    object,
    uuid(E232A5B7-4DB4-44C9-9152-F47C12E5F051),
    local,
    helpstring("Get frame metadata")
] interface IDeckLinkVideoFrameMetadataExtensions : IUnknown
{
    HRESULT GetInt ([in] BMDDeckLinkFrameMetadataID metadataID, [out] LONGLONG* value);
    HRESULT GetFloat ([in] BMDDeckLinkFrameMetadataID metadataID, [out] double* value);
    HRESULT GetFlag ([in] BMDDeckLinkFrameMetadataID metadataID, [out] BOOL* value);
    HRESULT GetString ([in] BMDDeckLinkFrameMetadataID metadataID, [out] BSTR* value);
    HRESULT GetBytes ([in] BMDDeckLinkFrameMetadataID metadataID, [out] void* buffer /* optional */, [in, out] unsigned int* bufferSize);
};

/* Interface IDeckLinkVideoFrameMutableMetadataExtensions - Set frame metadata */

[
    object,
    uuid(CC198FC6-8298-4419-942D-8357EC355E58),
    local,
    helpstring("Set frame metadata")
] interface IDeckLinkVideoFrameMutableMetadataExtensions : IDeckLinkVideoFrameMetadataExtensions
{
    HRESULT SetInt ([in] BMDDeckLinkFrameMetadataID metadataID, [in] LONGLONG value);
    HRESULT SetFloat ([in] BMDDeckLinkFrameMetadataID metadataID, [in] double value);
    HRESULT SetFlag ([in] BMDDeckLinkFrameMetadataID metadataID, [in] BOOL value);
    HRESULT SetString ([in] BMDDeckLinkFrameMetadataID metadataID, [in] BSTR value);
    HRESULT SetBytes ([in] BMDDeckLinkFrameMetadataID metadataID, [in] void* buffer, [in] unsigned int bufferSize);
};

/* Interface IDeckLinkVideoInputFrame - Provided by the IDeckLinkVideoInput frame arrival callback. */

[
    object,
    uuid(C9ADD3D2-BE52-488D-AB2D-7FDEF7AF0C95),
    local,
    helpstring("Provided by the IDeckLinkVideoInput frame arrival callback.")
] interface IDeckLinkVideoInputFrame : IDeckLinkVideoFrame
{
    HRESULT GetStreamTime ([out] BMDTimeValue* frameTime, [out] BMDTimeValue* frameDuration, [in] BMDTimeScale timeScale);
    HRESULT GetHardwareReferenceTimestamp ([in] BMDTimeScale timeScale, [out] BMDTimeValue* frameTime, [out] BMDTimeValue* frameDuration);
};

/* Interface IDeckLinkAncillaryPacket - On output, user needs to implement this interface */

[
    object,
    uuid(CC5BBF7E-029C-4D3B-9158-6000EF5E3670),
    helpstring("On output, user needs to implement this interface")
] interface IDeckLinkAncillaryPacket : IUnknown
{
    HRESULT GetBytes ([in] BMDAncillaryPacketFormat format /* For output, only one format need be offered */, [out] const void** data /* Optional */, [out] unsigned int* size /* Optional */);
    unsigned char GetDID (void);
    unsigned char GetSDID (void);
    unsigned int GetLineNumber (void);	// On output, zero is auto
    unsigned char GetDataStreamIndex (void);	// Usually zero. Can only be 1 if non-SD and the first data stream is completely full
};

/* Interface IDeckLinkAncillaryPacketIterator - Enumerates ancillary packets */

[
    object,
    uuid(3FC8994B-88FB-4C17-968F-9AAB69D964A7),
    helpstring("Enumerates ancillary packets")
] interface IDeckLinkAncillaryPacketIterator : IUnknown
{
    HRESULT Next ([out] IDeckLinkAncillaryPacket** packet);
};

/* Interface IDeckLinkVideoFrameAncillaryPackets - Obtained through QueryInterface on an IDeckLinkVideoFrame object. */

[
    object,
    uuid(6C186C0F-459E-41D8-AEE2-4812D81AEE68),
    local,
    helpstring("Obtained through QueryInterface on an IDeckLinkVideoFrame object.")
] interface IDeckLinkVideoFrameAncillaryPackets : IUnknown
{
    HRESULT GetPacketIterator ([out] IDeckLinkAncillaryPacketIterator** iterator);
    HRESULT GetFirstPacketByID ([in] unsigned char DID, [in] unsigned char SDID, [out] IDeckLinkAncillaryPacket** packet);
    HRESULT AttachPacket ([in] IDeckLinkAncillaryPacket* packet);	// Implement IDeckLinkAncillaryPacket to output your own
    HRESULT DetachPacket ([in] IDeckLinkAncillaryPacket* packet);
    HRESULT DetachAllPackets (void);
};

/* Interface IDeckLinkVideoFrameAncillary - Use of IDeckLinkVideoFrameAncillaryPackets is preferred. Obtained through QueryInterface on an IDeckLinkVideoFrame object. */

[
    object,
    uuid(732E723C-D1A4-4E29-9E8E-4A88797A0004),
    local,
    helpstring("Use of IDeckLinkVideoFrameAncillaryPackets is preferred. Obtained through QueryInterface on an IDeckLinkVideoFrame object.")
] interface IDeckLinkVideoFrameAncillary : IUnknown
{
    HRESULT GetBufferForVerticalBlankingLine ([in] unsigned int lineNumber, [out] void** buffer);	// Pixels/rowbytes is same as display mode, except for above HD where it's 1920 pixels for UHD modes and 2048 pixels for DCI modes
    BMDPixelFormat GetPixelFormat (void);
    BMDDisplayMode GetDisplayMode (void);
};

/* Interface IDeckLinkEncoderPacket - Interface to encapsulate an encoded packet. */

[
    object,
    uuid(B693F36C-316E-4AF1-B6C2-F389A4BCA620),
    local,
    helpstring("Interface to encapsulate an encoded packet.")
] interface IDeckLinkEncoderPacket : IUnknown
{
    HRESULT GetBytes ([out] void** buffer);
    long GetSize (void);
    HRESULT GetStreamTime ([out] BMDTimeValue* frameTime, [in] BMDTimeScale timeScale);
    BMDPacketType GetPacketType (void);
};

/* Interface IDeckLinkEncoderVideoPacket - Provided by the IDeckLinkEncoderInput video packet arrival callback. */

[
    object,
    uuid(4E7FD944-E8C7-4EAC-B8C0-7B77F80F5AE0),
    local,
    helpstring("Provided by the IDeckLinkEncoderInput video packet arrival callback.")
] interface IDeckLinkEncoderVideoPacket : IDeckLinkEncoderPacket
{
    BMDPixelFormat GetPixelFormat (void);
    HRESULT GetHardwareReferenceTimestamp ([in] BMDTimeScale timeScale, [out] BMDTimeValue* frameTime, [out] BMDTimeValue* frameDuration);
    HRESULT GetTimecode ([in] BMDTimecodeFormat format, [out] IDeckLinkTimecode** timecode);
};

/* Interface IDeckLinkEncoderAudioPacket - Provided by the IDeckLinkEncoderInput audio packet arrival callback. */

[
    object,
    uuid(49E8EDC8-693B-4E14-8EF6-12C658F5A07A),
    local,
    helpstring("Provided by the IDeckLinkEncoderInput audio packet arrival callback.")
] interface IDeckLinkEncoderAudioPacket : IDeckLinkEncoderPacket
{
    BMDAudioFormat GetAudioFormat (void);
};

/* Interface IDeckLinkH265NALPacket - Obtained through QueryInterface on an IDeckLinkEncoderVideoPacket object */

[
    object,
    uuid(639C8E0B-68D5-4BDE-A6D4-95F3AEAFF2E7),
    local,
    helpstring("Obtained through QueryInterface on an IDeckLinkEncoderVideoPacket object")
] interface IDeckLinkH265NALPacket : IDeckLinkEncoderVideoPacket
{
    HRESULT GetUnitType ([out] unsigned char* unitType);
    HRESULT GetBytesNoPrefix ([out] void** buffer);
    long GetSizeNoPrefix (void);
};

/* Interface IDeckLinkAudioInputPacket - Provided by the IDeckLinkInput callback. */

[
    object,
    uuid(E43D5870-2894-11DE-8C30-0800200C9A66),
    local,
    helpstring("Provided by the IDeckLinkInput callback.")
] interface IDeckLinkAudioInputPacket : IUnknown
{
    long GetSampleFrameCount (void);
    HRESULT GetBytes ([out] void** buffer);
    HRESULT GetPacketTime ([out] BMDTimeValue* packetTime, [in] BMDTimeScale timeScale);
};

/* Interface IDeckLinkScreenPreviewCallback - Screen preview callback */

[
    object,
    uuid(D4FA2345-9FBA-4497-95C3-C0C3CED3CDA8),
    local,
    helpstring("Screen preview callback")
] interface IDeckLinkScreenPreviewCallback : IUnknown
{
    HRESULT DrawFrame ([in] IDeckLinkVideoFrame* theFrame);
};

/* Interface IDeckLinkGLScreenPreviewHelper - Created with CoCreateInstance on platforms with native COM support or from CreateOpenGLScreenPreviewHelper/CreateOpenGL3ScreenPreviewHelper on other platforms. */

[
    object,
    uuid(CEB778E2-C202-4EC8-9085-0CD285CC5522),
    local,
    helpstring("Created with CoCreateInstance on platforms with native COM support or from CreateOpenGLScreenPreviewHelper/CreateOpenGL3ScreenPreviewHelper on other platforms.")
] interface IDeckLinkGLScreenPreviewHelper : IUnknown
{

    /* Methods must be called with OpenGL context set */

    HRESULT InitializeGL (void);
    HRESULT PaintGL (void);
    HRESULT SetFrame ([in] IDeckLinkVideoFrame* theFrame);
    HRESULT Set3DPreviewFormat ([in] BMD3DPreviewFormat previewFormat);
};

/* Interface IDeckLinkDX9ScreenPreviewHelper - Created with CoCreateInstance. */

[
    object,
    uuid(F2DD78CA-2921-4AC2-B5BC-BFDCC2035A1F),
    local,
    helpstring("Created with CoCreateInstance.")
] interface IDeckLinkDX9ScreenPreviewHelper : IUnknown
{
    HRESULT Initialize ([in] void* device);
    HRESULT Render ([in] RECT* rc);
    HRESULT SetFrame ([in] IDeckLinkVideoFrame* theFrame);
    HRESULT Set3DPreviewFormat ([in] BMD3DPreviewFormat previewFormat);
};

/* Interface IDeckLinkWPFDX9ScreenPreviewHelper - Created with CoCreateInstance(). */

[
    object,
    uuid(C59346CD-9326-4266-AC2D-5C190F5799EE),
    local,
    helpstring("Created with CoCreateInstance().")
] interface IDeckLinkWPFDX9ScreenPreviewHelper : IUnknown
{
    HRESULT Initialize (void);
    HRESULT Render (void);
    HRESULT SetSurfaceSize ([in] unsigned int width, [in] unsigned int height);
    HRESULT SetFrame ([in] IDeckLinkVideoFrame* theFrame);
    HRESULT Set3DPreviewFormat ([in] BMD3DPreviewFormat previewFormat);
    HRESULT GetBackBuffer ([out] void** backBuffer);
};

/* Interface IDeckLinkNotificationCallback - DeckLink Notification Callback Interface */

[
    object,
    uuid(b002a1ec-070d-4288-8289-bd5d36e5ff0d),
    local,
    helpstring("DeckLink Notification Callback Interface")
] interface IDeckLinkNotificationCallback : IUnknown
{
    HRESULT Notify ([in] BMDNotifications topic, [in] ULONGLONG param1, [in] ULONGLONG param2);
};

/* Interface IDeckLinkNotification - DeckLink Notification interface */

[
    object,
    uuid(b85df4c8-bdf5-47c1-8064-28162ebdd4eb),
    local,
    helpstring("DeckLink Notification interface")
] interface IDeckLinkNotification : IUnknown
{
    HRESULT Subscribe ([in] BMDNotifications topic, [in] IDeckLinkNotificationCallback* theCallback);
    HRESULT Unsubscribe ([in] BMDNotifications topic, [in] IDeckLinkNotificationCallback* theCallback);
};

/* Interface IDeckLinkProfileAttributes - Created by QueryInterface from an IDeckLinkProfile, or from IDeckLink. When queried from IDeckLink, interrogates the active profile */

[
    object,
    uuid(17D4BF8E-4911-473A-80A0-731CF6FF345B),
    local,
    helpstring("Created by QueryInterface from an IDeckLinkProfile, or from IDeckLink. When queried from IDeckLink, interrogates the active profile")
] interface IDeckLinkProfileAttributes : IUnknown
{
    HRESULT GetFlag ([in] BMDDeckLinkAttributeID cfgID, [out] BOOL* value);
    HRESULT GetInt ([in] BMDDeckLinkAttributeID cfgID, [out] LONGLONG* value);
    HRESULT GetFloat ([in] BMDDeckLinkAttributeID cfgID, [out] double* value);
    HRESULT GetString ([in] BMDDeckLinkAttributeID cfgID, [out] BSTR* value);
};

/* Interface IDeckLinkProfileIterator - Enumerates IDeckLinkProfile interfaces */

[
    object,
    uuid(29E5A8C0-8BE4-46EB-93AC-31DAAB5B7BF2),
    helpstring("Enumerates IDeckLinkProfile interfaces")
] interface IDeckLinkProfileIterator : IUnknown
{
    HRESULT Next ([out] IDeckLinkProfile** profile);
};

/* Interface IDeckLinkProfile - Represents the active profile when queried from IDeckLink */

[
    object,
    uuid(16093466-674A-432B-9DA0-1AC2C5A8241C),
    local,
    helpstring("Represents the active profile when queried from IDeckLink")
] interface IDeckLinkProfile : IUnknown
{
    HRESULT GetDevice ([out] IDeckLink** device);	// Device affected when this profile becomes active
    HRESULT IsActive ([out] BOOL* isActive);
    HRESULT SetActive (void);	// Activating a profile will also change the profile on all devices enumerated by GetPeers. Activation is not complete until IDeckLinkProfileCallback::ProfileActivated is called
    HRESULT GetPeers ([out] IDeckLinkProfileIterator** profileIterator);	// Profiles of other devices activated with this profile
};

/* Interface IDeckLinkProfileCallback - Receive notifications about profiles related to this device */

[
    object,
    uuid(A4F9341E-97AA-4E04-8935-15F809898CEA),
    helpstring("Receive notifications about profiles related to this device")
] interface IDeckLinkProfileCallback : IUnknown
{
    HRESULT ProfileChanging ([in] IDeckLinkProfile* profileToBeActivated, [in] BOOL streamsWillBeForcedToStop);	// Called before this device changes profile. User has an opportunity for teardown if streamsWillBeForcedToStop
    HRESULT ProfileActivated ([in] IDeckLinkProfile* activatedProfile);	// Called after this device has been activated with a new profile
};

/* Interface IDeckLinkProfileManager - Created by QueryInterface from IDeckLink when a device has multiple optional profiles */

[
    object,
    uuid(30D41429-3998-4B6D-84F8-78C94A797C6E),
    helpstring("Created by QueryInterface from IDeckLink when a device has multiple optional profiles")
] interface IDeckLinkProfileManager : IUnknown
{
    HRESULT GetProfiles ([out] IDeckLinkProfileIterator** profileIterator);	// All available profiles for this device
    HRESULT GetProfile ([in] BMDProfileID profileID, [out] IDeckLinkProfile** profile);
    HRESULT SetCallback ([in] IDeckLinkProfileCallback* callback);
};

/* Interface IDeckLinkStatus - DeckLink Status interface */

[
    object,
    uuid(5F558200-4028-49BC-BEAC-DB3FA4A96E46),
    local,
    helpstring("DeckLink Status interface")
] interface IDeckLinkStatus : IUnknown
{
    HRESULT GetFlag ([in] BMDDeckLinkStatusID statusID, [out] BOOL* value);
    HRESULT GetInt ([in] BMDDeckLinkStatusID statusID, [out] LONGLONG* value);
    HRESULT GetFloat ([in] BMDDeckLinkStatusID statusID, [out] double* value);
    HRESULT GetString ([in] BMDDeckLinkStatusID statusID, [out] BSTR* value);
    HRESULT GetBytes ([in] BMDDeckLinkStatusID statusID, [out] void* buffer, [in, out] unsigned int* bufferSize);
};

/* Interface IDeckLinkKeyer - DeckLink Keyer interface */

[
    object,
    uuid(89AFCAF5-65F8-421E-98F7-96FE5F5BFBA3),
    local,
    helpstring("DeckLink Keyer interface")
] interface IDeckLinkKeyer : IUnknown
{
    HRESULT Enable ([in] BOOL isExternal);
    HRESULT SetLevel ([in] unsigned char level);
    HRESULT RampUp ([in] unsigned int numberOfFrames);
    HRESULT RampDown ([in] unsigned int numberOfFrames);
    HRESULT Disable (void);
};

/* Interface IDeckLinkVideoConversion - Created with CoCreateInstance. */

[
    object,
    uuid(A48755D9-8BD5-4727-A1E9-069FDEDBA6E9),
    local,
    helpstring("Created with CoCreateInstance.")
] interface IDeckLinkVideoConversion : IUnknown
{
    HRESULT ConvertFrame ([in] IDeckLinkVideoFrame* srcFrame, [in] IDeckLinkVideoFrame* dstFrame);
    HRESULT ConvertNewFrame ([in] IDeckLinkVideoFrame* srcFrame, [in] BMDPixelFormat dstPixelFormat, [in] BMDColorspace dstColorspace, [in] IDeckLinkVideoBuffer* dstBuffer, [out] IDeckLinkVideoFrame** dstFrame);
};

/* Interface IDeckLinkDeviceNotificationCallback - DeckLink device arrival/removal notification callbacks */

[
    object,
    uuid(4997053B-0ADF-4CC8-AC70-7A50C4BE728F),
    helpstring("DeckLink device arrival/removal notification callbacks")
] interface IDeckLinkDeviceNotificationCallback : IUnknown
{
    HRESULT DeckLinkDeviceArrived ([in] IDeckLink* deckLinkDevice);
    HRESULT DeckLinkDeviceRemoved ([in] IDeckLink* deckLinkDevice);
};

/* Interface IDeckLinkDiscovery - DeckLink device discovery */

[
    object,
    uuid(CDBF631C-BC76-45FA-B44D-C55059BC6101),
    helpstring("DeckLink device discovery")
] interface IDeckLinkDiscovery : IUnknown
{
    HRESULT InstallDeviceNotifications ([in] IDeckLinkDeviceNotificationCallback* deviceNotificationCallback);
    HRESULT UninstallDeviceNotifications (void);
};

/* Coclasses */

importlib("stdole2.tlb");

[
    uuid(BA6C6F44-6DA5-4DCE-94AA-EE2D1372A676),
    helpstring("CDeckLinkIterator Class")
] coclass CDeckLinkIterator
{
    [default] interface IDeckLinkIterator;
};

[
    uuid(263CA19F-ED09-482E-9F9D-84005783A237),
    helpstring("CDeckLinkAPIInformation Class")
] coclass CDeckLinkAPIInformation
{
    [default] interface IDeckLinkAPIInformation;
};

[
    uuid(1E332DAE-0D04-49EB-B8A1-B6E00B2B6BD0),
    helpstring("CDeckLinkGLScreenPreviewHelper Class")
] coclass CDeckLinkGLScreenPreviewHelper
{
    [default] interface IDeckLinkGLScreenPreviewHelper;
};

[
    uuid(166804E4-15EF-4BFD-B623-B5BA921667C5),
    helpstring("CDeckLinkGL3ScreenPreviewHelper Class. Requires OpenGL 3.2 support and provides improved performance and color handling")
] coclass CDeckLinkGL3ScreenPreviewHelper
{
    [default] interface IDeckLinkGLScreenPreviewHelper;
};

[
    uuid(0EB111ED-ADA6-43A6-8B16-CA5D27EEA15E),
    helpstring("CDeckLinkDX9ScreenPreviewHelper Class")
] coclass CDeckLinkDX9ScreenPreviewHelper
{
    [default] interface IDeckLinkDX9ScreenPreviewHelper;
};

[
    uuid(5E64496D-4BB2-45D5-9B63-BF1B463B18AF),
    helpstring("CDeckLinkWPFDX9ScreenPreviewHelper Class")
] coclass CDeckLinkWPFDX9ScreenPreviewHelper
{
    [default] interface IDeckLinkWPFDX9ScreenPreviewHelper;
};

[
    uuid(89BA47BD-1FE2-4D76-9BFE-DE85049C4987),
    helpstring("CDeckLinkVideoConversion Class")
] coclass CDeckLinkVideoConversion
{
    [default] interface IDeckLinkVideoConversion;
};

[
    uuid(22FBFC33-8D07-495C-A5BF-DAB5EA9B82DB),
    helpstring("CDeckLinkDiscovery Class")
] coclass CDeckLinkDiscovery
{
    [default] interface IDeckLinkDiscovery;
};

[
    uuid(F891AD29-D0C2-46E9-A926-4E2D0DD8CFAD),
    helpstring("CDeckLinkVideoFrameAncillaryPackets Class")
] coclass CDeckLinkVideoFrameAncillaryPackets
{
    [default] interface IDeckLinkVideoFrameAncillaryPackets;
};

// import deprecated interfaces

#include "DeckLinkAPI_v14_2_1.idl"
#include "DeckLinkAPI_v11_5_1.idl"
#include "DeckLinkAPI_v10_11.idl"
#include "DeckLinkAPI_v10_9.idl"
#include "DeckLinkAPIStreaming_v10_8.idl"
#include "DeckLinkAPI_v10_4.idl"
#include "DeckLinkAPI_v10_2.idl"
#include "DeckLinkAPI_v11_5.idl"
#include "DeckLinkAPI_v11_4.idl"
#include "DeckLinkAPI_v10_8.idl"
#include "DeckLinkAPI_v10_6.idl"
#include "DeckLinkAPI_v10_5.idl"
};
