From: Klaus R. <kre...@us...> - 2007-11-30 16:53:34
|
Update of /cvsroot/ming/ming/test/Sound In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv14862/test/Sound Added Files: Makefile.am TestList test01-cxx.C test01.c test01.ref test02-cxx.C test02.c test02.ref Log Message: testcases for SWFSound with SoundStream. submitted by sak...@sf... http://sourceforge.net/tracker/index.php?func=detail&aid=1824403&group_id=18365&atid=118365 --- NEW FILE: test01.c --- #include <libming.h> int main() { SWFMovie m = newSWFMovieWithVersion(7); SWFSound sound; FILE *file; int ret; file = fopen(MEDIADIR "/audio01.mp3", "rb"); if(!file) { perror(MEDIADIR "/audio01.mp3"); return 1; } sound = newSWFSound_fromSoundStream(newSWFSoundStream(file)); if(!sound) { fprintf(stderr, "Could not create SWFSound\n"); return 1; } SWFMovie_startSound(m, sound); ret = SWFMovie_save(m, "test01.swf"); if ( ret == -1 ) { fprintf(stderr, "Something went wrong during SWFMovie_save\n"); return 1; } return 0; } --- NEW FILE: test02.ref --- File version: 7 File size: 1041703 Frame size: (0,6400)x(0,4800) Frame rate: 12.000000 / sec. Total frames: 1 Offset: 20 (0x0014) Block type: 14 (SWF_DEFINESOUND) Block length: 1041668 CharacterId: 1 SoundFormat: 2 SoundRate: 2 SoundSize: 1 SoundType: 1 SoundSampleCount: 1914048 Offset: 1041694 (0xfe51e) Block type: 15 (SWF_STARTSOUND) Block length: 3 SoundId 1 SoundInfo: Offset: 1041699 (0xfe523) Block type: 1 (SWF_SHOWFRAME) Block length: 0 Offset: 1041701 (0xfe525) Block type: 0 (SWF_END) Block length: 0 --- NEW FILE: test01.ref --- File version: 7 File size: 695110 Frame size: (0,6400)x(0,4800) Frame rate: 12.000000 / sec. Total frames: 1 Offset: 20 (0x0014) Block type: 14 (SWF_DEFINESOUND) Block length: 695075 CharacterId: 1 SoundFormat: 2 SoundRate: 2 SoundSize: 1 SoundType: 1 SoundSampleCount: 1916352 Offset: 695101 (0xa9b3d) Block type: 15 (SWF_STARTSOUND) Block length: 3 SoundId 1 SoundInfo: Offset: 695106 (0xa9b42) Block type: 1 (SWF_SHOWFRAME) Block length: 0 Offset: 695108 (0xa9b44) Block type: 0 (SWF_END) Block length: 0 --- NEW FILE: TestList --- test01:swf: mp3 stream sound test02:swf: flv audio stream sound --- NEW FILE: test01-cxx.C --- #include <mingpp.h> int main() { SWFMovie *m = new SWFMovie(7); SWFSound *sound; int i; FILE *file; file = fopen(MEDIADIR "/audio01.mp3", "rb"); if(!file) { return 0; } sound = new SWFSound(new SWFSoundStream(file)); if(!sound) return 0; m->startSound(sound); m->save("test01.swf"); return 0; } --- NEW FILE: Makefile.am --- SUBDIRS = AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_srcdir)/src \ -I$(top_srcdir)/test \ -DMEDIADIR='"$(srcdir)/../Media/"' LDADD = $(top_builddir)/src/libming.la TESTS = dotests C_PROGS = \ test01 \ test02 if USE_CXX CXX_PROGS = \ test01-cxx \ test02-cxx test01_cxx_SOURCES = test01-cxx.C test02_cxx_SOURCES = test02-cxx.C endif TEST_PROGS = $(C_PROGS) $(CXX_PROGS) EXTRA_DIST = \ test01.ref \ test02.ref TestList check_PROGRAMS = \ $(TEST_PROGS) CLEANFILES = dotests php.ini \ test01.swf \ test02.swf include ../Makefile.inc --- NEW FILE: test02.c --- #include <libming.h> int main() { SWFMovie m = newSWFMovieWithVersion(7); SWFSound sound; FILE *file; int ret; file = fopen(MEDIADIR "/video02.flv", "rb"); if(!file) { perror(MEDIADIR "/video02.flv"); return 1; } sound = newSWFSound_fromSoundStream(newSWFSoundStream(file)); if(!sound) { fprintf(stderr, "Could not create SWFSound\n"); return 1; } SWFMovie_startSound(m, sound); ret = SWFMovie_save(m, "test02.swf"); if ( ret == -1 ) { fprintf(stderr, "Something went wrong during SWFMovie_save\n"); return 1; } return 0; } --- NEW FILE: test02-cxx.C --- #include <mingpp.h> int main() { SWFMovie *m = new SWFMovie(7); SWFSound *sound; int i; FILE *file; file = fopen(MEDIADIR "/video02.flv", "rb"); if(!file) { return 0; } sound = new SWFSound(new SWFSoundStream(file)); if(!sound) return 0; m->startSound(sound); m->save("test02.swf"); return 0; } |