~ubuntu-branches/ubuntu/lucid/fpc/lucid-proposed

« back to all changes in this revision

Viewing changes to fpcsrc/packages/os2units/src/hwvideo.pas

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-10-09 23:29:00 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20081009232900-553f61m37jkp6upv
Tags: 2.2.2-4
[ Torsten Werner ]
* Update ABI version in fpc-depends automatically.
* Remove empty directories from binary package fpc-source.

[ Mazen Neifer ]
* Removed leading path when calling update-alternatives to remove a Linitian
  error.
* Fixed clean target.
* Improved description of packages. (Closes: #498882)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{
 
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)
 
5
 
 
6
    This is Video Acceleration Interface
 
7
 
 
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.
 
15
 
 
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.
 
20
 
 
21
 **********************************************************************}
 
22
 
 
23
{
 
24
@abstract(Video Acceleration Interface)
 
25
@author(Valery Gaynullin)
 
26
@author(Yuri Prokushev (prokushev@freemail.ru))
 
27
@created(29 Nov 2002)
 
28
@lastmod(19 Jan 2003)
 
29
This is Video Acceleration Interface.
 
30
Warning: This code is alfa. Future versions of this unit will propably
 
31
not be compatible.
 
32
}
 
33
 
 
34
Unit HWVideo;
 
35
 
 
36
Interface
 
37
 
 
38
Uses
 
39
  Os2Def,
 
40
  PMWin,
 
41
  PMGpi;
 
42
 
 
43
// GRADD function class
 
44
Const
 
45
  VA2_FUNCTION_CLASS='Video Acceleration 2';
 
46
 
 
47
Type
 
48
  THWVIDEOCAPS=record
 
49
    ulLength: Cardinal;
 
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
 
58
  end;
 
59
  PHWVIDEOCAPS=^THWVIDEOCAPS;
 
60
 
 
61
//ulCapsFlag defines
 
62
Const
 
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
 
71
 
 
72
Type
 
73
  THWATTRIBUTE=record
 
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
 
83
  end;
 
84
  PHWATTRIBUTE=^THWATTRIBUTE;
 
85
 
 
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.
 
91
 
 
92
Const
 
93
  //attribute of ON/OFF type
 
94
  ATTRTYPE_BOOLEAN              = 1;
 
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
 
100
  ATTRTYPE_BYTE                 = 4;
 
101
 
 
102
 
 
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;
 
109
 
 
110
//some common attribute names
 
111
Const
 
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';
 
119
 
 
120
Type
 
121
  THWVIDEOSETUP=record
 
122
    ulLength: Cardinal;
 
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
 
128
    rctlSrcRect: RECTL;
 
129
  end;
 
130
  PHWVIDEOSETUP=^THWVIDEOSETUP;
 
131
 
 
132
//return codes
 
133
Const
 
134
  //no error
 
135
  HWVIDEO_DONE = 0;
 
136
  //unspecified error
 
137
  HWVIDEO_ERROR = 3;
 
138
  //FS session active, accelerator not available
 
139
  HWVIDEO_ERROR_BACKGROUND = 4;
 
140
  //HW not available
 
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;
 
146
  //HW already in use
 
147
  HWVIDEO_ERROR_USED = 9;
 
148
 
 
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;
 
153
 
 
154
//Get HW capability
 
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;
 
160
 
 
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
 
164
//buffers
 
165
Function HWVIDEOSetup(pSetup: PHWVIDEOSETUP): Cardinal; cdecl;
 
166
 
 
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;
 
170
 
 
171
//Display HWVideo buffer
 
172
//set pending state for last accessed videobuffer, switch
 
173
//buffers on next VSYNC
 
174
Function HWVIDEOEndUpdate: Cardinal; cdecl;
 
175
 
 
176
//Get current HW attributes
 
177
//0<=ulAttribNum<pCaps->ulAttrCount, else error returned.
 
178
Function HWVIDEOGetAttrib(ulAttribNum: Cardinal; pAttrib: PHWATTRIBUTE): Cardinal; cdecl;
 
179
 
 
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;
 
184
 
 
185
//Close HWVideo
 
186
Function HWVIDEOClose: Cardinal; cdecl;
 
187
 
 
188
Implementation
 
189
 
 
190
Function HWVIDEOInit: Cardinal; cdecl;
 
191
  external 'hwvideo' name 'HWVIDEOInit';
 
192
 
 
193
Function HWVIDEOCaps(pCaps: PHWVIDEOCAPS): Cardinal; cdecl;
 
194
  external 'hwvideo' name 'HWVIDEOCaps';
 
195
 
 
196
Function HWVIDEOSetup(pSetup: PHWVIDEOSETUP): Cardinal; cdecl;
 
197
  external 'hwvideo' name 'HWVIDEOSetup';
 
198
 
 
199
Function HWVIDEOBeginUpdate(var ppBuffer: Pointer; var pulPhysBuffer: Cardinal): Cardinal; cdecl;
 
200
  external 'hwvideo' name 'HWVIDEOBeginUpdate';
 
201
 
 
202
Function HWVIDEOEndUpdate: Cardinal; cdecl;
 
203
  external 'hwvideo' name 'HWVIDEOEndUpdate';
 
204
 
 
205
Function HWVIDEOGetAttrib(ulAttribNum: Cardinal; pAttrib: PHWATTRIBUTE): Cardinal; cdecl;
 
206
  external 'hwvideo' name 'HWVIDEOGetAttrib';
 
207
 
 
208
Function HWVIDEOSetAttrib(ulAttribNum: Cardinal; pAttrib: PHWATTRIBUTE): Cardinal; cdecl;
 
209
  external 'hwvideo' name 'HWVIDEOSetAttrib';
 
210
 
 
211
Function HWVIDEOClose: Cardinal; cdecl;
 
212
  external 'hwvideo' name 'HWVIDEOClose';
 
213
 
 
214
End.