[Sumover-dev] [svn commit] r4576 - in vic/branches/mpeg4: video

sumover-dev at cs.ucl.ac.uk sumover-dev at cs.ucl.ac.uk
Sat Jan 30 10:06:31 GMT 2010


Author: douglask
Date: Sat Jan 30 10:06:31 2010
New Revision: 4576

Added:
   vic/branches/mpeg4/video/DeckLinkAPI.idl
   vic/branches/mpeg4/video/DeckLinkAPI_v7_1.idl
   vic/branches/mpeg4/video/DeckLinkAPI_v7_3.idl
Modified:
   vic/branches/mpeg4/vic.2008.vcproj
   vic/branches/mpeg4/video/grabber-decklink.cpp

Log:
Blackmagic DeckLink grabber modifications for Windows support

Modified: vic/branches/mpeg4/vic.2008.vcproj
==============================================================================
--- vic/branches/mpeg4/vic.2008.vcproj	(original)
+++ vic/branches/mpeg4/vic.2008.vcproj	Sat Jan 30 10:06:31 2010
@@ -2147,6 +2147,46 @@
 				>
 			</File>
 			<File
+				RelativePath=".\video\DeckLinkAPI.idl"
+				>
+				<FileConfiguration
+					Name="Debug (nonGPL)|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCMIDLTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release (nonGPL)|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCMIDLTool"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath=".\DeckLinkAPI_i.c"
+				>
+				<FileConfiguration
+					Name="Debug (nonGPL)|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release (nonGPL)|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
 				RelativePath=".\video\deinterlace.cpp"
 				>
 				<FileConfiguration
@@ -2171,6 +2211,26 @@
 				>
 			</File>
 			<File
+				RelativePath=".\video\grabber-decklink.cpp"
+				>
+				<FileConfiguration
+					Name="Debug (nonGPL)|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release (nonGPL)|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
 				RelativePath=".\video\grabber-file.cpp"
 				>
 			</File>

