-
Notifications
You must be signed in to change notification settings - Fork 31
/
DSUtil.pas
5015 lines (4460 loc) · 200 KB
/
DSUtil.pas
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
(*********************************************************************
* DSPack 2.3.3 *
* *
* home page : http://www.progdigy.com *
* email : hgourvest@progdigy.com *
* Thanks to Michael Andersen. (DSVideoWindowEx) *
* *
* date : 21-02-2003 *
* *
* The contents of this file are used with permission, subject to *
* the Mozilla Public License Version 1.1 (the "License"); you may *
* not use this file except in compliance with the License. You may *
* obtain a copy of the License at *
* http://www.mozilla.org/MPL/MPL-1.1.html *
* *
* Software distributed under the License is distributed on an *
* "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or *
* implied. See the License for the specific language governing *
* rights and limitations under the License. *
* *
* Contributor(s) *
* Peter J. Haas <DSPack@pjh2.de> *
* Andriy Nevhasymyy <a.n@email.com> *
* Milenko Mitrovic <dcoder@dsp-worx.de> *
* Michael Andersen <michael@mechdata.dk> *
* Martin Offenwanger <coder@dsplayer.de> *
* *
*********************************************************************)
{
@abstract(Methods & usefull Class for Direct Show programming.)
@author(Henri Gourvest: hgourvest@progdigy.com)
@created(Mar 14, 2002)
@lastmod(Oct 24, 2003)
}
unit DSUtil;
{$B-} // needed at least for TSysDevEnum.FilterIndexOfFriendlyName
{$I jedi.inc}
{$IFDEF COMPILER7_UP}
{$WARN UNSAFE_CODE OFF}
{$WARN UNSAFE_TYPE OFF}
{$WARN UNSAFE_CAST OFF}
{$ENDIF}
interface
uses
{$IFDEF COMPILER6_UP} Variants, {$ENDIF}
Windows, Controls, SysUtils, ActiveX, Classes, MMSystem, DirectShow9, WMF9,
DirectDraw;
const
IID_IPropertyBag : TGUID = '{55272A00-42CB-11CE-8135-00AA004BB851}';
IID_ISpecifyPropertyPages : TGUID = '{B196B28B-BAB4-101A-B69C-00AA00341D07}';
IID_IPersistStream : TGUID = '{00000109-0000-0000-C000-000000000046}';
IID_IMoniker : TGUID = '{0000000F-0000-0000-C000-000000000046}';
// MS Mepg4 DMO
MEDIASUBTYPE_MP42 : TGUID = '{3234504D-0000-0010-8000-00AA00389B71}';
// DIVX
MEDIASUBTYPE_DIVX : TGUID = '{58564944-0000-0010-8000-00AA00389B71}';
// VoxWare MetaSound
MEDIASUBTYPE_VOXWARE : TGUID = '{00000075-0000-0010-8000-00AA00389B71}';
MiliSecPerDay : Cardinal = 86400000;
MAX_TIME : Int64 = $7FFFFFFFFFFFFFFF;
bits555: array[0..2] of DWord = ($007C00, $0003E0, $00001F);
bits565: array[0..2] of DWord = ($00F800, $0007E0, $00001F);
bits888: array[0..2] of DWord = ($FF0000, $00FF00, $0000FF);
////////////////////////////////////////////////////////////////////////////////
// DIVX ressources translated from latest OpenDivx DirectX Codec
// divx
CLSID_DIVX : TGUID = '{78766964-0000-0010-8000-00aa00389b71}';
// DIVX
CLSID_DivX_U : TGUID = '{58564944-0000-0010-8000-00aa00389b71}';
// dvx1
CLSID_DivX_ : TGUID = '{31787664-0000-0010-8000-00aa00389b71}';
// DVX1
CLSID_DivX__U : TGUID = '{31585644-0000-0010-8000-00aa00389b71}';
// dx50
CLSID_dx50 : TGUID = '{30357864-0000-0010-8000-00aa00389b71}';
// DX50
CLSID_DX50_ : TGUID = '{30355844-0000-0010-8000-00aa00389b71}';
// div6
CLSID_div6 : TGUID = '{36766964-0000-0010-8000-00aa00389b71}';
// DIV6
CLSID_DIV6_ : TGUID = '{36564944-0000-0010-8000-00aa00389b71}';
// div5
CLSID_div5 : TGUID = '{35766964-0000-0010-8000-00aa00389b71}';
// DIV5
CLSID_DIV5_ : TGUID = '{35564944-0000-0010-8000-00aa00389b71}';
// div4
CLSID_div4 : TGUID = '{34766964-0000-0010-8000-00aa00389b71}';
// DIV4
CLSID_DIV4_ : TGUID = '{34564944-0000-0010-8000-00aa00389b71}';
// div3
CLSID_div3 : TGUID = '{33766964-0000-0010-8000-00aa00389b71}';
// DIV3
CLSID_DIV3_ : TGUID = '{33564944-0000-0010-8000-00aa00389b71}';
CLSID_DIVXCodec : TGUID = '{78766964-0000-0010-8000-00aa00389b71}';
IID_IIDivXFilterInterface : TGUID = '{D132EE97-3E38-4030-8B17-59163B30A1F5}';
CLSID_DivXPropertiesPage : TGUID = '{310e42a0-f913-11d4-887c-006008dc5c26}';
type
{$IFDEF VER130}
PPointer = ^Pointer;
{$ENDIF}
{ Interface to control the Divx Decoder filter.
TODO: discover the last function ... }
IDivXFilterInterface = interface(IUnknown)
['{D132EE97-3E38-4030-8B17-59163B30A1F5}']
{ OpenDivx }
// current postprocessing level 0..100
function get_PPLevel(out PPLevel: integer): HRESULT; stdcall;
// new postprocessing level 0..100
function put_PPLevel(PPLevel: integer): HRESULT; stdcall;
// Put the default postprocessing = 0
function put_DefaultPPLevel: HRESULT; stdcall;
{ DIVX }
function put_MaxDelayAllowed(maxdelayallowed: integer): HRESULT; stdcall;
function put_Brightness(brightness: integer): HRESULT; stdcall;
function put_Contrast(contrast: integer): HRESULT; stdcall;
function put_Saturation(saturation: integer): HRESULT; stdcall;
function get_MaxDelayAllowed(out maxdelayallowed: integer): HRESULT; stdcall;
function get_Brightness(out brightness: integer): HRESULT; stdcall;
function get_Contrast(out contrast: integer): HRESULT; stdcall;
function get_Saturation(out saturation: integer): HRESULT; stdcall;
function put_AspectRatio(x, y: integer): HRESULT; stdcall;
function get_AspectRatio(out x, y: integer): HRESULT; stdcall;
end;
////////////////////////////////////////////////////////////////////////////////
// Ogg Vorbis
type
TVORBISFORMAT = record
nChannels: WORD;
nSamplesPerSec: Longword;
nMinBitsPerSec: Longword;
nAvgBitsPerSec: Longword;
nMaxBitsPerSec: Longword;
fQuality: Double;
end;
const
// f07e245f-5a1f-4d1e-8bff-dc31d84a55ab
CLSID_OggSplitter: TGUID = '{f07e245f-5a1f-4d1e-8bff-dc31d84a55ab}';
// {078C3DAA-9E58-4d42-9E1C-7C8EE79539C5}
CLSID_OggSplitPropPage: TGUID = '{078C3DAA-9E58-4d42-9E1C-7C8EE79539C5}';
// 8cae96b7-85b1-4605-b23c-17ff5262b296
CLSID_OggMux: TGUID = '{8cae96b7-85b1-4605-b23c-17ff5262b296}';
// {AB97AFC3-D08E-4e2d-98E0-AEE6D4634BA4}
CLSID_OggMuxPropPage: TGUID = '{AB97AFC3-D08E-4e2d-98E0-AEE6D4634BA4}';
// {889EF574-0656-4B52-9091-072E52BB1B80}
CLSID_VorbisEnc: TGUID = '{889EF574-0656-4B52-9091-072E52BB1B80}';
// {c5379125-fd36-4277-a7cd-fab469ef3a2f}
CLSID_VorbisEncPropPage: TGUID = '{c5379125-fd36-4277-a7cd-fab469ef3a2f}';
// 02391f44-2767-4e6a-a484-9b47b506f3a4
CLSID_VorbisDec: TGUID = '{02391f44-2767-4e6a-a484-9b47b506f3a4}';
// 77983549-ffda-4a88-b48f-b924e8d1f01c
CLSID_OggDSAboutPage: TGUID = '{77983549-ffda-4a88-b48f-b924e8d1f01c}';
// {D2855FA9-61A7-4db0-B979-71F297C17A04}
MEDIASUBTYPE_Ogg: TGUID = '{D2855FA9-61A7-4db0-B979-71F297C17A04}';
// cddca2d5-6d75-4f98-840e-737bedd5c63b
MEDIASUBTYPE_Vorbis: TGUID = '{cddca2d5-6d75-4f98-840e-737bedd5c63b}';
// 6bddfa7e-9f22-46a9-ab5e-884eff294d9f
FORMAT_VorbisFormat: TGUID = '{6bddfa7e-9f22-46a9-ab5e-884eff294d9f}';
////////////////////////////////////////////////////////////////////////////////
// WMF9 Utils
type
TWMPofiles8 = (
wmp_V80_255VideoPDA,
wmp_V80_150VideoPDA,
wmp_V80_28856VideoMBR,
wmp_V80_100768VideoMBR,
wmp_V80_288100VideoMBR,
wmp_V80_288Video,
wmp_V80_56Video,
wmp_V80_100Video,
wmp_V80_256Video,
wmp_V80_384Video,
wmp_V80_768Video,
wmp_V80_700NTSCVideo,
wmp_V80_1400NTSCVideo,
wmp_V80_384PALVideo,
wmp_V80_700PALVideo,
wmp_V80_288MonoAudio,
wmp_V80_288StereoAudio,
wmp_V80_32StereoAudio,
wmp_V80_48StereoAudio,
wmp_V80_64StereoAudio,
wmp_V80_96StereoAudio,
wmp_V80_128StereoAudio,
wmp_V80_288VideoOnly,
wmp_V80_56VideoOnly,
wmp_V80_FAIRVBRVideo,
wmp_V80_HIGHVBRVideo,
wmp_V80_BESTVBRVideo
);
const
WMProfiles8 : array[TWMPofiles8] of TGUID =
('{FEEDBCDF-3FAC-4c93-AC0D-47941EC72C0B}',
'{AEE16DFA-2C14-4a2f-AD3F-A3034031784F}',
'{D66920C4-C21F-4ec8-A0B4-95CF2BD57FC4}',
'{5BDB5A0E-979E-47d3-9596-73B386392A55}',
'{D8722C69-2419-4b36-B4E0-6E17B60564E5}',
'{3DF678D9-1352-4186-BBF8-74F0C19B6AE2}',
'{254E8A96-2612-405c-8039-F0BF725CED7D}',
'{A2E300B4-C2D4-4fc0-B5DD-ECBD948DC0DF}',
'{BBC75500-33D2-4466-B86B-122B201CC9AE}',
'{29B00C2B-09A9-48bd-AD09-CDAE117D1DA7}',
'{74D01102-E71A-4820-8F0D-13D2EC1E4872}',
'{C8C2985F-E5D9-4538-9E23-9B21BF78F745}',
'{931D1BEE-617A-4bcd-9905-CCD0786683EE}',
'{9227C692-AE62-4f72-A7EA-736062D0E21E}',
'{EC298949-639B-45e2-96FD-4AB32D5919C2}',
'{7EA3126D-E1BA-4716-89AF-F65CEE0C0C67}',
'{7E4CAB5C-35DC-45bb-A7C0-19B28070D0CC}',
'{60907F9F-B352-47e5-B210-0EF1F47E9F9D}',
'{5EE06BE5-492B-480a-8A8F-12F373ECF9D4}',
'{09BB5BC4-3176-457f-8DD6-3CD919123E2D}',
'{1FC81930-61F2-436f-9D33-349F2A1C0F10}',
'{407B9450-8BDC-4ee5-88B8-6F527BD941F2}',
'{8C45B4C7-4AEB-4f78-A5EC-88420B9DADEF}',
'{6E2A6955-81DF-4943-BA50-68A986A708F6}',
'{3510A862-5850-4886-835F-D78EC6A64042}',
'{0F10D9D3-3B04-4fb0-A3D3-88D4AC854ACC}',
'{048439BA-309C-440e-9CB4-3DCCA3756423}');
function ProfileFromGUID(const GUID: TGUID): TWMPofiles8;
////////////////////////////////////////////////////////////////////////////////
{ Frees an object reference and replaces the reference with Nil. (Delphi4 compatibility)}
procedure FreeAndNil(var Obj);
{ Enable Graphedit to connect with a filter graph.<br>
The application must register the filter graph instance in the Running Object
Table (ROT). The ROT is a globally accessible look-up table that keeps track
of running objects. Objects are registered in the ROT by moniker. To connect
to the graph, GraphEdit searches the ROT for monikers whose display name matches
a particular format: !FilterGraph X pid Y.<br>
<b>Graph:</b> a graph interface (IGraphBuilder, IFilterGraph, IFilterGraph2).<br>
<b>ID:</b> return the ROT identifier.}
function AddGraphToRot(Graph: IFilterGraph; out ID: integer): HRESULT;
{ Disable Graphedit to connect with your filter graph.<br>
<b>ID:</b> identifier provided by the @link(AddGraphToRot) method.}
function RemoveGraphFromRot(ID: integer): HRESULT;
{ deprecated, convert a Time code event to TDVD_TimeCode record. }
function IntToTimeCode(x : longint): TDVDTimeCode;
{ Return a string explaining a filter graph event. }
function GetEventCodeDef(code: longint): string;
{ General purpose function to delete a heap allocated TAM_MEDIA_TYPE structure
which is useful when calling IEnumMediaTypes.Next as the interface
implementation allocates the structures which you must later delete
the format block may also be a pointer to an interface to release. }
procedure DeleteMediaType(pmt: PAMMediaType);
{ The CreateMediaType function allocates a new AM_MEDIA_TYPE structure,
including the format block. This also comes in useful when using the
IEnumMediaTypes interface so that you can copy a media type, you can do
nearly the same by creating a TMediaType class but as soon as it goes out
of scope the destructor will delete the memory it allocated
(this takes a copy of the memory). }
function CreateMediaType(pSrc: PAMMediaType): PAMMediaType;
{ The CopyMediaType function copies an AM_MEDIA_TYPE structure into another
structure, including the format block. This function allocates the memory
for the format block. If the pmtTarget parameter already contains an allocated
format block, a memory leak will occur. To avoid a memory leak, call
FreeMediaType before calling this function. }
procedure CopyMediaType(pmtTarget: PAMMediaType; pmtSource: PAMMediaType);
{ The FreeMediaType function frees the format block in an AM_MEDIA_TYPE structure.
Use this function to free just the format block. To delete the AM_MEDIA_TYPE
structure, call DeleteMediaType. }
procedure FreeMediaType(mt: PAMMediaType);
{ The CreateAudioMediaType function initializes a media type from a TWAVEFORMATEX structure.
If the bSetFormat parameter is TRUE, the method allocates the memory for the format
block. If the pmt parameter already contains an allocated format block, a memory
leak will occur. To avoid a memory leak, call FreeMediaType before calling this function.
After the method returns, call FreeMediaType again to free the format block. }
function CreateAudioMediaType(pwfx: PWaveFormatEx; pmt: PAMMediaType; bSetFormat: boolean): HRESULT;
{ The FOURCCMap function provides conversion between GUID media subtypes and
old-style FOURCC 32-bit media tags. In the original Microsoft® Windows®
multimedia APIs, media types were tagged with 32-bit values created from
four 8-bit characters and were known as FOURCCs. Microsoft DirectShow® media
types have GUIDs for the subtype, partly because these are simpler to create
(creation of a new FOURCC requires its registration with Microsoft).
Because FOURCCs are unique, a one-to-one mapping has been made possible by
allocating a range of 4,000 million GUIDs representing FOURCCs. This range
is all GUIDs of the form: XXXXXXXX-0000-0010-8000-00AA00389B71. }
function FOURCCMap(Fourcc: Cardinal): TGUID;
{ Find the four-character codes wich identifi a codec. }
function GetFOURCC(Fourcc: Cardinal): string;
{ Convert a FCC (Four Char Codes) to Cardinal. A FCC identifie a media type.}
function FCC(str: String): Cardinal;
{ Create the four-character codes from a Cardinal value. }
function MAKEFOURCC(ch0, ch1, ch2, ch3: char): Cardinal;
{ The GetErrorString function retrieves the error message for a given return
code, using the current language setting.}
function GetErrorString(hr: HRESULT): string;
{ This function examine a media type and return a short description like GraphEdit. }
function GetMediaTypeDescription(MediaType: PAMMediaType): string;
{ Retrieve the Size needed to store a bitmat }
function GetBitmapSize(Header: PBitmapInfoHeader): DWORD;
function GetBitmapSubtype(bmiHeader: PBitmapInfoHeader): TGUID; stdcall;
function GetTrueColorType(bmiHeader: PBitmapInfoHeader): TGUID; stdcall;
function GetDXSDKMediaPath : String;
function CopyScreenToBitmap(Rect : TRect; pData : PByte; pHeader : PBitmapInfo) : HBitmap;
type
{ Property pages.<br>See also: @link(ShowFilterPropertyPage), @link:(HaveFilterPropertyPage).}
TPropertyPage = (
ppDefault, // Simple property page.
ppVFWCapDisplay, // Capture Video source dialog box.
ppVFWCapFormat, // Capture Video format dialog box.
ppVFWCapSource, // Capture Video source dialog box.
ppVFWCompConfig, // Compress Configure dialog box.
ppVFWCompAbout // Compress About Dialog box.
);
{ Show the property page associated with the Filter.
A property page is one way for a filter to support properties that the user can set.
Many of the filters provided with DirectShow support property pages, they are
intended for debugging purposes, and are not recommended for application use.
In most cases the equivalent functionality is provided through a custom interface
on the filter. An application should control these filters programatically,
rather than expose their property pages to users. }
function ShowFilterPropertyPage(parent: THandle; Filter: IBaseFilter;
PropertyPage: TPropertyPage = ppDefault): HRESULT;
{ Return true if the specified property page is provided by the Filter.}
function HaveFilterPropertyPage(Filter: IBaseFilter;
PropertyPage: TPropertyPage = ppDefault): boolean;
{ Show the property page associated with the Pin. <br>
<b>See also: </b> @link:(ShowFilterPropertyPage).}
function ShowPinPropertyPage(parent: THandle; Pin: IPin): HRESULT;
{ Convert 100 nano sec unit to milisecondes. }
function RefTimeToMiliSec(RefTime: Int64): Cardinal;
{ Convert milisecondes to 100 nano sec unit}
function MiliSecToRefTime(Milisec: int64): Int64;
{ The mechanism for describing a bitmap format is with the BITMAPINFOHEADER
This is really messy to deal with because it invariably has fields that
follow it holding bit fields, palettes and the rest. This function gives
the number of bytes required to hold a VIDEOINFO that represents it. This
count includes the prefix information (like the rcSource rectangle) the
BITMAPINFOHEADER field, and any other colour information on the end.
WARNING If you want to copy a BITMAPINFOHEADER into a VIDEOINFO always make
sure that you use the HEADER macro because the BITMAPINFOHEADER field isn't
right at the start of the VIDEOINFO (there are a number of other fields),
CopyMemory(HEADER(pVideoInfo),pbmi,sizeof(BITMAPINFOHEADER)); }
function GetBitmapFormatSize(const Header: TBitmapInfoHeader): Integer;
{ Retrieve original source rectangle from a TAM_Media_type record.}
function GetSourceRectFromMediaType(const MediaType: TAMMediaType): TRect;
{ TODO -oMichael Andersen: make documentation }
function StretchRect(R, IR: TRect): TRect;
// raise @link(EDirectShowException) exception if failed.
function CheckDSError(HR: HRESULT): HRESULT;
// milenko start (added functions from dshowutil.cpp)
function FindRenderer(pGB: IGraphBuilder; const mediatype: PGUID; out ppFilter: IBaseFilter): HRESULT;
function FindAudioRenderer(pGB: IGraphBuilder; out ppFilter: IBaseFilter): HRESULT;
function FindVideoRenderer(pGB: IGraphBuilder; out ppFilter: IBaseFilter): HRESULT;
function CountFilterPins(pFilter: IBaseFilter; out pulInPins: Cardinal; out pulOutPins: Cardinal): HRESULT;
function CountTotalFilterPins(pFilter: IBaseFilter; out pulPins: Cardinal): HRESULT;
function GetPin(pFilter: IBaseFilter; dirrequired: TPinDirection; iNum: integer; out ppPin: IPin): HRESULT;
function GetInPin(pFilter: IBaseFilter; nPin: integer): IPin;
function GetOutPin(pFilter: IBaseFilter; nPin: integer): IPin;
function FindOtherSplitterPin(pPinIn: IPin; guid: TGUID; nStream: integer; out ppSplitPin: IPin): HRESULT;
function SeekNextFrame(pSeeking: IMediaSeeking; FPS: Double; Frame: LongInt): HRESULT;
procedure ShowFilenameByCLSID(clsid: TGUID; out szFilename: WideString);
function GetFileDurationString(pMS: IMediaSeeking; out szDuration: WideString): HRESULT;
function CanFrameStep(pGB: IGraphBuilder): Boolean;
procedure UtilFreeMediaType(pmt: PAMMediaType);
procedure UtilDeleteMediaType(pmt: PAMMediaType);
function SaveGraphFile(pGraph: IGraphBuilder; wszPath: WideString): HRESULT;
function LoadGraphFile(pGraph: IGraphBuilder; const wszName: WideString): HRESULT;
// milenko end
// Added by Michael. Used to Detect installed DirectX Version. (Source from getdxver.cpp)
function GetDXVersion(var pdwDirectXVersion : DWORD; out strDirectXVersion : String) : HResult;
type
// DirectShow Exception class
EDirectShowException = class(Exception)
ErrorCode: Integer;
end;
EDSPackException = class(Exception)
ErrorCode: Integer;
end;
// *****************************************************************************
// TSysDevEnum
// *****************************************************************************
{@exclude}
PFilCatNode = ^TFilCatNode;
{@exclude}
TFilCatNode = record
FriendlyName : Shortstring;
CLSID : TGUID;
end;
{ Usefull class to enumerate availables filters.
See "Filter Enumerator" sample. }
TSysDevEnum = class
private
FGUID : TGUID;
FCategories : TList;
FFilters : TList;
ACategory : PFilCatNode;
procedure GetCat(catlist: TList; CatGUID: TGUID);
function GetCountCategories: integer;
function GetCountFilters: integer;
function GetCategory(item: integer): TFilCatNode;
function GetFilter(item: integer): TFilCatNode;
public
{ Select the main category by GUID. For example CLSID_VideoCompressorCategory
to enumerate Video Compressors. }
procedure SelectGUIDCategory(GUID: TGUID);
{ Select the main category by Index. }
procedure SelectIndexCategory(index: integer);
{ Call CountCategories to retrieve categories count.}
property CountCategories: integer read GetCountCategories;
{ Call CountFilters to retrieve the number of Filte within a Category. }
property CountFilters: integer read GetCountFilters;
{ Call Categories to read Category Name and GUID. }
property Categories[item: integer]: TFilCatNode read GetCategory;
{ Call Filters to read Filter Name and GUID. }
property Filters[item: integer]: TFilCatNode read GetFilter;
{ Find filter index by FriendlyName; -1, if not found }
function FilterIndexOfFriendlyName(const FriendlyName: string): Integer;
{ Call GetBaseFilter to retrieve the IBaseFilter interface corresponding to index. }
function GetBaseFilter(index: integer): IBaseFilter; overload;
{ Call GetBaseFilter to retrieve the IBaseFilter interface corresponding to GUID. }
function GetBaseFilter(GUID: TGUID): IBaseFilter; overload;
{ Call GetMoniker to retrieve the IMoniker interface corresponding to index.
This interface can be used to store a filter with the @link(TBaseFiter) class. }
function GetMoniker(index: integer): IMoniker;
{ constructor }
constructor Create; overload;
{ constructor. Create the class and initialize the main category with the GUID. }
constructor Create(guid: TGUID); overload;
{ destructor }
destructor Destroy; override;
end;
// *****************************************************************************
// TFilterList
// *****************************************************************************
{ This class can enumerate all filters in a FilterGraph. }
TFilterList = class(TInterfaceList)
private
Graph : IFilterGraph;
function GetFilter(Index: Integer): IBaseFilter;
procedure PutFilter(Index: Integer; Item: IBaseFilter);
function GetFilterInfo(index: integer): TFilterInfo;
public
{ Create a list based on a FilterGraph. }
constructor Create(FilterGraph: IFilterGraph); overload;
{ Destructor. }
destructor Destroy; override;
{ Update the list. }
procedure Update;
{ Reload the list from another FilterGraph.}
procedure Assign(FilterGraph: IFilterGraph);
{ Call First to obtain the first interface in the list. }
function First: IBaseFilter;
{ Call IndexOf to obtain the index of an interface. }
function IndexOf(Item: IBaseFilter): Integer;
{ Call Add to add an interface to the list. }
function Add(Item: IBaseFilter): Integer;
{ Call Insert to insert an interface into the list. Item is the interface to
insert, and Index indicates the position (zero-offset) where the interface
should be added. }
procedure Insert(Index: Integer; Item: IBaseFilter);
{ Call Last to obtain the last interface in the list. }
function Last: IBaseFilter;
{ Call Remove to remove an interface from the list. Remove returns the index
of the removed interface, or 1 if the interface was not found. }
function Remove(Item: IBaseFilter): Integer;
{ Use Items to directly access an interface in the list. Index identifies each
interface by its position in the list. }
property Items[Index: Integer]: IBaseFilter read GetFilter write PutFilter; default;
{ call FilterInfo to retrieve the Filer name and his FilterGraph. }
property FilterInfo[Index: Integer] : TFilterInfo read GetFilterInfo;
end;
//******************************************************************************
// TPinList
//******************************************************************************
{Helper class to enumerate pins on a filter. }
TPinList = class(TInterfaceList)
private
Filter: IBaseFilter;
function GetPin(Index: Integer): IPin;
procedure PutPin(Index: Integer; Item: IPin);
function GetPinInfo(index: integer): TPinInfo;
function GetConnected(Index: Integer): boolean;
public
{ Create a Pin list from the IBaseFilter interface. }
constructor Create(BaseFilter: IBaseFilter); overload;
{ Destructor. }
destructor Destroy; override;
{ Update the Pin list. }
procedure Update;
{ Load a Pin list from the IBaseFilter Interface. }
procedure Assign(BaseFilter: IBaseFilter);
{ Return the First Pin from in the list. }
function First: IPin;
{ Return the index of Pin in the list. }
function IndexOf(Item: IPin): Integer;
{ Add A Pin to the list. }
function Add(Item: IPin): Integer;
{ Insert a pin at the given position. }
procedure Insert(Index: Integer; Item: IPin);
{ Return the last pin in the list. }
function Last: IPin;
{ Remove a pin from the lis. }
function Remove(Item: IPin): Integer;
{ Return the the pin interface at the defined position. }
property Items[Index: Integer]: IPin read GetPin write PutPin; default;
{ Retrieve informations on a pin. }
property PinInfo[Index: Integer]: TPinInfo read GetPinInfo;
property Connected[Index: Integer]: boolean read GetConnected;
end;
// *****************************************************************************
// TMediaType
// *****************************************************************************
{ Uses TMediaType to configure media types. This class have a special property editor.
See @link(TSampleGrabber)}
TMediaType = class(TPersistent)
private
function GetMajorType: TGUID;
procedure SetMajorType(MT: TGUID);
function GetSubType: TGUID;
procedure SetSubType(ST: TGUID);
procedure SetFormatType(const GUID: TGUID);
function GetFormatType: TGUID;
procedure ReadData(Stream: TStream);
procedure WriteData(Stream: TStream);
protected
{ @exclude}
procedure DefineProperties(Filer: TFiler); override;
public
{ Local copy of the Media Type. }
AMMediaType: PAMMediaType;
{ Destructor method. }
destructor Destroy; override;
{ Constructor method. }
constructor Create; overload;
{ Constructor method. Initialised with majortype. }
constructor Create(majortype: TGUID); overload;
{ Constructor method. Initialised with another media type. }
constructor Create(mediatype: PAMMediaType); overload;
{ Constructor method. Initialised with another TMediaType}
constructor Create(MTClass: TMediaType); overload;
{ Copy from another TMediaType. }
procedure Assign(Source: TPersistent); override;
{ Copy from another PAM_MEDIA_TYPE. }
procedure Read(mediatype: PAMMediaType);
{ Tests for equality between TMediaType objects.<br>
<b>rt:</b> Reference to the TMediaType object to compare.<br>
Returns TRUE if rt is equal to this object. Otherwise, returns FALSE. }
function Equal(MTClass: TMediaType): boolean; overload;
{ Tests for inequality between TMediaType objects.<br>
<b>rt:</b> Reference to the TMediaType object to compare.<br>
Returns TRUE if rt is not equal to this object. Otherwise, returns FALSE. }
function NotEqual(MTClass: TMediaType): boolean; overload;
{ The IsValid method determines whether a major type has been assigned to this object.
Returns TRUE if a major type has been assigned to this object. Otherwise, returns FALSE.
By default, TMediaType objects are initialized with a major type of GUID_NULL.
Call this method to determine whether the object has been correctly initialized.}
function IsValid: boolean;
{ The IsFixedSize method determines if the samples have a fixed size or a variable size.
Returns the value of the bFixedSizeSamples member.}
function IsFixedSize: boolean;
{ The IsTemporalCompressed method determines if the stream uses temporal compression.
Returns the value of the bTemporalCompression member. }
function IsTemporalCompressed: boolean;
{ The GetSampleSize method retrieves the sample size.
If the sample size is fixed, returns the sample size in bytes. Otherwise,
returns zero. }
function GetSampleSize: ULONG;
{ The SetSampleSize method specifies a fixed sample size, or specifies that
samples have a variable size. If value of sz is zero, the media type uses
variable sample sizes. Otherwise, the sample size is fixed at sz bytes. }
procedure SetSampleSize(SZ: ULONG);
{ The SetVariableSize method specifies that samples do not have a fixed size.
This method sets the bFixedSizeSamples member to FALSE. Subsequent calls to the TMediaType.GetSampleSize method return zero. }
procedure SetVariableSize;
{ The SetTemporalCompression method specifies whether samples are compressed
using temporal (interframe) compression. }
procedure SetTemporalCompression(bCompressed: boolean);
{ read/write pointer to format - can't change length without
calling SetFormat, AllocFormatBuffer or ReallocFormatBuffer}
function Format: pointer;
{ The FormatLength method retrieves the length of the format block. }
function FormatLength: ULONG;
{ The SetFormat method specifies the format block.<br>
<b>pFormat:</b> Pointer to a block of memory that contains the format block.<br>
<b>length:</b> Length of the format block, in bytes. }
function SetFormat(pFormat: pointer; length: ULONG): boolean;
{ The ResetFormatBuffer method deletes the format block. }
procedure ResetFormatBuffer;
{ The AllocFormatBuffer method allocates memory for the format block.<br>
<b>length:</b> Size required for the format block, in bytes.<br>
Returns a pointer to the new block if successful. Otherwise, returns nil.<br>
If the method successfully allocates a new format block, it frees the existing
format block. If the allocation fails, the method leaves the existing format block. }
function AllocFormatBuffer(length: ULONG): pointer;
{ The ReallocFormatBuffer method reallocates the format block to a new size.<br>
<b>length:</b> New size required for the format block, in bytes. Must be greater
than zero.<br>
Returns a pointer to the new block if successful. Otherwise, returns either
a pointer to the old format block, or nil.
This method allocates a new format block. It copies as much of the existing
format block as possible into the new format block. If the new block is
smaller than the existing block, the existing format block is truncated.
If the new block is larger, the contents of the additional space are undefined.
They are not explicitly set to zero. }
function ReallocFormatBuffer(length: ULONG): pointer;
{ The InitMediaType method initializes the media type.
This method zeroes the object's memory, sets the fixed-sample-size property
to TRUE, and sets the sample size to 1. }
procedure InitMediaType;
{ The MatchesPartial method determines if this media type matches a partially
specified media type. The media type specified by ppartial can have a value
of GUID_NULL for the major type, subtype, or format type. Any members with
GUID_NULL values are not tested. (In effect, GUID_NULL acts as a wildcard.)
Members with values other than GUID_NULL must match for the media type to match.}
function MatchesPartial(ppartial: TMediaType): boolean;
{ The IsPartiallySpecified method determines if the media type is partially
defined. A media type is partial if the major type, subtype, or format type
is GUID_NULL. The IPin.Connect method can accept partial media types.
The implementation does not actually test the subtype. If there is a specified
format type, the media type is not considered partial, even if the subtype is GUID_NULL. }
function IsPartiallySpecified: boolean;
{ Set or retrieve the MajorType GUID. }
property MajorType: TGUID read GetMajorType write SetMajorType;
{ Set or retrieve the SubType GUID. }
property SubType: TGUID read GetSubType write SetSubType;
{ Set or retrieve the FormatType GUID. }
property FormatType: TGUID read GetFormatType write SetFormatType;
end;
// *****************************************************************************
// TEnumMediaType
// *****************************************************************************
{ This class can retrieve all media types from a pin, a file or an IEnumMediaTypes interface. }
TEnumMediaType = class(TObject)
private
FList : TList;
function GetItem(Index: Integer): TMediaType;
procedure SetItem(Index: Integer; Item: TMediaType);
function GetMediaDescription(Index: Integer): string;
function GetCount: integer;
public
{ Constructor method.}
constructor Create; overload;
{ Constructor method enumerating all media types on a pin. }
constructor Create(Pin: IPin); overload;
{ Constructor method enumerating media types provided by a IEnumMediaType interface. }
constructor Create(EnumMT: IEnumMediaTypes); overload;
{ Constructor method enumerating all media types availables in a media file.
Support WMF files. }
constructor Create(FileName: TFileName); overload;
{ Destructor method. }
destructor Destroy; override;
{ Enumerate all media types on a pin.}
procedure Assign(Pin: IPin); overload;
{ Enumerate media types provided by a IEnumMediaType interface. }
procedure Assign(EnumMT: IEnumMediaTypes); overload;
{ Enumerate all media types availables in a media file. Support WMF files. }
procedure Assign(FileName: TFileName); overload;
{ Add a media type to the list. }
function Add(Item: TMediaType): Integer;
{ Clear the list. }
procedure Clear;
{ Remove a media type from the list. }
procedure Delete(Index: Integer);
{ Retrieve a mediaa type. }
property Items[Index: Integer]: TMediaType read GetItem write SetItem;
{ Return a string describing the media type. }
property MediaDescription[Index: Integer]: string read GetMediaDescription;
{ Number of items in the list. }
property Count: integer read GetCount;
end;
// *****************************************************************************
// TPersistentMemory
// *****************************************************************************
{ For internal use. This class is designed to store a custom memory stream with
a form. It is the ancestor of @link(TBaseFilter).}
TPersistentMemory = class(TPersistent)
private
FData: pointer;
FDataLength: Cardinal;
procedure ReadData(Stream: TStream);
procedure WriteData(Stream: TStream);
function Equal(Memory: TPersistentMemory): boolean;
procedure AllocateMemory(ALength: Cardinal);
protected
{ @exclude }
procedure AssignTo(Dest: TPersistent); override;
{ @exclude }
procedure DefineProperties(Filer: TFiler); override;
public
{ Set/Get the buffer length. }
property DataLength: Cardinal read FDataLength write AllocateMemory;
{ Pointer to buffer. }
property Data: Pointer read FData;
{ Constructor }
constructor Create; virtual;
{ Destructor }
destructor Destroy; override;
{ Call Assign to copy the properties or other attributes of one object from another. }
procedure Assign(Source: TPersistent); override;
end;
// *****************************************************************************
// TBaseFilter
// *****************************************************************************
{ This class can store a custom filter as a moniker within the dfm file. }
TBaseFilter = class(TPersistentMemory)
private
procedure SetMoniker(Moniker: IMoniker);
function GetMoniker: IMoniker;
public
{ Set or retrieve the moniker interface.}
property Moniker: IMoniker read GetMoniker write SetMoniker;
{ Read a property bag. For example you can read the GUID identifier (PropertyBag('CLSID'))}
function PropertyBag(Name: WideString): OleVariant;
{Return the IBaseFilter interface corresponding to filter.}
function CreateFilter: IBaseFilter;
end;
// *****************************************************************************
// DxDiag.h
// *****************************************************************************
const
// This identifier is passed to IDxDiagProvider::Initialize in order to ensure that an
// application was built against the correct header files. This number is
// incremented whenever a header (or other) change would require applications
// to be rebuilt. If the version doesn't match, IDxDiagProvider::Initialize will fail.
// (The number itself has no meaning.)
DXDIAG_DX9_SDK_VERSION = 111;
(****************************************************************************
*
* DxDiag Errors
*
****************************************************************************)
DXDIAG_E_INSUFFICIENT_BUFFER = HResult($8007007A);
(****************************************************************************
*
* DxDiag CLSIDs
*
****************************************************************************)
CLSID_DxDiagProvider : TGUID = '{A65B8071-3BFE-4213-9A5B-491DA4461CA7}';
(****************************************************************************
*
* DxDiag Interface IIDs
*
****************************************************************************)
IID_IDxDiagProvider : TGUID = '{9C6B4CB0-23F8-49CC-A3ED-45A55000A6D2}';
IID_IDxDiagContainer : TGUID = '{7D0F462F-4064-4862-BC7F-933E5058C10F}';
Type
(****************************************************************************
*
* DxDiag Structures
*
****************************************************************************)
PDXDIAG_INIT_PARAMS = ^TDxDiagInitParams;
_DXDIAG_INIT_PARAMS = record
dwSize : DWORD; // Size of this structure.
dwDxDiagHeaderVersion : DWORD; // Pass in DXDIAG_DX9_SDK_VERSION. This verifies
// the header and dll are correctly matched.
bAllowWHQLChecks : Boolean; // If true, allow dxdiag to check if drivers are
// digital signed as logo'd by WHQL which may
// connect via internet to update WHQL certificates.
pReserved : Pointer; // Reserved. Must be NULL.
End;
{$EXTERNALSYM _DXDIAG_INIT_PARAMS}
DXDIAG_INIT_PARAMS = _DXDIAG_INIT_PARAMS;
{$EXTERNALSYM DXDIAG_INIT_PARAMS}
TDxDiagInitParams = _DXDIAG_INIT_PARAMS;
(****************************************************************************
*
* DxDiag Application Interfaces
*
****************************************************************************)
IDxDiagProvider = interface;
IDxDiagContainer = interface;
IDxDiagProvider = interface(IUnknown)
['{9C6B4CB0-23F8-49CC-A3ED-45A55000A6D2}']
// *** IDxDiagProvider methods *** //
function Initialize(pParams : PDXDIAG_INIT_PARAMS): HResult; stdcall;
function GetRootContainer(Out ppInstance : IDxDiagContainer): HResult; stdcall;
End;
IDxDiagContainer = interface(IUnknown)
['{7D0F462F-4064-4862-BC7F-933E5058C10F}']
// *** IDxDiagContainer methods *** //
function GetNumberOfChildContainers(Out pdwCount : dword) : HResult; stdcall;
function EnumChildContainerNames(dwIndex : dword; pwszContainer : PWideChar; cchContainer : DWord) : HResult; stdcall;
function GetChildContainer(pwszContainer : PWideChar; Out ppInstance : IDxDiagContainer) : Hresult; stdcall;
function GetNumberOfProps(Out pdwCount : dword) : HResult; stdcall;
function EnumPropNames(dwIndex : dword; pwszPropName : PWideChar; cchPropName : dword) : HResult; stdcall;
function GetProp(pwszPropName : PWideChar; Out pvarProp : OleVariant) : HResult; stdcall;
End;
// milenko start DMO TMediaBuffer implementation
TMediaBuffer = class(TObject, IMediaBuffer, IUnKnown)
private
FRefCount: integer;
FLength: DWORD;
FMaxLength: DWORD;
FData: PByte;
public
constructor Create(MaxLen: DWORD);
destructor Destroy; override;
class function CreateBuffer(MaxLen: DWORD; const IID: TGUID; out Obj): HRESULT;
// IUnknown
function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall;
function _AddRef: Integer; stdcall;
function _Release: Integer; stdcall;
// IMediaBuffer methods
function SetLength(cbLength: DWORD): HResult; stdcall;
function GetMaxLength(out pcbMaxLength: DWORD): HResult; stdcall;
function GetBufferAndLength(out ppBuffer: PByte; // not filled if NULL
out pcbLength: DWORD // not filled if NULL
): HResult; stdcall;
end;
// milenko end
// milenko start wxutil implementation
const
RESOLUTION = DWORD(1); // High resolution timer
ADVISE_CACHE = integer(4); // Default cache size
MILLISECONDS = LONGLONG(1000); // 10 ^ 3
NANOSECONDS = LONGLONG(1000000000); // 10 ^ 9
UNITS = LONGLONG(NANOSECONDS div 100); // 10 ^ 7
TimeZero = LONGLONG(0);
type
DWORDLONG = LONGLONG; // Should be unsigned Int64 !!!
ULONGLONG = DWORDLONG; // Should be unsigned Int64 !!!
function UInt32x32To64(a, b: DWORD): ULONGLONG;
function Int64x32Div32(a: LONGLONG; b, c, d: LongInt): LONGLONG;
function Int32x32To64(a, b: integer): Int64;
function MILLISECONDS_TO_100NS_UNITS(Ms: LONGLONG): LONGLONG;
function llMulDiv(a, b, c, d: LONGLONG): LONGLONG;
function AmGetLastErrorToHResult: HRESULT;
function IsEqualObject(pFirst, pSecond: IUnknown): Boolean;
// milenko end
// milenko start namedguid implementation
const
IID_IDirectDrawKernel : TGUID = '{8D56C120-6A08-11D0-9B06-00A0C903A3B8}';
IID_IDirectDrawSurfaceKernel: TGUID = '{60755DA0-6A40-11D0-9B06-00A0C903A3B8}';
function GetGUIDString(GUID: TGUID): String;
// milenko end
// milenko start (usefull functions to get linear amplification)
function GetBasicAudioVolume(Value : integer) : integer;
function SetBasicAudioVolume(Value : integer) : integer;
function GetBasicAudioPan(Value : integer) : integer;
function SetBasicAudioPan(Value : integer) : integer;
// milenko end
// milenok start (yet another delphi5 compatibility ...)
{$IFDEF VER130}
function GUIDToString(const GUID: TGUID): string;
function StringToGUID(const S: string): TGUID;
function EnsureRange(const AValue, AMin, AMax: Integer): Integer;
{$ENDIF}
// milenko end
{$IFNDEF COMPILER6_UP}
procedure Set8087CW(NewCW: Word);
function Get8087CW: Word;
{$ENDIF}
// previously TMPEGHeaderBitsWrapper
function MPEGHeaderBitsGetSectionLength(Header: PMPEGHeaderBits) : Word;
function MPEGHeaderBitsGetReserved(Header: PMPEGHeaderBits): WORD;
function MPEGHeaderBitsGetPrivateIndicator(Header: PMPEGHeaderBits): WORD;
function MPEGHeaderBitsGetSectionSyntaxIndicator(Header: PMPEGHeaderBits): WORD;
procedure MPEGHeaderBitsSetSectionLength(Header: PMPEGHeaderBits; AValue: WORD);
procedure MPEGHeaderBitsSetReserved(Header: PMPEGHeaderBits; AValue: WORD);
procedure MPEGHeaderBitsSetPrivateIndicator(Header: PMPEGHeaderBits; AValue: WORD);
procedure MPEGHeaderBitsSetSectionSyntaxIndicator(Header: PMPEGHeaderBits; AValue: WORD);
// previously TPIDBitsWrapper
function PIDBitsGetReserved(PIDBits: PPIDBits): WORD;
function PIDBitsGetProgramId(PIDBits: PPIDBits): WORD;
procedure PIDBitsSetReserved(PIDBits: PPIDBits; AValue: WORD);
procedure PIDBitsSetProgramId(PIDBits: PPIDBits; AValue: WORD);
// previously TPIDBitsWrapper
function MPEGHeaderVersionBitsGetCurrentNextIndicator(MPEGHeaderVersionBits: PMPEGHeaderVersionBits): Byte;
function MPEGHeaderVersionBitsGetVersionNumber(MPEGHeaderVersionBits: PMPEGHeaderVersionBits): Byte;
function MPEGHeaderVersionBitsGetReserved(MPEGHeaderVersionBits: PMPEGHeaderVersionBits): Byte;
procedure MPEGHeaderVersionBitsSetCurrentNextIndicator(MPEGHeaderVersionBits: PMPEGHeaderVersionBits; AValue: Byte);
procedure MPEGHeaderVersionBitsSetVersionNumber(MPEGHeaderVersionBits: PMPEGHeaderVersionBits; AValue: Byte);
procedure MPEGHeaderVersionBitsSetReserved(MPEGHeaderVersionBits: PMPEGHeaderVersionBits; AValue: Byte);
implementation
uses
DirectSound, Math, ComObj, Registry;
{$IFNDEF COMPILER6_UP}
var
Default8087CW: Word = $1372;
procedure Set8087CW(NewCW: Word);
begin
Default8087CW := NewCW;
asm
FNCLEX
FLDCW Default8087CW
end;
end;
function Get8087CW: Word;
asm
PUSH 0
FNSTCW [ESP].Word
POP EAX
end;
{$ENDIF}