1 AC_DEFUN(RFX_CHECK_AVI2SWF,
4 AC_CHECK_PROGS(AVIFILE_CONFIG, avifile-config)
6 if test "x$AVIFILE_CONFIG" '!=' "x";then
7 OLDCPPFLAGS="$CPPFLAGS"
8 # temporarily add avifile paths to CPPFLAGS...
9 CPPFLAGS="$CPPFLAGS $CXXFLAGS "`$AVIFILE_CONFIG --cflags`
10 AC_CHECK_HEADERS(avifile/version.h version.h)
12 CPPFLAGS="$OLDCPPFLAGS"
15 AC_MSG_CHECKING([whether we can compile the avifile test program])
17 if test "x${ac_cv_header_version_h}" '=' "xyes";then
18 HAVE_VERSION_H_DEFINE='#define HAVE_VERSION_H'
20 if test "x${ac_cv_header_avifile_version_h}" '=' "xyes";then
21 HAVE_AVIFILE_VERSION_H_DEFINE='#define HAVE_AVIFILE_VERSION_H'
24 cat > conftest.cpp << EOF
26 // hack- we can't yet access the variables in config.h (because it hasn't been generated yet),
27 // so we have to introduce them this way
28 $HAVE_VERSION_H_DEFINE
29 $HAVE_AVIFILE_VERSION_H_DEFINE
34 #ifdef HAVE_AVIFILE_VERSION_H
35 #include <avifile/version.h>
38 #if (AVIFILE_MAJOR_VERSION == 0) && (AVIFILE_MINOR_VERSION>=6)
43 #include <StreamInfo.h>
58 IAviReadStream* astream;
59 IAviReadStream* vstream;
60 player = CreateIAviReadFile(0);
61 astream = player->GetStream(0, AviStream::Audio);
62 vstream = player->GetStream(0, AviStream::Video);
63 vstream -> StartStreaming();
64 astream -> StartStreaming();
67 player->GetFileHeader(&head);
68 head.dwMicroSecPerFrame;
73 head.dwMicroSecPerFrame;
75 astream->GetEndTime());
76 player->StreamCount();
80 audioinfo = astream->GetStreamInfo();
81 videoinfo = vstream->GetStreamInfo();
82 videoinfo->GetVideoWidth();
83 videoinfo->GetVideoHeight();
84 audioinfo->GetAudioSamplesPerSec();
87 CImage*img = vstream->GetFrame();
94 astream->GetAudioFormatInfo(&wave,0);
96 astream->ReadFrames(0,0,0,a,b);
98 int main (int argc, char*argv[])
104 if test "x$AVIFILE_CONFIG" '!=' "x";then
105 AVIFILE_LIBS=`$AVIFILE_CONFIG --libs`
106 AVIFILE_CFLAGS=`$AVIFILE_CONFIG --cflags`
107 avifile_link='$CXX $CPPFLAGS $CXXFLAGS $AVIFILE_CFLAGS conftest.cpp $AVIFILE_LIBS -o conftest${ac_exeext}'
108 if { (eval echo avi2swf.m4:71: \"$avifile_link\") 1>&5; (eval $avifile_link) 2>&5; } && test -s conftest${ac_exeext} && ./conftest${ac_exeext}; then
112 AC_DEFINE_UNQUOTED(AVIFILE, true)
114 echo "configure: failed program was:" >&5