Added: vic/branches/mpeg4/video/DeckLinkAPI.idl
==============================================================================
--- (empty file)
+++ vic/branches/mpeg4/video/DeckLinkAPI.idl	Sat Jan 30 10:06:31 2010
@@ -0,0 +1,847 @@
+/* -LICENSE-START-
+** Copyright (c) 2009 Blackmagic Design
+**
+** Permission is hereby granted, free of charge, to any person or organization
+** obtaining a copy of the software and accompanying documentation covered by
+** this license (the "Software") to use, reproduce, display, distribute,
+** 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, all subject to the following:
+** 
+** 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.
+** 
+** 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.
+** -LICENSE-END-
+*/
+
+/* DeckLinkAPI.idl */
+
+import "unknwn.idl";
+
+[uuid(D864517A-EDD5-466D-867D-C819F1C052BB),
+version(1.0), helpstring("DeckLink API Library")]
+library DeckLinkAPI
+{
+
+/* Type Declarations */
+
+typedef LONGLONG BMDTimeValue;
+typedef LONGLONG BMDTimeScale;
+typedef unsigned long BMDTimecodeBCD;
+
+/* End Type Declarations */
+
+/* Enumeration Mapping */
+
+cpp_quote("typedef unsigned long BMDFrameFlags;")
+cpp_quote("typedef unsigned long BMDVideoInputFlags;")
+cpp_quote("typedef unsigned long BMDVideoInputFormatChangedEvents;")
+cpp_quote("typedef unsigned long BMDDetectedVideoInputFormatFlags;")
+cpp_quote("typedef unsigned long BMDTimecodeFlags;")
+cpp_quote("typedef unsigned long BMDAnalogVideoFlags;")
+cpp_quote("#if 0")
+typedef enum _BMDFrameFlags BMDFrameFlags;
+typedef enum _BMDVideoInputFlags BMDVideoInputFlags;
+typedef enum _BMDVideoInputFormatChangedEvents BMDVideoInputFormatChangedEvents;
+typedef enum _BMDDetectedVideoInputFormatFlags BMDDetectedVideoInputFormatFlags;
+typedef enum _BMDTimecodeFlags BMDTimecodeFlags;
+typedef enum _BMDAnalogVideoFlags BMDAnalogVideoFlags;
+cpp_quote("#endif")
+
+/* End Enumeration Mapping */
+
+/* Enum BMDDisplayMode - Video display modes */
+
+typedef [v1_enum] enum	_BMDDisplayMode {
+    bmdModeNTSC                                        = /* 'ntsc' */ 0x6E747363,
+    bmdModeNTSC2398                                    = /* 'nt23' */ 0x6E743233, // 3:2 pulldown
+    bmdModePAL                                         = /* 'pal ' */ 0x70616C20,
+
+    /* HD 1080 Modes */
+
+    bmdModeHD1080p2398                                 = /* '23ps' */ 0x32337073,
+    bmdModeHD1080p24                                   = /* '24ps' */ 0x32347073,
+    bmdModeHD1080p25                                   = /* 'Hp25' */ 0x48703235,
+    bmdModeHD1080p2997                                 = /* 'Hp29' */ 0x48703239,
+    bmdModeHD1080p30                                   = /* 'Hp30' */ 0x48703330,
+    bmdModeHD1080i50                                   = /* 'Hi50' */ 0x48693530,
+    bmdModeHD1080i5994                                 = /* 'Hi59' */ 0x48693539,
+    bmdModeHD1080i6000                                 = /* 'Hi60' */ 0x48693630, // N.B. This _really_ is 60.00 Hz.
+    bmdModeHD1080p50                                   = /* 'Hp50' */ 0x48703530,
+    bmdModeHD1080p5994                                 = /* 'Hp59' */ 0x48703539,
+    bmdModeHD1080p6000                                 = /* 'Hp60' */ 0x48703630, // N.B. This _really_ is 60.00 Hz.
+
+    /* HD 720 Modes */
+
+    bmdModeHD720p50                                    = /* 'hp50' */ 0x68703530,
+    bmdModeHD720p5994                                  = /* 'hp59' */ 0x68703539,
+    bmdModeHD720p60                                    = /* 'hp60' */ 0x68703630,
+
+    /* 2k Modes */
+
+    bmdMode2k2398                                      = /* '2k23' */ 0x326B3233,
+    bmdMode2k24                                        = /* '2k24' */ 0x326B3234,
+    bmdMode2k25                                        = /* '2k25' */ 0x326B3235
+} BMDDisplayMode;
+
+/* End Enum BMDDisplayMode */
+
+/* Enum BMDFieldDominance - Video field dominance */
+
+typedef [v1_enum] enum	_BMDFieldDominance {
+    bmdUnknownFieldDominance                           = 0,
+    bmdLowerFieldFirst                                 = /* 'lowr' */ 0x6C6F7772,
+    bmdUpperFieldFirst                                 = /* 'uppr' */ 0x75707072,
+    bmdProgressiveFrame                                = /* 'prog' */ 0x70726F67,
+    bmdProgressiveSegmentedFrame                       = /* 'psf ' */ 0x70736620
+} BMDFieldDominance;
+
+/* End Enum BMDFieldDominance */
+
+/* Enum BMDPixelFormat - Video pixel formats supported for output/input */
+
+typedef [v1_enum] enum	_BMDPixelFormat {
+    bmdFormat8BitYUV                                   = /* '2vuy' */ 0x32767579,
+    bmdFormat10BitYUV                                  = /* 'v210' */ 0x76323130,
+    bmdFormat8BitARGB                                  = 0x20,
+    bmdFormat8BitBGRA                                  = /* 'BGRA' */ 0x42475241,
+    bmdFormat10BitRGB                                  = /* 'r210' */ 0x72323130
+} BMDPixelFormat;
+
+/* End Enum BMDPixelFormat */
+
+/* Enum BMDVideoOutputFlags - Flags to control the output of ancillary data along with video. */
+
+typedef [v1_enum] enum	_BMDVideoOutputFlags {
+    bmdVideoOutputFlagDefault                          = 0,
+    bmdVideoOutputRP188                                = 1 << 0,
+    bmdVideoOutputVANC                                 = 1 << 1
+} BMDVideoOutputFlags;
+
+/* End Enum BMDVideoOutputFlags */
+
+/* Enum BMDFrameFlags - Frame flags */
+
+[v1_enum] enum	_BMDFrameFlags {
+    bmdFrameFlagDefault                                = 0,
+    bmdFrameFlagFlipVertical                           = 1 << 0,
+
+    /* Flags that are valid only for frames returned through IDeckLinkInput */
+
+    bmdFrameHasNoInputSource                           = 1 << 31
+};
+
+/* End Enum BMDFrameFlags */
+
+/* Enum BMDVideoInputFlags - Flags applicable to video input */
+
+[v1_enum] enum	_BMDVideoInputFlags {
+    bmdVideoInputFlagDefault                           = 0,
+    bmdVideoInputEnableFormatDetection                 = 1 << 0
+};
+
+/* End Enum BMDVideoInputFlags */
+
+/* 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
+};
+
+/* End Enum BMDVideoInputFormatChangedEvents */
+
+/* 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
+};
+
+/* End Enum BMDDetectedVideoInputFormatFlags */
+
+/* Enum BMDOutputFrameCompletionResult - Frame Completion Callback */
+
+typedef [v1_enum] enum	_BMDOutputFrameCompletionResult {
+    bmdOutputFrameCompleted,                          
+    bmdOutputFrameDisplayedLate,                      
+    bmdOutputFrameDropped,                            
+    bmdOutputFrameFlushed                             
+} BMDOutputFrameCompletionResult;
+
+/* End Enum BMDOutputFrameCompletionResult */
+
+/* Enum BMDAudioSampleRate - Audio sample rates supported for output/input */
+
+typedef [v1_enum] enum	_BMDAudioSampleRate {
+    bmdAudioSampleRate48kHz                            = 48000
+} BMDAudioSampleRate;
+
+/* End Enum BMDAudioSampleRate */
+
+/* Enum BMDAudioSampleType - Audio sample sizes supported for output/input */
+
+typedef [v1_enum] enum	_BMDAudioSampleType {
+    bmdAudioSampleType16bitInteger                     = 16,
+    bmdAudioSampleType32bitInteger                     = 32
+} BMDAudioSampleType;
+
+/* End Enum BMDAudioSampleType */
+
+/* Enum BMDAudioOutputStreamType - Audio output stream type */
+
+typedef [v1_enum] enum	_BMDAudioOutputStreamType {
+    bmdAudioOutputStreamContinuous,                   
+    bmdAudioOutputStreamContinuousDontResample,       
+    bmdAudioOutputStreamTimestamped                   
+} BMDAudioOutputStreamType;
+
+/* End Enum BMDAudioOutputStreamType */
+
+/* Enum BMDDisplayModeSupport - Output mode supported flags */
+
+typedef [v1_enum] enum	_BMDDisplayModeSupport {
+    bmdDisplayModeNotSupported                         = 0,
+    bmdDisplayModeSupported,                          
+    bmdDisplayModeSupportedWithConversion             
+} BMDDisplayModeSupport;
+
+/* End Enum BMDDisplayModeSupport */
+
+/* Enum BMDTimecodeFormat - Timecode formats for frame metadata */
+
+typedef [v1_enum] enum	_BMDTimecodeFormat {
+    bmdTimecodeRP188                                   = /* 'rp18' */ 0x72703138,
+    bmdTimecodeVITC                                    = /* 'vitc' */ 0x76697463,
+    bmdTimecodeSerial                                  = /* 'seri' */ 0x73657269
+} BMDTimecodeFormat;
+
+/* End Enum BMDTimecodeFormat */
+
+/* Enum BMDTimecodeFlags - Timecode flags */
+
+[v1_enum] enum	_BMDTimecodeFlags {
+    bmdTimecodeFlagDefault                             = 0,
+    bmdTimecodeIsDropFrame                             = 1 << 0
+};
+
+/* End Enum BMDTimecodeFlags */
+
+/* Enum BMDVideoConnection - Video connection types */
+
+typedef [v1_enum] enum	_BMDVideoConnection {
+    bmdVideoConnectionSDI                              = /* 'sdi ' */ 0x73646920,
+    bmdVideoConnectionHDMI                             = /* 'hdmi' */ 0x68646D69,
+    bmdVideoConnectionOpticalSDI                       = /* 'opti' */ 0x6F707469,
+    bmdVideoConnectionComponent                        = /* 'cpnt' */ 0x63706E74,
+    bmdVideoConnectionComposite                        = /* 'cmst' */ 0x636D7374,
+    bmdVideoConnectionSVideo                           = /* 'svid' */ 0x73766964
+} BMDVideoConnection;
+
+/* End Enum BMDVideoConnection */
+
+/* Enum BMDAnalogVideoFlags - Analog video display flags */
+
+[v1_enum] enum	_BMDAnalogVideoFlags {
+    bmdAnalogVideoFlagCompositeSetup75                 = 1 << 0,
+    bmdAnalogVideoFlagComponentBetacamLevels           = 1 << 1
+};
+
+/* End Enum BMDAnalogVideoFlags */
+
+/* Enum BMDAudioConnection - Audio connection types */
+
+typedef [v1_enum] enum	_BMDAudioConnection {
+    bmdAudioConnectionEmbedded                         = /* 'embd' */ 0x656D6264,
+    bmdAudioConnectionAESEBU                           = /* 'aes ' */ 0x61657320,
+    bmdAudioConnectionAnalog                           = /* 'anlg' */ 0x616E6C67
+} BMDAudioConnection;
+
+/* End Enum BMDAudioConnection */
+
+/* Enum BMDVideoOutputConversionMode - Video/audio conversion mode */
+
+typedef [v1_enum] enum	_BMDVideoOutputConversionMode {
+    bmdNoVideoOutputConversion                         = /* 'none' */ 0x6E6F6E65,
+    bmdVideoOutputLetterboxDownonversion               = /* 'ltbx' */ 0x6C746278,
+    bmdVideoOutputAnamorphicDownonversion              = /* 'amph' */ 0x616D7068,
+    bmdVideoOutputHD720toHD1080Conversion              = /* '720c' */ 0x37323063,
+    bmdVideoOutputHardwareLetterboxDownconversion      = /* 'HWlb' */ 0x48576C62,
+    bmdVideoOutputHardwareAnamorphicDownconversion     = /* 'HWam' */ 0x4857616D,
+    bmdVideoOutputHardwareCenterCutDownconversion      = /* 'HWcc' */ 0x48576363
+} BMDVideoOutputConversionMode;
+
+/* End Enum 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;
+
+/* End Enum BMDVideoInputConversionMode */
+
+/* Enum BMDDeckLinkAttributeID - DeckLink Atribute ID */
+
+typedef [v1_enum] enum	_BMDDeckLinkAttributeID {
+
+    /* Flags */
+
+    BMDDeckLinkSupportsInternalKeying                  = /* 'keyi' */ 0x6B657969,
+    BMDDeckLinkSupportsExternalKeying                  = /* 'keye' */ 0x6B657965,
+    BMDDeckLinkSupportsHDKeying                        = /* 'keyh' */ 0x6B657968,
+    BMDDeckLinkSupportsInputFormatDetection            = /* 'infd' */ 0x696E6664,
+    BMDDeckLinkHasSerialPort                           = /* 'hspt' */ 0x68737074,
+
+    /* Integers */
+
+    BMDDeckLinkMaximumAudioChannels                    = /* 'mach' */ 0x6D616368,
+
+    /* Strings */
+
+    BMDDeckLinkSerialPortDeviceName                    = /* 'slpn' */ 0x736C706E
+} BMDDeckLinkAttributeID;
+
+/* End Enum BMDDeckLinkAttributeID */
+
+/* Enum BMDDeckLinkAPIInformationID - DeckLinkAPI information ID */
+
+typedef [v1_enum] enum	_BMDDeckLinkAPIInformationID {
+    BMDDeckLinkAPIVersion                              = /* 'vers' */ 0x76657273
+} BMDDeckLinkAPIInformationID;
+
+/* End Enum BMDDeckLinkAPIInformationID */
+
+/* Forward Declarations */
+
+interface IDeckLinkVideoOutputCallback;
+interface IDeckLinkInputCallback;
+interface IDeckLinkMemoryAllocator;
+interface IDeckLinkAudioOutputCallback;
+interface IDeckLinkIterator;
+interface IDeckLinkAPIInformation;
+interface IDeckLinkDisplayModeIterator;
+interface IDeckLinkDisplayMode;
+interface IDeckLink;
+interface IDeckLinkOutput;
+interface IDeckLinkInput;
+interface IDeckLinkTimecode;
+interface IDeckLinkVideoFrame;
+interface IDeckLinkMutableVideoFrame;
+interface IDeckLinkVideoInputFrame;
+interface IDeckLinkVideoFrameAncillary;
+interface IDeckLinkAudioInputPacket;
+interface IDeckLinkScreenPreviewCallback;
+interface IDeckLinkGLScreenPreviewHelper;
+interface IDeckLinkConfiguration;
+interface IDeckLinkAttributes;
+interface IDeckLinkKeyer;
+
+/* End Forward Declarations */
+
+/* Interface IDeckLinkVideoOutputCallback - Frame completion callback. */
+
+[
+    object,
+    uuid(E763A626-4A3C-49D1-BF13-E7AD3692AE52),
+    helpstring("Frame completion callback.")
+] interface IDeckLinkVideoOutputCallback : IUnknown
+{
+    HRESULT ScheduledFrameCompleted([in] IDeckLinkVideoFrame *completedFrame, [in] BMDOutputFrameCompletionResult result);
+    HRESULT ScheduledPlaybackHasStopped(void);
+};
+
+/* End Interface IDeckLinkVideoOutputCallback */
+
+/* Interface IDeckLinkInputCallback - Frame arrival callback. */
+
+[
+    object,
+    uuid(31D28EE7-88B6-4CB1-897A-CDBF79A26414),
+    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);
+};
+
+/* End Interface IDeckLinkInputCallback */
+
+/* Interface IDeckLinkMemoryAllocator - Memory allocator for video frames. */
+
+[
+    object,
+    uuid(B36EB6E7-9D29-4AA8-92EF-843B87A289E8),
+    local, 
+    helpstring("Memory allocator for video frames.")
+] interface IDeckLinkMemoryAllocator : IUnknown
+{
+    HRESULT AllocateBuffer(unsigned long bufferSize, [out] void **allocatedBuffer);
+    HRESULT ReleaseBuffer([in] void *buffer);
+
+    HRESULT Commit(void);
+    HRESULT Decommit(void);
+};
+
+/* End Interface IDeckLinkMemoryAllocator */
+
+/* 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(BOOL preroll);
+};
+
+/* End Interface IDeckLinkAudioOutputCallback */
+
+/* Interface IDeckLinkIterator - enumerates installed DeckLink hardware */
+
+[
+    object,
+    uuid(74E936FC-CC28-4A67-81A0-1E94E52D4E69),
+    helpstring("enumerates installed DeckLink hardware")
+] interface IDeckLinkIterator : IUnknown
+{
+    HRESULT Next([out] IDeckLink **deckLinkInstance);
+};
+
+/* End Interface IDeckLinkIterator */
+
+/* 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);
+};
+
+/* End Interface IDeckLinkAPIInformation */
+
+/* Interface IDeckLinkDisplayModeIterator - enumerates over supported input/output display modes. */
+
+[
+    object,
+    uuid(455D741F-1779-4800-86F5-0B5D13D79751),
+    helpstring("enumerates over supported input/output display modes.")
+] interface IDeckLinkDisplayModeIterator : IUnknown
+{
+    HRESULT Next([out] IDeckLinkDisplayMode **deckLinkDisplayMode);
+};
+
+/* End Interface IDeckLinkDisplayModeIterator */
+
+/* Interface IDeckLinkDisplayMode - represents a display mode */
+
+[
+    object,
+    uuid(87451E84-2B7E-439E-A629-4393EA4A8550),
+    helpstring("represents a display mode")
+] interface IDeckLinkDisplayMode : IUnknown
+{
+    HRESULT GetName([out] BSTR *name);
+    BMDDisplayMode GetDisplayMode(void);
+    long GetWidth(void);
+    long GetHeight(void);
+    HRESULT GetFrameRate([out] BMDTimeValue *frameDuration, [out] BMDTimeScale *timeScale);
+    BMDFieldDominance GetFieldDominance(void);
+};
+
+/* End Interface IDeckLinkDisplayMode */
+
+/* Interface IDeckLink - represents a DeckLink device */
+
+[
+    object,
+    uuid(62BFF75D-6569-4E55-8D4D-66AA03829ABC),
+    helpstring("represents a DeckLink device")
+] interface IDeckLink : IUnknown
+{
+    HRESULT GetModelName([out] BSTR *modelName);
+};
+
+/* End Interface IDeckLink */
+
+/* Interface IDeckLinkOutput - Created by QueryInterface from IDeckLink. */
+
+[
+    object,
+    uuid(29228142-EB8C-4141-A621-F74026450955),
+    local, 
+    helpstring("Created by QueryInterface from IDeckLink.")
+] interface IDeckLinkOutput : IUnknown
+{
+    HRESULT DoesSupportVideoMode(BMDDisplayMode displayMode, BMDPixelFormat pixelFormat, [out] BMDDisplayModeSupport *result);
+    HRESULT GetDisplayModeIterator([out] IDeckLinkDisplayModeIterator **iterator);
+
+    HRESULT SetScreenPreviewCallback([in] IDeckLinkScreenPreviewCallback *previewCallback);
+
+    /* Video Output */
+
+    HRESULT EnableVideoOutput(BMDDisplayMode displayMode, BMDVideoOutputFlags flags);
+    HRESULT DisableVideoOutput(void);
+
+    HRESULT SetVideoOutputFrameMemoryAllocator([in] IDeckLinkMemoryAllocator *theAllocator);
+    HRESULT CreateVideoFrame(long width, long height, long rowBytes, BMDPixelFormat pixelFormat, BMDFrameFlags flags, [out] IDeckLinkMutableVideoFrame **outFrame);
+    HRESULT CreateAncillaryData(BMDDisplayMode displayMode, BMDPixelFormat pixelFormat, [out] IDeckLinkVideoFrameAncillary **outBuffer);
+
+    HRESULT DisplayVideoFrameSync([in] IDeckLinkVideoFrame *theFrame);
+    HRESULT ScheduleVideoFrame([in] IDeckLinkVideoFrame *theFrame, BMDTimeValue displayTime, BMDTimeValue displayDuration, BMDTimeScale timeScale);
+    HRESULT SetScheduledFrameCompletionCallback([in] IDeckLinkVideoOutputCallback *theCallback);
+    HRESULT GetBufferedVideoFrameCount([out] unsigned long *bufferedFrameCount);
+
+    /* Audio Output */
+
+    HRESULT EnableAudioOutput(BMDAudioSampleRate sampleRate, BMDAudioSampleType sampleType, unsigned long channelCount, BMDAudioOutputStreamType streamType);
+    HRESULT DisableAudioOutput(void);
+
+    HRESULT WriteAudioSamplesSync([in] void *buffer, unsigned long sampleFrameCount, [out] unsigned long *sampleFramesWritten);
+
+    HRESULT BeginAudioPreroll(void);
+    HRESULT EndAudioPreroll(void);
+    HRESULT ScheduleAudioSamples([in] void *buffer, unsigned long sampleFrameCount, BMDTimeValue streamTime, BMDTimeScale timeScale, [out] unsigned long *sampleFramesWritten);
+
+    HRESULT GetBufferedAudioSampleFrameCount([out] unsigned long *bufferedSampleFrameCount);
+    HRESULT FlushBufferedAudioSamples(void);
+
+    HRESULT SetAudioCallback([in] IDeckLinkAudioOutputCallback *theCallback);
+
+    /* Output Control */
+
+    HRESULT StartScheduledPlayback(BMDTimeValue playbackStartTime, BMDTimeScale timeScale, double playbackSpeed);
+    HRESULT StopScheduledPlayback(BMDTimeValue stopPlaybackAtTime, [out] BMDTimeValue *actualStopTime, BMDTimeScale timeScale);
+    HRESULT IsScheduledPlaybackRunning([out] BOOL *active);
+    HRESULT GetScheduledStreamTime(BMDTimeScale desiredTimeScale, [out] BMDTimeValue *streamTime, [out] double *playbackSpeed);
+
+    /* Hardware Timing */
+
+    HRESULT GetHardwareReferenceClock(BMDTimeScale desiredTimeScale, [out] BMDTimeValue *hardwareTime, [out] BMDTimeValue *timeInFrame, [out] BMDTimeValue *ticksPerFrame);
+};
+
+/* End Interface IDeckLinkOutput */
+
+/* Interface IDeckLinkInput - Created by QueryInterface from IDeckLink. */
+
+[
+    object,
+    uuid(300C135A-9F43-48E2-9906-6D7911D93CF1),
+    helpstring("Created by QueryInterface from IDeckLink.")
+] interface IDeckLinkInput : IUnknown
+{
+    HRESULT DoesSupportVideoMode(BMDDisplayMode displayMode, BMDPixelFormat pixelFormat, [out] BMDDisplayModeSupport *result);
+    HRESULT GetDisplayModeIterator([out] IDeckLinkDisplayModeIterator **iterator);
+
+    HRESULT SetScreenPreviewCallback([in] IDeckLinkScreenPreviewCallback *previewCallback);
+
+    /* Video Input */
+
+    HRESULT EnableVideoInput(BMDDisplayMode displayMode, BMDPixelFormat pixelFormat, BMDVideoInputFlags flags);
+    HRESULT DisableVideoInput(void);
+    HRESULT GetAvailableVideoFrameCount([out] unsigned long *availableFrameCount);
+
+    /* Audio Input */
+
+    HRESULT EnableAudioInput(BMDAudioSampleRate sampleRate, BMDAudioSampleType sampleType, unsigned long channelCount);
+    HRESULT DisableAudioInput(void);
+    HRESULT GetAvailableAudioSampleFrameCount([out] unsigned long *availableSampleFrameCount);
+
+    /* Input Control */
+
+    HRESULT StartStreams(void);
+    HRESULT StopStreams(void);
+    HRESULT PauseStreams(void);
+    HRESULT FlushStreams(void);
+    HRESULT SetCallback([in] IDeckLinkInputCallback *theCallback);
+
+    /* Hardware Timing */
+
+    HRESULT GetHardwareReferenceClock(BMDTimeScale desiredTimeScale, [out] BMDTimeValue *hardwareTime, [out] BMDTimeValue *timeInFrame, [out] BMDTimeValue *ticksPerFrame);
+};
+
+/* End Interface IDeckLinkInput */
+
+/* Interface IDeckLinkTimecode - Used for video frame timecode representation. */
+
+[
+    object,
+    uuid(EFB9BCA6-A521-44F7-BD69-2332F24D9EE6),
+    helpstring("Used for video frame timecode representation.")
+] interface IDeckLinkTimecode : IUnknown
+{
+    BMDTimecodeBCD GetBCD(void);
+    HRESULT GetComponents([out] unsigned char *hours, [out] unsigned char *minutes, [out] unsigned char *seconds, [out] unsigned char *frames);
+    HRESULT GetString([out] BSTR *timecode);
+    BMDTimecodeFlags GetFlags(void);
+};
+
+/* End Interface IDeckLinkTimecode */
+
+/* Interface IDeckLinkVideoFrame - Interface to encapsulate a video frame; can be caller-implemented. */
+
+[
+    object,
+    uuid(A8D8238E-6B18-4196-99E1-5AF717B83D32),
+    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 GetBytes([out] void **buffer);
+
+    HRESULT GetTimecode(BMDTimecodeFormat format, [out] IDeckLinkTimecode **timecode);
+    HRESULT GetAncillaryData([out] IDeckLinkVideoFrameAncillary **ancillary);
+};
+
+/* End Interface IDeckLinkVideoFrame */
+
+/* Interface IDeckLinkMutableVideoFrame - Created by IDeckLinkOutput::CreateVideoFrame. */
+
+[
+    object,
+    uuid(46FCEE00-B4E6-43D0-91C0-023A7FCEB34F),
+    local, 
+    helpstring("Created by IDeckLinkOutput::CreateVideoFrame.")
+] interface IDeckLinkMutableVideoFrame : IDeckLinkVideoFrame
+{
+    HRESULT SetFlags(BMDFrameFlags newFlags);
+
+    HRESULT SetTimecode(BMDTimecodeFormat format, [in] IDeckLinkTimecode *timecode);
+    HRESULT SetTimecodeFromComponents(BMDTimecodeFormat format, unsigned char hours, unsigned char minutes, unsigned char seconds, unsigned char frames, BMDTimecodeFlags flags);
+    HRESULT SetAncillaryData([in] IDeckLinkVideoFrameAncillary *ancillary);
+};
+
+/* End Interface IDeckLinkMutableVideoFrame */
+
+/* Interface IDeckLinkVideoInputFrame - Provided by the IDeckLinkVideoInput frame arrival callback. */
+
+[
+    object,
+    uuid(9A74FA41-AE9F-47AC-8CF4-01F42DD59965),
+    local, 
+    helpstring("Provided by the IDeckLinkVideoInput frame arrival callback.")
+] interface IDeckLinkVideoInputFrame : IDeckLinkVideoFrame
+{
+    HRESULT GetStreamTime([out] BMDTimeValue *frameTime, [out] BMDTimeValue *frameDuration, BMDTimeScale timeScale);
+    HRESULT GetHardwareReferenceTimestamp(BMDTimeScale timeScale, [out] BMDTimeValue *frameTime, [out] BMDTimeValue *frameDuration);
+};
+
+/* End Interface IDeckLinkVideoInputFrame */
+
+/* Interface IDeckLinkVideoFrameAncillary - Obtained through QueryInterface() on an IDeckLinkVideoFrame object. */
+
+[
+    object,
+    uuid(732E723C-D1A4-4E29-9E8E-4A88797A0004),
+    local, 
+    helpstring("Obtained through QueryInterface() on an IDeckLinkVideoFrame object.")
+] interface IDeckLinkVideoFrameAncillary : IUnknown
+{
+
+    HRESULT GetBufferForVerticalBlankingLine(unsigned long lineNumber, [out] void **buffer);
+    BMDPixelFormat GetPixelFormat(void);
+    BMDDisplayMode GetDisplayMode(void);
+};
+
+/* End Interface IDeckLinkVideoFrameAncillary */
+
+/* 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, BMDTimeScale timeScale);
+};
+
+/* End Interface IDeckLinkAudioInputPacket */
+
+/* Interface IDeckLinkScreenPreviewCallback - Screen preview callback */
+
+[
+    object,
+    uuid(373F499D-4B4D-4518-AD22-6354E5A5825E),
+    local, 
+    helpstring("Screen preview callback")
+] interface IDeckLinkScreenPreviewCallback : IUnknown
+{
+    HRESULT DrawFrame([in] IDeckLinkVideoFrame *theFrame);
+};
+
+/* End Interface IDeckLinkScreenPreviewCallback */
+
+/* Interface IDeckLinkGLScreenPreviewHelper - Created with CoCreateInstance(). */
+
+[
+    object,
+    uuid(BA575CD9-A15E-497B-B2C2-F9AFE7BE4EBA),
+    local, 
+    helpstring("Created with CoCreateInstance().")
+] interface IDeckLinkGLScreenPreviewHelper : IUnknown
+{
+
+    /* Methods must be called with OpenGL context set */
+
+    HRESULT InitializeGL(void);
+    HRESULT PaintGL(void);
+    HRESULT SetFrame([in] IDeckLinkVideoFrame *theFrame);
+};
+
+/* End Interface IDeckLinkGLScreenPreviewHelper */
+
+/* Interface IDeckLinkConfiguration - Created by QueryInterface from IDeckLink. */
+
+[
+    object,
+    uuid(B8EAD569-B764-47F0-A73F-AE40DF6CBF10),
+    helpstring("Created by QueryInterface from IDeckLink.")
+] interface IDeckLinkConfiguration : IUnknown
+{
+    HRESULT GetConfigurationValidator([out] IDeckLinkConfiguration **configObject);
+    HRESULT WriteConfigurationToPreferences(void);
+
+    /* Video Output Configuration */
+
+    HRESULT SetVideoOutputFormat(BMDVideoConnection videoOutputConnection);
+    HRESULT IsVideoOutputActive(BMDVideoConnection videoOutputConnection, [out] BOOL *active);
+
+    HRESULT SetAnalogVideoOutputFlags(BMDAnalogVideoFlags analogVideoFlags);
+    HRESULT GetAnalogVideoOutputFlags([out] BMDAnalogVideoFlags *analogVideoFlags);
+
+    HRESULT EnableFieldFlickerRemovalWhenPaused(BOOL enable);
+    HRESULT IsEnabledFieldFlickerRemovalWhenPaused([out] BOOL *enabled);
+
+    HRESULT Set444And3GBpsVideoOutput(BOOL enable444VideoOutput, BOOL enable3GbsOutput);
+    HRESULT Get444And3GBpsVideoOutput([out] BOOL *is444VideoOutputEnabled, [out] BOOL *threeGbsOutputEnabled);
+
+    HRESULT SetVideoOutputConversionMode(BMDVideoOutputConversionMode conversionMode);
+    HRESULT GetVideoOutputConversionMode([out] BMDVideoOutputConversionMode *conversionMode);
+
+    HRESULT Set_HD1080p24_to_HD1080i5994_Conversion(BOOL enable);
+    HRESULT Get_HD1080p24_to_HD1080i5994_Conversion([out] BOOL *enabled);
+
+    /* Video Input Configuration */
+
+    HRESULT SetVideoInputFormat(BMDVideoConnection videoInputFormat);
+    HRESULT GetVideoInputFormat([out] BMDVideoConnection *videoInputFormat);
+
+    HRESULT SetAnalogVideoInputFlags(BMDAnalogVideoFlags analogVideoFlags);
+    HRESULT GetAnalogVideoInputFlags([out] BMDAnalogVideoFlags *analogVideoFlags);
+
+    HRESULT SetVideoInputConversionMode(BMDVideoInputConversionMode conversionMode);
+    HRESULT GetVideoInputConversionMode([out] BMDVideoInputConversionMode *conversionMode);
+
+    HRESULT SetBlackVideoOutputDuringCapture(BOOL blackOutInCapture);
+    HRESULT GetBlackVideoOutputDuringCapture([out] BOOL *blackOutInCapture);
+
+    HRESULT Set32PulldownSequenceInitialTimecodeFrame(unsigned long aFrameTimecode);
+    HRESULT Get32PulldownSequenceInitialTimecodeFrame([out] unsigned long *aFrameTimecode);
+
+    HRESULT SetVancSourceLineMapping(unsigned long activeLine1VANCsource, unsigned long activeLine2VANCsource, unsigned long activeLine3VANCsource);
+    HRESULT GetVancSourceLineMapping([out] unsigned long *activeLine1VANCsource, [out] unsigned long *activeLine2VANCsource, [out] unsigned long *activeLine3VANCsource);
+
+    /* Audio Input Configuration */
+
+    HRESULT SetAudioInputFormat(BMDAudioConnection audioInputFormat);
+    HRESULT GetAudioInputFormat([out] BMDAudioConnection *audioInputFormat);
+};
+
+/* End Interface IDeckLinkConfiguration */
+
+/* Interface IDeckLinkAttributes - DeckLink Attribute interface */
+
+[
+    object,
+    uuid(ABC11843-D966-44CB-96E2-A1CB5D3135C4),
+    local, 
+    helpstring("DeckLink Attribute interface")
+] interface IDeckLinkAttributes : 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);
+};
+
+/* End Interface IDeckLinkAttributes */
+
+/* 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 long numberOfFrames);
+    HRESULT RampDown([in] unsigned long numberOfFrames);
+    HRESULT Disable(void);
+};
+
+/* End Interface IDeckLinkKeyer */
+
+/* Coclasses */
+
+importlib("stdole2.tlb");
+
+[
+    uuid(D9EDA3B3-2887-41FA-B724-017CF1EB1D37),
+    helpstring("CDeckLinkIterator Class")
+] coclass CDeckLinkIterator
+{
+    [default] interface IDeckLinkIterator;
+};
+
+[
+    uuid(D398CEE7-4434-4CA3-9BA6-5AE34556B905),
+    helpstring("CDeckLinkGLScreenPreviewHelper Class")
+] coclass CDeckLinkGLScreenPreviewHelper
+{
+    [default] interface IDeckLinkGLScreenPreviewHelper;
+};
+
+/* End Coclasses */
+
+// import deprecated interfaces
+#include "DeckLinkAPI_v7_1.idl"
+#include "DeckLinkAPI_v7_3.idl"
+};

