]> git.sesse.net Git - casparcg/blob - dependencies64/bluefish/include/BlueVelvet.h
Modifications to the files within the Bluefish module.
[casparcg] / dependencies64 / bluefish / include / BlueVelvet.h
1 /*
2 // ==========================================================================
3 //      Bluefish444 BlueVelvet SDK library
4 //
5 //  BlueVelvet.h
6 //  Public Header
7 //
8 //  developed by  : Cameron Duffy   (C) 2002 Bluefish444 P/L
9 //
10 //  derived from work begun by Vizrt Austria (C) 2001.
11 //
12 // ==========================================================================
13
14   $Id: BlueVelvet.h,v 1.32.8.1 2011/08/04 03:34:36 tim Exp $
15 */
16 #ifndef _BLUEVELVET_H
17 #define _BLUEVELVET_H
18
19 #ifdef BLUEFISH_EXPORTS
20 #define BLUEFISH_API __declspec(dllexport)
21 #else
22 #define BLUEFISH_API __declspec(dllimport)
23 #endif
24
25 //#include "BlueVelvet_c.h"
26
27 #define BLUE_UINT32     unsigned int 
28 #define BLUE_INT32      int 
29 #define BLUE_UINT8      unsigned char
30 #define BLUE_INT8       char
31 #define BLUE_UINT16     unsigned short
32 #define BLUE_INT16      short
33 #define BLUE_UINT64     unsigned __int64
34
35
36 #ifndef BLUEVELVET_2_DLL
37 #define BLUEVELVET_SDK_VERSION3
38 #endif
39
40 #include "BlueDriver_p.h"
41
42
43 //----------------------------------------------------------------------------
44 // Some simple macros and definitions
45 #define BLUEVELVET_MAX_DEVICES  (5)                     // Maximum number of Blue Cards recognised by driver
46
47 typedef int BErr;
48
49 #define BLUE_OK(a)                              (!a)            // Test for succcess of a method returning BErr
50 #define BLUE_FAIL(a)                    (a)                     // Test for failure of a method returning BErr
51 #define BLUE_PASS(a)                    (a>=0)          // Use this where +ve return values still indicate success
52
53
54 //----------------------------------------------------------------------------
55 // The class definition
56 class BLUEFISH_API CBlueVelvet
57 {
58 public:
59         //      4.1             Startup Functions
60         //---------------------------------
61         //      4.1.1   device_enumerate
62         //                      Counts accessible blue cards in target system. 
63         virtual
64         BErr    device_enumerate(
65                                         int& Devices
66                                         ) = 0;
67
68         //      4.1.2   device_attach
69         //                      Attach the class instance to the indexed device. 
70         virtual
71         BErr    device_attach(
72                                         int                     DeviceId,
73                                         int                     do_audio        // DEPRECATED; SET TO 0
74                                         ) = 0;
75
76         //      4.1.3   device_detach
77         //                      Detach the current device from the class instance.
78         virtual
79         BErr    device_detach(
80                                         void
81                                         ) = 0;
82
83         //      4.1.4   device_attach_audio
84         //                      Attach the class instance to the audio I/O component of the current device.
85         // DEPRECATED; DO NOT USE!
86         virtual
87         BErr    device_attach_audio(
88                                         void
89                                         ) = 0;
90
91         //      4.1.5   device_detach_audio
92         //                      Remove audio I/O components of the current device from the class instance.
93         // DEPRECATED; DO NOT USE!
94         virtual
95         BErr    device_detach_audio(
96                                         void
97                                         ) = 0;
98
99         //      4.1.6   device_attach_audio_in
100         //                      Attach the class instance to the audio IINPUT component of the current device.
101         // DEPRECATED; DO NOT USE!
102         virtual
103         BErr    device_attach_audio_in(
104                                         void
105                                         ) = 0;
106
107         //      4.1.7   device_detach_audio_in
108         //                      Remove audio INPUT component of the current device from the class instance.
109         // DEPRECATED; DO NOT USE!
110         virtual
111         BErr    device_detach_audio_in(
112                                         void
113                                         ) = 0;
114
115         //      4.1.8   device_attach_audio_out
116         //                      Attach the class instance to the audio OUTPUT component of the current device.
117         // DEPRECATED; DO NOT USE!
118         virtual
119         BErr    device_attach_audio_out(
120                                         void
121                                         ) = 0;
122
123         //      4.1.9   device_detach_audio_out
124         //                      Remove audio OUTPUT component of the current device from the class instance. 
125         // DEPRECATED; DO NOT USE!
126     virtual
127         BErr    device_detach_audio_out(
128                                         void
129                                         ) = 0;
130
131         //      4.1.10  device_get_bar
132         //                      Get device Bar assets from driver
133     virtual
134         BErr    device_get_bar(
135                                         unsigned long   BarN,
136                                         void**                  ppAddress,
137                                         unsigned long&  Length
138                                         ) = 0;
139
140
141
142         //      4.2             Feature Assessment Functions
143         //---------------------------------
144         //      4.2.1   has_timing_adjust
145         virtual
146         int             has_timing_adjust(
147                                         int     DeviceId=0
148                                         ) = 0;
149
150         //      4.2.2   has_vertical_flip
151         virtual
152         int             has_vertical_flip(
153                                         int     DeviceId=0
154                                         ) = 0;
155
156         //      4.2.3   has_half_res
157         virtual
158         int             has_half_res(
159                                         int     DeviceId=0
160                                         ) = 0;
161
162         //      4.2.4   has_dissolve
163         virtual
164         int             has_dissolve(
165                                         int     DeviceId=0
166                                         ) = 0;
167
168         //      4.2.5   has_aperture
169         virtual
170         int             has_aperture(
171                                         int     DeviceId=0
172                                         ) = 0;
173
174         //      4.2.6   has_input_sdi
175         virtual
176         int             has_input_sdi(
177                                         int     DeviceId=0
178                                         ) = 0;
179
180         //      4.2.7   has_output_sdi
181         virtual
182         int             has_output_sdi(
183                                         int     DeviceId=0
184                                         ) = 0;
185
186         //      4.2.8   has_input_composite
187         virtual
188         int             has_input_composite(
189                                         int     DeviceId=0
190                                         ) = 0;
191
192         //      4.2.9   has_output_composite
193         virtual
194         int             has_output_composite(
195                                         int     DeviceId=0
196                                         ) = 0;
197
198         //      4.2.10  has_input_yuv
199         virtual
200         int             has_input_yuv(
201                                         int     DeviceId=0
202                                         ) = 0;
203
204         //      4.2.11  has_output_yuv
205         virtual
206         int             has_output_yuv(
207                                         int     DeviceId=0
208                                         ) = 0;
209
210         //      4.2.12  has_output_rgb
211         virtual
212         int             has_output_rgb(
213                                         int     DeviceId=0
214                                         ) = 0;
215
216         //      4.2.13  has_input_svideo
217         virtual
218         int             has_input_svideo(
219                                         int     DeviceId=0
220                                         ) = 0;
221
222         //      4.2.14  has_output_svideo
223         virtual
224         int             has_output_svideo(
225                                         int     DeviceId=0
226                                         ) = 0;
227
228         //      4.2.15  has_output_key
229         virtual
230         int             has_output_key(
231                                         int     DeviceId=0
232                                         ) = 0;
233
234         //      4.2.16  has_output_key_v4444
235         virtual
236         int             has_output_key_v4444(
237                                         int     DeviceId=0
238                                         ) = 0;
239
240         //      4.2.17  has_letterbox
241         virtual
242         int             has_letterbox(
243                                         int     DeviceId=0
244                                         ) = 0;
245
246         //      4.2.18  has_video_memory
247         virtual
248         int             has_video_memory(
249                                         int     DeviceId=0
250                                         ) = 0;
251
252         //      4.2.18  has_video_memory_base
253         virtual
254         int             has_video_memory_base(
255                                         int     DeviceId=0
256                                         ) = 0;
257
258         //      4.2.19  has_video_cardtype
259         virtual
260         int             has_video_cardtype(
261                                         int     DeviceId=0
262                                         ) = 0;
263
264         //      4.2.20  count_video_mode
265         virtual
266         int             count_video_mode(
267                                         int     DeviceId=0
268                                         ) = 0;
269
270         //      4.2.21  enum_video_mode
271         virtual
272         EVideoMode enum_video_mode(
273                                         int Index,
274                                         int     DeviceId=0
275                                         ) = 0;
276
277         //      4.2.22  count_memory_format
278         virtual
279         int             count_memory_format(
280                                         int     DeviceId=0
281                                         ) = 0;
282
283         //      4.2.23  enum_memory_format
284         virtual
285         EMemoryFormat enum_memory_format(
286                                         int     Index,
287                                         int     DeviceId=0
288                                         ) = 0;
289
290         //      4.2.24  count_update_method
291         virtual
292         int             count_update_method (
293                                         int     DeviceId=0
294                                         ) = 0;
295
296         //      4.2.25  enum_update_method
297         virtual
298         EUpdateMethod enum_update_method(
299                                         int     Index,
300                                         int     DeviceId=0
301                                         ) = 0;
302
303         //      4.2.26  has_audio_input
304         virtual
305         int             has_audio_input(
306                                         int     DeviceId=0
307                                         ) = 0;
308
309         //      4.2.27  has_audio_output
310         virtual
311         int             has_audio_output(
312                                         int     DeviceId=0
313                                         ) = 0;
314
315         //      4.2.28  count_audio_input_rate
316         virtual
317         int             count_audio_input_rate(
318                                         int     DeviceId=0
319                                         ) = 0;
320
321         //      4.2.29  count_audio_output_rate
322         virtual
323         int             count_audio_output_rate(
324                                         int     DeviceId=0
325                                         ) = 0;
326
327         //      4.2.30  enum_audio_input_rate
328         //                      Returns the enumeration for the Ith supported audio input rate.
329         virtual
330         EAudioRate enum_audio_input_rate(
331                                         int     Index,
332                                         int     DeviceId=0
333                                         ) = 0;
334
335         //      4.2.31  enum_audio_output_rate
336         //                      Returns the enumeration for the Ith supported audio output rate.
337         virtual
338         EAudioRate enum_audio_output_rate(
339                                         int     Index,
340                                         int     DeviceId=0
341                                         ) = 0;
342
343
344         //      4.2.32  has_audio_playthru
345         virtual
346         int             has_audio_playthru(
347                                         int     DeviceId=0
348                                         ) = 0;
349
350         //      4.2.33  has_dma_control
351         virtual
352         int             has_dma_control(
353                                         int     DeviceId=0
354                                         ) = 0;
355
356         //      4.2.34  has_scaled_rgb
357         virtual
358         int             has_scaled_rgb(
359                                         int     DeviceId=0
360                                         ) = 0;
361
362         //      4.3     Control Functions
363         //---------------------------------
364         //      4.3.1   set_timing_adjust
365         //                      Determines the video format of a signal applied to the Link A input. 
366         virtual
367         BErr    set_timing_adjust(
368                                         unsigned int    HPhase,
369                                         unsigned int    VPhase
370                                         ) = 0;
371
372         //      4.3.2   set_vertical_flip
373         virtual
374         BErr    set_vertical_flip(
375                                         int&    On
376                                         ) = 0;
377
378         //      4.3.3   set_output_key
379         virtual
380         BErr    set_output_key(
381                                         int&    On,
382                                         int&    v4444,
383                                         int&    Invert,
384                                         int&    White
385                                         ) = 0;
386
387         //      4.3.4   set_output_key_on
388         virtual
389         BErr    set_output_key_on(
390                                         int&    On
391                                         ) = 0;
392
393         //      4.3.5   set_output_key_v4444
394         virtual
395         BErr    set_output_key_v4444(
396                                         int&    v4444
397                                         ) = 0;
398
399         //      4.3.6   set_output_key_invert
400         virtual
401         BErr    set_output_key_invert(
402                                         int&    Invert
403                                         ) = 0;
404
405         //      4.3.7   set_output_key_white
406         virtual
407         BErr    set_output_key_white(
408                                         int&    White
409                                         ) = 0;
410
411         //      4.3.8   set_letterbox
412         virtual
413         BErr    set_letterbox(
414                                         unsigned int&   Lines,
415                                         int&                    Black
416                                         ) = 0;
417
418         //      4.3.9   set_letterbox_lines
419         virtual
420         BErr    set_letterbox_lines(
421                                         unsigned int&   Lines
422                                         ) = 0;
423
424         //      4.3.10  set_letterbox_black
425         virtual
426         BErr    set_letterbox_black(
427                                         int&                    Black
428                                         ) = 0;
429
430         //      4.3.11  set_safearea
431         virtual
432         BErr    set_safearea(
433                                         int&                    Title,
434                                         int&                    Picture
435                                         ) = 0;
436
437         //      4.3.12  set_safearea_title
438         virtual
439         BErr    set_safearea_title(
440                                         int&                    Title
441                                         ) = 0;
442
443         //      4.3.13  set_safearea_picture
444         virtual
445         BErr    set_safearea_picture(
446                                         int&                    Picture
447                                         ) = 0;
448
449         //      4.3.14  set_output_video
450         virtual
451         BErr    set_output_video(
452                                         int&                    Enable
453                                         ) = 0;
454
455         //      4.3.15  set_audio_rate
456         virtual
457         BErr    set_audio_rate(
458                                         unsigned long&  Rate
459                                         ) = 0;
460
461         //      4.3.16  set_audio_playthrough
462         virtual
463         BErr    set_audio_playthrough(
464                                         int&                    Playthru
465                                         ) = 0;
466
467         //      4.3.17  wait_output_video_synch
468         virtual
469         BErr    wait_output_video_synch(
470                                         unsigned long   UpdFmt,
471                                         unsigned long&  FieldCount
472                                         ) = 0;
473
474         //      4.3.18  get_output_video_synch_count
475         virtual
476         BErr    get_output_video_synch_count(
477                                         unsigned long&  FieldCount
478                                         ) = 0;
479
480         //      4.3.19  set_scaled_rgb
481         virtual
482         BErr    set_scaled_rgb(
483                                         unsigned long&  On
484                                         ) = 0;
485
486         //      4.3.20  wait_pci_interrupt
487         virtual
488         BErr    wait_pci_interrupt(
489                                         unsigned long   Wait
490                                         ) = 0;
491
492         //      4.3.21  get_audio_rate
493         virtual
494         BErr    get_audio_rate(
495                                         unsigned long&  Rate
496                                         ) = 0;
497
498         //      4.3.22  wait_input_video_synch
499         virtual
500         BErr    wait_input_video_synch(
501                                         unsigned long   UpdFmt,
502                                         unsigned long&  FieldCount
503                                         ) = 0;
504
505         //      4.3.23  get_input_video_synch_count
506         virtual
507         BErr    get_input_video_synch_count(
508                                         unsigned long&  FieldCount
509                                         ) = 0;
510
511
512         //      4.4             Video STYLE Functions
513         //---------------------------------
514         //      4.4.1   get_video_input_format
515         //                      Determines the video format of a signal applied to the Link A input. 
516         virtual
517         BErr    get_video_input_format(
518                                         unsigned long&  VidFmt
519                                         ) = 0;
520
521         //      4.4.2   get_video_genlock_format
522         //                      Determines the video format of a signal applied to the GENLOCK input. 
523         virtual
524         BErr    get_video_genlock_format(
525                                         unsigned long&  VidFmt
526                                         ) = 0;
527
528         //      4.4.3   get_video_output_format
529         //                      Determines the video format of the output signal. 
530         virtual
531         BErr    get_video_output_format(
532                                         unsigned long&  VidFmt
533                                         ) = 0;
534
535         //      4.4.4   set_video_output_format
536         //                      Changes the output signal video format of Link A output. 
537         virtual
538         BErr    set_video_output_format(
539                                         unsigned long&  VidFmt
540                                         ) = 0;
541
542         //      4.4.5   get_video_memory_format
543         //                      Determines the pixel format for blue card video buffers. 
544         virtual
545         BErr    get_video_memory_format(
546                                         unsigned long&  MemFmt
547                                         ) = 0;
548
549         //      4.4.6   set_video_memory_format
550         //                      Changes the pixel format for blue card video buffers. 
551         virtual
552         BErr    set_video_memory_format(
553                                         unsigned long&  MemFmt
554                                         ) = 0;
555
556         //      4.4.7   get_video_update_format
557         //                      Determines the update synchronisation style of the video buffers. 
558         virtual
559         BErr    get_video_update_format(
560                                         unsigned long&  UpdFmt
561                                         ) = 0;
562
563         //      4.4.8   set_video_update_format
564         //                      Changes the video synchronisation method. 
565         virtual
566         BErr    set_video_update_format(
567                                         unsigned long&  UpdFmt
568                                         ) = 0;
569         //      4.4.9   get_video_zoom_format
570         //                      Determines the video resolution style of the video buffers. 
571         virtual
572         BErr    get_video_zoom_format(
573                                         unsigned long&  ResFmt
574                                         ) = 0;
575
576         //      4.4.10  set_video_zoom_format
577         //                      Changes the video resolution style of the video buffers. 
578         virtual
579         BErr    set_video_zoom_format(
580                                         unsigned long&  ResFmt
581                                         ) = 0;
582         //      4.4.11  get_video_framestore_style
583         //                      Determines the video mode, memory format and update synchronisation
584         //                      styles of the blue card video buffers. 
585         virtual
586         BErr    get_video_framestore_style(
587                                         unsigned long&  VidFmt,
588                                         unsigned long&  MemFmt,
589                                         unsigned long&  UpdFmt,
590                                         unsigned long&  ResFmt
591                                         ) = 0;
592
593         //      4.4.12  set_video_framestore_style
594         //                      Changes the video mode, memory format and update synchronisation styles. 
595         virtual
596         BErr    set_video_framestore_style(
597                                         unsigned long&  VidFmt,
598                                         unsigned long&  MemFmt,
599                                         unsigned long&  UpdFmt,
600                                         unsigned long&  ResFmt
601                                         ) = 0;
602
603         //      4.4.13  get_video_engine
604         //                              Instruct the device driver to change the operational mode of the
605         //                              video engine. 
606         virtual
607         BErr    get_video_engine(
608                                         unsigned long&  Mode
609                                         ) = 0;
610
611         //      4.4.14  set_video_engine
612         //                              Instruct the device driver to change the operational mode of the
613         //                              video engine. 
614         virtual
615         BErr    set_video_engine(
616                                         unsigned long&  Mode
617                                         ) = 0;
618
619         
620         //      4.5             DMA Memory Functions
621         //---------------------------------
622         //      4.5.1   system_buffer_map
623         //                      Obtains the virtual address of one of the driver managed system buffers. 
624         virtual
625         BErr    system_buffer_map(
626                                         void**  ppAddress,
627                                         int             BufferId
628                                         ) = 0;
629
630         //      4.5.2   system_buffer_unmap
631         //                      Unmaps the virtual address of one of the driver managed system buffers
632         //                      from the process address space. 
633         virtual
634         BErr    system_buffer_unmap(
635                                         void*           pAddress
636                                         ) = 0;
637
638         //      4.5.3   system_buffer_assign
639         //                      Assign an arbitrary usermode buffer to a particular DMA function. 
640         virtual
641         BErr    system_buffer_assign(
642                                         void*                   pAddress,
643                                         unsigned long   Id,
644                                         unsigned long   Length,
645                                         unsigned long   Target
646                                         ) = 0;
647
648         //      4.5.4   system_buffer_write
649         //                      Instructs the DMA engine to begin a DMA write operation to the
650         //                      active blue card host buffer. 
651         // DEPRECATED; DO NOT USE! USE system_buffer_write_async() instead
652         virtual
653         int             system_buffer_write(
654                                         unsigned char*          pPixels,
655                                         unsigned long           Size,
656                                         unsigned long           Offset=0
657                                         ) = 0;
658
659         //      4.5.5   system_buffer_read
660         //                      Instructs the DMA engine to begin a DMA read operation from the
661         //                      active blue card host buffer. 
662         // DEPRECATED; DO NOT USE! USE system_buffer_read_async() instead
663         virtual
664         int             system_buffer_read(
665                                         unsigned char*          pPixels,
666                                         unsigned long           Size,
667                                         unsigned long           Offset=0
668                                         ) = 0;
669
670         virtual
671         int             system_buffer_write_async(
672                                         unsigned char*          pPixels,
673                                         unsigned long           Size,
674                                         OVERLAPPED                      * pAsync,
675                                         unsigned long           BufferID,
676                                         unsigned long           Offset=0
677                                         ) = 0;
678
679         //      4.5.5   system_buffer_read
680         //                      Instructs the DMA engine to begin a DMA read operation from the
681         //                      active blue card host buffer. 
682         virtual
683         int             system_buffer_read_async(
684                                         unsigned char*          pPixels,
685                                         unsigned long           Size,
686                                         OVERLAPPED                      * pAsync,
687                                         unsigned long           BufferID,
688                                         unsigned long           Offset=0
689                                         ) = 0;
690
691
692         //      4.6             Framestore Functions
693         //---------------------------------
694         //      4.6.1   render_buffer_count
695         //                      Determines the number of buffers the blue card memory has been partitioned into. 
696         virtual
697         BErr    render_buffer_count(
698                                         unsigned long&          Count
699                                         ) = 0;
700
701         //      4.6.2   render_buffer_update
702         //                      Instructs the video digitiser to select a blue card buffer to rasterise. 
703         virtual
704         BErr    render_buffer_update(
705                                         unsigned long           BufferId
706                                         ) = 0;
707
708         //      4.6.3   render_buffer_update_b
709         //                      Instructs the video digitiser to select a blue card buffer as the video
710         //                      channel B source for real-time dissolves. 
711         virtual
712         BErr    render_buffer_update_b(
713                                         unsigned long           BufferId
714                                         ) = 0;
715
716         //      4.6.4   render_buffer_dissolve
717         //                      Set the percentage of Channel A over Channel B for real-time dissolve. 
718         virtual
719         BErr    render_buffer_dissolve(
720                                         unsigned long           Dissolve
721                                         ) = 0;
722
723         //      4.6.5   render_buffer_dissolve_a_b
724         //                      Set the video source for Channel A and Channel B and the dissolve
725         //                      percentage between them. 
726         virtual
727         BErr    render_buffer_dissolve_a_b(
728                                         unsigned long           BufferId_A,
729                                         unsigned long           BufferId_B,
730                                         unsigned long           Dissolve
731                                         ) = 0;
732
733         //      4.6.6   render_buffer_map
734         //                      Get the virtual address of the indexed blue card buffer. 
735         virtual
736         BErr    render_buffer_map(
737                                         void**                  pAddress,
738                                         unsigned long   BufferId
739                                         ) = 0;
740
741         //      4.6.7   render_buffer_map_aperture
742         //                      Get the virtual address of the 8-bit aperture for the indexed blue card buffer. 
743         virtual
744         BErr    render_buffer_map_aperture(
745                                         void**                  pAddress,
746                                         unsigned long   BufferId
747                                         ) = 0;
748
749         //      4.6.8   render_buffer_map_all
750         //                      Generates a table of the virtual addresses for all blue card buffers. 
751         virtual
752         BErr    render_buffer_map_all(
753                                         void**                  pTable,
754                                         unsigned long&  Count
755                                         ) = 0;
756
757
758         //      4.6.9   render_buffer_map_aperture_all
759         //                      Generates a table of the virtual addresses for the 8-bit aperture
760         //                      of all blue card buffers. 
761         virtual
762         BErr    render_buffer_map_aperture_all(
763                                         void**                  pTable,
764                                         unsigned long&  Count
765                                         ) = 0;
766
767         //      4.6.10  render_buffer_select
768         //                      Specify which blue card buffer will become the target of future DMA transactions. 
769         virtual
770         BErr    render_buffer_select(
771                                         unsigned long   BufferId
772                                         ) = 0;
773
774         //      4.6.11  render_buffer_capture
775         //                      Specify which blue card buffer will be used for capture. 
776         virtual
777         BErr    render_buffer_capture(
778                                         unsigned long   BufferId,
779                                         int                             On
780                                         ) = 0;
781
782         //      4.6.12  render_buffer_sizeof
783         //                      Determine the maximum byte size of each blue card memory partition. 
784         virtual
785         BErr    render_buffer_sizeof(
786                                         unsigned long&  Count,
787                                         unsigned long&  Length,
788                                         unsigned long&  Actual,
789                                         unsigned long&  Golden
790                                         ) = 0;
791
792         //      4.6.13  render_buffer_quantise
793         //                      Control whether blue card memory is repartitioned on style changes. 
794         virtual
795         BErr    render_buffer_quantise(
796                                         int             On
797                                         ) = 0;
798
799         //      4.7     Audio Functions
800         //---------------------------------
801         //      4.7.1   audio_playback_start
802         //                      Start audio playback. 
803         // DEPRECATED; DO NOT USE!
804         virtual
805         BErr    audio_playback_start(
806                                         unsigned long   Synch
807                                         ) = 0;
808
809         //      4.7.2   audio_playback_stop
810         //                      Stop audio playback. 
811         // DEPRECATED; DO NOT USE!
812         virtual
813         BErr    audio_playback_stop(
814                                         void
815                                         ) = 0;
816
817         //      4.7.3   audio_playback_stream
818         //                      Register a native interleaved audio file for playback. 
819         // DEPRECATED; DO NOT USE!
820         virtual
821         BErr    audio_playback_stream(
822                                         char*           pName,
823                                         int                     Offset,
824                                         int                     Flags
825                                         ) = 0;
826
827         //      4.7.4   audio_playback_stream_mono
828         //                      Register a native monophonic audio file for playback. 
829         // DEPRECATED; DO NOT USE!
830         virtual
831         BErr    audio_playback_stream_mono(
832                                         unsigned long   Chan,
833                                         char*                   pName,
834                                         int                             Offset,
835                                         int                             Flags
836                                         ) = 0;
837
838         //      4.7.5   audio_playback_stream_stereo
839         //                      Register a native stereophonic audio file for playback. 
840         // DEPRECATED; DO NOT USE!
841         virtual
842         BErr    audio_playback_stream_stereo(
843                                         unsigned long   Pair,
844                                         char*                   pName,
845                                         int                             Offset,
846                                         int                             Flags
847                                         ) = 0;
848
849         //      4.7.6   audio_playback_buffer
850         //                      Register a native 6-channel interleaved audio buffer for playback. 
851         // DEPRECATED; DO NOT USE!
852         virtual
853         BErr    audio_playback_buffer(
854                                         void*                   pGlobal,
855                                         unsigned long*  pBuffer,
856                                         unsigned long   Length,
857                                         unsigned long   Chunk,
858                                         int     (*pFunc)(void* pGlobal, unsigned long* pBuffer, int Offset, int Length),
859                                         int                             Flags
860                                         ) = 0;
861
862         //      4.7.7   audio_playback_buffer_mono
863         //                      Register a native monophonic audio buffer for playback. 
864         // DEPRECATED; DO NOT USE!
865         virtual
866         BErr    audio_playback_buffer_mono(
867                                         unsigned long   Chan,
868                                         void*                   pGlobal,
869                                         unsigned long*  pBuffer,
870                                         unsigned long   Length,
871                                         unsigned long   Chunk,
872                                         int     (*pFunc)(void* pGlobal, unsigned long* pBuffer, int Offset, int Length),
873                                         int                             Flags
874                                         ) = 0;
875
876         //      4.7.8   audio_playback_buffer_stereo
877         //                      Register a native stereophonic audio buffer for playback. 
878         // DEPRECATED; DO NOT USE!
879         virtual
880         BErr    audio_playback_buffer_stereo(
881                                         unsigned long   Pair,
882                                         void*                   pGlobal,
883                                         unsigned long*  pBuffer,
884                                         unsigned long   Length,
885                                         unsigned long   Chunk,
886                                         int     (*pFunc)(void* pGlobal, unsigned long* pBuffer, int Offset, int Length),
887                                         int                             Flags
888                                         ) = 0;
889
890         //      4.7.9   audio_playback_deregister
891         //                      De-registers a native 6-channel interleaved audio source from playback. 
892         // DEPRECATED; DO NOT USE!
893         virtual
894         BErr    audio_playback_deregister(
895                                         void
896                                         ) = 0;
897
898         //      4.7.10  audio_playback_deregister_mono
899         //                      De-registers a native monophonic audio source from playback. 
900         // DEPRECATED; DO NOT USE!
901         virtual
902         BErr    audio_playback_deregister_mono(
903                                         unsigned long   Chan
904                                         ) = 0;
905
906         //      4.7.11  audio_playback_deregister_stereo
907         //                      De-registers a native stereophonic audio source from playback. 
908         // DEPRECATED; DO NOT USE!
909         virtual
910         BErr    audio_playback_deregister_stereo(
911                                         unsigned long   Pair
912                                         ) = 0;
913
914         //      4.7.12  AudioHandlerPlay
915         //                      Moves source audio data streams into the playback buffer. 
916         // DEPRECATED; DO NOT USE!
917         virtual
918         BErr    AudioHandlerPlay(
919                                         unsigned long&  Snooze
920                                         ) = 0;
921
922         //      4.7.13  audio_capture_start
923         //                      Begin capturing audio. 
924         virtual
925         BErr    audio_capture_start(
926                                         unsigned long   Synch,
927                                         unsigned long   PlayThru
928                                         ) = 0;
929
930         //      4.7.14  audio_capture_stop
931         //                      Stop capturing audio. 
932         virtual
933         BErr    audio_capture_stop(
934                                         void
935                                         ) = 0;
936         //      4.7.15  audio_capture_stream
937         //                      Register a file for capture of native interleaved audio. 
938         // DEPRECATED; DO NOT USE!
939         virtual
940         BErr    audio_capture_stream (
941                                         char*                   pName,
942                                         int                             Offset,
943                                         int                             Flags
944                                         ) = 0;
945
946         //      4.7.16  audio_capture_stream_mono
947         //                      Register a file for capture of native monophonic audio. 
948         // DEPRECATED; DO NOT USE!
949         virtual
950         BErr    audio_capture_stream_mono(
951                                         unsigned long   Chan,
952                                         char*                   pName,
953                                         int                             Offset,
954                                         int                             Flags
955                                         ) = 0;
956
957         //      4.7.17  audio_capture_stream_stereo
958         //                      Register a file for capture of native stereophonic audio. 
959         // DEPRECATED; DO NOT USE!
960         virtual
961         BErr    audio_capture_stream_stereo(
962                                         unsigned long   Pair,
963                                         char*                   pName,
964                                         int                             Offset,
965                                         int                             Flags
966                                         ) = 0;
967
968         //      4.7.18  audio_capture_buffer
969         //                      Register a buffer for capture of native interleaved audio. 
970         // DEPRECATED; DO NOT USE!
971         virtual
972         BErr    audio_capture_buffer(
973                                         void*                   pGlobal,
974                                         unsigned long*  pBuffer,
975                                         unsigned long   Length,
976                                         unsigned long   Chunk,
977                                         int     (*pFunc)(void* pGlobal, unsigned long* pBuffer, int Offset, int Length),
978                                         int                             Flags
979                                         ) = 0;
980
981         //      4.7.19  audio_capture_buffer_mono
982         //                      Register a buffer for capture of native monophonic audio. 
983         // DEPRECATED; DO NOT USE!
984         virtual
985         BErr    audio_capture_buffer_mono(
986                                         unsigned long   Chan,
987                                         void*                   pGlobal,
988                                         unsigned long*  pBuffer,
989                                         unsigned long   Length,
990                                         unsigned long   Chunk,
991                                         int     (*pFunc)(void* pGlobal, unsigned long* pBuffer, int Offset, int Length),
992                                         int                             Flags
993                                         ) = 0;
994
995         //      4.7.20  audio_capture_buffer_stereo
996         //                      Register a buffer for capture of native stereophonic audio. 
997         // DEPRECATED; DO NOT USE!
998         virtual
999         BErr    audio_capture_buffer_stereo(
1000                                         unsigned long   Pair,
1001                                         void*                   pGlobal,
1002                                         unsigned long*  pBuffer,
1003                                         unsigned long   Length,
1004                                         unsigned long   Chunk,
1005                                         int     (*pFunc)(void* pGlobal, unsigned long* pBuffer, int Offset, int Length),
1006                                         int                             Flags
1007                                         ) = 0;
1008
1009         //      4.7.21  audio_capture_deregister
1010         //                      De-registers a buffer from capture monitor thread. 
1011         // DEPRECATED; DO NOT USE!
1012         virtual
1013         BErr    audio_capture_deregister(
1014                                         void
1015                                         ) = 0;
1016
1017         //      4.7.22  audio_capture_deregister_mono
1018         //                      De-registers a single monophonic audio buffer from capture monitor thread. 
1019         // DEPRECATED; DO NOT USE!
1020         virtual
1021         BErr    audio_capture_deregister_mono(
1022                                         unsigned long   Chan
1023                                         ) = 0;
1024
1025         //      4.7.23  audio_capture_deregister_stereo
1026         //                      De-registers a stereophonic audio buffer from capture monitor thread. 
1027         // DEPRECATED; DO NOT USE!
1028         virtual
1029         BErr    audio_capture_deregister_stereo(
1030                                         unsigned long   Pair
1031                                         ) = 0;
1032
1033
1034         //      4.7.24  audio_playback_threshold
1035         //                      Adjust the Chunk and Snooze times for the Audio Playback Monitor Thread
1036         // DEPRECATED; DO NOT USE!
1037         virtual
1038         BErr    audio_playback_threshold(
1039                                         unsigned long   Chunk,
1040                                         unsigned long   Snooze
1041                                         ) = 0;
1042
1043         //      4.7.25  audio_capture_sample_count
1044         //                      Number of samples captured. 
1045         // DEPRECATED; DO NOT USE!
1046         virtual
1047         ULONG   audio_capture_sample_count() = 0;
1048
1049         //      4.7.26  audio_capture_sample_count_mono
1050         //                      Number of samples captured. 
1051         // DEPRECATED; DO NOT USE!
1052         virtual
1053         ULONG   audio_capture_sample_count_mono(unsigned long Chan) = 0;
1054
1055         //      4.7.27  audio_capture_sample_count_stereo
1056         //                      Number of samples captured. 
1057         // DEPRECATED; DO NOT USE!
1058         virtual
1059         ULONG   audio_capture_sample_count_stereo(unsigned long Pair) = 0;
1060
1061         //      4.7.28  audio_playback_blip
1062         //                      Channel is to be blipped
1063         // DEPRECATED; DO NOT USE!
1064         virtual
1065         BErr    audio_playback_blip(
1066                                                 int Channel
1067                                                 ) = 0;
1068
1069         //      4.8     Video Engine Functions
1070         //---------------------------------
1071         //      4.8.1   video_playback_start
1072         //                      Start video playback. 
1073         virtual
1074         BErr    video_playback_start(
1075                                         int             Step,
1076                                         int             Loop
1077                                         ) = 0;
1078
1079         //      4.8.2   video_playback_stop
1080         //                      Halts the video playback engine. 
1081         virtual
1082         BErr    video_playback_stop(
1083                                         int             Wait,
1084                                         int             Flush
1085                                         ) = 0;
1086
1087         //      4.8.3   video_playback_flush
1088         //                      Flush all pending display requests from all Channels. 
1089         virtual
1090         BErr    video_playback_flush(
1091                                         void
1092                                         ) = 0;
1093
1094         //      4.8.4   video_playback_flush_A
1095         //                      Flush all pending display requests from Channel A. 
1096         // DEPRECATED; DO NOT USE!
1097         virtual
1098         BErr    video_playback_flush_A(
1099                                         void
1100                                         ) = 0;
1101
1102         //      4.8.5   video_playback_flush_B
1103         //                      Flush all pending display requests from Channel-B. 
1104         // DEPRECATED; DO NOT USE!
1105         virtual
1106         BErr    video_playback_flush_B(
1107                                         void
1108                                         ) = 0;
1109
1110         //      4.8.6   video_playback_allocate
1111         //                      Obtain the address of the next available video memory buffer. 
1112         virtual
1113         BErr    video_playback_allocate(
1114                                         void**                  pAddress,
1115                                         unsigned long&  BufferId,
1116                                         unsigned long&  Underrun
1117                                         ) = 0;
1118
1119         //      4.8.7   video_playback_release
1120         //                      Release physical blue card video buffer. 
1121         virtual
1122         BErr    video_playback_release(
1123                                         unsigned long   BufferId
1124                                         ) = 0;
1125
1126         //      4.8.8   video_playback_flush_display
1127         //                      Remove a unique display request from the display lists. 
1128         virtual
1129         BErr    video_playback_flush_display(
1130                                         unsigned long   UniqueId
1131                                         ) = 0;
1132
1133         //      4.8.9   video_playback_release_flush
1134         //                      Purges all pending display requests and returns the frame to the free list.
1135         virtual
1136         BErr    video_playback_release_flush(
1137                                         unsigned long   BufferId
1138                                         ) = 0;
1139
1140         //      4.8.10  video_playback_present
1141         //                      Present a buffer to the video playback engine Channel-A. 
1142         virtual
1143         BErr    video_playback_present(
1144                                         unsigned long&  UniqueId,
1145                                         unsigned long   BufferId,
1146                                         unsigned long   Count,
1147                                         int                             Keep,
1148                                         int                             Odd=0
1149                                         ) = 0;
1150
1151         //      4.8.11  video_playback_present_dissolve
1152         //                      Present a frame with a dissolve value to the video playback engine. 
1153         virtual
1154         BErr    video_playback_present_dissolve(
1155                                         unsigned long&  UniqueId,
1156                                         unsigned long   BufferId,
1157                                         unsigned long   Count,
1158                                         unsigned long   Dissolve,
1159                                         int                             Keep,
1160                                         int                             Odd=0
1161                                         ) = 0;
1162
1163         //      4.8.12  video_playback_present_A
1164         //                      Present a frame to the video playback engine that will be inserted into Channel-A. 
1165         // DEPRECATED; DO NOT USE!
1166         virtual
1167         BErr    video_playback_present_A(
1168                                         unsigned long&  UniqueId,
1169                                         unsigned long   BufferId,
1170                                         unsigned long   Count,
1171                                         unsigned long   Dissolve,
1172                                         int                             Synch_B,
1173                                         int                             Keep,
1174                                         int                             Odd=0
1175                                         ) = 0;
1176
1177         //      4.8.13  video_playabck_present_B
1178         //                      Present a frame to the video playback engine that will be inserted into Channel-B. 
1179         // DEPRECATED; DO NOT USE!
1180         virtual
1181         BErr    video_playback_present_B(
1182                                         unsigned long&  UniqueId,
1183                                         unsigned long   BufferId,
1184                                         unsigned long   Count,
1185                                         unsigned long   Dissolve,
1186                                         int                             Synch_A,
1187                                         int                             Keep,
1188                                         int                             Odd=0
1189                                         ) = 0;
1190
1191         //      4.8.14  video_playback_present_detail
1192         //                      The general purpose presentation function. 
1193         // DEPRECATED; DO NOT USE!
1194         virtual
1195         BErr    video_playback_present_detail(
1196                                         unsigned long&  UniqueId,
1197                                         unsigned long   BufferId,
1198                                         unsigned long   Count,
1199                                         unsigned long   Dissolve,
1200                                         unsigned long   Flags
1201                                         ) = 0;
1202
1203         //      4.8.15  video_capture_start
1204         //                      Instruct the device driver to begin capturing images into the video framestore. 
1205         virtual
1206         BErr    video_capture_start(
1207                                         int             Step=0
1208                                         ) = 0;
1209
1210         //      4.8.16  video_capture_stop
1211         //                      Instruct the device driver to stop the video capture. 
1212         virtual
1213         BErr    video_capture_stop(
1214                                         void
1215                                         ) = 0;
1216
1217         //      4.8.17  video_capture_harvest
1218         //                      Get the details about the next frame in a capture sequence. 
1219         virtual
1220         BErr    video_capture_harvest(
1221                                         void**                  ppAddress,
1222                                         unsigned long&  BufferId,
1223                                         unsigned long&  Count,
1224                                         unsigned long&  Frames,
1225                                         int                             CompostLater=0
1226                                         ) = 0;
1227
1228         // not used for anything important...
1229         // DEPRECATED; DO NOT USE!
1230         virtual
1231         BErr nudge_frame(LONG nudge) = 0;
1232
1233         //      4.8.18  video_playback_pause
1234         //                      Suspend or Resume playback 
1235         virtual
1236         BErr    video_playback_pause(
1237                                         int             Suspend
1238                                         ) = 0;
1239
1240         //      4.8.19  video_capture_compost
1241         //                      Return a harvested frame for recycling
1242         virtual
1243         BErr    video_capture_compost(
1244                                         unsigned long   BufferId
1245                                         ) = 0;
1246
1247 #ifdef BLUEVELVET_SDK_VERSION3
1248         virtual BErr set_onboard_keyer(int & On)=0;
1249         virtual BErr get_onboard_keyer_status(int &On)=0;
1250         virtual BErr get_timing_adjust(unsigned int     & HPhase,unsigned int & VPhase,unsigned int & MaxHPhase,unsigned int & MaxVPhase) = 0;
1251         virtual BErr get_letterbox_values(unsigned int& Lines,int & bBlackEnableFlag)=0;
1252         virtual BErr get_safearea_info(int&     Title,int& Picture)=0;
1253         virtual int has_downconverter_bnc(int deviceId)=0;
1254         virtual int has_onboard_keyer(int deviceId)=0;
1255         virtual int has_duallink_input(int deviceId)=0;
1256         virtual int has_programmable_colorspace_matrix(int deviceId)=0;
1257
1258         virtual BErr SetMatrix_Col_Green_Y(double CoeffG_R,double CoeffG_G,double CoeffG_B,double constG)=0;
1259         virtual BErr GetMatrix_Col_Green_Y(double & CoeffG_R,double & CoeffG_G,double & CoeffG_B,double & constG)=0;
1260
1261         virtual BErr SetMatrix_Col_Red_PR(double CoeffR_R,double CoeffR_G,double CoeffR_B,double constR)=0;
1262         virtual BErr GetMatrix_Col_Red_PR(double & CoeffR_R,double & CoeffR_G,double & CoeffR_B,double & constR)=0;
1263
1264         virtual BErr SetMatrix_Col_Blue_PB(double CoeffB_R,double CoeffB_G,double CoeffB_B,double constB)=0;
1265         virtual BErr GetMatrix_Col_Blue_PB(double & CoeffB_R,double & CoeffB_G,double & CoeffB_B,double & constB)=0;
1266
1267         virtual BErr SetDualLink_Output_Conn_SignalColorSpace(unsigned long & signalType,unsigned long  updateMatrixFlag)=0;
1268         virtual BErr SetDualLink_Input(unsigned long  & EnableDualLink)=0;
1269         virtual BErr SetDualLink_Input_SignalFormatType(unsigned long &v4444)=0;
1270         virtual BErr GetDualLink_InputProperty(unsigned long & DualLink,unsigned long & connSignalColorSpace,unsigned long & v4444)=0;
1271         virtual BErr GetDualLink_OutputProperty(unsigned long & DualLink,unsigned long & connSignalColorSpace,unsigned long & v4444)=0;
1272
1273         virtual BErr Set_DownConverterSignalType(unsigned long type)=0;
1274         virtual BErr GetDownConverterSignalType(unsigned long & connSignalType)=0;
1275
1276         virtual BErr SetDualLink_Input_Conn_SignalColorSpace(unsigned long  & signalType)=0;
1277         virtual int  GetHDCardType(int nDeviceId)=0;
1278
1279         // New Audio Interface 
1280         virtual BErr MaxAudioOutBufferSize(long & nSampleCount)=0;
1281         virtual BErr GetAudioOutBufferFreeSpace(long  & nSampleCount)=0;
1282         virtual BErr wait_audio_output_interrupt(unsigned long & noQueuedSample,unsigned long & noFreeSample) = 0;
1283         virtual BErr InitAudioPlaybackMode()=0;
1284         virtual BErr StartAudioPlayback(int syncCount)=0;
1285         virtual BErr StopAudioPlayback()=0;
1286         virtual BErr WriteAudioSample(int nSampleType,void * pBuffer,long  nNoSample,int bFlag,long nNoSamplesWritten)=0;
1287         virtual BErr EndAudioPlaybackMode()=0; 
1288         virtual int GetPCIRevId()=0;
1289 #endif
1290
1291         //      Need this so that derived destructor gets called
1292         virtual ~CBlueVelvet(){}
1293         HANDLE          m_hDevice;                                      // Handle to the blue card device driver
1294 };
1295
1296
1297 //------------------------------------------------------------------------------------------------------------
1298 extern "C" {
1299 //------------------------------------------------------------------------------------------------------------
1300 //      4.0.0   The Blue Velvet factory
1301 BLUEFISH_API CBlueVelvet*       BlueVelvetFactory();
1302
1303
1304 //      4.0.1   Who am I
1305 BLUEFISH_API const char*        BlueVelvetVersion();
1306
1307 //      4.0.2   Golden Value calculation
1308 BLUEFISH_API unsigned long BlueVelvetGolden(
1309                                                                                 unsigned long   VidFmt,
1310                                                                                 unsigned long   MemFmt,
1311                                                                                 unsigned long   UpdFmt
1312                                                                                 );
1313 //      4.0.3   Bytes Per Line calculation
1314 BLUEFISH_API unsigned long BlueVelvetLineBytes(
1315                                                                                 unsigned long   VidFmt,
1316                                                                                 unsigned long   MemFmt
1317                                                                                 );
1318 //      4.0.4   Bytes Per Frame calculation
1319 BLUEFISH_API unsigned long BlueVelvetFrameBytes(
1320                                                                                 unsigned long   VidFmt,
1321                                                                                 unsigned long   MemFmt,
1322                                                                                 unsigned long   UpdFmt
1323                                                                                 );
1324
1325 //      4.0.5   Lines Per Frame calculation
1326 BLUEFISH_API unsigned long BlueVelvetFrameLines(
1327                                                                                 unsigned long   VidFmt,
1328                                                                                 unsigned long   UpdFmt
1329                                                                                 );
1330
1331 //      4.0.6   Pixels per Line calculation
1332 BLUEFISH_API unsigned long BlueVelvetLinePixels(
1333                                                                                 unsigned long   VidFmt
1334                                                                                 );
1335
1336 BLUEFISH_API unsigned long BlueVelvetVBILines(unsigned long VidFmt,unsigned long FrameType);
1337
1338 }
1339
1340 #endif  //_BLUEVELVET_H