]> git.sesse.net Git - casparcg/blob - dependencies64/bluefish/include/BlueDriver_p.h
Modifications to the files within the Bluefish module.
[casparcg] / dependencies64 / bluefish / include / BlueDriver_p.h
1 /*
2  $Id: BlueDriver_p.h,v 1.62.2.16 2011/10/26 05:33:18 tim Exp $
3 */
4 #pragma once 
5 #define _BLUEDRIVER_P_H__
6 #define BLUE_UINT32     unsigned int 
7 #define BLUE_INT32      int 
8 #define BLUE_UINT8      unsigned char
9 #define BLUE_INT8       char
10 #define BLUE_UINT16     unsigned short
11 #define BLUE_INT16      short
12 #pragma once
13 #ifdef BLUE_LINUX_CODE
14 #define BLUE_UINT64 unsigned long long 
15 //#include <asm/types.h>
16 #else
17 #define BLUE_UINT64     unsigned __int64
18 #endif 
19
20 //#define ORAC_FILMPOST_FIRMWARE_PRODUCTID      (0x1)
21 //#define ORAC_BROADCAST_FIRMWARE_PRODUCTID     (0x2)
22 //#define ORAC_ASI_FIRMWARE_PRODUCTID                   (0x3)
23 //#define ORAC_4SDIINPUT_FIRMWARE_PRODUCTID     (0x4)
24 //#define ORAC_4SDIOUTPUT_FIRMWARE_PRODUCTID    (0x5)
25
26
27
28 /**
29  * This contains the enumerators that can be used to set the cards \n
30  * video output and also to determine the video mode of the incoming \n
31  * video signal.
32  */ 
33 typedef enum _EVideoMode
34 {
35         VID_FMT_PAL=0,
36         VID_FMT_NTSC=1,
37         VID_FMT_576I_5000=0,    /**< 720  x 576  50       Interlaced */
38         VID_FMT_486I_5994=1,    /**< 720  x 486  60/1.001 Interlaced */
39         VID_FMT_720P_5994,              /**< 1280 x 720  60/1.001 Progressive */
40         VID_FMT_720P_6000,              /**< 1280 x 720  60       Progressive */
41         VID_FMT_1080PSF_2397,   /**< 1920 x 1080 24/1.001 Segment Frame */
42         VID_FMT_1080PSF_2400,   /**< 1920 x 1080 24       Segment Frame */
43         VID_FMT_1080P_2397,             /**< 1920 x 1080 24/1.001 Progressive */
44         VID_FMT_1080P_2400,             /**< 1920 x 1080 24       Progressive */
45         VID_FMT_1080I_5000,             /**< 1920 x 1080 50       Interlaced */
46         VID_FMT_1080I_5994,             /**< 1920 x 1080 60/1.001 Interlaced */
47         VID_FMT_1080I_6000,             /**< 1920 x 1080 60       Interlaced */
48         VID_FMT_1080P_2500,             /**< 1920 x 1080 25       Progressive */
49         VID_FMT_1080P_2997,             /**< 1920 x 1080 30/1.001 Progressive */
50         VID_FMT_1080P_3000,             /**< 1920 x 1080 30       Progressive */
51         VID_FMT_HSDL_1498,              /**< 2048 x 1556 15/1.0   Segment Frame */
52         VID_FMT_HSDL_1500,              /**< 2048 x 1556 15                     Segment Frame */
53         VID_FMT_720P_5000,              /**< 1280 x 720  50                     Progressive */
54         VID_FMT_720P_2398,              /**< 1280 x 720  24/1.001       Progressive */
55         VID_FMT_720P_2400,              /**< 1280 x 720  24     Progressive */
56         VID_FMT_2048_1080PSF_2397=19,   /**< 2048 x 1080 24/1.001       Segment Frame */
57         VID_FMT_2048_1080PSF_2400=20,   /**< 2048 x 1080 24     Segment Frame */
58         VID_FMT_2048_1080P_2397=21,     /**< 2048 x 1080 24/1.001       progressive */ 
59         VID_FMT_2048_1080P_2400=22,     /**< 2048 x 1080 24     progressive  */
60         VID_FMT_1080PSF_2500=23,
61         VID_FMT_1080PSF_2997=24,
62         VID_FMT_1080PSF_3000=25,
63         VID_FMT_1080P_5000=26,
64         VID_FMT_1080P_5994=27,
65         VID_FMT_1080P_6000=28,
66         VID_FMT_720P_2500=29,
67         VID_FMT_720P_2997=30,
68         VID_FMT_720P_3000=31,
69         VID_FMT_DVB_ASI=32,
70         VID_FMT_2048_1080PSF_2500=33,
71         VID_FMT_2048_1080PSF_2997=34,
72         VID_FMT_2048_1080PSF_3000=35,
73         VID_FMT_2048_1080P_2500=36,
74         VID_FMT_2048_1080P_2997=37,
75         VID_FMT_2048_1080P_3000=38,
76         VID_FMT_2048_1080P_5000=39,
77         VID_FMT_2048_1080P_5994=40,
78         VID_FMT_2048_1080P_6000=41,
79         VID_FMT_INVALID=42
80 } EVideoMode;
81
82 /**
83 @brief Use these enumerators to set the pixel format 
84                 that should be used by the video input and output 
85                 framestores.
86 */
87 typedef enum _EMemoryFormat
88 {
89         MEM_FMT_ARGB=0, /**< ARGB 4:4:4:4 */
90         MEM_FMT_BV10=1,
91         MEM_FMT_BV8=2,
92         MEM_FMT_YUVS=MEM_FMT_BV8,
93         MEM_FMT_V210=3, // Iridium HD (BAG1)
94         MEM_FMT_RGBA=4,
95         MEM_FMT_CINEON_LITTLE_ENDIAN=5,
96         MEM_FMT_ARGB_PC=6,
97         MEM_FMT_BGRA=MEM_FMT_ARGB_PC,
98         MEM_FMT_CINEON=7,
99         MEM_FMT_2VUY=8,
100         MEM_FMT_BGR=9,
101         MEM_FMT_BGR_16_16_16=10,
102         MEM_FMT_BGRA_16_16_16_16=11,
103         MEM_FMT_VUYA_4444=12,
104         MEM_FMT_V216=13,
105         MEM_FMT_Y210=14,
106         MEM_FMT_Y216=15,
107         MEM_FMT_INVALID=16
108 } EMemoryFormat;
109
110 /**
111 @brief Used to control the video update type, 
112                 whether the card should capture/playback a
113                 video frame or field.
114 */
115 typedef enum _EUpdateMethod
116 {
117         UPD_FMT_FIELD=0,
118         UPD_FMT_FRAME,
119         UPD_FMT_FRAME_DISPLAY_FIELD1,
120         UPD_FMT_FRAME_DISPLAY_FIELD2,
121         UPD_FMT_INVALID,
122         UPD_FMT_FLAG_RETURN_CURRENT_UNIQUEID=0x80000000,/**< if this flag is used on epoch cards, function would 
123                                                                                                         return the unique id of the current frame as the return value.*/
124 } EUpdateMethod;
125
126 typedef enum _EResoFormat
127 {
128         RES_FMT_NORMAL=0,
129         RES_FMT_HALF,
130         RES_FMT_INVALID
131 } EResoFormat;
132
133 typedef enum _ECardType
134 {
135         CRD_BLUEDEEP_LT=0,              // D64 Lite
136         CRD_BLUEDEEP_SD,                // Iridium SD
137         CRD_BLUEDEEP_AV,                // Iridium AV
138         CRD_BLUEDEEP_IO,                // D64 Full
139         CRD_BLUEWILD_AV,                // D64 AV
140         CRD_IRIDIUM_HD,                 // * Iridium HD
141         CRD_BLUEWILD_RT,                // D64 RT
142         CRD_BLUEWILD_HD,                // * BadAss G2
143         CRD_REDDEVIL,                   // Iridium Full
144         CRD_BLUEDEEP_HD,                // * BadAss G2 variant, proposed, reserved
145         CRD_BLUE_EPOCH_2K = CRD_BLUEDEEP_HD,
146         CRD_BLUE_EPOCH_2K_HORIZON=CRD_BLUE_EPOCH_2K,
147         CRD_BLUEDEEP_HDS,               // * BadAss G2 variant, proposed, reserved
148         CRD_BLUE_ENVY,                  // Mini Din 
149         CRD_BLUE_PRIDE,                 //Mini Din Output 
150         CRD_BLUE_GREED,
151         CRD_BLUE_INGEST,
152         CRD_BLUE_SD_DUALLINK,
153         CRD_BLUE_CATALYST,
154         CRD_BLUE_SD_DUALLINK_PRO,
155         CRD_BLUE_SD_INGEST_PRO,
156         CRD_BLUE_SD_DEEPBLUE_LITE_PRO,
157         CRD_BLUE_SD_SINGLELINK_PRO,
158         CRD_BLUE_SD_IRIDIUM_AV_PRO,
159         CRD_BLUE_SD_FIDELITY,
160         CRD_BLUE_SD_FOCUS,
161         CRD_BLUE_SD_PRIME,
162         CRD_BLUE_EPOCH_2K_CORE,
163         CRD_BLUE_EPOCH_2K_ULTRA,
164         CRD_BLUE_EPOCH_HORIZON,
165         CRD_BLUE_EPOCH_CORE,
166         CRD_BLUE_EPOCH_ULTRA,
167         CRD_BLUE_CREATE_HD,
168         CRD_BLUE_CREATE_2K,
169         CRD_BLUE_CREATE_2K_ULTRA,
170         CRD_BLUE_CREATE_3D = CRD_BLUE_CREATE_2K,
171         CRD_BLUE_CREATE_3D_ULTRA = CRD_BLUE_CREATE_2K_ULTRA,
172         CRD_BLUE_SUPER_NOVA,
173         CRD_INVALID
174 } ECardType;
175
176
177 typedef enum _EHDCardSubType
178 {       
179         CRD_HD_FURY=1,
180         CRD_HD_VENGENCE=2,
181         CRD_HD_IRIDIUM_XP=3,
182         CRD_HD_IRIDIUM = 4,
183         CRD_HD_LUST=5,
184         CRD_HD_INVALID
185 }EHDCardSubType;
186
187 enum EEpochFirmwareProductID
188 {
189         ORAC_FILMPOST_FIRMWARE_PRODUCTID=(0x1),                         //Epoch/Create, standard firmware
190         ORAC_BROADCAST_FIRMWARE_PRODUCTID=(0x2),                        //Epoch
191         ORAC_ASI_FIRMWARE_PRODUCTID=(0x3),                                      //Epoch
192         ORAC_4SDIINPUT_FIRMWARE_PRODUCTID=(0x4),                        //SuperNova
193         ORAC_4SDIOUTPUT_FIRMWARE_PRODUCTID=(0x5),                       //SuperNova
194         ORAC_2SDIINPUT_2SDIOUTPUT_FIRMWARE_PRODUCTID=(0x6),     //SuperNova
195 };
196
197 /**< @brief Use this enumerator to select the audio channels that should be captured  or played back.
198 */
199 typedef enum _BlueAudioChannelDesc
200 {
201         MONO_FLAG               = 0xC0000000,
202         MONO_CHANNEL_1  = 0x00000001,
203         MONO_CHANNEL_2  = 0x00000002,
204         MONO_CHANNEL_3  = 0x00000004,
205         MONO_CHANNEL_4  = 0x00000008,
206         MONO_CHANNEL_5  = 0x00000010,
207         MONO_CHANNEL_6  = 0x00000020,
208         MONO_CHANNEL_7  = 0x00000040,
209         MONO_CHANNEL_8  = 0x00000080,
210         MONO_CHANNEL_9  = 0x00000100,// to be used by analog audio output channels 
211         MONO_CHANNEL_10 = 0x00000200,// to be used by analog audio output channels 
212         MONO_CHANNEL_11 = 0x00000400,//actual channel 9
213         MONO_CHANNEL_12 = 0x00000800,//actual channel 10
214         MONO_CHANNEL_13 = 0x00001000,//actual channel 11
215         MONO_CHANNEL_14 = 0x00002000,//actual channel 12
216         MONO_CHANNEL_15 = 0x00004000,//actual channel 13
217         MONO_CHANNEL_16 = 0x00008000,//actual channel 14
218         MONO_CHANNEL_17 = 0x00010000,//actual channel 15
219         MONO_CHANNEL_18 = 0x00020000 //actual channel 16
220 }BlueAudioChannelDesc;
221
222
223 //----------------------------------------------------------------------------
224 /**<
225 Use this enumeraotor to set the type of pcm audio data.
226 */
227 typedef enum
228 {
229         AUDIO_CHANNEL_LOOPING_OFF               = 0x00000000, /**< deprecated not used any more */
230         AUDIO_CHANNEL_LOOPING                   = 0x00000001,/**< deprecated not used any more */
231         AUDIO_CHANNEL_LITTLEENDIAN              = 0x00000000, /**< if the audio data is little endian this flag must be set*/
232         AUDIO_CHANNEL_BIGENDIAN                 = 0x00000002,/**< if the audio data is big  endian this flag must be set*/
233         AUDIO_CHANNEL_OFFSET_IN_BYTES   = 0x00000004,/**< deprecated not used any more */
234         AUDIO_CHANNEL_16BIT                             = 0x00000008, /**< if the audio channel bit depth is 16 bits this flag must be set*/
235         AUDIO_CHANNEL_BLIP_PENDING              = 0x00000010,/**< deprecated not used any more */
236         AUDIO_CHANNEL_BLIP_COMPLETE             = 0x00000020,/**< deprecated not used any more */
237         AUDIO_CHANNEL_SELECT_CHANNEL    = 0x00000040,/**< deprecated not used any more */
238         AUDIO_CHANNEL_24BIT                             = 0x00000080/**< if the audio channel bit depth is 24 bits this flag must be set*/
239 } EAudioFlags;
240
241 /**
242 @desc Used to select Audio input source on new generation SD cards 
243 @remarks
244 This enumerator works only when used with ReadAudioSample function.
245 */
246 typedef enum
247 {
248         BLUE_AUDIO_AES=0, /**< Used to select All 8 channels of Digital Audio using AES/AES3id  connector*/
249         BLUE_AUDIO_ANALOG=1,/**< Used to select Analog audio*/
250         BLUE_AUDIO_SDIA=2, /**< Used to select Emb audio from SDI A */
251         BLUE_AUDIO_EMBEDDED=BLUE_AUDIO_SDIA,
252         BLUE_AUDIO_SDIB=3, /**< Used to select Emb audio from SDI B */
253         BLUE_AUDIO_AES_PAIR0=4, /**< Used to select stereo pair 0 as audio input source. This is only supported on SD Greed Derivative cards.*/
254         BLUE_AUDIO_AES_PAIR1=5,/**< Used to select stereo pair 1 as audio input source. This is only supported on SD Greed Derivative cards.*/
255         BLUE_AUDIO_AES_PAIR2=6,/**< Used to select stereo pair 2 as audio input source. This is only supported on SD Greed Derivative cards.*/
256         BLUE_AUDIO_AES_PAIR3=7,/**< Used to select stereo pair 3 as audio input source. This is only supported on SD Greed Derivative cards.*/
257         BLUE_AUDIO_SDIC=8, /**< Used to select Emb audio from SDI C */
258         BLUE_AUDIO_SDID=9, /**< Used to select Emb audio from SDI D */
259         BLUE_AUDIO_INVALID=10
260 } Blue_Audio_Connector_Type;
261
262 typedef enum _EAudioRate
263 {
264         AUDIO_SAMPLE_RATE_48K=48000,
265         AUDIO_SAMPLE_RATE_96K=96000,
266         AUDIO_SAMPLE_RATE_UNKNOWN=-1
267 } EAudioRate;
268
269 /**<
270 @brief use this enumerator to define the color space of the video signal on the SDI cable
271 */
272 typedef enum _EConnectorSignalColorSpace
273 {
274         RGB_ON_CONNECTOR=0x00400000, /**< Use this enumerator if the colorspace of video data on the SDI cable is RGB <br/>
275                                                                                 When using dual link capture/playback , user can choose the 
276                                                                                 color space of the data. <br>
277                                                                                 In single link SDI the color space of the signal is always YUB*/
278         YUV_ON_CONNECTOR=0 /**<Use this enumerator if color space of video data on the SDI cable  is RGB.*/
279 }EConnectorSignalColorSpace;
280
281
282 /**<
283 @brief use this enumerator for controlling the dual link functionality.
284 */
285 typedef enum _EDualLinkSignalFormatType
286 {
287         Signal_FormatType_4224=0, /**< sets the card to work in  4:2:2:4 mode*/
288         Signal_FormatType_4444=1,/**< sets the card to work in  4:4:4 10 bit dual link mode*/
289         Signal_FormatType_444_10BitSDI=Signal_FormatType_4444,/**< sets the card to work in  10 bit 4:4:4 dual link mode*/
290         Signal_FormatType_444_12BitSDI=0x4,/**< sets the card to work in  4:4:4 12 bit dual link mode*/
291         Signal_FormatType_Independent_422 = 0x2,
292         Signal_FormatType_Key_Key=0x8000/**< not used currently on epoch cards */
293         
294 }EDualLinkSignalFormatType;
295
296
297 enum ECardOperatingMode
298 {
299         CardOperatingMode_SingleLink=0x0,
300         CardOperatingMode_Independent_422=CardOperatingMode_SingleLink,
301         CardOperatingMode_DualLink=0x1, 
302         CardOperatingMode_StereoScopic_422=0x3, 
303         CardOperatingMode_Dependent_422=CardOperatingMode_StereoScopic_422,/**< not used currently on epoch cards */
304 };
305
306
307 typedef enum _EPreDefinedColorSpaceMatrix
308 {
309         UNITY_MATRIX=0,
310         MATRIX_709_CGR=1,
311         MATRIX_RGB_TO_YUV_709_CGR=MATRIX_709_CGR,
312         MATRIX_709=2,
313         MATRIX_RGB_TO_YUV_709=MATRIX_709,
314         RGB_FULL_RGB_SMPTE=3,
315         MATRIX_601_CGR=4,
316         MATRIX_RGB_TO_YUV_601_CGR=MATRIX_601_CGR,
317         MATRIX_601=5,
318         MATRIX_RGB_TO_YUV_601=MATRIX_601,
319         MATRIX_SMPTE_274_CGR=6,
320         MATRIX_SMPTE_274=7,
321         MATRIX_VUYA=8,
322         UNITY_MATRIX_INPUT=9,
323         MATRIX_YUV_TO_RGB_709_CGR=10,
324         MATRIX_YUV_TO_RGB_709=11,
325         RGB_SMPTE_RGB_FULL=12,
326         MATRIX_YUV_TO_RGB_601_CGR=13,
327         MATRIX_YUV_TO_RGB_601=14,
328         MATRIX_USER_DEFINED=15,
329 }EPreDefinedColorSpaceMatrix;
330
331 #ifndef BLUE_LINUX_CODE
332 /**< 
333 @brief this enumerator contains the status of the driver video/hanc fifo 
334 */
335 typedef enum
336 {
337         BLUE_FIFO_CLOSED=0, /**< Fifo has not been initialized*/
338         BLUE_FIFO_STARTING=1,/**< Fifo is starting */
339         BLUE_FIFO_RUNNING=2,/**< Fifo is running */
340         BLUE_FIFO_STOPPING=3,/**< Fifo is in the process of stopping */
341         BLUE_FIFO_PASSIVE=5,/**< Fifo is currently stopped or not active*/
342 }BlueVideoFifoStatus;
343 #endif
344
345 /**<
346 @brief use this enumerator to define the data range of the RGB video frame data.
347 */
348 typedef enum _ERGBDataRange
349 {
350         CGR_RANGE=0, /**<       In this mode RGB data expected by the user (capture) or provided by the user(playback) is 
351                                                 in the range of 0-255(8 bit) or 0-1023(10 bit0).<br/>
352                                                 driver uses this information to choose the appropriate YUV conversion matrices.*/
353         SMPTE_RANGE=1  /**<     In this mode RGB data expected by the user (capture) or provided by the user(playback) is 
354                                                 in the range of 16-235(8 bit) or 64-940(10 bit0).<br/>
355                                                 driver uses this information to choose the appropriate YUV conversion matrices.*/
356 }ERGBDataRange;
357
358 typedef enum _EHD_XCONNECTOR_MODE
359 {
360         SD_SDI=1,
361         HD_SDI=2
362 }EHD_XCONNECTOR_MODE;
363
364 /**< @brief  this enumerator can be used to set the image orienatation of the frame.                                                    
365 */
366 typedef enum _EImageOrientation
367 {
368         ImageOrientation_Normal=0,      /**< in this configuration , frame is top to bottom and left to right */
369         ImageOrientation_VerticalFlip=1, /**< in this configuration frame is bottom to top and left to right*/
370         ImageOrientation_Invalid=2,     
371 }EImageOrientation;
372
373 /**< @brief this enumerator defines the reference signal source that can be used with bluefish cards
374 */
375 typedef enum _EBlueGenlockSource
376 {
377         BlueGenlockBNC=0, /**< Genlock is used as reference signal source */
378         BlueSDIBNC=0x10000, /**< SDI input B  is used as reference signal source */
379         BlueSDI_B_BNC=BlueSDIBNC,
380         BlueSDI_A_BNC=0x20000,/**< SDI input A  is used as reference signal source */
381         BlueAnalog_BNC=0x40000, /**< Analog input is used as reference signal source */
382         BlueSoftware=0x80000,
383 }EBlueGenlockSource;
384
385
386 typedef enum _EBlueVideoChannel
387 {
388         BLUE_VIDEOCHANNEL_A=0,
389         BLUE_VIDEO_OUTPUT_CHANNEL_A=BLUE_VIDEOCHANNEL_A,
390         
391         BLUE_VIDEOCHANNEL_B=1,
392         BLUE_VIDEO_OUTPUT_CHANNEL_B=BLUE_VIDEOCHANNEL_B,
393         
394         BLUE_VIDEOCHANNEL_C=2,
395         BLUE_VIDEO_INPUT_CHANNEL_A=BLUE_VIDEOCHANNEL_C,
396
397         BLUE_VIDEOCHANNEL_D=3,
398         BLUE_VIDEO_INPUT_CHANNEL_B=BLUE_VIDEOCHANNEL_D,
399
400         BLUE_VIDEOCHANNEL_E=4,
401         BLUE_VIDEO_INPUT_CHANNEL_C=BLUE_VIDEOCHANNEL_E,
402
403         BLUE_VIDEOCHANNEL_F=5,
404         BLUE_VIDEO_INPUT_CHANNEL_D=BLUE_VIDEOCHANNEL_F,
405
406         BLUE_VIDEOCHANNEL_G=6,
407         BLUE_VIDEO_OUTPUT_CHANNEL_C=BLUE_VIDEOCHANNEL_G,
408
409         BLUE_VIDEOCHANNEL_H=7,
410         BLUE_VIDEO_OUTPUT_CHANNEL_D=BLUE_VIDEOCHANNEL_H,
411         
412         BLUE_OUTPUT_MEM_MODULE_A=BLUE_VIDEO_OUTPUT_CHANNEL_A,
413         BLUE_OUTPUT_MEM_MODULE_B=BLUE_VIDEO_OUTPUT_CHANNEL_B,
414         BLUE_INPUT_MEM_MODULE_A=BLUE_VIDEO_INPUT_CHANNEL_A,
415         BLUE_INPUT_MEM_MODULE_B=BLUE_VIDEO_INPUT_CHANNEL_B,
416         //BLUE_JETSTREAM_SCALER_MODULE_0=0x10,
417         //BLUE_JETSTREAM_SCALER_MODULE_1=0x11,
418         //BLUE_JETSTREAM_SCALER_MODULE_2=0x12,
419         //BLUE_JETSTREAM_SCALER_MODULE_3=0x13,
420
421         BLUE_VIDEOCHANNEL_INVALID=30
422 }EBlueVideoChannel;
423
424 typedef enum _EBlueVideoRouting
425 {
426         BLUE_VIDEO_LINK_INVALID=0,
427         BLUE_SDI_A_LINK1=4,
428         BLUE_SDI_A_LINK2=5,
429         BLUE_SDI_B_LINK1=6,
430         BLUE_SDI_B_LINK2=7,
431         BLUE_ANALOG_LINK1=8,
432         BLUE_ANALOG_LINK2=9,
433         BLUE_SDI_A_SINGLE_LINK=BLUE_SDI_A_LINK1,
434         BLUE_SDI_B_SINGLE_LINK=BLUE_SDI_B_LINK1,
435         BLUE_ANALOG_SINGLE_LINK=BLUE_ANALOG_LINK1
436
437 }EBlueVideoRouting;
438
439 typedef enum
440 {
441         BLUE_FIFO_NULL_ATTRIBUTE=0x0,
442         BLUE_FIFO_ECHOPORT_ENABLED=0x1,
443         BLUE_FIFO_STEPMODE = 0x2,
444         BLUE_FIFO_LOOPMODE = 0x4
445 }BlueVideoFifo_Attributes;
446
447 typedef enum _BlueAudioOutputDest
448 {
449         Blue_AnalogAudio_Output=0x0,
450         Blue_AES_Output=0x80000000,
451         Blue_Emb_Output=0x40000000,
452 }BlueAudioOutputDest;
453
454
455 /**<@brief this enumerator is not used need to be removed*/
456 typedef enum _BlueAudioInputSource
457 {
458         Blue_AES=0x10,
459         Blue_AnalogAudio=0x20,
460         Blue_SDIA_Embed=0x40,
461         Blue_SDIB_Embed=0x80,
462 }BlueAudioInputSource;
463
464 typedef enum _EBlueConnectorIdentifier
465 {
466         BLUE_CONNECTOR_INVALID = -1,
467         
468         // BNC connectors in order from top to bottom of shield
469         BLUE_CONNECTOR_BNC_A = 0,    // BNC closest to top of shield
470         BLUE_CONNECTOR_BNC_B,
471         BLUE_CONNECTOR_BNC_C,
472         BLUE_CONNECTOR_BNC_D,
473         BLUE_CONNECTOR_BNC_E,
474         BLUE_CONNECTOR_BNC_F,
475         BLUE_CONNECTOR_GENLOCK,
476         
477         BLUE_CONNECTOR_ANALOG_VIDEO_1 = 100,
478         BLUE_CONNECTOR_ANALOG_VIDEO_2,
479         BLUE_CONNECTOR_ANALOG_VIDEO_3,
480         BLUE_CONNECTOR_ANALOG_VIDEO_4,
481         BLUE_CONNECTOR_ANALOG_VIDEO_5,
482         BLUE_CONNECTOR_ANALOG_VIDEO_6,
483
484         BLUE_CONNECTOR_DVID_1 = 200,
485         BLUE_CONNECTOR_SDI_OUTPUT_A= BLUE_CONNECTOR_DVID_1,
486         BLUE_CONNECTOR_DVID_2,
487         BLUE_CONNECTOR_SDI_OUTPUT_B= BLUE_CONNECTOR_DVID_2,
488         BLUE_CONNECTOR_DVID_3,
489         BLUE_CONNECTOR_SDI_INPUT_A= BLUE_CONNECTOR_DVID_3,
490         BLUE_CONNECTOR_DVID_4,
491         BLUE_CONNECTOR_SDI_INPUT_B= BLUE_CONNECTOR_DVID_4,
492         BLUE_CONNECTOR_DVID_5,
493         BLUE_CONNECTOR_SDI_OUTPUT_C,
494         BLUE_CONNECTOR_SDI_OUTPUT_D,
495
496         BLUE_CONNECTOR_AES = 300,
497         BLUE_CONNECTOR_ANALOG_AUDIO_1,
498         BLUE_CONNECTOR_ANALOG_AUDIO_2,
499
500         BLUE_CONNECTOR_DVID_6,
501         BLUE_CONNECTOR_SDI_INPUT_C= BLUE_CONNECTOR_DVID_6,
502         BLUE_CONNECTOR_DVID_7,
503         BLUE_CONNECTOR_SDI_INPUT_D= BLUE_CONNECTOR_DVID_7,
504
505         //BLUE_CONNECTOR_RESOURCE_BLOCK=0x400,
506         //BLUE_CONNECTOR_JETSTREAM_SCALER_0=(BLUE_CONNECTOR_RESOURCE_BLOCK|BLUE_JETSTREAM_SCALER_MODULE_0),
507         //BLUE_CONNECTOR_JETSTREAM_SCALER_1=(BLUE_CONNECTOR_RESOURCE_BLOCK|BLUE_JETSTREAM_SCALER_MODULE_1),
508         //BLUE_CONNECTOR_JETSTREAM_SCALER_2=(BLUE_CONNECTOR_RESOURCE_BLOCK|BLUE_JETSTREAM_SCALER_MODULE_2),
509         //BLUE_CONNECTOR_JETSTREAM_SCALER_3=(BLUE_CONNECTOR_RESOURCE_BLOCK|BLUE_JETSTREAM_SCALER_MODULE_3),
510
511         //BLUE_CONNECTOR_OUTPUT_MEM_MODULE_A=(BLUE_CONNECTOR_RESOURCE_BLOCK|BLUE_OUTPUT_MEM_MODULE_A),
512         //BLUE_CONNECTOR_OUTPUT_MEM_MODULE_B=(BLUE_CONNECTOR_RESOURCE_BLOCK|BLUE_OUTPUT_MEM_MODULE_B),
513         //BLUE_CONNECTOR_INPUT_MEM_MODULE_A=(BLUE_CONNECTOR_RESOURCE_BLOCK|BLUE_INPUT_MEM_MODULE_A),
514         //BLUE_CONNECTOR_INPUT_MEM_MODULE_B=(BLUE_CONNECTOR_RESOURCE_BLOCK|BLUE_INPUT_MEM_MODULE_B),
515         //
516 }EBlueConnectorIdentifier;
517
518 typedef enum _EBlueConnectorSignalDirection
519 {
520         BLUE_CONNECTOR_SIGNAL_INVALID=-1,
521         BLUE_CONNECTOR_SIGNAL_INPUT=0,
522         BLUE_CONNECTOR_SIGNAL_OUTPUT=1,
523 }EBlueConnectorSignalDirection;
524
525 typedef enum _EBlueConnectorProperty
526 {
527         BLUE_INVALID_CONNECTOR_PROPERTY = -1,
528
529         //signal property
530         BLUE_CONNECTOR_PROP_INPUT_SIGNAL=0,
531         BLUE_CONNECTOR_PROP_OUTPUT_SIGNAL=1,
532
533         // Video output
534         BLUE_CONNECTOR_PROP_SDI = 0,
535         BLUE_CONNECTOR_PROP_YUV_Y,
536         BLUE_CONNECTOR_PROP_YUV_U,
537         BLUE_CONNECTOR_PROP_YUV_V,
538         BLUE_CONNECTOR_PROP_RGB_R,
539         BLUE_CONNECTOR_PROP_RGB_G,
540         BLUE_CONNECTOR_PROP_RGB_B,
541         BLUE_CONNECTOR_PROP_CVBS,
542         BLUE_CONNECTOR_PROP_SVIDEO_Y,
543         BLUE_CONNECTOR_PROP_SVIDEO_C,
544         
545         // Audio output
546         BLUE_CONNECTOR_PROP_AUDIO_AES = 0x2000,
547         BLUE_CONNECTOR_PROP_AUDIO_EMBEDDED,
548         BLUE_CONNECTOR_PROP_AUDIO_ANALOG,
549
550         
551         BLUE_CONNECTOR_PROP_SINGLE_LINK=0x3000,
552         BLUE_CONNECTOR_PROP_DUALLINK_LINK_1,
553         BLUE_CONNECTOR_PROP_DUALLINK_LINK_2,
554         BLUE_CONNECTOR_PROP_DUALLINK_LINK,
555
556         BLUE_CONNECTOR_PROP_STEREO_MODE_SIDE_BY_SIDE,
557         BLUE_CONNECTOR_PROP_STEREO_MODE_TOP_DOWN,
558         BLUE_CONNECTOR_PROP_STEREO_MODE_LINE_BY_LINE,
559
560 }EBlueConnectorProperty;
561
562 /*
563 typedef enum _BLUE_AUDIOINPUT_SOURCE
564 {
565         BLUE_AES_AUDIO_INPUT=0x10000,
566         BLUE_ANALOG_AUDIO_INPUT=0x20000,
567         BLUE_SDIA_AUDIO_INPUT=0x30000,
568         BLUE_SDIB_AUDIO_INPUT=0x40000
569 }BLUE_AUDIOINPUT_SOURCE;
570 */
571 /**
572 @desc use the values in this enumerator for controlling card property
573 */
574 typedef enum _EBlueCardProperty
575 {
576         VIDEO_DUAL_LINK_OUTPUT=0,/**<  Use this property to enable/diable cards dual link output property*/
577         VIDEO_DUAL_LINK_INPUT=1,/**<  Use this property to enable/diable cards dual link input property*/
578         VIDEO_DUAL_LINK_OUTPUT_SIGNAL_FORMAT_TYPE=2, /**<Use this property to select signal format type that should be used 
579                                                         when dual link output is enabled. Possible values this property can
580                                                         accept is defined in the enumerator EDualLinkSignalFormatType
581                                                                                                 */
582         VIDEO_DUAL_LINK_INPUT_SIGNAL_FORMAT_TYPE=3,/**< Use this property to select signal format type that should be used 
583                                                 when dual link input is enabled. Possible values this property can
584                                                 accept is defined in the enumerator EDualLinkSignalFormatType
585                                                 */
586         VIDEO_OUTPUT_SIGNAL_COLOR_SPACE=4,/**<  Use this property to select color space of the signal when dual link output is set to 
587                                         use 4:4:4/4:4:4:4 signal format type. Possible values this property can
588                                         accept is defined in the enumerator EConnectorSignalColorSpace
589                                         */
590         VIDEO_INPUT_SIGNAL_COLOR_SPACE=5,/**<   Use this property to select color space of the signal when dual link input is set to 
591                                         use 4:4:4/4:4:4:4 signal format type. Possible values this property can
592                                         accept is defined in the enumerator EConnectorSignalColorSpace
593                                         */
594         VIDEO_MEMORY_FORMAT=6, /**<Use this property to ser the pixel format that should be used by 
595                         video output channels.  Possible values this property can
596                         accept is defined in the enumerator EMemoryFormat
597                         */      
598         VIDEO_MODE=7,/**<Use this property to set the video mode that should be used by 
599                         video output channels.  Possible values this property can
600                         accept is defined in the enumerator EVideoMode
601                         */      //
602         VIDEO_UPDATE_TYPE=8,/**<Use this property to set the framestore update type that should be used by 
603                         video output channels.  Card can update video framestore at field/frame rate.
604                         Possible values this property can accept is defined in the enumerator EUpdateMethod
605                         */      
606         VIDEO_ENGINE=9,
607         VIDEO_IMAGE_ORIENTATION=10,/**< Use this property to set the image orientation of the video output framestore.
608                                 This property must be set before frame is transferred to on card memory using 
609                                 DMA transfer functions(system_buffer_write_async). It is recommended to use 
610                                 vertical flipped image orientation only on RGB pixel formats.
611                                 Possible values this property can accept is defined in the enumerator EImageOrientation
612                                 */
613         VIDEO_USER_DEFINED_COLOR_MATRIX=11,
614         VIDEO_PREDEFINED_COLOR_MATRIX=12,//EPreDefinedColorSpaceMatrix
615         VIDEO_RGB_DATA_RANGE=13,                /**<    Use this property to set the data range of RGB pixel format, user can specify 
616                                                                                         whether the RGB data is in either SMPTE or CGR range. Based on this information 
617                                                                                         driver is decide which color matrix should be used.
618                                                                                         Possible values this property can accept is defined in the enumerator ERGBDataRange
619                                                                                         For SD cards this property will set the input and the output to the specified value.
620                                                                                         For Epoch/Create/SuperNova cards this property will only set the output to the specified value.
621                                                                                         For setting the input on Epoch/Create/SuperNova cards see EPOCH_VIDEO_INPUT_RGB_DATA_RANGE*/
622         VIDEO_KEY_OVER_BLACK=14,/**< this property is deprecated and no longer supported on epoch/create range of cards.*/      
623         VIDEO_KEY_OVER_INPUT_SIGNAL=15,
624         VIDEO_SET_DOWN_CONVERTER_VIDEO_MODE=16,/**< this property is deprecated and no longer supported on epoch/create range of cards.
625                                                 EHD_XCONNECTOR_MODE
626                                                 */
627         VIDEO_LETTER_BOX=17,
628         VIDEO_PILLOR_BOX_LEFT=18,
629         VIDEO_PILLOR_BOX_RIGHT=19,
630         VIDEO_PILLOR_BOX_TOP=20,
631         VIDEO_PILLOR_BOX_BOTTOM=21,
632         VIDEO_SAFE_PICTURE=22,
633         VIDEO_SAFE_TITLE=23,
634         VIDEO_INPUT_SIGNAL_VIDEO_MODE=24,/**< Use this property to retreive the video input signal information on the 
635                                         default video input channel used by that  SDK object.
636                                         */
637         VIDEO_COLOR_MATRIX_MODE=25,
638         VIDEO_OUTPUT_MAIN_LUT=26,/**< this property is deprecated and no longer supported on epoch/create range of cards.*/
639         VIDEO_OUTPUT_AUX_LUT=27,/**< this property is deprecated and no longer supported on epoch/create range of cards.*/
640         VIDEO_LTC=28,           /**< this property is deprecated and no longer supported on epoch/create range of cards. To retreive/ outputting 
641                                 LTC information you can use the HANC decoding and encoding functions.*/
642         VIDEO_GPIO=29,  
643         VIDEO_PLAYBACK_FIFO_STATUS=30, /**< This property can be used to retreive how many frames are bufferd in the video playback fifo.*/
644         RS422_RX_BUFFER_LENGTH=31,
645         RS422_RX_BUFFER_FLUSH=32,
646         VIDEO_INPUT_UPDATE_TYPE=33,/**< Use this property to set the framestore update type that should be used by 
647                                 video input  channels.  Card can update video framestore at field/frame rate.
648                                 Possible values this property can accept is defined in the enumerator EUpdateMethod
649                                                                         */      
650         VIDEO_INPUT_MEMORY_FORMAT=34,/**<Use this property to set the pixel format that should be used by 
651                                         video input channels when it is capturing a frame from video input source.  
652                                         Possible values this property can accept is defined in the enumerator EMemoryFormat
653                                                                         */      
654         VIDEO_GENLOCK_SIGNAL=35,/**< Use this property to retrieve video signal of the reference source that is used by the card.
655                                 This can also be used to select the reference signal source that should be used.        
656                                 */
657
658         AUDIO_OUTPUT_PROP=36,   /**< this can be used to route PCM audio data onto respective audio output connectors. */
659         AUDIO_CHANNEL_ROUTING=AUDIO_OUTPUT_PROP,
660         AUDIO_INPUT_PROP=37,/**< Use this property to select audio input source that should be used when doing 
661                         an audio capture.
662                         Possible values this property can accept is defined in the enumerator Blue_Audio_Connector_Type.
663                         */
664         VIDEO_ENABLE_LETTERBOX=38,
665         VIDEO_DUALLINK_OUTPUT_INVERT_KEY_COLOR=39,/**< this property is deprecated and no longer supported on epoch/create range of cards.*/
666         VIDEO_DUALLINK_OUTPUT_DEFAULT_KEY_COLOR=40,/**< this property is deprecated and no longer supported on epoch/create range of cards.*/
667         VIDEO_BLACKGENERATOR=41, /**< Use this property to control the black generator on the video output channel.
668                                                          */
669         VIDEO_INPUTFRAMESTORE_IMAGE_ORIENTATION=42,
670         VIDEO_INPUT_SOURCE_SELECTION=43, /**<   The video input source that should be used by the SDK default video input channel 
671                                         can be configured using this property.  
672                                         Possible values this property can accept is defined in the enumerator EBlueConnectorIdentifier.
673                                         */
674         DEFAULT_VIDEO_OUTPUT_CHANNEL=44,
675         DEFAULT_VIDEO_INPUT_CHANNEL=45,
676         VIDEO_REFERENCE_SIGNAL_TIMING=46,
677         EMBEDEDDED_AUDIO_OUTPUT=47, /**< the embedded audio output property can be configured using this property.
678                                         Possible values this property can accept is defined in the enumerator EBlueEmbAudioOutput.
679                                         */
680         EMBEDDED_AUDIO_OUTPUT=EMBEDEDDED_AUDIO_OUTPUT,
681         VIDEO_PLAYBACK_FIFO_FREE_STATUS=48, /**< this will return the number of free buffer in the fifo. 
682                                         If the video engine  is framestore this will give you the number of buffers that the framestore mode 
683                                         can you use with that video output channel.*/
684         VIDEO_IMAGE_WIDTH=49,           /**< only for selective DMA of a smaller image onto video output raster; size in bytes (not pixels) */
685         VIDEO_IMAGE_HEIGHT=50,          /**< only for selective DMA of a smaller image onto video output raster; number of lines */
686         VIDEO_SCALER_MODE=51,
687         AVAIL_AUDIO_INPUT_SAMPLE_COUNT=52,
688         VIDEO_PLAYBACK_FIFO_ENGINE_STATUS=53,   /**< this will return the playback fifo status. The values returned by this property 
689                                                 are defined in the enumerator BlueVideoFifoStatus.
690                                                 */      
691         VIDEO_CAPTURE_FIFO_ENGINE_STATUS=54,    /**< this will return the capture  fifo status. 
692                                                 The values returned by this property are defined in the enumerator BlueVideoFifoStatus.
693                                                 */
694         VIDEO_2K_1556_PANSCAN=55,/**< this property is deprecated and no longer supported on epoch/create range of cards.*/
695         VIDEO_OUTPUT_ENGINE=56, /**< Use this property to set the video engine of the video output channels.
696                                 Possible values this property can accept is defined in the enumerator EEngineMode 
697                                 */
698         VIDEO_INPUT_ENGINE=57, /**< Use this property to set the video engine of the video input channels.
699                                 Possible values this property can accept is defined in the enumerator EEngineMode 
700                                 */
701         BYPASS_RELAY_A_ENABLE=58, /**< use this property to control the bypass relay on SDI A output.*/
702         BYPASS_RELAY_B_ENABLE=59, /**< use this property to control the bypass relay on SDI B output.*/
703         VIDEO_PREMULTIPLIER=60,
704         VIDEO_PLAYBACK_START_TRIGGER_POINT=61, /**< Using this property you can instruct the driver to start the 
705                                                 video playback fifo on a particular video output field count.
706                                                 Normally video playback fifo is started on the next video interrupt after 
707                                                 the video_playback_start call.*/
708         GENLOCK_TIMING=62,
709         VIDEO_IMAGE_PITCH=63,
710         VIDEO_IMAGE_OFFSET=64,
711         VIDEO_INPUT_IMAGE_WIDTH=65,
712         VIDEO_INPUT_IMAGE_HEIGHT=66,
713         VIDEO_INPUT_IMAGE_PITCH=67,
714         VIDEO_INPUT_IMAGE_OFFSET=68,
715         TIMECODE_RP188=69,      /**< this property is deprecated and no longer supported on epoch/create range of cards.*/
716         BOARD_TEMPERATURE=70,/**<This property can be used to retreive the Board temperature, core temperature and 
717                                 RPM of the Fan on epoch/create range of cards.<br/>
718                                 Use the macro's EPOCH_CORE_TEMP ,EPOCH_BOARD_TEMP and EPOCH_FAN_SPEED
719                                 to retireive the respective values from the property.<br/>                                                      
720                                                 */      
721         MR2_ROUTING=71, /**< Use this property to control the MR2 functionlity on epoch range of cards.
722                         Use the following macro with this property.<br/>
723                         1) EPOCH_SET_ROUTING --> for setting the source, destination and link type of the routing connection,<br/>
724                         2) EPOCH_ROUTING_GET_SRC_DATA --> for getting the routing source.<br/>
725                                                         The possible source and destination elements supported by the routing matrix are defined in the 
726                                                         enumerator EEpochRoutingElements.<br/>
727                         */
728         SAVEAS_POWERUP_SETTINGS=72,
729         VIDEO_CAPTURE_AVAIL_BUFFER_COUNT=73, /**< This property will return the number of captured frame avail in the fifo at present.
730                                                 If the video engine  is framestore this will give you the number of buffers that the framestore mode 
731                                                 can you use with that video input channel */
732         EPOCH_APP_WATCHDOG_TIMER=74,/**< Use this property to control the application  watchdog timer functionality. 
733                                         Possible values this property can accept is defined in the enumerator enum_blue_app_watchdog_timer_prop.
734                                 */      
735         EPOCH_RESET_VIDEO_INPUT_FIELDCOUNT=75, /**< Use this property to reset the field count on both the 
736                                                 video channels of the card. You can pass the value that 
737                                                 should be used as starting fieldcount after the reset.
738                                                 This property can be used to keep track  sync between left and right signal 
739                                                 when you are capturing in stereoscopic mode.
740                                         */
741         EPOCH_RS422_PORT_FLAGS=76,/**<  Use this property to set the master/slave property of the RS422 ports.
742                                 Possible values this property can accept is defined in the enumerator enum_blue_rs422_port_flags.
743                                 */
744         EPOCH_DVB_ASI_INPUT_TIMEOUT=77, /**< Current DVB ASI input firmware does not support this property in hardware,
745                                         this is a future addition.
746                                         Use this property to set the timeout  of the DVB ASI input stream. 
747                                         timeout is specified in  milliseconds.If hardware did not get the required no of                
748                                         packets( specified using EPOCH_DVB_ASI_INPUT_LATENCY_PACKET_COUNT)
749                                         within the period specified in the timeout, hardware would generate a video input interrupt
750                                         and it would be safe to read the dvb asi packet from the card.
751                                         */
752         EPOCH_DVB_ASI_INPUT_PACKING_FORMAT=78, /**< Use this property to specify the packing method that should be used 
753                                                 when capturing DVB ASI packets.
754                                                 The possible packing methods are defined in the enumerator enum_blue_dvb_asi_packing_format.*/
755         EPOCH_DVB_ASI_INPUT_LATENCY_PACKET_COUNT=79, /**< Use this property to set  how many asi packets should be captured by the card , before it 
756                                                         notifies the driver of available data using video input interrupt.<br/>
757                                                         */
758         VIDEO_PLAYBACK_FIFO_CURRENT_FRAME_UNIQUEID=80, /**< This property can be used to query the current unique id of 
759                                                         the frame that is being displayed currently by the video output channel. This 
760                                                         property is only usefull in the context of video fifo.<br/>
761                                                         You get a uniqueid when you present a frame using video_playback_present function.
762                                                         Alternative ways to get this information are <br/>
763                                                         1) using blue_wait_video_sync_async , the member current_display_frame_uniqueid contains the same information<br/>
764                                                         2) using wait_video_output_sync function on epoch cards, if 
765                                                         the flag UPD_FMT_FLAG_RETURN_CURRENT_UNIQUEID is appended with 
766                                                         either UPD_FMT_FRAME or UPD_FMT_FIELD , the return value of 
767                                                         the function wait_video_output_sync woukd contain the current display
768                                                         frames uniqueid.<br/>*/
769
770         EPOCH_DVB_ASI_INPUT_GET_PACKET_SIZE = 81,/**< use this property to get the size of each asi transport stream packet
771                                                         (whether it is 188 or 204.*/
772         EPOCH_DVB_ASI_INPUT_PACKET_COUNT = 82,/**< this property would give you the number of packets captured during the last 
773                                                 interrupt time frame. For ASI interrupt is generated if 
774                                                 hardware captured the requested number of packets or it hit the 
775                                                 timeout value
776                                                 */
777         EPOCH_DVB_ASI_INPUT_LIVE_PACKET_COUNT = 83,/**< this property would give you the number of packets that
778                                                 is being captured during the current interrupt time frame. 
779                                                 For ASI interrupt is generated when has hardware captured the 
780                                                 requested number of packets specified using  
781                                                 EPOCH_DVB_ASI_INPUT_LATENCY_PACKET_COUNT property.
782                                                 */
783         EPOCH_DVB_ASI_INPUT_AVAIL_PACKETS_IN_FIFO = 84,/**< This property would return the number of ASI packets 
784                                                         that has been captured into card memory , that
785                                                         can be retreived.
786                                                         This property is only valid when the video input 
787                                                         channel is being used in FIFO modes.
788                                                 */
789         EPOCH_ROUTING_SOURCE_VIDEO_MODE=VIDEO_SCALER_MODE,/**< Use this property to change the video mode that scaler should be set to.
790                                                         USe the macro SET_EPOCH_SCALER_MODE when using this property, as this macro 
791                                                         would allow you to select which one of the scaler blocks video mode should be updated.
792                                                         */
793         EPOCH_AVAIL_VIDEO_SCALER_COUNT=85,/**< This property would return available scaler processing block available on the card.*/
794         EPOCH_ENUM_AVAIL_VIDEO_SCALERS_ID=86,/**< You can enumerate the available scaler processing block available on the card using this property.
795                                         You pass in the index value as input parameter to get the scaler id that should be used.
796                                         Applications are recommended to use this property to query the available scaler id's 
797                                         rather than hardcoding a scaler id. As the scaler id's that you can use would vary based on
798                                         whether you have VPS0 or VPS1 boards loaded on the base board.
799                                         */
800         EPOCH_ALLOCATE_VIDEO_SCALER=87, /**< This is just a helper property for applications who need to use more than one scaler
801                                         and just wants to query the next available scaler from the driver pool, rather than hardcoding 
802                                         each thread to use a particular scaler.
803                                         Allocate a free scaler from the available scaler pool.
804                                         User has got the option to specify whether they want to use the scaler for 
805                                         use with a single link or dual link stream */
806         EPOCH_RELEASE_VIDEO_SCALER=88, /**< Release the previously allocated scaler processing block back to the free pool.
807                                         If the user passes in a value of 0, all the allocated scaler blocks in the driver are released.
808                                         So effectively
809                                         */
810         EPOCH_DMA_CARDMEMORY_PITCH=89,
811         EPOCH_OUTPUT_CHANNEL_AV_OFFSET=90,
812         EPOCH_SCALER_CHANNEL_MUX_MODE=91,
813         EPOCH_INPUT_CHANNEL_AV_OFFSET=92,
814         EPOCH_AUDIOOUTPUT_MANUAL_UCZV_GENERATION=93,/* ASI firmware only */
815         EPOCH_SAMPLE_RATE_CONVERTER_BYPASS=94,
816         EPOCH_GET_PRODUCT_ID=95,                                        /* returns the enum for the firmware type EEpochFirmwareProductID */
817         EPOCH_GENLOCK_IS_LOCKED=96,
818         EPOCH_DVB_ASI_OUTPUT_PACKET_COUNT=97,           /* ASI firmware only */
819         EPOCH_DVB_ASI_OUTPUT_BIT_RATE=98,                       /* ASI firmware only */
820         EPOCH_DVB_ASI_DUPLICATE_OUTPUT_A=99,            /* ASI firmware only */
821         EPOCH_DVB_ASI_DUPLICATE_OUTPUT_B=100,           /* ASI firmware only */
822         EPOCH_SCALER_HORIZONTAL_FLIP=101,                       /* see SideBySide_3D sample application */
823         EPOCH_CONNECTOR_DIRECTION=102,                          /* see application notes */
824         EPOCH_AUDIOOUTPUT_VALIDITY_BITS=103,            /* ASI firmware only */
825         EPOCH_SIZEOF_DRIVER_ALLOCATED_MEMORY=104,       /* video buffer allocated in Kernel space; accessible in userland via system_buffer_map() */
826         INVALID_VIDEO_MODE_FLAG=105,                            /* returns the enum for VID_FMT_INVALID that this SDK/Driver was compiled with;
827                                                                                                 it changed between 5.9.x.x and 5.10.x.x driver branch and has to be handled differently for
828                                                                                                 each driver if the application wants to use the VID_FMT_INVALID flag and support both driver branches */
829         EPOCH_VIDEO_INPUT_VPID=106,                                     /* returns the VPID for the current video input signal */
830         EPOCH_LOW_LATENCY_DMA=107,                                      /* not fully supported yet */
831         EPOCH_VIDEO_INPUT_RGB_DATA_RANGE=108,
832
833         VIDEO_CARDPROPERTY_INVALID=1000
834 }EBlueCardProperty;
835
836
837 typedef enum _EAnalogConnectorSignalType
838 {
839         ANALOG_OUTPUTSIGNAL_CVBS_Y_C=1,
840         ANALOG_OUTPUTSIGNAL_COMPONENT=2,
841         ANALOG_OUTPUTSIGNAL_RGB=4
842 }EAnalogConnectorSignalType;
843
844 /**<
845 @brief Use this enumerator to set the analog video signal types and connectors.
846 */
847 typedef enum _EAnalogInputConnectorType 
848 {
849 /* Composite input */
850         ANALOG_VIDEO_INPUT_CVBS_AIN1=0x00, /**<only available on Mini COAX */
851         ANALOG_VIDEO_INPUT_CVBS_AIN2=0x01, /**<available on both Mini COAX and Mini DIN*/
852         ANALOG_VIDEO_INPUT_CVBS_AIN3=0x02, /**<available on both Mini COAX and Mini DIN*/
853         ANALOG_VIDEO_INPUT_CVBS_AIN4=0x03, /**<only available on Mini COAX */
854         ANALOG_VIDEO_INPUT_CVBS_AIN5=0x04, /**<only available on Mini COAX */
855         ANALOG_VIDEO_INPUT_CVBS_AIN6=0x05, /**<available on both Mini COAX and Mini DIN */
856
857 /*svideo input*/
858 //Y_C is a synonym for svideo
859         ANALOG_VIDEO_INPUT_Y_C_AIN1_AIN4=0x06, /**<only available on Mini COAX*/
860         ANALOG_VIDEO_INPUT_Y_C_AIN2_AIN5=0x07, /**<only available on Mini COAX*/
861         ANALOG_VIDEO_INPUT_Y_C_AIN3_AIN6=0x08, /**<available on both Mini COAX and Mini DIN*/
862
863 /*YUV input*/
864         ANALOG_VIDEO_INPUT_YUV_AIN1_AIN4_AIN5=0x09, /**<only available on Mini COAX*/
865         ANALOG_VIDEO_INPUT_YUV_AIN2_AIN3_AIN6=0x0a, /**<available on both Mini COAX and Mini DIN*/
866         ANALOG_VIDEO_INPUT_USE_SDI_A=0x6F,      
867         ANALOG_VIDEO_INPUT_USE_SDI=0x7F,
868         GENERIC_ANALOG_VIDEO_SOURCE=0x8F,
869         ANALOG_VIDEO_INPUT_USE_SDI_B=ANALOG_VIDEO_INPUT_USE_SDI
870 }EAnalogInputConnectorType;
871
872
873 typedef enum {
874         ANALOG_VIDEO_INPUT_CONNECTOR,//EAnalogInputConnectorType
875         ANALOG_VIDEO_INPUT_PED,
876         ANALOG_VIDEO_INPUT_BRIGHTNESS,
877         ANALOG_VIDEO_INPUT_HUE,
878         ANALOG_VIDEO_INPUT_LUMA_GAIN,
879         ANALOG_VIDEO_INPUT_CHROMA_GAIN,
880         ANALOG_VIDEO_INPUT_AUTO_GAIN,
881         ANALOG_VIDEO_INPUT_LOAD_DEFAULT_SETTING,        
882         ANALOG_VIDEO_OUTPUT_PED,
883         ANALOG_VIDEO_OUTPUT_BRIGHTNESS,
884         ANALOG_VIDEO_OUTPUT_HUE,
885         ANALOG_VIDEO_OUTPUT_LUMA_GAIN,
886         ANALOG_VIDEO_OUTPUT_CHROMA_GAIN,        
887         ANALOG_VIDEO_OUTPUT_SHARPNESS,
888         ANALOG_VIDEO_OUTPUT_AUTO_GAIN,
889         ANALOG_VIDEO_OUTPUT_LOAD_DEFAULT_SETTING,
890         ANALOG_VIDEO_OUTPUT_SIGNAL_TYPE,//_EAnalogConnectorSignalType
891         ANALOG_LOAD_BLUEFISH_DEFAULT_SETTING,
892         ANALOG_SET_AS_POWERUP_SETTINGS,
893         ANALOG_LOAD_POWERUP_SETTINGS,
894         ANALOG_CONNECTOR_STATUS
895 } AnalogCard_Property;
896
897 typedef struct {
898         BLUE_INT32 inputConnector;                      //ANALOG_VIDEO_INPUT_CONNECTOR, EAnalogInputConnectorType
899         BLUE_INT32 inputPed;                            //ANALOG_VIDEO_INPUT_PED,
900         BLUE_INT32 inputBrightness;             //ANALOG_VIDEO_INPUT_BRIGHTNESS,
901         BLUE_INT32 inputHue;                            //ANALOG_VIDEO_INPUT_HUE,
902         BLUE_INT32 inputLumaGain;                       //ANALOG_VIDEO_INPUT_LUMA_GAIN,
903         BLUE_INT32 inputChromaGain;             //ANALOG_VIDEO_INPUT_CHROMA_GAIN,
904         BLUE_INT32 inputAutoGain;                       //ANALOG_VIDEO_INPUT_AUTO_GAIN,
905         BLUE_INT32 outputPed;                           //ANALOG_VIDEO_OUTPUT_PED,
906         BLUE_INT32 outputBrightness;            //ANALOG_VIDEO_OUTPUT_BRIGHTNESS,
907         BLUE_INT32 outputHue;                           //ANALOG_VIDEO_OUTPUT_HUE,
908         BLUE_INT32 outputYGain;                 //ANALOG_VIDEO_OUTPUT_Y_GAIN,
909         BLUE_INT32 outputUGain;                 //ANALOG_VIDEO_OUTPUT_U_GAIN,
910         BLUE_INT32 outputVGain;                 //ANALOG_VIDEO_OUTPUT_V_GAIN,
911         BLUE_INT32 outputSharpness;             //ANALOG_VIDEO_OUTPUT_SHARPNESS,
912         BLUE_INT32 outputAutoGain;                      //ANALOG_VIDEO_OUTPUT_AUTO_GAIN,
913         BLUE_INT32 outputSignalTypes;           //EAnalogConnectorSignalType
914 }AnalogCardState;
915
916 //----------------------------------------------------------------------------------------------------
917 /**< brief Used to determine how video interrupts are handled*/
918 typedef enum _EEngineMode
919 {
920         VIDEO_ENGINE_FRAMESTORE=0,      /**< framestore engine. In this mode user is responsible for 
921                                                                          schduling a capture or playback after waiting for the 
922                                                                          respective video sync;s*/
923         VIDEO_ENGINE_PLAYBACK=1,        /**< Playback engine. In this mode there is a driver FIFO, which 
924                                                                         is reponisble for scheudling a frame for  playback.
925                                                                         User just adds video frames into the fifo.*/
926         VIDEO_ENGINE_CAPTURE=2,         /**< Capture engine  In this mode there is a driver FIFO, which 
927                                                                         is reponisble for scheudling a frame for capture.
928                                                                         User just retreives video frames from the FIFO.*/
929         VIDEO_ENGINE_PAGEFLIP=3,        /**< not supported any more */
930         VIDEO_ENGINE_DUPLEX=4,          /**< Full Duplex video. This is a FIFO mode. Use this mode if you want 
931                                                                 to capture and playback at the same time.*/
932         VIDEO_ENGINE_INVALID
933 } EEngineMode;
934
935 /**< use this enumerator for controlling emb audio output properties using the 
936          property EMBEDDED_AUDIO_OUTPUT.        
937 */
938 typedef enum _EBlueEmbAudioOutput
939 {
940         blue_emb_audio_enable=0x1,      // Switches off/on  the whole HANC output from connecotrs associated with the channel
941         blue_auto_aes_to_emb_audio_encoder=0x2, //control whether the auto aes to emb thread should be running or not.
942         blue_emb_audio_group1_enable=0x4, /**< enables group1(ch 0-  3) emb audio */
943         blue_emb_audio_group2_enable=0x8, /**< enables group2(ch 4-  7) emb audio */
944         blue_emb_audio_group3_enable=0x10, /**< enables group3(ch 8-  11) emb audio */
945         blue_emb_audio_group4_enable=0x20, /**< enables group4(ch 12-  16) emb audio */
946         blue_enable_hanc_timestamp_pkt = 0x40
947 }EBlueEmbAudioOutput;
948
949
950 /**< Not used any more */
951 typedef enum _EBufferTarget
952 {
953         BUFFER_TARGET_VIDEO=0,          // Generic R/W DMA
954         BUFFER_TARGET_AUDIO,            // Special processing required for audio
955         BUFFER_TARGET_VIDEO_8BIT,       // Special R/W DMA utilising 8 bit aperture
956         BUFFER_TARGET_VIDEO_HALF,       // Special R/W DMA every second line (currently unused)
957         BUFFER_TARGET_VIDEO_OUT,        // Updates video out register on DMA completion for write 
958         BUFFER_TARGET_INVALID
959 } EBufferTarget;
960
961 #define BUFFER_TYPE_VIDEO               (0)
962 #define BUFFER_TYPE_AUDIO               (1)
963 #define BUFFER_TYPE_VIDEO_8BIT  (2)     // use this when assigning a buffer to indicate DMA from aperture!
964 #define BUFFER_TYPE_VIDEO_OUT   (3)     // On DMA start set video output address to DMA target
965 #define BUFFER_TYPE_VIDEO_HALF  (4)     // DMA every second line...
966
967 // Buffer identifiers
968 #define BUFFER_ID_AUDIO_IN              (0)
969 #define BUFFER_ID_AUDIO_OUT             (1)
970 #define BUFFER_ID_VIDEO0                (2)
971 #define BUFFER_ID_VIDEO1                (3)
972 #define BUFFER_ID_VIDEO2                (4)
973 #define BUFFER_ID_VIDEO3                (5)
974
975 //#define       BUFFER_ID_USER_BASE             (6)
976
977
978
979 #define VIDEO_BORDER_TOP                (0x10000000)
980 #define VIDEO_BORDER_BOTTOM             (0x20000000)
981 #define VIDEO_BORDER_LEFT               (0x40000000)
982 #define VIDEO_BORDER_RIGHT              (0x80000000)
983
984 typedef struct _AnalogCardPropStruct
985 {
986         BLUE_UINT32 VideoChannel;
987         BLUE_INT32  prop;
988         BLUE_INT32  value;
989         BLUE_INT32  minValue;
990         BLUE_INT32  maxValue;
991         BLUE_INT32  bReadFlag;
992 }AnalogCardPropStruct;
993
994 typedef enum _EConnectorSignalFormatType
995 {
996         Signal_Type_4444 =1,
997         Signal_Type_4224 =0,
998         Signal_Type_422=2
999 }EConnectorSignalFormatType;
1000
1001 typedef enum _EDMADirection
1002 {
1003         DMA_WRITE=0,
1004         DMA_READ=1,
1005         DMA_INVALID=2
1006 }EDMADirection;                 
1007
1008
1009 typedef enum _MatrixColType
1010 {
1011         COL_BLUE_PB=0,
1012         COL_RED_PR=1,
1013         COL_GREEN_Y=2,
1014         COL_KEY=3
1015 }MatrixColType;
1016
1017
1018
1019
1020 /**< Bits defining supported features that can be used with VideoFeature_struct*/
1021 #define VIDEO_CAPS_INPUT_SDI                                    (0x00000001)    /**<  Capable of input of SDI Video */
1022 #define VIDEO_CAPS_OUTPUT_SDI                                   (0x00000002)    /**<  Capable of output of SDI Video */
1023 #define VIDEO_CAPS_INPUT_COMP                                   (0x00000004)    /**<  Capable of capturing Composite Video input */
1024 #define VIDEO_CAPS_OUTPUT_COMP                                  (0x00000008)    /**<  Capable of capturing Composite Video output */
1025
1026 #define VIDEO_CAPS_INPUT_YUV                                    (0x00000010)    /**<  Capable of capturing Component Video input */
1027 #define VIDEO_CAPS_OUTPUT_YUV                                   (0x00000020)    /**<  Capable of capturing Component Video output */
1028 #define VIDEO_CAPS_INPUT_SVIDEO                                 (0x00000040)    /**<  Capable of capturing SVideo input */
1029 #define VIDEO_CAPS_OUTPUT_SVIDEO                                (0x00000080)    /**<  Capable of capturing SVideo output */
1030
1031 #define VIDEO_CAPS_GENLOCK                                              (0x00000100)    /**<  Able to adjust Vert & Horiz timing */
1032 #define VIDEO_CAPS_VERTICAL_FLIP                                (0x00000200)    /**<  Able to flip rasterisation */
1033 #define VIDEO_CAPS_KEY_OUTPUT                                   (0x00000400)    /**<  Video keying output capable */
1034 #define VIDEO_CAPS_4444_OUTPUT                                  (0x00000800)    /**<  Capable of outputting 4444 (dual link) */
1035
1036 #define VIDEO_CAPS_DUALLINK_INPUT                               (0x00001000)    /**<  Dual Link input   */
1037 #define VIDEO_CAPS_INTERNAL_KEYER                               (0x00002000)    /**<  Has got an internal Keyer */
1038 #define VIDEO_CAPS_RGB_COLORSPACE_SDI_CONN              (0x00004000)    /**<  Support RGB colorspace  in on an  SDI connector  */
1039 #define VIDEO_CAPS_HAS_PILLOR_BOX                               (0x00008000)    /**<  Has got support for pillor box */
1040
1041 #define VIDEO_CAPS_OUTPUT_RGB                                   (0x00010000)    /**<  Has Analog RGB output connector  */
1042 #define VIDEO_CAPS_SCALED_RGB                                   (0x00020000)    /**<  Can scale RGB colour space */
1043 #define AUDIO_CAPS_PLAYBACK                                     (0x00040000)    /**<  Has got audio output */
1044 #define AUDIO_CAPS_CAPTURE                                              (0x00080000)
1045
1046 #define VIDEO_CAPS_DOWNCONVERTER                                (0x00100000)
1047 #define VIDEO_CAPS_DUALOUTPUT_422_IND_STREAM    (0x00200000)    /**<  Specifies whether the card supports Dual Indepenedent 422 output streams */
1048 #define VIDEO_CAPS_DUALINPUT_422_IND_STREAM             (0x00400000)    /**<  Specifies whether the card supports Dual Indepenedent 422 input streams */
1049
1050 #define VIDEO_CAPS_VBI_OUTPUT                                   (0x00800000)    /**<  Specifies whether the card supports VBI output */
1051 #define VIDEO_CAPS_VBI_INPUT                                    (0x04000000)    /**<  Specifies whether the card supports VBI input */  
1052
1053 #define VIDEO_CAPS_HANC_OUTPUT                                  (0x02000000)
1054 #define VIDEO_CAPS_HANC_INPUT                                   (0x04000000)
1055
1056 #define VIDEO_CAPS_FOUND_VPS0                                   VIDEO_CAPS_DOWNCONVERTER        /**< specifies whether the VPS0 scaler board was found on the card */
1057 #define VIDEO_CAPS_FOUND_VPS1                                   (0x10000000)                            /**< specifies whether the VPS1 scaler board was found on the card */
1058 #define VIDEO_CAPS_FOUND_VPIO                                   (0x20000000)                            /**< specifies whether the VPIO(DVI daughter board)board was found on the card */
1059
1060 /*
1061 #define VIDEO_CAPS_DUALOUTPUT_422_IND_STREAM    (0x00100000)    // Specifies whether the card supports Dual Indepenedent 422 output streams
1062 #define VIDEO_CAPS_DUALINPUT_422_IND_STREAM             (0x00200000)    // Specifies whether the card supports Dual Indepenedent 422 input streams
1063
1064 #define VIDEO_CAPS_VBI_OUTPUT                                   (0x00400000)
1065 #define VIDEO_CAPS_VBI_INPUT                                    (0x00800000)
1066
1067 #define VIDEO_CAPS_HANC_OUTPUT                                  (0x01000000)
1068 #define VIDEO_CAPS_HANC_INPUT                                   (0x02000000)
1069 */
1070
1071 #define BLUE_CARD_BUFFER_TYPE_OFFSET            (12)
1072 #define BLUE_DMA_DATA_TYPE_OFFSET                       (16)
1073 #define BLUE_DMA_FLAGS_OFFSET                           (20)
1074 #define GetDMACardBufferId(value)                       (value & 0xFFF)
1075 #define GetCardBufferType(value)                        ((value & 0xF000) >> BLUE_CARD_BUFFER_TYPE_OFFSET)
1076 #define GetDMADataType(value)                           ((value & 0xF0000) >> BLUE_DMA_DATA_TYPE_OFFSET)
1077 #define GetDMAFlags(value)                                      ((value & 0xF00000) >> (BLUE_DMA_FLAGS_OFFSET))
1078
1079
1080 #define Blue_DMABuffer(CardBufferType,BufferId,DataType)                ( (((ULONG)DataType&0xF)<<(ULONG)BLUE_DMA_DATA_TYPE_OFFSET)| \
1081                                                                                                                                 ( CardBufferType<<(ULONG)BLUE_CARD_BUFFER_TYPE_OFFSET) | \
1082                                                                                                                                 ( ((ULONG)BufferId&0xFFF)) |0)
1083
1084 #define BlueImage_VBI_DMABuffer(BufferId,DataType)                              ( (((ULONG)DataType&0xF)<<(ULONG)BLUE_DMA_DATA_TYPE_OFFSET)| \
1085                                                                                                                                 ( BLUE_CARDBUFFER_IMAGE_VBI<<(ULONG)BLUE_CARD_BUFFER_TYPE_OFFSET) | \
1086                                                                                                                                 ( ((ULONG)BufferId&0xFFF)) |0)
1087
1088 #define BlueImage_DMABuffer(BufferId,DataType)                                  ( (((ULONG)DataType&0xF)<<(ULONG)BLUE_DMA_DATA_TYPE_OFFSET)| \
1089                                                                                                                                 ( BLUE_CARDBUFFER_IMAGE<<(ULONG)BLUE_CARD_BUFFER_TYPE_OFFSET) | \
1090                                                                                                                                 ( ((ULONG)BufferId&0xFFF)) |0)
1091
1092 #define BlueImage_VBI_HANC_DMABuffer(BufferId,DataType)                 ( (((ULONG)DataType&0xF)<<(ULONG)BLUE_DMA_DATA_TYPE_OFFSET)| \
1093                                                                                                                                 ( BLUE_CARDBUFFER_IMAGE_VBI_HANC<<(ULONG)BLUE_CARD_BUFFER_TYPE_OFFSET) | \
1094                                                                                                                                 ( ((ULONG)BufferId&0xFFF)) |0)
1095
1096 #define BlueImage_HANC_DMABuffer(BufferId,DataType)                             ( (((ULONG)DataType&0xF)<<(ULONG)BLUE_DMA_DATA_TYPE_OFFSET)| \
1097                                                                                                                                 ( BLUE_CARDBUFFER_IMAGE_HANC<<(ULONG)BLUE_CARD_BUFFER_TYPE_OFFSET) | \
1098                                                                                                                                 ( ((ULONG)BufferId&0xFFF)) |0)
1099
1100
1101 #define BlueBuffer(CardBufferType,BufferId)                     (((CardBufferType)<<BLUE_CARD_BUFFER_TYPE_OFFSET)|((BufferId&0xFFF))|0)
1102 #define BlueBuffer_Image_VBI(BufferId)                          (((BLUE_CARDBUFFER_IMAGE_VBI)<<BLUE_CARD_BUFFER_TYPE_OFFSET)|((BufferId&0xFFF))|0)
1103 #define BlueBuffer_Image(BufferId)                                      (((BLUE_CARDBUFFER_IMAGE)<<BLUE_CARD_BUFFER_TYPE_OFFSET)|((BufferId&0xFFF))|0)
1104 #define BlueBuffer_Image_VBI_HANC(BufferId)                     (((BLUE_CARDBUFFER_IMAGE_VBI_HANC)<<BLUE_CARD_BUFFER_TYPE_OFFSET)|((BufferId&0xFFF))|0)
1105 #define BlueBuffer_Image_HANC(BufferId)                         (((BLUE_CARDBUFFER_IMAGE_HANC)<<BLUE_CARD_BUFFER_TYPE_OFFSET)|((BufferId&0xFFF))|0)
1106 #define BlueBuffer_HANC(BufferId)                                       (((BLUE_CARDBUFFER_HANC)<<BLUE_CARD_BUFFER_TYPE_OFFSET)|((BufferId&0xFFF))|0)
1107
1108 #define BYPASS_RELAY_A                                                          (0x00000001) // enable bypass relay channel a when loading driver , only used in linux 
1109 #define BYPASS_RELAY_B                                                          (0x00000002) // enable bypass relay channel a when loading driver , only used in linux 
1110 typedef enum _EDMACardBufferType
1111 {
1112         BLUE_CARDBUFFER_IMAGE=0,
1113         BLUE_CARDBUFFER_IMAGE_VBI_HANC=1,
1114         BLUE_CARDBUFFER_IMAGE_VBI=2,
1115         BLUE_CARDBUFFER_AUDIO_OUT=3,
1116         BLUE_CARDBUFFER_AUDIO_IN=4,
1117         BLUE_CARDBUFFER_HANC=5,
1118         BLUE_CARDBUFFER_IMAGE_HANC=6,
1119         BLUE_CARDBUFFER_INVALID=6
1120 }EDMACardBufferType;
1121
1122 typedef enum _EDMADataType
1123 {
1124         BLUE_DATA_FRAME=0,
1125         BLUE_DATA_IMAGE=0,
1126         BLUE_DATA_FIELD1=1,
1127         BLUE_DATA_FIELD2=2,
1128         BLUE_DATA_VBI=3,
1129         BLUE_DATA_HANC=4,
1130         BLUE_DATA_AUDIO_IN=5,
1131         BLUE_DATA_AUDIO_OUT=6,
1132         BLUE_DATA_FRAME_RDOM=7,
1133         BLUE_DATA_FRAME_STEREO_LEFT=BLUE_DATA_FRAME,
1134         BLUE_DATA_FRAME_STEREO_RIGHT=8,
1135         BLUE_DMADATA_INVALID=9
1136 }EDMADataType;
1137
1138 typedef struct _AUXILLARY_VIDEO_INFO
1139 {
1140         BLUE_UINT32  video_channel_id;
1141         BLUE_UINT32  lVideoMode;
1142         BLUE_UINT32  lUniqueId;
1143         BLUE_UINT32  lInfoType;
1144         BLUE_UINT32  lMemFmt;
1145         BLUE_UINT32  lGpio;
1146         BLUE_UINT64  lLTC;
1147 }Auxillary_Video_Info;
1148
1149
1150 typedef enum _EBlueVideoAuxInfoType
1151 {
1152         BLUE_VIDEO_AUX_MEMFMT_CHANGE=1,
1153         BLUE_VIDEO_AUX_UPDATE_LTC=2,
1154         BLUE_VIDEO_AUX_UPDATE_GPIO=4,
1155         BLUE_VIDEO_AUX_VIDFMT_CHANGE=8,
1156
1157 }EBlueVideoAuxInfoType;
1158 // Max of 4 bits 
1159
1160 #define GET_ANALOG_AUDIO_LEFT_ROUTINGCHANNEL(value)                             (value&0xFF)
1161 #define GET_ANALOG_AUDIO_RIGHT_ROUTINGCHANNEL(value)                    ((value&0xFF00)>>8)
1162 #define SET_ANALOG_AUDIO_ROUTINGCHANNEL(left,right)                             (((right & 0xFF)<<8)|(left & 0xFF))
1163 #define SET_AUDIO_OUTPUT_ROUTINGCHANNEL(output_type,src_channel_id,_output_channel_id) ((1<<31)|((output_type&3)<<29)|((src_channel_id & 0x7F)<<16)|((_output_channel_id &0x3f)<<23))
1164 #define GET_AUDIO_OUTPUT_SRC_CHANNEL_ROUTING(value)                             ((value>>16) & 0x7F)
1165 #define GET_AUDIO_OUTPUT_CHANNEL_ROUTING(value)                                 ((value>>23) & 0x3F)
1166 #define GET_AUDIO_OUTPUT_TYPE_ROUTING(value)                                    ((value & 0x60000000)>>29)
1167
1168 #define AUDIO_INPUT_SOURCE_SELECT_FLAG                                                  (1<<16) 
1169 #define AUDIO_INPUT_SOURCE_SELECT(SynchCount,AudioInputSource)  (AUDIO_INPUT_SOURCE_SELECT_FLAG|(SynchCount)|(AudioInputSource<<17))
1170
1171 struct blue_video_connection_routing_struct
1172 {
1173         BLUE_UINT32 video_channel;
1174         BLUE_UINT32 duallink_flag;
1175         BLUE_UINT32 link1_connector;
1176         BLUE_UINT32 link2_connector;
1177 };
1178
1179 #pragma pack(push, video_sync_struct, 1)
1180 typedef struct _blue_video_sync_struct
1181 {
1182         BLUE_UINT32     sync_wait_type;// field or frame
1183         BLUE_UINT32     video_channel; // which video channel interrupt should the interrupt wait for 
1184         BLUE_UINT32     timeout_video_msc;      //if the current video msc is equal to this one insert it into the queue.
1185         BLUE_UINT32     video_msc;              //current video msc
1186         BLUE_UINT32 current_display_frame_id; // would give you the current frame id which is being displayed
1187         BLUE_UINT32 current_display_frame_uniqueid; // would give you the unique id associated with current frame id which is being displayed
1188                                                                                                 // this is only valid when using fifo modes.
1189         BLUE_UINT8  pad[24];
1190 }blue_video_sync_struct;
1191 #pragma pack(pop,video_sync_struct)
1192
1193
1194 typedef enum _EBlueLUTType
1195 {
1196         BLUE_MAIN_LUT_B_Pb=0,
1197         BLUE_MAIN_LUT_G_Y=1,
1198         BLUE_MAIN_LUT_R_Pr=2,
1199         BLUE_AUX_LUT_B_Pb=3,
1200         BLUE_AUX_LUT_G_Y=4,
1201         BLUE_AUX_LUT_R_Pr=5,
1202 }EBlueLUTType;
1203
1204 #pragma pack(push, video_frame, 1)
1205 struct VideoFeature_struct 
1206 {
1207         BLUE_UINT32  Type;                   // Bluefish card type
1208         BLUE_UINT32  CardSubType;               
1209         BLUE_UINT32  Bus;                    // Which PIC bus (bridge) it is on
1210         BLUE_UINT32  Slot;                   // Which slot card is plugged into
1211         BLUE_UINT32  Feature;                //  Look at  the _EBlueFishCardFeatures  definition to know what each bit mean
1212         BLUE_UINT32  FirmwareVersion;
1213 };
1214
1215 struct blue_videoframe_info
1216 {
1217         BLUE_UINT64 ltcTimeCode;
1218         unsigned long videochannel;
1219         unsigned long BufferId;
1220         unsigned long Count;
1221         unsigned long DroppedFrameCount;
1222 };
1223
1224 struct blue_videoframe_info_ex
1225 {
1226         BLUE_UINT64 ltcTimeCode;                        //LTC timecode
1227         unsigned long videochannel;                     //the channel this frame was captured from
1228         long BufferId;                                          //this buffer contains the captured frame
1229         unsigned long Count;                            //total captured frames
1230         unsigned long DroppedFrameCount;        //dropped frame count
1231         unsigned long nFrameTimeStamp;          //field count the frame was captured at
1232         unsigned long nVideoSignalType;         //video mode of this frame
1233         unsigned int  nASIPktCount;                     //only for DVB-ASI; how many ASI packets are in this frame
1234         unsigned int  nASIPktSize;                      //only for DVB-ASI; how many bytes per packet
1235         unsigned int  nAudioValidityBits;       //part of the channels status block for audio
1236         unsigned char pad[20];                          //not used
1237 };
1238
1239 struct blue_1d_lookup_table_struct
1240 {
1241         BLUE_UINT32 nVideoChannel;
1242         BLUE_UINT32  nLUTId;
1243         BLUE_UINT16 * pLUTData;
1244         BLUE_UINT32  nLUTElementCount;  
1245         BLUE_UINT8      pad[256];
1246 };
1247 #pragma pack(pop, video_frame)
1248
1249 #pragma pack(push, blue_dma_request, 1)
1250 struct blue_dma_request_struct
1251 {
1252         unsigned char * pBuffer;
1253         BLUE_UINT32 video_channel;
1254         BLUE_UINT32     BufferId;
1255         unsigned int BufferDataType;
1256         unsigned int FrameType;
1257         unsigned int BufferSize;
1258         unsigned int Offset;
1259         unsigned long   BytesTransferred;
1260         unsigned char pad[64];
1261 };
1262
1263 enum SerialPort_struct_flags
1264 {
1265         SerialPort_Read=1,
1266         SerialPort_Write=2,
1267         SerialPort_TX_Queue_Status=4,           
1268         SerialPort_RX_Queue_Status=8,
1269         SerialPort_RX_FlushBuffer=16,
1270         SerialPort_RX_IntWait_Return_On_Data=32,
1271         
1272 };
1273
1274 struct SerialPort_struct
1275 {
1276         unsigned char   Buffer[64];
1277         unsigned int    nBufLength;
1278         unsigned int    nSerialPortId;
1279         unsigned int    bFlag; // SerialPort_struct_flags 
1280         unsigned short  sTimeOut; 
1281 };
1282
1283
1284 struct blue_video_scaler_ceofficent
1285 {
1286         BLUE_UINT32 ioctl_read_only_flag;
1287         BLUE_UINT32 nScalerId;
1288         BLUE_UINT32 nScalerFilterType;
1289         BLUE_UINT32 nScalerCoefficentWeight[15];
1290 };
1291
1292 enum blue_video_scaler_param_flags
1293 {
1294         scaler_flags_set_destrect_as_framesize = 0x1,
1295 };
1296
1297 struct blue_video_scaler_param_struct
1298 {
1299         BLUE_UINT32 ioctl_read_only_flag;
1300         BLUE_UINT32 nScalerId;
1301         BLUE_UINT32 nSrcVideoHeight;
1302         BLUE_UINT32 nSrcVideoWidth;
1303         BLUE_UINT32 nSrcVideoYPos;
1304         BLUE_UINT32 nSrcVideoXPos;
1305         BLUE_UINT32 nDestVideoHeight;
1306         BLUE_UINT32 nDestVideoWidth;
1307         BLUE_UINT32 nDestVideoYPos;
1308         BLUE_UINT32 nDestVideoXPos;
1309         BLUE_UINT32 nHScaleFactor;
1310         BLUE_UINT32 nVScaleFactor;
1311         BLUE_UINT32 nScalerOutputVideoMode;
1312         BLUE_UINT32 nScalerParamFlags;
1313         BLUE_UINT32 pad[128];
1314 };
1315 #ifndef EXCLUDE_USERLAND_STRUCT
1316 struct blue_color_matrix_struct{
1317         BLUE_UINT32  VideoChannel;
1318         BLUE_UINT32 MatrixColumn; //MatrixColType enumerator defines this 
1319         double  Coeff_B;
1320         double  Coeff_R;
1321         double  Coeff_G;
1322         double  Coeff_K;
1323         double  const_value;
1324 };
1325 #endif
1326 #pragma pack(pop, blue_dma_request)
1327
1328 typedef enum _blue_output_hanc_ioctl_enum
1329 {
1330         blue_get_output_hanc_buffer=0,
1331         blue_put_output_hanc_buffer=1,
1332         blue_get_valid_silent_hanc_data_status=3,
1333         blue_set_valid_silent_hanc_data_status=4,
1334         blue_start_output_fifo=5,
1335         blue_stop_output_fifo=6,
1336         blue_init_output_fifo=7,
1337         blue_get_queues_info=8,
1338         blue_get_output_fifo_info=blue_get_queues_info,
1339         blue_get_output_fifo_status=9,
1340
1341 }blue_output_hanc_ioctl_enum;
1342
1343 typedef enum _blue_input_hanc_ioctl_enum
1344 {
1345         blue_get_input_hanc_buffer=0,
1346         blue_start_input_fifo=3,
1347         blue_stop_input_fifo=4,
1348         blue_init_input_fifo=5,
1349         blue_playthru_input_fifo=6,
1350         blue_release_input_hanc_buffer=7,
1351         blue_map_input_hanc_buffer=8,
1352         blue_unmap_input_hanc_buffer=9,
1353         blue_get_info_input_hanc_fifo=10,
1354         blue_get_input_rp188=11,
1355         blue_get_input_fifo_status=12,
1356 }blue_input_hanc_ioctl_enum;
1357
1358
1359 #define HANC_PLAYBACK_INIT                              (0x00000001)
1360 #define HANC_PLAYBACK_START                             (0x00000002)
1361 #define HANC_PLAYBACK_STOP                              (0x00000004)
1362
1363 #define HANC_CAPTURE_INIT                               (0x00000010)
1364 #define HANC_CAPTURE_START                              (0x00000020)
1365 #define HANC_CAPTURE_STOP                               (0x00000040)
1366 #define HANC_CAPTURE_PLAYTHRU                   (0x00000080)
1367
1368
1369 typedef enum _EOracFPGAConfigCMD
1370 {
1371         ORAC_FPGA_CONFIG_CMD_ERASE_SECTOR=0,
1372         ORAC_FPGA_CONFIG_CMD_UNLOCK_SECTOR=1,
1373         ORAC_FPGA_CONFIG_CMD_WRITE_DATA=2,
1374         ORAC_FPGA_CONFIG_CMD_STATUS=3,
1375         ORAC_FPGA_CONFIG_CMD_READMODE=4,
1376         ORAC_FPGA_CONFIG_RAW_WRITE=5,
1377         ORAC_FPGA_CONFIG_RAW_READ=6,
1378         ORAC_FPGA_CONFIG_CMD_READ_DATA=7,
1379         ORAC_FPGA_CONFIG_INIT=8,
1380         ORAC_FPGA_CONFIG_EXIT=9
1381 }EOracFPGAConfigCMD;
1382
1383
1384 #define ANALOG_CHANNEL_0 MONO_CHANNEL_9
1385 #define ANALOG_CHANNEL_1 MONO_CHANNEL_10
1386
1387 /*Assumes that the data is in stereo pairs not individual samples*/
1388 #define STEREO_PAIR_1   (MONO_CHANNEL_1|MONO_CHANNEL_2) /* Mono Channel 1 & Mono channel 2* together*/
1389 #define STEREO_PAIR_2   (MONO_CHANNEL_3|MONO_CHANNEL_4) /* Mono Channel 3 & Mono Channel 4* together*/
1390 #define STEREO_PAIR_3   (MONO_CHANNEL_5|MONO_CHANNEL_6) /* Mono Channel 5 & Mono Channel 6* together*/
1391 #define STEREO_PAIR_4   (MONO_CHANNEL_7|MONO_CHANNEL_8) /* Mono Channel 7 & Mono Channel 8* together*/
1392
1393 #define ANALOG_AUDIO_PAIR (ANALOG_CHANNEL_0|ANALOG_CHANNEL_1)
1394
1395 #define BLUE_LITTLE_ENDIAN      0
1396 #define BLUE_BIG_ENDIAN         1
1397
1398 #define GREED_SILENT_HANC_BUFFER1       250
1399 #define GREED_SILENT_HANC_BUFFER2       251
1400
1401 #define AES_SRC_BYPASS_CHANNEL_1_2 0x1
1402 #define AES_SRC_BYPASS_CHANNEL_3_4 0x2
1403 #define AES_SRC_BYPASS_CHANNEL_5_6 0x4
1404 #define AES_SRC_BYPASS_CHANNEL_7_8 0x8
1405
1406 typedef enum _EEpochRoutingElements
1407 {
1408         EPOCH_SRC_DEST_SCALER_0=0x1,
1409         EPOCH_SRC_DEST_SCALER_1,
1410         EPOCH_SRC_DEST_SCALER_2,
1411         EPOCH_SRC_DEST_SCALER_3,
1412
1413         EPOCH_SRC_SDI_INPUT_A,
1414         EPOCH_SRC_SDI_INPUT_B,
1415         EPOCH_SRC_SDI_INPUT_C,
1416         EPOCH_SRC_SDI_INPUT_D,
1417
1418         EPOCH_DEST_SDI_OUTPUT_A,
1419         EPOCH_DEST_SDI_OUTPUT_B,
1420         EPOCH_DEST_SDI_OUTPUT_C,
1421         EPOCH_DEST_SDI_OUTPUT_D,
1422
1423         EPOCH_SRC_OUTPUT_MEM_INTERFACE_CHA,
1424         EPOCH_SRC_OUTPUT_MEM_INTERFACE_CHB,
1425
1426         EPOCH_DEST_INPUT_MEM_INTERFACE_CHA,
1427         EPOCH_DEST_INPUT_MEM_INTERFACE_CHB,
1428
1429         EPOCH_DEST_AES_ANALOG_AUDIO_OUTPUT,
1430
1431         EPOCH_SRC_AV_SIGNAL_GEN,
1432         EPOCH_SRC_DEST_VPIO_SCALER_0,
1433         EPOCH_SRC_DEST_VPIO_SCALER_1,
1434
1435         EPOCH_DEST_VARIVUE_HDMI,
1436
1437         EPOCH_DEST_INPUT_MEM_INTERFACE_CHC,
1438         EPOCH_DEST_INPUT_MEM_INTERFACE_CHD,
1439
1440         EPOCH_SRC_OUTPUT_MEM_INTERFACE_CHC,
1441         EPOCH_SRC_OUTPUT_MEM_INTERFACE_CHD,
1442
1443 }EEpochRoutingElements;
1444
1445
1446
1447 #define VPEnableFieldCountTrigger               ((BLUE_UINT64)1<<63)
1448 #define VPTriggerGetFieldCount(value)   ((BLUE_UINT64)value & 0xFFFFFFFF)
1449
1450 typedef enum _EBlueScalerFilterType
1451 {
1452         BlueScalerHorizontalYFilter=1,
1453         BlueScalerHorizontalCFilter=2,
1454         BlueScalerVerticalYFilter=3,
1455         BlueScalerVerticalCFilter=4,
1456 }EBlueScalerFilterType;
1457
1458
1459
1460 #define SET_EPOCH_SCALER_MODE(scaler_id,video_mode) ((scaler_id <<16)|video_mode)
1461 #define GET_EPOCH_SCALER_MODE(value)                            (value&0xFFFF)
1462 #define GET_EPOCH_SCALER_ID(value)                                      ((value&0xFFFF0000)>>16)
1463
1464
1465 // use these macros for retreiving the temp and fan speed.
1466 // on epoch range of cards.
1467 #define EPOCH_CORE_TEMP(value)                                  (value & 0xFFFF)
1468 #define EPOCH_BOARD_TEMP(value)                                 ((value>>16) & 0xFF)
1469 #define EPOCH_FAN_SPEED(value)                                  ((value>>24) & 0xFF)
1470
1471 /** 
1472         @desc   use these macro for doing the MR2 routing  on epoch range of cards.
1473                         MR2 routing can be controlled using the property MR_ROUTING.
1474 */
1475 #define EPOCH_SET_ROUTING(routing_src,routing_dest,data_link_type) ((routing_src & 0xFF) | ((routing_dest & 0xFF)<<8) | ((data_link_type&0xFFFF)<<16))
1476 #define EPOCH_ROUTING_GET_SRC_DATA(value)               (value & 0xFF)
1477 #define EPOCH_ROUTING_GET_DEST_DATA(value)              ((value>>8) & 0xFF)
1478 #define EPOCH_ROUTING_GET_LINK_TYPE_DATA(value) ((value>>16) & 0xFFFF)
1479
1480 #define GPIO_TX_PORT_A  (1)
1481 #define GPIO_TX_PORT_B  (2)
1482
1483 #define EPOCH_GPIO_TX(port,value)       (port<<16|value) // if want to set each of the GPO 
1484                                                                                                         // ports individually you should use this macro.
1485                                                                                                         // without the macro it would set both the GPO
1486                                                                                                         // ports on the card
1487
1488 /**
1489         @desc   use these macros for controlling epoch application watch dog settings.
1490                         The card property EPOCH_APP_WATCHDOG_TIMER can be used to control 
1491                         the watchdog timer functionality.
1492 */
1493 enum enum_blue_app_watchdog_timer_prop
1494 {
1495         enum_blue_app_watchdog_timer_start_stop=(1<<31),                        // can be used to enable/disable timer 
1496         enum_blue_app_watchdog_timer_keepalive=(1<<30),                         // can be used to reset the timer value
1497         enum_blue_app_watchdog_timer_get_present_time=(1<<29),          // can query to get the value of the timer
1498         enum_blue_app_watchdog_get_timer_activated_status=(1<<28),      // can query to get whether the timer has been activated
1499         enum_blue_app_watchdog_get_timer_start_stop_status=(1<<27),     // can query whether the timer has been set.
1500         enum_blue_app_watchdog_enable_gpo_on_active=(1<<26), // using this enumerator you can tell the system that when 
1501                                                                                                                 // application watchdog timer has expired whether a GPO output should be triggered or not.
1502                                                                                                                 // you can use also use this  enumerator  to select
1503                                                                                                                 // which GPO output should be triggered with this. to use GPO port A pass a value of 
1504                                                                                                                 // GPIO_TX_PORT_A when this enumerator is used.
1505         enum_blue_hardware_watchdog_enable_gpo=(1<<25) // can be used to enable/disable GPO trigger when hardware watchdog timer has been 
1506                                                                                                         // triggered
1507 };
1508
1509 #define EPOCH_WATCHDOG_TIMER_SET_MACRO(prop,value) (prop|(value &0xFFFF))
1510 #define EPOCH_WATCHDOG_TIMER_QUERY_MACRO(prop) (prop)
1511 #define EPOCH_WATCHDOG_TIMER_GET_VALUE_MACRO(value) (value&0xFFFF)
1512
1513 enum enum_blue_rs422_port_flags
1514 {
1515         enum_blue_rs422_port_set_as_slave =(1<<0) // If this flag is set the RS422 port would be set to slave mode.
1516                                                                                           // by default port is setup to work in master mode , where it would be acting 
1517                                                                                           // as master in the transactions.                                                                                       
1518 };
1519 #define EPOCH_RS422_PORT_FLAG_SET_MACRO(portid,value)   ((portid&0x3)|(value<<3))
1520 #define EPOCH_RS422_PORT_FLAG_GET_FLAG_MACRO(value)             ((value>>3)&0xFFFF)
1521 #define EPOCH_RS422_PORT_FLAG_GET_PORTID_MACRO(value)   (value&0x3)
1522
1523
1524 enum enum_blue_dvb_asi_packing_format
1525 {
1526         enum_blue_dvb_asi_packed_format=1,/**< In this packing method the asi packets are stored as 188 or 204 bytes*/
1527         enum_blue_dvb_asi_packed_format_with_timestamp=2,/**< In this packing method the asi packets are stored as (8+188) or (8+204) bytes
1528                                                                                                                         The timestamp is stored at the begininig of the packet , using 8 bytes*/
1529         enum_blue_dvb_asi_256byte_container_format=3,
1530         enum_blue_dvb_asi_256byte_container_format_with_timestamp=4
1531 };
1532
1533
1534 #define RS422_SERIALPORT_FLAG(timeout,port,RxFlushBuffer) (((unsigned long)(timeout)<<16)|(port & 0x3) | (RxFlushBuffer<<15))
1535 // use this macro with Wait_For_SerialPort_InputData,
1536 // if you you want the  function to return 
1537 // immediatelty when it gets byte in the serial RX port.
1538 #define RS422_SERIALPORT_FLAG2(timeout,port,RxFlushBuffer,RXIntWaitReturnOnAvailData) (((unsigned long)(timeout)<<16)|(port & 0x3) | (RxFlushBuffer<<15)|(RXIntWaitReturnOnAvailData<<14))
1539
1540 typedef enum _blue_blackgenerator_status
1541 {
1542         ENUM_BLACKGENERATOR_OFF =       0,      //producing normal video output
1543         ENUM_BLACKGENERATOR_ON =        1,      //producing black video output
1544         ENUM_BLACKGENERATOR_SDI_SYNC_OFF =      2       //no valid SDI signal is coming out of our SDI output connector; only available in Epoch ASI firmware
1545 }blue_blackgenerator_status;