Added: vic/branches/mpeg4/video/DeckLinkAPI_v7_1.idl
==============================================================================
--- (empty file)
+++ vic/branches/mpeg4/video/DeckLinkAPI_v7_1.idl	Sat Jan 30 10:06:31 2010
@@ -0,0 +1,160 @@
+/* -LICENSE-START-
+** Copyright (c) 2009 Blackmagic Design
+**
+** Permission is hereby granted, free of charge, to any person or organization
+** obtaining a copy of the software and accompanying documentation covered by
+** this license (the "Software") to use, reproduce, display, distribute,
+** 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, all subject to the following:
+** 
+** 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.
+** 
+** 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.
+** -LICENSE-END-
+*/
+/* DeckLinkAPI_v7_1.idl */
+
+	interface IDeckLinkDisplayModeIterator_v7_1;
+	interface IDeckLinkDisplayMode_v7_1;
+	interface IDeckLinkVideoFrame_v7_1;
+	interface IDeckLinkVideoInputFrame_v7_1;
+	interface IDeckLinkAudioInputPacket_v7_1;
+	
+	[object, uuid(B28131B6-59AC-4857-B5AC-CD75D5883E2F),
+	 helpstring("IDeckLinkDisplayModeIterator_v7_1 enumerates over supported input/output display modes.")]
+	interface IDeckLinkDisplayModeIterator_v7_1 : IUnknown
+	{
+		HRESULT		Next ([out] IDeckLinkDisplayMode_v7_1** deckLinkDisplayMode);
+	};
+
+
+	[object, uuid(AF0CD6D5-8376-435E-8433-54F9DD530AC3),
+	 helpstring("IDeckLinkDisplayMode_v7_1 represents a display mode")]
+	interface IDeckLinkDisplayMode_v7_1 : IUnknown
+	{
+		HRESULT				GetName ([out] BSTR* name);
+		BMDDisplayMode		GetDisplayMode ();
+		long				GetWidth ();
+		long				GetHeight ();
+		HRESULT				GetFrameRate ([out] BMDTimeValue *frameDuration, [out] BMDTimeScale *timeScale);
+	};
+	
+	[object, uuid(EBD01AFA-E4B0-49C6-A01D-EDB9D1B55FD9),
+     helpstring("IDeckLinkVideoOutputCallback. Frame completion callback.")]
+    interface IDeckLinkVideoOutputCallback_v7_1 : IUnknown
+    {
+        HRESULT		ScheduledFrameCompleted ([in] IDeckLinkVideoFrame_v7_1* completedFrame, [in] BMDOutputFrameCompletionResult result);
+    };
+	
+    [object, uuid(7F94F328-5ED4-4E9F-9729-76A86BDC99CC),
+     helpstring("IDeckLinkInputCallback_v7_1. Frame arrival callback.")]
+    interface IDeckLinkInputCallback_v7_1 : IUnknown
+    {
+        HRESULT		VideoInputFrameArrived ([in] IDeckLinkVideoInputFrame_v7_1* videoFrame, [in] IDeckLinkAudioInputPacket_v7_1* audioPacket);
+    };
+	
+
+    [object, uuid(AE5B3E9B-4E1E-4535-B6E8-480FF52F6CE5), local,
+     helpstring("IDeckLinkOutput_v7_1.  Created by QueryInterface from IDeckLink.")]
+    interface IDeckLinkOutput_v7_1 : IUnknown
+    {
+		HRESULT		DoesSupportVideoMode (BMDDisplayMode displayMode, BMDPixelFormat pixelFormat, [out] BMDDisplayModeSupport *result);
+		HRESULT		GetDisplayModeIterator ([out] IDeckLinkDisplayModeIterator_v7_1 **iterator);
+		
+		// Video output
+        HRESULT		EnableVideoOutput (BMDDisplayMode displayMode);
+        HRESULT		DisableVideoOutput ();
+		
+		HRESULT		SetVideoOutputFrameMemoryAllocator ([in] IDeckLinkMemoryAllocator* theAllocator);
+        HRESULT		CreateVideoFrame (long width, long height, long rowBytes, BMDPixelFormat pixelFormat, BMDFrameFlags flags, IDeckLinkVideoFrame_v7_1** outFrame);
+        HRESULT		CreateVideoFrameFromBuffer (void* buffer, long width, long height, long rowBytes, BMDPixelFormat pixelFormat, BMDFrameFlags flags, IDeckLinkVideoFrame_v7_1** outFrame);
+
+        HRESULT		DisplayVideoFrameSync (IDeckLinkVideoFrame_v7_1* theFrame);
+        HRESULT		ScheduleVideoFrame (IDeckLinkVideoFrame_v7_1* theFrame, BMDTimeValue displayTime, BMDTimeValue displayDuration, BMDTimeScale timeScale);
+        HRESULT		SetScheduledFrameCompletionCallback ([in] IDeckLinkVideoOutputCallback_v7_1* theCallback);
+		
+		// Audio output
+		HRESULT		EnableAudioOutput (BMDAudioSampleRate sampleRate, BMDAudioSampleType sampleType, unsigned long channelCount);
+		HRESULT		DisableAudioOutput ();
+		
+		HRESULT		WriteAudioSamplesSync (void* buffer, unsigned long sampleFrameCount, [out] unsigned long *sampleFramesWritten);
+		
+		HRESULT		BeginAudioPreroll ();
+		HRESULT		EndAudioPreroll ();
+		HRESULT		ScheduleAudioSamples (void* buffer, unsigned long sampleFrameCount, BMDTimeValue streamTime, BMDTimeScale timeScale, [out] unsigned long *sampleFramesWritten);
+		
+		HRESULT		GetBufferedAudioSampleFrameCount ( [out] unsigned long *bufferedSampleCount);
+		HRESULT		FlushBufferedAudioSamples ();
+		
+		HRESULT		SetAudioCallback ( [in] IDeckLinkAudioOutputCallback* theCallback);
+		
+		// Output control
+        HRESULT		StartScheduledPlayback (BMDTimeValue playbackStartTime, BMDTimeScale timeScale, double playbackSpeed);
+        HRESULT		StopScheduledPlayback (BMDTimeValue stopPlaybackAtTime, BMDTimeValue *actualStopTime, BMDTimeScale timeScale);
+        HRESULT		GetHardwareReferenceClock (BMDTimeScale desiredTimeScale, BMDTimeValue *elapsedTimeSinceSchedulerBegan);
+    };
+
+    [object, uuid(2B54EDEF-5B32-429F-BA11-BB990596EACD),
+     helpstring("IDeckLinkInput_v7_1.  Created by QueryInterface from IDeckLink.")]
+    interface IDeckLinkInput_v7_1 : IUnknown
+    {
+		HRESULT		DoesSupportVideoMode (BMDDisplayMode displayMode, BMDPixelFormat pixelFormat, [out] BMDDisplayModeSupport *result);
+		HRESULT		GetDisplayModeIterator ([out] IDeckLinkDisplayModeIterator_v7_1 **iterator);
+		
+		// Video input
+		HRESULT		EnableVideoInput (BMDDisplayMode displayMode, BMDPixelFormat pixelFormat, BMDVideoInputFlags flags);
+		HRESULT		DisableVideoInput ();
+		
+		// Audio input
+		HRESULT		EnableAudioInput (BMDAudioSampleRate sampleRate, BMDAudioSampleType sampleType, unsigned long channelCount);
+		HRESULT		DisableAudioInput ();
+		HRESULT		ReadAudioSamples (void* buffer, unsigned long sampleFrameCount, [out] unsigned long *sampleFramesRead, [out] BMDTimeValue *audioPacketTime, BMDTimeScale timeScale);
+		HRESULT		GetBufferedAudioSampleFrameCount ( [out] unsigned long *bufferedSampleCount);
+		
+		// Input control
+		HRESULT		StartStreams ();
+		HRESULT		StopStreams ();
+		HRESULT		PauseStreams ();
+		HRESULT		SetCallback ([in] IDeckLinkInputCallback_v7_1* theCallback);
+    };
+	
+	[object, uuid(333F3A10-8C2D-43CF-B79D-46560FEEA1CE), local,
+     helpstring("IDeckLinkVideoFrame_v7_1.  Created by IDeckLinkVideoOutput::CreateVideoFrame.")]
+    interface IDeckLinkVideoFrame_v7_1 : IUnknown
+    {
+        long				GetWidth ();
+        long				GetHeight ();
+        long				GetRowBytes ();
+        BMDPixelFormat		GetPixelFormat ();
+        BMDFrameFlags		GetFlags ();
+        HRESULT				GetBytes (void* *buffer);
+    };
+	
+	[object, uuid(C8B41D95-8848-40EE-9B37-6E3417FB114B), local,
+     helpstring("IDeckLinkVideoInputFrame_v7_1.  Provided by the IDeckLinkVideoInput frame arrival callback.")]
+    interface IDeckLinkVideoInputFrame_v7_1 : IDeckLinkVideoFrame_v7_1
+    {
+        HRESULT				GetFrameTime (BMDTimeValue *frameTime, BMDTimeValue *frameDuration, BMDTimeScale timeScale);
+    };
+	
+	[object, uuid(C86DE4F6-A29F-42E3-AB3A-1363E29F0788), local,
+     helpstring("IDeckLinkAudioInputPacket_v7_1.  Provided by the IDeckLinkInput callback.")]
+    interface IDeckLinkAudioInputPacket_v7_1 : IUnknown
+    {
+		long				GetSampleCount ();
+		HRESULT				GetBytes (void* *buffer);
+		HRESULT				GetAudioPacketTime (BMDTimeValue *packetTime, BMDTimeScale timeScale);
+    };
+	

