From 20e158548a02a6ac87e5e662d790e88882e0e4d9 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Sun, 4 Nov 2012 07:15:40 -0800 Subject: Imported Upstream version 1.1.1 --- win32/VS2005/README | 22 + win32/VS2005/dump_video/dump_video_dynamic.vcproj | 188 ++ win32/VS2005/dump_video/dump_video_static.vcproj | 188 ++ .../encoder_example/encoder_example_dynamic.vcproj | 184 ++ .../encoder_example/encoder_example_static.vcproj | 184 ++ win32/VS2005/libogg.vsprops | 19 + win32/VS2005/libtheora/libtheora_dynamic.vcproj | 882 ++++++++++ win32/VS2005/libtheora/libtheora_static.vcproj | 872 ++++++++++ win32/VS2005/libtheora_dynamic.sln | 146 ++ win32/VS2005/libtheora_static.sln | 146 ++ win32/VS2005/libvorbis.vsprops | 19 + win32/VS2008/README | 22 + win32/VS2008/dump_video/dump_video_dynamic.vcproj | 180 ++ win32/VS2008/dump_video/dump_video_static.vcproj | 180 ++ .../encoder_example/encoder_example_dynamic.vcproj | 176 ++ .../encoder_example/encoder_example_static.vcproj | 176 ++ win32/VS2008/libogg.vsprops | 19 + win32/VS2008/libtheora/libtheora_dynamic.vcproj | 766 ++++++++ win32/VS2008/libtheora/libtheora_static.vcproj | 748 ++++++++ win32/VS2008/libtheora_dynamic.sln | 146 ++ win32/VS2008/libtheora_static.sln | 146 ++ win32/VS2008/libvorbis.vsprops | 19 + win32/build_theora_static.bat | 18 + win32/build_theora_static_debug.bat | 18 + win32/experimental/dumpvid/dumpvid.dsp | 121 ++ win32/experimental/encoderwin/ReadMe.txt | 13 + win32/experimental/encoderwin/encoderwin.dsp | 121 ++ win32/experimental/transcoder/avi2vp3/avi2vp3.c | 82 + win32/experimental/transcoder/avi2vp3/avilib.c | 1839 ++++++++++++++++++++ win32/experimental/transcoder/avi2vp3/avilib.h | 309 ++++ win32/experimental/transcoder/avi2vp3/outfile.vp3 | Bin 0 -> 233132 bytes win32/experimental/transcoder/avi2vp3/vp31.avi | Bin 0 -> 299724 bytes win32/experimental/transcoder/readme.txt | 17 + win32/experimental/transcoder/transcoder.dsp | 121 ++ win32/experimental/transcoder/transcoder_example.c | 926 ++++++++++ win32/experimental/wincompat/README.txt | 1 + win32/experimental/wincompat/getopt.c | 122 ++ win32/experimental/wincompat/getopt.h | 110 ++ win32/experimental/wincompat/getopt_long.c | 547 ++++++ win32/experimental/wincompat/unistd.h | 0 win32/getopt.c | 1047 +++++++++++ win32/getopt1.c | 188 ++ win32/getopt_win.h | 169 ++ win32/theora_static.dsp | 336 ++++ win32/xmingw32/Makefile | 393 +++++ win32/xmingw32/libtheoradec-all.def | 58 + win32/xmingw32/libtheoradec-all.rc | 39 + win32/xmingw32/libtheoradec.rc | 3 + win32/xmingw32/libtheoradec70.rc | 3 + win32/xmingw32/libtheoradec70d.rc | 3 + win32/xmingw32/libtheoradec71.rc | 3 + win32/xmingw32/libtheoradec71d.rc | 3 + win32/xmingw32/libtheoradec80.rc | 3 + win32/xmingw32/libtheoradec80d.rc | 3 + win32/xmingw32/libtheoradecd.rc | 3 + win32/xmingw32/libtheoraenc-all.def | 17 + win32/xmingw32/libtheoraenc-all.rc | 39 + win32/xmingw32/libtheoraenc.rc | 3 + win32/xmingw32/libtheoraenc70.rc | 3 + win32/xmingw32/libtheoraenc70d.rc | 3 + win32/xmingw32/libtheoraenc71.rc | 3 + win32/xmingw32/libtheoraenc71d.rc | 3 + win32/xmingw32/libtheoraenc80.rc | 3 + win32/xmingw32/libtheoraenc80d.rc | 3 + win32/xmingw32/libtheoraencd.rc | 3 + 65 files changed, 12127 insertions(+) create mode 100644 win32/VS2005/README create mode 100644 win32/VS2005/dump_video/dump_video_dynamic.vcproj create mode 100644 win32/VS2005/dump_video/dump_video_static.vcproj create mode 100644 win32/VS2005/encoder_example/encoder_example_dynamic.vcproj create mode 100644 win32/VS2005/encoder_example/encoder_example_static.vcproj create mode 100644 win32/VS2005/libogg.vsprops create mode 100644 win32/VS2005/libtheora/libtheora_dynamic.vcproj create mode 100644 win32/VS2005/libtheora/libtheora_static.vcproj create mode 100644 win32/VS2005/libtheora_dynamic.sln create mode 100644 win32/VS2005/libtheora_static.sln create mode 100644 win32/VS2005/libvorbis.vsprops create mode 100644 win32/VS2008/README create mode 100644 win32/VS2008/dump_video/dump_video_dynamic.vcproj create mode 100644 win32/VS2008/dump_video/dump_video_static.vcproj create mode 100644 win32/VS2008/encoder_example/encoder_example_dynamic.vcproj create mode 100644 win32/VS2008/encoder_example/encoder_example_static.vcproj create mode 100644 win32/VS2008/libogg.vsprops create mode 100644 win32/VS2008/libtheora/libtheora_dynamic.vcproj create mode 100644 win32/VS2008/libtheora/libtheora_static.vcproj create mode 100644 win32/VS2008/libtheora_dynamic.sln create mode 100644 win32/VS2008/libtheora_static.sln create mode 100644 win32/VS2008/libvorbis.vsprops create mode 100755 win32/build_theora_static.bat create mode 100755 win32/build_theora_static_debug.bat create mode 100644 win32/experimental/dumpvid/dumpvid.dsp create mode 100644 win32/experimental/encoderwin/ReadMe.txt create mode 100644 win32/experimental/encoderwin/encoderwin.dsp create mode 100644 win32/experimental/transcoder/avi2vp3/avi2vp3.c create mode 100644 win32/experimental/transcoder/avi2vp3/avilib.c create mode 100644 win32/experimental/transcoder/avi2vp3/avilib.h create mode 100644 win32/experimental/transcoder/avi2vp3/outfile.vp3 create mode 100644 win32/experimental/transcoder/avi2vp3/vp31.avi create mode 100644 win32/experimental/transcoder/readme.txt create mode 100644 win32/experimental/transcoder/transcoder.dsp create mode 100644 win32/experimental/transcoder/transcoder_example.c create mode 100644 win32/experimental/wincompat/README.txt create mode 100644 win32/experimental/wincompat/getopt.c create mode 100644 win32/experimental/wincompat/getopt.h create mode 100644 win32/experimental/wincompat/getopt_long.c create mode 100644 win32/experimental/wincompat/unistd.h create mode 100644 win32/getopt.c create mode 100644 win32/getopt1.c create mode 100644 win32/getopt_win.h create mode 100644 win32/theora_static.dsp create mode 100644 win32/xmingw32/Makefile create mode 100644 win32/xmingw32/libtheoradec-all.def create mode 100644 win32/xmingw32/libtheoradec-all.rc create mode 100644 win32/xmingw32/libtheoradec.rc create mode 100644 win32/xmingw32/libtheoradec70.rc create mode 100644 win32/xmingw32/libtheoradec70d.rc create mode 100644 win32/xmingw32/libtheoradec71.rc create mode 100644 win32/xmingw32/libtheoradec71d.rc create mode 100644 win32/xmingw32/libtheoradec80.rc create mode 100644 win32/xmingw32/libtheoradec80d.rc create mode 100644 win32/xmingw32/libtheoradecd.rc create mode 100644 win32/xmingw32/libtheoraenc-all.def create mode 100644 win32/xmingw32/libtheoraenc-all.rc create mode 100644 win32/xmingw32/libtheoraenc.rc create mode 100644 win32/xmingw32/libtheoraenc70.rc create mode 100644 win32/xmingw32/libtheoraenc70d.rc create mode 100644 win32/xmingw32/libtheoraenc71.rc create mode 100644 win32/xmingw32/libtheoraenc71d.rc create mode 100644 win32/xmingw32/libtheoraenc80.rc create mode 100644 win32/xmingw32/libtheoraenc80d.rc create mode 100644 win32/xmingw32/libtheoraencd.rc (limited to 'win32') diff --git a/win32/VS2005/README b/win32/VS2005/README new file mode 100644 index 0000000..d40e044 --- /dev/null +++ b/win32/VS2005/README @@ -0,0 +1,22 @@ +libtheora has libogg as a dependency, and for examples, also +libvorbis, therefore you need to have libogg and libvorbis +compiled beforehand. + +Lets say you have libogg, libvorbis and libtheora in the same directory: + +libogg-1.1.4 +libvorbis-1.2.2 +libtheora-1.0 + +Because there is no automatic library detection you have to, +either: + +1. Rename libogg-1.1.4 to libogg, and libvorbis-1.2.2 to libvorbis. + +2. Open libogg.vsprops with a text editor (even notepad.exe +will suffice) and see if LIBOGG_VERSION is set to the correct +version, in this case "1.1.4". + +The same procedure should be done for libvorbis.vsprops and +check LIBVORBIS_VERSION for the correct version, in this +case "1.2.2". diff --git a/win32/VS2005/dump_video/dump_video_dynamic.vcproj b/win32/VS2005/dump_video/dump_video_dynamic.vcproj new file mode 100644 index 0000000..60368d6 --- /dev/null +++ b/win32/VS2005/dump_video/dump_video_dynamic.vcproj @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win32/VS2005/dump_video/dump_video_static.vcproj b/win32/VS2005/dump_video/dump_video_static.vcproj new file mode 100644 index 0000000..5218023 --- /dev/null +++ b/win32/VS2005/dump_video/dump_video_static.vcproj @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win32/VS2005/encoder_example/encoder_example_dynamic.vcproj b/win32/VS2005/encoder_example/encoder_example_dynamic.vcproj new file mode 100644 index 0000000..477510e --- /dev/null +++ b/win32/VS2005/encoder_example/encoder_example_dynamic.vcproj @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win32/VS2005/encoder_example/encoder_example_static.vcproj b/win32/VS2005/encoder_example/encoder_example_static.vcproj new file mode 100644 index 0000000..9da78c4 --- /dev/null +++ b/win32/VS2005/encoder_example/encoder_example_static.vcproj @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win32/VS2005/libogg.vsprops b/win32/VS2005/libogg.vsprops new file mode 100644 index 0000000..7fe0db7 --- /dev/null +++ b/win32/VS2005/libogg.vsprops @@ -0,0 +1,19 @@ + + + + + + diff --git a/win32/VS2005/libtheora/libtheora_dynamic.vcproj b/win32/VS2005/libtheora/libtheora_dynamic.vcproj new file mode 100644 index 0000000..31d8e9f --- /dev/null +++ b/win32/VS2005/libtheora/libtheora_dynamic.vcproj @@ -0,0 +1,882 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win32/VS2005/libtheora/libtheora_static.vcproj b/win32/VS2005/libtheora/libtheora_static.vcproj new file mode 100644 index 0000000..2c5f4da --- /dev/null +++ b/win32/VS2005/libtheora/libtheora_static.vcproj @@ -0,0 +1,872 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win32/VS2005/libtheora_dynamic.sln b/win32/VS2005/libtheora_dynamic.sln new file mode 100644 index 0000000..c14cf85 --- /dev/null +++ b/win32/VS2005/libtheora_dynamic.sln @@ -0,0 +1,146 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtheora", "libtheora\libtheora_dynamic.vcproj", "{653F3841-3F26-49B9-AFCF-091DB4B67031}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dump_video", "dump_video\dump_video_dynamic.vcproj", "{1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "encoder_example", "encoder_example\encoder_example_dynamic.vcproj", "{AD710263-EBFA-4388-BAA9-AD73C32AFF26}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) = Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) = Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + Debug|Windows Mobile 6 Professional SDK (ARMV4I) = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + Debug|x64 = Debug|x64 + Release_SSE|Win32 = Release_SSE|Win32 + Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) = Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) = Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I) = Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I) + Release_SSE|x64 = Release_SSE|x64 + Release_SSE2|Win32 = Release_SSE2|Win32 + Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) = Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) = Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I) = Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I) + Release_SSE2|x64 = Release_SSE2|x64 + Release|Win32 = Release|Win32 + Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) = Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) = Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + Release|Windows Mobile 6 Professional SDK (ARMV4I) = Release|Windows Mobile 6 Professional SDK (ARMV4I) + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Win32.ActiveCfg = Debug|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Win32.Build.0 = Debug|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|x64.ActiveCfg = Debug|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|x64.Build.0 = Debug|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Win32.ActiveCfg = Release_SSE|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Win32.Build.0 = Release_SSE|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Build.0 = Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Deploy.0 = Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Build.0 = Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Deploy.0 = Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|x64.ActiveCfg = Release_SSE|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|x64.Build.0 = Release_SSE|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Win32.ActiveCfg = Release_SSE2|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Win32.Build.0 = Release_SSE2|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Build.0 = Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Deploy.0 = Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Build.0 = Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Deploy.0 = Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|x64.ActiveCfg = Release_SSE2|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|x64.Build.0 = Release_SSE2|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Win32.ActiveCfg = Release|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Win32.Build.0 = Release|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|x64.ActiveCfg = Release|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|x64.Build.0 = Release|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Win32.ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Win32.Build.0 = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|x64.ActiveCfg = Debug|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|x64.Build.0 = Debug|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|Win32.ActiveCfg = Release_SSE|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|Win32.Build.0 = Release_SSE|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|x64.ActiveCfg = Release_SSE|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|x64.Build.0 = Release_SSE|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|Win32.ActiveCfg = Release_SSE2|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|Win32.Build.0 = Release_SSE2|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|x64.ActiveCfg = Release_SSE2|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|x64.Build.0 = Release_SSE2|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Win32.ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Win32.Build.0 = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|x64.ActiveCfg = Release|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|x64.Build.0 = Release|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Win32.ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Win32.Build.0 = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|x64.ActiveCfg = Debug|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|x64.Build.0 = Debug|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|Win32.ActiveCfg = Release_SSE|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|Win32.Build.0 = Release_SSE|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|x64.ActiveCfg = Release_SSE|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|x64.Build.0 = Release_SSE|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|Win32.ActiveCfg = Release_SSE2|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|Win32.Build.0 = Release_SSE2|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|x64.ActiveCfg = Release_SSE2|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|x64.Build.0 = Release_SSE2|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Win32.ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Win32.Build.0 = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|x64.ActiveCfg = Release|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/win32/VS2005/libtheora_static.sln b/win32/VS2005/libtheora_static.sln new file mode 100644 index 0000000..30eab85 --- /dev/null +++ b/win32/VS2005/libtheora_static.sln @@ -0,0 +1,146 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dump_video_static", "dump_video\dump_video_static.vcproj", "{1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtheora_static", "libtheora\libtheora_static.vcproj", "{653F3841-3F26-49B9-AFCF-091DB4B67031}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "encoder_example_static", "encoder_example\encoder_example_static.vcproj", "{AD710263-EBFA-4388-BAA9-AD73C32AFF26}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) = Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) = Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + Debug|Windows Mobile 6 Professional SDK (ARMV4I) = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + Debug|x64 = Debug|x64 + Release_SSE|Win32 = Release_SSE|Win32 + Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) = Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) = Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I) = Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I) + Release_SSE|x64 = Release_SSE|x64 + Release_SSE2|Win32 = Release_SSE2|Win32 + Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) = Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) = Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I) = Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I) + Release_SSE2|x64 = Release_SSE2|x64 + Release|Win32 = Release|Win32 + Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) = Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) = Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + Release|Windows Mobile 6 Professional SDK (ARMV4I) = Release|Windows Mobile 6 Professional SDK (ARMV4I) + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Win32.ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Win32.Build.0 = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|x64.ActiveCfg = Debug|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|x64.Build.0 = Debug|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|Win32.ActiveCfg = Release_SSE|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|Win32.Build.0 = Release_SSE|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|x64.ActiveCfg = Release_SSE|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|x64.Build.0 = Release_SSE|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|Win32.ActiveCfg = Release_SSE2|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|Win32.Build.0 = Release_SSE2|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|x64.ActiveCfg = Release_SSE2|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|x64.Build.0 = Release_SSE2|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Win32.ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Win32.Build.0 = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|x64.ActiveCfg = Release|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|x64.Build.0 = Release|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Win32.ActiveCfg = Debug|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Win32.Build.0 = Debug|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|x64.ActiveCfg = Debug|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|x64.Build.0 = Debug|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Win32.ActiveCfg = Release_SSE|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Win32.Build.0 = Release_SSE|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Build.0 = Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Deploy.0 = Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Build.0 = Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Deploy.0 = Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|x64.ActiveCfg = Release_SSE|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|x64.Build.0 = Release_SSE|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Win32.ActiveCfg = Release_SSE2|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Win32.Build.0 = Release_SSE2|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Build.0 = Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Deploy.0 = Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Build.0 = Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Deploy.0 = Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|x64.ActiveCfg = Release_SSE2|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|x64.Build.0 = Release_SSE2|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Win32.ActiveCfg = Release|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Win32.Build.0 = Release|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|x64.ActiveCfg = Release|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|x64.Build.0 = Release|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Win32.ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Win32.Build.0 = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|x64.ActiveCfg = Debug|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|x64.Build.0 = Debug|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|Win32.ActiveCfg = Release_SSE|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|Win32.Build.0 = Release_SSE|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|x64.ActiveCfg = Release_SSE|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|x64.Build.0 = Release_SSE|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|Win32.ActiveCfg = Release_SSE2|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|Win32.Build.0 = Release_SSE2|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|x64.ActiveCfg = Release_SSE2|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|x64.Build.0 = Release_SSE2|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Win32.ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Win32.Build.0 = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|x64.ActiveCfg = Release|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/win32/VS2005/libvorbis.vsprops b/win32/VS2005/libvorbis.vsprops new file mode 100644 index 0000000..1b9577e --- /dev/null +++ b/win32/VS2005/libvorbis.vsprops @@ -0,0 +1,19 @@ + + + + + + diff --git a/win32/VS2008/README b/win32/VS2008/README new file mode 100644 index 0000000..d40e044 --- /dev/null +++ b/win32/VS2008/README @@ -0,0 +1,22 @@ +libtheora has libogg as a dependency, and for examples, also +libvorbis, therefore you need to have libogg and libvorbis +compiled beforehand. + +Lets say you have libogg, libvorbis and libtheora in the same directory: + +libogg-1.1.4 +libvorbis-1.2.2 +libtheora-1.0 + +Because there is no automatic library detection you have to, +either: + +1. Rename libogg-1.1.4 to libogg, and libvorbis-1.2.2 to libvorbis. + +2. Open libogg.vsprops with a text editor (even notepad.exe +will suffice) and see if LIBOGG_VERSION is set to the correct +version, in this case "1.1.4". + +The same procedure should be done for libvorbis.vsprops and +check LIBVORBIS_VERSION for the correct version, in this +case "1.2.2". diff --git a/win32/VS2008/dump_video/dump_video_dynamic.vcproj b/win32/VS2008/dump_video/dump_video_dynamic.vcproj new file mode 100644 index 0000000..9a6f49f --- /dev/null +++ b/win32/VS2008/dump_video/dump_video_dynamic.vcproj @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win32/VS2008/dump_video/dump_video_static.vcproj b/win32/VS2008/dump_video/dump_video_static.vcproj new file mode 100644 index 0000000..60d6d74 --- /dev/null +++ b/win32/VS2008/dump_video/dump_video_static.vcproj @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win32/VS2008/encoder_example/encoder_example_dynamic.vcproj b/win32/VS2008/encoder_example/encoder_example_dynamic.vcproj new file mode 100644 index 0000000..d68d8ac --- /dev/null +++ b/win32/VS2008/encoder_example/encoder_example_dynamic.vcproj @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win32/VS2008/encoder_example/encoder_example_static.vcproj b/win32/VS2008/encoder_example/encoder_example_static.vcproj new file mode 100644 index 0000000..91cee2d --- /dev/null +++ b/win32/VS2008/encoder_example/encoder_example_static.vcproj @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win32/VS2008/libogg.vsprops b/win32/VS2008/libogg.vsprops new file mode 100644 index 0000000..1355b50 --- /dev/null +++ b/win32/VS2008/libogg.vsprops @@ -0,0 +1,19 @@ + + + + + + diff --git a/win32/VS2008/libtheora/libtheora_dynamic.vcproj b/win32/VS2008/libtheora/libtheora_dynamic.vcproj new file mode 100644 index 0000000..56fcee5 --- /dev/null +++ b/win32/VS2008/libtheora/libtheora_dynamic.vcproj @@ -0,0 +1,766 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win32/VS2008/libtheora/libtheora_static.vcproj b/win32/VS2008/libtheora/libtheora_static.vcproj new file mode 100644 index 0000000..9ad6033 --- /dev/null +++ b/win32/VS2008/libtheora/libtheora_static.vcproj @@ -0,0 +1,748 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win32/VS2008/libtheora_dynamic.sln b/win32/VS2008/libtheora_dynamic.sln new file mode 100644 index 0000000..d4bde5d --- /dev/null +++ b/win32/VS2008/libtheora_dynamic.sln @@ -0,0 +1,146 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtheora", "libtheora\libtheora_dynamic.vcproj", "{653F3841-3F26-49B9-AFCF-091DB4B67031}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dump_video", "dump_video\dump_video_dynamic.vcproj", "{1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "encoder_example", "encoder_example\encoder_example_dynamic.vcproj", "{AD710263-EBFA-4388-BAA9-AD73C32AFF26}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) = Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) = Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + Debug|Windows Mobile 6 Professional SDK (ARMV4I) = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + Debug|x64 = Debug|x64 + Release_SSE|Win32 = Release_SSE|Win32 + Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) = Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) = Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I) = Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I) + Release_SSE|x64 = Release_SSE|x64 + Release_SSE2|Win32 = Release_SSE2|Win32 + Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) = Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) = Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I) = Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I) + Release_SSE2|x64 = Release_SSE2|x64 + Release|Win32 = Release|Win32 + Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) = Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) = Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + Release|Windows Mobile 6 Professional SDK (ARMV4I) = Release|Windows Mobile 6 Professional SDK (ARMV4I) + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Win32.ActiveCfg = Debug|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Win32.Build.0 = Debug|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|x64.ActiveCfg = Debug|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|x64.Build.0 = Debug|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Win32.ActiveCfg = Release_SSE|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Win32.Build.0 = Release_SSE|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Build.0 = Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Deploy.0 = Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Build.0 = Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Deploy.0 = Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|x64.ActiveCfg = Release_SSE|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|x64.Build.0 = Release_SSE|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Win32.ActiveCfg = Release_SSE2|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Win32.Build.0 = Release_SSE2|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Build.0 = Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Deploy.0 = Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Build.0 = Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Deploy.0 = Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|x64.ActiveCfg = Release_SSE2|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|x64.Build.0 = Release_SSE2|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Win32.ActiveCfg = Release|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Win32.Build.0 = Release|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|x64.ActiveCfg = Release|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|x64.Build.0 = Release|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Win32.ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Win32.Build.0 = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|x64.ActiveCfg = Debug|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|x64.Build.0 = Debug|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|Win32.ActiveCfg = Release_SSE|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|Win32.Build.0 = Release_SSE|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|x64.ActiveCfg = Release_SSE|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|x64.Build.0 = Release_SSE|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|Win32.ActiveCfg = Release_SSE2|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|Win32.Build.0 = Release_SSE2|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|x64.ActiveCfg = Release_SSE2|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|x64.Build.0 = Release_SSE2|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Win32.ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Win32.Build.0 = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|x64.ActiveCfg = Release|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|x64.Build.0 = Release|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Win32.ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Win32.Build.0 = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|x64.ActiveCfg = Debug|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|x64.Build.0 = Debug|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|Win32.ActiveCfg = Release_SSE|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|Win32.Build.0 = Release_SSE|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|x64.ActiveCfg = Release_SSE|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|x64.Build.0 = Release_SSE|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|Win32.ActiveCfg = Release_SSE2|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|Win32.Build.0 = Release_SSE2|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|x64.ActiveCfg = Release_SSE2|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|x64.Build.0 = Release_SSE2|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Win32.ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Win32.Build.0 = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|x64.ActiveCfg = Release|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/win32/VS2008/libtheora_static.sln b/win32/VS2008/libtheora_static.sln new file mode 100644 index 0000000..2b39635 --- /dev/null +++ b/win32/VS2008/libtheora_static.sln @@ -0,0 +1,146 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dump_video_static", "dump_video\dump_video_static.vcproj", "{1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtheora_static", "libtheora\libtheora_static.vcproj", "{653F3841-3F26-49B9-AFCF-091DB4B67031}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "encoder_example_static", "encoder_example\encoder_example_static.vcproj", "{AD710263-EBFA-4388-BAA9-AD73C32AFF26}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) = Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) = Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + Debug|Windows Mobile 6 Professional SDK (ARMV4I) = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + Debug|x64 = Debug|x64 + Release_SSE|Win32 = Release_SSE|Win32 + Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) = Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) = Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I) = Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I) + Release_SSE|x64 = Release_SSE|x64 + Release_SSE2|Win32 = Release_SSE2|Win32 + Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) = Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) = Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I) = Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I) + Release_SSE2|x64 = Release_SSE2|x64 + Release|Win32 = Release|Win32 + Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) = Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) = Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + Release|Windows Mobile 6 Professional SDK (ARMV4I) = Release|Windows Mobile 6 Professional SDK (ARMV4I) + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Win32.ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Win32.Build.0 = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|x64.ActiveCfg = Debug|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|x64.Build.0 = Debug|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|Win32.ActiveCfg = Release_SSE|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|Win32.Build.0 = Release_SSE|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|x64.ActiveCfg = Release_SSE|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|x64.Build.0 = Release_SSE|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|Win32.ActiveCfg = Release_SSE2|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|Win32.Build.0 = Release_SSE2|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|x64.ActiveCfg = Release_SSE2|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|x64.Build.0 = Release_SSE2|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Win32.ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Win32.Build.0 = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|x64.ActiveCfg = Release|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|x64.Build.0 = Release|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Win32.ActiveCfg = Debug|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Win32.Build.0 = Debug|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|x64.ActiveCfg = Debug|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|x64.Build.0 = Debug|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Win32.ActiveCfg = Release_SSE|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Win32.Build.0 = Release_SSE|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Build.0 = Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Deploy.0 = Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Build.0 = Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Deploy.0 = Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|x64.ActiveCfg = Release_SSE|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|x64.Build.0 = Release_SSE|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Win32.ActiveCfg = Release_SSE2|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Win32.Build.0 = Release_SSE2|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Build.0 = Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Deploy.0 = Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Build.0 = Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Deploy.0 = Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|x64.ActiveCfg = Release_SSE2|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|x64.Build.0 = Release_SSE2|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Win32.ActiveCfg = Release|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Win32.Build.0 = Release|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|x64.ActiveCfg = Release|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|x64.Build.0 = Release|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Win32.ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Win32.Build.0 = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|x64.ActiveCfg = Debug|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|x64.Build.0 = Debug|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|Win32.ActiveCfg = Release_SSE|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|Win32.Build.0 = Release_SSE|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|x64.ActiveCfg = Release_SSE|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|x64.Build.0 = Release_SSE|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|Win32.ActiveCfg = Release_SSE2|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|Win32.Build.0 = Release_SSE2|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|x64.ActiveCfg = Release_SSE2|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|x64.Build.0 = Release_SSE2|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Win32.ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Win32.Build.0 = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|x64.ActiveCfg = Release|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/win32/VS2008/libvorbis.vsprops b/win32/VS2008/libvorbis.vsprops new file mode 100644 index 0000000..004dcc5 --- /dev/null +++ b/win32/VS2008/libvorbis.vsprops @@ -0,0 +1,19 @@ + + + + + + diff --git a/win32/build_theora_static.bat b/win32/build_theora_static.bat new file mode 100755 index 0000000..842cef0 --- /dev/null +++ b/win32/build_theora_static.bat @@ -0,0 +1,18 @@ +@echo off +echo ---+++--- Building Theora (Static) ---+++--- + +if .%SRCROOT%==. set SRCROOT=D:\xiph + +set OLDPATH=%PATH% +set OLDINCLUDE=%INCLUDE% +set OLDLIB=%LIB% + +call "c:\program files\microsoft visual studio\vc98\bin\vcvars32.bat" +echo Setting include paths for Theora +set INCLUDE=%INCLUDE%;%SRCROOT%\ogg\include;%SRCROOT%\theora\include +echo Compiling... +msdev theora_static.dsp /useenv /make "theora_static - Win32 Release" /rebuild + +set PATH=%OLDPATH% +set INCLUDE=%OLDINCLUDE% +set LIB=%OLDLIB% diff --git a/win32/build_theora_static_debug.bat b/win32/build_theora_static_debug.bat new file mode 100755 index 0000000..c58edb0 --- /dev/null +++ b/win32/build_theora_static_debug.bat @@ -0,0 +1,18 @@ +@echo off +echo ---+++--- Building Theora (Static) ---+++--- + +if .%SRCROOT%==. set SRCROOT=D:\xiph + +set OLDPATH=%PATH% +set OLDINCLUDE=%INCLUDE% +set OLDLIB=%LIB% + +call "c:\program files\microsoft visual studio\vc98\bin\vcvars32.bat" +echo Setting include paths for Theora +set INCLUDE=%INCLUDE%;%SRCROOT%\ogg\include;%SRCROOT%\theora\include +echo Compiling... +msdev theora_static.dsp /useenv /make "theora_static - Win32 Debug" /rebuild + +set PATH=%OLDPATH% +set INCLUDE=%OLDINCLUDE% +set LIB=%OLDLIB% diff --git a/win32/experimental/dumpvid/dumpvid.dsp b/win32/experimental/dumpvid/dumpvid.dsp new file mode 100644 index 0000000..40c4b07 --- /dev/null +++ b/win32/experimental/dumpvid/dumpvid.dsp @@ -0,0 +1,121 @@ +# Microsoft Developer Studio Project File - Name="dumpvid" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=dumpvid - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "dumpvid.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "dumpvid.mak" CFG="dumpvid - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "dumpvid - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "dumpvid - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "dumpvid - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /I "..\..\..\..\ogg\include" /I "..\wincompat" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib theora_static.lib ogg_static.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"LIBCMT" /out:"dump_vid.exe" /libpath:"..\..\Static_Release" /libpath:"..\..\..\..\ogg\win32\Static_Release" /libpath:"..\..\..\..\vorbis\win32\Vorbis_Static_Release" /libpath:"..\..\..\..\vorbis\win32\VorbisEnc_Static_Release" + +!ELSEIF "$(CFG)" == "dumpvid - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\include" /I "..\..\..\..\ogg\include" /I "..\wincompat" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /FD /GZ /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib theora_static_d.lib ogg_static_d.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"LIBCD" /out:"dump_vid.exe" /pdbtype:sept /libpath:"..\..\Static_Debug" /libpath:"..\..\..\..\ogg\win32\Static_Debug" /libpath:"..\..\..\..\vorbis\win32\Vorbis_Static_Debug" /libpath:"..\..\..\..\vorbis\win32\VorbisEnc_Static_Debug" +# SUBTRACT LINK32 /nodefaultlib + +!ENDIF + +# Begin Target + +# Name "dumpvid - Win32 Release" +# Name "dumpvid - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\examples\dump_video.c +# End Source File +# Begin Source File + +SOURCE=..\wincompat\getopt.c +# End Source File +# Begin Source File + +SOURCE=..\wincompat\getopt_long.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Group "library" + +# PROP Default_Filter "" +# End Group +# Begin Source File + +SOURCE=.\ReadMe.txt +# End Source File +# End Target +# End Project diff --git a/win32/experimental/encoderwin/ReadMe.txt b/win32/experimental/encoderwin/ReadMe.txt new file mode 100644 index 0000000..12c4090 --- /dev/null +++ b/win32/experimental/encoderwin/ReadMe.txt @@ -0,0 +1,13 @@ +05/30/03 +Updated to use the common encoder_sample.c source in theora/examples. + +05/23/03 + +Very simple port of the sample encoder for Windows, for testing. +Encoder options in the command line are not working, and the frame rate +of video needs to be set in code (like in the simple sample encoder.) + +This example will be updated to a true Win32 app sometime in the future, +hope it is useful for basic testing now. + +mauricio@xiph.org \ No newline at end of file diff --git a/win32/experimental/encoderwin/encoderwin.dsp b/win32/experimental/encoderwin/encoderwin.dsp new file mode 100644 index 0000000..6befa4e --- /dev/null +++ b/win32/experimental/encoderwin/encoderwin.dsp @@ -0,0 +1,121 @@ +# Microsoft Developer Studio Project File - Name="encoderwin" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=encoderwin - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "encoderwin.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "encoderwin.mak" CFG="encoderwin - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "encoderwin - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "encoderwin - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "encoderwin - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /I "..\..\..\..\vorbis\include" /I "..\..\..\..\ogg\include" /I "..\wincompat" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib theora_static.lib ogg_static.lib vorbis_static.lib vorbisenc_static.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"LIBCMT" /out:"encoderwin.exe" /libpath:"..\..\Static_Release" /libpath:"..\..\..\..\ogg\win32\Static_Release" /libpath:"..\..\..\..\vorbis\win32\Vorbis_Static_Release" /libpath:"..\..\..\..\vorbis\win32\VorbisEnc_Static_Release" + +!ELSEIF "$(CFG)" == "encoderwin - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\include" /I "..\..\..\..\vorbis\include" /I "..\..\..\..\ogg\include" /I "..\wincompat" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib theora_static_d.lib ogg_static_d.lib vorbis_static_d.lib vorbisenc_static_d.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"LIBCD" /out:"encoderwin.exe" /pdbtype:sept /libpath:"..\..\Static_Debug" /libpath:"..\..\..\..\ogg\win32\Static_Debug" /libpath:"..\..\..\..\vorbis\win32\Vorbis_Static_Debug" /libpath:"..\..\..\..\vorbis\win32\VorbisEnc_Static_Debug" +# SUBTRACT LINK32 /nodefaultlib + +!ENDIF + +# Begin Target + +# Name "encoderwin - Win32 Release" +# Name "encoderwin - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\examples\encoder_example.c +# End Source File +# Begin Source File + +SOURCE=..\wincompat\getopt.c +# End Source File +# Begin Source File + +SOURCE=..\wincompat\getopt_long.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Group "library" + +# PROP Default_Filter "" +# End Group +# Begin Source File + +SOURCE=.\ReadMe.txt +# End Source File +# End Target +# End Project diff --git a/win32/experimental/transcoder/avi2vp3/avi2vp3.c b/win32/experimental/transcoder/avi2vp3/avi2vp3.c new file mode 100644 index 0000000..08777e5 --- /dev/null +++ b/win32/experimental/transcoder/avi2vp3/avi2vp3.c @@ -0,0 +1,82 @@ +#include +#include +#ifdef _WIN32 +#include +#else +typedef long DWORD; +#endif + +/*extremely crude app to dump vp3 frames from an avi file*/ +/*filenames are hardcoded*/ + +#include "avilib.h" + +int main(int argc, const char **argv) +{ + + FILE * f = fopen("outfile.vp3", "wb"); + + char * buffer; + int olength; + int length; + avi_t *avifile; + int chunksize; + int frame; + int frames; + int keyframegap = 0; + int maxkeyframegap = 0; + + DWORD initialticks; + + int framew = 0; + int frameh = 0; + double framerate = 0.0f; + double fps_numerator, fps_denominator; + + avifile = AVI_open_input_file("vp31.avi", 1); + frames = AVI_video_frames(avifile); + framew = AVI_video_width(avifile); + frameh = AVI_video_height(avifile); + framerate = AVI_frame_rate(avifile); + chunksize = AVI_max_video_chunk(avifile); + /* avilib only reports the max video chunk size if the file has an + idx table. We fall back to an arbitrary limit otherwise. Better + would be just to handle the chunks dynamically */ + if (chunksize <= 0) chunksize = 131072; + buffer = malloc(chunksize); + printf("Frames(%d) Video(%dx%d) %3.2f fps\n",frames,framew, frameh,framerate); + printf("Video Compressor: %s", AVI_video_compressor(avifile)); + fps_denominator = 1000000.0F; + fps_numerator = framerate * fps_denominator; + + sprintf(buffer,"AVI2VP31R W%d H%d F%.0f:%.0f Ip A0:0\n", framew, frameh, fps_numerator, fps_denominator); + fwrite(buffer, strlen(buffer), 1, f); + + for (frame = 0; frame < frames;) { + int keyframe; + olength = length; + length = AVI_frame_size(avifile, frame++); + if( !length ) { + length = olength; + } + AVI_read_frame(avifile, (char *) buffer, &keyframe); + fwrite("FRAME\n", 6, 1, f); + fwrite(&length, sizeof(int), 1, f); + fwrite(&keyframe, sizeof(int), 1, f); + printf("Frame size(%d) IsKeyframe(%d)\n", length, keyframe); + fwrite(buffer, 1, length, f); + if (!keyframe){ + keyframegap++; + } else { + if (keyframegap>maxkeyframegap) maxkeyframegap=keyframegap; + keyframegap = 0; + } + } + + fclose(f); + printf("Max keyframegap (%d)\n", maxkeyframegap); + + free(buffer); + + exit(0); +} diff --git a/win32/experimental/transcoder/avi2vp3/avilib.c b/win32/experimental/transcoder/avi2vp3/avilib.c new file mode 100644 index 0000000..3df78ff --- /dev/null +++ b/win32/experimental/transcoder/avi2vp3/avilib.c @@ -0,0 +1,1839 @@ +/* + * avilib.c + * + * Copyright (C) Thomas Östreich - June 2001 + * multiple audio track support Copyright (C) 2002 Thomas Östreich + * + * Original code: + * Copyright (C) 1999 Rainer Johanni + * + * This file is part of transcode, a linux video stream processing tool + * + * transcode is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * transcode is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +#include "avilib.h" +//#include + +#define INFO_LIST + +/* The following variable indicates the kind of error */ + +long AVI_errno; + +#define MAX_INFO_STRLEN 64 +static char id_str[MAX_INFO_STRLEN]; + +#define FRAME_RATE_SCALE 1000000 + +#ifndef PACKAGE +#define PACKAGE "my" +#define VERSION "0.00" +#endif + +#ifndef O_BINARY +/* win32 wants a binary flag to open(); this sets it to null + on platforms that don't have it. */ +#define O_BINARY 0 +#endif + +/******************************************************************* + * * + * Utilities for writing an AVI File * + * * + *******************************************************************/ + +static size_t avi_read(int fd, char *buf, size_t len) +{ + size_t n = 0; + size_t r = 0; + + while (r < len) { + n = read (fd, buf + r, len - r); + + if (n <= 0) + return r; + r += n; + } + + return r; +} + +static size_t avi_write (int fd, char *buf, size_t len) +{ + size_t n = 0; + size_t r = 0; + + while (r < len) { + n = write (fd, buf + r, len - r); + if (n < 0) + return n; + + r += n; + } + return r; +} + +/* HEADERBYTES: The number of bytes to reserve for the header */ + +#define HEADERBYTES 2048 + +/* AVI_MAX_LEN: The maximum length of an AVI file, we stay a bit below + the 2GB limit (Remember: 2*10^9 is smaller than 2 GB) */ + +#define AVI_MAX_LEN (UINT_MAX-(1<<20)*16-HEADERBYTES) + +#define PAD_EVEN(x) ( ((x)+1) & ~1 ) + + +/* Copy n into dst as a 4 byte, little endian number. + Should also work on big endian machines */ + +static void long2str(unsigned char *dst, int n) +{ + dst[0] = (n )&0xff; + dst[1] = (n>> 8)&0xff; + dst[2] = (n>>16)&0xff; + dst[3] = (n>>24)&0xff; +} + +/* Convert a string of 4 or 2 bytes to a number, + also working on big endian machines */ + +static unsigned long str2ulong(unsigned char *str) +{ + return ( str[0] | (str[1]<<8) | (str[2]<<16) | (str[3]<<24) ); +} +static unsigned long str2ushort(unsigned char *str) +{ + return ( str[0] | (str[1]<<8) ); +} + +/* Calculate audio sample size from number of bits and number of channels. + This may have to be adjusted for eg. 12 bits and stereo */ + +static int avi_sampsize(avi_t *AVI, int j) +{ + int s; + s = ((AVI->track[j].a_bits+7)/8)*AVI->track[j].a_chans; + // if(s==0) s=1; /* avoid possible zero divisions */ + if(s<4) s=4; /* avoid possible zero divisions */ + return s; +} + +/* Add a chunk (=tag and data) to the AVI file, + returns -1 on write error, 0 on success */ + +static int avi_add_chunk(avi_t *AVI, unsigned char *tag, unsigned char *data, int length) +{ + unsigned char c[8]; + + /* Copy tag and length int c, so that we need only 1 write system call + for these two values */ + + memcpy(c,tag,4); + long2str(c+4,length); + + /* Output tag, length and data, restore previous position + if the write fails */ + + length = PAD_EVEN(length); + + if( avi_write(AVI->fdes,(char *)c,8) != 8 || + avi_write(AVI->fdes,(char *)data,length) != length ) + { + lseek(AVI->fdes,AVI->pos,SEEK_SET); + AVI_errno = AVI_ERR_WRITE; + return -1; + } + + /* Update file position */ + + AVI->pos += 8 + length; + + //fprintf(stderr, "pos=%lu %s\n", AVI->pos, tag); + + return 0; +} + +static int avi_add_index_entry(avi_t *AVI, unsigned char *tag, long flags, unsigned long pos, unsigned long len) +{ + void *ptr; + + if(AVI->n_idx>=AVI->max_idx) { + ptr = realloc((void *)AVI->idx,(AVI->max_idx+4096)*16); + + if(ptr == 0) { + AVI_errno = AVI_ERR_NO_MEM; + return -1; + } + AVI->max_idx += 4096; + AVI->idx = (unsigned char((*)[16]) ) ptr; + } + + /* Add index entry */ + + // fprintf(stderr, "INDEX %s %ld %lu %lu\n", tag, flags, pos, len); + + memcpy(AVI->idx[AVI->n_idx],tag,4); + long2str(AVI->idx[AVI->n_idx]+ 4,flags); + long2str(AVI->idx[AVI->n_idx]+ 8, pos); + long2str(AVI->idx[AVI->n_idx]+12, len); + + /* Update counter */ + + AVI->n_idx++; + + if(len>AVI->max_len) AVI->max_len=len; + + return 0; +} + +/* + AVI_open_output_file: Open an AVI File and write a bunch + of zero bytes as space for the header. + + returns a pointer to avi_t on success, a zero pointer on error +*/ + +avi_t* AVI_open_output_file(char * filename) +{ + avi_t *AVI; + int i; + + int mask = 0; + + unsigned char AVI_header[HEADERBYTES]; + + /* Allocate the avi_t struct and zero it */ + + AVI = (avi_t *) malloc(sizeof(avi_t)); + if(AVI==0) + { + AVI_errno = AVI_ERR_NO_MEM; + return 0; + } + memset((void *)AVI,0,sizeof(avi_t)); + + /* Since Linux needs a long time when deleting big files, + we do not truncate the file when we open it. + Instead it is truncated when the AVI file is closed */ + + /* mask = umask (0); + umask (mask);*/ + + AVI->fdes = open(filename, O_RDWR|O_CREAT|O_BINARY, 0644 &~ mask); + if (AVI->fdes < 0) + { + AVI_errno = AVI_ERR_OPEN; + free(AVI); + return 0; + } + + /* Write out HEADERBYTES bytes, the header will go here + when we are finished with writing */ + + for (i=0;ifdes,(char *)AVI_header,HEADERBYTES); + if (i != HEADERBYTES) + { + close(AVI->fdes); + AVI_errno = AVI_ERR_WRITE; + free(AVI); + return 0; + } + + AVI->pos = HEADERBYTES; + AVI->mode = AVI_MODE_WRITE; /* open for writing */ + + //init + AVI->anum = 0; + AVI->aptr = 0; + + return AVI; +} + +void AVI_set_video(avi_t *AVI, int width, int height, double fps, char *compressor) +{ + /* may only be called if file is open for writing */ + + if(AVI->mode==AVI_MODE_READ) return; + + AVI->width = width; + AVI->height = height; + AVI->fps = fps; + + if(strncmp(compressor, "RGB", 3)==0) { + memset(AVI->compressor, 0, 4); + } else { + memcpy(AVI->compressor,compressor,4); + } + + AVI->compressor[4] = 0; + + avi_update_header(AVI); +} + +void AVI_set_audio(avi_t *AVI, int channels, long rate, int bits, int format, long mp3rate) +{ + /* may only be called if file is open for writing */ + + if(AVI->mode==AVI_MODE_READ) return; + + //inc audio tracks + AVI->aptr=AVI->anum; + ++AVI->anum; + + if(AVI->anum > AVI_MAX_TRACKS) { + fprintf(stderr, "error - only %d audio tracks supported\n", AVI_MAX_TRACKS); + exit(1); + } + + AVI->track[AVI->aptr].a_chans = channels; + AVI->track[AVI->aptr].a_rate = rate; + AVI->track[AVI->aptr].a_bits = bits; + AVI->track[AVI->aptr].a_fmt = format; + AVI->track[AVI->aptr].mp3rate = mp3rate; + + avi_update_header(AVI); +} + +#define OUT4CC(s) \ + if(nhb<=HEADERBYTES-4) memcpy(AVI_header+nhb,s,4); nhb += 4 + +#define OUTLONG(n) \ + if(nhb<=HEADERBYTES-4) long2str(AVI_header+nhb,n); nhb += 4 + +#define OUTSHRT(n) \ + if(nhb<=HEADERBYTES-2) { \ + AVI_header[nhb ] = (n )&0xff; \ + AVI_header[nhb+1] = (n>>8)&0xff; \ + } \ + nhb += 2 + + +//ThOe write preliminary AVI file header: 0 frames, max vid/aud size +int avi_update_header(avi_t *AVI) +{ + int njunk, sampsize, hasIndex, ms_per_frame, frate, flag; + int movi_len, hdrl_start, strl_start, j; + unsigned char AVI_header[HEADERBYTES]; + long nhb; + + //assume max size + movi_len = AVI_MAX_LEN - HEADERBYTES + 4; + + //assume index will be written + hasIndex=1; + + if(AVI->fps < 0.001) { + frate=0; + ms_per_frame=0; + } else { + frate = (int) (FRAME_RATE_SCALE*AVI->fps + 0.5); + ms_per_frame=(int) (1000000/AVI->fps + 0.5); + } + + /* Prepare the file header */ + + nhb = 0; + + /* The RIFF header */ + + OUT4CC ("RIFF"); + OUTLONG(movi_len); // assume max size + OUT4CC ("AVI "); + + /* Start the header list */ + + OUT4CC ("LIST"); + OUTLONG(0); /* Length of list in bytes, don't know yet */ + hdrl_start = nhb; /* Store start position */ + OUT4CC ("hdrl"); + + /* The main AVI header */ + + /* The Flags in AVI File header */ + +#define AVIF_HASINDEX 0x00000010 /* Index at end of file */ +#define AVIF_MUSTUSEINDEX 0x00000020 +#define AVIF_ISINTERLEAVED 0x00000100 +#define AVIF_TRUSTCKTYPE 0x00000800 /* Use CKType to find key frames */ +#define AVIF_WASCAPTUREFILE 0x00010000 +#define AVIF_COPYRIGHTED 0x00020000 + + OUT4CC ("avih"); + OUTLONG(56); /* # of bytes to follow */ + OUTLONG(ms_per_frame); /* Microseconds per frame */ + //ThOe ->0 + // OUTLONG(10000000); /* MaxBytesPerSec, I hope this will never be used */ + OUTLONG(0); + OUTLONG(0); /* PaddingGranularity (whatever that might be) */ + /* Other sources call it 'reserved' */ + flag = AVIF_ISINTERLEAVED; + if(hasIndex) flag |= AVIF_HASINDEX; + if(hasIndex && AVI->must_use_index) flag |= AVIF_MUSTUSEINDEX; + OUTLONG(flag); /* Flags */ + OUTLONG(0); // no frames yet + OUTLONG(0); /* InitialFrames */ + + OUTLONG(AVI->anum+1); + + OUTLONG(0); /* SuggestedBufferSize */ + OUTLONG(AVI->width); /* Width */ + OUTLONG(AVI->height); /* Height */ + /* MS calls the following 'reserved': */ + OUTLONG(0); /* TimeScale: Unit used to measure time */ + OUTLONG(0); /* DataRate: Data rate of playback */ + OUTLONG(0); /* StartTime: Starting time of AVI data */ + OUTLONG(0); /* DataLength: Size of AVI data chunk */ + + + /* Start the video stream list ---------------------------------- */ + + OUT4CC ("LIST"); + OUTLONG(0); /* Length of list in bytes, don't know yet */ + strl_start = nhb; /* Store start position */ + OUT4CC ("strl"); + + /* The video stream header */ + + OUT4CC ("strh"); + OUTLONG(56); /* # of bytes to follow */ + OUT4CC ("vids"); /* Type */ + OUT4CC (AVI->compressor); /* Handler */ + OUTLONG(0); /* Flags */ + OUTLONG(0); /* Reserved, MS says: wPriority, wLanguage */ + OUTLONG(0); /* InitialFrames */ + OUTLONG(FRAME_RATE_SCALE); /* Scale */ + OUTLONG(frate); /* Rate: Rate/Scale == samples/second */ + OUTLONG(0); /* Start */ + OUTLONG(0); // no frames yet + OUTLONG(0); /* SuggestedBufferSize */ + OUTLONG(-1); /* Quality */ + OUTLONG(0); /* SampleSize */ + OUTLONG(0); /* Frame */ + OUTLONG(0); /* Frame */ + // OUTLONG(0); /* Frame */ + //OUTLONG(0); /* Frame */ + + /* The video stream format */ + + OUT4CC ("strf"); + OUTLONG(40); /* # of bytes to follow */ + OUTLONG(40); /* Size */ + OUTLONG(AVI->width); /* Width */ + OUTLONG(AVI->height); /* Height */ + OUTSHRT(1); OUTSHRT(24); /* Planes, Count */ + OUT4CC (AVI->compressor); /* Compression */ + // ThOe (*3) + OUTLONG(AVI->width*AVI->height*3); /* SizeImage (in bytes?) */ + OUTLONG(0); /* XPelsPerMeter */ + OUTLONG(0); /* YPelsPerMeter */ + OUTLONG(0); /* ClrUsed: Number of colors used */ + OUTLONG(0); /* ClrImportant: Number of colors important */ + + /* Finish stream list, i.e. put number of bytes in the list to proper pos */ + + long2str(AVI_header+strl_start-4,nhb-strl_start); + + + /* Start the audio stream list ---------------------------------- */ + + for(j=0; janum; ++j) { + + sampsize = avi_sampsize(AVI, j); + + OUT4CC ("LIST"); + OUTLONG(0); /* Length of list in bytes, don't know yet */ + strl_start = nhb; /* Store start position */ + OUT4CC ("strl"); + + /* The audio stream header */ + + OUT4CC ("strh"); + OUTLONG(56); /* # of bytes to follow */ + OUT4CC ("auds"); + + // ----------- + // ThOe + OUTLONG(0); /* Format (Optionally) */ + // ----------- + + OUTLONG(0); /* Flags */ + OUTLONG(0); /* Reserved, MS says: wPriority, wLanguage */ + OUTLONG(0); /* InitialFrames */ + + // ThOe /4 + OUTLONG(sampsize/4); /* Scale */ + OUTLONG(1000*AVI->track[j].mp3rate/8); + OUTLONG(0); /* Start */ + OUTLONG(4*AVI->track[j].audio_bytes/sampsize); /* Length */ + OUTLONG(0); /* SuggestedBufferSize */ + OUTLONG(-1); /* Quality */ + + // ThOe /4 + OUTLONG(sampsize/4); /* SampleSize */ + + OUTLONG(0); /* Frame */ + OUTLONG(0); /* Frame */ + // OUTLONG(0); /* Frame */ + //OUTLONG(0); /* Frame */ + + /* The audio stream format */ + + OUT4CC ("strf"); + OUTLONG(16); /* # of bytes to follow */ + OUTSHRT(AVI->track[j].a_fmt); /* Format */ + OUTSHRT(AVI->track[j].a_chans); /* Number of channels */ + OUTLONG(AVI->track[j].a_rate); /* SamplesPerSec */ + // ThOe + OUTLONG(1000*AVI->track[j].mp3rate/8); + //ThOe (/4) + + OUTSHRT(sampsize/4); /* BlockAlign */ + + + OUTSHRT(AVI->track[j].a_bits); /* BitsPerSample */ + + /* Finish stream list, i.e. put number of bytes in the list to proper pos */ + + long2str(AVI_header+strl_start-4,nhb-strl_start); + } + + /* Finish header list */ + + long2str(AVI_header+hdrl_start-4,nhb-hdrl_start); + + + /* Calculate the needed amount of junk bytes, output junk */ + + njunk = HEADERBYTES - nhb - 8 - 12; + + /* Safety first: if njunk <= 0, somebody has played with + HEADERBYTES without knowing what (s)he did. + This is a fatal error */ + + if(njunk<=0) + { + fprintf(stderr,"AVI_close_output_file: # of header bytes too small\n"); + exit(1); + } + + OUT4CC ("JUNK"); + OUTLONG(njunk); + memset(AVI_header+nhb,0,njunk); + + //11/14/01 added id string + + if(njunk > strlen(id_str)+8) { + sprintf(id_str, "%s-%s", PACKAGE, VERSION); + memcpy(AVI_header+nhb, id_str, strlen(id_str)); + } + + nhb += njunk; + + /* Start the movi list */ + + OUT4CC ("LIST"); + OUTLONG(movi_len); /* Length of list in bytes */ + OUT4CC ("movi"); + + /* Output the header, truncate the file to the number of bytes + actually written, report an error if someting goes wrong */ + + if ( lseek(AVI->fdes,0,SEEK_SET)<0 || + avi_write(AVI->fdes,(char *)AVI_header,HEADERBYTES)!=HEADERBYTES || + lseek(AVI->fdes,AVI->pos,SEEK_SET)<0) + { + AVI_errno = AVI_ERR_CLOSE; + return -1; + } + + return 0; +} + +/* + Write the header of an AVI file and close it. + returns 0 on success, -1 on write error. +*/ + +static int avi_close_output_file(avi_t *AVI) +{ + + int ret, njunk, sampsize, hasIndex, ms_per_frame, frate, idxerror, flag; + unsigned long movi_len; + int hdrl_start, strl_start, j; + unsigned char AVI_header[HEADERBYTES]; + long nhb; + +#ifdef INFO_LIST + long info_len; +// time_t calptr; +#endif + + /* Calculate length of movi list */ + + movi_len = AVI->pos - HEADERBYTES + 4; + + /* Try to ouput the index entries. This may fail e.g. if no space + is left on device. We will report this as an error, but we still + try to write the header correctly (so that the file still may be + readable in the most cases */ + + idxerror = 0; + // fprintf(stderr, "pos=%lu, index_len=%ld \n", AVI->pos, AVI->n_idx*16); + ret = avi_add_chunk(AVI, (unsigned char *)"idx1", (void*)AVI->idx, AVI->n_idx*16); + hasIndex = (ret==0); + //fprintf(stderr, "pos=%lu, index_len=%d\n", AVI->pos, hasIndex); + + if(ret) { + idxerror = 1; + AVI_errno = AVI_ERR_WRITE_INDEX; + } + + /* Calculate Microseconds per frame */ + + if(AVI->fps < 0.001) { + frate=0; + ms_per_frame=0; + } else { + frate = (int) (FRAME_RATE_SCALE*AVI->fps + 0.5); + ms_per_frame=(int) (1000000/AVI->fps + 0.5); + } + + /* Prepare the file header */ + + nhb = 0; + + /* The RIFF header */ + + OUT4CC ("RIFF"); + OUTLONG(AVI->pos - 8); /* # of bytes to follow */ + OUT4CC ("AVI "); + + /* Start the header list */ + + OUT4CC ("LIST"); + OUTLONG(0); /* Length of list in bytes, don't know yet */ + hdrl_start = nhb; /* Store start position */ + OUT4CC ("hdrl"); + + /* The main AVI header */ + + /* The Flags in AVI File header */ + +#define AVIF_HASINDEX 0x00000010 /* Index at end of file */ +#define AVIF_MUSTUSEINDEX 0x00000020 +#define AVIF_ISINTERLEAVED 0x00000100 +#define AVIF_TRUSTCKTYPE 0x00000800 /* Use CKType to find key frames */ +#define AVIF_WASCAPTUREFILE 0x00010000 +#define AVIF_COPYRIGHTED 0x00020000 + + OUT4CC ("avih"); + OUTLONG(56); /* # of bytes to follow */ + OUTLONG(ms_per_frame); /* Microseconds per frame */ + //ThOe ->0 + // OUTLONG(10000000); /* MaxBytesPerSec, I hope this will never be used */ + OUTLONG(0); + OUTLONG(0); /* PaddingGranularity (whatever that might be) */ + /* Other sources call it 'reserved' */ + flag = AVIF_ISINTERLEAVED; + if(hasIndex) flag |= AVIF_HASINDEX; + if(hasIndex && AVI->must_use_index) flag |= AVIF_MUSTUSEINDEX; + OUTLONG(flag); /* Flags */ + OUTLONG(AVI->video_frames); /* TotalFrames */ + OUTLONG(0); /* InitialFrames */ + + OUTLONG(AVI->anum+1); +// if (AVI->track[0].audio_bytes) +// { OUTLONG(2); } /* Streams */ +// else +// { OUTLONG(1); } /* Streams */ + + OUTLONG(0); /* SuggestedBufferSize */ + OUTLONG(AVI->width); /* Width */ + OUTLONG(AVI->height); /* Height */ + /* MS calls the following 'reserved': */ + OUTLONG(0); /* TimeScale: Unit used to measure time */ + OUTLONG(0); /* DataRate: Data rate of playback */ + OUTLONG(0); /* StartTime: Starting time of AVI data */ + OUTLONG(0); /* DataLength: Size of AVI data chunk */ + + + /* Start the video stream list ---------------------------------- */ + + OUT4CC ("LIST"); + OUTLONG(0); /* Length of list in bytes, don't know yet */ + strl_start = nhb; /* Store start position */ + OUT4CC ("strl"); + + /* The video stream header */ + + OUT4CC ("strh"); + OUTLONG(56); /* # of bytes to follow */ + OUT4CC ("vids"); /* Type */ + OUT4CC (AVI->compressor); /* Handler */ + OUTLONG(0); /* Flags */ + OUTLONG(0); /* Reserved, MS says: wPriority, wLanguage */ + OUTLONG(0); /* InitialFrames */ + OUTLONG(FRAME_RATE_SCALE); /* Scale */ + OUTLONG(frate); /* Rate: Rate/Scale == samples/second */ + OUTLONG(0); /* Start */ + OUTLONG(AVI->video_frames); /* Length */ + OUTLONG(0); /* SuggestedBufferSize */ + OUTLONG(-1); /* Quality */ + OUTLONG(0); /* SampleSize */ + OUTLONG(0); /* Frame */ + OUTLONG(0); /* Frame */ + // OUTLONG(0); /* Frame */ + //OUTLONG(0); /* Frame */ + + /* The video stream format */ + + OUT4CC ("strf"); + OUTLONG(40); /* # of bytes to follow */ + OUTLONG(40); /* Size */ + OUTLONG(AVI->width); /* Width */ + OUTLONG(AVI->height); /* Height */ + OUTSHRT(1); OUTSHRT(24); /* Planes, Count */ + OUT4CC (AVI->compressor); /* Compression */ + // ThOe (*3) + OUTLONG(AVI->width*AVI->height*3); /* SizeImage (in bytes?) */ + OUTLONG(0); /* XPelsPerMeter */ + OUTLONG(0); /* YPelsPerMeter */ + OUTLONG(0); /* ClrUsed: Number of colors used */ + OUTLONG(0); /* ClrImportant: Number of colors important */ + + /* Finish stream list, i.e. put number of bytes in the list to proper pos */ + + long2str(AVI_header+strl_start-4,nhb-strl_start); + + /* Start the audio stream list ---------------------------------- */ + + for(j=0; janum; ++j) { + + //if (AVI->track[j].a_chans && AVI->track[j].audio_bytes) + { + + sampsize = avi_sampsize(AVI, j); + + OUT4CC ("LIST"); + OUTLONG(0); /* Length of list in bytes, don't know yet */ + strl_start = nhb; /* Store start position */ + OUT4CC ("strl"); + + /* The audio stream header */ + + OUT4CC ("strh"); + OUTLONG(56); /* # of bytes to follow */ + OUT4CC ("auds"); + + // ----------- + // ThOe + OUTLONG(0); /* Format (Optionally) */ + // ----------- + + OUTLONG(0); /* Flags */ + OUTLONG(0); /* Reserved, MS says: wPriority, wLanguage */ + OUTLONG(0); /* InitialFrames */ + + // ThOe /4 + OUTLONG(sampsize/4); /* Scale */ + OUTLONG(1000*AVI->track[j].mp3rate/8); + OUTLONG(0); /* Start */ + OUTLONG(4*AVI->track[j].audio_bytes/sampsize); /* Length */ + OUTLONG(0); /* SuggestedBufferSize */ + OUTLONG(-1); /* Quality */ + + // ThOe /4 + OUTLONG(sampsize/4); /* SampleSize */ + + OUTLONG(0); /* Frame */ + OUTLONG(0); /* Frame */ + // OUTLONG(0); /* Frame */ + //OUTLONG(0); /* Frame */ + + /* The audio stream format */ + + OUT4CC ("strf"); + OUTLONG(16); /* # of bytes to follow */ + OUTSHRT(AVI->track[j].a_fmt); /* Format */ + OUTSHRT(AVI->track[j].a_chans); /* Number of channels */ + OUTLONG(AVI->track[j].a_rate); /* SamplesPerSec */ + // ThOe + OUTLONG(1000*AVI->track[j].mp3rate/8); + //ThOe (/4) + + OUTSHRT(sampsize/4); /* BlockAlign */ + + + OUTSHRT(AVI->track[j].a_bits); /* BitsPerSample */ + + /* Finish stream list, i.e. put number of bytes in the list to proper pos */ + } + long2str(AVI_header+strl_start-4,nhb-strl_start); + } + + /* Finish header list */ + + long2str(AVI_header+hdrl_start-4,nhb-hdrl_start); + + + // add INFO list --- (0.6.0pre4) + +#ifdef INFO_LIST + OUT4CC ("LIST"); + + //FIXME + info_len = MAX_INFO_STRLEN + 12; + OUTLONG(info_len); + OUT4CC ("INFO"); + +// OUT4CC ("INAM"); +// OUTLONG(MAX_INFO_STRLEN); + +// sprintf(id_str, "\t"); +// memset(AVI_header+nhb, 0, MAX_INFO_STRLEN); +// memcpy(AVI_header+nhb, id_str, strlen(id_str)); +// nhb += MAX_INFO_STRLEN; + + OUT4CC ("ISFT"); + OUTLONG(MAX_INFO_STRLEN); + + sprintf(id_str, "%s-%s", PACKAGE, VERSION); + memset(AVI_header+nhb, 0, MAX_INFO_STRLEN); + memcpy(AVI_header+nhb, id_str, strlen(id_str)); + nhb += MAX_INFO_STRLEN; + +// OUT4CC ("ICMT"); +// OUTLONG(MAX_INFO_STRLEN); + +// calptr=time(NULL); +// sprintf(id_str, "\t%s %s", ctime(&calptr), ""); +// memset(AVI_header+nhb, 0, MAX_INFO_STRLEN); +// memcpy(AVI_header+nhb, id_str, 25); +// nhb += MAX_INFO_STRLEN; +#endif + + // ---------------------------- + + /* Calculate the needed amount of junk bytes, output junk */ + + njunk = HEADERBYTES - nhb - 8 - 12; + + /* Safety first: if njunk <= 0, somebody has played with + HEADERBYTES without knowing what (s)he did. + This is a fatal error */ + + if(njunk<=0) + { + fprintf(stderr,"AVI_close_output_file: # of header bytes too small\n"); + exit(1); + } + + OUT4CC ("JUNK"); + OUTLONG(njunk); + memset(AVI_header+nhb,0,njunk); + + nhb += njunk; + + /* Start the movi list */ + + OUT4CC ("LIST"); + OUTLONG(movi_len); /* Length of list in bytes */ + OUT4CC ("movi"); + + /* Output the header, truncate the file to the number of bytes + actually written, report an error if someting goes wrong */ + + if ( lseek(AVI->fdes,0,SEEK_SET)<0 || + avi_write(AVI->fdes,(char *)AVI_header,HEADERBYTES)!=HEADERBYTES + //|| ftruncate(AVI->fdes,AVI->pos)<0 + ) + { + AVI_errno = AVI_ERR_CLOSE; + return -1; + } + + if(idxerror) return -1; + + return 0; +} + +/* + AVI_write_data: + Add video or audio data to the file; + + Return values: + 0 No error; + -1 Error, AVI_errno is set appropriatly; + +*/ + +static int avi_write_data(avi_t *AVI, char *data, unsigned long length, int audio, int keyframe) +{ + int n; + + unsigned char astr[5]; + + /* Check for maximum file length */ + + if ( (AVI->pos + 8 + length + 8 + (AVI->n_idx+1)*16) > AVI_MAX_LEN ) { + AVI_errno = AVI_ERR_SIZELIM; + return -1; + } + + /* Add index entry */ + + //set tag for current audio track + sprintf((char *)astr, "0%1dwb", AVI->aptr+1); + + if(audio) + n = avi_add_index_entry(AVI,astr,0x00,AVI->pos,length); + else + n = avi_add_index_entry(AVI,(unsigned char *) "00db",((keyframe)?0x10:0x0),AVI->pos,length); + + if(n) return -1; + + /* Output tag and data */ + + if(audio) + n = avi_add_chunk(AVI,(unsigned char *) astr, (unsigned char *)data,length); + else + n = avi_add_chunk(AVI,(unsigned char *)"00db",(unsigned char *)data,length); + + if (n) return -1; + + return 0; +} + +int AVI_write_frame(avi_t *AVI, char *data, long bytes, int keyframe) +{ + unsigned long pos; + + if(AVI->mode==AVI_MODE_READ) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } + + pos = AVI->pos; + + if(avi_write_data(AVI,data,bytes,0,keyframe)) return -1; + + AVI->last_pos = pos; + AVI->last_len = bytes; + AVI->video_frames++; + return 0; +} + +int AVI_dup_frame(avi_t *AVI) +{ + if(AVI->mode==AVI_MODE_READ) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } + + if(AVI->last_pos==0) return 0; /* No previous real frame */ + if(avi_add_index_entry(AVI,(unsigned char *)"00db",0x10,AVI->last_pos,AVI->last_len)) return -1; + AVI->video_frames++; + AVI->must_use_index = 1; + return 0; +} + +int AVI_write_audio(avi_t *AVI, char *data, long bytes) +{ + if(AVI->mode==AVI_MODE_READ) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } + + if( avi_write_data(AVI,data,bytes,1,0) ) return -1; + AVI->track[AVI->aptr].audio_bytes += bytes; + return 0; +} + + +int AVI_append_audio(avi_t *AVI, char *data, long bytes) +{ + + long i, length, pos; + unsigned char c[4]; + + if(AVI->mode==AVI_MODE_READ) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } + + // update last index entry: + + --AVI->n_idx; + length = str2ulong(AVI->idx[AVI->n_idx]+12); + pos = str2ulong(AVI->idx[AVI->n_idx]+8); + + //update; + long2str(AVI->idx[AVI->n_idx]+12,length+bytes); + + ++AVI->n_idx; + + AVI->track[AVI->aptr].audio_bytes += bytes; + + //update chunk header + lseek(AVI->fdes, pos+4, SEEK_SET); + long2str(c, length+bytes); + avi_write(AVI->fdes,(char *) c, 4); + + lseek(AVI->fdes, pos+8+length, SEEK_SET); + + i=PAD_EVEN(length + bytes); + + bytes = i - length; + avi_write(AVI->fdes, data, bytes); + AVI->pos = pos + 8 + i; + + return 0; +} + + +long AVI_bytes_remain(avi_t *AVI) +{ + if(AVI->mode==AVI_MODE_READ) return 0; + + return ( AVI_MAX_LEN - (AVI->pos + 8 + 16*AVI->n_idx)); +} + +long AVI_bytes_written(avi_t *AVI) +{ + if(AVI->mode==AVI_MODE_READ) return 0; + + return (AVI->pos + 8 + 16*AVI->n_idx); +} + +int AVI_set_audio_track(avi_t *AVI, int track) +{ + + if(track < 0 || track + 1 > AVI->anum) return(-1); + + //this info is not written to file anyway + AVI->aptr=track; + return 0; +} + +int AVI_get_audio_track(avi_t *AVI) +{ + return(AVI->aptr); +} + + +/******************************************************************* + * * + * Utilities for reading video and audio from an AVI File * + * * + *******************************************************************/ + +int AVI_close(avi_t *AVI) +{ + int ret; + + /* If the file was open for writing, the header and index still have + to be written */ + + if(AVI->mode == AVI_MODE_WRITE) + ret = avi_close_output_file(AVI); + else + ret = 0; + + /* Even if there happened an error, we first clean up */ + + close(AVI->fdes); + if(AVI->idx) free(AVI->idx); + if(AVI->video_index) free(AVI->video_index); + //FIXME + //if(AVI->audio_index) free(AVI->audio_index); + free(AVI); + + return ret; +} + + +#define ERR_EXIT(x) \ +{ \ + AVI_close(AVI); \ + AVI_errno = x; \ + return 0; \ +} + +avi_t *AVI_open_input_file(char *filename, int getIndex) +{ + avi_t *AVI=NULL; + + /* Create avi_t structure */ + + AVI = (avi_t *) malloc(sizeof(avi_t)); + if(AVI==NULL) + { + AVI_errno = AVI_ERR_NO_MEM; + return 0; + } + memset((void *)AVI,0,sizeof(avi_t)); + + AVI->mode = AVI_MODE_READ; /* open for reading */ + + /* Open the file */ + + AVI->fdes = open(filename,O_RDONLY|O_BINARY); + if(AVI->fdes < 0) + { + AVI_errno = AVI_ERR_OPEN; + free(AVI); + return 0; + } + + avi_parse_input_file(AVI, getIndex); + + AVI->aptr=0; //reset + + return AVI; +} + +avi_t *AVI_open_fd(int fd, int getIndex) +{ + avi_t *AVI=NULL; + + /* Create avi_t structure */ + + AVI = (avi_t *) malloc(sizeof(avi_t)); + if(AVI==NULL) + { + AVI_errno = AVI_ERR_NO_MEM; + return 0; + } + memset((void *)AVI,0,sizeof(avi_t)); + + AVI->mode = AVI_MODE_READ; /* open for reading */ + + // file alread open + AVI->fdes = fd; + + avi_parse_input_file(AVI, getIndex); + + AVI->aptr=0; //reset + + return AVI; +} + +int avi_parse_input_file(avi_t *AVI, int getIndex) +{ + long i, n, rate, scale, idx_type; + unsigned char *hdrl_data; + long header_offset=0, hdrl_len=0; + long nvi, nai[AVI_MAX_TRACKS], ioff; + long tot[AVI_MAX_TRACKS]; + int j; + int lasttag = 0; + int vids_strh_seen = 0; + int vids_strf_seen = 0; + int auds_strh_seen = 0; + // int auds_strf_seen = 0; + int num_stream = 0; + char data[256]; + + /* Read first 12 bytes and check that this is an AVI file */ + + if( avi_read(AVI->fdes,data,12) != 12 ) ERR_EXIT(AVI_ERR_READ) + + if( strncasecmp(data ,"RIFF",4) !=0 || + strncasecmp(data+8,"AVI ",4) !=0 ) ERR_EXIT(AVI_ERR_NO_AVI) + + /* Go through the AVI file and extract the header list, + the start position of the 'movi' list and an optionally + present idx1 tag */ + + hdrl_data = 0; + + while(1) + { + if( avi_read(AVI->fdes,data,8) != 8 ) break; /* We assume it's EOF */ + + n = str2ulong((unsigned char *) data+4); + n = PAD_EVEN(n); + + if(strncasecmp(data,"LIST",4) == 0) + { + if( avi_read(AVI->fdes,data,4) != 4 ) ERR_EXIT(AVI_ERR_READ) + n -= 4; + if(strncasecmp(data,"hdrl",4) == 0) + { + hdrl_len = n; + hdrl_data = (unsigned char *) malloc(n); + if(hdrl_data==0) ERR_EXIT(AVI_ERR_NO_MEM); + + // offset of header + + header_offset = lseek(AVI->fdes,0,SEEK_CUR); + + if( avi_read(AVI->fdes,(char *)hdrl_data,n) != n ) ERR_EXIT(AVI_ERR_READ) + } + else if(strncasecmp(data,"movi",4) == 0) + { + AVI->movi_start = lseek(AVI->fdes,0,SEEK_CUR); + lseek(AVI->fdes,n,SEEK_CUR); + } + else + lseek(AVI->fdes,n,SEEK_CUR); + } + else if(strncasecmp(data,"idx1",4) == 0) + { + /* n must be a multiple of 16, but the reading does not + break if this is not the case */ + + AVI->n_idx = AVI->max_idx = n/16; + AVI->idx = (unsigned char((*)[16]) ) malloc(n); + if(AVI->idx==0) ERR_EXIT(AVI_ERR_NO_MEM) + if(avi_read(AVI->fdes, (char *) AVI->idx, n) != n ) ERR_EXIT(AVI_ERR_READ) + } + else + lseek(AVI->fdes,n,SEEK_CUR); + } + + if(!hdrl_data ) ERR_EXIT(AVI_ERR_NO_HDRL) + if(!AVI->movi_start) ERR_EXIT(AVI_ERR_NO_MOVI) + + /* Interpret the header list */ + + for(i=0;icompressor,hdrl_data+i+4,4); + AVI->compressor[4] = 0; + + // ThOe + AVI->v_codech_off = header_offset + i+4; + + scale = str2ulong((unsigned char *)hdrl_data+i+20); + rate = str2ulong(hdrl_data+i+24); + if(scale!=0) AVI->fps = (double)rate/(double)scale; + AVI->video_frames = str2ulong(hdrl_data+i+32); + AVI->video_strn = num_stream; + AVI->max_len = 0; + vids_strh_seen = 1; + lasttag = 1; /* vids */ + } + else if (strncasecmp ((char *) hdrl_data+i,"auds",4) ==0 && ! auds_strh_seen) + { + + //inc audio tracks + AVI->aptr=AVI->anum; + ++AVI->anum; + + if(AVI->anum > AVI_MAX_TRACKS) { + fprintf(stderr, "error - only %d audio tracks supported\n", AVI_MAX_TRACKS); + return(-1); + } + + AVI->track[AVI->aptr].audio_bytes = str2ulong(hdrl_data+i+32)*avi_sampsize(AVI, 0); + AVI->track[AVI->aptr].audio_strn = num_stream; + // auds_strh_seen = 1; + lasttag = 2; /* auds */ + + // ThOe + AVI->track[AVI->aptr].a_codech_off = header_offset + i; + + } + else + lasttag = 0; + num_stream++; + } + else if(strncasecmp((char *) hdrl_data+i,"strf",4)==0) + { + i += 8; + if(lasttag == 1) + { + AVI->width = str2ulong(hdrl_data+i+4); + AVI->height = str2ulong(hdrl_data+i+8); + vids_strf_seen = 1; + //ThOe + AVI->v_codecf_off = header_offset + i+16; + + memcpy(AVI->compressor2, hdrl_data+i+16, 4); + AVI->compressor2[4] = 0; + + } + else if(lasttag == 2) + { + AVI->track[AVI->aptr].a_fmt = str2ushort(hdrl_data+i ); + + //ThOe + AVI->track[AVI->aptr].a_codecf_off = header_offset + i; + + AVI->track[AVI->aptr].a_chans = str2ushort(hdrl_data+i+2); + AVI->track[AVI->aptr].a_rate = str2ulong (hdrl_data+i+4); + //ThOe: read mp3bitrate + AVI->track[AVI->aptr].mp3rate = 8*str2ulong(hdrl_data+i+8)/1000; + //:ThOe + AVI->track[AVI->aptr].a_bits = str2ushort(hdrl_data+i+14); + // auds_strf_seen = 1; + } + lasttag = 0; + } + else + { + i += 8; + lasttag = 0; + } + + i += n; + } + + free(hdrl_data); + + if(!vids_strh_seen || !vids_strf_seen) ERR_EXIT(AVI_ERR_NO_VIDS) + + AVI->video_tag[0] = AVI->video_strn/10 + '0'; + AVI->video_tag[1] = AVI->video_strn%10 + '0'; + AVI->video_tag[2] = 'd'; + AVI->video_tag[3] = 'b'; + + /* Audio tag is set to "99wb" if no audio present */ + if(!AVI->track[0].a_chans) AVI->track[0].audio_strn = 99; + + for(j=0; janum; ++j) { + AVI->track[j].audio_tag[0] = (j+1)/10 + '0'; + AVI->track[j].audio_tag[1] = (j+1)%10 + '0'; + AVI->track[j].audio_tag[2] = 'w'; + AVI->track[j].audio_tag[3] = 'b'; + } + + lseek(AVI->fdes,AVI->movi_start,SEEK_SET); + + /* get index if wanted */ + + if(!getIndex) return(0); + + /* if the file has an idx1, check if this is relative + to the start of the file or to the start of the movi list */ + + idx_type = 0; + + if(AVI->idx) + { + long pos, len; + + /* Search the first videoframe in the idx1 and look where + it is in the file */ + + for(i=0;in_idx;i++) + if( strncasecmp((char *) AVI->idx[i],(char *) AVI->video_tag,3)==0 ) break; + if(i>=AVI->n_idx) ERR_EXIT(AVI_ERR_NO_VIDS) + + pos = str2ulong(AVI->idx[i]+ 8); + len = str2ulong(AVI->idx[i]+12); + + lseek(AVI->fdes,pos,SEEK_SET); + if(avi_read(AVI->fdes,data,8)!=8) ERR_EXIT(AVI_ERR_READ) + if( strncasecmp((char *)data,(char *)AVI->idx[i],4)==0 && + str2ulong((unsigned char *)data+4)==len ) + { + idx_type = 1; /* Index from start of file */ + } + else + { + lseek(AVI->fdes,pos+AVI->movi_start-4,SEEK_SET); + if(avi_read(AVI->fdes,data,8)!=8) ERR_EXIT(AVI_ERR_READ) + if( strncasecmp((char *)data,(char *)AVI->idx[i],4)==0 && str2ulong((unsigned char *)data+4)==len ) + { + idx_type = 2; /* Index from start of movi list */ + } + } + /* idx_type remains 0 if neither of the two tests above succeeds */ + } + + if(idx_type == 0) + { + /* we must search through the file to get the index */ + + lseek(AVI->fdes, AVI->movi_start, SEEK_SET); + + AVI->n_idx = 0; + + while(1) + { + if( avi_read(AVI->fdes,data,8) != 8 ) break; + n = str2ulong((unsigned char *)data+4); + + /* The movi list may contain sub-lists, ignore them */ + + if(strncasecmp(data,"LIST",4)==0) + { + lseek(AVI->fdes,4,SEEK_CUR); + continue; + } + + /* Check if we got a tag ##db, ##dc or ##wb */ + + if( ( (data[2]=='d' || data[2]=='D') && + (data[3]=='b' || data[3]=='B' || data[3]=='c' || data[3]=='C') ) + || ( (data[2]=='w' || data[2]=='W') && + (data[3]=='b' || data[3]=='B') ) ) + { + avi_add_index_entry(AVI,(unsigned char *) data,0,lseek(AVI->fdes,0,SEEK_CUR)-8,n); + } + + lseek(AVI->fdes,PAD_EVEN(n),SEEK_CUR); + } + idx_type = 1; + } + + /* Now generate the video index and audio index arrays */ + + nvi = 0; + for(j=0; janum; ++j) nai[j] = 0; + + for(i=0;in_idx;i++) { + + if(strncasecmp((char *)AVI->idx[i],(char *) AVI->video_tag,3) == 0) nvi++; + + for(j=0; janum; ++j) if(strncasecmp((char *)AVI->idx[i], AVI->track[j].audio_tag,4) == 0) nai[j]++; + } + + AVI->video_frames = nvi; + for(j=0; janum; ++j) AVI->track[j].audio_chunks = nai[j]; + +// fprintf(stderr, "chunks = %ld %d %s\n", AVI->track[0].audio_chunks, AVI->anum, AVI->track[0].audio_tag); + + if(AVI->video_frames==0) ERR_EXIT(AVI_ERR_NO_VIDS); + AVI->video_index = (video_index_entry *) malloc(nvi*sizeof(video_index_entry)); + if(AVI->video_index==0) ERR_EXIT(AVI_ERR_NO_MEM); + + for(j=0; janum; ++j) { + if(AVI->track[j].audio_chunks) { + AVI->track[j].audio_index = (audio_index_entry *) malloc(nai[j]*sizeof(audio_index_entry)); + if(AVI->track[j].audio_index==0) ERR_EXIT(AVI_ERR_NO_MEM); + } + } + + nvi = 0; + for(j=0; janum; ++j) nai[j] = tot[j] = 0; + + ioff = idx_type == 1 ? 8 : AVI->movi_start+4; + + for(i=0;in_idx;i++) { + + //video + if(strncasecmp((char *)AVI->idx[i],(char *)AVI->video_tag,3) == 0) { + AVI->video_index[nvi].key = str2ulong(AVI->idx[i]+ 4); + AVI->video_index[nvi].pos = str2ulong(AVI->idx[i]+ 8)+ioff; + AVI->video_index[nvi].len = str2ulong(AVI->idx[i]+12); + nvi++; + } + + //audio + for(j=0; janum; ++j) { + + if(strncasecmp((char *)AVI->idx[i],AVI->track[j].audio_tag,4) == 0) { + AVI->track[j].audio_index[nai[j]].pos = str2ulong(AVI->idx[i]+ 8)+ioff; + AVI->track[j].audio_index[nai[j]].len = str2ulong(AVI->idx[i]+12); + AVI->track[j].audio_index[nai[j]].tot = tot[j]; + tot[j] += AVI->track[j].audio_index[nai[j]].len; + nai[j]++; + } + } + } + + + for(j=0; janum; ++j) AVI->track[j].audio_bytes = tot[j]; + + /* Reposition the file */ + + lseek(AVI->fdes,AVI->movi_start,SEEK_SET); + AVI->video_pos = 0; + + return(0); +} + +long AVI_video_frames(avi_t *AVI) +{ + return AVI->video_frames; +} +int AVI_video_width(avi_t *AVI) +{ + return AVI->width; +} +int AVI_video_height(avi_t *AVI) +{ + return AVI->height; +} +double AVI_frame_rate(avi_t *AVI) +{ + return AVI->fps; +} +char* AVI_video_compressor(avi_t *AVI) +{ + return AVI->compressor2; +} + +long AVI_max_video_chunk(avi_t *AVI) +{ + return AVI->max_len; +} + +int AVI_audio_tracks(avi_t *AVI) +{ + return(AVI->anum); +} + +int AVI_audio_channels(avi_t *AVI) +{ + return AVI->track[AVI->aptr].a_chans; +} + +long AVI_audio_mp3rate(avi_t *AVI) +{ + return AVI->track[AVI->aptr].mp3rate; +} + +int AVI_audio_bits(avi_t *AVI) +{ + return AVI->track[AVI->aptr].a_bits; +} + +int AVI_audio_format(avi_t *AVI) +{ + return AVI->track[AVI->aptr].a_fmt; +} + +long AVI_audio_rate(avi_t *AVI) +{ + return AVI->track[AVI->aptr].a_rate; +} + +long AVI_audio_bytes(avi_t *AVI) +{ + return AVI->track[AVI->aptr].audio_bytes; +} + +long AVI_audio_chunks(avi_t *AVI) +{ + return AVI->track[AVI->aptr].audio_chunks; +} + +long AVI_audio_codech_offset(avi_t *AVI) +{ + return AVI->track[AVI->aptr].a_codech_off; +} + +long AVI_audio_codecf_offset(avi_t *AVI) +{ + return AVI->track[AVI->aptr].a_codecf_off; +} + +long AVI_video_codech_offset(avi_t *AVI) +{ + return AVI->v_codech_off; +} + +long AVI_video_codecf_offset(avi_t *AVI) +{ + return AVI->v_codecf_off; +} + +long AVI_frame_size(avi_t *AVI, long frame) +{ + if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } + if(!AVI->video_index) { AVI_errno = AVI_ERR_NO_IDX; return -1; } + + if(frame < 0 || frame >= AVI->video_frames) return 0; + return(AVI->video_index[frame].len); +} + +long AVI_audio_size(avi_t *AVI, long frame) +{ + if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } + if(!AVI->track[AVI->aptr].audio_index) { AVI_errno = AVI_ERR_NO_IDX; return -1; } + + if(frame < 0 || frame >= AVI->track[AVI->aptr].audio_chunks) return 0; + return(AVI->track[AVI->aptr].audio_index[frame].len); +} + +long AVI_get_video_position(avi_t *AVI, long frame) +{ + if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } + if(!AVI->video_index) { AVI_errno = AVI_ERR_NO_IDX; return -1; } + + if(frame < 0 || frame >= AVI->video_frames) return 0; + return(AVI->video_index[frame].pos); +} + + +int AVI_seek_start(avi_t *AVI) +{ + if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } + + lseek(AVI->fdes,AVI->movi_start,SEEK_SET); + AVI->video_pos = 0; + return 0; +} + +int AVI_set_video_position(avi_t *AVI, long frame) +{ + if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } + if(!AVI->video_index) { AVI_errno = AVI_ERR_NO_IDX; return -1; } + + if (frame < 0 ) frame = 0; + AVI->video_pos = frame; + return 0; +} + +int AVI_set_audio_bitrate(avi_t *AVI, long bitrate) +{ + if(AVI->mode==AVI_MODE_READ) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } + + AVI->track[AVI->aptr].mp3rate = bitrate; + return 0; +} + + +long AVI_read_frame(avi_t *AVI, char *vidbuf, int *keyframe) +{ + long n; + + if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } + if(!AVI->video_index) { AVI_errno = AVI_ERR_NO_IDX; return -1; } + + if(AVI->video_pos < 0 || AVI->video_pos >= AVI->video_frames) return -1; + n = AVI->video_index[AVI->video_pos].len; + + *keyframe = (AVI->video_index[AVI->video_pos].key==0x10) ? 1:0; + + lseek(AVI->fdes, AVI->video_index[AVI->video_pos].pos, SEEK_SET); + + if (avi_read(AVI->fdes,vidbuf,n) != n) + { + AVI_errno = AVI_ERR_READ; + return -1; + } + + AVI->video_pos++; + + return n; +} + +int AVI_set_audio_position(avi_t *AVI, long byte) +{ + long n0, n1, n; + + if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } + if(!AVI->track[AVI->aptr].audio_index) { AVI_errno = AVI_ERR_NO_IDX; return -1; } + + if(byte < 0) byte = 0; + + /* Binary search in the audio chunks */ + + n0 = 0; + n1 = AVI->track[AVI->aptr].audio_chunks; + + while(n0track[AVI->aptr].audio_index[n].tot>byte) + n1 = n; + else + n0 = n; + } + + AVI->track[AVI->aptr].audio_posc = n0; + AVI->track[AVI->aptr].audio_posb = byte - AVI->track[AVI->aptr].audio_index[n0].tot; + + return 0; +} + +long AVI_read_audio(avi_t *AVI, char *audbuf, long bytes) +{ + long nr, pos, left, todo; + + if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } + if(!AVI->track[AVI->aptr].audio_index) { AVI_errno = AVI_ERR_NO_IDX; return -1; } + + nr = 0; /* total number of bytes read */ + + while(bytes>0) + { + left = AVI->track[AVI->aptr].audio_index[AVI->track[AVI->aptr].audio_posc].len - AVI->track[AVI->aptr].audio_posb; + if(left==0) + { + if(AVI->track[AVI->aptr].audio_posc>=AVI->track[AVI->aptr].audio_chunks-1) return nr; + AVI->track[AVI->aptr].audio_posc++; + AVI->track[AVI->aptr].audio_posb = 0; + continue; + } + if(bytestrack[AVI->aptr].audio_index[AVI->track[AVI->aptr].audio_posc].pos + AVI->track[AVI->aptr].audio_posb; + lseek(AVI->fdes, pos, SEEK_SET); + if (avi_read(AVI->fdes,audbuf+nr,todo) != todo) + { + AVI_errno = AVI_ERR_READ; + return -1; + } + bytes -= todo; + nr += todo; + AVI->track[AVI->aptr].audio_posb += todo; + } + + return nr; +} + +/* AVI_read_data: Special routine for reading the next audio or video chunk + without having an index of the file. */ + +int AVI_read_data(avi_t *AVI, char *vidbuf, long max_vidbuf, + char *audbuf, long max_audbuf, + long *len) +{ + +/* + * Return codes: + * + * 1 = video data read + * 2 = audio data read + * 0 = reached EOF + * -1 = video buffer too small + * -2 = audio buffer too small + */ + + int n; + char data[8]; + + if(AVI->mode==AVI_MODE_WRITE) return 0; + + while(1) + { + /* Read tag and length */ + + if( avi_read(AVI->fdes,data,8) != 8 ) return 0; + + /* if we got a list tag, ignore it */ + + if(strncasecmp(data,"LIST",4) == 0) + { + lseek(AVI->fdes,4,SEEK_CUR); + continue; + } + + n = PAD_EVEN(str2ulong((unsigned char *)data+4)); + + if(strncasecmp(data,AVI->video_tag,3) == 0) + { + *len = n; + AVI->video_pos++; + if(n>max_vidbuf) + { + lseek(AVI->fdes,n,SEEK_CUR); + return -1; + } + if(avi_read(AVI->fdes,vidbuf,n) != n ) return 0; + return 1; + } + else if(strncasecmp(data,AVI->track[AVI->aptr].audio_tag,4) == 0) + { + *len = n; + if(n>max_audbuf) + { + lseek(AVI->fdes,n,SEEK_CUR); + return -2; + } + if(avi_read(AVI->fdes,audbuf,n) != n ) return 0; + return 2; + break; + } + else + if(lseek(AVI->fdes,n,SEEK_CUR)<0) return 0; + } +} + +/* AVI_print_error: Print most recent error (similar to perror) */ + +char *(avi_errors[]) = +{ + /* 0 */ "avilib - No Error", + /* 1 */ "avilib - AVI file size limit reached", + /* 2 */ "avilib - Error opening AVI file", + /* 3 */ "avilib - Error reading from AVI file", + /* 4 */ "avilib - Error writing to AVI file", + /* 5 */ "avilib - Error writing index (file may still be useable)", + /* 6 */ "avilib - Error closing AVI file", + /* 7 */ "avilib - Operation (read/write) not permitted", + /* 8 */ "avilib - Out of memory (malloc failed)", + /* 9 */ "avilib - Not an AVI file", + /* 10 */ "avilib - AVI file has no header list (corrupted?)", + /* 11 */ "avilib - AVI file has no MOVI list (corrupted?)", + /* 12 */ "avilib - AVI file has no video data", + /* 13 */ "avilib - operation needs an index", + /* 14 */ "avilib - Unkown Error" +}; +static int num_avi_errors = sizeof(avi_errors)/sizeof(char*); + +static char error_string[4096]; + +void AVI_print_error(char *str) +{ + int aerrno; + + aerrno = (AVI_errno>=0 && AVI_errno=0 && AVI_errno + * + * This file is part of transcode, a linux video stream processing tool + * + * transcode is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * transcode is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef AVILIB_H +#define AVILIB_H + +#define AVI_MAX_TRACKS 8 + +typedef struct +{ + unsigned long key; + unsigned long pos; + unsigned long len; +} video_index_entry; + +typedef struct +{ + unsigned long pos; + unsigned long len; + unsigned long tot; +} audio_index_entry; + +typedef struct track_s +{ + + long a_fmt; /* Audio format, see #defines below */ + long a_chans; /* Audio channels, 0 for no audio */ + long a_rate; /* Rate in Hz */ + long a_bits; /* bits per audio sample */ + long mp3rate; /* mp3 bitrate kbs*/ + + long audio_strn; /* Audio stream number */ + long audio_bytes; /* Total number of bytes of audio data */ + long audio_chunks; /* Chunks of audio data in the file */ + + char audio_tag[4]; /* Tag of audio data */ + long audio_posc; /* Audio position: chunk */ + long audio_posb; /* Audio position: byte within chunk */ + + long a_codech_off; /* absolut offset of audio codec information */ + long a_codecf_off; /* absolut offset of audio codec information */ + + audio_index_entry *audio_index; + +} track_t; + +typedef struct +{ + + long fdes; /* File descriptor of AVI file */ + long mode; /* 0 for reading, 1 for writing */ + + long width; /* Width of a video frame */ + long height; /* Height of a video frame */ + double fps; /* Frames per second */ + char compressor[8]; /* Type of compressor, 4 bytes + padding for 0 byte */ + char compressor2[8]; /* Type of compressor, 4 bytes + padding for 0 byte */ + long video_strn; /* Video stream number */ + long video_frames; /* Number of video frames */ + char video_tag[4]; /* Tag of video data */ + long video_pos; /* Number of next frame to be read + (if index present) */ + + unsigned long max_len; /* maximum video chunk present */ + + track_t track[AVI_MAX_TRACKS]; // up to AVI_MAX_TRACKS audio tracks supported + + unsigned long pos; /* position in file */ + long n_idx; /* number of index entries actually filled */ + long max_idx; /* number of index entries actually allocated */ + + long v_codech_off; /* absolut offset of video codec (strh) info */ + long v_codecf_off; /* absolut offset of video codec (strf) info */ + + unsigned char (*idx)[16]; /* index entries (AVI idx1 tag) */ + video_index_entry *video_index; + + unsigned long last_pos; /* Position of last frame written */ + unsigned long last_len; /* Length of last frame written */ + int must_use_index; /* Flag if frames are duplicated */ + unsigned long movi_start; + + int anum; // total number of audio tracks + int aptr; // current audio working track + +} avi_t; + +#define AVI_MODE_WRITE 0 +#define AVI_MODE_READ 1 + +/* The error codes delivered by avi_open_input_file */ + +#define AVI_ERR_SIZELIM 1 /* The write of the data would exceed + the maximum size of the AVI file. + This is more a warning than an error + since the file may be closed safely */ + +#define AVI_ERR_OPEN 2 /* Error opening the AVI file - wrong path + name or file nor readable/writable */ + +#define AVI_ERR_READ 3 /* Error reading from AVI File */ + +#define AVI_ERR_WRITE 4 /* Error writing to AVI File, + disk full ??? */ + +#define AVI_ERR_WRITE_INDEX 5 /* Could not write index to AVI file + during close, file may still be + usable */ + +#define AVI_ERR_CLOSE 6 /* Could not write header to AVI file + or not truncate the file during close, + file is most probably corrupted */ + +#define AVI_ERR_NOT_PERM 7 /* Operation not permitted: + trying to read from a file open + for writing or vice versa */ + +#define AVI_ERR_NO_MEM 8 /* malloc failed */ + +#define AVI_ERR_NO_AVI 9 /* Not an AVI file */ + +#define AVI_ERR_NO_HDRL 10 /* AVI file has no has no header list, + corrupted ??? */ + +#define AVI_ERR_NO_MOVI 11 /* AVI file has no has no MOVI list, + corrupted ??? */ + +#define AVI_ERR_NO_VIDS 12 /* AVI file contains no video data */ + +#define AVI_ERR_NO_IDX 13 /* The file has been opened with + getIndex==0, but an operation has been + performed that needs an index */ + +/* Possible Audio formats */ + +#ifndef WAVE_FORMAT_PCM +#define WAVE_FORMAT_UNKNOWN (0x0000) +#define WAVE_FORMAT_PCM (0x0001) +#define WAVE_FORMAT_ADPCM (0x0002) +#define WAVE_FORMAT_IBM_CVSD (0x0005) +#define WAVE_FORMAT_ALAW (0x0006) +#define WAVE_FORMAT_MULAW (0x0007) +#define WAVE_FORMAT_OKI_ADPCM (0x0010) +#define WAVE_FORMAT_DVI_ADPCM (0x0011) +#define WAVE_FORMAT_DIGISTD (0x0015) +#define WAVE_FORMAT_DIGIFIX (0x0016) +#define WAVE_FORMAT_YAMAHA_ADPCM (0x0020) +#define WAVE_FORMAT_DSP_TRUESPEECH (0x0022) +#define WAVE_FORMAT_GSM610 (0x0031) +#define IBM_FORMAT_MULAW (0x0101) +#define IBM_FORMAT_ALAW (0x0102) +#define IBM_FORMAT_ADPCM (0x0103) +#endif + +avi_t* AVI_open_output_file(char * filename); +void AVI_set_video(avi_t *AVI, int width, int height, double fps, char *compressor); +void AVI_set_audio(avi_t *AVI, int channels, long rate, int bits, int format, long mp3rate); +int AVI_write_frame(avi_t *AVI, char *data, long bytes, int keyframe); +int AVI_dup_frame(avi_t *AVI); +int AVI_write_audio(avi_t *AVI, char *data, long bytes); +int AVI_append_audio(avi_t *AVI, char *data, long bytes); +long AVI_bytes_remain(avi_t *AVI); +int AVI_close(avi_t *AVI); +long AVI_bytes_written(avi_t *AVI); + +avi_t *AVI_open_input_file(char *filename, int getIndex); +avi_t *AVI_open_fd(int fd, int getIndex); +int avi_parse_input_file(avi_t *AVI, int getIndex); +long AVI_audio_mp3rate(avi_t *AVI); +long AVI_video_frames(avi_t *AVI); +int AVI_video_width(avi_t *AVI); +int AVI_video_height(avi_t *AVI); +double AVI_frame_rate(avi_t *AVI); +char* AVI_video_compressor(avi_t *AVI); + +int AVI_audio_channels(avi_t *AVI); +int AVI_audio_bits(avi_t *AVI); +int AVI_audio_format(avi_t *AVI); +long AVI_audio_rate(avi_t *AVI); +long AVI_audio_bytes(avi_t *AVI); +long AVI_audio_chunks(avi_t *AVI); + +long AVI_max_video_chunk(avi_t *AVI); + +long AVI_frame_size(avi_t *AVI, long frame); +long AVI_audio_size(avi_t *AVI, long frame); +int AVI_seek_start(avi_t *AVI); +int AVI_set_video_position(avi_t *AVI, long frame); +long AVI_get_video_position(avi_t *AVI, long frame); +long AVI_read_frame(avi_t *AVI, char *vidbuf, int *keyframe); + +int AVI_set_audio_position(avi_t *AVI, long byte); +int AVI_set_audio_bitrate(avi_t *AVI, long bitrate); + +long AVI_read_audio(avi_t *AVI, char *audbuf, long bytes); + +long AVI_audio_codech_offset(avi_t *AVI); +long AVI_audio_codecf_offset(avi_t *AVI); +long AVI_video_codech_offset(avi_t *AVI); +long AVI_video_codecf_offset(avi_t *AVI); + +int AVI_read_data(avi_t *AVI, char *vidbuf, long max_vidbuf, + char *audbuf, long max_audbuf, + long *len); + +void AVI_print_error(char *str); +char *AVI_strerror(); +char *AVI_syserror(); + +int AVI_scan(char *name); +int AVI_dump(char *name, int mode); + +char *AVI_codec2str(short cc); +int AVI_file_check(char *import_file); + +void AVI_info(avi_t *avifile); +uint64_t AVI_max_size(); +int avi_update_header(avi_t *AVI); + +int AVI_set_audio_track(avi_t *AVI, int track); +int AVI_get_audio_track(avi_t *AVI); +int AVI_audio_tracks(avi_t *AVI); + + +struct riff_struct +{ + unsigned char id[4]; /* RIFF */ + unsigned long len; + unsigned char wave_id[4]; /* WAVE */ +}; + + +struct chunk_struct +{ + unsigned char id[4]; + unsigned long len; +}; + +struct common_struct +{ + unsigned short wFormatTag; + unsigned short wChannels; + unsigned long dwSamplesPerSec; + unsigned long dwAvgBytesPerSec; + unsigned short wBlockAlign; + unsigned short wBitsPerSample; /* Only for PCM */ +}; + +struct wave_header +{ + struct riff_struct riff; + struct chunk_struct format; + struct common_struct common; + struct chunk_struct data; +}; + + + +struct AVIStreamHeader { + long fccType; + long fccHandler; + long dwFlags; + long dwPriority; + long dwInitialFrames; + long dwScale; + long dwRate; + long dwStart; + long dwLength; + long dwSuggestedBufferSize; + long dwQuality; + long dwSampleSize; +}; + +#endif diff --git a/win32/experimental/transcoder/avi2vp3/outfile.vp3 b/win32/experimental/transcoder/avi2vp3/outfile.vp3 new file mode 100644 index 0000000..ed74aa9 Binary files /dev/null and b/win32/experimental/transcoder/avi2vp3/outfile.vp3 differ diff --git a/win32/experimental/transcoder/avi2vp3/vp31.avi b/win32/experimental/transcoder/avi2vp3/vp31.avi new file mode 100644 index 0000000..9dada7d Binary files /dev/null and b/win32/experimental/transcoder/avi2vp3/vp31.avi differ diff --git a/win32/experimental/transcoder/readme.txt b/win32/experimental/transcoder/readme.txt new file mode 100644 index 0000000..b10a292 --- /dev/null +++ b/win32/experimental/transcoder/readme.txt @@ -0,0 +1,17 @@ +Quick hack at a transcoder tool from VP3 to Theora + +I actually built the avi2vp3 tool with codeWarrior, but it should compile under +VC as well. I have included a source avi file and the converted .vp3 output. +Output is a file with some header info matching YUVMPEG, and for each frame: + +FRAME header block matching YUV2MPEG +long (Intel aligned) keyframeflag describing in frame is a keyframe +long (Intel aligned) fsize storing frame size in bytes +bytes[fsize] with binary frame data + +The transcode tool is a modification of the current encoder. PUt it into the +win32/experimental subdirectory, and the paths should be correct. It produces +an apparently valid theora stream, but outputs garbage data. The code is packing +the binary frame data in a way that SHOULD work at least imo, but I am probably +missing some initialization issue (or vp3 is not transcodable to theora). + diff --git a/win32/experimental/transcoder/transcoder.dsp b/win32/experimental/transcoder/transcoder.dsp new file mode 100644 index 0000000..863908b --- /dev/null +++ b/win32/experimental/transcoder/transcoder.dsp @@ -0,0 +1,121 @@ +# Microsoft Developer Studio Project File - Name="transcoder" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=transcoder - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "transcoder.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "transcoder.mak" CFG="transcoder - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "transcoder - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "transcoder - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "transcoder - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /I "..\..\..\..\vorbis\include" /I "..\..\..\..\ogg\include" /I "..\wincompat" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D GETOPT_API= /FD /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib theora_static.lib ogg_static.lib vorbis_static.lib vorbisenc_static.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"LIBCMT" /out:"transcoder.exe" /libpath:"..\..\Static_Release" /libpath:"..\..\..\..\ogg\win32\Static_Release" /libpath:"..\..\..\..\vorbis\win32\Vorbis_Static_Release" /libpath:"..\..\..\..\vorbis\win32\VorbisEnc_Static_Release" + +!ELSEIF "$(CFG)" == "transcoder - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\include" /I "..\..\..\..\vorbis\include" /I "..\..\..\..\ogg\include" /I "..\wincompat" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D GETOPT_API= /FD /GZ /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib theora_static_d.lib ogg_static_d.lib vorbis_static_d.lib vorbisenc_static_d.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"LIBCD" /out:"transcoder.exe" /pdbtype:sept /libpath:"..\..\Static_Debug" /libpath:"..\..\..\..\ogg\win32\Static_Debug" /libpath:"..\..\..\..\vorbis\win32\Vorbis_Static_Debug" /libpath:"..\..\..\..\vorbis\win32\VorbisEnc_Static_Debug" +# SUBTRACT LINK32 /nodefaultlib + +!ENDIF + +# Begin Target + +# Name "transcoder - Win32 Release" +# Name "transcoder - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\wincompat\getopt.c +# End Source File +# Begin Source File + +SOURCE=..\wincompat\getopt_long.c +# End Source File +# Begin Source File + +SOURCE=.\transcoder_example.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Group "library" + +# PROP Default_Filter "" +# End Group +# Begin Source File + +SOURCE=.\ReadMe.txt +# End Source File +# End Target +# End Project diff --git a/win32/experimental/transcoder/transcoder_example.c b/win32/experimental/transcoder/transcoder_example.c new file mode 100644 index 0000000..28c2b52 --- /dev/null +++ b/win32/experimental/transcoder/transcoder_example.c @@ -0,0 +1,926 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2004 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: example encoder application; makes an Ogg Theora/Vorbis + file from YUV4MPEG2 and WAV input + last mod: $Id: transcoder_example.c,v 1.4 2004/03/20 00:14:04 tterribe Exp $ + + ********************************************************************/ + +#define _GNU_SOURCE +#define _REENTRANT +#define _LARGEFILE_SOURCE +#define _LARGEFILE64_SOURCE +#define _FILE_OFFSET_BITS 64 + +#include +#include +#include +#include +#include +#include +#include +#include "theora/theora.h" +#include "vorbis/codec.h" +#include "vorbis/vorbisenc.h" + +#ifdef _WIN32 +/*supply missing headers and functions to Win32. going to hell, I know*/ +#include +#include + +static double rint(double x) +{ + if (x < 0.0) + return (double)(int)(x - 0.5); + else + return (double)(int)(x + 0.5); +} +#endif + +/*Copied from vorbis/sharedbook.c*/ +static int _ilog(unsigned int v){ + int ret=0; + while(v){ + ret++; + v>>=1; + } + return(ret); +} + + +const char *optstring = "o:a:A:v:V:"; +struct option options [] = { + {"output",required_argument,NULL,'o'}, + {"audio-rate-target",required_argument,NULL,'A'}, + {"video-rate-target",required_argument,NULL,'V'}, + {"audio-quality",required_argument,NULL,'a'}, + {"video-quality",required_argument,NULL,'v'}, + {NULL,0,NULL,0} +}; + +typedef struct TC_INSTANCE { + ogg_uint32_t LastKeyFrame ; + ogg_int64_t KeyFrameCount; + int ThisIsFirstFrame; + int ThisIsKeyFrame; + ogg_uint32_t CurrentFrame; + ogg_int64_t granulepos; + int keyframe_granule_shift; + char * in_bytes; + long in_bytecount; + ogg_uint32_t fps_denominator; + ogg_uint32_t fps_numerator; + oggpack_buffer opb_in; + oggpack_buffer opb_out; +} TC_INSTANCE; + +/* You'll go to Hell for using globals. */ + +FILE *audio=NULL; +FILE *video=NULL; + +int audio_ch=0; +int audio_hz=0; + +float audio_q=.1; +int audio_r=-1; + +int video_x=0; +int video_y=0; +int frame_x=0; +int frame_y=0; +int frame_x_offset=0; +int frame_y_offset=0; +int video_hzn=0; +int video_hzd=0; +int video_an=0; +int video_ad=0; + +int video_r=-1; +int video_q=16; + + char *vp3frame[2]; + int framebytecount[2]; + int frameiskey[2]; + + ogg_page audiopage; + ogg_page videopage; + +static void usage(void){ + fprintf(stderr, + "Usage: encoder_example [options] [audio_file] video_file\n\n" + "Options: \n\n" + " -o --output file name for encoded output;\n" + " If this option is not given, the\n" + " compressed data is sent to stdout.\n\n" + " -A --audio-rate-target bitrate target for Vorbis audio;\n" + " use -a and not -A if at all possible,\n" + " as -a gives higher quality for a given\n" + " bitrate.\n\n" + " -V --video-rate-target bitrate target for Theora video\n\n" + " -a --audio-quality Vorbis quality selector from -1 to 10\n" + " (-1 yields smallest files but lowest\n" + " fidelity; 10 yields highest fidelity\n" + " but large files. '2' is a reasonable\n" + " default).\n\n" + " -v --video-quality Theora quality selector fro 0 to 10\n" + " (0 yields smallest files but lowest\n" + " video quality. 10 yields highest\n" + " fidelity but large files).\n\n" + "encoder_example accepts only uncompressed RIFF WAV format audio and\n" + "YUV4MPEG2 uncompressed video.\n\n"); + exit(1); +} + +static void id_file(char *f){ + FILE *test; + unsigned char buffer[80]; + int ret; + + /* open it, look for magic */ + + if(!strcmp(f,"-")){ + /* stdin */ + test=stdin; + }else{ + test=fopen(f,"rb"); + if(!test){ + fprintf(stderr,"Unable to open file %s.\n",f); + exit(1); + } + } + + ret=fread(buffer,1,4,test); + if(ret<4){ + fprintf(stderr,"EOF determining file type of file %s.\n",f); + exit(1); + } + + if(!memcmp(buffer,"RIFF",4)){ + /* possible WAV file */ + + if(audio){ + /* umm, we already have one */ + fprintf(stderr,"Multiple RIFF WAVE files specified on command line.\n"); + exit(1); + } + + /* Parse the rest of the header */ + + ret=fread(buffer,1,4,test); + ret=fread(buffer,1,4,test); + if(ret<4)goto riff_err; + if(!memcmp(buffer,"WAVE",4)){ + + while(!feof(test)){ + ret=fread(buffer,1,4,test); + if(ret<4)goto riff_err; + if(!memcmp("fmt",buffer,3)){ + + /* OK, this is our audio specs chunk. Slurp it up. */ + + ret=fread(buffer,1,20,test); + if(ret<20)goto riff_err; + + if(memcmp(buffer+4,"\001\000",2)){ + fprintf(stderr,"The WAV file %s is in a compressed format; " + "can't read it.\n",f); + exit(1); + } + + audio=test; + audio_ch=buffer[6]+(buffer[7]<<8); + audio_hz=buffer[8]+(buffer[9]<<8)+ + (buffer[10]<<16)+(buffer[11]<<24); + + if(buffer[18]+(buffer[19]<<8)!=16){ + fprintf(stderr,"Can only read 16 bit WAV files for now.\n"); + exit(1); + } + + /* Now, align things to the beginning of the data */ + /* Look for 'dataxxxx' */ + while(!feof(test)){ + ret=fread(buffer,1,4,test); + if(ret<4)goto riff_err; + if(!memcmp("data",buffer,4)){ + /* We're there. Ignore the declared size for now. */ + ret=fread(buffer,1,4,test); + if(ret<4)goto riff_err; + + fprintf(stderr,"File %s is 16 bit %d channel %d Hz RIFF WAV audio.\n", + f,audio_ch,audio_hz); + + return; + } + } + } + } + } + + fprintf(stderr,"Couldn't find WAVE data in RIFF file %s.\n",f); + exit(1); + + } + if(!memcmp(buffer,"AVI2",4)){ + /* possible AVI2VP31 format file */ + /* read until newline, or 80 cols, whichever happens first */ + int i; + for(i=0;i<79;i++){ + ret=fread(buffer+i,1,1,test); + if(ret<1)goto yuv_err; + if(buffer[i]=='\n')break; + } + if(i==79){ + fprintf(stderr,"Error parsing %s header; not a VP31 raw frames file?\n",f); + } + buffer[i]='\0'; + + if(!memcmp(buffer,"VP31",4)){ + char interlace; + + if(video){ + /* umm, we already have one */ + fprintf(stderr,"Multiple video files specified on command line.\n"); + exit(1); + } + + if(buffer[4]!='R'){ + fprintf(stderr,"Incorrect file ; VP31 raw frames required.\n"); + } + + ret=sscanf(buffer,"VP31R W%d H%d F%d:%d I%c A%d:%d", + &frame_x,&frame_y,&video_hzn,&video_hzd,&interlace, + &video_an,&video_ad); + if(ret<7){ + fprintf(stderr,"Error parsing AVI2VP31R header in file %s.\n",f); + exit(1); + } + + if(interlace!='p'){ + fprintf(stderr,"Input video is interlaced; Theora handles only progressive scan\n"); + exit(1); + } + + video=test; + + fprintf(stderr,"File %s is %dx%d %.02f fps VP31 video.\n", + f,frame_x,frame_y,(double)video_hzn/video_hzd); + + return; + } + } + fprintf(stderr,"Input file %s is neither a WAV nor VP31 file.\n",f); + exit(1); + + riff_err: + fprintf(stderr,"EOF parsing RIFF file %s.\n",f); + exit(1); + yuv_err: + fprintf(stderr,"EOF parsing VP31 file %s.\n",f); + exit(1); + +} + +int spinner=0; +char *spinascii="|/-\\"; +void spinnit(void){ + spinner++; + if(spinner==4)spinner=0; + fprintf(stderr,"\r%c",spinascii[spinner]); +} + +int fetch_and_process_audio(FILE *audio,ogg_page *audiopage, + ogg_stream_state *vo, + vorbis_dsp_state *vd, + vorbis_block *vb, + int audioflag){ + ogg_packet op; + int i,j; + + while(audio && !audioflag){ + /* process any audio already buffered */ + spinnit(); + if(ogg_stream_pageout(vo,audiopage)>0) return 1; + if(ogg_stream_eos(vo))return 0; + + { + /* read and process more audio */ + signed char readbuffer[4096]; + int toread=4096/2/audio_ch; + int bytesread=fread(readbuffer,1,toread*2*audio_ch,audio); + int sampread=bytesread/2/audio_ch; + float **vorbis_buffer; + int count=0; + + if(bytesread<=0){ + /* end of file. this can be done implicitly, but it's + easier to see here in non-clever fashion. Tell the + library we're at end of stream so that it can handle the + last frame and mark end of stream in the output properly */ + vorbis_analysis_wrote(vd,0); + }else{ + vorbis_buffer=vorbis_analysis_buffer(vd,sampread); + /* uninterleave samples */ + for(i=0;iin_bytecount; + + if(!bytes)return(0); + + op->packet=ttc->in_bytes; + op->bytes=bytes; + op->b_o_s=0; + op->e_o_s=last_p; + + op->packetno=ttc->CurrentFrame; + op->granulepos=ttc->granulepos; + + return 1; +} + +void TranscodeKeyFrame(TC_INSTANCE *ttc){ + /* Keep track of the total number of Key Frames Coded */ + ttc->KeyFrameCount += 1; + ttc->LastKeyFrame = 1; +} + +void TranscodeFrame(TC_INSTANCE *ttc){ + ttc->LastKeyFrame++; +} + +void TranscodeFirstFrame(TC_INSTANCE *ttc){ + /* Keep track of the total number of Key Frames Coded. */ + ttc->KeyFrameCount = 1; + ttc->LastKeyFrame = 1; +} + +int theora_transcode_bufferin( TC_INSTANCE *ttc, int isKeyFrame, char * bytes, int bytecount){ + + /*transcode: record keyframe flag*/ + ttc->ThisIsKeyFrame = isKeyFrame; + + /* Special case for first frame */ + if ( ttc->ThisIsFirstFrame ){ + ttc->ThisIsFirstFrame = 0; + ttc->ThisIsKeyFrame = 0; + } else if ( ttc->ThisIsKeyFrame ) { + TranscodeKeyFrame(ttc); + ttc->ThisIsKeyFrame = 0; + } else { + /* Compress the frame. */ + TranscodeFrame( ttc ); + } + /*need to pack info here*/ + { + + int frame_type; + long total_bits; + long total_words; + int frac_bits; + + oggpackB_readinit(&ttc->opb_in,bytes,bytecount); + oggpackB_reset(&ttc->opb_out); + + /*Mark as video frame.*/ + oggpackB_write(&ttc->opb_out,0,1); + /*Copy frame type.*/ + frame_type=oggpackB_read1(&ttc->opb_in); + oggpackB_write(&ttc->opb_out,frame_type,1); + /*Skip an unused bit in the VP32 header.*/ + oggpackB_adv1(&ttc->opb_in); + /*Copy Q multiplier.*/ + oggpackB_write(&ttc->opb_out,oggpackB_read(&ttc->opb_in,6),6); + /*VP3 has no per-block Q multipliers*/ + oggpackB_write(&ttc->opb_out,0,1); + /*If the frame is a base/key/golden frame, copy a few extra bits.*/ + if(frame_type==0){ + /*These 13 bits are not included in a Theora frame header. + They were 0's and VP3 version info in VP32.*/ + oggpackB_adv(&ttc->opb_in,13); + /*Copy the key frame type and the spare configuration bits.*/ + oggpackB_write(&ttc->opb_out,oggpackB_read(&ttc->opb_in,3),3); + } + + /*Copy the rest of the bits over.*/ + total_bits=bytecount*8-oggpack_bits(&ttc->opb_in); + frac_bits=(int)(total_bits&31); + if(frac_bits){ + oggpackB_write(&ttc->opb_out,oggpackB_read(&ttc->opb_in,frac_bits), + frac_bits); + } + total_words=total_bits>>5; + while(total_words-->0){ + oggpackB_write(&ttc->opb_out,oggpackB_read(&ttc->opb_in,32),32); + } + + ttc->in_bytecount = oggpackB_bytes(&ttc->opb_out); + ttc->in_bytes = oggpackB_get_buffer(&ttc->opb_out); + } + + /* Update stats variables. */ + ttc->CurrentFrame++; + + ttc->granulepos= + ((ttc->CurrentFrame-ttc->LastKeyFrame-1)<keyframe_granule_shift)+ + ttc->LastKeyFrame-1; + + return 0; +} + +//static void _tp_writebuffer(oggpack_buffer *opb, const char *buf, const long len) + +int theora_transcoder_init(theora_info * ti, TC_INSTANCE * ttc){ + memset(ttc, 0, sizeof(*ttc)); + ttc->granulepos = -1; + ttc->keyframe_granule_shift=_ilog(ti->keyframe_frequency_force-1); + ttc->LastKeyFrame = 0; + ttc->KeyFrameCount = 0; + ttc->ThisIsFirstFrame = 1; + ttc->ThisIsKeyFrame = 0; + ttc->CurrentFrame = 1; + ttc->in_bytes = 0; + ttc->in_bytecount = 0; + ttc->fps_denominator = ti->fps_denominator; + ttc->fps_numerator = ti->fps_numerator; + oggpackB_writeinit(&ttc->opb_out); + return 0; +} + +int fetch_and_process_video(FILE *video,ogg_page *videopage, + ogg_stream_state *to, + TC_INSTANCE *ttc, + int videoflag){ + /* You'll go to Hell for using static variables */ + static int state=-1; + ogg_packet op; + int i; + int keyframeflag, framelength; + + + if(state==-1){ + /* initialize the double frame buffer */ + state=0; + } + + /* is there a video page flushed? If not, work until there is. */ + while(!videoflag){ + spinnit(); + + if(ogg_stream_pageout(to,videopage)>0) return 1; + if(ogg_stream_eos(to)) return 0; + + { + /* read and process more video */ + /* video strategy reads one frame ahead so we know when we're + at end of stream and can mark last video frame as such + (vorbis audio has to flush one frame past last video frame + due to overlap and thus doesn't need this extra work */ + + /* have two frame buffers full (if possible) before + proceeding. after first pass and until eos, one will + always be full when we get here */ + + for(i=state;i<2;i++){ + char c,frame[6]; + int ret=fread(frame,1,6,video); + + /* match and skip the frame header */ + if(ret<6)break; + if(memcmp(frame,"FRAME",5)){ + fprintf(stderr,"Loss of framing in VP31 input data\n"); + exit(1); + } + if(frame[5]!='\n'){ + int j; + for(j=0;j<79;j++) + if(fread(&c,1,1,video)&&c=='\n')break; + if(j==79){ + fprintf(stderr,"Error parsing VP31 frame header\n"); + exit(1); + } + } + + /*read the length*/ + ret=fread(&framelength, sizeof(int), 1, video); + + /*read the keyframeflag*/ + ret=fread(&keyframeflag, sizeof(int), 1, video); + + vp3frame[i] = malloc(framelength); + framebytecount[i] = framelength; + frameiskey[i] = keyframeflag; + + /* read the frame */ + ret=fread((char *) vp3frame[i], sizeof(char), framelength, video); + if(ret!=framelength) break; + + state++; + } + + if(state<1){ + /* can't get here unless VP31 stream has no video */ + fprintf(stderr,"Video input contains no frames.\n"); + exit(1); + } + + /* Theora is a one-frame-in,one-frame-out system; submit a frame + for compression and pull out the packet */ + + //theora_encode_YUVin(td,&yuv); + theora_transcode_bufferin( ttc, frameiskey[0], vp3frame[0], framebytecount[0]); + + /* if there's only one frame, it's the last in the stream */ + if(state<2) + theora_transcode_packetout(ttc,1,&op); + else + theora_transcode_packetout(ttc,0,&op); + + ogg_stream_packetin(to,&op); + + { + signed char *temp=vp3frame[0]; + vp3frame[0]=vp3frame[1]; + vp3frame[1] = temp; + free(temp); + + framebytecount[0]= framebytecount[1]; + frameiskey[0] = frameiskey[1]; + state--; + } + } + } + return videoflag; +} + +/* returns, in seconds, absolute time of current packet in given + logical stream */ +double transcode_granule_time(TC_INSTANCE *ttc,ogg_int64_t granulepos){ + if(granulepos>=0){ + ogg_int64_t iframe=granulepos>>ttc->keyframe_granule_shift; + ogg_int64_t pframe=granulepos-(iframe<keyframe_granule_shift); + + return (iframe+pframe)* + ((double)ttc->fps_denominator/ttc->fps_numerator); + + } + return(-1); +} + +int main(int argc,char *argv[]){ + int c,long_option_index,ret; + + ogg_stream_state to; /* take physical pages, weld into a logical + stream of packets */ + ogg_stream_state vo; /* take physical pages, weld into a logical + stream of packets */ + ogg_page og; /* one Ogg bitstream page. Vorbis packets are inside */ + ogg_packet op; /* one raw packet of data for decode */ + + theora_state td; + theora_info ti; + theora_comment tc; + + vorbis_info vi; /* struct that stores all the static vorbis bitstream + settings */ + vorbis_comment vc; /* struct that stores all the user comments */ + + vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */ + vorbis_block vb; /* local working space for packet->PCM decode */ + + int audioflag=0; + int videoflag=0; + int akbps=0; + int vkbps=0; + + ogg_int64_t audio_bytesout=0; + ogg_int64_t video_bytesout=0; + double timebase; + + FILE* outfile = stdout; + + TC_INSTANCE ttc; + +#ifdef _WIN32 /* We need to set stdin/stdout to binary mode. Damn windows. */ + /* if we were reading/writing a file, it would also need to in + binary mode, eg, fopen("file.wav","wb"); */ + /* Beware the evil ifdef. We avoid these where we can, but this one we + cannot. Don't add any more, you'll probably go to hell if you do. */ + _setmode( _fileno( stdin ), _O_BINARY ); + _setmode( _fileno( stdout ), _O_BINARY ); +#endif + + while((c=getopt_long(argc,argv,optstring,options,&long_option_index))!=EOF){ + switch(c){ + case 'o': + outfile=fopen(optarg,"wb"); + if(outfile==NULL){ + fprintf(stderr,"Unable to open output file '%s'\n", optarg); + exit(1); + } + break;; + + case 'a': + audio_q=atof(optarg)*.099; + if(audio_q<-.1 || audio_q>1){ + fprintf(stderr,"Illegal audio quality (choose -1 through 10)\n"); + exit(1); + } + audio_r=-1; + break; + + case 'v': + video_q=rint(atof(optarg)*6.3); + if(video_q<0 || video_q>63){ + fprintf(stderr,"Illegal video quality (choose 0 through 10)\n"); + exit(1); + } + video_r=0; + break; + + case 'A': + audio_r=atof(optarg)*1000; + if(audio_q<0){ + fprintf(stderr,"Illegal audio quality (choose > 0 please)\n"); + exit(1); + } + audio_q=-99; + break; + + case 'V': + video_r=rint(atof(optarg)*1000); + if(video_r<45000 || video_r>2000000){ + fprintf(stderr,"Illegal video bitrate (choose 45kbps through 2000kbps)\n"); + exit(1); + } + video_q=0; + break; + default: + usage(); + } + } + + while(optind>4)<<4; + video_y=((frame_y + 15) >>4)<<4; + frame_x_offset=(video_x-frame_x)/2; + frame_y_offset=(video_y-frame_y)/2; + + theora_info_init(&ti); + ti.width=video_x; + ti.height=video_y; + ti.frame_width=frame_x; + ti.frame_height=frame_y; + ti.offset_x=frame_x_offset; + ti.offset_y=frame_y_offset; + ti.fps_numerator=video_hzn; + ti.fps_denominator=video_hzd; + ti.aspect_numerator=video_an; + ti.aspect_denominator=video_ad; + ti.colorspace=OC_CS_UNSPECIFIED; + ti.target_bitrate=video_r; + ti.quality=video_q; + + ti.dropframes_p=0; + ti.quick_p=1; + ti.keyframe_auto_p=1; + ti.keyframe_frequency=32768; + ti.keyframe_frequency_force=32768; + ti.keyframe_data_target_bitrate=video_r*1.5; + ti.keyframe_auto_threshold=80; + ti.keyframe_mindistance=8; + ti.noise_sensitivity=1; + + theora_encode_init(&td,&ti); + theora_transcoder_init(&ti, &ttc); + theora_info_clear(&ti); + + /* initialize Vorbis too, assuming we have audio to compress. */ + if(audio){ + vorbis_info_init(&vi); + if(audio_q>-99) + ret = vorbis_encode_init_vbr(&vi,audio_ch,audio_hz,audio_q); + else + ret = vorbis_encode_init(&vi,audio_ch,audio_hz,-1,audio_r,-1); + if(ret){ + fprintf(stderr,"The Vorbis encoder could not set up a mode according to\n" + "the requested quality or bitrate.\n\n"); + exit(1); + } + + vorbis_comment_init(&vc); + vorbis_analysis_init(&vd,&vi); + vorbis_block_init(&vd,&vb); + } + + /* write the bitstream header packets with proper page interleave */ + + /* first packet will get its own page automatically */ + theora_encode_header(&td,&op); + ogg_stream_packetin(&to,&op); + if(ogg_stream_pageout(&to,&og)!=1){ + fprintf(stderr,"Internal Ogg library error.\n"); + exit(1); + } + fwrite(og.header,1,og.header_len,outfile); + fwrite(og.body,1,og.body_len,outfile); + + /* create the remaining theora headers */ + theora_comment_init(&tc); + theora_encode_comment(&tc,&op); + ogg_stream_packetin(&to,&op); + theora_encode_tables(&td,&op); + ogg_stream_packetin(&to,&op); + + if(audio){ + ogg_packet header; + ogg_packet header_comm; + ogg_packet header_code; + + vorbis_analysis_headerout(&vd,&vc,&header,&header_comm,&header_code); + ogg_stream_packetin(&vo,&header); /* automatically placed in its own + page */ + if(ogg_stream_pageout(&vo,&og)!=1){ + fprintf(stderr,"Internal Ogg library error.\n"); + exit(1); + } + fwrite(og.header,1,og.header_len,outfile); + fwrite(og.body,1,og.body_len,outfile); + + /* remaining vorbis header packets */ + ogg_stream_packetin(&vo,&header_comm); + ogg_stream_packetin(&vo,&header_code); + } + + /* Flush the rest of our headers. This ensures + the actual data in each stream will start + on a new page, as per spec. */ + while(1){ + int result = ogg_stream_flush(&to,&og); + if(result<0){ + /* can't get here */ + fprintf(stderr,"Internal Ogg library error.\n"); + exit(1); + } + if(result==0)break; + fwrite(og.header,1,og.header_len,outfile); + fwrite(og.body,1,og.body_len,outfile); + } + if(audio){ + while(1){ + int result=ogg_stream_flush(&vo,&og); + if(result<0){ + /* can't get here */ + fprintf(stderr,"Internal Ogg library error.\n"); + exit(1); + } + if(result==0)break; + fwrite(og.header,1,og.header_len,outfile); + fwrite(og.body,1,og.body_len,outfile); + } + } + + /* setup complete. Raw processing loop */ + fprintf(stderr,"Compressing....\n"); + while(1){ + + + /* is there an audio page flushed? If not, fetch one if possible */ + audioflag=fetch_and_process_audio(audio,&audiopage,&vo,&vd,&vb,audioflag); + + /* is there a video page flushed? If not, fetch one if possible */ + videoflag=fetch_and_process_video(video,&videopage,&to,&ttc,videoflag); + + /* no pages of either? Must be end of stream. */ + if(!audioflag && !videoflag)break; + + /* which is earlier; the end of the audio page or the end of the + video page? Flush the earlier to stream */ + { + int audio_or_video=-1; + double audiotime= + audioflag?vorbis_granule_time(&vd,ogg_page_granulepos(&audiopage)):-1; + double videotime= + videoflag?transcode_granule_time(&ttc,ogg_page_granulepos(&videopage)):-1; + + if(!audioflag){ + audio_or_video=1; + } else if(!videoflag) { + audio_or_video=0; + } else { + if(audiotime +//__FBSDID("$FreeBSD: src/lib/libc/stdlib/getopt.c,v 1.6 2002/03/29 22:43:42 markm Exp $"); + +#include "namespace.h"*/ +#include +#include +#include +/*#include "un-namespace.h"*/ + +/*#include "libc_private.h"*/ + +int opterr = 1, /* if error message should be printed */ + optind = 1, /* index into parent argv vector */ + optopt, /* character checked for validity */ + optreset; /* reset getopt */ +char *optarg; /* argument associated with option */ + +#define BADCH (int)'?' +#define BADARG (int)':' +#define EMSG "" + +/* + * getopt -- + * Parse argc/argv argument vector. + */ +int +getopt(nargc, nargv, ostr) + int nargc; + char * const *nargv; + const char *ostr; +{ + static char *place = EMSG; /* option letter processing */ + char *oli; /* option letter list index */ + + if (optreset || !*place) { /* update scanning pointer */ + optreset = 0; + if (optind >= nargc || *(place = nargv[optind]) != '-') { + place = EMSG; + return (-1); + } + if (place[1] && *++place == '-') { /* found "--" */ + ++optind; + place = EMSG; + return (-1); + } + } /* option letter okay? */ + if ((optopt = (int)*place++) == (int)':' || + !(oli = strchr(ostr, optopt))) { + /* + * if the user didn't specify '-' as an option, + * assume it means -1. + */ + if (optopt == (int)'-') + return (-1); + if (!*place) + ++optind; + if (opterr && *ostr != ':' && optopt != BADCH) + (void)fprintf(stderr, "%s: illegal option -- %c\n", + "progname", optopt); + return (BADCH); + } + if (*++oli != ':') { /* don't need argument */ + optarg = NULL; + if (!*place) + ++optind; + } + else { /* need an argument */ + if (*place) /* no white space */ + optarg = place; + else if (nargc <= ++optind) { /* no arg */ + place = EMSG; + if (*ostr == ':') + return (BADARG); + if (opterr) + (void)fprintf(stderr, + "%s: option requires an argument -- %c\n", + "progname", optopt); + return (BADCH); + } + else /* white space */ + optarg = nargv[optind]; + place = EMSG; + ++optind; + } + return (optopt); /* dump back option letter */ +} diff --git a/win32/experimental/wincompat/getopt.h b/win32/experimental/wincompat/getopt.h new file mode 100644 index 0000000..d95d6cf --- /dev/null +++ b/win32/experimental/wincompat/getopt.h @@ -0,0 +1,110 @@ +/* $NetBSD: getopt.h,v 1.4 2000/07/07 10:43:54 ad Exp $ */ +/* $FreeBSD: src/include/getopt.h,v 1.1 2002/09/29 04:14:30 eric Exp $ */ + +/*- + * Copyright (c) 2000 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Dieter Baron and Thomas Klausner. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _GETOPT_H_ +#define _GETOPT_H_ + +#ifdef _WIN32 +/* from */ +# ifdef __cplusplus +# define __BEGIN_DECLS extern "C" { +# define __END_DECLS } +# else +# define __BEGIN_DECLS +# define __END_DECLS +# endif +# define __P(args) args +#endif + +/*#ifndef _WIN32 +#include +#include +#endif*/ + +#ifdef _WIN32 +# if !defined(GETOPT_API) +# define GETOPT_API __declspec(dllimport) +# endif +#endif + +/* + * Gnu like getopt_long() and BSD4.4 getsubopt()/optreset extensions + */ +#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE) +#define no_argument 0 +#define required_argument 1 +#define optional_argument 2 + +struct option { + /* name of long option */ + const char *name; + /* + * one of no_argument, required_argument, and optional_argument: + * whether option takes an argument + */ + int has_arg; + /* if not NULL, set *flag to val when option found */ + int *flag; + /* if flag not NULL, value to set *flag to; else return value */ + int val; +}; + +__BEGIN_DECLS +GETOPT_API int getopt_long __P((int, char * const *, const char *, + const struct option *, int *)); +__END_DECLS +#endif + +#ifdef _WIN32 +/* These are global getopt variables */ +__BEGIN_DECLS + +GETOPT_API extern int opterr, /* if error message should be printed */ + optind, /* index into parent argv vector */ + optopt, /* character checked for validity */ + optreset; /* reset getopt */ +GETOPT_API extern char* optarg; /* argument associated with option */ + +/* Original getopt */ +GETOPT_API int getopt __P((int, char * const *, const char *)); + +__END_DECLS +#endif + +#endif /* !_GETOPT_H_ */ diff --git a/win32/experimental/wincompat/getopt_long.c b/win32/experimental/wincompat/getopt_long.c new file mode 100644 index 0000000..b5ae0fa --- /dev/null +++ b/win32/experimental/wincompat/getopt_long.c @@ -0,0 +1,547 @@ +/* $NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $ */ +/* $FreeBSD: src/lib/libc/stdlib/getopt_long.c,v 1.2 2002/10/16 22:18:42 alfred Exp $ */ + +/*- + * Copyright (c) 2000 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Dieter Baron and Thomas Klausner. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + + +#include +#include +#include + +#ifdef _WIN32 + +/* Windows needs warnx(). We change the definition though: + * 1. (another) global is defined, opterrmsg, which holds the error message + * 2. errors are always printed out on stderr w/o the program name + * Note that opterrmsg always gets set no matter what opterr is set to. The + * error message will not be printed if opterr is 0 as usual. + */ + +#include +#include + +GETOPT_API extern char opterrmsg[128]; +char opterrmsg[128]; /* last error message is stored here */ + +static void warnx(int print_error, const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + if (fmt != NULL) + _vsnprintf(opterrmsg, 128, fmt, ap); + else + opterrmsg[0]='\0'; + va_end(ap); + if (print_error) { + fprintf(stderr, opterrmsg); + fprintf(stderr, "\n"); + } +} + +#endif /*_WIN32*/ + +/* not part of the original file */ +#ifndef _DIAGASSERT +#define _DIAGASSERT(X) +#endif + +#if HAVE_CONFIG_H && !HAVE_GETOPT_LONG && !HAVE_DECL_OPTIND +#define REPLACE_GETOPT +#endif + +#ifdef REPLACE_GETOPT +#ifdef __weak_alias +__weak_alias(getopt,_getopt) +#endif +int opterr = 1; /* if error message should be printed */ +int optind = 1; /* index into parent argv vector */ +int optopt = '?'; /* character checked for validity */ +int optreset; /* reset getopt */ +char *optarg; /* argument associated with option */ +#elif HAVE_CONFIG_H && !HAVE_DECL_OPTRESET +static int optreset; +#endif + +#ifdef __weak_alias +__weak_alias(getopt_long,_getopt_long) +#endif + +#if !HAVE_GETOPT_LONG +#define IGNORE_FIRST (*options == '-' || *options == '+') +#define PRINT_ERROR ((opterr) && ((*options != ':') \ + || (IGNORE_FIRST && options[1] != ':'))) +#define IS_POSIXLY_CORRECT (getenv("POSIXLY_CORRECT") != NULL) +#define PERMUTE (!IS_POSIXLY_CORRECT && !IGNORE_FIRST) +/* XXX: GNU ignores PC if *options == '-' */ +#define IN_ORDER (!IS_POSIXLY_CORRECT && *options == '-') + +/* return values */ +#define BADCH (int)'?' +#define BADARG ((IGNORE_FIRST && options[1] == ':') \ + || (*options == ':') ? (int)':' : (int)'?') +#define INORDER (int)1 + +#define EMSG "" + +static int getopt_internal(int, char * const *, const char *); +static int gcd(int, int); +static void permute_args(int, int, int, char * const *); + +static char *place = EMSG; /* option letter processing */ + +/* XXX: set optreset to 1 rather than these two */ +static int nonopt_start = -1; /* first non option argument (for permute) */ +static int nonopt_end = -1; /* first option after non options (for permute) */ + +/* Error messages */ +static const char recargchar[] = "option requires an argument -- %c"; +static const char recargstring[] = "option requires an argument -- %s"; +static const char ambig[] = "ambiguous option -- %.*s"; +static const char noarg[] = "option doesn't take an argument -- %.*s"; +static const char illoptchar[] = "unknown option -- %c"; +static const char illoptstring[] = "unknown option -- %s"; + + +/* + * Compute the greatest common divisor of a and b. + */ +static int +gcd(a, b) + int a; + int b; +{ + int c; + + c = a % b; + while (c != 0) { + a = b; + b = c; + c = a % b; + } + + return b; +} + +/* + * Exchange the block from nonopt_start to nonopt_end with the block + * from nonopt_end to opt_end (keeping the same order of arguments + * in each block). + */ +static void +permute_args(panonopt_start, panonopt_end, opt_end, nargv) + int panonopt_start; + int panonopt_end; + int opt_end; + char * const *nargv; +{ + int cstart, cyclelen, i, j, ncycle, nnonopts, nopts, pos; + char *swap; + + _DIAGASSERT(nargv != NULL); + + /* + * compute lengths of blocks and number and size of cycles + */ + nnonopts = panonopt_end - panonopt_start; + nopts = opt_end - panonopt_end; + ncycle = gcd(nnonopts, nopts); + cyclelen = (opt_end - panonopt_start) / ncycle; + + for (i = 0; i < ncycle; i++) { + cstart = panonopt_end+i; + pos = cstart; + for (j = 0; j < cyclelen; j++) { + if (pos >= panonopt_end) + pos -= nnonopts; + else + pos += nopts; + swap = nargv[pos]; + /* LINTED const cast */ + ((char **) nargv)[pos] = nargv[cstart]; + /* LINTED const cast */ + ((char **)nargv)[cstart] = swap; + } + } +} + +/* + * getopt_internal -- + * Parse argc/argv argument vector. Called by user level routines. + * Returns -2 if -- is found (can be long option or end of options marker). + */ +static int +getopt_internal(nargc, nargv, options) + int nargc; + char * const *nargv; + const char *options; +{ + char *oli; /* option letter list index */ + int optchar; + + _DIAGASSERT(nargv != NULL); + _DIAGASSERT(options != NULL); + + optarg = NULL; + + /* + * XXX Some programs (like rsyncd) expect to be able to + * XXX re-initialize optind to 0 and have getopt_long(3) + * XXX properly function again. Work around this braindamage. + */ + if (optind == 0) + optind = 1; + + if (optreset) + nonopt_start = nonopt_end = -1; +start: + if (optreset || !*place) { /* update scanning pointer */ + optreset = 0; + if (optind >= nargc) { /* end of argument vector */ + place = EMSG; + if (nonopt_end != -1) { + /* do permutation, if we have to */ + permute_args(nonopt_start, nonopt_end, + optind, nargv); + optind -= nonopt_end - nonopt_start; + } + else if (nonopt_start != -1) { + /* + * If we skipped non-options, set optind + * to the first of them. + */ + optind = nonopt_start; + } + nonopt_start = nonopt_end = -1; + return -1; + } + if ((*(place = nargv[optind]) != '-') + || (place[1] == '\0')) { /* found non-option */ + place = EMSG; + if (IN_ORDER) { + /* + * GNU extension: + * return non-option as argument to option 1 + */ + optarg = nargv[optind++]; + return INORDER; + } + if (!PERMUTE) { + /* + * if no permutation wanted, stop parsing + * at first non-option + */ + return -1; + } + /* do permutation */ + if (nonopt_start == -1) + nonopt_start = optind; + else if (nonopt_end != -1) { + permute_args(nonopt_start, nonopt_end, + optind, nargv); + nonopt_start = optind - + (nonopt_end - nonopt_start); + nonopt_end = -1; + } + optind++; + /* process next argument */ + goto start; + } + if (nonopt_start != -1 && nonopt_end == -1) + nonopt_end = optind; + if (place[1] && *++place == '-') { /* found "--" */ + place++; + return -2; + } + } + if ((optchar = (int)*place++) == (int)':' || + (oli = strchr(options + (IGNORE_FIRST ? 1 : 0), optchar)) == NULL) { + /* option letter unknown or ':' */ + if (!*place) + ++optind; +#ifndef _WIN32 + if (PRINT_ERROR) + warnx(illoptchar, optchar); +#else + warnx(PRINT_ERROR, illoptchar, optchar); +#endif + optopt = optchar; + return BADCH; + } + if (optchar == 'W' && oli[1] == ';') { /* -W long-option */ + /* XXX: what if no long options provided (called by getopt)? */ + if (*place) + return -2; + + if (++optind >= nargc) { /* no arg */ + place = EMSG; +#ifndef _WIN32 + if (PRINT_ERROR) + warnx(recargchar, optchar); +#else + warnx(PRINT_ERROR, recargchar, optchar); +#endif + optopt = optchar; + return BADARG; + } else /* white space */ + place = nargv[optind]; + /* + * Handle -W arg the same as --arg (which causes getopt to + * stop parsing). + */ + return -2; + } + if (*++oli != ':') { /* doesn't take argument */ + if (!*place) + ++optind; + } else { /* takes (optional) argument */ + optarg = NULL; + if (*place) /* no white space */ + optarg = place; + /* XXX: disable test for :: if PC? (GNU doesn't) */ + else if (oli[1] != ':') { /* arg not optional */ + if (++optind >= nargc) { /* no arg */ + place = EMSG; +#ifndef _WIN32 + if (PRINT_ERROR) + warnx(recargchar, optchar); +#else + warnx(PRINT_ERROR, recargchar, optchar); +#endif + optopt = optchar; + return BADARG; + } else + optarg = nargv[optind]; + } + place = EMSG; + ++optind; + } + /* dump back option letter */ + return optchar; +} + +#ifdef REPLACE_GETOPT +/* + * getopt -- + * Parse argc/argv argument vector. + * + * [eventually this will replace the real getopt] + */ +int +getopt(nargc, nargv, options) + int nargc; + char * const *nargv; + const char *options; +{ + int retval; + + _DIAGASSERT(nargv != NULL); + _DIAGASSERT(options != NULL); + + if ((retval = getopt_internal(nargc, nargv, options)) == -2) { + ++optind; + /* + * We found an option (--), so if we skipped non-options, + * we have to permute. + */ + if (nonopt_end != -1) { + permute_args(nonopt_start, nonopt_end, optind, + nargv); + optind -= nonopt_end - nonopt_start; + } + nonopt_start = nonopt_end = -1; + retval = -1; + } + return retval; +} +#endif + +/* + * getopt_long -- + * Parse argc/argv argument vector. + */ +int +getopt_long(nargc, nargv, options, long_options, idx) + int nargc; + char * const *nargv; + const char *options; + const struct option *long_options; + int *idx; +{ + int retval; + + _DIAGASSERT(nargv != NULL); + _DIAGASSERT(options != NULL); + _DIAGASSERT(long_options != NULL); + /* idx may be NULL */ + + if ((retval = getopt_internal(nargc, nargv, options)) == -2) { + char *current_argv, *has_equal; + size_t current_argv_len; + int i, match; + + current_argv = place; + match = -1; + + optind++; + place = EMSG; + + if (*current_argv == '\0') { /* found "--" */ + /* + * We found an option (--), so if we skipped + * non-options, we have to permute. + */ + if (nonopt_end != -1) { + permute_args(nonopt_start, nonopt_end, + optind, nargv); + optind -= nonopt_end - nonopt_start; + } + nonopt_start = nonopt_end = -1; + return -1; + } + if ((has_equal = strchr(current_argv, '=')) != NULL) { + /* argument found (--option=arg) */ + current_argv_len = has_equal - current_argv; + has_equal++; + } else + current_argv_len = strlen(current_argv); + + for (i = 0; long_options[i].name; i++) { + /* find matching long option */ + if (strncmp(current_argv, long_options[i].name, + current_argv_len)) + continue; + + if (strlen(long_options[i].name) == + (unsigned)current_argv_len) { + /* exact match */ + match = i; + break; + } + if (match == -1) /* partial match */ + match = i; + else { + /* ambiguous abbreviation */ +#ifndef _WIN32 + if (PRINT_ERROR) + warnx(ambig, (int)current_argv_len, + current_argv); +#else + warnx(PRINT_ERROR, ambig, (int)current_argv_len, + current_argv); +#endif + optopt = 0; + return BADCH; + } + } + if (match != -1) { /* option found */ + if (long_options[match].has_arg == no_argument + && has_equal) { +#ifndef _WIN32 + if (PRINT_ERROR) + warnx(noarg, (int)current_argv_len, + current_argv); +#else + warnx(PRINT_ERROR, noarg, (int)current_argv_len, + current_argv); +#endif + /* + * XXX: GNU sets optopt to val regardless of + * flag + */ + if (long_options[match].flag == NULL) + optopt = long_options[match].val; + else + optopt = 0; + return BADARG; + } + if (long_options[match].has_arg == required_argument || + long_options[match].has_arg == optional_argument) { + if (has_equal) + optarg = has_equal; + else if (long_options[match].has_arg == + required_argument) { + /* + * optional argument doesn't use + * next nargv + */ + optarg = nargv[optind++]; + } + } + if ((long_options[match].has_arg == required_argument) + && (optarg == NULL)) { + /* + * Missing argument; leading ':' + * indicates no error should be generated + */ +#ifndef _WIN32 + if (PRINT_ERROR) + warnx(recargstring, current_argv); +#else + warnx(PRINT_ERROR, recargstring, current_argv); +#endif + /* + * XXX: GNU sets optopt to val regardless + * of flag + */ + if (long_options[match].flag == NULL) + optopt = long_options[match].val; + else + optopt = 0; + --optind; + return BADARG; + } + } else { /* unknown option */ +#ifndef _WIN32 + if (PRINT_ERROR) + warnx(illoptstring, current_argv); +#else + warnx(PRINT_ERROR, illoptstring, current_argv); +#endif + optopt = 0; + return BADCH; + } + if (long_options[match].flag) { + *long_options[match].flag = long_options[match].val; + retval = 0; + } else + retval = long_options[match].val; + if (idx) + *idx = match; + } + return retval; +} +#endif /* !GETOPT_LONG */ diff --git a/win32/experimental/wincompat/unistd.h b/win32/experimental/wincompat/unistd.h new file mode 100644 index 0000000..e69de29 diff --git a/win32/getopt.c b/win32/getopt.c new file mode 100644 index 0000000..dad25b6 --- /dev/null +++ b/win32/getopt.c @@ -0,0 +1,1047 @@ +/* Getopt for GNU. + NOTE: getopt is now part of the C library, so if you don't know what + "Keep this file name-space clean" means, talk to drepper@gnu.org + before changing it! + + Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 + Free Software Foundation, Inc. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* This tells Alpha OSF/1 not to define a getopt prototype in . + Ditto for AIX 3.2 and . */ +#ifndef _NO_PROTO +# define _NO_PROTO +#endif + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#if !defined __STDC__ || !__STDC__ +/* This is a separate conditional since some stdc systems + reject `defined (const)'. */ +# ifndef const +# define const +# endif +#endif + +#include + +/* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself. This code is part of the GNU C + Library, but also included in many other GNU distributions. Compiling + and linking in this code is a waste when using the GNU C library + (especially if it is a shared library). Rather than having every GNU + program understand `configure --with-gnu-libc' and omit the object files, + it is simpler to just do this in the source for each such file. */ + +#define GETOPT_INTERFACE_VERSION 2 +#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 +# include +# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION +# define ELIDE_CODE +# endif +#endif + +#ifndef ELIDE_CODE + + +/* This needs to come after some library #include + to get __GNU_LIBRARY__ defined. */ +#ifdef __GNU_LIBRARY__ +/* Don't include stdlib.h for non-GNU C libraries because some of them + contain conflicting prototypes for getopt. */ +# include +# include +#endif /* GNU C library. */ + +#ifdef VMS +# include +# if HAVE_STRING_H - 0 +# include +# endif +#endif + +#ifndef _ +/* This is for other GNU distributions with internationalized messages. + When compiling libc, the _ macro is predefined. */ +# ifdef HAVE_LIBINTL_H +# include +# define _(msgid) gettext (msgid) +# else +# define _(msgid) (msgid) +# endif +#endif + +/* This version of `getopt' appears to the caller like standard Unix `getopt' + but it behaves differently for the user, since it allows the user + to intersperse the options with the other arguments. + + As `getopt' works, it permutes the elements of ARGV so that, + when it is done, all the options precede everything else. Thus + all application programs are extended to handle flexible argument order. + + Setting the environment variable POSIXLY_CORRECT disables permutation. + Then the behavior is completely standard. + + GNU application programs can use a third alternative mode in which + they can distinguish the relative order of options and other arguments. */ + +#include "getopt_win.h" + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +char *optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns -1, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +/* 1003.2 says this must be 1 before any call. */ +int optind = 1; + +/* Formerly, initialization of getopt depended on optind==0, which + causes problems with re-calling getopt as programs generally don't + know that. */ + +int __getopt_initialized; + +/* The next char to be scanned in the option-element + in which the last option character we returned was found. + This allows us to pick up the scan where we left off. + + If this is zero, or a null string, it means resume the scan + by advancing to the next ARGV-element. */ + +static char *nextchar; + +/* Callers store zero here to inhibit the error message + for unrecognized options. */ + +int opterr = 1; + +/* Set to an option character which was unrecognized. + This must be initialized on some systems to avoid linking in the + system's own getopt implementation. */ + +int optopt = '?'; + +/* Describe how to deal with options that follow non-option ARGV-elements. + + If the caller did not specify anything, + the default is REQUIRE_ORDER if the environment variable + POSIXLY_CORRECT is defined, PERMUTE otherwise. + + REQUIRE_ORDER means don't recognize them as options; + stop option processing when the first non-option is seen. + This is what Unix does. + This mode of operation is selected by either setting the environment + variable POSIXLY_CORRECT, or using `+' as the first character + of the list of option characters. + + PERMUTE is the default. We permute the contents of ARGV as we scan, + so that eventually all the non-options are at the end. This allows options + to be given in any order, even with programs that were not written to + expect this. + + RETURN_IN_ORDER is an option available to programs that were written + to expect options and other ARGV-elements in any order and that care about + the ordering of the two. We describe each non-option ARGV-element + as if it were the argument of an option with character code 1. + Using `-' as the first character of the list of option characters + selects this mode of operation. + + The special argument `--' forces an end of option-scanning regardless + of the value of `ordering'. In the case of RETURN_IN_ORDER, only + `--' can cause `getopt' to return -1 with `optind' != ARGC. */ + +static enum +{ + REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER +} ordering; + +/* Value of POSIXLY_CORRECT environment variable. */ +static char *posixly_correct; + +#ifdef __GNU_LIBRARY__ +/* We want to avoid inclusion of string.h with non-GNU libraries + because there are many ways it can cause trouble. + On some systems, it contains special magic macros that don't work + in GCC. */ +# include +# define my_index strchr +#else + +#include + +/* Avoid depending on library functions or files + whose names are inconsistent. */ + +#ifndef getenv +extern char *getenv (); +#endif + +static char * +my_index (str, chr) + const char *str; + int chr; +{ + while (*str) + { + if (*str == chr) + return (char *) str; + str++; + } + return 0; +} + +/* If using GCC, we can safely declare strlen this way. + If not using GCC, it is ok not to declare it. */ +#ifdef __GNUC__ +/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. + That was relevant to code that was here before. */ +# if (!defined __STDC__ || !__STDC__) && !defined strlen +/* gcc with -traditional declares the built-in strlen to return int, + and has done so at least since version 2.4.5. -- rms. */ +extern int strlen (const char *); +# endif /* not __STDC__ */ +#endif /* __GNUC__ */ + +#endif /* not __GNU_LIBRARY__ */ + +/* Handle permutation of arguments. */ + +/* Describe the part of ARGV that contains non-options that have + been skipped. `first_nonopt' is the index in ARGV of the first of them; + `last_nonopt' is the index after the last of them. */ + +static int first_nonopt; +static int last_nonopt; + +#ifdef _LIBC +/* Bash 2.0 gives us an environment variable containing flags + indicating ARGV elements that should not be considered arguments. */ + +/* Defined in getopt_init.c */ +extern char *__getopt_nonoption_flags; + +static int nonoption_flags_max_len; +static int nonoption_flags_len; + +static int original_argc; +static char *const *original_argv; + +/* Make sure the environment variable bash 2.0 puts in the environment + is valid for the getopt call we must make sure that the ARGV passed + to getopt is that one passed to the process. */ +static void +__attribute__ ((unused)) +store_args_and_env (int argc, char *const *argv) +{ + /* XXX This is no good solution. We should rather copy the args so + that we can compare them later. But we must not use malloc(3). */ + original_argc = argc; + original_argv = argv; +} +# ifdef text_set_element +text_set_element (__libc_subinit, store_args_and_env); +# endif /* text_set_element */ + +# define SWAP_FLAGS(ch1, ch2) \ + if (nonoption_flags_len > 0) \ + { \ + char __tmp = __getopt_nonoption_flags[ch1]; \ + __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ + __getopt_nonoption_flags[ch2] = __tmp; \ + } +#else /* !_LIBC */ +# define SWAP_FLAGS(ch1, ch2) +#endif /* _LIBC */ + +/* Exchange two adjacent subsequences of ARGV. + One subsequence is elements [first_nonopt,last_nonopt) + which contains all the non-options that have been skipped so far. + The other is elements [last_nonopt,optind), which contains all + the options processed since those non-options were skipped. + + `first_nonopt' and `last_nonopt' are relocated so that they describe + the new indices of the non-options in ARGV after they are moved. */ + +#if defined __STDC__ && __STDC__ +static void exchange (char **); +#endif + +static void +exchange (argv) + char **argv; +{ + int bottom = first_nonopt; + int middle = last_nonopt; + int top = optind; + char *tem; + + /* Exchange the shorter segment with the far end of the longer segment. + That puts the shorter segment into the right place. + It leaves the longer segment in the right place overall, + but it consists of two parts that need to be swapped next. */ + +#ifdef _LIBC + /* First make sure the handling of the `__getopt_nonoption_flags' + string can work normally. Our top argument must be in the range + of the string. */ + if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) + { + /* We must extend the array. The user plays games with us and + presents new arguments. */ + char *new_str = malloc (top + 1); + if (new_str == NULL) + nonoption_flags_len = nonoption_flags_max_len = 0; + else + { + memset (__mempcpy (new_str, __getopt_nonoption_flags, + nonoption_flags_max_len), + '\0', top + 1 - nonoption_flags_max_len); + nonoption_flags_max_len = top + 1; + __getopt_nonoption_flags = new_str; + } + } +#endif + + while (top > middle && middle > bottom) + { + if (top - middle > middle - bottom) + { + /* Bottom segment is the short one. */ + int len = middle - bottom; + register int i; + + /* Swap it with the top part of the top segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[top - (middle - bottom) + i]; + argv[top - (middle - bottom) + i] = tem; + SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); + } + /* Exclude the moved bottom segment from further swapping. */ + top -= len; + } + else + { + /* Top segment is the short one. */ + int len = top - middle; + register int i; + + /* Swap it with the bottom part of the bottom segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[middle + i]; + argv[middle + i] = tem; + SWAP_FLAGS (bottom + i, middle + i); + } + /* Exclude the moved top segment from further swapping. */ + bottom += len; + } + } + + /* Update records for the slots the non-options now occupy. */ + + first_nonopt += (optind - last_nonopt); + last_nonopt = optind; +} + +/* Initialize the internal data when the first call is made. */ + +#if defined __STDC__ && __STDC__ +static const char *_getopt_initialize (int, char *const *, const char *); +#endif +static const char * +_getopt_initialize (argc, argv, optstring) + int argc; + char *const *argv; + const char *optstring; +{ + /* Start processing options with ARGV-element 1 (since ARGV-element 0 + is the program name); the sequence of previously skipped + non-option ARGV-elements is empty. */ + + first_nonopt = last_nonopt = optind; + + nextchar = NULL; + + posixly_correct = getenv ("POSIXLY_CORRECT"); + + /* Determine how to handle the ordering of options and nonoptions. */ + + if (optstring[0] == '-') + { + ordering = RETURN_IN_ORDER; + ++optstring; + } + else if (optstring[0] == '+') + { + ordering = REQUIRE_ORDER; + ++optstring; + } + else if (posixly_correct != NULL) + ordering = REQUIRE_ORDER; + else + ordering = PERMUTE; + +#ifdef _LIBC + if (posixly_correct == NULL + && argc == original_argc && argv == original_argv) + { + if (nonoption_flags_max_len == 0) + { + if (__getopt_nonoption_flags == NULL + || __getopt_nonoption_flags[0] == '\0') + nonoption_flags_max_len = -1; + else + { + const char *orig_str = __getopt_nonoption_flags; + int len = nonoption_flags_max_len = strlen (orig_str); + if (nonoption_flags_max_len < argc) + nonoption_flags_max_len = argc; + __getopt_nonoption_flags = + (char *) malloc (nonoption_flags_max_len); + if (__getopt_nonoption_flags == NULL) + nonoption_flags_max_len = -1; + else + memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), + '\0', nonoption_flags_max_len - len); + } + } + nonoption_flags_len = nonoption_flags_max_len; + } + else + nonoption_flags_len = 0; +#endif + + return optstring; +} + +/* Scan elements of ARGV (whose length is ARGC) for option characters + given in OPTSTRING. + + If an element of ARGV starts with '-', and is not exactly "-" or "--", + then it is an option element. The characters of this element + (aside from the initial '-') are option characters. If `getopt' + is called repeatedly, it returns successively each of the option characters + from each of the option elements. + + If `getopt' finds another option character, it returns that character, + updating `optind' and `nextchar' so that the next call to `getopt' can + resume the scan with the following option character or ARGV-element. + + If there are no more option characters, `getopt' returns -1. + Then `optind' is the index in ARGV of the first ARGV-element + that is not an option. (The ARGV-elements have been permuted + so that those that are not options now come last.) + + OPTSTRING is a string containing the legitimate option characters. + If an option character is seen that is not listed in OPTSTRING, + return '?' after printing an error message. If you set `opterr' to + zero, the error message is suppressed but we still return '?'. + + If a char in OPTSTRING is followed by a colon, that means it wants an arg, + so the following text in the same ARGV-element, or the text of the following + ARGV-element, is returned in `optarg'. Two colons mean an option that + wants an optional arg; if there is text in the current ARGV-element, + it is returned in `optarg', otherwise `optarg' is set to zero. + + If OPTSTRING starts with `-' or `+', it requests different methods of + handling the non-option ARGV-elements. + See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. + + Long-named options begin with `--' instead of `-'. + Their names may be abbreviated as long as the abbreviation is unique + or is an exact match for some defined option. If they have an + argument, it follows the option name in the same ARGV-element, separated + from the option name by a `=', or else the in next ARGV-element. + When `getopt' finds a long-named option, it returns 0 if that option's + `flag' field is nonzero, the value of the option's `val' field + if the `flag' field is zero. + + The elements of ARGV aren't really const, because we permute them. + But we pretend they're const in the prototype to be compatible + with other systems. + + LONGOPTS is a vector of `struct option' terminated by an + element containing a name which is zero. + + LONGIND returns the index in LONGOPT of the long-named option found. + It is only valid when a long-named option has been found by the most + recent call. + + If LONG_ONLY is nonzero, '-' as well as '--' can introduce + long-named options. */ + +int +_getopt_internal (argc, argv, optstring, longopts, longind, long_only) + int argc; + char *const *argv; + const char *optstring; + const struct option *longopts; + int *longind; + int long_only; +{ + optarg = NULL; + + if (optind == 0 || !__getopt_initialized) + { + if (optind == 0) + optind = 1; /* Don't scan ARGV[0], the program name. */ + optstring = _getopt_initialize (argc, argv, optstring); + __getopt_initialized = 1; + } + + /* Test whether ARGV[optind] points to a non-option argument. + Either it does not have option syntax, or there is an environment flag + from the shell indicating it is not an option. The later information + is only used when the used in the GNU libc. */ +#ifdef _LIBC +# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ + || (optind < nonoption_flags_len \ + && __getopt_nonoption_flags[optind] == '1')) +#else +# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') +#endif + + if (nextchar == NULL || *nextchar == '\0') + { + /* Advance to the next ARGV-element. */ + + /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been + moved back by the user (who may also have changed the arguments). */ + if (last_nonopt > optind) + last_nonopt = optind; + if (first_nonopt > optind) + first_nonopt = optind; + + if (ordering == PERMUTE) + { + /* If we have just processed some options following some non-options, + exchange them so that the options come first. */ + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange ((char **) argv); + else if (last_nonopt != optind) + first_nonopt = optind; + + /* Skip any additional non-options + and extend the range of non-options previously skipped. */ + + while (optind < argc && NONOPTION_P) + optind++; + last_nonopt = optind; + } + + /* The special ARGV-element `--' means premature end of options. + Skip it like a null option, + then exchange with previous non-options as if it were an option, + then skip everything else like a non-option. */ + + if (optind != argc && !strcmp (argv[optind], "--")) + { + optind++; + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange ((char **) argv); + else if (first_nonopt == last_nonopt) + first_nonopt = optind; + last_nonopt = argc; + + optind = argc; + } + + /* If we have done all the ARGV-elements, stop the scan + and back over any non-options that we skipped and permuted. */ + + if (optind == argc) + { + /* Set the next-arg-index to point at the non-options + that we previously skipped, so the caller will digest them. */ + if (first_nonopt != last_nonopt) + optind = first_nonopt; + return -1; + } + + /* If we have come to a non-option and did not permute it, + either stop the scan or describe it to the caller and pass it by. */ + + if (NONOPTION_P) + { + if (ordering == REQUIRE_ORDER) + return -1; + optarg = argv[optind++]; + return 1; + } + + /* We have found another option-ARGV-element. + Skip the initial punctuation. */ + + nextchar = (argv[optind] + 1 + + (longopts != NULL && argv[optind][1] == '-')); + } + + /* Decode the current option-ARGV-element. */ + + /* Check whether the ARGV-element is a long option. + + If long_only and the ARGV-element has the form "-f", where f is + a valid short option, don't consider it an abbreviated form of + a long option that starts with f. Otherwise there would be no + way to give the -f short option. + + On the other hand, if there's a long option "fubar" and + the ARGV-element is "-fu", do consider that an abbreviation of + the long option, just like "--fu", and not "-f" with arg "u". + + This distinction seems to be the most useful approach. */ + + if (longopts != NULL + && (argv[optind][1] == '-' + || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) + { + char *nameend; + const struct option *p; + const struct option *pfound = NULL; + int exact = 0; + int ambig = 0; + int indfound = -1; + int option_index; + + for (nameend = nextchar; *nameend && *nameend != '='; nameend++) + /* Do nothing. */ ; + + /* Test all long options for either exact match + or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; p++, option_index++) + if (!strncmp (p->name, nextchar, nameend - nextchar)) + { + if ((unsigned int) (nameend - nextchar) + == (unsigned int) strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else + /* Second or later nonexact match found. */ + ambig = 1; + } + + if (ambig && !exact) + { + if (opterr) + fprintf (stderr, _("%s: option `%s' is ambiguous\n"), + argv[0], argv[optind]); + nextchar += strlen (nextchar); + optind++; + optopt = 0; + return '?'; + } + + if (pfound != NULL) + { + option_index = indfound; + optind++; + if (*nameend) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + optarg = nameend + 1; + else + { + if (opterr) + { + if (argv[optind - 1][1] == '-') + /* --option */ + fprintf (stderr, + _("%s: option `--%s' doesn't allow an argument\n"), + argv[0], pfound->name); + else + /* +option or -option */ + fprintf (stderr, + _("%s: option `%c%s' doesn't allow an argument\n"), + argv[0], argv[optind - 1][0], pfound->name); + } + + nextchar += strlen (nextchar); + + optopt = pfound->val; + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (optind < argc) + optarg = argv[optind++]; + else + { + if (opterr) + fprintf (stderr, + _("%s: option `%s' requires an argument\n"), + argv[0], argv[optind - 1]); + nextchar += strlen (nextchar); + optopt = pfound->val; + return optstring[0] == ':' ? ':' : '?'; + } + } + nextchar += strlen (nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + + /* Can't find it as a long option. If this is not getopt_long_only, + or the option starts with '--' or is not a valid short + option, then it's an error. + Otherwise interpret it as a short option. */ + if (!long_only || argv[optind][1] == '-' + || my_index (optstring, *nextchar) == NULL) + { + if (opterr) + { + if (argv[optind][1] == '-') + /* --option */ + fprintf (stderr, _("%s: unrecognized option `--%s'\n"), + argv[0], nextchar); + else + /* +option or -option */ + fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), + argv[0], argv[optind][0], nextchar); + } + nextchar = (char *) ""; + optind++; + optopt = 0; + return '?'; + } + } + + /* Look at and handle the next short option-character. */ + + { + char c = *nextchar++; + char *temp = my_index (optstring, c); + + /* Increment `optind' when we start to process its last character. */ + if (*nextchar == '\0') + ++optind; + + if (temp == NULL || c == ':') + { + if (opterr) + { + if (posixly_correct) + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, _("%s: illegal option -- %c\n"), + argv[0], c); + else + fprintf (stderr, _("%s: invalid option -- %c\n"), + argv[0], c); + } + optopt = c; + return '?'; + } + /* Convenience. Treat POSIX -W foo same as long option --foo */ + if (temp[0] == 'W' && temp[1] == ';') + { + char *nameend; + const struct option *p; + const struct option *pfound = NULL; + int exact = 0; + int ambig = 0; + int indfound = 0; + int option_index; + + /* This is an option that requires an argument. */ + if (*nextchar != '\0') + { + optarg = nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + optind++; + } + else if (optind == argc) + { + if (opterr) + { + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, _("%s: option requires an argument -- %c\n"), + argv[0], c); + } + optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + return c; + } + else + /* We already incremented `optind' once; + increment it again when taking next ARGV-elt as argument. */ + optarg = argv[optind++]; + + /* optarg is now the argument, see if it's in the + table of longopts. */ + + for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) + /* Do nothing. */ ; + + /* Test all long options for either exact match + or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; p++, option_index++) + if (!strncmp (p->name, nextchar, nameend - nextchar)) + { + if ((unsigned int) (nameend - nextchar) == strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else + /* Second or later nonexact match found. */ + ambig = 1; + } + if (ambig && !exact) + { + if (opterr) + fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), + argv[0], argv[optind]); + nextchar += strlen (nextchar); + optind++; + return '?'; + } + if (pfound != NULL) + { + option_index = indfound; + if (*nameend) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + optarg = nameend + 1; + else + { + if (opterr) + fprintf (stderr, _("\ +%s: option `-W %s' doesn't allow an argument\n"), + argv[0], pfound->name); + + nextchar += strlen (nextchar); + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (optind < argc) + optarg = argv[optind++]; + else + { + if (opterr) + fprintf (stderr, + _("%s: option `%s' requires an argument\n"), + argv[0], argv[optind - 1]); + nextchar += strlen (nextchar); + return optstring[0] == ':' ? ':' : '?'; + } + } + nextchar += strlen (nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + nextchar = NULL; + return 'W'; /* Let the application handle it. */ + } + if (temp[1] == ':') + { + if (temp[2] == ':') + { + /* This is an option that accepts an argument optionally. */ + if (*nextchar != '\0') + { + optarg = nextchar; + optind++; + } + else + optarg = NULL; + nextchar = NULL; + } + else + { + /* This is an option that requires an argument. */ + if (*nextchar != '\0') + { + optarg = nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + optind++; + } + else if (optind == argc) + { + if (opterr) + { + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, + _("%s: option requires an argument -- %c\n"), + argv[0], c); + } + optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + } + else + /* We already incremented `optind' once; + increment it again when taking next ARGV-elt as argument. */ + optarg = argv[optind++]; + nextchar = NULL; + } + } + return c; + } +} + +int +getopt (argc, argv, optstring) + int argc; + char *const *argv; + const char *optstring; +{ + return _getopt_internal (argc, argv, optstring, + (const struct option *) 0, + (int *) 0, + 0); +} + +#endif /* Not ELIDE_CODE. */ + +#ifdef TEST + +/* Compile with -DTEST to make an executable for use in testing + the above definition of `getopt'. */ + +int +main (argc, argv) + int argc; + char **argv; +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + + c = getopt (argc, argv, "abc:d:0123456789"); + if (c == -1) + break; + + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_optind != 0 && digit_optind != this_option_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_optind = this_option_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value `%s'\n", optarg); + break; + + case '?': + break; + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */ diff --git a/win32/getopt1.c b/win32/getopt1.c new file mode 100644 index 0000000..dee6325 --- /dev/null +++ b/win32/getopt1.c @@ -0,0 +1,188 @@ +/* getopt_long and getopt_long_only entry points for GNU getopt. + Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "getopt_win.h" + +#if !defined __STDC__ || !__STDC__ +/* This is a separate conditional since some stdc systems + reject `defined (const)'. */ +#ifndef const +#define const +#endif +#endif + +#include + +/* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself. This code is part of the GNU C + Library, but also included in many other GNU distributions. Compiling + and linking in this code is a waste when using the GNU C library + (especially if it is a shared library). Rather than having every GNU + program understand `configure --with-gnu-libc' and omit the object files, + it is simpler to just do this in the source for each such file. */ + +#define GETOPT_INTERFACE_VERSION 2 +#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 +#include +#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION +#define ELIDE_CODE +#endif +#endif + +#ifndef ELIDE_CODE + + +/* This needs to come after some library #include + to get __GNU_LIBRARY__ defined. */ +#ifdef __GNU_LIBRARY__ +#include +#endif + +#ifndef NULL +#define NULL 0 +#endif + +int +getopt_long (argc, argv, options, long_options, opt_index) + int argc; + char *const *argv; + const char *options; + const struct option *long_options; + int *opt_index; +{ + return _getopt_internal (argc, argv, options, long_options, opt_index, 0); +} + +/* Like getopt_long, but '-' as well as '--' can indicate a long option. + If an option that starts with '-' (not '--') doesn't match a long option, + but does match a short option, it is parsed as a short option + instead. */ + +int +getopt_long_only (argc, argv, options, long_options, opt_index) + int argc; + char *const *argv; + const char *options; + const struct option *long_options; + int *opt_index; +{ + return _getopt_internal (argc, argv, options, long_options, opt_index, 1); +} + + +#endif /* Not ELIDE_CODE. */ + +#ifdef TEST + +#include + +int +main (argc, argv) + int argc; + char **argv; +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + int option_index = 0; + static struct option long_options[] = + { + {"add", 1, 0, 0}, + {"append", 0, 0, 0}, + {"delete", 1, 0, 0}, + {"verbose", 0, 0, 0}, + {"create", 0, 0, 0}, + {"file", 1, 0, 0}, + {0, 0, 0, 0} + }; + + c = getopt_long (argc, argv, "abc:d:0123456789", + long_options, &option_index); + if (c == -1) + break; + + switch (c) + { + case 0: + printf ("option %s", long_options[option_index].name); + if (optarg) + printf (" with arg %s", optarg); + printf ("\n"); + break; + + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_optind != 0 && digit_optind != this_option_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_optind = this_option_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value `%s'\n", optarg); + break; + + case 'd': + printf ("option d with value `%s'\n", optarg); + break; + + case '?': + break; + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */ diff --git a/win32/getopt_win.h b/win32/getopt_win.h new file mode 100644 index 0000000..b0147e9 --- /dev/null +++ b/win32/getopt_win.h @@ -0,0 +1,169 @@ +/* Declarations for getopt. + Copyright (C) 1989,90,91,92,93,94,96,97,98 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _GETOPT_H + +#ifndef __need_getopt +# define _GETOPT_H 1 +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +extern char *optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns -1, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +extern int optind; + +/* Callers store zero here to inhibit the error message `getopt' prints + for unrecognized options. */ + +extern int opterr; + +/* Set to an option character which was unrecognized. */ + +extern int optopt; + +#ifndef __need_getopt +/* Describe the long-named options requested by the application. + The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector + of `struct option' terminated by an element containing a name which is + zero. + + The field `has_arg' is: + no_argument (or 0) if the option does not take an argument, + required_argument (or 1) if the option requires an argument, + optional_argument (or 2) if the option takes an optional argument. + + If the field `flag' is not NULL, it points to a variable that is set + to the value given in the field `val' when the option is found, but + left unchanged if the option is not found. + + To have a long-named option do something other than set an `int' to + a compiled-in constant, such as set a value from `optarg', set the + option's `flag' field to zero and its `val' field to a nonzero + value (the equivalent single-letter option character, if there is + one). For long options that have a zero `flag' field, `getopt' + returns the contents of the `val' field. */ + +struct option +{ +# if defined __STDC__ && __STDC__ + const char *name; +# else + char *name; +# endif + /* has_arg can't be an enum because some compilers complain about + type mismatches in all the code that assumes it is an int. */ + int has_arg; + int *flag; + int val; +}; + +/* Names for the values of the `has_arg' field of `struct option'. */ + +# define no_argument 0 +# define required_argument 1 +# define optional_argument 2 +#endif /* need getopt */ + + +/* Get definitions and prototypes for functions to process the + arguments in ARGV (ARGC of them, minus the program name) for + options given in OPTS. + + Return the option character from OPTS just read. Return -1 when + there are no more options. For unrecognized options, or options + missing arguments, `optopt' is set to the option letter, and '?' is + returned. + + The OPTS string is a list of characters which are recognized option + letters, optionally followed by colons, specifying that that letter + takes an argument, to be placed in `optarg'. + + If a letter in OPTS is followed by two colons, its argument is + optional. This behavior is specific to the GNU `getopt'. + + The argument `--' causes premature termination of argument + scanning, explicitly telling `getopt' that there are no more + options. + + If OPTS begins with `--', then non-option arguments are treated as + arguments to the option '\0'. This behavior is specific to the GNU + `getopt'. */ + +#if defined __STDC__ && __STDC__ +# ifdef __GNU_LIBRARY__ +/* Many other libraries have conflicting prototypes for getopt, with + differences in the consts, in stdlib.h. To avoid compilation + errors, only prototype getopt for the GNU C library. */ +extern int getopt (int __argc, char *const *__argv, const char *__shortopts); +# else /* not __GNU_LIBRARY__ */ +extern int getopt (); +# endif /* __GNU_LIBRARY__ */ + +# ifndef __need_getopt +extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts, + const struct option *__longopts, int *__longind); +extern int getopt_long_only (int __argc, char *const *__argv, + const char *__shortopts, + const struct option *__longopts, int *__longind); + +/* Internal only. Users should not call this directly. */ +extern int _getopt_internal (int __argc, char *const *__argv, + const char *__shortopts, + const struct option *__longopts, int *__longind, + int __long_only); +# endif +#else /* not __STDC__ */ +extern int getopt (); +# ifndef __need_getopt +extern int getopt_long (); +extern int getopt_long_only (); + +extern int _getopt_internal (); +# endif +#endif /* __STDC__ */ + +#ifdef __cplusplus +} +#endif + +/* Make sure we later can get all the definitions and declarations. */ +#undef __need_getopt + +#endif /* getopt.h */ diff --git a/win32/theora_static.dsp b/win32/theora_static.dsp new file mode 100644 index 0000000..f794e10 --- /dev/null +++ b/win32/theora_static.dsp @@ -0,0 +1,336 @@ +# Microsoft Developer Studio Project File - Name="theora_static" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=theora_static - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "theora_static.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "theora_static.mak" CFG="theora_static - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "theora_static - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "theora_static - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "theora_static - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Static_Release" +# PROP Intermediate_Dir "Static_Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\ogg\include" /I "..\..\theora\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "theora_static - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Static_Debug" +# PROP Intermediate_Dir "Static_Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\ogg\include" /I "..\..\theora\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"Static_Debug\theora_static_d.lib" + +!ENDIF + +# Begin Target + +# Name "theora_static - Win32 Release" +# Name "theora_static - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\lib\enc\dct.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\dct_decode.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\dct_encode.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\dct_encode.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\encapiwrapper.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\encode.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\encoder_huffman.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\encoder_idct.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\encoder_toplevel.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\encoder_quant.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\frarray.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\frinit.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\mathops.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\mcenc.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\mode.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\reconstruct.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\x86_32_vs\dsp_mmx.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\x86_32_vs\fdct_mmx.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\x86_32_vs\recon_mmx.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\apiwrapper.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\bitpack.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\decapiwrapper.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\decinfo.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\decode.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\dequant.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\fragment.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\huffdec.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\idct.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\info.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\internal.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\quant.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\state.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\x86_vc\mmxfrag.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\x86_vc\mmxidct.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\x86_vc\mmxloopfilter.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\x86_vc\mmxstate.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\x86_vc\x86stat.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\lib\dec\apiwrapper.h +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\block_inline.h +# End Source File +# Begin Source File + +SOURCE=..\include\theora\codec.h +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\codec_internal.h +# End Source File +# Begin Source File + +SOURCE=..\lib\cpu.h +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\dct.h +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\decint.h +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\dequant.h +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\dsp.h +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\encoder_huffman.h +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\encoder_lookup.h +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\enquant.h +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\huffdec.h +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\huffman.h +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\hufftables.h +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\idct.h +# End Source File +# Begin Source File + +SOURCE=..\lib\internal.h +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\ocintrin.h +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\pp.h +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\quant.h +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\quant_lookup.h +# End Source File +# Begin Source File + +SOURCE=..\include\theora\theora.h +# End Source File +# Begin Source File + +SOURCE=..\include\theora\theoradec.h +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\toplevel_lookup.h +# End Source File +# End Group +# End Target +# End Project diff --git a/win32/xmingw32/Makefile b/win32/xmingw32/Makefile new file mode 100644 index 0000000..cf016d4 --- /dev/null +++ b/win32/xmingw32/Makefile @@ -0,0 +1,393 @@ +# NOTE: This Makefile requires GNU make +# Location to put the targets. +TARGETBINDIR = . +TARGETLIBDIR = . +# DLL version information. Currently this must be updated manually. +# Fields are: major, minor, build number, QFE version +VERSION_FIELD = 1,0,0,0 +VERSION_STRING = \\\"1.0\\\" +# Name of the targets +# Hooray for Windows DLL hell. +LIBTHEORAENC_TARGET = libtheoraenc.dll +LIBTHEORAENCD_TARGET = libtheoraencd.dll +LIBTHEORAENC70_TARGET = libtheoraenc70.dll +LIBTHEORAENC70D_TARGET = libtheoraenc70d.dll +LIBTHEORAENC71_TARGET = libtheoraenc71.dll +LIBTHEORAENC71D_TARGET = libtheoraenc71d.dll +LIBTHEORAENC80_TARGET = libtheoraenc80.dll +LIBTHEORAENC80D_TARGET = libtheoraenc80d.dll + +LIBTHEORADEC_TARGET = libtheoradec.dll +LIBTHEORADECD_TARGET = libtheoradecd.dll +LIBTHEORADEC70_TARGET = libtheoradec70.dll +LIBTHEORADEC70D_TARGET = libtheoradec70d.dll +LIBTHEORADEC71_TARGET = libtheoradec71.dll +LIBTHEORADEC71D_TARGET = libtheoradec71d.dll +LIBTHEORADEC80_TARGET = libtheoradec80.dll +LIBTHEORADEC80D_TARGET = libtheoradec80d.dll + +DUMP_VIDEO_TARGET = dump_video.exe +PLAYER_EXAMPLE_TARGET = player_example.exe +ENCODER_EXAMPLE_TARGET = encoder_example.exe + +# The compiler tools to use +# The is no standard mingw prefix, so try to guess +MINGW_PREFIX := $(or $(strip $(foreach exeprefix, \ + i686-mingw32 i686-pc-mingw32 i586-mingw32msvc i386-mingw32 \ + no-mingw32, \ + $(if $(shell which $(exeprefix)-gcc 2>/dev/null), $(exeprefix) )))) +CC = $(MINGW_PREFIX)-gcc +RC = $(MINGW_PREFIX)-windres +DLLTOOL = $(MINGW_PREFIX)-dlltool +LD = $(MINGW_PREFIX)-ld +SDLCONFIG = $(MINGW_PREFIX)-sdl-config +# The command to use to generate dependency information +MAKEDEPEND = ${CC} -MM +#MAKEDEPEND = makedepend -f- -Y -- + +# The location of include files. +# Modify these to point to your Ogg and Vorbis include directories if they are +# not installed in a standard location. +CINCLUDE = -D_REENTRANT +# Extra compilation flags. +# You may get speed increases by including flags such as -O2 or -O3 or +# -ffast-math, or additional flags, depending on your system and compiler. +# The correct -march= flag will also generate much better code +# on newer architectures. +CFLAGS = -Wall -Wno-parentheses -DOC_X86_ASM +RELEASE_CFLAGS = ${CFLAGS} -mtune=native -O3 -fomit-frame-pointer -fforce-addr \ + -finline-functions +# The -g flag will generally include debugging information. +DEBUG_CFLAGS = ${CFLAGS} -g +# Libraries to link with, and the location of library files. +LIBS = -logg -lvorbis -lvorbisenc + +# ANYTHING BELOW THIS LINE PROBABLY DOES NOT NEED EDITING +CINCLUDE := -I../../include ${CINCLUDE} +LIBSRCDIR = ../../lib +BINSRCDIR = ../../examples +WORKDIR = objs + +# C source file lists + +LIBTHEORADEC_CSOURCES = \ +apiwrapper.c \ +bitpack.c \ +decapiwrapper.c \ +decinfo.c \ +decode.c \ +dequant.c \ +fragment.c \ +huffdec.c \ +idct.c \ +info.c \ +internal.c \ +quant.c \ +state.c \ +$(if $(findstring -DOC_X86_ASM,${CFLAGS}), \ +x86/mmxidct.c \ +x86/mmxfrag.c \ +x86/mmxstate.c \ +x86/x86state.c \ +) + +LIBTHEORAENC_CSOURCES = \ +apiwrapper.c \ +fragment.c \ +idct.c \ +internal.c \ +state.c \ +quant.c \ +analyze.c \ +fdct.c \ +encfrag.c \ +encapiwrapper.c \ +encinfo.c \ +encode.c \ +enquant.c \ +huffenc.c \ +mathops.c \ +mcenc.c \ +rate.c \ +tokenize.c \ +$(if $(findstring -DOC_X86_ASM,${CFLAGS}), \ +x86/mmxfrag.c \ +x86/mmxidct.c \ +x86/mmxstate.c \ +x86/x86state.c \ +x86/mmxencfrag.c \ +x86/mmxfdct.c \ +x86/x86enc.c \ +) + + +DUMP_VIDEO_CSOURCES = dump_video.c +ENCODER_EXAMPLE_CSOURCES = encoder_example.c +PLAYER_EXAMPLE_CSOURCES = player_example.c + +# Create object file list. +LIBTHEORADEC_OBJS:= ${LIBTHEORADEC_CSOURCES:%.c=${WORKDIR}/%.o} +LIBTHEORADECD_OBJS:= ${LIBTHEORADEC_CSOURCES:%.c=${WORKDIR}/%.do} +LIBTHEORAENC_OBJS:= ${LIBTHEORAENC_CSOURCES:%.c=${WORKDIR}/%.o} +LIBTHEORAENCD_OBJS:= ${LIBTHEORAENC_CSOURCES:%.c=${WORKDIR}/%.do} +DUMP_VIDEO_OBJS:= ${DUMP_VIDEO_CSOURCES:%.c=${WORKDIR}/%.o} +ENCODER_EXAMPLE_OBJS:= ${ENCODER_EXAMPLE_CSOURCES:%.c=${WORKDIR}/%.o} +PLAYER_EXAMPLE_OBJS:= ${PLAYER_EXAMPLE_CSOURCES:%.c=${WORKDIR}/%.o} +RC_OBJS:= ${LIBTHEORADEC_TARGET} ${LIBTHEORAENC_TARGET} \ + ${LIBTHEORADECD_TARGET} ${LIBTHEORAENCD_TARGET} \ + ${LIBTHEORADEC70_TARGET} ${LIBTHEORAENC70_TARGET} \ + ${LIBTHEORADEC70D_TARGET} ${LIBTHEORAENC70D_TARGET} \ + ${LIBTHEORADEC71_TARGET} ${LIBTHEORAENC71_TARGET} \ + ${LIBTHEORADEC71D_TARGET} ${LIBTHEORAENC71D_TARGET} \ + ${LIBTHEORADEC80_TARGET} ${LIBTHEORAENC80_TARGET} \ + ${LIBTHEORADEC80D_TARGET} ${LIBTHEORAENC80D_TARGET} +RC_OBJS:= ${RC_OBJS:%.dll=${WORKDIR}/%.rco} +ALL_OBJS:= ${LIBTHEORADEC_OBJS} ${LIBTHEORAENC_OBJS} \ + ${LIBTHEORADECD_OBJS} ${LIBTHEORAENCD_OBJS} ${RC_OBJS} \ + ${DUMP_VIDEO_OBJS} ${ENCODER_EXAMPLE_OBJS} #${PLAYER_EXAMPLE_OBJS} +# Create the dependency file list +ALL_DEPS:= ${ALL_OBJS:%.o=%.d} +ALL_DEPS:= ${ALL_DEPS:%.do=%.dd} +ALL_DEPS:= ${ALL_DEPS:%.rco=%.d} +# Prepend source path to file names. +LIBTHEORADEC_CSOURCES:= ${LIBTHEORADEC_CSOURCES:%=${LIBSRCDIR}/%} +LIBTHEORAENC_CSOURCES:= ${LIBTHEORAENC_CSOURCES:%=${LIBSRCDIR}/%} +DUMP_VIDEO_CSOURCES:= ${DUMP_VIDEO_CSOURCES:%=${BINSRCDIR}/%} +ENCODER_EXAMPLE_CSOURCES:= ${ENCODER_EXAMPLE_CSOURCES:%=${BINSRCDIR}/%} +PLAYER_EXAMPLE_CSOURCES:= ${PLAYER_EXAMPLE_CSOURCES:%=${BINSRCDIR}/%} +ALL_CSOURCES:= ${LIBTHEORADEC_CSOURCES} ${LIBTHEORAENC_CSOURCES} \ + ${DUMP_VIDEO_CSOURCES} ${PLAYER_EXAMPLE_CSOURCES} \ + ${ENCODER_EXAMPLE_CSOURCES} +LIBTHEORAENC_RCO:= ${WORKDIR}/${LIBTHEORAENC_TARGET:%.dll=%.rco} +LIBTHEORAENCD_RCO:= ${WORKDIR}/${LIBTHEORAENCD_TARGET:%.dll=%.rco} +LIBTHEORAENC70_RCO:= ${WORKDIR}/${LIBTHEORAENC70_TARGET:%.dll=%.rco} +LIBTHEORAENC70D_RCO:= ${WORKDIR}/${LIBTHEORAENC70D_TARGET:%.dll=%.rco} +LIBTHEORAENC71_RCO:= ${WORKDIR}/${LIBTHEORAENC71_TARGET:%.dll=%.rco} +LIBTHEORAENC71D_RCO:= ${WORKDIR}/${LIBTHEORAENC71D_TARGET:%.dll=%.rco} +LIBTHEORAENC80_RCO:= ${WORKDIR}/${LIBTHEORAENC80_TARGET:%.dll=%.rco} +LIBTHEORAENC80D_RCO:= ${WORKDIR}/${LIBTHEORAENC80D_TARGET:%.dll=%.rco} +LIBTHEORADEC_RCO:= ${WORKDIR}/${LIBTHEORADEC_TARGET:%.dll=%.rco} +LIBTHEORADECD_RCO:= ${WORKDIR}/${LIBTHEORADECD_TARGET:%.dll=%.rco} +LIBTHEORADEC70_RCO:= ${WORKDIR}/${LIBTHEORADEC70_TARGET:%.dll=%.rco} +LIBTHEORADEC70D_RCO:= ${WORKDIR}/${LIBTHEORADEC70D_TARGET:%.dll=%.rco} +LIBTHEORADEC71_RCO:= ${WORKDIR}/${LIBTHEORADEC71_TARGET:%.dll=%.rco} +LIBTHEORADEC71D_RCO:= ${WORKDIR}/${LIBTHEORADEC71D_TARGET:%.dll=%.rco} +LIBTHEORADEC80_RCO:= ${WORKDIR}/${LIBTHEORADEC80_TARGET:%.dll=%.rco} +LIBTHEORADEC80D_RCO:= ${WORKDIR}/${LIBTHEORADEC80D_TARGET:%.dll=%.rco} +# Prepand target path to file names. +LIBTHEORAENC_TARGET:= ${TARGETLIBDIR}/${LIBTHEORAENC_TARGET} +LIBTHEORAENCD_TARGET:= ${TARGETLIBDIR}/${LIBTHEORAENCD_TARGET} +LIBTHEORAENC70_TARGET:= ${TARGETLIBDIR}/${LIBTHEORAENC70_TARGET} +LIBTHEORAENC70D_TARGET:= ${TARGETLIBDIR}/${LIBTHEORAENC70D_TARGET} +LIBTHEORAENC71_TARGET:= ${TARGETLIBDIR}/${LIBTHEORAENC71_TARGET} +LIBTHEORAENC71D_TARGET:= ${TARGETLIBDIR}/${LIBTHEORAENC71D_TARGET} +LIBTHEORAENC80_TARGET:= ${TARGETLIBDIR}/${LIBTHEORAENC80_TARGET} +LIBTHEORAENC80D_TARGET:= ${TARGETLIBDIR}/${LIBTHEORAENC80D_TARGET} +LIBTHEORADEC_TARGET:= ${TARGETLIBDIR}/${LIBTHEORADEC_TARGET} +LIBTHEORADECD_TARGET:= ${TARGETLIBDIR}/${LIBTHEORADECD_TARGET} +LIBTHEORADEC70_TARGET:= ${TARGETLIBDIR}/${LIBTHEORADEC70_TARGET} +LIBTHEORADEC70D_TARGET:= ${TARGETLIBDIR}/${LIBTHEORADEC70D_TARGET} +LIBTHEORADEC71_TARGET:= ${TARGETLIBDIR}/${LIBTHEORADEC71_TARGET} +LIBTHEORADEC71D_TARGET:= ${TARGETLIBDIR}/${LIBTHEORADEC71D_TARGET} +LIBTHEORADEC80_TARGET:= ${TARGETLIBDIR}/${LIBTHEORADEC80_TARGET} +LIBTHEORADEC80D_TARGET:= ${TARGETLIBDIR}/${LIBTHEORADEC80D_TARGET} +DUMP_VIDEO_TARGET:= ${TARGETBINDIR}/${DUMP_VIDEO_TARGET} +ENCODER_EXAMPLE_TARGET:= ${TARGETBINDIR}/${ENCODER_EXAMPLE_TARGET} +PLAYER_EXAMPLE_TARGET:= ${TARGETBINDIR}/${PLAYER_EXAMPLE_TARGET} +DLL_TARGETS:= ${LIBTHEORADEC_TARGET} ${LIBTHEORAENC_TARGET} \ + ${LIBTHEORADECD_TARGET} ${LIBTHEORAENCD_TARGET} \ + ${LIBTHEORADEC70_TARGET} ${LIBTHEORAENC70_TARGET} \ + ${LIBTHEORADEC70D_TARGET} ${LIBTHEORAENC70D_TARGET} \ + ${LIBTHEORADEC71_TARGET} ${LIBTHEORAENC71_TARGET} \ + ${LIBTHEORADEC71D_TARGET} ${LIBTHEORAENC71D_TARGET} \ + ${LIBTHEORADEC80_TARGET} ${LIBTHEORAENC80_TARGET} \ + ${LIBTHEORADEC80D_TARGET} ${LIBTHEORAENC80D_TARGET} +ALL_TARGETS:= ${DLL_TARGETS} ${DLL_TARGETS:%.dll=%.dll.a} \ + ${DUMP_VIDEO_TARGET} ${ENCODER_EXAMPLE_TARGET} #${PLAYER_EXAMPLE_TARGET} +IMPLIB_TARGETS:= ${DLL_TARGETS:%.dll=%.def} ${DLL_TARGETS:%.dll=%.lib} \ + ${DLL_TARGETS:%.dll=%.exp} + +# Targets: +# Everything (default) +all: ${ALL_TARGETS} + +# These require Microsoft's lib.exe to build, and so are not made by default. +implibs: ${IMPLIB_TARGETS} + +# libtheoradec +${LIBTHEORADEC_TARGET}: ${LIBTHEORADEC_OBJS} ${LIBTHEORADEC_RCO} \ + libtheoradec-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ ${LIBTHEORADEC_OBJS} -logg -lmsvcrt \ + ${LIBTHEORADEC_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoradec-all.def +${LIBTHEORADECD_TARGET}: ${LIBTHEORADECD_OBJS} ${LIBTHEORADECD_RCO} \ + libtheoradec-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ ${LIBTHEORADECD_OBJS} -logg -lmsvcrtd \ + ${LIBTHEORADECD_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoradec-all.def +${LIBTHEORADEC70_TARGET}: ${LIBTHEORADEC_OBJS} ${LIBTHEORADEC70_RCO} \ + libtheoradec-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ ${LIBTHEORADEC_OBJS} -logg -lmsvcr70 \ + ${LIBTHEORADEC70_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoradec-all.def +${LIBTHEORADEC70D_TARGET}: ${LIBTHEORADECD_OBJS} ${LIBTHEORADEC70D_RCO} \ + libtheoradec-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ ${LIBTHEORADECD_OBJS} -logg -lmsvcr70d \ + ${LIBTHEORADEC70D_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoradec-all.def +${LIBTHEORADEC71_TARGET}: ${LIBTHEORADEC_OBJS} ${LIBTHEORADEC71_RCO} \ + libtheoradec-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ ${LIBTHEORADEC_OBJS} -logg -lmsvcr71 \ + ${LIBTHEORADEC71_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoradec-all.def +${LIBTHEORADEC71D_TARGET}: ${LIBTHEORADECD_OBJS} ${LIBTHEORADEC71D_RCO} \ + libtheoradec-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ ${LIBTHEORADECD_OBJS} -logg -lmsvcr71d \ + ${LIBTHEORADEC71D_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoradec-all.def +${LIBTHEORADEC80_TARGET}: ${LIBTHEORADEC_OBJS} ${LIBTHEORADEC80_RCO} \ + libtheoradec-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ ${LIBTHEORADEC_OBJS} -logg -lmsvcr80 \ + ${LIBTHEORADEC80_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoradec-all.def +${LIBTHEORADEC80D_TARGET}: ${LIBTHEORADECD_OBJS} ${LIBTHEORADEC80D_RCO} \ + libtheoradec-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ ${LIBTHEORADECD_OBJS} -logg -lmsvcr80d \ + ${LIBTHEORADEC80D_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoradec-all.def + +# libtheoraenc +${LIBTHEORAENC_TARGET}: ${LIBTHEORAENC_OBJS} ${LIBTHEORAENC_RCO} \ + libtheoraenc-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ \ + ${LIBTHEORAENC_OBJS} ${LIBTHEORADEC_TARGET} -logg -lmsvcrt \ + ${LIBTHEORAENC_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoraenc-all.def +${LIBTHEORAENCD_TARGET}: ${LIBTHEORAENCD_OBJS} ${LIBTHEORAENCD_RCO} \ + libtheoraenc-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ \ + ${LIBTHEORAENCD_OBJS} ${LIBTHEORADECD_TARGET} -logg -lmsvcrtd \ + ${LIBTHEORAENCD_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoraenc-all.def +${LIBTHEORAENC70_TARGET}: ${LIBTHEORAENC_OBJS} ${LIBTHEORAENC70_RCO} \ + libtheoraenc-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ \ + ${LIBTHEORAENC_OBJS} ${LIBTHEORADEC70_TARGET} -logg -lmsvcr70 \ + ${LIBTHEORAENC70_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoraenc-all.def +${LIBTHEORAENC70D_TARGET}: ${LIBTHEORAENCD_OBJS} ${LIBTHEORAENC70D_RCO} \ + libtheoraenc-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ \ + ${LIBTHEORAENCD_OBJS} ${LIBTHEORADEC70D_TARGET} -logg -lmsvcr70d \ + ${LIBTHEORAENC70D_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoraenc-all.def +${LIBTHEORAENC71_TARGET}: ${LIBTHEORAENC_OBJS} ${LIBTHEORAENC71_RCO} \ + libtheoraenc-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ \ + ${LIBTHEORAENC_OBJS} ${LIBTHEORADEC71_TARGET} -logg -lmsvcr71 \ + ${LIBTHEORAENC71_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoraenc-all.def +${LIBTHEORAENC71D_TARGET}: ${LIBTHEORAENCD_OBJS} ${LIBTHEORAENC71D_RCO} \ + libtheoraenc-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ \ + ${LIBTHEORAENCD_OBJS} ${LIBTHEORADEC71D_TARGET} -logg -lmsvcr71d \ + ${LIBTHEORAENC71D_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoraenc-all.def +${LIBTHEORAENC80_TARGET}: ${LIBTHEORAENC_OBJS} ${LIBTHEORAENC80_RCO} \ + libtheoraenc-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ \ + ${LIBTHEORAENC_OBJS} ${LIBTHEORADEC80_TARGET} -logg -lmsvcr80 \ + ${LIBTHEORAENC80_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoraenc-all.def +${LIBTHEORAENC80D_TARGET}: ${LIBTHEORAENCD_OBJS} ${LIBTHEORAENC80D_RCO} \ + libtheoraenc-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ \ + ${LIBTHEORAENCD_OBJS} ${LIBTHEORADEC80D_TARGET} -logg -lmsvcr80d \ + ${LIBTHEORAENC80D_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoraenc-all.def + +# dump_video +${DUMP_VIDEO_TARGET}: ${DUMP_VIDEO_OBJS} ${LIBTHEORADEC_TARGET} + mkdir -p ${TARGETBINDIR} + ${CC} ${CFLAGS} -o $@ ${DUMP_VIDEO_OBJS} ${LIBS} \ + ${LIBTHEORADEC_TARGET}.a + +# encoder_example +${ENCODER_EXAMPLE_TARGET}: ${ENCODER_EXAMPLE_OBJS} ${LIBTHEORADEC_TARGET} \ + ${LIBTHEORAENC_TARGET} + mkdir -p ${TARGETBINDIR} + ${CC} ${CFLAGS} -o $@ ${ENCODER_EXAMPLE_OBJS} ${LIBS} \ + ${LIBTHEORAENC_TARGET}.a ${LIBTHEORADEC_TARGET}.a + +# player_example +${PLAYER_EXAMPLE_TARGET}: CINCLUDE += $(SDLCONFIG) --cflags +${PLAYER_EXAMPLE_TARGET}: ${PLAYER_EXAMPLE_OBJS} ${LIBTHEORADEC_TARGET} + mkdir -p ${TARGETBINDIR} + ${CC} ${CFLAGS} -o $@ ${PLAYER_EXAMPLE_OBJS} ${LIBS} \ + ${LIBTHEORADEC_TARGET}.a `${SDLCONFIG} --libs` + +# Remove all targets. +clean: + -rm $(sort ${ALL_OBJS} ${ALL_DEPS} ${ALL_TARGETS} ${IMPLIB_TARGETS}) + -rmdir ${WORKDIR}/x86 + -rmdir ${WORKDIR} + +# Make everything depend on changes in the Makefile +${ALL_OBJS} ${ALL_DEPS} ${ALL_TARGETS} : Makefile + +# Specify which targets are phony for GNU make +.PHONY : all clean + +# Rules +# Windows-specific rules +%.dll.a : %.dll +%.def : %.dll +%.exp : %.lib +%.lib : %.def + wine lib /machine:i386 /def:$< +${WORKDIR}/%.d : %.rc + mkdir -p ${dir $@} + ${MAKEDEPEND} -x c-header ${CINCLUDE} $< -MT ${@:%.d=%.rco} > $@ +${WORKDIR}/%.rco : %.rc + mkdir -p ${dir $@} + ${RC} ${CINCLUDE} -DTH_VERSION_FIELD=${VERSION_FIELD} \ + -DTH_VERSION_STRING=${VERSION_STRING} $< $@ +# Normal compilation +${WORKDIR}/%.d : ${LIBSRCDIR}/%.c + mkdir -p ${dir $@} + ${MAKEDEPEND} ${CINCLUDE} ${RELEASE_CFLAGS} $< -MT ${@:%.d=%.o} > $@ +${WORKDIR}/%.d : ${BINSRCDIR}/%.c + mkdir -p ${dir $@} + ${MAKEDEPEND} ${CINCLUDE} ${RELEASE_CFLAGS} $< -MT ${@:%.d=%.o} > $@ +${WORKDIR}/%.o : ${LIBSRCDIR}/%.c + mkdir -p ${dir $@} + ${CC} ${CINCLUDE} ${RELEASE_CFLAGS} -c -o $@ $< +${WORKDIR}/%.o : ${BINSRCDIR}/%.c + mkdir -p ${dir $@} + ${CC} ${CINCLUDE} ${RELEASE_CFLAGS} -c -o $@ $< +# Debug versions +${WORKDIR}/%.dd : ${LIBSRCDIR}/%.c + mkdir -p ${dir $@} + ${MAKEDEPEND} ${CINCLUDE} ${DEBUG_CFLAGS} $< -MT ${@:%.d=%.do} > $@ +${WORKDIR}/%.do : ${LIBSRCDIR}/%.c + mkdir -p ${dir $@} + ${CC} ${CINCLUDE} ${DEBUG_CFLAGS} -c -o $@ $< + +# Include header file dependencies +-include ${ALL_DEPS} diff --git a/win32/xmingw32/libtheoradec-all.def b/win32/xmingw32/libtheoradec-all.def new file mode 100644 index 0000000..566eeb3 --- /dev/null +++ b/win32/xmingw32/libtheoradec-all.def @@ -0,0 +1,58 @@ +EXPORTS +; Old alpha API + theora_version_string @ 1 + theora_version_number @ 2 + + theora_decode_header @ 3 + theora_decode_init @ 4 + theora_decode_packetin @ 5 + theora_decode_YUVout @ 6 + + theora_control @ 7 + + theora_packet_isheader @ 8 + theora_packet_iskeyframe @ 9 + + theora_granule_shift @ 10 + theora_granule_frame @ 11 + theora_granule_time @ 12 + + theora_info_init @ 13 + theora_info_clear @ 14 + + theora_clear @ 15 + + theora_comment_init @ 16 + theora_comment_add @ 17 + theora_comment_add_tag @ 18 + theora_comment_query @ 19 + theora_comment_query_count @ 20 + theora_comment_clear @ 21 + +; New theora-exp API + th_version_string @ 22 + th_version_number @ 23 + + th_decode_headerin @ 24 + th_decode_alloc @ 25 + th_setup_free @ 26 + th_decode_ctl @ 27 + th_decode_packetin @ 28 + th_decode_ycbcr_out @ 29 + th_decode_free @ 30 + + th_packet_isheader @ 31 + th_packet_iskeyframe @ 32 + + th_granule_frame @ 33 + th_granule_time @ 34 + + th_info_init @ 35 + th_info_clear @ 36 + + th_comment_init @ 37 + th_comment_add @ 38 + th_comment_add_tag @ 39 + th_comment_query @ 40 + th_comment_query_count @ 41 + th_comment_clear @ 42 diff --git a/win32/xmingw32/libtheoradec-all.rc b/win32/xmingw32/libtheoradec-all.rc new file mode 100644 index 0000000..f6a5c60 --- /dev/null +++ b/win32/xmingw32/libtheoradec-all.rc @@ -0,0 +1,39 @@ +#include + +/*See "VERSIONINFO Resource" in MSDN, + http://msdn2.microsoft.com/en-us/library/Aa381058.aspx */ +VS_VERSION_INFO VERSIONINFO +FILEVERSION TH_VERSION_FIELD +PRODUCTVERSION TH_VERSION_FIELD +FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#if defined(_DEBUG) +FILEFLAGS VS_FF_DEBUG +#else +FILEFLAGS 0 +#endif +FILEOS VOS__WINDOWS32 +FILETYPE VFT_DLL +FILESUBTYPE 0 +BEGIN + BLOCK "StringFileInfo" + BEGIN + /*0x040904B0 == US English, Unicode*/ + BLOCK "0x040904B0" + BEGIN + VALUE "Comments","Xiph.Org " TH_DEC_INTERNAL_NAME ".dll" + VALUE "CompanyName","The Xiph.Org Foundation" + VALUE "FileDescription","Xiph.Org Theora Decoder Library" + VALUE "FileVersion",TH_VERSION_STRING + VALUE "InternalName",TH_DEC_INTERNAL_NAME + VALUE "LegalCopyright","Copyright (C) 2002-2007 Xiph.Org Foundation" + VALUE "OriginalFilename",TH_DEC_INTERNAL_NAME ".dll" + VALUE "ProductName","libtheora" + VALUE "ProductVersion",TH_VERSION_STRING + END + END + BLOCK "VarFileInfo" + BEGIN + /*0x0409, 1200 == US English, Unicode*/ + VALUE "Translation",0x0409,1200 + END +END diff --git a/win32/xmingw32/libtheoradec.rc b/win32/xmingw32/libtheoradec.rc new file mode 100644 index 0000000..3ed5da2 --- /dev/null +++ b/win32/xmingw32/libtheoradec.rc @@ -0,0 +1,3 @@ +#define TH_DEC_INTERNAL_NAME "libtheoradec" +#undef _DEBUG +#include "libtheoradec-all.rc" diff --git a/win32/xmingw32/libtheoradec70.rc b/win32/xmingw32/libtheoradec70.rc new file mode 100644 index 0000000..ee82820 --- /dev/null +++ b/win32/xmingw32/libtheoradec70.rc @@ -0,0 +1,3 @@ +#define TH_DEC_INTERNAL_NAME "libtheoradec70" +#undef _DEBUG +#include "libtheoradec-all.rc" diff --git a/win32/xmingw32/libtheoradec70d.rc b/win32/xmingw32/libtheoradec70d.rc new file mode 100644 index 0000000..783800d --- /dev/null +++ b/win32/xmingw32/libtheoradec70d.rc @@ -0,0 +1,3 @@ +#define TH_DEC_INTERNAL_NAME "libtheoradec70d" +#define _DEBUG (1) +#include "libtheoradec-all.rc" diff --git a/win32/xmingw32/libtheoradec71.rc b/win32/xmingw32/libtheoradec71.rc new file mode 100644 index 0000000..0becd19 --- /dev/null +++ b/win32/xmingw32/libtheoradec71.rc @@ -0,0 +1,3 @@ +#define TH_DEC_INTERNAL_NAME "libtheoradec71" +#undef _DEBUG +#include "libtheoradec-all.rc" diff --git a/win32/xmingw32/libtheoradec71d.rc b/win32/xmingw32/libtheoradec71d.rc new file mode 100644 index 0000000..e1a0398 --- /dev/null +++ b/win32/xmingw32/libtheoradec71d.rc @@ -0,0 +1,3 @@ +#define TH_DEC_INTERNAL_NAME "libtheoradec71d" +#define _DEBUG (1) +#include "libtheoradec-all.rc" diff --git a/win32/xmingw32/libtheoradec80.rc b/win32/xmingw32/libtheoradec80.rc new file mode 100644 index 0000000..932cce9 --- /dev/null +++ b/win32/xmingw32/libtheoradec80.rc @@ -0,0 +1,3 @@ +#define TH_DEC_INTERNAL_NAME "libtheoradec80" +#undef _DEBUG +#include "libtheoradec-all.rc" diff --git a/win32/xmingw32/libtheoradec80d.rc b/win32/xmingw32/libtheoradec80d.rc new file mode 100644 index 0000000..1ff5512 --- /dev/null +++ b/win32/xmingw32/libtheoradec80d.rc @@ -0,0 +1,3 @@ +#define TH_DEC_INTERNAL_NAME "libtheoradec80d" +#define _DEBUG (1) +#include "libtheoradec-all.rc" diff --git a/win32/xmingw32/libtheoradecd.rc b/win32/xmingw32/libtheoradecd.rc new file mode 100644 index 0000000..5cfaf6e --- /dev/null +++ b/win32/xmingw32/libtheoradecd.rc @@ -0,0 +1,3 @@ +#define TH_DEC_INTERNAL_NAME "libtheoradecd" +#define _DEBUG (1) +#include "libtheoradec-all.rc" diff --git a/win32/xmingw32/libtheoraenc-all.def b/win32/xmingw32/libtheoraenc-all.def new file mode 100644 index 0000000..36d2dad --- /dev/null +++ b/win32/xmingw32/libtheoraenc-all.def @@ -0,0 +1,17 @@ +EXPORTS +; Old alpha API + theora_encode_init @ 1 + theora_encode_YUVin @ 2 + theora_encode_packetout @ 3 + theora_encode_header @ 4 + theora_encode_comment @ 5 + theora_encode_tables @ 6 +; New theora-exp API + th_encode_alloc @ 7 + th_encode_ctl @ 8 + th_encode_flushheader @ 9 + th_encode_ycbcr_in @ 10 + th_encode_packetout @ 11 + th_encode_free @ 12 + TH_VP31_QUANT_INFO @ 13 + TH_VP31_HUFF_CODES @ 14 diff --git a/win32/xmingw32/libtheoraenc-all.rc b/win32/xmingw32/libtheoraenc-all.rc new file mode 100644 index 0000000..5c96b09 --- /dev/null +++ b/win32/xmingw32/libtheoraenc-all.rc @@ -0,0 +1,39 @@ +#include + +/*See "VERSIONINFO Resource" in MSDN, + http://msdn2.microsoft.com/en-us/library/Aa381058.aspx */ +VS_VERSION_INFO VERSIONINFO +FILEVERSION TH_VERSION_FIELD +PRODUCTVERSION TH_VERSION_FIELD +FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#if defined(_DEBUG) +FILEFLAGS VS_FF_DEBUG +#else +FILEFLAGS 0 +#endif +FILEOS VOS__WINDOWS32 +FILETYPE VFT_DLL +FILESUBTYPE 0 +BEGIN + BLOCK "StringFileInfo" + BEGIN + /*0x040904B0 == US English, Unicode*/ + BLOCK "0x040904B0" + BEGIN + VALUE "Comments","Xiph.Org " TH_ENC_INTERNAL_NAME ".dll" + VALUE "CompanyName","The Xiph.Org Foundation" + VALUE "FileDescription","Xiph.Org Theora Encoder Library" + VALUE "FileVersion",TH_VERSION_STRING + VALUE "InternalName",TH_ENC_INTERNAL_NAME + VALUE "LegalCopyright","Copyright (C) 2002-2007 Xiph.Org Foundation" + VALUE "OriginalFilename",TH_ENC_INTERNAL_NAME ".dll" + VALUE "ProductName","libtheora" + VALUE "ProductVersion",TH_VERSION_STRING + END + END + BLOCK "VarFileInfo" + BEGIN + /*0x0409, 1200 == US English, Unicode*/ + VALUE "Translation",0x0409,1200 + END +END diff --git a/win32/xmingw32/libtheoraenc.rc b/win32/xmingw32/libtheoraenc.rc new file mode 100644 index 0000000..26a356d --- /dev/null +++ b/win32/xmingw32/libtheoraenc.rc @@ -0,0 +1,3 @@ +#define TH_ENC_INTERNAL_NAME "libtheoraenc" +#undef _DEBUG +#include "libtheoraenc-all.rc" diff --git a/win32/xmingw32/libtheoraenc70.rc b/win32/xmingw32/libtheoraenc70.rc new file mode 100644 index 0000000..12cf7c1 --- /dev/null +++ b/win32/xmingw32/libtheoraenc70.rc @@ -0,0 +1,3 @@ +#define TH_ENC_INTERNAL_NAME "libtheoraenc70" +#undef _DEBUG +#include "libtheoraenc-all.rc" diff --git a/win32/xmingw32/libtheoraenc70d.rc b/win32/xmingw32/libtheoraenc70d.rc new file mode 100644 index 0000000..0fdb70b --- /dev/null +++ b/win32/xmingw32/libtheoraenc70d.rc @@ -0,0 +1,3 @@ +#define TH_ENC_INTERNAL_NAME "libtheoraenc70d" +#define _DEBUG (1) +#include "libtheoraenc-all.rc" diff --git a/win32/xmingw32/libtheoraenc71.rc b/win32/xmingw32/libtheoraenc71.rc new file mode 100644 index 0000000..8607516 --- /dev/null +++ b/win32/xmingw32/libtheoraenc71.rc @@ -0,0 +1,3 @@ +#define TH_ENC_INTERNAL_NAME "libtheoraenc71" +#undef _DEBUG +#include "libtheoraenc-all.rc" diff --git a/win32/xmingw32/libtheoraenc71d.rc b/win32/xmingw32/libtheoraenc71d.rc new file mode 100644 index 0000000..3ef2ef1 --- /dev/null +++ b/win32/xmingw32/libtheoraenc71d.rc @@ -0,0 +1,3 @@ +#define TH_ENC_INTERNAL_NAME "libtheoraenc71d" +#define _DEBUG (1) +#include "libtheoraenc-all.rc" diff --git a/win32/xmingw32/libtheoraenc80.rc b/win32/xmingw32/libtheoraenc80.rc new file mode 100644 index 0000000..66ef776 --- /dev/null +++ b/win32/xmingw32/libtheoraenc80.rc @@ -0,0 +1,3 @@ +#define TH_ENC_INTERNAL_NAME "libtheoraenc80" +#undef _DEBUG +#include "libtheoraenc-all.rc" diff --git a/win32/xmingw32/libtheoraenc80d.rc b/win32/xmingw32/libtheoraenc80d.rc new file mode 100644 index 0000000..dcca72c --- /dev/null +++ b/win32/xmingw32/libtheoraenc80d.rc @@ -0,0 +1,3 @@ +#define TH_ENC_INTERNAL_NAME "libtheoraenc80d" +#define _DEBUG (1) +#include "libtheoraenc-all.rc" diff --git a/win32/xmingw32/libtheoraencd.rc b/win32/xmingw32/libtheoraencd.rc new file mode 100644 index 0000000..fe2a56b --- /dev/null +++ b/win32/xmingw32/libtheoraencd.rc @@ -0,0 +1,3 @@ +#define TH_ENC_INTERNAL_NAME "libtheoraencd" +#define _DEBUG (1) +#include "libtheoraenc-all.rc" -- cgit v1.2.3