-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBlackmagicRawAPI.h
893 lines (762 loc) · 54 KB
/
BlackmagicRawAPI.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
/* -LICENSE-START-
** Copyright (c) 2024 Blackmagic Design
**
** Permission is hereby granted, free of charge, to any person or organization
** obtaining a copy of the software and accompanying documentation covered by
** this license (the "Software") to use, reproduce, display, distribute,
** execute, and transmit the Software, and to prepare derivative works of the
** Software, and to permit third-parties to whom the Software is furnished to
** do so, all subject to the following:
**
** The copyright notices in the Software and this entire statement, including
** the above license grant, this restriction and the following disclaimer,
** must be included in all copies of the Software, in whole or in part, and
** all derivative works of the Software, unless such copies or derivative
** works are solely in the form of machine-executable object code generated by
** a source language processor.
**
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
** FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
** SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
** FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
** ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
** DEALINGS IN THE SOFTWARE.
** -LICENSE-END-
*/
#ifndef BMD_BLACKMAGICRAWAPI_H
#define BMD_BLACKMAGICRAWAPI_H
#ifndef BRAW_MAJOR
# define BRAW_MAJOR 3
#endif
#ifndef BMD_CONST
#if defined(_MSC_VER)
#define BMD_CONST __declspec(selectany)
#else
#define BMD_CONST static const
#endif
#endif
#ifndef BMD_PUBLIC
#define BMD_PUBLIC
#endif
#if (__APPLE__ + 0)
#include <CoreFoundation/CoreFoundation.h>
#include <CoreFoundation/CFPlugInCOM.h>
#endif
#if (__linux__ + 0)
#include "LinuxCOM.h"
#endif
#include <stdint.h>
#if (_WIN32 + 0)
#include <comutil.h>
#include <oleauto.h> // VARIANT
//#include <wtype.h> // BSTR
typedef BSTR BRawStr;
struct CFUUIDBytes {
unsigned char byte0;
unsigned char byte1;
unsigned char byte2;
unsigned char byte3;
unsigned char byte4;
unsigned char byte5;
unsigned char byte6;
unsigned char byte7;
unsigned char byte8;
unsigned char byte9;
unsigned char byte10;
unsigned char byte11;
unsigned char byte12;
unsigned char byte13;
unsigned char byte14;
unsigned char byte15;
operator IID() const { return {(unsigned long)(byte0 << 24 | byte1 << 16 | byte2 << 8 | byte3), (unsigned short)(byte4 << 8 | byte5), (unsigned short)(byte6 << 8 | byte7), byte8, byte9, byte10, byte11, byte12, byte13, byte14, byte15};}
};
#elif (__APPLE__ + 0)
typedef CFStringRef BRawStr;
#else
typedef char* BRawStr;
#endif
// Type Declarations
#if (BRAW_MAJOR + 0) >= 4
#define IID_IBlackmagicRawPipelineDevice IID_IBlackmagicRawPipelineDevice4
#else
#define IID_IBlackmagicRawPipelineDevice IID_IBlackmagicRawPipelineDevice2
#endif
#if (BRAW_MAJOR + 0) >= 3
#define IID_IBlackmagicRaw IID_IBlackmagicRaw3
#define IID_IBlackmagicRawFactory IID_IBlackmagicRawFactory3
#define IID_IBlackmagicRawConfiguration IID_IBlackmagicRawConfiguration3
#define IID_IBlackmagicRawPost3DLUT IID_IBlackmagicRawPost3DLUT2
#define IID_IBlackmagicRawClip IID_IBlackmagicRawClip2
#else
#define IID_IBlackmagicRaw IID_IBlackmagicRaw2
#define IID_IBlackmagicRawFactory IID_IBlackmagicRawFactory2
#define IID_IBlackmagicRawConfiguration IID_IBlackmagicRawConfiguration2
#define IID_IBlackmagicRawPost3DLUT IID_IBlackmagicRawPost3DLUT2
#define IID_IBlackmagicRawClip IID_IBlackmagicRawClip2
#endif
// Interface ID Declarations
BMD_CONST REFIID IID_IBlackmagicRaw2 = /* 5A540A06-1B62-4224-ACB0-A2385C6ED649 */ CFUUIDBytes{ 0x5A,0x54,0x0A,0x06,0x1B,0x62,0x42,0x24,0xAC,0xB0,0xA2,0x38,0x5C,0x6E,0xD6,0x49 };
BMD_CONST REFIID IID_IBlackmagicRawFactory2 = /* 74FEBEDC-12D6-490D-9A77-48F19E8F60CB */ CFUUIDBytes{ 0x74,0xFE,0xBE,0xDC,0x12,0xD6,0x49,0x0D,0x9A,0x77,0x48,0xF1,0x9E,0x8F,0x60,0xCB };
BMD_CONST REFIID IID_IBlackmagicRawConfiguration2 = /* F8588A3D-E31F-45BD-96C7-A5640EA8B8E7 */ CFUUIDBytes{ 0xF8,0x58,0x8A,0x3D,0xE3,0x1F,0x45,0xBD,0x96,0xC7,0xA5,0x64,0x0E,0xA8,0xB8,0xE7 };
BMD_CONST REFIID IID_IBlackmagicRawPost3DLUT2 = /* 72A53B50-BB40-4C69-83FB-58CF58AF35B6 */ CFUUIDBytes{ 0x72,0xA5,0x3B,0x50,0xBB,0x40,0x4C,0x69,0x83,0xFB,0x58,0xCF,0x58,0xAF,0x35,0xB6 };
BMD_CONST REFIID IID_IBlackmagicRawClip2 = /* 408F758F-347F-4CDA-BA9B-89B6F15603CF */ CFUUIDBytes{ 0x40,0x8F,0x75,0x8F,0x34,0x7F,0x4C,0xDA,0xBA,0x9B,0x89,0xB6,0xF1,0x56,0x03,0xCF };
BMD_CONST REFIID IID_IBlackmagicRaw3 = /* 558ABA39-B344-4E9B-A484-116CF2A4B5C6 */ CFUUIDBytes{ 0x55,0x8A,0xBA,0x39,0xB3,0x44,0x4E,0x9B,0xA4,0x84,0x11,0x6C,0xF2,0xA4,0xB5,0xC6 };
BMD_CONST REFIID IID_IBlackmagicRawFactory3 = /* 78DEEB84-98C9-434A-B7E5-7AACC2988399 */ CFUUIDBytes{ 0x78,0xDE,0xEB,0x84,0x98,0xC9,0x43,0x4A,0xB7,0xE5,0x7A,0xAC,0xC2,0x98,0x83,0x99 };
BMD_CONST REFIID IID_IBlackmagicRawPipelineIterator = /* 051ED792-3D9D-4ED0-BB1F-3873E08773CB */ CFUUIDBytes{ 0x05,0x1E,0xD7,0x92,0x3D,0x9D,0x4E,0xD0,0xBB,0x1F,0x38,0x73,0xE0,0x87,0x73,0xCB };
BMD_CONST REFIID IID_IBlackmagicRawPipelineDeviceIterator = /* 32D3385F-06EE-4260-82EB-2BABFFFACED8 */ CFUUIDBytes{ 0x32,0xD3,0x38,0x5F,0x06,0xEE,0x42,0x60,0x82,0xEB,0x2B,0xAB,0xFF,0xFA,0xCE,0xD8 };
BMD_CONST REFIID IID_IBlackmagicRawOpenGLInteropHelper = /* 86444C8A-4398-4364-9166-7D10F41C315E */ CFUUIDBytes{ 0x86,0x44,0x4C,0x8A,0x43,0x98,0x43,0x64,0x91,0x66,0x7D,0x10,0xF4,0x1C,0x31,0x5E };
BMD_CONST REFIID IID_IBlackmagicRawPipelineDevice2 = /* 2B0D350D-8C17-431F-88AD-1E7945DF2F9F */ CFUUIDBytes{ 0x2B,0x0D,0x35,0x0D,0x8C,0x17,0x43,0x1F,0x88,0xAD,0x1E,0x79,0x45,0xDF,0x2F,0x9F };
BMD_CONST REFIID IID_IBlackmagicRawPipelineDevice4 = /* 67BB92E8-AD7E-432E-8BA5-E688A2A63F2F */ CFUUIDBytes{ 0x67,0xBB,0x92,0xE8,0xAD,0x7E,0x43,0x2E,0x8B,0xA5,0xE6,0x88,0xA2,0xA6,0x3F,0x2F };
BMD_CONST REFIID IID_IBlackmagicRawToneCurve = /* 7E40C13D-3575-46B5-B2B7-85DAE1EEFD77 */ CFUUIDBytes{ 0x7E,0x40,0xC1,0x3D,0x35,0x75,0x46,0xB5,0xB2,0xB7,0x85,0xDA,0xE1,0xEE,0xFD,0x77 };
BMD_CONST REFIID IID_IBlackmagicRawConfiguration3 = /* 267E9866-FB40-4BFB-8BF8-96EA3F7DA36E */ CFUUIDBytes{ 0x26,0x7E,0x98,0x66,0xFB,0x40,0x4B,0xFB,0x8B,0xF8,0x96,0xEA,0x3F,0x7D,0xA3,0x6E };
BMD_CONST REFIID IID_IBlackmagicRawConfigurationEx = /* ACE9078F-ABA0-4B26-A954-EDA108DADA5A */ CFUUIDBytes{ 0xAC,0xE9,0x07,0x8F,0xAB,0xA0,0x4B,0x26,0xA9,0x54,0xED,0xA1,0x08,0xDA,0xDA,0x5A };
BMD_CONST REFIID IID_IBlackmagicRawClipGeometry = /* 22717196-36AE-4B8A-B5CC-24292F9660F0 */ CFUUIDBytes{ 0x22,0x71,0x71,0x96,0x36,0xAE,0x4B,0x8A,0xB5,0xCC,0x24,0x29,0x2F,0x96,0x60,0xF0 };
BMD_CONST REFIID IID_IBlackmagicRawResourceManager = /* 3C5C3C4A-812C-4AF0-99F0-06C6E197C189 */ CFUUIDBytes{ 0x3C,0x5C,0x3C,0x4A,0x81,0x2C,0x4A,0xF0,0x99,0xF0,0x06,0xC6,0xE1,0x97,0xC1,0x89 };
BMD_CONST REFIID IID_IBlackmagicRawMetadataIterator = /* F85AE78D-5DC2-40BC-8C1D-D0D805523ADA */ CFUUIDBytes{ 0xF8,0x5A,0xE7,0x8D,0x5D,0xC2,0x40,0xBC,0x8C,0x1D,0xD0,0xD8,0x05,0x52,0x3A,0xDA };
BMD_CONST REFIID IID_IBlackmagicRawClipProcessingAttributes = /* 1F53C8AE-2295-4C8E-B17F-5931F4F146AC */ CFUUIDBytes{ 0x1F,0x53,0xC8,0xAE,0x22,0x95,0x4C,0x8E,0xB1,0x7F,0x59,0x31,0xF4,0xF1,0x46,0xAC };
BMD_CONST REFIID IID_IBlackmagicRawFrameProcessingAttributes = /* 5F7C5C0F-7138-445A-9D0D-6111B6409D17 */ CFUUIDBytes{ 0x5F,0x7C,0x5C,0x0F,0x71,0x38,0x44,0x5A,0x9D,0x0D,0x61,0x11,0xB6,0x40,0x9D,0x17 };
BMD_CONST REFIID IID_IBlackmagicRawPost3DLUT3 = /* 86052BC4-0231-48C6-B3C8-C771112AAD68 */ CFUUIDBytes{ 0x86,0x05,0x2B,0xC4,0x02,0x31,0x48,0xC6,0xB3,0xC8,0xC7,0x71,0x11,0x2A,0xAD,0x68 };
BMD_CONST REFIID IID_IBlackmagicRawProcessedImage = /* D87A0F72-A883-42BB-8488-0089411C5035 */ CFUUIDBytes{ 0xD8,0x7A,0x0F,0x72,0xA8,0x83,0x42,0xBB,0x84,0x88,0x00,0x89,0x41,0x1C,0x50,0x35 };
BMD_CONST REFIID IID_IBlackmagicRawJob = /* 34C05ACF-7118-45EA-8B71-887E0515395D */ CFUUIDBytes{ 0x34,0xC0,0x5A,0xCF,0x71,0x18,0x45,0xEA,0x8B,0x71,0x88,0x7E,0x05,0x15,0x39,0x5D };
BMD_CONST REFIID IID_IBlackmagicRawCallback = /* E9F98FAC-33DB-4A65-BB94-8A82B027AED0 */ CFUUIDBytes{ 0xE9,0xF9,0x8F,0xAC,0x33,0xDB,0x4A,0x65,0xBB,0x94,0x8A,0x82,0xB0,0x27,0xAE,0xD0 };
BMD_CONST REFIID IID_IBlackmagicRawClipAudio = /* 76D4ACED-E0D6-45BB-B547-56B7435B2A1D */ CFUUIDBytes{ 0x76,0xD4,0xAC,0xED,0xE0,0xD6,0x45,0xBB,0xB5,0x47,0x56,0xB7,0x43,0x5B,0x2A,0x1D };
BMD_CONST REFIID IID_IBlackmagicRawClipAccelerometerMotion = /* 983AACBB-F469-40C9-AA81-345B0B7CCD05 */ CFUUIDBytes{ 0x98,0x3A,0xAC,0xBB,0xF4,0x69,0x40,0xC9,0xAA,0x81,0x34,0x5B,0x0B,0x7C,0xCD,0x05 };
BMD_CONST REFIID IID_IBlackmagicRawClipGyroscopeMotion = /* 00543A2C-FDED-4C79-A60C-A460415F0296 */ CFUUIDBytes{ 0x00,0x54,0x3A,0x2C,0xFD,0xED,0x4C,0x79,0xA6,0x0C,0xA4,0x60,0x41,0x5F,0x02,0x96 };
BMD_CONST REFIID IID_IBlackmagicRawClipPDAFData = /* AAE71534-F951-4062-B6A9-69B8808CD267 */ CFUUIDBytes{ 0xAA,0xE7,0x15,0x34,0xF9,0x51,0x40,0x62,0xB6,0xA9,0x69,0xB8,0x80,0x8C,0xD2,0x67 };
BMD_CONST REFIID IID_IBlackmagicRawFrame = /* A500B253-1808-4EF2-8692-D23C692404EA */ CFUUIDBytes{ 0xA5,0x00,0xB2,0x53,0x18,0x08,0x4E,0xF2,0x86,0x92,0xD2,0x3C,0x69,0x24,0x04,0xEA };
BMD_CONST REFIID IID_IBlackmagicRawFrameEx = /* F8C6C374-D7FB-4BD3-AD0B-C533464FF450 */ CFUUIDBytes{ 0xF8,0xC6,0xC3,0x74,0xD7,0xFB,0x4B,0xD3,0xAD,0x0B,0xC5,0x33,0x46,0x4F,0xF4,0x50 };
BMD_CONST REFIID IID_IBlackmagicRawManualDecoderFlow1 = /* 278815A6-A3C1-47C7-A0A6-6754DEAE5E7A */ CFUUIDBytes{ 0x27,0x88,0x15,0xA6,0xA3,0xC1,0x47,0xC7,0xA0,0xA6,0x67,0x54,0xDE,0xAE,0x5E,0x7A };
BMD_CONST REFIID IID_IBlackmagicRawManualDecoderFlow2 = /* DBEC4C39-B4C2-4A65-AA8C-2B3C7F4777E3 */ CFUUIDBytes{ 0xDB,0xEC,0x4C,0x39,0xB4,0xC2,0x4A,0x65,0xAA,0x8C,0x2B,0x3C,0x7F,0x47,0x77,0xE3 };
BMD_CONST REFIID IID_IBlackmagicRawClip3 = /* A2910203-787B-4BF2-A374-B1A459E2D351 */ CFUUIDBytes{ 0xA2,0x91,0x02,0x03,0x78,0x7B,0x4B,0xF2,0xA3,0x74,0xB1,0xA4,0x59,0xE2,0xD3,0x51 };
BMD_CONST REFIID IID_IBlackmagicRawClipEx = /* D260C7D0-93BD-4D68-B600-93B4CAB7F870 */ CFUUIDBytes{ 0xD2,0x60,0xC7,0xD0,0x93,0xBD,0x4D,0x68,0xB6,0x00,0x93,0xB4,0xCA,0xB7,0xF8,0x70 };
BMD_CONST REFIID IID_IBlackmagicRawClipResolutions = /* 3070805E-ABE3-498C-9D77-8C991B2B77E5 */ CFUUIDBytes{ 0x30,0x70,0x80,0x5E,0xAB,0xE3,0x49,0x8C,0x9D,0x77,0x8C,0x99,0x1B,0x2B,0x77,0xE5 };
/* Enum BlackmagicRawVariantType - Variant types that may be stored as metadata */
#ifndef _WIN32
enum {
VT_EMPTY = 0,
VT_UI1 = 1,
VT_I2 = 2,
VT_UI2 = 3,
VT_I4 = 4,
VT_UI4 = 5,
VT_R4 = 6,
VT_BSTR = 7,
VT_SAFEARRAY = 8,
};
#endif
typedef uint32_t BlackmagicRawVariantType;
enum _BlackmagicRawVariantType {
blackmagicRawVariantTypeEmpty = VT_EMPTY,
blackmagicRawVariantTypeU8 = VT_UI1,
blackmagicRawVariantTypeS16 = VT_I2,
blackmagicRawVariantTypeU16 = VT_UI2,
blackmagicRawVariantTypeS32 = VT_I4,
blackmagicRawVariantTypeU32 = VT_UI4,
blackmagicRawVariantTypeFloat32 = VT_R4,
blackmagicRawVariantTypeString = VT_BSTR,
blackmagicRawVariantTypeSafeArray = VT_SAFEARRAY,
};
/* Enum BlackmagicRawResourceType - Used in IBlackmagicRawResourceManager */
typedef uint32_t BlackmagicRawResourceType;
enum _BlackmagicRawResourceType {
blackmagicRawResourceTypeBufferCPU = /* 'cpub' */ 0x63707562, // block of CPU memory
blackmagicRawResourceTypeBufferMetal = /* 'metb' */ 0x6D657462, // a MTLBuffer
blackmagicRawResourceTypeBufferCUDA = /* 'cudb' */ 0x63756462, // a CUdeviceptr
blackmagicRawResourceTypeBufferOpenCL = /* 'oclb' */ 0x6F636C62 // a cl_mem
};
/* Enum BlackmagicRawResourceFormat - Used for resource allocation */
typedef uint32_t BlackmagicRawResourceFormat;
enum _BlackmagicRawResourceFormat {
blackmagicRawResourceFormatRGBAU8 = /* 'rgba' */ 0x72676261,
blackmagicRawResourceFormatBGRAU8 = /* 'bgra' */ 0x62677261,
blackmagicRawResourceFormatRGBU16 = /* '16il' */ 0x3136696C,
blackmagicRawResourceFormatRGBAU16 = /* '16al' */ 0x3136616C,
blackmagicRawResourceFormatBGRAU16 = /* '16la' */ 0x31366C61,
blackmagicRawResourceFormatRGBU16Planar = /* '16pl' */ 0x3136706C,
blackmagicRawResourceFormatRGBF32 = /* 'f32s' */ 0x66333273,
blackmagicRawResourceFormatRGBAF32 = /* 'f32l' */ 0x6633326C,
blackmagicRawResourceFormatBGRAF32 = /* 'f32a' */ 0x66333261,
blackmagicRawResourceFormatRGBF32Planar = /* 'f32p' */ 0x66333270,
blackmagicRawResourceFormatRGBF16 = /* 'f16s' */ 0x66313673,
blackmagicRawResourceFormatRGBAF16 = /* 'f16l' */ 0x6631366C,
blackmagicRawResourceFormatBGRAF16 = /* 'f16a' */ 0x66313661,
blackmagicRawResourceFormatRGBF16Planar
};
/* Enum BlackmagicRawResourceUsage - Used in IBlackmagicRawResourceManager */
typedef uint32_t BlackmagicRawResourceUsage;
enum _BlackmagicRawResourceUsage {
blackmagicRawResourceUsageReadCPUWriteCPU = /* 'rcwc' */ 0x72637763,
blackmagicRawResourceUsageReadGPUWriteGPU = /* 'rgwg' */ 0x72677767,
blackmagicRawResourceUsageReadGPUWriteCPU = /* 'rgwc' */ 0x72677763,
blackmagicRawResourceUsageReadCPUWriteGPU = /* 'rcwg' */ 0x72637767
};
/* Enum BlackmagicRawPipeline - Used in IBlackmagicRawConfiguration. Each pipeline has different mappings to context/commandQueue */
typedef uint32_t BlackmagicRawPipeline;
enum _BlackmagicRawPipeline {
blackmagicRawPipelineCPU = /* 'cpub' */ 0x63707562,
blackmagicRawPipelineCUDA = /* 'cuda' */ 0x63756461, // context/commandQueue maps to CUcontext/CUstream
blackmagicRawPipelineMetal = /* 'metl' */ 0x6D65746C, // context/commandQueue maps to nil/MTLCommandQueue
blackmagicRawPipelineOpenCL = /* 'opcl' */ 0x6F70636C // context/commandQueue maps to cl_context/cl_command_queue
};
/* Enum BlackmagicRawInstructionSet - Used in IBlackmagicRawConfiguration */
typedef uint32_t BlackmagicRawInstructionSet;
enum _BlackmagicRawInstructionSet {
blackmagicRawInstructionSetSSE41 = /* 'se41' */ 0x73653431,
blackmagicRawInstructionSetAVX = /* 'avx_' */ 0x6176785F,
blackmagicRawInstructionSetAVX2 = /* 'avx2' */ 0x61767832,
blackmagicRawInstructionSetNEON = /* 'neon' */ 0x6E656F6E
};
/* Enum BlackmagicRawAudioFormat - Used in IBlackmagicRawFileAudio */
typedef uint32_t BlackmagicRawAudioFormat;
enum _BlackmagicRawAudioFormat {
blackmagicRawAudioFormatPCMLittleEndian = /* 'pcml' */ 0x70636D6C
};
/* Enum BlackmagicRawResolutionScale - Used in IBlackmagicRawFrame */
typedef uint32_t BlackmagicRawResolutionScale;
enum _BlackmagicRawResolutionScale {
blackmagicRawResolutionScaleFull = /* 'full' */ 0x66756C6C,
blackmagicRawResolutionScaleHalf = /* 'half' */ 0x68616C66,
blackmagicRawResolutionScaleQuarter = /* 'qrtr' */ 0x71727472,
blackmagicRawResolutionScaleEighth = /* 'eith' */ 0x65697468,
};
/* Enum BlackmagicRawClipProcessingAttribute - Variant types that may be stored as metadata */
typedef uint32_t BlackmagicRawClipProcessingAttribute;
enum _BlackmagicRawClipProcessingAttribute {
blackmagicRawClipProcessingAttributeColorScienceGen = /* 'csgn' */ 0x6373676E, // u16
blackmagicRawClipProcessingAttributeGamma = /* 'gama' */ 0x67616D61, // string
blackmagicRawClipProcessingAttributeGamut = /* 'gamt' */ 0x67616D74, // string
blackmagicRawClipProcessingAttributeToneCurveContrast = /* 'tcon' */ 0x74636F6E, // float
blackmagicRawClipProcessingAttributeToneCurveSaturation = /* 'tsat' */ 0x74736174, // float
blackmagicRawClipProcessingAttributeToneCurveMidpoint = /* 'tmid' */ 0x746D6964, // float
blackmagicRawClipProcessingAttributeToneCurveHighlights = /* 'thih' */ 0x74686968, // float
blackmagicRawClipProcessingAttributeToneCurveShadows = /* 'tsha' */ 0x74736861, // float
blackmagicRawClipProcessingAttributeToneCurveVideoBlackLevel = /* 'tvbl' */ 0x7476626C, // u16
blackmagicRawClipProcessingAttributeToneCurveBlackLevel = /* 'tblk' */ 0x74626C6B, // float
blackmagicRawClipProcessingAttributeToneCurveWhiteLevel = /* 'twit' */ 0x74776974, // float
blackmagicRawClipProcessingAttributeHighlightRecovery = /* 'hlry' */ 0x686C7279, // u16
blackmagicRawClipProcessingAttributeAnalogGainIsConstant = /* 'agic' */ 0x61676963, // u16
blackmagicRawClipProcessingAttributeAnalogGain = /* 'gain' */ 0x6761696E, // float
blackmagicRawClipProcessingAttributePost3DLUTMode = /* 'lutm' */ 0x6C75746D, // string
blackmagicRawClipProcessingAttributeEmbeddedPost3DLUTName = /* 'emln' */ 0x656D6C6E, // string
blackmagicRawClipProcessingAttributeEmbeddedPost3DLUTTitle = /* 'emlt' */ 0x656D6C74, // string
blackmagicRawClipProcessingAttributeEmbeddedPost3DLUTSize = /* 'emls' */ 0x656D6C73, // u16
blackmagicRawClipProcessingAttributeEmbeddedPost3DLUTData = /* 'emld' */ 0x656D6C64, // float array, size*size*size*3 elements
blackmagicRawClipProcessingAttributeSidecarPost3DLUTName = /* 'scln' */ 0x73636C6E, // string
blackmagicRawClipProcessingAttributeSidecarPost3DLUTTitle = /* 'sclt' */ 0x73636C74, // string
blackmagicRawClipProcessingAttributeSidecarPost3DLUTSize = /* 'scls' */ 0x73636C73, // u16
blackmagicRawClipProcessingAttributeSidecarPost3DLUTData = /* 'scld' */ 0x73636C64, // float array, size*size*size*3 elements
blackmagicRawClipProcessingAttributeGamutCompressionEnable = /* 'gace' */ 0x67616365 // u16, 0=disabled, 1=enabled
};
/* Enum BlackmagicRawFrameProcessingAttribute - Variant types that may be stored as metadata */
typedef uint32_t BlackmagicRawFrameProcessingAttribute;
enum _BlackmagicRawFrameProcessingAttribute {
blackmagicRawFrameProcessingAttributeWhiteBalanceKelvin = /* 'wbkv' */ 0x77626B76, // u32
blackmagicRawFrameProcessingAttributeWhiteBalanceTint = /* 'wbtn' */ 0x7762746E, // s16
blackmagicRawFrameProcessingAttributeExposure = /* 'expo' */ 0x6578706F, // float
blackmagicRawFrameProcessingAttributeISO = /* 'fiso' */ 0x6669736F, // u32
blackmagicRawFrameProcessingAttributeAnalogGain = /* 'agpf' */ 0x61677066 // float
};
/* Enum BlackmagicRawInterop - */
typedef uint32_t BlackmagicRawInterop;
enum _BlackmagicRawInterop {
blackmagicRawInteropNone = /* 'none' */ 0x6E6F6E65,
blackmagicRawInteropOpenGL = /* 'opgl' */ 0x6F70676C
};
/* Enum BlackmagicRawAnamorphicRatio - */
typedef uint32_t BlackmagicRawAnamorphicRatio;
enum _BlackmagicRawAnamorphicRatio {
blackmagicRawAnamorphicRatioFromMetadata = /* 'meta' */ 0x6D657461,
blackmagicRawAnamorphicRatioDisabled = /* 'dsbl' */ 0x6473626C,
blackmagicRawAnamorphicRatio133x = /* '133x' */ 0x31333378,
blackmagicRawAnamorphicRatio15x = /* '15x_' */ 0x3135785F,
blackmagicRawAnamorphicRatio16x = /* '16x_' */ 0x3136785F,
blackmagicRawAnamorphicRatio166x = /* '166x' */ 0x31363678,
blackmagicRawAnamorphicRatio18x = /* '18x_' */ 0x3138785F,
blackmagicRawAnamorphicRatio2x = /* '2x__' */ 0x32785F5F
};
/* Enum BlackmagicRawRotation - */
typedef uint32_t BlackmagicRawRotation;
enum _BlackmagicRawRotation {
blackmagicRawRotationFromMetadata = /* 'meta' */ 0x6D657461,
blackmagicRawRotationDisabled = /* 'dsbl' */ 0x6473626C,
blackmagicRawRotationClockwise90 = /* 'r90_' */ 0x7239305F,
blackmagicRawRotationClockwise180 = /* 'r180' */ 0x72313830,
blackmagicRawRotationClockwise270 = /* 'r270' */ 0x72323730
};
/* Enum BlackmagicRawFlip - */
typedef uint32_t BlackmagicRawFlip;
enum _BlackmagicRawFlip {
blackmagicRawFlipFromMetadata = /* 'meta' */ 0x6D657461,
blackmagicRawFlipDisabled = /* 'dsbl' */ 0x6473626C,
blackmagicRawFlipHorizontal = /* 'flpx' */ 0x666C7078,
blackmagicRawFlipVertical = /* 'flpy' */ 0x666C7079,
blackmagicRawFlipBoth = /* 'flpb' */ 0x666C7062
};
#if defined(__cplusplus)
// Forward Declarations
class IBlackmagicRaw;
class IBlackmagicRawFactory;
class IBlackmagicRawPipelineIterator;
class IBlackmagicRawPipelineDeviceIterator;
class IBlackmagicRawOpenGLInteropHelper;
class IBlackmagicRawPipelineDevice;
class IBlackmagicRawToneCurve;
class IBlackmagicRawConfiguration;
class IBlackmagicRawConfigurationEx;
class IBlackmagicRawClipGeometry;
class IBlackmagicRawResourceManager;
class IBlackmagicRawMetadataIterator;
class IBlackmagicRawClipProcessingAttributes;
class IBlackmagicRawFrameProcessingAttributes;
class IBlackmagicRawPost3DLUT;
class IBlackmagicRawProcessedImage;
class IBlackmagicRawJob;
class IBlackmagicRawCallback;
class IBlackmagicRawClipAudio;
class IBlackmagicRawClipAccelerometerMotion;
class IBlackmagicRawClipGyroscopeMotion;
class IBlackmagicRawClipPDAFData;
class IBlackmagicRawFrame;
class IBlackmagicRawFrameEx;
class IBlackmagicRawManualDecoderFlow1;
class IBlackmagicRawManualDecoderFlow2;
class IBlackmagicRawClip;
class IBlackmagicRawClipEx;
class IBlackmagicRawClipResolutions;
/* Struct SafeArrayBound - Dimensionality of a SafeArray */
#ifdef _WIN32
using SafeArray = SAFEARRAY;
using SafeArrayBound = SAFEARRAYBOUND;
#else
struct SafeArrayBound
{
uint32_t lLbound;
uint32_t cElements;
};
/* Struct SafeArray - Typed array of data, passed into and out of API library */
struct SafeArray
{
BlackmagicRawVariantType variantType;
uint32_t cDims;
uint8_t* data;
SafeArrayBound bounds;
};
/* Struct Variant - Structure wrapping metadata, passed into and out of the API Library */
struct Variant
{
BlackmagicRawVariantType vt;
// Metadata
union {
int16_t iVal;
uint16_t uiVal;
int32_t intVal;
uint32_t uintVal;
float fltVal;
BRawStr bstrVal;
SafeArray* parray;
};
};
using VARIANT = Variant;
using VARTYPE = BlackmagicRawVariantType;
#endif
/* Interface IBlackmagicRaw - A single codec instance */
class BMD_PUBLIC IBlackmagicRaw : public IUnknown
{
public:
virtual HRESULT OpenClip (/* in */ BRawStr fileName, /* out */ IBlackmagicRawClip** clip) = 0;
#if (BRAW_MAJOR + 0) >= 3
virtual HRESULT OpenClipWithGeometry (/* in */ BRawStr fileName, /* in */ IBlackmagicRawClipGeometry* geometry, /* out */ IBlackmagicRawClip** clip) = 0;
#endif
virtual HRESULT SetCallback (/* in */ IBlackmagicRawCallback* callback) = 0;
virtual HRESULT PreparePipeline (/* in */ BlackmagicRawPipeline pipeline, /* in */ void* pipelineContext, /* in */ void* pipelineCommandQueue, /* in */ void* userData /* optional */) = 0; // Asynchronously prepares the current pipeline
virtual HRESULT PreparePipelineForDevice (/* in */ IBlackmagicRawPipelineDevice* pipelineDevice, /* in */ void* userData /* optional */) = 0; // Asynchronously prepares the current pipeline
virtual HRESULT FlushJobs (void) = 0; // Blocking call which will only return once all jobs have been completed
protected:
virtual ~IBlackmagicRaw () {} // call Release method to drop reference count
};
/* Interface IBlackmagicRawFactory - Use this to create one or more Codec objects */
class BMD_PUBLIC IBlackmagicRawFactory : public IUnknown
{
public:
virtual HRESULT CreateCodec (/* out */ IBlackmagicRaw** codec) = 0;
virtual HRESULT CreatePipelineIterator (/* in */ BlackmagicRawInterop interop, /* out */ IBlackmagicRawPipelineIterator** pipelineIterator) = 0;
virtual HRESULT CreatePipelineDeviceIterator (/* in */ BlackmagicRawPipeline pipeline, /* in */ BlackmagicRawInterop interop, /* out */ IBlackmagicRawPipelineDeviceIterator** deviceIterator) = 0;
#if (BRAW_MAJOR + 0) >= 3
virtual HRESULT CreateClipGeometry (/* out */ IBlackmagicRawClipGeometry** geometry) = 0;
#endif
protected:
virtual ~IBlackmagicRawFactory () {} // call Release method to drop reference count
};
/* Interface IBlackmagicRawPipelineIterator - Use this to determine pipelines available for use on the system */
class BMD_PUBLIC IBlackmagicRawPipelineIterator : public IUnknown
{
public:
virtual HRESULT Next (void) = 0; // When at last entry, calling Next() will return S_FALSE
virtual HRESULT GetName (/* out */ BRawStr* pipelineName) = 0;
virtual HRESULT GetInterop (/* out */ BlackmagicRawInterop* interop) = 0;
virtual HRESULT GetPipeline (/* out */ BlackmagicRawPipeline* pipeline) = 0;
protected:
virtual ~IBlackmagicRawPipelineIterator () {} // call Release method to drop reference count
};
/* Interface IBlackmagicRawPipelineDeviceIterator - Use this to determine pipeline devices available for use on the system */
class BMD_PUBLIC IBlackmagicRawPipelineDeviceIterator : public IUnknown
{
public:
virtual HRESULT Next (void) = 0; // When at last entry, calling Next() will return S_FALSE
virtual HRESULT GetPipeline (/* out */ BlackmagicRawPipeline* pipeline) = 0;
virtual HRESULT GetInterop (/* out */ BlackmagicRawInterop* interop) = 0;
virtual HRESULT CreateDevice (/* out */ IBlackmagicRawPipelineDevice** pipelineDevice) = 0;
protected:
virtual ~IBlackmagicRawPipelineDeviceIterator () {} // call Release method to drop reference count
};
/* Interface IBlackmagicRawOpenGLInteropHelper - */
class BMD_PUBLIC IBlackmagicRawOpenGLInteropHelper : public IUnknown
{
public:
virtual HRESULT GetPreferredResourceFormat (/* out */ BlackmagicRawResourceFormat* preferredFormat) = 0;
virtual HRESULT SetImage (/* in */ IBlackmagicRawProcessedImage* processedImage, /* out */ uint32_t* openGLTextureName, /* out */ int32_t* openGLTextureTarget) = 0;
protected:
virtual ~IBlackmagicRawOpenGLInteropHelper () {} // call Release method to drop reference count
};
/* Interface IBlackmagicRawPipelineDevice - */
class BMD_PUBLIC IBlackmagicRawPipelineDevice : public IUnknown
{
public:
virtual HRESULT SetBestInstructionSet (void) = 0;
virtual HRESULT SetInstructionSet (/* in */ BlackmagicRawInstructionSet instructionSet) = 0;
virtual HRESULT GetInstructionSet (/* out */ BlackmagicRawInstructionSet* instructionSet) = 0;
virtual HRESULT GetIndex (/* out */ uint32_t* deviceIndex) = 0;
virtual HRESULT GetName (/* out */ BRawStr* deviceName) = 0;
virtual HRESULT GetInterop (/* out */ BlackmagicRawInterop* interop) = 0;
virtual HRESULT GetPipeline (/* out */ BlackmagicRawPipeline* pipeline, /* out */ void** context, /* out */ void** commandQueue) = 0;
virtual HRESULT GetPipelineName (/* out */ BRawStr* pipelineName) = 0;
virtual HRESULT GetOpenGLInteropHelper (/* out */ IBlackmagicRawOpenGLInteropHelper** interopHelper) = 0;
#if (BRAW_MAJOR + 0) >= 4
virtual HRESULT GetSupportedResourceFormats (/* out */ BlackmagicRawResourceFormat* array /* optional */, /* in, out */ uint32_t* arrayElementCount /* optional */) = 0;
#else
protected:
virtual ~IBlackmagicRawPipelineDevice () {} // call Release method to drop reference count
#endif // (BRAW_MAJOR + 0) >= 4
};
/* Interface IBlackmagicRawToneCurve - Functions which provide useful tone curve operations */
class BMD_PUBLIC IBlackmagicRawToneCurve : public IUnknown
{
public:
virtual HRESULT GetToneCurve (/* in */ BRawStr cameraType, /* in */ BRawStr gamma, /* in */ uint16_t gen /* Color science gen */, /* out */ float* contrast, /* out */ float* saturation, /* out */ float* midpoint, /* out */ float* highlights, /* out */ float* shadows, /* out */ float* blackLevel, /* out */ float* whiteLevel, /* out */ uint16_t* videoBlackLevel) = 0; // Query tone curve parameters for a specific camera and gamma. These are only currently available on Gamut: Blackmagic Design, Gamma: Blackmagic Design Film, Blackmagic Design Extended Video, Blackmagic Design Custom. Note: Custom gamma can define a tone curve per clip, see BlackmagicRawClipProcessingAttributes::GetToneCurveForCustomGamma()
virtual HRESULT EvaluateToneCurve (/* in */ BRawStr cameraType, /* in */ uint16_t gen, /* in */ float contrast, /* in */ float saturation, /* in */ float midpoint, /* in */ float highlights, /* in */ float shadows, /* in */ float blackLevel, /* in */ float whiteLevel, /* in */ uint16_t videoBlackLevel, /* out */ float* array, /* in */ uint32_t arrayElementCount) = 0; // Evaluates tone curve, returned buffer can be used to visualise curve
protected:
virtual ~IBlackmagicRawToneCurve () {} // call Release method to drop reference count
};
/* Interface IBlackmagicRawConfiguration - Configuration for Codec Object. Configuration properties are read on first OpenClip() */
class BMD_PUBLIC IBlackmagicRawConfiguration : public IUnknown
{
public:
virtual HRESULT SetPipeline (/* in */ BlackmagicRawPipeline pipeline /* changing pipeline will cause the default resource manager to be re-created */, /* in */ void* pipelineContext, /* in */ void* pipelineCommandQueue) = 0;
virtual HRESULT GetPipeline (/* out */ BlackmagicRawPipeline* pipeline /* optional */, /* out */ void** pipelineContextOut /* optional */, /* out */ void** pipelineCommandQueueOut /* optional */) = 0;
virtual HRESULT IsPipelineSupported (/* in */ BlackmagicRawPipeline pipeline, /* out */ bool* pipelineSupported) = 0; // Verifies relevant hardware/DLLs are available
virtual HRESULT SetCPUThreads (/* in */ uint32_t threadCount /* set 0 for default */) = 0;
virtual HRESULT GetCPUThreads (/* out */ uint32_t* threadCount) = 0;
virtual HRESULT GetMaxCPUThreadCount (/* out */ uint32_t* threadCount) = 0;
virtual HRESULT SetWriteMetadataPerFrame (/* in */ bool writePerFrame) = 0; // if true, frame metadata will be written to only the relevant frame
virtual HRESULT GetWriteMetadataPerFrame (/* out */ bool* writePerFrame) = 0;
virtual HRESULT SetFromDevice (/* in */ IBlackmagicRawPipelineDevice* pipelineDevice) = 0;
#if (BRAW_MAJOR + 0) >= 3
virtual HRESULT GetVersion (/* out */ BRawStr* version) = 0;
virtual HRESULT GetCameraSupportVersion (/* out */ BRawStr* version) = 0;
#endif
protected:
virtual ~IBlackmagicRawConfiguration () {} // call Release method to drop reference count
};
/* Interface IBlackmagicRawConfigurationEx - Extended Configuration for Codec Object */
class BMD_PUBLIC IBlackmagicRawConfigurationEx : public IUnknown
{
public:
virtual HRESULT GetResourceManager (/* out */ IBlackmagicRawResourceManager** resourceManager) = 0;
virtual HRESULT SetResourceManager (/* in */ IBlackmagicRawResourceManager* resourceManager /* setting null will restore the default resource manager */) = 0; // Set to NULL to return to default resource manager
virtual HRESULT GetInstructionSet (/* out */ BlackmagicRawInstructionSet* instructionSet) = 0;
virtual HRESULT SetInstructionSet (/* in */ BlackmagicRawInstructionSet instructionSet) = 0;
protected:
virtual ~IBlackmagicRawConfigurationEx () {} // call Release method to drop reference count
};
/* Interface IBlackmagicRawClipGeometry - Geometry properties of Clip object */
class BMD_PUBLIC IBlackmagicRawClipGeometry : public IUnknown
{
public:
virtual HRESULT GetAnamorphicRatio (/* out */ BlackmagicRawAnamorphicRatio* anamorphic) = 0;
virtual HRESULT SetAnamorphicRatio (/* in */ BlackmagicRawAnamorphicRatio anamorphic) = 0;
virtual HRESULT GetRotation (/* out */ BlackmagicRawRotation* rotation) = 0;
virtual HRESULT SetRotation (/* in */ BlackmagicRawRotation rotation) = 0;
virtual HRESULT GetFlip (/* out */ BlackmagicRawFlip* flip) = 0;
virtual HRESULT SetFlip (/* in */ BlackmagicRawFlip flip) = 0;
#if (BRAW_MAJOR + 0) >= 4
protected:
virtual ~IBlackmagicRawClipGeometry () {} // call Release method to drop reference count
#endif
};
/* Interface IBlackmagicRawResourceManager - Resource manager allows manual handling of CPU/GPU resource allocation */
class BMD_PUBLIC IBlackmagicRawResourceManager : public IUnknown
{
public:
virtual HRESULT CreateResource (/* in */ void* context, /* in */ void* commandQueue, /* in */ uint32_t sizeBytes, /* in */ BlackmagicRawResourceType type, /* in */ BlackmagicRawResourceUsage usage, /* out */ void** resource) = 0;
virtual HRESULT ReleaseResource (/* in */ void* context, /* in */ void* commandQueue, /* in */ void* resource, /* in */ BlackmagicRawResourceType type) = 0;
virtual HRESULT CopyResource (/* in */ void* context, /* in */ void* commandQueue, /* in */ void* source, /* in */ BlackmagicRawResourceType sourceType, /* in */ void* destination, /* in */ BlackmagicRawResourceType destinationType, /* in */ uint32_t sizeBytes, /* in */ bool copyAsync) = 0; // Utility function, not called by the API
virtual HRESULT GetResourceHostPointer (/* in */ void* context, /* in */ void* commandQueue, /* in */ void* resource, /* in */ BlackmagicRawResourceType resourceType, /* out */ void** hostPointer) = 0; // Utility function, not called by the API
protected:
virtual ~IBlackmagicRawResourceManager () {} // call Release method to drop reference count
};
/* Interface IBlackmagicRawMetadataIterator - Iterating metadata */
class BMD_PUBLIC IBlackmagicRawMetadataIterator : public IUnknown
{
public:
virtual HRESULT Next (void) = 0; // When at last entry, calling Next() will return S_FALSE
virtual HRESULT GetKey (/* out */ BRawStr* key) = 0;
virtual HRESULT GetData (/* out */ VARIANT* data) = 0;
protected:
virtual ~IBlackmagicRawMetadataIterator () {} // call Release method to drop reference count
};
/* Interface IBlackmagicRawClipProcessingAttributes - Clip attributes used during processing */
class BMD_PUBLIC IBlackmagicRawClipProcessingAttributes : public IUnknown
{
public:
virtual HRESULT GetClipAttribute (/* in */ BlackmagicRawClipProcessingAttribute attribute, /* out */ VARIANT* value) = 0;
virtual HRESULT SetClipAttribute (/* in */ BlackmagicRawClipProcessingAttribute attribute, /* in */ VARIANT* value) = 0;
virtual HRESULT GetClipAttributeRange (/* in */ BlackmagicRawClipProcessingAttribute attribute, /* out */ VARIANT* valueMin, /* out */ VARIANT* valueMax, /* out */ bool* isReadOnly) = 0;
virtual HRESULT GetClipAttributeList (/* in */ BlackmagicRawClipProcessingAttribute attribute, /* out */ VARIANT* array /* optional */, /* out */ uint32_t* arrayElementCount /* optional */, /* out */ bool* isReadOnly) = 0;
virtual HRESULT GetISOList (/* out */ uint32_t* array /* optional */, /* in, out */ uint32_t* arrayElementCount /* optional */, /* out */ bool* isReadOnly) = 0;
virtual HRESULT GetPost3DLUT (/* out */ IBlackmagicRawPost3DLUT** lut) = 0;
protected:
virtual ~IBlackmagicRawClipProcessingAttributes () {} // call Release method to drop reference count
};
/* Interface IBlackmagicRawFrameProcessingAttributes - Frame attributes used during processing */
class BMD_PUBLIC IBlackmagicRawFrameProcessingAttributes : public IUnknown
{
public:
virtual HRESULT GetFrameAttribute (/* in */ BlackmagicRawFrameProcessingAttribute attribute, /* out */ VARIANT* value) = 0;
virtual HRESULT SetFrameAttribute (/* in */ BlackmagicRawFrameProcessingAttribute attribute, /* in */ VARIANT* value) = 0;
virtual HRESULT GetFrameAttributeRange (/* in */ BlackmagicRawFrameProcessingAttribute attribute, /* out */ VARIANT* valueMin, /* out */ VARIANT* valueMax, /* out */ bool* isReadOnly) = 0;
virtual HRESULT GetFrameAttributeList (/* in */ BlackmagicRawFrameProcessingAttribute attribute, /* out */ VARIANT* array /* optional */, /* out */ uint32_t* arrayElementCount /* optional */, /* out */ bool* isReadOnly) = 0;
virtual HRESULT GetISOList (/* out */ uint32_t* array /* optional */, /* in, out */ uint32_t* arrayElementCount /* optional */, /* out */ bool* isReadOnly) = 0;
protected:
virtual ~IBlackmagicRawFrameProcessingAttributes () {} // call Release method to drop reference count
};
/* Interface IBlackmagicRawPost3DLUT - 3D LUT object */
class BMD_PUBLIC IBlackmagicRawPost3DLUT : public IUnknown
{
public:
virtual HRESULT GetName (/* out */ BRawStr* name) = 0;
virtual HRESULT GetTitle (/* out */ BRawStr* title) = 0;
virtual HRESULT GetSize (/* out */ uint32_t* size) = 0;
virtual HRESULT GetResourceGPU (/* in */ void* context, /* in */ void* commandQueue, /* out */ BlackmagicRawResourceType* type, /* out */ void** resource) = 0;
virtual HRESULT GetResourceCPU (/* out */ void** resource) = 0;
virtual HRESULT GetResourceSizeBytes (/* out */ uint32_t* sizeBytes) = 0;
#if (BRAW_MAJOR + 0) >= 3
virtual HRESULT WriteCubeFile (/* in */ BRawStr fileName) = 0;
#endif
protected:
virtual ~IBlackmagicRawPost3DLUT () {} // call Release method to drop reference count
};
/* Interface IBlackmagicRawProcessedImage - Processed image ready to display */
class BMD_PUBLIC IBlackmagicRawProcessedImage : public IUnknown
{
public:
virtual HRESULT GetWidth (/* out */ uint32_t* width) = 0;
virtual HRESULT GetHeight (/* out */ uint32_t* height) = 0;
virtual HRESULT GetResource (/* out */ void** resource) = 0;
virtual HRESULT GetResourceType (/* out */ BlackmagicRawResourceType* type) = 0;
virtual HRESULT GetResourceFormat (/* out */ BlackmagicRawResourceFormat* format) = 0;
virtual HRESULT GetResourceSizeBytes (/* out */ uint32_t* sizeBytes) = 0;
virtual HRESULT GetResourceContextAndCommandQueue (/* out */ void** context, /* out */ void** commandQueue) = 0;
protected:
virtual ~IBlackmagicRawProcessedImage () {} // call Release method to drop reference count
};
/* Interface IBlackmagicRawJob - Asynchronous job object */
class BMD_PUBLIC IBlackmagicRawJob : public IUnknown
{
public:
virtual HRESULT Submit (void) = 0;
virtual HRESULT Abort (void) = 0;
virtual HRESULT SetUserData (/* in */ void* userData) = 0;
virtual HRESULT GetUserData (/* out */ void** userData) = 0;
protected:
virtual ~IBlackmagicRawJob () {} // call Release method to drop reference count
};
/* Interface IBlackmagicRawCallback - Callback for IBlackmagicRaw */
class BMD_PUBLIC IBlackmagicRawCallback : public IUnknown
{
public:
virtual void ReadComplete (/* in */ IBlackmagicRawJob* job, /* in */ HRESULT result, /* in */ IBlackmagicRawFrame* frame) = 0;
virtual void DecodeComplete (/* in */ IBlackmagicRawJob* job, /* in */ HRESULT result) = 0;
virtual void ProcessComplete (/* in */ IBlackmagicRawJob* job, /* in */ HRESULT result, /* in */ IBlackmagicRawProcessedImage* processedImage) = 0;
virtual void TrimProgress (/* in */ IBlackmagicRawJob* job, /* in */ float progress) = 0;
virtual void TrimComplete (/* in */ IBlackmagicRawJob* job, /* in */ HRESULT result) = 0;
virtual void SidecarMetadataParseWarning (/* in */ IBlackmagicRawClip* clip, /* in */ BRawStr fileName, /* in */ uint32_t lineNumber, /* in */ BRawStr info) = 0; // offending line will be ignored
virtual void SidecarMetadataParseError (/* in */ IBlackmagicRawClip* clip, /* in */ BRawStr fileName, /* in */ uint32_t lineNumber, /* in */ BRawStr info) = 0; // entire file will be ignored
virtual void PreparePipelineComplete (/* in */ void* userData, /* in */ HRESULT result) = 0;
protected:
virtual ~IBlackmagicRawCallback () {} // call Release method to drop reference count
};
/* Interface IBlackmagicRawClipAudio - Audio component for an opened movie clip */
class BMD_PUBLIC IBlackmagicRawClipAudio : public IUnknown
{
public:
virtual HRESULT GetAudioFormat (/* out */ BlackmagicRawAudioFormat* format) = 0;
virtual HRESULT GetAudioBitDepth (/* out */ uint32_t* bitDepth) = 0;
virtual HRESULT GetAudioChannelCount (/* out */ uint32_t* channelCount) = 0;
virtual HRESULT GetAudioSampleRate (/* out */ uint32_t* sampleRate) = 0;
virtual HRESULT GetAudioSampleCount (/* out */ uint64_t* sampleCount) = 0;
virtual HRESULT GetAudioSamples (/* in */ int64_t sampleFrameIndex, /* in */ void* buffer, /* in */ uint32_t bufferSizeBytes, /* in */ uint32_t maxSampleCount, /* out */ uint32_t* samplesRead /* optional */, /* out */ uint32_t* bytesRead /* optional */) = 0;
protected:
virtual ~IBlackmagicRawClipAudio () {} // call Release method to drop reference count
};
/* Interface IBlackmagicRawClipAccelerometerMotion - Accelerometer motion for an opened movie clip */
class BMD_PUBLIC IBlackmagicRawClipAccelerometerMotion : public IUnknown
{
public:
virtual HRESULT GetSampleRate (/* out */ float* sampleRate) = 0;
virtual HRESULT GetSampleCount (/* out */ uint32_t* sampleCount) = 0;
virtual HRESULT GetSampleSize (/* out */ uint32_t* sampleSize) = 0;
virtual HRESULT GetSampleRange (/* in */ uint64_t sampleStartIndex, /* in */ uint32_t sampleCount, /* out */ float* samples, /* out */ uint32_t* sampleCountOut) = 0;
protected:
virtual ~IBlackmagicRawClipAccelerometerMotion () {} // call Release method to drop reference count
};
/* Interface IBlackmagicRawClipGyroscopeMotion - Gyroscope motion for an opened movie clip */
class BMD_PUBLIC IBlackmagicRawClipGyroscopeMotion : public IUnknown
{
public:
virtual HRESULT GetSampleRate (/* out */ float* sampleRate) = 0;
virtual HRESULT GetSampleCount (/* out */ uint32_t* sampleCount) = 0;
virtual HRESULT GetSampleSize (/* out */ uint32_t* sampleSize) = 0;
virtual HRESULT GetSampleRange (/* in */ uint64_t sampleStartIndex, /* in */ uint32_t sampleCount, /* out */ float* samples, /* out */ uint32_t* sampleCountOut) = 0;
protected:
virtual ~IBlackmagicRawClipGyroscopeMotion () {} // call Release method to drop reference count
};
/* Interface IBlackmagicRawFrame - Frame of a clip */
class BMD_PUBLIC IBlackmagicRawFrame : public IUnknown
{
public:
virtual HRESULT GetFrameIndex (/* out */ uint64_t* frameIndex) = 0;
virtual HRESULT GetTimecode (/* out */ BRawStr* timecode) = 0;
virtual HRESULT GetMetadataIterator (/* out */ IBlackmagicRawMetadataIterator** iterator) = 0;
virtual HRESULT GetMetadata (/* in */ BRawStr key, /* out */ VARIANT* value) = 0;
virtual HRESULT SetMetadata (/* in */ BRawStr key, /* in */ VARIANT* value) = 0; // To clear metadata to movie original, set value to NULL. This data is not saved to disk until SaveSideCar() is called
virtual HRESULT CloneFrameProcessingAttributes (/* out */ IBlackmagicRawFrameProcessingAttributes** frameProcessingAttributes) = 0; // creates object with current frame processing attributes
virtual HRESULT SetResolutionScale (/* in */ BlackmagicRawResolutionScale resolutionScale) = 0;
virtual HRESULT GetResolutionScale (/* out */ BlackmagicRawResolutionScale* resolutionScale) = 0;
virtual HRESULT SetResourceFormat (/* in */ BlackmagicRawResourceFormat resourceFormat) = 0;
virtual HRESULT GetResourceFormat (/* out */ BlackmagicRawResourceFormat* resourceFormat) = 0;
virtual HRESULT GetSensorRate (/* out */ float* sensorRate) = 0;
virtual HRESULT CreateJobDecodeAndProcessFrame (/* in */ IBlackmagicRawClipProcessingAttributes* clipProcessingAttributes /* optionally override clipProcessingAttributes */, /* in */ IBlackmagicRawFrameProcessingAttributes* frameProcessingAttributes /* optionally override frameProcessingAttributes */, /* out */ IBlackmagicRawJob** job) = 0;
protected:
virtual ~IBlackmagicRawFrame () {} // call Release method to drop reference count
};
/* Interface IBlackmagicRawFrameEx - provides extra information for use with IBlackmagicRawManualDecoder */
class BMD_PUBLIC IBlackmagicRawFrameEx : public IUnknown
{
public:
virtual HRESULT GetBitStreamSizeBytes (/* out */ uint32_t* bitStreamSizeBytes) = 0;
virtual HRESULT GetProcessedImageResolution (/* out */ uint32_t* width, /* out */ uint32_t* height) = 0;
protected:
virtual ~IBlackmagicRawFrameEx () {} // call Release method to drop reference count
};
/* Interface IBlackmagicRawManualDecoderFlow1 - Allowing manual decoding/processing of buffers, Flow1 is a pure CPU solution */
class BMD_PUBLIC IBlackmagicRawManualDecoderFlow1 : public IUnknown
{
public:
virtual HRESULT PopulateFrameStateBuffer (/* in */ IBlackmagicRawFrame* frame, /* in */ IBlackmagicRawClipProcessingAttributes* clipProcessingAttributes /* optionally override clipProcessingAttributes */, /* in */ IBlackmagicRawFrameProcessingAttributes* frameProcessingAttributes /* optionally override frameProcessingAttributes */, /* out */ void* frameState, /* in */ uint32_t frameStateSizeBytes) = 0;
virtual HRESULT GetFrameStateSizeBytes (/* out */ uint32_t* frameStateSizeBytes) = 0;
virtual HRESULT GetDecodedSizeBytes (/* in */ void* frameStateBufferCPU, /* out */ uint32_t* decodedSizeBytes) = 0;
virtual HRESULT GetProcessedSizeBytes (/* in */ void* frameStateBufferCPU, /* out */ uint32_t* processedSizeBytes) = 0;
virtual HRESULT GetPost3DLUTSizeBytes (/* in */ void* frameStateBufferCPU, /* out */ uint32_t* post3DLUTSizeBytes) = 0;
virtual HRESULT CreateJobDecode (/* in */ void* frameStateBufferCPU, /* in */ void* bitStreamBufferCPU, /* in */ void* decodedBufferCPU, /* out */ IBlackmagicRawJob** job) = 0;
virtual HRESULT CreateJobProcess (/* in */ void* frameStateBufferCPU, /* in */ void* decodedBufferCPU, /* in */ void* processedBufferCPU, /* in */ void* post3DLUTBufferCPU, /* out */ IBlackmagicRawJob** job) = 0;
protected:
virtual ~IBlackmagicRawManualDecoderFlow1 () {} // call Release method to drop reference count
};
/* Interface IBlackmagicRawManualDecoderFlow2 - Allowing manual decoding/processing of buffers, Flow2 is a hybrid CPU/GPU solution */
class BMD_PUBLIC IBlackmagicRawManualDecoderFlow2 : public IUnknown
{
public:
virtual HRESULT PopulateFrameStateBuffer (/* in */ IBlackmagicRawFrame* frame, /* in */ IBlackmagicRawClipProcessingAttributes* clipProcessingAttributes /* optionally override clipProcessingAttributes */, /* in */ IBlackmagicRawFrameProcessingAttributes* frameProcessingAttributes /* optionally override frameProcessingAttributes */, /* out */ void* frameState, /* in */ uint32_t frameStateSizeBytes) = 0;
virtual HRESULT GetFrameStateSizeBytes (/* out */ uint32_t* frameStateSizeBytes) = 0;
virtual HRESULT GetDecodedSizeBytes (/* in */ void* frameStateBufferCPU, /* out */ uint32_t* decodedSizeBytes) = 0;
virtual HRESULT GetWorkingSizeBytes (/* in */ void* frameStateBufferCPU, /* out */ uint32_t* workingSizeBytes) = 0;
virtual HRESULT GetProcessedSizeBytes (/* in */ void* frameStateBufferCPU, /* out */ uint32_t* processedSizeBytes) = 0;
virtual HRESULT GetPost3DLUTSizeBytes (/* in */ void* frameStateBufferCPU, /* out */ uint32_t* post3DLUTSizeBytes) = 0;
virtual HRESULT CreateJobDecode (/* in */ void* frameStateBufferCPU, /* in */ void* bitStreamBufferCPU, /* in */ void* decodedBufferCPU, /* out */ IBlackmagicRawJob** job) = 0;
virtual HRESULT CreateJobProcess (/* in */ void* context, /* in */ void* commandQueue, /* in */ void* frameStateBufferCPU, /* in */ void* decodedBufferGPU, /* in */ void* workingBufferGPU /* additional working buffer */, /* in */ void* processedBufferGPU, /* in */ void* post3DLUTBufferGPU, /* out */ IBlackmagicRawJob** job) = 0; // Create a job to process a frame. This is performed on the specified GPU. After this process is complete a final processed image will be provided via a OnProcessComplete() callback
protected:
virtual ~IBlackmagicRawManualDecoderFlow2 () {} // call Release method to drop reference count
};
/* Interface IBlackmagicRawClip - Opened movie clip */
class BMD_PUBLIC IBlackmagicRawClip : public IUnknown
{
public:
virtual HRESULT GetWidth (/* out */ uint32_t* width) = 0;
virtual HRESULT GetHeight (/* out */ uint32_t* height) = 0;
virtual HRESULT GetFrameRate (/* out */ float* frameRate) = 0;
virtual HRESULT GetFrameCount (/* out */ uint64_t* frameCount) = 0;
virtual HRESULT GetTimecodeForFrame (/* in */ uint64_t frameIndex, /* out */ BRawStr* timecode) = 0;
virtual HRESULT GetMetadataIterator (/* out */ IBlackmagicRawMetadataIterator** iterator) = 0;
virtual HRESULT GetMetadata (/* in */ BRawStr key, /* out */ VARIANT* value) = 0;
virtual HRESULT SetMetadata (/* in */ BRawStr key, /* in */ VARIANT* value) = 0; // To clear metadata to movie original, set value to NULL. This data is not saved to disk until SaveSideCar() is called
virtual HRESULT GetCameraType (/* out */ BRawStr* cameraType) = 0;
virtual HRESULT CloneClipProcessingAttributes (/* out */ IBlackmagicRawClipProcessingAttributes** clipProcessingAttributes) = 0; // creates object with current clip processing attributes
virtual HRESULT GetMulticardFileCount (/* out */ uint32_t* multicardFileCount) = 0;
virtual HRESULT IsMulticardFilePresent (/* in */ uint32_t index, /* out */ bool* isMulticardFilePresent) = 0;
virtual HRESULT GetSidecarFileAttached (/* out */ bool* isSidecarFileAttached) = 0; // Check for successfully parsed sidecar file, which is automatically loaded upon opening of a clip
virtual HRESULT SaveSidecarFile (void) = 0; // Save metadata to sidecar file
virtual HRESULT ReloadSidecarFile (void) = 0; // Reload metadata from sidecar file
virtual HRESULT CreateJobReadFrame (/* in */ uint64_t frameIndex, /* out */ IBlackmagicRawJob** job) = 0; // Create a job to read a frame
virtual HRESULT CreateJobTrim (/* in */ BRawStr fileName, /* in */ uint64_t frameIndex, /* in */ uint64_t frameCount, /* in */ IBlackmagicRawClipProcessingAttributes* clipProcessingAttributes /* optional */, /* in */ IBlackmagicRawFrameProcessingAttributes* frameProcessingAttributes /* optional */, /* out */ IBlackmagicRawJob** job) = 0;
#if (BRAW_MAJOR + 0) >= 3
virtual HRESULT CloneWithGeometry (/* in */ IBlackmagicRawClipGeometry* geometry, /* out */ IBlackmagicRawClip** clip) = 0;
#endif
protected:
virtual ~IBlackmagicRawClip () {} // call Release method to drop reference count
};
/* Interface IBlackmagicRawClipEx - Extended use of IBlackmagicRawClip, to pass custom bitstream */
class BMD_PUBLIC IBlackmagicRawClipEx : public IUnknown
{
public:
virtual HRESULT GetMaxBitStreamSizeBytes (/* out */ uint32_t* maxBitStreamSizeBytes) = 0;
virtual HRESULT GetBitStreamSizeBytes (/* in */ uint64_t frameIndex, /* out */ uint32_t* bitStreamSizeBytes) = 0;
virtual HRESULT CreateJobReadFrame (/* in */ uint64_t frameIndex, /* out */ void* bitStream /* optional */, /* in */ uint32_t bitStreamSizeBytes /* optional */, /* out */ IBlackmagicRawJob** job) = 0;
virtual HRESULT QueryTimecodeInfo (/* out */ uint32_t* baseFrameIndex, /* out */ bool* isDropFrameTimecode) = 0;
protected:
virtual ~IBlackmagicRawClipEx () {} // call Release method to drop reference count
};
/* Interface IBlackmagicRawClipResolutions - Supports querying of resolutions and/or scales for processed image results */
class BMD_PUBLIC IBlackmagicRawClipResolutions : public IUnknown
{
public:
virtual HRESULT GetResolutionCount (/* out */ uint32_t* resolutionCount) = 0;
virtual HRESULT GetResolution (/* in */ uint32_t resolutionIndex, /* out */ uint32_t* resolutionWidthPixels, /* out */ uint32_t* resolutionHeightPixels) = 0;
virtual HRESULT GetClosestResolutionForScale (/* in */ BlackmagicRawResolutionScale resolutionScale, /* out */ uint32_t* resolutionWidthPixels, /* out */ uint32_t* resolutionHeightPixels) = 0;
#if (BRAW_MAJOR + 0) >= 3
virtual HRESULT GetClosestScaleForResolution (/* in */ uint32_t resolutionWidthPixels, /* in */ uint32_t resolutionHeightPixels, /* out */ BlackmagicRawResolutionScale* resolutionScale) = 0;
#else
virtual HRESULT GetClosestScaleForResolution (/* in */ uint32_t resolutionWidthPixels, /* in */ uint32_t resolutionHeightPixels, /* in */ bool requestUpsideDown, /* out */ BlackmagicRawResolutionScale* resolutionScale) = 0;
#endif
protected:
virtual ~IBlackmagicRawClipResolutions () {} // call Release method to drop reference count
};
/* Functions */
extern "C" {
BMD_PUBLIC IBlackmagicRawFactory* CreateBlackmagicRawFactoryInstance(void);
#ifndef _WIN32
BMD_PUBLIC IBlackmagicRawFactory* CreateBlackmagicRawFactoryInstanceFromPath(/* in */ BRawStr loadPath);
BMD_PUBLIC IBlackmagicRawFactory* CreateBlackmagicRawFactoryInstanceFromExeRelativePath(/* in */ BRawStr loadPath);
BMD_PUBLIC HRESULT VariantInit(/* in */ VARIANT* variant);
BMD_PUBLIC HRESULT VariantClear(/* in */ VARIANT* variant);
BMD_PUBLIC SafeArray* SafeArrayCreate(/* in */ BlackmagicRawVariantType variantType, /* in */ uint32_t dimensions, /* in */ SafeArrayBound* safeArrayBound);
BMD_PUBLIC HRESULT SafeArrayGetVartype(/* in */ SafeArray* safeArray, /* out */ BlackmagicRawVariantType* variantType);
BMD_PUBLIC HRESULT SafeArrayGetLBound(/* in */ SafeArray* safeArray, /* in */ uint32_t dimensions, /* out */ long* lBound);
BMD_PUBLIC HRESULT SafeArrayGetUBound(/* in */ SafeArray* safeArray, /* in */ uint32_t dimensions, /* out */ long* uBound);
BMD_PUBLIC HRESULT SafeArrayAccessData(/* in */ SafeArray* safeArray, /* out */ void** outData);
BMD_PUBLIC HRESULT SafeArrayUnaccessData(/* in */ SafeArray* safeArray);
BMD_PUBLIC HRESULT SafeArrayDestroy(/* in */ SafeArray* safeArray);
#endif
}
#endif /* defined(__cplusplus) */
#endif /* defined(BMD_BLACKMAGICRAWAPI_H) */