Added: vic/branches/mpeg4/video/DeckLinkAPI_v7_3.idl
==============================================================================
--- (empty file)
+++ vic/branches/mpeg4/video/DeckLinkAPI_v7_3.idl	Sat Jan 30 10:06:31 2010
@@ -0,0 +1,157 @@
+/* -LICENSE-START-
+** Copyright (c) 2009 Blackmagic Design
+**
+** Permission is hereby granted, free of charge, to any person or organization
+** obtaining a copy of the software and accompanying documentation covered by
+** this license (the "Software") to use, reproduce, display, distribute,
+** 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, all subject to the following:
+** 
+** 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.
+** 
+** 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.
+** -LICENSE-END-
+*/
+
+/* Forward Declarations */
+
+interface IDeckLinkInputCallback_v7_3;
+interface IDeckLinkOutput_v7_3;
+interface IDeckLinkInput_v7_3;
+interface IDeckLinkVideoInputFrame_v7_3;
+
+/* End Forward Declarations */
+
+
+/* Interface IDeckLinkInputCallback - Frame arrival callback. */
+
+[
+    object,
+    uuid(FD6F311D-4D00-444B-9ED4-1F25B5730AD0),
+    helpstring("Frame arrival callback.")
+] interface IDeckLinkInputCallback_v7_3 : IUnknown
+{
+    HRESULT VideoInputFormatChanged([in] BMDVideoInputFormatChangedEvents notificationEvents, [in] IDeckLinkDisplayMode *newDisplayMode, [in] BMDDetectedVideoInputFormatFlags detectedSignalFlags);
+    HRESULT VideoInputFrameArrived([in] IDeckLinkVideoInputFrame_v7_3 *videoFrame, [in] IDeckLinkAudioInputPacket *audioPacket);
+};
+
+/* End Interface IDeckLinkInputCallback */
+
+
+/* Interface IDeckLinkOutput - Created by QueryInterface from IDeckLink. */
+
+[
+    object,
+    uuid(271C65E3-C323-4344-A30F-D908BCB20AA3),
+    local, 
+    helpstring("Created by QueryInterface from IDeckLink.")
+] interface IDeckLinkOutput_v7_3 : IUnknown
+{
+    HRESULT DoesSupportVideoMode(BMDDisplayMode displayMode, BMDPixelFormat pixelFormat, [out] BMDDisplayModeSupport *result);
+    HRESULT GetDisplayModeIterator([out] IDeckLinkDisplayModeIterator **iterator);
+
+    HRESULT SetScreenPreviewCallback([in] IDeckLinkScreenPreviewCallback *previewCallback);
+
+    /* Video Output */
+
+    HRESULT EnableVideoOutput(BMDDisplayMode displayMode, BMDVideoOutputFlags flags);
+    HRESULT DisableVideoOutput(void);
+
+    HRESULT SetVideoOutputFrameMemoryAllocator([in] IDeckLinkMemoryAllocator *theAllocator);
+    HRESULT CreateVideoFrame(long width, long height, long rowBytes, BMDPixelFormat pixelFormat, BMDFrameFlags flags, [out] IDeckLinkMutableVideoFrame **outFrame);
+    HRESULT CreateAncillaryData(BMDDisplayMode displayMode, BMDPixelFormat pixelFormat, [out] IDeckLinkVideoFrameAncillary **outBuffer);
+
+    HRESULT DisplayVideoFrameSync([in] IDeckLinkVideoFrame *theFrame);
+    HRESULT ScheduleVideoFrame([in] IDeckLinkVideoFrame *theFrame, BMDTimeValue displayTime, BMDTimeValue displayDuration, BMDTimeScale timeScale);
+    HRESULT SetScheduledFrameCompletionCallback([in] IDeckLinkVideoOutputCallback *theCallback);
+    HRESULT GetBufferedVideoFrameCount([out] unsigned long *bufferedFrameCount);
+
+    /* Audio Output */
+
+    HRESULT EnableAudioOutput(BMDAudioSampleRate sampleRate, BMDAudioSampleType sampleType, unsigned long channelCount, BMDAudioOutputStreamType streamType);
+    HRESULT DisableAudioOutput(void);
+
+    HRESULT WriteAudioSamplesSync([in] void *buffer, unsigned long sampleFrameCount, [out] unsigned long *sampleFramesWritten);
+
+    HRESULT BeginAudioPreroll(void);
+    HRESULT EndAudioPreroll(void);
+    HRESULT ScheduleAudioSamples([in] void *buffer, unsigned long sampleFrameCount, BMDTimeValue streamTime, BMDTimeScale timeScale, [out] unsigned long *sampleFramesWritten);
+
+    HRESULT GetBufferedAudioSampleFrameCount([out] unsigned long *bufferedSampleFrameCount);
+    HRESULT FlushBufferedAudioSamples(void);
+
+    HRESULT SetAudioCallback([in] IDeckLinkAudioOutputCallback *theCallback);
+
+    /* Output Control */
+
+    HRESULT StartScheduledPlayback(BMDTimeValue playbackStartTime, BMDTimeScale timeScale, double playbackSpeed);
+    HRESULT StopScheduledPlayback(BMDTimeValue stopPlaybackAtTime, [out] BMDTimeValue *actualStopTime, BMDTimeScale timeScale);
+    HRESULT IsScheduledPlaybackRunning([out] BOOL *active);
+    HRESULT GetHardwareReferenceClock(BMDTimeScale desiredTimeScale, [out] BMDTimeValue *elapsedTimeSinceSchedulerBegan);
+};
+
+/* End Interface IDeckLinkOutput */
+
+/* Interface IDeckLinkInput - Created by QueryInterface from IDeckLink. */
+
+[
+    object,
+    uuid(4973F012-9925-458C-871C-18774CDBBECB),
+    helpstring("Created by QueryInterface from IDeckLink.")
+] interface IDeckLinkInput_v7_3 : IUnknown
+{
+    HRESULT DoesSupportVideoMode(BMDDisplayMode displayMode, BMDPixelFormat pixelFormat, [out] BMDDisplayModeSupport *result);
+    HRESULT GetDisplayModeIterator([out] IDeckLinkDisplayModeIterator **iterator);
+
+    HRESULT SetScreenPreviewCallback([in] IDeckLinkScreenPreviewCallback *previewCallback);
+
+    /* Video Input */
+
+    HRESULT EnableVideoInput(BMDDisplayMode displayMode, BMDPixelFormat pixelFormat, BMDVideoInputFlags flags);
+    HRESULT DisableVideoInput(void);
+    HRESULT GetAvailableVideoFrameCount([out] unsigned long *availableFrameCount);
+
+    /* Audio Input */
+
+    HRESULT EnableAudioInput(BMDAudioSampleRate sampleRate, BMDAudioSampleType sampleType, unsigned long channelCount);
+    HRESULT DisableAudioInput(void);
+    HRESULT GetAvailableAudioSampleFrameCount([out] unsigned long *availableSampleFrameCount);
+
+    /* Input Control */
+
+    HRESULT StartStreams(void);
+    HRESULT StopStreams(void);
+    HRESULT PauseStreams(void);
+    HRESULT FlushStreams(void);
+    HRESULT SetCallback([in] IDeckLinkInputCallback_v7_3 *theCallback);
+};
+
+/* End Interface IDeckLinkInput */
+
+
+/* Interface IDeckLinkVideoInputFrame - Provided by the IDeckLinkVideoInput frame arrival callback. */
+
+[
+    object,
+    uuid(CF317790-2894-11DE-8C30-0800200C9A66),
+    local, 
+    helpstring("Provided by the IDeckLinkVideoInput frame arrival callback.")
+] interface IDeckLinkVideoInputFrame_v7_3 : IDeckLinkVideoFrame
+{
+    HRESULT GetStreamTime([out] BMDTimeValue *frameTime, [out] BMDTimeValue *frameDuration, BMDTimeScale timeScale);
+};
+
+/* End Interface IDeckLinkVideoInputFrame */
+

