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"
9 CPPFLAGS="$CPPFLAGS $CXXFLAGS "`$AVIFILE_CONFIG --cflags`
10 #LDFLAGS="$LDFLAGS `$AVIFILE_CONFIG --libs`"
11 AC_CHECK_HEADERS(avifile/version.h version.h)
12 #LDFLAGS="$OLDLDFLAGS"
13 CPPFLAGS="$OLDCPPFLAGS"
16 AC_MSG_CHECKING([whether we can compile the avifile test program])
18 if test "x${ac_cv_header_version_h}" '=' "xyes";then
19 HAVE_VERSION_H_DEFINE='#define HAVE_VERSION_H'
21 if test "x${ac_cv_header_avifile_version_h}" '=' "xyes";then
22 HAVE_AVIFILE_VERSION_H_DEFINE='#define HAVE_AVIFILE_VERSION_H'
25 cat > conftest.cpp << EOF
27 // hack- we can't yet access the variables in config.h (because it hasn't been generated yet),
28 // so we have to introduce them this way
29 $HAVE_VERSION_H_DEFINE
30 $HAVE_AVIFILE_VERSION_H_DEFINE
35 #ifdef HAVE_AVIFILE_VERSION_H
36 #include <avifile/version.h>
39 #if (AVIFILE_MAJOR_VERSION == 0) && (AVIFILE_MINOR_VERSION>=6)
44 #include <StreamInfo.h>
59 IAviReadStream* astream;
60 IAviReadStream* vstream;
61 player = CreateIAviReadFile(0);
62 astream = player->GetStream(0, AviStream::Audio);
63 vstream = player->GetStream(0, AviStream::Video);
64 vstream -> StartStreaming();
65 astream -> StartStreaming();
68 player->GetFileHeader(&head);
69 head.dwMicroSecPerFrame;
74 head.dwMicroSecPerFrame;
76 astream->GetEndTime());
77 player->StreamCount();
81 audioinfo = astream->GetStreamInfo();
82 videoinfo = vstream->GetStreamInfo();
83 videoinfo->GetVideoWidth();
84 videoinfo->GetVideoHeight();
85 audioinfo->GetAudioSamplesPerSec();
88 CImage*img = vstream->GetFrame();
95 astream->GetAudioFormatInfo(&wave,0);
97 astream->ReadFrames(0,0,0,a,b);
99 int main (int argc, char*argv[])
105 if test "x$AVIFILE_CONFIG" '!=' "x";then
106 ac_link='$CXX $CPPFLAGS $CXXFLAGS `$AVIFILE_CONFIG --cflags` `$AVIFILE_CONFIG --libs` conftest.cpp -o conftest${ac_exeext}'
107 if { (eval echo avi2swf.m4:71: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && ./conftest${ac_exeext}; then
111 AC_DEFINE_UNQUOTED(AVIFILE, true)
113 echo "configure: failed program was:" >&5