ffgl-core 0.2.6

FFGL plugin framework
Documentation
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
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<title>FreeFrame Open Video Plugin System Specification</title>
    <style type="text/css">
		a:link, a:visited, a:active {color:#0040A0;}
		a:hover {TEXT-DECORATION:none; color:#0040A0;}
		body, h1, h2, h3, h4, p, td, th {font-family:arial,sans-serif;font-size:10pt;}
		h1 {font-size:20pt;}
		h2 {font-size:16pt;}
		h3 {font-size:12pt;}
		h4 {font-size:10pt;}
	</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>

<body>

<center>
<h1>FreeFrame Open Video Plugin System Specification</h1>
<h2>Version 1.5 - 'FreeFrameGL'</h2>
</center>

<a href="#CHAPLibrary"><b>1. OS integration</b></a><br>
<a href="#CHAPConstants"><b>2. Basic types and constants</b></a><br>
<a href="#CHAPTypes"><b>3. Enumerated and derived types</b></a><br>
<a href="#CHAPStructures"><b>4. Structures</b></a><br>
<a href="#CHAPFunctions"><b>5. Functions</b></a><br>
&nbsp; &nbsp; <a href="#CHAPFunctionsGlobal"><b>5.1. Global functions</b></a><br>
&nbsp; &nbsp; <a href="#CHAPFunctionsInstance"><b>5.2. Instance specific functions</b></a><br>

<p>&nbsp;</p>

<p>
<b>Copyright (c) 2002-2007 <a href="http://www.freeframe.org" target="_blank">www.freeframe.org</a><br>
All rights reserved.</b>
</p>

<p>
This document is a functional specification for the FreeFrame application programmers interface
(API).  It is intended to be subject to the same license as the code supplied as examples of
use of the FreeFrame API.
</p>

<p>
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
</p>
<ul type=disc>
	<li>
		Redistributions of source code must retain the above copyright
		notice, this list of conditions and the following disclaimer.
	</li>
	<li>
		Redistributions in binary form must reproduce the above copyright
		notice, this list of conditions and the following disclaimer in
		the documentation and/or other materials provided with the
		distribution.
	</li>
	<li>
		Neither the name of FreeFrame nor the names of its
		contributors may be used to endorse or promote products derived
		from this software without specific prior written permission.
	</li>
</ul>

<font face=courier>
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</font>

<p>&nbsp;</p>

<a name="CHAPLibrary"><hr><h2>1. OS integration</h2><hr>
</a>
<p>
FreeFrame plugins are distributed and used as compiled shared objects (.so)
in Linux, as Bundles in Mac OS X and as Dynamic Link Libraries (.dll) in
Windows.
</p>

<p>
FreeFrame Plugins export a single function: <a href="#plugMain">plugMain</a>. This is passed 3 values:
a 32-bit function code, a 32-bit input value and a 32-bit instance identifier.
It returns a 32-bit output value.
<br>
The input values and output values have different types according to the function code.
This may be implemented differently on different platforms in different languages, but the
format of the values must be consistent.
</p>

<hr>

<!-- /****************** plugMain ******************/  -->
<a name="plugMain">
	<table border=0  bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>plugMain</h3></td>
		<td valign=top>(unsigned integer functionCode, unsigned integer inputValue, unsigned integer instanceID)</td>
	</tr></table>
</a>

<h4>Parameters:</h4>

<table border=0>
<tr>
	<td><i>functionCode:</i></td>
	<td>Tells the plugin which function is being called (see <a href="#functiontable">function table</a>)</td>
</tr>
<tr>
	<td><i>inputValue:</i></td>
	<td>
		32-bit value or 32-bit pointer to some structure, depending on function
		code.
	</td>
</tr>
<tr>
	<td><i>instanceID:</i></td>
	<td>32-bit instance identifier. Only used for instance specific functions (see <a href="#functiontable">function table</a>)</td>
</tr>
</table>

<h4>Return value:</h4>

Depends on function code. See <a href="#functiontable">function table</a> for details.

<h4>Remarks:</h4>
<table border=0>
<tr>
	<td>PLUGIN DEVELOPERS:</td>
	<td>
		You shouldn't need to change this function. This is the one and only function exposed by
		the library containing the actual plugin.
	</td>
</tr>
</table>




<p>&nbsp;</p>

<a name="CHAPConstants">
	<hr><h2>2. Basic types and constants</h2><hr>
</a>
<p>
All numbers in this document are ordinary decimal numbers, expect if specified
otherwise.
</p>
<p>The following types are used:</p>

<p>
<table border=1>
<tr>
	<td><b>Type</b></td>
	<td><b>Range of type</b></td>
	<td><b>Notes</b></td>
</tr>

<tr>
	<td><b>32-bit unsigned integer</b></td>
	<td>0 to 4294967295</td>
	<td>-</td>
</tr>

<tr>
	<td><b>32-bit pointer</b></td>
	<td>0 to 4294967295</td>
	<td>needs to be a valid memory location</td>
</tr>

<tr>
	<td><b>32-bit IEEE float</b></td>
	<td>1 sign bit, 8 bit exponent, 23 bit fraction</td>
	<td>Smallest Non-Zero Values: + or - 1.4012985 × (10 ^ ?45)</td>
	<td>Largest Non-Infinite Values: + or - 3.4028235 × (10 ^ 38)</td>
</tr>

<tr>
  <a name="Float64"></a>
	<td><b>64-bit IEEE float</b></td>
	<td>1 sign bit, 11 bit exponent, 52 bit fraction</td>
	<td>Smallest Non-Zero Values: + or - 5.0 × (10 ^ ?324)</td>
	<td>Largest Non-Infinite Values: + or - 1.7976931348623157 × (10 ^ 308)</td>
</tr>
</table>
&nbsp;
<p>The following constants are used as return values:

<a name="FF_FAIL"></a>
<a name="FF_SUCCESS"></a>
<a name="FF_TRUE"></a>
<a name="FF_FALSE"></a>
<a name="FF_SUPPORTED"></a>
<a name="FF_UNSUPPORTED"></a>
</p>

<table border=1>
	<tr>
		<td><b>FF_SUCCESS</b></td>
		<td>0</td>
	</tr>
	<tr>
		<td><b>FF_FAIL</b></td>
		<td>(hex) FFFFFFFF</td>
	</tr>
	<tr>
		<td><b>FF_TRUE</b></td>
		<td>1</td>
	</tr>
	<tr>
		<td><b>FF_FALSE</b></td>
		<td>0</td>
	</tr>
	<tr>
		<td><b>FF_SUPPORTED</b></td>
		<td>1</td>
	</tr>
	<tr>
		<td><b>FF_UNSUPPORTED</b></td>
		<td>0</td>
	</tr>
</table>


<h4>Remarks:</h4>
<ul type=disc>
	<li>
		In functions that return error codes any value other than 0 is assumed to be an
		error code. These are to be defined in each function below.	</li>
	<li>
		In functions that return a pointer, (hex) FFFFFFFF also represents a failure condition.</li>
</ul>

<p>&nbsp;</p>

<a name="CHAPTypes"><hr><h2>3. Enumerated and derived types</h2><hr>
</a>

<!-- /****************** InstanceIdentifier ******************/  -->
<a name="InstanceIdentifier">
	<table border=0 bgcolor="#E8E8E8">
	<tr>
		<td valign=top><h3>InstanceIdentifier</h3></td>
		<td valign=top>&nbsp;(32-bit unsigned integer)</td>
	</tr>
	</table>
</a>

<h4>Definition:</h4>

<table border=0>
<tr>
	<td valign=top><i>InstanceIdentifier:</i></td>
	<td>
		Unique identifier for the instance of a plugin. For some plugins, this value
		might represent a pointer to a plugin-specific data structure containing the
		instance's current state. Or it could be an index to a table of all active
		instances of a plugin, or any other value that uniquely identifies an instance.
	</td>
</tr>
</table>

<hr>

<!-- /****************** NumParameters ******************/  -->
<a name="NumParameters">
	<table border=0 bgcolor="#E8E8E8">
	<tr>
		<td valign=top><h3>NumParameters</h3></td>
		<td valign=top>&nbsp;(32-bit unsigned integer)
		</td>
	</tr>
	</table>
</a>

<h4>Definition:</h4>

<table border=0>
<tr>
	<td valign=top><i>NumParameters:</i></td>
	<td>Specifies the number of parameters that the plugin implements.</td>
</tr>
</table>

<hr>

<!-- /****************** ParameterNumber******************/  -->
<a name="ParameterNumber"></a>
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>ParameterNumber</h3></td>
		<td valign=top>&nbsp;(<a name="NumParameters">32-bit unsigned integer</a>)</td>
	</tr></table>

<h4>Definition:</h4>

<table border=0>
<tr>
	<td valign=top><i>ParameterNumber:</i></td>
	<td>Index of a parameter, starting at 0 for the first parameter.</td>
</tr>
</table>

<hr>

<!-- /****************** ParameterName******************/  -->
<a name="ParameterName">
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>ParameterName</h3></td>
		<td valign=top>&nbsp;(array of 16 1-byte ASCII characters, *not null terminated*)</td>
	</tr></table>
</a>

<h4>Definition:</h4>

<table border=0>
<tr>
	<td valign=top><i>ParameterName:</i></td>
	<td>The name of the Parameter as it will be displayed by the host on the UI.</td>
</tr>
</table>

<hr>

<!-- /****************** ParameterValue******************/  -->
<a name="ParameterValue">
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>ParameterValue</h3></td>
		<td valign=top>&nbsp;(32-bit float value OR 32-bit pointer)</td>
	</tr></table>
</a>

<h4>Definition:</h4>

<table border=0>
<tr>
	<td valign=top><i>ParameterValue:</i></td>
	<td>Float value from 0-1 or pointer to null terminated string. (See remarks)</td>
</tr>
</table>

<h4>Remarks:</h4>
<p>
Apart from text parameters, FreeFrame parameter values are always 32-bit floats,
and the range of values permitted is STRICTLY 0-1  (0 &lt;= ParameterValue &lt;= 1).
This allows faster processing and a good range of values over a standard
range, so the host can run up sliders or similar for the plugin.
<b>The Use of any values outside this range will result in hideous incompatibilities.</b>
The <a href="#ParameterDisplayValue"> ParameterDisplayValue</a> can be used to display whatever actual values
the plugin likes e.g. 0-255, 0-767, 1-256 or whatever.
The plugin should translate the standard 0-1 float range into the values it
needs for its processing.
<br>
For text parameters, this 32-bit value represents a pointer to a null terminated
string.
</p>

<hr>

<!-- /****************** ParameterDefaultValue******************/  -->
<a name="ParameterDefaultValue">
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>ParameterDefaultValue</h3></td>
		<td valign=top>&nbsp;(32-bit float value OR 32-bit pointer)</td>
	</tr></table>
</a>

<h4>Definition:</h4>

<table border=0>
<tr>
	<td valign=top><i>ParameterDefaultValue:</i></td>
	<td>The initial default value for this parameter. 32-bit float value or 32-bit pointer to null terminated string. (See remarks)</td>
</tr>
</table>

<h4>Remarks:</h4>
<p>
Plugins should always specify default values.
Sometimes a host may not implement all parameters on a plugin,
so the plugin must use default values until told to do otherwise by the host.
Apart from text parameters, FreeFrame parameter values are always 32-bit floats,
and the range of values permitted is STRICTLY 0-1.
<br>
For text parameters, this 32-bit value represents a pointer to a null terminated
string.
</p>

<hr>

<!-- /****************** ParameterDisplayValue******************/  -->
<a name="ParameterDisplayValue">
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>ParameterDisplayValue</h3></td>
		<td valign=top>&nbsp;(array of 16 1-byte ASCII characters, *not null
          terminated*)</td>
	</tr></table>
</a>

<h4>Definition:</h4>

<table border=0>
<tr>
	<td valign=top><i>ParameterDisplayValue:</i></td>
	<td>
		String representing the current display value of this parameter.
		The plugin can display whatever it
		likes here e.g. just the float, a rounded 0-100 '%' representation for the user,
		words representing states like 'on' / 'off',
		different effects that the one plugin can do etc...
	</td>
</tr>
</table>

<hr>

<!-- /****************** PluginCapsIndex******************/  -->
<a name="PluginCapsIndex"></a>
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>PluginCapsIndex</h3></td>
		<td valign=top>&nbsp;(<a name="NumParameters">32-bit unsigned integer</a>)</td>
	</tr></table>

<h4>Definition:</h4>

<table border=0>
<tr>
	<td valign=top><i>PluginCapsIndex:</i></td>
	<td>
		32-bit unsigned integer. Specifies certain capabilities of a plugin that the host may
		want to enquire about.:<br>
		0 = 16-bit 5-6-5 pixelformat support<br>
		1 = 24-bit pixelformat support<br>
		2 = 32-bit (or 24-bit 32-bit aligned) pixelformat support<br>
		&nbsp;<br>
		3 = Plugin supports <a href="#processFrameCopy">processFrameCopy</a> function<br>
		&nbsp;<br>
		4 = Plugin supports <a href="#processOpengl">processOpengl</a> function<br>
		&nbsp;<br>
		5 = Plugin supports <a href="#setTime">setTime</a> function<br>
		&nbsp;<br>
		Calls to these caps indexes are only meaningful if the plugin has reported
		that it supports <a href="#processFrameCopy">processFrameCopy</a> or
		<a href="#processOpengl">processOpengl</a>:<br>
		10 = Minimum input frames<br>
		11 = Maximum input frames<br>
		<br>
		Calls to this caps index are only meaningful if the plugin has reported
		that it supports <a href="#processFrameCopy">processFrameCopy</a>:<br>
		15 = Plugin optimized for copy or in-place processing
	</td>
</tr>
</table>

<h4>Remarks:</h4>
<p>
See <a href="#getPluginCaps">getPluginCaps</a> for more information about the usage
of this structure.
</p>
<p>
See <a href="#VideoInfoStruct">VideoInfoStruct</a> for more information about the
pixelformats.
</p>

<hr>

<!-- /****************** ParameterType ******************/  -->
<a name="ParameterType"></a>
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>ParameterType</h3></td>
		<td valign=top>&nbsp;(<a name="NumParameters">32-bit unsigned integer</a>)</td>
	</tr></table>

<h4>Definition:</h4>

<table border=0>
<tr>
	<td valign=top><i>ParameterType:</i></td>
	<td>
		32-bit unsigned integer. Tells the host what kind of data the
		parameter is. Current meaningful values:<br>
		<table border=0>
		<tr>
			<td><b>Value</b></td>
			<td><b>Type</b></td>
			<td><b>Description</b></td>
		</tr>
		<tr>
			<td>0</td>
			<td>boolean</td>
			<td>0.0 defined as false and anything else defined as true - e.g. checkbox</td>
		</tr>
		<tr>
			<td>1</td>
			<td>event</td>
			<td>
				Similar to boolean but for a momentary push button style trigger.
                1.0 is set momentarily to denote a simple event - e.g. pushbutton / keystroke.			</td>
		</tr>
		<tr>
			<td>2</td>
			<td>red</td>
			<td rowspan=3>
        The 3 colors e.g. for a colorpicker			</td>
		</tr>
		<tr>
			<td>3</td>
			<td>green</td>
		</tr>
		<tr>
			<td>4</td>
			<td>blue</td>
		</tr>
		<tr>
			<td>5</td>
			<td>xpos</td>
			<td rowspan=2>
				For x, y video interaction e.g. cursor - these define a position within the processed video frames.
			</td>
		</tr>
		<tr>
			<td>6</td>
			<td>ypos</td>
		</tr>
		<tr>
			<td>10</td>
			<td>standard</td>
			<td>A standard parameter representing an unspecified float value</td>
		</tr>
		<tr>
		  <td>11</td>
		  <td>alpha</td>
		  <td>Transparency value esp. for use in a 3 colour colourpicker + alpha </td>
		  </tr>
		<tr>
			<td>100</td>
			<td>text</td>
			<td>
				A null terminated text input type - Note: only this type has a
				different data type for the moment			</td>
		</tr>
		</table>
	</td>
</tr>
</table>

<h4>Remarks:</h4>
<p>
The range of values permitted for all variables (except text) is strictly 0-1.<br><br>
For the xpos and ypos parameter types, GPU plugin coordinates (0,0) refer to the bottom left corner
of the processed frame, and coordinates (1,1) refer to the upper right corner. CPU plugin coordinates (0,0) may be at the bottom left or top left,
and (1,1) at the top right or bottom right, depending on the orientation defined in the <a href="#VideoInfoStruct">VideoInfoStruct</a>.

</p>

<hr>

<!-- /****************** InputChannel******************/  -->
<a name="InputChannel">
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>InputChannel</h3></td>
		<td valign=top>&nbsp;32-bit unsigned integer</td>
	</tr></table>
</a>

<h4>Definition:</h4>

<table border=0>
<tr>
	<td valign=top><i>InputChannel:</i></td>
	<td>
		Input channel as relates to the use of multiple inputs in <a href="#processFrameCopy">processFrameCopy</a>
		The first channel is 0.
	</td>
</tr>
</table>

<hr>

<!-- /****************** InputStatus******************/  -->
<a name="InputStatus">
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>InputStatus</h3></td>
		<td valign=top>&nbsp;32-bit unsigned integer</td>
	</tr></table>
</a>

<h4>Definition:</h4>

<table border=0>
<tr>
	<td valign=top><i>InputStatus:</i></td>
	<td>
		Status of input channels as relates to the use of multiple inputs in <a href="#processFrameCopy">processFrameCopy</a>.<br>
		0 = Not in use<br>
		1 = In Use
	</td>
</tr>
</table>


<p>&nbsp;</p>

<a name="CHAPStructures">
<hr><h2>4. Structures</h2><hr>
</a>

<!-- /****************** PluginInfoStruct ******************/  -->
<a name="PluginInfoStruct">
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>PluginInfoStruct</h3></td>
		<td valign=top>&nbsp;(size = 32 bytes)</td>
	</tr></table>
</a>

<pre>
PluginInfoStruct {
  <b>APIMajorVersion:</b> 32-bit unsigned integer
  <b>APIMinorVersion:</b> 32-bit unsigned integer
  <b>PluginUniqueID:</b> 4 1-byte ASCII characters *not null terminated*
  <b>PluginName:</b> 16 1-byte ASCII characters *not null terminated*
  <b>PluginType:</b> 32-bit unsigned integer
}
</pre>

<h4>Fields:</h4>
<table border=0>
<tr>
	<td valign=top><i>APIMajorVersion:</i></td>
	<td>Represents number before decimal point in version numbers</td>
</tr>
<tr>
	<td valign=top><i>APIMinorVersion:</i></td>
	<td>Represents number after decimal point in version numbers</td>
</tr>
<tr>
	<td valign=top><i>PluginUniqueID:</i></td>
	<td>Unique ID for plugin</td>
</tr>
<tr>
	<td valign=top><i>PluginName:</i></td>
	<td>Name of plugin</td>
</tr>
<tr>
	<td valign=top><i>PluginType:</i></td>
	<td>
		Current meaningful values:<br>
		0 = effect<br>
		1 = source<br>
		(see remarks)
	</td>
</tr>
</table>

<h4>Remarks:</h4>
<p>
Plugins of PluginType effect process one or more input frames to create an output frame.
Source plugins create an output based only on the plugin parameters, and do
not expect or use any input frames.
</p>
<p>
FreeFrame APIMinorVersion numbers should always have 3 digits - so divide the
minor version number by 1000 and add the major version number to get the full
version number.
<br>
Example: for version 0.511, APIMajorVersion=0 and APIMinorVersion=511.
</p>

<hr>

<!-- /****************** VideoInfoStruct ******************/  -->
<a name="VideoInfoStruct">
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>VideoInfoStruct</h3></td>
		<td valign=top>&nbsp;(size = 16 bytes)</td>
	</tr></table>
</a>
<pre>
VideoInfoStruct {
  <b>FrameWidth:</b> 32-bit unsigned integer
  <b>FrameHeight:</b> 32-bit unsigned integer
  <b>BitDepth:</b> 32-bit unsigned integer
  <b>Orientation:</b> 32-bit unsigned integer
}
</pre>

<h4>Fields:</h4>
<table border=0>
<tr>
	<td valign=top><i>FrameWidth:</i></td>
	<td>Width of video frame in pixels</td>
</tr>
<tr>
	<td valign=top><i>FrameHeight:</i></td>
	<td>Height of video frame in pixels</td>
</tr>
<tr>
	<td valign=top><i>BitDepth:</i></td>
	<td>Current meaningful values:<br>
		0 = 16-bit, 5-6-5 packed<br>
		1 = 24-bit, packed (see remarks)<br>
		2 = 32-bit, also suitable for 32-bit unsigned integer aligned 24-bit (see remarks).<br>
		(see remarks)
	</td>
</tr>
<tr>
	<td valign=top><i>Orientation:</i></td>
	<td>Current meaningful values:<br>
		1 = origin at top left<br>
		2 = origin at bottom left<br>
		(see remarks)
	</td>
</tr>
</table>

<h4>Remarks:</h4>
<p>
This structure is provided by the host when a CPU plugin is instantiated.
When a GPU plugin is instantiated, it is passed a <a href="#FFGLViewportStruct">FFGLViewportStruct</a>. The remarks below
are not relevant to GPU plugins.
</p>
<p>
Video frames are provided to CPU plugins as large buffers of pixels. The Red, Green, Blue,
and sometimes Alpha values of a single pixel are located at consecutive memory locations.
A video buffer consists of FrameWidth x FrameHeight pixels.
</p>
<p>
Plugins using 32-bit as byte aligned 24-bit video should be careful not to
overwrite the alpha (4th) byte of each pixel (e.g. by using it as a processing
space) as this may be used soon by hosts with 32-bit video processing becoming
more accessible.
</p>
<p>
If Orientation == 1 the first pixel at the pointer to the frame is the top left
pixel. If Orientation == 2, it is the bottom left pixel. This is particularly important for text and
live input (to avoid mirroring of the image).
</p>
<p>
The byte order of color values depends on the target platform (i.e. big-endian versus little-endian). For little-endian platforms
(e.g. Intel PC), the byte order is BGRA for 32-bit and BGR for 24-bit colors.
For big-endian machines (e.g. MAC), the byte order for 32-bit is ARGB and RGB for 24-bit.<br>
For all target platforms, the unsigned integer representation of a 32-bit color is the same, namely (in C syntax):
<pre>
unsigned int color = (A << 24) + (R << 16) + (G << 8) + (B << 0);
</pre>
where A, R, G, B are the 8-bit color components. Plugin developers who aim for platform-independence should be aware of these
differences and program their plugins accordingly.
</p>

<hr>

<!-- /****************** SetParameterStruct ******************/  -->
<a name="SetParameterStruct">
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>SetParameterStruct</h3></td>
		<td valign=top>&nbsp;(size = 8 bytes)</td>
	</tr></table>
</a>

<pre>
SetParameterStruct {
  <b>ParameterNumber:</b> <a href="#ParameterNumber">ParameterNumber</a>
  <b>NewParameterValue:</b> <a href="#ParameterValue">ParameterValue</a>
}
</pre>

<h4>Fields:</h4>
<table border=0>
<tr>
	<td valign=top><i>ParameterNumber:</i></td>
	<td>Index of the parameter to set.</td>
</tr>
<tr>
	<td valign=top><i>NewParameterValue:</i></td>
	<td>
		New value for this parameter. For float parameters, this is a float from 0-1.
		For text parameters, this is a pointer to a null terminated string
		(see <a href="#ParameterValue">ParameterValue</a>).
	</td>
</tr>
</table>

<hr>

<!-- /****************** PluginExtendedInfoStruct ******************/  -->
<a name="PluginExtendedInfoStruct">
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>PluginExtendedInfoStruct</h3></td>
		<td valign=top>&nbsp;(size = 24 bytes)</td>
	</tr></table>
</a>

<pre>
PluginExtendedInfoStruct{
  <b>PluginMajorVersion:</b> 32-bit unsigned integer
  <b>PluginMinorVersion:</b> 32-bit unsigned integer
  <b>Description:</b> 32-bit pointer to null terminated string
  <b>About:</b> 32-bit pointer to null terminated string
  <b>FreeFrameExtendedDataSize:</b> 32-bit unsigned integer
  <b>FreeFrameExtendedDataBlock:</b> 32-bit pointer
}
</pre>

<h4>Fields:</h4>
<table border=0>
<tr>
	<td valign=top><i>PluginMajorVersion:</i></td>
	<td>
		Represents number before decimal point in version numbers.
	</td>
</tr>
<tr>
	<td valign=top><i>PluginMinorVersion:</i></td>
	<td>
		Represents number after decimal point in version numbers.
	</td>
</tr>
<tr>
	<td valign=top><i>Description:</i></td>
	<td>
		A description of the plugin - intended to be made available to the user
		in hosts supporting this function via the UI. Pointer value can be 0
		if not provided by plugin!
	</td>
</tr>
<tr>
	<td valign=top><i>About:</i></td>
	<td>
		Author and license information. Pointer value can be 0
		if not provided by plugin!
	</td>
</tr>
<tr>
	<td valign=top><i>FreeFrameExtendedDataSize:</i></td>
	<td>
		Size in bytes of the FreeFrameExtendedDataBlock - or 0 if not provided by plugin.
	</td>
</tr>
<tr>
	<td valign=top><i>FreeFrameExtendedDataBlock:</i></td>
	<td>
		32-bit pointer to a FreeFrame ExtendedDataBlock
		- this interface is not yet in use, but provided
		to allow the FreeFrame project to establish an
		extended data block format in the future.
		Please do not use until a data format has been agreed.
	</td>
</tr>
</table>

<h4>Remarks:</h4>
<p>
FreeFrame PluginMinorVersion numbers should always have 3 digits - so divide the
minor version number by 1000 and add the major version number to get the full
version number.  Example: 0.751 APIMajorVersion=0, APIMinorVersion=751
</p>

<hr>

<!-- /****************** ProcessFrameCopyStruct ******************/  -->
<a name="ProcessFrameCopyStruct">
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>ProcessFrameCopyStruct</h3></td>
		<td valign=top>&nbsp;(size = 12 bytes)</td>
	</tr></table>
</a>

<pre>
ProcessFrameCopyStruct{
  <b>numInputFrames:</b> 32-bit unsigned integer
  <b>ppInputFrames:</b> 32-bit pointer to array of pointers
  <b>pOutputFrame:</b> 32-bit pointer
}
</pre>

<h4>Fields:</h4>
<table border=0>
<tr>
	<td valign=top><i>numInputFrames:</i></td>
	<td>Number of input frames contained in ppInputFrames.</td>
</tr>
<tr>
	<td valign=top><i>ppInputFrames:</i></td>
	<td>A pointer to an array of pointers to input frames.</td>
</tr>
<tr>
	<td valign=top><i>pOutputFrame:</i></td>
	<td>
		Pointer to output frame.
	</td>
</tr>
</table>

<hr>

<!-- /****************** FFGLTextureStruct ******************/ -->
<a name="FFGLTextureStruct">
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>FFGLTextureStruct</h3></td>
		<td valign=top>&nbsp;(size = 20 bytes)</td>
	</tr></table>
</a>

<pre>
FFGLTextureStruct {
  <b>Width:</b> 32-bit unsigned integer
  <b>Height:</b> 32-bit unsigned integer
  <b>HardwareWidth:</b> 32-bit unsigned integer
  <b>HardwareHeight:</b> 32-bit unsigned integer
  <b>Handle:</b> 32-bit unsigned integer (GLuint)
}
</pre>

<h4>Fields:</h4>
<table border=0>
<tr>
	<td valign=top><i>Width:</i></td>
	<td>Width (in pixels) of video frame</td>
</tr>
<tr>
	<td valign=top><i>Height:</i></td>
	<td>Height (in pixels) of video frame</td>
</tr>
<tr>
	<td valign=top><i>HardwareWidth:</i></td>
	<td>Width (in pixels) of GPU texture storing the video frame</td>
</tr>
<tr>
	<td valign=top><i>HardwareHeight:</i></td>
	<td>Height (in pixels) of GPU texture storing the video frame</td>
</tr>
<tr>
	<td valign=top><i>Handle:</i></td>
	<td>The OpenGL texture handle, from glGenTextures, use with glBindTexture</td>
</tr>
</table>

<h4>Remarks:</h4>
<p>Hosts must provide textures of type GL_TEXTURE_2D. GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_3D, etc, are NOT supported.
</p>

<hr>

<!-- /****************** FFGLViewportStruct ******************/ -->
<a name="FFGLViewportStruct" id="FFGLViewportStruct">
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>FFGLViewportStruct</h3></td>
		<td valign=top>&nbsp;(size = 16 bytes)</td>
	</tr></table>
</a>

<pre>
FFGLViewportStruct {
   <b>X:</b> 32-bit unsigned integer
   <b>Y:</b> 32-bit unsigned integer
   <b>Width:</b> 32-bit unsigned integer
   <b>Height:</b> 32-bit unsigned integer
}
</pre>

<h4>Fields:</h4>
<table border=0>
<tr>
	<td valign=top><i>X:</i></td>
	<td>X-coordinate of the viewport's bottom left corner</td>
</tr>
<tr>
	<td valign=top><i>Y:</i></td>
	<td>Y-coordinate of the viewport's bottom left corner</td>
</tr>
<tr>
	<td valign=top><i>Width:</i></td>
	<td>Width of viewport</td>
</tr>
<tr>
	<td valign=top><i>Height:</i></td>
	<td>Height of viewport</td>
</tr>
</table>

<h4>Remarks:</h4>
<p>
This structure is provided by the host when a GPU plugin is instantiated.
When a CPU plugin is instantiated, it is passed a <a href="#VideoInfoStruct">VideoInfoStruct</a>. The remarks below
are not relevant to CPU plugins.
</p>
<p>
GPU plugins draw their output into the host's OpenGL viewport during calls to <a href="#processOpengl">processOpenGL</a>. Plugins can expect that this viewport will not change during the lifetime of the plugin.
If the host's viewport changes (perhaps because the user changed their output window size or output resolution), any loaded plugins must be deinstantiated and reinstantiated and provided with the new viewport information.
</p>

<hr>

<!-- /****************** ProcessOpenGLStruct ******************/ -->
<a name="ProcessOpenGLStruct">
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>ProcessOpenGLStruct</h3></td>
		<td valign=top>&nbsp;(size = 12 bytes)</td>
	</tr></table>
</a>

<pre>
ProcessOpenGLStruct {
   <b>numInputTextures:</b> 32-bit unsigned integer
   <b>ppInputTextures:</b> 32-bit pointer to array of pointers to <a href="#FFGLTextureStruct">FFGLTextureStruct</a>
   <b>HostFBO:</b> 32-bit unsigned integer (GLuint)
}
</pre>

<h4>Fields:</h4>
<table border=0>
<tr>
	<td valign=top><i>numInputTextures:</i></td>
	<td>Number of input textures contained in ppInputTextures</td>
</tr>
<tr>
  <td valign=top><i>ppInputTextures:</i></td>
  <td>A pointer to an array of pointers to input textures</td>
</tr>
<tr>
	<td valign=top><i>HostFBO:</i></td>
	<td>32-bit unsigned integer (GLuint) see Remarks below </td>
</tr>
</table>

<h4>Remarks:</h4>
<p>Hosts must provide textures of type GL_TEXTURE_2D. GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_3D, etc, are NOT supported.

<p>Hosts will often wish to capture the output of a GPU plugin to an offscreen texture. Hosts and plugins *must* use the
   the EXT_framebuffer_object ("FBO") extension to do this. Use of any other methods (such as 'PBuffers') is not supported.
<p>When a host calls ProcessOpenGL with an FBO active, the host must provide the handle to the FBO in the 'HostFBO' field.
   Plugins that use their own FBOs internally must restore the host's FBO with a call to glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, HostFBO)
   so that the host can successfully capture the output of the plugin.
<p>When a host calls ProcessOpenGL with no FBO active, it must pass a value of 0 in the 'HostFBO' field.
<br><br>
<a name="CHAPFunctions">
	<hr><h2>5. Functions</h2><hr>
</a>
<p>Some functions are specific to an instance of a plugin, and thus require a
valid InstanceID in the InstanceID field, others concern global parameters
that are the same for all instances, and so do not require a valid InstanceID.</p>

<a name="functiontable">
	<h3>Function Code Table</h3>
</a>

<h4>Global functions:</h4>

<table border=1>
	<tr>
		<td><b>Code</b></td>
		<td><b>Function</b></td>
		<td><b>Input value type</b></td>
		<td><b>Output value type</b></td>
	</tr>

	<tr>
		<td>0</td>
		<td><a href="#getInfo">getInfo</a></td>
		<td>none</td>
		<td>Pointer to a <a href="#PluginInfoStruct">PluginInfoStruct</a></td>
	</tr>

	<tr>
		<td>1</td>
		<td><a href="#initialise">initialise</a></td>
		<td>none</td>
		<td>Success/error code</td>
	</tr>

	<tr>
		<td>2</td>
		<td><a href="#deInitialise">deInitialise</a></td>
		<td>none</td>
		<td>Success/error code</td>
	</tr>

	<tr>
		<td>4</td>
		<td><a href="#getNumParameters">getNumParameters</a></td>
		<td>none</td>
		<td><a href="#NumParameters">NumParameters</a></td>
	</tr>

	<tr>
		<td>5</td>
		<td><a href="#getParameterName">getParameterName</a></td>
		<td><a href="#ParameterNumber">ParameterNumber</a></td>
		<td>Pointer to <a href="#ParameterName">ParameterName</a></td>
	</tr>

	<tr>
		<td>6</td>
		<td><a href="#getParameterDefault">getParameterDefault</a></td>
		<td><a href="#ParameterNumber">ParameterNumber</a></td>
		<td><a href="#ParameterDefaultValue">ParameterDefaultValue</a></td>
	</tr>

	<tr>
		<td>10</td>
		<td><a href="#getPluginCaps">getPluginCaps</a></td>
		<td><a href="#PluginCapsIndex">PluginCapsIndex</a></td>
		<td>Supported/unsupported/value</td>
	</tr>

	<tr>
		<td>13</td>
		<td><a href="#getExtendedInfo">getExtendedInfo</a></td>
		<td>none</td>
		<td>Pointer to <a href="#PluginExtendedInfoStruct">PluginExtendedInfoStruct</a></td>
	</tr>

	<tr>
		<td>15</td>
		<td><a href="#getParameterType">getParameterType</a></td>
		<td><a href="#ParameterNumber">ParameterNumber</a></td>
		<td><a href="#ParameterType">ParameterType</a></td>
	</tr>

</table>

<h4>Instance specific functions:</h4>

<table border=1>
	<tr>
		<td><b>Code</b></td>
		<td><b>Function</b></td>
		<td><b>Input value type</b></td>
		<td><b>Output value type</b></td>
	</tr>

	<tr>
		<td>3</td>
		<td><a href="#processFrame">processFrame</a></td>
		<td>Pointer to a frame of video</td>
		<td>Success/error code</td>
	</tr>

	<tr>
		<td>7</td>
		<td><a href="#getParameterDisplay">getParameterDisplay</a></td>
		<td><a href="#ParameterNumber">ParameterNumber</a></td>
		<td>Pointer to <a href="#ParameterDisplayValue">ParameterDisplayValue</a></td>
	</tr>

	<tr>
		<td>8</td>
		<td><a href="#setParameter">setParameter</a></td>
		<td>Pointer to <a href="#SetParameterStruct">SetParameterStruct</a></td>
		<td>Success/error code</td>
	</tr>

	<tr>
		<td>9</td>
		<td><a href="#getParameter">getParameter</a></td>
		<td><a href="#ParameterNumber">ParameterNumber</a></td>
		<td><a href="#ParameterValue">ParameterValue</a></td>
	</tr>

	<tr>
		<td>11</td>
		<td><a href="#instantiate">instantiate</a></td>
		<td>Pointer to <a href="#VideoInfoStruct">VideoInfoStruct</a></td>
		<td><a href="#InstanceIdentifier">InstanceIdentifier</a></td>
	</tr>

	<tr>
		<td>12</td>
		<td><a href="#deInstantiate">deInstantiate</a></td>
		<td>none</td>
		<td>Success/error code</td>
	</tr>

	<tr>
		<td>14</td>
		<td><a href="#processFrameCopy">processFrameCopy</a></td>
		<td>Pointer to <a href="#ProcessFrameCopyStruct">ProcessFrameCopyStruct</a></td>
		<td>Success/error code</td>
	</tr>

	<tr>
		<td>16</td>
		<td><a href="#getInputStatus">getInputStatus</a></td>
		<td><a href="#InputChannel">InputChannel</a></td>
		<td><a href="#InputStatus">InputStatus</a></td>
	</tr>
	<tr>
      <td>17</td>
	  <td><a href="#processOpengl">processOpengl</a></td>
	  <td>pointer to <a href="#ProcessOpenGLStruct">ProcessOpenGLStruct</a></td>
	  <td>Success/error code </td>
  </tr>

	<tr>
	  <td>18</td>
	  <td><a href="#instantiateGL">instantiateGL</a></td>
	  <td>pointer to <a href="#FFGLViewportStruct">FFGLViewportStruct</a></td>
	  <td>InstanceIdentifier</td>
  </tr>
	<tr>
	  <td>19</td>
	  <td><a href="#deInstantiateGL">deInstantiateGL</a></td>
	  <td>none</td>
	  <td>Success/error code</td>
  </tr>
  <tr>
	  <td>20</td>
	  <td><a href="#setTime">setTime</a></td>
	  <td>Pointer to 64-bit float representing time in seconds</td>
	  <td>Success/error code</td>
  </tr>
</table>

<p>&nbsp;</p>

<a name="CHAPFunctionsGlobal">
<hr><h2>5.1. Global functions</h2><hr>
</a>

<!-- /****************** getInfo ******************/  -->
<a name="getInfo">
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>getInfo</h3></td>
		<td valign=top>&nbsp;(function code = 0)</td>
	</tr></table>
</a>

<h4>Input value:</h4>
<i>none</i>

<h4>Return value:</h4>
32-bit pointer to <A href="#PluginInfoStruct">PluginInfoStruct</a> if successful,
<a href="#FF_FAIL">FF_FAIL</a> otherwise.

<h4>Remarks:</h4>
<p>
Gets information about the plugin - version, unique id, short name and type (see
<a href="#PluginInfoStruct">PluginInfoStruct</a>).
<br>
This function should be identical in all future versions of the FreeFrame API.
</p>

<table border=0>
<tr>
	<td valign=top>HOST:</td>
	<td>
		Call this function first to get version information.
		The version defines the other function codes that are supported.
	</td>
</tr>
</table>

<hr>

<!-- /****************** initialise ******************/  -->
<a name="initialise"></a>
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>initialise</h3></td>
		<td valign=top>&nbsp;(function code = 1)</td>
	</tr></table>

<h4>Input value:</h4>
<i>none</i>

<h4>Return value:</h4>
<a href="#FF_SUCCESS">FF_SUCCESS</a> if successful, <a href="#FF_FAIL">FF_FAIL</a> or
other error-codes if failed. (32-bit unsigned integer)

<h4>Remarks:</h4>

<table border=0>
<tr>
	<td valign=top>PLUGIN:</td>
	<td>
		Prepare the plug-in for processing.
		Set default values, allocate memory.
		When the plug-in returns from this function it must be ready to accept calls to
        <a href="#instantiate">
		instantiate</a>.
	</td>
</tr>
<tr>
	<td valign=top>HOST:</td>
	<td>
		This function *must* return before a call to <a href="#instantiate">instantiate</a>.
	</td>
</tr>
</table>

<hr>

<!-- /****************** deInitialise ******************/  -->
<a name="deInitialise"></a>
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>deInitialise</h3></td>
		<td valign=top>&nbsp;(function code = 2)</td>
	</tr></table>

<h4>Input value:</h4>
<i>none</i>

<h4>Return value:</h4>
<a href="#FF_SUCCESS">FF_SUCCESS</a> if successful, <a href="#FF_FAIL">FF_FAIL</a> or
other error-codes if failed. (32-bit unsigned integer)

<h4>Remarks:</h4>
<table border=0>
<tr>
	<td valign=top>PLUGIN:</td>
	<td>Tidy up, deallocate memory</td>
</tr>
<tr>
	<td valign=top>HOST:</td>
	<td>This *must* be the last function called on the plugin</td>
</tr>
</table>

<hr>

<!-- /****************** getNumParameters ******************/  -->
<a name="getNumParameters"></a>
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>getNumParameters</h3></td>
		<td valign=top>&nbsp;(function code = 4)</td>
	</tr></table>

<h4>Input value:</h4>
<i>none</i>

<h4>Return value:</h4>
 <a href="#NumParameters">NumParameters</a> indicating the number of parameters in plugin
or <a href="#FF_FAIL">FF_FAIL</a> on error.
<h4>Remarks:</h4>

<table border=0>
<tr>
	<td valign=top>PLUGIN:</td>
	<td>
		Plugin developers should normally expect hosts to expose up to 8 parameters
		Some hosts may only expose 1 or 4 parameters, some may expose larger numbers.
		All parameters should have sensible defaults incase the user is unable to
		control them from the host.
	</td>
</tr>
<tr>
	<td valign=top>HOST:</td>
	<td>
		Host developers should try to implement at least the first 4 parameters.
		8 is the recommended number to expose.
	</td>
</tr>
</table>

<hr>

<!-- /****************** getParameterName ******************/  -->
<a name="getParameterName"></a>
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>getParameterName</h3></td>
		<td valign=top>&nbsp;(function code = 5)</td>
	</tr></table>

<h4>Input value:</h4>
<table border=0>
<tr>
	<td><i>index:</i></td>
	<td>
        <a href="#ParameterNumber">ParameterNumber</a>
	</td>
</tr>
</table>

<h4>Return value:</h4>
32-bit pointer to <a href="#ParameterName">ParameterName</a> (16 byte char array) containing the name of parameter specified by
index.
Returns <a href="#FF_FAIL">FF_FAIL</a> on error.

<hr>

<!-- /****************** getParameterDefault******************/  -->
<a name="getParameterDefault"></a>
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>getParameterDefault</h3></td>
		<td valign=top>&nbsp;(function code = 6)</td>
	</tr></table>

<h4>Input value:</h4>
<table border=0>
<tr>
	<td><i>index:</i></td>
	<td>
        <a href="#ParameterNumber">ParameterNumber</a>
	</td>
</tr>
</table>

<h4>Return value:</h4>
<a href="#ParameterDefaultValue">ParameterDefaultValue</a> indicating the default value of parameter specified by index.
For float parameters, the return value is a 32-bit float (0&lt;=value&lt;=1). Return value
for text parameters is a 32-bit pointer to a null terminated string.
<br>
Returns <a href="#FF_FAIL">FF_FAIL</a> on error.

<hr>

<!-- /****************** getPluginCaps ******************/  -->
<a name="getPluginCaps"></a>
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>getPluginCaps</h3></td>
		<td valign=top>&nbsp;(function code = 10)</td>
	</tr></table>

<h4>Input value:</h4>
<table border=0>
<tr>
	<td><i>capsIndex:</i></td>
	<td>
		<a href="#PluginCapsIndex">PluginCapsIndex</a>
	</td>
</tr>
</table>

<h4>Return value:</h4>
32-bit unsigned integer<br><Br>
Use the table below to determine what value to return for each capability (see <a href="#PluginCapsIndex">PluginCapsIndex</a>).
<br><br>
<table border=1>
	<tr>
		<td valign=top><b>capsIndex value</b></td>
		<td valign=top><b>capsIndex meaning</b></td>
		<td valign=top><b>return values</b></td>
	</tr>
	<tr>
		<td valign=top>0 (FF_CAP_16BITVIDEO)</td>
		<td valign=top>16 bit video</td>
		<td valign=top>
			<a href="#FF_SUPPORTED">FF_SUPPORTED</a>: plugin supports 16 bit video<br>
			<a href="#FF_UNSUPPORTED">FF_UNSUPPORTED</a>: plugin doesn't support 16 bit video
		</td>
	</tr>
	<tr>
		<td valign=top>1 (FF_CAP_24BITVIDEO)</td>
		<td valign=top>24 bit video</td>
		<td valign=top>
			<a href="#FF_SUPPORTED">FF_SUPPORTED</a>: plugin supports 24 bit video<br>
			<a href="#FF_UNSUPPORTED">FF_UNSUPPORTED</a>: plugin doesn't support 24 bit video
		</td>
	</tr>
	<tr>
		<td valign=top>2 (FF_CAP_32BITVIDEO)</td>
		<td valign=top>32 bit video</td>
		<td valign=top>
			<a href="#FF_SUPPORTED">FF_SUPPORTED</a>: plugin supports 32 bit video<br>
			<a href="#FF_UNSUPPORTED">FF_UNSUPPORTED</a>: plugin doesn't support 32 bit video
		</td>
	</tr>
	<tr>
		<td valign=top>3 (FF_CAP_PROCESSFRAMECOPY)</td>
		<td valign=top><a href="#processFrameCopy">processFrameCopy</a> support</td>
		<td valign=top>
			<a href="#FF_SUPPORTED">FF_SUPPORTED</a>: plugin supports <a href="#processFrameCopy">processFrameCopy</a><br>
			<a href="#FF_UNSUPPORTED">FF_UNSUPPORTED</a>: plugin doesn't support <a href="#processFrameCopy">processFrameCopy</a>
		</td>
	</tr>
	<tr>
		<td valign=top>4 (FF_CAP_PROCESSOPENGL)</td>
		<td valign=top><a href="#processOpengl">processOpengl</a> support</td>
		<td valign=top>
			<a href="#FF_SUPPORTED">FF_SUPPORTED</a>: plugin supports <a href="#processOpengl">processOpengl</a><br>
			<a href="#FF_UNSUPPORTED">FF_UNSUPPORTED</a>: plugin doesn't support <a href="#processOpengl">processOpengl</a>
		</td>
	</tr>

	<tr>
		<td valign=top>5 (FF_CAP_SETTIME)</td>
		<td valign=top><a href="#setTime">setTime</a> support</td>
		<td valign=top>
			<a href="#FF_SUPPORTED">FF_SUPPORTED</a>: plugin supports <a href="#setTime">setTime</a><br>
			<a href="#FF_UNSUPPORTED">FF_UNSUPPORTED</a>: plugin doesn't support <a href="#setTime">setTime</a>
		</td>
	</tr>

	<tr>
		<td valign=top>10 (FF_CAP_MINIMUMINPUTFRAMES)</td>
		<td>Minimum input frames</td>
		<td>Returns minimum number of input frames plugin requires or <a href="#FF_UNSUPPORTED">FF_UNSUPPORTED</a> if capability not supported.</td>
	</tr>
	<tr>
		<td valign=top>11 (FF_CAP_MAXIMUMINPUTFRAMES)</td>
		<td valign=top>Maximum input frames</td>
		<td valign=top>Returns maximum number of input frames plugin can process or <a href="#FF_UNSUPPORTED">FF_UNSUPPORTED</a> if capability not supported.</td>
	</tr>
	<tr>
		<td valign=top>15 (FF_CAP_COPYORINPLACE)</td>
		<td valign=top>Plugin optimization</td>
		<td valign=top>
			Return value indicates whether plugin is optimized for Copy or InPlace processing.<br>
			0 (FF_UNSUPPORTED) = no preference<br>
			1 (FF_CAP_PREFER_INPLACE) = InPlace processing is faster<br>
			2 (FF_CAP_PREFER_COPY) = Copy processing is faster<br>
			3 (FF_CAP_PREFER_BOTH) = Both are optimized<br>
		</td>
	</tr>
</table>

<h4>Remarks:</h4>
<p>
Plugins must support either CPU or GPU processing, but not both. CPU processing involves repeated calls to <a href="#processFrame">processFrame</a> and/or
<a href="#processFrameCopy">processFrameCopy</a>. GPU processing involves repeated calls to <a href="#processOpengl">processOpenGL</a>.
<br><Br>
CPU plugins should return FF_UNSUPPORTED (0) for FF_CAP_PROCESSOPENGL.
<br><br>
GPU plugins should return FF_SUPPORTED (1) for FF_CAP_PROCESSOPENGL.<br><br>
GPU plugins should return FF_UNSUPPORTED (0) for FF_CAP_16BITVIDEO,
FF_CAP_24BITVIDEO, FF_CAP_32BITVIDEO, FF_CAP_PROCESSFRAMECOPY, and FF_CAP_COPYORINPLACE.
<br><br>
FF_CAP_MINIMUMINPUTFRAMES, FF_CAP_MAXIMUMINPUTFRAMES, and FF_CAP_SETTIME apply to both CPU and GPU plugins, so all plugins should return appropriate values for these queries.
<br><br>
CPU PLUGIN/HOST BIT DEPTH<br>
Typically a host program has a preferred bit depth that it uses to perform its operations, and it will ask the plugin if it supports that bit depth.
If the plugin does not support it, the host may decide not to use the plugin and deinitialize it. If the host supports a 2nd or 3rd format, it may
check with the plugin to see if those are supported, and use one of them instead.


<hr>

<!-- /****************** getExtendedInfo******************/  -->
<a name="getExtendedInfo"></a>
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>getExtendedInfo</h3></td>
		<td valign=top>&nbsp;(function code = 13)</td>
	</tr></table>

<h4>Input value:</h4>
<i>none</i>

<h4>Return value:</h4>
32-bit pointer to <a href="#PluginExtendedInfoStruct">PluginExtendedInfoStruct</a> or
<a href="#FF_FAIL">FF_FAIL</a> on error.

<hr>

<!-- /****************** getParameterType ******************/  -->
<a name="getParameterType"></a>
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>getParameterType</h3></td>
		<td valign=top>&nbsp;(function code = 15)</td>
	</tr></table>

<h4>Input value:</h4>
<table border=0>
<tr>
	<td><i>index:</i></td>
	<td>
        <a href="#ParameterNumber">ParameterNumber</a>
	</td>
</tr>
</table>

<h4>Return value:</h4>
<a href="#ParameterType">ParameterType</a> value which tells the host what kind of data the
parameter index is.<br>
Returns <a href="#FF_FAIL">FF_FAIL</a> on error.

<h4>Remarks:</h4>
<p>
Hosts may decide to present an appropriate visual interface
depending on the parameter type. All FreeFrame data for the moment is
passed as 32-bit floats from 0-1, except text data.
</p>


<p>&nbsp;</p>

<a name="CHAPFunctionsInstance">
	<hr><h2>5.2. Instance specific functions</h2><hr>
</a>

<!-- /****************** processFrame ******************/  -->
<a name="processFrame"></a>
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>processFrame</h3></td>
		<td valign=top>&nbsp;(function code = 3, needs valid instanceID!)</td>
	</tr></table>

<h4>Input value:</h4>
<table border=0>
<tr>
	<td><i>pFrame:</i></td>
	<td>
		32-bit pointer to byte array containing frame of video.
	</td>
</tr>
</table>

<h4>Return value:</h4>
<a href="#FF_SUCCESS">FF_SUCCESS</a> if successful, <a href="#FF_FAIL">FF_FAIL</a> if
failed. (32-bit unsigned integer)

<h4>Remarks:</h4>

<table border=0>
<tr>
	<td valign=top>CPU PLUGINS:</td>
	<td>Process a frame of video 'in place'. This is also the basic
	frameport for source plugins.</td>
</tr>
<tr>
	<td valign=top>GPU PLUGINS:</td>
	<td>Do not implement this function, return FF_FAIL.</td>
</tr>
<tr>
	<td valign=top>HOST:</td>
	<td>pFrame needs to be a valid pointer throughout this call as the plugin processes
	the frame 'in place'.
	</td>
</tr>
</table>

<hr>

<!-- /****************** getParameterDisplay ******************/  -->
<a name="getParameterDisplay"></a>
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>getParameterDisplay</h3></td>
		<td valign=top>&nbsp;(function code = 7, needs valid instanceID!)</td>
	</tr></table>

<h4>Input value:</h4>
<table border=0>
<tr>
	<td><i>index:</i></td>
	<td>
        <a href="#ParameterNumber">ParameterNumber</a>
	</td>
</tr>
</table>

<h4>Return value:</h4>
Pointer to <a href="#ParameterDisplayValue">ParameterDisplayValue</a> containing
a string to display as the value of parameter index.
<br>
Returns <a href="#FF_FAIL">FF_FAIL</a> if failed.

<hr>

<!-- /****************** setParameter ******************/  -->
<a name="setParameter"></a>
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>setParameter</h3></td>
		<td valign=top>&nbsp;(function code = 8, needs valid instanceID!)</td>
	</tr></table>

<h4>Input value:</h4>
<table border=0>
<tr>
	<td><i>setParam:</i></td>
	<td>
		Pointer to <a href="#SetParameterStruct">SetParameterStruct</a>.
	</td>
</tr>
</table>

<h4>Return value:</h4>
Returns <a href="#FF_SUCCESS">FF_SUCCESS</a> if successful or <a href="#FF_FAIL">FF_FAIL</a> if failed

<h4>Remarks:</h4>
<p>
Sets the value of a parameter.
</p>
<table border=0>
<tr>
	<td valign=top>PLUGIN:</td>
	<td>
		A plugin shouldn't change parameter values by itself. All
		parameters are set by the plugin host through this function.
	</td>
</tr>
</table>

<hr>

<!-- /****************** getParameter ******************/  -->
<a name="getParameter"></a>
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>getParameter</h3></td>
		<td valign=top>&nbsp;(function code = 9, needs valid instanceID!)</td>
	</tr></table>

<h4>Input value:</h4>
<table border=0>
<tr>
	<td><i>index:</i></td>
	<td>
        <a href="#ParameterNumber">ParameterNumber</a>
	</td>
</tr>
</table>

<h4>Return value:</h4>
A <a href="#ParameterValue">ParameterValue</a> or <a href="#FF_FAIL">FF_FAIL</a> on error.

<h4>Remarks:</h4>
<p>
Returns value of a parameter. Note that the return value has different interpretations,
depending on the type of the parameter (see <a href="#ParameterValue">ParameterValue</a>).
</p>

<hr>

<!-- /****************** instantiate ******************/  -->
<a name="instantiate"></a>
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>instantiate</h3></td>
		<td valign=top>&nbsp;(function code = 11, needs valid instanceID!)</td>
	</tr></table>

<h4>Input value:</h4>
<table border=0>
<tr>
	<td><i>videoInfo:</i></td>
	<td>
		32-bit pointer to <a href="#VideoinfoStruct">VideoInfoStruct</a>.
	</td>
</tr>
</table>

<h4>Return value:</h4>
An <a href="#InstanceIdentifier">InstanceIdentifier</a> for the newly instantiated
effect. Will be used as instanceID for future function calls.<br>
Returns <a href="#FF_FAIL">FF_FAIL</a> on error.

<h4>Remarks:</h4>

<table border=0>
<tr>
	<td valign=top>CPU PLUGINS:</td>
	<td>
		Prepare an instance of the plugin for processing. Set default values, allocate memory.
		When the plugin returns from this function it must be ready to process a frame.
		<br><br>
		Make a local copy of the <a href="#VideoInfoStruct">VideoInfoStruct</a> if necessary, the
		pointer may not be valid after the function returns. The instance identifier you provide to the host must
		be the unique identifier of this instance until a call to deinitialise.<br><br>
	</td>
</tr>
<tr><td colspan=2><br></td></tr>
<tr>
	<td valign=top>GPU PLUGINS:</td>
	<td>
		Do not implement this function, return FF_FAIL. GPU plugins have their own <a href="#instantiateGL">instantiateGL</a> function.<br><br><br>
	</td>
</tr>
<tr><td colspan=2><br></td></tr>

<tr>
	<td valign=top>HOST:</td>
	<td>
		This function *must* return before a call to processFrame. The <a href="#InstanceIdentifier">InstanceIdentifier</a>
		provided by the plugin is your handle to this	instance of the plugin. The host must keep this instance identifier,
		and provide it in all calls to the plugin regarding that instance.
		<br><br>
		Ensure that the pointer to <a href="#VideoInfoStruct">VideoInfoStruct</a> remains valid until the function returns.
	</td>
</tr>
</table>

<hr>

<!-- /****************** deInstantiate ******************/  -->
<a name="deInstantiate"></a>
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>deInstantiate</h3></td>
		<td valign=top>&nbsp;(function code = 12, needs valid instanceID!)</td>
	</tr></table>

<h4>Input value:</h4>
<i>none</i>

<h4>Return value:</h4>
Returns <a href="#FF_SUCCESS">FF_SUCCESS</a> if successful or <a href="#FF_FAIL">FF_FAIL</a> if failed.

<h4>Remarks:</h4>
<table border=0>
<tr>
	<td valign=top>CPU PLUGINS:</td>
	<td>
		Tidy up, deallocate memory. All memory associated with the instance being deinstantiated must be freed
		here.
	</td>
</tr>
<tr>
	<td valign=top>GPU PLUGINS:</td>
	<td>
		Do not implement this function, return FF_FAIL. GPU plugins have their own <a href="#deInstantiateGL">deInstantiateGL</a> function.
	</td>
</tr>
<tr>
	<td valign=top>HOST:</td>
	<td>
		This function must be called to close an instance of the plugin.
		All instances should be closed before <a href="#deInitialise">deInitialising</a> the plugin!
	</td>
</tr>
</table>

<hr>

<!-- /****************** processFrameCopy ******************/  -->
<a name="processFrameCopy"></a>
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>processFrameCopy</h3></td>
		<td valign=top>&nbsp;(function code = 14, needs valid instanceID!)</td>
	</tr></table>

<h4>Input value:</h4>
<table border=0>
<tr>
	<td><i>copyStruct:</i></td>
	<td>
		32-bit pointer to <a href="#ProcessFrameCopyStruct">ProcessFrameCopyStruct</a>
	</td>
</tr>
</table>

<h4>Return value:</h4>
Returns <a href="#FF_SUCCESS">FF_SUCCESS</a> if successful or <a href="#FF_FAIL">FF_FAIL</a> if failed.

<h4>Remarks:</h4>
<p>
<table border=0>
<tr>
	<td valign=top>CPU PLUGINS:</td>
	<td>
  The processFrameCopy function performs a source-&gt;dest buffer frame process
  in CPU effect plugins. Multiple input frames can be processed by processFrameCopy, so plugins should indicate the number of input frames they prefer with <a href="#getPluginCaps">getPluginCaps</a>.
	CPU source plugins should not support processFrameCopy as they do not require input frames.<br><br>
  Plugins do not have to support processFrameCopy, but they must support the <a href="#processFrame">processFrame</a> (in-place) method of
  processing. Support for processFrameCopy should be indicated in <a href="#getPluginCaps">getPluginCaps</a>.
	<br><br>The plugin can also define (via <a href="#getPluginCaps">getPluginCaps</a>) which of processFrameCopy or <a href="#processFrame">processFrame</a> should be used for optimal performance.<br><br>
	</td>
</tr>
<tr><td><br></td></tr>
<tr>
	<td valign=top>GPU PLUGINS:</td>
	<td>
	Do not implement this function, return FF_FAIL;
	</td>
</tr>
</table>

<hr>

<!-- /****************** getInputStatus ******************/  -->
<a name="getInputStatus"></a>
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>getInputStatus</h3></td>
		<td valign=top>&nbsp;(function code = 16, needs valid instanceID!)</td>
	</tr></table>

<h4>Input value:</h4>
<table border=0>
<tr>
	<td><i>channel:</i></td>
	<td>
		<a href="#InputChannel">InputChannel</a> value.
	</td>
</tr>
</table>

<h4>Return value:</h4>
Returns an <a href="#InputStatus">InputStatus</a> value describing the status of
channel.

<h4>Remarks:</h4>
<p>
This function is provided to allow hosts to optimize the rendering of input
frames. Due to user input a plugin may only plan to render certain input
channels - this function allows hosts to ask the plugin which input channels
it plans to render.
</p>

<table border=0>
<tr>
	<td valign=top>HOST:</td>
	<td>
		A host may only call this function for channels in this range:<br>
		'Minimum input frames' <= channel < 'Maximum input frames' (see <a href="#getPluginCaps">getPluginCaps</a>).<br>
		One should assume that all channels  < 'Minimum input frames' are always in use.
	</td>
</tr>
</table>

<hr>
<!-- /****************** processOpengl ******************/  -->
<a name="processOpengl"></a>
<table border=0 bgcolor="#E8E8E8">
  <tr>
    <td valign=top><h3>processOpengl</h3></td>
    <td valign=top>&nbsp;(function code = 17, needs valid instanceID!)</td>
  </tr>
</table>
<h4>Input value:</h4>
<table border=0>
  <tr>
    <td><i>pProcessOpenGLStruct:</i></td>
    <td> pointer to <a href="#ProcessOpenGLStruct">ProcessOpenGLStruct</a> structure. </td>
  </tr>
</table>
<h4>Return value:</h4>
<a href="#FF_SUCCESS">FF_SUCCESS</a> if successful, <a href="#FF_FAIL">FF_FAIL</a> if
failed. (32-bit unsigned integer)
<h4>Remarks:</h4>
<table border=0>
  <tr>
    <td valign=top>CPU PLUGINS:</td>
    <td>Do not implement this function, return FF_FAIL.<br><br><br></td>
  </tr>
  <tr>
    <td valign=top>GPU PLUGINS:</td>
    <td>Before returning from ProcessOpenGL, plugins MUST RESTORE ANY CHANGED OPENGL STATES BACK TO THE DEFAULT OPENGL STATE as defined by the OpenGL spec - WITH THE FOLLOWING EXCEPTIONS:
      <ul>
        <li>
          If a plugin uses its own EXT_framebuffer_object ("FBO") for internal rendering, the plugin must restore the host's FBO binding using the HostFBO field from <a href="#ProcessOpenGLStruct">processOpenGLStruct</a> by calling glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, HostFBO) .
           <br><br>
        </li>
         <li>
           If a plugin changes the OpenGL viewport state for any reason, it must restore the host's viewport (provided in the call to <a href="#instantiateGL">instantiateGL</a>).
           <br><br>
         </li>
        <li>More exceptions may be added in the future as necessary<br><br></li>
        <li>
        Official documentation on "default" OpenGL states can be found here:<br>
          <a href="http://www.opengl.org/documentation/specs" target="_blank">
          http://www.opengl.org/documentation/specs</a> and <br>
          <a href="http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/get.html" target="_blank">
          http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/get.html</a>
        </li>
    </ul></td>
  </tr>
  <tr>
    <td valign=top>GPU HOST:</td>
    <td>
      Hosts must provide textures of type GL_TEXTURE_2D. GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_3D, etc, are NOT supported.
      Hosts must ensure that OpenGL is in its default state when ProcessOpenGL is called - with the exceptions listed above.
    </td>
  </tr>
</table>
<hr>
<!-- /****************** instantiateGL ******************/  -->
<a name="instantiateGL" id="instantiateGL"></a>
<table border=0 bgcolor="#E8E8E8">
  <tr>
    <td valign=top><h3>instantiateGL</h3></td>
    <td valign=top>&nbsp;(function code = 18, needs valid instanceID!)</td>
  </tr>
</table>
<p>#define FF_INSTANTIATEGL       18</p>
<p>DWORD instantiateGL(const FFGLViewportStruct *pHostGLViewport)</p>
<h4>Input value:</h4>
<table border=0>
  <tr>
    <td><i>pFFGLViewportStruct:</i></td>
    <td> pointer to FFGLViewportStruct structure that defines the host's OpenGL viewport. </td>
  </tr>
</table>
<h4>Return value:</h4>
An <a href="#InstanceIdentifier">InstanceIdentifier</a> for the newly instantiated
effect. Will be used as instanceID for future function calls.<br>
Returns <a href="#FF_FAIL">FF_FAIL</a> on error.
<h4>Remarks:</h4>
<table border=0>
<tr><td>CPU PLUGINS:</td>
<td>Do not implement this function, return FF_FAIL. CPU plugins have their own <a href="#instantiate">instantiate</a> function.</td>
</tr>

<tr><td colspan=2><br></td></tr>

<tr>
  <td valign=top>GPU PLUGINS:</td>
  <td> Prepare an instance of the plugin for processing.
    Set default values, allocate memory, GPU resources, textures, shader programs, etc.
    Plugins should expect the host's OpenGL viewport to remain valid for the lifetime of the plugin. The <a href="#FFGLViewportStruct">FFGLViewportStruct</a> pointer will become invalid after instantiateGL returns, so (if necessary) plugins should store a copy of the <a href="#FFGLViewportStruct">FFGLViewportStruct</a> for later use during calls to <a href="#processOpengl">processOpenGL</a>.
    <br><br>
    When the plugin returns from this function it must be ready to process a frame.
    </td>
  </tr>

<tr><td colspan=2><br></td></tr>

  <tr>
    <td valign=top>GPU HOST:</td>
    <td>
    Hosts must ensure that a valid OpenGL context is active during this call so that plugins can allocate GPU resources. <br><br>
    This function must return before the host makes any calls to processOpengl. The <a href="#InstanceIdentifier">InstanceIdentifier</a> provided by the plugin is your handle to this
      instance of the plugin. The host must keep this instance identifier,
      and provide it in all calls to the plugin regarding that instance.<br><br>
      If the host's viewport changes (perhaps because the user changed their output window size or output resolution), any loaded plugins affected by the change must be deinstantiated and reinstantiated and provided with the new viewport information.
   </td>
  </tr>

</table>
<hr>
<!-- /****************** deInstantiateGL ******************/  -->
<a name="deInstantiateGL" id="deInstantiateGL"></a>
<table border=0 bgcolor="#E8E8E8">
  <tr>
    <td valign=top><h3>deInstantiateGL</h3></td>
    <td valign=top>&nbsp;(function code = 19, needs valid instanceID!)</td>
  </tr>
</table>
<p>#define FF_DEINSTANTIATEGL     19</p>
<p>DWORD deInstantiateGL(void *instanceID)</p>
<h4>Input value:</h4>
<table border=0>
  <tr>
    <td><i>pProcessOpenGLStruct:</i></td>
    <td> pointer to ProcessOpenGLStruct structure. </td>
  </tr>
</table>

<h4>Return value:</h4>
Returns <a href="#FF_SUCCESS">FF_SUCCESS</a> if successful or <a href="#FF_FAIL">FF_FAIL</a> if failed.

<h4>Remarks:</h4>

<table border=0>
  <tr>
    <td valign=top>CPU PLUGINS:</td>
    <td>Do not implement this function, return FF_FAIL. CPU plugins have their own <a href="#deInstantiate">deInstantiate</a> function.</td>
  </tr>
  <tr><td colspan=2><br></td></tr>
  <tr>
    <td valign=top>GPU PLUGINS:</td>
    <td>Tidy up, deallocate memory, deallocate GPU resources specific to this GL instance: textures, shader programs, etc. All memory associated with the instance being deinstantiated must be freed
		here.	Plugins should release all GPU resources they've created for this instance.</td>
  </tr>
  <tr><td colspan=2><br></td></tr>
  <tr>
    <td valign=top>GPU HOST:</td>
    <td>This function is called to close an instance of the plugin.
		Hosts must ensure a valid OpenGL context is active during this call so that plugins can free GPU resources.
    All instances should be closed before <a href="#deInitialise">deInitialising</a> the plugin!
   </td>
  </tr>
</table>

<hr>
<!-- /****************** setTime ******************/  -->
<a name="setTime"></a>
	<table border=0 bgcolor="#E8E8E8"><tr>
		<td valign=top><h3>setTime</h3></td>
		<td valign=top>&nbsp;(function code = 20, needs valid instanceID!)</td>
	</tr></table>

<h4>Input value:</h4>
<table border=0>
<tr>
	<td><i>Time:</i></td>
	<td>
		Pointer to <a href="#Float64">64-bit floating point value</a> representing time in seconds.
	</td>
</tr>
</table>

<h4>Return value:</h4>
Returns <a href="#FF_SUCCESS">FF_SUCCESS</a> if successful or <a href="#FF_FAIL">FF_FAIL</a> if failed

<h4>Remarks:</h4>
<p>
Plugins that support the setTime function should return FF_TRUE when asked for the FF_CAP_SETTIME capability in <a href="#getPluginCaps">getPluginCaps</a>.
<br><br>
Hosts must not call SetTime while any of the plugin's process functions are still executing.
</p>


</body>
</html>