aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/lib/ffmpeg
diff options
context:
space:
mode:
authorjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-09-13 11:39:57 +0000
committerjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-09-13 11:39:57 +0000
commit5a778181e947cfb883f85d3239f6d1f1714dacc8 (patch)
treee9483aab9464d34d4d1171aa97504c6a283d54b0 /Game/Code/lib/ffmpeg
parentf0bf8c49eadf2656bf91a4b24a6ce5106b887b0a (diff)
downloadusdx-5a778181e947cfb883f85d3239f6d1f1714dacc8.tar.gz
usdx-5a778181e947cfb883f85d3239f6d1f1714dacc8.tar.xz
usdx-5a778181e947cfb883f85d3239f6d1f1714dacc8.zip
changes to make 3rd party libraries compile / work
in lazarus. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@387 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/lib/ffmpeg')
-rw-r--r--Game/Code/lib/ffmpeg/avcodec.pas6
-rw-r--r--Game/Code/lib/ffmpeg/avformat.pas13
-rw-r--r--Game/Code/lib/ffmpeg/avio.pas2
-rw-r--r--Game/Code/lib/ffmpeg/lazarustest.lpi194
-rw-r--r--Game/Code/lib/ffmpeg/lazarustest.lpr27
5 files changed, 238 insertions, 4 deletions
diff --git a/Game/Code/lib/ffmpeg/avcodec.pas b/Game/Code/lib/ffmpeg/avcodec.pas
index 978b5fb6..ce08dcc9 100644
--- a/Game/Code/lib/ffmpeg/avcodec.pas
+++ b/Game/Code/lib/ffmpeg/avcodec.pas
@@ -576,7 +576,7 @@ type
of AVIn/OutputFormat *)
item_name: function (): pchar; cdecl;
option: PAVOption;
- end;
+ end;
TAVCodecContext = record {720}
(*** Info on struct for av_log
@@ -1792,11 +1792,13 @@ procedure av_resample_close (c: PAVResampleContext);
got_sub_ptr: pinteger;
const buf: pchar; buf_size: integer): integer;
cdecl; external av__codec;
+
+ {$IFNDEF FPC}
function avcodec_parse_frame (avctx: PAVCodecContext; pdata: PPointer;
data_size_ptr: pinteger;
buf: pchar; buf_size: integer): integer;
cdecl; external av__codec;
-
+ {$ENDIF}
function avcodec_encode_audio (avctx: PAVCodecContext; buf: PByte;
buf_size: integer; const samples: Pword): integer;
cdecl; external av__codec;
diff --git a/Game/Code/lib/ffmpeg/avformat.pas b/Game/Code/lib/ffmpeg/avformat.pas
index 0aa98905..6d13bcdf 100644
--- a/Game/Code/lib/ffmpeg/avformat.pas
+++ b/Game/Code/lib/ffmpeg/avformat.pas
@@ -19,6 +19,10 @@ unit avformat;
interface
+{$IFDEF FPC}
+ {$MODE Delphi}
+{$ENDIF}
+
uses
windows, avcodec, avio, rational, avutil;
@@ -554,6 +558,7 @@ const
const
FFM_PACKET_SIZE = 4096;
+ {$IFNDEF FPC}
function ffm_read_write_index (fd: integer): int64;
cdecl; external av__format;
@@ -562,20 +567,23 @@ const
procedure ffm_set_write_index (s: PAVFormatContext; pos: int64; file_size: int64);
cdecl; external av__format;
-
+ {$ENDIF}
+
function find_info_tag (arg: pchar; arg_size: integer; tag1: pchar; info: pchar): integer;
cdecl; external av__format;
+ {$IFNDEF FPC}
function get_frame_filename(buf: pchar; buf_size: integer;
path: pchar; number: integer): integer;
cdecl; external av__format;
+
function filename_number_test (filename: pchar): integer;
cdecl; external av__format;
-
(* grab specific *)
function video_grab_init (): integer;
cdecl; external av__format;
+
function audio_init (): integer;
cdecl; external av__format;
@@ -584,6 +592,7 @@ const
cdecl; external av__format;
function dc1394_init (): integer;
cdecl; external av__format;
+ {$ENDIF}
function strstart(str: pchar; val: pchar; ptr: PPointer): integer;
cdecl; external av__format;
diff --git a/Game/Code/lib/ffmpeg/avio.pas b/Game/Code/lib/ffmpeg/avio.pas
index 20275ab7..7d0e8c04 100644
--- a/Game/Code/lib/ffmpeg/avio.pas
+++ b/Game/Code/lib/ffmpeg/avio.pas
@@ -224,12 +224,14 @@ type
procedure init_checksum (s: PByteIOContext; update_checksum: pointer; checksum: cardinal);
cdecl; external av__format;
+ {$IFNDEF FPC}
function udp_set_remote_url(h: PURLContext; const uri: pchar): integer;
cdecl; external av__format;
function udp_get_local_port(h: PURLContext): integer;
cdecl; external av__format;
function udp_get_file_handle(h: PURLContext): integer;
cdecl; external av__format;
+ {$ENDIF}
implementation
diff --git a/Game/Code/lib/ffmpeg/lazarustest.lpi b/Game/Code/lib/ffmpeg/lazarustest.lpi
new file mode 100644
index 00000000..3cd1c3de
--- /dev/null
+++ b/Game/Code/lib/ffmpeg/lazarustest.lpi
@@ -0,0 +1,194 @@
+<?xml version="1.0"?>
+<CONFIG>
+ <ProjectOptions>
+ <PathDelim Value="\"/>
+ <Version Value="5"/>
+ <General>
+ <MainUnit Value="0"/>
+ <IconPath Value="./"/>
+ <TargetFileExt Value=".exe"/>
+ <ActiveEditorIndexAtStart Value="1"/>
+ </General>
+ <VersionInfo>
+ <ProjectVersion Value=""/>
+ <Language Value=""/>
+ <CharSet Value=""/>
+ </VersionInfo>
+ <PublishOptions>
+ <Version Value="2"/>
+ <IgnoreBinaries Value="False"/>
+ <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
+ <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
+ </PublishOptions>
+ <RunParams>
+ <local>
+ <FormatVersion Value="1"/>
+ <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
+ </local>
+ </RunParams>
+ <Units Count="5">
+ <Unit0>
+ <Filename Value="lazarustest.lpr"/>
+ <IsPartOfProject Value="True"/>
+ <UnitName Value="lazarustest"/>
+ <CursorPos X="26" Y="8"/>
+ <TopLine Value="1"/>
+ <EditorIndex Value="0"/>
+ <UsageCount Value="22"/>
+ <Loaded Value="True"/>
+ </Unit0>
+ <Unit1>
+ <Filename Value="delphi\bass.pas"/>
+ <UnitName Value="Bass"/>
+ <CursorPos X="12" Y="539"/>
+ <TopLine Value="589"/>
+ <UsageCount Value="10"/>
+ </Unit1>
+ <Unit2>
+ <Filename Value="avformat.pas"/>
+ <UnitName Value="avformat"/>
+ <CursorPos X="38" Y="594"/>
+ <TopLine Value="567"/>
+ <EditorIndex Value="1"/>
+ <UsageCount Value="10"/>
+ <Loaded Value="True"/>
+ </Unit2>
+ <Unit3>
+ <Filename Value="avcodec.pas"/>
+ <UnitName Value="avcodec"/>
+ <CursorPos X="3" Y="1796"/>
+ <TopLine Value="1775"/>
+ <EditorIndex Value="2"/>
+ <UsageCount Value="11"/>
+ <Loaded Value="True"/>
+ </Unit3>
+ <Unit4>
+ <Filename Value="avio.pas"/>
+ <UnitName Value="avio"/>
+ <CursorPos X="1" Y="1"/>
+ <TopLine Value="1"/>
+ <EditorIndex Value="3"/>
+ <UsageCount Value="11"/>
+ <Loaded Value="True"/>
+ </Unit4>
+ </Units>
+ <JumpHistory Count="24" HistoryIndex="23">
+ <Position1>
+ <Filename Value="lazarustest.lpr"/>
+ <Caret Line="16" Column="18" TopLine="1"/>
+ </Position1>
+ <Position2>
+ <Filename Value="avio.pas"/>
+ <Caret Line="28" Column="38" TopLine="36"/>
+ </Position2>
+ <Position3>
+ <Filename Value="avio.pas"/>
+ <Caret Line="29" Column="7" TopLine="9"/>
+ </Position3>
+ <Position4>
+ <Filename Value="avio.pas"/>
+ <Caret Line="30" Column="7" TopLine="10"/>
+ </Position4>
+ <Position5>
+ <Filename Value="avio.pas"/>
+ <Caret Line="31" Column="7" TopLine="11"/>
+ </Position5>
+ <Position6>
+ <Filename Value="avio.pas"/>
+ <Caret Line="44" Column="10" TopLine="40"/>
+ </Position6>
+ <Position7>
+ <Filename Value="avio.pas"/>
+ <Caret Line="1" Column="1" TopLine="1"/>
+ </Position7>
+ <Position8>
+ <Filename Value="avio.pas"/>
+ <Caret Line="23" Column="5" TopLine="3"/>
+ </Position8>
+ <Position9>
+ <Filename Value="avio.pas"/>
+ <Caret Line="1" Column="1" TopLine="1"/>
+ </Position9>
+ <Position10>
+ <Filename Value="avcodec.pas"/>
+ <Caret Line="567" Column="24" TopLine="560"/>
+ </Position10>
+ <Position11>
+ <Filename Value="avcodec.pas"/>
+ <Caret Line="1968" Column="5" TopLine="1928"/>
+ </Position11>
+ <Position12>
+ <Filename Value="avcodec.pas"/>
+ <Caret Line="22" Column="31" TopLine="6"/>
+ </Position12>
+ <Position13>
+ <Filename Value="avcodec.pas"/>
+ <Caret Line="247" Column="14" TopLine="227"/>
+ </Position13>
+ <Position14>
+ <Filename Value="avcodec.pas"/>
+ <Caret Line="546" Column="46" TopLine="526"/>
+ </Position14>
+ <Position15>
+ <Filename Value="avcodec.pas"/>
+ <Caret Line="20" Column="26" TopLine="1"/>
+ </Position15>
+ <Position16>
+ <Filename Value="avcodec.pas"/>
+ <Caret Line="250" Column="59" TopLine="230"/>
+ </Position16>
+ <Position17>
+ <Filename Value="avcodec.pas"/>
+ <Caret Line="841" Column="53" TopLine="821"/>
+ </Position17>
+ <Position18>
+ <Filename Value="avio.pas"/>
+ <Caret Line="1" Column="1" TopLine="1"/>
+ </Position18>
+ <Position19>
+ <Filename Value="avio.pas"/>
+ <Caret Line="236" Column="8" TopLine="205"/>
+ </Position19>
+ <Position20>
+ <Filename Value="avformat.pas"/>
+ <Caret Line="1" Column="1" TopLine="1"/>
+ </Position20>
+ <Position21>
+ <Filename Value="avformat.pas"/>
+ <Caret Line="568" Column="3" TopLine="541"/>
+ </Position21>
+ <Position22>
+ <Filename Value="avformat.pas"/>
+ <Caret Line="41" Column="17" TopLine="25"/>
+ </Position22>
+ <Position23>
+ <Filename Value="avformat.pas"/>
+ <Caret Line="1" Column="1" TopLine="1"/>
+ </Position23>
+ <Position24>
+ <Filename Value="avformat.pas"/>
+ <Caret Line="588" Column="1" TopLine="557"/>
+ </Position24>
+ </JumpHistory>
+ </ProjectOptions>
+ <CompilerOptions>
+ <Version Value="5"/>
+ <PathDelim Value="\"/>
+ <CodeGeneration>
+ <Generate Value="Faster"/>
+ </CodeGeneration>
+ <Other>
+ <CompilerPath Value="$(CompPath)"/>
+ </Other>
+ </CompilerOptions>
+ <Debugging>
+ <Exceptions Count="2">
+ <Item1>
+ <Name Value="ECodetoolError"/>
+ </Item1>
+ <Item2>
+ <Name Value="EFOpenError"/>
+ </Item2>
+ </Exceptions>
+ </Debugging>
+</CONFIG>
diff --git a/Game/Code/lib/ffmpeg/lazarustest.lpr b/Game/Code/lib/ffmpeg/lazarustest.lpr
new file mode 100644
index 00000000..56efac75
--- /dev/null
+++ b/Game/Code/lib/ffmpeg/lazarustest.lpr
@@ -0,0 +1,27 @@
+program lazarustest;
+
+{$MODE Delphi}
+
+uses
+
+ avcodec in 'avcodec.pas',
+ avformat in 'avformat.pas',
+ avutil in 'avutil.pas',
+ rational in 'rational.pas',
+ opt in 'opt.pas',
+ avio in 'avio.pas',
+ sysutils;
+
+begin
+ // This compiles with all units in..
+ // but I cant run it, if its compiled with lazarus or delphi
+ // I get errors about not finding functions in dll's
+
+ try
+// av_register_all();
+ writeln( 'If you see this then ffmpeg is probably lazarus compatible' );
+ except
+ writeln( 'ffmpeg is NOT lazarus compatible' );
+ end;
+end.
+