2
Copyright (c) 1991, 1992, 1993 International Business Machines Corporation
3
Copyright (c) 2002 by Valery Gaynullin
4
Copyright (c) 2002-2003 by Yuri Prokushev (prokushev@freemail.ru)
6
This is Video Acceleration Interface
8
This program is free software; you can redistribute it and/or modify it
9
under the terms of the GNU Library General Public License (LGPL) as
10
published by the Free Software Foundation; either version 2 of the
11
License, or (at your option) any later version. This program is
12
distributed in the hope that it will be useful, but WITHOUT ANY
13
WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
FITNESS FOR A PARTICULAR PURPOSE.
16
See the GNU Library General Public License for more details. You should
17
have received a copy of the GNU Library General Public License along
18
with this program; if not, write to the Free Software Foundation, Inc.,
19
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
**********************************************************************}
24
@abstract(Video Acceleration Interface)
25
@author(Valery Gaynullin)
26
@author(Yuri Prokushev (prokushev@freemail.ru))
29
This is Video Acceleration Interface.
30
Warning: This code is alfa. Future versions of this unit will propably
43
// GRADD function class
45
VA2_FUNCTION_CLASS='Video Acceleration 2';
50
ulCapsFlags: Cardinal; //flags, describing HW capability
51
szlSrcMax: SIZEL; //maximum source size (pixels)
52
rctlDstMargin: RECTL; //destination rectangle margins
53
fccDstColor: Cardinal; //screen FOURCC
54
ulScanAlign: Cardinal; //requered scanline aligment-1
55
ulNumColors: Cardinal; //count of supported source FOURCC
56
fccColorType: ^Cardinal; //array of supported FOURCC
57
ulAttrCount: Cardinal; //count of viewport attributes
59
PHWVIDEOCAPS=^THWVIDEOCAPS;
63
HWVIDEOCAPS_MINIFY = $00000001; //Chip can perform downscaling
64
HWVIDEOCAPS_FILTER = $00000002; //Image filtering present
65
HWVIDEOCAPS_NONINTEGER_SCALE = $00000004; //allow scale to noninteger ratio
66
HWVIDEOCAPS_COLOR_KEYING = $00000008; //allow color keying
67
HWVIDEOCAPS_OVERLAY = $00000010; //overlay-type HW
68
HWVIDEOCAPS_SEPARATE_OUT = $00000020; //used separate output connector (like TV out)
69
HWVIDEOCAPS_DECODE = $00000040; //support non-RAW data
70
HWVIDEOCAPS_NEEDPROTECT = $00000080; //HW need to lock VRAM
74
ulLength: Cardinal; //size of structure in bytes
75
szAttrDesc: Array[0..64] of Char; //string, describing attribute
76
ulAttrType: Cardinal; //type of attribute, check ATTRTYPE_* const
77
ulValueSize: Cardinal; //size in bytes of each value member
78
ulValueCount: Cardinal; //count of value members
79
pValueList: Pointer; //list of supported values
80
ulCurrentValue: Cardinal; //current value
81
ulDefaultValue: Cardinal; //default value
82
ulAttribFlags: Cardinal; //flags to define some additional properties
84
PHWATTRIBUTE=^THWATTRIBUTE;
86
//types of attributes.
87
// if ATTRTYPE_BOOLEAN, ATTRTYPE_STATICTEXT or ATTRTYPE_BYTE,
88
// ulValueCount & ulValueSize undefined,
89
// pValueList can be NULL,
90
// else this must be actual value of allocated chunk of memory.
93
//attribute of ON/OFF type
95
//attribute can be member of set string type
96
ATTRTYPE_AGGREGATE_STRING = 2;
97
//attribute have no value - this is static text string
98
ATTRTYPE_STATICTEXT = 3;
99
//attribute can be any value in 0..255 margins
103
//defines for ulAttribFlags field
104
//changing this attribute affect HW capability, so application
105
//must re-read Caps after changing value of this attribute
106
//application must not assume preserving any capability when this
107
//attribute was changed
108
ATTRIB_CHANGE_CAPS = 1;
110
//some common attribute names
112
ATTRIBUTE_BRIGHTNESS = 'Brightness';
113
ATTRIBUTE_CONTRAST = 'Contrast';
114
ATTRIBUTE_SATURATION = 'Saturation';
115
ATTRIBUTE_HUE = 'Hue';
116
ATTRIBUTE_FILTERING = 'Filtering';
117
ATTRIBUTE_TVOUT = 'Output to TV';
118
ATTRIBUTE_COLORKEY = 'Color Keying';
123
rctlDstRect: RECTL; //destination screen rectangle
124
szlSrcSize: SIZEL; //source image size
125
ulSrcPitch: Cardinal; //byte offset between image rows
126
fccColor: Cardinal; //image format
127
ulKeyColor: Cardinal; //color key
130
PHWVIDEOSETUP=^THWVIDEOSETUP;
138
//FS session active, accelerator not available
139
HWVIDEO_ERROR_BACKGROUND = 4;
141
HWVIDEO_ERROR_NO_HW = 6;
142
//incorrect parameter
143
HWVIDEO_ERROR_PARAMETER = 7;
144
//to low offscreen VRAM to handle setup
145
HWVIDEO_ERROR_LOW_VRAM = 8;
147
HWVIDEO_ERROR_USED = 9;
149
//Init HWVideo subsystem
150
//check for presence and avilability of accelerated HW, if present and
151
//available - lock it for this process.
152
Function HWVIDEOInit: Cardinal; cdecl;
155
//return filled structure. When called, ulNumColors must be
156
//set to actual allocated size of fccColorType array.
157
//if call returned with error, then need to check returned
158
//ulNumColors, allocate larger space and call again.
159
Function HWVIDEOCaps(pCaps: PHWVIDEOCAPS): Cardinal; cdecl;
161
//Set HWVideo viewport
162
//Check HW capability to handle this setup, allocate buffers.
163
//one special case: pSetup==NULL - disable video and free all
165
Function HWVIDEOSetup(pSetup: PHWVIDEOSETUP): Cardinal; cdecl;
167
//Get HWVideo buffer pointer
168
//return linear pointer to overlay buffer and it's physical address
169
Function HWVIDEOBeginUpdate(var ppBuffer: Pointer; var pulPhysBuffer: Cardinal): Cardinal; cdecl;
171
//Display HWVideo buffer
172
//set pending state for last accessed videobuffer, switch
173
//buffers on next VSYNC
174
Function HWVIDEOEndUpdate: Cardinal; cdecl;
176
//Get current HW attributes
177
//0<=ulAttribNum<pCaps->ulAttrCount, else error returned.
178
Function HWVIDEOGetAttrib(ulAttribNum: Cardinal; pAttrib: PHWATTRIBUTE): Cardinal; cdecl;
180
//Set new attribute value
181
//0<=ulAttribNum<pCaps.ulAttrCount, else error returned.
182
//pAttrib->ulCurrentValue filled with new value
183
Function HWVIDEOSetAttrib(ulAttribNum: Cardinal; pAttrib: PHWATTRIBUTE): Cardinal; cdecl;
186
Function HWVIDEOClose: Cardinal; cdecl;
190
Function HWVIDEOInit: Cardinal; cdecl;
191
external 'hwvideo' name 'HWVIDEOInit';
193
Function HWVIDEOCaps(pCaps: PHWVIDEOCAPS): Cardinal; cdecl;
194
external 'hwvideo' name 'HWVIDEOCaps';
196
Function HWVIDEOSetup(pSetup: PHWVIDEOSETUP): Cardinal; cdecl;
197
external 'hwvideo' name 'HWVIDEOSetup';
199
Function HWVIDEOBeginUpdate(var ppBuffer: Pointer; var pulPhysBuffer: Cardinal): Cardinal; cdecl;
200
external 'hwvideo' name 'HWVIDEOBeginUpdate';
202
Function HWVIDEOEndUpdate: Cardinal; cdecl;
203
external 'hwvideo' name 'HWVIDEOEndUpdate';
205
Function HWVIDEOGetAttrib(ulAttribNum: Cardinal; pAttrib: PHWATTRIBUTE): Cardinal; cdecl;
206
external 'hwvideo' name 'HWVIDEOGetAttrib';
208
Function HWVIDEOSetAttrib(ulAttribNum: Cardinal; pAttrib: PHWATTRIBUTE): Cardinal; cdecl;
209
external 'hwvideo' name 'HWVIDEOSetAttrib';
211
Function HWVIDEOClose: Cardinal; cdecl;
212
external 'hwvideo' name 'HWVIDEOClose';