aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authork-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2012-05-10 08:21:01 +0000
committerk-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2012-05-10 08:21:01 +0000
commit15a9be95ed35a087df0d22fc0f1f7a9fcad6ea5b (patch)
treedfb3ec2bd669ded85a92355e5740de0aca204df4 /test
parent295a057b3b1ea7b24602e94307f7f11c36d981dd (diff)
downloadusdx-15a9be95ed35a087df0d22fc0f1f7a9fcad6ea5b.tar.gz
usdx-15a9be95ed35a087df0d22fc0f1f7a9fcad6ea5b.tar.xz
usdx-15a9be95ed35a087df0d22fc0f1f7a9fcad6ea5b.zip
a simple test for TFFmpegDecodeStream.Open in media/UAudioDecoder_FFmpeg.pas
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2878 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'test')
-rw-r--r--test/FFmpeg_Test6.pas40
-rw-r--r--test/menuswoosh.mp3bin0 -> 5246 bytes
2 files changed, 40 insertions, 0 deletions
diff --git a/test/FFmpeg_Test6.pas b/test/FFmpeg_Test6.pas
new file mode 100644
index 00000000..88751853
--- /dev/null
+++ b/test/FFmpeg_Test6.pas
@@ -0,0 +1,40 @@
+Program FFmpeg_Test6;
+
+{$IFDEF FPC}
+ {$MODE Delphi}
+{$ENDIF}
+
+(**
+ * Test of function TFFmpegDecodeStream.Open in media/UAudioDecoder_FFmpeg.pas
+ * after configure for selecting the installed FFmpeg lib compile with:
+ *
+ * fpc -Fi../src -Fu../src/base -Fu../src/lib/FFmpeg-0.... FFmpeg_Test6.pas
+ *)
+
+uses
+ avcodec,
+ avformat;
+
+const
+ Filename: PAnsiChar = 'menuswoosh.mp3';
+
+var
+ fFormatCtx: PAVFormatContext;
+ TestFrame: TAVPacket;
+
+begin
+ av_register_all;
+ if (av_open_input_file(fFormatCtx, Filename, nil, 0, nil) <> 0) then
+ writeln('av_open_input_file failed: File not found: ', Filename);
+
+ if (av_read_frame(fFormatCtx, TestFrame) < 0) then
+ writeln('av_read_frame failed');
+
+ dump_format(fFormatCtx, 0, argv[1], 0);
+
+ if (fFormatCtx <> nil) then
+ begin
+ av_close_input_file(fFormatCtx);
+ fFormatCtx := nil;
+ end;
+end.
diff --git a/test/menuswoosh.mp3 b/test/menuswoosh.mp3
new file mode 100644
index 00000000..1025a86f
--- /dev/null
+++ b/test/menuswoosh.mp3
Binary files differ