/* -LICENSE-START-
** Copyright (c) 2025 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-
*/

#pragma once

#include "DeckLinkAPI.h"

// Interface ID Declarations

BMD_CONST REFIID IID_IDeckLinkStatus_v15_3_1                          = /* 5F558200-4028-49BC-BEAC-DB3FA4A96E46 */ { 0x5F,0x55,0x82,0x00,0x40,0x28,0x49,0xBC,0xBE,0xAC,0xDB,0x3F,0xA4,0xA9,0x6E,0x46 };
BMD_CONST REFIID IID_IDeckLinkVideoBuffer_v15_3_1                     = /* CCB4B64A-5C86-4E02-B778-885D352709FE */ { 0xCC,0xB4,0xB6,0x4A,0x5C,0x86,0x4E,0x02,0xB7,0x78,0x88,0x5D,0x35,0x27,0x09,0xFE };
BMD_CONST REFIID IID_IDeckLinkVideoBufferAllocator_v15_3_1            = /* 3481A4DF-2B11-4E55-AC61-836B87985E9A */ { 0x34,0x81,0xA4,0xDF,0x2B,0x11,0x4E,0x55,0xAC,0x61,0x83,0x6B,0x87,0x98,0x5E,0x9A };
BMD_CONST REFIID IID_IDeckLinkVideoBufferAllocatorProvider_v15_3_1    = /* 08B80403-BFF2-49D0-B448-8C908B9E9FC9 */ { 0x08,0xB8,0x04,0x03,0xBF,0xF2,0x49,0xD0,0xB4,0x48,0x8C,0x90,0x8B,0x9E,0x9F,0xC9 };
BMD_CONST REFIID IID_IDeckLinkVideoConversion_v15_3_1                 = /* A48755D9-8BD5-4727-A1E9-069FDEDBA6E9 */ { 0xA4,0x87,0x55,0xD9,0x8B,0xD5,0x47,0x27,0xA1,0xE9,0x06,0x9F,0xDE,0xDB,0xA6,0xE9 };
BMD_CONST REFIID IID_IDeckLinkProfileAttributes_v15_3_1               = /* 17D4BF8E-4911-473A-80A0-731CF6FF345B */ { 0x17,0xD4,0xBF,0x8E,0x49,0x11,0x47,0x3A,0x80,0xA0,0x73,0x1C,0xF6,0xFF,0x34,0x5B };
BMD_CONST REFIID IID_IDeckLinkNotification_v15_3_1                    = /* B85DF4C8-BDF5-47C1-8064-28162EBDD4EB */ { 0xB8,0x5D,0xF4,0xC8,0xBD,0xF5,0x47,0xC1,0x80,0x64,0x28,0x16,0x2E,0xBD,0xD4,0xEB };

#if defined(__cplusplus)

/* Enum BMDDeckLinkStatusID_v15_3_1 - DeckLink Status ID */

typedef uint32_t BMDDeckLinkStatusID_v15_3_1;
enum _BMDDeckLinkStatusID_v15_3_1
{
    /* Integers */
    bmdDeckLinkStatusDeviceTemperature_v15_3_1                          = /* 'dtmp' */ 0x64746D70,

    bmdDeckLinkStatusEthernetLink_v15_3_1                               = /* 'sels' */ 0x73656C73,
    bmdDeckLinkStatusEthernetLinkMbps_v15_3_1                           = /* 'sesp' */ 0x73657370,

    /* Strings */
    bmdDeckLinkStatusEthernetLocalIPAddress_v15_3_1                     = /* 'seip' */ 0x73656970,
    bmdDeckLinkStatusEthernetSubnetMask_v15_3_1                         = /* 'sesm' */ 0x7365736D,
    bmdDeckLinkStatusEthernetGatewayIPAddress_v15_3_1                   = /* 'segw' */ 0x73656777,
    bmdDeckLinkStatusEthernetPrimaryDNS_v15_3_1                         = /* 'sepd' */ 0x73657064,
    bmdDeckLinkStatusEthernetSecondaryDNS_v15_3_1                       = /* 'sesd' */ 0x73657364,
    bmdDeckLinkStatusEthernetVideoOutputAddress_v15_3_1                 = /* 'soav' */ 0x736F6176,
    bmdDeckLinkStatusEthernetAudioOutputAddress_v15_3_1                 = /* 'soaa' */ 0x736F6161,
    bmdDeckLinkStatusEthernetAncillaryOutputAddress_v15_3_1             = /* 'soaA' */ 0x736F6141,
};

/* Enum BMDDeckLinkAttributeID - DeckLink Attribute ID */

typedef uint32_t BMDDeckLinkAttributeID_v15_3_1;
enum _BMDDeckLinkAttributeID_v15_3_1
{
    /* Strings */
    BMDDeckLinkEthernetMACAddress_v15_3_1                               = /* 'eMAC' */ 0x654D4143,
};

/* Interface IDeckLinkStatus_v15_3_1 - DeckLink Status interface */

class BMD_PUBLIC IDeckLinkStatus_v15_3_1 : public IUnknown
{
public:
    virtual HRESULT GetFlag (/* in */ BMDDeckLinkStatusID statusID, /* out */ bool* value) = 0;
    virtual HRESULT GetInt (/* in */ BMDDeckLinkStatusID statusID, /* out */ int64_t* value) = 0;
    virtual HRESULT GetFloat (/* in */ BMDDeckLinkStatusID statusID, /* out */ double* value) = 0;
    virtual HRESULT GetString (/* in */ BMDDeckLinkStatusID statusID, /* out */ const char** value) = 0;
    virtual HRESULT GetBytes (/* in */ BMDDeckLinkStatusID statusID, /* out */ void* buffer, /* in, out */ uint32_t* bufferSize) = 0;

protected:
    virtual ~IDeckLinkStatus_v15_3_1 () {} // call Release method to drop reference count
};