Modified: vic/branches/mpeg4/video/grabber-decklink.cpp
==============================================================================
--- vic/branches/mpeg4/video/grabber-decklink.cpp	(original)
+++ vic/branches/mpeg4/video/grabber-decklink.cpp	Sat Jan 30 10:06:31 2010
@@ -1,4 +1,3 @@
-
 /*
  * grabber-declink.cpp
  *
@@ -37,7 +36,6 @@
  */
 
 #include <stdio.h>
-#include <unistd.h>
 #include <sys/types.h>
 
 #include "grabber.h"
@@ -47,13 +45,21 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "yuv_convert.h"
-
+#if defined(_WIN32) || defined(_WIN64)
+#include <atlbase.h>
+#include "DeckLinkAPI_h.h"
+#include "inttypes.h"
+#else
+#include <unistd.h>
 #include "DeckLinkAPIDispatch.cpp"
+#endif
+
+#include "yuv_convert.h"
 
+#if !defined(_WIN32) && !defined(_WIN64)
 #undef debug_msg
 #define debug_msg(args...) fprintf(stderr, args)
-
+#endif
 
 #define NUM_DEVS 5   // max number of DeckLink capture devices we'll support
 
@@ -109,14 +115,21 @@
     }
 
     virtual ULONG STDMETHODCALLTYPE AddRef() {
+#if defined(_WIN32) || defined(_WIN64) 
+       return InterlockedIncrement((LONG*)&mRefCount);
+#else
        return __sync_fetch_and_add(&mRefCount, 1);
+#endif
     }
 
     virtual ULONG STDMETHODCALLTYPE Release() {
         int32_t newRefValue;
 
+#if defined(_WIN32) || defined(_WIN64) 
+        newRefValue = InterlockedDecrement((LONG*)&mRefCount);
+#else
         newRefValue = __sync_fetch_and_sub(&mRefCount, 1);
-
+#endif
         if (newRefValue == 0) {
             delete this;
             return 0;
@@ -124,7 +137,7 @@
         return newRefValue;
     }
 
-    virtual HRESULT VideoInputFrameArrived(IDeckLinkVideoInputFrame* arrivedFrame, IDeckLinkAudioInputPacket*) {
+    virtual HRESULT STDMETHODCALLTYPE VideoInputFrameArrived(IDeckLinkVideoInputFrame* arrivedFrame, IDeckLinkAudioInputPacket*) {
 
         void *videoFrame;
         arrivedFrame->GetBytes(&videoFrame);
@@ -206,22 +219,39 @@
 
 DeckLinkScanner::DeckLinkScanner(int maxNumDevices)
 {
-    IDeckLinkIterator* deckLinkIterator;
     IDeckLink* deckLink;
     int n = 0;
     HRESULT result;
 
+#if defined(_WIN32) || defined(_WIN64) 
+    CComPtr<IDeckLinkIterator> deckLinkIterator = NULL;
+	if (CoCreateInstance(CLSID_CDeckLinkIterator, NULL, CLSCTX_ALL, IID_IDeckLinkIterator, (void**)&deckLinkIterator) != S_OK || deckLinkIterator == NULL) {
+        debug_msg("DeckLinkScanner: DeckLink iterator instance could not be created\n");
+        return;
+	}
+#else
+    IDeckLinkIterator* deckLinkIterator;
     deckLinkIterator = CreateDeckLinkIteratorInstance();
     if (deckLinkIterator == NULL) {
         debug_msg("DeckLinkScanner: DeckLink iterator instance could not be created\n");
         return;
     }
+#endif
 
     memset(devs_, 0, sizeof(devs_));
     // Enumerate all DeckLink cards on this system
     while (deckLinkIterator->Next(&deckLink) == S_OK && n < maxNumDevices) {
-                
-#ifdef __APPLE__
+
+#if defined(_WIN32) || defined(_WIN64) 
+        char deviceNameString[64] = {};
+        CComBSTR cardNameBSTR;
+
+        result = deckLink->GetModelName(&cardNameBSTR);
+	    if (result == S_OK) {
+            CW2A tmpstr1(cardNameBSTR);
+            strncpy_s(deviceNameString, sizeof(deviceNameString), tmpstr1, _TRUNCATE);
+	    }
+#elif __APPLE__
         char deviceNameString[64] = {};
         CFStringRef modelName;
 
@@ -251,14 +281,13 @@
 
 DeckLinkScanner::~DeckLinkScanner() {
     debug_msg("~DeckLinkScanner\n");
-    /*
+
     for (int i = 0; i < NUM_DEVS; i++) {
         if (devs_[i]) {
-            debug_msg("Deleteing device %d\n", i);
+            debug_msg("Deleting DeckLink device %d\n", i);
             delete devs_[i];
         }
     }
-    */
 }
 
 DeckLinkDevice::DeckLinkDevice(const char* name, IDeckLink* deckLink) : InputDevice(name), grabber_(0), deckLink_(deckLink)
@@ -329,7 +358,16 @@
     while (displayModeIterator->Next(&displayMode) == S_OK) {
         char typeString[128];
 
-#ifdef __APPLE__
+#if defined(_WIN32) || defined(_WIN64) 
+        char displayModeString[64] = {};
+        CComBSTR displayModeNameBSTR;
+
+        result = displayMode->GetName(&displayModeNameBSTR) == S_OK;
+	    if (result == S_OK) {
+            CW2A tmpstr1(displayModeNameBSTR);
+            strncpy_s(displayModeString, sizeof(displayModeString), tmpstr1, _TRUNCATE);
+	    }
+#elif __APPLE__
         char displayModeString[64] = {};
 
         CFStringRef displayModeName;
@@ -399,7 +437,7 @@
 }
 
 DeckLinkGrabber::DeckLinkGrabber(const char *cformat, IDeckLink* deckLink) :
-    deckLink_(deckLink), displayMode_(NULL)
+    deckLink_(deckLink)
 {
     HRESULT result;
 
@@ -495,7 +533,16 @@
             while (displayModeIterator->Next(&displayMode) == S_OK) {
                 char typeString[128];
 
-#ifdef __APPLE__
+#if defined(_WIN32) || defined(_WIN64) 
+                char displayModeString[64] = {};
+                CComBSTR displayModeNameBSTR;
+
+                result = displayMode->GetName(&displayModeNameBSTR);
+	            if (result == S_OK) {
+                    CW2A tmpstr1(displayModeNameBSTR);
+                    strncpy_s(displayModeString, sizeof(displayModeString), tmpstr1, _TRUNCATE);
+	            }
+#elif __APPLE__
                 char displayModeString[64] = {};
 
                 CFStringRef displayModeName;



More information about the Sumover-dev mailing list