-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestFFmpegDLL.dpr
More file actions
131 lines (115 loc) · 3.05 KB
/
TestFFmpegDLL.dpr
File metadata and controls
131 lines (115 loc) · 3.05 KB
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
program TestFFmpegDLL;
{$APPTYPE CONSOLE}
uses
System.SysUtils,
Winapi.Windows;
type
TAvFormatNetworkInit = procedure; cdecl;
TAvFormatNetworkDeinit = procedure; cdecl;
var
hAvFormat: THandle;
hAvCodec: THandle;
hAvUtil: THandle;
hSwScale: THandle;
avformat_network_init: TAvFormatNetworkInit;
avformat_network_deinit: TAvFormatNetworkDeinit;
begin
try
WriteLn('=== Test Caricamento DLL FFmpeg ===');
WriteLn;
// Test avutil
Write('Caricamento avutil-60.dll... ');
hAvUtil := LoadLibrary('avutil-60.dll');
if hAvUtil = 0 then
begin
WriteLn('FALLITO! Errore: ', GetLastError);
WriteLn('Premi INVIO per uscire...');
ReadLn;
Exit;
end;
WriteLn('OK');
// Test avcodec
Write('Caricamento avcodec-62.dll... ');
hAvCodec := LoadLibrary('avcodec-62.dll');
if hAvCodec = 0 then
begin
WriteLn('FALLITO! Errore: ', GetLastError);
FreeLibrary(hAvUtil);
WriteLn('Premi INVIO per uscire...');
ReadLn;
Exit;
end;
WriteLn('OK');
// Test avformat
Write('Caricamento avformat-62.dll... ');
hAvFormat := LoadLibrary('avformat-62.dll');
if hAvFormat = 0 then
begin
WriteLn('FALLITO! Errore: ', GetLastError);
FreeLibrary(hAvCodec);
FreeLibrary(hAvUtil);
WriteLn('Premi INVIO per uscire...');
ReadLn;
Exit;
end;
WriteLn('OK');
// Test swscale
Write('Caricamento swscale-9.dll... ');
hSwScale := LoadLibrary('swscale-9.dll');
if hSwScale = 0 then
begin
WriteLn('FALLITO! Errore: ', GetLastError);
FreeLibrary(hAvFormat);
FreeLibrary(hAvCodec);
FreeLibrary(hAvUtil);
WriteLn('Premi INVIO per uscire...');
ReadLn;
Exit;
end;
WriteLn('OK');
WriteLn;
WriteLn('Tutte le DLL caricate con successo!');
WriteLn;
// Test avformat_network_init
Write('Test avformat_network_init... ');
@avformat_network_init := GetProcAddress(hAvFormat, 'avformat_network_init');
if @avformat_network_init = nil then
begin
WriteLn('FALLITO! Funzione non trovata');
end
else
begin
try
avformat_network_init;
WriteLn('OK');
Write('Test avformat_network_deinit... ');
@avformat_network_deinit := GetProcAddress(hAvFormat, 'avformat_network_deinit');
if @avformat_network_deinit = nil then
begin
WriteLn('FALLITO! Funzione non trovata');
end
else
begin
avformat_network_deinit;
WriteLn('OK');
end;
except
on E: Exception do
WriteLn('EXCEPTION: ', E.ClassName, ' - ', E.Message);
end;
end;
WriteLn;
WriteLn('=== Test completato con successo ===');
// Cleanup
FreeLibrary(hSwScale);
FreeLibrary(hAvFormat);
FreeLibrary(hAvCodec);
FreeLibrary(hAvUtil);
except
on E: Exception do
WriteLn('ERRORE: ', E.ClassName, ' - ', E.Message);
end;
WriteLn;
WriteLn('Premi INVIO per uscire...');
ReadLn;
end.