/* Interface IDeckLinkVideoBuffer_v15_3_1 - Interface to encapsulate a video frame buffer; can be caller-implemented. */

class BMD_PUBLIC IDeckLinkVideoBuffer_v15_3_1 : public IUnknown
{
public:
	virtual HRESULT GetBytes (/* out */ void** buffer) = 0;
	virtual HRESULT StartAccess (/* in */ BMDBufferAccessFlags flags) = 0;
	virtual HRESULT EndAccess (/* in */ BMDBufferAccessFlags flags) = 0;

protected:
	virtual ~IDeckLinkVideoBuffer_v15_3_1 () {} // call Release method to drop reference count
};

/* Interface IDeckLinkVideoBufferAllocator_v15_3_1 - Buffer allocator for video. */

class BMD_PUBLIC IDeckLinkVideoBufferAllocator_v15_3_1 : public IUnknown
{
public:
	virtual HRESULT AllocateVideoBuffer (/* out */ IDeckLinkVideoBuffer_v15_3_1** allocatedBuffer) = 0;

protected:
	virtual ~IDeckLinkVideoBufferAllocator_v15_3_1 () {} // call Release method to drop reference count
};

/* Interface IDeckLinkVideoBufferAllocatorProvider_v15_3_1 - Allows EnableVideoInputWithAllocatorProvider to obtain allocators */

class BMD_PUBLIC IDeckLinkVideoBufferAllocatorProvider_v15_3_1 : public IUnknown
{
public:
	virtual HRESULT GetVideoBufferAllocator (/* in */ uint32_t bufferSize, /* in */ uint32_t width, /* in */ uint32_t height, /* in */ uint32_t rowBytes, /* in */ BMDPixelFormat pixelFormat, /* out */ IDeckLinkVideoBufferAllocator_v15_3_1** allocator) = 0;

protected:
	virtual ~IDeckLinkVideoBufferAllocatorProvider_v15_3_1 () {} // call Release method to drop reference count
};

/* Interface IDeckLinkVideoConversion_v15_3_1 */

class BMD_PUBLIC IDeckLinkVideoConversion_v15_3_1 : public IUnknown
{
public:
    virtual HRESULT ConvertFrame (/* in */ IDeckLinkVideoFrame* srcFrame, /* in */ IDeckLinkVideoFrame* dstFrame) = 0;
    virtual HRESULT ConvertNewFrame (/* in */ IDeckLinkVideoFrame* srcFrame, /* in */ BMDPixelFormat dstPixelFormat, /* in */ BMDColorspace dstColorspace, /* in */ IDeckLinkVideoBuffer_v15_3_1* dstBuffer, /* out */ IDeckLinkVideoFrame** dstFrame) = 0;

protected:
    virtual ~IDeckLinkVideoConversion_v15_3_1 () {} // call Release method to drop reference count
};

/* Interface IDeckLinkProfileAttributes_v15_3_1 - Created by QueryInterface from an IDeckLinkProfile, or from IDeckLink. When queried from IDeckLink, interrogates the active profile */

class BMD_PUBLIC IDeckLinkProfileAttributes_v15_3_1 : public IUnknown
{
public:
    virtual HRESULT GetFlag (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ bool* value) = 0;
    virtual HRESULT GetInt (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ int64_t* value) = 0;
    virtual HRESULT GetFloat (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ double* value) = 0;
    virtual HRESULT GetString (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ const char** value) = 0;

protected:
    virtual ~IDeckLinkProfileAttributes_v15_3_1 () {} // call Release method to drop reference count
};

/* Interface IDeckLinkNotification_v15_3_1 - DeckLink Notification interface */

class BMD_PUBLIC IDeckLinkNotification_v15_3_1 : public IUnknown
{
public:
    virtual HRESULT Subscribe (/* in */ BMDNotifications topic, /* in */ IDeckLinkNotificationCallback *theCallback) = 0;
    virtual HRESULT Unsubscribe (/* in */ BMDNotifications topic, /* in */ IDeckLinkNotificationCallback *theCallback) = 0;

protected:
    virtual ~IDeckLinkNotification_v15_3_1 () {} // call Release method to drop reference count
};

/* Functions */

extern "C"
{
    BMD_PUBLIC IDeckLinkIterator* CreateDeckLinkIteratorInstance_v15_3_1(void);
    BMD_PUBLIC IDeckLinkDiscovery* CreateDeckLinkDiscoveryInstance_v15_3_1(void);
    BMD_PUBLIC IDeckLinkAPIInformation* CreateDeckLinkAPIInformationInstance_v15_3_1(void);
    BMD_PUBLIC IDeckLinkGLScreenPreviewHelper* CreateOpenGLScreenPreviewHelper_v15_3_1(void);
    BMD_PUBLIC IDeckLinkGLScreenPreviewHelper* CreateOpenGL3ScreenPreviewHelper_v15_3_1(void);	// Requires OpenGL 3.2 support and provides improved performance and color handling
    BMD_PUBLIC IDeckLinkVideoConversion_v15_3_1* CreateVideoConversionInstance_v15_3_1(void);
    BMD_PUBLIC IDeckLinkVideoFrameAncillaryPackets* CreateVideoFrameAncillaryPacketsInstance_v15_3_1(void);	// For use when creating a custom IDeckLinkVideoFrame without wrapping IDeckLinkOutput::CreateVideoFrame
}

#endif      // defined(__cplusplus)
