OSDN Git Service

add tstools.
authorgn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Sat, 26 Dec 2009 13:51:02 +0000 (13:51 +0000)
committergn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Sat, 26 Dec 2009 13:51:02 +0000 (13:51 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@367 4e526526-5e11-4fc0-8910-f8fd03428081

127 files changed:
tstools/BonTsDemux/BonTsDemux.exe [new file with mode: 0755]
tstools/BonTsDemux/BonTsDemux.txt [new file with mode: 0755]
tstools/BonTsDemux/cap_sts_sea.ini [new file with mode: 0755]
tstools/BonTsDemux/ffmpeg.exe [new file with mode: 0755]
tstools/DtsEdit/DtsEdit.exe [new file with mode: 0644]
tstools/DtsEdit/License.txt [new file with mode: 0644]
tstools/DtsEdit/gpl.txt [new file with mode: 0644]
tstools/DtsEdit/readme.txt [new file with mode: 0644]
tstools/DtsEdit/src/DtsEdit.cpp [new file with mode: 0644]
tstools/DtsEdit/src/DtsEdit.sln [new file with mode: 0644]
tstools/DtsEdit/src/DtsEdit.vcproj [new file with mode: 0644]
tstools/DtsEdit/src/EditMain.cpp [new file with mode: 0644]
tstools/DtsEdit/src/EditMain.h [new file with mode: 0644]
tstools/DtsEdit/src/Help.cpp [new file with mode: 0644]
tstools/DtsEdit/src/Help.h [new file with mode: 0644]
tstools/DtsEdit/src/common.cpp [new file with mode: 0644]
tstools/DtsEdit/src/common.h [new file with mode: 0644]
tstools/DtsEdit/src/debug.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/avparse.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/base_coding.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/bifs.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/bifsengine.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/bitstream.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/color.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/compositor.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/config_file.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/constants.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/crypt.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/download.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/esi.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/events.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/ietf.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/internal/avilib.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/internal/bifs_dev.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/internal/bifs_tables.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/internal/camera.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/internal/compositor_dev.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/internal/config.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/internal/config_static.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/internal/crypt_dev.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/internal/ietf_dev.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/internal/isomedia_dev.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/internal/laser_dev.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/internal/media_dev.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/internal/mesh.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/internal/odf_dev.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/internal/ogg.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/internal/scenegraph_dev.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/internal/swf_dev.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/internal/terminal_dev.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/internal/vobsub.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/ismacryp.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/iso639.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/isomedia.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/laser.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/libgpac_static.lib [new file with mode: 0644]
tstools/DtsEdit/src/gpac/libgpac_static_msvcr.lib [new file with mode: 0644]
tstools/DtsEdit/src/gpac/list.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/math.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/media_tools.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/mediaobject.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/module.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/modules/audio_out.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/modules/codec.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/modules/font.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/modules/ipmp.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/modules/js_usr.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/modules/raster2d.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/modules/service.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/modules/term_ext.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/modules/video_out.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/mpeg4_odf.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/mpegts.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/network.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/nodes_mpeg4.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/nodes_svg.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/nodes_x3d.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/nodes_xbl.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/options.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/path2d.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/scene_manager.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/scenegraph.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/scenegraph_svg.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/scenegraph_vrml.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/setup.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/svg_types.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/sync_layer.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/term_info.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/terminal.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/thread.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/token.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/tools.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/user.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/utf.h [new file with mode: 0644]
tstools/DtsEdit/src/gpac/xml.h [new file with mode: 0644]
tstools/DtsEdit/src/stdafx.cpp [new file with mode: 0644]
tstools/DtsEdit/src/stdafx.h [new file with mode: 0644]
tstools/DtsEdit/src/stdint.h [new file with mode: 0644]
tstools/DtsEdit/ディレイカット.bat [new file with mode: 0644]
tstools/Makefile [new file with mode: 0755]
tstools/cfr2tc/cfr2tc-README.txt [new file with mode: 0644]
tstools/cfr2tc/cfr2tc.exe [new file with mode: 0644]
tstools/cfr2tc/cfr2tc/cfr2tc.cpp [new file with mode: 0644]
tstools/cfr2tc/cfr2tc/cfr2tc.rc [new file with mode: 0644]
tstools/cfr2tc/cfr2tc/cfr2tc.sln [new file with mode: 0644]
tstools/cfr2tc/cfr2tc/cfr2tc.vcproj [new file with mode: 0644]
tstools/cfr2tc/cfr2tc/resource.h [new file with mode: 0644]
tstools/cfr2tc/gpl.txt [new file with mode: 0644]
tstools/epgdump/Makefile [new file with mode: 0755]
tstools/epgdump/aribstr.c [new file with mode: 0755]
tstools/epgdump/aribstr.h [new file with mode: 0755]
tstools/epgdump/eit.c [new file with mode: 0755]
tstools/epgdump/eit.h [new file with mode: 0755]
tstools/epgdump/epgdump.c [new file with mode: 0755]
tstools/epgdump/epgdump_segfault_fix_patch(last).txt [new file with mode: 0755]
tstools/epgdump/patch2ch [new file with mode: 0755]
tstools/epgdump/patch_r2 [new file with mode: 0755]
tstools/epgdump/readme.txt [new file with mode: 0755]
tstools/epgdump/sdt.c [new file with mode: 0755]
tstools/epgdump/sdt.h [new file with mode: 0755]
tstools/epgdump/ts.c [new file with mode: 0755]
tstools/epgdump/ts.h [new file with mode: 0755]
tstools/epgdump/ts_ctl.h [new file with mode: 0755]
tstools/epgdump/util.c [new file with mode: 0755]
tstools/epgdump/util.h [new file with mode: 0755]
tstools/epgdump/xmldata.c [new file with mode: 0755]
tstools/jTsSplitter/jTsSplitter.jar [new file with mode: 0644]

diff --git a/tstools/BonTsDemux/BonTsDemux.exe b/tstools/BonTsDemux/BonTsDemux.exe
new file mode 100755 (executable)
index 0000000..8ea97f4
Binary files /dev/null and b/tstools/BonTsDemux/BonTsDemux.exe differ
diff --git a/tstools/BonTsDemux/BonTsDemux.txt b/tstools/BonTsDemux/BonTsDemux.txt
new file mode 100755 (executable)
index 0000000..0f47538
--- /dev/null
@@ -0,0 +1,270 @@
+BonTsDemux mod 10k5 (modified by kt)\r
+\r
+LxbEvo.FpE\8e\81\82É\82æ\82é BonTsDemux mod 10 \82ð\89ü\91¢\82µ\82½\82à\82Ì\81B\r
+\r
+AAC \82Ì Demux \82ð\83o\83b\83`\8f\88\97\9d\82Å\82«\82é\83\\83t\83g\82ª\8c©\93\96\82½\82ç\82È\82©\82Á\82½\82½\82ß\82É\8dì\90¬\81B\r
+\r
+\81\9b\95Ï\8dX\93_\r
+\81EAAC \82Ì Demux \8b@\94\\82ð\95\9c\8a\88\81B\r
+  AAC Demux \8e\9e\82É\82Í\81A\83t\83@\83C\83\8b\96¼\82É\92x\89\84\8e\9e\8aÔ\82ð\93ü\82ê\82é\82æ\82¤\82É\95Ï\8dX\81B\r
+  \81iDGIndex \82È\82Ç\82Æ\93¯\82\8c`\8e®\81B\81j\r
+\r
+\81E\89¹\90º\82Ì\92x\89\84\8e\9e\8aÔ\82ð\95â\90³\82Å\82«\82é\82æ\82¤\82É\95Ï\8dX\81B\r
+  \83R\83}\83\93\83h\83\89\83C\83\93\82Å\82Í -delay nnn \82Å\8ew\92è\89Â\94\\81B\81innn \82Í\81Ams\92P\88Ê\82Ì\90®\90\94\81j\r
+\r
+\81ERF64\83T\83|\81[\83g\81AVideo Frame\95â\8a®\82Ì\90Ý\92è\82ð\83t\83@\83C\83\8b\82²\82Æ\82É\8bL\89¯\82·\82é\82æ\82¤\82É\95Ï\8dX\81B\r
+  D&D \82Å\83t\83@\83C\83\8b\82ð\93o\98^\82·\82é\8fê\8d\87\82Í\81A\91¼\82Ì\83I\83v\83V\83\87\83\93\82Æ\93¯\97l\82É\81A\90æ\82É\8aó\96]\82Ì\90Ý\92è\82ð\r
+  \91I\82ñ\82Å\82¨\82¢\82½\8fó\91Ô\82Å D&D \82·\82é\82±\82Æ\81B\r
+\r
+\81E\83X\83N\83\89\83\93\83u\83\8b\89ð\8f\9c\82ð\8ds\82í\82È\82¢\83I\83v\83V\83\87\83\93\82ð\92Ç\89Á\81B\r
+  \83R\83}\83\93\83h\83\89\83C\83\93\82Å\82Í -nd \82Å\8ew\92è\89Â\94\\81B\r
+  \81i\83X\83N\83\89\83\93\83u\83\8b\89ð\8f\9c\8dÏ\82Ý\83t\83@\83C\83\8b\82Ì\8f\88\97\9d\8d\82\91¬\89»\97p\81j\r
+\r
+\81E\91\80\8dì\90«\8cü\8fã\82Ì\82½\82ß\81A\88ê\95\94\82Ì\83{\83^\83\93\93\99\82É\83A\83N\83Z\83X\83L\81[\82ð\92Ç\89Á\81B\r
+\r
+\81E\82»\82Ì\91¼\82Ì\8d×\82©\82¢\95Ï\8dX\82Í\89º\8bL\82Ì\97\9a\97ð\82ð\8eQ\8fÆ\82Ì\82±\82Æ\81B\r
+\r
+\r
+\81\9b\83r\83\8b\83h\82É\95K\97v\82È\8aÂ\8b«/\83\89\83C\83u\83\89\83\8a\r
+\81EMicrosoft Visual Studio 2003 \88È\8fã\r
+\81EFAAD 2.6.1\r
+  http://www.audiocoding.com/downloads.html\r
+  \81i\83R\83\93\83p\83C\83\8b\82µ\82Ä\82Å\82«\82½\83\8a\83\8a\81[\83X\94Å libfaad.lib \82ð BonTsDemux.vcproj \82È\82Ç\82Æ\r
+    \93¯\82\8aK\91w\82É\92u\82­\82±\82Æ\81B\82Ü\82½\81A\83f\83o\83b\83O\94Å\82Ì\83\89\83C\83u\83\89\83\8a\82Í libfaadd.lib \82É\83\8a\83l\81[\83\80\r
+    \82µ\82Ä\93¯\82\8aK\91w\82É\92u\82­\82±\82Æ\81B\81j\r
+\r
+\81\9b\97\9a\97ð\r
+2009/01/10  mod 10k5\r
+\81E\91\80\8dì\90«\8cü\8fã\82Ì\82½\82ß\81A\88ê\95\94\82Ì\83{\83^\83\93\93\99\82É\83A\83N\83Z\83X\83L\81[\82ð\92Ç\89Á\81B\r
+\81EMFC \82ð\83X\83^\83e\83B\83b\83N\83\8a\83\93\83N\82·\82é\82æ\82¤\82É\95Ï\8dX\81B\81i\83\89\83\93\83^\83C\83\80\83\89\83C\83u\83\89\83\8a\82Í\95s\97v\82É\81B\81j\r
+\r
+2008/09/13  mod 10k4\r
+\81E\83X\83N\83\89\83\93\83u\83\8b\89ð\8f\9c\82ð\8ds\82í\82È\82¢\83I\83v\83V\83\87\83\93\82ð\92Ç\89Á\81B\r
+\81E\90Ý\92è\82ð\95Ï\8dX\82µ\82Ä\82¢\82È\82¢\82É\82à\8aÖ\82í\82ç\82¸\81A\95Ï\8a·\8aJ\8en\8e\9e\82É\83o\83b\83`\83\8a\83X\83g\82É\92Ç\89Á\93o\98^\82³\82ê\82é\r
+  \8fê\8d\87\82ª\82 \82Á\82½\82Ì\82ð\8fC\90³\81B\r
+\r
+2008/09/10  mod 10k3\r
+\81E\83\89\83\93\83^\83C\83\80\83\89\83C\83u\83\89\83\8a\82ª\95s\91«\82µ\82Ä\82¢\82½\82Ì\82Å\92Ç\89Á\81B\81i\92\86\90g\82Ì\95Ï\8dX\82Í\96³\82µ\81B\81j\r
+\r
+2008/09/07  mod 10k3\r
+\81Emod 10k2 \82Å\81A\89¹\90º\82Ì\92x\89\84\8e\9e\8aÔ\82Ì\95â\90³\82ª\8cø\82¢\82Ä\82¢\82È\82©\82Á\82½\82Ì\82ð\8fC\90³\81B\r
+  \82È\82¨\81A\95â\90³\92l\82É\82 \82Ü\82è\91å\82«\82È\92l\81i\90\94\95b\88È\8fã\81H\81j\82ð\93ü\82ê\82é\82Æ\93®\8dì\82ª\82¨\82©\82µ\82­\82È\82é\82©\82à\r
+  \92m\82ê\82È\82¢\82Ì\82Å\92\8d\88Ó\81B\r
+\r
+2008/09/07  mod 10k2\r
+\81E\8f\88\97\9d\82ª\8fI\97¹\82µ\82½\82ç\83E\83B\83\93\83h\83E\82ð\93_\96Å\82³\82¹\82é\82æ\82¤\82É\95Ï\8dX\81B\r
+\81ERF64\83T\83|\81[\83g\81AVideo Frame\95â\8a®\82Ì\90Ý\92è\82ð\83t\83@\83C\83\8b\82²\82Æ\82É\95Û\91\82·\82é\82æ\82¤\82É\95Ï\8dX\81B\r
+\81E\89¹\90º\82Ì\92x\89\84\8e\9e\8aÔ\82ð\95â\90³\82Å\82«\82é\82æ\82¤\82É\95Ï\8dX\81B\r
+\81E\83^\83u\83I\81[\83_\81[\82ª\82ß\82¿\82á\82­\82¿\82á\82¾\82Á\82½\82Ì\82ð\8fC\90³\81B\r
+\81E\83\89\83\93\83^\83C\83\80\83\89\83C\83u\83\89\83\8a\82ð\93¯\8d«\81B\r
+\r
+2008/08/25  mod 10k1\r
+\81Emod 10 \82ð\89ü\91¢\81B\r
+\81EAAC \82Ì Demux \8b@\94\\82ð\95\9c\8a\88\81B\r
+  AAC Demux \8e\9e\82É\82Í\81A\83t\83@\83C\83\8b\96¼\82É\92x\89\84\8e\9e\8aÔ\82ð\93ü\82ê\82é\82æ\82¤\82É\95Ï\8dX\81B\r
+  \81iDGIndex \82È\82Ç\82Æ\93¯\82\8c`\8e®\81B\81j\r
+\81EWin2k\81iWinXP \82Å\83r\83W\83\85\83A\83\8b\83X\83^\83C\83\8b off \82Ì\8fê\8d\87\82à\81H\81j\82Å\81A\83h\83\8d\83b\83v\83_\83E\83\93\r
+  \83R\83\93\83{\83{\83b\83N\83X\82ª 1\8ds\82µ\82©\95\\8e¦\82³\82ê\82È\82¢\82Ì\82ð\8fC\90³\81B\r
+\81E\83o\83b\83`\83\8a\83X\83g\82Ì\95\\8e¦\95\9d\82ð\8ag\91å\81B\r
+\81E\83t\83@\83C\83\8b\83I\81[\83v\83\93\83_\83C\83A\83\8d\83O\82Ì\83T\83C\83Y\82ð\89Â\95Ï\82É\90Ý\92è\81B\r
+\81E\82»\82Ì\91¼\81AVS2003 \82Å\83R\83\93\83p\83C\83\8b\82Å\82«\82é\82æ\82¤\82É\82·\82é\82½\82ß\82Ì\83\\81[\83X\8fã\82Ì\8fC\90³\82È\82Ç\81B\r
+\r
+\r
+\r
+----------------------------------------------------------------------------\r
+BonTsDemux mod 10 readme\r
+----------------------------------------------------------------------------\r
+\r
+BonTsDemux mod 10 (modified by LxbEvo.FpE)\r
+\r
+TS\83t\83@\83C\83\8b\82ð\81A\92¼\90Ú\95Ê\83t\83@\83C\83\8b\82É\95Ï\8a·\82·\82é\81B\r
+\r
+BonTsDemux\82Å\81AWAV\95Ï\8a·\8e\9e\82ÉVideo Frame\82ÆAudio PTS\82ð\8eg\82Á\82Ä\89¹\90º\82ð \82¸\82ê\82È\82¢\82æ\82¤\82É\95â\8a®\r
+ffmpeg\82É\92¼\90Ú\82Í\82¢\82Ä\82Ý\82é\r
+\r
+\r
+\90Ý\92è\8d\80\96Ú\82Ì\90à\96¾\r
+\r
+       \81ERF64\83T\83|\81[\83g\r
+       \r
+               true \8e\9e 4GB \83I\81[\83o\81[\8e\9e RIFF\8b­\90§ \r
+               false \8e\9e 4GB \83I\81[\83o\81[\8e\9e RF64\81i\8d¡\82Ü\82Å\92Ê\82è\82Ì\93®\8dì\81\r
+\r
+       \81EVideo Frame\95â\8a®\r
+\r
+               \81ETS\83\\81[\83X\82Å\89¹\90º\82Ì\82Ý\82Ì\8bó\8aÔ\82ª\82 \82é\r
+               \81Ebiterr\93\99\82Å\81A\83r\83f\83I or \89¹\90º\83t\83\8c\81[\83\80\82Ì\8c\87\97\8e\82ª\82 \82é\r
+               \8fã\8bL\82ª\82 \82Ä\82Í\82Ü\82éTS\83\\81[\83X\82Å\89¹\82¸\82ê\82ª\94­\90\82·\82é\8fê\8d\87\81A\82±\82ê\82É\83`\83F\83b\83N\82ð\93ü\82ê\82é\82Æ\89ü\91P\82·\82é\82©\82à\81B\r
+               \81¦\82½\82¾\82µ\81A\8c»\8fó\82Å\82Í29.97fps\8c\88\82ß\82¤\82¿\82È\82Ì\82Å\81A\82»\82ê\88È\8aO\82Ì\83\\81[\83X\82¾\82Æ\8bt\82É\82¸\82ê\82Ä\82µ\82Ü\82¢\82Ü\82·\81B\r
+\r
+\r
+FFMPEG\8eg\97p\8e\9e\82Ì\92\8d\88Ó\8e\96\8d\80\r
+       \81E\8b­\90§5.1ch\8fo\97Í\82¾\82Æ\82Ù\82Æ\82ñ\82Ç\82Ì\83P\81[\83X\82Å\83G\83\89\81[\82É\82È\82è\82Ü\82·\81B\r
+       \81Elocalhost:1234\82ðBonTsDemux\91¤\82Å\8eg\97p\82µ\82Ü\82·\81B\r
+       \81E\93ü\97Í(-i)\81A\8fo\97Í\83t\83@\83C\83\8b\82Ì\8ew\92è\82Í\82µ\82È\82¢\82Å\82­\82¾\82³\82¢\81B\r
+\r
+\r
+\83R\83}\83\93\83h\83\89\83C\83\93\82©\82ç\82Ì\8cÄ\82Ñ\8fo\82µ\8ed\97l\r
+       \97á: bontsdemux -i "test.ts" -o "test" -encode "Demux(m2v)" -start -quit\r
+\r
+       \83R\83}\83\93\83h\8eí\97Þ\r
+       -i [\83t\83@\83C\83\8b\96¼]         \93ü\97Í\83t\83@\83C\83\8b(ts)\82Ì\90Ý\92è\r
+       -o [\83t\83@\83C\83\8b\96¼]         \8fo\97Í\83t\83@\83C\83\8b\82Ì\90Ý\92è\81B\8ag\92£\8eq\82Í\8e©\93®\82Å\95t\82­\8ed\97l\82È\82Ì\82Å\81A\82Â\82¯\82È\82¢\82±\82Æ\82ð\90\84\8f§\r
+       -srv [\83T\81[\83r\83X\94Ô\8d\86]     \83T\81[\83r\83X\94Ô\8d\86\82Ì\91I\91ð(10\90i\90\94\92l)\r
+       -es [0-2]                       \89¹\90ºES\82Ì\91I\91ð(0:\83T\81[\83r\83X\82É\88Ë\91¶ 1-2:2-3\94Ô\96Ú\82É\91\8dÝ\82·\82é\89¹\90º(\82È\82¢\8fê\8d\87\82Í0\82Æ\93¯\82\90U\82é\95\91\82¢\82ð\82·\82é)\r
+       -encode [\8eí\97Þ]          [\8eí\97Þ]\97á\81F      \8ew\92è\82È\82µ        \81cDemux(m2v+wav)\r
+                                                                       Demux(wav)      \81c\89¹\90º\82Ì\82Ý\r
+                                                                       Demux(m2v)      \81c\89f\91\9c\82Ì\82Ý\r
+                                                                       MPG2PS          \81cMPG2PS\8c`\8e®\82Å\8fo\97Í(cap_sts_sea.ini\82Å\82Ì\90Ý\92è\8d\80\96Ú)\r
+                                                                       WMV8            \81cWMV8(cap_sts_sea.ini\82Å\82Ì\90Ý\92è\8d\80\96Ú)\r
+                                                                        \81F\r
+       -sound [\95û\8e®(0-4)]      0:Stereo(\8eå+\95\9b)\r
+                                               1:\8eå\89¹\90º\r
+                                               2:\95\9b\89¹\90º\r
+                                               3:\8b­\90§5.1ch\r
+                                               4:\8b­\90§5.1ch(Split)\r
+       -rf64                           wav RF64\83T\83|\81[\83g\r
+       -vf                                     Video Frame\95â\8a®\97L\8cø\r
+       -start                          \8e©\93®\82Å\8aJ\8en\r
+       -quit                           \8e©\93®\82Å\8fI\97¹\r
+\r
+----------------------------------------------------------------------------------------\r
+mod 10\r
+       qE.77T.ink\8e\81\82ÌWavWriter \82Ì RIFF \8b­\90§\91Î\89\9e\94Å\r
+       Video Frame\95â\8a® \82ð\81A\83I\83v\83V\83\87\83\93\88µ\82¢\82É\95Ï\8dX\r
+\r
+mod 9.1\r
+       \95\9b\89¹\90º\82ª\91I\91ð\82Å\82«\82Ä\82¢\82È\82©\82Á\82½\95s\8bï\8d\87\82ð\8fC\90³\r
+\r
+mod 9\r
+       \83R\83}\83\93\83h\83\89\83C\83\93\83I\83v\83V\83\87\83\93\82É\91Î\89\9e\r
+       \89¹\90º\8fo\97Í\95û\8e®\82Å\81A\8eå\89¹\90º,\95\9b\89¹\90º\82Ì\91I\91ð\82ª\8fo\97\88\82È\82©\82Á\82½\95s\8bï\8d\87\82ð\8fC\90³(mod 8\82Å\82Ì\83G\83\93\83o\83O)\r
+       \83t\83@\83C\83\8b\96¼\82ª\92·\82·\82¬\82é\82Æ\81AD&D\8e\9e\82É\97\8e\82¿\82Ä\82¢\82½\95s\8bï\8d\87\82ð\8fC\90³\r
+       RF64\8fo\97Í\82ð\91I\91ð\89Â\94\\82É\82µ\82½\r
+       cap_sts_sea.ini\83t\83@\83C\83\8b\82Å\81A\8ag\92£\8eq\82Ì\8ew\92è\82ð\89Â\94\\82Æ\82µ\82½\r
+       \r
+mod 8\r
+       5.1ch\8fo\97Í\8e\9e\82Ì\83`\83\83\83\93\83l\83\8b\83A\83T\83C\83\93\83o\83O\8fC\90³\r
+       qE.77T.ink\8e\81\82ÌRF64\83t\83H\81[\83}\83b\83g\91Î\89\9e\r
+               \81¨4GB \82ð\92´\82¦\82é\82Æ\8e©\93®\93I\82É RF64 \83t\83H\81[\83}\83b\83g\82É\82È\82é\81B\r
+               \81¨5.1ch Split\83\82\81[\83h\r
+                       \81E\83`\83\83\83\93\83l\83\8b\96\88\82É 1ch Wav \8f\91\82«\8fo\82µ\83N\83\89\83X\81B\r
+                       \81E\93n\82³\82ê\82½\83t\83@\83C\83\8b\96¼\82É\91Î\82µ\82Ä\81A\83`\83\83\83\93\83l\83\8b\82Ì\83T\83t\83B\83b\83N\83X\82ð\95t\82¯\82Ä\8fo\97Í\82·\82é\81B\r
+                       \81E4GB \82ð\92´\82¦\82é\82Æ\8e©\93®\93I\82É RF64 \83t\83H\81[\83}\83b\83g\82É\82È\82é\81B\r
+\r
+mod 7\r
+       File\8fo\97Í\8e\9e\82É\81AGOP\82Ì\83T\83C\83Y\82ª\91å\82«\82¢\82Æ\8f\91\82«\82±\82Ý\83G\83\89\81[\82ð\82¨\82±\82µ\82Ä\82¢\82½\95s\8bï\8d\87\82ð\8fC\90³\r
+       ffmpeg\82ª\88Ù\8fí\8fI\97¹\82µ\82½\82Æ\82«\82É\83n\83\93\83O\83A\83b\83v\82µ\82Ä\82¢\82½\82Ì\82ð\8fC\90³\r
+       demux\8e\9e\82É\89¹\90º\95â\90³\82ð\8ds\82Á\82½\8dÛ\81A\88Ù\8fí\8fI\97¹\82·\82é\95s\8bï\8d\87\82ð\8fC\90³\r
+       \82»\82Ì\91¼\81A\8d×\82©\82¢\82Æ\82±\82ë\82ð\8fC\90³\r
+       \r
+mod 6b2\r
+       Meru\8e\81\82Ì\83T\81[\83r\83X\91I\91ð\82ð\91g\82Ý\8d\9e\82Ý(\93®\8dì\82 \82Ü\82è\8c©\82ê\82Ä\82¢\82È\82¢\81B)\r
+       PTS\82Ì\82È\82¢\83p\83P\83b\83g\82ª\82«\82½\82Æ\82«\82É\81A\8b­\90§\8fI\97¹\82·\82é\95s\8bï\8d\87\82ð\8fC\90³\r
+       \83r\83f\83I\8fo\97Í\83t\83@\83C\83\8b\82Ì\83G\83f\83B\83b\83g\83{\83b\83N\83X\82É\81A\8ag\92£\8eq\82ð\95\\8e¦\82µ\82È\82¢\82æ\82¤\82É\8fC\90³\r
+       \8ag\92£\8eq\82ðm2v,wav,mpg,mp4,avi\82©\82ç\8e©\93®\82Å\91I\91ð\82·\82é\8b@\94\\r
+\r
+mod 6b\r
+       5.1 DownMix\82Ì\8cW\90\94\8aÔ\88á\82¢\82ð\8fC\90³\r
+       qE.77T.ink\8e\81\82Ì\8b­\90§5.1ch\8fo\97Í\82ð\91g\82Ý\8d\9e\82Ý(TS\83\\81[\83X\82ª\82È\82¢\82½\82ß\81A\93®\8dì\96¢\8c\9f\8fØ)\r
+       Audio ES \91I\91ð\8b@\94\\92Ç\89Á\r
+       \83o\83b\83`\8f\88\97\9d\8b@\94\\92Ç\89Á\r
+       D&D\8b@\94\\92Ç\89Á\r
+       \89¹\90º\91I\91ð(\8eå\81A\95\9b\89¹)\92Ç\89Á\r
+       WAV\8fo\97Í\82Ì\82Ý\81AM2V\8fo\97Í\82Ì\82Ý\91I\91ð\8b@\94\\92Ç\89Á\r
+       \89¹\82¸\82ê\95â\90³\8fC\90³(\83X\83g\83\8a\81[\83\80\93r\92\86\82Å\82à\81A200ms\88È\8fã\8bó\94\92\82ª\82 \82é\8fê\8d\87\82ÍNULL\82Å\88ê\8bC\82É\96\84\82ß\82Ä\82Ý\82é)\r
+\r
+mod 5\r
+       ffmpeg\82É\92¼\90Ú\82Í\82¢\82Ä\82Ý\82é\83e\83X\83g\r
+       ffmpeg\82Ö\82Ì\83p\83\89\83\81\81[\83^\82Í\81Acap_sts_sea.ini\82Å\92\80\8e\9f\95Ï\8dX\82µ\82Ä\82­\82¾\82³\82¢\81B\r
+               \81¨\93ü\97Í(-i)\81A\8fo\97Í\83t\83@\83C\83\8b\82Ì\8ew\92è\82Í\82µ\82È\82¢\82Å\82­\82¾\82³\82¢\81B\r
+               \81¨2-pass\82Í\8fo\97\88\82Ü\82¹\82ñ(\8ed\97l)\81B\r
+               \81¨\95t\91®\82Ìffmpeg.exe\82Í\81A rev.12910 Pentium4\8dÅ\93K\89»\94Å\82Å\82·\81B(\93ü\8eè\8c³\81Fhttp://blog.k-tai-douga.com/)\r
+       \82Ü\82½\81A\8d¡\89ñ\82Ì\83o\81[\83W\83\87\83\93\82æ\82è\81Awav\93f\82«\8fo\82µ\90ê\97p\82É\82È\82Á\82Ä\82¢\82Ü\82·\81B(\89¹\90º\82Í\8b­\90§2ch\90ê\97p)\r
+\r
+mod 4\r
+       mod 3\82Å\83R\83~\83b\83g\83~\83X\82ª\82 \82Á\82½\82Ì\82Å\8fC\90³\r
+       \81{\91½\8f­\89ü\97Ç\r
+\r
+mod 3\r
+       \93r\92\86\82Å\83`\83\83\83\93\83l\83\8b\82ð\95Ï\82¦\82Ä\82à\81A\82 \82é\92ö\93x\93¯\8aú\82Å\82«\82é\82æ\82¤\82É\82µ\82½(\8e\84\82Ì\8eÀ\97Í\82Å\82Í\81A\82±\82ê\82ª\8cÀ\8aE)\r
+       \83G\83\89\81[\82Å\94j\8aü\82·\82é\82µ\82©\82È\82¢\89¹\90º\83t\83\8c\81[\83\80\82ª\82 \82Á\82½\8fê\8d\87\81A\88È\91O\82Ì\83I\81[\83f\83B\83I\83T\83C\83Y\95ª0\8fo\97Í\82·\82é\82æ\82¤\82É\82µ\82Ä\82Ý\82½\81B\r
+       (\8cø\89Ê\82Í\82 \82Á\82½\82ç\82¢\82¢\82È\92ö\93x)\r
+\r
+\r
+\r
+----------------------------------------------------------------------------\r
+original readme\r
+----------------------------------------------------------------------------\r
+\r
+\r
+\81| BonTsDemux Ver.1.10 \81|\r
+\r
+\r
+\82P\81D\8aT\97v\r
+\81@\81@\81EBon\83V\83\8a\81[\83Y\82ÌMPEG2-TS\8f\88\97\9d\83G\83\93\83W\83\93\81uBonTsEngine\81v\82ð\8eg\97p\82µ\82½\83T\83\93\83v\83\8b\83v\83\8d\83O\83\89\83\80\82Å\82·\81B\r
+\81@\81@\81ETS\83t\83@\83C\83\8b\82©\82ç\89f\91\9c(m2v)\82Æ\89¹\90º(aac/wav)\82ð\95ª\97£\82µ\82Ä\83t\83@\83C\83\8b\82É\8fo\97Í\82µ\82Ü\82·\81B\r
+\81@\81@\81EB-CAS\83J\81[\83h\82ª\90Ú\91±\82³\82ê\82Ä\82¢\82é\8fê\8d\87\82Í\83X\83N\83\89\83\93\83u\83\8b\82³\82ê\82½TS\83t\83@\83C\83\8b\82Ì\93Ç\82Ý\8d\9e\82Ý\82ª\89Â\94\\82Å\82·\81B\r
+\81@\81@\81E\83}\83\8b\83`\83`\83\83\83\93\83l\83\8b\82Ì\8fê\8d\87\82ÍPAT\82Å\8dÅ\8f\89\82Ì\83T\81[\83r\83X\82É\91®\82·\82é\83X\83g\83\8a\81[\83\80\82ª\95ª\97£\82³\82ê\82Ü\82·\81B\r
+\81@\81@\81EAAC\83f\83R\81[\83h\82ð\8eg\97p\82·\82é\8fê\8d\87\82Í\8fí\82É2ch\82É\83_\83E\83\93\83R\83\93\83o\81[\83g/\83A\83b\83v\83R\83\93\83o\81[\83g\82³\82ê\82Ü\82·\81B\r
+\r
+\81@\81@\81¦\96{\83\\83t\83g\83E\83F\83A\82Ì\93®\8dì\82É\82Í\81uMicrosoft Visual C++ 2005 SP1 \8dÄ\94Ð\95z\89Â\94\\83p\83b\83P\81[\83W\81v\82ª\95K\97v\82Å\82·\81B\r
+\81@\81@\81@\81@http://www.microsoft.com/downloads/details.aspx?displaylang=ja&FamilyID=200b2fd9-ae1a-4a14-984d-389c36f85647\r
+\r
+\r
+\82Q\81D\92\8d\88Ó\8e\96\8d\80\r
+\81@\81@\81EB-CAS\83J\81[\83h\82ð\8b\96\89Â\82³\82ê\82½\8b@\8aí\88È\8aO\82Å\8eg\97p\82·\82é\82±\82Æ\82ÍB-CAS\83J\81[\83h\82Ì\8c_\96ñ\96ñ\8a¼\82É\92ï\90G\82·\82é\89Â\94\\90«\82ª\82 \82é\r
+\81@\81@\81@\82½\82ß\81A\96{\83\\83t\83g\83E\83F\83A\82Í\8e©\8cÈ\82Ì\90Ó\94C\82É\82¨\82¢\82Ä\8eg\97p\82µ\82Ä\89º\82³\82¢\81B\r
+\81@\81@\81E\96{\83\\83t\83g\83E\83F\83A\82Í\89º\8bL\81u\8cö\8aJ\8bK\8ai\81v\82Ì\8bZ\8fp\8fî\95ñ\82É\8aî\82Ã\82«\81u\90³\8bK\82Ì\8eè\96@\81v\82ð\97p\82¢\82é\82æ\82¤\8eÀ\91\95\82³\82ê\82Ä\82¢\82Ü\82·\81B\r
+\81@\81@\81@\8f\83\90\88\82É\8bZ\8fp\93I\82È\8c\9f\8fØ\82ð\96Ú\93I\82Æ\82µ\82½\83T\83\93\83v\83\8b\83v\83\8d\83O\83\89\83\80\82Å\82 \82è\81A\91æ\8eO\8eÒ\82Ì\92m\93I\8dà\8eY\8c \82ð\90N\8aQ\82·\82é\89Â\94\\90«\82Ì\r
+\81@\81@\81@\82 \82é\96Ú\93I\82É\8eg\97p\82³\82ê\82é\82±\82Æ\82ð\8dì\8eÒ\82Í\88ê\90Ø\88Ó\90}\82µ\82Ä\82¨\82ç\82¸\81A\82Ü\82½\82±\82ê\82ç\82Ì\8ds\88×\82ð\8bÖ\8e~\82µ\82Ü\82·\81B\r
+\81@\81@\81E\96{\83\\83t\83g\83E\83F\83A\82Í\90³\8bK\82É\83\89\83C\83Z\83\93\83X\82³\82ê\82½B-CAS\83J\81[\83h\82ð\97p\82¢\82é\82±\82Æ\82É\82æ\82è\95\9c\8d\86\82ð\8ds\82¢\82Ü\82·\81B\r
+\81@\81@\81E\96{\83\\83t\83g\83E\83F\83A\92P\91Ì\82Å\82Í\82¢\82©\82È\82é\92\98\8dì\95¨\82Ì\8bZ\8fp\93I\95Û\8cì\8eè\92i\82à\89ñ\94ð\82·\82é\82±\82Æ\82Í\82Å\82«\82Ü\82¹\82ñ\81B\r
+\81@\81@\81E\96{\83\\83t\83g\83E\83F\83A\82Í\81u\83t\83\8a\81[\83\\83t\83g\81v\82Å\82·\81B\r
+\81@\81@\81E\96{\83\\83t\83g\83E\83F\83A\82ÍARIB\8bK\8ai\82É\93K\8d\87\82·\82é\82±\82Æ\82ð\95Û\8fá\82µ\82Ä\82¨\82ç\82¸\81A\82¢\82©\82È\82é\8eí\95Ê\82Ì\90»\95i\82É\82à\8aY\93\96\82µ\82Ü\82¹\82ñ\81B\r
+\81@\81@\81E\96{\83\\83t\83g\83E\83F\83A\82ð\8eg\97p\82µ\82½\8c\8b\89Ê\94­\90\82µ\82½\82¢\82©\82È\82é\91¹\8aQ\82à\8dì\8eÒ\82Í\90Ó\94C\82ð\95\89\82¤\82±\82Æ\82Í\82Å\82«\82Ü\82¹\82ñ\81B\r
+\81@\81@\81E\96{\83T\83\93\83v\83\8b\83v\83\8d\83O\83\89\83\80\82Ì\83\\81[\83X\83R\81[\83h\82Ì\8eæ\82è\88µ\82¢\82ÍGPL\82É\8f]\82¤\82±\82Æ\82Æ\82µ\82Ü\82·\81B\r
+\r
+\81@\81@\82±\82ê\82ç\82É\93¯\88Ó\92¸\82¯\82é\8fê\8d\87\82É\82Ì\82Ý\81A\96{\83\\83t\83g\83E\83F\83A\82Ì\8eg\97p\82ð\8b\96\89Â\92v\82µ\82Ü\82·\81B\r
+\r
+\r
+\82R\81D\83\89\83C\83Z\83\93\83X\82É\82Â\82¢\82Ä\r
+\81@\81@\81E\96{\83p\83b\83P\81[\83W\82É\8aÜ\82Ü\82ê\82é\91S\82Ä\82Ì\83\\81[\83X\83R\81[\83h\81A\83o\83C\83i\83\8a\82É\82Â\82¢\82Ä\92\98\8dì\8c \82Í\88ê\90Ø\8eå\92£\82µ\82Ü\82¹\82ñ\81B\r
+\81@\81@\81E\83I\83\8a\83W\83i\83\8b\82Ì\82Ü\82Ü\96\94\82Í\89ü\95Ï\82µ\81A\8ae\8e©\82Ì\83\\83t\83g\83E\83F\83A\82É\8e©\97R\82É\93Y\95t\81A\91g\82Ý\8d\9e\82Þ\82±\82Æ\82ª\82Å\82«\82Ü\82·\81B\r
+\81@\81@\81E\92A\82µGPL\82É\8f]\82¤\82±\82Æ\82ð\97v\8b\81\82µ\82Ü\82·\82Ì\82Å\82±\82ê\82ç\82ð\8ds\82¤\8fê\8d\87\82Í\83\\81[\83X\83R\81[\83h\82Ì\8aJ\8e¦\82ª\95K\90{\82Æ\82È\82è\82Ü\82·\81B\r
+\81@\81@\81E\82±\82Ì\82Æ\82«\96{\83\\83t\83g\83E\83F\83A\82Ì\92\98\8dì\8c \95\\8e¦\82ð\8ds\82¤\82©\82Ç\82¤\82©\82Í\94C\88Ó\82Å\82·\81B\r
+\81@\81@\81E\96{\83\\83t\83g\83E\83F\83A\82ÍFAAD2\82Ì\83\89\83C\83u\83\89\83\8a\94Å\83o\83C\83i\83\8a\82ð\8eg\97p\82µ\82Ä\82¢\82Ü\82·\81B\r
+\r
+\81@\81@\81@"Code from FAAD2 is copyright (c) Nero AG, www.nero.com"\r
+\r
+\81@\81@\81E\83r\83\8b\83h\82É\95K\97v\82È\8aÂ\8b«\r
+\81@\81@\81@- Microsoft Visual Studio 2005 \88È\8fã\81@\81¦MFC\82ª\95K\97v\r
+\81@\81@\81@- Microsoft Windows SDK v6.0 \88È\8fã\r
+\r
+\r
+\82S\81D\8eQ\8dl\95\8c£\r
+\81@\81@\81EARIB STD-B10\r
+\81@\81@\81EARIB STD-B24\r
+\81@\81@\81EARIB STD-B25\r
+\81@\81@\81EARIB STD-B32\r
+\81@\81@\81EISO/IEC 11172-3\r
+\81@\81@\81EISO/IEC 13818-1\r
+\81@\81@\81EISO/IEC 13818-2\r
+\81@\81@\81EISO/IEC 13818-7\r
+\r
+\81@\81@\81E\82Ü\82é\82à\90»\8dì\8f\8a\81uARIB STD-B25 \8ed\97l\8am\94F\83e\83X\83g\83v\83\8d\83O\83\89\83\80\81v\r
+\81@\81@\81EMeru\8e\81\81uBonTsEngine\89ü\91¢\94Å\81v\r
+\81@\81@\81EMeru\8e\81\81uCapUSB M-Edition\81v\r
+\81@\81@\81E\8dì\8eÒ\95s\96¾\81uMpeg2-TS\82Ì\83X\83g\83\8a\81[\83\80\82©\82ç\83f\81[\83^\95ú\91\97\8fî\95ñ\82ð\92\8a\8fo\82·\82é\83e\83X\83g\81v\r
+\81@\81@\81EMicrosoft DirectX 9.0\81uPSI \83p\81[\83T\81\83t\83B\83\8b\83\83T\83\93\83v\83\8b\81v\r
+\r
+\r
+\82T\81D\83T\83|\81[\83g\81A\98A\97\8d\90æ\r
+\81@\81@\81@\98A\97\8d\90æ\81@\81@\81F\81@\8ag\92£\83c\81[\83\8b\92\86\82Ì\90l\81@\81@nakanohito@2sen.dip.jp\r
+\81@\81@\81@\8cö\8e®\83T\83C\83g\81F\81@http://2sen.dip.jp/friio/\r
+\r
+\82U\81D\8dX\90V\97\9a\97ð\r
+\81@Ver.1.10 \81E\89f\91\9c\82Æ\89¹\90º\82Ì\8aJ\8en\88Ê\92u\82ð\93¯\8aú\82³\82¹\82é\8b@\94\\82ð\92Ç\89Á\81B\r
+\81@\81@\81@\81@\81\81E\89¹\90º\8fo\97Í\83t\83@\83C\83\8b\96¼\82ª\94½\89f\82³\82ê\82È\82©\82Á\82½\95s\8bï\8d\87\8fC\90³\81B\r
+\r
+\81@Ver.1.00 \81E\8f\89\89ñ\83\8a\83\8a\81[\83X\r
diff --git a/tstools/BonTsDemux/cap_sts_sea.ini b/tstools/BonTsDemux/cap_sts_sea.ini
new file mode 100755 (executable)
index 0000000..a73ec86
--- /dev/null
@@ -0,0 +1,18 @@
+[FFMPEG_SETTING]\r
+\r
+\r
+MPEG2PS                =-f dvd -vcodec copy -aspect 16:9 -acodec libmp3lame -ar 48000 -ab 192k -vol 256 -y\r
+MPEG2PS_EXT    =mpg\r
+\r
+MPEG2PS_AC3 =-f dvd -vcodec copy -aspect 16:9 -acodec ac3 -ar 48000 -ab 448k -vol 256 -y
+MPEG2PS_AC3_EXT = mpg
+MPEG2PS_MP2 =-f dvd -vcodec copy -aspect 16:9 -acodec mp2 -ar 48000 -ab 384k -vol 256 -y
+MPEG2PS_MP2_EXT = mpg
+DVD_1h =-target ntsc-dvd -b 8000k -aspect 16:9 -acodec ac3 -ar 48000 -ab 192k -vol 256 -y
+DVD_1h_EXT = mpg
+DVD_2h =-target ntsc-dvd -b 4600k -aspect 16:9 -acodec ac3 -ar 48000 -ab 192k -vol 256 -y
+DVD_2h_EXT = mpg
+DVD_3h =-target ntsc-dvd -b 3050k -aspect 16:9 -acodec ac3 -ar 48000 -ab 192k -vol 256 -y
+DVD_3h_EXT = mpg
+DVD_4h =-target ntsc-dvd -b 2200k -aspect 16:9 -acodec ac3 -ar 48000 -ab 192k -vol 256 -y
+DVD_4h_EXT = mpg\r
diff --git a/tstools/BonTsDemux/ffmpeg.exe b/tstools/BonTsDemux/ffmpeg.exe
new file mode 100755 (executable)
index 0000000..a8b45c1
Binary files /dev/null and b/tstools/BonTsDemux/ffmpeg.exe differ
diff --git a/tstools/DtsEdit/DtsEdit.exe b/tstools/DtsEdit/DtsEdit.exe
new file mode 100644 (file)
index 0000000..9b0dff8
Binary files /dev/null and b/tstools/DtsEdit/DtsEdit.exe differ
diff --git a/tstools/DtsEdit/License.txt b/tstools/DtsEdit/License.txt
new file mode 100644 (file)
index 0000000..17bdbc0
--- /dev/null
@@ -0,0 +1,18 @@
+\96{\83A\81[\83J\83C\83u\82É\8aÜ\82Ü\82ê\82é\83\\83t\83g\83E\83F\83A\82ÍGPL\82Ì\8c³\8cö\8aJ\82³\82ê\82Ä\82¢\82Ü\82·\81B\r
+\94z\95z\8aÈ\88Õ\89»\82Ì\82½\82ß\83\\81[\83X\82Í\93Y\95t\82µ\82Ä\82¢\82Ü\82¹\82ñ\82ª\81A\82Ç\82È\82½\82Å\82à\83\\81[\83X\82Ì\r
+\93ü\8eè\82Í\89Â\94\\82Å\82·\81B\r
+\82²\97v\96]\82Ì\8dÛ\82É\82Í\81A\94z\95z\83T\83C\83g\82Ì\8cf\8e¦\94Â\81E\82à\82µ\82­\82Í\83\81\81[\83\8b\82É\82Ä\82²\98A\97\8d\r
+\82­\82¾\82³\82¢\81B\r
+\r
+\8f®\81A\82²\8aó\96]\82Ì\94z\95z\94}\91Ì\82É\82æ\82Á\82Ä\82Í\8eè\90\94\97¿\82ð\92¸\82­\8fê\8d\87\82à\82²\82´\82¢\82Ü\82·\82ª\81A\r
+Http\8co\97R\82Å\82 \82ê\82Î\96³\97¿\82Å\82·\81B\r
+\91Î\89\9e\82Ü\82Å\82É1\8fT\8aÔ\92ö\93x\82Ì\8e\9e\8aÔ\82ð\92¸\82­\8fê\8d\87\82ª\82 \82è\82Ü\82·\81B\r
+\83\81\81[\83\8b\82ð\91\97\90M\82µ\82½\82Ì\82É\94½\89\9e\82ª\82È\82¢\8fê\8d\87\82Í\81A\83X\83p\83\80\83t\83B\83\8b\83^\82É\82æ\82Á\82Ä\r
+\8dí\8f\9c\82³\82ê\82Ä\82µ\82Ü\82Á\82½\89Â\94\\90«\82à\82 \82è\82Ü\82·\82Ì\82Å\81A\8cf\8e¦\94Â\82Ü\82Å\82²\98A\97\8d\82­\82¾\82³\82¢\81B\r
+\r
+\94z\95z\83T\83C\83g\r
+http://seraphy.fam.cx/~seraphy\r
+http://seraphy.luna.ddns.vc/~seraphy\r
+\r
+\98A\97\8d\90æ\r
+seraphy@seraphy.fam.cx\r
diff --git a/tstools/DtsEdit/gpl.txt b/tstools/DtsEdit/gpl.txt
new file mode 100644 (file)
index 0000000..94a9ed0
--- /dev/null
@@ -0,0 +1,674 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program 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 3 of the License, or
+    (at your option) any later version.
+
+    This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+    <program>  Copyright (C) <year>  <name of author>
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+  The GNU General Public License does not permit incorporating your program
+into proprietary programs.  If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.  But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/tstools/DtsEdit/readme.txt b/tstools/DtsEdit/readme.txt
new file mode 100644 (file)
index 0000000..1e9f0a5
--- /dev/null
@@ -0,0 +1,130 @@
+\r
+*****************************************************************************\r
+*\r
+* DtsEdit.exe\r
+*\r
+*****************************************************************************\r
+\81y\8aT\97v\81z\r
+\81EMP4(AVC)\83R\83\93\83e\83i\82É\91Î\82µ\82Ä\81A\83^\83C\83\80\83R\81[\83h\82Ì\93ü\8fo\97Í\82ð\8ds\82¢\82Ü\82·\81B\r
+\81E\91Î\89\9e\82µ\82Ä\82¢\82é timecode format \82Í\81Av1\81Av2\82É\82È\82è\82Ü\82·\81B\r
+\r
+\r
+\81y\8eg\82¢\95û\81z\r
+Usage: DtsEdit <option> <mp4 file>\r
+\r
+option list\r
+        -tc <file name>       : \93ü\97Í\82·\82éTimeCode\83t\83@\83C\83\8b\82ð\8ew\92è\82µ\82Ü\82·\81B\r
+                                -tc\82ª\8ew\92è\82³\82ê\82½\8fê\8d\87\82Í\81ATimeCode\82ð\8ew\92è\82ÌMP4\83t\83@\83C\83\8b\82É\96\84\82ß\8d\9e\82Ý\82Ü\82·\81B\r
+                                \8ew\92è\82³\82ê\82È\82©\82Á\82½\8fê\8d\87\82Í\81AMP4\83t\83@\83C\83\8b\82©\82çTimeCode\82ð\92\8a\8fo\82µ\82Ü\82·\81B\r
+        -tv <1|2>             : \93ü\8fo\97Í\82·\82éTimeCode\83t\83@\83C\83\8b\82Ì\83o\81[\83W\83\87\83\93\82ð\8ew\92è\82µ\82Ü\82·\81B\83f\83t\83H\83\8b\83g\82Í2\82Å\82·\81B\r
+        -s <time scale>       : timeScale\82ð\8ew\92è\82µ\82Ü\82·\81B\r
+                                \96¢\8ew\92è\82Ì\8fê\8d\87\82Í\81A\93ü\97Í\82³\82ê\82½timecode format\82É\82æ\82Á\82Ä\8e©\93®\8cv\8eZ\82³\82ê\82Ü\82·\81B\r
+        -mlt <multiple>       : timeScale\82Ì\8e©\93®\8cv\8eZ\82É\8eg\97p\82µ\82Ü\82·\81B\r
+                                \83f\83t\83H\83\8b\83g\92l\82Í4.0\94{\82Å\82·\81BtimeScale\82ð\92¼\90Ú\8ew\92è\82µ\82½\8fê\8d\87\82Í\81A\93à\95\94\82Ì\8cv\8eZ\8c\8b\89Ê\82Å\8fã\8f\91\82«\82³\82ê\82Ü\82·\81B\r
+        -r <time rate>        : \8dÅ\8f¬timeRate\82ð\8ew\92è\82µ\82Ü\82·\81B\r
+                                \96¢\8ew\92è\82Ì\8fê\8d\87\82Í\81A\93ü\97Í\82³\82ê\82½MP4\83t\83@\83C\83\8b\82É\8f]\82¢\82Ü\82·\81B\r
+        -no-dc                : \8f\89\8aú\83f\83B\83\8c\83C\83J\83b\83g\82ð\96³\8cø\82É\82µ\82Ü\82·\81B\r
+        -df <count>           : \8f\89\8aú\83f\83B\83\8c\83C\82ð\95t\97^\82·\82é\8fê\8d\87\82Ì\81A\83f\83B\83\8c\83C\83t\83\8c\81[\83\80\90\94\82ð\8ew\92è\82µ\82Ü\82·\81B\r
+                                \96¢\8ew\92è\82Ì\8fê\8d\87\82Í\81A\93ü\97Í\82³\82ê\82½MP4\83t\83@\83C\83\8b\82©\82ç\8e©\93®\8cv\8eZ\82µ\82Ü\82·\81B\r
+                                \8dÄ\90\8e\9e\8aÔ\82Ì\92Z\82¢\93®\89æ\82Å\82Í\90³\8am\82É\8eæ\93¾\82Å\82«\82È\82¢\8fê\8d\87\82ª\82 \82è\82Ü\82·\81B\r
+        -o <output file>      : \8fo\97Í\83t\83@\83C\83\8b\82ð\8ew\92è\82µ\82Ü\82·\81B\r
+\r
+\r
+  \81 TimeCode\82ð\8fo\97Í\82·\82é\81B\r
+    \8aî\96{\93I\82É\83I\83v\83V\83\87\83\93\82Ì\8ew\92è\82Í\95s\97v\82Å\82·\81B\r
+    timecode format v1 \82ð\8fo\97Í\82µ\82½\82¢\8fê\8d\87\82Í\81A\83I\83v\83V\83\87\83\93\82É\81u-tv 1\81v\82ð\8ew\92è\82µ\82Ü\82·\81B\r
+\r
+  \81 TimeCode\82ð\93ü\97Í\82·\82é\81B\r
+    TimeScale\81ATimeRate\82ð\8e©\93®\94»\92è\82·\82é\82½\82ß\81A\83I\83v\83V\83\87\83\93\82ð\8ew\92è\82µ\82È\82­\82Ä\82à\93ü\97Í\82µ\82½TimeCode\82É\82 \82í\82¹\82Ä\93K\90Ø\82È\92l\82ª\90Ý\92è\82³\82ê\82Ü\82·\81B\r
+    TimeCode\93ü\97Í\82ÍVFR\89»\82ð\91O\92ñ\82É\82µ\82Ä\82¢\82Ü\82·\82Ì\82Å\81ATimeScale\82Í4\94{\90¸\93x\82Å\8cv\8eZ\82³\82ê\82Ü\82·\81B\r
+    \90¸\93x\82ð\95Ï\8dX\82µ\82½\82¢\8fê\8d\87\82Í\81A-mlt\83I\83v\83V\83\87\83\93\82ð\97\98\97p\82µ\82Ü\82·\81B\81i\8f­\90\94\8ew\92è\82ª\89Â\94\\82Å\82·\81j\r
+    \96Ú\93I\82ÌTimeScale\82ª\96¾\8am\82È\8fê\8d\87\82Í\81A-s\83I\83v\83V\83\87\83\93\82ð\97\98\97p\82µ\82Ü\82·\81B\82»\82Ì\82Æ\82«\81ATimeRate\82Í\93ü\97Í\8c³\82Ì\83t\83@\83C\83\8b\82É\8f]\82¢\82Ü\82·\82Ì\82Å\92\8d\88Ó\82ª\r
+    \95K\97v\82Å\82·\81B\r
+\r
+    \81¦TimeRate\82É\82Â\82¢\82Ä\81B\r
+      fps\82ð\95ª\90\94\82Å\95\\8c»\82µ\82½\8fê\8d\87\82Ì\95ª\95ê\82É\82 \82½\82è\82Ü\82·\81B\95W\8f\80NTSC\82Å\82 \82ê\82Î29.97fps\82Å\82·\82ª\81A\90³\8am\82É\82Í\82±\82Ì\82Æ\82«\82Ìfps\82Í\8fz\8aÂ\8f¬\90\94\82Å\82 \82è\81A\r
+      30000/1001\82Æ\95\\8bL\82µ\82Ü\82·\81B\r
+      \82±\82Ì\8fê\8d\87\81ATimeScale\82Í30000\81ATimeRate\82Í1001\82Æ\82È\82è\82Ü\82·\81B\r
+\r
+      \82à\82µ\94ñNTSC\83\\81[\83X\82ð\88µ\82¤\8fê\8d\87\82Í\8f\88\97\9d\8c\8b\89Ê\82Ì\95\\8e¦\82ð\8am\94F\82µ\82Ä\82­\82¾\82³\82¢\81B\r
+      \97á\82¦\82Î30fps\82Ì\93®\89æ\82Ì\8fê\8d\87\82Í\81ATimeRate\82Í1\82Å\82à\8d\\82¢\82Ü\82¹\82ñ\81B\81i\82»\82Ì\82Æ\82«\82ÌTimeScale\82Í120\82Æ\8e©\93®\8cv\8eZ\82³\82ê\82Ü\82·\81B\81j\r
+      \83f\83B\83\8c\83C\83t\83\8c\81[\83\80\82ª3\83t\83\8c\81[\83\80\88È\8fã\82 \82é\8fê\8d\87\82Í\81ATimeRate\82ª1\82Å\82Í\8f\89\8aú\83f\83B\83\8c\83C\83J\83b\83g\82É\8e¸\94s\82µ\82Ü\82·\81B\r
+      \82»\82Ì\8fê\8d\87\82ÍTimeRate\82ð10\82É\95Ï\8dX\82·\82é\82È\82Ç\82µ\82Ä\82­\82¾\82³\82¢\81B\r
+\r
+    \81¦\94{\90¸\93x\82É\82Â\82¢\82Ä\r
+      VFR\82ð\8eÀ\8c»\82·\82é\82É\82 \82½\82è\81ANTSC\82Ì\95\\8e¦\83^\83C\83~\83\93\83O\82ð\95ö\82³\82È\82¢\82æ\82¤\82É\82·\82é\82½\82ß\82ÉTimeScale\82ðn\94{\82µ\82Ü\82·\81B\r
+      \97á\82¦\82Î23.976fps\82Æ29.97fps\82Ì\8d¬\8d\87\83t\83\8c\81[\83\80\83\8c\81[\83g\82Å\82 \82Á\82½\8fê\8d\87\81A\82±\82ê\82ð\95ª\90\94\95\\8c»\82·\82é\82Æ24000/1001\81A30000/1001\82Æ\82È\82è\82Ü\82·\81B\r
+      \91å\82«\82¢\82Ù\82¤\82ÌTimeScale 30000\82É\82 \82í\82¹\82é\82Æ\81A24000/1001 => 30000/1251.25 \82Æ\82È\82Á\82Ä\82µ\82Ü\82¢\81A\95ª\8eq\82É\92[\90\94\82ª\94­\90\82µ\82Ä\82µ\82Ü\82¢\82Ü\82·\81B\r
+      \82»\82±\82Å\81A\91å\82«\82¢\82Ù\82¤\82ÌTimeScale\82ð4\94{\82É\82µ120000/5005\81A120000/4004\82Æ\90®\90\94\82Å\95\\82·\82±\82Æ\82Å\81A\95\\8e¦\83^\83C\83~\83\93\83O\82ð\95ö\82³\82¸\82É\83t\83\8c\81[\83\80\r
+      \83\8c\81[\83g\82Ì\8d¬\8d\87\82ð\8eÀ\8c»\82µ\82Ä\82¢\82Ü\82·\81B\r
+      \82³\82ç\82É59.94fps(60000/1001)\82ð\8d¬\8d\87\82·\82é\8fê\8d\87\82à\81A120000/2002\82Æ\95\\8c»\82Å\82«\82é\82Ì\82Å\82»\82Ì\82Ü\82Ü\8d¬\8d\87\82ª\89Â\94\\82Å\82·\81B\r
+      \81i\82½\82¾\82µ\81A\94{\90¸\93x\82Ì\83f\83t\83H\83\8b\83g\92l\82Í4\94{\82É\82È\82Á\82Ä\82¢\82Ü\82·\82Ì\82Å\81A\8fã\82Ì\97l\82ÈTimeCode\82ð\93ü\97Í\82µ\82½\8fê\8d\87\82Í\81A240000/10010\81A240000/8008\81A\r
+      240000/4004\82Æ\82¢\82¤\8cv\8eZ\8c\8b\89Ê\82É\82È\82è\82Ü\82·\81B\81j\r
+      TimeCode\82ªCFR\82É\82È\82Á\82Ä\82¢\82é\8fê\8d\87\82Í\81A\81u-mlt 1\81v\82Æ\82µ\82Ä\8f\88\97\9d\82µ\82Ä\82à\96â\91è\82 \82è\82Ü\82¹\82ñ\82ª\81A\8f\89\8aú\83f\83B\83\8c\83C\83J\83b\83g\82ð\8ds\82¤\82É\82 \82½\82è\88ê\92è\8fã\82Ì\r
+      TimeScale\95ª\89ð\94\\81iTimeRate\82Ì\91å\82«\82³\81j\82ª\95K\97v\82Å\82·\81B\r
+\r
+    \81¦\83f\83B\83\8c\83C\83t\83\8c\81[\83\80\90\94\82É\82Â\82¢\82Ä\r
+      \8c¾\82¢\8a·\82¦\82é\82Æ\81u\91O\95û\8eQ\8fÆ\83t\83\8c\81[\83\80\82Ì\98A\91±\90\94\81v\82É\82È\82è\82Ü\82·\81B\r
+      DtsEdit\82Å\82Í\81A\82±\82Ì\83t\83\8c\81[\83\80\90\94\82ðCTS\81iComposition Time Stamp\81j\82Ì\8f\87\8f\98\90«\82ð\83`\83F\83b\83N\82·\82é\82±\82Æ\82Å\8e©\93®\8eZ\8fo\82µ\82Ä\82¢\82Ü\82·\81B\r
+      \8f\\95ª\82È\92·\82³\82Ì\93®\89æ\82Å\82Í\82È\82¢\8fê\8d\87\81A\8e©\93®\8eZ\8fo\82ª\82¤\82Ü\82­\93®\8dì\82µ\82È\82¢\8fê\8d\87\82ª\82 \82è\82Ü\82·\81B\r
+      \8f®\81A\82±\82Ì\90\94\92l\82Í\8f\89\8aú\83f\83B\83\8c\83C\83J\83b\83g\82ð\96³\8cø\89»\82µ\82½\8fê\8d\87\82É\8eg\97p\82µ\82Ü\82·\81B\r
+      \8f\88\97\9d\8c\8b\89Ê\82É\95\\8e¦\82³\82ê\82é\81uDelay Frame\81v\82Ì\96\87\90\94\82ª\81A\93ü\97Í\8c³\83t\83@\83C\83\8b\82Ì\96{\97\88\82Ì\96\87\90\94\82Æ\88á\82¤\8fê\8d\87\82Í\81A-df\83I\83v\83V\83\87\83\93\82É\82Ä\92ù\90³\82µ\82Ä\82­\82¾\82³\82¢\81B\r
+\r
+\r
+\81y\92\8d\88Ó\8e\96\8d\80\81z\r
+\81E\83p\83\89\83\81\81[\83^\82Ì\94Í\88Í\83`\83F\83b\83N\82È\82Ç\82Í\8ds\82Á\82Ä\82¢\82È\82¢\82Ì\82Å\81A\82©\82È\82è\96³\92\83\82È\8ew\92è\82à\82Å\82«\82Ä\82µ\82Ü\82¢\82Ü\82·\81B\r
+\81E\82²\97\98\97p\82Í\8cv\89æ\93I\82É\81B\r
+\r
+\r
+\81y\8fC\90³\97\9a\97ð\81z\r
+    \81 20081009\r
+      \81E1fps\81`120fps\82ª\8d¬\8dÝ\82·\82é\82æ\82¤\82È\95Ï\91ÔVFR\82Å\82È\82¢\82©\82¬\82è\81A\8f\89\8aú\83f\83B\83\8c\83C\82Í\95½\8bÏfps\82©\82ç\8eZ\8fo\82µ\82Ä\82à\91å\8fä\95v\82»\82¤\r
+        \82È\82Ì\82Å\8fC\90³\81B\83_\83\81\82¾\82Á\82½\8fê\8d\87\82Í\83G\83\89\81[\82ð\95\\8e¦\82·\82é\82æ\82¤\82É\82µ\82½\81B\r
+        timecode format v2 \82ð\8eæ\82è\8d\9e\82Þ\82Æ\82«\81ATimeStamp\82ª\90®\90\94\82É\8aÛ\82ß\82ç\82ê\82Ä\82¢\82Ä\82à\81ATimeRate\82©\82ç\96{\97\88\82ÌTimeStamp\r
+        \82ð\95\9c\8c³\82Å\82«\82é\82æ\82¤\82É\82µ\82½\81B\r
+\r
+    \81 20081008\r
+      \81E -no-dc \82ð\8eg\97p\82µ\81A\90¸\93x\82ð4\94{\96¢\96\9e\82Åtimecode\82ð\8eæ\82è\8d\9e\82ñ\82¾\8fê\8d\87\81A\95t\97^\82·\82é\83f\83B\83\8c\83C\82ª\8f¬\82³\82·\82¬\82Ä\r
+        DTS\82Ì\89Â\95Ï\94Í\88Í\82ð\8b·\82ß\82Ä\82µ\82Ü\82¢\81ADTS\82ª\82¸\82ê\82é\82±\82Æ\82É\82æ\82è\8eÀ\8dÛ\82Ì\83t\83\8c\81[\83\80\82Ì\95\\8e¦\83^\83C\83~\83\93\83O\82Ü\82Å\82¸\82ê\82Ä\r
+        \82µ\82Ü\82¤\96â\91è\82ª\82 \82Á\82½\82½\82ß\8fC\90³\81B\r
+\r
+        \82±\82Ì\8fC\90³\82É\82æ\82è\81A\95t\97^\82·\82é\83f\83B\83\8c\83C\82Í\81u\83f\83B\83\8c\83C\83t\83\8c\81[\83\80\90\94 * TimeRate * \90¸\93x\81v\82©\82ç\81A\r
+        \81u\83f\83B\83\8c\83C\83t\83\8c\81[\83\80\90\94 * \8dÅ\8f¬fps\81v\82É\95Ï\82í\82è\82Ü\82µ\82½\81B\8bÉ\92[\82Éfps\82Ì\92á\82¢\95\94\95ª\82ª\82 \82éTimeCode\82ð\8eæ\82è\8d\9e\82Þ\82Æ\81A\r
+        \83f\83B\83\8c\83C\82ª\91å\82«\82­\82È\82é\82Ì\82Å\92\8d\88Ó\82µ\82Ä\82­\82¾\82³\82¢\81B\r
+        \81i\81¦\8f\89\8aú\83f\83B\83\8c\83C\83J\83b\83g\82ð\8eg\97p\82µ\82½\8fê\8d\87\82Í\81A\96â\91è\82 \82è\82Ü\82¹\82ñ\81B\81j\r
+\r
+    \81 20080614\r
+      \81EGPAC\82Ì\8dÅ\90V\89»\81B\r
+\r
+    \81 20080511\r
+      \81E\83g\83\89\83b\83N\95¡\90»\8e\9e\82É\81A\93ü\97Í\8c³\83t\83@\83C\83\8b\82Ìedit box\82ª\83R\83s\81[\82³\82ê\82é\82Ì\82Å\8dí\8f\9c\82·\82é\82æ\82¤\82É\8fC\90³\81B\r
+\r
+    \81 20080328\r
+      \81E\8f\89\8aú\83f\83B\83\8c\83C\83J\83b\83g\82ð\8ds\82í\82È\82¢\82Æ\82«\82Í\81Aedts\82ð\91}\93ü\82µ\82Ä\8f\89\8aú\83f\83B\83\8c\83C\82ð\91Å\82¿\8fÁ\82·\82æ\82¤\82É\82µ\82Ä\82Ý\82½\81B\r
+        \82Å\82à\81Aedts\82É\91Î\89\9e\82µ\82½splitter\81Aplayer\82ð\92m\82ç\82È\82¢\81c  QuickTime\82Í\91Î\89\9e\82µ\82Ä\82¢\82é\82Ì\82©\82È\81H\r
+        \8eè\8c³\82Å\8am\94F\82µ\82½\8cÀ\82è\82¾\82ÆVLC\82Í\91Î\89\9e\82µ\82Ä\82Ü\82µ\82½\81BGabest\82Í\83_\83\81\81BHaali\82Í\8c³\81X\83f\83B\83\8c\83C\83J\83b\83g\82·\82é\82Ì\82Å\r
+        \82»\82à\82»\82à\88Ó\96¡\82È\82µ\81B\r
+\r
+        \88ê\89\9emp4\82Æ\82µ\82Ä\82Í\81A\8f\89\8aú\83f\83B\83\8c\83C\83J\83b\83g\82ªhack\82Û\82¢\91Î\89\9e\82Å\81Aedts\96\84\82ß\8d\9e\82Ý\82ª\8bK\8ai\92Ê\82è\82Ì\89¤\93¹\81B\r
+        \82µ\82©\82µ\8c»\8fó\82Í\81Ahack\82Ì\95û\82ª\8cÝ\8a·\90«\82ª\8d\82\82¢\82Æ\82¢\82¤\94ß\82µ\82¢\8fó\8bµ\81B\r
+        \82È\82ñ\82Å\91Î\89\9e\82µ\82Ä\82¢\82È\82¢\83\\83t\83g\82ª\82 \82é\82Ì\82©\82Í\82¨\8e@\82µ\81c\r
+\r
+        \82È\82ñ\82Æ\81AHaali splitter\82Íedts\82ð\96³\8e\8b\82·\82é\82Ì\82Å\82Í\82È\82­\81A\8cë\94F\82µ\82Ä\8cë\93®\8dì\82µ\82Ü\82·\81B\r
+        \82È\82ñ\82¾\82©2\94N\91O\82Æ\82Ü\82é\82Å\8fó\8bµ\82ª\95Ï\82í\82Á\82Ä\82È\82¢\82í\82¯\82Å\82·\82Ë\81B\82Æ\82¢\82¤\82í\82¯\82Åedts\91Î\89\9e\82Í2\94N\8cã\82É\82à\82¤\88ê\89ñ\r
+        \83`\83\83\83\8c\83\93\83W\82µ\82Ü\82·\81B\r
+        \82±\82Ì\83o\81[\83W\83\87\83\93\82Í\82¨\91 \93ü\82è\81B\r
+\r
+    \81 20080327\r
+      \81ETimeScale\81ATimeRate\82Ì\8e©\93®\8cv\8eZ\8f\88\97\9d\82ð\8eÀ\91\95\81B\r
+        \82±\82ê\82É\94º\82¢\81A\83I\83v\83V\83\87\83\93\82ð\88ê\95\94\95Ï\8dX\81B\r
+\r
+    \81 20080314\r
+      \81E\82¢\82ë\82¢\82ë\8dl\82¦\82Ä\81Atimecode format v1 \82ÌAssume\82É\82Í\95½\8bÏ\82Å\82Í\82È\82­\8dÅ\91åfps\82ð\8fo\97Í\82·\82é\r
+        \82æ\82¤\82É\82µ\82Ä\82Ý\82½\81B\r
+        v1\93ü\97Í\8e\9e\82ÌtimeScale\82Í\81A\82±\82ÌAssume\82©\82ç\8cv\8eZ\82µ\82Ü\82·\81B\r
+\r
+    \81 20080313\r
+      \81E\97\\91z\88È\8fã\82É\81ADTSRepair\82ð timecode \82Ì\93ü\8fo\97Í\82É\8eg\82¤\90l\82ª\82¢\82½\82æ\82¤\82È\82Ì\82Å\81A\8b}ç¯\8dì\90¬\81B\r
+        DTSRepair\82Í\96¼\91O\82Ì\92Ê\82èDTS\82ðNTSC\83^\83C\83~\83\93\83O\82É\8b¸\90³\82·\82é\82½\82ß\82Ì\83\\83t\83g\82Å\82·\82Ì\82Å\81A\r
+        \91¼\82Ì\83^\83C\83~\83\93\83O\82ÌMP4\83t\83@\83C\83\8b\82É\8eg\97p\82·\82é\82Æ\81A\82©\82È\82è\82Ì\8am\97¦\82Å\83_\83\81\82É\82µ\82Ä\82µ\82Ü\82¢\82Ü\82·\81B\r
+\r
diff --git a/tstools/DtsEdit/src/DtsEdit.cpp b/tstools/DtsEdit/src/DtsEdit.cpp
new file mode 100644 (file)
index 0000000..e7682c3
--- /dev/null
@@ -0,0 +1,142 @@
+// DTSRepair.cpp : \83R\83\93\83\\81[\83\8b \83A\83v\83\8a\83P\81[\83V\83\87\83\93\82Ì\83G\83\93\83g\83\8a \83|\83C\83\93\83g\82ð\92è\8b`\82µ\82Ü\82·\81B\r
+//\r
+\r
+#include "stdafx.h"\r
+#include "Help.h"\r
+#include "EditMain.h"\r
+#include "windows.h"\r
+\r
+#define EXIST(s) (GetFileAttributes(s) != 0xFFFFFFFF)\r
+\r
+int main(int argc, char* argv[])\r
+{\r
+       int ret = -1;\r
+       T_EDIT_PARAM prm;\r
+\r
+       ZeroMemory(&prm, sizeof(T_EDIT_PARAM));\r
+\r
+       // \83R\83}\83\93\83h\83\89\83C\83\93\83`\83F\83b\83N\r
+       if (argc < 2){\r
+               Help();\r
+               return ret;\r
+       }\r
+\r
+       // \8f\89\8aú\92l\r
+       prm.i_mode = MODE_OUT;\r
+       prm.i_tcv = 2;\r
+       prm.i_timescale = 0;\r
+       prm.i_timerate = 0;\r
+       prm.f_scaleFct = 0;\r
+       prm.f_mlt = 4.0;\r
+       prm.i_delayFrame = -1;\r
+       prm.b_dc = TRUE;\r
+\r
+       for(int i=1; i<argc; i++){\r
+               char *name = argv[i];\r
+               char *value = NULL;\r
+               char *value2 = NULL;\r
+               if((i+1)<argc)\r
+                       value = argv[i+1];\r
+\r
+               if(0){}\r
+\r
+#define OPT(x) else if (!_stricmp(x, name))\r
+\r
+               // \83^\83C\83\80\83R\81[\83h\r
+               OPT("-tc"){\r
+                       if(!value || prm.p_tcfile) goto _ERROR_ARG;\r
+                       prm.p_tcfile = new char[strlen(value) + 1];\r
+                       strcpy(prm.p_tcfile, value);\r
+                       prm.i_mode = MODE_IN;\r
+                       i++;            \r
+               }\r
+\r
+               // \83^\83C\83\80\83R\81[\83h\r
+               OPT("-tv"){\r
+                       if(!value) goto _ERROR_ARG;\r
+                       prm.i_tcv = atoi(value);\r
+                       i++;\r
+               }\r
+\r
+               // \83^\83C\83\80\83X\83P\81[\83\8b\r
+               OPT("-s"){\r
+                       if(!value) goto _ERROR_ARG;\r
+                       prm.i_timescale = atol(value);\r
+                       i++;\r
+               }\r
+\r
+               // \94{\90\94\r
+               OPT("-mlt"){\r
+                       if(!value) goto _ERROR_ARG;\r
+                       prm.f_mlt = atof(value);\r
+                       i++;\r
+               }\r
+\r
+               // \8dÅ\8f¬\83^\83C\83\80\83\8c\81[\83g\r
+               OPT("-r"){\r
+                       if(!value) goto _ERROR_ARG;\r
+                       prm.i_timerate = atol(value);\r
+                       i++;\r
+               }\r
+\r
+               // \8f\89\8aú\83f\83B\83\8c\83C\83J\83b\83g\r
+               OPT("-no-dc"){\r
+                       prm.b_dc = FALSE;\r
+               }\r
+\r
+               // \83f\83B\83\8c\83C\83t\83\8c\81[\83\80\90\94\r
+               OPT("-df"){\r
+                       if(!value) goto _ERROR_ARG;\r
+                       prm.i_delayFrame = atol(value);\r
+                       i++;\r
+               }\r
+\r
+               // \8fo\97Í\83t\83@\83C\83\8b\96¼\r
+               OPT("-o"){\r
+                       if(!value || prm.p_outfile) goto _ERROR_ARG;\r
+                       prm.p_outfile = new char[strlen(value) + 1];\r
+                       strcpy(prm.p_outfile, value);\r
+                       i++;\r
+               }\r
+\r
+               // \93ü\97Í\83t\83@\83C\83\8b\r
+               else if(EXIST(name)){\r
+                       if(prm.p_infile) goto _ERROR_ARG;\r
+                       prm.p_infile = new char[strlen(name) + 1];\r
+                       strcpy(prm.p_infile, name);\r
+               }\r
+\r
+               else {\r
+_ERROR_ARG:\r
+                       Help();\r
+                       goto _ERROR_RET;\r
+               }\r
+       }\r
+\r
+       // \83`\83F\83b\83N\8f\88\97\9d\r
+       if(prm.i_mode == MODE_IN && !EXIST(prm.p_tcfile)){\r
+               Help();\r
+               goto _ERROR_RET;\r
+       }\r
+\r
+       if(!prm.p_outfile){\r
+               prm.p_outfile = new char[strlen(prm.p_infile) + 20];\r
+               strcpy(prm.p_outfile, prm.p_infile);\r
+\r
+               if(prm.i_mode == MODE_IN)\r
+                       strcat(prm.p_outfile, "_tc_input.mp4");\r
+               if(prm.i_mode == MODE_OUT)\r
+                       strcat(prm.p_outfile, "_timecode.txt");\r
+       }\r
+\r
+       // \83\81\83C\83\93\8f\88\97\9d\r
+       EditMain(&prm);\r
+       ret = 0;\r
+\r
+_ERROR_RET:\r
+       if(prm.p_tcfile)        delete [] prm.p_tcfile;\r
+       if(prm.p_outfile)       delete [] prm.p_outfile;\r
+       if(prm.p_infile)        delete [] prm.p_infile;\r
+       return ret;\r
+}\r
+\r
diff --git a/tstools/DtsEdit/src/DtsEdit.sln b/tstools/DtsEdit/src/DtsEdit.sln
new file mode 100644 (file)
index 0000000..3f5dd16
--- /dev/null
@@ -0,0 +1,20 @@
+\r
+Microsoft Visual Studio Solution File, Format Version 10.00\r
+# Visual Studio 2008\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DtsEdit", "DtsEdit.vcproj", "{29DD06A3-83FD-4C25-8783-D93D9C3C671F}"\r
+EndProject\r
+Global\r
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
+               Debug|Win32 = Debug|Win32\r
+               Release|Win32 = Release|Win32\r
+       EndGlobalSection\r
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
+               {29DD06A3-83FD-4C25-8783-D93D9C3C671F}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {29DD06A3-83FD-4C25-8783-D93D9C3C671F}.Debug|Win32.Build.0 = Debug|Win32\r
+               {29DD06A3-83FD-4C25-8783-D93D9C3C671F}.Release|Win32.ActiveCfg = Release|Win32\r
+               {29DD06A3-83FD-4C25-8783-D93D9C3C671F}.Release|Win32.Build.0 = Release|Win32\r
+       EndGlobalSection\r
+       GlobalSection(SolutionProperties) = preSolution\r
+               HideSolutionNode = FALSE\r
+       EndGlobalSection\r
+EndGlobal\r
diff --git a/tstools/DtsEdit/src/DtsEdit.vcproj b/tstools/DtsEdit/src/DtsEdit.vcproj
new file mode 100644 (file)
index 0000000..864281a
--- /dev/null
@@ -0,0 +1,242 @@
+<?xml version="1.0" encoding="shift_jis"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="9.00"\r
+       Name="DtsEdit"\r
+       ProjectGUID="{29DD06A3-83FD-4C25-8783-D93D9C3C671F}"\r
+       RootNamespace="DtsEdit"\r
+       Keyword="Win32Proj"\r
+       TargetFrameworkVersion="131072"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       ATLMinimizesCRunTimeLibraryUsage="false"\r
+                       CharacterSet="2"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories="&quot;$(ProjectDir)&quot;"\r
+                               PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="1"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="4"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="WinMM.lib uuid.lib"\r
+                               OutputFile="bin\$(ProjectName).exe"\r
+                               LinkIncremental="2"\r
+                               IgnoreDefaultLibraryNames="libcmt.lib"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               RandomizedBaseAddress="1"\r
+                               DataExecutionPrevention="0"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       ATLMinimizesCRunTimeLibraryUsage="false"\r
+                       CharacterSet="2"\r
+                       WholeProgramOptimization="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="3"\r
+                               InlineFunctionExpansion="2"\r
+                               FavorSizeOrSpeed="1"\r
+                               AdditionalIncludeDirectories="&quot;$(ProjectDir)&quot;"\r
+                               PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="WinMM.lib uuid.lib"\r
+                               OutputFile="bin\$(ProjectName).exe"\r
+                               LinkIncremental="1"\r
+                               IgnoreDefaultLibraryNames=""\r
+                               SubSystem="1"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               RandomizedBaseAddress="1"\r
+                               DataExecutionPrevention="0"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="\83\\81[\83\83t\83@\83C\83\8b"\r
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\common.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\DtsEdit.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\Help.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\EditMain.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\stdafx.cpp"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="\83w\83b\83_\81\83t\83@\83C\83\8b"\r
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\common.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\Help.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\EditMain.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\stdafx.h"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="\83\8a\83\\81[\83\83t\83@\83C\83\8b"\r
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+                       >\r
+               </Filter>\r
+               <File\r
+                       RelativePath=".\gpac\libgpac_static.lib"\r
+                       >\r
+               </File>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
diff --git a/tstools/DtsEdit/src/EditMain.cpp b/tstools/DtsEdit/src/EditMain.cpp
new file mode 100644 (file)
index 0000000..3790de8
--- /dev/null
@@ -0,0 +1,281 @@
+#include <stdio.h>\r
+#include "stdafx.h"\r
+#include "Help.h"\r
+#include "EditMain.h"\r
+#include "debug.h"\r
+\r
+\r
+void EditMain(T_EDIT_PARAM *prm){\r
+\r
+       GF_Err          e;\r
+       T_MP4_INFO      mi;\r
+       T_TS_LIST       *ts             = NULL;\r
+       T_TS_LIST       *tsSort = NULL;\r
+\r
+       // \8f\89\8aú\89»\r
+       gf_sys_init();\r
+\r
+       ZeroMemory(&mi, sizeof(T_MP4_INFO));\r
+\r
+       // \83^\81[\83Q\83b\83g\83t\83@\83C\83\8b\82Ì\83I\81[\83v\83\93\r
+       mi.fp_in = gf_isom_open(prm->p_infile, GF_ISOM_OPEN_READ, NULL);\r
+       printf("\93ü\97Í\83t\83@\83C\83\8b... [%s]\n\n", prm->p_infile);\r
+\r
+       mi.i_trackCount = gf_isom_get_track_count(mi.fp_in);\r
+       \r
+       // \8ae\83g\83\89\83b\83N\82Ì\83t\83H\81[\83}\83b\83g\82ð\8eæ\93¾\r
+       u32 lst4CC[] = {GF_ISOM_BRAND_AVC1, GF_ISOM_BRAND_MP4V, GF_ISOM_BRAND_XVID};\r
+       SearchTrackOf4CC(&mi, lst4CC, 3);\r
+\r
+       // \96Ú\93I\82Ì\83g\83\89\83b\83N\82ª\8c©\82Â\82©\82ç\82È\82©\82Á\82½\8fê\8d\87\81B\r
+       if (mi.i_trackNo == NULL){\r
+               ErrorMessage(MSG_NO_4CC);\r
+               goto _ERROR_RET;\r
+       }\r
+\r
+       // \83T\83\93\83v\83\8b\90\94\82Ì\8eæ\93¾\r
+       mi.ui_sampleCount = gf_isom_get_sample_count(mi.fp_in, mi.i_trackNo);\r
+       if(mi.ui_sampleCount < 3){\r
+               ErrorMessage(MSG_NO_SAMPLE);\r
+               goto _ERROR_RET;\r
+       }\r
+\r
+       ts = new T_TS_LIST[mi.ui_sampleCount + 1];\r
+       ZeroMemory(ts, sizeof(T_TS_LIST) * mi.ui_sampleCount);\r
+\r
+       // \83T\83\93\83v\83\8b\8fî\95ñ\82ð\8eæ\93¾\82µ\81A\83f\83B\83\8c\83C\83t\83\8c\81[\83\80\94»\92è\81ECTS\8f\87\82É\95À\82Ñ\91Ö\82¦\r
+       printf("\83T\83\93\83v\83\8b\8fî\95ñ\8eæ\93¾\92\86...\n");\r
+       if(readTsFromFile(&mi, ts))\r
+               goto _ERROR_RET;\r
+\r
+       // \83s\83N\83`\83\83\95\\8e¦\8f\87\82Å\83\\81[\83g\r
+       tsSort = new T_TS_LIST[mi.ui_sampleCount + 1];\r
+       memcpy(tsSort, ts, sizeof(T_TS_LIST) * mi.ui_sampleCount);\r
+       qsort(tsSort, mi.ui_sampleCount, sizeof(T_TS_LIST), (int(*)(const void*, const void*))CompareTS_PTS);\r
+\r
+       // \8dÅ\8fI\83t\83\8c\81[\83\80\82ÌFPS\95â\8a®\r
+       u32 i = mi.ui_sampleCount;\r
+       tsSort[i].DTS                   = ts[i-1].DTS + (ts[i-1].DTS - ts[i-2].DTS);\r
+       tsSort[i].CTS_Offset    = 0;\r
+       tsSort[i].CTS                   = tsSort[i-1].CTS + (tsSort[i-1].CTS - tsSort[i-2].CTS);\r
+       tsSort[i].PTS                   = tsSort[i-1].PTS + (tsSort[i-1].PTS - tsSort[i-2].PTS);\r
+       tsSort[i].samples               = i+1;\r
+\r
+       // \83^\83C\83\80\83X\83P\81[\83\8b\82Ì\8eæ\93¾\r
+       mi.i_org_timescale = (int)gf_isom_get_media_timescale(mi.fp_in, mi.i_trackNo);\r
+\r
+       // \82±\82Ì\95Ó\82Å\83\82\81[\83h\95ª\8aò\r
+       if(prm->i_mode == MODE_IN){\r
+               // \83^\83C\83\80\83R\81[\83h\93ü\97Í\r
+\r
+               // \8dÅ\8f¬\83t\83\8c\81[\83\80\83\8c\81[\83g\8eæ\93¾\r
+               mi.i_org_timerate = getMinimumPTSDiff(&mi, tsSort);\r
+               if(prm->i_timerate <= 0) {\r
+                       int rate = gcd(mi.i_org_timescale, mi.i_org_timerate);\r
+                       prm->i_timerate = mi.i_org_timerate / rate;\r
+               }\r
+\r
+               // TimeCode V2 \82Ì\8eæ\82è\8d\9e\82Ý\r
+               if (prm->i_tcv == 1){\r
+                       if(readTimeCodeFromFileV1(&mi, tsSort, prm))\r
+                               goto _ERROR_RET;\r
+               } else if(prm->i_tcv == 2){\r
+                       if(readTimeCodeFromFile(&mi, tsSort, prm))\r
+                               goto _ERROR_RET;\r
+               } else {\r
+                       goto _ERROR_RET;\r
+               }\r
+\r
+               // \92x\89\84\83t\83\8c\81[\83\80\90\94\8eæ\93¾\r
+               if(prm->i_delayFrame < 0) {\r
+                       prm->i_delayFrame = getDelayFlame(&mi, ts);\r
+               }\r
+               mi.i_delayFrame = prm->i_delayFrame;\r
+               mi.i_initDelay = mi.i_delayFrame * (int)(getAveragePTSDiff(&mi, tsSort) / (double)prm->i_timerate + 0.5) * prm->i_timerate;\r
+\r
+               // \8c\8b\89Ê\82ð\83R\83s\81[\82µ\82Ä\83s\83N\83`\83\83\8f\87\82É\83\\81[\83g\r
+               memcpy(ts, tsSort, sizeof(T_TS_LIST) * mi.ui_sampleCount);\r
+               qsort(ts, mi.ui_sampleCount, sizeof(T_TS_LIST), (int(*)(const void*, const void*))CompareTS_Sample);\r
+\r
+\r
+               // \8fî\95ñ\82Ì\95\\8e¦\r
+               printf("\n");\r
+               printf("--- input ---\n");\r
+               printf("TimeScale       \81F%d\n", mi.i_org_timescale);\r
+               printf("TimeRate        \81F%d\n", mi.i_org_timerate);\r
+               printf("Sample Count    \81F%d\n", mi.ui_sampleCount);\r
+               printf("Delay Frame     \81F%d\n", mi.i_delayFrame);\r
+               printf("Delay Time      \81F%d\n", mi.i_initDelay);\r
+               printf("\n");\r
+               printf("--- output ---\n");\r
+               printf("TimeScale       \81F%d\n", prm->i_timescale);\r
+               printf("TimeRate        \81F%d\n", prm->i_timerate);\r
+               printf("Multiple        \81F%lf\n", prm->f_scaleFct);\r
+               printf("\n");\r
+               printf("\83t\83@\83C\83\8b\8fo\97Í\92\86... [%s]\n", prm->p_outfile);\r
+\r
+               u32 readDscIdx = 0;\r
+               u32 destTrack = 0;\r
+               mi.fp_out = gf_isom_open(prm->p_outfile, GF_ISOM_OPEN_WRITE, NULL);\r
+\r
+\r
+               // \8fo\97Í\8aJ\8en\r
+               for (int trackIdx=1; trackIdx<=mi.i_trackCount; trackIdx++){\r
+                       // \83g\83\89\83b\83N\82Ì\83R\83s\81[\r
+                       gf_isom_clone_track(mi.fp_in, trackIdx, mi.fp_out, true, &destTrack);\r
+                       // edts\82Ì\8dí\8f\9c\r
+                       gf_isom_remove_edit_segments(mi.fp_out, destTrack);\r
+\r
+                       if (trackIdx != mi.i_trackNo){\r
+                               u32 sampleCount = gf_isom_get_sample_count(mi.fp_in, trackIdx);\r
+                               for(u32 i=1; i<=sampleCount; i++){\r
+                                       printf("... %5.1f%%\r", (double)i/(double)sampleCount * 100.0);\r
+                                       GF_ISOSample *sample = gf_isom_get_sample(mi.fp_in, trackIdx, i, &readDscIdx);\r
+                                       e = gf_isom_add_sample(mi.fp_out, destTrack, readDscIdx, sample);\r
+                                       gf_isom_sample_del(&sample);\r
+                               }\r
+\r
+                       } else {\r
+                               // \83^\83C\83\80\83X\83P\81[\83\8b\90Ý\92è\r
+                               e = gf_isom_set_media_timescale(mi.fp_out, destTrack, (u32)prm->i_timescale);\r
+                               if(e)\r
+                                       printf("!!! \83^\83C\83\80\83X\83P\81[\83\8b\90Ý\92è\8e¸\94s : %d !!!\n", e);\r
+\r
+                               // DTS\82ð\90Ý\92è\82µ\8fo\97Í\r
+                               s64 before_dts = -1;\r
+                               int delta_time = int((prm->i_timerate * prm->f_scaleFct) / (mi.i_delayFrame*2));\r
+\r
+                               if(delta_time < 1 && prm->b_dc){\r
+                                       ErrorMessage(MSG_MORE_SMALL_TIMERATE);\r
+                                       break;\r
+                               }\r
+\r
+                               for(u32 i=0; i<mi.ui_sampleCount; i++){\r
+                                       printf("... %5.1f%%\r", (double)i/(double)mi.ui_sampleCount * 100.0);\r
+\r
+                                       s64 cts = 0;\r
+                                       s64 dts = 0;\r
+                                       int offset = 0;\r
+                                       int dts_delay = 0;\r
+                                       int cts_delay = 0;\r
+                                       int ts_diff = 0;\r
+\r
+                                       cts = ts[i].PTS;\r
+                                       if(!prm->b_dc){\r
+                                               dts_delay = 0;\r
+                                               cts_delay = mi.i_initDelay;\r
+                                       } else {\r
+                                               for(u32 k=MAX(0, i - mi.i_delayFrame); k<i; k++)\r
+                                                       ts_diff += (int)(tsSort[k + 1].PTS - tsSort[k].PTS);\r
+\r
+                                               dts_delay = MAX(mi.i_initDelay, ts_diff);\r
+                                               cts_delay = 0;\r
+                                       }\r
+\r
+                                       if(dts_delay < tsSort[i].PTS)\r
+                                               dts = tsSort[i].PTS - dts_delay;\r
+\r
+                                       // \91O\89ñ\82ÌDTS\82æ\82è\82à\92l\82Í\91å\82«\82­\82È\82¯\82ê\82Î\82È\82ç\82È\82¢\81B\r
+                                       if(dts <= before_dts)\r
+                                               dts = before_dts + delta_time;\r
+\r
+                                       // CTS_Offset\82Ì\8eZ\8fo\r
+                                       offset = (int)(cts - dts + cts_delay);\r
+\r
+                                       // \83I\83t\83Z\83b\83g\82Ì\8cv\8eZ\82Å\95\89\82É\82È\82Á\82Ä\82µ\82Ü\82Á\82½\8fê\8d\87\r
+                                       if (offset < 0){\r
+                                               dts += offset;\r
+                                               offset = 0;\r
+                                       }\r
+\r
+                                       ts[i].DTS = before_dts = dts;\r
+                                       ts[i].CTS_Offset = offset;\r
+\r
+                                       // \83`\83F\83b\83N\r
+                                       if( (dts + (s64)offset - (s64)ts[0].CTS_Offset) != cts )\r
+                                               printf("!!! \95\\8e¦\83^\83C\83~\83\93\83O\83G\83\89\81[ / Track:%d Frame:%d Target PTS:%I64d (DTS:%I64d, CTS_Offset:%d, Delay:%d) !!!\n", destTrack, i+1, cts, dts, offset, ts[0].CTS_Offset);\r
+\r
+                                       GF_ISOSample *sample = gf_isom_get_sample(mi.fp_in, mi.i_trackNo, i+1, &readDscIdx);\r
+                                       sample->DTS = ts[i].DTS;\r
+                                       sample->CTS_Offset = ts[i].CTS_Offset;\r
+                                       e = gf_isom_add_sample(mi.fp_out, destTrack, readDscIdx, sample);\r
+\r
+                                       if(e)\r
+                                               printf("!!! \83T\83\93\83v\83\8b\8f\91\82«\8d\9e\82Ý\83G\83\89\81[ / Track:%d Frame:%d DTS:%I64d, CTS_Offset:%d Err:%d !!!\n", destTrack, i+1, sample->DTS, sample->CTS_Offset, e);\r
+                                       gf_isom_sample_del(&sample);\r
+                               }\r
+\r
+                               // edts\82Ì\91}\93ü\r
+                               //GF_ISOSample *sample = gf_isom_get_sample_info(mi.fp_out, destTrack, 1, NULL, NULL);\r
+                               //if(sample->CTS_Offset > 0){\r
+                               //      u64 trackDur = gf_isom_get_track_duration(mi.fp_out, destTrack);\r
+                               //      gf_isom_remove_edit_segments(mi.fp_out, destTrack);\r
+                               //      gf_isom_append_edit_segment(mi.fp_out, destTrack, trackDur, sample->CTS_Offset, GF_ISOM_EDIT_NORMAL);\r
+                               //}\r
+                               //gf_isom_sample_del(&sample);\r
+                       }\r
+\r
+                       printf("... %d\83g\83\89\83b\83N\8fo\97Í\8fI\97¹\n", trackIdx);\r
+               }\r
+\r
+               // \8fo\97Í\83t\83@\83C\83\8b\82ð\95Â\82\82é\r
+               gf_isom_clone_pl_indications(mi.fp_in, mi.fp_out);\r
+               gf_isom_clone_root_od(mi.fp_in, mi.fp_out);\r
+\r
+               u64 duration = gf_isom_get_duration(mi.fp_out);\r
+               gf_isom_make_interleave(mi.fp_out, 0.5);\r
+               gf_isom_close(mi.fp_out);\r
+\r
+       }\r
+       else if (prm->i_mode == MODE_OUT){\r
+               // TIMECODE\82Ì\8fo\97Í\r
+               if(prm->i_tcv == 2){\r
+                       FILE *fpout;\r
+                       if((fpout = fopen(prm->p_outfile, "wb")) != NULL){\r
+                               fprintf(fpout, "# timecode format v2\r\n");\r
+                               for(u32 i=0; i<mi.ui_sampleCount; i++){\r
+                                       fprintf(fpout, "%.6lf\r\n", (double)tsSort[i].PTS / (double)mi.i_org_timescale * 1000.0);\r
+                               }\r
+                       }\r
+                       fclose(fpout);\r
+                       printf("... timecode format v2 \8fo\97Í\8fI\97¹\n");\r
+               }\r
+               else if(prm->i_tcv == 1){\r
+                       FILE *fpout;\r
+                       if((fpout = fopen(prm->p_outfile, "wb")) != NULL){\r
+                               fprintf(fpout, "# timecode format v1\r\n");\r
+                               fprintf(fpout, "Assume %.6lf\r\n", getMaximumFps(&mi, tsSort));\r
+                               u32 stpos = 0;\r
+                               double fps = 0.0;\r
+                               double beforFps = (double)mi.i_org_timescale/(double)(tsSort[1].PTS - tsSort[0].PTS);\r
+                               for(u32 i=0; i<mi.ui_sampleCount; i++){\r
+                                       fps = (double)mi.i_org_timescale/(double)(tsSort[i+1].PTS - tsSort[i].PTS);\r
+                                       if (fps != beforFps){\r
+                                               fprintf(fpout, "%d,%d,%.6lf\r\n",stpos, i-1, beforFps);\r
+                                               beforFps = fps;\r
+                                               stpos = i;\r
+                                       }\r
+                               }\r
+                               if(stpos <= mi.ui_sampleCount - 1){\r
+                                       fprintf(fpout, "%d,%d,%.6lf\r\n",stpos, mi.ui_sampleCount - 1, fps);\r
+                               }\r
+                       }\r
+                       fclose(fpout);\r
+                       printf("... timecode format v1 \8fo\97Í\8fI\97¹\n");\r
+               } else {\r
+                       goto _ERROR_RET;\r
+               }\r
+       }\r
+\r
+\r
+_ERROR_RET:\r
+\r
+       // \83t\83@\83C\83\8b\82ð\95Â\82\82Ä\8fI\97¹\r
+       gf_isom_close(mi.fp_in);\r
+\r
+       if(ts)          delete [] ts;\r
+       if(tsSort)      delete [] tsSort;\r
+       // \8dÅ\8fI\r
+       gf_sys_close();\r
+}\r
+\r
diff --git a/tstools/DtsEdit/src/EditMain.h b/tstools/DtsEdit/src/EditMain.h
new file mode 100644 (file)
index 0000000..439a10f
--- /dev/null
@@ -0,0 +1,9 @@
+\r
+#include "stdafx.h"\r
+\r
+#pragma once\r
+\r
+#define MODE_IN                        0x00000001ui32\r
+#define MODE_OUT               0x00000002ui32\r
+\r
+void EditMain(T_EDIT_PARAM *prm);\r
diff --git a/tstools/DtsEdit/src/Help.cpp b/tstools/DtsEdit/src/Help.cpp
new file mode 100644 (file)
index 0000000..d250d9f
--- /dev/null
@@ -0,0 +1,68 @@
+#include <stdio.h>\r
+#include <string.h>\r
+\r
+#include <Help.h>\r
+\r
+// \83w\83\8b\83v\82Ì\95\\8e¦\r
+void Help(){\r
+       printf("\83p\83\89\83\81\81[\83^\82ª\95s\90³\82Å\82·\81B\n");\r
+       printf("Usage: DtsEdit <option> <mp4 file>\n");\r
+       printf("\n");\r
+       printf("option list\n");\r
+       printf("        -tc <file name>       : \93ü\97Í\82·\82éTimeCode\83t\83@\83C\83\8b\82ð\8ew\92è\82µ\82Ü\82·\81B\n");\r
+       printf("                                -tc\82ª\8ew\92è\82³\82ê\82½\8fê\8d\87\82Í\81ATimeCode\82ð\8ew\92è\82ÌMP4\83t\83@\83C\83\8b\82É\96\84\82ß\8d\9e\82Ý\82Ü\82·\81B\n");\r
+       printf("                                \8ew\92è\82³\82ê\82È\82©\82Á\82½\8fê\8d\87\82Í\81AMP4\83t\83@\83C\83\8b\82©\82çTimeCode\82ð\92\8a\8fo\82µ\82Ü\82·\81B\n");\r
+       printf("        -tv <1|2>             : \93ü\8fo\97Í\82·\82éTimeCode\83t\83@\83C\83\8b\82Ì\83o\81[\83W\83\87\83\93\82ð\8ew\92è\82µ\82Ü\82·\81B\83f\83t\83H\83\8b\83g\82Í2\82Å\82·\81B\n");\r
+       printf("        -s <time scale>       : timeScale\82ð\8ew\92è\82µ\82Ü\82·\81B\n");\r
+       printf("                                \96¢\8ew\92è\82Ì\8fê\8d\87\82Í\81A\93ü\97Í\82³\82ê\82½timecode format\82É\82æ\82Á\82Ä\8e©\93®\8cv\8eZ\82³\82ê\82Ü\82·\81B\n");\r
+       printf("        -mlt <multiple>       : timeScale\82Ì\8e©\93®\8cv\8eZ\82É\8eg\97p\82µ\82Ü\82·\81B\n");\r
+       printf("                                \83f\83t\83H\83\8b\83g\92l\82Í4.0\94{\82Å\82·\81BtimeScale\82ð\92¼\90Ú\8ew\92è\82µ\82½\8fê\8d\87\82Í\81A\93à\95\94\82Ì\8cv\8eZ\8c\8b\89Ê\82Å\8fã\8f\91\82«\82³\82ê\82Ü\82·\81B\n");\r
+       printf("        -r <time rate>        : \8dÅ\8f¬timeRate\82ð\8ew\92è\82µ\82Ü\82·\81B\n");\r
+       printf("                                \96¢\8ew\92è\82Ì\8fê\8d\87\82Í\81A\93ü\97Í\82³\82ê\82½MP4\83t\83@\83C\83\8b\82É\8f]\82¢\82Ü\82·\81B\n");\r
+       printf("        -no-dc                : \8f\89\8aú\83f\83B\83\8c\83C\83J\83b\83g\82ð\96³\8cø\82É\82µ\82Ü\82·\81B\n");\r
+       printf("        -df <count>           : \8f\89\8aú\83f\83B\83\8c\83C\82ð\95t\97^\82·\82é\8fê\8d\87\82Ì\81A\83f\83B\83\8c\83C\83t\83\8c\81[\83\80\90\94\82ð\8ew\92è\82µ\82Ü\82·\81B\n");\r
+       printf("                                \96¢\8ew\92è\82Ì\8fê\8d\87\82Í\81A\93ü\97Í\82³\82ê\82½MP4\83t\83@\83C\83\8b\82©\82ç\8e©\93®\8cv\8eZ\82µ\82Ü\82·\81B\n");\r
+       printf("                                \8dÄ\90\8e\9e\8aÔ\82Ì\92Z\82¢\93®\89æ\82Å\82Í\90³\8am\82É\8eæ\93¾\82Å\82«\82È\82¢\8fê\8d\87\82ª\82 \82è\82Ü\82·\81B\n");\r
+       printf("        -o <output file>      : \8fo\97Í\83t\83@\83C\83\8b\82ð\8ew\92è\82µ\82Ü\82·\81B\n");\r
+       printf("\n");\r
+}\r
+\r
+int ErrorMessage(int msgId){\r
+       char msg[1024];\r
+\r
+       switch(msgId)\r
+       {\r
+               case MSG_NO_4CC:\r
+                       strcpy(msg, "\96¢\91Î\89\9e\82Ì\83r\83f\83I\8c`\8e®\82Å\82·\81B\n");\r
+                       strcat(msg, "\91Î\89\9e\82·\82éFOURCC\81Favc1, mp4v, xvid");\r
+                       break;\r
+               case MSG_NO_V2:\r
+                       strcpy(msg, "\8ew\92è\82³\82ê\82½\83t\83@\83C\83\8b\82Í timecode format v2 \82Å\82Í\82 \82è\82Ü\82¹\82ñ\81B");\r
+                       break;\r
+               case MSG_NO_V1:\r
+                       strcpy(msg, "\8ew\92è\82³\82ê\82½\83t\83@\83C\83\8b\82Í timecode format v1 \82Å\82Í\82 \82è\82Ü\82¹\82ñ\81B");\r
+                       break;\r
+               case MSG_MORE_SMALL_DIV_PTS:\r
+                       strcpy(msg, "\83s\83N\83`\83\83\82Ì\95\\8e¦\8aÔ\8au\82ª\8f¬\82³\82·\82¬\82Ü\82·\81B\n");\r
+                       strcat(msg, "timecode\82ð\93ü\97Í\82µ\82Ä\82¢\82é\8fê\8d\87\82Í\81A\93à\97e\82ð\8am\94F\82µ\82Ä\82­\82¾\82³\82¢\81B");\r
+                       break;\r
+               case MSG_LOST_FRAME:\r
+                       strcpy(msg, "\83t\83\8c\81[\83\80\82ª\98A\91±\82µ\82Ä\82¢\82È\82¢\82½\82ß\81ATimeCode\93ü\97Í\82ð\92â\8e~\82µ\82Ü\82µ\82½\81B");\r
+                       break;\r
+               case MSG_NO_ENOUGH_FRAME:\r
+                       strcpy(msg, "\83t\83\8c\81[\83\80\82ª\91«\82è\82È\82¢\82½\82ß\81ATimeCode\93ü\97Í\82ð\92â\8e~\82µ\82Ü\82µ\82½\81B");\r
+                       break;\r
+               case MSG_NO_SAMPLE:\r
+                       strcpy(msg, "\83T\83\93\83v\83\8b\82ª\8eæ\93¾\82Å\82«\82Ü\82¹\82ñ\81B\8dÅ\92á\82Å\82à2\83t\83\8c\81[\83\80\82Ì\93®\89æ\82ð\93ü\97Í\82µ\82Ä\82­\82¾\82³\82¢\81B");\r
+                       break;\r
+               case MSG_MORE_SMALL_TIMERATE:\r
+                       strcpy(msg, "TimeScale\82Ì\95ª\89ð\94\\82É\91Î\82µ\82Ä\83f\83B\83\8c\83C\83t\83\8c\81[\83\80\82ª\91½\82·\82¬\82é\82½\82ß\81A\8f\89\8aú\83f\83B\83\8c\83C\83J\83b\83g\82ª\8fo\97\88\82Ü\82¹\82ñ\81B");\r
+                       break;\r
+               default:\r
+                       sprintf(msg, "\96¢\92è\8b`\83\81\83b\83Z\81[\83W\81F0x%08X", msgId);\r
+                       break;\r
+       }\r
+       \r
+       printf("\n%s\n\n", msg);\r
+       return 1;\r
+}\r
diff --git a/tstools/DtsEdit/src/Help.h b/tstools/DtsEdit/src/Help.h
new file mode 100644 (file)
index 0000000..5ff36a9
--- /dev/null
@@ -0,0 +1,17 @@
+\r
+#pragma once\r
+\r
+#define MSG_NO_AVC1                                    0x00000001\r
+#define MSG_NO_V2                                      0x00000002\r
+#define MSG_NO_4CC                                     0x00000003\r
+#define MSG_NO_V1                                      0x00000004\r
+#define MSG_MORE_SMALL_DIV_PTS         0x00000005\r
+#define MSG_LOST_FRAME                         0x00000006\r
+#define MSG_NO_ENOUGH_FRAME                    0x00000007\r
+#define MSG_NO_SAMPLE                          0x00000008\r
+#define MSG_MORE_SMALL_TIMERATE                0x00000009\r
+\r
+void Help();\r
+\r
+int ErrorMessage(int msgId);\r
+\r
diff --git a/tstools/DtsEdit/src/common.cpp b/tstools/DtsEdit/src/common.cpp
new file mode 100644 (file)
index 0000000..7ed8b49
--- /dev/null
@@ -0,0 +1,311 @@
+#include "stdafx.h"\r
+#include "help.h"\r
+#include "debug.h"\r
+\r
+// \8dÅ\91å\8cö\96ñ\90\94\82Ì\8eæ\93¾\r
+int gcd( int a, int b) {\r
+    while (1) {\r
+        int c = a % b;\r
+        if( !c )\r
+            return b;\r
+        a = b;\r
+        b = c;\r
+    }\r
+}\r
+\r
+int CompareU64(const u64 *a, const u64 *b)\r
+{\r
+       s64 diff = (s64)(*a - *b);\r
+       return (diff > 0 ? 1: diff == 0 ? 0: -1);\r
+}\r
+\r
+int CompareTS_PTS(const T_TS_LIST *a, const T_TS_LIST *b)\r
+{\r
+       s64 diff = (s64)(a->PTS - b->PTS);\r
+       return (diff > 0 ? 1: diff == 0 ? 0: -1);\r
+}\r
+\r
+int CompareTS_Sample(const T_TS_LIST *a, const T_TS_LIST *b)\r
+{\r
+       int diff = (int)(a->samples - b->samples);\r
+       return (diff > 0 ? 1: diff == 0 ? 0: -1);\r
+}\r
+\r
+\r
+int SearchTrackOf4CC(T_MP4_INFO *mi, u32 *List4CC, int ListCount){\r
+       u32     tgTrack = NULL;\r
+       u32 tg4CC = NULL;\r
+       for (int i = 1; i <= mi->i_trackCount; i++){\r
+               tg4CC = gf_isom_get_media_subtype(mi->fp_in, i, 1);\r
+               if (tg4CC == GF_ISOM_SUBTYPE_MPEG4)\r
+                       tg4CC = gf_isom_get_mpeg4_subtype(mi->fp_in, i, 1);\r
+\r
+               DPRINTF("FOUR CC %s \r\n", gf_4cc_to_str(tg4CC));\r
+\r
+               for (s32 k=0; k<ListCount; k++){\r
+                       if (tg4CC == List4CC[k]){\r
+                               tgTrack = i;\r
+                               break;\r
+                       }\r
+               }\r
+\r
+               if (tgTrack){\r
+                       mi->i_trackNo = tgTrack;\r
+                       mi->ui_4cc = tg4CC;\r
+                       break;\r
+               }\r
+       }\r
+\r
+       return 0;\r
+}\r
+\r
+\r
+int readTsFromFile(T_MP4_INFO *mi, T_TS_LIST *ts){\r
+       int ret = 0;\r
+\r
+       for(u32 i=0; i<mi->ui_sampleCount; i++){\r
+               GF_ISOSample *sample = gf_isom_get_sample_info(mi->fp_in, mi->i_trackNo, i+1, NULL, NULL);\r
+\r
+               if(!sample){\r
+                       ret = ErrorMessage(MSG_NO_SAMPLE);\r
+                       break;\r
+               }\r
+\r
+               ts[i].DTS                       = sample->DTS;\r
+               ts[i].CTS_Offset        = sample->CTS_Offset;\r
+               ts[i].CTS                       = sample->DTS + sample->CTS_Offset;\r
+               ts[i].PTS                       = ts[i].CTS - ts[0].CTS_Offset;\r
+               ts[i].samples           = i+1;\r
+               gf_isom_sample_del(&sample);\r
+       }\r
+\r
+       return ret;\r
+}\r
+\r
+\r
+int getDelayFlame(T_MP4_INFO *mi, T_TS_LIST *ts){\r
+       int delay = 0;\r
+       int maxDelay = 0;\r
+       for(u32 i=1; i<mi->ui_sampleCount; i++){\r
+               if(ts[i-1].CTS > ts[i].CTS){\r
+                       delay++;\r
+                       maxDelay = MAX(maxDelay, delay);\r
+               } else {\r
+                       delay = 0;\r
+               }\r
+       }\r
+\r
+       return maxDelay;\r
+}\r
+\r
+\r
+int getMinimumPTSDiff(T_MP4_INFO *mi, T_TS_LIST *ts){\r
+       int min_diff = INT_MAX;\r
+       for(u32 i=1; i<mi->ui_sampleCount; i++){\r
+               int diff = (int)(ts[i].PTS - ts[i-1].PTS);\r
+               min_diff = MIN(min_diff, diff);\r
+       }\r
+       return min_diff;\r
+}\r
+\r
+int getMaximumPTSDiff(T_MP4_INFO *mi, T_TS_LIST *ts){\r
+       int max_diff = 0;\r
+       for(u32 i=1; i<mi->ui_sampleCount; i++){\r
+               int diff = (int)(ts[i].PTS - ts[i-1].PTS);\r
+               max_diff = MAX(max_diff, diff);\r
+       }\r
+       return max_diff;\r
+}\r
+\r
+double getAveragePTSDiff(T_MP4_INFO *mi, T_TS_LIST *ts){\r
+       double avr_diff = 0.0;\r
+       for(u32 i=1; i<mi->ui_sampleCount; i++){\r
+               double diff = (double)(ts[i].PTS - ts[i-1].PTS);\r
+               avr_diff += diff / (double)(mi->ui_sampleCount-1);\r
+       }\r
+       return avr_diff;\r
+}\r
+\r
+double getAverageFps(T_MP4_INFO *mi, T_TS_LIST *ts){\r
+       double base_fps = (double)mi->i_org_timescale / (double)(ts[1].PTS - ts[0].PTS);\r
+       double sum_fps = 0;\r
+       for(u32 i=1; i<mi->ui_sampleCount; i++){\r
+               sum_fps += ((double)mi->i_org_timescale / (double)(ts[i].PTS - ts[i-1].PTS)) - base_fps;\r
+       }\r
+       return ((sum_fps / (double)mi->ui_sampleCount) + base_fps);\r
+}\r
+\r
+double getMaximumFps(T_MP4_INFO *mi, T_TS_LIST *ts){\r
+       double max_fps = 0;\r
+       for(u32 i=1; i<mi->ui_sampleCount; i++){\r
+               double fps = (double)mi->i_org_timescale / (double)(ts[i].PTS - ts[i-1].PTS);\r
+               max_fps = MAX(max_fps, fps);\r
+       }\r
+       return max_fps;\r
+}\r
+\r
+\r
+\r
+int readTimeCodeFromFile(T_MP4_INFO *mi, T_TS_LIST *ts, T_EDIT_PARAM *prm){\r
+       FILE *fpin;\r
+       int err = 0;\r
+\r
+       if((fpin = fopen(prm->p_tcfile, "rb")) != NULL){\r
+               printf("timecode\8eæ\8d\9e\92\86...\n");\r
+\r
+               char buf1[256], buf2[256], buf3[256], buf4[256];\r
+\r
+               /* read header */\r
+               fscanf(fpin, "%s %s %s %s", buf1, buf2, buf3, buf4);\r
+               if(     _stricmp(buf2, "timecode") != 0 ||\r
+                       _stricmp(buf3, "format") != 0 ||\r
+                       _stricmp(buf4, "v2") != 0\r
+               ){\r
+                       err = ErrorMessage(MSG_NO_V2);\r
+               } else {\r
+                       u32             i                       = 0;\r
+                       double  timeStamp       = 0;\r
+                       bool    enough          = false;\r
+                       double  *timeList       = new double[mi->ui_sampleCount];\r
+\r
+                       // \83t\83@\83C\83\8b\82ð\93Ç\82Ý\8d\9e\82Ý\r
+                       while( fscanf(fpin, "%lf", &timeStamp) != EOF ){\r
+                               timeList[i] = timeStamp;\r
+                               i++;\r
+                               if (mi->ui_sampleCount <= i){\r
+                                       enough = true;\r
+                                       break;\r
+                               }\r
+                       }\r
+\r
+                       if (!enough) {\r
+                               err = ErrorMessage(MSG_NO_ENOUGH_FRAME);\r
+                       } else {\r
+\r
+                               double min_timeStamp = INT_MAX;\r
+                               // \8dÅ\8f¬\83^\83C\83~\83\93\83O\82ð\8eæ\93¾\r
+                               for(i=0; i<mi->ui_sampleCount - 1; i++){\r
+                                       double tmp = timeList[i+1] - timeList[i];\r
+                                       if(tmp > 0.0){\r
+                                               int true_fps = (int)((double)prm->i_timerate / tmp + 0.5);\r
+                                               if( true_fps > 0)\r
+                                                       tmp = (double)prm->i_timerate / (double)(true_fps);\r
+                                       }\r
+                                       min_timeStamp = MIN(min_timeStamp, tmp);\r
+                               }\r
+                               // \83G\83\89\81[\89ñ\94ð\r
+                               double max_fps = 1000.0 / MAX(min_timeStamp, 1.0);\r
+                               int timescale = int(max_fps * (double)prm->i_timerate * prm->f_mlt + 0.5);\r
+\r
+                               // timescale\96¢\8ew\92è\82Ì\8fê\8d\87\r
+                               if(prm->i_timescale <= 0){\r
+                                       prm->i_timescale = timescale;\r
+                                       prm->f_scaleFct = prm->f_mlt;\r
+                               } else {\r
+                                       prm->f_scaleFct = ((double)prm->i_timescale / (double)timescale) * prm->f_mlt;\r
+                               }\r
+\r
+                               double timerate = prm->i_timerate;\r
+                               if (prm->f_scaleFct < 1.0)\r
+                                       timerate = timerate * prm->f_scaleFct;\r
+\r
+                               for(i=0; i<mi->ui_sampleCount; i++){\r
+                                       ts[i].PTS = u64( u64((double)prm->i_timescale * (timeList[i] / 1000.0) / timerate + 0.5) * timerate + 0.5);\r
+                                       ts[i].CTS = ts[i].PTS;\r
+                               }\r
+                       }\r
+\r
+                       delete [] timeList;\r
+               }\r
+       }\r
+       fclose(fpin);\r
+       return err;\r
+}\r
+\r
+int readTimeCodeFromFileV1(T_MP4_INFO *mi, T_TS_LIST *ts, T_EDIT_PARAM *prm){\r
+       FILE *fpin;\r
+       int err = 0;\r
+\r
+       if((fpin = fopen(prm->p_tcfile, "rb")) != NULL){\r
+               printf("timecode\8eæ\8d\9e\92\86...\n");\r
+\r
+               char buf1[256], buf2[256], buf3[256], buf4[256];\r
+\r
+               /* read header */\r
+               fscanf(fpin, "%s %s %s %s", buf1, buf2, buf3, buf4);\r
+               if(     _stricmp(buf2, "timecode") != 0 ||\r
+                       _stricmp(buf3, "format") != 0 ||\r
+                       _stricmp(buf4, "v1") != 0\r
+               ){\r
+                       err = ErrorMessage(MSG_NO_V1);\r
+               } else {\r
+                       double AssumeFps;\r
+                       fscanf(fpin, "%s %lf",buf1, &AssumeFps);\r
+                       if(     _stricmp(buf1, "Assume") != 0)\r
+                               err = ErrorMessage(MSG_NO_V1);\r
+                       else {\r
+                               double  fps;\r
+                               u32             st;\r
+                               u32             ed;\r
+                               s64             beforeCount = 0;\r
+                               bool    enough          = false;\r
+                               double  *fpsList        = new double[mi->ui_sampleCount];\r
+\r
+\r
+                               while( fscanf(fpin, "%d,%d,%lf", &st, &ed, &fps) != EOF ){\r
+                                       \r
+                                       for(u32 i=st+1; i<=ed+1; i++){\r
+                                               if ((beforeCount + 1) != i){\r
+                                                       err = ErrorMessage(MSG_LOST_FRAME);\r
+                                                       break;\r
+                                               }\r
+                                               beforeCount = i;\r
+                                               fpsList[i] = fps;\r
+\r
+                                               if (mi->ui_sampleCount <= i+1)\r
+                                                       break;\r
+                                       }\r
+                                       if (mi->ui_sampleCount <= ed+1){\r
+                                               enough = true;\r
+                                               break;\r
+                                       }\r
+                               }\r
+                               if (!enough) {\r
+                                       err = ErrorMessage(MSG_NO_ENOUGH_FRAME);\r
+                               } else {\r
+\r
+                                       double max_fps = 0.1;\r
+                                       // \8dÅ\91åfps\82ð\8eæ\93¾\r
+                                       for(u32 i=0; i<mi->ui_sampleCount; i++){\r
+                                               max_fps = MAX(max_fps, fpsList[i]);\r
+                                       }\r
+                                       int timescale = int(max_fps * (double)prm->i_timerate * prm->f_mlt + 0.5);\r
+\r
+                                       // timescale\96¢\8ew\92è\82Ì\8fê\8d\87\r
+                                       if(prm->i_timescale <= 0){\r
+                                               prm->i_timescale = timescale;\r
+                                               prm->f_scaleFct = prm->f_mlt;\r
+                                       } else {\r
+                                               prm->f_scaleFct = ((double)prm->i_timescale / (double)timescale) * prm->f_mlt;\r
+                                       }\r
+\r
+                                       double timerate = prm->i_timerate;\r
+                                       if (prm->f_scaleFct < 1.0)\r
+                                               timerate = timerate * prm->f_scaleFct;\r
+\r
+                                       // \90æ\93ª\82Í0\8cÅ\92è\r
+                                       ts[0].PTS = 0;\r
+                                       ts[0].CTS = 0;\r
+                                       for(u32 i=1; i<mi->ui_sampleCount; i++){\r
+                                               ts[i].PTS = ts[i-1].PTS + u64( u64(((double)prm->i_timescale / (fpsList[i] * timerate)) + 0.5) * timerate + 0.5);\r
+                                               ts[i].CTS = ts[i].PTS;\r
+                                       }\r
+                               }\r
+                       }\r
+               }\r
+       }\r
+       fclose(fpin);\r
+       return err;\r
+}\r
+\r
+\r
diff --git a/tstools/DtsEdit/src/common.h b/tstools/DtsEdit/src/common.h
new file mode 100644 (file)
index 0000000..659afc7
--- /dev/null
@@ -0,0 +1,67 @@
+\r
+#ifndef _COMMON_H_\r
+\r
+// common.h\r
+\r
+#define _COMMON_H_\r
+\r
+#define GF_ISOM_BRAND_MP4V GF_4CC('m','p','4','v')\r
+#define GF_ISOM_BRAND_XVID GF_4CC('x','v','i','d')\r
+\r
+typedef struct {\r
+       char            *p_infile;\r
+       char            *p_outfile;\r
+       char            *p_tcfile;\r
+       int                     i_mode;\r
+       int                     i_tcv;\r
+       BOOL            b_dc;\r
+       int                     i_timescale;\r
+       int                     i_timerate;\r
+       int                     i_delayFrame;\r
+       double          f_scaleFct;\r
+       double          f_mlt;\r
+} T_EDIT_PARAM;\r
+\r
+typedef struct {\r
+       GF_ISOFile      *fp_in;\r
+       GF_ISOFile      *fp_out;\r
+       int                     i_trackCount;\r
+       int                     i_trackNo;\r
+       u32                     ui_4cc;\r
+       u32                     ui_sampleCount;\r
+       int                     i_delayFrame;\r
+       int                     i_initDelay;\r
+       int                     i_org_timescale;\r
+       int                     i_org_timerate;\r
+} T_MP4_INFO;\r
+\r
+typedef struct {\r
+       u64                     DTS;\r
+       u32                     CTS_Offset;\r
+       u64                     CTS;\r
+       u64                     PTS;    // delay\82ð\8aÜ\82Ü\82È\82¢\83s\83N\83`\83\83\95\\8e¦\83^\83C\83~\83\93\83O\r
+       u32                     samples;\r
+} T_TS_LIST;\r
+\r
+int gcd( int a, int b);\r
+int CompareU64(const u64 *a, const u64 *b);\r
+int CompareTS_PTS(const T_TS_LIST *a, const T_TS_LIST *b);\r
+int CompareTS_Sample(const T_TS_LIST *a, const T_TS_LIST *b);\r
+\r
+int SearchTrackOf4CC(T_MP4_INFO *mi, u32 *List4CC, int ListCount);\r
+int readTsFromFile(T_MP4_INFO *mi, T_TS_LIST *ts);\r
+int getDelayFlame(T_MP4_INFO *mi, T_TS_LIST *ts);\r
+int getMinimumPTSDiff(T_MP4_INFO *mi, T_TS_LIST *ts);\r
+int getMaximumPTSDiff(T_MP4_INFO *mi, T_TS_LIST *ts);\r
+double getAveragePTSDiff(T_MP4_INFO *mi, T_TS_LIST *ts);\r
+double getAverageFps(T_MP4_INFO *mi, T_TS_LIST *ts);\r
+double getMaximumFps(T_MP4_INFO *mi, T_TS_LIST *ts);\r
+\r
+int readTimeCodeFromFile(T_MP4_INFO *mi, T_TS_LIST *tc, T_EDIT_PARAM *prm);\r
+int readTimeCodeFromFileV1(T_MP4_INFO *mi, T_TS_LIST *tc, T_EDIT_PARAM *prm);\r
+\r
+\r
+\r
+#endif //_COMMON_H_\r
+\r
+\r
diff --git a/tstools/DtsEdit/src/debug.h b/tstools/DtsEdit/src/debug.h
new file mode 100644 (file)
index 0000000..4c76b5c
--- /dev/null
@@ -0,0 +1,98 @@
+\r
+#ifndef _MY_DEBUG_H\r
+#define _MY_DEBUG_H 1\r
+\r
+#include <stdio.h>      /* vsprintf */\r
+#include <windows.h>\r
+\r
+#ifdef _DEBUG\r
+\r
+#ifdef _cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#define DPRINTF_BUF_SZ  10240\r
+static void SENDSTR(char *cMsg){\r
+       HWND hTgWnd1 = FindWindow("Notepad", "\96³\91è - \83\81\83\82\92 ");\r
+       hTgWnd1 = GetWindow(hTgWnd1, GW_CHILD);\r
+  \r
+       if(hTgWnd1 > 0){\r
+               SendMessage(hTgWnd1, EM_REPLACESEL, NULL, (LPARAM)cMsg);\r
+       }\r
+}\r
+static void DUMP(char *tablename, unsigned char *data, DWORD size){\r
+       char buf1[60]   = {'\0'};\r
+       char *buf2              = (char*)calloc(1, size * 60);\r
+       DWORD i;\r
+\r
+       //sprintf(buf2, "------ DUMP %s ------\r\n", tablename);\r
+       //for (int y=0; y<(size/16); y++){\r
+       //      sprintf(buf1, "%08X: %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\r\n"\r
+       //              , data[y*16 + 0], data[y*16 + 1], data[y*16 + 2], data[y*16 + 3], data[y*16 + 4], data[y*16 + 5], data[y*16 + 6], data[y*16 + 7]\r
+       //              , data[y*16 + 8], data[y*16 + 9], data[y*16 +10], data[y*16 +11], data[y*16 +12], data[y*16 +13], data[y*16 +14], data[y*16 +15]\r
+       //              );\r
+       //      strcat(buf2, buf1);\r
+       //}\r
+\r
+       _snprintf(buf2, size * 60, "------ DUMP %s ------", tablename);\r
+       for (i=0; i<size; i++){\r
+               if ((i % 16) == 0){\r
+                       sprintf(buf1, "\r\n%02X", data[i]);\r
+               }else{\r
+                       sprintf(buf1, " %02X", data[i]);\r
+               }\r
+               strcat(buf2, buf1);\r
+       }\r
+       strcat(buf2, "\r\n\r\n");\r
+       SENDSTR(buf2);\r
+       free(buf2);\r
+}\r
+static void DPRINTLN(char *fmt, ...)\r
+{\r
+       va_list args;\r
+       char *buf1 = (char*)calloc(DPRINTF_BUF_SZ, sizeof(char));\r
+       char *buf2 = (char*)calloc(DPRINTF_BUF_SZ, sizeof(char));\r
+\r
+       va_start(args, fmt);\r
+       _vsnprintf(buf1, DPRINTF_BUF_SZ, fmt, args);\r
+       va_end(args);\r
+       _snprintf(buf2, DPRINTF_BUF_SZ, "[0x%08X]\t%s\r\n" ,GetCurrentThreadId(), buf1);\r
+       //strcat(buf, "\r\n");\r
+       //OutputDebugString(buf);\r
+       //FILE *fp = fopen("_debug.txt", "ab");\r
+       //fwrite(buf, strlen(buf), 1, fp);\r
+       //fclose(fp);\r
+       SENDSTR(buf2);\r
+\r
+       free(buf1);\r
+       free(buf2);\r
+}\r
+static void DPRINTF(char *fmt, ...)\r
+{\r
+       va_list args;\r
+       char *buf1 = (char*)calloc(DPRINTF_BUF_SZ, sizeof(char));\r
+\r
+       va_start(args, fmt);\r
+       _vsnprintf(buf1, DPRINTF_BUF_SZ, fmt, args);\r
+       va_end(args);\r
+\r
+       //OutputDebugString(buf);\r
+       //FILE *fp = fopen("_debug.txt", "ab");\r
+       //fwrite(buf, strlen(buf), 1, fp);\r
+       //fclose(fp);\r
+       SENDSTR(buf1);\r
+\r
+       free(buf1);\r
+}\r
+#else\r
+static __inline void DPRINTLN(char *fmt, ...) { }\r
+static __inline void DPRINTF(char *fmt, ...) { }\r
+static __inline void DUMP(char *tablename, unsigned char* data, unsigned long size){ }\r
+\r
+#ifdef _cplusplus\r
+} //extern "C"\r
+#endif\r
+\r
+#endif //_DEBUG\r
+\r
+#endif //_MY_DEBUG_H
\ No newline at end of file
diff --git a/tstools/DtsEdit/src/gpac/avparse.h b/tstools/DtsEdit/src/gpac/avparse.h
new file mode 100644 (file)
index 0000000..6cc9aaf
--- /dev/null
@@ -0,0 +1,208 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / Authoring Tools sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_PARSERS_AV_H_\r
+#define _GF_PARSERS_AV_H_\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/bitstream.h>\r
+\r
+/*basic MPEG (1,2,4) visual object parser (DSI extraction and timing/framing)*/\r
+typedef struct\r
+{\r
+       /*video PL*/\r
+       u8 VideoPL;\r
+       u8 RAP_stream, objectType, has_shape, enh_layer;\r
+       /*video resolution*/\r
+       u16 width, height;\r
+       /*pixel aspect ratio*/\r
+       u8 par_num, par_den;\r
+\r
+       u16 clock_rate;\r
+       u8 NumBitsTimeIncrement;\r
+       u32 time_increment;\r
+       /*for MPEG 1/2*/\r
+       Double fps;\r
+} GF_M4VDecSpecInfo;\r
+\r
+\r
+typedef struct __tag_m4v_parser GF_M4VParser;\r
+\r
+GF_M4VParser *gf_m4v_parser_new(char *data, u32 data_size, Bool mpeg12video);\r
+GF_M4VParser *gf_m4v_parser_bs_new(GF_BitStream *bs, Bool mpeg12video);\r
+void gf_m4v_parser_del(GF_M4VParser *m4v);\r
+GF_Err gf_m4v_parse_config(GF_M4VParser *m4v, GF_M4VDecSpecInfo *dsi);\r
+\r
+/*get a frame (can contain GOP). The parser ALWAYS resync on the next object in the bitstream\r
+thus you can seek the bitstream to copy the payload without re-seeking it */\r
+GF_Err gf_m4v_parse_frame(GF_M4VParser *m4v, GF_M4VDecSpecInfo dsi, u8 *frame_type, u32 *time_inc, u32 *size, u32 *start, Bool *is_coded);\r
+/*returns current object start in bitstream*/\r
+u32 gf_m4v_get_object_start(GF_M4VParser *m4v);\r
+/*returns 1 if current object is a valid MPEG-4 Visual object*/\r
+Bool gf_m4v_is_valid_object_type(GF_M4VParser *m4v);\r
+/*returns readable description of profile*/\r
+const char *gf_m4v_get_profile_name(u8 video_pl);\r
+/*decodes DSI*/\r
+GF_Err gf_m4v_get_config(char *rawdsi, u32 rawdsi_size, GF_M4VDecSpecInfo *dsi);\r
+/*rewrites PL code in DSI*/\r
+void gf_m4v_rewrite_pl(char **io_dsi, u32 *io_dsi_len, u8 PL);\r
+/*rewrites PAR code in DSI. Negative values will remove the par*/\r
+GF_Err gf_m4v_rewrite_par(char **o_data, u32 *o_dataLen, s32 par_n, s32 par_d);\r
+\r
+/*MP3 tools*/\r
+u8 gf_mp3_num_channels(u32 hdr);\r
+u16 gf_mp3_sampling_rate(u32 hdr);\r
+u16 gf_mp3_window_size(u32 hdr);\r
+u16 gf_mp3_bit_rate(u32 hdr);\r
+u8 gf_mp3_object_type_indication(u32 hdr);\r
+u8 gf_mp3_layer(u32 hdr);\r
+u8 gf_mp3_version(u32 hdr);\r
+const char *gf_mp3_version_name(u32 hdr);\r
+u16 gf_mp3_frame_size(u32 hdr);\r
+u32 gf_mp3_get_next_header(FILE* in);\r
+u32 gf_mp3_get_next_header_mem(char *buffer, u32 size, u32 *pos);\r
+\r
+/*vorbis tools*/\r
+typedef struct\r
+{\r
+       u32 sample_rate, channels, version;\r
+       s32 max_r, avg_r, low_r;\r
+       u32 min_block, max_block;\r
+\r
+       /*do not touch, parser private*/\r
+       Bool is_init;\r
+       u32 modebits;\r
+       Bool mode_flag[64];\r
+} GF_VorbisParser;\r
+\r
+/*call with vorbis header packets - you MUST initialize the structure to 0 before!!\r
+returns 1 if success, 0 if error.*/\r
+Bool gf_vorbis_parse_header(GF_VorbisParser *vp, char *data, u32 data_len);\r
+/*returns 0 if init error or not a vorbis frame, otherwise returns the number of audio samples\r
+in this frame*/\r
+u32 gf_vorbis_check_frame(GF_VorbisParser *vp, char *data, u32 data_length);\r
+\r
+\r
+enum\r
+{\r
+    GF_M4A_AAC_MAIN = 1,\r
+    GF_M4A_AAC_LC = 2,\r
+    GF_M4A_AAC_SSR = 3,\r
+    GF_M4A_AAC_LTP = 4,\r
+    GF_M4A_AAC_SBR = 5,\r
+    GF_M4A_AAC_SCALABLE = 6,\r
+    GF_M4A_TWINVQ = 7,\r
+    GF_M4A_CELP = 8, \r
+    GF_M4A_HVXC = 9,\r
+    GF_M4A_TTSI = 12,\r
+    GF_M4A_MAIN_SYNTHETIC = 13,\r
+    GF_M4A_WAVETABLE_SYNTHESIS = 14,\r
+    GF_M4A_GENERAL_MIDI = 15,\r
+    GF_M4A_ALGO_SYNTH_AUDIO_FX = 16,\r
+    GF_M4A_ER_AAC_LC = 17,\r
+    GF_M4A_ER_AAC_LTP = 19,\r
+    GF_M4A_ER_AAC_SCALABLE = 20,\r
+    GF_M4A_ER_TWINVQ = 21,\r
+    GF_M4A_ER_BSAC = 22,\r
+    GF_M4A_ER_AAC_LD = 23,\r
+    GF_M4A_ER_CELP = 24,\r
+    GF_M4A_ER_HVXC = 25,\r
+    GF_M4A_ER_HILN = 26,\r
+    GF_M4A_ER_PARAMETRIC = 27,\r
+    GF_M4A_SSC = 28,\r
+    //GF_M4A_PS = 29,\r
+    GF_M4A_LAYER1 = 32,\r
+    GF_M4A_LAYER2 = 33,\r
+    GF_M4A_LAYER3 = 34,\r
+    GF_M4A_DST = 35,\r
+    GF_M4A_ALS = 36,\r
+};\r
+\r
+static const u32 GF_M4ASampleRates[] =\r
+{\r
+    96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, \r
+       16000, 12000, 11025, 8000, 7350, 0, 0, 0\r
+};\r
+\r
+/*get Audio type from dsi. return audio codec type:*/\r
+typedef struct\r
+{\r
+       u32 nb_chan;\r
+       u32 base_object_type, base_sr, base_sr_index;\r
+       /*SBR*/\r
+       Bool has_sbr;\r
+       u32 sbr_object_type, sbr_sr, sbr_sr_index;\r
+       /*PL indication*/\r
+       u8 audioPL;\r
+} GF_M4ADecSpecInfo;\r
+/*parses dsi and updates audioPL*/\r
+GF_Err gf_m4a_get_config(char *dsi, u32 dsi_size, GF_M4ADecSpecInfo *cfg);\r
+/*gets audioPL for given cfg*/\r
+u32 gf_m4a_get_profile(GF_M4ADecSpecInfo *cfg);\r
+const char *gf_m4a_object_type_name(u32 objectType);\r
+const char *gf_m4a_get_profile_name(u8 audio_pl);\r
+\r
+GF_Err gf_m4a_write_config(GF_M4ADecSpecInfo *cfg, char **dsi, u32 *dsi_size);\r
+GF_Err gf_m4a_parse_config(GF_BitStream *bs, GF_M4ADecSpecInfo *cfg, Bool size_known);\r
+\r
+typedef struct\r
+{\r
+       u32 bitrate;\r
+       u32 sample_rate;\r
+       u32 framesize;\r
+       u32 channels;\r
+       /*only set if full parse*/\r
+       u8 fscod, bsid, bsmod, acmod, lfon, brcode;\r
+} GF_AC3Header;\r
+\r
+Bool gf_ac3_parser(u8 *buffer, u32 buffer_size, u32 *pos, GF_AC3Header *out_hdr, Bool full_parse);\r
+Bool gf_ac3_parser_bs(GF_BitStream *bs, GF_AC3Header *hdr, Bool full_parse);\r
+\r
+\r
+GF_Err gf_avc_get_sps_info(char *sps, u32 sps_size, u32 *width, u32 *height, s32 *par_n, s32 *par_d);\r
+\r
+const char *gf_avc_get_profile_name(u8 video_prof);\r
+\r
+\r
+/*gets image size (bs must contain the whole image) \r
+@OTI: image type (JPEG=0x6C, PNG=0x6D)\r
+@width, height: image resolution - for jpeg max size if thumbnail included*/\r
+void gf_img_parse(GF_BitStream *bs, u8 *OTI, u32 *mtype, u32 *width, u32 *height, char **dsi, u32 *dsi_len);\r
+\r
+GF_Err gf_img_jpeg_dec(char *jpg, u32 jpg_size, u32 *width, u32 *height, u32 *pixel_format, char *dst, u32 *dst_size, u32 dst_nb_comp);\r
+\r
+GF_Err gf_img_png_dec(char *png, u32 png_size, u32 *width, u32 *height, u32 *pixel_format, char *dst, u32 *dst_size);\r
+GF_Err gf_img_png_enc(char *data, u32 width, u32 height, u32 pixel_format, char *dst, u32 *dst_size);\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif /*_GF_PARSERS_AV_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/base_coding.h b/tstools/DtsEdit/src/gpac/base_coding.h
new file mode 100644 (file)
index 0000000..4b5c90a
--- /dev/null
@@ -0,0 +1,105 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / common tools sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_BASE_CODING_H_\r
+#define _GF_BASE_CODING_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/*!\r
+ *     \file <gpac/base_coding.h>\r
+ *     \brief Base coding functions.\r
+ */\r
+\r
+/*!\r
+ *     \addtogroup bascod_grp base coding\r
+ *     \ingroup utils_grp\r
+ *     \brief Base Coding functions\r
+ *\r
+ *     This section documents the base encoding and decoding functions of the GPAC framework.\r
+ *     @{\r
+ */\r
+\r
+#include <gpac/tools.h>\r
+\r
+/*!\r
+ *\brief base64 encoder\r
+ *\r
+ *Encodes a data buffer to Base64\r
+ *\param in_buffer input data buffer\r
+ *\param in_buffer_size input data buffer size\r
+ *\param out_buffer output Base64 buffer location\r
+ *\param out_buffer_size output Base64 buffer allocated size\r
+ *\return size of the encoded Base64 buffer\r
+ *\note the encoded data buffer is not NULL-terminated.\r
+ */\r
+u32 gf_base64_encode(char *in_buffer, u32 in_buffer_size, char *out_buffer, u32 out_buffer_size);\r
+/*!\r
+ *\brief base64 decoder\r
+ *\r
+ *Decodes a Base64 buffer to data\r
+ *\param in_buffer input Base64 buffer\r
+ *\param in_buffer_size input Base64 buffer size\r
+ *\param out_buffer output data buffer location\r
+ *\param out_buffer_size output data buffer allocated size\r
+ *\return size of the decoded buffer\r
+ */\r
+u32 gf_base64_decode(char *in_buffer, u32 in_buffer_size, char *out_buffer, u32 out_buffer_size);\r
+\r
+/*!\r
+ *\brief base16 encoder\r
+ *\r
+ *Encodes a data buffer to Base16\r
+ *\param in_buffer input data buffer\r
+ *\param in_buffer_size input data buffer size\r
+ *\param out_buffer output Base16 buffer location\r
+ *\param out_buffer_size output Base16 buffer allocated size\r
+ *\return size of the encoded Base16 buffer\r
+ *\note the encoded data buffer is not NULL-terminated.\r
+ */\r
+u32 gf_base16_encode(char *in_buffer, u32 in_buffer_size, char *out_buffer, u32 out_buffer_size);\r
+\r
+/*!\r
+ *\brief base16 decoder\r
+ *\r
+ *Decodes a Base16 buffer to data\r
+ *\param in_buffer input Base16 buffer\r
+ *\param in_buffer_size input Base16 buffer size\r
+ *\param out_buffer output data buffer location\r
+ *\param out_buffer_size output data buffer allocated size\r
+ *\return size of the decoded buffer\r
+ */\r
+u32 gf_base16_decode(char *in_buffer, u32 in_buffer_size, char *out_buffer, u32 out_buffer_size);\r
+\r
+/*! @} */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif         /*_GF_BASE_CODING_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/bifs.h b/tstools/DtsEdit/src/gpac/bifs.h
new file mode 100644 (file)
index 0000000..25097ca
--- /dev/null
@@ -0,0 +1,95 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / BIFS codec sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_BIFS_H_\r
+#define _GF_BIFS_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+\r
+#include <gpac/nodes_mpeg4.h>\r
+/*for BIFSConfig*/\r
+#include <gpac/mpeg4_odf.h>\r
+\r
+typedef struct __tag_bifs_dec GF_BifsDecoder;\r
+\r
+/*BIFS decoder constructor - \r
+ @command_dec: if set, the decoder will only work in memory mode (creating commands for the graph)\r
+ otherwise the decoder will always apply commands while decoding them*/\r
+GF_BifsDecoder *gf_bifs_decoder_new(GF_SceneGraph *scenegraph, Bool command_dec);\r
+void gf_bifs_decoder_del(GF_BifsDecoder *codec);\r
+\r
+/*sets the scene time. Scene time is the real clock of the bifs stream in secs*/\r
+void gf_bifs_decoder_set_time_offset(GF_BifsDecoder *codec, Double ts);\r
+\r
+/*signals the sizeInfo of the config should be ignored - used for BIFS in AnimationStream nodes*/\r
+void gf_bifs_decoder_ignore_size_info(GF_BifsDecoder *codec);\r
+\r
+/*setup a stream*/\r
+GF_Err gf_bifs_decoder_configure_stream(GF_BifsDecoder *codec, u16 ESID, char *DecoderSpecificInfo, u32 DecoderSpecificInfoLength, u32 objectTypeIndication);\r
+/*removes a stream*/\r
+GF_Err gf_bifs_decoder_remove_stream(GF_BifsDecoder *codec, u16 ESID);\r
+\r
+/*decode a BIFS AU and applies it to the graph (non-memory mode only)*/\r
+GF_Err gf_bifs_decode_au(GF_BifsDecoder *codec, u16 ESID, char *data, u32 data_length, Double ts_offset);\r
+\r
+/*Memory BIFS decoding - fills the command list with the content of the AU - cf scenegraph_vrml.h for commands usage\r
+       @ESID: ID of input stream\r
+       @data, @data_length: BIFS AU\r
+       @com_list: target list for decoded commands\r
+*/\r
+GF_Err gf_bifs_decode_command_list(GF_BifsDecoder *codec, u16 ESID, char *data, u32 data_length, GF_List *com_list);\r
+\r
+\r
+/*BIFS encoding*/\r
+typedef struct __tag_bifs_enc GF_BifsEncoder;\r
+\r
+/*constructor - @graph: scene graph being encoded*/\r
+GF_BifsEncoder *gf_bifs_encoder_new(GF_SceneGraph *graph);\r
+/*destructor*/\r
+void gf_bifs_encoder_del(GF_BifsEncoder *codec);\r
+/*setup a destination stream*/\r
+GF_Err gf_bifs_encoder_new_stream(GF_BifsEncoder *codec, u16 ESID, GF_BIFSConfig *cfg, Bool encodeNames, Bool has_predictive);\r
+/*encodes a list of commands for the given stream in the output buffer - data is dynamically allocated for output\r
+the scenegraph used is the one described in SceneReplace command, hence scalable streams shall be encoded in time order\r
+*/\r
+GF_Err gf_bifs_encode_au(GF_BifsEncoder *codec, u16 ESID, GF_List *command_list, char **out_data, u32 *out_data_length);\r
+/*returns encoded config desc*/\r
+GF_Err gf_bifs_encoder_get_config(GF_BifsEncoder *codec, u16 ESID, char **out_data, u32 *out_data_length);\r
+/*returns BIFS version used by codec for given stream*/\r
+u8 gf_bifs_encoder_get_version(GF_BifsEncoder *codec, u16 ESID);\r
+\r
+/*Encodes current graph as a scene replace*/\r
+GF_Err gf_bifs_encoder_get_rap(GF_BifsEncoder *codec, char **out_data, u32 *out_data_length);\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+\r
+#endif /*_GF_BIFS_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/bifsengine.h b/tstools/DtsEdit/src/gpac/bifsengine.h
new file mode 100644 (file)
index 0000000..d178e32
--- /dev/null
@@ -0,0 +1,138 @@
+/*\r
+ *                                     GPAC Multimedia Framework\r
+ *\r
+ *                     Authors: Cyril Concolato - Jean le Feuvre\r
+ *                             Copyright (c) 2005-200X ENST\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / ISO Media File Format sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+\r
+#ifndef _GF_BIFSENGINE_H_\r
+#define _GF_BIFSENGINE_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/scene_manager.h>\r
+\r
+#ifndef GPAC_READ_ONLY\r
+       \r
+typedef struct __tag_bifs_engine GF_BifsEngine;\r
+\r
+/**\r
+ * @calling_object is the calling object on which call back will be called\r
+ * @inputContext is the name of a scene file (bt, xmt or mp4) to initialize the coding context\r
+ *\r
+ * must be called only one time (by process calling the DLL) before other calls\r
+ */\r
+GF_BifsEngine *gf_beng_init(void *calling_object, char *inputContext);\r
+\r
+/**\r
+ * @calling_object is the calling object on which call back will be called\r
+ * @inputContext is an UTF-8 scene description (with or without IOD) in BT or XMT-A format\r
+ * @width, @height: width and height of scene if no IOD is given in the context.\r
+ * @usePixelMetrics: metrics system used in the scene, if no IOD is given in the context.\r
+ *\r
+ * must be called only one time (by process calling the DLL) before other calls\r
+ */\r
+GF_BifsEngine *gf_beng_init_from_string(void *calling_object, char *inputContext, u32 width, u32 height, Bool usePixelMetrics);\r
+\r
+\r
+/**\r
+ * @calling_object is the calling object on which call back will be called\r
+ * @ctx is an already loaded scene manager\r
+ *\r
+ * must be called only one time (by process calling the DLL) before other calls\r
+ */\r
+GF_BifsEngine *gf_beng_init_from_context(void *calling_object, GF_SceneManager *ctx);\r
+\r
+/**\r
+ * @beng, pointer to the GF_BifsEngine returned by BENC_Init\r
+ * @config: pointer to the encoded BIFS config (memory is not allocated)\r
+ * @config_len: length of the buffer\r
+ *\r
+ * must be called after BENC_Init\r
+ */\r
+void gf_beng_get_stream_config(GF_BifsEngine *beng, char **config, u32 *config_len);\r
+\r
+/**\r
+ * Encodes the AU context which is not encoded when calling BENC_EncodeAUFromString/File\r
+ * Should be called after Aggregate.\r
+ *\r
+ * @beng, pointer to the GF_BifsEngine returned by BENC_Init\r
+ * @AUCallback, pointer on a callback function to get the result of the coding the AU using the current context\r
+ *\r
+ */\r
+GF_Err gf_beng_encode_context(GF_BifsEngine *beng, GF_Err (*AUCallback)(void *, char *data, u32 size, u64 ts));\r
+\r
+/**\r
+ * @beng, pointer to the GF_BifsEngine returned by BENC_Init\r
+ * @auFile, name of a file containing a description for an access unit (BT or XMT)\r
+ * @AUCallback, pointer on a callback function to get the result of the coding the AU using the current context\r
+ *\r
+ */\r
+GF_Err gf_beng_encode_from_file(GF_BifsEngine *beng, char *auFile, GF_Err (*AUCallback)(void *, char *data, u32 size, u64 ts));\r
+\r
+/**\r
+ * @beng, pointer to the GF_BifsEngine returned by BENC_Init\r
+ * @auString, a char string to encode (must one or several complete nodes in BT\r
+ * @AUCallback, pointer on a callback function to get the result of the coding the AU using the current context\r
+ *\r
+ */\r
+GF_Err gf_beng_encode_from_string(GF_BifsEngine *beng, char *auString, GF_Err (*AUCallback)(void *, char *data, u32 size, u64 ts));\r
+\r
+/**\r
+ * @beng, pointer to the GF_BifsEngine returned by BENC_Init\r
+ * @ctxFileName, name of the file to save the current state of the BIFS scene to\r
+ *\r
+ * save the current context of the beng.\r
+ * if you want to save an aggregate context, use BENC_AggregateCurrentContext before\r
+ *\r
+ */\r
+GF_Err gf_beng_save_context(GF_BifsEngine *beng, char *ctxFileName);\r
+\r
+/**\r
+ * @beng, pointer to the GF_BifsEngine returned by BENC_Init\r
+ *\r
+ * aggregates the current context of the beng, creates a scene replace\r
+ *\r
+ */\r
+GF_Err gf_beng_aggregate_context(GF_BifsEngine *beng);\r
+\r
+/**\r
+ * @beng, pointer to the GF_BifsEngine returned by BENC_Init\r
+ *\r
+ * release the memory used by this beng, no more call on the beng should happen after this\r
+ *\r
+ */\r
+void gf_beng_terminate(GF_BifsEngine *beng);\r
+\r
+\r
+#endif\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif // __cplusplus\r
+\r
+\r
+#endif /*_GF_BIFSENGINE_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/bitstream.h b/tstools/DtsEdit/src/gpac/bitstream.h
new file mode 100644 (file)
index 0000000..887d0d1
--- /dev/null
@@ -0,0 +1,450 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / common tools sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_BITSTREAM_H_\r
+#define _GF_BITSTREAM_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/*!\r
+ *     \file <gpac/bitstream.h>\r
+ *     \brief bitstream functions.\r
+ */\r
+\r
+/*!\r
+ *     \addtogroup bs_grp bitstream\r
+ *     \ingroup utils_grp\r
+ *     \brief BitStream object\r
+ *\r
+ *     This section documents the bitstream object of the GPAC framework.\r
+ *     \note Unless specified, all functions assume Big-Endian ordering of data in the bitstream.\r
+ *     @{\r
+ */\r
+\r
+#include <gpac/tools.h>\r
+\r
+\r
+enum\r
+{\r
+       GF_BITSTREAM_READ = 0,\r
+       GF_BITSTREAM_WRITE,\r
+};\r
+\r
+typedef struct __tag_bitstream GF_BitStream;\r
+\r
+/*!\r
+ *     \brief bitstream constructor\r
+ *\r
+ *     Constructs a bitstream from a buffer (read or write mode)\r
+ *     \param buffer buffer to read or write. In WRITE mode, this can be NULL to let the bitstream object dynamically allocate memory, in which case the size param is ignored.\r
+ *     \param size size of the buffer given. \r
+ *     \param mode operation mode for this bitstream: GF_BITSTREAM_READ for read, GF_BITSTREAM_WRITE for write.\r
+ *     \return new bitstream object\r
+ *     \note In write mode on an existing data buffer, data overflow is never signaled but simply ignored, it is the caller responsability to ensure it \r
+ *     does not write more than possible.\r
+ */\r
+GF_BitStream *gf_bs_new(char *buffer, u64 size, u32 mode);\r
+/*!\r
+ *     \brief bitstream constructor from file handle\r
+ *\r
+ * Creates a bitstream from a file handle. \r
+ * \param f handle of the file to use. This handle must be created with binary mode.\r
+ *     \param mode operation mode for this bitstream: GF_BITSTREAM_READ for read, GF_BITSTREAM_WRITE for write.\r
+ *     \return new bitstream object\r
+ *     \note - You have to open your file in the appropriated mode:\n\r
+ *     - GF_BITSTREAM_READ: bitstream is constructed for reading\n\r
+ *     - GF_BITSTREAM_WRITE: bitstream is constructed for writing\n\r
+ *     \note - you may use any of these modes for a file with read/write access.\r
+ *     \warning RESULTS ARE UNEXPECTED IF YOU TOUCH THE FILE WHILE USING THE BITSTREAM.\r
+ */\r
+GF_BitStream *gf_bs_from_file(FILE *f, u32 mode);\r
+/*!\r
+ *     \brief bitstream constructor from file handle\r
+ *\r
+ * Deletes the bitstream object. If the buffer was created by the bitstream, it is deleted if still present.\r
+ */\r
+void gf_bs_del(GF_BitStream *bs);\r
+\r
+/*!\r
+ *     \brief integer reading\r
+ *\r
+ *     Reads an integer coded on a number of bit.\r
+ *     \param bs the target bitstream \r
+ *     \param nBits the number of bits to read\r
+ *     \return the integer value read.\r
+ */\r
+u32 gf_bs_read_int(GF_BitStream *bs, u32 nBits);\r
+/*!\r
+ *     \brief large integer reading\r
+ *\r
+ *     Reads a large integer coded on a number of bit bigger than 32.\r
+ *     \param bs the target bitstream \r
+ *     \param nBits the number of bits to read\r
+ *     \return the large integer value read.\r
+ */\r
+u64 gf_bs_read_long_int(GF_BitStream *bs, u32 nBits);\r
+/*!\r
+ *     \brief float reading\r
+ *\r
+ *     Reads a float coded as IEEE 32 bit format.\r
+ *     \param bs the target bitstream \r
+ *     \return the float value read.\r
+ */\r
+Float gf_bs_read_float(GF_BitStream *bs);\r
+/*!\r
+ *     \brief double reading\r
+ *\r
+ *     Reads a double coded as IEEE 64 bit format.\r
+ *     \param bs the target bitstream \r
+ *     \return the double value read.\r
+ */\r
+Double gf_bs_read_double(GF_BitStream *bs);\r
+/*!\r
+ *     \brief data reading\r
+ *\r
+ *     Reads a data buffer\r
+ *     \param bs the target bitstream \r
+ *     \param data the data buffer to be filled\r
+ *     \param nbBytes the amount of bytes to read\r
+ *     \return the number of bytes actually read.\r
+ *     \warning the data buffer passed must be large enough to hold the desired amount of bytes.\r
+ */\r
+u32 gf_bs_read_data(GF_BitStream *bs, char *data, u32 nbBytes);\r
+\r
+/*!\r
+ *     \brief align char reading\r
+ *\r
+ *     Reads an integer coded on 8 bits starting at a byte boundary in the bitstream.\r
+ *     \warning you must not use this function if the bitstream is not aligned\r
+ *     \param bs the target bitstream \r
+ *     \return the char value read.\r
+ */\r
+u32 gf_bs_read_u8(GF_BitStream *bs);\r
+/*!\r
+ *     \brief align short reading\r
+ *\r
+ *     Reads an integer coded on 16 bits starting at a byte boundary in the bitstream.\r
+ *     \warning you must not use this function if the bitstream is not aligned\r
+ *     \param bs the target bitstream \r
+ *     \return the short value read.\r
+ */\r
+u32 gf_bs_read_u16(GF_BitStream *bs);\r
+/*!\r
+ *     \brief align 24-bit integer reading\r
+ *\r
+ *     Reads an integer coded on 24 bits starting at a byte boundary in the bitstream.\r
+ *     \warning you must not use this function if the bitstream is not aligned\r
+ *     \param bs the target bitstream \r
+ *     \return the integer value read.\r
+ */\r
+u32 gf_bs_read_u24(GF_BitStream *bs);\r
+/*!\r
+ *     \brief align integer reading\r
+ *\r
+ *     Reads an integer coded on 32 bits starting at a byte boundary in the bitstream.\r
+ *     \warning you must not use this function if the bitstream is not aligned\r
+ *     \param bs the target bitstream \r
+ *     \return the integer value read.\r
+ */\r
+u32 gf_bs_read_u32(GF_BitStream *bs);\r
+/*!\r
+ *     \brief align large integer reading\r
+ *\r
+ *     Reads an integer coded on 64 bits starting at a byte boundary in the bitstream.\r
+ *     \warning you must not use this function if the bitstream is not aligned\r
+ *     \param bs the target bitstream \r
+ *     \return the large integer value read.\r
+ */\r
+u64 gf_bs_read_u64(GF_BitStream *bs);\r
+/*!\r
+ *     \brief little endian integer reading\r
+ *\r
+ *     Reads an integer coded on 32 bits in little-endian order.\r
+ *     \param bs the target bitstream \r
+ *     \return the integer value read.\r
+ */\r
+u32 gf_bs_read_u32_le(GF_BitStream *bs);\r
+/*!\r
+ *     \brief little endian integer reading\r
+ *\r
+ *     Reads an integer coded on 16 bits in little-endian order.\r
+ *     \param bs the target bitstream \r
+ *     \return the integer value read.\r
+ */\r
+u16 gf_bs_read_u16_le(GF_BitStream *bs);\r
+\r
+\r
+/*!\r
+ *     \brief variable length integer reading\r
+ *\r
+ *     Reads an integer coded on a variable number of 4-bits chunks. The number of chunks is given by the number of non-0 bits at the begining.\r
+ *     \param bs the target bitstream \r
+ *     \return the integer value read.\r
+ */\r
+u32 gf_bs_read_vluimsbf5(GF_BitStream *bs);\r
+\r
+/*!\r
+ *     \brief bit position\r
+ *\r
+ *     Returns current bit position in the bitstream - only works in memory mode.\r
+ *     \param bs the target bitstream \r
+ *     \return the integer value read.\r
+ */\r
+u32 gf_bs_get_bit_offset(GF_BitStream *bs);\r
+\r
+/*!\r
+ *     \brief current bit position\r
+ *\r
+ *     Returns bit position in the current byte of the bitstream - only works in memory mode.\r
+ *     \param bs the target bitstream \r
+ *     \return the integer value read.\r
+ */\r
+u32 gf_bs_get_bit_position(GF_BitStream *bs);\r
+\r
+\r
+/*!\r
+ *     \brief integer writing\r
+ *\r
+ *     Writes an integer on a given number of bits.\r
+ *     \param bs the target bitstream \r
+ *     \param value the integer to write\r
+ *     \param nBits number of bits used to code the integer\r
+ */\r
+void gf_bs_write_int(GF_BitStream *bs, s32 value, s32 nBits);\r
+/*!\r
+ *     \brief large integer writing\r
+ *\r
+ *     Writes an integer on a given number of bits greater than 32.\r
+ *     \param bs the target bitstream \r
+ *     \param value the large integer to write\r
+ *     \param nBits number of bits used to code the integer\r
+ */\r
+void gf_bs_write_long_int(GF_BitStream *bs, s64 value, s32 nBits);\r
+/*!\r
+ *     \brief float writing\r
+ *\r
+ *     Writes a float in IEEE 32 bits format.\r
+ *     \param bs the target bitstream \r
+ *     \param value the float to write\r
+ */\r
+void gf_bs_write_float(GF_BitStream *bs, Float value);\r
+/*!\r
+ *     \brief double writing\r
+ *\r
+ *     Writes a double in IEEE 64 bits format.\r
+ *     \param bs the target bitstream \r
+ *     \param value the double to write\r
+ */\r
+void gf_bs_write_double(GF_BitStream *bs, Double value);\r
+/*!\r
+ *     \brief data writing\r
+ *\r
+ *     Writes a data buffer.\r
+ *     \param bs the target bitstream \r
+ *     \param data the data to write\r
+ *     \param nbBytes number of data bytes to write\r
+ */\r
+u32 gf_bs_write_data(GF_BitStream *bs, char *data, u32 nbBytes);\r
+\r
+/*!\r
+ *     \brief align char writing\r
+ *\r
+ *     Writes an integer on 8 bits starting at a byte boundary in the bitstream.\r
+ *     \warning you must not use this function if the bitstream is not aligned\r
+ *     \param bs the target bitstream \r
+ *     \param value the char value to write\r
+ */\r
+void gf_bs_write_u8(GF_BitStream *bs, u32 value);\r
+/*!\r
+ *     \brief align short writing\r
+ *\r
+ *     Writes an integer on 16 bits starting at a byte boundary in the bitstream.\r
+ *     \warning you must not use this function if the bitstream is not aligned\r
+ *     \param bs the target bitstream \r
+ *     \param value the short value to write\r
+ */\r
+void gf_bs_write_u16(GF_BitStream *bs, u32 value);\r
+/*!\r
+ *     \brief align 24-bits integer writing\r
+ *\r
+ *     Writes an integer on 24 bits starting at a byte boundary in the bitstream.\r
+ *     \warning you must not use this function if the bitstream is not aligned\r
+ *     \param bs the target bitstream \r
+ *     \param value the integer value to write\r
+ */\r
+void gf_bs_write_u24(GF_BitStream *bs, u32 value);\r
+/*!\r
+ *     \brief align integer writing\r
+ *\r
+ *     Writes an integer on 32 bits starting at a byte boundary in the bitstream.\r
+ *     \warning you must not use this function if the bitstream is not aligned\r
+ *     \param bs the target bitstream \r
+ *     \param value the integer value to write\r
+ */\r
+void gf_bs_write_u32(GF_BitStream *bs, u32 value);\r
+/*!\r
+ *     \brief align large integer writing\r
+ *\r
+ *     Writes an integer on 64 bits starting at a byte boundary in the bitstream.\r
+ *     \warning you must not use this function if the bitstream is not aligned\r
+ *     \param bs the target bitstream \r
+ *     \param value the large integer value to write\r
+ */\r
+void gf_bs_write_u64(GF_BitStream *bs, u64 value);\r
+/*!\r
+ *     \brief little endian integer writing\r
+ *\r
+ *     Writes an integer on 32 bits in little-endian order.\r
+ *     \param bs the target bitstream\r
+ *     \param value the integer value to write\r
+ */\r
+void gf_bs_write_u32_le(GF_BitStream *bs, u32 value);\r
+/*!\r
+ *     \brief little endian short writing\r
+ *\r
+ *     Writes an integer on 16 bits in little-endian order.\r
+ *     \param bs the target bitstream\r
+ *     \param value the short value to write\r
+ */\r
+void gf_bs_write_u16_le(GF_BitStream *bs, u32 value);\r
+\r
+/*!\r
+ *     \brief end of bitstream management\r
+ *\r
+ *     Assigns a notification callback function for end of stream signaling in read mode\r
+ *     \param bs the target bitstream\r
+ *     \param EndOfStream the notification function to use\r
+ *     \param par opaque user data passed to the bitstream\r
+ */\r
+void gf_bs_set_eos_callback(GF_BitStream *bs, void (*EndOfStream)(void *par), void *par);\r
+\r
+/*!\r
+ *     \brief bitstream alignment\r
+ *\r
+ *     Aligns bitstream to next byte boundary. In write mode, this will write 0 bit values until alignment.\r
+ *     \param bs the target bitstream\r
+ *     \return the number of bits read/written until alignment\r
+ */\r
+u8 gf_bs_align(GF_BitStream *bs);\r
+/*!\r
+ *     \brief capacity query\r
+ *\r
+ *     Returns the number of bytes still available in the bitstream in read mode.\r
+ *     \param bs the target bitstream\r
+ *     \return the number of bytes still available in read mode, -1 in write modes.\r
+ */\r
+u64 gf_bs_available(GF_BitStream *bs);\r
+/*!\r
+ *     \brief buffer fetching\r
+ *\r
+ *     Fetches the internal bitstream buffer in write mode. If a buffer was given at the bitstream construction, or if the bitstream is in read mode, this does nothing.\r
+ *     \param bs the target bitstream\r
+ *     \param output address of a memory block to be allocated for bitstream data.\r
+ *     \param outSize set to the size of the allocated memory block.\r
+ *     \note \r
+       * It is the user responsability to destroy the allocated buffer\r
+       * Once this function has been called, the internal bitstream buffer is reseted.\r
+ */\r
+void gf_bs_get_content(GF_BitStream *bs, char **output, u32 *outSize);\r
+/*!\r
+ *     \brief byte skipping\r
+ *\r
+ *     Skips bytes in the bitstream. In Write mode, this will write the 0 integer value for memory-based bitstreams or seek the stream\r
+ for file-based bitstream.\r
+ *     \param bs the target bitstream\r
+ *     \param nbBytes the number of bytes to skip\r
+ */\r
+void gf_bs_skip_bytes(GF_BitStream *bs, u64 nbBytes);\r
+\r
+/*!\r
+ *\brief bitstream seeking\r
+ *\r
+ *Seeks the bitstream to a given offset after the begining of the stream. This will perform alignment of the bitstream in all modes.\r
+ *\warning Results are unpredictable if seeking beyond the bitstream end is performed.\r
+ *\param bs the target bitstream\r
+ *\param offset buffer/file offset to seek to\r
+ */\r
+GF_Err gf_bs_seek(GF_BitStream *bs, u64 offset);\r
+\r
+/*!\r
+ *\brief bit peeking \r
+ *\r
+ *Peeks a given number of bits (read without moving the position indicator) for read modes only.\r
+ *\param bs the target bitstream\r
+ *\param numBits the number of bits to peek\r
+ *\param byte_offset\r
+       * if set, bitstream is aligned and moved from byte_offset before peeking (byte-aligned picking)\r
+       * otherwise, bitstream is not aligned and bits are peeked from current state\r
+ *\return the integer value read\r
+*/\r
+u32 gf_bs_peek_bits(GF_BitStream *bs, u32 numBits, u32 byte_offset);\r
+\r
+/*!\r
+ *\brief bit reservoir query\r
+ *\r
+ * Queries the number of bits available in read mode.\r
+ *\param bs the target bitstream\r
+ *\return number of available bits if position is in the last byte of the buffer/stream, 8 otherwise\r
+ */\r
+u8 gf_bs_bits_available(GF_BitStream *bs);\r
+/*!\r
+ *\brief position query\r
+ *\r
+ *Returns the reading/writting position in the buffer/file.\r
+ *\param bs the target bitstream\r
+ *\return the read/write position of the bitstream\r
+ */\r
+u64 gf_bs_get_position(GF_BitStream *bs);\r
+/*!\r
+ *\brief size query\r
+ *\r
+ *Returns the size of the associated buffer/file.\r
+ *\param bs the target bitstream\r
+ *\return the size of the bitstream\r
+ */\r
+u64 gf_bs_get_size(GF_BitStream *bs);\r
+/*!\r
+ *\brief file-based size query\r
+ *\r
+ *Returns the size of a file-based bitstream and force a seek to end of file. This is used in case the file handle\r
+ *describes a file being constructed on disk while being read?\r
+ *\r
+ *\param bs the target bitstream\r
+ *\return the disk size of the associated file\r
+ */\r
+u64 gf_bs_get_refreshed_size(GF_BitStream *bs);\r
+\r
+\r
+\r
+/*! @} */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif         /*_GF_BITSTREAM_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/color.h b/tstools/DtsEdit/src/gpac/color.h
new file mode 100644 (file)
index 0000000..ee53b54
--- /dev/null
@@ -0,0 +1,239 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / common tools interfaces\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+\r
+#ifndef _GF_RASTER_2D_H_\r
+#define _GF_RASTER_2D_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/constants.h>\r
+\r
+\r
+/*!\r
+ *\addtogroup color_grp color\r
+ *\ingroup utils_grp\r
+ *\brief Color tools\r
+ *\r
+ *This section documents color tools for image processing and color conversion\r
+ *     @{\r
+ */\r
+\r
+\r
+/*!\brief Video framebuffer object\r
+ *\r
+ *The video framebuffer object represents uncompressed color data like images in a variety of formats. Data in\r
+ *the video framebuffer MUST be continuous.\r
+*/\r
+typedef struct\r
+{\r
+       /*!Width of the video framebuffer */\r
+       u32 width;\r
+       /*!Height of the video framebuffer */\r
+       u32 height;\r
+       /*!Vertical pitch of the video framebuffer (number of bytes to skip to go down one line in the buffer). May be \r
+       negative for some framebuffers (embedded devices)*/\r
+       s32 pitch;\r
+       /*!Pixel format of the video framebuffer*/\r
+       u32 pixel_format;\r
+       /*!pointer to the begining of the video memory (top-left corner)*/\r
+       char *video_buffer;\r
+       /*!indicates that the video data reside on systems memory or video card one*/\r
+       Bool is_hardware_memory;\r
+} GF_VideoSurface;\r
+\r
+/*!\brief Video Window object\r
+ *\r
+ *The video window object represents a rectangle in framebuffer coordinate system\r
+*/\r
+typedef struct\r
+{\r
+       /*!left-most coordinate of the rectangle*/\r
+       u32 x;\r
+       /*!top-most coordinate of the rectangle*/\r
+       u32 y;\r
+       /*!width of the rectangle*/\r
+       u32 w;\r
+       /*!height of the rectangle*/\r
+       u32 h;\r
+} GF_Window;\r
+\r
+\r
+/*!\brief color matrix object\r
+ *\r
+ *The Color transformation matrix object allows complete color space transformation (shift, rotate, skew, add).\n\r
+ *The matrix coefs are in rgba order, hence the color RGBA is transformed to:\r
+ \code\r
+       R'              m0      m1      m2      m3      m4                      R\r
+       G'              m5      m6      m7      m8      m9                      G\r
+       B'      =       m10     m11     m12     m13     m14             x       B\r
+       A'              m15     m16     m17     m18     m19                     A\r
+       0               0       0       0       0       1                       0\r
+ \endcode\r
+ *Coeficients are in intensity scale, ranging from 0 to \ref FIX_ONE.\r
+*/\r
+typedef struct\r
+{\r
+       /*!color matrix coefficient*/\r
+       Fixed m[20];\r
+       /*!internal flag to speed up things when matrix is identity. This is a read only flag, do not modify it*/\r
+       u32 identity;\r
+} GF_ColorMatrix;\r
+\r
+/*!\brief ARGB color object\r
+ *\r
+ *The color type used in the GPAC framework represents colors in the form 0xAARRGGBB, with each component ranging from 0 to 255\r
+*/\r
+typedef u32 GF_Color;\r
+/*!\hideinitializer color formating macro from alpha, red, green and blue components expressed as integers ranging from 0 to 255*/\r
+#define GF_COL_ARGB(a, r, g, b) ((a)<<24 | (r)<<16 | (g)<<8 | (b))\r
+/*!\hideinitializer color formating macro from alpha, red, green and blue components expressed as fixed numbers ranging from 0 to \ref FIX_ONE*/\r
+#define GF_COL_ARGB_FIXED(_a, _r, _g, _b) GF_COL_ARGB(FIX2INT(255*(_a)), FIX2INT(255*(_r)), FIX2INT(255*(_g)), FIX2INT(255*(_b)))\r
+/*!\hideinitializer gets alpha component of a color*/\r
+#define GF_COL_A(c) (u8) ((c)>>24)\r
+/*!\hideinitializer gets red component of a color*/\r
+#define GF_COL_R(c) (u8) ( ((c)>>16) & 0xFF)\r
+/*!\hideinitializer gets green component of a color*/\r
+#define GF_COL_G(c) (u8) ( ((c)>>8) & 0xFF)\r
+/*!\hideinitializer gets blue component of a color*/\r
+#define GF_COL_B(c) (u8) ( (c) & 0xFF)\r
+/*!\hideinitializer 16-bits color formating macro from red, green and blue components*/\r
+#define GF_COL_565(r, g, b) (u16) (((r & 248)<<8) + ((g & 252)<<3)  + (b>>3))\r
+/*!\hideinitializer 15-bits color formating macro from red, green and blue components*/\r
+#define GF_COL_555(r, g, b) (u16) (((r & 248)<<7) + ((g & 248)<<2)  + (b>>3))\r
+/*!\hideinitializer 15-bits color formating macro from red, green and blue components*/\r
+#define GF_COL_444(r, g, b) (u16) (((r & 240)<<4) + ((g & 240))  + ((b & 240)>>4))\r
+/*!\hideinitializer 16-bits alphagrey color formating macro alpha and grey components*/\r
+#define GF_COL_AG(a, g) (u16) ( (a << 8) | g)\r
+/*!\hideinitializer transfoms a 32-bits color into a 16-bits one.\note alpha component is lost*/\r
+#define GF_COL_TO_565(c) (((GF_COL_R(c) & 248)<<8) + ((GF_COL_G(c) & 252)<<3)  + (GF_COL_B(c)>>3))\r
+/*!\hideinitializer transfoms a 32-bits color into a 15-bits one.\note alpha component is lost*/\r
+#define GF_COL_TO_555(c) (((GF_COL_R(c) & 248)<<7) + ((GF_COL_G(c) & 248)<<2)  + (GF_COL_B(c)>>3))\r
+/*!\hideinitializer transfoms a 32-bits color into a 16-bits alphagrey one.\note red component is used for grey, green and blue components are lost.*/\r
+#define GF_COL_TO_AG(c) ( (GF_COL_A(c) << 8) | GF_COL_R(c))\r
+/*!\hideinitializer transfoms a 32-bits color into a 15-bits one.\note alpha component is lost*/\r
+#define GF_COL_TO_444(c) (((GF_COL_R(c) & 240)<<4) + ((GF_COL_G(c) & 240))  + ((GF_COL_B(c)>>4) & 240) )\r
+\r
+/*!Inits a color matrix to identity*/\r
+void gf_cmx_init(GF_ColorMatrix *_this);\r
+/*!Inits all coefficients of a color matrix \r
+ *\param _this color matrix to initialize\r
+ *\param coefs list of the 20 fixed numbers to copy\r
+*/\r
+void gf_cmx_set_all(GF_ColorMatrix *_this, Fixed *coefs);\r
+/*!Inits all coefficients of a color matrix \r
+ *\param _this color matrix to initialize\r
+ *\param mrr red-to-red multiplication factor\r
+ *\param mrg red-to-green multiplication factor\r
+ *\param mrb red-to-blue multiplication factor\r
+ *\param mra red-to-alpha multiplication factor\r
+ *\param tr red translation factor\r
+ *\param mgr green-to-red multiplication factor\r
+ *\param mgg green-to-green multiplication factor\r
+ *\param mgb green-to-blue multiplication factor\r
+ *\param mga green-to-alpha multiplication factor\r
+ *\param tg green translation factor\r
+ *\param mbr blue-to-red multiplication factor\r
+ *\param mbg blue-to-green multiplication factor\r
+ *\param mbb blue-to-blue multiplication factor\r
+ *\param mba blue-to-alpha multiplication factor\r
+ *\param tb blue translation factor\r
+ *\param mar alpha-to-red multiplication factor\r
+ *\param mag alpha-to-green multiplication factor\r
+ *\param mab alpha-to-blue multiplication factor\r
+ *\param maa alpha-to-alpha multiplication factor\r
+ *\param ta alpha translation factor\r
+*/\r
+void gf_cmx_set(GF_ColorMatrix *_this, \r
+                                Fixed mrr, Fixed mrg, Fixed mrb, Fixed mra, Fixed tr,\r
+                                Fixed mgr, Fixed mgg, Fixed mgb, Fixed mga, Fixed tg,\r
+                                Fixed mbr, Fixed mbg, Fixed mbb, Fixed mba, Fixed tb,\r
+                                Fixed mar, Fixed mag, Fixed mab, Fixed maa, Fixed ta);\r
+/*!Inits a matrix from another matrix\r
+ *\param _this color matrix to initialize\r
+ *\param from color matrix to copy from\r
+*/\r
+void gf_cmx_copy(GF_ColorMatrix *_this, GF_ColorMatrix *from);\r
+/*!\brief color matrix multiplication\r
+ *\r
+ *Multiplies a color matrix by another one. Result is _this*with\r
+ *\param _this color matrix to transform. Once the function called, _this will contain the resulting color matrix\r
+ *\param with color matrix to add\r
+*/\r
+void gf_cmx_multiply(GF_ColorMatrix *_this, GF_ColorMatrix *with);\r
+/*!\brief color matrix transform\r
+ *\r
+ *Transforms a color with a given color matrix\r
+ *\param _this color matrix to use.\r
+ *\param col color to transform\r
+ *\return transformed color\r
+*/\r
+GF_Color gf_cmx_apply(GF_ColorMatrix *_this, GF_Color col);\r
+/*!\brief color components matrix transform\r
+ *\r
+ *Transforms color components with a given color matrix\r
+ *\param _this color matrix to use.\r
+ *\param a pointer to alpha component. Once the function is called, a contains the transformed alpha component\r
+ *\param r pointer to red component. Once the function is called, r contains the transformed red component\r
+ *\param g pointer to green component. Once the function is called, g contains the transformed green component\r
+ *\param b pointer to blue component. Once the function is called, b contains the transformed blue component\r
+*/\r
+void gf_cmx_apply_fixed(GF_ColorMatrix *_this, Fixed *a, Fixed *r, Fixed *g, Fixed *b);\r
+\r
+\r
+/*!\brief Color Key descriptor\r
+ *\r
+ *The ColorKey object represents a ColorKey with low and high threshold keying\r
+*/\r
+typedef struct\r
+{\r
+       /*!color key R, G, and B components*/\r
+       u8 r, g, b;\r
+       /*!Alpha value for opaque (non-keyed) pixels*/\r
+       u8 alpha;\r
+       /*!low variance threshold*/\r
+       u8 low;\r
+       /*!high variance threshold*/\r
+       u8 high;\r
+} GF_ColorKey;\r
+\r
+/*!\brief not done yet\r
+ *\r
+ */\r
+GF_Err gf_stretch_bits(GF_VideoSurface *dst, GF_VideoSurface *src, GF_Window *dst_wnd, GF_Window *src_wnd, s32 dst_x_pitch, u8 alpha, Bool flip, GF_ColorKey *colorKey, GF_ColorMatrix * cmat);\r
+\r
+\r
+\r
+/*! @} */\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif /*_GF_RASTER_2D_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/compositor.h b/tstools/DtsEdit/src/gpac/compositor.h
new file mode 100644 (file)
index 0000000..9eb001b
--- /dev/null
@@ -0,0 +1,164 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / Scene Compositor sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_COMPOSITOR_H_\r
+#define _GF_COMPOSITOR_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+\r
+/*include scene graph API*/\r
+#include <gpac/scenegraph.h>\r
+/*GF_User and GF_Terminal */\r
+#include <gpac/user.h>\r
+/*frame buffer definition*/\r
+#include <gpac/color.h>\r
+\r
+typedef struct __tag_compositor GF_Compositor;\r
+\r
+/*creates default compositor \r
+if self_threaded, video compositor uses a dedicated thread, otherwise visual rendering is done by the user\r
+audio compositor always runs in its own thread if enabled\r
+term may be NULL, in which case InputSensors won't be enabled\r
+*/\r
+GF_Compositor *gf_sc_new(GF_User *user_interface, Bool self_threaded, GF_Terminal *term);\r
+void gf_sc_del(GF_Compositor *sr);\r
+\r
+/*sets simulation frame rate*/\r
+void gf_sc_set_fps(GF_Compositor *sr, Double fps);\r
+\r
+/*set the root scene graph of the compositor - if NULL remove current and reset simulation time*/\r
+GF_Err gf_sc_set_scene(GF_Compositor *sr, GF_SceneGraph *scene_graph);\r
+\r
+/*if the compositor doesn't use its own thread for visual, this will perform a render pass*/\r
+Bool gf_sc_draw_frame(GF_Compositor *sr);\r
+\r
+/*inits rendering info for the node - shall be called for all nodes the parent system doesn't handle*/\r
+void gf_sc_on_node_init(GF_Compositor *sr, GF_Node *node);\r
+\r
+/*notify the given node has been modified. The compositor filters object to decide whether the scene graph has to be \r
+traversed or not- if object is NULL, this means complete traversing of the graph is requested (use carefully since it\r
+can be a time consuming operation)*/\r
+void gf_sc_invalidate(GF_Compositor *sr, GF_Node *byObj);\r
+\r
+/*return the compositor time - this is the time every time line syncs on*/\r
+u32 gf_sc_get_clock(GF_Compositor *sr);\r
+\r
+\r
+/*locks/unlocks the visual scene rendering - modification of the scene tree shall only happen when scene compositor is locked*/\r
+void gf_sc_lock(GF_Compositor *sr, Bool doLock);\r
+/*locks/unlocks the audio scene rendering - this is needed whenever an audio object changes config on the fly*/\r
+void gf_sc_lock_audio(GF_Compositor *sr, Bool doLock);\r
+\r
+/*notify user input - returns 0 if event hasn't been handled by the compositor*/\r
+Bool gf_sc_user_event(GF_Compositor *sr, GF_Event *event);\r
+\r
+/*maps screen coordinates to bifs 2D coordinates for the current zoom/pan settings\r
+X and Y are point coordinates in the display expressed in BIFS-like fashion (0,0) at center of \r
+display and Y increasing from bottom to top*/\r
+void gf_sc_map_point(GF_Compositor *sr, s32 X, s32 Y, Fixed *bifsX, Fixed *bifsY);\r
+\r
+/*signal the size of the display area has been changed*/\r
+GF_Err gf_sc_size_changed(GF_Compositor *sr, u32 NewWidth, u32 NewHeight);\r
+\r
+/*set/get user options - options are as defined in user.h*/\r
+GF_Err gf_sc_set_option(GF_Compositor *sr, u32 type, u32 value);\r
+u32 gf_sc_get_option(GF_Compositor *sr, u32 type);\r
+\r
+/*returns current FPS\r
+if @absoluteFPS is set, the return value is the absolute framerate, eg NbFrameCount/NbTimeSpent regardless of\r
+whether a frame has been drawn or not, which means the FPS returned can be much greater than the compositor FPS\r
+if @absoluteFPS is not set, the return value is the FPS taking into account not drawn frames (eg, less than or equal to\r
+compositor FPS)\r
+*/\r
+Double gf_sc_get_fps(GF_Compositor *sr, Bool absoluteFPS);\r
+\r
+Bool gf_sc_has_text_selection(GF_Compositor *compositor);\r
+const char *gf_sc_get_selected_text(GF_Compositor *compositor);\r
+\r
+GF_Err gf_sc_paste_text(GF_Compositor *compositor, const char *text);\r
+\r
+/*user-define management: this is used for instant visual rendering of the scene graph, \r
+for exporting or authoring tools preview. User is responsible for calling render when desired and shall also maintain\r
+scene timing*/\r
+\r
+/*force render tick*/\r
+void gf_sc_render(GF_Compositor *sr);\r
+/*gets screen buffer - this locks the scene graph too until released is called*/\r
+GF_Err gf_sc_get_screen_buffer(GF_Compositor *sr, GF_VideoSurface *framebuffer, Bool depth_buffer);\r
+/*releases screen buffer and unlocks graph*/\r
+GF_Err gf_sc_release_screen_buffer(GF_Compositor *sr, GF_VideoSurface *framebuffer);\r
+\r
+/*renders one frame*/\r
+void gf_sc_simulation_tick(GF_Compositor *sr);\r
+\r
+/*forces graphics cache recompute*/\r
+void gf_sc_reset_graphics(GF_Compositor *sr);\r
+\r
+/*picks a node (may return NULL) - coords are given in OS client system coordinate, as in UserInput*/\r
+GF_Node *gf_sc_pick_node(GF_Compositor *sr, s32 X, s32 Y);\r
+\r
+/*get viewpoints/viewports for main scene - idx is 1-based, and if greater than number of viewpoints return GF_EOS*/\r
+GF_Err gf_sc_get_viewpoint(GF_Compositor *sr, u32 viewpoint_idx, const char **outName, Bool *is_bound);\r
+/*set viewpoints/viewports for main scene given its name - idx is 1-based, or 0 to retrieve by viewpoint name\r
+if only one viewpoint is present in the scene, this will bind/unbind it*/\r
+GF_Err gf_sc_set_viewpoint(GF_Compositor *sr, u32 viewpoint_idx, const char *viewpoint_name);\r
+\r
+/*render subscene root node. rs is the current traverse stack\r
+this is needed to handle graph metrics changes between scenes...*/\r
+void gf_sc_traverse_subscene(GF_Compositor *sr, GF_Node *inline_parent, GF_SceneGraph *subscene, void *rs);\r
+\r
+/*set outupt size*/\r
+GF_Err gf_sc_set_size(GF_Compositor *sr, u32 NewWidth, u32 NewHeight);\r
+/*get outupt size*/\r
+Bool gf_sc_get_size(GF_Compositor *sr, u32 *Width, u32 *Height);\r
+\r
+/*returns total length of audio hardware buffer in ms, 0 if no audio*/\r
+u32 gf_sc_get_audio_buffer_length(GF_Compositor *sr);\r
+\r
+/*add/remove extra scene from compositor (extra scenes are OSDs or any other scene graphs not directly\r
+usable by main scene, like 3GP text streams*/\r
+void gf_sc_register_extra_graph(GF_Compositor *sr, GF_SceneGraph *extra_scene, Bool do_remove);\r
+\r
+/*gets audio hardware delay*/\r
+u32 gf_sc_get_audio_delay(GF_Compositor *sr);\r
+\r
+/*returns total length of audio hardware buffer in ms, 0 if no audio*/\r
+u32 gf_sc_get_audio_buffer_length(GF_Compositor *sr);\r
+\r
+void *gf_sc_get_visual_compositor(GF_Compositor *sr);\r
+\r
+GF_Compositor *gf_sc_get_compositor(GF_Node *node);\r
+\r
+Bool gf_sc_script_action(GF_Compositor *sr, u32 type, GF_Node *n, GF_JSAPIParam *param);\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /*_GF_COMPOSITOR_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/config_file.h b/tstools/DtsEdit/src/gpac/config_file.h
new file mode 100644 (file)
index 0000000..b855a48
--- /dev/null
@@ -0,0 +1,165 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / common tools sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_CONFIG_FILE_H_\r
+#define _GF_CONFIG_FILE_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/*!\r
+ *     \file <gpac/config_file.h>\r
+ *     \brief configuration file functions.\r
+ */\r
+\r
+ /*!\r
+ *     \addtogroup cfg_grp configuration\r
+ *     \ingroup utils_grp\r
+ *     \brief Configuration File object\r
+ *\r
+ *     This section documents the configuration file object of the GPAC framework.\r
+ *     This file is formatted as the INI file mode of WIN32 in sections and keys.\n\r
+ *\note For more information on the GPAC configuration file itself, please refer to the GPAC configuration help provided with GPAC.\r
+ *     @{\r
+ */\r
+\r
+#include <gpac/tools.h>\r
+\r
+\r
+typedef struct __tag_config GF_Config;\r
+\r
+/*!\r
+ *     \brief configuration file constructor\r
+ *\r
+ *Constructs a configuration file\r
+ *\param filePath directory the file is located in\r
+ *\param fileName name of the configuration file\r
+ *\return the configuration file object\r
+ */\r
+GF_Config *gf_cfg_new(const char *filePath, const char *fileName);\r
+/*!\r
+ *     \brief configuration file destructor\r
+ *\r
+ *Destroys the configuration file and saves it if needed.\r
+ *\param cfgFile the target configuration file\r
+ */\r
+void gf_cfg_del(GF_Config *cfgFile);\r
+/*!\r
+ *     \brief configuration saving\r
+ *\r
+ *Saves the configuration file if modified.\r
+ *\param cfgFile the target configuration file\r
+ */\r
+GF_Err gf_cfg_save(GF_Config *iniFile);\r
+/*!\r
+ *     \brief key value query\r
+ *\r
+ *Gets a key value from its section and name.\r
+ *\param cfgFile the target configuration file\r
+ *\param secName the desired key parent section name\r
+ *\param keyName the desired key name\r
+ *\return the desired key value if found, NULL otherwise.\r
+ */\r
+const char *gf_cfg_get_key(GF_Config *cfgFile, const char *secName, const char *keyName);\r
+/*!\r
+ *     \brief key value update\r
+ *\r
+ *Sets a key value from its section and name.\r
+ *\param cfgFile the target configuration file\r
+ *\param secName the desired key parent section name\r
+ *\param keyName the desired key name\r
+ *\param keyValue the desired key value\r
+ *\note this will also create both section and key if they are not found in the configuration file\r
+ */\r
+GF_Err gf_cfg_set_key(GF_Config *cfgFile, const char *secName, const char *keyName, const char *keyValue);\r
+/*!\r
+ *     \brief section count query\r
+ *\r
+ *Gets the number of sections in the configuration file\r
+ *\param cfgFile the target configuration file\r
+ *\return the number of sections\r
+ */\r
+u32 gf_cfg_get_section_count(GF_Config *cfgFile);\r
+/*!\r
+ *     \brief section name query\r
+ *\r
+ *Gets a section name based on its index\r
+ *\param cfgFile the target configuration file\r
+ *\param secIndex 0-based index of the section to query\r
+ *\return the section name if found, NULL otherwise\r
+ */\r
+const char *gf_cfg_get_section_name(GF_Config *cfgFile, u32 secIndex);\r
+/*!\r
+ *     \brief key count query\r
+ *\r
+ *Gets the number of keys in a section of the configuration file\r
+ *\param cfgFile the target configuration file\r
+ *\param secName the target section\r
+ *\return the number of keys in the section\r
+ */\r
+u32 gf_cfg_get_key_count(GF_Config *cfgFile, const char *secName);\r
+/*!\r
+ *     \brief key count query\r
+ *\r
+ *Gets the number of keys in a section of the configuration file\r
+ *\param cfgFile the target configuration file\r
+ *\param secName the target section\r
+ *\param keyIndex 0-based index of the key in the section\r
+ *\return the key name if found, NULL otherwise\r
+ */\r
+const char *gf_cfg_get_key_name(GF_Config *cfgFile, const char *secName, u32 keyIndex);\r
+\r
+/*!\r
+ *     \brief key insertion\r
+ *\r
+ *Inserts a new key in a given section. Returns an error if a key with the given name \r
+ *already exists in the section\r
+ *\param cfgFile the target configuration file\r
+ *\param secName the target section\r
+ *\param keyName the name of the target key\r
+ *\param keyValue the value for the new key\r
+ *\param index the 0-based index position of the new key\r
+ */\r
+GF_Err gf_cfg_insert_key(GF_Config *cfgFile, const char *secName, const char *keyName, const char *keyValue, u32 index);\r
+\r
+/*!\r
+ *     \brief section destrouction\r
+ *\r
+ *Removes all entries in the given section\r
+ *\param cfgFile the target configuration file\r
+ *\param secName the target section\r
+ */\r
+void gf_cfg_del_section(GF_Config *cfgFile, const char *secName);\r
+\r
+/*! @} */\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif         /*_GF_CONFIG_FILE_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/constants.h b/tstools/DtsEdit/src/gpac/constants.h
new file mode 100644 (file)
index 0000000..ad36acb
--- /dev/null
@@ -0,0 +1,407 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / exported constants\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_CONSTANTS_H_\r
+#define _GF_CONSTANTS_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/tools.h>\r
+\r
+/*! \addtogroup cst_grp constants\r
+ *     \brief Constants used within GPAC\r
+ *\r
+ *     This section documents some constants used in the GPAC framework which are not related to\r
+ *     any specific sub-project.\r
+ *     \ingroup utils_grp\r
+ *     @{\r
+ */\r
+\r
+\r
+/*!\r
+ *     \brief Supported media stream types\r
+ *     \hideinitializer\r
+ *\r
+ * Supported media stream types for media objects.\r
+*/\r
+enum\r
+{\r
+       /*!MPEG-4 Object Descriptor Stream*/\r
+       GF_STREAM_OD            = 0x01,\r
+       /*!MPEG-4 Object Clock Reference Stream*/\r
+       GF_STREAM_OCR           = 0x02,\r
+       /*!MPEG-4 Scene Description Stream*/\r
+       GF_STREAM_SCENE         = 0x03,\r
+       /*!Visual Stream (Video, Image or MPEG-4 SNHC Tools)*/\r
+       GF_STREAM_VISUAL        = 0x04,\r
+       /*!Audio Stream (Audio, MPEG-4 Structured-Audio Tools)*/\r
+       GF_STREAM_AUDIO         = 0x05,\r
+       /*!MPEG-7 Description Stream*/\r
+       GF_STREAM_MPEG7         = 0x06,\r
+       /*!MPEG-4 Intellectual Property Management and Protection Stream*/\r
+       GF_STREAM_IPMP          = 0x07,\r
+       /*!MPEG-4 Object Content Information Stream*/\r
+       GF_STREAM_OCI           = 0x08,\r
+       /*!MPEG-4 MPEGlet Stream*/\r
+       GF_STREAM_MPEGJ         = 0x09,\r
+       /*!MPEG-4 User Interaction Stream*/\r
+       GF_STREAM_INTERACT      = 0x0A,\r
+       /*!MPEG-4 IPMP Tool Stream*/\r
+       GF_STREAM_IPMP_TOOL     = 0x0B,\r
+       /*!MPEG-4 Font Data Stream*/\r
+       GF_STREAM_FONT          = 0x0C,\r
+       /*!MPEG-4 Streaming Text Stream*/\r
+       GF_STREAM_TEXT          = 0x0D,\r
+       /*!Nero Digital Subpicture Stream*/\r
+       GF_STREAM_ND_SUBPIC = 0x38,\r
+\r
+       /*GPAC internal stream types*/\r
+\r
+\r
+       /*!GPAC Private Scene streams\n\r
+       *\n\note\r
+       *this stream type (MPEG-4 user-private) is reserved for streams only used to create a scene decoder \r
+       *handling the scene without input streams, as is the case for file readers (BT/VRML/XML..).\n\r
+       *The decoderSpecificInfo carried is as follows:\r
+        \code \r
+               u32 file_size:  total file size \r
+               char file_name[dsi_size - sizeof(u32)]: local file name. \r
+               \n\note: File may be a cache file, it is the decoder responsability to check if the file is completely\r
+               downloaded before parsing if needed.\r
+        \endcode \r
+       *The inBufferLength param for decoders using these streams is the stream clock in ms (no input data is given).\n\r
+       *The "dummy_in" module is available to generate these streams for common files, and also takes care of proper \r
+       clock init in case of seeking.\n\r
+       *This is a reentrant stream type: if any media object with this streamtype also exist in the scene, they will be \r
+       *attached to the scene decoder (except when a new inline scene is detected, in which case a new decoder will \r
+       *be created). This allows for animation/sprite usage along with the systems timing/stream management.\n\r
+       *\n\r
+       *the objectTypeIndication currently in use for these streams are documented below\n\r
+       */\r
+       GF_STREAM_PRIVATE_SCENE = 0x20,\r
+};\r
+\r
+\r
+/*!\r
+ *     Media Object types\r
+ * \r
+ *     This type provides a hint to network modules which may have to generate an service descriptor on the fly.\r
+ *     They occur only if objects/services used in the scene are not referenced through ObjectDescriptors (MPEG-4) \r
+ *     but direct through URL\r
+*/\r
+enum\r
+{\r
+       /*!service descriptor expected is of undefined type. This should be treated like GF_MEDIA_OBJECT_SCENE*/\r
+       GF_MEDIA_OBJECT_UNDEF = 0,\r
+       /*!service descriptor expected is of SCENE type and shall contain a scene stream and OD one if needed*/\r
+       GF_MEDIA_OBJECT_SCENE,\r
+       /*!service descriptor expected is of SCENE UPDATES type (animation streams)*/\r
+       GF_MEDIA_OBJECT_UPDATES,\r
+       /*!service descriptor expected is of VISUAL type*/\r
+       GF_MEDIA_OBJECT_VIDEO,\r
+       /*!service descriptor expected is of AUDIO type*/\r
+       GF_MEDIA_OBJECT_AUDIO,\r
+       /*!service descriptor expected is of TEXT type (3GPP/MPEG4)*/\r
+       GF_MEDIA_OBJECT_TEXT,\r
+       /*!service descriptor expected is of UserInteraction type (MPEG-4 InputSensor)*/\r
+       GF_MEDIA_OBJECT_INTERACT,\r
+};\r
+\r
+/*! All Media Objects inserted through URLs and not MPEG-4 OD Framework use this ODID*/\r
+#define GF_MEDIA_EXTERNAL_ID           1050\r
+\r
+\r
+/*!\r
+ * \brief Pixel Formats\r
+ * \r
+ *     Supported pixel formats for everything using video\r
+ *\note        For textures using 32 bit ARGB/RGB_32/BGR_32:\r
+ *\li on little endian machines, shall be ordered in memory as BGRA, \r
+ *\li on big endians, shall be ordered in memory as ARGB\r
+ *so that *(u32*)pixel_mem is always ARGB (0xAARRGGBB).\r
+*/\r
+typedef enum\r
+{\r
+       /*!8 bit GREY */\r
+       GF_PIXEL_GREYSCALE      =       GF_4CC('G','R','E','Y'),\r
+       /*!16 bit greyscale*/\r
+       GF_PIXEL_ALPHAGREY      =       GF_4CC('G','R','A','L'),\r
+       /*!12 bit RGB on 16 bits (4096 colors)*/\r
+       GF_PIXEL_RGB_444        =       GF_4CC('R','4','4','4'),\r
+       /*!15 bit RGB*/\r
+       GF_PIXEL_RGB_555        =       GF_4CC('R','5','5','5'),\r
+       /*!16 bit RGB*/\r
+       GF_PIXEL_RGB_565        =       GF_4CC('R','5','6','5'),\r
+       /*!24 bit RGB*/\r
+       GF_PIXEL_RGB_24         =       GF_4CC('R','G','B','3'),\r
+       /*!24 bit BGR - used for graphics cards video format signaling*/\r
+       GF_PIXEL_BGR_24         =       GF_4CC('B','G','R','3'),\r
+       /*!32 bit RGB*/\r
+       GF_PIXEL_RGB_32         =       GF_4CC('R','G','B','4'),\r
+       /*!32 bit BGR - used for graphics cards video format signaling*/\r
+       GF_PIXEL_BGR_32         =       GF_4CC('B','G','R','4'),\r
+\r
+       /*!32 bit ARGB.*/\r
+       GF_PIXEL_ARGB           =       GF_4CC('A','R','G','B'),\r
+       /*!32 bit RGBA (openGL like)*/\r
+       GF_PIXEL_RGBA           =       GF_4CC('R','G','B', 'A'),\r
+\r
+       /*!RGB24 + depth plane*/\r
+    GF_PIXEL_RGBD              =       GF_4CC('R', 'G', 'B', 'D'),\r
+\r
+       /*!RGB24 + depth plane (7 power bits) + shape mask*/\r
+    GF_PIXEL_RGBDS             =       GF_4CC('3', 'C', 'D', 'S'),\r
+    \r
+       /*!YUV packed format*/\r
+       GF_PIXEL_YUY2           =       GF_4CC('Y','U','Y','2'),\r
+       /*!YUV packed format*/\r
+       GF_PIXEL_YVYU           =       GF_4CC('Y','V','Y','U'),\r
+       /*!YUV packed format*/\r
+       GF_PIXEL_UYVY           =       GF_4CC('U','Y','V','Y'),\r
+       /*!YUV packed format*/\r
+       GF_PIXEL_VYUY           =       GF_4CC('V','Y','U','Y'),\r
+       /*!YUV packed format*/\r
+       GF_PIXEL_Y422           =       GF_4CC('Y','4','2','2'),\r
+       /*!YUV packed format*/\r
+       GF_PIXEL_UYNV           =       GF_4CC('U','Y','N','V'),\r
+       /*!YUV packed format*/\r
+       GF_PIXEL_YUNV           =       GF_4CC('Y','U','N','V'),\r
+       /*!YUV packed format*/\r
+       GF_PIXEL_V422           =       GF_4CC('V','4','2','2'),\r
+       \r
+       /*!YUV planar format*/\r
+       GF_PIXEL_YV12           =       GF_4CC('Y','V','1','2'),\r
+       /*!YUV planar format*/\r
+       GF_PIXEL_IYUV           =       GF_4CC('I','Y','U','V'),\r
+       /*!YUV planar format*/\r
+       GF_PIXEL_I420           =       GF_4CC('I','4','2','0'),\r
+               \r
+       /*!YV12 + Alpha plane*/\r
+       GF_PIXEL_YUVA           =       GF_4CC('Y', 'U', 'V', 'A'),\r
+\r
+       /*!YV12 + Depth plane*/\r
+       GF_PIXEL_YUVD           =       GF_4CC('Y', 'U', 'V', 'D'),\r
+\r
+} GF_PixelFormat;\r
+\r
+\r
+/*!\r
+ * \brief Scene ObjectTypeIndication Formats\r
+ * \r
+ *     Supported ObjectTypeIndication for scene description streams. *_FILE_* are only used with private scene streams\r
+ * and only carry the file name for the scene. Other internal stream types can be used in a real streaming environment\r
+*/\r
+enum\r
+{\r
+       /*!OTI for BIFS v1*/\r
+       GPAC_OTI_SCENE_BIFS = 0x01,\r
+       /*!OTI for BIFS v2*/\r
+       GPAC_OTI_SCENE_BIFS_V2 = 0x02,\r
+       /*!OTI for BIFS InputSensor streams*/\r
+       GPAC_OTI_SCENE_INTERACT = 0x03,\r
+       /*!OTI forLASeR streams*/\r
+       GPAC_OTI_SCENE_LASER = 0x09,\r
+\r
+       /*!OTI for dummy streams (dsi = file name) using the generci context loader (BIFS/VRML/SWF/...) - GPAC internal*/\r
+       GPAC_OTI_PRIVATE_SCENE_GENERIC = 0xC0,\r
+       /*!OTI for SVG dummy stream (dsi = file name) - GPAC internal*/\r
+       GPAC_OTI_PRIVATE_SCENE_SVG = 0xC1,\r
+       /*!OTI for LASeR/SAF+XML dummy stream (dsi = file name) - GPAC internal*/\r
+       GPAC_OTI_PRIVATE_SCENE_LASER = 0xC2,\r
+       /*!OTI for XBL dummy streams (dsi = file name) - GPAC internal*/\r
+       GPAC_OTI_PRIVATE_SCENE_XBL = 0xC3,\r
+       /*!OTI for EPG dummy streams (dsi = null) - GPAC internal*/\r
+       GPAC_OTI_PRIVATE_SCENE_EPG = 0xC4,\r
+\r
+       /*!OTI for streaming SVG - GPAC internal*/\r
+       GPAC_OTI_SCENE_SVG = 0xD0,\r
+       /*!OTI for streaming SVG + gz - GPAC internal*/\r
+       GPAC_OTI_SCENE_SVG_GZ = 0xD1,\r
+       /*!OTI for DIMS (dsi = 3GPP DIMS configuration) - GPAC internal*/\r
+       GPAC_OTI_SCENE_DIMS = 0xD2,\r
+};\r
+\r
+\r
+/*!\r
+ * \brief Extra ObjectTypeIndication\r
+ *\r
+ *     ObjectTypeIndication for media (audio/video) codecs not defined in MPEG-4. Since GPAC signals streams through MPEG-4 Descriptions,\r
+ *     it needs extensions for non-MPEG-4 streams such as AMR, H263 , etc.\n\r
+ *\note The decoder specific info for such streams is always carried encoded, with the following syntax:\n\r
+ *     DSI Syntax for audio streams\r
+ \code \r
+ *     u32 codec_four_cc: the codec 4CC reg code / codec id for ffmpeg\r
+ *     u32 sample_rate: sampling rate or 0 if unknown\r
+ *     u16 nb_channels: num channels or 0 if unknown\r
+ *     u16 frame_size: num audio samples per frame or 0 if unknown\r
+ *     u8 nb_bits_per_sample: nb bits or 0 if unknown\r
+ *     u8 num_frames_per_au: num audio frames per AU (used in 3GPP, max 15), 0 if unknown\r
+ *     char *data: per-codec extensions till end of DSI bitstream\r
+ \endcode\r
+ \n\r
+ *     DSI Syntax for video streams\r
+ \code \r
+ *     u32 codec_four_cc: the codec 4CC reg code  / codec id for ffmpeg\r
+ *     u16 width: video width or 0 if unknown\r
+ *     u16 height: video height or 0 if unknown\r
+ *     char *data: per-codec extensions till end of DSI bitstream\r
+ \endcode\r
+*/\r
+#define GPAC_OTI_MEDIA_GENERIC                         0x80\r
+\r
+/*!\r
+ * \brief FFMPEG ObjectTypeIndication\r
+ *\r
+ *     ObjectTypeIndication for FFMPEG codecs not defined in MPEG-4. FFMPEG uses the base GPAC_OTI_MEDIA_GENERIC specific info formats, and extends it as follows:\r
+ \code \r
+ *     u32 bit_rate: the stream rate or 0 if unknown\r
+ *     u32 codec_tag: FFMPEG codec tag as defined in libavcodec\r
+ *     char *data: codec extensions till end of DSI bitstream\r
+ \endcode\r
+ */\r
+#define GPAC_OTI_MEDIA_FFMPEG                          0x81\r
+\r
+\r
+/*!\r
+ * \brief OGG ObjectTypeIndication\r
+ *\r
+ *     Object type indication for all OGG media. The DSI contains all intitialization ogg packets for the codec\r
+ * and is formated as follows:\n\r
+ *\code \r
+       while (dsi_size) {\r
+               bit(16) packet_size;\r
+               char packet[packet_size];\r
+               dsi_size -= packet_size;\r
+       }\endcode\r
+*/\r
+#define GPAC_OTI_MEDIA_OGG                             0xDD\r
+\r
+\r
+/*channel cfg flags - DECODERS MUST OUTPUT STEREO/MULTICHANNEL IN THIS ORDER*/\r
+/*!\r
+ * \brief Audio Channel Configuration\r
+ *\r
+ *     Audio channel flags for spatialization.\r
+ \note Decoders must output stereo/multichannel audio channels in this order in the decoded audio frame.\r
+ */\r
+enum\r
+{\r
+       /*!Left Audio Channel*/\r
+       GF_AUDIO_CH_FRONT_LEFT = (1),\r
+       /*!Right Audio Channel*/\r
+       GF_AUDIO_CH_FRONT_RIGHT = (1<<1),\r
+       /*!Center Audio Channel - may also be used to signal monophonic audio*/\r
+       GF_AUDIO_CH_FRONT_CENTER = (1<<2),\r
+       /*!LFE Audio Channel*/\r
+       GF_AUDIO_CH_LFE = (1<<3),\r
+       /*!Back Left Audio Channel*/\r
+       GF_AUDIO_CH_BACK_LEFT = (1<<4),\r
+       /*!Back Right Audio Channel*/\r
+       GF_AUDIO_CH_BACK_RIGHT = (1<<5),\r
+       /*!Back Center Audio Channel*/\r
+       GF_AUDIO_CH_BACK_CENTER = (1<<6),\r
+       /*!Side Left Audio Channel*/\r
+       GF_AUDIO_CH_SIDE_LEFT = (1<<7),\r
+       /*!Side Right Audio Channel*/\r
+       GF_AUDIO_CH_SIDE_RIGHT = (1<<8)\r
+};\r
+\r
+\r
+\r
+/*DIMS unit flags */\r
+/*!\r
+ * \brief DIMS Unit header flags\r
+ *\r
+ *     DIMS Unit header flags as 3GPP TS 26.142.\r
+ */\r
+enum\r
+{\r
+       /*!S: is-Scene: DIMS unit contains a complete document (<svg>*/\r
+       GF_DIMS_UNIT_S = 1,\r
+       /*!M: is-RAP: DIMS unit is a random access point*/\r
+       GF_DIMS_UNIT_M = 1<<1,\r
+       /*!I: is-Redundant: DIMS unit is made of redundant data*/\r
+       GF_DIMS_UNIT_I = 1<<2,\r
+       /*!D: redundant-exit: DIMS unit is the end of redundant data*/\r
+       GF_DIMS_UNIT_D = 1<<3,\r
+       /*!P: priority: DIMS unit is high priority*/\r
+       GF_DIMS_UNIT_P = 1<<4,\r
+       /*!C: compressed: DIMS unit is compressed*/\r
+       GF_DIMS_UNIT_C = 1<<5\r
+};\r
+\r
+\r
+/*!\r
+ \cond DUMMY_DOXY_SECTION\r
+*/\r
+\r
+/*AVC NAL unit types*/\r
+#define GF_AVC_NALU_NON_IDR_SLICE 0x1\r
+#define GF_AVC_NALU_DP_A_SLICE 0x2\r
+#define GF_AVC_NALU_DP_B_SLICE 0x3\r
+#define GF_AVC_NALU_DP_C_SLICE 0x4\r
+#define GF_AVC_NALU_IDR_SLICE 0x5\r
+#define GF_AVC_NALU_SEI 0x6\r
+#define GF_AVC_NALU_SEQ_PARAM 0x7\r
+#define GF_AVC_NALU_PIC_PARAM 0x8\r
+#define GF_AVC_NALU_ACCESS_UNIT 0x9\r
+#define GF_AVC_NALU_END_OF_SEQ 0xa\r
+#define GF_AVC_NALU_END_OF_STREAM 0xb\r
+#define GF_AVC_NALU_FILLER_DATA 0xc\r
+\r
+#define GF_AVC_TYPE_P 0\r
+#define GF_AVC_TYPE_B 1\r
+#define GF_AVC_TYPE_I 2\r
+#define GF_AVC_TYPE_SP 3\r
+#define GF_AVC_TYPE_SI 4\r
+#define GF_AVC_TYPE2_P 5\r
+#define GF_AVC_TYPE2_B 6\r
+#define GF_AVC_TYPE2_I 7\r
+#define GF_AVC_TYPE2_SP 8\r
+#define GF_AVC_TYPE2_SI 9\r
+\r
+\r
+/*rate sizes - note that these sizes INCLUDE the rate_type header byte*/\r
+static const u32 GF_QCELP_RATE_TO_SIZE [] = {0, 1, 1, 4, 2, 8, 3, 17, 4, 35, 5, 8, 14, 1};\r
+static const u32 GF_QCELP_RATE_TO_SIZE_NB = 7;\r
+static const u32 GF_SMV_EVRC_RATE_TO_SIZE [] = {0, 1, 1, 3, 2, 6, 3, 11, 4, 23, 5, 1};\r
+static const u32 GF_SMV_EVRC_RATE_TO_SIZE_NB = 6;\r
+static const u32 GF_AMR_FRAME_SIZE[16] = { 12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0 };\r
+static const u32 GF_AMR_WB_FRAME_SIZE[16] = { 17, 23, 32, 36, 40, 46, 50, 58, 60, 5, 5, 0, 0, 0, 0, 0 };\r
+\r
+\r
+/*!\r
+ \endcond\r
+*/\r
+\r
+\r
+/*! @} */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /*_GF_CONSTANTS_H_*/\r
diff --git a/tstools/DtsEdit/src/gpac/crypt.h b/tstools/DtsEdit/src/gpac/crypt.h
new file mode 100644 (file)
index 0000000..5c36175
--- /dev/null
@@ -0,0 +1,190 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / Crypto Tools sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+/*\r
+       The GPAC crypto lib is a simplified version of libmcrypt - not all algos are included.\r
+       Doc here is man mcrypt\r
+       Original libmcrypt license\r
+*/\r
+\r
+/*\r
+ * Copyright (C) 1998,1999,2000 Nikos Mavroyanopoulos\r
+ * \r
+ * This library is free software; you can redistribute it and/or modify it \r
+ * under the terms of the GNU Library General Public License as published \r
+ * by the Free Software Foundation; either version 2 of the License, or \r
+ * (at your option) any later version.\r
+ *\r
+ * This library is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+ * Library General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU Library General Public\r
+ * License along with this library; if not, write to the\r
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,\r
+ * Boston, MA 02111-1307, USA.\r
+ */\r
+\r
+#ifndef _GF_CRYPT_H_\r
+#define _GF_CRYPT_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/tools.h>\r
+\r
+/*max number of possible key sizes for all supported modes*/\r
+#define MAX_KEY_SIZES  4\r
+\r
+/*crypto lib handler*/\r
+typedef struct _tag_crypt_stream GF_Crypt;\r
+\r
+/*supported modes (case insensitive): "CBC", "CFB", "CTR", "ECB", "nCFB", "nOFB", "OFB", "STREAM"*/\r
+/*supported algos (case insensitive): \r
+       "AES-128" == "Rijndael-128"\r
+       "AES-192" == "Rijndael-192"\r
+       "AES-256" == "Rijndael-256"\r
+       "DES", "3DES"\r
+*/\r
+\r
+\r
+/*opens crypto context - algo and mode SHALL NOT be NULL*/\r
+GF_Crypt *gf_crypt_open(const char *algorithm, const char *mode);\r
+/*close crypto context*/\r
+void gf_crypt_close(GF_Crypt *gfc);\r
+\r
+/* sets the state of the algorithm. Can be used only with block algorithms and certain modes like CBC, CFB etc. \r
+It is usefully if you want to restart or start a different encryption quickly. \r
+*/\r
+GF_Err gf_crypt_set_state(GF_Crypt *gfc, const void *iv, int size);\r
+/*gets the state of the algorithm. Can be used only certain modes and algorithms. \r
+The size will hold the size of the state and the state must have enough bytes to hold it.\r
+*/\r
+GF_Err gf_crypt_get_state(GF_Crypt *gfc, void *iv, int *size);\r
+/*Returns 1 if the algorithm is a block algorithm or 0 if it is a stream algorithm.*/\r
+Bool gf_crypt_is_block_algorithm(GF_Crypt *gfc);\r
+/*Returns 1 if the mode is for use with block algorithms, otherwise it returns 0.*/\r
+Bool gf_crypt_is_block_algorithm_mode(GF_Crypt *gfc);\r
+/*Returns 1 if the mode outputs blocks of bytes or 0 if it outputs bytes. (eg. 1 for cbc and ecb, and 0 for cfb and stream)*/\r
+Bool gf_crypt_is_block_mode(GF_Crypt *gfc);\r
+/*Returns the block size of the algorithm specified by the encryption descriptor in bytes.*/\r
+u32 gf_crypt_get_block_size(GF_Crypt *gfc);\r
+/*Returns the maximum supported key size of the algorithm specified by the encryption descriptor in bytes.*/\r
+u32 gf_crypt_get_key_size(GF_Crypt *gfc);\r
+/*Returns the number of supported key sizes.\r
+@keys: array of at least MAX_KEY_SIZES size - will hold the supported sizes*/\r
+u32 gf_crypt_get_supported_key_sizes(GF_Crypt *gfc, u32 *key_sizes);\r
+/*Returns size (in bytes) of the IV of the algorithm specified for the context. \r
+If it is '0' then the IV is ignored in that algorithm. \r
+IV is used in CBC, CFB, OFB modes, and in some algorithms in STREAM mode.\r
+*/\r
+u32 gf_crypt_get_iv_size(GF_Crypt *gfc);\r
+/*Returns 1 if the mode needs an IV, 0 otherwise. \r
+Some 'stream' algorithms may need an IV even if the mode itself does not need an IV.\r
+*/\r
+Bool gf_crypt_mode_has_iv(GF_Crypt *gfc);\r
+\r
+/*guess what these do...*/\r
+const char *gf_crypt_get_algorithm_name(GF_Crypt *gfc);\r
+u32 gf_crypt_get_algorithm_version(GF_Crypt *gfc);\r
+const char *gf_crypt_get_mode_name(GF_Crypt *gfc);\r
+u32 gf_crypt_get_mode_version(GF_Crypt *gfc);\r
+\r
+\r
+/*\r
+This function initializes all buffers for the specified context\r
+@Lenofkey: key size in BYTES - maximum value of lenofkey should be the one obtained by \r
+calling gf_crypt_get_key_size() and every value smaller than this is legal.\r
+@IV: usually size of the algorithms block size - get it by calling gf_crypt_get_iv_size().\r
+       IV is ignored in ECB. IV MUST exist in CFB, CBC, STREAM, nOFB and OFB modes.\r
+       It needs to be random and unique (but not secret). The same IV must be used\r
+       for encryption/decryption. \r
+After calling this function you can use the descriptor for encryption or decryption (not both). \r
+*/\r
+GF_Err gf_crypt_init(GF_Crypt *gfc, void *key, u32 lenofkey, const void *IV);\r
+/*releases context buffers - you may call gf_crypt_init after that, or gf_crypt_close*/\r
+void gf_crypt_deinit(GF_Crypt *gfc);\r
+/*changes key and IV*/\r
+GF_Err gf_crypt_set_key(GF_Crypt *gfc, void *key, u32 keysize, const void *iv);\r
+\r
+/*\r
+main encryption function. \r
+@Plaintext, @len: plaintext to encrypt - len should be  k*algorithms_block_size if used in a mode\r
+which operated in blocks (cbc, ecb, nofb), or whatever when used in cfb or ofb which operate in streams.\r
+The plaintext is replaced by the ciphertext. \r
+*/\r
+GF_Err gf_crypt_encrypt(GF_Crypt *gfc, void *plaintext, int len);\r
+/*decryption function. It is almost the same with gf_crypt_generic.*/\r
+GF_Err gf_crypt_decrypt(GF_Crypt *gfc, void *ciphertext, int len);\r
+\r
+/*various queries on both modes and algo*/\r
+u32 gf_crypt_str_get_algorithm_version(const char *algorithm);\r
+u32 gf_crypt_str_get_mode_version(const char *mode);\r
+Bool gf_crypt_str_is_block_algorithm(const char *algorithm);\r
+Bool gf_crypt_str_is_block_algorithm_mode(const char *algorithm);\r
+Bool gf_crypt_str_is_block_mode(const char *mode);\r
+u32 gf_crypt_str_module_get_algo_block_size(const char *algorithm);\r
+u32 gf_crypt_str_module_get_algo_key_size(const char *algorithm);\r
+u32 gf_crypt_str_get_algo_supported_key_sizes(const char *algorithm, int *keys);\r
+\r
+\r
+\r
+/*SHA1 from Christophe Devine*/\r
+typedef struct\r
+{\r
+    u32 total[2];\r
+    u32 state[5];\r
+    u8 buffer[64];\r
+} GF_SHA1Context;\r
+\r
+/*\r
+ * Core SHA-1 functions\r
+ */\r
+void gf_sha1_starts(GF_SHA1Context *ctx );\r
+void gf_sha1_update(GF_SHA1Context *ctx, u8 *input, u32 length);\r
+void gf_sha1_finish(GF_SHA1Context *ctx, u8 digest[20] );\r
+\r
+/*\r
+ * Output SHA-1(file contents), returns 0 if successful.\r
+ */\r
+int gf_sha1_file(char *filename, u8 digest[20]);\r
+\r
+/*\r
+ * Output SHA-1(buf)\r
+ */\r
+void gf_sha1_csum(u8 *buf, u32 buflen, u8 digest[20]);\r
+\r
+/*\r
+ * Output HMAC-SHA-1(key,buf)\r
+ */\r
+void gf_sha1_hmac(u8 *key, u32 keylen, u8 *buf, u32 buflen, u8 digest[20]);\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /*_GF_CRYPT_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/download.h b/tstools/DtsEdit/src/gpac/download.h
new file mode 100644 (file)
index 0000000..6d56ffc
--- /dev/null
@@ -0,0 +1,277 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / common tools sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_DOWNLOAD_H_\r
+#define _GF_DOWNLOAD_H_\r
+\r
+/*!\r
+ *     \file <gpac/download.h>\r
+ *     \brief Downloader functions.\r
+ */\r
+\r
+/*!\r
+ *     \addtogroup dld_grp downloader\r
+ *     \ingroup utils_grp\r
+ *     \brief File Downloader objects\r
+ *\r
+ *     This section documents the file downloading tools the GPAC framework. Currently HTTP is supported, HTTPS is under testing but may not be supported\r
+ *depending on GPAC compilation options (HTTPS in GPAC needs OpenSSL installed on the system).\r
+ *\r
+ *     @{\r
+ */\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/tools.h>\r
+#include <gpac/module.h>\r
+\r
+\r
+/*!the download manager object. This is usually not used by GPAC modules*/\r
+typedef struct __gf_download_manager GF_DownloadManager;\r
+/*!the download manager session.*/\r
+typedef struct __gf_download_session GF_DownloadSession;\r
+\r
+/*!\r
+ *\brief download manager constructor\r
+ *\r
+ *Creates a new download manager object.\r
+ *\param cfg optional configuration file. Currently the download manager needs a configuration file for cache location and \r
+ *other options. The cache directory must be indicated in the section "General", key "CacheDirectory" of the configuration\r
+ *file. If the cache directory is not found, the cache will be disabled but the downloader will still work.\r
+ *\return the download manager object\r
+*/\r
+GF_DownloadManager *gf_dm_new(GF_Config *cfg);\r
+/*\r
+ *\brief download manager destructor\r
+ *\r
+ *Deletes the download manager. All running sessions are aborted\r
+ *\param dm the download manager object\r
+ */\r
+void gf_dm_del(GF_DownloadManager *dm);\r
+\r
+/*!\r
+ *\brief callback function for authentication\r
+ *\r
+ * The gf_dm_get_usr_pass type is the type for the callback of the \ref gf_dm_set_auth_callback function used for password retrieval\r
+ *\param usr_cbk opaque user data\r
+ *\param site_url url of the site the user and password are requested for\r
+ *\param usr_name the user name for this site. The allocated space for this buffer is 50 bytes. \note this varaibale may already be formatted.\r
+ *\param password the password for this site and user. The allocated space for this buffer is 50 bytes.\r
+ *\return 0 if user didn't fill in the information which will result in an authentication failure, 1 otherwise.\r
+*/\r
+typedef Bool (*gf_dm_get_usr_pass)(void *usr_cbk, const char *site_url, char *usr_name, char *password);\r
+\r
+/*!\r
+ *\brief password retrieval assignment\r
+ *\r
+ *Assigns the callback function used for user password retrieval. If no such function is assigned to the download manager, \r
+ *all downloads requiring authentication will fail.\r
+ *\param dm the download manager object\r
+ *\param get_pass \ref gf_dm_get_usr_pass callback function for user and password retrieval. \r
+ *\param usr_cbk opaque user data passed to callback function\r
+ */\r
+void gf_dm_set_auth_callback(GF_DownloadManager *dm, gf_dm_get_usr_pass get_pass, void *usr_cbk);\r
+\r
+/*!downloader session message types*/\r
+enum\r
+{\r
+       /*!signal that session is setup and waiting for connection request*/\r
+       GF_NETIO_SETUP = 0,\r
+       /*!signal that session connection is done*/\r
+       GF_NETIO_CONNECTED,\r
+       /*!request a protocol method from the user. Default value is "GET" for HTTP*/\r
+       GF_NETIO_GET_METHOD,\r
+       /*!request a header from the user. */\r
+       GF_NETIO_GET_HEADER,\r
+       /*!requesting content from the user, if any. Content is appended to the request*/\r
+       GF_NETIO_GET_CONTENT,\r
+       /*!signal that request is sent and waiting for server reply*/\r
+       GF_NETIO_WAIT_FOR_REPLY,\r
+       /*!signal a header to user. */\r
+       GF_NETIO_PARSE_HEADER,\r
+       /*!signal request reply to user. The reply is always sent after the headers*/\r
+       GF_NETIO_PARSE_REPLY,\r
+       /*!send data to the user*/\r
+       GF_NETIO_DATA_EXCHANGE,\r
+       /*!all data has been transfered*/\r
+       GF_NETIO_DATA_TRANSFERED,\r
+       /*!signal that the session has been deconnected*/\r
+       GF_NETIO_DISCONNECTED,\r
+       /*!downloader session failed (error code set) or done/destroyed (no error code)*/\r
+       GF_NETIO_STATE_ERROR\r
+};\r
+\r
+/*!session download flags*/\r
+enum\r
+{\r
+       /*!session is not threaded, the user must explicitely fetch the data */\r
+       GF_NETIO_SESSION_NOT_THREADED   =       1,\r
+       /*!session has no cache: data will be sent to the user if threaded mode (live streams like radios & co)*/\r
+       GF_NETIO_SESSION_NOT_CACHED     =       1<<1,\r
+};\r
+\r
+\r
+/*!protocol I/O parameter*/\r
+typedef struct\r
+{\r
+       /*!parameter message type*/\r
+       u32 msg_type;\r
+       /*error code if any. Valid for all message types.*/\r
+       GF_Err error;\r
+       /*!data received or data to send. Only valid for GF_NETIO_GET_CONTENT and GF_NETIO_DATA_EXCHANGE (when no cache is setup) messages*/\r
+       char *data;\r
+       /*!size of associated data. Only valid for GF_NETIO_GET_CONTENT and GF_NETIO_DATA_EXCHANGE messages*/\r
+       u32 size;\r
+       /*protocol header. Only valid for GF_NETIO_GET_HEADER, GF_NETIO_PARSE_HEADER and GF_NETIO_GET_METHOD*/\r
+       char *name;\r
+       /*protocol header value or server response. Only alid for GF_NETIO_GET_HEADER, GF_NETIO_PARSE_HEADER and GF_NETIO_PARSE_REPLY*/\r
+       char *value;\r
+       /*response code - only valid for GF_NETIO_PARSE_REPLY*/\r
+       u32 reply;\r
+} GF_NETIO_Parameter;\r
+\r
+/*!\r
+ *\brief callback function for data reception and state signaling\r
+ *\r
+ * The gf_dm_user_io type is the type for the data callback function of a download session\r
+ *\param usr_cbk opaque user data\r
+ *\param parameter the input/output parameter structure \r
+*/\r
+typedef void (*gf_dm_user_io)(void *usr_cbk, GF_NETIO_Parameter *parameter);\r
+\r
+\r
+\r
+/*!\r
+ *\brief download session constructor\r
+ *\r
+ *Creates a new download session\r
+ *\param dm the download manager object\r
+ *\param url file to retrieve (no PUT/POST yet, only downloading is supported)\r
+ *\param dl_flags combination of session download flags\r
+ *\param user_io \ref gf_dm_user_io callback function for data reception and service messages\r
+ *\param usr_cbk opaque user data passed to callback function\r
+ *\param error error for failure cases \r
+ *\return the session object or NULL if error. If no error is indicated and a NULL session is returned, this means the file is local\r
+ */\r
+GF_DownloadSession * gf_dm_sess_new(GF_DownloadManager *dm, char *url, u32 dl_flags,\r
+                                                                         gf_dm_user_io user_io,\r
+                                                                         void *usr_cbk,\r
+                                                                         GF_Err *error);\r
+\r
+/*!\r
+ *brief downloader session destructor\r
+ *\r
+ *Deletes the download session, cleaning the cache if indicated in the configuration file of the download manager (section "Downloader", key "CleanCache")\r
+ *\param sess the download session\r
+*/\r
+void gf_dm_sess_del(GF_DownloadSession * sess);\r
+/*!\r
+ *\brief aborts downloading\r
+ *\r
+ *Aborts all operations in the session, regardless of its state. The session cannot be reused once this is called.\r
+ *\param sess the download session\r
+ */\r
+void gf_dm_sess_abort(GF_DownloadSession * sess);\r
+/*!\r
+ *\brief sets private data\r
+ *\r
+ *associate private data with the session.\r
+ *\param sess the download session\r
+ *\param private_data the private data\r
+ *\warning the private_data parameter is reserved for bandwidth statistics per service when used in the GPAC terminal.\r
+ */\r
+void gf_dm_sess_set_private(GF_DownloadSession * sess, void *private_data);\r
+\r
+/*!\r
+ *\brief gets private data\r
+ *\r
+ *Gets private data associated with the session.\r
+ *\param sess the download session\r
+ *\return the private data\r
+ *\warning the private_data parameter is reserved for bandwidth statistics per service when used in the GPAC terminal.\r
+ */\r
+void *gf_dm_sess_get_private(GF_DownloadSession * sess);\r
+/*!\r
+ *\brief gets last session error \r
+ *\r
+ *Gets the last error that occured in the session\r
+ *\param sess the download session\r
+ *\return the last error\r
+ */\r
+GF_Err gf_dm_sess_last_error(GF_DownloadSession *sess);\r
+\r
+/*!\r
+ *\brief fetches data on session\r
+ *\r
+ *Fetches data from the server. This will also performs connections and all needed exchange with server.\r
+ *\param sess the download session\r
+ *\param buffer destination buffer\r
+ *\param buffer_size destination buffer allocated size\r
+ *\param read_size amount of data actually fetched\r
+ *\note this can only be used when the session is not threaded\r
+ */\r
+GF_Err gf_dm_sess_fetch_data(GF_DownloadSession * sess, char *buffer, u32 buffer_size, u32 *read_size);\r
+\r
+/*!\r
+ *\brief get mime type \r
+ *\r
+ *Fetches the mime type of the URL this session is fetching\r
+ *\param sess the download session\r
+ *\return the mime type of the URL, or NULL if error. You should get the error with \ref gf_dm_sess_last_error\r
+ */\r
+const char *gf_dm_sess_mime_type(GF_DownloadSession * sess);\r
+/*!\r
+ *\brief get cache file name\r
+ *\r
+ *Gets the cache file name for the session.\r
+ *\param sess the download session\r
+ *\return the absolute path of the cache file, or NULL if the session is not cached*/\r
+const char *gf_dm_sess_get_cache_name(GF_DownloadSession * sess);\r
+/*!\r
+ *\brief get statistics\r
+ *\r
+ *Gets download statistics for the session. All output parameters are optional and may be set to NULL.\r
+ *\param sess the download session\r
+ *\param server the remote server address\r
+ *\param path the path on the remote server\r
+ *\param total_size the total size in bytes the file fetched, 0 if unknown.\r
+ *\param bytes_done the amount of bytes received from the server\r
+ *\param bytes_per_sec the average data rate in bytes per seconds\r
+ *\param net_status the session status\r
+ */\r
+GF_Err gf_dm_sess_get_stats(GF_DownloadSession * sess, const char **server, const char **path, u32 *total_size, u32 *bytes_done, u32 *bytes_per_sec, u32 *net_status);\r
+\r
+\r
+/*! @} */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif         /*_GF_DOWNLOAD_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/esi.h b/tstools/DtsEdit/src/gpac/esi.h
new file mode 100644 (file)
index 0000000..b0b4800
--- /dev/null
@@ -0,0 +1,183 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Authors: Jean le Feuvre\r
+ *                             Copyright (c) 2005-200X ENST\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / Elementary Stream Interface sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_ESI_H_\r
+#define _GF_ESI_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/tools.h>\r
+\r
+/* ESI input control commands*/\r
+enum\r
+{\r
+       /*forces a data flush from interface to dest (caller) - used for non-threaded interfaces\r
+               corresponding parameter: unused\r
+       */\r
+       GF_ESI_INPUT_DATA_FLUSH,\r
+       /*pulls a COMPLETE AU from the stream\r
+               corresponding parameter: pointer to a GF_ESIPacket to fill. The indut data_len in the packet is used to indicate any padding in bytes\r
+       */\r
+       GF_ESI_INPUT_DATA_PULL,\r
+       /*releases the currently pulled AU from the stream - AU cannot be pulled after that, unless seek happens\r
+               corresponding parameter: unused\r
+       */\r
+       GF_ESI_INPUT_DATA_RELEASE,\r
+\r
+       /*destroys any allocated resource by the stream interface*/\r
+       GF_ESI_INPUT_DESTROY,\r
+};\r
+\r
+/* ESI output control commands*/\r
+enum\r
+{\r
+       /*forces a data flush from interface to dest (caller) - used for non-threaded interfaces\r
+               corresponding parameter: unused\r
+       */\r
+       GF_ESI_OUTPUT_DATA_DISPATCH\r
+};\r
+       \r
+/*\r
+       data packet flags\r
+*/\r
+enum\r
+{\r
+       GF_ESI_DATA_AU_START    =       1,\r
+       GF_ESI_DATA_AU_END              =       1<<1,\r
+       GF_ESI_DATA_AU_RAP              =       1<<2,\r
+       GF_ESI_DATA_HAS_CTS             =       1<<3,\r
+       GF_ESI_DATA_HAS_DTS             =       1<<4,\r
+       GF_ESI_DATA_ENCRYPTED   =       1<<5,\r
+};\r
+\r
+typedef struct __data_packet_ifce\r
+{\r
+       u32 flags;\r
+       char *data;\r
+       u32 data_len;\r
+       /*DTS, CTS/PTS and duration expressed in media timescale*/\r
+       u64 dts, cts;\r
+       u32 duration;\r
+       u32 pck_sn;\r
+       /*MPEG-4 stuff*/\r
+       u32 au_sn;\r
+       /*for packets using ISMACrypt/OMA/3GPP based crypto*/\r
+       u32 isma_bso;\r
+} GF_ESIPacket;\r
+\r
+struct __esi_video_info\r
+{\r
+       u32 width, height, par;\r
+       Double FPS;\r
+};\r
+struct __esi_audio_info\r
+{\r
+       u32 sample_rate, nb_channels;\r
+};\r
+\r
+enum\r
+{\r
+       /*data can be pulled from this stream*/\r
+       GF_ESI_AU_PULL_CAP      =       1,\r
+       /*DTS is signaled for this stream*/\r
+       GF_ESI_SIGNAL_DTS =     1<<1,\r
+       /*no more data to expect from this stream*/\r
+       GF_ESI_STREAM_IS_OVER   =       1<<2,\r
+};\r
+\r
+typedef struct __elementary_stream_ifce \r
+{\r
+       /*misc caps of the stream*/\r
+       u32 caps;\r
+       /*matches PID for MPEG2, ES_ID for MPEG-4*/\r
+       u32 stream_id;\r
+       /*MPEG-TS program number if any*/\r
+       u16 program_number;\r
+       /*MPEG-4 ST/OTIs*/\r
+       u8 stream_type;\r
+       u8 object_type_indication;\r
+       /* MPEG-4 SL Config */\r
+       GF_SLConfig sl_config;\r
+       /*stream 4CC for non-mpeg codecs, 0 otherwise (stream is identified through StreamType/ObjectType)*/\r
+       u32 fourcc;\r
+       /*packed 3-char language code (4CC with last byte ' ')*/\r
+       u32 lang;\r
+       /*media timescale*/\r
+       u32 timescale;\r
+       /*duration in ms - 0 if unknown*/\r
+       Double duration;\r
+       /*average bit rate in bit/sec - 0 if unknown*/\r
+       u32 bit_rate;\r
+\r
+       struct __esi_video_info info_video;\r
+       struct __esi_audio_info info_audio;\r
+\r
+       /*input ES control from caller*/\r
+       GF_Err (*input_ctrl)(struct __elementary_stream_ifce *_self, u32 ctrl_type, void *param);\r
+       /*input user data of interface - usually set by interface owner*/\r
+       void *input_udta;\r
+\r
+       /*output ES control of destination*/\r
+       GF_Err (*output_ctrl)(struct __elementary_stream_ifce *_self, u32 ctrl_type, void *param);\r
+       /*output user data of interface - usually set during interface setup*/\r
+       void *output_udta;\r
+\r
+} GF_ESInterface;\r
+\r
+typedef struct __service_ifce\r
+{\r
+       u32 type;\r
+\r
+       /*input service control from caller*/\r
+       GF_Err (*input_ctrl)(struct __service_ifce *_self, u32 ctrl_type, void *param);\r
+       /*input user data of interface - usually set by interface owner*/\r
+       void *input_udta;\r
+\r
+       /*output service control of destination*/\r
+       GF_Err (*output_ctrl)(struct __service_ifce *_self, u32 ctrl_type, void *param);\r
+       /*output user data of interface - usually set during interface setup*/\r
+       void *output_udta;\r
+\r
+       GF_ESInterface **streams;\r
+       u32 nb_streams;\r
+} GF_ServiceInterface;\r
+\r
+\r
+typedef struct __data_io\r
+{\r
+       u32 (*read)(struct __data_io *_self, char *buffer, u32 nb_bytes);\r
+       u32 (*write)(struct __data_io *_self, char *buffer, u32 nb_bytes);\r
+       void *udta;\r
+} GF_DataIO;\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif //_GF_ESI_H_\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/events.h b/tstools/DtsEdit/src/gpac/events.h
new file mode 100644 (file)
index 0000000..84f0d5e
--- /dev/null
@@ -0,0 +1,689 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / Events management\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+\r
+\r
+#ifndef _GF_EVENTS_H_\r
+#define _GF_EVENTS_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/math.h>\r
+#include <gpac/tools.h>\r
+\r
+/*\r
+               minimal event system \r
+\r
+       DO NOT CHANGE THEIR POSITION IN THE LIST, USED TO SPEED UP FILTERING OF USER INPUT EVENTS\r
+*/\r
+\r
+/*events*/\r
+enum {\r
+\r
+       /******************************************************\r
+\r
+               Events used for both GPAC internals and DOM Events\r
+\r
+       *******************************************************/\r
+       /*MouseEvents*/\r
+       GF_EVENT_CLICK, \r
+       GF_EVENT_MOUSEUP, \r
+       GF_EVENT_MOUSEDOWN, \r
+       GF_EVENT_MOUSEOVER, \r
+       GF_EVENT_MOUSEOUT, \r
+       /*!! ALL MOUSE EVENTS SHALL BE DECLARED BEFORE MOUSEMOVE !! */\r
+       GF_EVENT_MOUSEMOVE, \r
+       /*mouse wheel event*/\r
+       GF_EVENT_MOUSEWHEEL,\r
+\r
+       /*Key Events*/\r
+       GF_EVENT_KEYUP,\r
+       GF_EVENT_KEYDOWN, /* covers KeyDown, KeyPress and AccessKey */\r
+       GF_EVENT_LONGKEYPRESS,\r
+       /*character input*/\r
+       GF_EVENT_TEXTINPUT,\r
+\r
+\r
+       /******************************************************\r
+\r
+               Events used for DOM Events only\r
+\r
+       *******************************************************/\r
+       GF_EVENT_TEXTSELECT,\r
+\r
+       /*DOM UIEvents*/\r
+       GF_EVENT_FOCUSIN,\r
+       GF_EVENT_FOCUSOUT, \r
+       GF_EVENT_ACTIVATE, \r
+       GF_EVENT_CHANGE, \r
+       GF_EVENT_FOCUS, \r
+       GF_EVENT_BLUR, \r
+       /*SVG (HTML) Events*/\r
+       GF_EVENT_LOAD, \r
+       GF_EVENT_UNLOAD,\r
+       GF_EVENT_ABORT, \r
+       GF_EVENT_ERROR, \r
+       GF_EVENT_RESIZE, \r
+       GF_EVENT_SCROLL, \r
+       GF_EVENT_ZOOM,\r
+       GF_EVENT_BEGIN, /*this is a fake event, it is NEVER fired, only used in SMIL begin*/\r
+       GF_EVENT_BEGIN_EVENT,\r
+       GF_EVENT_END, /*this is a fake event, it is NEVER fired, only used in SMIL end*/\r
+       GF_EVENT_END_EVENT,\r
+       GF_EVENT_REPEAT, /*this is a fake event, it is NEVER fired, only used in SMIL repeat*/\r
+       GF_EVENT_REPEAT_EVENT,\r
+\r
+       /*DOM MutationEvents - NOT SUPPORTED YET*/\r
+       GF_EVENT_TREE_MODIFIED,\r
+       GF_EVENT_NODE_INSERTED,\r
+       GF_EVENT_NODE_REMOVED,\r
+       GF_EVENT_NODE_INSERTED_DOC,\r
+       GF_EVENT_NODE_REMOVED_DOC,\r
+       GF_EVENT_ATTR_MODIFIED,\r
+       GF_EVENT_CHAR_DATA_MODIFIED,\r
+       GF_EVENT_NODE_NAME_CHANGED,\r
+       GF_EVENT_ATTR_NAME_CHANGED,\r
+\r
+       GF_EVENT_DCCI_PROP_CHANGE,\r
+\r
+       /*LASeR events*/\r
+       GF_EVENT_ACTIVATED,\r
+       GF_EVENT_DEACTIVATED,\r
+       GF_EVENT_PAUSE,\r
+       GF_EVENT_PAUSED_EVENT,\r
+       GF_EVENT_PLAY,\r
+       GF_EVENT_REPEAT_KEY,\r
+       GF_EVENT_RESUME_EVENT,\r
+       GF_EVENT_SHORT_ACCESSKEY,\r
+       /*pseudo-event, only used in LASeR coding*/\r
+       GF_EVENT_EXECUTION_TIME,\r
+\r
+       /*MediaAccess events - cf http://www.w3.org/TR/MediaAccessEvents*/\r
+       GF_EVENT_MEDIA_BEGIN_SESSION_SETUP,\r
+       GF_EVENT_MEDIA_END_SESSION_SETUP,\r
+       GF_EVENT_MEDIA_DATA_REQUEST,\r
+       GF_EVENT_MEDIA_PLAYABLE,\r
+       GF_EVENT_MEDIA_NOT_PLAYABLE,\r
+       GF_EVENT_MEDIA_DATA_PROGRESS,\r
+       GF_EVENT_MEDIA_END_OF_DATA,\r
+       GF_EVENT_MEDIA_STOP,\r
+       GF_EVENT_MEDIA_ERROR,\r
+\r
+       GF_EVENT_BATTERY,\r
+       GF_EVENT_CPU,\r
+       GF_EVENT_UNKNOWN,\r
+\r
+\r
+       /******************************************************\r
+\r
+               Events used for GPAC internals only\r
+\r
+       *******************************************************/\r
+\r
+       /*same as mousedown, generated internally by GPAC*/\r
+       GF_EVENT_DBLCLICK,\r
+       \r
+       /*window events*/\r
+       /*size has changed - indicate new w & h in .x end .y fields of event. \r
+       When sent from gpac to a video plugin, indicates the output size should be changed. This is only sent when the plugin\r
+       manages the output video himself\r
+       When sent from a video plugin to gpac, indicates the output size has been changed. This is only sent when the plugin\r
+       manages the output video himself\r
+       */\r
+       GF_EVENT_SIZE,          \r
+       /*signals the scene size (if indicated in scene) upon connection (sent to the user event proc only)\r
+               if scene size hasn't changed (seeking or other) this event is not sent\r
+       */\r
+       GF_EVENT_SCENE_SIZE,            \r
+       GF_EVENT_SHOWHIDE,      /*window show/hide (minimized or other). This is also sent to the user to signal focus switch in fullscreen*/\r
+       GF_EVENT_SET_CURSOR,    /*set mouse cursor*/\r
+       GF_EVENT_SET_CAPTION,   /*set window caption*/\r
+       GF_EVENT_MOVE,          /*move window*/\r
+       GF_EVENT_REFRESH, /*window needs repaint (whenever needed, eg restore, hide->show, background refresh, paint)*/\r
+       GF_EVENT_QUIT,  /*window is being closed*/\r
+       /*video hw setup message:\r
+               - when sent from gpac to plugin, indicates that the plugin should re-setup hardware context due to a window resize:\r
+                       * for 2D output, this means resizing the backbuffer if needed (depending on HW constraints)\r
+                       * for 3D output, this means re-setup of OpenGL context (depending on HW constraints). Depending on windowing systems \r
+                       and implementations, it could be possible to resize a window without destroying the GL context.\r
+\r
+               - when sent from plugin to gpac, indicates that hardware resources must be resetup before next render step (this is mainly\r
+               due to discard all openGL textures and cached objects)\r
+       */\r
+       GF_EVENT_VIDEO_SETUP,\r
+\r
+       /*terminal events*/\r
+       GF_EVENT_CONNECT,       /*signal URL is connected*/\r
+       GF_EVENT_DURATION,      /*signal duration of presentation*/\r
+       GF_EVENT_AUTHORIZATION, /*indicates a user and pass is queried*/\r
+       GF_EVENT_NAVIGATE, /*indicates the user app should load or jump to the given URL.*/\r
+       GF_EVENT_NAVIGATE_INFO, /*indicates the link or its description under the mouse pointer*/\r
+       GF_EVENT_MESSAGE, /*message from the MPEG-4 terminal*/\r
+       GF_EVENT_PROGRESS, /*progress message from the MPEG-4 terminal*/\r
+       GF_EVENT_VIEWPOINTS,    /*indicates viewpoint list has changed - no struct associated*/\r
+       GF_EVENT_STREAMLIST,    /*indicates stream list has changed - no struct associated - only used when no scene info is present*/\r
+       GF_EVENT_METADATA, /*indicates a change in associated metadata*/\r
+       GF_EVENT_MIGRATE, /*indicates a session migration request*/\r
+       GF_EVENT_DISCONNECT, /*indicates the current url should be disconnected*/\r
+       GF_EVENT_SYS_COLORS,    /*queries the list of system colors*/\r
+};\r
+\r
+/*GPAC/DOM3 key codes*/\r
+enum {\r
+       GF_KEY_UNIDENTIFIED = 0, \r
+       GF_KEY_ACCEPT = 1, /* "Accept"    The Accept (Commit) key.*/\r
+       GF_KEY_AGAIN, /* "Again"  The Again key.*/\r
+       GF_KEY_ALLCANDIDATES, /* "AllCandidates"    The All Candidates key.*/\r
+       GF_KEY_ALPHANUM, /*"Alphanumeric"    The Alphanumeric key.*/\r
+       GF_KEY_ALT, /*"Alt"    The Alt (Menu) key.*/\r
+       GF_KEY_ALTGRAPH, /*"AltGraph"    The Alt-Graph key.*/\r
+       GF_KEY_APPS, /*"Apps"    The Application key.*/\r
+       GF_KEY_ATTN, /*"Attn"    The ATTN key.*/\r
+       GF_KEY_BROWSERBACK, /*"BrowserBack"    The Browser Back key.*/\r
+       GF_KEY_BROWSERFAVORITES, /*"BrowserFavorites"    The Browser Favorites key.*/\r
+       GF_KEY_BROWSERFORWARD, /*"BrowserForward"    The Browser Forward key.*/\r
+       GF_KEY_BROWSERHOME, /*"BrowserHome"    The Browser Home key.*/\r
+       GF_KEY_BROWSERREFRESH, /*"BrowserRefresh"    The Browser Refresh key.*/\r
+       GF_KEY_BROWSERSEARCH, /*"BrowserSearch"    The Browser Search key.*/\r
+       GF_KEY_BROWSERSTOP, /*"BrowserStop"    The Browser Stop key.*/\r
+       GF_KEY_CAPSLOCK, /*"CapsLock"    The Caps Lock (Capital) key.*/\r
+       GF_KEY_CLEAR, /*"Clear"    The Clear key.*/\r
+       GF_KEY_CODEINPUT, /*"CodeInput"    The Code Input key.*/\r
+       GF_KEY_COMPOSE, /*"Compose"    The Compose key.*/\r
+       GF_KEY_CONTROL, /*"Control"    The Control (Ctrl) key.*/\r
+       GF_KEY_CRSEL, /*"Crsel"    The Crsel key.*/\r
+       GF_KEY_CONVERT, /*"Convert"    The Convert key.*/\r
+       GF_KEY_COPY, /*"Copy"    The Copy key.*/\r
+       GF_KEY_CUT, /*"Cut"    The Cut key.*/\r
+       GF_KEY_DOWN, /*"Down"    The Down Arrow key.*/\r
+       GF_KEY_END, /*"End"    The End key.*/\r
+       GF_KEY_ENTER, /*"Enter"    The Enter key.\r
+                   Note: This key identifier is also used for the Return (Macintosh numpad) key.*/\r
+       GF_KEY_ERASEEOF, /*"EraseEof"    The Erase EOF key.*/\r
+       GF_KEY_EXECUTE, /*"Execute"    The Execute key.*/\r
+       GF_KEY_EXSEL, /*"Exsel"    The Exsel key.*/\r
+       GF_KEY_F1, /*"F1"    The F1 key.*/\r
+       GF_KEY_F2, /*"F2"    The F2 key.*/\r
+       GF_KEY_F3, /*"F3"    The F3 key.*/\r
+       GF_KEY_F4, /*"F4"    The F4 key.*/\r
+       GF_KEY_F5, /*"F5"    The F5 key.*/\r
+       GF_KEY_F6, /*"F6"    The F6 key.*/\r
+       GF_KEY_F7, /*"F7"    The F7 key.*/\r
+       GF_KEY_F8, /*"F8"    The F8 key.*/\r
+       GF_KEY_F9, /*"F9"    The F9 key.*/\r
+       GF_KEY_F10, /*"F10"    The F10 key.*/\r
+       GF_KEY_F11, /*"F11"    The F11 key.*/\r
+       GF_KEY_F12, /*"F12"    The F12 key.*/\r
+       GF_KEY_F13, /*"F13"    The F13 key.*/\r
+       GF_KEY_F14, /*"F14"    The F14 key.*/\r
+       GF_KEY_F15, /*"F15"    The F15 key.*/\r
+       GF_KEY_F16, /*"F16"    The F16 key.*/\r
+       GF_KEY_F17, /*"F17"    The F17 key.*/\r
+       GF_KEY_F18, /*"F18"    The F18 key.*/\r
+       GF_KEY_F19, /*"F19"    The F19 key.*/\r
+       GF_KEY_F20, /*"F20"    The F20 key.*/\r
+       GF_KEY_F21, /*"F21"    The F21 key.*/\r
+       GF_KEY_F22, /*"F22"    The F22 key.*/\r
+       GF_KEY_F23, /*"F23"    The F23 key.*/\r
+       GF_KEY_F24, /*"F24"    The F24 key.*/\r
+       GF_KEY_FINALMODE, /*"FinalMode"    The Final Mode (Final) key used on some asian keyboards.*/\r
+       GF_KEY_FIND, /*"Find"    The Find key.*/\r
+       GF_KEY_FULLWIDTH, /*"FullWidth"    The Full-Width Characters key.*/\r
+       GF_KEY_HALFWIDTH, /*"HalfWidth"    The Half-Width Characters key.*/\r
+       GF_KEY_HANGULMODE, /*"HangulMode"    The Hangul (Korean characters) Mode key.*/\r
+       GF_KEY_HANJAMODE, /*"HanjaMode"    The Hanja (Korean characters) Mode key.*/\r
+       GF_KEY_HELP, /*"Help"    The Help key.*/\r
+       GF_KEY_HIRAGANA, /*"Hiragana"    The Hiragana (Japanese Kana characters) key.*/\r
+       GF_KEY_HOME, /*"Home"    The Home key.*/\r
+       GF_KEY_INSERT, /*"Insert"    The Insert (Ins) key.*/\r
+       GF_KEY_JAPANESEHIRAGANA, /*"JapaneseHiragana"    The Japanese-Hiragana key.*/\r
+       GF_KEY_JAPANESEKATAKANA, /*"JapaneseKatakana"    The Japanese-Katakana key.*/\r
+       GF_KEY_JAPANESEROMAJI, /*"JapaneseRomaji"    The Japanese-Romaji key.*/\r
+       GF_KEY_JUNJAMODE, /*"JunjaMode"    The Junja Mode key.*/\r
+       GF_KEY_KANAMODE, /*"KanaMode"    The Kana Mode (Kana Lock) key.*/\r
+       GF_KEY_KANJIMODE, /*"KanjiMode"    The Kanji (Japanese name for ideographic characters of Chinese origin) Mode key.*/\r
+       GF_KEY_KATAKANA, /*"Katakana"    The Katakana (Japanese Kana characters) key.*/\r
+       GF_KEY_LAUNCHAPPLICATION1, /*"LaunchApplication1"    The Start Application One key.*/\r
+       GF_KEY_LAUNCHAPPLICATION2, /*"LaunchApplication2"    The Start Application Two key.*/\r
+       GF_KEY_LAUNCHMAIL, /*"LaunchMail"    The Start Mail key.*/\r
+       GF_KEY_LEFT, /*"Left"    The Left Arrow key.*/\r
+       GF_KEY_META, /*"Meta"    The Meta key.*/\r
+       GF_KEY_MEDIANEXTTRACK, /*"MediaNextTrack"    The Media Next Track key.*/\r
+       GF_KEY_MEDIAPLAYPAUSE, /*"MediaPlayPause"    The Media Play Pause key.*/\r
+       GF_KEY_MEDIAPREVIOUSTRACK, /*"MediaPreviousTrack"    The Media Previous Track key.*/\r
+       GF_KEY_MEDIASTOP, /*"MediaStop"    The Media Stok key.*/\r
+       GF_KEY_MODECHANGE, /*"ModeChange"    The Mode Change key.*/\r
+       GF_KEY_NONCONVERT, /*"Nonconvert"    The Nonconvert (Don't Convert) key.*/\r
+       GF_KEY_NUMLOCK, /*"NumLock"    The Num Lock key.*/\r
+       GF_KEY_PAGEDOWN, /*"PageDown"    The Page Down (Next) key.*/\r
+       GF_KEY_PAGEUP, /*"PageUp"    The Page Up key.*/\r
+       GF_KEY_PASTE, /*"Paste"    The Paste key.*/\r
+       GF_KEY_PAUSE, /*"Pause"    The Pause key.*/\r
+       GF_KEY_PLAY, /*"Play"    The Play key.*/\r
+       GF_KEY_PREVIOUSCANDIDATE, /*"PreviousCandidate"    The Previous Candidate function key.*/\r
+       GF_KEY_PRINTSCREEN, /*"PrintScreen"    The Print Screen (PrintScrn, SnapShot) key.*/\r
+       GF_KEY_PROCESS, /*"Process"    The Process key.*/\r
+       GF_KEY_PROPS, /*"Props"    The Props key.*/\r
+       GF_KEY_RIGHT, /*"Right"    The Right Arrow key.*/\r
+       GF_KEY_ROMANCHARACTERS, /*"RomanCharacters"    The Roman Characters function key.*/\r
+       GF_KEY_SCROLL, /*"Scroll"    The Scroll Lock key.*/\r
+       GF_KEY_SELECT, /*"Select"    The Select key.*/\r
+       GF_KEY_SELECTMEDIA, /*"SelectMedia"    The Select Media key.*/\r
+       GF_KEY_SHIFT, /*"Shift"    The Shift key.*/\r
+       GF_KEY_STOP, /*"Stop"    The Stop key.*/\r
+       GF_KEY_UP, /*"Up"    The Up Arrow key.*/\r
+       GF_KEY_UNDO, /*"Undo"    The Undo key.*/\r
+       GF_KEY_VOLUMEDOWN, /*"VolumeDown"    The Volume Down key.*/\r
+       GF_KEY_VOLUMEMUTE, /*"VolumeMute"    The Volume Mute key.*/\r
+       GF_KEY_VOLUMEUP, /*"VolumeUp"    The Volume Up key.*/\r
+       GF_KEY_WIN, /*"Win"    The Windows Logo key.*/\r
+       GF_KEY_ZOOM, /*"Zoom"    The Zoom key.*/\r
+       GF_KEY_BACKSPACE, /*"U+0008"    The Backspace (Back) key.*/\r
+       GF_KEY_TAB, /*"U+0009"    The Horizontal Tabulation (Tab) key.*/\r
+       GF_KEY_CANCEL, /*"U+0018"    The Cancel key.*/\r
+       GF_KEY_ESCAPE, /*"U+001B"    The Escape (Esc) key.*/\r
+       GF_KEY_SPACE, /*"U+0020"    The Space (Spacebar) key.*/\r
+       GF_KEY_EXCLAMATION, /*"U+0021"    The Exclamation Mark (Factorial, Bang) key (!).*/\r
+       GF_KEY_QUOTATION, /*"U+0022"    The Quotation Mark (Quote Double) key (").*/\r
+       GF_KEY_NUMBER, /*"U+0023"    The Number Sign (Pound Sign, Hash, Crosshatch, Octothorpe) key (#).*/\r
+       GF_KEY_DOLLAR, /*"U+0024"    The Dollar Sign (milreis, escudo) key ($).*/\r
+       GF_KEY_AMPERSAND, /*"U+0026"    The Ampersand key (&).*/\r
+       GF_KEY_APOSTROPHE, /*"U+0027"    The Apostrophe (Apostrophe-Quote, APL Quote) key (').*/\r
+       GF_KEY_LEFTPARENTHESIS, /*"U+0028"    The Left Parenthesis (Opening Parenthesis) key (().*/\r
+       GF_KEY_RIGHTPARENTHESIS, /*"U+0029"    The Right Parenthesis (Closing Parenthesis) key ()).*/\r
+       GF_KEY_STAR, /*"U+002A"    The Asterix (Star) key (*).*/\r
+       GF_KEY_PLUS, /*"U+002B"    The Plus Sign (Plus) key (+).*/\r
+       GF_KEY_COMMA, /*"U+002C"    The Comma (decimal separator) sign key (,).*/\r
+       GF_KEY_HYPHEN, /*"U+002D"    The Hyphen-minus (hyphen or minus sign) key (-).*/\r
+       GF_KEY_FULLSTOP, /*"U+002E"    The Full Stop (period, dot, decimal point) key (.).*/\r
+       GF_KEY_SLASH, /*"U+002F"    The Solidus (slash, virgule, shilling) key (/).*/\r
+       GF_KEY_0, /*"U+0030"    The Digit Zero key (0).*/\r
+       GF_KEY_1, /*"U+0031"    The Digit One key (1).*/\r
+       GF_KEY_2, /*"U+0032"    The Digit Two key (2).*/\r
+       GF_KEY_3, /*"U+0033"    The Digit Three key (3).*/\r
+       GF_KEY_4, /*"U+0034"    The Digit Four key (4).*/\r
+       GF_KEY_5, /*"U+0035"    The Digit Five key (5).*/\r
+       GF_KEY_6, /*"U+0036"    The Digit Six key (6).*/\r
+       GF_KEY_7, /*"U+0037"    The Digit Seven key (7).*/\r
+       GF_KEY_8, /*"U+0038"    The Digit Eight key (8).*/\r
+       GF_KEY_9, /*"U+0039"    The Digit Nine key (9).*/\r
+       GF_KEY_COLON, /*"U+003A"    The Colon key (:).*/\r
+       GF_KEY_SEMICOLON, /*"U+003B"    The Semicolon key (;).*/\r
+       GF_KEY_LESSTHAN, /*"U+003C"    The Less-Than Sign key (<).*/\r
+       GF_KEY_EQUALS, /*"U+003D"    The Equals Sign key (=).*/\r
+       GF_KEY_GREATERTHAN, /*"U+003E"    The Greater-Than Sign key (>).*/\r
+       GF_KEY_QUESTION, /*"U+003F"    The Question Mark key (?).*/\r
+       GF_KEY_AT, /*"U+0040"    The Commercial At (@) key.*/\r
+       GF_KEY_A, /*"U+0041"    The Latin Capital Letter A key (A).*/\r
+       GF_KEY_B, /*"U+0042"    The Latin Capital Letter B key (B).*/\r
+       GF_KEY_C, /*"U+0043"    The Latin Capital Letter C key (C).*/\r
+       GF_KEY_D, /*"U+0044"    The Latin Capital Letter D key (D).*/\r
+       GF_KEY_E, /*"U+0045"    The Latin Capital Letter E key (E).*/\r
+       GF_KEY_F, /*"U+0046"    The Latin Capital Letter F key (F).*/\r
+       GF_KEY_G, /*"U+0047"    The Latin Capital Letter G key (G).*/\r
+       GF_KEY_H, /*"U+0048"    The Latin Capital Letter H key (H).*/\r
+       GF_KEY_I, /*"U+0049"    The Latin Capital Letter I key (I).*/\r
+       GF_KEY_J, /*"U+004A"    The Latin Capital Letter J key (J).*/\r
+       GF_KEY_K, /*"U+004B"    The Latin Capital Letter K key (K).*/\r
+       GF_KEY_L, /*"U+004C"    The Latin Capital Letter L key (L).*/\r
+       GF_KEY_M, /*"U+004D"    The Latin Capital Letter M key (M).*/\r
+       GF_KEY_N, /*"U+004E"    The Latin Capital Letter N key (N).*/\r
+       GF_KEY_O, /*"U+004F"    The Latin Capital Letter O key (O).*/\r
+       GF_KEY_P, /*"U+0050"    The Latin Capital Letter P key (P).*/\r
+       GF_KEY_Q, /*"U+0051"    The Latin Capital Letter Q key (Q).*/\r
+       GF_KEY_R, /*"U+0052"    The Latin Capital Letter R key (R).*/\r
+       GF_KEY_S, /*"U+0053"    The Latin Capital Letter S key (S).*/\r
+       GF_KEY_T, /*"U+0054"    The Latin Capital Letter T key (T).*/\r
+       GF_KEY_U, /*"U+0055"    The Latin Capital Letter U key (U).*/\r
+       GF_KEY_V, /*"U+0056"    The Latin Capital Letter V key (V).*/\r
+       GF_KEY_W, /*"U+0057"    The Latin Capital Letter W key (W).*/\r
+       GF_KEY_X, /*"U+0058"    The Latin Capital Letter X key (X).*/\r
+       GF_KEY_Y, /*"U+0059"    The Latin Capital Letter Y key (Y).*/\r
+       GF_KEY_Z, /*"U+005A"    The Latin Capital Letter Z key (Z).*/\r
+       GF_KEY_LEFTSQUAREBRACKET, /*"U+005B"    The Left Square Bracket (Opening Square Bracket) key ([).*/\r
+       GF_KEY_BACKSLASH, /*"U+005C"    The Reverse Solidus (Backslash) key (\).*/\r
+       GF_KEY_RIGHTSQUAREBRACKET, /*"U+005D"    The Right Square Bracket (Closing Square Bracket) key (]).*/\r
+       GF_KEY_CIRCUM, /*"U+005E"    The Circumflex Accent key (^).*/\r
+       GF_KEY_UNDERSCORE, /*"U+005F"    The Low Sign (Spacing Underscore, Underscore) key (_).*/\r
+       GF_KEY_GRAVEACCENT, /*"U+0060"    The Grave Accent (Back Quote) key (`).*/\r
+       GF_KEY_LEFTCURLYBRACKET, /*"U+007B"    The Left Curly Bracket (Opening Curly Bracket, Opening Brace, Brace Left) key ({).*/\r
+       GF_KEY_PIPE, /*"U+007C"    The Vertical Line (Vertical Bar, Pipe) key (|).*/\r
+       GF_KEY_RIGHTCURLYBRACKET, /*"U+007D"    The Right Curly Bracket (Closing Curly Bracket, Closing Brace, Brace Right) key (}).*/\r
+       GF_KEY_DEL, /*"U+007F"    The Delete (Del) Key.*/\r
+       GF_KEY_INVERTEXCLAMATION, /*"U+00A1"    The Inverted Exclamation Mark key (�).*/\r
+       GF_KEY_DEADGRAVE, /*"U+0300"    The Combining Grave Accent (Greek Varia, Dead Grave) key.*/\r
+       GF_KEY_DEADEACUTE, /*"U+0301"    The Combining Acute Accent (Stress Mark, Greek Oxia, Tonos, Dead Eacute) key.*/\r
+       GF_KEY_DEADCIRCUM, /*"U+0302"    The Combining Circumflex Accent (Hat, Dead Circumflex) key.*/\r
+       GF_KEY_DEADTILDE, /*"U+0303"    The Combining Tilde (Dead Tilde) key.*/\r
+       GF_KEY_DEADMACRON, /*"U+0304"    The Combining Macron (Long, Dead Macron) key.*/\r
+       GF_KEY_DEADBREVE, /*"U+0306"    The Combining Breve (Short, Dead Breve) key.*/\r
+       GF_KEY_DEADABOVEDOT, /*"U+0307"    The Combining Dot Above (Derivative, Dead Above Dot) key.*/\r
+       GF_KEY_DEADDIARESIS, /*"U+0308"    The Combining Diaeresis (Double Dot Abode, Umlaut, Greek Dialytika, Double Derivative, Dead Diaeresis) key.*/\r
+       GF_KEY_DEADRINGABOVE, /*"U+030A"    The Combining Ring Above (Dead Above Ring) key.*/\r
+       GF_KEY_DEADDOUBLEACUTE, /*"U+030B"    The Combining Double Acute Accent (Dead Doubleacute) key.*/\r
+       GF_KEY_DEADCARON, /*"U+030C"    The Combining Caron (Hacek, V Above, Dead Caron) key.*/\r
+       GF_KEY_DEADCEDILLA, /*"U+0327"    The Combining Cedilla (Dead Cedilla) key.*/\r
+       GF_KEY_DEADOGONEK, /*"U+0328"    The Combining Ogonek (Nasal Hook, Dead Ogonek) key.*/\r
+       GF_KEY_DEADIOTA, /*"U+0345"    The Combining Greek Ypogegrammeni (Greek Non-Spacing Iota Below, Iota Subscript, Dead Iota) key.*/\r
+       GF_KEY_EURO, /*"U+20AC"    The Euro Currency Sign key (�).*/\r
+       GF_KEY_DEADVOICESOUND, /*"U+3099"    The Combining Katakana-Hiragana Voiced Sound Mark (Dead Voiced Sound) key.*/\r
+       GF_KEY_DEADSEMIVOICESOUND, /*"U+309A"    The Combining Katakana-Hiragana Semi-Voiced Sound Mark (Dead Semivoiced Sound) key. */\r
+\r
+       /*non-dom keys, used in LASeR*/\r
+       GF_KEY_CELL_SOFT1,      /*soft1 key of cell phones*/\r
+       GF_KEY_CELL_SOFT2,      /*soft2 key of cell phones*/\r
+       \r
+       /*for joystick handling*/\r
+       GF_KEY_JOYSTICK\r
+};\r
+\r
+\r
+/*key modifiers state - set by terminal (not set by video driver)*/\r
+enum\r
+{\r
+       GF_KEY_MOD_SHIFT = (1),\r
+       GF_KEY_MOD_CTRL = (1<<2),\r
+       GF_KEY_MOD_ALT = (1<<3),\r
+\r
+       GF_KEY_EXT_NUMPAD = (1<<4),\r
+       GF_KEY_EXT_LEFT = (1<<5),\r
+       GF_KEY_EXT_RIGHT = (1<<6)\r
+};\r
+\r
+/*mouse button modifiers*/\r
+enum\r
+{\r
+       GF_MOUSE_LEFT = 0,\r
+       GF_MOUSE_MIDDLE,\r
+       GF_MOUSE_RIGHT\r
+};\r
+\r
+/*event proc return value: ignored*/\r
+typedef struct\r
+{\r
+       /*GF_EVENT_MOUSEMOVE, GF_EVENT_MOUSEWHEEL, GF_EVENT_MOUSEDOWN, GF_EVENT_MOUSEUP*/\r
+       u8 type;\r
+       /*mouse location in output window, 2D-like:  top-left (0,0), increasing y towards bottom*/\r
+       s32 x, y;\r
+       /*wheel position (wheel current delta / wheel absolute delta) for GF_EVENT_MouseWheel*/\r
+       Fixed wheel_pos;\r
+       /*0: left - 1: middle, 2- right*/\r
+       u32 button;\r
+       /*key modifier*/\r
+       u32 key_states;\r
+} GF_EventMouse;\r
+\r
+/*event proc return value: ignored*/\r
+typedef struct\r
+{\r
+       /*GF_EVENT_KEYDOWN and GF_EVENT_KEYUP*/\r
+       u8 type;\r
+       /*above GPAC/DOM key code*/\r
+       u32 key_code;\r
+       /* hadrware key value (matching ASCI) */\r
+       u32 hw_code;\r
+       /*key modifier*/\r
+       u32 flags;\r
+} GF_EventKey;\r
+\r
+/*event proc return value: ignored*/\r
+typedef struct\r
+{\r
+       /*GF_EVENT_TEXTINPUT*/\r
+       u8 type;\r
+       /*above virtual key code*/\r
+       u32 unicode_char;\r
+} GF_EventChar;\r
+\r
+/*event proc return value: ignored*/\r
+typedef struct\r
+{\r
+       /*GF_EVENT_SIZE*/\r
+       u8 type;\r
+       /*width and height*/\r
+       u16 width, height;\r
+} GF_EventSize;\r
+\r
+/*event proc return value: ignored*/\r
+typedef struct\r
+{\r
+       /*GF_EVENT_VIDEO_SETUP*/\r
+       u8 type;\r
+       /*width and height of visual surface to allocate*/\r
+       u16 width, height;\r
+       /*indicates whether double buffering is desired*/\r
+       Bool back_buffer;\r
+       /*indicates whether system memory for the backbuffer is desired (no video blitting)*/\r
+       Bool system_memory;\r
+       /*indicates whether opengl context shall be created. Values are:\r
+               0: no opengl context shall be created\r
+               1: opengl context shall be created for the main window and set as the current one\r
+               2: an extra opengl context shall be created for offscreen rendering and set as the current one\r
+                       if not supported, mix of 2D (raster) and 3D (openGL) will be disabled\r
+       */\r
+       u32 opengl_mode;\r
+} GF_EventVideoSetup;\r
+\r
+/*event proc return value: ignored\r
+this event may be triggered by the compositor if owning window or if shortcut fullscreen is detected*/\r
+typedef struct\r
+{\r
+       /*GF_EVENT_SHOWHIDE*/\r
+       u8 type;\r
+       /*0: hidden - 1: visible - 2: fullscreen*/\r
+       u32 show_type;\r
+} GF_EventShow;\r
+\r
+\r
+/*sensor signaling*/\r
+enum\r
+{\r
+       GF_CURSOR_NORMAL = 0x00,\r
+       GF_CURSOR_ANCHOR, \r
+       GF_CURSOR_TOUCH,\r
+       /*discSensor, cylinderSensor, sphereSensor*/\r
+       GF_CURSOR_ROTATE, \r
+       /*proximitySensor & proximitySensor2D*/\r
+       GF_CURSOR_PROXIMITY, \r
+       /*planeSensor & planeSensor2D*/\r
+       GF_CURSOR_PLANE,\r
+       /*collision*/\r
+       GF_CURSOR_COLLIDE, \r
+       GF_CURSOR_HIDE, \r
+};\r
+\r
+/*event proc return value: ignored*/\r
+typedef struct\r
+{\r
+       /*GF_EVENT_SET_CURSOR*/\r
+       u8 type;\r
+       /*set if is visible*/\r
+       u32 cursor_type;\r
+} GF_EventCursor;\r
+\r
+/*event proc return value: ignored*/\r
+typedef struct\r
+{\r
+       /*GF_EVENT_SET_CAPTION*/\r
+       u8 type;\r
+       /*window style flags - NOT USED YET*/\r
+       const char *caption;\r
+} GF_EventCaption;\r
+\r
+/*event proc: never posted*/\r
+typedef struct\r
+{\r
+       /*GF_EVENT_MOVE*/\r
+       u8 type;\r
+       s32 x, y;\r
+       /*0: absolute positionning, 1: relative move, 2: use alignment constraints*/\r
+       Bool relative;\r
+       /*0: left/top, 1: middle, 2: right/bottom*/\r
+       u8 align_x, align_y;\r
+} GF_EventMove;\r
+\r
+/*duration may be signaled several times: it may change when setting up streams\r
+event proc return value: ignored*/\r
+typedef struct\r
+{\r
+       /*GF_EVENT_DURATION*/\r
+       u8 type;\r
+       /*duration in seconds*/\r
+       Double duration;\r
+       /*is seeking supported for service*/\r
+       Bool can_seek;\r
+} GF_EventDuration;\r
+\r
+/*event proc return value: 0 if URL not supported, 1 if accepted (it is the user responsability to load the url)\r
+YOU SHALL NOT DIRECTLY OPEN THE NEW URL IN THE EVENT PROC, THIS WOULD DEADLOCK THE TERMINAL\r
+*/\r
+typedef struct\r
+{\r
+       /*GF_EVENT_NAVIGATE and GF_EVENT_NAVIGATE_INFO*/\r
+       u8 type;\r
+       /*new url to open / data to handle*/\r
+       const char *to_url;\r
+       /*parameters (cf vrml spec) - UNUSED for GF_EVENT_NAVIGATE_INFO*/\r
+       u32 param_count;\r
+       const char **parameters;\r
+} GF_EventNavigate;\r
+\r
+\r
+/*event proc return value: ignored*/\r
+typedef struct\r
+{\r
+       /*GF_EVENT_MESSAGE*/\r
+       u8 type;\r
+       /*name of service issuing the message*/\r
+       const char *service;\r
+       /*message*/\r
+       const char *message;\r
+       /*error if any*/\r
+       GF_Err error;\r
+} GF_EventMessage;\r
+\r
+/*event proc return value: ignored*/\r
+typedef struct\r
+{\r
+       /*GF_EVENT_PROGRESS*/\r
+       u8 type;\r
+       /*name of service issuing the progress notif*/\r
+       const char *service;\r
+       /*progress type: 0: buffering, 1: downloading, 2: importing (BT/VRML/...)*/\r
+       u32 progress_type;\r
+       /*amount done and total amount of operation.\r
+               For buffer events, expresses current and total desired stream buffer in scene in milliseconds\r
+               For download events, expresses current and total size of download in bytes\r
+               For import events, no units defined (depends on importers)\r
+       */\r
+       u32 done, total;\r
+} GF_EventProgress;\r
+\r
+/*event proc return value: ignored*/\r
+typedef struct\r
+{\r
+       /*GF_EVENT_CONNECT*/\r
+       u8 type;\r
+       /*sent upon connection/deconnection completion. if any error, it is signaled through message event*/\r
+       Bool is_connected;\r
+} GF_EventConnect;\r
+\r
+/*event proc return value: 1 if info has been completed, 0 otherwise (and operation this request was for\r
+will then fail)*/\r
+typedef struct\r
+{\r
+       /*GF_EVENT_AUTHORIZATION*/\r
+       u8 type;\r
+       /*the URL the auth request is for*/\r
+       const char *site_url;\r
+       /*user name (provided buffer can hold 50 bytes). It may already be formated, or an empty ("") string*/\r
+       char *user;\r
+       /*password (provided buffer can hold 50 bytes)*/\r
+       char *password;\r
+} GF_EventAuthorize;\r
+\r
+\r
+/*event proc return value: 1 if info has been completed, 0 otherwise */\r
+typedef struct\r
+{\r
+       /*GF_EVENT_SYS_COLORS*/\r
+       u8 type;\r
+       /*ARGB colors, in order:\r
+       ActiveBorder, ActiveCaption, AppWorkspace, Background, ButtonFace, ButtonHighlight, ButtonShadow, \r
+       ButtonText, CaptionText, GrayText, Highlight, HighlightText, InactiveBorder, InactiveCaption, \r
+       InactiveCaptionText, InfoBackground, InfoText, Menu, MenuText, Scrollbar, ThreeDDarkShadow, \r
+       ThreeDFace, ThreeDHighlight, ThreeDLightShadow, ThreeDShadow, Window, WindowFrame, WindowText\r
+       */\r
+       u32 sys_colors[28];\r
+} GF_EventSysColors;\r
+\r
+/*Mutation AttrChangeType Signaling*/\r
+enum\r
+{\r
+       GF_MUTATION_ATTRCHANGE_MODIFICATION = 0x01,\r
+       GF_MUTATION_ATTRCHANGE_ADDITION = 0x02,\r
+       GF_MUTATION_ATTRCHANGE_REMOVAL = 0x03,\r
+};\r
+\r
+typedef struct {\r
+       /* GF_EVENT_TREE_MODIFIED, GF_EVENT_NODE_INSERTED, GF_EVENT_NODE_REMOVED, GF_EVENT_NODE_INSERTED_DOC, GF_EVENT_NODE_REMOVED_DOC, GF_EVENT_ATTR_MODIFIED, GF_EVENT_CHAR_DATA_MODIFIED */\r
+       u8 type;\r
+       void *relatedNode;\r
+       void *prevValue;\r
+       void *newValue;\r
+       void *attrName;\r
+       u8 attrChange;\r
+} GF_EventMutation;\r
+\r
+typedef union\r
+{\r
+       u8 type;\r
+       GF_EventMouse mouse;\r
+       GF_EventKey key;\r
+       GF_EventChar character;\r
+       GF_EventSize size;\r
+       GF_EventShow show;\r
+       GF_EventDuration duration;\r
+       GF_EventNavigate navigate;\r
+       GF_EventMessage message;\r
+       GF_EventProgress progress;\r
+       GF_EventConnect connect;\r
+       GF_EventCaption caption;\r
+       GF_EventCursor cursor;\r
+       GF_EventAuthorize auth;\r
+       GF_EventSysColors sys_cols;\r
+       GF_EventMove move;\r
+       GF_EventVideoSetup setup;\r
+       GF_EventMutation mutation;\r
+} GF_Event;\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /*_GF_EVENTS_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/ietf.h b/tstools/DtsEdit/src/gpac/ietf.h
new file mode 100644 (file)
index 0000000..e6552e5
--- /dev/null
@@ -0,0 +1,1319 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / IETF RTP/RTSP/SDP sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+\r
+#ifndef        _GF_IETF_H_\r
+#define _GF_IETF_H_\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/list.h>\r
+#include <gpac/bitstream.h>\r
+#include <gpac/sync_layer.h>\r
+#include <gpac/network.h>\r
+\r
+\r
+/****************************************************************************\r
+\r
+                               RTSP VERSION 1.0 LIBRARY EXPORTS\r
+\r
+****************************************************************************/\r
+\r
+#define GF_RTSP_VERSION                "RTSP/1.0"\r
+\r
+\r
+/*\r
+ *             RTSP NOTIF CODES\r
+ */\r
+enum\r
+{\r
+       NC_RTSP_Continue                =               100,\r
+       NC_RTSP_OK                              =               200,\r
+       NC_RTSP_Created                 =               201,\r
+       NC_RTSP_Low_on_Storage_Space    =       250,\r
+\r
+       NC_RTSP_Multiple_Choice =       300,\r
+       NC_RTSP_Moved_Permanently       =       301,\r
+       NC_RTSP_Moved_Temporarily       =       302,\r
+       NC_RTSP_See_Other       =       303,\r
+       NC_RTSP_Use_Proxy       =       305,\r
+\r
+       NC_RTSP_Bad_Request     =       400,\r
+       NC_RTSP_Unauthorized    =       401,\r
+       NC_RTSP_Payment_Required        =       402,\r
+       NC_RTSP_Forbidden       =       403,\r
+       NC_RTSP_Not_Found       =       404,\r
+       NC_RTSP_Method_Not_Allowed      =       405,\r
+       NC_RTSP_Not_Acceptable  =       406,\r
+       NC_RTSP_Proxy_Authentication_Required   =       407,\r
+       NC_RTSP_Request_Timeout =       408,\r
+       NC_RTSP_Gone    =       410,\r
+       NC_RTSP_Length_Required =       411,\r
+       NC_RTSP_Precondition_Failed     =       412,\r
+       NC_RTSP_Request_Entity_Too_Large        =       413,\r
+       NC_RTSP_Request_URI_Too_Long    =       414,\r
+       NC_RTSP_Unsupported_Media_Type  =       415,\r
+\r
+       NC_RTSP_Invalid_parameter       =       451,\r
+       NC_RTSP_Illegal_Conference_Identifier   =       452,\r
+       NC_RTSP_Not_Enough_Bandwidth    =       453,\r
+       NC_RTSP_Session_Not_Found       =       454,\r
+       NC_RTSP_Method_Not_Valid_In_This_State  =       455,\r
+       NC_RTSP_Header_Field_Not_Valid  =       456,\r
+       NC_RTSP_Invalid_Range   =       457,\r
+       NC_RTSP_Parameter_Is_ReadOnly   =       458,\r
+       NC_RTSP_Aggregate_Operation_Not_Allowed =       459,\r
+       NC_RTSP_Only_Aggregate_Operation_Allowed        =       460,\r
+       NC_RTSP_Unsupported_Transport   =       461,\r
+       NC_RTSP_Destination_Unreachable =       462,\r
+       \r
+       NC_RTSP_Internal_Server_Error   =       500,\r
+       NC_RTSP_Not_Implemented =       501,\r
+       NC_RTSP_Bad_Gateway     =       502,\r
+       NC_RTSP_Service_Unavailable     =       503,\r
+       NC_RTSP_Gateway_Timeout =       504,\r
+       NC_RTSP_RTSP_Version_Not_Supported      =       505,\r
+\r
+       NC_RTSP_Option_not_support      =       551,\r
+};\r
+\r
+const char *gf_rtsp_nc_to_string(u32 ErrCode);\r
+\r
+/*\r
+               Common structures between commands and responses\r
+*/\r
+\r
+/*\r
+       RTSP Range information - RTSP Session level only (though this is almost the same\r
+       format as an SDP range, this is not used in the SDP lib as "a=range" is not part of SDP\r
+       but part of RTSP\r
+*/\r
+typedef struct {\r
+       /* start and end range. If end is -1, the range is open (from start to unknown) */\r
+       Double start, end;\r
+       /* use SMPTE range (Start and End specify the number of frames) (currently not supported) */\r
+       u32 UseSMPTE;\r
+       /* framerate for SMPTE range */\r
+       Double FPS;\r
+} GF_RTSPRange;\r
+\r
+/*\r
+parses a Range line and returns range header structure. can be used for RTSP extension of SDP\r
+NB: Only support for npt for now\r
+*/\r
+GF_RTSPRange *gf_rtsp_range_parse(char *range_buf);\r
+\r
+GF_RTSPRange *gf_rtsp_range_new();\r
+void gf_rtsp_range_del(GF_RTSPRange *range);\r
+\r
+/*\r
+                       Transport structure \r
+               contains all network info for RTSP sessions (ports, uni/multi-cast, ...)\r
+*/\r
+\r
+/*\r
+       Transport Profiles as defined in RFC 2326\r
+*/\r
+#define GF_RTSP_PROFILE_RTP_AVP                        "RTP/AVP"\r
+#define GF_RTSP_PROFILE_RTP_AVP_TCP            "RTP/AVP/TCP"\r
+#define GF_RTSP_PROFILE_UDP                            "udp"\r
+\r
+\r
+typedef struct\r
+{\r
+       /* set to 1 if unicast */\r
+       Bool IsUnicast;\r
+       /* for multicast */\r
+       char *destination;\r
+       /* for redirections internal to servers */\r
+       char *source;\r
+       /*IsRecord is usually 0 (PLAY) . If set, Append specify that the stream should\r
+       be concatenated to existing resources */\r
+       Bool IsRecord, Append;\r
+       /* in case transport is on TCP/RTSP, If only 1 ID is specified, it is stored in rtpID (this\r
+       is not RTP interleaving) */\r
+       Bool IsInterleaved, rtpID, rtcpID;\r
+       /* Multicast specific */\r
+       u32 MulticastLayers;\r
+       u8 TTL;\r
+       /*RTP specific*/\r
+\r
+       /*port for multicast*/\r
+       /*server port in unicast - RTP implies low is even , and last is low+1*/\r
+       u16 port_first, port_last;\r
+       /*client port in unicast - RTP implies low is even , and last is low+1*/\r
+       u16 client_port_first, client_port_last;\r
+       u32 SSRC;\r
+\r
+       /*Transport protocol. In this version we only support RTP/AVP, the following flag tells \r
+       us if this is RTP/AVP/TCP or RTP/AVP (default)*/\r
+       char *Profile;\r
+} GF_RTSPTransport;\r
+\r
+\r
+GF_RTSPTransport *gf_rtsp_transport_clone(GF_RTSPTransport *original);\r
+void gf_rtsp_transport_del(GF_RTSPTransport *transp);\r
+\r
+\r
+/*\r
+                               RTSP Command\r
+               the RTSP Response is sent by a client / received by a server\r
+       text Allocation is done by the lib when parsing a command, and\r
+       is automatically freed when calling reset / delete. Therefore you must\r
+       set/allocate the fields yourself when writing a command (client)\r
+\r
+*/\r
+\r
+/*ALL RTSP METHODS - all other methods will be ignored*/\r
+#define GF_RTSP_DESCRIBE               "DESCRIBE"\r
+#define GF_RTSP_SETUP                  "SETUP"\r
+#define GF_RTSP_PLAY                   "PLAY"\r
+#define GF_RTSP_PAUSE                  "PAUSE"\r
+#define GF_RTSP_RECORD                 "RECORD"\r
+#define GF_RTSP_TEARDOWN               "TEARDOWN"\r
+#define GF_RTSP_GET_PARAMETER  "GET_PARAMETER"\r
+#define GF_RTSP_SET_PARAMETER  "SET_PARAMETER"\r
+#define GF_RTSP_OPTIONS                "OPTIONS"\r
+#define GF_RTSP_ANNOUNCE               "ANNOUNCE"\r
+#define GF_RTSP_REDIRECTE              "REDIRECT"\r
+\r
+\r
+typedef struct\r
+{\r
+       char *Accept;\r
+       char *Accept_Encoding;\r
+       char *Accept_Language;\r
+       char *Authorization;\r
+       u32 Bandwidth;\r
+       u32 Blocksize;\r
+       char *Cache_Control;\r
+       char *Conference;\r
+       char *Connection;\r
+       u32 Content_Length;\r
+       u32 CSeq;\r
+       char *From;\r
+       char *Proxy_Authorization;\r
+       char *Proxy_Require;\r
+       GF_RTSPRange *Range;\r
+       char *Referer;\r
+       Double Scale;\r
+       char *Session;\r
+       Double Speed;\r
+       /*nota : RTSP allows several configurations for a single channel (multicast and \r
+       unicast , ...). Usually only 1*/\r
+       GF_List *Transports;\r
+       char *User_Agent;\r
+\r
+       /*type of the command, one of the described above*/\r
+       char *method;\r
+       \r
+       /*Header extensions*/\r
+       GF_List *Xtensions;\r
+\r
+       /*body of the command, size is Content-Length (auto computed when sent). It is not \r
+       terminated by a NULL char*/\r
+       char *body;\r
+\r
+       /*\r
+                       Specify ControlString if your request targets\r
+               a specific media stream in the service. If null, the service name only will be used\r
+               for control (for ex, both A and V streams in a single file)\r
+               If the request is GF_RTSP_OPTIONS, you must provide a control string containing the options \r
+               you want to query\r
+       */\r
+       char *ControlString;\r
+\r
+       /*user data: this is never touched by the lib, its intend is to help stacking\r
+       RTSP commands in your app*/\r
+       void *user_data;\r
+\r
+\r
+       /*\r
+               Server side Extensions\r
+       */\r
+\r
+       /*full URL of the command. Not used at client side, as the URL is ALWAYS relative\r
+       to the server / service of the RTSP session \r
+       On the server side however redirections are up to the server, so we cannot decide for it        */\r
+       char *service_name;\r
+       /*RTSP status code of the command as parsed. One of the above RTSP StatusCode*/\r
+       u32 StatusCode;\r
+} GF_RTSPCommand;\r
+\r
+\r
+GF_RTSPCommand *gf_rtsp_command_new();\r
+void gf_rtsp_command_del(GF_RTSPCommand *com);\r
+void gf_rtsp_command_reset(GF_RTSPCommand *com);\r
+\r
+\r
+\r
+/*\r
+                               RTSP Response\r
+               the RTSP Response is received by a client / sent by a server\r
+       text Allocation is done by the lib when parsing a response, and\r
+       is automatically freed when calling reset / delete. Therefore you must\r
+       allocate the fields yourself when writing a response (server)\r
+\r
+*/\r
+\r
+/*\r
+       RTP-Info for RTP channels. There may be several RTP-Infos in one response\r
+       based on the server implementation (DSS/QTSS begaves this way)\r
+*/\r
+typedef struct\r
+{\r
+       /*control string of the channel*/\r
+       char *url;\r
+       /*seq num for asociated rtp_time*/\r
+       u32 seq;\r
+       /*rtp TimeStamp corresponding to the Range start specified in the PLAY request*/\r
+       u32 rtp_time;\r
+       /*ssrc of sender if known, 0 otherwise*/\r
+       u32 ssrc;\r
+} GF_RTPInfo;\r
+\r
+\r
+\r
+/*\r
+       RTSP Response\r
+*/\r
+typedef struct\r
+{\r
+       /* response code*/\r
+       u32 ResponseCode;\r
+       /* comment from the server */\r
+       char *ResponseInfo;\r
+       \r
+       /*      Header Fields   */\r
+       char *Accept;\r
+       char *Accept_Encoding;\r
+       char *Accept_Language;\r
+       char *Allow;\r
+       char *Authorization;\r
+       u32 Bandwidth;\r
+       u32 Blocksize;\r
+       char *Cache_Control;\r
+       char *Conference;\r
+       char *Connection;\r
+       char *Content_Base;\r
+       char *Content_Encoding;\r
+       char *Content_Language;\r
+       u32 Content_Length;\r
+       char *Content_Location;\r
+       char *Content_Type;\r
+       u32 CSeq;\r
+       char *Date;\r
+       char *Expires;\r
+       char *From;\r
+       char *Host;\r
+       char *If_Match;\r
+       char *If_Modified_Since;\r
+       char *Last_Modified;\r
+       char *Location;\r
+       char *Proxy_Authenticate;\r
+       char *Proxy_Require;\r
+       char *Public;\r
+       GF_RTSPRange *Range;\r
+       char *Referer;\r
+       char *Require;\r
+       char *Retry_After;\r
+       GF_List *RTP_Infos;\r
+       Double Scale;\r
+       char *Server;\r
+       char *Session;\r
+       u32 SessionTimeOut;\r
+       Double Speed;\r
+       char *Timestamp;\r
+       /*nota : RTSP allows several configurations for a single channel (multicast and \r
+       unicast , ...). Usually only 1*/\r
+       GF_List *Transports;\r
+       char *Unsupported;\r
+       char *User_Agent;\r
+       char *Vary;\r
+       char *Via;\r
+       char *WWW_Authenticate;\r
+\r
+       /*Header extensions*/\r
+       GF_List *Xtensions;\r
+\r
+       /*body of the response, size is Content-Length (auto computed when sent). It is not \r
+       terminated by a NULL char when response is parsed but must be null-terminated when \r
+       response is being sent*/\r
+       char *body;\r
+} GF_RTSPResponse;\r
+\r
+\r
+GF_RTSPResponse *gf_rtsp_response_new();\r
+void gf_rtsp_response_del(GF_RTSPResponse *rsp);\r
+void gf_rtsp_response_reset(GF_RTSPResponse *rsp);\r
+\r
+\r
+\r
+typedef struct _tag_rtsp_session GF_RTSPSession;\r
+\r
+GF_RTSPSession *gf_rtsp_session_new(char *sURL, u16 DefaultPort);\r
+void gf_rtsp_session_del(GF_RTSPSession *sess);\r
+\r
+GF_Err gf_rtsp_set_buffer_size(GF_RTSPSession *sess, u32 BufferSize);\r
+\r
+/*force the IP address the client is using*/\r
+void gf_rtsp_set_mobile_ip(GF_RTSPSession *sess, char *MobileIP);\r
+\r
+\r
+/*Reset state machine, invalidate SessionID\r
+NOTE: RFC2326 requires that the session is reseted when all RTP streams\r
+are closed. As this lib doesn't maintain the number of valid streams\r
+you MUST call reset when all your streams are shutdown (either requested through\r
+TEARDOWN or signaled through RTCP BYE packets for RTP, or any other signaling means\r
+for other protocols)\r
+reset connection will destroy the socket - this is isefull in case of timeouts, because\r
+some servers do not restart with the right CSeq...*/\r
+void gf_rtsp_session_reset(GF_RTSPSession *sess, Bool ResetConnection);\r
+\r
+u32 gf_rtsp_is_my_session(GF_RTSPSession *sess, char *url);\r
+const char *gf_rtsp_get_last_session_id(GF_RTSPSession *sess);\r
+char *gf_rtsp_get_server_name(GF_RTSPSession *sess);\r
+char *gf_rtsp_get_service_name(GF_RTSPSession *sess);\r
+u16 gf_rtsp_get_session_port(GF_RTSPSession *sess);\r
+\r
+/*Fetch an RTSP response from the server the GF_RTSPResponse will be reseted before fetch*/\r
+GF_Err gf_rtsp_get_response(GF_RTSPSession *sess, GF_RTSPResponse *rsp);\r
+\r
+\r
+/*RTSP State Machine. The only non blocking mode is GF_RTSP_STATE_WAIT_FOR_CONTROL*/\r
+enum\r
+{\r
+       /*Initialized (connection might be off, but all structures are in place)\r
+       This is the default state between # requests (aka, DESCRIBE and SETUP\r
+       or SETUP and PLAY ...)*/\r
+       GF_RTSP_STATE_INIT      =       0,\r
+       /*Waiting*/\r
+       GF_RTSP_STATE_WAITING,\r
+       /*PLAY, PAUSE, RECORD. Aggregation is allowed for the same type, you can send several command\r
+       in a row. However the session will return GF_SERVICE_ERROR if you do not have \r
+       a valid SessionID in the command\r
+       You cannot issue a SETUP / DESCRIBE while in this state*/\r
+       GF_RTSP_STATE_WAIT_FOR_CONTROL,\r
+\r
+       /*FATAL ERROR: session is invalidated by server. Call reset and restart from SETUP if needed*/\r
+       GF_RTSP_STATE_INVALIDATED\r
+};\r
+\r
+u32 gf_rtsp_get_session_state(GF_RTSPSession *sess);\r
+/*aggregate command state-machine: the PLAY/PAUSE can be aggregated \r
+(sent before the reply is received). This function gets the last command sent*/\r
+char *gf_rtsp_get_last_request(GF_RTSPSession *sess);\r
+/*foce a reset in case of pbs*/\r
+void gf_rtsp_reset_aggregation(GF_RTSPSession *sess);\r
+\r
+/*\r
+       Send an RTSP request to the server.\r
+*/\r
+GF_Err gf_rtsp_send_command(GF_RTSPSession *sess, GF_RTSPCommand *com);\r
+\r
+\r
+GF_Err gf_rtsp_set_interleave_callback(GF_RTSPSession *sess,\r
+                                               GF_Err (*SignalData)(GF_RTSPSession *sess, void *cbk_ptr, char *buffer, u32 bufferSize, Bool IsRTCP)\r
+                               );\r
+\r
+\r
+GF_Err gf_rtsp_session_read(GF_RTSPSession *sess);\r
+\r
+GF_Err gf_rtsp_register_interleave(GF_RTSPSession *sess, void *the_ch, u8 LowInterID, u8 HighInterID);\r
+u32 gf_rtsp_unregister_interleave(GF_RTSPSession *sess, u8 LowInterID);\r
+\r
+\r
+\r
+/*\r
+                       Server side session constructor\r
+       create a new RTSP session from an existing socket in listen state. If no pending connection\r
+       is detected, return NULL\r
+*/\r
+GF_RTSPSession *gf_rtsp_session_new_server(GF_Socket *rtsp_listener);\r
+\r
+/*fetch an RTSP request. The GF_RTSPCommand will be reseted before fetch*/\r
+GF_Err gf_rtsp_get_command(GF_RTSPSession *sess, GF_RTSPCommand *com);\r
+\r
+/*unpack the URL, check the service name / server. Typically used when a client sends a \r
+ DESCRIBE || SETUP url RTSP/1.0. Server / service name check must be performed by your app as redirection\r
+or services available are unknown here.*/\r
+GF_Err gf_rtsp_load_service_name(GF_RTSPSession *sess, char *URL);\r
+\r
+/*geenrates a session ID fpor the given session*/\r
+char *gf_rtsp_generate_session_id(GF_RTSPSession *sess);\r
+\r
+/*send the RTSP response*/\r
+GF_Err gf_rtsp_send_response(GF_RTSPSession *sess, GF_RTSPResponse *rsp);\r
+\r
+/*gets the IP address of the local host running the session\r
+buffer shall be GF_MAX_IP_NAME_LEN long*/\r
+GF_Err gf_rtsp_get_session_ip(GF_RTSPSession *sess, char *buffer);\r
+\r
+/*returns the next available ID for interleaving. It is recommended that you use 2 \r
+consecutive IDs for RTP/RTCP interleaving*/\r
+u8 gf_rtsp_get_next_interleave_id(GF_RTSPSession *sess);\r
+\r
+/*gets the IP address of the connected peer - buffer shall be GF_MAX_IP_NAME_LEN long*/\r
+GF_Err gf_rtsp_get_remote_address(GF_RTSPSession *sess, char *buffer);\r
+\r
+\r
+/*\r
+               RTP LIB EXPORTS\r
+*/\r
+\r
+\r
+typedef struct tagRTP_HEADER {\r
+       /*version, must be 2*/\r
+       u8 Version;\r
+       /*padding bits in the payload*/\r
+       u8 Padding;\r
+       /*header extension is defined*/\r
+       u8 Extension;\r
+       /*number of CSRC (<=15)*/\r
+       u8 CSRCCount;\r
+       /*Marker Bit*/\r
+       u8 Marker;\r
+       /*payload type on 7 bits*/\r
+       u8 PayloadType;\r
+       /*packet seq number*/\r
+       u16 SequenceNumber;\r
+       /*packet time stamp*/\r
+       u32 TimeStamp;\r
+       /*sync source identifier*/\r
+       u32 SSRC;\r
+       /*in our basic client, CSRC should always be NULL*/\r
+       u32 CSRC[16];\r
+} GF_RTPHeader;\r
+\r
+\r
+\r
+\r
+/*\r
+       structure containing the rtpmap information\r
+*/\r
+typedef struct\r
+{\r
+       /*dynamic payload type of this map*/\r
+       u32 PayloadType;\r
+       /*registered payload name of this map*/\r
+       char *payload_name;\r
+       /*RTP clock rate (TS resolution) of this map*/\r
+       u32 ClockRate;\r
+       /*optional parameters for audio, specifying number of channels. Unused for other media types.*/\r
+       u32 AudioChannels;\r
+} GF_RTPMap;\r
+\r
+\r
+\r
+typedef struct __tag_rtp_channel GF_RTPChannel;\r
+\r
+GF_RTPChannel *gf_rtp_new();\r
+void gf_rtp_del(GF_RTPChannel *ch);\r
+\r
+/*you configure a server channel through the transport structure, with the same info as a \r
+client channel, the client_port_* info designing the REMOTE client and port_* designing\r
+your server channel*/\r
+GF_Err gf_rtp_setup_transport(GF_RTPChannel *ch, GF_RTSPTransport *trans_info, char *remote_address);\r
+\r
+/*auto-setup of rtp/rtcp transport ports - only effective in unicast, non interleaved cases. \r
+for multicast port setup MUST be done through the above gf_rtp_setup_transport function\r
+this will take care of port reuse*/\r
+GF_Err gf_rtp_set_ports(GF_RTPChannel *ch, u16 first_port);\r
+\r
+/*init of payload information. only ONE payload per sync source is supported in this\r
+version of the library (a sender cannot switch payload types on a single media)*/\r
+GF_Err gf_rtp_setup_payload(GF_RTPChannel *ch, GF_RTPMap *map);\r
+\r
+/*enables sending of NAT keep-alive packets for NAT traversal\r
+       @nat_timeout: specifies the inactivity period in ms after which NAT keepalive packets are sent. \r
+       If 0, disables NAT keep-alive packets \r
+*/\r
+void gf_rtp_enable_nat_keepalive(GF_RTPChannel *ch, u32 nat_timeout);\r
+\r
+\r
+/*initialize the RTP channel.\r
+\r
+UDPBufferSize: UDP stack buffer size if configurable by OS/ISP - ignored otherwise\r
+NOTE: on WinCE devices, this is not configurable on an app bases but for the whole OS\r
+you must update the device registry with:\r
+       [HKEY_LOCAL_MACHINE\Comm\Afd]\r
+       DgramBuffer=dword:N\r
+\r
+       where N is the number of UDP datagrams a socket should be able to buffer. For multimedia\r
+app you should set N as large as possible. The device MUST be reseted for the param to take effect\r
+\r
+ReorederingSize: max number of packets to queue for reordering. 0 means no reordering\r
+MaxReorderDelay: max time to wait in ms before releasing first packet in reoderer when only one packet is present.\r
+If 0 and reordering size is specified, defaults to 200 ms (usually enough).\r
+IsSource: if true, the channel is a sender (media data, sender report, Receiver report processing)\r
+if source, you must specify the Path MTU size. The RTP lib won't send any packet bigger than this size\r
+your application shall perform payload size splitting if needed\r
+local_interface_ip: local interface address to use for multicast. If NULL, default address is used\r
+*/\r
+GF_Err gf_rtp_initialize(GF_RTPChannel *ch, u32 UDPBufferSize, Bool IsSource, u32 PathMTU, u32 ReorederingSize, u32 MaxReorderDelay, char *local_interface_ip);\r
+\r
+/*init the RTP info after a PLAY or PAUSE, rtp_time is the rtp TimeStamp of the RTP packet\r
+with seq_num sequence number. This info is needed to compute the CurrentTime of the RTP channel \r
+ssrc may not be known if sender hasn't indicated it (use 0 then)*/\r
+GF_Err gf_rtp_set_info_rtp(GF_RTPChannel *ch, u32 seq_num, u32 rtp_time, u32 ssrc);\r
+\r
+/*retrieve current RTP time in sec. If rtp_time was unknown (not on demand media) the time is absolute.\r
+Otherwise this is the time in ms elapsed since the last PLAY range start value\r
+Not supported yet if played without RTSP (aka RTCP time not supported)*/\r
+Double gf_rtp_get_current_time(GF_RTPChannel *ch);\r
+\r
+\r
+void gf_rtp_reset_buffers(GF_RTPChannel *ch);\r
+\r
+/*read any data on UDP only (not valid for TCP). Performs re-ordering if configured for it\r
+returns amount of data read (raw UDP packet size)*/\r
+u32 gf_rtp_read_rtp(GF_RTPChannel *ch, char *buffer, u32 buffer_size);\r
+u32 gf_rtp_read_rtcp(GF_RTPChannel *ch, char *buffer, u32 buffer_size);\r
+\r
+/*decodes an RTP packet and gets the begining of the RTP payload*/\r
+GF_Err gf_rtp_decode_rtp(GF_RTPChannel *ch, char *pck, u32 pck_size, GF_RTPHeader *rtp_hdr, u32 *PayloadStart);\r
+\r
+/*decodes an RTCP packet and update timing info, send RR too*/\r
+GF_Err gf_rtp_decode_rtcp(GF_RTPChannel *ch, char *pck, u32 pck_size);\r
+\r
+/*computes and send Receiver report. If the channel is a TCP channel, you must specify\r
+the callback function. NOTE: many RTP implementation do NOT process RTCP info received on TCP...\r
+the lib will decide whether the report shall be sent or not, therefore you should call\r
+this function at regular times*/\r
+GF_Err gf_rtp_send_rtcp_report(GF_RTPChannel *ch, \r
+                                               GF_Err (*RTP_TCPCallback)(void *cbk, char *pck, u32 pck_size),\r
+                                               void *rtsp_cbk);\r
+\r
+/*send a BYE info (leaving the session)*/\r
+GF_Err gf_rtp_send_bye(GF_RTPChannel *ch,\r
+                                               GF_Err (*RTP_TCPCallback)(void *cbk, char *pck, u32 pck_size),\r
+                                               void *rtsp_cbk);\r
+\r
+\r
+/*send RTP packet*/\r
+GF_Err gf_rtp_send_packet(GF_RTPChannel *ch, GF_RTPHeader *rtp_hdr, char *extra_header, u32 extra_header_size, char *pck, u32 pck_size);\r
+\r
+enum\r
+{\r
+       GF_RTCP_INFO_NAME = 0,\r
+       GF_RTCP_INFO_EMAIL,\r
+       GF_RTCP_INFO_PHONE,\r
+       GF_RTCP_INFO_LOCATION,\r
+       GF_RTCP_INFO_TOOL,\r
+       GF_RTCP_INFO_NOTE,\r
+       GF_RTCP_INFO_PRIV\r
+};\r
+\r
+/*sets RTCP info sent in RTCP reports. info_string shall NOT exceed 255 chars*/\r
+GF_Err gf_rtp_set_info_rtcp(GF_RTPChannel *ch, u32 InfoCode, char *info_string);\r
+\r
+u32 gf_rtp_is_unicast(GF_RTPChannel *ch);\r
+u32 gf_rtp_is_interleaved(GF_RTPChannel *ch);\r
+u32 gf_rtp_get_clockrate(GF_RTPChannel *ch);\r
+u32 gf_rtp_is_active(GF_RTPChannel *ch);\r
+u8 gf_rtp_get_low_interleave_id(GF_RTPChannel *ch);\r
+u8 gf_rtp_get_hight_interleave_id(GF_RTPChannel *ch);\r
+GF_RTSPTransport *gf_rtp_get_transport(GF_RTPChannel *ch);\r
+u32 gf_rtp_get_local_ssrc(GF_RTPChannel *ch);\r
+\r
+Float gf_rtp_get_loss(GF_RTPChannel *ch);\r
+u32 gf_rtp_get_tcp_bytes_sent(GF_RTPChannel *ch);\r
+void gf_rtp_get_ports(GF_RTPChannel *ch, u16 *rtp_port, u16 *rtcp_port);\r
+\r
+\r
+\r
+\r
+       \r
+/****************************************************************************\r
+\r
+                                       SDP LIBRARY EXPORTS\r
+               \r
+                 Note: SDP is mainly a text protocol with \r
+       well defined containers. The following structures are used to write / read\r
+       SDP informations, and the library also provides consistency checking\r
+\r
+  When reading SDP, all text items/structures are allocated by the lib, and you\r
+  must call gf_sdp_info_reset(GF_SDPInfo *sdp) or gf_sdp_info_del(GF_SDPInfo *sdp) to release the memory\r
+\r
+  When writing the SDP from a GF_SDPInfo, the output buffer is allocated by the library, \r
+  and you must release it yourself\r
+\r
+  Some quick constructors are available for GF_SDPConnection and GF_SDPMedia in order to set up\r
+  some specific parameters to their default value\r
+\r
+  An extra function gf_sdp_info_check(GF_SDPInfo *sdp) is provided for compliency check \r
+  with RFC2327: all requested fields are checked as well as conflicting information forbidden\r
+  in RFC 2327\r
+****************************************************************************/\r
+\r
+/*\r
+       All attributes x-ZZZZ are considered as extensions attributes. If no "x-" is found \r
+       the attributes in the RTSP response is SKIPPED. The "x-" radical is removed in the structure\r
+       when parsing commands / responses\r
+*/\r
+typedef struct\r
+{\r
+       char *Name;\r
+       char *Value;\r
+} GF_X_Attribute;\r
+\r
+\r
+/*\r
+       Structure for bandwidth info\r
+*/\r
+typedef struct\r
+{\r
+       /*"CT", "AS" are defined. Private extensions must be "X-*" ( * "are recommended to be short")*/\r
+       char *name;\r
+       /*in kBitsPerSec*/\r
+       u32 value;\r
+} GF_SDPBandwidth;\r
+\r
+/*\r
+       Structure for Time info\r
+*/\r
+/*we do not support more than ... time offsets / zone adjustment\r
+if more are needed, RFC recommends to use several entries rather than a big*/\r
+#define GF_SDP_MAX_TIMEOFFSET  10\r
+\r
+typedef struct\r
+{\r
+       /*NPT time in sec*/\r
+       u32 StartTime;\r
+       /*if 0, session is unbound. NPT time in sec*/\r
+       u32 StopTime;\r
+       /*if 0 session is not repeated. Expressed in sec.\r
+       Session is signaled repeated every repeatInterval*/\r
+       u32 RepeatInterval;\r
+       /*active duration of the session in sec*/\r
+       u32 ActiveDuration;\r
+\r
+       /*time offsets to use with repeat. Specify a non-regular repeat time from the Start time*/\r
+       u32 OffsetFromStart[GF_SDP_MAX_TIMEOFFSET];\r
+       /*Number of offsets*/\r
+       u32 NbRepeatOffsets;\r
+\r
+       /*EX of repeat:\r
+       a session happens 3 times a week, on mon 1PM, thu 3PM and fri 10AM\r
+       1- StartTime should be NPT for the session on the very first monday, StopTime\r
+       the end of this session\r
+       2- the repeatInterval should be 1 week, ActiveDuration the length of the session\r
+       3- 3 offsets: 0 (for monday) (3*24+2)*3600 for thu and (4*24-3) for fri\r
+       */\r
+\r
+\r
+       /*timezone adjustments, to cope with #timezones, daylight saving countries and co ...\r
+       Ex: adjTime = [2882844526 2898848070] adjOffset=[-1h 0]\r
+       [0]: at 2882844526 the time base by which the session's repeat times are calculated \r
+       is shifted back by 1 hour\r
+       [1]: at time 2898848070 the session's original time base is restored\r
+       */\r
+\r
+       /*Adjustment time at which the corresponding time offset is to be applied to the \r
+       session time line (time used to compute the "repeat session"). \r
+       All Expressed in NPT*/\r
+       u32 AdjustmentTime[GF_SDP_MAX_TIMEOFFSET];\r
+       /* Offset with the session time line, ALWAYS ABSOLUTE OFFSET TO the specified StartTime*/\r
+       s32 AdjustmentOffset[GF_SDP_MAX_TIMEOFFSET];\r
+       /*Number of offsets.*/\r
+       u32 NbZoneOffsets;\r
+} GF_SDPTiming;\r
+\r
+\r
+typedef struct\r
+{\r
+       /*only "IN" currently defined*/\r
+       char *net_type;\r
+       /*"IP4","IP6"*/\r
+       char *add_type;\r
+       /*hex IPv6 address or doted IPv4 address*/\r
+       char *host;\r
+       /*TTL - MUST BE PRESENT if IP is multicast - -1 otherwise*/\r
+       s32 TTL;\r
+       /*multiple address counts - ONLY in media descriptions if needed. This\r
+       is used for content scaling, when # quality of the same media are multicasted on\r
+       # IP addresses*/\r
+       u32 add_count;\r
+} GF_SDPConnection;\r
+\r
+/*\r
+       FMTP: description of dynamic payload types. This is opaque at the SDP level.\r
+       Each attributes is assumed to be formatted as <param_name=param_val; ...>\r
+       If not the case the attribute will have an empty value string and only the\r
+       parameter name.\r
+*/\r
+typedef struct\r
+{\r
+       /*payload type of the format described*/\r
+       u32 PayloadType;\r
+       /*list of GF_X_Attribute elements. The Value field may be NULL*/\r
+       GF_List *Attributes;\r
+} GF_SDP_FMTP;\r
+\r
+typedef struct\r
+{\r
+       /*m=\r
+       0: application - 1:video - 2: audio - 3: text - 4:data - 5: control*/\r
+       u32 Type;\r
+       /*Port Number - For transports based on UDP, the value should be in the range 1024 \r
+       to 65535 inclusive. For RTP compliance it should be an even number*/\r
+       u32 PortNumber;\r
+       /*number of ports described. If >= 2, the next media(s) in the SDP will be configured\r
+       to use the next tuple (for RTP). If 0 or 1, ignored\r
+       Note: this is used for scalable media: PortNumber indicates the port of the base \r
+       media and NumPorts the ports||total number of the upper layers*/\r
+       u32 NumPorts;\r
+       /*currently ony "RTP/AVP" and "udp" defined*/\r
+       char *Profile;\r
+\r
+       /*list of GF_SDPConnection's. A media can have several connection in case of scalable content*/\r
+       GF_List *Connections;\r
+\r
+       /*RTPMaps contains a list SDPRTPMaps*/\r
+       GF_List *RTPMaps;\r
+\r
+       /*FMTP contains a list of FMTP structures*/\r
+       GF_List *FMTP;\r
+       \r
+       /*for RTP this is PayloadType, but can be opaque (string) depending on the app.\r
+       Formated as XX WW QQ FF\r
+       When reading the SDP, the payloads defined in RTPMap are removed from this list\r
+       When writing the SDP for RTP, you should only specify static payload types here,\r
+       as dynamic ones are stored in RTPMaps and automatically written*/\r
+       char *fmt_list;\r
+\r
+       /*all attributes not defined in RFC 2327 for the media*/\r
+       GF_List *Attributes;\r
+\r
+       /*Other SDP attributes for media desc*/\r
+\r
+       /*k=\r
+       method is 'clear' (key follows), 'base64' (key in base64), 'uri' (key is the URI) \r
+       or 'prompt' (key not included)*/\r
+       char *k_method, *k_key;\r
+\r
+       GF_List *Bandwidths;\r
+\r
+       /*0 if not present*/\r
+       u32 PacketTime;\r
+       /*0: none - 1: recv, 2: send, 3 both*/\r
+       u32 SendReceive;\r
+       char *orientation, *sdplang, *lang;\r
+       /*for video only, 0.0 if not present*/\r
+       Double FrameRate;\r
+       /*between 0 and 10, -1 if not present*/\r
+       s32 Quality;\r
+} GF_SDPMedia;\r
+\r
+typedef struct\r
+{\r
+       /*v=*/\r
+       u32 Version;\r
+       /*o=*/\r
+       char *o_username, *o_session_id, *o_version, *o_address;\r
+       /*"IN" for Net, "IP4" or "IP6" for address are currently valid*/\r
+       char *o_net_type, *o_add_type;\r
+\r
+       /*s=*/\r
+       char *s_session_name;\r
+       /*i=*/\r
+       char *i_description;\r
+       /*u=*/\r
+       char *u_uri;\r
+       /*e=*/\r
+       char *e_email;\r
+       /*p=*/\r
+       char *p_phone;\r
+       /*c= either 1 or 0 GF_SDPConnection */\r
+       GF_SDPConnection *c_connection; \r
+       /*b=*/\r
+       GF_List *b_bandwidth;\r
+       /*All time info (t, r, z)*/\r
+       GF_List *Timing;\r
+       /*k=\r
+       method is 'clear' (key follows), 'base64' (key in base64), 'uri' (key is the URI) \r
+       or 'prompt' (key not included)*/\r
+       char *k_method, *k_key;\r
+       /*all possible attributes (a=), session level*/\r
+       char *a_cat, *a_keywds, *a_tool;\r
+       /*0: none, 1: recv, 2: send, 3 both*/\r
+       u32 a_SendReceive;\r
+       /*should be `broadcast', `meeting', `moderated', `test' or `H332'*/\r
+       char *a_type;\r
+       char *a_charset;\r
+       char *a_sdplang, *a_lang;\r
+\r
+       /*all attributes not defined in RFC 2327 for the presentation*/\r
+       GF_List *Attributes;\r
+       \r
+       /*list of media in the SDP*/\r
+       GF_List *media_desc;\r
+} GF_SDPInfo;\r
+\r
+\r
+/*\r
+  Memory Consideration: the destructors free all non-NULL string. You should therefore \r
+  be carefull while (de-)assigning the strings. The function gf_sdp_info_parse() performs a complete \r
+  reset of the GF_SDPInfo\r
+*/\r
+/*constructor*/\r
+GF_SDPInfo *gf_sdp_info_new();\r
+/*destructor*/\r
+void gf_sdp_info_del(GF_SDPInfo *sdp);\r
+/*reset all structures (destroys substructure too)*/\r
+void gf_sdp_info_reset(GF_SDPInfo *sdp);\r
+/*Parses a memory SDP buffer*/\r
+GF_Err gf_sdp_info_parse(GF_SDPInfo *sdp, char *sdp_text, u32 text_size);\r
+/*check the consistency of the GF_SDPInfo*/\r
+GF_Err gf_sdp_info_check(GF_SDPInfo *sdp);\r
+/*write the SDP to a new buffer and returns it. Automatically checks the SDP before calling*/\r
+GF_Err gf_sdp_info_write(GF_SDPInfo *sdp, char **out_str_buf);\r
+\r
+\r
+/*\r
+       Const/dest for GF_SDPMedia\r
+*/\r
+GF_SDPMedia *gf_sdp_media_new();\r
+void gf_sdp_media_del(GF_SDPMedia *media);\r
+\r
+/*\r
+       Const/dest for GF_SDPConnection\r
+*/\r
+GF_SDPConnection *gf_sdp_conn_new();\r
+void gf_sdp_conn_del(GF_SDPConnection *conn);\r
+\r
+/*\r
+       Const/dest for SDP FMTP\r
+*/\r
+GF_SDP_FMTP *gf_sdp_fmtp_new();\r
+void gf_sdp_fmtp_del(GF_SDP_FMTP *fmtp);\r
+\r
+\r
+\r
+/*\r
+       RTP packetizer\r
+*/\r
+\r
+\r
+/*RTP<->SL mapping*/\r
+typedef struct \r
+{\r
+       /*1 - required options*/\r
+\r
+       /*mode, or "" if no mode ("generic" should be used instead)*/\r
+       char mode[30];\r
+       \r
+       /*config of the stream if carried in SDP*/\r
+       char *config;\r
+       u32 configSize;\r
+       /* Stream Type*/\r
+       u8 StreamType;\r
+       /* stream profile and level indication - for AVC/H264, 0xPPCCLL, with PP:profile, CC:compatibility, LL:level*/\r
+       u32 PL_ID;\r
+\r
+\r
+       /*2 - optional options*/\r
+       \r
+       /*size of AUs if constant*/\r
+       u32 ConstantSize;\r
+       /*duration of AUs if constant, in RTP timescale*/\r
+       u32 ConstantDuration;\r
+\r
+       /* Object Type Indication */\r
+       u8 ObjectTypeIndication;\r
+       /*audio max displacement when interleaving (eg, de-interleaving window buffer max length) in RTP timescale*/\r
+       u32 maxDisplacement;\r
+       /*de-interleaveBufferSize if not recomputable from maxDisplacement*/\r
+       u32 deinterleaveBufferSize;\r
+       \r
+       /*The number of bits on which the AU-size field is encoded in the AU-header*/\r
+       u32 SizeLength;\r
+       /*The number of bits on which the AU-Index is encoded in the first AU-header*/\r
+       u32 IndexLength;\r
+       /*The number of bits on which the AU-Index-delta field is encoded in any non-first AU-header*/\r
+       u32 IndexDeltaLength;\r
+\r
+       /*The number of bits on which the DTS-delta field is encoded in the AU-header*/\r
+       u32 DTSDeltaLength;\r
+       /*The number of bits on which the CTS-delta field is encoded in the AU-header*/\r
+       u32 CTSDeltaLength;\r
+       /*random access point flag present*/\r
+       Bool RandomAccessIndication;\r
+       \r
+       /*The number of bits on which the Stream-state field is encoded in the AU-header (systems only)*/\r
+       u32 StreamStateIndication;\r
+       /*The number of bits that is used to encode the auxiliary-data-size field \r
+       (no normative usage of this section)*/\r
+       u32 AuxiliaryDataSizeLength;\r
+\r
+       /*ISMACryp stuff*/\r
+       u8 IV_length, IV_delta_length;\r
+       u8 KI_length;\r
+\r
+       /*internal stuff*/\r
+       /*len of first AU header in an RTP payload*/\r
+       u32 auh_first_min_len;\r
+       u32 auh_min_len;\r
+} GP_RTPSLMap;\r
+       \r
+\r
+/*packetizer config flags - some flags are dynamically re-assigned when detecting multiSL / B-Frames / ...*/\r
+enum\r
+{\r
+       /*forces MPEG-4 generic transport if MPEG-4 systems mapping is available*/\r
+       GP_RTP_PCK_FORCE_MPEG4 =        (1),\r
+       /*Enables AUs concatenation in an RTP packet (if payload supports it) - this forces GP_RTP_PCK_SIGNAL_SIZE for MPEG-4*/\r
+       GP_RTP_PCK_USE_MULTI    =       (1<<1),\r
+       /*if set, audio interleaving is used if payload supports it (forces GP_RTP_PCK_USE_MULTI flag)\r
+               THIS IS CURRENTLY NOT IMPLEMENTED*/\r
+       GP_RTP_PCK_USE_INTERLEAVING =   (1<<2),\r
+       /*uses static RTP payloadID if any defined*/\r
+       GP_RTP_PCK_USE_STATIC_ID =      (1<<3),\r
+\r
+       /*MPEG-4 generic transport option*/\r
+       /*if flag set, RAP flag is signaled in RTP payload*/\r
+       GP_RTP_PCK_SIGNAL_RAP   =       (1<<4),\r
+       /*if flag set, AU indexes are signaled in RTP payload*/\r
+       GP_RTP_PCK_SIGNAL_AU_IDX        =       (1<<5),\r
+       /*if flag set, AU size is signaled in RTP payload*/\r
+       GP_RTP_PCK_SIGNAL_SIZE  =       (1<<6),\r
+       /*if flag set, CTS is signaled in RTP payload - DTS is automatically set if needed*/\r
+       GP_RTP_PCK_SIGNAL_TS    =       (1<<7),\r
+\r
+       /*setup payload for carouseling of systems streams*/\r
+       GP_RTP_PCK_AUTO_CAROUSEL = (1<<8),\r
+\r
+       /*use LATM payload for AAC-LC*/\r
+       GP_RTP_PCK_USE_LATM_AAC =       (1<<9),\r
+\r
+       /*ISMACryp options*/\r
+       /*signals that input data is selectively encrypted (eg not all input frames are encrypted) \r
+       - this is usually automatically set by hinter*/\r
+       GP_RTP_PCK_SELECTIVE_ENCRYPTION =       (1<<10),\r
+       /*signals that each sample will have its own key indicator - ignored in non-multi modes\r
+       if not set and key indicator changes, a new RTP packet will be forced*/\r
+       GP_RTP_PCK_KEY_IDX_PER_AU =     (1<<11),\r
+};\r
+\r
+\r
+\r
+/*\r
+               Generic packetization tools - used by track hinters and future live tools\r
+*/\r
+\r
+/*currently supported payload types*/\r
+enum \r
+{\r
+       /*not defined*/\r
+       GF_RTP_PAYT_UNKNOWN,\r
+       /*use generic MPEG-4 transport - RFC 3016 and RFC 3640*/\r
+       GF_RTP_PAYT_MPEG4,\r
+       /*use generic MPEG-1/2 video transport - RFC 2250*/\r
+       GF_RTP_PAYT_MPEG12_VIDEO,\r
+       /*use generic MPEG-1/2 audio transport - RFC 2250*/\r
+       GF_RTP_PAYT_MPEG12_AUDIO,\r
+       /*use H263 transport - RFC 2429*/\r
+       GF_RTP_PAYT_H263,\r
+       /*use AMR transport - RFC 3267*/\r
+       GF_RTP_PAYT_AMR,\r
+       /*use AMR-WB transport - RFC 3267*/\r
+       GF_RTP_PAYT_AMR_WB,\r
+       /*use QCELP transport - RFC 2658*/\r
+       GF_RTP_PAYT_QCELP,\r
+       /*use EVRC/SMV transport - RFC 3558*/\r
+       GF_RTP_PAYT_EVRC_SMV,\r
+       /*use 3GPP Text transport - no RFC yet, only draft*/\r
+       GF_RTP_PAYT_3GPP_TEXT,\r
+       /*use H264 transport - no RFC yet, only draft*/\r
+       GF_RTP_PAYT_H264_AVC,\r
+       /*use LATM for AAC-LC*/\r
+       GF_RTP_PAYT_LATM,\r
+       /*use 3GPP DIMS format*/\r
+       GF_RTP_PAYT_3GPP_DIMS,\r
+       /*use AC3 audio format*/\r
+       GF_RTP_PAYT_AC3,\r
+};\r
+\r
+\r
+\r
+/*\r
+       RTP packetizer\r
+*/\r
+\r
+\r
+\r
+/*\r
+               RTP -> SL packetization tool\r
+       You should ONLY modify the GF_SLHeader while packetizing, all the rest is private\r
+       to the tool.\r
+       Also note that AU start/end is automatically updated, therefore you should only\r
+       set CTS-DTS-OCR-sequenceNumber (which is automatically incremented when spliting a payload)\r
+       -padding-idle infos\r
+       SL flags are computed on the fly, but you may wish to modify them in case of \r
+       packet drop/... at the encoder side\r
+\r
+*/\r
+struct __tag_rtp_packetizer\r
+{\r
+       /*input packet sl header cfg. modify only if needed*/\r
+       GF_SLHeader sl_header;\r
+\r
+       /*\r
+       \r
+               PRIVATE _ DO NOT TOUCH\r
+       */\r
+       \r
+       /*RTP payload type (RFC type, NOT the RTP hdr payT)*/\r
+       u32 rtp_payt;\r
+       /*packetization flags*/\r
+       u32 flags;\r
+       /*Path MTU size without 12-bytes RTP header*/\r
+       u32 Path_MTU;\r
+       /*max packet duration in RTP TS*/\r
+       u32 max_ptime;\r
+\r
+       /*payload type of RTP packets - only one payload type can be used in GPAC*/\r
+       u8 PayloadType;\r
+\r
+       /*RTP header of current packet*/\r
+       GF_RTPHeader rtp_header;\r
+\r
+       /*RTP packet handling callbacks*/\r
+       void (*OnNewPacket)(void *cbk_obj, GF_RTPHeader *header);\r
+       void (*OnPacketDone)(void *cbk_obj, GF_RTPHeader *header);\r
+       void (*OnDataReference)(void *cbk_obj, u32 payload_size, u32 offset_from_orig);\r
+       void (*OnData)(void *cbk_obj, char *data, u32 data_size, Bool is_header);\r
+       void *cbk_obj;\r
+       \r
+               /*********************************\r
+                       MPEG-4 Generic hinting \r
+               *********************************/\r
+\r
+       /*SL to RTP map*/\r
+       GP_RTPSLMap slMap;\r
+       /*SL conf and state*/\r
+       GF_SLConfig sl_config;\r
+\r
+       /*set to 1 if firstSL in RTP packet*/\r
+       Bool first_sl_in_rtp;\r
+       Bool has_AU_header;\r
+       /*current info writers*/\r
+       GF_BitStream *pck_hdr, *payload;\r
+\r
+       /*AU SN of last au*/\r
+       u32 last_au_sn;\r
+\r
+       /*info for the current packet*/\r
+       u32 auh_size, bytesInPacket;\r
+\r
+               /*********************************\r
+                               ISMACryp info\r
+               *********************************/\r
+       Bool force_flush, is_encrypted;\r
+       u64 IV, first_AU_IV;\r
+       char *key_indicator;\r
+\r
+               /*********************************\r
+                               AVC-H264 info\r
+               *********************************/\r
+       /*AVC non-IDR flag: set if all NAL in current packet are non-IDR (disposable)*/\r
+       Bool avc_non_idr;\r
+\r
+               /*********************************\r
+                               AC3 info\r
+               *********************************/\r
+       /*ac3 ft flags*/\r
+       u8 ac3_ft;\r
+\r
+};\r
+\r
+/*generic rtp builder (packetizer)*/\r
+typedef struct __tag_rtp_packetizer GP_RTPPacketizer;\r
+\r
+/*creates a new builder\r
+       @hintType: hint media type, one of the above\r
+       @flags: hint flags (cf above)\r
+       @slc: user-given SL config to use. If none specified, default RFC config is used\r
+       @cbk_obj: callback object passed back in functions\r
+       @OnNewPacket: callback function starting new RTP packet\r
+               @header: rtp header for new packet - note that RTP header flags are not used until PacketDone is called\r
+       @OnPacketDone: callback function closing current RTP packet\r
+               @header: final rtp header for packet\r
+       @OnDataReference: optional, to call each time data from input buffer is added to current RTP packet. \r
+               If not set, data must be added through OnData\r
+               @payload_size: size of reference data\r
+               @offset_from_orig: start offset in input buffer\r
+       @OnData: to call each time data is added to current RTP packet (either extra data from payload or\r
+               data from input when not using referencing)\r
+               @is_head: signal the data added MUST be inserted at the begining of the payload. Otherwise data\r
+               is concatenated as received\r
+*/\r
+GP_RTPPacketizer *gf_rtp_builder_new(u32 hintType, \r
+                                               GF_SLConfig *slc, \r
+                                               u32 flags,\r
+                                               void *cbk_obj, \r
+                                               void (*OnNewPacket)(void *cbk, GF_RTPHeader *header),\r
+                                               void (*OnPacketDone)(void *cbk, GF_RTPHeader *header),\r
+                                               void (*OnDataReference)(void *cbk, u32 payload_size, u32 offset_from_orig),\r
+                                               void (*OnData)(void *cbk, char *data, u32 data_size, Bool is_head)\r
+                                       );\r
+\r
+/*destroy builder*/\r
+void gf_rtp_builder_del(GP_RTPPacketizer *builder);\r
+\r
+/*\r
+               init the builder\r
+       @MaxPayloadSize: maximum payload size of RTP packets (eg MTU minus IP/UDP/RTP headers)\r
+       @max_ptime: maximum packet duration IN RTP TIMESCALE\r
+       @StreamType: MPEG-4 system stream type - MUST always be provided for payloads format specifying \r
+               audio or video streams\r
+       @OTI : MPEG-4 system objectTypeIndication - may be 0 if stream is not mpeg4 systems\r
+\r
+                       *** all other params are for MultiSL draft ***\r
+       \r
+         @avgSize: average size of an AU. This is not always known (real-time encoding). \r
+In this case you should specify a rough compute indicating how many packets could be \r
+stored per RTP packet. for ex AAC stereo at 44100 k / 64kbps , one AU ~= 380 bytes\r
+so 3 AUs for 1500 MTU is ok - BE CAREFULL: MultiSL adds some SL info on top of the 12\r
+byte RTP header so you should specify a smaller size\r
+The packetizer will ALWAYS make sure there's no pb storing the packets so specifying \r
+more will result in a slight overhead in the SL mapping but the gain to singleSL \r
+will still be worth it.\r
+       -Nota: at init, the packetizer can decide to switch to SingleSL if the average size \r
+specified is too close to the PathMTU\r
+\r
+       @maxSize: max size of an AU. If unknown (real-time) set to 0\r
+       @avgTS: average CTS progression (1000/FPS for video)\r
+       @maxDTS: maximum DTS offset in case of bidirectional coding. \r
+       @IV_length: size (in bytes) of IV when ISMACrypted\r
+       @KI_length: size (in bytes) of key indicator when ISMACrypted\r
+       @pref_mode: MPEG-4 generic only, specifies the payload mode - can be NULL (mode generic)\r
+*/\r
+\r
+void gf_rtp_builder_init(GP_RTPPacketizer *builder, u8 PayloadType, u32 MaxPayloadSize, u32 max_ptime,\r
+                                          u32 StreamType, u32 OTI, u32 PL_ID,\r
+                                          u32 avgSize, u32 maxSize, \r
+                                          u32 avgTS, u32 maxDTS,\r
+                                          u32 IV_length, u32 KI_length,\r
+                                          char *pref_mode);\r
+\r
+/*set frame crypto info*/\r
+void gp_rtp_builder_set_cryp_info(GP_RTPPacketizer *builder, u64 IV, char *key_indicator, Bool is_encrypted);\r
+/*packetize input buffer\r
+@data, @data_size: input buffer\r
+@IsAUEnd: set to one if this buffer is the last of the AU\r
+@FullAUSize: complete access unit size if known, 0 otherwise\r
+@duration: sample duration in rtp timescale (only needed for 3GPP text streams)\r
+@descIndex: sample description index (only needed for 3GPP text streams)\r
+*/\r
+GF_Err gf_rtp_builder_process(GP_RTPPacketizer *builder, char *data, u32 data_size, u8 IsAUEnd, u32 FullAUSize, u32 duration, u8 descIndex);\r
+\r
+/*format the "fmtp: " attribute for the MPEG-4 generic packetizer. sdpline shall be at least 2000 char*/\r
+GF_Err gf_rtp_builder_format_sdp(GP_RTPPacketizer *builder, char *payload_name, char *sdpLine, char *dsi, u32 dsi_size);\r
+/*formats SDP payload name and media name - both MUST be at least 20 bytes*/\r
+Bool gf_rtp_builder_get_payload_name(GP_RTPPacketizer *builder, char *szPayloadName, char *szMediaName);\r
+\r
+\r
+\r
+\r
+\r
+/*rtp payload flags*/\r
+enum\r
+{\r
+       /*AU end was detected (eg next packet is AU start)*/\r
+       GF_RTP_NEW_AU = (1),\r
+       /*AMR config*/\r
+       GF_RTP_AMR_ALIGN = (1<<1),\r
+       /*for RFC3016, signals bitstream inspection for RAP discovery*/\r
+       GF_RTP_M4V_CHECK_RAP = (1<<2),\r
+       /*flag set when unreliable usage of the M bit is detected*/\r
+       GF_RTP_UNRELIABLE_M = (1<<3),\r
+\r
+       /*AWFULL hack at rtp level to cope with ffmpeg h264 crashes when jumping in stream without IDR*/\r
+       GF_RTP_AVC_WAIT_RAP = (1<<4),\r
+       /*ISMACryp stuff*/\r
+       GF_RTP_HAS_ISMACRYP = (1<<5),\r
+       GF_RTP_ISMA_SEL_ENC = (1<<6),\r
+       GF_RTP_ISMA_HAS_KEY_IDX = (1<<7)\r
+};\r
+\r
+/*\r
+               SL -> RTP packetization tool\r
+\r
+*/\r
+struct __tag_rtp_depacketizer\r
+{\r
+       /*depacketize routine*/\r
+       void (*depacketize)(struct __tag_rtp_depacketizer *rtp, GF_RTPHeader *hdr, char *payload, u32 size);\r
+\r
+       /*output packet sl header cfg*/\r
+       GF_SLHeader sl_hdr;\r
+\r
+       /*RTP payload type (RFC type, NOT the RTP hdr payT)*/\r
+       u32 payt;\r
+       /*depacketization flags*/\r
+       u32 flags;\r
+\r
+       /*callback routine*/\r
+       void (*on_sl_packet)(void *udta, char *payload, u32 size, GF_SLHeader *hdr, GF_Err e);\r
+       void *udta;\r
+\r
+       /*SL <-> RTP map*/\r
+       GP_RTPSLMap sl_map;\r
+       u32 clock_rate;\r
+\r
+       /*inter-packet reconstruction bitstream (for 3GP text and H264)*/\r
+       GF_BitStream *inter_bs;\r
+\r
+       /*H264/AVC config*/\r
+       u32 h264_pck_mode;\r
+       \r
+       /*3GP text reassembler state*/\r
+       u8 nb_txt_frag, cur_txt_frag, sidx, txt_len, nb_mod_frag;\r
+\r
+       /*ISMACryp*/\r
+       u32 isma_scheme;\r
+       char *key;\r
+};\r
+\r
+/*generic rtp builder (packetizer)*/\r
+typedef struct __tag_rtp_depacketizer GF_RTPDepacketizer;\r
+\r
+GF_RTPDepacketizer *gf_rtp_depacketizer_new(GF_SDPMedia *media, void (*sl_packet_cbk)(void *udta, char *payload, u32 size, GF_SLHeader *hdr, GF_Err e), void *udta);\r
+void gf_rtp_depacketizer_del(GF_RTPDepacketizer *rtp);\r
+void gf_rtp_depacketizer_reset(GF_RTPDepacketizer *rtp, Bool full_reset);\r
+void gf_rtp_depacketizer_process(GF_RTPDepacketizer *rtp, GF_RTPHeader *hdr, char *payload, u32 size);\r
+\r
+void gf_rtp_depacketizer_get_slconfig(GF_RTPDepacketizer *rtp, GF_SLConfig *sl);\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif         /*_GF_IETF_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/internal/avilib.h b/tstools/DtsEdit/src/gpac/internal/avilib.h
new file mode 100644 (file)
index 0000000..5d34594
--- /dev/null
@@ -0,0 +1,434 @@
+/*\r
+ *  avilib.h\r
+ *\r
+ *  Copyright (C) Thomas Östreich - June 2001\r
+ *  multiple audio track support Copyright (C) 2002 Thomas Östreich\r
+ *\r
+ *  Original code:\r
+ *  Copyright (C) 1999 Rainer Johanni <Rainer@Johanni.de> \r
+ *\r
+ *  This file is part of transcode, a linux video stream processing tool\r
+ *      \r
+ *  transcode is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  transcode is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_AVILIB_H_\r
+#define _GF_AVILIB_H_\r
+\r
+#include <gpac/tools.h>\r
+\r
+#define AVI_MAX_TRACKS 8\r
+\r
+typedef struct\r
+{\r
+  u64 key;\r
+  u64 pos;\r
+  u64 len;\r
+} video_index_entry;\r
+\r
+typedef struct\r
+{\r
+   u64 pos;\r
+   u64 len;\r
+   u64 tot;\r
+} audio_index_entry;\r
+\r
+\r
+// Index types\r
+\r
+\r
+#define AVI_INDEX_OF_INDEXES 0x00             // when each entry in aIndex\r
+                                              // array points to an index chunk\r
+#define AVI_INDEX_OF_CHUNKS  0x01             // when each entry in aIndex\r
+                                              // array points to a chunk in the file\r
+#define AVI_INDEX_IS_DATA    0x80             // when each entry is aIndex is\r
+                                              // really the data\r
+// bIndexSubtype codes for INDEX_OF_CHUNKS\r
+//\r
+#define AVI_INDEX_2FIELD     0x01             // when fields within frames\r
+                                              // are also indexed\r
+\r
+\r
+\r
+typedef struct _avisuperindex_entry {\r
+    u64 qwOffset;           // absolute file offset\r
+    u32 dwSize;                  // size of index chunk at this offset\r
+    u32 dwDuration;              // time span in stream ticks\r
+} avisuperindex_entry;\r
+\r
+typedef struct _avistdindex_entry {\r
+    u32 dwOffset;                // qwBaseOffset + this is absolute file offset\r
+    u32 dwSize;                  // bit 31 is set if this is NOT a keyframe\r
+} avistdindex_entry;\r
+\r
+// Standard index \r
+typedef struct _avistdindex_chunk {\r
+    char           fcc[4];                 // ix##\r
+    u32 dwSize;                 // size of this chunk\r
+    u16 wLongsPerEntry;         // must be sizeof(aIndex[0])/sizeof(DWORD)\r
+    u8  bIndexSubType;          // must be 0\r
+    u8  bIndexType;             // must be AVI_INDEX_OF_CHUNKS\r
+    u32  nEntriesInUse;          //\r
+    char           dwChunkId[4];           // '##dc' or '##db' or '##wb' etc..\r
+    u64 qwBaseOffset;       // all dwOffsets in aIndex array are relative to this\r
+    u32  dwReserved3;            // must be 0\r
+    avistdindex_entry *aIndex;\r
+} avistdindex_chunk;\r
+    \r
+\r
+// Base Index Form 'indx'\r
+typedef struct _avisuperindex_chunk {\r
+    char           fcc[4];\r
+    u32  dwSize;                 // size of this chunk\r
+    u16 wLongsPerEntry;         // size of each entry in aIndex array (must be 8 for us)\r
+    u8  bIndexSubType;          // future use. must be 0\r
+    u8 bIndexType;             // one of AVI_INDEX_* codes\r
+    u32 nEntriesInUse;          // index of first unused member in aIndex array\r
+    char           dwChunkId[4];           // fcc of what is indexed\r
+    u32 dwReserved[3];          // meaning differs for each index type/subtype.\r
+                                           // 0 if unused\r
+    avisuperindex_entry *aIndex;           // where are the ix## chunks\r
+    avistdindex_chunk **stdindex;          // the ix## chunks itself (array)\r
+} avisuperindex_chunk;\r
+    \r
+\r
+\r
+typedef struct track_s\r
+{\r
+\r
+    long   a_fmt;             /* Audio format, see #defines below */\r
+    long   a_chans;           /* Audio channels, 0 for no audio */\r
+    long   a_rate;            /* Rate in Hz */\r
+    long   a_bits;            /* bits per audio sample */\r
+    long   mp3rate;           /* mp3 bitrate kbs*/\r
+    long   a_vbr;             /* 0 == no Variable BitRate */\r
+    long   padrate;          /* byte rate used for zero padding */\r
+\r
+    long   audio_strn;        /* Audio stream number */\r
+    u64  audio_bytes;       /* Total number of bytes of audio data */\r
+    long   audio_chunks;      /* Chunks of audio data in the file */\r
+\r
+    char   audio_tag[4];      /* Tag of audio data */\r
+    long   audio_posc;        /* Audio position: chunk */\r
+    long   audio_posb;        /* Audio position: byte within chunk */\r
\r
+    u64  a_codech_off;       /* absolut offset of audio codec information */ \r
+    u64  a_codecf_off;       /* absolut offset of audio codec information */ \r
+\r
+    audio_index_entry *audio_index;\r
+    avisuperindex_chunk *audio_superindex;\r
+\r
+} track_t;\r
+\r
+typedef struct\r
+{\r
+  u32  bi_size;\r
+  u32  bi_width;\r
+  u32  bi_height;\r
+  u16  bi_planes;\r
+  u16  bi_bit_count;\r
+  u32  bi_compression;\r
+  u32  bi_size_image;\r
+  u32  bi_x_pels_per_meter;\r
+  u32  bi_y_pels_per_meter;\r
+  u32  bi_clr_used;\r
+  u32  bi_clr_important;\r
+} alBITMAPINFOHEADER;\r
+\r
+typedef struct\r
+{\r
+  u16  w_format_tag;\r
+  u16  n_channels;\r
+  u32  n_samples_per_sec;\r
+  u32  n_avg_bytes_per_sec;\r
+  u16  n_block_align;\r
+  u16  w_bits_per_sample;\r
+  u16  cb_size;\r
+} alWAVEFORMATEX;\r
+\r
+typedef struct\r
+{\r
+  u32 fcc_type; \r
+  u32 fcc_handler; \r
+  u32 dw_flags; \r
+  u32 dw_caps; \r
+  u16 w_priority;\r
+  u16 w_language;\r
+  u32 dw_scale;\r
+  u32 dw_rate;\r
+  u32 dw_start;\r
+  u32 dw_length;\r
+  u32 dw_initial_frames;\r
+  u32 dw_suggested_buffer_size;\r
+  u32 dw_quality;\r
+  u32 dw_sample_size;\r
+  u16 dw_left;\r
+  u16 dw_top;\r
+  u16 dw_right;\r
+  u16 dw_bottom;\r
+} alAVISTREAMHEADER;\r
+\r
+typedef struct\r
+{\r
+  \r
+  FILE *fdes;              /* File descriptor of AVI file */\r
+  long   mode;              /* 0 for reading, 1 for writing */\r
+  \r
+  long   width;             /* Width  of a video frame */\r
+  long   height;            /* Height of a video frame */\r
+  double fps;               /* Frames per second */\r
+  char   compressor[8];     /* Type of compressor, 4 bytes + padding for 0 byte */\r
+  char   compressor2[8];     /* Type of compressor, 4 bytes + padding for 0 byte */\r
+  u32   video_strn;        /* Video stream number */\r
+  long   video_frames;      /* Number of video frames */\r
+  char   video_tag[4];      /* Tag of video data */\r
+  long   video_pos;         /* Number of next frame to be read\r
+                              (if index present) */\r
+  alAVISTREAMHEADER video_stream_header;\r
+  \r
+  u32 max_len;    /* maximum video chunk present */\r
+  \r
+  track_t track[AVI_MAX_TRACKS];  // up to AVI_MAX_TRACKS audio tracks supported\r
+  \r
+  s64  pos;               /* position in file */\r
+  long   n_idx;             /* number of index entries actually filled */\r
+  long   max_idx;           /* number of index entries actually allocated */\r
+  \r
+  s64  v_codech_off;      /* absolut offset of video codec (strh) info */ \r
+  s64  v_codecf_off;      /* absolut offset of video codec (strf) info */ \r
+  \r
+  u8 (*idx)[16]; /* index entries (AVI idx1 tag) */\r
+\r
+  video_index_entry *video_index;\r
+  avisuperindex_chunk *video_superindex;  /* index of indices */\r
+  int is_opendml;           /* set to 1 if this is an odml file with multiple index chunks */\r
+  \r
+  s64  last_pos;          /* Position of last frame written */\r
+  u32 last_len;   /* Length of last frame written */\r
+  int must_use_index;       /* Flag if frames are duplicated */\r
+  s64  movi_start;\r
+  int total_frames;         /* total number of frames if dmlh is present */\r
+  \r
+  u32 anum;            // total number of audio tracks \r
+  u32 aptr;            // current audio working track \r
+  char *index_file;    // read the avi index from this file\r
+  \r
+  alBITMAPINFOHEADER *bitmap_info_header;\r
+  alWAVEFORMATEX *wave_format_ex[AVI_MAX_TRACKS];\r
+  alAVISTREAMHEADER stream_headers[AVI_MAX_TRACKS];\r
+\r
+  void*                extradata;\r
+  unsigned long        extradata_size;\r
+} avi_t;\r
+\r
+#define AVI_MODE_WRITE  0\r
+#define AVI_MODE_READ   1\r
+\r
+/* The error codes delivered by avi_open_input_file */\r
+\r
+#define AVI_ERR_SIZELIM      1     /* The write of the data would exceed\r
+                                      the maximum size of the AVI file.\r
+                                      This is more a warning than an error\r
+                                      since the file may be closed safely */\r
+\r
+#define AVI_ERR_OPEN         2     /* Error opening the AVI file - wrong path\r
+                                      name or file nor readable/writable */\r
+\r
+#define AVI_ERR_READ         3     /* Error reading from AVI File */\r
+\r
+#define AVI_ERR_WRITE        4     /* Error writing to AVI File,\r
+                                      disk full ??? */\r
+\r
+#define AVI_ERR_WRITE_INDEX  5     /* Could not write index to AVI file\r
+                                      during close, file may still be\r
+                                      usable */\r
+\r
+#define AVI_ERR_CLOSE        6     /* Could not write header to AVI file\r
+                                      or not truncate the file during close,\r
+                                      file is most probably corrupted */\r
+\r
+#define AVI_ERR_NOT_PERM     7     /* Operation not permitted:\r
+                                      trying to read from a file open\r
+                                      for writing or vice versa */\r
+\r
+#define AVI_ERR_NO_MEM       8     /* malloc failed */\r
+\r
+#define AVI_ERR_NO_AVI       9     /* Not an AVI file */\r
+\r
+#define AVI_ERR_NO_HDRL     10     /* AVI file has no has no header list,\r
+                                      corrupted ??? */\r
+\r
+#define AVI_ERR_NO_MOVI     11     /* AVI file has no has no MOVI list,\r
+                                      corrupted ??? */\r
+\r
+#define AVI_ERR_NO_VIDS     12     /* AVI file contains no video data */\r
+\r
+#define AVI_ERR_NO_IDX      13     /* The file has been opened with\r
+                                      getIndex==0, but an operation has been\r
+                                      performed that needs an index */\r
+\r
+/* Possible Audio formats */\r
+\r
+#ifndef WAVE_FORMAT_PCM\r
+#define WAVE_FORMAT_UNKNOWN             (0x0000)\r
+#ifndef WAVE_FORMAT_PCM\r
+#define WAVE_FORMAT_PCM                 (0x0001)\r
+#endif\r
+#define WAVE_FORMAT_ADPCM               (0x0002)\r
+#define WAVE_FORMAT_IBM_CVSD            (0x0005)\r
+#define WAVE_FORMAT_ALAW                (0x0006)\r
+#define WAVE_FORMAT_MULAW               (0x0007)\r
+#define WAVE_FORMAT_OKI_ADPCM           (0x0010)\r
+#define WAVE_FORMAT_DVI_ADPCM           (0x0011)\r
+#define WAVE_FORMAT_DIGISTD             (0x0015)\r
+#define WAVE_FORMAT_DIGIFIX             (0x0016)\r
+#define WAVE_FORMAT_YAMAHA_ADPCM        (0x0020)\r
+#define WAVE_FORMAT_DSP_TRUESPEECH      (0x0022)\r
+#define WAVE_FORMAT_GSM610              (0x0031)\r
+#define IBM_FORMAT_MULAW                (0x0101)\r
+#define IBM_FORMAT_ALAW                 (0x0102)\r
+#define IBM_FORMAT_ADPCM                (0x0103)\r
+#endif\r
+\r
+avi_t* AVI_open_output_file(char * filename);\r
+void AVI_set_video(avi_t *AVI, int width, int height, double fps, char *compressor);\r
+void AVI_set_audio(avi_t *AVI, int channels, long rate, int bits, int format, long mp3rate);\r
+int  AVI_write_frame(avi_t *AVI, char *data, long bytes, int keyframe);\r
+int  AVI_dup_frame(avi_t *AVI);\r
+int  AVI_write_audio(avi_t *AVI, char *data, long bytes);\r
+int  AVI_append_audio(avi_t *AVI, char *data, long bytes);\r
+u64 AVI_bytes_remain(avi_t *AVI);\r
+int  AVI_close(avi_t *AVI);\r
+u64 AVI_bytes_written(avi_t *AVI);\r
+\r
+avi_t *AVI_open_input_file(char *filename, int getIndex);\r
+avi_t *AVI_open_input_indexfile(char *filename, int getIndex, char *indexfile);\r
+avi_t *AVI_open_fd(FILE *fd, int getIndex);\r
+avi_t *AVI_open_indexfd(FILE *fd, int getIndex, char *indexfile);\r
+int avi_parse_input_file(avi_t *AVI, int getIndex);\r
+int avi_parse_index_from_file(avi_t *AVI, char *filename);\r
+long AVI_audio_mp3rate(avi_t *AVI);\r
+long AVI_audio_padrate(avi_t *AVI);\r
+long AVI_video_frames(avi_t *AVI);\r
+int  AVI_video_width(avi_t *AVI);\r
+int  AVI_video_height(avi_t *AVI);\r
+double AVI_frame_rate(avi_t *AVI);\r
+char* AVI_video_compressor(avi_t *AVI);\r
+\r
+int  AVI_audio_channels(avi_t *AVI);\r
+int  AVI_audio_bits(avi_t *AVI);\r
+int  AVI_audio_format(avi_t *AVI);\r
+long AVI_audio_rate(avi_t *AVI);\r
+u64 AVI_audio_bytes(avi_t *AVI);\r
+long AVI_audio_chunks(avi_t *AVI);\r
+int  AVI_can_read_audio(avi_t *AVI);\r
+\r
+long AVI_max_video_chunk(avi_t *AVI);\r
+\r
+long AVI_frame_size(avi_t *AVI, long frame);\r
+long AVI_audio_size(avi_t *AVI, long frame);\r
+int  AVI_seek_start(avi_t *AVI);\r
+int  AVI_set_video_position(avi_t *AVI, long frame);\r
+u64 AVI_get_video_position(avi_t *AVI, long frame);\r
+long AVI_read_frame(avi_t *AVI, char *vidbuf, int *keyframe);\r
+\r
+int  AVI_set_audio_position(avi_t *AVI, long byte);\r
+int  AVI_set_audio_bitrate(avi_t *AVI, long bitrate);\r
+\r
+long AVI_get_audio_position_index(avi_t *AVI);\r
+int  AVI_set_audio_position_index(avi_t *AVI, long indexpos);\r
+\r
+long AVI_read_audio(avi_t *AVI, char *audbuf, long bytes, int *continuous);\r
+\r
+int  AVI_read_data(avi_t *AVI, char *vidbuf, long max_vidbuf,\r
+                               char *audbuf, long max_audbuf,\r
+                               long *len);\r
+\r
+int AVI_scan(char *name);\r
+int AVI_dump(char *name, int mode);\r
+\r
+char *AVI_codec2str(short cc);\r
+int AVI_file_check(char *import_file);\r
+\r
+void AVI_info(avi_t *avifile);\r
+u64 AVI_max_size(void);\r
+int avi_update_header(avi_t *AVI);\r
+\r
+int AVI_set_audio_track(avi_t *AVI, u32 track);\r
+int AVI_get_audio_track(avi_t *AVI);\r
+int AVI_audio_tracks(avi_t *AVI);\r
+\r
+void AVI_set_audio_vbr(avi_t *AVI, long is_vbr);\r
+long AVI_get_audio_vbr(avi_t *AVI);\r
+\r
+void AVI_set_comment_fd(avi_t *AVI, int fd);\r
+int  AVI_get_comment_fd(avi_t *AVI);\r
+\r
+struct riff_struct \r
+{\r
+  u8 id[4];   /* RIFF */\r
+  u32 len;\r
+  u8 wave_id[4]; /* WAVE */\r
+};\r
+\r
+\r
+struct chunk_struct \r
+{\r
+       u8 id[4];\r
+       u32 len;\r
+};\r
+\r
+struct common_struct \r
+{\r
+       u16 wFormatTag;\r
+       u16 wChannels;\r
+       u32 dwSamplesPerSec;\r
+       u32 dwAvgBytesPerSec;\r
+       u16 wBlockAlign;\r
+       u16 wBitsPerSample;  /* Only for PCM */\r
+};\r
+\r
+struct wave_header \r
+{\r
+       struct riff_struct   riff;\r
+       struct chunk_struct  format;\r
+       struct common_struct common;\r
+       struct chunk_struct  data;\r
+};\r
+\r
+// Simple WAV IO\r
+int AVI_read_wave_header( int fd, struct wave_header * wave );\r
+int AVI_write_wave_header( int fd, const struct wave_header * wave );\r
+size_t AVI_read_wave_pcm_data( int fd, void * buffer, size_t buflen );\r
+size_t AVI_write_wave_pcm_data( int fd, const void * buffer, size_t buflen );\r
+\r
+\r
+struct AVIStreamHeader {\r
+  long  fccType;\r
+  long  fccHandler;\r
+  long  dwFlags;\r
+  long  dwPriority;\r
+  long  dwInitialFrames;\r
+  long  dwScale;\r
+  long  dwRate;\r
+  long  dwStart;\r
+  long  dwLength;\r
+  long  dwSuggestedBufferSize;\r
+  long  dwQuality;\r
+  long  dwSampleSize;\r
+};\r
+\r
+#endif /*_GF_AVILIB_H_*/\r
diff --git a/tstools/DtsEdit/src/gpac/internal/bifs_dev.h b/tstools/DtsEdit/src/gpac/internal/bifs_dev.h
new file mode 100644 (file)
index 0000000..a053a11
--- /dev/null
@@ -0,0 +1,223 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / BIFS codec sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+\r
+#ifndef _GF_BIFS_DEV_H_\r
+#define _GF_BIFS_DEV_H_\r
+\r
+\r
+#include <gpac/nodes_mpeg4.h>\r
+#include <gpac/bitstream.h>\r
+#include <gpac/bifs.h>\r
+#include <gpac/thread.h>\r
+#include <gpac/internal/scenegraph_dev.h>\r
+\r
+typedef struct {\r
+       /*node this mask is for*/\r
+       GF_Node *node;\r
+       /*in case node is not defined yet*/\r
+       u32 node_id;\r
+       /*the rest is not needed at the current time, we only support simple sugnaling for FDP, BDP and IFS2D\r
+       which are using pre-defs masks*/\r
+} BIFSElementaryMask;\r
+\r
+typedef struct\r
+{\r
+       /*v1 or v2*/\r
+       u8 version;\r
+       /*BIFS config - common fields*/\r
+       u16 NodeIDBits;\r
+       u16 RouteIDBits;\r
+       Bool PixelMetrics;\r
+       /*set to 0, 0 if no size is specified*/\r
+       u16 Width, Height;\r
+\r
+       /*BIFS-Anim - not supported */\r
+       /*if 1 the BIFS_Anim codec is reset at each intra frame*/\r
+       Bool BAnimRAP;\r
+       /*list of elementary masks for BIFS anim*/\r
+       GF_List *elementaryMasks;\r
+\r
+       /*BIFS v2 add-on*/\r
+       Bool Use3DMeshCoding;\r
+       Bool UsePredictiveMFField;\r
+       u16 ProtoIDBits;\r
+} BIFSConfig;\r
+\r
+\r
+\r
+/*per_stream config support*/\r
+typedef struct \r
+{\r
+       BIFSConfig config;\r
+       u16 ESID;\r
+} BIFSStreamInfo;\r
+\r
+/*per_stream config support*/\r
+typedef struct \r
+{\r
+       GF_Node *node;\r
+       SFCommandBuffer *cb;\r
+} CommandBufferItem;\r
+\r
+\r
+struct __tag_bifs_dec\r
+{\r
+       GF_Err LastError;\r
+       /*all attached streams*/\r
+       GF_List *streamInfo;\r
+       /*active stream*/\r
+       BIFSStreamInfo *info;\r
+\r
+       Bool UseName;\r
+\r
+       GF_SceneGraph *scenegraph;\r
+       /*modified during conditional execution / proto parsing*/\r
+       GF_SceneGraph *current_graph;\r
+\r
+       /*Quantization*/\r
+       /*QP stack*/\r
+       GF_List *QPs;\r
+       /*active QP*/\r
+       M_QuantizationParameter *ActiveQP;\r
+\r
+       /*QP 14 stuff: we need to store the last numb of fields in the last received Coord //field (!!!)*/\r
+       \r
+       /*number of iten in the Coord field*/\r
+       u32 NumCoord;\r
+       Bool coord_stored, storing_coord;\r
+\r
+       /*only set at SceneReplace during proto parsing, NULL otherwise*/\r
+       GF_Proto *pCurrentProto;\r
+\r
+       /*when set the decoder works with commands rather than modifying the scene graph directly*/\r
+       Bool dec_memory_mode;\r
+       Bool force_keep_qp;\r
+       /*only set in mem mode. Conditionals/InputSensors are stacked while decoding, then decoded once the AU is decoded\r
+       to make sure all nodes potentially used by the conditional command buffer are created*/\r
+       GF_List *command_buffers;\r
+\r
+       Bool ignore_size;\r
+       Bool is_com_dec;\r
+       Double cts_offset;\r
+};\r
+\r
+\r
+/*decodes an GF_Node*/\r
+GF_Node *gf_bifs_dec_node(GF_BifsDecoder * codec, GF_BitStream *bs, u32 NDT_Tag);\r
+/*decodes an SFField (to get a ptr to the field, use gf_node_get_field )\r
+the FieldIndex is used for Quantzation*/\r
+GF_Err gf_bifs_dec_sf_field(GF_BifsDecoder * codec, GF_BitStream *bs, GF_Node *node, GF_FieldInfo *field);\r
+/*decodes a Field (either SF or MF). The field MUST BE EMPTY*/\r
+GF_Err gf_bifs_dec_field(GF_BifsDecoder * codec, GF_BitStream *bs, GF_Node *node, GF_FieldInfo *field);\r
+/*decodes a route*/\r
+GF_Err gf_bifs_dec_route(GF_BifsDecoder * codec, GF_BitStream *bs, Bool is_insert);\r
+/*get name*/\r
+void gf_bifs_dec_name(GF_BitStream *bs, char *name);\r
+\r
+BIFSStreamInfo *gf_bifs_dec_get_stream(GF_BifsDecoder * codec, u16 ESID);\r
+/*decodes a BIFS command frame*/\r
+GF_Err gf_bifs_dec_command(GF_BifsDecoder * codec, GF_BitStream *bs);\r
+/*decodes proto list - if proto_list is not NULL, protos parsed are not registered with the parent graph\r
+and added to the list*/\r
+GF_Err gf_bifs_dec_proto_list(GF_BifsDecoder * codec, GF_BitStream *bs, GF_List *proto_list);\r
+/*decodes field(s) of a node - exported for MultipleReplace*/\r
+GF_Err gf_bifs_dec_node_list(GF_BifsDecoder * codec, GF_BitStream *bs, GF_Node *node, Bool is_proto);\r
+GF_Err gf_bifs_dec_node_mask(GF_BifsDecoder * codec, GF_BitStream *bs, GF_Node *node, Bool is_proto);\r
+\r
+/*called once a field has been modified through a command, send eventOut or propagate eventIn if needed*/\r
+void gf_bifs_check_field_change(GF_Node *node, GF_FieldInfo *field);\r
+\r
+GF_Err gf_bifs_flush_command_list(GF_BifsDecoder *codec);\r
+\r
+struct __tag_bifs_enc\r
+{\r
+       GF_Err LastError;\r
+       /*all attached streams*/\r
+       GF_List *streamInfo;\r
+       /*active stream*/\r
+       BIFSStreamInfo *info;\r
+\r
+       Bool UseName;\r
+\r
+       /*the scene graph the codec is encoding (set htrough ReplaceScene or manually)*/\r
+       GF_SceneGraph *scene_graph;\r
+       /*current proto graph for DEF/USE*/\r
+       GF_SceneGraph *current_proto_graph;\r
+\r
+       /*Quantization*/\r
+       /*QP stack*/\r
+       GF_List *QPs;\r
+       /*active QP*/\r
+       M_QuantizationParameter *ActiveQP;\r
+\r
+       u32 NumCoord;\r
+       Bool coord_stored, storing_coord;\r
+\r
+       GF_Proto *encoding_proto;\r
+\r
+       /*keep track of DEF/USE*/\r
+       GF_List *encoded_nodes;\r
+       Bool is_encoding_command;\r
+};\r
+\r
+GF_Err gf_bifs_enc_commands(GF_BifsEncoder *codec, GF_List *comList, GF_BitStream *bs);\r
+\r
+GF_Err gf_bifs_enc_node(GF_BifsEncoder * codec, GF_Node *node, u32 NDT_Tag, GF_BitStream *bs);\r
+GF_Err gf_bifs_enc_sf_field(GF_BifsEncoder *codec, GF_BitStream *bs, GF_Node *node, GF_FieldInfo *field);\r
+GF_Err gf_bifs_enc_field(GF_BifsEncoder * codec, GF_BitStream *bs, GF_Node *node, GF_FieldInfo *field);\r
+GF_Err gf_bifs_enc_mf_field(GF_BifsEncoder *codec, GF_BitStream *bs, GF_Node *node, GF_FieldInfo *field);\r
+GF_Err gf_bifs_enc_route(GF_BifsEncoder *codec, GF_Route *r, GF_BitStream *bs);\r
+void gf_bifs_enc_name(GF_BifsEncoder *codec, GF_BitStream *bs, char *name);\r
+GF_Node *gf_bifs_enc_find_node(GF_BifsEncoder *codec, u32 nodeID);\r
+\r
+#define GF_BIFS_WRITE_INT(codec, bs, val, nbBits, str, com)    {\\r
+               gf_bs_write_int(bs, val, nbBits);       \\r
+               GF_LOG(GF_LOG_DEBUG, GF_LOG_CODING, ("[BIFS] %s\t\t%d\t\t%d\t\t%s\n", str, nbBits, val, com ? com : "") );      \\r
+       } \\r
+\r
+GF_Route *gf_bifs_enc_is_field_ised(GF_BifsEncoder *codec, GF_Node *node, u32 fieldIndex);\r
+\r
+/*get field QP and anim info*/\r
+Bool gf_bifs_get_aq_info(GF_Node *Node, u32 FieldIndex, u8 *QType, u8 *AType, Fixed *b_min, Fixed *b_max, u32 *QT13_bits);\r
+\r
+/*get the absolute field 0_based index (or ALL mode) given the field index in IndexMode*/\r
+GF_Err gf_bifs_get_field_index(GF_Node *Node, u32 inField, u8 IndexMode, u32 *allField);\r
+\r
+/*returns the opaque NodeDataType of the node "children" field if any, or 0*/\r
+u32 gf_bifs_get_child_table(GF_Node *Node);\r
+\r
+/*returns binary type of node in the given version of the desired NDT*/\r
+u32 gf_bifs_get_node_type(u32 NDT_Tag, u32 NodeTag, u32 Version);\r
+\r
+/*converts field index from all_mode to given mode*/\r
+GF_Err gf_bifs_field_index_by_mode(GF_Node *node, u32 all_ind, u8 indexMode, u32 *outField);\r
+\r
+/*return number of bits needed to code all nodes present in the specified NDT*/\r
+u32 gf_bifs_get_ndt_bits(u32 NDT_Tag, u32 Version);\r
+/*return absolute node tag given its type in the NDT and the NDT version number*/\r
+u32 gf_bifs_ndt_get_node_type(u32 NDT_Tag, u32 NodeType, u32 Version);\r
+\r
+#endif //_GF_BIFS_DEV_H_\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/internal/bifs_tables.h b/tstools/DtsEdit/src/gpac/internal/bifs_tables.h
new file mode 100644 (file)
index 0000000..f642d23
--- /dev/null
@@ -0,0 +1,661 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / BIFS codec sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *\r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.        \r
+ *\r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.\r
+ *\r
+ */\r
+\r
+\r
+/*\r
+       DO NOT MOFIFY - File generated on GMT Thu Aug 07 11:43:26 2008\r
+\r
+       BY MPEG4Gen for GPAC Version 0.4.5-DEV\r
+*/\r
+\r
+#ifndef _NDT_H\r
+#define _NDT_H\r
+\r
+#include <gpac/nodes_mpeg4.h>\r
+\r
+\r
+\r
+u32 ALL_GetNodeType(const u32 *table, const u32 count, u32 NodeTag, u32 Version);\r
+\r
+\r
+\r
+/* NDT BIFS Version 1 */\r
+\r
+#define SFWorldNode_V1_NUMBITS         7\r
+#define SFWorldNode_V1_Count   100\r
+\r
+static const u32 SFWorldNode_V1_TypeToTag[100] = {\r
+ TAG_MPEG4_Anchor, TAG_MPEG4_AnimationStream, TAG_MPEG4_Appearance, TAG_MPEG4_AudioBuffer, TAG_MPEG4_AudioClip, TAG_MPEG4_AudioDelay, TAG_MPEG4_AudioFX, TAG_MPEG4_AudioMix, TAG_MPEG4_AudioSource, TAG_MPEG4_AudioSwitch, TAG_MPEG4_Background, TAG_MPEG4_Background2D, TAG_MPEG4_Billboard, TAG_MPEG4_Bitmap, TAG_MPEG4_Box, TAG_MPEG4_Circle, TAG_MPEG4_Collision, TAG_MPEG4_Color, TAG_MPEG4_ColorInterpolator, TAG_MPEG4_CompositeTexture2D, TAG_MPEG4_CompositeTexture3D, TAG_MPEG4_Conditional, TAG_MPEG4_Cone, TAG_MPEG4_Coordinate, TAG_MPEG4_Coordinate2D, TAG_MPEG4_CoordinateInterpolator, TAG_MPEG4_CoordinateInterpolator2D, TAG_MPEG4_Curve2D, TAG_MPEG4_Cylinder, TAG_MPEG4_CylinderSensor, TAG_MPEG4_DirectionalLight, TAG_MPEG4_DiscSensor, TAG_MPEG4_ElevationGrid, TAG_MPEG4_Expression, TAG_MPEG4_Extrusion, TAG_MPEG4_Face, TAG_MPEG4_FaceDefMesh, TAG_MPEG4_FaceDefTables, TAG_MPEG4_FaceDefTransform, TAG_MPEG4_FAP, TAG_MPEG4_FDP, TAG_MPEG4_FIT, TAG_MPEG4_Fog, TAG_MPEG4_FontStyle, TAG_MPEG4_Form, TAG_MPEG4_Group, TAG_MPEG4_ImageTexture, TAG_MPEG4_IndexedFaceSet, TAG_MPEG4_IndexedFaceSet2D, TAG_MPEG4_IndexedLineSet, TAG_MPEG4_IndexedLineSet2D, TAG_MPEG4_Inline, TAG_MPEG4_LOD, TAG_MPEG4_Layer2D, TAG_MPEG4_Layer3D, TAG_MPEG4_Layout, TAG_MPEG4_LineProperties, TAG_MPEG4_ListeningPoint, TAG_MPEG4_Material, TAG_MPEG4_Material2D, TAG_MPEG4_MovieTexture, TAG_MPEG4_NavigationInfo, TAG_MPEG4_Normal, TAG_MPEG4_NormalInterpolator, TAG_MPEG4_OrderedGroup, TAG_MPEG4_OrientationInterpolator, TAG_MPEG4_PixelTexture, TAG_MPEG4_PlaneSensor, TAG_MPEG4_PlaneSensor2D, TAG_MPEG4_PointLight, TAG_MPEG4_PointSet, TAG_MPEG4_PointSet2D, TAG_MPEG4_PositionInterpolator, TAG_MPEG4_PositionInterpolator2D, TAG_MPEG4_ProximitySensor2D, TAG_MPEG4_ProximitySensor, TAG_MPEG4_QuantizationParameter, TAG_MPEG4_Rectangle, TAG_MPEG4_ScalarInterpolator, TAG_MPEG4_Script, TAG_MPEG4_Shape, TAG_MPEG4_Sound, TAG_MPEG4_Sound2D, TAG_MPEG4_Sphere, TAG_MPEG4_SphereSensor, TAG_MPEG4_SpotLight, TAG_MPEG4_Switch, TAG_MPEG4_TermCap, TAG_MPEG4_Text, TAG_MPEG4_TextureCoordinate, TAG_MPEG4_TextureTransform, TAG_MPEG4_TimeSensor, TAG_MPEG4_TouchSensor, TAG_MPEG4_Transform, TAG_MPEG4_Transform2D, TAG_MPEG4_Valuator, TAG_MPEG4_Viewpoint, TAG_MPEG4_VisibilitySensor, TAG_MPEG4_Viseme, TAG_MPEG4_WorldInfo\r
+};\r
+\r
+#define SF3DNode_V1_NUMBITS            6\r
+#define SF3DNode_V1_Count      52\r
+\r
+static const u32 SF3DNode_V1_TypeToTag[52] = {\r
+ TAG_MPEG4_Anchor, TAG_MPEG4_AnimationStream, TAG_MPEG4_Background, TAG_MPEG4_Background2D, TAG_MPEG4_Billboard, TAG_MPEG4_Collision, TAG_MPEG4_ColorInterpolator, TAG_MPEG4_Conditional, TAG_MPEG4_CoordinateInterpolator, TAG_MPEG4_CoordinateInterpolator2D, TAG_MPEG4_CylinderSensor, TAG_MPEG4_DirectionalLight, TAG_MPEG4_DiscSensor, TAG_MPEG4_Face, TAG_MPEG4_Fog, TAG_MPEG4_Form, TAG_MPEG4_Group, TAG_MPEG4_Inline, TAG_MPEG4_LOD, TAG_MPEG4_Layer2D, TAG_MPEG4_Layer3D, TAG_MPEG4_Layout, TAG_MPEG4_ListeningPoint, TAG_MPEG4_NavigationInfo, TAG_MPEG4_NormalInterpolator, TAG_MPEG4_OrderedGroup, TAG_MPEG4_OrientationInterpolator, TAG_MPEG4_PlaneSensor, TAG_MPEG4_PlaneSensor2D, TAG_MPEG4_PointLight, TAG_MPEG4_PositionInterpolator, TAG_MPEG4_PositionInterpolator2D, TAG_MPEG4_ProximitySensor2D, TAG_MPEG4_ProximitySensor, TAG_MPEG4_QuantizationParameter, TAG_MPEG4_ScalarInterpolator, TAG_MPEG4_Script, TAG_MPEG4_Shape, TAG_MPEG4_Sound, TAG_MPEG4_Sound2D, TAG_MPEG4_SphereSensor, TAG_MPEG4_SpotLight, TAG_MPEG4_Switch, TAG_MPEG4_TermCap, TAG_MPEG4_TimeSensor, TAG_MPEG4_TouchSensor, TAG_MPEG4_Transform, TAG_MPEG4_Transform2D, TAG_MPEG4_Valuator, TAG_MPEG4_Viewpoint, TAG_MPEG4_VisibilitySensor, TAG_MPEG4_WorldInfo\r
+};\r
+\r
+#define SF2DNode_V1_NUMBITS            5\r
+#define SF2DNode_V1_Count      31\r
+\r
+static const u32 SF2DNode_V1_TypeToTag[31] = {\r
+ TAG_MPEG4_Anchor, TAG_MPEG4_AnimationStream, TAG_MPEG4_Background2D, TAG_MPEG4_ColorInterpolator, TAG_MPEG4_Conditional, TAG_MPEG4_CoordinateInterpolator2D, TAG_MPEG4_DiscSensor, TAG_MPEG4_Face, TAG_MPEG4_Form, TAG_MPEG4_Group, TAG_MPEG4_Inline, TAG_MPEG4_LOD, TAG_MPEG4_Layer2D, TAG_MPEG4_Layer3D, TAG_MPEG4_Layout, TAG_MPEG4_OrderedGroup, TAG_MPEG4_PlaneSensor2D, TAG_MPEG4_PositionInterpolator2D, TAG_MPEG4_ProximitySensor2D, TAG_MPEG4_QuantizationParameter, TAG_MPEG4_ScalarInterpolator, TAG_MPEG4_Script, TAG_MPEG4_Shape, TAG_MPEG4_Sound2D, TAG_MPEG4_Switch, TAG_MPEG4_TermCap, TAG_MPEG4_TimeSensor, TAG_MPEG4_TouchSensor, TAG_MPEG4_Transform2D, TAG_MPEG4_Valuator, TAG_MPEG4_WorldInfo\r
+};\r
+\r
+#define SFStreamingNode_V1_NUMBITS             3\r
+#define SFStreamingNode_V1_Count       5\r
+\r
+static const u32 SFStreamingNode_V1_TypeToTag[5] = {\r
+ TAG_MPEG4_AnimationStream, TAG_MPEG4_AudioClip, TAG_MPEG4_AudioSource, TAG_MPEG4_Inline, TAG_MPEG4_MovieTexture\r
+};\r
+\r
+#define SFAppearanceNode_V1_NUMBITS            1\r
+#define SFAppearanceNode_V1_Count      1\r
+\r
+static const u32 SFAppearanceNode_V1_TypeToTag[1] = {\r
+ TAG_MPEG4_Appearance\r
+};\r
+\r
+#define SFAudioNode_V1_NUMBITS         3\r
+#define SFAudioNode_V1_Count   7\r
+\r
+static const u32 SFAudioNode_V1_TypeToTag[7] = {\r
+ TAG_MPEG4_AudioBuffer, TAG_MPEG4_AudioClip, TAG_MPEG4_AudioDelay, TAG_MPEG4_AudioFX, TAG_MPEG4_AudioMix, TAG_MPEG4_AudioSource, TAG_MPEG4_AudioSwitch\r
+};\r
+\r
+#define SFBackground3DNode_V1_NUMBITS          1\r
+#define SFBackground3DNode_V1_Count    1\r
+\r
+static const u32 SFBackground3DNode_V1_TypeToTag[1] = {\r
+ TAG_MPEG4_Background\r
+};\r
+\r
+#define SFBackground2DNode_V1_NUMBITS          1\r
+#define SFBackground2DNode_V1_Count    1\r
+\r
+static const u32 SFBackground2DNode_V1_TypeToTag[1] = {\r
+ TAG_MPEG4_Background2D\r
+};\r
+\r
+#define SFGeometryNode_V1_NUMBITS              5\r
+#define SFGeometryNode_V1_Count        17\r
+\r
+static const u32 SFGeometryNode_V1_TypeToTag[17] = {\r
+ TAG_MPEG4_Bitmap, TAG_MPEG4_Box, TAG_MPEG4_Circle, TAG_MPEG4_Cone, TAG_MPEG4_Curve2D, TAG_MPEG4_Cylinder, TAG_MPEG4_ElevationGrid, TAG_MPEG4_Extrusion, TAG_MPEG4_IndexedFaceSet, TAG_MPEG4_IndexedFaceSet2D, TAG_MPEG4_IndexedLineSet, TAG_MPEG4_IndexedLineSet2D, TAG_MPEG4_PointSet, TAG_MPEG4_PointSet2D, TAG_MPEG4_Rectangle, TAG_MPEG4_Sphere, TAG_MPEG4_Text\r
+};\r
+\r
+#define SFColorNode_V1_NUMBITS         1\r
+#define SFColorNode_V1_Count   1\r
+\r
+static const u32 SFColorNode_V1_TypeToTag[1] = {\r
+ TAG_MPEG4_Color\r
+};\r
+\r
+#define SFTextureNode_V1_NUMBITS               3\r
+#define SFTextureNode_V1_Count 5\r
+\r
+static const u32 SFTextureNode_V1_TypeToTag[5] = {\r
+ TAG_MPEG4_CompositeTexture2D, TAG_MPEG4_CompositeTexture3D, TAG_MPEG4_ImageTexture, TAG_MPEG4_MovieTexture, TAG_MPEG4_PixelTexture\r
+};\r
+\r
+#define SFCoordinateNode_V1_NUMBITS            1\r
+#define SFCoordinateNode_V1_Count      1\r
+\r
+static const u32 SFCoordinateNode_V1_TypeToTag[1] = {\r
+ TAG_MPEG4_Coordinate\r
+};\r
+\r
+#define SFCoordinate2DNode_V1_NUMBITS          1\r
+#define SFCoordinate2DNode_V1_Count    1\r
+\r
+static const u32 SFCoordinate2DNode_V1_TypeToTag[1] = {\r
+ TAG_MPEG4_Coordinate2D\r
+};\r
+\r
+#define SFExpressionNode_V1_NUMBITS            1\r
+#define SFExpressionNode_V1_Count      1\r
+\r
+static const u32 SFExpressionNode_V1_TypeToTag[1] = {\r
+ TAG_MPEG4_Expression\r
+};\r
+\r
+#define SFFaceDefMeshNode_V1_NUMBITS           1\r
+#define SFFaceDefMeshNode_V1_Count     1\r
+\r
+static const u32 SFFaceDefMeshNode_V1_TypeToTag[1] = {\r
+ TAG_MPEG4_FaceDefMesh\r
+};\r
+\r
+#define SFFaceDefTablesNode_V1_NUMBITS         1\r
+#define SFFaceDefTablesNode_V1_Count   1\r
+\r
+static const u32 SFFaceDefTablesNode_V1_TypeToTag[1] = {\r
+ TAG_MPEG4_FaceDefTables\r
+};\r
+\r
+#define SFFaceDefTransformNode_V1_NUMBITS              1\r
+#define SFFaceDefTransformNode_V1_Count        1\r
+\r
+static const u32 SFFaceDefTransformNode_V1_TypeToTag[1] = {\r
+ TAG_MPEG4_FaceDefTransform\r
+};\r
+\r
+#define SFFAPNode_V1_NUMBITS           1\r
+#define SFFAPNode_V1_Count     1\r
+\r
+static const u32 SFFAPNode_V1_TypeToTag[1] = {\r
+ TAG_MPEG4_FAP\r
+};\r
+\r
+#define SFFDPNode_V1_NUMBITS           1\r
+#define SFFDPNode_V1_Count     1\r
+\r
+static const u32 SFFDPNode_V1_TypeToTag[1] = {\r
+ TAG_MPEG4_FDP\r
+};\r
+\r
+#define SFFITNode_V1_NUMBITS           1\r
+#define SFFITNode_V1_Count     1\r
+\r
+static const u32 SFFITNode_V1_TypeToTag[1] = {\r
+ TAG_MPEG4_FIT\r
+};\r
+\r
+#define SFFogNode_V1_NUMBITS           1\r
+#define SFFogNode_V1_Count     1\r
+\r
+static const u32 SFFogNode_V1_TypeToTag[1] = {\r
+ TAG_MPEG4_Fog\r
+};\r
+\r
+#define SFFontStyleNode_V1_NUMBITS             1\r
+#define SFFontStyleNode_V1_Count       1\r
+\r
+static const u32 SFFontStyleNode_V1_TypeToTag[1] = {\r
+ TAG_MPEG4_FontStyle\r
+};\r
+\r
+#define SFTopNode_V1_NUMBITS           3\r
+#define SFTopNode_V1_Count     4\r
+\r
+static const u32 SFTopNode_V1_TypeToTag[4] = {\r
+ TAG_MPEG4_Group, TAG_MPEG4_Layer2D, TAG_MPEG4_Layer3D, TAG_MPEG4_OrderedGroup\r
+};\r
+\r
+#define SFLinePropertiesNode_V1_NUMBITS                1\r
+#define SFLinePropertiesNode_V1_Count  1\r
+\r
+static const u32 SFLinePropertiesNode_V1_TypeToTag[1] = {\r
+ TAG_MPEG4_LineProperties\r
+};\r
+\r
+#define SFMaterialNode_V1_NUMBITS              2\r
+#define SFMaterialNode_V1_Count        2\r
+\r
+static const u32 SFMaterialNode_V1_TypeToTag[2] = {\r
+ TAG_MPEG4_Material, TAG_MPEG4_Material2D\r
+};\r
+\r
+#define SFNavigationInfoNode_V1_NUMBITS                1\r
+#define SFNavigationInfoNode_V1_Count  1\r
+\r
+static const u32 SFNavigationInfoNode_V1_TypeToTag[1] = {\r
+ TAG_MPEG4_NavigationInfo\r
+};\r
+\r
+#define SFNormalNode_V1_NUMBITS                1\r
+#define SFNormalNode_V1_Count  1\r
+\r
+static const u32 SFNormalNode_V1_TypeToTag[1] = {\r
+ TAG_MPEG4_Normal\r
+};\r
+\r
+#define SFTextureCoordinateNode_V1_NUMBITS             1\r
+#define SFTextureCoordinateNode_V1_Count       1\r
+\r
+static const u32 SFTextureCoordinateNode_V1_TypeToTag[1] = {\r
+ TAG_MPEG4_TextureCoordinate\r
+};\r
+\r
+#define SFTextureTransformNode_V1_NUMBITS              1\r
+#define SFTextureTransformNode_V1_Count        1\r
+\r
+static const u32 SFTextureTransformNode_V1_TypeToTag[1] = {\r
+ TAG_MPEG4_TextureTransform\r
+};\r
+\r
+#define SFViewpointNode_V1_NUMBITS             1\r
+#define SFViewpointNode_V1_Count       1\r
+\r
+static const u32 SFViewpointNode_V1_TypeToTag[1] = {\r
+ TAG_MPEG4_Viewpoint\r
+};\r
+\r
+#define SFVisemeNode_V1_NUMBITS                1\r
+#define SFVisemeNode_V1_Count  1\r
+\r
+static const u32 SFVisemeNode_V1_TypeToTag[1] = {\r
+ TAG_MPEG4_Viseme\r
+};\r
+\r
+\r
+u32 NDT_V1_GetNumBits(u32 NDT_Tag);\r
+u32 NDT_V1_GetNodeTag(u32 Context_NDT_Tag, u32 NodeType);\r
+u32 NDT_V1_GetNodeType(u32 NDT_Tag, u32 NodeTag);\r
+\r
+\r
+\r
+\r
+/* NDT BIFS Version 2 */\r
+\r
+#define SFWorldNode_V2_NUMBITS         4\r
+#define SFWorldNode_V2_Count   12\r
+\r
+static const u32 SFWorldNode_V2_TypeToTag[12] = {\r
+ TAG_MPEG4_AcousticMaterial, TAG_MPEG4_AcousticScene, TAG_MPEG4_ApplicationWindow, TAG_MPEG4_BAP, TAG_MPEG4_BDP, TAG_MPEG4_Body, TAG_MPEG4_BodyDefTable, TAG_MPEG4_BodySegmentConnectionHint, TAG_MPEG4_DirectiveSound, TAG_MPEG4_Hierarchical3DMesh, TAG_MPEG4_MaterialKey, TAG_MPEG4_PerceptualParameters\r
+};\r
+\r
+#define SF3DNode_V2_NUMBITS            3\r
+#define SF3DNode_V2_Count      3\r
+\r
+static const u32 SF3DNode_V2_TypeToTag[3] = {\r
+ TAG_MPEG4_AcousticScene, TAG_MPEG4_Body, TAG_MPEG4_DirectiveSound\r
+};\r
+\r
+#define SF2DNode_V2_NUMBITS            2\r
+#define SF2DNode_V2_Count      2\r
+\r
+static const u32 SF2DNode_V2_TypeToTag[2] = {\r
+ TAG_MPEG4_ApplicationWindow, TAG_MPEG4_Body\r
+};\r
+\r
+#define SFGeometryNode_V2_NUMBITS              2\r
+#define SFGeometryNode_V2_Count        1\r
+\r
+static const u32 SFGeometryNode_V2_TypeToTag[1] = {\r
+ TAG_MPEG4_Hierarchical3DMesh\r
+};\r
+\r
+#define SFMaterialNode_V2_NUMBITS              2\r
+#define SFMaterialNode_V2_Count        2\r
+\r
+static const u32 SFMaterialNode_V2_TypeToTag[2] = {\r
+ TAG_MPEG4_AcousticMaterial, TAG_MPEG4_MaterialKey\r
+};\r
+\r
+#define SFBAPNode_V2_NUMBITS           2\r
+#define SFBAPNode_V2_Count     1\r
+\r
+static const u32 SFBAPNode_V2_TypeToTag[1] = {\r
+ TAG_MPEG4_BAP\r
+};\r
+\r
+#define SFBDPNode_V2_NUMBITS           2\r
+#define SFBDPNode_V2_Count     1\r
+\r
+static const u32 SFBDPNode_V2_TypeToTag[1] = {\r
+ TAG_MPEG4_BDP\r
+};\r
+\r
+#define SFBodyDefTableNode_V2_NUMBITS          2\r
+#define SFBodyDefTableNode_V2_Count    1\r
+\r
+static const u32 SFBodyDefTableNode_V2_TypeToTag[1] = {\r
+ TAG_MPEG4_BodyDefTable\r
+};\r
+\r
+#define SFBodySegmentConnectionHintNode_V2_NUMBITS             2\r
+#define SFBodySegmentConnectionHintNode_V2_Count       1\r
+\r
+static const u32 SFBodySegmentConnectionHintNode_V2_TypeToTag[1] = {\r
+ TAG_MPEG4_BodySegmentConnectionHint\r
+};\r
+\r
+#define SFPerceptualParameterNode_V2_NUMBITS           2\r
+#define SFPerceptualParameterNode_V2_Count     1\r
+\r
+static const u32 SFPerceptualParameterNode_V2_TypeToTag[1] = {\r
+ TAG_MPEG4_PerceptualParameters\r
+};\r
+\r
+\r
+u32 NDT_V2_GetNumBits(u32 NDT_Tag);\r
+u32 NDT_V2_GetNodeTag(u32 Context_NDT_Tag, u32 NodeType);\r
+u32 NDT_V2_GetNodeType(u32 NDT_Tag, u32 NodeTag);\r
+\r
+\r
+\r
+\r
+/* NDT BIFS Version 3 */\r
+\r
+#define SFWorldNode_V3_NUMBITS         2\r
+#define SFWorldNode_V3_Count   3\r
+\r
+static const u32 SFWorldNode_V3_TypeToTag[3] = {\r
+ TAG_MPEG4_TemporalTransform, TAG_MPEG4_TemporalGroup, TAG_MPEG4_ServerCommand\r
+};\r
+\r
+#define SF3DNode_V3_NUMBITS            2\r
+#define SF3DNode_V3_Count      3\r
+\r
+static const u32 SF3DNode_V3_TypeToTag[3] = {\r
+ TAG_MPEG4_TemporalTransform, TAG_MPEG4_TemporalGroup, TAG_MPEG4_ServerCommand\r
+};\r
+\r
+#define SF2DNode_V3_NUMBITS            2\r
+#define SF2DNode_V3_Count      3\r
+\r
+static const u32 SF2DNode_V3_TypeToTag[3] = {\r
+ TAG_MPEG4_TemporalTransform, TAG_MPEG4_TemporalGroup, TAG_MPEG4_ServerCommand\r
+};\r
+\r
+#define SFTemporalNode_V3_NUMBITS              2\r
+#define SFTemporalNode_V3_Count        2\r
+\r
+static const u32 SFTemporalNode_V3_TypeToTag[2] = {\r
+ TAG_MPEG4_TemporalTransform, TAG_MPEG4_TemporalGroup\r
+};\r
+\r
+\r
+u32 NDT_V3_GetNumBits(u32 NDT_Tag);\r
+u32 NDT_V3_GetNodeTag(u32 Context_NDT_Tag, u32 NodeType);\r
+u32 NDT_V3_GetNodeType(u32 NDT_Tag, u32 NodeTag);\r
+\r
+\r
+\r
+\r
+/* NDT BIFS Version 4 */\r
+\r
+#define SFWorldNode_V4_NUMBITS         3\r
+#define SFWorldNode_V4_Count   5\r
+\r
+static const u32 SFWorldNode_V4_TypeToTag[5] = {\r
+ TAG_MPEG4_InputSensor, TAG_MPEG4_MatteTexture, TAG_MPEG4_MediaBuffer, TAG_MPEG4_MediaControl, TAG_MPEG4_MediaSensor\r
+};\r
+\r
+#define SF3DNode_V4_NUMBITS            3\r
+#define SF3DNode_V4_Count      5\r
+\r
+static const u32 SF3DNode_V4_TypeToTag[5] = {\r
+ TAG_MPEG4_InputSensor, TAG_MPEG4_MatteTexture, TAG_MPEG4_MediaBuffer, TAG_MPEG4_MediaControl, TAG_MPEG4_MediaSensor\r
+};\r
+\r
+#define SF2DNode_V4_NUMBITS            3\r
+#define SF2DNode_V4_Count      5\r
+\r
+static const u32 SF2DNode_V4_TypeToTag[5] = {\r
+ TAG_MPEG4_InputSensor, TAG_MPEG4_MatteTexture, TAG_MPEG4_MediaBuffer, TAG_MPEG4_MediaControl, TAG_MPEG4_MediaSensor\r
+};\r
+\r
+#define SFTextureNode_V4_NUMBITS               1\r
+#define SFTextureNode_V4_Count 1\r
+\r
+static const u32 SFTextureNode_V4_TypeToTag[1] = {\r
+ TAG_MPEG4_MatteTexture\r
+};\r
+\r
+\r
+u32 NDT_V4_GetNumBits(u32 NDT_Tag);\r
+u32 NDT_V4_GetNodeTag(u32 Context_NDT_Tag, u32 NodeType);\r
+u32 NDT_V4_GetNodeType(u32 NDT_Tag, u32 NodeTag);\r
+\r
+\r
+\r
+\r
+/* NDT BIFS Version 5 */\r
+\r
+#define SFWorldNode_V5_NUMBITS         6\r
+#define SFWorldNode_V5_Count   39\r
+\r
+static const u32 SFWorldNode_V5_TypeToTag[39] = {\r
+ TAG_MPEG4_BitWrapper, TAG_MPEG4_CoordinateInterpolator4D, TAG_MPEG4_DepthImage, TAG_MPEG4_FFD, TAG_MPEG4_Implicit, TAG_MPEG4_XXLFM_Appearance, TAG_MPEG4_XXLFM_BlendList, TAG_MPEG4_XXLFM_FrameList, TAG_MPEG4_XXLFM_LightMap, TAG_MPEG4_XXLFM_SurfaceMapList, TAG_MPEG4_XXLFM_ViewMapList, TAG_MPEG4_MeshGrid, TAG_MPEG4_NonLinearDeformer, TAG_MPEG4_NurbsCurve, TAG_MPEG4_NurbsCurve2D, TAG_MPEG4_NurbsSurface, TAG_MPEG4_OctreeImage, TAG_MPEG4_XXParticles, TAG_MPEG4_XXParticleInitBox, TAG_MPEG4_XXPlanarObstacle, TAG_MPEG4_XXPointAttractor, TAG_MPEG4_PointTexture, TAG_MPEG4_PositionAnimator, TAG_MPEG4_PositionAnimator2D, TAG_MPEG4_PositionInterpolator4D, TAG_MPEG4_ProceduralTexture, TAG_MPEG4_Quadric, TAG_MPEG4_SBBone, TAG_MPEG4_SBMuscle, TAG_MPEG4_SBSegment, TAG_MPEG4_SBSite, TAG_MPEG4_SBSkinnedModel, TAG_MPEG4_SBVCAnimation, TAG_MPEG4_ScalarAnimator, TAG_MPEG4_SimpleTexture, TAG_MPEG4_SolidRep, TAG_MPEG4_SubdivisionSurface, TAG_MPEG4_SubdivSurfaceSector, TAG_MPEG4_WaveletSubdivisionSurface\r
+};\r
+\r
+#define SF3DNode_V5_NUMBITS            5\r
+#define SF3DNode_V5_Count      17\r
+\r
+static const u32 SF3DNode_V5_TypeToTag[17] = {\r
+ TAG_MPEG4_BitWrapper, TAG_MPEG4_CoordinateInterpolator4D, TAG_MPEG4_DepthImage, TAG_MPEG4_FFD, TAG_MPEG4_OctreeImage, TAG_MPEG4_XXParticles, TAG_MPEG4_PositionAnimator, TAG_MPEG4_PositionAnimator2D, TAG_MPEG4_PositionInterpolator4D, TAG_MPEG4_SBBone, TAG_MPEG4_SBMuscle, TAG_MPEG4_SBSegment, TAG_MPEG4_SBSite, TAG_MPEG4_SBSkinnedModel, TAG_MPEG4_SBVCAnimation, TAG_MPEG4_ScalarAnimator, TAG_MPEG4_WaveletSubdivisionSurface\r
+};\r
+\r
+#define SF2DNode_V5_NUMBITS            4\r
+#define SF2DNode_V5_Count      9\r
+\r
+static const u32 SF2DNode_V5_TypeToTag[9] = {\r
+ TAG_MPEG4_BitWrapper, TAG_MPEG4_PositionAnimator2D, TAG_MPEG4_SBBone, TAG_MPEG4_SBMuscle, TAG_MPEG4_SBSegment, TAG_MPEG4_SBSite, TAG_MPEG4_SBSkinnedModel, TAG_MPEG4_SBVCAnimation, TAG_MPEG4_ScalarAnimator\r
+};\r
+\r
+#define SFAppearanceNode_V5_NUMBITS            1\r
+#define SFAppearanceNode_V5_Count      1\r
+\r
+static const u32 SFAppearanceNode_V5_TypeToTag[1] = {\r
+ TAG_MPEG4_XXLFM_Appearance\r
+};\r
+\r
+#define SFGeometryNode_V5_NUMBITS              4\r
+#define SFGeometryNode_V5_Count        10\r
+\r
+static const u32 SFGeometryNode_V5_TypeToTag[10] = {\r
+ TAG_MPEG4_BitWrapper, TAG_MPEG4_Implicit, TAG_MPEG4_MeshGrid, TAG_MPEG4_NonLinearDeformer, TAG_MPEG4_NurbsCurve, TAG_MPEG4_NurbsCurve2D, TAG_MPEG4_NurbsSurface, TAG_MPEG4_Quadric, TAG_MPEG4_SolidRep, TAG_MPEG4_SubdivisionSurface\r
+};\r
+\r
+#define SFTextureNode_V5_NUMBITS               1\r
+#define SFTextureNode_V5_Count 1\r
+\r
+static const u32 SFTextureNode_V5_TypeToTag[1] = {\r
+ TAG_MPEG4_ProceduralTexture\r
+};\r
+\r
+#define SFDepthImageNode_V5_NUMBITS            1\r
+#define SFDepthImageNode_V5_Count      1\r
+\r
+static const u32 SFDepthImageNode_V5_TypeToTag[1] = {\r
+ TAG_MPEG4_DepthImage\r
+};\r
+\r
+#define SFBlendListNode_V5_NUMBITS             1\r
+#define SFBlendListNode_V5_Count       1\r
+\r
+static const u32 SFBlendListNode_V5_TypeToTag[1] = {\r
+ TAG_MPEG4_XXLFM_BlendList\r
+};\r
+\r
+#define SFFrameListNode_V5_NUMBITS             1\r
+#define SFFrameListNode_V5_Count       1\r
+\r
+static const u32 SFFrameListNode_V5_TypeToTag[1] = {\r
+ TAG_MPEG4_XXLFM_FrameList\r
+};\r
+\r
+#define SFLightMapNode_V5_NUMBITS              1\r
+#define SFLightMapNode_V5_Count        1\r
+\r
+static const u32 SFLightMapNode_V5_TypeToTag[1] = {\r
+ TAG_MPEG4_XXLFM_LightMap\r
+};\r
+\r
+#define SFSurfaceMapNode_V5_NUMBITS            1\r
+#define SFSurfaceMapNode_V5_Count      1\r
+\r
+static const u32 SFSurfaceMapNode_V5_TypeToTag[1] = {\r
+ TAG_MPEG4_XXLFM_SurfaceMapList\r
+};\r
+\r
+#define SFViewMapNode_V5_NUMBITS               1\r
+#define SFViewMapNode_V5_Count 1\r
+\r
+static const u32 SFViewMapNode_V5_TypeToTag[1] = {\r
+ TAG_MPEG4_XXLFM_ViewMapList\r
+};\r
+\r
+#define SFParticleInitializerNode_V5_NUMBITS           1\r
+#define SFParticleInitializerNode_V5_Count     1\r
+\r
+static const u32 SFParticleInitializerNode_V5_TypeToTag[1] = {\r
+ TAG_MPEG4_XXParticleInitBox\r
+};\r
+\r
+#define SFInfluenceNode_V5_NUMBITS             2\r
+#define SFInfluenceNode_V5_Count       2\r
+\r
+static const u32 SFInfluenceNode_V5_TypeToTag[2] = {\r
+ TAG_MPEG4_XXPlanarObstacle, TAG_MPEG4_XXPointAttractor\r
+};\r
+\r
+#define SFDepthTextureNode_V5_NUMBITS          2\r
+#define SFDepthTextureNode_V5_Count    2\r
+\r
+static const u32 SFDepthTextureNode_V5_TypeToTag[2] = {\r
+ TAG_MPEG4_PointTexture, TAG_MPEG4_SimpleTexture\r
+};\r
+\r
+#define SFSBBoneNode_V5_NUMBITS                1\r
+#define SFSBBoneNode_V5_Count  1\r
+\r
+static const u32 SFSBBoneNode_V5_TypeToTag[1] = {\r
+ TAG_MPEG4_SBBone\r
+};\r
+\r
+#define SFSBMuscleNode_V5_NUMBITS              1\r
+#define SFSBMuscleNode_V5_Count        1\r
+\r
+static const u32 SFSBMuscleNode_V5_TypeToTag[1] = {\r
+ TAG_MPEG4_SBMuscle\r
+};\r
+\r
+#define SFSBSegmentNode_V5_NUMBITS             1\r
+#define SFSBSegmentNode_V5_Count       1\r
+\r
+static const u32 SFSBSegmentNode_V5_TypeToTag[1] = {\r
+ TAG_MPEG4_SBSegment\r
+};\r
+\r
+#define SFSBSiteNode_V5_NUMBITS                1\r
+#define SFSBSiteNode_V5_Count  1\r
+\r
+static const u32 SFSBSiteNode_V5_TypeToTag[1] = {\r
+ TAG_MPEG4_SBSite\r
+};\r
+\r
+#define SFBaseMeshNode_V5_NUMBITS              1\r
+#define SFBaseMeshNode_V5_Count        1\r
+\r
+static const u32 SFBaseMeshNode_V5_TypeToTag[1] = {\r
+ TAG_MPEG4_SubdivisionSurface\r
+};\r
+\r
+#define SFSubdivSurfaceSectorNode_V5_NUMBITS           1\r
+#define SFSubdivSurfaceSectorNode_V5_Count     1\r
+\r
+static const u32 SFSubdivSurfaceSectorNode_V5_TypeToTag[1] = {\r
+ TAG_MPEG4_SubdivSurfaceSector\r
+};\r
+\r
+\r
+u32 NDT_V5_GetNumBits(u32 NDT_Tag);\r
+u32 NDT_V5_GetNodeTag(u32 Context_NDT_Tag, u32 NodeType);\r
+u32 NDT_V5_GetNodeType(u32 NDT_Tag, u32 NodeTag);\r
+\r
+\r
+\r
+\r
+/* NDT BIFS Version 6 */\r
+\r
+#define SFWorldNode_V6_NUMBITS         4\r
+#define SFWorldNode_V6_Count   12\r
+\r
+static const u32 SFWorldNode_V6_TypeToTag[12] = {\r
+ TAG_MPEG4_Clipper2D, TAG_MPEG4_ColorTransform, TAG_MPEG4_Ellipse, TAG_MPEG4_LinearGradient, TAG_MPEG4_PathLayout, TAG_MPEG4_RadialGradient, TAG_MPEG4_SynthesizedTexture, TAG_MPEG4_TransformMatrix2D, TAG_MPEG4_Viewport, TAG_MPEG4_XCurve2D, TAG_MPEG4_XFontStyle, TAG_MPEG4_XLineProperties\r
+};\r
+\r
+#define SF3DNode_V6_NUMBITS            3\r
+#define SF3DNode_V6_Count      5\r
+\r
+static const u32 SF3DNode_V6_TypeToTag[5] = {\r
+ TAG_MPEG4_Clipper2D, TAG_MPEG4_ColorTransform, TAG_MPEG4_PathLayout, TAG_MPEG4_TransformMatrix2D, TAG_MPEG4_Viewport\r
+};\r
+\r
+#define SF2DNode_V6_NUMBITS            3\r
+#define SF2DNode_V6_Count      5\r
+\r
+static const u32 SF2DNode_V6_TypeToTag[5] = {\r
+ TAG_MPEG4_Clipper2D, TAG_MPEG4_ColorTransform, TAG_MPEG4_PathLayout, TAG_MPEG4_TransformMatrix2D, TAG_MPEG4_Viewport\r
+};\r
+\r
+#define SFGeometryNode_V6_NUMBITS              2\r
+#define SFGeometryNode_V6_Count        2\r
+\r
+static const u32 SFGeometryNode_V6_TypeToTag[2] = {\r
+ TAG_MPEG4_Ellipse, TAG_MPEG4_XCurve2D\r
+};\r
+\r
+#define SFTextureNode_V6_NUMBITS               2\r
+#define SFTextureNode_V6_Count 3\r
+\r
+static const u32 SFTextureNode_V6_TypeToTag[3] = {\r
+ TAG_MPEG4_LinearGradient, TAG_MPEG4_RadialGradient, TAG_MPEG4_SynthesizedTexture\r
+};\r
+\r
+#define SFFontStyleNode_V6_NUMBITS             1\r
+#define SFFontStyleNode_V6_Count       1\r
+\r
+static const u32 SFFontStyleNode_V6_TypeToTag[1] = {\r
+ TAG_MPEG4_XFontStyle\r
+};\r
+\r
+#define SFLinePropertiesNode_V6_NUMBITS                1\r
+#define SFLinePropertiesNode_V6_Count  1\r
+\r
+static const u32 SFLinePropertiesNode_V6_TypeToTag[1] = {\r
+ TAG_MPEG4_XLineProperties\r
+};\r
+\r
+#define SFTextureTransformNode_V6_NUMBITS              1\r
+#define SFTextureTransformNode_V6_Count        1\r
+\r
+static const u32 SFTextureTransformNode_V6_TypeToTag[1] = {\r
+ TAG_MPEG4_TransformMatrix2D\r
+};\r
+\r
+#define SFViewportNode_V6_NUMBITS              1\r
+#define SFViewportNode_V6_Count        1\r
+\r
+static const u32 SFViewportNode_V6_TypeToTag[1] = {\r
+ TAG_MPEG4_Viewport\r
+};\r
+\r
+\r
+u32 NDT_V6_GetNumBits(u32 NDT_Tag);\r
+u32 NDT_V6_GetNodeTag(u32 Context_NDT_Tag, u32 NodeType);\r
+u32 NDT_V6_GetNodeType(u32 NDT_Tag, u32 NodeTag);\r
+\r
+\r
+\r
+u32 NDT_GetChildTable(u32 NodeTag);\r
+\r
+\r
+\r
+\r
+#endif         /*_NDT_H*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/internal/camera.h b/tstools/DtsEdit/src/gpac/internal/camera.h
new file mode 100644 (file)
index 0000000..bf83140
--- /dev/null
@@ -0,0 +1,184 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / Scene Compositor sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _CAMERA_H_\r
+#define _CAMERA_H_\r
+\r
+//#include <gpac/internal/compositor_dev.h>\r
+#include <gpac/scenegraph_vrml.h>\r
+\r
+/*camera flags*/\r
+enum\r
+{\r
+       /*if set frustum needs to be recomputed\r
+       we avoid computing it at each frame/interaction since that's a lot of matrix maths*/\r
+       CAM_IS_DIRTY = 1,\r
+       /*if set when ortho, indicates the viewport matrix shall be used when computing modelview (2D only)*/\r
+       CAM_HAS_VIEWPORT = 1<<2,\r
+};\r
+\r
+enum\r
+{\r
+       /*only valid at root node*/\r
+       CULL_NOT_SET = 0,\r
+       /*subtree completely outside view vol*/\r
+       CULL_OUTSIDE,\r
+       /*subtree completely inside view vol*/\r
+       CULL_INSIDE,\r
+       /*subtree overlaps view vol - FIXME: would be nice to keep track of intersecting planes*/\r
+       CULL_INTERSECTS\r
+};\r
+\r
+/*navigation info flags - non-VRML ones are simply blaxxun contact ones */\r
+enum\r
+{\r
+       /*headlight is on*/\r
+       NAV_HEADLIGHT = 1,\r
+       /*any navigation (eg, user-interface navigation control allowed)*/\r
+       NAV_ANY = 1<<1\r
+};\r
+\r
+/*frustum object*/\r
+enum\r
+{\r
+       FRUS_NEAR_PLANE = 0,\r
+       FRUS_FAR_PLANE,\r
+       FRUS_LEFT_PLANE,\r
+       FRUS_RIGHT_PLANE,\r
+       FRUS_BOTTOM_PLANE,\r
+       FRUS_TOP_PLANE\r
+};\r
+\r
+\r
+\r
+enum\r
+{\r
+       /*nothing detected*/\r
+       CF_NONE = 0,\r
+       /*collision detected*/\r
+       CF_COLLISION = 1,\r
+       /*gravity detecion enabled*/\r
+       CF_DO_GRAVITY = (1<<1),\r
+       /*gravity detected*/\r
+       CF_GRAVITY = (1<<2),\r
+       /*viewpoint is stored at end of animation*/\r
+       CF_STORE_VP = (1<<3),\r
+};\r
+\r
+typedef struct _camera\r
+{\r
+       /*this flag MUST be set by the owner of the camera*/\r
+       Bool is_3D;\r
+\r
+       u32 flags;\r
+\r
+       /*viewport info*/\r
+       GF_Rect vp;\r
+       /*not always same as VP due to aspect ratio*/\r
+       Fixed width, height;\r
+       Fixed z_near, z_far;\r
+\r
+       /*current vectors*/\r
+       Fixed fieldOfView;\r
+       SFVec3f up, position, target;\r
+\r
+       /*initial vp for reset*/\r
+       SFVec3f vp_position;\r
+       SFRotation vp_orientation;\r
+       Fixed vp_fov, vp_dist;\r
+\r
+       /*animation path*/\r
+       SFVec3f start_pos, end_pos;\r
+       SFRotation start_ori, end_ori;\r
+       Fixed start_fov, end_fov;\r
+       /*for 2D cameras we never animate except for vp reset*/\r
+       Fixed start_zoom;\r
+       SFVec2f start_trans, start_rot;\r
+\r
+       /*center of examine movement*/\r
+       SFVec3f examine_center;\r
+\r
+       /*anim*/\r
+       u32 anim_len, anim_start;\r
+       Bool jumping;\r
+       Fixed dheight;\r
+\r
+       /*navigation info - overwridden by any bindable NavigationInfo node*/\r
+       u32 navigation_flags, navigate_mode;\r
+       SFVec3f avatar_size;\r
+       Fixed visibility, speed;\r
+       Bool had_viewpoint, had_nav_info;\r
+\r
+       /*last camera position before collision& gravity detection*/\r
+       SFVec3f last_pos;\r
+       u32 collide_flags;\r
+       /*collision point in world coord*/\r
+       SFVec3f collide_point;\r
+       /*collide dist in world coord, used to check if we have a closer collision*/\r
+       Fixed collide_dist;\r
+       /*ground in world coord*/\r
+       SFVec3f ground_point;\r
+       /*ground dist in world coord, used to check if we have a closer ground*/\r
+       Fixed ground_dist;\r
+       /*for obstacle detection*/\r
+       Bool last_had_ground;\r
+       Bool last_had_col;\r
+\r
+       /*projection & modelview matrices*/\r
+       GF_Matrix projection, modelview;\r
+       /*unprojection matrix = INV(P*M) used for screen->world compute*/\r
+       GF_Matrix unprojection;\r
+       /*viewport matrix*/\r
+       GF_Matrix viewport;\r
+       /*frustum planes*/\r
+       GF_Plane planes[6];\r
+       /*p vertex idx per plane (for bbox-frustum intersection checks)*/\r
+       u32 p_idx[6];\r
+       /*frustrum bounding sphere (for sphere-sphere frustum intersection checks)*/\r
+       SFVec3f center;\r
+       Fixed radius;\r
+} GF_Camera;\r
+\r
+/*invalidate camera to force recompute of all params*/\r
+void camera_invalidate(GF_Camera *cam);\r
+/*updates camera. user transform is only used in 2D to set global user zoom/pan/translate*/\r
+void camera_update(GF_Camera *cam, GF_Matrix2D *user_transform, Bool center_coords);\r
+/*reset to last viewport*/\r
+void camera_reset_viewpoint(GF_Camera *cam, Bool animate);\r
+/*move camera to given vp*/\r
+void camera_move_to(GF_Camera *cam, SFVec3f pos, SFVec3f target, SFVec3f up);\r
+Bool camera_animate(GF_Camera *cam);\r
+void camera_stop_anim(GF_Camera *cam);\r
+/*start jump mode*/\r
+void camera_jump(GF_Camera *cam);\r
+\r
+void camera_set_vectors(GF_Camera *cam, SFVec3f pos, SFRotation ori, Fixed fov);\r
+\r
+SFRotation camera_get_orientation(SFVec3f pos, SFVec3f target, SFVec3f up);\r
+SFVec3f camera_get_pos_dir(GF_Camera *cam);\r
+SFVec3f camera_get_target_dir(GF_Camera *cam);\r
+SFVec3f camera_get_right_dir(GF_Camera *cam);\r
+\r
+#endif\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/internal/compositor_dev.h b/tstools/DtsEdit/src/gpac/internal/compositor_dev.h
new file mode 100644 (file)
index 0000000..ee2accd
--- /dev/null
@@ -0,0 +1,1161 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / Scene Rendering sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _COMPOSITOR_DEV_H_\r
+#define _COMPOSITOR_DEV_H_\r
+\r
+\r
+#include <gpac/compositor.h>\r
+/*include scene graph API*/\r
+#include <gpac/thread.h>\r
+/*bridge between the rendering engine and the systems media engine*/\r
+#include <gpac/mediaobject.h>\r
+\r
+/*raster2D API*/\r
+#include <gpac/modules/raster2d.h>\r
+/*font engine API*/\r
+#include <gpac/modules/font.h>\r
+/*AV hardware API*/\r
+#include <gpac/modules/video_out.h>\r
+#include <gpac/modules/audio_out.h>\r
+\r
+/*SVG properties*/\r
+#ifndef GPAC_DISABLE_SVG\r
+#include <gpac/scenegraph_svg.h>\r
+#endif\r
+\r
+\r
+/*if defined, events are queued before being processed, otherwise they are handled whenever triggered*/\r
+//#define GF_SR_EVENT_QUEUE    \r
+\r
+\r
+/*use 2D caching for groups*/\r
+//#define GF_SR_USE_VIDEO_CACHE\r
+\r
+\r
+/*FPS computed on this number of frame*/\r
+#define GF_SR_FPS_COMPUTE_SIZE 30\r
+\r
+enum\r
+{\r
+       GF_SR_CFG_OVERRIDE_SIZE = 1,\r
+       GF_SR_CFG_SET_SIZE = 1<<1,\r
+       GF_SR_CFG_AR = 1<<2,\r
+       GF_SR_CFG_FULLSCREEN = 1<<3,\r
+       /*flag is set whenever we're reconfiguring visual. This will discard all UI\r
+       messages during this phase in order to avoid any deadlocks*/\r
+       GF_SR_IN_RECONFIG = 1<<4,\r
+       /*special flag indicating the set size is actually due to a notif by the plugin*/\r
+       GF_SR_CFG_WINDOWSIZE_NOTIF = 1<<10,\r
+};\r
+\r
+\r
+\r
+/*forward definition of the visual manager*/\r
+typedef struct _visual_manager GF_VisualManager;\r
+typedef struct _draw_aspect_2d DrawAspect2D;\r
+typedef struct _traversing_state GF_TraverseState;\r
+typedef struct _gf_ft_mgr GF_FontManager;\r
+\r
+#ifndef GPAC_DISABLE_3D\r
+#include <gpac/internal/camera.h>\r
+#include <gpac/internal/mesh.h>\r
+\r
+#ifdef WIN32\r
+#include <windows.h>\r
+typedef void (APIENTRY * PFNGLARBMULTITEXTUREPROC)(unsigned int target);\r
+#else\r
+typedef void (*PFNGLARBMULTITEXTUREPROC) (unsigned int target);\r
+#endif\r
+\r
+typedef struct \r
+{\r
+       Bool multisample;\r
+       Bool bgra_texture;\r
+       Bool abgr_texture;\r
+       Bool npot_texture;\r
+       Bool rect_texture;\r
+       u32 yuv_texture;\r
+       PFNGLARBMULTITEXTUREPROC glActiveTextureARB;\r
+       PFNGLARBMULTITEXTUREPROC glClientActiveTextureARB;\r
+} GLCaps;\r
+\r
+#endif\r
+\r
+#define DOUBLECLICK_TIME_MS            250\r
+\r
+enum\r
+{\r
+       /*no text selection*/\r
+       GF_SC_TSEL_NONE = 0,\r
+       /*text selection in progress*/\r
+       GF_SC_TSEL_ACTIVE,\r
+       /*text selection frozen*/\r
+       GF_SC_TSEL_FROZEN,\r
+       /*text selection has just been released*/\r
+       GF_SC_TSEL_RELEASED,\r
+};\r
+\r
+struct __tag_compositor\r
+{\r
+       /*the main user*/\r
+       GF_User *user;\r
+       /*terminal - only used for InputSensor*/\r
+       GF_Terminal *term;\r
+\r
+       /*audio renderer*/\r
+       struct _audio_render *audio_renderer;\r
+       /*video out*/\r
+       GF_VideoOutput *video_out;\r
+       /*2D rasterizer*/\r
+       GF_Raster2D *rasterizer;\r
+\r
+       /*visual rendering thread if used*/\r
+       GF_Thread *VisualThread;\r
+       /*0: not init, 1: running, 2: exit requested, 3: done*/\r
+       u32 video_th_state;\r
+\r
+       /*compositor exclusive access to the scene and display*/\r
+       GF_Mutex *mx;\r
+\r
+       /*the main scene graph*/\r
+       GF_SceneGraph *scene;\r
+       /*extra scene graphs (OSD, etc), always registered in draw order. That's the module responsability\r
+       to draw them*/\r
+       GF_List *extra_scenes;\r
+\r
+       u32 inherit_type_3d;\r
+       \r
+       /*all time nodes registered*/\r
+       GF_List *time_nodes;\r
+       /*all textures (texture handlers)*/\r
+       GF_List *textures;\r
+\r
+#ifdef GF_SR_EVENT_QUEUE\r
+       /*event queue*/\r
+       GF_List *events;\r
+       GF_Mutex *ev_mx;\r
+#endif\r
+\r
+       /*simulation frame rate*/\r
+       Double frame_rate;\r
+       u32 frame_duration;\r
+       u32 frame_time[GF_SR_FPS_COMPUTE_SIZE];\r
+       u32 current_frame;\r
+\r
+       u32 last_click_time;\r
+\r
+       /*display size*/\r
+       u32 display_width, display_height;\r
+\r
+       /*visual output location on window (we may draw background color outside of it) \r
+               vp_x & vp_y: horizontal & vertical offset of the drawing area in the video output\r
+               vp_width & vp_height: width & height of the drawing area\r
+                       * in scalable mode, this is the display size\r
+                       * in not scalable mode, this is the final drawing area size (dst_w & dst_h of the blit)\r
+       */\r
+       u32 vp_x, vp_y, vp_width, vp_height;\r
+       /*backbuffer size - in scalable mode, matches display size, otherwise matches scene size*/\r
+       u32 output_width, output_height;\r
+\r
+       /*scene size if any*/\r
+       u32 scene_width, scene_height;\r
+       Bool has_size_info;\r
+       Bool fullscreen;\r
+       /*!! paused will not stop display (this enables pausing a VRML world and still examining it)*/\r
+       Bool paused, step_mode;\r
+       Bool draw_next_frame;\r
+       /*freeze_display prevents any screen updates - needed when output driver uses direct video memory access*/\r
+       Bool is_hidden, freeze_display;\r
+\r
+       /*current frame number*/\r
+       u32 frame_number;\r
+       /*count number of initialized sensors*/\r
+       u32 interaction_sensors;\r
+\r
+       /*set whenever 3D HW ctx changes (need to rebuild dlists/textures if any used)*/\r
+       Bool reset_graphics;\r
+\r
+       /*font engine*/\r
+       GF_FontManager *font_manager;\r
+       /*set whenever a new font has been received*/\r
+       Bool reset_fonts;\r
+\r
+       /*options*/\r
+       u32 aspect_ratio, antiAlias, texture_text_mode;\r
+       Bool high_speed, stress_mode;\r
+       Bool force_opengl_2d;\r
+\r
+       /*key modif*/\r
+       u32 key_states;\r
+       u32 interaction_level;\r
+\r
+       /*size override when no size info is present\r
+               flags:  1: size override is requested (cfg)\r
+                               2: size override has been applied\r
+       */\r
+       u32 override_size_flags;\r
+\r
+       /*any of the above flags - reseted at each simulation tick*/\r
+       u32 msg_type;\r
+       /*for size*/\r
+       u32 new_width, new_height;\r
+\r
+       /*current background color*/\r
+       u32 back_color;\r
+\r
+       /*bounding box draw type: none, unit box/rect and sphere (3D only)*/\r
+       u32 draw_bvol;\r
+\r
+       /*list of system colors*/\r
+       u32 sys_colors[28];\r
+\r
+       /*all visual managers created*/\r
+       GF_List *visuals;\r
+       /*all outlines cached*/\r
+       GF_List *strike_bank;\r
+\r
+       /*main visual manager - the one managing the primary video output*/\r
+       GF_VisualManager *visual;\r
+       /*set to false whenever a new scene is attached to compositor*/\r
+       Bool root_visual_setup;\r
+       \r
+       /*indicates whether the aspect ratio shall be recomputed:\r
+               1: AR changed\r
+               2: AR changed and root visual type changed between 2D and 3D\r
+       */\r
+       u32 recompute_ar;\r
+\r
+       Bool zoom_changed;\r
+\r
+       /*traversing context*/\r
+       struct _traversing_state *traverse_state;\r
+\r
+       /*current picked node if any*/\r
+       GF_Node *grab_node;\r
+       /*current picked node's parent use if any*/\r
+       GF_Node *grab_use;\r
+       /*current focus node if any*/\r
+       GF_Node *focus_node;\r
+       /*parent use node of the current focus node if any*/\r
+       GF_Node *focus_used;\r
+       /*current parent focus node if any - needed to navigate within PROTOs*/\r
+       GF_List *focus_ancestors;\r
+       GF_List *focus_use_stack;\r
+       /*focus node uses dom events*/\r
+       Bool focus_uses_dom_events;\r
+       /*current sensor type*/\r
+       u32 sensor_type;\r
+       /*list of VRML sensors active before the picking phase (eg active at the previous pass)*/\r
+       GF_List *previous_sensors;\r
+       /*list of VRML sensors active after the picking phase*/\r
+       GF_List *sensors;\r
+       /*indicates a sensor is currently active*/\r
+       Bool grabbed_sensor;\r
+\r
+       /*hardware handle for 2D screen access - currently only used with win32 (HDC) */\r
+       void *hw_context;\r
+       /*indicates whether HW is locked*/\r
+       Bool hw_locked;\r
+       /*screen buffer for direct access*/\r
+       GF_VideoSurface hw_surface;\r
+       /*output buffer is configured in video memory*/\r
+       Bool video_memory;\r
+       /*indicate if overlays were prezsent in the previous frame*/\r
+       Bool last_had_overlays;\r
+\r
+       /*options*/\r
+       Bool scalable_zoom;\r
+       Bool enable_yuv_hw;\r
+       /*disables partial hardware blit (eg during dirty rect) to avoid artefacts*/\r
+       Bool disable_partial_hw_blit;\r
+\r
+       /*user navigation mode*/\r
+       u32 navigate_mode;\r
+       /*set if content doesn't allow navigation*/\r
+       Bool navigation_disabled;\r
+\r
+       /*user mouse navigation state:\r
+        0: not active\r
+        1: pre-active phase: mouse has been clicked and waiting for mouse move to confirm. This allows\r
+               for clicking on objects in the navigation mode\r
+        2: navigation is grabbed\r
+       */\r
+       u32 navigation_state;\r
+       /*navigation x & y grab point in scene coord system*/\r
+       Fixed grab_x, grab_y;\r
+       /*aspect ratio scale factor*/\r
+       Fixed scale_x, scale_y;\r
+       /*user zoom level*/\r
+       Fixed zoom;\r
+       /*user pan*/\r
+       Fixed trans_x, trans_y;\r
+       /*user rotation angle - ALWAYS CENTERED*/\r
+       Fixed rotation;\r
+\r
+       Bool skip_flush;\r
+#ifndef GPAC_DISABLE_SVG\r
+       u32 num_clicks;\r
+#endif\r
+\r
+       /*a dedicated drawable for focus highlight */\r
+       struct _drawable *focus_highlight;\r
+       /*highlight fill and stroke colors (ARGB)*/\r
+       u32 highlight_fill, highlight_stroke;\r
+\r
+       /*picking info*/\r
+\r
+       /*picked node*/\r
+       GF_Node *hit_node;\r
+       /*appearance at hit point - used for composite texture*/\r
+       GF_Node *hit_appear;\r
+       /*parent use stack - SVG only*/\r
+       GF_List *hit_use_stack, *prev_hit_use_stack;\r
+       /*picked node uses DOM event or VRML events ?*/\r
+       Bool hit_use_dom_events;\r
+\r
+       /*world->local and local->world transform at hit point*/\r
+       GF_Matrix hit_world_to_local, hit_local_to_world;\r
+       /*hit point in local coord & world coord*/\r
+       SFVec3f hit_local_point, hit_world_point;\r
+       /*tex coords at hit point*/\r
+       SFVec2f hit_texcoords;\r
+       /*picking ray in world coord system*/\r
+       GF_Ray hit_world_ray;\r
+       /*normal at hit point, local coord system*/\r
+       SFVec3f hit_normal;\r
+       /*distance from ray origin used to discards further hits - FIXME: may not properly work with transparent layer3D*/\r
+       Fixed hit_square_dist;\r
+\r
+       /*text selection and edition*/\r
+\r
+       /*the active parent text node under selection*/\r
+       GF_Node *text_selection;\r
+       /*text selection start/end in world coord system*/\r
+       SFVec2f start_sel, end_sel;     \r
+       /*text selection state*/ \r
+       u32 store_text_state;\r
+       /*parent text node when a text is hit (to handle tspan selection)*/\r
+       GF_Node *hit_text;\r
+       u32 sel_buffer_len, sel_buffer_alloc;\r
+       u16 *sel_buffer;\r
+       u8 *selected_text;\r
+       /*text selection color - reverse video not yet supported*/\r
+       u32 text_sel_color;\r
+\r
+       /*set whenever the focus node is a text node*/\r
+       u32 focus_text_type;\r
+       Bool edit_is_tspan;\r
+       /*pointer to edited text*/\r
+       char **edited_text;\r
+       u32 caret_pos, dom_text_pos;\r
+\r
+#ifndef GPAC_DISABLE_3D\r
+       /*options*/\r
+       /*emulate power-of-2 for video texturing by using a po2 texture and texture scaling. If any textureTransform\r
+       is applied to this texture, black stripes will appear on the borders.\r
+       If not set video is written through glDrawPixels with bitmap (slow scaling), or converted to\r
+       po2 texture*/\r
+       Bool emul_pow2;\r
+       /*use openGL for outline rather than vectorial ones*/\r
+       Bool raster_outlines;\r
+       /*disable RECT extensions (except for Bitmap...)*/\r
+       Bool disable_rect_ext;\r
+       /*disable RECT extensions (except for Bitmap...)*/\r
+       Bool bitmap_use_pixels;\r
+       /*disable RECT extensions (except for Bitmap...)*/\r
+       u32 draw_normals;\r
+       /*backface cull type: 0 off, 1: on, 2: on with transparency*/\r
+       u32 backcull;\r
+       /*polygon atialiasing*/\r
+       Bool poly_aa;\r
+       /*disable gluScaleImage*/\r
+       Bool disable_glu_scale;\r
+       /*wireframe/solid mode*/\r
+       u32 wiremode;\r
+       /*collision detection mode*/\r
+       u32 collide_mode;\r
+       /*gravity enabled*/\r
+       Bool gravity_on;\r
+       /*AABB tree-based culling is disabled*/\r
+       Bool disable_gl_cull;\r
+       /*YUV textures in OpenGL are disabled (soft YUV->RGB )*/\r
+       Bool disable_yuvgl;\r
+\r
+       /*unit box (1.0 size) and unit sphere (1.0 radius)*/\r
+       GF_Mesh *unit_bbox;\r
+\r
+       /*active layer3D for layer navigation - may be NULL*/\r
+       GF_Node *active_layer;\r
+\r
+       GLCaps gl_caps;\r
+\r
+       u32 offscreen_width, offscreen_height;\r
+\r
+#ifdef GPAC_USE_TINYGL\r
+       void *tgl_ctx;\r
+#endif\r
+\r
+#endif\r
+       \r
+       u32 networks_time;\r
+       u32 decoders_time;\r
+\r
+       u32 visual_config_time;\r
+       u32 traverse_setup_time;\r
+       u32 traverse_and_direct_draw_time;\r
+       u32 indirect_draw_time;\r
+\r
+#ifdef GF_SR_USE_VIDEO_CACHE\r
+       /*video cache size / max size in kbytes*/\r
+       u32 video_cache_current_size, video_cache_max_size;\r
+       u32 cache_scale, cache_tolerance;\r
+       /*sorted list (by cache priority) of cached groups - permanent for the lifetime of the scene/cache object*/\r
+       GF_List *cached_groups;\r
+       /*list of groups being cached in one frame */\r
+       GF_List *cached_groups_queue;\r
+#endif\r
+\r
+       /*used for -depth dump*/\r
+       Fixed OGLDepthGain; /*gain applied to OpenGL depth buffer, a float [0..1])*/\r
+       Fixed OGLDepthOffset; /*offset applied to OpenGL depth buffer*/\r
+       \r
+#ifdef GPAC_TRISCOPE_MODE\r
+       void *RenoirHandler;\r
+#endif\r
+       \r
+};\r
+\r
+\r
+/*base stack for timed nodes (nodes that activate themselves at given times)\r
+       @UpdateTimeNode: shall be setup by the node handler and is called once per simulation frame\r
+       @is_registerd: all handlers indicate store their state if wanted (provided for conveniency but not inspected by the compositor)\r
+       @needs_unregister: all handlers indicate they can be removed from the list of active time nodes\r
+in order to save time. THIS IS INSPECTED by the compositor at each simulation tick after calling UpdateTimeNode\r
+and if set, the node is removed right away from the list\r
+*/\r
+typedef struct _time_node\r
+{\r
+       void (*UpdateTimeNode)(struct _time_node *);\r
+       Bool is_registered, needs_unregister;\r
+       /*user data*/\r
+       void *udta;\r
+} GF_TimeNode;\r
+\r
+void gf_sc_register_time_node(GF_Compositor *sr, GF_TimeNode *tn);\r
+void gf_sc_unregister_time_node(GF_Compositor *sr, GF_TimeNode *tn);\r
+\r
+enum\r
+{\r
+       /*texture repeat along s*/\r
+       GF_SR_TEXTURE_REPEAT_S = (1<<0),\r
+       /*texture repeat along t*/\r
+       GF_SR_TEXTURE_REPEAT_T = (1<<1),\r
+       /*texture is a matte texture*/\r
+       GF_SR_TEXTURE_MATTE = (1<<2),\r
+       /*texture doesn't need vertical flip for OpenGL*/\r
+       GF_SR_TEXTURE_NO_GL_FLIP = (1<<3),\r
+       /*Set durin a composition cycle. If not set at the end of the cycle, \r
+       the hardware binding is released*/\r
+       GF_SR_TEXTURE_USED = (1<<4),\r
+};\r
+\r
+typedef struct _gf_sc_texture_handler\r
+{\r
+       GF_Node *owner;\r
+       GF_Compositor *compositor;\r
+       /*low-level texture object - this is not exposed out of libgpac*/\r
+       struct __texture_wrapper *tx_io;\r
+       /*media stream*/\r
+       GF_MediaObject *stream;\r
+       /*texture is open (for DEF/USE)*/\r
+       Bool is_open;\r
+       /*this is needed in case the Url is changed - note that media nodes cannot point to different\r
+       URLs (when they could in VRML), the MF is only holding media segment descriptions*/\r
+       MFURL current_url;\r
+       /*to override by each texture node*/\r
+       void (*update_texture_fcnt)(struct _gf_sc_texture_handler *txh);\r
+       /*needs_release if a visual frame is grabbed (not used by modules)*/\r
+       Bool needs_release;\r
+       /*stream_finished: indicates stream is over (not used by modules)*/\r
+       Bool stream_finished;\r
+       /*needs_refresh: indicates texture content has been changed - needed by modules performing tile drawing*/\r
+       Bool needs_refresh;\r
+       /*needed to discard same frame fetch*/\r
+       u32 last_frame_time;\r
+       /*active display in the texture (0, 0 == top, left)*/\r
+       //GF_Rect active_window;\r
+       /*texture is transparent*/              \r
+       Bool transparent;\r
+       /*flags for user - the repeatS and repeatT are set upon creation, the rest is NEVER touched by compositor*/\r
+       u32 flags;\r
+       /*gradients are relative to the object bounds, therefore a gradient is not the same if used on 2 different\r
+       objects - since we don't want to build an offscreen texture for the gradient, gradients have to be updated \r
+       at each draw - the matrix shall be updated to the gradient transformation in the local system\r
+       MUST be set for gradient textures*/\r
+       void (*compute_gradient_matrix)(struct _gf_sc_texture_handler *txh, GF_Rect *bounds, GF_Matrix2D *mat, Bool for_3d);\r
+\r
+       /*image data for natural media*/\r
+       char *data;\r
+       u32 width, height, stride, pixelformat, pixel_ar;\r
+       /*if set texture has been transformed by MatteTexture -> disable blit*/\r
+       Bool has_cmat;\r
+\r
+       /*matteTexture parent if any*/\r
+       GF_Node *matteTexture;\r
+       \r
+\r
+#ifdef GPAC_TRISCOPE_MODE\r
+\r
+       void *RenoirObject;\r
+       \r
+#endif\r
+       \r
+       \r
+} GF_TextureHandler;\r
+\r
+/*setup texturing object*/\r
+void gf_sc_texture_setup(GF_TextureHandler *hdl, GF_Compositor *sr, GF_Node *owner);\r
+/*destroy texturing object*/\r
+void gf_sc_texture_destroy(GF_TextureHandler *txh);\r
+\r
+/*return texture handle for built-in textures (movieTexture, ImageTexture and PixelTexture)*/\r
+GF_TextureHandler *gf_sc_texture_get_handler(GF_Node *n);\r
+\r
+/*these ones are needed by modules only for Background(2D) handling*/\r
+\r
+/*returns 1 if url changed from current one*/\r
+Bool gf_sc_texture_check_url_change(GF_TextureHandler *txh, MFURL *url);\r
+/*starts associated object*/\r
+GF_Err gf_sc_texture_play(GF_TextureHandler *txh, MFURL *url);\r
+GF_Err gf_sc_texture_play_from_to(GF_TextureHandler *txh, MFURL *url, Double start_offset, Double end_offset, Bool can_loop, Bool lock_scene_timeline);\r
+/*stops associated object*/\r
+void gf_sc_texture_stop(GF_TextureHandler *txh);\r
+/*restarts associated object - DO NOT CALL stop/start*/\r
+void gf_sc_texture_restart(GF_TextureHandler *txh);\r
+/*common routine for all video texture: fetches a frame and update the 2D texture object */\r
+void gf_sc_texture_update_frame(GF_TextureHandler *txh, Bool disable_resync);\r
+/*release video memory if needed*/\r
+void gf_sc_texture_release_stream(GF_TextureHandler *txh);\r
+\r
+\r
+\r
+/*sensor node handler - this is not defined as a stack because Anchor is both a grouping node and a \r
+sensor node, and we DO need the groupingnode stack...*/\r
+typedef struct _sensor_handler\r
+{\r
+       /*sensor enabled or not ?*/\r
+       Bool (*IsEnabled)(GF_Node *node);\r
+       /*user input on sensor:\r
+       is_over: pointing device is over a shape the sensor is attached to\r
+       evt_type: mouse event type\r
+       compositor: pointer to compositor - hit info is stored at compositor level\r
+       */\r
+       void (*OnUserEvent)(struct _sensor_handler *sh, Bool is_over, GF_Event *ev, GF_Compositor *compositor);\r
+       /*pointer to the sensor node*/\r
+       GF_Node *sensor;\r
+} GF_SensorHandler;\r
+\r
+/*returns TRUE if the node is a pointing device sensor node that can be stacked during traversing (all sensor except anchor)*/\r
+Bool compositor_mpeg4_is_sensor_node(GF_Node *node);\r
+/*returns associated sensor handler from traversable stack (the node handler is always responsible for creation/deletion)\r
+returns NULL if not a sensor or sensor is not activated*/\r
+GF_SensorHandler *compositor_mpeg4_get_sensor_handler(GF_Node *n);\r
+\r
+/*rendering modes*/\r
+enum\r
+{\r
+       /*regular traversing mode for z-sorting:\r
+               - 2D mode: builds the display list (may draw directly if requested)\r
+               - 3D mode: sort & queue transparent objects\r
+       */\r
+       TRAVERSE_SORT = 0,\r
+       /*explicit draw routine used when flushing 2D display list*/\r
+       TRAVERSE_DRAW_2D,\r
+       /*pick routine*/\r
+       TRAVERSE_PICK,\r
+       /*get bounds routine: returns bounds in local coord system (including node transform if any)*/\r
+       TRAVERSE_GET_BOUNDS,\r
+       /*set to signal bindable render - only called on bindable stack top if present.\r
+       for background (drawing request), viewports/viewpoints fog and navigation (setup)\r
+       all other nodes SHALL NOT RESPOND TO THIS CALL\r
+       */\r
+       TRAVERSE_BINDABLE,\r
+\r
+       /*writes the text selection into the compositor buffer - we need a traversing mode for this operation\r
+       to handle properly text and tspans*/\r
+       TRAVERSE_GET_TEXT,\r
+\r
+#ifndef GPAC_DISABLE_3D\r
+       /*explicit draw routine used when flushing 3D display list*/\r
+       TRAVERSE_DRAW_3D,\r
+       /*set global lights on. Since the model_matrix is not pushed to the target in this \r
+       pass, global lights shall not forget to do it (cf lighting.c)*/\r
+       TRAVERSE_LIGHTING,\r
+       /*collision routine*/\r
+       TRAVERSE_COLLIDE,\r
+#endif\r
+};\r
+\r
+\r
+typedef struct _group_cache_candidate GF_CacheCandidate;\r
+\r
+\r
+\r
+#define MAX_USER_CLIP_PLANES           4\r
+\r
+/*the traversing context: set_up at top-level and passed through SFNode_Render. Each node is responsible for \r
+restoring the context state before returning*/\r
+struct _traversing_state\r
+{\r
+       struct _audio_group *audio_parent;\r
+       struct _soundinterface *sound_holder;\r
+\r
+#ifndef GPAC_DISABLE_SVG\r
+       SVGPropertiesPointers *svg_props;\r
+       u32 svg_flags;\r
+#endif\r
+\r
+       /*current traversing mode*/\r
+       u32 traversing_mode;\r
+       /*for 2D drawing, indicates objects are to be drawn as soon as traversed, at each frame*/\r
+       Bool direct_draw;\r
+       /*current subtree is part of a switched-off subtree (needed for audio)*/\r
+       Bool switched_off;\r
+       /*set by the traversed subtree to indicate no cull shall be performed*/\r
+       Bool disable_cull;\r
+\r
+       /*indicates if we are in a layer or not*/\r
+       Bool is_layer;\r
+       /*current graph traversed is in pixel metrics*/\r
+       Bool pixel_metrics;\r
+       /*minimal half-dimension (w/2, h/2)*/\r
+       Fixed min_hsize;\r
+\r
+       /*indicates if the current subtree is fliped compared to the target visual*/\r
+       Bool fliped_coords;\r
+\r
+       /*current size of viewport being traverse (root scene, layers)*/\r
+       SFVec2f vp_size;\r
+\r
+       /*the one and only visual manager currently being traversed*/\r
+       GF_VisualManager *visual;\r
+       \r
+       /*current background and viewport stacks*/\r
+       GF_List *backgrounds;\r
+       GF_List *viewpoints;\r
+\r
+       /*current transformation from top-level*/\r
+       GF_Matrix2D transform;\r
+       /*current color transformation from top-level*/\r
+       GF_ColorMatrix color_mat;\r
+       /* Contains the viewbox transform, used for svg ref() transform */\r
+       GF_Matrix2D vb_transform;\r
+\r
+       /*if set all nodes shall be redrawn - set only at specific places in the tree*/\r
+       Bool invalidate_all;\r
+\r
+       /*text splitting: 0: no splitting, 1: word by word, 2:letter by letter*/\r
+       u32 text_split_mode;\r
+       /*1-based idx of text element drawn*/\r
+       u32 text_split_idx;\r
+\r
+       /*all VRML sensors for the current level*/\r
+       GF_List *vrml_sensors;\r
+\r
+       /*current appearance when traversing geometry nodes*/\r
+       GF_Node *appear;\r
+       /*parent group for composition: can be Form, Layout or Layer2D*/\r
+       struct _parent_node_2d *parent;\r
+\r
+       /*group/object bounds in local coordinate system*/\r
+       GF_Rect bounds;\r
+\r
+       /*node for which bounds should be fetched - SVG only*/\r
+       GF_Node *for_node;\r
+       Bool abort_bounds_traverse;\r
+       GF_Matrix2D mx_at_node;\r
+       Bool ignore_strike;\r
+       \r
+       GF_List *use_stack;\r
+       /* Styling Property and others for SVG context */\r
+#ifndef GPAC_DISABLE_SVG\r
+       SVG_Number *parent_use_opacity;\r
+       SVGAllAttributes *parent_anim_atts;\r
+\r
+       /*SVG text rendering state*/\r
+       Bool in_svg_text;\r
+       Bool in_svg_text_area;\r
+\r
+       /* current chunk & position of last placed text chunk*/\r
+       u32 chunk_index;\r
+       Fixed text_end_x, text_end_y;\r
+\r
+       /* text & tspan state*/\r
+       GF_List *x_anchors;\r
+       SVG_Coordinates *text_x, *text_y, *text_rotate;\r
+       u32 count_x, count_y, count_rotate, idx_rotate;\r
+\r
+       /* textArea state*/\r
+       Fixed max_length, max_height;\r
+       Fixed base_x, base_y;\r
+       Fixed line_spacing;\r
+       Fixed base_shift;\r
+       /*quick and dirty hack to try to solve xml:space across text and tspans without \r
+       flattening the DOMText nodes\r
+       0: first block of text\r
+       1: previous block of text ended with a space\r
+       2: previous block of text did NOT end with a space\r
+       */\r
+       u32 last_char_type;\r
+       /*in textArea, indicates that the children bounds must be refreshed due to a baseline adjustment*/\r
+       u32 refresh_children_bounds;\r
+#endif\r
+       GF_Node *text_parent;\r
+\r
+       /*current context to be drawn - only set when drawing in 2D mode or 3D for SVG*/\r
+       struct _drawable_context *ctx;\r
+\r
+       /*world ray for picking - in 2D, orig is 2D mouse pos and direction is -z*/\r
+       GF_Ray ray;\r
+\r
+       /*we have 2 clippers, one for regular clipping (layout, form if clipping) which is maintained in world coord system\r
+       and one for layer2D which is maintained in parent coord system (cf layer rendering). The layer clipper\r
+       is used only when cascading layers - layer3D doesn't use clippers*/\r
+       Bool has_clip, has_layer_clip;\r
+       /*active clipper in world coord system */\r
+       GF_Rect clipper, layer_clipper;\r
+\r
+       \r
+       /*set when traversing a cached group during offscreen bitmap construction.*/\r
+       Bool in_group_cache;\r
+\r
+\r
+#ifndef GPAC_DISABLE_3D\r
+       /*the current camera*/\r
+       GF_Camera *camera;\r
+\r
+       /*current object (model) transformation from top-level, view is NOT included*/\r
+       GF_Matrix model_matrix;\r
+\r
+       /*fog bind stack*/\r
+       GF_List *fogs; /*holds fogs info*/\r
+       /*navigation bind stack*/\r
+       GF_List *navigations;\r
+\r
+       /*when drawing, signals the mesh is transparent (enables blending)*/\r
+       Bool mesh_is_transparent;\r
+       /*when drawing, signals the number of textures used by the mesh*/\r
+       u32 mesh_num_textures;\r
+\r
+       /*bounds for TRAVERSE_GET_BOUNDS and background rendering*/\r
+       GF_BBox bbox;\r
+\r
+       /*cull flag (used to skip culling of children when parent bbox is completely inside/outside frustum)*/\r
+       u32 cull_flag;\r
+\r
+       /*toggle local lights on/off - field is ONLY valid in TRAVERSE_RENDER mode, and local lights\r
+       are always set off in reverse order as when set on*/\r
+       Bool local_light_on;\r
+       /*current directional ligths contexts - only valid in TRAVERSE_RENDER*/\r
+       GF_List *local_lights;\r
+\r
+       /*clip planes in world coords*/\r
+       GF_Plane clip_planes[MAX_USER_CLIP_PLANES];\r
+       u32 num_clip_planes;\r
+\r
+\r
+       /*layer traversal state:\r
+               set to the first traversed layer3D when picking\r
+               set to the current layer3D traversed when rendering 3D to an offscreen bitmap. This alows other \r
+                       nodes (typically bindables) seting the layer dirty flags to force a redraw \r
+       */\r
+       GF_Node *layer3d;\r
+#endif\r
+\r
+       \r
+       /*depth z-axis info for 2D scenes in triscope mode*/\r
+       Fixed depth;\r
+\r
+#ifdef GF_SR_USE_VIDEO_CACHE\r
+       /*set to 1 if cache evaluation can be skipped - this is only set when there is not enough memory \r
+       to cache a sub-group, in which case the group cannot be cached (we're caching in display coordinates)*/\r
+       Bool cache_too_small;\r
+#endif\r
+};\r
+\r
+/*\r
+       Audio mixer - MAX 6 CHANNELS SUPPORTED\r
+*/\r
+\r
+/*the audio object as used by the mixer. All audio nodes need to implement this interface*/\r
+typedef struct _audiointerface\r
+{\r
+       /*fetch audio data for a given audio delay (~soundcard drift) - if delay is 0 sync should not be performed \r
+       (eg intermediate mix) */\r
+       char *(*FetchFrame) (void *callback, u32 *size, u32 audio_delay_ms);\r
+       /*release a number of bytes in the indicated frame (ts)*/\r
+       void (*ReleaseFrame) (void *callback, u32 nb_bytes);\r
+       /*get media speed*/\r
+       Fixed (*GetSpeed)(void *callback);\r
+       /*gets volume for each channel - vol = Fixed[6]. returns 1 if volume shall be changed (!= 1.0)*/\r
+       Bool (*GetChannelVolume)(void *callback, Fixed *vol);\r
+       /*returns 1 if muted*/\r
+       Bool (*IsMuted)(void *callback);\r
+       /*user callback*/\r
+       void *callback;\r
+       /*returns 0 if config is not known yet or changed, \r
+       otherwise AND IF @for_reconf is set, updates member var below and return TRUE\r
+       You may return 0 to force parent user invalidation*/\r
+       Bool (*GetConfig)(struct _audiointerface *ai, Bool for_reconf);\r
+       /*updated cfg, or 0 otherwise*/\r
+       u32 chan, bps, samplerate, ch_cfg;\r
+} GF_AudioInterface;\r
+\r
+typedef struct __audiomix GF_AudioMixer;\r
+\r
+/*create mixer - ar is NULL for any sub-mixers, or points to the main audio renderer (mixer outputs to sound driver)*/\r
+GF_AudioMixer *gf_mixer_new(struct _audio_render *ar);\r
+void gf_mixer_del(GF_AudioMixer *am);\r
+void gf_mixer_remove_all(GF_AudioMixer *am);\r
+void gf_mixer_add_input(GF_AudioMixer *am, GF_AudioInterface *src);\r
+void gf_mixer_remove_input(GF_AudioMixer *am, GF_AudioInterface *src);\r
+void gf_mixer_lock(GF_AudioMixer *am, Bool lockIt);\r
+/*mix inputs in buffer, return number of bytes written to output*/\r
+u32 gf_mixer_get_output(GF_AudioMixer *am, void *buffer, u32 buffer_size);\r
+/*reconfig all sources if needed - returns TRUE if main audio config changed\r
+NOTE: this is called at each gf_mixer_get_output by the mixer. To call externally for audio hardware\r
+reconfiguration only*/\r
+Bool gf_mixer_reconfig(GF_AudioMixer *am);\r
+/*retrieves mixer cfg*/\r
+void gf_mixer_get_config(GF_AudioMixer *am, u32 *outSR, u32 *outCH, u32 *outBPS, u32 *outChCfg);\r
+/*called by audio renderer in case the hardware used a different setup than requested*/\r
+void gf_mixer_set_config(GF_AudioMixer *am, u32 outSR, u32 outCH, u32 outBPS, u32 ch_cfg);\r
+Bool gf_mixer_is_src_present(GF_AudioMixer *am, GF_AudioInterface *ifce);\r
+u32 gf_mixer_get_src_count(GF_AudioMixer *am);\r
+void gf_mixer_force_chanel_out(GF_AudioMixer *am, u32 num_channels);\r
+u32 gf_mixer_get_block_align(GF_AudioMixer *am);\r
+Bool gf_mixer_must_reconfig(GF_AudioMixer *am);\r
+Bool gf_mixer_empty(GF_AudioMixer *am);\r
+\r
+/*the audio renderer*/\r
+typedef struct _audio_render\r
+{\r
+       GF_AudioOutput *audio_out;\r
+\r
+       Bool disable_resync;\r
+       Bool disable_multichannel;\r
+\r
+       /*startup time (the audio renderer is used when present as the system clock)*/\r
+       u32 startTime;\r
+       /*frozen time counter if set*/\r
+       Bool Frozen;\r
+       u32 FreezeTime;\r
+       \r
+       /*final output*/\r
+       GF_AudioMixer *mixer;\r
+       Bool need_reconfig;\r
+       /*client*/\r
+       GF_User *user;\r
+\r
+       /*audio thread if output not self-threaded*/\r
+       GF_Thread *th;\r
+       /*thread state: 0: not intit, 1: running, 2: waiting for stop, 3: done*/\r
+       u32 audio_th_state;\r
+\r
+       u32 audio_delay, volume, pan;\r
+} GF_AudioRenderer;\r
+\r
+/*creates audio renderer*/\r
+GF_AudioRenderer *gf_sc_ar_load(GF_User *user);\r
+/*deletes audio renderer*/\r
+void gf_sc_ar_del(GF_AudioRenderer *ar);\r
+/*control audio renderer - CtrlType:\r
+       0: pause\r
+       1: resume\r
+       2: clean HW buffer and play\r
+*/\r
+void gf_sc_ar_control(GF_AudioRenderer *ar, u32 CtrlType);\r
+/*set volume and pan*/\r
+void gf_sc_ar_set_volume(GF_AudioRenderer *ar, u32 Volume);\r
+void gf_sc_ar_set_pan(GF_AudioRenderer *ar, u32 Balance);\r
+/*set audio priority*/\r
+void gf_sc_ar_set_priority(GF_AudioRenderer *ar, u32 priority);\r
+/*gets time in msec - this is the only clock used by the whole ESM system - depends on the audio driver*/\r
+u32 gf_sc_ar_get_clock(GF_AudioRenderer *ar);\r
+/*reset all input nodes*/\r
+void gf_sc_ar_reset(GF_AudioRenderer *ar);\r
+/*add audio node*/\r
+void gf_sc_ar_add_src(GF_AudioRenderer *ar, GF_AudioInterface *source);\r
+/*remove audio node*/\r
+void gf_sc_ar_remove_src(GF_AudioRenderer *ar, GF_AudioInterface *source);\r
+/*reconfig audio hardware if needed*/\r
+void gf_sc_ar_reconfig(GF_AudioRenderer *ar);\r
+u32 gf_sc_ar_get_delay(GF_AudioRenderer *ar);\r
+\r
+/*the sound node interface for intensity & spatialization*/\r
+typedef struct _soundinterface\r
+{\r
+       /*gets volume for each channel - vol = Fixed[6]. returns 1 if volume shall be changed (!= 1.0)\r
+       if NULL channels are always at full intensity*/\r
+       Bool (*GetChannelVolume)(GF_Node *owner, Fixed *vol);\r
+       /*get sound priority (0: min, 255: max) - used by mixer to determine*/\r
+       u8 (*GetPriority) (GF_Node *owner);\r
+       /*node owning the structure*/\r
+       GF_Node *owner;\r
+} GF_SoundInterface;\r
+\r
+/*audio common to AudioClip and AudioSource*/\r
+typedef struct\r
+{\r
+       GF_Node *owner;\r
+       GF_Compositor *compositor;\r
+       GF_AudioInterface input_ifce;\r
+       /*can be NULL if the audio node generates its output from other input*/\r
+       GF_MediaObject *stream;\r
+       /*object speed and intensity*/\r
+       Fixed speed, intensity;\r
+       Bool stream_finished;\r
+       Bool need_release;\r
+       MFURL url;\r
+       u32 is_open;\r
+       Bool is_muted;\r
+       Bool register_with_renderer, register_with_parent;\r
+\r
+       GF_SoundInterface *snd;\r
+} GF_AudioInput;\r
+/*setup interface with audio renderer - overwrite any functions needed after setup EXCEPT callback object*/\r
+void gf_sc_audio_setup(GF_AudioInput *ai, GF_Compositor *sr, GF_Node *node);\r
+/*open audio object*/\r
+GF_Err gf_sc_audio_open(GF_AudioInput *ai, MFURL *url, Double clipBegin, Double clipEnd);\r
+/*closes audio object*/\r
+void gf_sc_audio_stop(GF_AudioInput *ai);\r
+/*restarts audio object (cf note in MediaObj)*/\r
+void gf_sc_audio_restart(GF_AudioInput *ai);\r
+\r
+Bool gf_sc_audio_check_url(GF_AudioInput *ai, MFURL *url);\r
+\r
+/*base grouping audio node (nodes with several audio sources as children)*/\r
+#define AUDIO_GROUP_NODE       \\r
+       GF_AudioInput output;           \\r
+       void (*add_source)(struct _audio_group *_this, GF_AudioInput *src);     \\r
+\r
+typedef struct _audio_group\r
+{\r
+       AUDIO_GROUP_NODE\r
+} GF_AudioGroup;\r
+\r
+\r
+/*register audio node with parent audio renderer (mixer or main renderer)*/\r
+void gf_sc_audio_register(GF_AudioInput *ai, GF_TraverseState *tr_state);\r
+void gf_sc_audio_unregister(GF_AudioInput *ai);\r
+\r
+\r
+#ifndef GPAC_DISABLE_SVG\r
+GF_Err gf_term_get_mfurl_from_xlink(GF_Node *node, MFURL *mfurl);\r
+Fixed gf_sc_svg_convert_length_to_display(GF_Compositor *sr, SVG_Length *length);\r
+\r
+char *gf_term_resolve_xlink(GF_Node *node, char *the_url);\r
+#endif\r
+\r
+GF_Err compositor_2d_set_aspect_ratio(GF_Compositor *sr);\r
+void compositor_2d_set_user_transform(GF_Compositor *sr, Fixed zoom, Fixed tx, Fixed ty, Bool is_resize) ;\r
+GF_Err compositor_2d_get_video_access(GF_VisualManager *surf);\r
+void compositor_2d_release_video_access(GF_VisualManager *surf);\r
+Bool compositor_2d_draw_bitmap(GF_VisualManager *visual, GF_TraverseState *tr_state, struct _drawable_context *ctx, GF_ColorKey *col_key);\r
+GF_Rect compositor_2d_update_clipper(GF_TraverseState *tr_state, GF_Rect this_clip, Bool *need_restore, GF_Rect *original, Bool for_layer);\r
+\r
+Bool compositor_get_2d_plane_intersection(GF_Ray *ray, SFVec3f *res);\r
+\r
+void compositor_send_resize_event(GF_Compositor *compositor, Fixed old_z, Fixed old_tx, Fixed old_ty, Bool is_resize);\r
+\r
+void compositor_set_cache_memory(GF_Compositor *compositor, u32 memory);\r
+/*checks whether the background node is transparent or not*/\r
+Bool compositor_background_transparent(GF_Node *node);\r
+\r
+#ifndef GPAC_DISABLE_3D\r
+\r
+GF_Err compositor_3d_set_aspect_ratio(GF_Compositor *sr);\r
+GF_Camera *compositor_3d_get_camera(GF_Compositor *sr);\r
+void compositor_3d_reset_camera(GF_Compositor *sr);\r
+GF_Camera *compositor_layer3d_get_camera(GF_Node *node);\r
+void compositor_layer3d_bind_camera(GF_Node *node, Bool do_bind, u32 nav_value);\r
+void compositor_3d_draw_bitmap(struct _drawable *stack, DrawAspect2D *asp, GF_TraverseState *tr_state, Fixed width, Fixed height, Fixed bmp_scale_x, Fixed bmp_scale_y);\r
+\r
+GF_Err compositor_3d_get_screen_buffer(GF_Compositor *sr, GF_VideoSurface *fb, Bool depth_buffer);\r
+GF_Err compositor_3d_release_screen_buffer(GF_Compositor *sr, GF_VideoSurface *framebuffer);\r
+\r
+void gf_sc_load_opengl_extensions(GF_Compositor *sr);\r
+\r
+#endif\r
+\r
+Bool gf_sc_exec_event(GF_Compositor *sr, GF_Event *evt);\r
+void gf_sc_get_nodes_bounds(GF_Node *self, GF_ChildNodeItem *children, GF_TraverseState *tr_state, s32 *child_idx);\r
+\r
+\r
+void gf_sc_visual_register(GF_Compositor *sr, GF_VisualManager *surf);\r
+void gf_sc_visual_unregister(GF_Compositor *sr, GF_VisualManager *surf);\r
+Bool gf_sc_visual_is_registered(GF_Compositor *sr, GF_VisualManager *surf);\r
+\r
+Bool gf_sc_pick_in_clipper(GF_TraverseState *tr_state, GF_Rect *clip);\r
+\r
+void compositor_gradient_update(GF_TextureHandler *txh);\r
+void compositor_set_ar_scale(GF_Compositor *sr, Fixed scaleX, Fixed scaleY);\r
+\r
+/*reset focus if node being deleted has the focus - must be called for each focusable node (internally called for 2D & 3D drawable nodes)*/\r
+void gf_sc_check_focus_upon_destroy(GF_Node *n);\r
+\r
+#ifndef GPAC_DISABLE_SVG\r
+\r
+void compositor_svg_build_gradient_texture(GF_TextureHandler *txh);\r
+\r
+/*base routine fo all svg elements:\r
+       - check for conditional processing (requiredXXX, ...)\r
+       - apply animation and inheritance\r
+\r
+       returns 0 if the node shall not be traversed due to conditional processing\r
+*/\r
+Bool compositor_svg_traverse_base(GF_Node *node, SVGAllAttributes *all_atts, GF_TraverseState *tr_state, SVGPropertiesPointers *backup_props, u32 *backup_flags);\r
+Bool compositor_svg_is_display_off(SVGPropertiesPointers *props);\r
+void compositor_svg_apply_local_transformation(GF_TraverseState *tr_state, SVGAllAttributes *atts, GF_Matrix2D *backup_matrix_2d, GF_Matrix *backup_matrix);\r
+void compositor_svg_restore_parent_transformation(GF_TraverseState *tr_state, GF_Matrix2D *backup_matrix_2d, GF_Matrix *backup_matrix);\r
+\r
+void compositor_svg_traverse_children(GF_ChildNodeItem *children, GF_TraverseState *tr_state);\r
+\r
+Bool compositor_svg_evaluate_conditional(GF_Compositor *compositor, SVGAllAttributes *all_atts);\r
+\r
+/*returns the node associated with the given xlink - this is not always the target node of the xlink structure due\r
+to async restart of animation nodes*/\r
+GF_Node *compositor_svg_get_xlink_resource_node(GF_Node *node, XMLRI *xlink);\r
+\r
+#endif\r
+\r
+/*Text handling*/\r
+\r
+typedef struct _gf_font GF_Font;\r
+\r
+struct _gf_font \r
+{\r
+       /*fonts are linked within the font manager*/\r
+       GF_Font *next;\r
+       /*list of glyphs in the font*/\r
+       GF_Glyph *glyph;\r
+\r
+       char *name;\r
+       u32 em_size;\r
+       u32 styles;\r
+       /*font uits in em size*/\r
+       s32 ascent, descent, underline, line_spacing, max_advance_h, max_advance_v;\r
+       s32 baseline;\r
+\r
+       /*only set for embedded font engines (SVG fonts)*/\r
+       GF_Font *(*get_alias)(void *udta);\r
+       GF_Err (*get_glyphs)(void *udta, const char *utf_string, u32 *glyph_ids_buffer, u32 *io_glyph_ids_buffer_size, const char *xml_lang, Bool *is_rtl);\r
+       GF_Glyph *(*load_glyph)(void *udta, u32 glyph_name);\r
+       void *udta;\r
+\r
+       Bool not_loaded;\r
+\r
+       struct _gf_ft_mgr *ft_mgr;\r
+       /*list of spans currently using the font - this is needed to allow for dynamic discard of the font*/\r
+       GF_List *spans;\r
+};\r
+\r
+enum \r
+{\r
+       /*span direction is horizontal*/\r
+       GF_TEXT_SPAN_HORIZONTAL = 1,\r
+       /*span is underlined*/\r
+       GF_TEXT_SPAN_UNDERLINE = 1<<1,\r
+       /*span is fliped (coord systems with Y-axis pointing downwards like SVG)*/\r
+       GF_TEXT_SPAN_FLIP = 1<<2,\r
+       /*span is in the current text selection*/\r
+       GF_TEXT_SPAN_RIGHT_TO_LEFT = 1<<3,\r
+       /*span is in the current text selection*/\r
+       GF_TEXT_SPAN_SELECTED = 1<<4\r
+};\r
+\r
+typedef struct __text_span\r
+{\r
+       GF_Font *font;\r
+       \r
+       GF_Glyph **glyphs;\r
+       u32 nb_glyphs;\r
+\r
+       u32 flags;\r
+\r
+       Fixed font_size;\r
+\r
+       /*scale to apply to get to requested font size*/\r
+       Fixed font_scale;\r
+       GF_Rect bounds;\r
+\r
+       /*MPEG-4 span scaling (length & maxExtend)*/\r
+       Fixed x_scale, y_scale;\r
+       /*x (resp. y) offset in local coord system. Ignored if per-glyph dx (resp dy) are specified*/\r
+       Fixed off_x, off_y;\r
+\r
+       /*per-glyph positioning - when allocated, this is the same number as the glyphs*/\r
+       Fixed *dx, *dy, *rot;\r
+\r
+       /*span language*/\r
+//     const char *lang;\r
+\r
+       /*span texturing and 3D tools*/\r
+       struct _span_internal *ext;\r
+\r
+       /*SVG stuff :(*/\r
+       GF_Node *anchor;\r
+       GF_Node *user;\r
+} GF_TextSpan;\r
+\r
+GF_FontManager *gf_font_manager_new(GF_User *user);\r
+void gf_font_manager_del(GF_FontManager *fm);\r
+\r
+GF_Font *gf_font_manager_set_font(GF_FontManager *fm, char **alt_fonts, u32 nb_fonts, u32 styles);\r
+GF_Font *gf_font_manager_set_font_ex(GF_FontManager *fm, char **alt_fonts, u32 nb_fonts, u32 styles, Bool check_only);\r
+\r
+GF_TextSpan *gf_font_manager_create_span(GF_FontManager *fm, GF_Font *font, char *span, Fixed font_size, Bool needs_x_offset, Bool needs_y_offset, Bool needs_rotate, const char *lang, Bool fliped_text, u32 styles, GF_Node *user);\r
+void gf_font_manager_delete_span(GF_FontManager *fm, GF_TextSpan *tspan);\r
+\r
+GF_Err gf_font_manager_register_font(GF_FontManager *fm, GF_Font *font);\r
+GF_Err gf_font_manager_unregister_font(GF_FontManager *fm, GF_Font *font);\r
+\r
+void gf_font_manager_refresh_span_bounds(GF_TextSpan *span);\r
+GF_Path *gf_font_span_create_path(GF_TextSpan *span);\r
+\r
+\r
+void gf_font_spans_draw_2d(GF_List *spans, GF_TraverseState *tr_state, u32 hl_color, Bool force_texture_text, GF_Rect *bounds);\r
+void gf_font_spans_draw_3d(GF_List *spans, GF_TraverseState *tr_state, DrawAspect2D *asp, u32 text_hl, Bool force_texturing);\r
+void gf_font_spans_pick(GF_Node *node, GF_List *spans, GF_TraverseState *tr_state, GF_Rect *node_bounds, Bool use_dom_events, struct _drawable *drawable);\r
+void gf_font_spans_get_selection(GF_Node *node, GF_List *spans, GF_TraverseState *tr_state);\r
+\r
+GF_Font *gf_compositor_svg_set_font(GF_FontManager *fm, char *a_font, u32 styles, Bool check_only);\r
+\r
+\r
+GF_SceneGraph *gf_sc_get_subscene(GF_Node *inline_node);\r
+GF_Node *gf_sc_get_subscene_root(GF_Node *inline_node);\r
+\r
+#endif /*_COMPOSITOR_DEV_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/internal/config.h b/tstools/DtsEdit/src/gpac/internal/config.h
new file mode 100644 (file)
index 0000000..207a982
--- /dev/null
@@ -0,0 +1,5 @@
+/* Automatically generated by configure */
+#ifndef GF_CONFIG_H
+#define GF_CONFIG_H
+#define GPAC_CONFIG_WIN32
+#endif
diff --git a/tstools/DtsEdit/src/gpac/internal/config_static.h b/tstools/DtsEdit/src/gpac/internal/config_static.h
new file mode 100644 (file)
index 0000000..ee3d0d3
--- /dev/null
@@ -0,0 +1,89 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                     Copyright (c) ENST 2008 - \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC \r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+\r
+#ifndef _GF_CONFIG_H_\r
+#define _GF_CONFIG_H_\r
+\r
+/*this file defines all common macros for libgpac compilation*/\r
+\r
+/*platform is big endian*/\r
+//#define GPAC_BIG_ENDIAN\r
+\r
+/*SSL enabled*/\r
+//#define GPAC_HAS_SSL\r
+\r
+/*spidermonkey enabled*/\r
+#define GPAC_HAS_SPIDERMONKEY\r
+\r
+/*libjpeg enabled*/\r
+#define GPAC_HAS_JPEG\r
+\r
+/*pnj enabled*/\r
+#define GPAC_HAS_PNG\r
+\r
+/*IPv6 enabled - for win32, this is evaluated at compile time, !! do not uncomment !!*/\r
+//#define GPAC_HAS_IPV6\r
+\r
+/*SVG disabled*/\r
+//#define GPAC_DISABLE_SVG\r
+\r
+/*3D compositor disabled*/\r
+//#define GPAC_DISABLE_3D\r
+\r
+/*use TinyGL instead of OpenGL*/\r
+//#define GPAC_USE_TINYGL\r
+\r
+/*use OpenGL ES instead of OpenGL*/\r
+//#define GPAC_USE_OGL_ES\r
+\r
+\r
+#if defined(_WIN32_WCE)\r
+\r
+/*use intel fixed-point*/\r
+//#define GPAC_USE_IGPP\r
+/*use intel fixed-point with high precision*/\r
+//#define GPAC_USE_IGPP_HP\r
+\r
+#if defined(GPAC_USE_IGPP) && defined(GPAC_USE_IGPP_HP)\r
+#error "Only one of GPAC_USE_IGPP and GPAC_USE_IGPP_HP can be defined"\r
+#endif\r
+\r
+\r
+#if !defined(GPAC_DISABLE_3D) && !defined(GPAC_USE_TINYGL) && !defined(GPAC_USE_OGL_ES)\r
+#define GPAC_USE_OGL_ES\r
+#endif\r
+\r
+#endif\r
+\r
+\r
+#if !defined(GPAC_USE_OGL_ES) && !defined(GPAC_USE_TINYGL)\r
+#define GPAC_HAS_GLU\r
+#endif\r
+\r
+\r
+\r
+#endif         /*_GF_CONFIG_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/internal/crypt_dev.h b/tstools/DtsEdit/src/gpac/internal/crypt_dev.h
new file mode 100644 (file)
index 0000000..8e00a5f
--- /dev/null
@@ -0,0 +1,158 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / Crypto Tools sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_CRYPT_DEV_H_\r
+#define _GF_CRYPT_DEV_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/crypt.h>\r
+\r
+/*the samllest version of the lib: only AES-128-CTR supported*/\r
+#define GPAC_CRYPT_ISMA_ONLY\r
+\r
+\r
+#if !defined(GPAC_CRYPT_ISMA_ONLY) && defined(GPAC_READ_ONLY)\r
+#define GPAC_CRYPT_ISMA_ONLY\r
+#endif\r
+\r
+typedef void (*mcryptfunc)(void*,void*);\r
+typedef GF_Err (*mcrypt_setkeystream)(void *, const void *, int, const void *, int);\r
+typedef GF_Err (*mcrypt_setkeyblock) (void *, const void *, int);\r
+typedef GF_Err (*mcrypt_docrypt) (void *, const void *, int);\r
+\r
+/*private - do not use*/\r
+typedef struct _tag_crypt_stream\r
+{\r
+       const char *algo_name;\r
+       u32 algo_version;\r
+       const char *mode_name;\r
+       u32 mode_version;\r
+\r
+       /* Holds the algorithm's internal key */\r
+       char *akey;\r
+       /* holds the mode's internal buffers */\r
+       char *abuf;\r
+       /* holds the key */\r
+       char *keyword_given;\r
+\r
+       /*all below are static vars for mode and algo - sizes are in bytes*/\r
+\r
+       /*modes access*/\r
+       GF_Err (*_init_mcrypt) (void *, void *, int, void *, int);\r
+       void (*_end_mcrypt) (void *);\r
+       GF_Err (*_mcrypt) (void *, void *, int, int, void *, mcryptfunc func, mcryptfunc func2);\r
+       GF_Err (*_mdecrypt) (void *, void *, int, int, void *, mcryptfunc func, mcryptfunc func2);\r
+       GF_Err (*_mcrypt_set_state) (void *, void *, int );\r
+       GF_Err (*_mcrypt_get_state) (void *, void *, int *);\r
+       /*algo access*/\r
+       void *a_encrypt;\r
+       void *a_decrypt;\r
+       void *a_set_key;\r
+\r
+       u32 algo_size;\r
+       u32 algo_block_size;\r
+       u32 key_size;\r
+       u32 num_key_sizes;\r
+       u32 key_sizes[MAX_KEY_SIZES];\r
+       u32 algo_IV_size;\r
+\r
+       u32 mode_size;\r
+       Bool is_block_algo, is_block_algo_mode, is_block_mode, has_IV;\r
+} GF_CryptStream;\r
+\r
+/*modes*/\r
+void gf_crypt_register_cbc(GF_Crypt *td);\r
+void gf_crypt_register_cfb(GF_Crypt *td);\r
+void gf_crypt_register_ctr(GF_Crypt *td);\r
+void gf_crypt_register_ecb(GF_Crypt *td);\r
+void gf_crypt_register_ncfb(GF_Crypt *td);\r
+void gf_crypt_register_nofb(GF_Crypt *td);\r
+void gf_crypt_register_ofb(GF_Crypt *td);\r
+void gf_crypt_register_stream(GF_Crypt *td);\r
+/*algos*/\r
+void gf_crypt_register_des(GF_Crypt *td);\r
+void gf_crypt_register_3des(GF_Crypt *td);\r
+void gf_crypt_register_rijndael_128(GF_Crypt *td);\r
+void gf_crypt_register_rijndael_192(GF_Crypt *td);\r
+void gf_crypt_register_rijndael_256(GF_Crypt *td);\r
+\r
+\r
+#define rotl32(x,n)   (((x) << ((u32)(n))) | ((x) >> (32 - (u32)(n))))\r
+#define rotr32(x,n)   (((x) >> ((u32)(n))) | ((x) << (32 - (u32)(n))))\r
+#define rotl16(x,n)   (((x) << ((u16)(n))) | ((x) >> (16 - (u16)(n))))\r
+#define rotr16(x,n)   (((x) >> ((u16)(n))) | ((x) << (16 - (u16)(n))))\r
+\r
+/* Use hardware rotations.. when available */\r
+#ifdef swap32\r
+# define byteswap32(x) swap32(x)\r
+#else\r
+# ifdef swap_32\r
+#  define byteswap32(x) swap_32(x)\r
+# else\r
+#  ifdef bswap_32\r
+#   define byteswap32(x) bswap_32(x)\r
+#  else\r
+#   define byteswap32(x)       ((rotl32(x, 8) & 0x00ff00ff) | (rotr32(x, 8) & 0xff00ff00))\r
+#  endif\r
+# endif\r
+#endif\r
+\r
+#ifdef swap16\r
+# define byteswap16(x) swap16(x)\r
+#else\r
+# ifdef swap_16\r
+#  define byteswap16(x) swap_16(x)\r
+# else\r
+#  ifdef bswap_16\r
+#   define byteswap16(x) bswap_16(x)\r
+#  else\r
+#   define byteswap16(x)       ((rotl16(x, 8) & 0x00ff) | (rotr16(x, 8) & 0xff00))\r
+#  endif\r
+# endif\r
+#endif\r
+\r
+GFINLINE static\r
+void memxor(unsigned char *o1, unsigned char *o2, int length)\r
+{\r
+       int i;\r
+\r
+       for (i = 0; i < length; i++) {\r
+               o1[i] ^= o2[i];\r
+       }\r
+       return;\r
+}\r
+\r
+\r
+#define Bzero(x, y) memset(x, 0, y)\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /*_GF_CRYPT_DEV_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/internal/ietf_dev.h b/tstools/DtsEdit/src/gpac/internal/ietf_dev.h
new file mode 100644 (file)
index 0000000..8e5f38b
--- /dev/null
@@ -0,0 +1,327 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / IETF RTP/RTSP/SDP sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef        _GF_IETF_DEV_H_\r
+#define _GF_IETF_DEV_H_\r
+\r
+#include <gpac/ietf.h>\r
+#include <gpac/thread.h>\r
+\r
+/*\r
+                       RTP intern\r
+*/\r
+\r
+typedef struct\r
+{\r
+       /*version of the packet. Must be 2*/\r
+       u8 Version;\r
+       /*padding bits at the end of the payload*/\r
+       u8 Padding;\r
+       /*number of reports*/\r
+       u8 Count;\r
+       /*payload type of RTCP pck*/\r
+       u8 PayloadType;\r
+       /*The length of this RTCP packet in 32-bit words minus one including the header and any padding*/\r
+       u16 Length;\r
+       /*sync source identifier*/\r
+       u32 SSRC;\r
+} GF_RTCPHeader;       \r
+\r
+\r
+typedef struct __PRO_item\r
+{\r
+       struct __PRO_item *next;\r
+       u32 pck_seq_num;\r
+       void *pck;\r
+       u32 size;\r
+} GF_POItem;\r
+\r
+typedef struct __PO\r
+{\r
+       struct __PRO_item *in;\r
+       u32 head_seqnum;\r
+       u32 Count;\r
+       u32 MaxCount;\r
+       u32 IsInit;\r
+       u32 MaxDelay, LastTime;\r
+} GF_RTPReorder;\r
+\r
+/* creates new RTP reorderer\r
+       @MaxCount: forces automatic packet flush. 0 means no flush\r
+       @MaxDelay: is the max time in ms the queue will wait for a missing packet\r
+*/\r
+GF_RTPReorder *gf_rtp_reorderer_new(u32 MaxCount, u32 MaxDelay);\r
+void gf_rtp_reorderer_del(GF_RTPReorder *po);\r
+/*reset the Queue*/\r
+void gf_rtp_reorderer_reset(GF_RTPReorder *po);\r
+\r
+/*Adds a packet to the queue. Packet Data is memcopied*/\r
+GF_Err gf_rtp_reorderer_add(GF_RTPReorder *po, void *pck, u32 pck_size, u32 pck_seqnum);\r
+/*gets the output of the queue. Packet Data IS YOURS to delete*/\r
+void *gf_rtp_reorderer_get(GF_RTPReorder *po, u32 *pck_size);\r
+\r
+\r
+/*the RTP channel with both RTP and RTCP sockets and buffers\r
+each channel is identified by a control string given in RTSP Describe\r
+this control string is used with Darwin\r
+*/\r
+struct __tag_rtp_channel\r
+{\r
+       /*global transport info for the session*/\r
+       GF_RTSPTransport net_info;\r
+       \r
+       /*RTP CHANNEL*/\r
+       GF_Socket *rtp;\r
+       /*RTCP CHANNEL*/\r
+       GF_Socket *rtcp;\r
+       \r
+       /*RTP Packet reordering. Turned on/off during initialization. The library forces a 200 ms\r
+       max latency at the reordering queue*/\r
+       GF_RTPReorder *po;\r
+\r
+       /*RTCP report times*/\r
+       u32 last_report_time;\r
+       u32 next_report_time;\r
+\r
+       /*NAT keep-alive*/\r
+       u32 last_nat_keepalive_time, nat_keepalive_time_period;\r
+\r
+       \r
+       /*the seq number of the first packet as signaled by the server if any, or first\r
+       RTP SN received (RTP multicast)*/\r
+       u32 rtp_first_SN;\r
+       /*the TS of the associated first packet as signaled by the server if any, or first\r
+       RTP TS received (RTP multicast)*/\r
+       u32 rtp_time;\r
+       /*NPT from the rtp_time*/\r
+       u32 CurrentTime;\r
+       /*num loops of pck sn*/\r
+       u32 num_sn_loops;\r
+       /*some mapping info - we should support # payloads*/\r
+       u8 PayloadType;\r
+       u32 TimeScale;\r
+\r
+       /*static buffer for RTP sending*/\r
+       char *send_buffer;\r
+       u32 send_buffer_size;\r
+       u32 pck_sent_since_last_sr;\r
+       u32 last_pck_ts;\r
+       u32 last_pck_ntp_sec, last_pck_ntp_frac;\r
+       u32 num_pck_sent, num_payload_bytes;\r
+\r
+       /*RTCP info*/\r
+       char *s_name, *s_email, *s_location, *s_phone, *s_tool, *s_note, *s_priv;\r
+//     s8 first_rtp_pck;\r
+       s8 first_SR;\r
+       u32 SSRC;\r
+       u32 SenderSSRC;\r
+\r
+       u32 last_pck_sn;\r
+\r
+       char *CName;\r
+\r
+       u32 rtcp_bytes_sent;\r
+       /*total pck rcv*/\r
+       u32 tot_num_pck_rcv, tot_num_pck_expected;\r
+       /*stats since last SR*/\r
+       u32 last_num_pck_rcv, last_num_pck_expected, last_num_pck_loss;\r
+       /*jitter compute*/\r
+       u32 Jitter, ntp_init;\r
+       s32 last_deviance;      \r
+       /*NTP of last SR*/\r
+       u32 last_SR_NTP_sec, last_SR_NTP_frac;\r
+       /*RTP time at last SR as indicated in SR*/\r
+       u32 last_SR_rtp_time;\r
+       /*payload info*/\r
+       u32 total_pck, total_bytes;\r
+};\r
+\r
+/*gets UTC in the channel RTP timescale*/\r
+u32 gf_rtp_channel_time(GF_RTPChannel *ch);\r
+/*gets time in 1/65536 seconds (for reports)*/\r
+u32 gf_rtp_get_report_time();\r
+/*updates the time for the next report (SR, RR)*/\r
+void gf_rtp_get_next_report_time(GF_RTPChannel *ch);\r
+\r
+\r
+/*\r
+                       RTSP intern\r
+*/\r
+\r
+#define GF_RTSP_DEFAULT_BUFFER         2048\r
+#define GF_RTSP_VERSION                "RTSP/1.0"\r
+\r
+/*macros for RTSP command and response formmating*/\r
+#define RTSP_WRITE_STEPALLOC   250\r
+\r
+#define RTSP_WRITE_ALLOC_STR(buf, buf_size, pos, str)          \\r
+       if (str) { \\r
+               if (strlen((const char *) str)+pos >= buf_size) {       \\r
+                       buf_size += RTSP_WRITE_STEPALLOC;       \\r
+                       buf = (char *) realloc(buf, buf_size);          \\r
+               }       \\r
+               strcpy(buf+pos, (const char *) str);            \\r
+               pos += strlen((const char *) str);              \\r
+       }\\r
+\r
+#define RTSP_WRITE_HEADER(buf, buf_size, pos, type, str)               \\r
+       if (str) { \\r
+               RTSP_WRITE_ALLOC_STR(buf, buf_size, pos, type);         \\r
+               RTSP_WRITE_ALLOC_STR(buf, buf_size, pos, ": ");         \\r
+               RTSP_WRITE_ALLOC_STR(buf, buf_size, pos, str);          \\r
+               RTSP_WRITE_ALLOC_STR(buf, buf_size, pos, "\r\n");               \\r
+       } \\r
+\r
+#define RTSP_WRITE_INT(buf, buf_size, pos, d, sig)             \\r
+       if (sig) { \\r
+               sprintf(temp, "%d", d);         \\r
+       } else { \\r
+               sprintf(temp, "%u", d);         \\r
+       }       \\r
+       RTSP_WRITE_ALLOC_STR(buf, buf_size, pos, temp);\r
+\r
+#define RTSP_WRITE_FLOAT(buf, buf_size, pos, d)                \\r
+       sprintf(temp, "%.4f", d);               \\r
+       RTSP_WRITE_ALLOC_STR(buf, buf_size, pos, temp);\r
+\r
+/*default packet size, but resize on the fly if needed*/\r
+#define RTSP_PCK_SIZE                  6000\r
+#define RTSP_TCP_BUF_SIZE              0x10000ul\r
+\r
+\r
+typedef struct\r
+{\r
+       u8 rtpID;\r
+       u8 rtcpID;\r
+       void *ch_ptr;\r
+} GF_TCPChan;\r
+\r
+/**************************************\r
+               RTSP Session\r
+***************************************/\r
+struct _tag_rtsp_session\r
+{\r
+       /*service name (extracted from URL) ex: news/latenight.mp4, vod.mp4 ...*/\r
+       char *Service;  \r
+       /*server name (extracted from URL)*/\r
+       char *Server;\r
+       /*server port (extracted from URL)*/\r
+       u16 Port;\r
+\r
+       /*if RTSP is on UDP*/\r
+       u8 ConnectionType;\r
+       /*TCP interleaving ID*/\r
+       u8 InterID;\r
+       /*http tunnel*/\r
+       Bool HasTunnel;\r
+       GF_Socket *http;\r
+       char HTTP_Cookie[30];\r
+       u32 CookieRadLen;\r
+\r
+       /*RTSP CHANNEL*/\r
+       GF_Socket *connection;\r
+       u32 SockBufferSize;\r
+       /*needs connection*/\r
+       u32 NeedConnection;\r
+\r
+       /*the RTSP sequence number*/\r
+       u32 CSeq;\r
+       /*this is for aggregated request in order to check SeqNum*/\r
+       u32 NbPending;\r
+\r
+       /*RTSP sessionID, arbitrary length, alpha-numeric*/\r
+       const char *last_session_id;\r
+\r
+       /*RTSP STATE machine*/\r
+       u32 RTSP_State;\r
+       char RTSPLastRequest[40];\r
+\r
+       /*current buffer from TCP if any*/\r
+       char TCPBuffer[RTSP_TCP_BUF_SIZE];\r
+       u32 CurrentSize, CurrentPos;\r
+\r
+       /*RTSP interleaving*/\r
+       GF_Err (*RTSP_SignalData)(GF_RTSPSession *sess, void *chan, char *buffer, u32 bufferSize, Bool IsRTCP);\r
+       \r
+       /*buffer for pck reconstruction*/\r
+       char *rtsp_pck_buf;\r
+       u32 rtsp_pck_size;\r
+       u32 pck_start, payloadSize;\r
+\r
+       /*all RTP channels in an interleaved RTP on RTSP session*/\r
+       GF_List *TCPChannels;\r
+       /*thread-safe, full duplex library for PLAY and RECORD*/\r
+       GF_Mutex *mx;\r
+\r
+       char *MobileIP; \r
+};\r
+\r
+GF_RTSPSession *gf_rtsp_session_new(char *sURL, u16 DefaultPort);\r
+\r
+/*check connection status*/\r
+GF_Err gf_rtsp_check_connection(GF_RTSPSession *sess);\r
+/*send data on RTSP*/\r
+GF_Err gf_rtsp_send_data(GF_RTSPSession *sess, char *buffer, u32 Size);\r
+\r
+/* \r
+                       Common RTSP tools\r
+*/\r
+\r
+/*locate body-start and body size in response/commands*/\r
+void gf_rtsp_get_body_info(GF_RTSPSession *sess, u32 *body_start, u32 *body_size);\r
+/*read TCP until a full command/response is received*/\r
+GF_Err gf_rtsp_read_reply(GF_RTSPSession *sess);\r
+/*fill the TCP buffer*/\r
+GF_Err gf_rtsp_fill_buffer(GF_RTSPSession *sess);\r
+/*force a fill on TCP buffer - used for de-interleaving and TCP-fragmented RTSP messages*/\r
+GF_Err gf_rtsp_refill_buffer(GF_RTSPSession *sess);\r
+/*parses a transport string and returns a transport structure*/\r
+GF_RTSPTransport *gf_rtsp_transport_parse(char *buffer);\r
+/*parsing of header for com and rsp*/\r
+GF_Err gf_rtsp_parse_header(char *buffer, u32 BufferSize, u32 BodyStart, GF_RTSPCommand *com, GF_RTSPResponse *rsp);\r
+void gf_rtsp_set_command_value(GF_RTSPCommand *com, char *Header, char *Value);\r
+void gf_rtsp_set_response_value(GF_RTSPResponse *rsp, char *Header, char *Value);\r
+/*deinterleave a data packet*/\r
+GF_Err gf_rtsp_set_deinterleave(GF_RTSPSession *sess);\r
+/*start session through HTTP tunnel (QTSS)*/\r
+GF_Err gf_rtsp_http_tunnel_start(GF_RTSPSession *sess, char *UserAgent);\r
+\r
+\r
+/*packetization routines*/\r
+GF_Err gp_rtp_builder_do_mpeg4(GP_RTPPacketizer *builder, char *data, u32 data_size, u8 IsAUEnd, u32 FullAUSize);\r
+GF_Err gp_rtp_builder_do_h263(GP_RTPPacketizer *builder, char *data, u32 data_size, u8 IsAUEnd, u32 FullAUSize);\r
+GF_Err gp_rtp_builder_do_amr(GP_RTPPacketizer *builder, char *data, u32 data_size, u8 IsAUEnd, u32 FullAUSize);\r
+GF_Err gp_rtp_builder_do_mpeg12_video(GP_RTPPacketizer *builder, char *data, u32 data_size, u8 IsAUEnd, u32 FullAUSize);\r
+GF_Err gp_rtp_builder_do_mpeg12_audio(GP_RTPPacketizer *builder, char *data, u32 data_size, u8 IsAUEnd, u32 FullAUSize);\r
+GF_Err gp_rtp_builder_do_tx3g(GP_RTPPacketizer *builder, char *data, u32 data_size, u8 IsAUEnd, u32 FullAUSize, u32 duration, u8 descIndex);\r
+GF_Err gp_rtp_builder_do_avc(GP_RTPPacketizer *builder, char *data, u32 data_size, u8 IsAUEnd, u32 FullAUSize);\r
+GF_Err gp_rtp_builder_do_qcelp(GP_RTPPacketizer *builder, char *data, u32 data_size, u8 IsAUEnd, u32 FullAUSize);\r
+GF_Err gp_rtp_builder_do_smv(GP_RTPPacketizer *builder, char *data, u32 data_size, u8 IsAUEnd, u32 FullAUSize);\r
+GF_Err gp_rtp_builder_do_latm(GP_RTPPacketizer *builder, char *data, u32 data_size, u8 IsAUEnd, u32 FullAUSize, u32 duration); \r
+GF_Err gp_rtp_builder_do_dims(GP_RTPPacketizer *builder, char *data, u32 data_size, u8 IsAUEnd, u32 FullAUSize, u32 duration);\r
+GF_Err gp_rtp_builder_do_ac3(GP_RTPPacketizer *builder, char *data, u32 data_size, u8 IsAUEnd, u32 FullAUSize);\r
+\r
+\r
+#endif /*_GF_IETF_DEV_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/internal/isomedia_dev.h b/tstools/DtsEdit/src/gpac/internal/isomedia_dev.h
new file mode 100644 (file)
index 0000000..c00df4b
--- /dev/null
@@ -0,0 +1,3140 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / ISO Media File Format sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_ISOMEDIA_DEV_H_\r
+#define _GF_ISOMEDIA_DEV_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/isomedia.h>\r
+\r
+\r
+//the default size is 64, cause we need to handle large boxes...\r
+#define GF_ISOM_BOX                    \\r
+       u32 type;                       \\r
+       u64 size;                       \\r
+\r
+#define GF_ISOM_FULL_BOX               \\r
+       GF_ISOM_BOX                     \\r
+       u8 version;                     \\r
+       u32 flags;                      \\r
+\r
+#define GF_ISOM_UUID_BOX       \\r
+       GF_ISOM_BOX                     \\r
+       u8 uuid[16];            \\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+} GF_Box;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+} GF_FullBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_UUID_BOX\r
+} GF_UUIDBox;\r
+\r
+/*constructor*/\r
+GF_Box *gf_isom_box_new(u32 boxType);\r
+\r
+GF_Err gf_isom_box_write(GF_Box *ptr, GF_BitStream *bs);\r
+GF_Err gf_isom_box_read(GF_Box *ptr, GF_BitStream *bs);\r
+void gf_isom_box_del(GF_Box *ptr);\r
+GF_Err gf_isom_box_size(GF_Box *ptr);\r
+\r
+GF_Err gf_isom_parse_box(GF_Box **outBox, GF_BitStream *bs);\r
+GF_Err gf_isom_read_box_list(GF_Box *s, GF_BitStream *bs, GF_Err (*add_box)(GF_Box *par, GF_Box *b));\r
+GF_Err gf_isom_read_box_list_ex(GF_Box *parent, GF_BitStream *bs, GF_Err (*add_box)(GF_Box *par, GF_Box *b), u32 parent_type);\r
+\r
+GF_Err gf_isom_box_get_size(GF_Box *ptr);\r
+GF_Err gf_isom_full_box_get_size(GF_Box *ptr);\r
+GF_Err gf_isom_box_write_header(GF_Box *ptr, GF_BitStream *bs);\r
+GF_Err gf_isom_full_box_read(GF_Box *ptr, GF_BitStream *bs);\r
+GF_Err gf_isom_full_box_write(GF_Box *s, GF_BitStream *bs);\r
+void gf_isom_full_box_init(GF_Box *ptr);\r
+void gf_isom_box_array_del(GF_List *boxList);\r
+GF_Err gf_isom_box_array_write(GF_Box *parent, GF_List *list, GF_BitStream *bs);\r
+GF_Err gf_isom_box_array_size(GF_Box *parent, GF_List *list);\r
+\r
+\r
+enum\r
+{\r
+       GF_ISOM_BOX_TYPE_CO64   = GF_4CC( 'c', 'o', '6', '4' ),\r
+       GF_ISOM_BOX_TYPE_STCO   = GF_4CC( 's', 't', 'c', 'o' ),\r
+       GF_ISOM_BOX_TYPE_CRHD   = GF_4CC( 'c', 'r', 'h', 'd' ),\r
+       GF_ISOM_BOX_TYPE_CTTS   = GF_4CC( 'c', 't', 't', 's' ),\r
+       GF_ISOM_BOX_TYPE_CPRT   = GF_4CC( 'c', 'p', 'r', 't' ),\r
+       GF_ISOM_BOX_TYPE_CHPL   = GF_4CC( 'c', 'h', 'p', 'l' ),\r
+       GF_ISOM_BOX_TYPE_URL    = GF_4CC( 'u', 'r', 'l', ' ' ),\r
+       GF_ISOM_BOX_TYPE_URN    = GF_4CC( 'u', 'r', 'n', ' ' ),\r
+       GF_ISOM_BOX_TYPE_DINF   = GF_4CC( 'd', 'i', 'n', 'f' ),\r
+       GF_ISOM_BOX_TYPE_DREF   = GF_4CC( 'd', 'r', 'e', 'f' ),\r
+       GF_ISOM_BOX_TYPE_STDP   = GF_4CC( 's', 't', 'd', 'p' ),\r
+       GF_ISOM_BOX_TYPE_EDTS   = GF_4CC( 'e', 'd', 't', 's' ),\r
+       GF_ISOM_BOX_TYPE_ELST   = GF_4CC( 'e', 'l', 's', 't' ),\r
+       GF_ISOM_BOX_TYPE_UUID   = GF_4CC( 'u', 'u', 'i', 'd' ),\r
+       GF_ISOM_BOX_TYPE_FREE   = GF_4CC( 'f', 'r', 'e', 'e' ),\r
+       GF_ISOM_BOX_TYPE_HDLR   = GF_4CC( 'h', 'd', 'l', 'r' ),\r
+       GF_ISOM_BOX_TYPE_GMHD   = GF_4CC( 'g', 'm', 'h', 'd' ),\r
+       GF_ISOM_BOX_TYPE_HMHD   = GF_4CC( 'h', 'm', 'h', 'd' ),\r
+       GF_ISOM_BOX_TYPE_HINT   = GF_4CC( 'h', 'i', 'n', 't' ),\r
+       GF_ISOM_BOX_TYPE_MDIA   = GF_4CC( 'm', 'd', 'i', 'a' ),\r
+       GF_ISOM_BOX_TYPE_MDAT   = GF_4CC( 'm', 'd', 'a', 't' ),\r
+       GF_ISOM_BOX_TYPE_MDHD   = GF_4CC( 'm', 'd', 'h', 'd' ),\r
+       GF_ISOM_BOX_TYPE_MINF   = GF_4CC( 'm', 'i', 'n', 'f' ),\r
+       GF_ISOM_BOX_TYPE_MOOV   = GF_4CC( 'm', 'o', 'o', 'v' ),\r
+       GF_ISOM_BOX_TYPE_MVHD   = GF_4CC( 'm', 'v', 'h', 'd' ),\r
+       GF_ISOM_BOX_TYPE_STSD   = GF_4CC( 's', 't', 's', 'd' ),\r
+       GF_ISOM_BOX_TYPE_STSZ   = GF_4CC( 's', 't', 's', 'z' ),\r
+       GF_ISOM_BOX_TYPE_STZ2   = GF_4CC( 's', 't', 'z', '2' ),\r
+       GF_ISOM_BOX_TYPE_STBL   = GF_4CC( 's', 't', 'b', 'l' ),\r
+       GF_ISOM_BOX_TYPE_STSC   = GF_4CC( 's', 't', 's', 'c' ),\r
+       GF_ISOM_BOX_TYPE_STSH   = GF_4CC( 's', 't', 's', 'h' ),\r
+       GF_ISOM_BOX_TYPE_SKIP   = GF_4CC( 's', 'k', 'i', 'p' ),\r
+       GF_ISOM_BOX_TYPE_SMHD   = GF_4CC( 's', 'm', 'h', 'd' ),\r
+       GF_ISOM_BOX_TYPE_STSS   = GF_4CC( 's', 't', 's', 's' ),\r
+       GF_ISOM_BOX_TYPE_STTS   = GF_4CC( 's', 't', 't', 's' ),\r
+       GF_ISOM_BOX_TYPE_TRAK   = GF_4CC( 't', 'r', 'a', 'k' ),\r
+       GF_ISOM_BOX_TYPE_TKHD   = GF_4CC( 't', 'k', 'h', 'd' ),\r
+       GF_ISOM_BOX_TYPE_TREF   = GF_4CC( 't', 'r', 'e', 'f' ),\r
+       GF_ISOM_BOX_TYPE_UDTA   = GF_4CC( 'u', 'd', 't', 'a' ),\r
+       GF_ISOM_BOX_TYPE_VMHD   = GF_4CC( 'v', 'm', 'h', 'd' ),\r
+       GF_ISOM_BOX_TYPE_FTYP   = GF_4CC( 'f', 't', 'y', 'p' ),\r
+       GF_ISOM_BOX_TYPE_FADB   = GF_4CC( 'p', 'a', 'd', 'b' ),\r
+       GF_ISOM_BOX_TYPE_PDIN   = GF_4CC( 'p', 'd', 'i', 'n' ),\r
+       GF_ISOM_BOX_TYPE_SDTP   = GF_4CC( 's', 'd', 't', 'p' ),\r
+\r
+#ifndef        GPAC_ISOM_NO_FRAGMENTS\r
+       /*Movie Fragments*/\r
+       GF_ISOM_BOX_TYPE_MVEX   = GF_4CC( 'm', 'v', 'e', 'x' ),\r
+       GF_ISOM_BOX_TYPE_MEHD   = GF_4CC( 'm', 'e', 'h', 'd' ),\r
+       GF_ISOM_BOX_TYPE_TREX   = GF_4CC( 't', 'r', 'e', 'x' ),\r
+       GF_ISOM_BOX_TYPE_MOOF   = GF_4CC( 'm', 'o', 'o', 'f' ),\r
+       GF_ISOM_BOX_TYPE_MFHD   = GF_4CC( 'm', 'f', 'h', 'd' ),\r
+       GF_ISOM_BOX_TYPE_TRAF   = GF_4CC( 't', 'r', 'a', 'f' ),\r
+       GF_ISOM_BOX_TYPE_TFHD   = GF_4CC( 't', 'f', 'h', 'd' ),\r
+       GF_ISOM_BOX_TYPE_TRUN   = GF_4CC( 't', 'r', 'u', 'n' ),\r
+#endif\r
+\r
+       /*MP4 extensions*/\r
+       GF_ISOM_BOX_TYPE_DPND   = GF_4CC( 'd', 'p', 'n', 'd' ),\r
+       GF_ISOM_BOX_TYPE_IODS   = GF_4CC( 'i', 'o', 'd', 's' ),\r
+       GF_ISOM_BOX_TYPE_ESDS   = GF_4CC( 'e', 's', 'd', 's' ),\r
+       GF_ISOM_BOX_TYPE_MPOD   = GF_4CC( 'm', 'p', 'o', 'd' ),\r
+       GF_ISOM_BOX_TYPE_SYNC   = GF_4CC( 's', 'y', 'n', 'c' ),\r
+       GF_ISOM_BOX_TYPE_IPIR   = GF_4CC( 'i', 'p', 'i', 'r' ),\r
+       GF_ISOM_BOX_TYPE_SDHD   = GF_4CC( 's', 'd', 'h', 'd' ),\r
+       GF_ISOM_BOX_TYPE_ODHD   = GF_4CC( 'o', 'd', 'h', 'd' ),\r
+       GF_ISOM_BOX_TYPE_NMHD   = GF_4CC( 'n', 'm', 'h', 'd' ),\r
+       GF_ISOM_BOX_TYPE_MP4S   = GF_4CC( 'm', 'p', '4', 's' ),\r
+       GF_ISOM_BOX_TYPE_MP4A   = GF_4CC( 'm', 'p', '4', 'a' ),\r
+       GF_ISOM_BOX_TYPE_MP4V   = GF_4CC( 'm', 'p', '4', 'v' ),\r
+\r
+       /*AVC / H264 extension*/\r
+       GF_ISOM_BOX_TYPE_AVCC   = GF_4CC( 'a', 'v', 'c', 'C' ),\r
+       GF_ISOM_BOX_TYPE_BTRT   = GF_4CC( 'b', 't', 'r', 't' ),\r
+       GF_ISOM_BOX_TYPE_M4DS   = GF_4CC( 'm', '4', 'd', 's' ),\r
+       GF_ISOM_BOX_TYPE_AVC1   = GF_4CC( 'a', 'v', 'c', '1' ),\r
+       GF_ISOM_BOX_TYPE_PASP   = GF_4CC( 'p', 'a', 's', 'p' ),\r
+\r
+       /*3GPP extensions*/\r
+       GF_ISOM_BOX_TYPE_DAMR   = GF_4CC( 'd', 'a', 'm', 'r' ),\r
+       GF_ISOM_BOX_TYPE_D263   = GF_4CC( 'd', '2', '6', '3' ),\r
+       GF_ISOM_BOX_TYPE_DEVC   = GF_4CC( 'd', 'e', 'v', 'c' ),\r
+       GF_ISOM_BOX_TYPE_DQCP   = GF_4CC( 'd', 'q', 'c', 'p' ),\r
+       GF_ISOM_BOX_TYPE_DSMV   = GF_4CC( 'd', 's', 'm', 'v' ),\r
+       GF_ISOM_BOX_TYPE_TSEL   = GF_4CC( 't', 's', 'e', 'l' ),\r
+\r
+       /*3GPP text / MPEG-4 StreamingText*/\r
+       GF_ISOM_BOX_TYPE_FTAB   = GF_4CC( 'f', 't', 'a', 'b' ),\r
+       GF_ISOM_BOX_TYPE_TX3G   = GF_4CC( 't', 'x', '3', 'g' ),\r
+       GF_ISOM_BOX_TYPE_STYL   = GF_4CC( 's', 't', 'y', 'l' ),\r
+       GF_ISOM_BOX_TYPE_HLIT   = GF_4CC( 'h', 'l', 'i', 't' ),\r
+       GF_ISOM_BOX_TYPE_HCLR   = GF_4CC( 'h', 'c', 'l', 'r' ),\r
+       GF_ISOM_BOX_TYPE_KROK   = GF_4CC( 'k', 'r', 'o', 'k' ),\r
+       GF_ISOM_BOX_TYPE_DLAY   = GF_4CC( 'd', 'l', 'a', 'y' ),\r
+       GF_ISOM_BOX_TYPE_HREF   = GF_4CC( 'h', 'r', 'e', 'f' ),\r
+       GF_ISOM_BOX_TYPE_TBOX   = GF_4CC( 't', 'b', 'o', 'x' ),\r
+       GF_ISOM_BOX_TYPE_BLNK   = GF_4CC( 'b', 'l', 'n', 'k' ),\r
+       GF_ISOM_BOX_TYPE_TWRP   = GF_4CC( 't', 'w', 'r', 'p' ),\r
+\r
+       /* ISO Base Media File Format Extensions for MPEG-21 */\r
+       GF_ISOM_BOX_TYPE_META   = GF_4CC( 'm', 'e', 't', 'a' ),\r
+       GF_ISOM_BOX_TYPE_XML    = GF_4CC( 'x', 'm', 'l', ' ' ),\r
+       GF_ISOM_BOX_TYPE_BXML   = GF_4CC( 'b', 'x', 'm', 'l' ),\r
+       GF_ISOM_BOX_TYPE_ILOC   = GF_4CC( 'i', 'l', 'o', 'c' ),\r
+       GF_ISOM_BOX_TYPE_PITM   = GF_4CC( 'p', 'i', 't', 'm' ),\r
+       GF_ISOM_BOX_TYPE_IPRO   = GF_4CC( 'i', 'p', 'r', 'o' ),\r
+       GF_ISOM_BOX_TYPE_INFE   = GF_4CC( 'i', 'n', 'f', 'e' ),\r
+       GF_ISOM_BOX_TYPE_IINF   = GF_4CC( 'i', 'i', 'n', 'f' ),\r
+       GF_ISOM_BOX_TYPE_ENCA   = GF_4CC( 'e', 'n', 'c', 'a' ),\r
+       GF_ISOM_BOX_TYPE_ENCV   = GF_4CC( 'e', 'n', 'c', 'v' ),\r
+       GF_ISOM_BOX_TYPE_ENCT   = GF_4CC( 'e', 'n', 'c', 't' ),\r
+       GF_ISOM_BOX_TYPE_ENCS   = GF_4CC( 'e', 'n', 'c', 's' ),\r
+       GF_ISOM_BOX_TYPE_SINF   = GF_4CC( 's', 'i', 'n', 'f' ),\r
+       GF_ISOM_BOX_TYPE_FRMA   = GF_4CC( 'f', 'r', 'm', 'a' ),\r
+       GF_ISOM_BOX_TYPE_SCHM   = GF_4CC( 's', 'c', 'h', 'm' ),\r
+       GF_ISOM_BOX_TYPE_SCHI   = GF_4CC( 's', 'c', 'h', 'i' ),\r
+\r
+       GF_ISOM_BOX_TYPE_METX   = GF_4CC( 'm', 'e', 't', 'x' ),\r
+       GF_ISOM_BOX_TYPE_METT   = GF_4CC( 'm', 'e', 't', 't' ),\r
+\r
+       /* ISMA 1.0 Encryption and Authentication V 1.0 */\r
+       GF_ISOM_BOX_TYPE_IKMS   = GF_4CC( 'i', 'K', 'M', 'S' ),\r
+       GF_ISOM_BOX_TYPE_ISFM   = GF_4CC( 'i', 'S', 'F', 'M' ),\r
+\r
+       /* Hinting boxes */\r
+       GF_ISOM_BOX_TYPE_RTP_STSD       = GF_4CC( 'r', 't', 'p', ' ' ),\r
+       GF_ISOM_BOX_TYPE_HNTI   = GF_4CC( 'h', 'n', 't', 'i' ),\r
+       GF_ISOM_BOX_TYPE_RTP    = GF_4CC( 'r', 't', 'p', ' ' ),\r
+       GF_ISOM_BOX_TYPE_SDP    = GF_4CC( 's', 'd', 'p', ' ' ),\r
+       GF_ISOM_BOX_TYPE_HINF   = GF_4CC( 'h', 'i', 'n', 'f' ),\r
+       GF_ISOM_BOX_TYPE_NAME   = GF_4CC( 'n', 'a', 'm', 'e' ),\r
+       GF_ISOM_BOX_TYPE_TRPY   = GF_4CC( 't', 'r', 'p', 'y' ),\r
+       GF_ISOM_BOX_TYPE_NUMP   = GF_4CC( 'n', 'u', 'm', 'p' ),\r
+       GF_ISOM_BOX_TYPE_TOTL   = GF_4CC( 't', 'o', 't', 'l' ),\r
+       GF_ISOM_BOX_TYPE_NPCK   = GF_4CC( 'n', 'p', 'c', 'k' ),\r
+       GF_ISOM_BOX_TYPE_TPYL   = GF_4CC( 't', 'p', 'y', 'l' ),\r
+       GF_ISOM_BOX_TYPE_TPAY   = GF_4CC( 't', 'p', 'a', 'y' ),\r
+       GF_ISOM_BOX_TYPE_MAXR   = GF_4CC( 'm', 'a', 'x', 'r' ),\r
+       GF_ISOM_BOX_TYPE_DMED   = GF_4CC( 'd', 'm', 'e', 'd' ),\r
+       GF_ISOM_BOX_TYPE_DIMM   = GF_4CC( 'd', 'i', 'm', 'm' ),\r
+       GF_ISOM_BOX_TYPE_DREP   = GF_4CC( 'd', 'r', 'e', 'p' ),\r
+       GF_ISOM_BOX_TYPE_TMIN   = GF_4CC( 't', 'm', 'i', 'n' ),\r
+       GF_ISOM_BOX_TYPE_TMAX   = GF_4CC( 't', 'm', 'a', 'x' ),\r
+       GF_ISOM_BOX_TYPE_PMAX   = GF_4CC( 'p', 'm', 'a', 'x' ),\r
+       GF_ISOM_BOX_TYPE_DMAX   = GF_4CC( 'd', 'm', 'a', 'x' ),\r
+       GF_ISOM_BOX_TYPE_PAYT   = GF_4CC( 'p', 'a', 'y', 't' ),\r
+       GF_ISOM_BOX_TYPE_RELY   = GF_4CC( 'r', 'e', 'l', 'y' ),\r
+       GF_ISOM_BOX_TYPE_TIMS   = GF_4CC( 't', 'i', 'm', 's' ),\r
+       GF_ISOM_BOX_TYPE_TSRO   = GF_4CC( 't', 's', 'r', 'o' ),\r
+       GF_ISOM_BOX_TYPE_SNRO   = GF_4CC( 's', 'n', 'r', 'o' ),\r
+       GF_ISOM_BOX_TYPE_RTPO   = GF_4CC( 'r', 't', 'p', 'o' ),\r
+       \r
+       /*internal type for track references*/\r
+       GF_ISOM_BOX_TYPE_REFT   = GF_4CC( 'R', 'E', 'F', 'T' ),\r
+\r
+       /* Apple extensions */\r
+\r
+       GF_ISOM_BOX_TYPE_ILST   = GF_4CC( 'i', 'l', 's', 't' ),\r
+       GF_ISOM_BOX_TYPE_0xA9NAM        = GF_4CC( 0xA9, 'n', 'a', 'm' ),\r
+       GF_ISOM_BOX_TYPE_0xA9CMT        = GF_4CC( 0xA9, 'c', 'm', 't' ),\r
+       GF_ISOM_BOX_TYPE_0xA9DAY        = GF_4CC( 0xA9, 'd', 'a', 'y' ),\r
+       GF_ISOM_BOX_TYPE_0xA9ART        = GF_4CC( 0xA9, 'A', 'R', 'T' ),\r
+       GF_ISOM_BOX_TYPE_0xA9TRK        = GF_4CC( 0xA9, 't', 'r', 'k' ),\r
+       GF_ISOM_BOX_TYPE_0xA9ALB        = GF_4CC( 0xA9, 'a', 'l', 'b' ),\r
+       GF_ISOM_BOX_TYPE_0xA9COM        = GF_4CC( 0xA9, 'c', 'o', 'm' ),\r
+       GF_ISOM_BOX_TYPE_0xA9WRT        = GF_4CC( 0xA9, 'w', 'r', 't' ),\r
+       GF_ISOM_BOX_TYPE_0xA9TOO        = GF_4CC( 0xA9, 't', 'o', 'o' ),\r
+       GF_ISOM_BOX_TYPE_0xA9CPY        = GF_4CC( 0xA9, 'c', 'p', 'y' ),\r
+       GF_ISOM_BOX_TYPE_0xA9DES        = GF_4CC( 0xA9, 'd', 'e', 's' ),\r
+       GF_ISOM_BOX_TYPE_0xA9GEN        = GF_4CC( 0xA9, 'g', 'e', 'n' ),\r
+       GF_ISOM_BOX_TYPE_0xA9GRP        = GF_4CC( 0xA9, 'g', 'r', 'p' ),\r
+       GF_ISOM_BOX_TYPE_0xA9ENC        = GF_4CC( 0xA9, 'e', 'n', 'c' ),\r
+       GF_ISOM_BOX_TYPE_aART           = GF_4CC( 'a', 'A', 'R', 'T' ),\r
+       GF_ISOM_BOX_TYPE_PGAP = GF_4CC( 'p', 'g', 'a', 'p' ),\r
+       GF_ISOM_BOX_TYPE_GNRE   = GF_4CC( 'g', 'n', 'r', 'e' ),\r
+       GF_ISOM_BOX_TYPE_DISK   = GF_4CC( 'd', 'i', 's', 'k' ),\r
+       GF_ISOM_BOX_TYPE_TRKN   = GF_4CC( 't', 'r', 'k', 'n' ),\r
+       GF_ISOM_BOX_TYPE_TMPO   = GF_4CC( 't', 'm', 'p', 'o' ),\r
+       GF_ISOM_BOX_TYPE_CPIL   = GF_4CC( 'c', 'p', 'i', 'l' ),\r
+       GF_ISOM_BOX_TYPE_COVR   = GF_4CC( 'c', 'o', 'v', 'r' ),\r
+       GF_ISOM_BOX_TYPE_iTunesSpecificInfo     = GF_4CC( '-', '-', '-', '-' ),\r
+       GF_ISOM_BOX_TYPE_DATA   = GF_4CC( 'd', 'a', 't', 'a' ),\r
+\r
+       GF_ISOM_HANDLER_TYPE_MDIR       = GF_4CC( 'm', 'd', 'i', 'r' ),\r
+       GF_ISOM_BOX_TYPE_CHAP   = GF_4CC( 'c', 'h', 'a', 'p' ),\r
+       \r
+       /*OMA (P)DCF boxes*/\r
+       GF_ISOM_BOX_TYPE_OHDR   = GF_4CC( 'o', 'h', 'd', 'r' ),\r
+       GF_ISOM_BOX_TYPE_GRPI   = GF_4CC( 'g', 'r', 'p', 'i' ),\r
+       GF_ISOM_BOX_TYPE_MDRI   = GF_4CC( 'm', 'd', 'r', 'i' ),\r
+       GF_ISOM_BOX_TYPE_ODTT   = GF_4CC( 'o', 'd', 't', 't' ),\r
+       GF_ISOM_BOX_TYPE_ODRB   = GF_4CC( 'o', 'd', 'r', 'b' ),\r
+       GF_ISOM_BOX_TYPE_ODKM   = GF_4CC( 'o', 'd', 'k', 'm' ),\r
+       GF_ISOM_BOX_TYPE_ODAF   = GF_4CC( 'o', 'd', 'a', 'f' ),\r
+\r
+       /*3GPP DIMS */\r
+       GF_ISOM_BOX_TYPE_DIMS   = GF_4CC( 'd', 'i', 'm', 's' ),\r
+       GF_ISOM_BOX_TYPE_DIMC   = GF_4CC( 'd', 'i', 'm', 'C' ),\r
+       GF_ISOM_BOX_TYPE_DIST   = GF_4CC( 'd', 'i', 'S', 'T' ),\r
+\r
+\r
+       GF_ISOM_BOX_TYPE_AC3    = GF_4CC( 'a', 'c', '-', '3' ),\r
+       GF_ISOM_BOX_TYPE_DAC3   = GF_4CC( 'd', 'a', 'c', '3' ),\r
+\r
+       /*ALL INTERNAL BOXES - NEVER WRITTEN TO FILE!!*/\r
+\r
+       /*generic handlers*/\r
+       GF_ISOM_BOX_TYPE_GNRM   = GF_4CC( 'g', 'n', 'r', 'm' ),\r
+       GF_ISOM_BOX_TYPE_GNRV   = GF_4CC( 'g', 'n', 'r', 'v' ),\r
+       GF_ISOM_BOX_TYPE_GNRA   = GF_4CC( 'g', 'n', 'r', 'a' ),\r
+       /*storage of AU fragments (for MPEG-4 visual resync marker (video packets), located in stbl.*/\r
+       GF_ISOM_BOX_TYPE_STSF   =  GF_4CC( 'S', 'T', 'S', 'F' ),\r
+       /*base constructor of all hint formats (currently only RTP uses it)*/\r
+       GF_ISOM_BOX_TYPE_GHNT   = GF_4CC( 'g', 'h', 'n', 't' ),\r
+       /*for compatibility with old files hinted for DSS - needs special parsing*/\r
+       GF_ISOM_BOX_TYPE_VOID   = GF_4CC( 'V', 'O', 'I', 'D' ),\r
+};\r
+\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       /*note: the data is NEVER loaded to the mdat in this lib*/\r
+       u64 dataSize;\r
+       char *data;\r
+} GF_MediaDataBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       char *data;\r
+       u32 dataSize;\r
+} GF_UnknownBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_UUID_BOX\r
+       char *data;\r
+       u32 dataSize;\r
+} GF_UnknownUUIDBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       u64 creationTime;\r
+       u64 modificationTime;\r
+       u32 timeScale;\r
+       u64 duration;\r
+       u32 nextTrackID;\r
+       u32 preferredRate;\r
+       u16 preferredVolume;\r
+       char reserved[10];\r
+       u32 matrixA;\r
+       u32 matrixB;\r
+       u32 matrixU;\r
+       u32 matrixC;\r
+       u32 matrixD;\r
+       u32 matrixV;\r
+       u32 matrixW;\r
+       u32 matrixX;\r
+       u32 matrixY;\r
+       u32 previewTime;\r
+       u32 previewDuration;\r
+       u32 posterTime;\r
+       u32 selectionTime;\r
+       u32 selectionDuration;\r
+       u32 currentTime;\r
+} GF_MovieHeaderBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       GF_Descriptor *descriptor;\r
+} GF_ObjectDescriptorBox;\r
+\r
+/*used for entry list*/\r
+typedef struct\r
+{\r
+       u64 segmentDuration;\r
+       s64 mediaTime;\r
+       u32 mediaRate;\r
+} GF_EdtsEntry;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       GF_List *entryList;\r
+} GF_EditListBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       GF_EditListBox *editList;\r
+} GF_EditBox;\r
+\r
+\r
+/*used to classify boxes in the UserData GF_Box*/\r
+typedef struct\r
+{\r
+       u32 boxType;\r
+       u8 uuid[16];\r
+       GF_List *boxList;\r
+} GF_UserDataMap;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       GF_List *recordList;\r
+} GF_UserDataBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       GF_MovieHeaderBox *mvhd;\r
+       GF_ObjectDescriptorBox *iods;\r
+       GF_UserDataBox *udta;\r
+#ifndef        GPAC_ISOM_NO_FRAGMENTS\r
+       struct __tag_mvex_box *mvex;\r
+#endif\r
+       /*meta box if any*/\r
+       struct __tag_meta_box *meta;\r
+       /*track boxes*/\r
+       GF_List *trackList;\r
+       /*other boxes*/\r
+       GF_List *boxes;\r
+\r
+       GF_ISOFile *mov;\r
+\r
+} GF_MovieBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       u64 creationTime;\r
+       u64 modificationTime;\r
+       u32 trackID;\r
+       u32 reserved1;\r
+       u64 duration;\r
+       u32 reserved2[2];\r
+       u16 layer;\r
+       u16 alternate_group;\r
+       u16 volume;\r
+       u16 reserved3;\r
+       u32 matrix[9];\r
+       u32 width, height;\r
+} GF_TrackHeaderBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       GF_List *boxList;\r
+} GF_TrackReferenceBox;\r
+\r
+\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       GF_UserDataBox *udta;\r
+       GF_TrackHeaderBox *Header;\r
+       struct __tag_media_box *Media;\r
+       GF_EditBox *editBox;\r
+       GF_TrackReferenceBox *References;\r
+       /*meta box if any*/\r
+       struct __tag_meta_box *meta;\r
+       /*other*/\r
+       GF_List *boxes;\r
+\r
+       GF_MovieBox *moov;\r
+       /*private for media padding*/\r
+       u32 padding_bytes;\r
+       /*private for editing*/\r
+       char *name;\r
+       /*private for editing*/\r
+       Bool is_unpacked;\r
+} GF_TrackBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       u64 creationTime;\r
+       u64 modificationTime;\r
+       u32 timeScale;\r
+       u64 duration;\r
+       char packedLanguage[4];\r
+       u16 reserved;\r
+} GF_MediaHeaderBox;\r
+\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       u32 reserved1;\r
+       u32 handlerType;\r
+       u8 reserved2[12];\r
+       char *nameUTF8;\r
+} GF_HandlerBox;\r
+\r
+typedef struct __tag_media_box\r
+{\r
+       GF_ISOM_BOX\r
+       GF_TrackBox *mediaTrack;\r
+       GF_MediaHeaderBox *mediaHeader;\r
+       GF_HandlerBox *handler;\r
+       struct __tag_media_info_box *information;\r
+       u64 BytesMissing;\r
+} GF_MediaBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       u64 reserved;\r
+} GF_VideoMediaHeaderBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       u32 reserved;\r
+} GF_SoundMediaHeaderBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       /*this is used for us INTERNALLY*/\r
+       u32 subType;\r
+       u32 maxPDUSize;\r
+       u32 avgPDUSize;\r
+       u32 maxBitrate;\r
+       u32 avgBitrate;\r
+       u32 slidingAverageBitrate;\r
+} GF_HintMediaHeaderBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+} GF_MPEGMediaHeaderBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+} GF_ODMediaHeaderBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+} GF_OCRMediaHeaderBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+} GF_SceneMediaHeaderBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       GF_List *boxList;\r
+} GF_DataReferenceBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       GF_DataReferenceBox *dref;\r
+} GF_DataInformationBox;\r
+\r
+#define GF_ISOM_DATAENTRY_FIELDS       \\r
+       char *location;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       GF_ISOM_DATAENTRY_FIELDS\r
+} GF_DataEntryBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       GF_ISOM_DATAENTRY_FIELDS\r
+} GF_DataEntryURLBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       GF_ISOM_DATAENTRY_FIELDS\r
+       char *nameURN;\r
+} GF_DataEntryURNBox;\r
+\r
+typedef struct\r
+{\r
+       u32 sampleCount;\r
+       u32 sampleDelta;\r
+} GF_SttsEntry;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       GF_SttsEntry *entries;\r
+       u32 nb_entries, alloc_size;\r
+\r
+#ifndef GPAC_READ_ONLY\r
+       /*cache for WRITE*/\r
+       u32 w_currentSampleNum;\r
+       u64 w_LastDTS;\r
+#endif\r
+       /*cache for READ*/\r
+       u32 r_FirstSampleInEntry;\r
+       u32 r_currentEntryIndex;\r
+       u64 r_CurrentDTS;\r
+} GF_TimeToSampleBox;\r
+\r
+\r
+/*TO CHECK - it could be reasonnable to only use 16bits for both count and offset*/\r
+typedef struct\r
+{\r
+       u32 sampleCount;\r
+       u32 decodingOffset;\r
+} GF_DttsEntry;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       GF_DttsEntry *entries;\r
+       u32 nb_entries, alloc_size;\r
+\r
+#ifndef GPAC_READ_ONLY\r
+       u32 w_LastSampleNumber;\r
+       /*force one sample per entry*/\r
+       Bool unpack_mode;\r
+#endif\r
+       /*Cache for read*/\r
+       u32 r_currentEntryIndex;\r
+       u32 r_FirstSampleInEntry;\r
+} GF_CompositionOffsetBox;\r
+\r
+\r
+typedef struct\r
+{\r
+       u32 SampleNumber;\r
+       u32 fragmentCount;\r
+       u16 *fragmentSizes;\r
+} GF_StsfEntry;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       GF_List *entryList;\r
+#ifndef GPAC_READ_ONLY\r
+       /*Cache for write*/\r
+       GF_StsfEntry *w_currentEntry;\r
+       u32 w_currentEntryIndex;\r
+#endif\r
+       /*Cache for read*/\r
+       u32 r_currentEntryIndex;\r
+       GF_StsfEntry *r_currentEntry;\r
+} GF_SampleFragmentBox;\r
+\r
+\r
+#define GF_ISOM_SAMPLE_ENTRY_FIELDS            \\r
+       GF_ISOM_UUID_BOX                                        \\r
+       u16 dataReferenceIndex;                         \\r
+       char reserved[ 6 ];                                     \\r
+       struct __tag_protect_box *protection_info;\r
+\r
+/*base sample entry box (never used but for typecasting)*/\r
+typedef struct\r
+{\r
+       GF_ISOM_SAMPLE_ENTRY_FIELDS\r
+} GF_SampleEntryBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_SAMPLE_ENTRY_FIELDS\r
+       /*box type as specified in the file (not this box's type!!)*/\r
+       u32 EntryType;\r
+\r
+       char *data;\r
+       u32 data_size;\r
+} GF_GenericSampleEntryBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       GF_ESD *desc;\r
+} GF_ESDBox;\r
+\r
+/*for all MPEG4 media except audio and video*/\r
+typedef struct\r
+{\r
+       GF_ISOM_SAMPLE_ENTRY_FIELDS\r
+       GF_ESDBox *esd;\r
+       /*used for hinting when extracting the OD stream...*/\r
+       GF_SLConfig *slc;\r
+} GF_MPEGSampleEntryBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u32 hSpacing;\r
+       u32 vSpacing;\r
+} GF_PixelAspectRatioBox;\r
+\r
+\r
+#define GF_ISOM_VISUAL_SAMPLE_ENTRY            \\r
+       GF_ISOM_SAMPLE_ENTRY_FIELDS                     \\r
+       u16 version;                                            \\r
+       u16 revision;                                           \\r
+       u32 vendor;                                                     \\r
+       u32 temporal_quality;                           \\r
+       u32 spacial_quality;                            \\r
+       u16 Width, Height;                                      \\r
+       u32 horiz_res, vert_res;                        \\r
+       u32 entry_data_size;                            \\r
+       u16 frames_per_sample;                          \\r
+       char compressor_name[33];                       \\r
+       u16 bit_depth;                                          \\r
+       s16 color_table_index;                          \\r
+       GF_PixelAspectRatioBox *pasp;           \r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_VISUAL_SAMPLE_ENTRY\r
+} GF_VisualSampleEntryBox;\r
+\r
+void gf_isom_video_sample_entry_init(GF_VisualSampleEntryBox *ent);\r
+GF_Err gf_isom_video_sample_entry_read(GF_VisualSampleEntryBox *ptr, GF_BitStream *bs);\r
+#ifndef GPAC_READ_ONLY\r
+void gf_isom_video_sample_entry_write(GF_VisualSampleEntryBox *ent, GF_BitStream *bs);\r
+void gf_isom_video_sample_entry_size(GF_VisualSampleEntryBox *ent);\r
+#endif\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u32 bufferSizeDB;\r
+       u32 maxBitrate;\r
+       u32 avgBitrate;\r
+} GF_MPEG4BitRateBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       GF_List *descriptors;\r
+} GF_MPEG4ExtensionDescriptorsBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       GF_AVCConfig *config;\r
+} GF_AVCConfigurationBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_VISUAL_SAMPLE_ENTRY\r
+       GF_ESDBox *esd;\r
+       /*used for Publishing*/\r
+       GF_SLConfig *slc;\r
+\r
+       /*avc extensions - we merged with regular 'mp4v' box to handle isma E&A signaling of AVC*/\r
+       GF_AVCConfigurationBox *avc_config;\r
+       GF_MPEG4BitRateBox *bitrate;\r
+       /*ext descriptors*/\r
+       GF_MPEG4ExtensionDescriptorsBox *descr;\r
+       /*internally emulated esd*/\r
+       GF_ESD *emul_esd;\r
+       /*iPod's hack*/\r
+       GF_UnknownUUIDBox *ipod_ext;\r
+\r
+} GF_MPEGVisualSampleEntryBox;\r
+\r
+\r
+/*this is the default visual sdst (to handle unknown media)*/\r
+typedef struct\r
+{\r
+       GF_ISOM_VISUAL_SAMPLE_ENTRY\r
+       /*box type as specified in the file (not this box's type!!)*/\r
+       u32 EntryType;\r
+       /*opaque description data (ESDS in MP4, SMI in SVQ3, ...)*/\r
+       char *data;\r
+       u32 data_size;\r
+} GF_GenericVisualSampleEntryBox;\r
+\r
+\r
+#define GF_ISOM_AUDIO_SAMPLE_ENTRY     \\r
+       GF_ISOM_SAMPLE_ENTRY_FIELDS             \\r
+       u16 version;                                    \\r
+       u16 revision;                                   \\r
+       u32 vendor;                                             \\r
+       u16 channel_count;                              \\r
+       u16 bitspersample;                              \\r
+       u16 compression_id;                             \\r
+       u16 packet_size;                                \\r
+       u16 samplerate_hi;                              \\r
+       u16 samplerate_lo;\r
+\r
+\r
+typedef struct \r
+{\r
+       GF_ISOM_AUDIO_SAMPLE_ENTRY\r
+} GF_AudioSampleEntryBox;\r
+\r
+void gf_isom_audio_sample_entry_init(GF_AudioSampleEntryBox *ptr);\r
+GF_Err gf_isom_audio_sample_entry_read(GF_AudioSampleEntryBox *ptr, GF_BitStream *bs);\r
+#ifndef GPAC_READ_ONLY\r
+void gf_isom_audio_sample_entry_write(GF_AudioSampleEntryBox *ptr, GF_BitStream *bs);\r
+void gf_isom_audio_sample_entry_size(GF_AudioSampleEntryBox *ptr);\r
+#endif\r
+\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_AUDIO_SAMPLE_ENTRY\r
+       GF_ESDBox *esd;\r
+       GF_SLConfig *slc;\r
+} GF_MPEGAudioSampleEntryBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       GF_3GPConfig cfg;\r
+} GF_3GPPConfigBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_AUDIO_SAMPLE_ENTRY\r
+       GF_3GPPConfigBox *info;\r
+} GF_3GPPAudioSampleEntryBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_VISUAL_SAMPLE_ENTRY\r
+       GF_3GPPConfigBox *info;\r
+} GF_3GPPVisualSampleEntryBox;\r
+\r
+/*this is the default visual sdst (to handle unknown media)*/\r
+typedef struct\r
+{\r
+       GF_ISOM_AUDIO_SAMPLE_ENTRY\r
+       /*box type as specified in the file (not this box's type!!)*/\r
+       u32 EntryType;\r
+       /*opaque description data (ESDS in MP4, ...)*/\r
+       char *data;\r
+       u32 data_size;\r
+} GF_GenericAudioSampleEntryBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       GF_AC3Config cfg;\r
+} GF_AC3ConfigBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_AUDIO_SAMPLE_ENTRY\r
+       GF_AC3ConfigBox *info;\r
+} GF_AC3SampleEntryBox;\r
+\r
+\r
+\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       u8 profile;\r
+       u8 level;\r
+       u8 pathComponents;\r
+       Bool fullRequestHost;\r
+       Bool streamType;\r
+       u8 containsRedundant;\r
+       char *textEncoding;\r
+       char *contentEncoding;\r
+} GF_DIMSSceneConfigBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       char *content_script_types;\r
+} GF_DIMSScriptTypesBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_SAMPLE_ENTRY_FIELDS\r
+       GF_DIMSSceneConfigBox *config;\r
+       GF_MPEG4BitRateBox *bitrate;\r
+       GF_DIMSScriptTypesBox *scripts;\r
+} GF_DIMSSampleEntryBox;\r
+\r
+\r
+/*base sample entry box (never used but for typecasting)*/\r
+typedef struct\r
+{\r
+       GF_ISOM_SAMPLE_ENTRY_FIELDS\r
+       char *content_encoding; //optional\r
+       char *mime_type_or_namespace;   //not optional\r
+       char *xml_schema_loc;   // optional\r
+       GF_MPEG4BitRateBox *bitrate; // optional\r
+} GF_MetaDataSampleEntryBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       GF_List *boxList;\r
+} GF_SampleDescriptionBox;\r
+\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       /*if this is the compact version, sample size is actually fieldSize*/\r
+       u32 sampleSize;\r
+       u32 sampleCount;\r
+       u32 alloc_size;\r
+       u32 *sizes;\r
+} GF_SampleSizeBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       u32 nb_entries;\r
+       u32 alloc_size;\r
+       u32 *offsets;\r
+} GF_ChunkOffsetBox;\r
+\r
+typedef struct \r
+{\r
+       GF_ISOM_FULL_BOX\r
+       u32 nb_entries;\r
+       u32 alloc_size;\r
+       u64 *offsets;\r
+} GF_ChunkLargeOffsetBox;\r
+\r
+typedef struct\r
+{\r
+       u32 firstChunk;\r
+       u32 nextChunk;\r
+       u32 samplesPerChunk;\r
+       u32 sampleDescriptionIndex;\r
+       u8 isEdited;\r
+} GF_StscEntry;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       GF_StscEntry *entries;\r
+       u32 alloc_size, nb_entries;\r
+\r
+       /*0-based cache for READ. In WRITE mode, we always have 1 sample per chunk so no need for a cache*/\r
+       u32 currentIndex;\r
+       /*first sample number in this chunk*/\r
+       u32 firstSampleInCurrentChunk;\r
+       u32 currentChunk;\r
+       u32 ghostNumber;\r
+} GF_SampleToChunkBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       u32 alloc_size, nb_entries;\r
+       u32 *sampleNumbers;\r
+       /*cache for READ mode (in write we realloc no matter what)*/\r
+       u32 r_LastSyncSample;\r
+       /*0-based index in the array*/\r
+       u32 r_LastSampleIndex;\r
+} GF_SyncSampleBox;\r
+\r
+typedef struct\r
+{\r
+       u32 shadowedSampleNumber;\r
+       s32 syncSampleNumber;\r
+} GF_StshEntry;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       GF_List *entries;\r
+       /*Cache for read mode*/\r
+       u32 r_LastEntryIndex;\r
+       u32 r_LastFoundSample;\r
+} GF_ShadowSyncBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       u32 nb_entries;\r
+       u16 *priorities;\r
+} GF_DegradationPriorityBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       u32 SampleCount;\r
+       u8 *padbits;\r
+} GF_PaddingBitsBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       u32 sampleCount;\r
+       /*each dep type is packed on 1 byte*/\r
+       u8 *sample_info;\r
+} GF_SampleDependencyTypeBox;\r
+\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       GF_TimeToSampleBox *TimeToSample;\r
+       GF_CompositionOffsetBox *CompositionOffset;\r
+       GF_SyncSampleBox *SyncSample;\r
+       GF_SampleDescriptionBox *SampleDescription;\r
+       GF_SampleSizeBox *SampleSize;\r
+       GF_SampleToChunkBox *SampleToChunk;\r
+       /*untyped, to handle 32 bits and 64 bits chunkOffsets*/\r
+       GF_Box *ChunkOffset;\r
+       GF_ShadowSyncBox *ShadowSync;\r
+       GF_DegradationPriorityBox *DegradationPriority;\r
+       GF_PaddingBitsBox *PaddingBits;\r
+       GF_SampleDependencyTypeBox *SampleDep;\r
+       GF_SampleFragmentBox *Fragments;\r
+\r
+       u32 MaxSamplePerChunk;\r
+       u16 groupID;\r
+       u16 trackPriority;\r
+       u32 currentEntryIndex;\r
+} GF_SampleTableBox;\r
+\r
+typedef struct __tag_media_info_box\r
+{\r
+       GF_ISOM_BOX\r
+       GF_DataInformationBox *dataInformation;\r
+       GF_SampleTableBox *sampleTable;\r
+       GF_Box *InfoHeader;\r
+       struct __tag_data_map *dataHandler;\r
+       u32 dataEntryIndex;\r
+       GF_List *boxes;\r
+} GF_MediaInformationBox;\r
+\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       char *data;\r
+       u32 dataSize;\r
+} GF_FreeSpaceBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       char packedLanguageCode[4];\r
+       char *notice;\r
+} GF_CopyrightBox;\r
+\r
+\r
+typedef struct\r
+{\r
+       char *name;\r
+       u64 start_time;\r
+} GF_ChapterEntry;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       GF_List *list;\r
+} GF_ChapterListBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u32 reference_type;\r
+       u32 trackIDCount;\r
+       u32 *trackIDs;\r
+} GF_TrackReferenceTypeBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u32 majorBrand;\r
+       u32 minorVersion;\r
+       u32 altCount;\r
+       u32 *altBrand;\r
+} GF_FileTypeBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       u32 *rates;\r
+       u32 *times;\r
+       u32 count;\r
+} GF_ProgressiveDownloadBox;\r
+\r
+\r
+/*\r
+       3GPP streaming text boxes\r
+*/\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u32 entry_count;\r
+       GF_FontRecord *fonts;\r
+} GF_FontTableBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_SAMPLE_ENTRY_FIELDS                             \\r
+       u32 displayFlags;\r
+       s8 horizontal_justification;\r
+       s8 vertical_justification;\r
+       /*ARGB*/\r
+       u32 back_color;\r
+       GF_BoxRecord default_box; \r
+       GF_StyleRecord  default_style;\r
+       GF_FontTableBox *font_table;\r
+} GF_TextSampleEntryBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u32 entry_count;\r
+       GF_StyleRecord *styles;\r
+} GF_TextStyleBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u16 startcharoffset;\r
+       u16 endcharoffset; \r
+} GF_TextHighlightBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       /*ARGB*/\r
+       u32 hil_color;\r
+} GF_TextHighlightColorBox;\r
+\r
+typedef struct\r
+{\r
+       u32 highlight_endtime;\r
+       u16 start_charoffset;\r
+       u16 end_charoffset;\r
+} KaraokeRecord;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u32 highlight_starttime;\r
+       u16 nb_entries;\r
+       KaraokeRecord *records;\r
+} GF_TextKaraokeBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u32 scroll_delay;\r
+} GF_TextScrollDelayBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u16 startcharoffset;\r
+       u16 endcharoffset;\r
+       char *URL;\r
+       char *URL_hint;\r
+} GF_TextHyperTextBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       GF_BoxRecord box;\r
+} GF_TextBoxBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u16 startcharoffset;\r
+       u16 endcharoffset;\r
+} GF_TextBlinkBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u8 wrap_flag;\r
+} GF_TextWrapBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       u32 switchGroup;\r
+       u32 *attributeList;\r
+       u32 attributeListCount;\r
+} GF_TrackSelectionBox;\r
+\r
+/*\r
+       MPEG-21 extensions\r
+*/\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       u32 xml_length;\r
+       char *xml;\r
+} GF_XMLBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       u32 data_length;\r
+       char *data;\r
+} GF_BinaryXMLBox;\r
+\r
+typedef struct\r
+{\r
+       u64 extent_offset;\r
+       u64 extent_length;\r
+#ifndef GPAC_READ_OLNLY\r
+       /*for storage only*/\r
+       u64 original_extent_offset;\r
+#endif\r
+} GF_ItemExtentEntry;\r
+\r
+typedef struct \r
+{\r
+       u16 item_ID;\r
+       u16 data_reference_index;\r
+       u64 base_offset;\r
+#ifndef GPAC_READ_OLNLY\r
+       /*for storage only*/\r
+       u64 original_base_offset;\r
+#endif\r
+       GF_List *extent_entries;\r
+} GF_ItemLocationEntry;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       u8 offset_size;\r
+    u8 length_size;\r
+       u8 base_offset_size;\r
+       GF_List *location_entries;\r
+} GF_ItemLocationBox;\r
+\r
+typedef        struct \r
+{\r
+       GF_ISOM_FULL_BOX\r
+       u16 item_ID;\r
+} GF_PrimaryItemBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       GF_List *protection_information;\r
+} GF_ItemProtectionBox;\r
+\r
+typedef struct \r
+{\r
+       GF_ISOM_FULL_BOX\r
+       u16 item_ID;\r
+       u16 item_protection_index;\r
+       /*zero-terminated strings*/\r
+       char *item_name;\r
+       char *content_type;\r
+       char *content_encoding;\r
+       // needed to actually read the resource file, but not written in the MP21 file.\r
+       char *full_path;\r
+} GF_ItemInfoEntryBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       GF_List *item_infos;\r
+} GF_ItemInfoBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u32 data_format;\r
+} GF_OriginalFormatBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       u32 scheme_type;\r
+       u32 scheme_version;\r
+       char *URI;\r
+} GF_SchemeTypeBox;\r
+\r
+/*ISMACryp specific*/\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       /*zero-terminated string*/\r
+       char *URI;\r
+} GF_ISMAKMSBox;\r
+\r
+/*ISMACryp specific*/\r
+typedef struct __isma_format_box\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       u8 selective_encryption;\r
+       u8 key_indicator_length;\r
+       u8 IV_length;\r
+} GF_ISMASampleFormatBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       GF_ISMAKMSBox *ikms;\r
+       GF_ISMASampleFormatBox *isfm;\r
+       struct __oma_kms_box *okms;\r
+} GF_SchemeInformationBox;\r
+\r
+typedef struct __tag_protect_box\r
+{\r
+       GF_ISOM_BOX\r
+       GF_OriginalFormatBox *original_format;\r
+       GF_SchemeTypeBox *scheme_type;\r
+       GF_SchemeInformationBox *info;\r
+} GF_ProtectionInfoBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       GF_List *descriptors;\r
+} GF_IPMPInfoBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       GF_IPMP_ToolList *ipmp_tools;\r
+       GF_List *descriptors;\r
+} GF_IPMPControlBox;\r
+\r
+\r
+typedef struct __tag_meta_box\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       GF_HandlerBox *handler; \r
+       GF_PrimaryItemBox *primary_resource;\r
+       GF_DataInformationBox *file_locations;\r
+       GF_ItemLocationBox *item_locations;\r
+       GF_ItemProtectionBox *protections;\r
+       GF_ItemInfoBox *item_infos;\r
+       GF_IPMPControlBox *IPMP_control;\r
+       GF_List *other_boxes;\r
+} GF_MetaBox;\r
+\r
+\r
+\r
+\r
+#ifndef        GPAC_ISOM_NO_FRAGMENTS\r
+\r
+/*V2 boxes - Movie Fragments*/\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       u64 fragment_duration;\r
+} GF_MovieExtendsHeaderBox;\r
+\r
+\r
+typedef struct __tag_mvex_box\r
+{\r
+       GF_ISOM_BOX\r
+       GF_List *TrackExList;\r
+       GF_MovieExtendsHeaderBox *mehd;\r
+       GF_ISOFile *mov;\r
+} GF_MovieExtendsBox;\r
+\r
+/*the TrackExtends contains default values for the track fragments*/\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       u32 trackID;\r
+       u32 def_sample_desc_index;\r
+       u32 def_sample_duration;\r
+       u32 def_sample_size;\r
+       u32 def_sample_flags;\r
+       GF_TrackBox *track;\r
+} GF_TrackExtendsBox;\r
+\r
+/*indicates the seq num of this fragment*/\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       u32 sequence_number;\r
+} GF_MovieFragmentHeaderBox;\r
+\r
+/*MovieFragment is a container IN THE FILE, contains 1 fragment*/\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       GF_MovieFragmentHeaderBox *mfhd;\r
+       GF_List *TrackList;\r
+       GF_ISOFile *mov;\r
+} GF_MovieFragmentBox;\r
+\r
+\r
+/*FLAGS for TRAF*/\r
+enum\r
+{\r
+       GF_ISOM_TRAF_BASE_OFFSET        =       0x01,\r
+       GF_ISOM_TRAF_SAMPLE_DESC        =       0x02,\r
+       GF_ISOM_TRAF_SAMPLE_DUR =       0x08,\r
+       GF_ISOM_TRAF_SAMPLE_SIZE        =       0x10,\r
+       GF_ISOM_TRAF_SAMPLE_FLAGS       =       0x20,\r
+       GF_ISOM_TRAF_DUR_EMPTY  =       0x10000\r
+};\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       u32 trackID;\r
+       /* all the following are optional fields */\r
+       u64 base_data_offset;\r
+       u32 sample_desc_index;\r
+       u32 def_sample_duration;\r
+       u32 def_sample_size;\r
+       u32 def_sample_flags;\r
+       u32 EmptyDuration;\r
+       u8 IFrameSwitching;\r
+} GF_TrackFragmentHeaderBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       GF_TrackFragmentHeaderBox *tfhd;\r
+       GF_List *TrackRuns;\r
+       /*keep a pointer to default flags*/\r
+       GF_TrackExtendsBox *trex;\r
+       /*when data caching is on*/\r
+       u32 DataCache;\r
+} GF_TrackFragmentBox;\r
+\r
+/*FLAGS for TRUN : specify what is written in the SampleTable of TRUN*/\r
+enum\r
+{\r
+       GF_ISOM_TRUN_DATA_OFFSET        = 0x01,\r
+       GF_ISOM_TRUN_FIRST_FLAG         = 0x04,\r
+       GF_ISOM_TRUN_DURATION           = 0x100,\r
+       GF_ISOM_TRUN_SIZE                       = 0x200,\r
+       GF_ISOM_TRUN_FLAGS                      = 0x400,\r
+       GF_ISOM_TRUN_CTS_OFFSET         = 0x800\r
+};\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       u32 sample_count;\r
+       /*the following are optional fields */\r
+       s32 data_offset;\r
+       u32 first_sample_flags;\r
+       /*can be empty*/\r
+       GF_List *entries;\r
+\r
+       /*in write mode with data caching*/\r
+       GF_BitStream *cache;\r
+} GF_TrackFragmentRunBox;\r
+\r
+typedef struct\r
+{\r
+       u32 Duration;\r
+       u32 size;\r
+       u32 flags;\r
+       u32 CTS_Offset;\r
+} GF_TrunEntry;\r
+\r
+#endif\r
+\r
+\r
+/*RTP Hint Track Sample Entry*/\r
+typedef struct\r
+{\r
+       GF_ISOM_SAMPLE_ENTRY_FIELDS\r
+       u16 HintTrackVersion;\r
+       u16 LastCompatibleVersion;\r
+       u32 MaxPacketSize;\r
+       GF_List *HintDataTable;\r
+       /*this is where we store the current RTP sample in read/write mode*/\r
+       struct __tag_hint_sample *hint_sample;\r
+       /*current hint sample in read mode, 1-based (0 is reset)*/\r
+       u32 cur_sample;\r
+       u32 pck_sn, ts_offset, ssrc;\r
+       GF_TrackReferenceTypeBox *hint_ref;\r
+} GF_HintSampleEntryBox;\r
+\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u32 subType;\r
+       char *sdpText;\r
+} GF_RTPBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       char *sdpText;\r
+} GF_SDPBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       s32 timeOffset;\r
+} GF_RTPOBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       /*contains GF_SDPBox if in track, GF_RTPBox if in movie*/\r
+       GF_Box *SDP;\r
+       GF_List *boxList;\r
+} GF_HintTrackInfoBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u8 reserved;\r
+       u8 prefered;\r
+       u8 required;\r
+} GF_RelyHintBox;\r
+\r
+/***********************************************************\r
+                       data entry tables for RTP\r
+***********************************************************/\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u32 timeScale;\r
+} GF_TSHintEntryBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u32 TimeOffset; \r
+} GF_TimeOffHintEntryBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u32 SeqOffset;\r
+} GF_SeqOffHintEntryBox;\r
+\r
+\r
+\r
+/***********************************************************\r
+                       hint track information boxes for RTP\r
+***********************************************************/\r
+\r
+/*Total number of bytes that will be sent, including 12-byte RTP headers, but not including any network headers*/\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u64 nbBytes;\r
+} GF_TRPYBox;\r
+\r
+/*32-bits version of trpy used in Darwin*/\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u32 nbBytes;\r
+} GF_TOTLBox;\r
+\r
+/*Total number of network packets that will be sent*/\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u64 nbPackets;\r
+} GF_NUMPBox;\r
+\r
+/*32-bits version of nump used in Darwin*/\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u32 nbPackets;\r
+} GF_NPCKBox;\r
+\r
+\r
+/*Total number of bytes that will be sent, not including 12-byte RTP headers*/\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u64 nbBytes;\r
+} GF_NTYLBox;\r
+\r
+/*32-bits version of tpyl used in Darwin*/\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u32 nbBytes;\r
+} GF_TPAYBox;\r
+\r
+/*Maximum data rate in bits per second.*/\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u32 granularity;\r
+       u32 maxDataRate;\r
+} GF_MAXRBox;\r
+\r
+\r
+/*Total number of bytes from the media track to be sent*/\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u64 nbBytes;\r
+} GF_DMEDBox;\r
+\r
+/*Number of bytes of immediate data to be sent*/\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u64 nbBytes;\r
+} GF_DIMMBox;\r
+\r
+\r
+/*Number of bytes of repeated data to be sent*/\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u64 nbBytes;\r
+} GF_DREPBox;\r
+\r
+/*Smallest relative transmission time, in milliseconds. signed integer for smoothing*/\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       s32 minTime;\r
+} GF_TMINBox;\r
+\r
+/*Largest relative transmission time, in milliseconds.*/\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       s32 maxTime;\r
+} GF_TMAXBox;\r
+\r
+/*Largest packet, in bytes, including 12-byte RTP header*/\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u32 maxSize;\r
+} GF_PMAXBox;\r
+\r
+/*Longest packet duration, in milliseconds*/\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u32 maxDur;\r
+} GF_DMAXBox;\r
+\r
+/*32-bit payload type number, followed by rtpmap payload string */\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       u32 payloadCode;\r
+       char *payloadString;\r
+} GF_PAYTBox;\r
+\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       char *string;\r
+} GF_NameBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       GF_List *dataRates;\r
+       GF_List *boxList;\r
+} GF_HintInfoBox;\r
+\r
+/*Apple extension*/\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       u32 reserved;\r
+       char *data;\r
+       u32 dataSize;\r
+} GF_DataBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       GF_DataBox *data;\r
+} GF_ListItemBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       GF_List *tags;\r
+} GF_ItemListBox;\r
+\r
+/*OMA (P)DCF extensions*/\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       u8 EncryptionMethod;\r
+       u8 PaddingScheme;\r
+       u64 PlaintextLength;\r
+       char *ContentID;\r
+       char *RightsIssuerURL;\r
+       char *TextualHeaders;\r
+       u32 TextualHeadersLen;\r
+       GF_List *ExtendedHeaders;\r
+} GF_OMADRMCommonHeaderBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       u8 GKEncryptionMethod;\r
+       char *GroupID;\r
+       u16 GKLength;\r
+       char *GroupKey;\r
+} GF_OMADRMGroupIDBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BOX\r
+       GF_List *boxes;\r
+} GF_OMADRMMutableInformationBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       char TransactionID[16];\r
+} GF_OMADRMTransactionTrackingBox;\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       char *oma_ro;\r
+       u32 oma_ro_size;\r
+} GF_OMADRMRightsObjectBox;\r
+\r
+/*identical*/\r
+typedef struct __isma_format_box GF_OMADRMAUFormatBox;\r
+\r
+typedef struct __oma_kms_box\r
+{\r
+       GF_ISOM_FULL_BOX\r
+       GF_OMADRMCommonHeaderBox *hdr;\r
+       GF_OMADRMAUFormatBox *fmt;\r
+} GF_OMADRMKMSBox;\r
+\r
+\r
+\r
+/*\r
+               Data Map (media storage) stuff\r
+*/\r
+\r
+/*regular file IO*/\r
+#define GF_ISOM_DATA_FILE                      0x01\r
+/*File Mapaing object, read-only mode on complete files (no download)*/\r
+#define GF_ISOM_DATA_FILE_MAPPING              0x02\r
+/*External file object. Needs implementation*/\r
+#define GF_ISOM_DATA_FILE_EXTERN               0x03\r
+\r
+/*Data Map modes*/\r
+enum\r
+{\r
+       /*read mode*/\r
+       GF_ISOM_DATA_MAP_READ = 1,\r
+       /*write mode*/\r
+       GF_ISOM_DATA_MAP_WRITE = 2,\r
+       /*the following modes are just ways of signaling extended functionalities\r
+       edit mode, to make sure the file is here, set to GF_ISOM_DATA_MAP_READ afterwards*/\r
+       GF_ISOM_DATA_MAP_EDIT = 3,\r
+       /*read-only access to the movie file: we create a file mapping object\r
+       mode is set to GF_ISOM_DATA_MAP_READ afterwards*/\r
+       GF_ISOM_DATA_MAP_READ_ONLY = 4,\r
+};\r
+\r
+/*this is the DataHandler structure each data handler has its own bitstream*/\r
+#define GF_ISOM_BASE_DATA_HANDLER      \\r
+       u8      type;           \\r
+       u64     curPos;         \\r
+       u8      mode;           \\r
+       GF_BitStream *bs;\r
+\r
+typedef struct __tag_data_map\r
+{\r
+       GF_ISOM_BASE_DATA_HANDLER\r
+} GF_DataMap;\r
+\r
+typedef struct \r
+{\r
+       GF_ISOM_BASE_DATA_HANDLER\r
+       FILE *stream;\r
+       Bool last_acces_was_read;\r
+#ifndef GPAC_READ_ONLY\r
+       char *temp_file;\r
+#endif\r
+} GF_FileDataMap;\r
+\r
+/*file mapping handler. used if supported, only on read mode for complete files  (not in file download)*/\r
+typedef struct \r
+{\r
+       GF_ISOM_BASE_DATA_HANDLER\r
+       char *name;\r
+       u32 file_size;\r
+       char *byte_map;\r
+       u32 byte_pos;\r
+} GF_FileMappingDataMap;\r
+\r
+GF_Err gf_isom_datamap_new(const char *location, const char *parentPath, u8 mode, GF_DataMap **outDataMap);\r
+void gf_isom_datamap_del(GF_DataMap *ptr);\r
+GF_Err gf_isom_datamap_open(GF_MediaBox *minf, u32 dataRefIndex, u8 Edit);\r
+void gf_isom_datamap_close(GF_MediaInformationBox *minf);\r
+u32 gf_isom_datamap_get_data(GF_DataMap *map, char *buffer, u32 bufferLength, u64 Offset);\r
+\r
+/*File-based data map*/\r
+GF_DataMap *gf_isom_fdm_new(const char *sPath, u8 mode);\r
+void gf_isom_fdm_del(GF_FileDataMap *ptr);\r
+u32 gf_isom_fdm_get_data(GF_FileDataMap *ptr, char *buffer, u32 bufferLength, u64 fileOffset);\r
+\r
+#ifndef GPAC_READ_ONLY\r
+GF_DataMap *gf_isom_fdm_new_temp(const char *sTempPath);\r
+#endif\r
+\r
+/*file-mapping, read only*/\r
+GF_DataMap *gf_isom_fmo_new(const char *sPath, u8 mode);\r
+void gf_isom_fmo_del(GF_FileMappingDataMap *ptr);\r
+u32 gf_isom_fmo_get_data(GF_FileMappingDataMap *ptr, char *buffer, u32 bufferLength, u64 fileOffset);\r
+\r
+#ifndef GPAC_READ_ONLY\r
+u64 gf_isom_datamap_get_offset(GF_DataMap *map);\r
+GF_Err gf_isom_datamap_add_data(GF_DataMap *ptr, char *data, u32 dataSize);\r
+#endif \r
+\r
+/*\r
+               Movie stuff\r
+*/\r
+\r
+\r
+/*time def for MP4/QT/MJ2K files*/\r
+#define GF_ISOM_MAC_TIME_OFFSET 2082758400/*208284480 */\r
+\r
+#ifndef        GPAC_ISOM_NO_FRAGMENTS\r
+#define GF_ISOM_FORMAT_FRAG_FLAGS(pad, sync, deg) ( ( (pad) << 17) | ( ( !(sync) ) << 16) | (deg) );\r
+#define GF_ISOM_GET_FRAG_PAD(flag) ( (flag) >> 17) & 0x7\r
+#define GF_ISOM_GET_FRAG_SYNC(flag) ( ! ( ( (flag) >> 16) & 0x1))\r
+#define GF_ISOM_GET_FRAG_DEG(flag)     (flag) & 0x7FFF\r
+#endif\r
+\r
+enum\r
+{\r
+       GF_ISOM_FRAG_WRITE_READY        =       0x01,\r
+       GF_ISOM_FRAG_READ_DEBUG         =       0x02,\r
+};\r
+\r
+/*this is our movie object*/\r
+struct __tag_isom {\r
+       /*the last fatal error*/\r
+       GF_Err LastError;\r
+       /*the original filename*/\r
+       char *fileName;\r
+       /*the original file in read/edit, and also used in fragments mode\r
+       once the first moov has been written\r
+       Nota: this API doesn't allow fragments BEFORE the MOOV in order\r
+       to make easily parsable files (note there could be some data (mdat) before\r
+       the moov*/\r
+       GF_DataMap *movieFileMap;\r
+\r
+#ifndef GPAC_READ_ONLY\r
+       /*the final file name*/\r
+       char *finalName;\r
+       /*the file where we store edited samples (for READ_WRITE and WRITE mode only)*/\r
+       GF_DataMap *editFileMap;\r
+       /*the interleaving time for dummy mode (in movie TimeScale)*/\r
+       u32 interleavingTime;\r
+#endif\r
+\r
+       u8 openMode;\r
+       u8 storageMode;\r
+       /*if true 3GPP text streams are read as MPEG-4 StreamingText*/\r
+       u8 convert_streaming_text;\r
+       u8 is_jp2;\r
+\r
+       /*main boxes for fast access*/\r
+       /*moov*/\r
+       GF_MovieBox *moov;\r
+       /*our MDAT box (one and only one when we store the file)*/\r
+       GF_MediaDataBox *mdat;\r
+       /*file brand (since v2, NULL means mp4 v1)*/\r
+       GF_FileTypeBox *brand;\r
+       /*progressive download info*/\r
+       GF_ProgressiveDownloadBox *pdin;\r
+       /*meta box if any*/\r
+       GF_MetaBox *meta;\r
+\r
+#ifndef        GPAC_ISOM_NO_FRAGMENTS\r
+       u32 FragmentsFlags, NextMoofNumber;\r
+       /*active fragment*/\r
+       GF_MovieFragmentBox *moof;\r
+       /*in WRITE mode, this is the current MDAT where data is written*/\r
+       /*in READ mode this is the last valid file position before a gf_isom_box_read failed*/\r
+       u64 current_top_box_start;\r
+#endif\r
+\r
+       /*this contains ALL the root boxes excepts fragments*/\r
+       GF_List *TopBoxes;\r
+\r
+       /*default track for sync of MPEG4 streams - this is the first accessed stream without OCR info - only set in READ mode*/\r
+       s32 es_id_default_sync;\r
+};\r
+\r
+/*time function*/\r
+u64 gf_isom_get_mp4time();\r
+/*set the last error of the file. if file is NULL, set the static error (used for IO errors*/\r
+void gf_isom_set_last_error(GF_ISOFile *the_file, GF_Err error);\r
+GF_Err gf_isom_parse_movie_boxes(GF_ISOFile *mov, u64 *bytesMissing);\r
+GF_ISOFile *gf_isom_new_movie();\r
+/*Movie and Track access functions*/\r
+GF_TrackBox *gf_isom_get_track_from_file(GF_ISOFile *the_file, u32 trackNumber);\r
+GF_TrackBox *gf_isom_get_track(GF_MovieBox *moov, u32 trackNumber);\r
+GF_TrackBox *gf_isom_get_track_from_id(GF_MovieBox *moov, u32 trackID);\r
+u32 gf_isom_get_tracknum_from_id(GF_MovieBox *moov, u32 trackID);\r
+/*open a movie*/\r
+GF_ISOFile *gf_isom_open_file(const char *fileName, u32 OpenMode, const char *tmp_dir);\r
+/*close and delete a movie*/\r
+void gf_isom_delete_movie(GF_ISOFile *mov);\r
+/*StreamDescription reconstruction Functions*/\r
+GF_Err GetESD(GF_MovieBox *moov, u32 trackID, u32 StreamDescIndex, GF_ESD **outESD);\r
+GF_Err GetESDForTime(GF_MovieBox *moov, u32 trackID, u64 CTS, GF_ESD **outESD);\r
+GF_Err Media_GetSampleDesc(GF_MediaBox *mdia, u32 SampleDescIndex, GF_SampleEntryBox **out_entry, u32 *dataRefIndex);\r
+GF_Err Media_GetSampleDescIndex(GF_MediaBox *mdia, u64 DTS, u32 *sampleDescIndex);\r
+/*get esd for given sample desc - \r
+       @true_desc_only: if true doesn't emulate desc and returns native ESD,\r
+                               otherwise emulates if needed/possible (TimedText) and return a hard copy of the desc\r
+*/\r
+GF_Err Media_GetESD(GF_MediaBox *mdia, u32 sampleDescIndex, GF_ESD **esd, Bool true_desc_only);\r
+Bool Track_IsMPEG4Stream(u32 HandlerType);\r
+Bool IsMP4Description(u32 entryType);\r
+/*Find a reference of a given type*/\r
+GF_Err Track_FindRef(GF_TrackBox *trak, u32 ReferenceType, GF_TrackReferenceTypeBox **dpnd);\r
+/*Time and sample*/\r
+GF_Err GetMediaTime(GF_TrackBox *trak, u64 movieTime, u64 *MediaTime, s64 *SegmentStartTime, s64 *MediaOffset, u8 *useEdit);\r
+GF_Err Media_GetSample(GF_MediaBox *mdia, u32 sampleNumber, GF_ISOSample **samp, u32 *sampleDescriptionIndex, Bool no_data, u64 *out_offset);\r
+GF_Err Media_CheckDataEntry(GF_MediaBox *mdia, u32 dataEntryIndex);\r
+GF_Err Media_FindSyncSample(GF_SampleTableBox *stbl, u32 searchFromTime, u32 *sampleNumber, u8 mode);\r
+GF_Err Media_RewriteODFrame(GF_MediaBox *mdia, GF_ISOSample *sample);\r
+GF_Err Media_FindDataRef(GF_DataReferenceBox *dref, char *URLname, char *URNname, u32 *dataRefIndex);\r
+Bool Media_IsSelfContained(GF_MediaBox *mdia, u32 StreamDescIndex);\r
+\r
+/*check the TimeToSample for the given time and return the Sample number\r
+if the entry is not found, return the closest sampleNumber in prevSampleNumber and 0 in sampleNumber\r
+if the DTS required is after all DTSs in the list, set prevSampleNumber and SampleNumber to 0\r
+useCTS specifies that we're looking for a composition time\r
+*/\r
+GF_Err findEntryForTime(GF_SampleTableBox *stbl, u64 DTS, u8 useCTS, u32 *sampleNumber, u32 *prevSampleNumber);\r
+/*Reading of the sample tables*/\r
+GF_Err stbl_GetSampleSize(GF_SampleSizeBox *stsz, u32 SampleNumber, u32 *Size);\r
+GF_Err stbl_GetSampleCTS(GF_CompositionOffsetBox *ctts, u32 SampleNumber, u32 *CTSoffset);\r
+GF_Err stbl_GetSampleDTS(GF_TimeToSampleBox *stts, u32 SampleNumber, u64 *DTS);\r
+/*find a RAP or set the prev / next RAPs if vars are passed*/\r
+GF_Err stbl_GetSampleRAP(GF_SyncSampleBox *stss, u32 SampleNumber, u8 *IsRAP, u32 *prevRAP, u32 *nextRAP);\r
+GF_Err stbl_GetSampleInfos(GF_SampleTableBox *stbl, u32 sampleNumber, u64 *offset, u32 *chunkNumber, u32 *descIndex, u8 *isEdited);\r
+GF_Err stbl_GetSampleShadow(GF_ShadowSyncBox *stsh, u32 *sampleNumber, u32 *syncNum);\r
+GF_Err stbl_GetPaddingBits(GF_PaddingBitsBox *padb, u32 SampleNumber, u8 *PadBits);\r
+u32 stbl_GetSampleFragmentCount(GF_SampleFragmentBox *stsf, u32 sampleNumber);\r
+u32 stbl_GetSampleFragmentSize(GF_SampleFragmentBox *stsf, u32 sampleNumber, u32 FragmentIndex);\r
+GF_Err stbl_GetSampleDepType(GF_SampleDependencyTypeBox *stbl, u32 SampleNumber, u32 *dependsOn, u32 *dependedOn, u32 *redundant);\r
+\r
+/*unpack sample2chunk and chunk offset so that we have 1 sample per chunk (edition mode only)*/\r
+GF_Err stbl_UnpackOffsets(GF_SampleTableBox *stbl);\r
+GF_Err SetTrackDuration(GF_TrackBox *trak);\r
+GF_Err Media_SetDuration(GF_TrackBox *trak);\r
+\r
+/*rewrites 3GP samples desc as MPEG-4 ESD*/\r
+GF_Err gf_isom_get_ttxt_esd(GF_MediaBox *mdia, GF_ESD **out_esd);\r
+/*inserts TTU header - only used when conversion to StreamingText is on*/\r
+GF_Err gf_isom_rewrite_text_sample(GF_ISOSample *samp, u32 sampleDescriptionIndex, u32 sample_dur);\r
+\r
+GF_UserDataMap *udta_getEntry(GF_UserDataBox *ptr, u32 box_type, bin128 *uuid);\r
+\r
+#ifndef GPAC_READ_ONLY\r
+\r
+GF_Err FlushCaptureMode(GF_ISOFile *movie);\r
+GF_Err CanAccessMovie(GF_ISOFile *movie, u32 Mode);\r
+GF_ISOFile *gf_isom_create_movie(const char *fileName, u32 OpenMode, const char *tmp_dir);\r
+void gf_isom_insert_moov(GF_ISOFile *file);\r
+\r
+GF_Err WriteToFile(GF_ISOFile *movie);\r
+GF_Err Track_SetStreamDescriptor(GF_TrackBox *trak, u32 StreamDescriptionIndex, u32 DataReferenceIndex, GF_ESD *esd, u32 *outStreamIndex);\r
+u8 RequestTrack(GF_MovieBox *moov, u32 TrackID);\r
+/*Track-Media setup*/\r
+GF_Err NewMedia(GF_MediaBox **mdia, u32 MediaType, u32 TimeScale);\r
+GF_Err Media_ParseODFrame(GF_MediaBox *mdia, GF_ISOSample *sample, GF_ISOSample **od_samp);\r
+GF_Err Media_AddSample(GF_MediaBox *mdia, u64 data_offset, GF_ISOSample *sample, u32 StreamDescIndex, u32 syncShadowNumber);\r
+GF_Err Media_CreateDataRef(GF_DataReferenceBox *dref, char *URLname, char *URNname, u32 *dataRefIndex);\r
+/*update a media sample. ONLY in edit mode*/\r
+GF_Err Media_UpdateSample(GF_MediaBox *mdia, u32 sampleNumber, GF_ISOSample *sample, Bool data_only);\r
+GF_Err Media_UpdateSampleReference(GF_MediaBox *mdia, u32 sampleNumber, GF_ISOSample *sample, u64 data_offset);\r
+/*addition in the sample tables*/\r
+GF_Err stbl_AddDTS(GF_SampleTableBox *stbl, u64 DTS, u32 *sampleNumber, u32 LastAUDefDuration);\r
+GF_Err stbl_AddCTS(GF_SampleTableBox *stbl, u32 sampleNumber, u32 CTSoffset);\r
+GF_Err stbl_AddSize(GF_SampleSizeBox *stsz, u32 sampleNumber, u32 size);\r
+GF_Err stbl_AddRAP(GF_SyncSampleBox *stss, u32 sampleNumber);\r
+GF_Err stbl_AddShadow(GF_ShadowSyncBox *stsh, u32 sampleNumber, u32 shadowNumber);\r
+GF_Err stbl_AddChunkOffset(GF_MediaBox *mdia, u32 sampleNumber, u32 StreamDescIndex, u64 offset);\r
+/*NB - no add for padding, this is done only through SetPaddingBits*/\r
+\r
+GF_Err stbl_AddSampleFragment(GF_SampleTableBox *stbl, u32 sampleNumber, u16 size);\r
+\r
+/*update of the sample table\r
+all these functions are called in edit and we always have 1 sample per chunk*/\r
+GF_Err stbl_SetChunkOffset(GF_MediaBox *mdia, u32 sampleNumber, u64 offset);\r
+GF_Err stbl_SetSampleCTS(GF_SampleTableBox *stbl, u32 sampleNumber, u32 offset);\r
+GF_Err stbl_SetSampleSize(GF_SampleSizeBox *stsz, u32 SampleNumber, u32 size);\r
+GF_Err stbl_SetSampleRAP(GF_SyncSampleBox *stss, u32 SampleNumber, u8 isRAP);\r
+GF_Err stbl_SetSyncShadow(GF_ShadowSyncBox *stsh, u32 sampleNumber, u32 syncSample);\r
+GF_Err stbl_SetPaddingBits(GF_SampleTableBox *stbl, u32 SampleNumber, u8 bits);\r
+/*for adding fragmented samples*/\r
+GF_Err stbl_SampleSizeAppend(GF_SampleSizeBox *stsz, u32 data_size);\r
+/*writing of the final chunk info in edit mode*/\r
+GF_Err stbl_SetChunkAndOffset(GF_SampleTableBox *stbl, u32 sampleNumber, u32 StreamDescIndex, GF_SampleToChunkBox *the_stsc, GF_Box **the_stco, u64 data_offset, u8 forceNewChunk);\r
+/*EDIT LIST functions*/\r
+GF_EdtsEntry *CreateEditEntry(u64 EditDuration, u64 MediaTime, u8 EditMode);\r
+\r
+GF_Err stbl_SetRedundant(GF_SampleTableBox *stbl, u32 sampleNumber);\r
+GF_Err stbl_AddRedundant(GF_SampleTableBox *stbl, u32 sampleNumber);\r
+\r
+/*REMOVE functions*/\r
+GF_Err stbl_RemoveDTS(GF_SampleTableBox *stbl, u32 sampleNumber, u32 LastAUDefDuration);\r
+GF_Err stbl_RemoveCTS(GF_SampleTableBox *stbl, u32 sampleNumber);\r
+GF_Err stbl_RemoveSize(GF_SampleSizeBox *stsz, u32 sampleNumber);\r
+GF_Err stbl_RemoveChunk(GF_SampleTableBox *stbl, u32 sampleNumber);\r
+GF_Err stbl_RemoveRAP(GF_SampleTableBox *stbl, u32 sampleNumber);\r
+GF_Err stbl_RemoveShadow(GF_ShadowSyncBox *stsh, u32 sampleNumber);\r
+GF_Err stbl_RemovePaddingBits(GF_SampleTableBox *stbl, u32 SampleNumber);\r
+GF_Err stbl_RemoveSampleFragments(GF_SampleTableBox *stbl, u32 sampleNumber);\r
+GF_Err stbl_RemoveRedundant(GF_SampleTableBox *stbl, u32 SampleNumber);\r
+\r
+#ifndef        GPAC_ISOM_NO_FRAGMENTS\r
+GF_Err StoreFragment(GF_ISOFile *movie);\r
+#endif\r
+\r
+#endif \r
+\r
+\r
+GF_Err GetNextMediaTime(GF_TrackBox *trak, u64 movieTime, u64 *OutMovieTime);\r
+GF_Err GetPrevMediaTime(GF_TrackBox *trak, u64 movieTime, u64 *OutMovieTime);\r
+\r
+Bool IsHintTrack(GF_TrackBox *trak);\r
+Bool CheckHintFormat(GF_TrackBox *trak, u32 HintType);\r
+u32 GetHintFormat(GF_TrackBox *trak);\r
+\r
+\r
+/*locate a box by its type or UUID*/\r
+GF_ItemListBox *gf_ismo_locate_box(GF_List *list, u32 boxType, bin128 UUID);\r
+\r
+GF_Err moov_AddBox(GF_Box *ptr, GF_Box *a);\r
+GF_Err tref_AddBox(GF_Box *ptr, GF_Box *a);\r
+GF_Err trak_AddBox(GF_Box *ptr, GF_Box *a);\r
+GF_Err mvex_AddBox(GF_Box *ptr, GF_Box *a);\r
+GF_Err stsd_AddBox(GF_SampleDescriptionBox *ptr, GF_Box *a);\r
+GF_Err hnti_AddBox(GF_HintTrackInfoBox *hnti, GF_Box *a);\r
+GF_Err udta_AddBox(GF_UserDataBox *ptr, GF_Box *a);\r
+GF_Err edts_AddBox(GF_Box *s, GF_Box *a);\r
+GF_Err stdp_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err sdtp_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err dinf_AddBox(GF_Box *s, GF_Box *a);\r
+GF_Err minf_AddBox(GF_Box *s, GF_Box *a);\r
+GF_Err mdia_AddBox(GF_Box *s, GF_Box *a);\r
+GF_Err stbl_AddBox(GF_SampleTableBox *ptr, GF_Box *a);\r
+\r
+GF_Err AVC_UpdateESD(GF_MPEGVisualSampleEntryBox *avc, GF_ESD *esd);\r
+void AVC_RewriteESDescriptor(GF_MPEGVisualSampleEntryBox *avc);\r
+GF_Err reftype_AddRefTrack(GF_TrackReferenceTypeBox *ref, u32 trackID, u16 *outRefIndex);\r
+\r
+\r
+/*\r
+               Hinting stuff\r
+*/\r
+\r
+/*the HintType for each protocol*/\r
+enum\r
+{\r
+       GF_ISMO_HINT_RTP        = 1,\r
+       /*not supported yet*/\r
+       GF_ISMO_MPEG2_TS        = 2\r
+};\r
+\r
+/*****************************************************\r
+               RTP Data Entries\r
+*****************************************************/\r
+\r
+#define GF_ISMO_BASE_DTE_ENTRY \\r
+       u8 source;\r
+\r
+typedef struct\r
+{\r
+       GF_ISMO_BASE_DTE_ENTRY\r
+} GF_GenericDTE;\r
+\r
+typedef struct\r
+{\r
+       GF_ISMO_BASE_DTE_ENTRY\r
+} GF_EmptyDTE;\r
+\r
+typedef struct\r
+{\r
+       GF_ISMO_BASE_DTE_ENTRY\r
+       u8 dataLength;\r
+       char data[14];\r
+} GF_ImmediateDTE;\r
+\r
+typedef struct\r
+{\r
+       GF_ISMO_BASE_DTE_ENTRY\r
+       s8 trackRefIndex;\r
+       u32 sampleNumber;\r
+       u16 dataLength;\r
+       u32 byteOffset;\r
+       u16 bytesPerComp;\r
+       u16 samplesPerComp;\r
+} GF_SampleDTE;\r
+\r
+typedef struct\r
+{\r
+       GF_ISMO_BASE_DTE_ENTRY\r
+       s8 trackRefIndex;\r
+       u32 streamDescIndex;\r
+       u16 dataLength;\r
+       u32 byteOffset;\r
+       u32 reserved;\r
+} GF_StreamDescDTE;\r
+\r
+GF_GenericDTE *NewDTE(u8 type);\r
+void DelDTE(GF_GenericDTE *dte);\r
+GF_Err ReadDTE(GF_GenericDTE *dte, GF_BitStream *bs);\r
+GF_Err WriteDTE(GF_GenericDTE *dte, GF_BitStream *bs);\r
+GF_Err OffsetDTE(GF_GenericDTE *dte, u32 offset, u32 HintSampleNumber);\r
+\r
+/*****************************************************\r
+               RTP Sample\r
+*****************************************************/\r
+\r
+/*data cache when reading*/\r
+typedef struct __tag_hint_data_cache\r
+{\r
+       GF_ISOSample *samp;\r
+       GF_TrackBox *trak;\r
+       u32 sample_num;\r
+} GF_HintDataCache;\r
+\r
+\r
+typedef struct __tag_hint_sample\r
+{\r
+       /*used internally for future protocol support (write only)*/\r
+       u8 HintType;\r
+       /*QT packets*/\r
+       u16 reserved;\r
+       GF_List *packetTable;\r
+       char *AdditionalData;\r
+       u32 dataLength;\r
+       /*used internally for hinting*/\r
+       u64 TransmissionTime;\r
+       /*for read only, used to store samples fetched while building packets*/\r
+       GF_List *sample_cache;\r
+} GF_HintSample;\r
+\r
+GF_HintSample *gf_isom_hint_sample_new(u32 ProtocolType);\r
+void gf_isom_hint_sample_del(GF_HintSample *ptr);\r
+GF_Err gf_isom_hint_sample_read(GF_HintSample *ptr, GF_BitStream *bs, u32 sampleSize);\r
+GF_Err gf_isom_hint_sample_write(GF_HintSample *ptr, GF_BitStream *bs);\r
+u32 gf_isom_hint_sample_size(GF_HintSample *ptr);\r
+\r
+/*****************************************************\r
+               Hint Packets (generic packet for future protocol support)\r
+*****************************************************/\r
+#define GF_ISOM_BASE_PACKET                    \\r
+       s32 relativeTransTime;\r
+\r
+\r
+typedef struct\r
+{\r
+       GF_ISOM_BASE_PACKET\r
+} GF_HintPacket;\r
+\r
+GF_HintPacket *gf_isom_hint_pck_new(u8 HintType);\r
+void gf_isom_hint_pck_del(u8 HintType, GF_HintPacket *ptr);\r
+GF_Err gf_isom_hint_pck_read(u8 HintType, GF_HintPacket *ptr, GF_BitStream *bs);\r
+GF_Err gf_isom_hint_pck_write(u8 HintType, GF_HintPacket *ptr, GF_BitStream *bs);\r
+u32 gf_isom_hint_pck_size(u8 HintType, GF_HintPacket *ptr);\r
+GF_Err gf_isom_hint_pck_offset(u8 HintType, GF_HintPacket *ptr, u32 offset, u32 HintSampleNumber);\r
+GF_Err gf_isom_hint_pck_add_dte(u8 HintType, GF_HintPacket *ptr, GF_GenericDTE *dte, u8 AtBegin);\r
+/*get the size of the packet AS RECONSTRUCTED BY THE SERVER (without CSRC)*/\r
+u32 gf_isom_hint_pck_length(u8 HintType, GF_HintPacket *ptr);\r
+\r
+/*the RTP packet*/\r
+typedef struct\r
+{\r
+       GF_ISOM_BASE_PACKET     \r
+       \r
+       /*RTP Header*/\r
+       u8 P_bit;\r
+       u8 X_bit;\r
+       u8 M_bit;\r
+       /*on 7 bits */\r
+       u8 payloadType;\r
+       u16 SequenceNumber;\r
+       /*Hinting flags*/\r
+       u8 B_bit;\r
+       u8 R_bit;\r
+       /*ExtraInfos TLVs - not really used */\r
+       GF_List *TLV;\r
+       /*DataTable - contains the DTEs...*/\r
+       GF_List *DataTable;\r
+} GF_RTPPacket;\r
+\r
+GF_RTPPacket *gf_isom_hint_rtp_new();\r
+void gf_isom_hint_rtp_del(GF_RTPPacket *ptr);\r
+GF_Err gf_isom_hint_rtp_read(GF_RTPPacket *ptr, GF_BitStream *bs);\r
+GF_Err gf_isom_hint_rtp_write(GF_RTPPacket *ptr, GF_BitStream *bs);\r
+u32 gf_isom_hint_rtp_size(GF_RTPPacket *ptr);\r
+GF_Err gf_isom_hint_rtp_offset(GF_RTPPacket *ptr, u32 offset, u32 HintSampleNumber);\r
+u32 gf_isom_hint_rtp_length(GF_RTPPacket *ptr);\r
+\r
+\r
+\r
+struct _3gpp_text_sample \r
+{\r
+       char *text;\r
+       u32 len;\r
+       \r
+       GF_TextStyleBox *styles;\r
+       /*at most one of these*/\r
+       GF_TextHighlightColorBox *highlight_color;\r
+       GF_TextScrollDelayBox *scroll_delay;\r
+       GF_TextBoxBox *box;\r
+       GF_TextWrapBox *wrap;\r
+\r
+       GF_List *others;\r
+       GF_TextKaraokeBox *cur_karaoke;\r
+};\r
+\r
+GF_TextSample *gf_isom_parse_texte_sample(GF_BitStream *bs);\r
+GF_TextSample *gf_isom_parse_texte_sample_from_data(char *data, u32 dataLength);\r
+\r
+\r
+\r
+/*\r
+       these are exported just in case, there should never be needed outside the lib\r
+*/\r
+\r
+GF_Box *reftype_New();\r
+GF_Box *free_New();\r
+GF_Box *mdat_New();\r
+GF_Box *moov_New();\r
+GF_Box *mvhd_New();\r
+GF_Box *mdhd_New();\r
+GF_Box *vmhd_New();\r
+GF_Box *smhd_New();\r
+GF_Box *hmhd_New();\r
+GF_Box *nmhd_New();\r
+GF_Box *stbl_New();\r
+GF_Box *dinf_New();\r
+GF_Box *url_New();\r
+GF_Box *urn_New();\r
+GF_Box *cprt_New();\r
+GF_Box *chpl_New();\r
+GF_Box *hdlr_New();\r
+GF_Box *iods_New();\r
+GF_Box *trak_New();\r
+GF_Box *mp4s_New();\r
+GF_Box *mp4v_New();\r
+GF_Box *mp4a_New();\r
+GF_Box *edts_New();\r
+GF_Box *udta_New();\r
+GF_Box *dref_New();\r
+GF_Box *stsd_New();\r
+GF_Box *stts_New();\r
+GF_Box *ctts_New();\r
+GF_Box *stsh_New();\r
+GF_Box *elst_New();\r
+GF_Box *stsc_New();\r
+GF_Box *stsz_New();\r
+GF_Box *stco_New();\r
+GF_Box *stss_New();\r
+GF_Box *stdp_New();\r
+GF_Box *sdtp_New();\r
+GF_Box *co64_New();\r
+GF_Box *esds_New();\r
+GF_Box *minf_New();\r
+GF_Box *tkhd_New();\r
+GF_Box *tref_New();\r
+GF_Box *mdia_New();\r
+GF_Box *defa_New();\r
+GF_Box *uuid_New();\r
+GF_Box *void_New();\r
+GF_Box *stsf_New();\r
+GF_Box *gnrm_New();\r
+GF_Box *gnrv_New();\r
+GF_Box *gnra_New();\r
+GF_Box *pdin_New();\r
+\r
+void reftype_del(GF_Box *);\r
+void free_del(GF_Box *);\r
+void mdat_del(GF_Box *);\r
+void moov_del(GF_Box *);\r
+void mvhd_del(GF_Box *);\r
+void mdhd_del(GF_Box *);\r
+void vmhd_del(GF_Box *);\r
+void smhd_del(GF_Box *);\r
+void hmhd_del(GF_Box *);\r
+void nmhd_del(GF_Box *);\r
+void stbl_del(GF_Box *);\r
+void dinf_del(GF_Box *);\r
+void url_del(GF_Box *);\r
+void urn_del(GF_Box *);\r
+void chpl_del(GF_Box *);\r
+void cprt_del(GF_Box *);\r
+void hdlr_del(GF_Box *);\r
+void iods_del(GF_Box *);\r
+void trak_del(GF_Box *);\r
+void mp4s_del(GF_Box *);\r
+void mp4v_del(GF_Box *);\r
+void mp4a_del(GF_Box *);\r
+void edts_del(GF_Box *);\r
+void udta_del(GF_Box *);\r
+void dref_del(GF_Box *);\r
+void stsd_del(GF_Box *);\r
+void stts_del(GF_Box *);\r
+void ctts_del(GF_Box *);\r
+void stsh_del(GF_Box *);\r
+void elst_del(GF_Box *);\r
+void stsc_del(GF_Box *);\r
+void stsz_del(GF_Box *);\r
+void stco_del(GF_Box *);\r
+void stss_del(GF_Box *);\r
+void stdp_del(GF_Box *);\r
+void sdtp_del(GF_Box *);\r
+void co64_del(GF_Box *);\r
+void esds_del(GF_Box *);\r
+void minf_del(GF_Box *);\r
+void tkhd_del(GF_Box *);\r
+void tref_del(GF_Box *);\r
+void mdia_del(GF_Box *);\r
+void defa_del(GF_Box *);\r
+void uuid_del(GF_Box *);\r
+void void_del(GF_Box *);\r
+void stsf_del(GF_Box *);\r
+void gnrm_del(GF_Box *);\r
+void gnrv_del(GF_Box *);\r
+void gnra_del(GF_Box *);\r
+void pdin_del(GF_Box *);\r
+\r
+GF_Err reftype_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err free_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err mdat_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err moov_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err mvhd_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err mdhd_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err vmhd_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err smhd_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err hmhd_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err nmhd_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err stbl_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err dinf_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err url_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err urn_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err chpl_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err cprt_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err hdlr_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err iods_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err trak_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err mp4s_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err mp4v_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err mp4a_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err edts_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err udta_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err dref_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err stsd_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err stts_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err ctts_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err stsh_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err elst_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err stsc_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err stsz_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err stco_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err stss_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err stdp_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err sdtp_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err co64_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err esds_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err minf_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err tkhd_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err tref_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err mdia_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err defa_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err uuid_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err void_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err stsf_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err gnrm_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err gnrv_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err gnra_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err pdin_Write(GF_Box *s, GF_BitStream *bs);\r
+\r
+GF_Err reftype_Size(GF_Box *);\r
+GF_Err free_Size(GF_Box *);\r
+GF_Err mdat_Size(GF_Box *);\r
+GF_Err moov_Size(GF_Box *);\r
+GF_Err mvhd_Size(GF_Box *);\r
+GF_Err mdhd_Size(GF_Box *);\r
+GF_Err vmhd_Size(GF_Box *);\r
+GF_Err smhd_Size(GF_Box *);\r
+GF_Err hmhd_Size(GF_Box *);\r
+GF_Err nmhd_Size(GF_Box *);\r
+GF_Err stbl_Size(GF_Box *);\r
+GF_Err dinf_Size(GF_Box *);\r
+GF_Err url_Size(GF_Box *);\r
+GF_Err urn_Size(GF_Box *);\r
+GF_Err chpl_Size(GF_Box *);\r
+GF_Err cprt_Size(GF_Box *);\r
+GF_Err hdlr_Size(GF_Box *);\r
+GF_Err iods_Size(GF_Box *);\r
+GF_Err trak_Size(GF_Box *);\r
+GF_Err mp4s_Size(GF_Box *);\r
+GF_Err mp4v_Size(GF_Box *);\r
+GF_Err mp4a_Size(GF_Box *);\r
+GF_Err edts_Size(GF_Box *);\r
+GF_Err udta_Size(GF_Box *);\r
+GF_Err dref_Size(GF_Box *);\r
+GF_Err stsd_Size(GF_Box *);\r
+GF_Err stts_Size(GF_Box *);\r
+GF_Err ctts_Size(GF_Box *);\r
+GF_Err stsh_Size(GF_Box *);\r
+GF_Err elst_Size(GF_Box *);\r
+GF_Err stsc_Size(GF_Box *);\r
+GF_Err stsz_Size(GF_Box *);\r
+GF_Err stco_Size(GF_Box *);\r
+GF_Err stss_Size(GF_Box *);\r
+GF_Err stdp_Size(GF_Box *);\r
+GF_Err sdtp_Size(GF_Box *);\r
+GF_Err co64_Size(GF_Box *);\r
+GF_Err esds_Size(GF_Box *);\r
+GF_Err minf_Size(GF_Box *);\r
+GF_Err tkhd_Size(GF_Box *);\r
+GF_Err tref_Size(GF_Box *);\r
+GF_Err mdia_Size(GF_Box *);\r
+GF_Err defa_Size(GF_Box *);\r
+GF_Err uuid_Size(GF_Box *);\r
+GF_Err void_Size(GF_Box *);\r
+GF_Err stsf_Size(GF_Box *);\r
+GF_Err gnrm_Size(GF_Box *);\r
+GF_Err gnrv_Size(GF_Box *);\r
+GF_Err gnra_Size(GF_Box *);\r
+GF_Err pdin_Size(GF_Box *);\r
+\r
+GF_Err reftype_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err free_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err mdat_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err moov_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err mvhd_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err mdhd_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err vmhd_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err smhd_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err hmhd_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err nmhd_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err stbl_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err dinf_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err url_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err urn_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err chpl_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err cprt_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err hdlr_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err iods_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err trak_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err mp4s_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err mp4v_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err mp4a_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err edts_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err udta_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err dref_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err stsd_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err stts_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err ctts_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err stsh_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err elst_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err stsc_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err stsz_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err stco_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err stss_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err stdp_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err sdtp_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err co64_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err esds_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err minf_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err tkhd_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err tref_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err mdia_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err defa_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err uuid_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err void_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err stsf_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err pdin_Read(GF_Box *s, GF_BitStream *bs);\r
+\r
+\r
+GF_Box *hinf_New();\r
+GF_Box *trpy_New();\r
+GF_Box *totl_New();\r
+GF_Box *nump_New();\r
+GF_Box *npck_New();\r
+GF_Box *tpyl_New();\r
+GF_Box *tpay_New();\r
+GF_Box *maxr_New();\r
+GF_Box *dmed_New();\r
+GF_Box *dimm_New();\r
+GF_Box *drep_New();\r
+GF_Box *tmin_New();\r
+GF_Box *tmax_New();\r
+GF_Box *pmax_New();\r
+GF_Box *dmax_New();\r
+GF_Box *payt_New();\r
+GF_Box *name_New();\r
+GF_Box *rely_New();\r
+GF_Box *snro_New();\r
+GF_Box *tims_New();\r
+GF_Box *tsro_New();\r
+GF_Box *ghnt_New();\r
+GF_Box *hnti_New();\r
+GF_Box *sdp_New();\r
+GF_Box *rtpo_New();\r
+\r
+void hinf_del(GF_Box *s);\r
+void trpy_del(GF_Box *s);\r
+void totl_del(GF_Box *s);\r
+void nump_del(GF_Box *s);\r
+void npck_del(GF_Box *s);\r
+void tpyl_del(GF_Box *s);\r
+void tpay_del(GF_Box *s);\r
+void maxr_del(GF_Box *s);\r
+void dmed_del(GF_Box *s);\r
+void dimm_del(GF_Box *s);\r
+void drep_del(GF_Box *s);\r
+void tmin_del(GF_Box *s);\r
+void tmax_del(GF_Box *s);\r
+void pmax_del(GF_Box *s);\r
+void dmax_del(GF_Box *s);\r
+void payt_del(GF_Box *s);\r
+void name_del(GF_Box *s);\r
+void rely_del(GF_Box *s);\r
+void snro_del(GF_Box *s);\r
+void tims_del(GF_Box *s);\r
+void tsro_del(GF_Box *s);\r
+void ghnt_del(GF_Box *s);\r
+void hnti_del(GF_Box *a);\r
+void sdp_del(GF_Box *a);\r
+void rtpo_del(GF_Box *s);\r
+\r
+GF_Err hinf_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err trpy_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err totl_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err nump_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err npck_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err tpyl_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err tpay_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err maxr_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err dmed_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err dimm_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err drep_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err tmin_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err tmax_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err pmax_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err dmax_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err payt_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err name_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err rely_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err snro_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err tims_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err tsro_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err ghnt_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err hnti_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err sdp_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err rtpo_Read(GF_Box *s, GF_BitStream *bs);\r
+\r
+GF_Err hinf_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err trpy_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err totl_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err nump_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err npck_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err tpyl_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err tpay_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err maxr_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err dmed_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err dimm_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err drep_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err tmin_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err tmax_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err pmax_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err dmax_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err payt_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err name_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err rely_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err snro_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err tims_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err tsro_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err ghnt_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err hnti_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err sdp_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err rtpo_Write(GF_Box *s, GF_BitStream *bs);\r
+\r
+GF_Err hinf_Size(GF_Box *s);\r
+GF_Err trpy_Size(GF_Box *s);\r
+GF_Err totl_Size(GF_Box *s);\r
+GF_Err nump_Size(GF_Box *s);\r
+GF_Err npck_Size(GF_Box *s);\r
+GF_Err tpyl_Size(GF_Box *s);\r
+GF_Err tpay_Size(GF_Box *s);\r
+GF_Err maxr_Size(GF_Box *s);\r
+GF_Err dmed_Size(GF_Box *s);\r
+GF_Err dimm_Size(GF_Box *s);\r
+GF_Err drep_Size(GF_Box *s);\r
+GF_Err tmin_Size(GF_Box *s);\r
+GF_Err tmax_Size(GF_Box *s);\r
+GF_Err pmax_Size(GF_Box *s);\r
+GF_Err dmax_Size(GF_Box *s);\r
+GF_Err payt_Size(GF_Box *s);\r
+GF_Err name_Size(GF_Box *s);\r
+GF_Err rely_Size(GF_Box *s);\r
+GF_Err snro_Size(GF_Box *s);\r
+GF_Err tims_Size(GF_Box *s);\r
+GF_Err tsro_Size(GF_Box *s);\r
+GF_Err ghnt_Size(GF_Box *s);\r
+GF_Err hnti_Size(GF_Box *s);\r
+GF_Err sdp_Size(GF_Box *s);\r
+GF_Err rtpo_Size(GF_Box *s);\r
+\r
+\r
+GF_Box *ftyp_New();\r
+void ftyp_del(GF_Box *s);\r
+GF_Err ftyp_Read(GF_Box *s,GF_BitStream *bs);\r
+GF_Err ftyp_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err ftyp_Size(GF_Box *s);\r
+\r
+GF_Box *padb_New();\r
+void padb_del(GF_Box *s);\r
+GF_Err padb_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err padb_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err padb_Size(GF_Box *s);\r
+\r
+GF_Box *gppa_New(u32 type);\r
+GF_Box *gppv_New(u32 type);\r
+GF_Box *gppc_New(u32 type);\r
+void gppa_del(GF_Box *s);\r
+void gppv_del(GF_Box *s);\r
+void gppc_del(GF_Box *s);\r
+GF_Err gppa_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err gppv_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err gppc_Read(GF_Box *s, GF_BitStream *bs);\r
+#ifndef GPAC_READ_ONLY\r
+GF_Err gppa_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err gppv_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err gppc_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err gppa_Size(GF_Box *s);\r
+GF_Err gppv_Size(GF_Box *s);\r
+GF_Err gppc_Size(GF_Box *s);\r
+#endif\r
+\r
+\r
+#ifndef        GPAC_ISOM_NO_FRAGMENTS\r
+GF_Box *mvex_New();\r
+GF_Box *trex_New();\r
+GF_Box *moof_New();\r
+GF_Box *mfhd_New();\r
+GF_Box *traf_New();\r
+GF_Box *tfhd_New();\r
+GF_Box *trun_New();\r
+\r
+void mvex_del(GF_Box *s);\r
+void trex_del(GF_Box *s);\r
+void moof_del(GF_Box *s);\r
+void mfhd_del(GF_Box *s);\r
+void traf_del(GF_Box *s);\r
+void tfhd_del(GF_Box *s);\r
+void trun_del(GF_Box *s);\r
+\r
+GF_Err mvex_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err trex_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err moof_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err mfhd_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err traf_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err tfhd_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err trun_Read(GF_Box *s, GF_BitStream *bs);\r
+\r
+GF_Err mvex_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err trex_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err moof_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err mfhd_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err traf_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err tfhd_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err trun_Write(GF_Box *s, GF_BitStream *bs);\r
+\r
+GF_Err mvex_Size(GF_Box *s);\r
+GF_Err trex_Size(GF_Box *s);\r
+GF_Err moof_Size(GF_Box *s);\r
+GF_Err mfhd_Size(GF_Box *s);\r
+GF_Err traf_Size(GF_Box *s);\r
+GF_Err tfhd_Size(GF_Box *s);\r
+GF_Err trun_Size(GF_Box *s);\r
+\r
+\r
+GF_Box *mehd_New();\r
+void mehd_del(GF_Box *s);\r
+GF_Err mehd_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err mehd_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err mehd_Size(GF_Box *s);\r
+\r
+#endif \r
+\r
+/*avc ext*/\r
+GF_Box *avcc_New();\r
+void avcc_del(GF_Box *s);\r
+GF_Err avcc_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err avcc_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err avcc_Size(GF_Box *s);\r
+\r
+GF_Box *avc1_New();\r
+\r
+GF_Box *m4ds_New();\r
+void m4ds_del(GF_Box *s);\r
+GF_Err m4ds_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err m4ds_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err m4ds_Size(GF_Box *s);\r
+\r
+GF_Box *btrt_New();\r
+void btrt_del(GF_Box *s);\r
+GF_Err btrt_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err btrt_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err btrt_Size(GF_Box *s);\r
+\r
+\r
+/*3GPP streaming text*/\r
+GF_Box *ftab_New();\r
+GF_Box *tx3g_New();\r
+GF_Box *styl_New();\r
+GF_Box *hlit_New();\r
+GF_Box *hclr_New();\r
+GF_Box *krok_New();\r
+GF_Box *dlay_New();\r
+GF_Box *href_New();\r
+GF_Box *tbox_New();\r
+GF_Box *blnk_New();\r
+GF_Box *twrp_New();\r
+\r
+void ftab_del(GF_Box *s);\r
+void tx3g_del(GF_Box *s);\r
+void styl_del(GF_Box *s);\r
+void hlit_del(GF_Box *s);\r
+void hclr_del(GF_Box *s);\r
+void krok_del(GF_Box *s);\r
+void dlay_del(GF_Box *s);\r
+void href_del(GF_Box *s);\r
+void tbox_del(GF_Box *s);\r
+void blnk_del(GF_Box *s);\r
+void twrp_del(GF_Box *s);\r
+\r
+GF_Err ftab_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err tx3g_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err styl_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err hlit_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err hclr_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err krok_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err dlay_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err href_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err tbox_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err blnk_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err twrp_Read(GF_Box *s, GF_BitStream *bs);\r
+\r
+#ifndef GPAC_READ_ONLY\r
+GF_Err ftab_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err tx3g_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err styl_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err hlit_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err hclr_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err krok_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err dlay_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err href_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err tbox_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err blnk_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err twrp_Write(GF_Box *s, GF_BitStream *bs);\r
+\r
+GF_Err ftab_Size(GF_Box *s);\r
+GF_Err tx3g_Size(GF_Box *s);\r
+GF_Err styl_Size(GF_Box *s);\r
+GF_Err hlit_Size(GF_Box *s);\r
+GF_Err hclr_Size(GF_Box *s);\r
+GF_Err krok_Size(GF_Box *s);\r
+GF_Err dlay_Size(GF_Box *s);\r
+GF_Err href_Size(GF_Box *s);\r
+GF_Err tbox_Size(GF_Box *s);\r
+GF_Err blnk_Size(GF_Box *s);\r
+GF_Err twrp_Size(GF_Box *s);\r
+#endif\r
+\r
+\r
+/* MPEG-21 functions */\r
+GF_Box *meta_New();\r
+GF_Box *xml_New();\r
+GF_Box *bxml_New();\r
+GF_Box *iloc_New();\r
+GF_Box *pitm_New();\r
+GF_Box *ipro_New();\r
+GF_Box *infe_New();\r
+GF_Box *iinf_New();\r
+GF_Box *sinf_New();\r
+GF_Box *frma_New();\r
+GF_Box *schm_New();\r
+GF_Box *schi_New();\r
+GF_Box *enca_New();\r
+GF_Box *encv_New();\r
+GF_Box *encs_New();\r
+\r
+void meta_del(GF_Box *s);\r
+void xml_del(GF_Box *s);\r
+void bxml_del(GF_Box *s);\r
+void iloc_del(GF_Box *s);\r
+void pitm_del(GF_Box *s);\r
+void ipro_del(GF_Box *s);\r
+void infe_del(GF_Box *s);\r
+void iinf_del(GF_Box *s);\r
+void sinf_del(GF_Box *s);\r
+void frma_del(GF_Box *s);\r
+void schm_del(GF_Box *s);\r
+void schi_del(GF_Box *s);\r
+\r
+GF_Err meta_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err xml_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err bxml_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err iloc_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err pitm_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err ipro_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err infe_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err iinf_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err sinf_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err frma_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err schm_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err schi_Read(GF_Box *s, GF_BitStream *bs);\r
+\r
+#ifndef GPAC_READ_ONLY\r
+GF_Err meta_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err xml_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err bxml_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err iloc_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err pitm_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err ipro_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err infe_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err iinf_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err sinf_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err frma_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err schm_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err schi_Write(GF_Box *s, GF_BitStream *bs);\r
+\r
+GF_Err meta_Size(GF_Box *s);\r
+GF_Err xml_Size(GF_Box *s);\r
+GF_Err bxml_Size(GF_Box *s);\r
+GF_Err iloc_Size(GF_Box *s);\r
+GF_Err pitm_Size(GF_Box *s);\r
+GF_Err ipro_Size(GF_Box *s);\r
+GF_Err infe_Size(GF_Box *s);\r
+GF_Err iinf_Size(GF_Box *s);\r
+GF_Err sinf_Size(GF_Box *s);\r
+GF_Err frma_Size(GF_Box *s);\r
+GF_Err schm_Size(GF_Box *s);\r
+GF_Err schi_Size(GF_Box *s);\r
+#endif\r
+\r
+/* end of MPEG-21 functions */\r
+\r
+\r
+/** ISMACryp functions **/\r
+GF_Box *iKMS_New();\r
+GF_Box *iSFM_New();\r
+void iKMS_del(GF_Box *s);\r
+void iSFM_del(GF_Box *s);\r
+GF_Err iKMS_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err iSFM_Read(GF_Box *s, GF_BitStream *bs);\r
+#ifndef GPAC_READ_ONLY\r
+GF_Err iKMS_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err iSFM_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err iKMS_Size(GF_Box *s);\r
+GF_Err iSFM_Size(GF_Box *s);\r
+#endif\r
+\r
+/* Apple extensions */\r
+void ilst_del(GF_Box *s);\r
+void ListItem_del(GF_Box *s);\r
+void data_del(GF_Box *s);\r
+GF_Err ilst_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err ListItem_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err data_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Box *ilst_New();\r
+GF_Box *ListItem_New(u32 type);\r
+GF_Box *data_New();\r
+#ifndef GPAC_READ_ONLY\r
+GF_Err ilst_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err ListItem_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err data_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err ilst_Size(GF_Box *s);\r
+GF_Err ListItem_Size(GF_Box *s);\r
+GF_Err data_Size(GF_Box *s);\r
+#endif\r
+\r
+\r
+GF_Err gb_box_array_dump(GF_List *list, FILE * trace);\r
+GF_Err reftype_dump(GF_Box *a, FILE * trace);\r
+GF_Err free_dump(GF_Box *a, FILE * trace);\r
+GF_Err mdat_dump(GF_Box *a, FILE * trace);\r
+GF_Err moov_dump(GF_Box *a, FILE * trace);\r
+GF_Err mvhd_dump(GF_Box *a, FILE * trace);\r
+GF_Err mdhd_dump(GF_Box *a, FILE * trace);\r
+GF_Err vmhd_dump(GF_Box *a, FILE * trace);\r
+GF_Err smhd_dump(GF_Box *a, FILE * trace);\r
+GF_Err hmhd_dump(GF_Box *a, FILE * trace);\r
+GF_Err nmhd_dump(GF_Box *a, FILE * trace);\r
+GF_Err stbl_dump(GF_Box *a, FILE * trace);\r
+GF_Err dinf_dump(GF_Box *a, FILE * trace);\r
+GF_Err url_dump(GF_Box *a, FILE * trace);\r
+GF_Err urn_dump(GF_Box *a, FILE * trace);\r
+GF_Err cprt_dump(GF_Box *a, FILE * trace);\r
+GF_Err hdlr_dump(GF_Box *a, FILE * trace);\r
+GF_Err iods_dump(GF_Box *a, FILE * trace);\r
+GF_Err trak_dump(GF_Box *a, FILE * trace);\r
+GF_Err mp4s_dump(GF_Box *a, FILE * trace);\r
+GF_Err mp4v_dump(GF_Box *a, FILE * trace);\r
+GF_Err mp4a_dump(GF_Box *a, FILE * trace);\r
+GF_Err edts_dump(GF_Box *a, FILE * trace);\r
+GF_Err udta_dump(GF_Box *a, FILE * trace);\r
+GF_Err dref_dump(GF_Box *a, FILE * trace);\r
+GF_Err stsd_dump(GF_Box *a, FILE * trace);\r
+GF_Err stts_dump(GF_Box *a, FILE * trace);\r
+GF_Err ctts_dump(GF_Box *a, FILE * trace);\r
+GF_Err stsh_dump(GF_Box *a, FILE * trace);\r
+GF_Err elst_dump(GF_Box *a, FILE * trace);\r
+GF_Err stsc_dump(GF_Box *a, FILE * trace);\r
+GF_Err stsz_dump(GF_Box *a, FILE * trace);\r
+GF_Err stco_dump(GF_Box *a, FILE * trace);\r
+GF_Err stss_dump(GF_Box *a, FILE * trace);\r
+GF_Err stdp_dump(GF_Box *a, FILE * trace);\r
+GF_Err sdtp_dump(GF_Box *a, FILE * trace);\r
+GF_Err co64_dump(GF_Box *a, FILE * trace);\r
+GF_Err esds_dump(GF_Box *a, FILE * trace);\r
+GF_Err minf_dump(GF_Box *a, FILE * trace);\r
+GF_Err tkhd_dump(GF_Box *a, FILE * trace);\r
+GF_Err tref_dump(GF_Box *a, FILE * trace);\r
+GF_Err mdia_dump(GF_Box *a, FILE * trace);\r
+GF_Err defa_dump(GF_Box *a, FILE * trace);\r
+GF_Err void_dump(GF_Box *a, FILE * trace);\r
+GF_Err ftyp_dump(GF_Box *a, FILE * trace);\r
+GF_Err padb_dump(GF_Box *a, FILE * trace);\r
+GF_Err stsf_dump(GF_Box *a, FILE * trace);\r
+GF_Err gnrm_dump(GF_Box *a, FILE * trace);\r
+GF_Err gnrv_dump(GF_Box *a, FILE * trace);\r
+GF_Err gnra_dump(GF_Box *a, FILE * trace);\r
+GF_Err gppa_dump(GF_Box *a, FILE * trace);\r
+GF_Err gppv_dump(GF_Box *a, FILE * trace);\r
+GF_Err gppc_dump(GF_Box *a, FILE * trace);\r
+GF_Err chpl_dump(GF_Box *a, FILE * trace);\r
+GF_Err dpin_dump(GF_Box *a, FILE * trace);\r
+\r
+GF_Err hinf_dump(GF_Box *a, FILE * trace);\r
+GF_Err trpy_dump(GF_Box *a, FILE * trace);\r
+GF_Err totl_dump(GF_Box *a, FILE * trace);\r
+GF_Err nump_dump(GF_Box *a, FILE * trace);\r
+GF_Err npck_dump(GF_Box *a, FILE * trace);\r
+GF_Err tpyl_dump(GF_Box *a, FILE * trace);\r
+GF_Err tpay_dump(GF_Box *a, FILE * trace);\r
+GF_Err maxr_dump(GF_Box *a, FILE * trace);\r
+GF_Err dmed_dump(GF_Box *a, FILE * trace);\r
+GF_Err dimm_dump(GF_Box *a, FILE * trace);\r
+GF_Err drep_dump(GF_Box *a, FILE * trace);\r
+GF_Err tmin_dump(GF_Box *a, FILE * trace);\r
+GF_Err tmax_dump(GF_Box *a, FILE * trace);\r
+GF_Err pmax_dump(GF_Box *a, FILE * trace);\r
+GF_Err dmax_dump(GF_Box *a, FILE * trace);\r
+GF_Err payt_dump(GF_Box *a, FILE * trace);\r
+GF_Err name_dump(GF_Box *a, FILE * trace);\r
+GF_Err rely_dump(GF_Box *a, FILE * trace);\r
+GF_Err snro_dump(GF_Box *a, FILE * trace);\r
+GF_Err tims_dump(GF_Box *a, FILE * trace);\r
+GF_Err tsro_dump(GF_Box *a, FILE * trace);\r
+GF_Err ghnt_dump(GF_Box *a, FILE * trace);\r
+GF_Err hnti_dump(GF_Box *a, FILE * trace);\r
+GF_Err sdp_dump(GF_Box *a, FILE * trace);\r
+GF_Err rtpo_dump(GF_Box *a, FILE * trace);\r
+\r
+\r
+\r
+#ifndef        GPAC_ISOM_NO_FRAGMENTS\r
+GF_Err mvex_dump(GF_Box *a, FILE * trace);\r
+GF_Err mehd_dump(GF_Box *a, FILE * trace);\r
+GF_Err trex_dump(GF_Box *a, FILE * trace);\r
+GF_Err moof_dump(GF_Box *a, FILE * trace);\r
+GF_Err mfhd_dump(GF_Box *a, FILE * trace);\r
+GF_Err traf_dump(GF_Box *a, FILE * trace);\r
+GF_Err tfhd_dump(GF_Box *a, FILE * trace);\r
+GF_Err trun_dump(GF_Box *a, FILE * trace);\r
+#endif\r
+\r
+GF_Err avcc_dump(GF_Box *a, FILE * trace);\r
+GF_Err avc1_dump(GF_Box *a, FILE * trace);\r
+GF_Err m4ds_dump(GF_Box *a, FILE * trace);\r
+GF_Err btrt_dump(GF_Box *a, FILE * trace);\r
+\r
+GF_Err ftab_dump(GF_Box *a, FILE * trace);\r
+GF_Err tx3g_dump(GF_Box *a, FILE * trace);\r
+GF_Err styl_dump(GF_Box *a, FILE * trace);\r
+GF_Err hlit_dump(GF_Box *a, FILE * trace);\r
+GF_Err hclr_dump(GF_Box *a, FILE * trace);\r
+GF_Err krok_dump(GF_Box *a, FILE * trace);\r
+GF_Err dlay_dump(GF_Box *a, FILE * trace);\r
+GF_Err href_dump(GF_Box *a, FILE * trace);\r
+GF_Err tbox_dump(GF_Box *a, FILE * trace);\r
+GF_Err blnk_dump(GF_Box *a, FILE * trace);\r
+GF_Err twrp_dump(GF_Box *a, FILE * trace);\r
+\r
+/* ISMACryp dump */\r
+GF_Err iKMS_dump(GF_Box *a, FILE * trace);\r
+GF_Err iSFM_dump(GF_Box *a, FILE * trace);\r
+\r
+/*MPEG-21 extensions dump*/\r
+GF_Err meta_dump(GF_Box *a, FILE * trace);\r
+GF_Err xml_dump(GF_Box *a, FILE * trace);\r
+GF_Err bxml_dump(GF_Box *a, FILE * trace);\r
+GF_Err iloc_dump(GF_Box *a, FILE * trace);\r
+GF_Err pitm_dump(GF_Box *a, FILE * trace);\r
+GF_Err ipro_dump(GF_Box *a, FILE * trace);\r
+GF_Err infe_dump(GF_Box *a, FILE * trace);\r
+GF_Err iinf_dump(GF_Box *a, FILE * trace);\r
+GF_Err sinf_dump(GF_Box *a, FILE * trace);\r
+GF_Err frma_dump(GF_Box *a, FILE * trace);\r
+GF_Err schm_dump(GF_Box *a, FILE * trace);\r
+GF_Err schi_dump(GF_Box *a, FILE * trace);\r
+\r
+/*Apple extensions*/\r
+GF_Err ilst_dump(GF_Box *a, FILE * trace);\r
+GF_Err ListItem_dump(GF_Box *a, FILE * trace);\r
+GF_Err data_dump(GF_Box *a, FILE * trace);\r
+\r
+/*Apple extensions*/\r
+GF_MetaBox *gf_isom_apple_get_meta_extensions(GF_ISOFile *mov);\r
+\r
+#ifndef GPAC_READ_ONLY\r
+GF_MetaBox *gf_isom_apple_create_meta_extensions(GF_ISOFile *mov);\r
+#endif //GPAC_READ_ONLY\r
+\r
+/*OMA extensions*/\r
+GF_Box *ohdr_New();\r
+void ohdr_del(GF_Box *s);\r
+GF_Err ohdr_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err ohdr_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err ohdr_Size(GF_Box *s);\r
+GF_Err ohdr_dump(GF_Box *a, FILE * trace);\r
+GF_Box *grpi_New();\r
+void grpi_del(GF_Box *s);\r
+GF_Err grpi_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err grpi_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err grpi_Size(GF_Box *s);\r
+GF_Err grpi_dump(GF_Box *a, FILE * trace);\r
+GF_Box *mdri_New();\r
+void mdri_del(GF_Box *s);\r
+GF_Err mdri_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err mdri_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err mdri_Size(GF_Box *s);\r
+GF_Err mdri_dump(GF_Box *a, FILE * trace);\r
+GF_Box *odtt_New();\r
+void odtt_del(GF_Box *s);\r
+GF_Err odtt_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err odtt_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err odtt_Size(GF_Box *s);\r
+GF_Err odtt_dump(GF_Box *a, FILE * trace);\r
+GF_Box *odrb_New();\r
+void odrb_del(GF_Box *s);\r
+GF_Err odrb_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err odrb_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err odrb_Size(GF_Box *s);\r
+GF_Err odrb_dump(GF_Box *a, FILE * trace);\r
+GF_Box *odkm_New();\r
+void odkm_del(GF_Box *s);\r
+GF_Err odkm_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err odkm_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err odkm_Size(GF_Box *s);\r
+GF_Err odkm_dump(GF_Box *a, FILE * trace);\r
+\r
+\r
+GF_Box *pasp_New();\r
+void pasp_del(GF_Box *s);\r
+GF_Err pasp_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err pasp_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err pasp_Size(GF_Box *s);\r
+GF_Err pasp_dump(GF_Box *a, FILE * trace);\r
+\r
+GF_Box *metx_New(u32 type);\r
+void metx_del(GF_Box *s);\r
+GF_Err metx_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err metx_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err metx_Size(GF_Box *s);\r
+GF_Err metx_dump(GF_Box *a, FILE * trace);\r
+\r
+\r
+\r
+GF_Box *tsel_New();\r
+void tsel_del(GF_Box *s);\r
+GF_Err tsel_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err tsel_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err tsel_Size(GF_Box *s);\r
+GF_Err tsel_dump(GF_Box *a, FILE * trace);\r
+\r
+\r
+GF_Box *dimC_New();\r
+void dimC_del(GF_Box *s);\r
+GF_Err dimC_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err dimC_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err dimC_Size(GF_Box *s);\r
+GF_Err dimC_dump(GF_Box *a, FILE * trace);\r
+\r
+GF_Box *dims_New();\r
+void dims_del(GF_Box *s);\r
+GF_Err dims_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err dims_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err dims_Size(GF_Box *s);\r
+GF_Err dims_dump(GF_Box *a, FILE * trace);\r
+\r
+GF_Box *diST_New();\r
+void diST_del(GF_Box *s);\r
+GF_Err diST_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err diST_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err diST_Size(GF_Box *s);\r
+GF_Err diST_dump(GF_Box *a, FILE * trace);\r
+\r
+\r
+GF_Box *ac3_New();\r
+void ac3_del(GF_Box *s);\r
+GF_Err ac3_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err ac3_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err ac3_Size(GF_Box *s);\r
+GF_Err ac3_dump(GF_Box *a, FILE * trace);\r
+\r
+GF_Box *dac3_New();\r
+void dac3_del(GF_Box *s);\r
+GF_Err dac3_Read(GF_Box *s, GF_BitStream *bs);\r
+GF_Err dac3_Write(GF_Box *s, GF_BitStream *bs);\r
+GF_Err dac3_Size(GF_Box *s);\r
+GF_Err dac3_dump(GF_Box *a, FILE * trace);\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif //_GF_ISOMEDIA_DEV_H_\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/internal/laser_dev.h b/tstools/DtsEdit/src/gpac/internal/laser_dev.h
new file mode 100644 (file)
index 0000000..e31180f
--- /dev/null
@@ -0,0 +1,337 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Authors: Jean le Feuvre\r
+ *                             Copyright (c) 2005-200X ENST\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / LASeR codec sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+\r
+#ifndef _GF_LASER_DEV_H_\r
+#define _GF_LASER_DEV_H_\r
+\r
+#include <gpac/laser.h>\r
+\r
+/*per_stream config support*/\r
+typedef struct \r
+{\r
+       GF_LASERConfig cfg;\r
+       u16 ESID;\r
+} LASeRStreamInfo;\r
+\r
+typedef struct\r
+{\r
+       /*colors can be encoded on up to 16 bits per comp*/\r
+       u16 r, g, b;\r
+} LSRCol;\r
+\r
+struct __tag_laser_codec\r
+{\r
+       GF_BitStream *bs;\r
+       GF_SceneGraph *sg;\r
+       GF_Err last_error;\r
+\r
+       /*all attached streams*/\r
+       GF_List *streamInfo;\r
+\r
+       LASeRStreamInfo *info;\r
+       Fixed res_factor/*2^-coord_res*/;\r
+       /*duplicated from config*/\r
+       u8 scale_bits;\r
+       u8 coord_bits;\r
+       u16 time_resolution;\r
+       u16 color_scale;\r
+\r
+       LSRCol *col_table;\r
+       u32 nb_cols;\r
+       /*computed dynamically*/\r
+       u32 colorIndexBits;\r
+       GF_List *font_table;\r
+       u32 fontIndexBits;\r
+\r
+       u32 privateData_id_index, privateTag_index;\r
+\r
+       /*decoder only*/\r
+       Double (*GetSceneTime)(void *cbk);\r
+       void *cbk;\r
+\r
+       /*sameElement coding*/\r
+       SVG_Element *prev_g;\r
+       SVG_Element *prev_line;\r
+       SVG_Element *prev_path;\r
+       SVG_Element *prev_polygon;\r
+       SVG_Element *prev_rect;\r
+       SVG_Element *prev_text;\r
+       SVG_Element *prev_use;\r
+       GF_Node *current_root;\r
+\r
+       /*0: normal playback, store script content\r
+         1: memory decoding of scene, decompress script into commands\r
+       */\r
+       Bool memory_dec;\r
+\r
+       GF_List *defered_hrefs;\r
+       GF_List *defered_anims;\r
+       GF_List *defered_listeners;\r
+\r
+       char *cache_dir, *service_name;\r
+       GF_List *unresolved_commands;\r
+};\r
+\r
+s32 gf_lsr_anim_type_from_attribute(u32 tag);\r
+s32 gf_lsr_anim_type_to_attribute(u32 tag);\r
+s32 gf_lsr_rare_type_from_attribute(u32 tag);\r
+s32 gf_lsr_rare_type_to_attribute(u32 tag);\r
+u32 gf_lsr_same_rare(SVGAllAttributes *elt_atts, SVGAllAttributes *base_atts);\r
+\r
+\r
+/*transform*/\r
+#define RARE_TRANSFORM                         47\r
+\r
+enum\r
+{\r
+       LSR_EVT_abort = 0,\r
+       LSR_EVT_accessKey = 1,\r
+       LSR_EVT_activate = 2,\r
+       LSR_EVT_activatedEvent = 3,\r
+       LSR_EVT_beginEvent = 4,\r
+       LSR_EVT_click = 5,\r
+       LSR_EVT_deactivatedEvent = 6,\r
+       LSR_EVT_endEvent = 7,\r
+       LSR_EVT_error = 8,\r
+       LSR_EVT_executionTime = 9,\r
+       LSR_EVT_focusin = 10,\r
+       LSR_EVT_focusout = 11,\r
+       LSR_EVT_keydown = 12,\r
+       LSR_EVT_keyup = 13,\r
+       LSR_EVT_load = 14,\r
+       LSR_EVT_longAccessKey = 15,\r
+       LSR_EVT_mousedown = 16,\r
+       LSR_EVT_mousemove = 17,\r
+       LSR_EVT_mouseout = 18,\r
+       LSR_EVT_mouseover = 19,\r
+       LSR_EVT_mouseup = 20,\r
+       LSR_EVT_pause = 21,\r
+       LSR_EVT_pausedEvent = 22,\r
+       LSR_EVT_play = 23,\r
+       LSR_EVT_repeatEvent = 24,\r
+       LSR_EVT_repeatKey = 25,\r
+       LSR_EVT_resize = 26,\r
+       LSR_EVT_resumedEvent = 27,\r
+       LSR_EVT_scroll = 28,\r
+       LSR_EVT_shortAccessKey = 29,\r
+       LSR_EVT_textinput = 30,\r
+       LSR_EVT_unload = 31,\r
+       LSR_EVT_zoom = 32\r
+};     \r
+\r
+u32 dom_to_lsr_key(u32 dom_k);\r
+\r
+\r
+#define LSR_UPDATE_TYPE_ROTATE                 76\r
+#define LSR_UPDATE_TYPE_SCALE                  79\r
+#define LSR_UPDATE_TYPE_SVG_HEIGHT             94\r
+#define LSR_UPDATE_TYPE_SVG_WIDTH              95\r
+#define LSR_UPDATE_TYPE_TEXT_CONTENT   107\r
+#define LSR_UPDATE_TYPE_TRANSFORM              108\r
+#define LSR_UPDATE_TYPE_TRANSLATION            110\r
+\r
+\r
+/*LASeR commands code*/\r
+enum\r
+{\r
+       LSR_UPDATE_ADD = 0,\r
+       LSR_UPDATE_CLEAN,\r
+       LSR_UPDATE_DELETE,\r
+       LSR_UPDATE_INSERT,\r
+       LSR_UPDATE_NEW_SCENE,\r
+       LSR_UPDATE_REFRESH_SCENE,\r
+       LSR_UPDATE_REPLACE,\r
+       LSR_UPDATE_RESTORE,\r
+       LSR_UPDATE_SAVE,\r
+       LSR_UPDATE_SEND_EVENT,\r
+       LSR_UPDATE_EXTEND,\r
+       LSR_UPDATE_TEXT_CONTENT\r
+};\r
+\r
+/*Code point Path code*/\r
+enum\r
+{\r
+       LSR_PATH_COM_C = 0,\r
+       LSR_PATH_COM_H,\r
+       LSR_PATH_COM_L,\r
+       LSR_PATH_COM_M, \r
+       LSR_PATH_COM_Q, \r
+       LSR_PATH_COM_S, \r
+       LSR_PATH_COM_T, \r
+       LSR_PATH_COM_V, \r
+       LSR_PATH_COM_Z, \r
+       LSR_PATH_COM_c, \r
+       LSR_PATH_COM_h, \r
+       LSR_PATH_COM_l, \r
+       LSR_PATH_COM_m, \r
+       LSR_PATH_COM_q, \r
+       LSR_PATH_COM_s, \r
+       LSR_PATH_COM_t,\r
+       LSR_PATH_COM_v,\r
+       LSR_PATH_COM_z\r
+};\r
+\r
+\r
+\r
+\r
+enum\r
+{\r
+       LSR_SCENE_CONTENT_MODEL_a = 0,\r
+       LSR_SCENE_CONTENT_MODEL_animate,\r
+       LSR_SCENE_CONTENT_MODEL_animateColor,\r
+       LSR_SCENE_CONTENT_MODEL_animateMotion,\r
+       LSR_SCENE_CONTENT_MODEL_animateTransform,\r
+       LSR_SCENE_CONTENT_MODEL_audio,\r
+       LSR_SCENE_CONTENT_MODEL_circle,\r
+       LSR_SCENE_CONTENT_MODEL_defs,\r
+       LSR_SCENE_CONTENT_MODEL_desc,\r
+       LSR_SCENE_CONTENT_MODEL_ellipse,\r
+       LSR_SCENE_CONTENT_MODEL_foreignObject,\r
+       LSR_SCENE_CONTENT_MODEL_g,\r
+       LSR_SCENE_CONTENT_MODEL_image,\r
+       LSR_SCENE_CONTENT_MODEL_line,\r
+       LSR_SCENE_CONTENT_MODEL_linearGradient,\r
+       LSR_SCENE_CONTENT_MODEL_metadata,\r
+       LSR_SCENE_CONTENT_MODEL_mpath,\r
+       LSR_SCENE_CONTENT_MODEL_path,\r
+       LSR_SCENE_CONTENT_MODEL_polygon,\r
+       LSR_SCENE_CONTENT_MODEL_polyline,\r
+       LSR_SCENE_CONTENT_MODEL_radialGradient,\r
+       LSR_SCENE_CONTENT_MODEL_rect,\r
+       LSR_SCENE_CONTENT_MODEL_sameg,\r
+       LSR_SCENE_CONTENT_MODEL_sameline,\r
+       LSR_SCENE_CONTENT_MODEL_samepath,\r
+       LSR_SCENE_CONTENT_MODEL_samepathfill,\r
+       LSR_SCENE_CONTENT_MODEL_samepolygon,\r
+       LSR_SCENE_CONTENT_MODEL_samepolygonfill,\r
+       LSR_SCENE_CONTENT_MODEL_samepolygonstroke,\r
+       LSR_SCENE_CONTENT_MODEL_samepolyline,\r
+       LSR_SCENE_CONTENT_MODEL_samepolylinefill,\r
+       LSR_SCENE_CONTENT_MODEL_samepolylinestroke,\r
+       LSR_SCENE_CONTENT_MODEL_samerect,\r
+       LSR_SCENE_CONTENT_MODEL_samerectfill,\r
+       LSR_SCENE_CONTENT_MODEL_sametext,\r
+       LSR_SCENE_CONTENT_MODEL_sametextfill,\r
+       LSR_SCENE_CONTENT_MODEL_sameuse,\r
+       LSR_SCENE_CONTENT_MODEL_script,\r
+       LSR_SCENE_CONTENT_MODEL_set,\r
+       LSR_SCENE_CONTENT_MODEL_stop,\r
+       LSR_SCENE_CONTENT_MODEL_switch,\r
+       LSR_SCENE_CONTENT_MODEL_text,\r
+       LSR_SCENE_CONTENT_MODEL_title,\r
+       LSR_SCENE_CONTENT_MODEL_tspan,\r
+       LSR_SCENE_CONTENT_MODEL_use,\r
+       LSR_SCENE_CONTENT_MODEL_video,\r
+       LSR_SCENE_CONTENT_MODEL_listener,\r
+       LSR_SCENE_CONTENT_MODEL_conditional,\r
+       LSR_SCENE_CONTENT_MODEL_cursorManager,\r
+       LSR_SCENE_CONTENT_MODEL_element_any,\r
+       LSR_SCENE_CONTENT_MODEL_privateContainer,\r
+       LSR_SCENE_CONTENT_MODEL_rectClip,\r
+       LSR_SCENE_CONTENT_MODEL_selector,\r
+       LSR_SCENE_CONTENT_MODEL_simpleLayout,\r
+       LSR_SCENE_CONTENT_MODEL_textContent,\r
+       LSR_SCENE_CONTENT_MODEL_extension,\r
+};\r
+\r
+enum\r
+{\r
+       LSR_UPDATE_CONTENT_MODEL_a = 0,\r
+       LSR_UPDATE_CONTENT_MODEL_animate,\r
+       LSR_UPDATE_CONTENT_MODEL_animateColor,\r
+       LSR_UPDATE_CONTENT_MODEL_animateMotion,\r
+       LSR_UPDATE_CONTENT_MODEL_animateTransform,\r
+       LSR_UPDATE_CONTENT_MODEL_audio,\r
+       LSR_UPDATE_CONTENT_MODEL_circle,\r
+       LSR_UPDATE_CONTENT_MODEL_defs,\r
+       LSR_UPDATE_CONTENT_MODEL_desc,\r
+       LSR_UPDATE_CONTENT_MODEL_ellipse,\r
+       LSR_UPDATE_CONTENT_MODEL_foreignObject,\r
+       LSR_UPDATE_CONTENT_MODEL_g,\r
+       LSR_UPDATE_CONTENT_MODEL_image,\r
+       LSR_UPDATE_CONTENT_MODEL_line,\r
+       LSR_UPDATE_CONTENT_MODEL_linearGradient,\r
+       LSR_UPDATE_CONTENT_MODEL_metadata,\r
+       LSR_UPDATE_CONTENT_MODEL_mpath,\r
+       LSR_UPDATE_CONTENT_MODEL_path,\r
+       LSR_UPDATE_CONTENT_MODEL_polygon,\r
+       LSR_UPDATE_CONTENT_MODEL_polyline,\r
+       LSR_UPDATE_CONTENT_MODEL_radialGradient,\r
+       LSR_UPDATE_CONTENT_MODEL_rect,\r
+       LSR_UPDATE_CONTENT_MODEL_script,\r
+       LSR_UPDATE_CONTENT_MODEL_set,\r
+       LSR_UPDATE_CONTENT_MODEL_stop,\r
+       LSR_UPDATE_CONTENT_MODEL_svg,\r
+       LSR_UPDATE_CONTENT_MODEL_switch,\r
+       LSR_UPDATE_CONTENT_MODEL_text,\r
+       LSR_UPDATE_CONTENT_MODEL_title,\r
+       LSR_UPDATE_CONTENT_MODEL_tspan,\r
+       LSR_UPDATE_CONTENT_MODEL_use,\r
+       LSR_UPDATE_CONTENT_MODEL_video,\r
+       LSR_UPDATE_CONTENT_MODEL_listener,\r
+};\r
+\r
+enum\r
+{\r
+       LSR_UPDATE_CONTENT_MODEL2_conditional = 0,\r
+       LSR_UPDATE_CONTENT_MODEL2_cursorManager,\r
+       LSR_UPDATE_CONTENT_MODEL2_extend,\r
+       LSR_UPDATE_CONTENT_MODEL2_private,\r
+       LSR_UPDATE_CONTENT_MODEL2_rectClip,\r
+       LSR_UPDATE_CONTENT_MODEL2_selector,\r
+       LSR_UPDATE_CONTENT_MODEL2_simpleLayout,\r
+};\r
+\r
+/*just to remember them, not implemented yet*/\r
+enum\r
+{\r
+       LSR_SVG12_EXT_animation = 0,\r
+       LSR_SVG12_EXT_discard,\r
+       LSR_SVG12_EXT_font,\r
+       LSR_SVG12_EXT_font_face,\r
+       LSR_SVG12_EXT_font_face_src,\r
+       LSR_SVG12_EXT_font_face_uri,\r
+       LSR_SVG12_EXT_glyph,\r
+       LSR_SVG12_EXT_handler,\r
+       LSR_SVG12_EXT_hkern,\r
+       LSR_SVG12_EXT_missingGlyph,\r
+       LSR_SVG12_EXT_prefetch,\r
+       LSR_SVG12_EXT_solidColor,\r
+       LSR_SVG12_EXT_tBreak,\r
+       LSR_SVG12_EXT_textArea,\r
+};\r
+\r
+/*just to remember them, not implemented yet*/\r
+enum\r
+{\r
+       LSR_AMD1_EXT_animateScroll = 0,\r
+       LSR_AMD1_EXT_setScroll,\r
+       LSR_AMD1_EXT_streamSource,\r
+       LSR_AMD1_EXT_updateSource,\r
+};\r
+\r
+#endif\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/internal/media_dev.h b/tstools/DtsEdit/src/gpac/internal/media_dev.h
new file mode 100644 (file)
index 0000000..c7cc5bc
--- /dev/null
@@ -0,0 +1,148 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / Media Tools sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+\r
+#ifndef _GF_MEDIA_DEV_H_\r
+#define _GF_MEDIA_DEV_H_\r
+\r
+#include <gpac/media_tools.h>\r
+\r
+GF_Err gf_import_message(GF_MediaImporter *import, GF_Err e, char *format, ...);\r
+\r
+/*returns 0 if not a start code, or size of start code (3 or 4 bytes). If start code, bitstream\r
+is positionned AFTER start code*/\r
+u32 AVC_IsStartCode(GF_BitStream *bs);\r
+/*returns size of chunk between current and next startcode (excluding startcode sizes), 0 if no more startcodes (eos)*/\r
+u32 AVC_NextStartCode(GF_BitStream *bs);\r
+/*returns NAL unit type - bitstream must be sync'ed!!*/\r
+u8 AVC_NALUType(GF_BitStream *bs);\r
+/*slice NALU*/\r
+Bool AVC_NALUIsSlice(u8 type);\r
+\r
+\r
+typedef struct\r
+{\r
+    s32 profile_idc;\r
+    s32 level_idc;\r
+    s32 prof_compat;\r
+    s32 log2_max_frame_num;\r
+    u32 poc_type, poc_cycle_length;\r
+    s32 log2_max_poc_lsb;\r
+    s32 delta_pic_order_always_zero_flag;\r
+       s32 offset_for_non_ref_pic, offset_for_top_to_bottom_field;\r
+       Bool frame_mbs_only_flag;\r
+\r
+    s16 offset_for_ref_frame[256];\r
+\r
+    s32 timing_info_present_flag;\r
+    u32 num_units_in_tick;\r
+    u32 time_scale;\r
+    s32 fixed_frame_rate_flag;\r
+\r
+       u32 width, height;\r
+       u32 par_num, par_den;\r
+       /*used to discard repeated SPSs - 0: not parsed, 1 parsed, 2 sent*/\r
+       u32 status;\r
+} AVC_SPS;\r
+\r
+typedef struct \r
+{\r
+    s32 sps_id;\r
+    s32 pic_order_present;      /* pic_order_present_flag*/\r
+    s32 redundant_pic_cnt_present; /* redundant_pic_cnt_present_flag */\r
+    int slice_group_count;      /* num_slice_groups_minus1 + 1*/\r
+       /*used to discard repeated SPSs - 0: not parsed, 1 parsed, 2 sent*/\r
+       u32 status;\r
+} AVC_PPS;\r
+\r
+typedef struct\r
+{\r
+       u8 nal_ref_idc, nal_unit_type, field_pic_flag, bottom_field_flag;\r
+       u32 frame_num, idr_pic_id, poc_lsb, slice_type;\r
+       s32 delta_poc_bottom;\r
+       s32 delta_poc[2];\r
+       s32 redundant_pic_cnt;\r
+\r
+       s32 poc;\r
+       u32 poc_msb, poc_msb_prev, poc_lsb_prev, frame_num_prev;\r
+       s32 frame_num_offset, frame_num_offset_prev;\r
+\r
+       AVC_SPS *sps;\r
+       AVC_PPS *pps;\r
+} AVCSliceInfo;\r
+\r
+\r
+typedef struct \r
+{\r
+       u32 frame_cnt;\r
+       u8 exact_match_flag;\r
+       u8 broken_link_flag;\r
+       u8 changing_slice_group_idc;\r
+       u8 valid;\r
+} AVCSeiRecoveryPoint;\r
+\r
+\r
+typedef struct \r
+{\r
+       AVCSeiRecoveryPoint recovery_point;\r
+       /*to be eventually completed by other sei*/\r
+\r
+} AVCSei;\r
+\r
+typedef struct\r
+{\r
+       AVC_SPS sps[32];\r
+       AVC_PPS pps[255];\r
+\r
+       AVCSliceInfo s_info;\r
+       AVCSei sei;\r
+} AVCState;\r
+\r
+/*return sps ID or -1 if error*/\r
+s32 AVC_ReadSeqInfo(GF_BitStream *bs, AVCState *avc, u32 *vui_flag_pos);\r
+/*return pps ID or -1 if error*/\r
+s32 AVC_ReadPictParamSet(GF_BitStream *bs, AVCState *avc);\r
+/*is slice a RAP*/\r
+Bool AVC_SliceIsIDR(AVCState *avc);\r
+/*parses NALU, updates avc state and returns:\r
+       1 if NALU part of new frame\r
+       0 if NALU part of prev frame\r
+       -1 if bitstream error\r
+*/\r
+s32 AVC_ParseNALU(GF_BitStream *bs, u32 nal_hdr, AVCState *avc);\r
+/*remove SEI messages not allowed in MP4*/\r
+u32 AVC_ReformatSEI_NALU(char *buffer, u32 nal_size, AVCState *avc);\r
+\r
+GF_Err AVC_ChangePAR(GF_AVCConfig *avcc, s32 ar_n, s32 ar_d);\r
+\r
+\r
+typedef struct\r
+{\r
+       u8 rate_idx;\r
+       u8 pck_size;\r
+} QCPRateTable;\r
+\r
+\r
+#endif         /*_GF_MEDIA_DEV_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/internal/mesh.h b/tstools/DtsEdit/src/gpac/internal/mesh.h
new file mode 100644 (file)
index 0000000..05bca60
--- /dev/null
@@ -0,0 +1,285 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / Scene Compositor sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+\r
+#ifndef _GF_MESH_H_\r
+#define _GF_MESH_H_\r
+\r
+#include <gpac/scenegraph_vrml.h>\r
+#include <gpac/path2d.h>\r
+\r
+/*by default we store each color on 32 bit rather than 4 floats (128 bits)*/\r
+\r
+//#define MESH_USE_SFCOLOR\r
+\r
+#ifdef MESH_USE_SFCOLOR\r
+#define MESH_MAKE_COL(_argb) _argb\r
+#define MESH_GET_COLOR(_argb, _vertex) _argb = (_vertex).color;\r
+#else\r
+#define MESH_MAKE_COL(_argb) GF_COL_ARGB(FIX2INT(255*(_argb.alpha)), FIX2INT(255*(_argb.blue)), FIX2INT(255*(_argb.green)), FIX2INT(255*(_argb.red)))\r
+#define MESH_GET_COLOR(_argb, _vertex) { _argb.alpha = INT2FIX(GF_COL_A((_vertex).color))/255; _argb.red = INT2FIX(GF_COL_R((_vertex).color))/255; _argb.green = INT2FIX(GF_COL_G((_vertex).color))/255; _argb.blue = INT2FIX(GF_COL_B((_vertex).color))/255; }\r
+#endif\r
+\r
+/*by default we store normals as signed bytes rather than floats*/\r
+\r
+//#define MESH_USE_FIXED_NORMAL\r
+\r
+#ifdef MESH_USE_FIXED_NORMAL\r
+#define MESH_SET_NORMAL(_vertex, _nor) _vertex.normal = _nor;\r
+#define MESH_GET_NORMAL(_nor, _vertex) _nor = _vertex.normal;\r
+#define MESH_NORMAL_UNIT       FIX_ONE\r
+#else\r
+\r
+typedef struct\r
+{\r
+       s8 x, y, z;\r
+       s8 __dummy;\r
+} SFVec3f_bytes;\r
+\r
+#define MESH_NORMAL_UNIT       1\r
+\r
+#ifdef GPAC_FIXED_POINT\r
+#define MESH_SET_NORMAL(_vertex, _nor) { SFVec3f_bytes __nor; __nor.x = (s8) FIX2INT(_nor.x*100); __nor.y = (s8) FIX2INT(_nor.y*100); __nor.z = (s8) FIX2INT(_nor.z*100); __nor.__dummy=0; _vertex.normal = __nor; }\r
+#define MESH_GET_NORMAL(_nor, _vertex) { (_nor).x = INT2FIX(_vertex.normal.x); (_nor).y = INT2FIX(_vertex.normal.y); (_nor).z = INT2FIX(_vertex.normal.z); gf_vec_norm(&(_nor)); }\r
+#else\r
+#define MESH_SET_NORMAL(_vertex, _nor) { SFVec3f_bytes __nor; __nor.x = (s8) (_nor.x*100); __nor.y = (s8) (_nor.y*100); __nor.z = (s8) (_nor.z*100); __nor.__dummy=0; _vertex.normal = __nor; }\r
+#define MESH_GET_NORMAL(_nor, _vertex) { (_nor).x = _vertex.normal.x; (_nor).y = _vertex.normal.y; (_nor).z = _vertex.normal.z; gf_vec_norm(&(_nor)); }\r
+#endif\r
+\r
+#endif\r
+\r
+typedef struct\r
+{\r
+       /*position*/\r
+       SFVec3f pos;    \r
+       /*texture coordinates*/\r
+       SFVec2f texcoords;\r
+       /*normal*/\r
+#ifdef MESH_USE_FIXED_NORMAL\r
+       SFVec3f normal;\r
+#else\r
+       SFVec3f_bytes normal;\r
+#endif\r
+       /*color if used by mesh object*/\r
+#ifdef MESH_USE_SFCOLOR\r
+       SFColorRGBA color;\r
+#else\r
+       u32 color;\r
+#endif\r
+} GF_Vertex;\r
+\r
+/*mesh type used*/\r
+enum\r
+{\r
+       /*default: triangles described by indices (nb triangles = nb indices / 3) */\r
+       MESH_TRIANGLES = 0,\r
+       /*point set: indices is meaningless*/\r
+       MESH_POINTSET,\r
+       /*line set: lines described by indices (nb lines = nb indices / 2) */\r
+       MESH_LINESET,\r
+};\r
+\r
+/*mesh flags*/\r
+enum\r
+{\r
+       /*vertex.color is used*/\r
+       MESH_HAS_COLOR = 1, \r
+       /*mesh is 2D: normal should be ignored and a global normal set to 0 0 1*/\r
+       MESH_IS_2D = 1<<1, \r
+       /*mesh has no texture coords - disable texturing*/\r
+       MESH_NO_TEXTURE = 1<<2, \r
+       /*mesh faces are clockwise*/\r
+       MESH_IS_CW = 1<<3, \r
+       /*mesh is solid (back face culling + 2 side lighting)*/\r
+       MESH_IS_SOLID = 1<<4, \r
+       /*mesh has smoothed normals*/\r
+       MESH_IS_SMOOTHED = 1<<5, \r
+       /*vertex.color is used with alpha channel*/\r
+       MESH_HAS_ALPHA = 1<<6, \r
+};\r
+\r
+/*indexes as used in glDrawElements - note that integer type is not allowed with oglES*/\r
+#ifdef GPAC_USE_OGL_ES\r
+#define IDX_TYPE       u16\r
+#else\r
+#define IDX_TYPE       u32\r
+#endif\r
+\r
+/*mesh object used by all 2D/3D primitives. */\r
+typedef struct __gf_mesh\r
+{\r
+       /*vertex list*/\r
+       u32 v_count, v_alloc;\r
+       GF_Vertex *vertices;\r
+       /*triangle indexes*/\r
+       u32 i_count, i_alloc;\r
+       IDX_TYPE *indices;\r
+\r
+       /*one of the above type*/\r
+       u32 mesh_type;\r
+\r
+       /*one of the above flags*/\r
+       u32 flags;\r
+\r
+       /*bounds info: bounding box and bounding sphere radius*/\r
+       GF_BBox bounds;\r
+\r
+       /*aabb tree of the mesh if any*/\r
+       struct __AABBNode *aabb_root;\r
+       /*triangle indexes used in AABB tree - order may be different than the one in mesh->indices*/\r
+       IDX_TYPE *aabb_indices;\r
+//     u32 aabb_nb_index;\r
+} GF_Mesh;\r
+\r
+GF_Mesh *new_mesh();\r
+void mesh_free(GF_Mesh *mesh);\r
+/*reset mesh*/\r
+void mesh_reset(GF_Mesh *mesh);\r
+/*recompute mesh bounds*/\r
+void mesh_update_bounds(GF_Mesh *mesh);\r
+/*adds new vertex*/\r
+void mesh_set_vertex_vx(GF_Mesh *mesh, GF_Vertex *vx);\r
+/*adds new vertex (exported for tesselator only)*/\r
+void mesh_set_vertex(GF_Mesh *mesh, Fixed x, Fixed y, Fixed z, Fixed nx, Fixed ny, Fixed nz, Fixed u, Fixed v);\r
+/*adds an index (exported for tesselator only)*/\r
+void mesh_set_index(GF_Mesh *mesh, u32 idx);\r
+/*adds an point & associated color, normal set to NULL*/\r
+void mesh_set_point(GF_Mesh *mesh, Fixed x, Fixed y, Fixed z, SFColorRGBA col);\r
+/*adds an index (exported for tesselator only)*/\r
+void mesh_set_triangle(GF_Mesh *mesh, u32 id1, u32 id2, u32 id3);\r
+/*make dest mesh the clone of orig*/\r
+void mesh_clone(GF_Mesh *dest, GF_Mesh *orig);\r
+/*recompute all normals*/\r
+void mesh_recompute_normals(GF_Mesh *mesh);\r
+/*generate texture coordinate - ONLY LOCAL MODES SUPPORTED FOR NOW*/\r
+void mesh_generate_tex_coords(GF_Mesh *mesh, GF_Node *__texCoords);\r
+\r
+/*inserts a box (lines only) of size 1.0 1.0 1.0*/\r
+void mesh_new_unit_bbox(GF_Mesh *mesh);\r
+\r
+/*insert base primitives - low res indicates less subdivision steps for circles (cone, cylinder, ellipse, sphere)*/\r
+void mesh_new_rectangle(GF_Mesh *mesh, SFVec2f size);\r
+void mesh_new_ellipse(GF_Mesh *mesh, Fixed a_dia, Fixed b_dia, Bool low_res);\r
+void mesh_new_box(GF_Mesh *mesh, SFVec3f size);\r
+void mesh_new_cylinder(GF_Mesh *mesh, Fixed height, Fixed radius, Bool bottom, Bool side, Bool top, Bool low_res);\r
+void mesh_new_cone(GF_Mesh *mesh, Fixed height, Fixed radius, Bool bottom, Bool side, Bool low_res);\r
+void mesh_new_sphere(GF_Mesh *mesh, Fixed radius, Bool low_res);\r
+/*inserts ILS/ILS2D and IFS2D outline when not filled*/\r
+void mesh_new_ils(GF_Mesh *mesh, GF_Node *__coord, MFInt32 *coordIndex, GF_Node *__color, MFInt32 *colorIndex, Bool colorPerVertex, Bool do_close);\r
+/*inserts IFS2D*/\r
+void mesh_new_ifs2d(GF_Mesh *mesh, GF_Node *ifs2d);\r
+/*inserts IFS*/\r
+void mesh_new_ifs(GF_Mesh *mesh, GF_Node *ifs);\r
+/*inserts PS/PS2D*/\r
+void mesh_new_ps(GF_Mesh *mesh, GF_Node *__coord, GF_Node *__color);\r
+/*inserts ElevationGrid*/\r
+void mesh_new_elevation_grid(GF_Mesh *mesh, GF_Node *eg);\r
+/*inserts Extrusion*/\r
+void mesh_new_extrusion(GF_Mesh *mesh, GF_Node *ext);\r
+/*builds mesh from path, performing tesselation if desired*/\r
+void mesh_from_path(GF_Mesh *mesh, GF_Path *path);\r
+/*builds mesh for outline of the given path*/\r
+void mesh_get_outline(GF_Mesh *mesh, GF_Path *path);\r
+/*constructs an extrusion from given path - mesh is reseted, txcoords computed from path bounds\r
+@thespine: spine line\r
+@creaseAngle: creaseAngle for normal smoothing, 0 for no smoothing\r
+begin_cap, end_cap: indicates whether start/end faces shall be added\r
+@spine_ori: orientation at spine points\r
+@spine_scale: scale at spine points\r
+@tx_along_spine: if set, texture coords are generated so that the texture is mapped on the side, \r
+otherwise the same txcoords are used all along the extrusion spine\r
+*/\r
+void mesh_extrude_path(GF_Mesh *mesh, GF_Path *path, MFVec3f *thespine, Fixed creaseAngle, Bool begin_cap, Bool end_cap, MFRotation *spine_ori, MFVec2f *spine_scale, Bool tx_along_spine);\r
+/*special extension of the above: APPENDS an extrusion from given path - mesh is NOT reseted, txcoords are computed based on min_cx, min_cy, width_cx, width_cy*/\r
+void mesh_extrude_path_ext(GF_Mesh *mesh, GF_Path *path, MFVec3f *thespine, Fixed creaseAngle, Fixed min_cx, Fixed min_cy, Fixed width_cx, Fixed width_cy, Bool begin_cap, Bool end_cap, MFRotation *spine_ori, MFVec2f *spine_scale, Bool tx_along_spine);\r
+\r
+/*returns 1 if intersection and set outPoint to closest intersection, 0 otherwise*/\r
+Bool gf_mesh_intersect_ray(GF_Mesh *mesh, GF_Ray *r, SFVec3f *outPoint, SFVec3f *outNormal, SFVec2f *outTexCoords);\r
+/*returns 1 if any face is less than min_dist from pos, with collision point on closest face (towards pos)*/\r
+Bool gf_mesh_closest_face(GF_Mesh *mesh, SFVec3f pos, Fixed min_dist, SFVec3f *outPoint);\r
+\r
+\r
+\r
+\r
+/*AABB tree node (exported for bounds drawing)*/\r
+typedef struct __AABBNode\r
+{\r
+       /*bbox*/\r
+       SFVec3f min, max;\r
+       /*sorted indices in mesh indices list*/\r
+       IDX_TYPE *indices;\r
+       /*nb triangles*/\r
+       u32 nb_idx;\r
+       /*children nodes, NULL if leaf*/\r
+       struct __AABBNode *pos, *neg;\r
+} AABBNode;\r
+\r
+/*tree construction modes*/\r
+enum\r
+{\r
+       /*AABB tree is not used*/\r
+       AABB_NONE, \r
+       /*longest box axis is used to divide an AABB node*/\r
+       AABB_LONGEST, \r
+       /*keep tree well-balanced*/\r
+       AABB_BALANCED,\r
+       /*best axis is use: test largest, then middle, then smallest axis*/\r
+       AABB_BEST_AXIS, \r
+       /*use variance to pick axis*/\r
+       AABB_SPLATTER,\r
+       /*fifty/fifty point split*/\r
+       AABB_FIFTY,\r
+};\r
+\r
+void gf_mesh_build_aabbtree(GF_Mesh *mesh);\r
+\r
+\r
+/*\r
+ *             tesselation functions\r
+ */\r
+\r
+/*appends given face (and tesselate if needed) to the mesh. Only vertices are used in the face\r
+indices are ignored. \r
+partially implemented on ogl-ES*/\r
+void TesselateFaceMesh(GF_Mesh *mesh, GF_Mesh *face);\r
+\r
+#ifndef GPAC_USE_OGL_ES\r
+/*converts 2D path into a polygon - these are only partially implemented when using oglES\r
+for_outline:\r
+        0, regular odd/even windining rule with texCoords\r
+        1, zero-non-zero windining rule without texCoords\r
+        2, zero-non-zero windining rule with texCoords\r
+*/\r
+void TesselatePath(GF_Mesh *mesh, GF_Path *path, u32 outline_style);\r
+\r
+/*appends given face (and tesselate if needed) to the mesh. Only vertices are used in the face\r
+indices are ignored. \r
+Same as TesselateFaceMesh + faces info to determine where are the polygons in the face - used by extruder only\r
+*/\r
+void TesselateFaceMeshComplex(GF_Mesh *dest, GF_Mesh *orig, u32 nbFaces, u32 *ptsPerFaces);\r
+\r
+#endif\r
+\r
+#endif         /*_GF_MESH_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/internal/odf_dev.h b/tstools/DtsEdit/src/gpac/internal/odf_dev.h
new file mode 100644 (file)
index 0000000..b07ae98
--- /dev/null
@@ -0,0 +1,364 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / MPEG-4 ObjectDescriptor sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+\r
+#ifndef _GF_OD_DEV_H_\r
+#define _GF_OD_DEV_H_\r
+\r
+#include <gpac/mpeg4_odf.h>\r
+\r
+/*read-write OD formatted strings*/\r
+GF_Err gf_odf_read_url_string(GF_BitStream *bs, char **string, u32 *readBytes);\r
+GF_Err gf_odf_write_url_string(GF_BitStream *bs, char *string);\r
+u32 gf_odf_size_url_string(char *string);\r
+\r
+/*descriptors base functions*/\r
+GF_Descriptor *gf_odf_create_descriptor(u8 tag);\r
+GF_Err gf_odf_delete_descriptor(GF_Descriptor *desc);\r
+GF_Err gf_odf_parse_descriptor(GF_BitStream *bs, GF_Descriptor **desc, u32 *size);\r
+GF_Err gf_odf_read_descriptor(GF_BitStream *bs, GF_Descriptor *desc, u32 DescSize);\r
+GF_Err gf_odf_write_base_descriptor(GF_BitStream *bs, u8 tag, u32 size);\r
+GF_Err gf_odf_write_descriptor(GF_BitStream *bs, GF_Descriptor *desc);\r
+GF_Err gf_odf_size_descriptor(GF_Descriptor *desc, u32 *outSize);\r
+GF_Err gf_odf_delete_descriptor_list(GF_List *descList);\r
+GF_Err gf_odf_write_descriptor_list(GF_BitStream *bs, GF_List *descList);\r
+GF_Err gf_odf_write_descriptor_list_filter(GF_BitStream *bs, GF_List *descList, u8 tag_only);\r
+GF_Err gf_odf_size_descriptor_list(GF_List *descList, u32 *outSize);\r
+\r
+/*handle lazy bitstreams where SizeOfInstance is always encoded on 4 bytes*/\r
+s32 gf_odf_size_field_size(u32 size_desc);\r
+\r
+GF_Err DumpDescList(GF_List *list, FILE *trace, u32 indent, const char *ListName, Bool XMTDump, Bool no_skip_empty);\r
+\r
+/*IPMPX tools*/\r
+u32 gf_ipmpx_array_size(GF_BitStream *bs, u32 *array_size);\r
+void gf_ipmpx_write_array(GF_BitStream *bs, char *data, u32 data_len);\r
+\r
+/*QoS qualifiers base functions*/\r
+GF_Err gf_odf_parse_qos_qual(GF_BitStream *bs, GF_QoS_Default **qos_qual, u32 *qos_size);\r
+void gf_odf_delete_qos_qual(GF_QoS_Default *qos);\r
+GF_Err gf_odf_size_qos_qual(GF_QoS_Default *qos);\r
+GF_Err gf_odf_write_qos_qual(GF_BitStream *bs, GF_QoS_Default *qos);\r
+\r
+GF_Descriptor *gf_odf_new_iod();\r
+GF_Descriptor *gf_odf_new_esd();\r
+GF_Descriptor *gf_odf_new_dcd();\r
+GF_Descriptor *gf_odf_new_slc(u8 predef);\r
+GF_Descriptor *gf_odf_new_cc();\r
+GF_Descriptor *gf_odf_new_cc_date();\r
+GF_Descriptor *gf_odf_new_cc_name();\r
+GF_Descriptor *gf_odf_new_ci();\r
+GF_Descriptor *gf_odf_new_default();\r
+GF_Descriptor *gf_odf_new_esd_inc();\r
+GF_Descriptor *gf_odf_new_esd_ref();\r
+GF_Descriptor *gf_odf_new_exp_text();\r
+GF_Descriptor *gf_odf_new_pl_ext();\r
+GF_Descriptor *gf_odf_new_ipi_ptr();\r
+GF_Descriptor *gf_odf_new_ipmp();\r
+GF_Descriptor *gf_odf_new_ipmp_ptr();\r
+GF_Descriptor *gf_odf_new_kw();\r
+GF_Descriptor *gf_odf_new_lang();\r
+GF_Descriptor *gf_odf_new_isom_iod();\r
+GF_Descriptor *gf_odf_new_isom_od();\r
+GF_Descriptor *gf_odf_new_od();\r
+GF_Descriptor *gf_odf_new_oci_date();\r
+GF_Descriptor *gf_odf_new_oci_name();\r
+GF_Descriptor *gf_odf_new_pl_idx();\r
+GF_Descriptor *gf_odf_new_qos();\r
+GF_Descriptor *gf_odf_new_rating();\r
+GF_Descriptor *gf_odf_new_reg();\r
+GF_Descriptor *gf_odf_new_short_text();\r
+GF_Descriptor *gf_odf_new_smpte_camera();\r
+GF_Descriptor *gf_odf_new_sup_cid();\r
+GF_Descriptor *gf_odf_new_segment();\r
+GF_Descriptor *gf_odf_new_mediatime();\r
+GF_Descriptor *gf_odf_new_ipmp_tool_list();\r
+GF_Descriptor *gf_odf_new_ipmp_tool();\r
+GF_Descriptor *gf_odf_new_muxinfo();\r
+GF_Descriptor *gf_odf_New_ElemMask();\r
+GF_Descriptor *gf_odf_new_bifs_cfg();\r
+GF_Descriptor *gf_odf_new_ui_cfg();\r
+GF_Descriptor *gf_odf_new_laser_cfg();\r
+GF_Descriptor *gf_odf_new_auxvid();\r
+\r
+\r
+GF_Err gf_odf_del_iod(GF_InitialObjectDescriptor *iod);\r
+GF_Err gf_odf_del_esd(GF_ESD *esd);\r
+GF_Err gf_odf_del_dcd(GF_DecoderConfig *dcd);\r
+GF_Err gf_odf_del_slc(GF_SLConfig *sl);\r
+GF_Err gf_odf_del_cc(GF_CCDescriptor *ccd);\r
+GF_Err gf_odf_del_cc_date(GF_CC_Date *cdd);\r
+GF_Err gf_odf_del_cc_name(GF_CC_Name *cnd);\r
+GF_Err gf_odf_del_ci(GF_CIDesc *cid);\r
+GF_Err gf_odf_del_default(GF_DefaultDescriptor *dd);\r
+GF_Err gf_odf_del_esd_inc(GF_ES_ID_Inc *esd_inc);\r
+GF_Err gf_odf_del_esd_ref(GF_ES_ID_Ref *esd_ref);\r
+GF_Err gf_odf_del_exp_text(GF_ExpandedTextual *etd);\r
+GF_Err gf_odf_del_pl_ext(GF_PLExt *pld);\r
+GF_Err gf_odf_del_ipi_ptr(GF_IPIPtr *ipid);\r
+GF_Err gf_odf_del_ipmp(GF_IPMP_Descriptor *ipmp);\r
+GF_Err gf_odf_del_ipmp_ptr(GF_IPMPPtr *ipmpd);\r
+GF_Err gf_odf_del_kw(GF_KeyWord *kwd);\r
+GF_Err gf_odf_del_lang(GF_Language *ld);\r
+GF_Err gf_odf_del_isom_iod(GF_IsomInitialObjectDescriptor *iod);\r
+GF_Err gf_odf_del_isom_od(GF_IsomObjectDescriptor *od);\r
+GF_Err gf_odf_del_od(GF_ObjectDescriptor *od);\r
+GF_Err gf_odf_del_oci_date(GF_OCI_Data *ocd);\r
+GF_Err gf_odf_del_oci_name(GF_OCICreators *ocn);\r
+GF_Err gf_odf_del_pl_idx(GF_PL_IDX *plid);\r
+GF_Err gf_odf_del_qos(GF_QoS_Descriptor *qos);\r
+GF_Err gf_odf_del_rating(GF_Rating *rd);\r
+GF_Err gf_odf_del_reg(GF_Registration *reg);\r
+GF_Err gf_odf_del_short_text(GF_ShortTextual *std);\r
+GF_Err gf_odf_del_smpte_camera(GF_SMPTECamera *cpd);\r
+GF_Err gf_odf_del_sup_cid(GF_SCIDesc *scid);\r
+GF_Err gf_odf_del_segment(GF_Segment *sd);\r
+GF_Err gf_odf_del_mediatime(GF_MediaTime *mt);\r
+GF_Err gf_odf_del_ipmp_tool_list(GF_IPMP_ToolList *ipmptl);\r
+GF_Err gf_odf_del_ipmp_tool(GF_IPMP_Tool *ipmp);\r
+GF_Err gf_odf_del_muxinfo(GF_MuxInfo *mi);\r
+GF_Err gf_odf_del_bifs_cfg(GF_BIFSConfig *desc);\r
+GF_Err gf_odf_del_ui_cfg(GF_UIConfig *desc);\r
+GF_Err gf_odf_del_laser_cfg(GF_LASERConfig *desc);\r
+GF_Err gf_odf_del_auxvid(GF_AuxVideoDescriptor *ld);\r
+\r
+GF_Err gf_odf_read_iod(GF_BitStream *bs, GF_InitialObjectDescriptor *iod, u32 DescSize);\r
+GF_Err gf_odf_read_esd(GF_BitStream *bs, GF_ESD *esd, u32 DescSize);\r
+GF_Err gf_odf_read_dcd(GF_BitStream *bs, GF_DecoderConfig *dcd, u32 DescSize);\r
+GF_Err gf_odf_read_slc(GF_BitStream *bs, GF_SLConfig *sl, u32 DescSize);\r
+GF_Err gf_odf_read_cc(GF_BitStream *bs, GF_CCDescriptor *ccd, u32 DescSize);\r
+GF_Err gf_odf_read_cc_date(GF_BitStream *bs, GF_CC_Date *cdd, u32 DescSize);\r
+GF_Err gf_odf_read_cc_name(GF_BitStream *bs, GF_CC_Name *cnd, u32 DescSize);\r
+GF_Err gf_odf_read_ci(GF_BitStream *bs, GF_CIDesc *cid, u32 DescSize);\r
+GF_Err gf_odf_read_default(GF_BitStream *bs, GF_DefaultDescriptor *dd, u32 DescSize);\r
+GF_Err gf_odf_read_esd_inc(GF_BitStream *bs, GF_ES_ID_Inc *esd_inc, u32 DescSize);\r
+GF_Err gf_odf_read_esd_ref(GF_BitStream *bs, GF_ES_ID_Ref *esd_ref, u32 DescSize);\r
+GF_Err gf_odf_read_exp_text(GF_BitStream *bs, GF_ExpandedTextual *etd, u32 DescSize);\r
+GF_Err gf_odf_read_pl_ext(GF_BitStream *bs, GF_PLExt *pld, u32 DescSize);\r
+GF_Err gf_odf_read_ipi_ptr(GF_BitStream *bs, GF_IPIPtr *ipid, u32 DescSize);\r
+GF_Err gf_odf_read_ipmp(GF_BitStream *bs, GF_IPMP_Descriptor *ipmp, u32 DescSize);\r
+GF_Err gf_odf_read_ipmp_ptr(GF_BitStream *bs, GF_IPMPPtr *ipmpd, u32 DescSize);\r
+GF_Err gf_odf_read_kw(GF_BitStream *bs, GF_KeyWord *kwd, u32 DescSize);\r
+GF_Err gf_odf_read_lang(GF_BitStream *bs, GF_Language *ld, u32 DescSize);\r
+GF_Err gf_odf_read_isom_iod(GF_BitStream *bs, GF_IsomInitialObjectDescriptor *iod, u32 DescSize);\r
+GF_Err gf_odf_read_isom_od(GF_BitStream *bs, GF_IsomObjectDescriptor *od, u32 DescSize);\r
+GF_Err gf_odf_read_od(GF_BitStream *bs, GF_ObjectDescriptor *od, u32 DescSize);\r
+GF_Err gf_odf_read_oci_date(GF_BitStream *bs, GF_OCI_Data *ocd, u32 DescSize);\r
+GF_Err gf_odf_read_oci_name(GF_BitStream *bs, GF_OCICreators *ocn, u32 DescSize);\r
+GF_Err gf_odf_read_pl_idx(GF_BitStream *bs, GF_PL_IDX *plid, u32 DescSize);\r
+GF_Err gf_odf_read_qos(GF_BitStream *bs, GF_QoS_Descriptor *qos, u32 DescSize);\r
+GF_Err gf_odf_read_rating(GF_BitStream *bs, GF_Rating *rd, u32 DescSize);\r
+GF_Err gf_odf_read_reg(GF_BitStream *bs, GF_Registration *reg, u32 DescSize);\r
+GF_Err gf_odf_read_short_text(GF_BitStream *bs, GF_ShortTextual *std, u32 DescSize);\r
+GF_Err gf_odf_read_smpte_camera(GF_BitStream *bs, GF_SMPTECamera *cpd, u32 DescSize);\r
+GF_Err gf_odf_read_sup_cid(GF_BitStream *bs, GF_SCIDesc *scid, u32 DescSize);\r
+GF_Err gf_odf_read_segment(GF_BitStream *bs, GF_Segment *sd, u32 DescSize);\r
+GF_Err gf_odf_read_mediatime(GF_BitStream *bs, GF_MediaTime *mt, u32 DescSize);\r
+GF_Err gf_odf_read_muxinfo(GF_BitStream *bs, GF_MuxInfo *mi, u32 DescSize);\r
+GF_Err gf_odf_read_ipmp_tool_list(GF_BitStream *bs, GF_IPMP_ToolList *ipmptl, u32 DescSize);\r
+GF_Err gf_odf_read_ipmp_tool(GF_BitStream *bs, GF_IPMP_Tool *ipmp, u32 DescSize);\r
+GF_Err gf_odf_read_auxvid(GF_BitStream *bs, GF_AuxVideoDescriptor *ld, u32 DescSize);\r
+\r
+GF_Err gf_odf_size_iod(GF_InitialObjectDescriptor *iod, u32 *outSize);\r
+GF_Err gf_odf_size_esd(GF_ESD *esd, u32 *outSize);\r
+GF_Err gf_odf_size_dcd(GF_DecoderConfig *dcd, u32 *outSize);\r
+GF_Err gf_odf_size_slc(GF_SLConfig *sl, u32 *outSize);\r
+GF_Err gf_odf_size_cc(GF_CCDescriptor *ccd, u32 *outSize);\r
+GF_Err gf_odf_size_cc_date(GF_CC_Date *cdd, u32 *outSize);\r
+GF_Err gf_odf_size_cc_name(GF_CC_Name *cnd, u32 *outSize);\r
+GF_Err gf_odf_size_ci(GF_CIDesc *cid, u32 *outSize);\r
+GF_Err gf_odf_size_default(GF_DefaultDescriptor *dd, u32 *outSize);\r
+GF_Err gf_odf_size_esd_inc(GF_ES_ID_Inc *esd_inc, u32 *outSize);\r
+GF_Err gf_odf_size_esd_ref(GF_ES_ID_Ref *esd_ref, u32 *outSize);\r
+GF_Err gf_odf_size_exp_text(GF_ExpandedTextual *etd, u32 *outSize);\r
+GF_Err gf_odf_size_pl_ext(GF_PLExt *pld, u32 *outSize);\r
+GF_Err gf_odf_size_ipi_ptr(GF_IPIPtr *ipid, u32 *outSize);\r
+GF_Err gf_odf_size_ipmp(GF_IPMP_Descriptor *ipmp, u32 *outSize);\r
+GF_Err gf_odf_size_ipmp_ptr(GF_IPMPPtr *ipmpd, u32 *outSize);\r
+GF_Err gf_odf_size_kw(GF_KeyWord *kwd, u32 *outSize);\r
+GF_Err gf_odf_size_lang(GF_Language *ld, u32 *outSize);\r
+GF_Err gf_odf_size_isom_iod(GF_IsomInitialObjectDescriptor *iod, u32 *outSize);\r
+GF_Err gf_odf_size_isom_od(GF_IsomObjectDescriptor *od, u32 *outSize);\r
+GF_Err gf_odf_size_od(GF_ObjectDescriptor *od, u32 *outSize);\r
+GF_Err gf_odf_size_oci_date(GF_OCI_Data *ocd, u32 *outSize);\r
+GF_Err gf_odf_size_oci_name(GF_OCICreators *ocn, u32 *outSize);\r
+GF_Err gf_odf_size_pl_idx(GF_PL_IDX *plid, u32 *outSize);\r
+GF_Err gf_odf_size_qos(GF_QoS_Descriptor *qos, u32 *outSize);\r
+GF_Err gf_odf_size_rating(GF_Rating *rd, u32 *outSize);\r
+GF_Err gf_odf_size_reg(GF_Registration *reg, u32 *outSize);\r
+GF_Err gf_odf_size_short_text(GF_ShortTextual *std, u32 *outSize);\r
+GF_Err gf_odf_size_smpte_camera(GF_SMPTECamera *cpd, u32 *outSize);\r
+GF_Err gf_odf_size_sup_cid(GF_SCIDesc *scid, u32 *outSize);\r
+GF_Err gf_odf_size_segment(GF_Segment *sd, u32 *outSize);\r
+GF_Err gf_odf_size_mediatime(GF_MediaTime *mt, u32 *outSize);\r
+GF_Err gf_odf_size_muxinfo(GF_MuxInfo *mi, u32 *outSize);\r
+GF_Err gf_odf_size_ipmp_tool_list(GF_IPMP_ToolList *ipmptl, u32 *outSize);\r
+GF_Err gf_odf_size_ipmp_tool(GF_IPMP_Tool *ipmp, u32 *outSize);\r
+GF_Err gf_odf_size_auxvid(GF_AuxVideoDescriptor *ld, u32 *outSize);\r
+\r
+GF_Err gf_odf_write_iod(GF_BitStream *bs, GF_InitialObjectDescriptor *iod);\r
+GF_Err gf_odf_write_esd(GF_BitStream *bs, GF_ESD *esd);\r
+GF_Err gf_odf_write_dcd(GF_BitStream *bs, GF_DecoderConfig *dcd);\r
+GF_Err gf_odf_write_slc(GF_BitStream *bs, GF_SLConfig *sl);\r
+GF_Err gf_odf_write_cc(GF_BitStream *bs, GF_CCDescriptor *ccd);\r
+GF_Err gf_odf_write_cc_date(GF_BitStream *bs, GF_CC_Date *cdd);\r
+GF_Err gf_odf_write_cc_name(GF_BitStream *bs, GF_CC_Name *cnd);\r
+GF_Err gf_odf_write_ci(GF_BitStream *bs, GF_CIDesc *cid);\r
+GF_Err gf_odf_write_default(GF_BitStream *bs, GF_DefaultDescriptor *dd);\r
+GF_Err gf_odf_write_esd_inc(GF_BitStream *bs, GF_ES_ID_Inc *esd_inc);\r
+GF_Err gf_odf_write_esd_ref(GF_BitStream *bs, GF_ES_ID_Ref *esd_ref);\r
+GF_Err gf_odf_write_exp_text(GF_BitStream *bs, GF_ExpandedTextual *etd);\r
+GF_Err gf_odf_write_pl_ext(GF_BitStream *bs, GF_PLExt *pld);\r
+GF_Err gf_odf_write_ipi_ptr(GF_BitStream *bs, GF_IPIPtr *ipid);\r
+GF_Err gf_odf_write_ipmp(GF_BitStream *bs, GF_IPMP_Descriptor *ipmp);\r
+GF_Err gf_odf_write_ipmp_ptr(GF_BitStream *bs, GF_IPMPPtr *ipmpd);\r
+GF_Err gf_odf_write_kw(GF_BitStream *bs, GF_KeyWord *kwd);\r
+GF_Err gf_odf_write_lang(GF_BitStream *bs, GF_Language *ld);\r
+GF_Err gf_odf_write_isom_iod(GF_BitStream *bs, GF_IsomInitialObjectDescriptor *iod);\r
+GF_Err gf_odf_write_isom_od(GF_BitStream *bs, GF_IsomObjectDescriptor *od);\r
+GF_Err gf_odf_write_od(GF_BitStream *bs, GF_ObjectDescriptor *od);\r
+GF_Err gf_odf_write_oci_date(GF_BitStream *bs, GF_OCI_Data *ocd);\r
+GF_Err gf_odf_write_oci_name(GF_BitStream *bs, GF_OCICreators *ocn);\r
+GF_Err gf_odf_write_pl_idx(GF_BitStream *bs, GF_PL_IDX *plid);\r
+GF_Err gf_odf_write_qos(GF_BitStream *bs, GF_QoS_Descriptor *qos);\r
+GF_Err gf_odf_write_rating(GF_BitStream *bs, GF_Rating *rd);\r
+GF_Err gf_odf_write_reg(GF_BitStream *bs, GF_Registration *reg);\r
+GF_Err gf_odf_write_short_text(GF_BitStream *bs, GF_ShortTextual *std);\r
+GF_Err gf_odf_write_smpte_camera(GF_BitStream *bs, GF_SMPTECamera *cpd);\r
+GF_Err gf_odf_write_sup_cid(GF_BitStream *bs, GF_SCIDesc *scid);\r
+GF_Err gf_odf_write_segment(GF_BitStream *bs, GF_Segment *sd);\r
+GF_Err gf_odf_write_mediatime(GF_BitStream *bs, GF_MediaTime *mt);\r
+GF_Err gf_odf_write_muxinfo(GF_BitStream *bs, GF_MuxInfo *mi);\r
+GF_Err gf_odf_write_ipmp_tool_list(GF_BitStream *bs, GF_IPMP_ToolList *ipmptl);\r
+GF_Err gf_odf_write_ipmp_tool(GF_BitStream *bs, GF_IPMP_Tool *ipmp);\r
+GF_Err gf_odf_write_auxvid(GF_BitStream *bs, GF_AuxVideoDescriptor *ld);\r
+\r
+GF_Descriptor *gf_odf_new_text_cfg();\r
+GF_Err gf_odf_del_text_cfg(GF_TextConfig *desc);\r
+GF_Descriptor *gf_odf_new_tx3g();\r
+GF_Err gf_odf_del_tx3g(GF_TextSampleDescriptor *sd);\r
+\r
+/*our commands base functions*/\r
+GF_ODCom *gf_odf_create_command(u8 tag);\r
+GF_Err gf_odf_delete_command(GF_ODCom *com);\r
+GF_Err gf_odf_parse_command(GF_BitStream *bs, GF_ODCom **com, u32 *com_size);\r
+GF_Err gf_odf_read_command(GF_BitStream *bs, GF_ODCom *com, u32 gf_odf_size_command);\r
+GF_Err gf_odf_size_command(GF_ODCom *com, u32 *outSize);\r
+GF_Err gf_odf_write_command(GF_BitStream *bs, GF_ODCom *com);\r
+\r
+GF_ODCom *gf_odf_new_od_remove();\r
+GF_ODCom *gf_odf_new_od_update();\r
+GF_ODCom *gf_odf_new_esd_update();\r
+GF_ODCom *gf_odf_new_esd_remove();\r
+GF_ODCom *gf_odf_new_ipmp_update();\r
+GF_ODCom *gf_odf_new_ipmp_remove();\r
+GF_ODCom *gf_odf_new_base_command();\r
+\r
+GF_Err gf_odf_del_od_remove(GF_ODRemove *ODRemove);\r
+GF_Err gf_odf_del_od_update(GF_ODUpdate *ODUpdate);\r
+GF_Err gf_odf_del_esd_update(GF_ESDUpdate *ESDUpdate);\r
+GF_Err gf_odf_del_esd_remove(GF_ESDRemove *ESDRemove);\r
+GF_Err gf_odf_del_ipmp_update(GF_IPMPUpdate *IPMPDUpdate);\r
+GF_Err gf_odf_del_ipmp_remove(GF_IPMPRemove *IPMPDRemove);\r
+GF_Err gf_odf_del_base_command(GF_BaseODCom *bcRemove);\r
+\r
+GF_Err gf_odf_read_od_remove(GF_BitStream *bs, GF_ODRemove *odRem, u32 gf_odf_size_command);\r
+GF_Err gf_odf_read_od_update(GF_BitStream *bs, GF_ODUpdate *odUp, u32 gf_odf_size_command);\r
+GF_Err gf_odf_read_esd_update(GF_BitStream *bs, GF_ESDUpdate *esdUp, u32 gf_odf_size_command);\r
+GF_Err gf_odf_read_esd_remove(GF_BitStream *bs, GF_ESDRemove *esdRem, u32 gf_odf_size_command);\r
+GF_Err gf_odf_read_ipmp_update(GF_BitStream *bs, GF_IPMPUpdate *ipmpUp, u32 gf_odf_size_command);\r
+GF_Err gf_odf_read_ipmp_remove(GF_BitStream *bs, GF_IPMPRemove *ipmpRem, u32 gf_odf_size_command);\r
+GF_Err gf_odf_read_base_command(GF_BitStream *bs, GF_BaseODCom *bcRem, u32 gf_odf_size_command);\r
+\r
+GF_Err gf_odf_size_od_remove(GF_ODRemove *odRem, u32 *outSize);\r
+GF_Err gf_odf_size_od_update(GF_ODUpdate *odUp, u32 *outSize);\r
+GF_Err gf_odf_size_esd_update(GF_ESDUpdate *esdUp, u32 *outSize);\r
+GF_Err gf_odf_size_esd_remove(GF_ESDRemove *esdRem, u32 *outSize);\r
+GF_Err gf_odf_size_ipmp_update(GF_IPMPUpdate *ipmpUp, u32 *outSize);\r
+GF_Err gf_odf_size_ipmp_remove(GF_IPMPRemove *ipmpRem, u32 *outSize);\r
+GF_Err gf_odf_size_base_command(GF_BaseODCom *bcRem, u32 *outSize);\r
+\r
+GF_Err gf_odf_write_od_remove(GF_BitStream *bs, GF_ODRemove *odRem);\r
+GF_Err gf_odf_write_od_update(GF_BitStream *bs, GF_ODUpdate *odUp);\r
+GF_Err gf_odf_write_esd_update(GF_BitStream *bs, GF_ESDUpdate *esdUp);\r
+GF_Err gf_odf_write_esd_remove(GF_BitStream *bs, GF_ESDRemove *esdRem);\r
+GF_Err gf_odf_write_ipmp_update(GF_BitStream *bs, GF_IPMPUpdate *ipmpUp);\r
+GF_Err gf_odf_write_ipmp_remove(GF_BitStream *bs, GF_IPMPRemove *ipmpRem);\r
+GF_Err gf_odf_write_base_command(GF_BitStream *bs, GF_BaseODCom *bcRem);\r
+\r
+\r
+\r
+/*dumping*/\r
+GF_Err gf_odf_dump_iod(GF_InitialObjectDescriptor *iod, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_esd(GF_ESD *esd, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_dcd(GF_DecoderConfig *dcd, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_slc(GF_SLConfig *sl, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_cc(GF_CCDescriptor *ccd, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_cc_date(GF_CC_Date *cdd, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_cc_name(GF_CC_Name *cnd, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_ci(GF_CIDesc *cid, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_default(GF_DefaultDescriptor *dd, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_esd_inc(GF_ES_ID_Inc *esd_inc, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_esd_ref(GF_ES_ID_Ref *esd_ref, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_exp_text(GF_ExpandedTextual *etd, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_pl_ext(GF_PLExt *pld, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_ipi_ptr(GF_IPIPtr *ipid, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_ipmp(GF_IPMP_Descriptor *ipmp, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_ipmp_ptr(GF_IPMPPtr *ipmpd, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_kw(GF_KeyWord *kwd, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_lang(GF_Language *ld, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_isom_iod(GF_IsomInitialObjectDescriptor *iod, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_isom_od(GF_IsomObjectDescriptor *od, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_od(GF_ObjectDescriptor *od, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_oci_date(GF_OCI_Data *ocd, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_oci_name(GF_OCICreators *ocn, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_pl_idx(GF_PL_IDX *plid, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_qos(GF_QoS_Descriptor *qos, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_rating(GF_Rating *rd, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_reg(GF_Registration *reg, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_short_text(GF_ShortTextual *std, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_smpte_camera(GF_SMPTECamera *cpd, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_sup_cid(GF_SCIDesc *scid, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_segment(GF_Segment *sd, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_mediatime(GF_MediaTime *mt, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_muxinfo(GF_MuxInfo *mi, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_bifs_cfg(GF_BIFSConfig *dsi, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_laser_cfg(GF_LASERConfig *dsi, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_ui_cfg(GF_UIConfig *dsi, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_txtcfg(GF_TextConfig *desc, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_ipmp_tool_list(GF_IPMP_ToolList *tl, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_ipmp_tool(GF_IPMP_Tool*t, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_aux_vid(GF_AuxVideoDescriptor *ld, FILE *trace, u32 indent, Bool XMTDump);\r
+\r
+\r
+GF_Err gf_odf_dump_od_update(GF_ODUpdate *com, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_od_remove(GF_ODRemove *com, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_esd_update(GF_ESDUpdate *com, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_esd_remove(GF_ESDRemove *com, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_ipmp_update(GF_IPMPUpdate *com, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_ipmp_remove(GF_IPMPRemove *com, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_base_command(GF_BaseODCom *com, FILE *trace, u32 indent, Bool XMTDump);\r
+\r
+#endif /*_GF_OD_DEV_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/internal/ogg.h b/tstools/DtsEdit/src/gpac/internal/ogg.h
new file mode 100644 (file)
index 0000000..e5b0f1e
--- /dev/null
@@ -0,0 +1,209 @@
+/********************************************************************\r
+ *                                                                  *\r
+ * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *\r
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *\r
+ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *\r
+ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *\r
+ *                                                                  *\r
+ * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002             *\r
+ * by the Xiph.Org Foundation http://www.xiph.org/                  *\r
+ *                                                                  *\r
+ ********************************************************************\r
+\r
+ function: code raw [Vorbis] packets into framed OggSquish stream and\r
+           decode Ogg streams back into raw packets\r
+\r
+ note: The CRC code is directly derived from public domain code by\r
+ Ross Williams (ross@guest.adelaide.edu.au).  See docs/framing.html\r
+ for details.\r
+\r
+ ********************************************************************/\r
+\r
+\r
+#ifndef _GF_OGG_H_\r
+#define _GF_OGG_H_\r
+\r
+/*DON'T CLASH WITH OFFICIAL OGG IF ALREADY INCLUDED*/\r
+#ifndef _OGG_H\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/tools.h>\r
+\r
+typedef struct {\r
+  s32 endbyte;\r
+  s32  endbit;\r
+\r
+  unsigned char *buffer;\r
+  unsigned char *ptr;\r
+  s32 storage;\r
+} oggpack_buffer;\r
+\r
+/* ogg_page is used to encapsulate the data in one Ogg bitstream page *****/\r
+\r
+typedef struct {\r
+  unsigned char *header;\r
+  s32 header_len;\r
+  unsigned char *body;\r
+  s32 body_len;\r
+} ogg_page;\r
+\r
+/* ogg_stream_state contains the current encode/decode state of a logical\r
+   Ogg bitstream **********************************************************/\r
+\r
+typedef struct {\r
+  unsigned char   *body_data;    /* bytes from packet bodies */\r
+  s32    body_storage;          /* storage elements allocated */\r
+  s32    body_fill;             /* elements stored; fill mark */\r
+  s32    body_returned;         /* elements of fill returned */\r
+\r
+\r
+  s32     *lacing_vals;      /* The values that will go to the segment table */\r
+  s64 *granule_vals; /* granulepos values for headers. Not compact\r
+                               this way, but it is simple coupled to the\r
+                               lacing fifo */\r
+  s32    lacing_storage;\r
+  s32    lacing_fill;\r
+  s32    lacing_packet;\r
+  s32    lacing_returned;\r
+\r
+  unsigned char    header[282];      /* working space for header encode */\r
+  s32              header_fill;\r
+\r
+  s32     e_o_s;          /* set when we have buffered the last packet in the\r
+                             logical bitstream */\r
+  s32     b_o_s;          /* set after we've written the initial page\r
+                             of a logical bitstream */\r
+  s32    serialno;\r
+  s32    pageno;\r
+  s64  packetno;      /* sequence number for decode; the framing\r
+                             knows where there's a hole in the data,\r
+                             but we need coupling so that the codec\r
+                             (which is in a seperate abstraction\r
+                             layer) also knows about the gap */\r
+  s64   granulepos;\r
+\r
+} ogg_stream_state;\r
+\r
+/* ogg_packet is used to encapsulate the data and metadata belonging\r
+   to a single raw Ogg/Vorbis packet *************************************/\r
+\r
+typedef struct {\r
+  unsigned char *packet;\r
+  s32  bytes;\r
+  s32  b_o_s;\r
+  s32  e_o_s;\r
+\r
+  s64  granulepos;\r
+  \r
+  s64  packetno;     /* sequence number for decode; the framing\r
+                               knows where there's a hole in the data,\r
+                               but we need coupling so that the codec\r
+                               (which is in a seperate abstraction\r
+                               layer) also knows about the gap */\r
+} ogg_packet;\r
+\r
+typedef struct {\r
+  unsigned char *data;\r
+  s32 storage;\r
+  s32 fill;\r
+  s32 returned;\r
+\r
+  s32 unsynced;\r
+  s32 headerbytes;\r
+  s32 bodybytes;\r
+} ogg_sync_state;\r
+\r
+\r
+\r
+/* Ogg BITSTREAM PRIMITIVES: bitstream ************************/\r
+\r
+void oggpack_writeinit(oggpack_buffer *b);\r
+void oggpack_writetrunc(oggpack_buffer *b,s32 bits);\r
+void oggpack_writealign(oggpack_buffer *b);\r
+void oggpack_writecopy(oggpack_buffer *b,void *source,s32 bits);\r
+void oggpack_reset(oggpack_buffer *b);\r
+void oggpack_writeclear(oggpack_buffer *b);\r
+void oggpack_readinit(oggpack_buffer *b,unsigned char *buf,s32 bytes);\r
+void oggpack_write(oggpack_buffer *b,u32 value,s32 bits);\r
+s32 oggpack_look(oggpack_buffer *b,s32 bits);\r
+s32 oggpack_look1(oggpack_buffer *b);\r
+void oggpack_adv(oggpack_buffer *b,s32 bits);\r
+void oggpack_adv1(oggpack_buffer *b);\r
+s32 oggpack_read(oggpack_buffer *b,s32 bits);\r
+s32 oggpack_read1(oggpack_buffer *b);\r
+s32 oggpack_bytes(oggpack_buffer *b);\r
+s32 oggpack_bits(oggpack_buffer *b);\r
+unsigned char *oggpack_get_buffer(oggpack_buffer *b);\r
+\r
+void oggpackB_writeinit(oggpack_buffer *b);\r
+void oggpackB_writetrunc(oggpack_buffer *b,s32 bits);\r
+void oggpackB_writealign(oggpack_buffer *b);\r
+void oggpackB_writecopy(oggpack_buffer *b,void *source,s32 bits);\r
+void oggpackB_reset(oggpack_buffer *b);\r
+void oggpackB_writeclear(oggpack_buffer *b);\r
+void oggpackB_readinit(oggpack_buffer *b,unsigned char *buf,s32 bytes);\r
+void oggpackB_write(oggpack_buffer *b,u32 value,s32 bits);\r
+s32 oggpackB_look(oggpack_buffer *b,s32 bits);\r
+s32 oggpackB_look1(oggpack_buffer *b);\r
+void oggpackB_adv(oggpack_buffer *b,s32 bits);\r
+void oggpackB_adv1(oggpack_buffer *b);\r
+s32 oggpackB_read(oggpack_buffer *b,s32 bits);\r
+s32 oggpackB_read1(oggpack_buffer *b);\r
+s32 oggpackB_bytes(oggpack_buffer *b);\r
+s32 oggpackB_bits(oggpack_buffer *b);\r
+unsigned char *oggpackB_get_buffer(oggpack_buffer *b);\r
+\r
+/* Ogg BITSTREAM PRIMITIVES: encoding **************************/\r
+\r
+s32 ogg_stream_packetin(ogg_stream_state *os, ogg_packet *op);\r
+s32 ogg_stream_pageout(ogg_stream_state *os, ogg_page *og);\r
+s32 ogg_stream_flush(ogg_stream_state *os, ogg_page *og);\r
+\r
+/* Ogg BITSTREAM PRIMITIVES: decoding **************************/\r
+\r
+s32 ogg_sync_init(ogg_sync_state *oy);\r
+s32 ogg_sync_clear(ogg_sync_state *oy);\r
+s32 ogg_sync_reset(ogg_sync_state *oy);\r
+s32 ogg_sync_destroy(ogg_sync_state *oy);\r
+\r
+char *ogg_sync_buffer(ogg_sync_state *oy, s32 size);\r
+s32 ogg_sync_wrote(ogg_sync_state *oy, s32 bytes);\r
+s32 ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og);\r
+s32 ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og);\r
+s32 ogg_stream_pagein(ogg_stream_state *os, ogg_page *og);\r
+s32 ogg_stream_packetout(ogg_stream_state *os,ogg_packet *op);\r
+s32 ogg_stream_packetpeek(ogg_stream_state *os,ogg_packet *op);\r
+\r
+/* Ogg BITSTREAM PRIMITIVES: general ***************************/\r
+\r
+s32 ogg_stream_init(ogg_stream_state *os,s32 serialno);\r
+s32 ogg_stream_clear(ogg_stream_state *os);\r
+s32 ogg_stream_reset(ogg_stream_state *os);\r
+s32 ogg_stream_reset_serialno(ogg_stream_state *os,s32 serialno);\r
+s32 ogg_stream_destroy(ogg_stream_state *os);\r
+s32 ogg_stream_eos(ogg_stream_state *os);\r
+void ogg_page_checksum_set(ogg_page *og);\r
+s32 ogg_page_version(ogg_page *og);\r
+s32 ogg_page_continued(ogg_page *og);\r
+s32 ogg_page_bos(ogg_page *og);\r
+s32 ogg_page_eos(ogg_page *og);\r
+s64 ogg_page_granulepos(ogg_page *og);\r
+s32 ogg_page_serialno(ogg_page *og);\r
+s32 ogg_page_pageno(ogg_page *og);\r
+s32 ogg_page_packets(ogg_page *og);\r
+\r
+void ogg_packet_clear(ogg_packet *op);\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif /*_OGG_H*/\r
+\r
+#endif /*_GF_OGG_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/internal/scenegraph_dev.h b/tstools/DtsEdit/src/gpac/internal/scenegraph_dev.h
new file mode 100644 (file)
index 0000000..ba0507b
--- /dev/null
@@ -0,0 +1,1047 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / Scene Graph sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+\r
+\r
+#ifndef _GF_SCENEGRAPH_DEV_H_\r
+#define _GF_SCENEGRAPH_DEV_H_\r
+\r
+/*defined this macro to enable cyclic render*/\r
+#define GF_CYCLIC_TRAVERSE_ON\r
+\r
+/*defined this macro to enable scene replacement from inside (through conditional)*/\r
+//#define GF_SELF_REPLACE_ENABLE\r
+\r
+/*for vrml base types, ROUTEs and PROTOs*/\r
+#include <gpac/scenegraph_vrml.h>\r
+\r
+#include <gpac/scenegraph_svg.h>\r
+\r
+#ifdef GPAC_HAS_SPIDERMONKEY\r
+\r
+/*WIN32 and WinCE config (no configure script)*/\r
+#if defined(WIN32) || defined(_WIN32_WCE) || defined(__SYMBIAN32__)\r
+#ifndef XP_PC\r
+#define XP_PC\r
+#endif\r
+#ifndef XP_WIN\r
+#define XP_WIN\r
+#endif\r
+/*WINCE specific config*/\r
+#if defined(_WIN32_WCE)\r
+#include <windows.h>\r
+#define XP_WINCE\r
+#endif\r
+#endif\r
+\r
+/*other platforms should be setup through configure*/\r
+\r
+#endif\r
+\r
+\r
+void gf_node_setup(GF_Node *p, u32 tag);\r
+\r
+typedef struct _parent_list\r
+{\r
+       struct _parent_list *next;\r
+       GF_Node *node;\r
+} GF_ParentList;\r
+\r
+\r
+/*internal flag reserved for NodeID*/\r
+#define GF_NODE_IS_DEF                 0x80000000      // 1<<31\r
+/*internal flag reserved for activate/deactivate*/\r
+#define GF_NODE_IS_DEACTIVATED 0x40000000      // 1<<30\r
+/*internal flag reserved for node with scripting bindings*/\r
+#define GF_NODE_HAS_BINDING            0x20000000      // 1<<29\r
+\r
+#ifdef GF_CYCLIC_TRAVERSE_ON\r
+#define GF_NODE_IN_TRAVERSE            0x10000000      //      1<<28\r
+#define GF_NODE_INTERNAL_FLAGS 0xF0000000\r
+#else\r
+#define GF_NODE_INTERNAL_FLAGS 0xE0000000\r
+#endif\r
+\r
+struct _node_interactive_ext\r
+{\r
+       /*routes on eventOut, ISed routes, ... for VRML-based scene graphs\r
+       THIS IS DYNAMICALLY CREATED*/\r
+       GF_List *routes;\r
+\r
+#ifdef GPAC_HAS_SPIDERMONKEY\r
+       /*JS bindings if any - THIS IS DYNAMICALLY CREATED\r
+       This speeds up field modif notification (script bindings are listed here)*/\r
+       GF_List *bindings;\r
+#endif\r
+\r
+#ifndef GPAC_DISABLE_SVG\r
+       /*event listeners - THIS IS DYNAMICALLY CREATED*/\r
+       GF_DOMEventTarget *dom_evt;\r
+\r
+       /* SVG animations are registered in the target node  - THIS IS DYNAMICALLY CREATED*/\r
+       GF_List *animations;\r
+#endif\r
+\r
+};\r
+\r
+typedef struct _nodepriv\r
+{\r
+       /*node type*/\r
+       u16 tag;\r
+       /*number of instances of this node in the graph*/\r
+       u16 num_instances;\r
+       /*node flags*/\r
+       u32 flags;\r
+       /*scenegraph holding the node*/\r
+       struct __tag_scene_graph *scenegraph;\r
+\r
+       /*user defined callback function */\r
+       void (*UserCallback)(struct _base_node *node, void *render_stack, Bool node_destroy);\r
+       /*user defined stack*/\r
+       void *UserPrivate;\r
+\r
+       /*list of all parent nodes (needed to invalidate parent tree)*/\r
+       GF_ParentList *parents;\r
+       \r
+       /*holder for all interactive stuff - THIS IS DYNAMICALLY CREATED*/\r
+       struct _node_interactive_ext *interact;\r
+} NodePriv;\r
+\r
+\r
+typedef struct __tag_node_id\r
+{\r
+       struct __tag_node_id *next;\r
+       GF_Node *node;\r
+\r
+       /*node ID*/\r
+       u32 NodeID;\r
+       /*node def name*/\r
+       char *NodeName;\r
+} NodeIDedItem;\r
+\r
+typedef struct\r
+{\r
+       char *name;\r
+       char *qname;\r
+       u32 xmlns_id;\r
+} GF_XMLNS;\r
+\r
+struct __tag_scene_graph \r
+{\r
+       /*used to discriminate between node and scenegraph*/\r
+       u64 __reserved_null;\r
+\r
+       /*all DEF nodes (explicit)*/\r
+       NodeIDedItem *id_node, *id_node_last;\r
+\r
+       /*all routes available*/\r
+       GF_List *Routes;\r
+\r
+       /*all routes available*/\r
+       GF_List *exported_nodes;\r
+\r
+       /*when a proto is instanciated it creates its own scene graph. BIFS/VRML specify that the namespace is the same \r
+       (eg cannot reuse a NodeID or route name/ID), but this could be done differently by some other stds\r
+       if NULL this is the main scenegraph*/\r
+       struct _proto_instance *pOwningProto;\r
+\r
+       /*all first-level protos of the graph (the only ones that can be instanciated in this graph)*/\r
+       GF_List *protos;\r
+       /*all first-level protos of the graph not currently registered - memory handling of graph only*/\r
+       GF_List *unregistered_protos;\r
+\r
+       /*pointer to the root node*/\r
+       GF_Node *RootNode;\r
+\r
+       /*routes to be activated (cascade model). This is used at the top-level graph only (eg\r
+       proto routes use that too, ecept ISed fields). It is the app responsability to \r
+       correctly connect or browse scene graphs connected through Inline*/\r
+       GF_List *routes_to_activate;\r
+\r
+       /*since events may trigger deletion of objects we use a 2 step delete*/\r
+       GF_List *routes_to_destroy;\r
+\r
+       u32 simulation_tick;\r
+\r
+       /*user private data*/\r
+       void *userpriv;\r
+\r
+       /*callback routines*/\r
+       /*node callback*/\r
+       void (*NodeCallback)(void *user_priv, u32 type, GF_Node *node, void *ctxdata);\r
+       /*real scene time callback*/\r
+       Double (*GetSceneTime)(void *userpriv);\r
+\r
+       GF_SceneGraph *(*GetExternProtoLib)(void *userpriv, MFURL *lib_url);\r
+\r
+       /*parent scene if any*/\r
+       struct __tag_scene_graph *parent_scene;\r
+\r
+       /*size info and pixel metrics - this is not used internally, however it helps when rendering\r
+       and decoding modules don't know each-other (as in MPEG4)*/\r
+       u32 width, height;\r
+       Bool usePixelMetrics;\r
+\r
+       Bool modified;\r
+\r
+       /*application interface for javascript*/\r
+       gf_sg_script_action script_action;\r
+       void *script_action_cbck;\r
+\r
+       /*script loader*/\r
+       void (*script_load)(GF_Node *node);\r
+       /*callback to JS upon node modif*/\r
+       void (*on_node_modified)(struct __tag_scene_graph *sg, GF_Node *node, GF_FieldInfo *info, GF_Node *script);\r
+\r
+       u32 max_defined_route_id;\r
+\r
+       /*namespaces list. This list is used while parsing/dumping the tree to store the hierarchy of xmlns attributes in subtrees.\r
+       It is a stack of GF_XMLNS structures pushed/popped at each element*/\r
+       GF_List *ns;\r
+\r
+#ifdef GF_SELF_REPLACE_ENABLE\r
+       /*to detect replace scene from within conditionals*/\r
+       Bool graph_has_been_reset;\r
+#endif\r
+       /*global qp used in BIFS coding*/\r
+       GF_Node *global_qp;\r
+\r
+       /*use stack as used in the dom_fire_event - this is only valid during an event fire, and may be NULL*/\r
+       GF_List *use_stack;\r
+\r
+       /*temp storage for name conversions*/\r
+       char szNameBuffer[100];\r
+\r
+#ifndef GPAC_DISABLE_SVG\r
+       GF_DOMEventTarget dom_evt;\r
+       u32 nb_evts_focus;\r
+       u32 nb_evts_mouse;\r
+       u32 nb_evts_key;\r
+       u32 nb_evts_ui;\r
+       u32 nb_evts_text;\r
+       u32 nb_evts_smil;\r
+       u32 nb_evts_mutation;\r
+       u32 nb_evts_laser;\r
+       u32 nb_evts_mae;\r
+       u32 nb_evts_svg;\r
+       u32 dom_evt_filter;\r
+\r
+       GF_List *xlink_hrefs;\r
+       GF_List *smil_timed_elements;\r
+       GF_List *modified_smil_timed_elements;\r
+       Bool update_smil_timing;\r
+\r
+       /*listeners to add*/\r
+       GF_List *listeners_to_add;\r
+\r
+#ifdef GPAC_HAS_SPIDERMONKEY\r
+       struct __tag_svg_script_ctx *svg_js;\r
+#endif\r
+\r
+#endif\r
+\r
+#ifdef GPAC_HAS_SPIDERMONKEY\r
+       GF_List *scripts;\r
+       /*\r
+                       Note about reference counter\r
+\r
+         A DOM document (<=> scenegraph) may be created through javascript, and the JS object having created the \r
+         document may be destroyed while the document is still in use. Moreover with XMLHttpRequest, the\r
+         "associated" doc is re-created at each request, but the script may still refer to the original document.\r
+         Since the document doesn't have a fixed owner, a reference counter is use and the scenegraph is kept alive \r
+         until the last object using it is destroyed.\r
+\r
+       If this counter is set to 0 when creating DOM Elements/..., this means the scenegraph is hold by an external\r
+       entity (typically the player), and cannot be destroyed from the scripting engine\r
+       */\r
+       u32 reference_count;\r
+       /*DOM nodes*/\r
+       GF_List *objects;\r
+       /*DOM document*/\r
+       struct JSObject *document;\r
+\r
+       Bool dcci_doc;\r
+#endif\r
+};\r
+\r
+void gf_sg_parent_setup(GF_Node *pNode);\r
+void gf_sg_parent_reset(GF_Node *pNode);\r
+\r
+void *gf_node_get_name_address(GF_Node*node);\r
+\r
+void gf_node_changed_internal(GF_Node *node, GF_FieldInfo *field, Bool notify_scripts);\r
+\r
+struct _route\r
+{\r
+       u8 is_setup;\r
+       /*set to true for proto IS fields*/\r
+       u8 IS_route;\r
+\r
+       u32 ID;\r
+       char *name;\r
+\r
+       GF_Node *FromNode;\r
+       GF_FieldInfo FromField;\r
+\r
+       GF_Node *ToNode;\r
+       GF_FieldInfo ToField;\r
+\r
+       /*scope of this route*/\r
+       GF_SceneGraph *graph;\r
+       u32 lastActivateTime;\r
+};\r
+\r
+void gf_sg_route_unqueue(GF_SceneGraph *sg, GF_Route *r);\r
+/*returns TRUE if route modified destination node*/\r
+Bool gf_sg_route_activate(GF_Route *r);\r
+void gf_sg_route_queue(GF_SceneGraph *pSG, GF_Route *r);\r
+\r
+void gf_sg_destroy_routes(GF_SceneGraph *sg);\r
+\r
+void gf_sg_route_setup(GF_Route *r);\r
+\r
+\r
+/*MPEG4 def*/\r
+GF_Node *gf_sg_mpeg4_node_new(u32 NodeTag);\r
+u32 gf_sg_mpeg4_node_get_child_ndt(GF_Node *node);\r
+GF_Err gf_sg_mpeg4_node_get_field_index(GF_Node *node, u32 inField, u8 code_mode, u32 *fieldIndex);\r
+GF_Err gf_sg_mpeg4_node_get_field(GF_Node *node, GF_FieldInfo *field);\r
+u32 gf_sg_mpeg4_node_get_field_count(GF_Node *node, u8 code_mode);\r
+void gf_sg_mpeg4_node_del(GF_Node *node);\r
+const char *gf_sg_mpeg4_node_get_class_name(u32 NodeTag);\r
+Bool gf_sg_mpeg4_node_get_aq_info(GF_Node *node, u32 FieldIndex, u8 *QType, u8 *AType, Fixed *b_min, Fixed *b_max, u32 *QT13_bits);\r
+s32 gf_sg_mpeg4_node_get_field_index_by_name(GF_Node *node, char *name);\r
+\r
+/*X3D def*/\r
+GF_Node *gf_sg_x3d_node_new(u32 NodeTag);\r
+GF_Err gf_sg_x3d_node_get_field(GF_Node *node, GF_FieldInfo *field);\r
+u32 gf_sg_x3d_node_get_field_count(GF_Node *node);\r
+void gf_sg_x3d_node_del(GF_Node *node);\r
+const char *gf_sg_x3d_node_get_class_name(u32 NodeTag);\r
+s32 gf_sg_x3d_node_get_field_index_by_name(GF_Node *node, char *name);\r
+\r
+Bool gf_x3d_get_node_type(u32 NDT_Tag, u32 NodeTag);\r
+\r
+void gf_sg_mfint32_del(MFInt32 par);\r
+void gf_sg_mffloat_del(MFFloat par);\r
+void gf_sg_mfdouble_del(MFDouble par);\r
+void gf_sg_mfbool_del(MFBool par);\r
+void gf_sg_mfcolor_del(MFColor par);\r
+void gf_sg_mfcolor_rgba_del(MFColorRGBA par);\r
+void gf_sg_mfrotation_del(MFRotation par);\r
+void gf_sg_mfstring_del(MFString par);\r
+void gf_sg_mftime_del(MFTime par);\r
+void gf_sg_mfvec2f_del(MFVec2f par);\r
+void gf_sg_mfvec3f_del(MFVec3f par);\r
+void gf_sg_mfvec4f_del(MFVec4f par);\r
+void gf_sg_mfvec2d_del(MFVec2d par);\r
+void gf_sg_mfvec3d_del(MFVec3d par);\r
+void gf_sg_sfimage_del(SFImage im);\r
+void gf_sg_sfstring_del(SFString par);\r
+void gf_sg_mfscript_del(MFScript sc);\r
+void gf_sg_sfcommand_del(SFCommandBuffer cb);\r
+void gf_sg_sfurl_del(SFURL url);\r
+\r
+Bool gf_sg_vrml_node_init(GF_Node *node);\r
+Bool gf_sg_vrml_node_changed(GF_Node *node, GF_FieldInfo *field);\r
+\r
+\r
+/*specialized node unregister for Memory Commands - checks if the node(s) used in the command have been destroyed\r
+during the reset. If so don't attempt to unregister the node*/\r
+GF_Err gf_node_try_destroy(GF_SceneGraph *sg, GF_Node *pNode, GF_Node *parentNode);\r
+\r
+\r
+#ifndef GPAC_DISABLE_SVG\r
+\r
+\r
+/* reset functions for SVG types */\r
+void gf_svg_reset_path(SVG_PathData path);\r
+void gf_svg_reset_iri(GF_SceneGraph *sg, XMLRI*iri);\r
+/* delete functions for SVG types */\r
+void gf_svg_delete_paint               (GF_SceneGraph *sg, SVG_Paint *paint);\r
+void gf_smil_delete_times              (GF_List *l);\r
+void gf_svg_delete_points              (GF_List *l);\r
+void gf_svg_delete_coordinates (GF_List *l);\r
+/*for keyTimes, keyPoints and keySplines*/\r
+void gf_smil_delete_key_types  (GF_List *l);\r
+\r
+u32 gf_node_get_attribute_count(GF_Node *node);\r
+GF_Err gf_node_get_attribute_info(GF_Node *node, GF_FieldInfo *info) ;\r
+\r
+\r
+/*SMIL anim tools*/\r
+\r
+typedef struct __xlink_attrip_ptrs {\r
+       XMLRI *href;\r
+       SVG_ContentType *type;\r
+       SVG_String *title;\r
+       XMLRI *arcrole; \r
+       XMLRI *role;\r
+       SVG_String *show;\r
+       SVG_String *actuate;\r
+} XLinkAttributesPointers;\r
+\r
+typedef struct __smil_time_attrip_ptrs {\r
+       SMIL_Times *begin, *end;\r
+       SVG_Clock *clipBegin, *clipEnd;\r
+       SMIL_Duration *dur;\r
+       SMIL_RepeatCount *repeatCount;\r
+       SMIL_Duration *repeatDur;\r
+       SMIL_Restart *restart;\r
+       SMIL_Fill *fill;\r
+       SMIL_Duration *max;\r
+       SMIL_Duration *min;\r
+       struct _smil_timing_rti *runtime; /* contains values for runtime handling of the SMIL timing */\r
+} SMILTimingAttributesPointers;\r
+\r
+typedef struct __smil_sync_attrip_ptrs {\r
+       SMIL_SyncBehavior *syncBehavior, *syncBehaviorDefault;\r
+       SMIL_SyncTolerance *syncTolerance, *syncToleranceDefault;\r
+       SVG_Boolean *syncMaster;\r
+       XMLRI *syncReference;\r
+} SMILSyncAttributesPointers;\r
+\r
+typedef struct __smil_anim_attrip_ptrs {\r
+       SMIL_AttributeName *attributeName; \r
+       SMIL_AttributeType *attributeType;\r
+       SMIL_AnimateValue *to, *by, *from;\r
+       SMIL_AnimateValues *values;\r
+       SMIL_CalcMode *calcMode;\r
+       SMIL_Accumulate *accumulate;\r
+       SMIL_Additive *additive;\r
+       SMIL_KeySplines *keySplines;\r
+       SMIL_KeyTimes *keyTimes;\r
+       SVG_TransformType *type;\r
+       SVG_Boolean *lsr_enabled;\r
+\r
+       SMIL_KeyPoints *keyPoints;\r
+       SVG_String *origin;\r
+       SVG_Rotate *rotate;\r
+       SVG_PathData *path;\r
+} SMILAnimationAttributesPointers;\r
+\r
+\r
+typedef struct {\r
+       GF_DOM_BASE_NODE\r
+\r
+       /*shortcuts for xlink, anim, timing attributes*/\r
+       XLinkAttributesPointers *xlinkp;\r
+       SMILAnimationAttributesPointers *animp;\r
+       SMILTimingAttributesPointers *timingp;\r
+} SVGTimedAnimBaseElement;\r
+\r
+GF_Err gf_node_animation_add(GF_Node *node, void *animation);\r
+GF_Err gf_node_animation_del(GF_Node *node);\r
+u32 gf_node_animation_count(GF_Node *node);\r
+void *gf_node_animation_get(GF_Node *node, u32 i);\r
+Bool gf_svg_is_inherit(GF_FieldInfo *a);\r
+Bool gf_svg_is_current_color(GF_FieldInfo *a);\r
+\r
+void gf_svg_reset_animate_values(SMIL_AnimateValues anim_values, GF_SceneGraph *sg);\r
+void gf_svg_reset_animate_value(SMIL_AnimateValue anim_value, GF_SceneGraph *sg);\r
+\r
+Bool gf_svg_is_timing_tag(u32 tag);\r
+Bool gf_svg_is_animation_tag(u32 tag);\r
+u32 gf_svg_get_modification_flags(SVG_Element *n, GF_FieldInfo *info);\r
+\r
+Bool gf_svg_resolve_smil_times(GF_Node *anim, void *event_base_element, GF_List *smil_times, Bool is_end, const char *node_name);\r
+\r
+\r
+/* SMIL Timing structures */\r
+/* status of an SMIL timed element */ \r
+enum {\r
+       SMIL_STATUS_WAITING_TO_BEGIN = 0,\r
+       SMIL_STATUS_ACTIVE,\r
+       SMIL_STATUS_POST_ACTIVE,\r
+       SMIL_STATUS_FROZEN,\r
+       SMIL_STATUS_DONE\r
+};\r
+\r
+typedef struct {\r
+       u32 activation_cycle;\r
+       u32 nb_iterations;\r
+\r
+       /* for the case where min > simple duration*/\r
+       Bool min_active;\r
+\r
+       /* negative values mean indefinite */\r
+       Double begin, \r
+                  end,\r
+                  simple_duration, \r
+                  active_duration,\r
+                  repeat_duration;\r
+\r
+} SMIL_Interval;\r
+\r
+struct _smil_timing_rti\r
+{\r
+       GF_Node *timed_elt;\r
+       SMILTimingAttributesPointers *timingp;\r
+\r
+       Double scene_time;\r
+       Fixed normalized_simple_time;\r
+       Bool force_reevaluation;\r
+\r
+       /* SMIL element life-cycle status */\r
+       u8 status;\r
+\r
+       SMIL_Interval *current_interval;\r
+       SMIL_Interval *next_interval;\r
+\r
+       /* Evaluation of animations is postponed untill tree traversal, so that inherit values can be computed\r
+       Other timed elements (audio, video, animation) are evaluated directly and do not require\r
+       scene tree traversal.*/\r
+       Bool postpone;\r
+\r
+       void (*evaluate)(struct _smil_timing_rti *rti, Fixed normalized_simple_time, u32 state);\r
+       u32 evaluate_status;\r
+\r
+#if 0\r
+       /* is called only when the timed element is active */\r
+       void (*activation)(struct _smil_timing_rti *rti, Fixed normalized_simple_time);\r
+\r
+       /* is called (possibly many times) when the timed element is frozen */\r
+       void (*freeze)(struct _smil_timing_rti *rti, Fixed normalized_simple_time);\r
+\r
+       /* is called (only once) when the timed element is restored */\r
+       void (*restore)(struct _smil_timing_rti *rti, Fixed normalized_simple_time);\r
+\r
+       /* is called only when the timed element is inactive and receives a fraction event, the second parameter is ignored */\r
+       void (*fraction_activation)(struct _smil_timing_rti *rti, Fixed normalized_simple_time);\r
+#endif\r
+       /* simulated normalized simple time */\r
+       Fixed fraction;\r
+\r
+       Bool paused;\r
+       Double media_duration;\r
+\r
+       /* shortcut when this rti corresponds to an animation */\r
+       struct _smil_anim_rti *rai;\r
+};\r
+\r
+void gf_smil_timing_init_runtime_info(GF_Node *timed_elt);\r
+void gf_smil_timing_delete_runtime_info(GF_Node *timed_elt, SMIL_Timing_RTI *rti);\r
+Fixed gf_smil_timing_get_normalized_simple_time(SMIL_Timing_RTI *rti, Double scene_time, Bool *force_end);\r
+/*returns 1 if an animation changed a value in the rendering tree */\r
+s32 gf_smil_timing_notify_time(SMIL_Timing_RTI *rti, Double scene_time);\r
+\r
+\r
+/* SMIL Animation Structures */\r
+/* This structure is used per animated attribute,\r
+   it contains:\r
+    - all the animations applying to the same attribute,\r
+    - the specified value before any inheritance has been applied nor any animation started \r
+           (as specified in the SVG document),\r
+    - the presentation value passed from one animation to the next one, at the same level in the tree\r
+       - a boolean indicating if the animated attribute is in fact a property\r
+   \r
+   and if the attribute is a property:\r
+       - a pointer to presentation value passed from the previous level in the tree\r
+       - a pointer to the value of the color property (for handling of 'currentColor'), from previous level in the tree\r
+       - the location of the attribute in the elt structure when it was created \r
+         (used for fast comparison of SVG properties when animating from/to/by/values/... inherited values)\r
+*/\r
+typedef struct {\r
+       GF_List *anims;\r
+       GF_FieldInfo specified_value;\r
+       GF_FieldInfo presentation_value;\r
+       Bool is_property;\r
+       GF_FieldInfo parent_presentation_value;\r
+       GF_FieldInfo current_color_value;\r
+       void *orig_dom_ptr;\r
+       /* flag set by any animation to inform other animations that there base value has changed */\r
+       Bool presentation_value_changed;\r
+       /* flag used for rendering */\r
+       u32 dirty_flags;\r
+       Bool dirty_parents;\r
+} SMIL_AttributeAnimations;\r
+\r
+/* This structure is per animation element, \r
+   it holds the result of the animation and \r
+   some info to make animation computation faster */\r
+typedef struct _smil_anim_rti {\r
+       SMIL_AttributeAnimations *owner;\r
+\r
+       Bool is_first_anim;\r
+\r
+       /* animation element */\r
+       GF_Node *anim_elt;\r
+       SMILAnimationAttributesPointers *animp;\r
+       SMILTimingAttributesPointers *timingp;\r
+       XLinkAttributesPointers *xlinkp;\r
+\r
+       /* in case of animateTransform without from or to, the underlying value is the identity transform */\r
+       GF_Matrix2D identity;\r
+       GF_FieldInfo default_transform_value;\r
+\r
+       /* result of the animation */\r
+       GF_FieldInfo interpolated_value;\r
+\r
+       /* last value of the animation, used in accumulation phase */\r
+       /* normally the far pointer in the last specified value is a pointer to a real attribute value,\r
+          and there's no need to allocate a new value. Except if the last specified value is the last \r
+          point in a path (animateMotion) in which case we allocate a matrix as last spec value,\r
+          which we need to delete (see animate-elem-202-t.svg). This is signaled if rai->path is not NULL*/\r
+       GF_FieldInfo last_specified_value;\r
+\r
+       /* temporary value needed when the type of \r
+          the key values is different from the target attribute type */\r
+       GF_FieldInfo tmp_value;\r
+\r
+       /* the number of values in animations should be constant (unless updated with LASeR commands) \r
+          we can store them to avoid computing them at each cycle */\r
+       u32 values_count;\r
+       u32 key_times_count;\r
+       u32 key_points_count;\r
+       u32 key_splines_count;\r
+\r
+\r
+       /* In change detection mode, we test previous animation parameters to determine \r
+          if a new evaluation of the animation will produce a different result. \r
+          The result of these test is stored in interpolated_value_changed */\r
+       Bool    change_detection_mode;\r
+       Bool    interpolated_value_changed;\r
+       s32             previous_key_index;\r
+       u32             previous_keytime_index;\r
+       Fixed   previous_coef;\r
+       s32             previous_iteration;\r
+       Bool    anim_done;\r
+\r
+       GF_Path *path;\r
+       u8 rotate;\r
+       GF_PathIterator *path_iterator;\r
+       Fixed length;\r
+\r
+} SMIL_Anim_RTI;\r
+\r
+void gf_smil_anim_init_node(GF_Node *node);\r
+void gf_smil_anim_init_discard(GF_Node *node);\r
+void gf_smil_anim_init_runtime_info(GF_Node *node);\r
+void gf_smil_anim_delete_runtime_info(SMIL_Anim_RTI *rai);\r
+void gf_smil_anim_delete_animations(GF_Node *e);\r
+void gf_smil_anim_remove_from_target(GF_Node *anim, GF_Node *target);\r
+\r
+void gf_sg_handle_dom_event(GF_Node *hdl, GF_DOM_Event *event, GF_Node *observer);\r
+void gf_smil_setup_events(GF_Node *node);\r
+\r
+void gf_smil_anim_reset_variables(SMIL_Anim_RTI *rai);\r
+void gf_smil_anim_set_anim_runtime_in_timing(GF_Node *n);\r
+\r
+void gf_smil_timing_pause(GF_Node *node);\r
+void gf_smil_timing_resume(GF_Node *node);\r
+\r
+#endif\r
+\r
+\r
+//\r
+//             MF Fields tools\r
+//     WARNING: MF / SF Nodes CANNOT USE THESE FUNCTIONS\r
+//\r
+\r
+//return the size (in bytes) of fixed fields (buffers are handled as a char ptr , 1 byte)\r
+u32 gf_sg_vrml_get_sf_size(u32 FieldType);\r
+\r
+\r
+/*BASE node (GF_Node) destructor*/\r
+void gf_node_free(GF_Node *node);\r
+\r
+/*node destructor dispatcher: redirects destruction for each graph type: VRML/MPEG4, X3D, SVG...)*/\r
+void gf_node_del(GF_Node *node);\r
+\r
+/*creates an undefined GF_Node - for parsing only*/\r
+GF_Node *gf_sg_new_base_node();\r
+\r
+/*returns field type from its name*/\r
+u32 gf_sg_field_type_by_name(char *fieldType);\r
+\r
+\r
+\r
+/*\r
+                       Proto node\r
+\r
+*/\r
+\r
+/*field interface to codec. This is used to do the node decoding, index translation\r
+and all QP/BIFS Anim parsing. */\r
+struct _protofield\r
+{\r
+       u8 EventType;\r
+       u8 FieldType;\r
+       /*if UseName, otherwise fieldN*/\r
+       char *FieldName;\r
+\r
+       /*default field value*/\r
+       void *def_value;\r
+       \r
+       GF_Node *def_sfnode_value;\r
+       GF_ChildNodeItem *def_mfnode_value;\r
+\r
+       /*coding indexes*/\r
+       u32 IN_index, OUT_index, DEF_index, ALL_index;\r
+\r
+       /*Quantization*/\r
+       u32 QP_Type, hasMinMax;\r
+       void *qp_min_value, *qp_max_value;\r
+       /*this is for QP=13 only*/\r
+       u32 NumBits;\r
+\r
+       /*Animation*/\r
+       u32 Anim_Type;\r
+\r
+       void *userpriv;\r
+       void (*OnDelete)(void *ptr);\r
+};\r
+\r
+GF_ProtoFieldInterface *gf_sg_proto_new_field_interface(u32 FieldType);\r
+\r
+/*set QP and anim info for a proto field (BIFS allows for that in proto coding)*/\r
+GF_Err gf_bifs_proto_field_set_aq_info(GF_ProtoFieldInterface *field, u32 QP_Type, u32 hasMinMax, u32 QPSFType, void *qp_min_value, void *qp_max_value, u32 QP13_NumBits);\r
+\r
+/*proto field instance. since it is useless to duplicate all coding info, names and the like\r
+we seperate proto declaration and proto instanciation*/\r
+typedef struct \r
+{\r
+       u8 EventType;\r
+       u8 FieldType;\r
+       u8 has_been_accessed;\r
+       void *field_pointer;\r
+} GF_ProtoField;\r
+\r
+\r
+struct _proto\r
+{\r
+       /*1 - Prototype interface*/\r
+       u32 ID;\r
+       char *Name;\r
+       GF_List *proto_fields;\r
+\r
+       /*pointer to parent scene graph*/\r
+       struct __tag_scene_graph *parent_graph;\r
+       /*pointer to proto scene graph*/\r
+       struct __tag_scene_graph *sub_graph;\r
+\r
+       /*2 - proto implementation as declared in the bitstream*/\r
+       GF_List *node_code;\r
+\r
+       /*num fields*/\r
+       u32 NumIn, NumOut, NumDef, NumDyn;\r
+\r
+       void *userpriv;\r
+       void (*OnDelete)(void *ptr);\r
+\r
+       /*URL of extern proto lib (if none, URL is empty)*/\r
+       MFURL ExternProto;\r
+\r
+       /*list of instances*/\r
+       GF_List *instances;\r
+};\r
+\r
+/*proto field API*/\r
+u32 gf_sg_proto_get_num_fields(GF_Node *node, u8 code_mode);\r
+GF_Err gf_sg_proto_get_field(GF_Proto *proto, GF_Node *node, GF_FieldInfo *field);\r
+\r
+\r
+typedef struct _proto_instance\r
+{\r
+       /*this is a node*/\r
+       BASE_NODE\r
+\r
+       /*Prototype interface for coding and field addressing*/\r
+       GF_Proto *proto_interface;\r
+\r
+       /*proto implementation at run-time (aka the state of the nodes may differ accross\r
+       different instances of the proto)*/\r
+       GF_List *fields;\r
+\r
+       /*a proto doesn't have one root SFnode but a collection of nodes for implementation*/\r
+       GF_List *node_code;\r
+\r
+       /*node for proto rendering, first of all declared nodes*/\r
+       GF_Node *RenderingNode;\r
+\r
+       /*in case the PROTO is destroyed*/\r
+       char *proto_name;\r
+\r
+       /*scripts are loaded once all IS routes are activated and node code is loaded*/\r
+       GF_List *scripts_to_load;\r
+\r
+       Bool is_loaded;\r
+} GF_ProtoInstance;\r
+\r
+/*destroy proto*/\r
+void gf_sg_proto_del_instance(GF_ProtoInstance *inst);\r
+GF_Err gf_sg_proto_get_field_index(GF_ProtoInstance *proto, u32 index, u32 code_mode, u32 *all_index);\r
+Bool gf_sg_proto_get_aq_info(GF_Node *Node, u32 FieldIndex, u8 *QType, u8 *AType, Fixed *b_min, Fixed *b_max, u32 *QT13_bits);\r
+GF_Err gf_sg_proto_get_field_ind_static(GF_Node *Node, u32 inField, u8 IndexMode, u32 *allField);\r
+GF_Node *gf_sg_proto_create_node(GF_SceneGraph *scene, GF_Proto *proto, GF_ProtoInstance *from_inst);\r
+void gf_sg_proto_instanciate(GF_ProtoInstance *proto_node);\r
+\r
+/*get tag of first node in proto code - used for validation only*/\r
+u32 gf_sg_proto_get_root_tag(GF_Proto *proto);\r
+\r
+\r
+/*to call when a proto field has been modified (at creation or through commands, modifications through events \r
+are handled internally).\r
+node can be the proto instance or a node from the proto code\r
+this will call NodeChanged if needed, forward to proto/node or trigger any route if needed*/\r
+void gf_sg_proto_propagate_event(GF_Node *node, u32 fieldIndex, GF_Node *from_node);\r
+\r
+s32 gf_sg_proto_get_field_index_by_name(GF_Proto *proto, GF_Node *node, char *name);\r
+\r
+GF_Node *gf_vrml_node_clone(GF_SceneGraph *inScene, GF_Node *orig, GF_Node *cloned_parent, char *inst_id_suffix);\r
+\r
+\r
+/*\r
+               Script node\r
+*/\r
+\r
+typedef struct \r
+{\r
+       //extra script fields\r
+       GF_List *fields;\r
+\r
+       //BIFS coding stuff\r
+       u32 numIn, numDef, numOut;\r
+\r
+#ifdef GPAC_HAS_SPIDERMONKEY\r
+       struct JSContext *js_ctx;\r
+       struct JSObject *js_obj;\r
+       struct JSObject *js_browser;\r
+       /*all attached objects (eg, not created by the script) are stored here so that we don't\r
+       allocate them again and again when getting properties. Garbage collection is performed (if needed)\r
+       on these objects after each eventIn execution*/\r
+       GF_List *js_cache;\r
+       struct JSObject *event;\r
+#endif\r
+\r
+       void (*JS_PreDestroy)(GF_Node *node);\r
+       void (*JS_EventIn)(GF_Node *node, GF_FieldInfo *in_field);\r
+\r
+       Bool is_loaded;\r
+} GF_ScriptPriv;\r
+\r
+/*setup script stack*/\r
+void gf_sg_script_init(GF_Node *node);\r
+/*get script field*/\r
+GF_Err gf_sg_script_get_field(GF_Node *node, GF_FieldInfo *info);\r
+/*get effective field count per event mode*/\r
+u32 gf_sg_script_get_num_fields(GF_Node *node, u8 IndexMode);\r
+/*translate field index from inMode to ALL mode*/\r
+GF_Err gf_sg_script_get_field_index(GF_Node *Node, u32 inField, u8 IndexMode, u32 *allField);\r
+/*create dynamic fields in the clone*/\r
+GF_Err gf_sg_script_prepare_clone(GF_Node *dest, GF_Node *orig);\r
+\r
+struct _scriptfield\r
+{\r
+       u32 eventType;\r
+       u32 fieldType;\r
+       char *name;\r
+\r
+       s32 IN_index, OUT_index, DEF_index;\r
+       u32 ALL_index;\r
+\r
+       //real field\r
+       void *pField;\r
+\r
+       Double last_route_time;\r
+       Bool activate_event_out;\r
+};\r
+\r
+\r
+#ifdef GPAC_HAS_SPIDERMONKEY\r
+\r
+\r
+#include <gpac/download.h>\r
+#include <gpac/network.h>\r
+\r
+\r
+#define JS_SETUP_CLASS(the_class, cname, flag, getp, setp, fin)        \\r
+       memset(&the_class, 0, sizeof(the_class));       \\r
+       the_class.name = cname; \\r
+       the_class.flags = flag; \\r
+       the_class.addProperty = JS_PropertyStub;        \\r
+       the_class.delProperty = JS_PropertyStub;        \\r
+       the_class.getProperty = getp;   \\r
+       the_class.setProperty = setp;   \\r
+       the_class.enumerate = JS_EnumerateStub; \\r
+       the_class.resolve = JS_ResolveStub;             \\r
+       the_class.convert = JS_ConvertStub;             \\r
+       the_class.finalize = fin;       \\r
+       the_class.hasInstance = js_has_instance;\r
+\r
+typedef struct\r
+{\r
+       GF_Node *node;\r
+       GF_DownloadSession *sess;\r
+} JSFileDownload;\r
+\r
+struct JSContext *gf_sg_ecmascript_new(GF_SceneGraph *sg);\r
+void gf_sg_ecmascript_del(struct JSContext *);\r
+\r
+void gf_sg_script_init_sm_api(GF_ScriptPriv *sc, GF_Node *script);\r
+\r
+typedef struct \r
+{\r
+       GF_FieldInfo field;\r
+       GF_Node *owner;\r
+       struct JSObject *obj;\r
+\r
+       /*JS list for MFFields or NULL*/\r
+       struct JSObject *js_list;\r
+\r
+       /*when creating SFnode from inside the script, the node is stored here untill attached to an object*/\r
+       GF_Node *temp_node;\r
+       /*when creating MFnode from inside the script, the node list is stored here untill attached to an object*/\r
+       GF_ChildNodeItem *temp_list;\r
+       /*when not owned by a node*/\r
+       void *field_ptr;\r
+       \r
+       /*cpontext in which the field was created*/\r
+       struct JSContext *js_ctx;\r
+} GF_JSField;\r
+\r
+#ifndef GPAC_DISABLE_SVG\r
+void JSScript_LoadSVG(GF_Node *node);\r
+\r
+typedef struct __tag_svg_script_ctx \r
+{\r
+       Bool (*script_execute)(struct __tag_scene_graph *sg, char *utf8_script, GF_DOM_Event *event);\r
+       Bool (*handler_execute)(GF_Node *n, GF_DOM_Event *event, GF_Node *observer);\r
+       u32 nb_scripts;\r
+       /*global script context for the scene*/\r
+       struct JSContext *js_ctx;\r
+       /*global object*/\r
+       struct JSObject *global;\r
+       /*global event object - used to update the associated DOMEvent (JS private stack) when dispatching events*/\r
+       struct JSObject *event;\r
+} GF_SVGJS;\r
+\r
+#endif /*GPAC_DISABLE_SVG*/\r
+\r
+/*initialize DOM Core (subset) + xmlHTTPRequest API. The global object MUST have private data storage\r
+and its private data MUST be a scenegraph. This scenegraph is only used to create new documents\r
+and setup the callback pointers*/\r
+void dom_js_load(GF_SceneGraph *scene, struct JSContext *c, struct JSObject *global);\r
+/*unloads the DOM core support (to be called upon destruction only, once the JSContext has been destroyed\r
+to releases all resources used by DOM JS)*/\r
+void dom_js_unload();\r
+\r
+/*defines a new global object "document" of type Document*/\r
+void dom_js_define_document(struct JSContext *c, struct JSObject *global, GF_SceneGraph *doc);\r
+/*defines a new global object "evt" of type Event*/\r
+struct JSObject *dom_js_define_event(struct JSContext *c, struct JSObject *global);\r
+\r
+struct JSObject *gf_dom_new_event(struct JSContext *c);\r
+\r
+struct JSObject *dom_js_get_node_proto(struct JSContext *c);\r
+struct JSObject *dom_js_get_element_proto(struct JSContext *c);\r
+struct JSObject *dom_js_get_document_proto(struct JSContext *c);\r
+struct JSObject *dom_js_get_event_proto(struct JSContext *c);\r
+\r
+void dom_set_class_selector(struct JSContext *c, /*struct JSClass*/void *(*get_element_class)(GF_Node *n), /*struct JSClass*/void *(*get_document_class)(GF_SceneGraph *n) );\r
+\r
+enum\r
+{\r
+       GF_DOM_EXC_INDEX_SIZE_ERR = 1,\r
+       GF_DOM_EXC_DOMSTRING_SIZE_ERR = 2,\r
+       GF_DOM_EXC_HIERARCHY_REQUEST_ERR = 3,\r
+       GF_DOM_EXC_WRONG_DOCUMENT_ERR = 4,\r
+       GF_DOM_EXC_INVALID_CHARACTER_ERR = 5,\r
+       GF_DOM_EXC_NO_DATA_ALLOWED_ERR = 6,\r
+       GF_DOM_EXC_NO_MODIFICATION_ALLOWED_ERR = 7,\r
+       GF_DOM_EXC_NOT_FOUND_ERR = 8,\r
+       GF_DOM_EXC_NOT_SUPPORTED_ERR = 9,\r
+       GF_DOM_EXC_INUSE_ATTRIBUTE_ERR = 10,\r
+       GF_DOM_EXC_INVALID_STATE_ERR = 11,\r
+       GF_DOM_EXC_SYNTAX_ERR = 12,\r
+       GF_DOM_EXC_INVALID_MODIFICATION_ERR = 13,\r
+       GF_DOM_EXC_NAMESPACE_ERR = 14,\r
+       GF_DOM_EXC_INVALID_ACCESS_ERR = 15,\r
+       GF_DOM_EXC_VALIDATION_ERR = 16,\r
+       GF_DOM_EXC_TYPE_MISMATCH_ERR = 17,\r
+};\r
+\r
+int dom_throw_exception(struct JSContext *c, u32 code);\r
+\r
+void gf_sg_handle_dom_event_for_vrml(GF_Node *hdl, GF_DOM_Event *event, GF_Node *observer);\r
+\r
+void gf_sg_load_script_extensions(GF_SceneGraph *sg, struct JSContext *c, struct JSObject *obj, Bool unload);\r
+\r
+#endif /*GPAC_HAS_SPIDERMONKEY*/\r
+\r
+GF_Err gf_sg_reload_xml_doc(const char *src, GF_SceneGraph *scene);\r
+\r
+SVG_Element *gf_svg_create_node(u32 tag);\r
+Bool gf_svg_node_init(GF_Node *node);\r
+void gf_svg_node_del(GF_Node *node);\r
+Bool gf_svg_node_changed(GF_Node *node, GF_FieldInfo *field);\r
+const char *gf_xml_get_element_name(GF_Node *node);\r
+\r
+SVGAttribute *gf_node_create_attribute_from_datatype(u32 data_type, u32 attribute_tag);\r
+\r
+GF_Err gf_node_get_attribute_by_name(GF_Node *node, char *name, u32 xmlns_code, Bool create_if_not_found, Bool set_default, GF_FieldInfo *field);\r
+void *gf_svg_get_property_pointer_from_tag(SVGPropertiesPointers *output_property_context, u32 prop_tag);\r
+void *gf_svg_get_property_pointer(SVG_Element *elt, void *input_attribute,\r
+                                                                  SVGPropertiesPointers *output_property_context);\r
+\r
+Bool gf_svg_is_property(GF_Node *node, GF_FieldInfo *target_attribute);\r
+\r
+/*exported for LASeR paring*/\r
+u32 svg_parse_point(SVG_Point *p, char *value_string);\r
+\r
+/*activates node. This is used by LASeR:activate and whenever a node is inserted in the scene\r
+through DOM*/\r
+GF_Err gf_node_activate(GF_Node *node);\r
+/*deactivates node. This is used by LASeR:deactivate and whenever a node is removed from the scene\r
+through DOM*/\r
+GF_Err gf_node_deactivate(GF_Node *node);\r
+\r
+/*post a listener to be added - this is only used by LASeR:activate and DOM.addEventListener. This \r
+is to ensure that when a node is processing an event creating a new listener on this node, this listener\r
+will not be triggered*/\r
+void gf_dom_listener_post_add(GF_Node *obs, GF_Node *listener);\r
+/*process all pending add_listener request*/\r
+void gf_dom_listener_process_add(GF_SceneGraph *sg);\r
+\r
+\r
+void gf_node_delete_attributes(GF_Node *node);\r
+\r
+\r
+typedef GF_DOMNode XBL_Element;\r
+const char *gf_xbl_get_element_name(u32 tag);\r
+u32 gf_xbl_get_element_tag(const char *element_name);\r
+XBL_Element *gf_xbl_create_node(u32 ElementTag);\r
+u32 gf_xbl_get_attribute_tag(u32 element_tag, const char *attribute_name);\r
+GF_DOMAttribute *gf_xbl_create_attribute(GF_DOMNode *elt, u32 tag);\r
+\r
+\r
+GF_Node *gf_xml_node_clone(GF_SceneGraph *inScene, GF_Node *orig, GF_Node *cloned_parent, char *inst_id, Bool deep);\r
+\r
+GF_Err gf_dom_listener_del(GF_Node *listener, GF_DOMEventTarget *target);\r
+\r
+GF_DOMHandler *gf_dom_listener_build_ex(GF_Node *node, u32 event_type, u32 event_parameter, GF_Node *handler, GF_Node **out_listener);\r
+\r
+\r
+#endif /*_GF_SCENEGRAPH_DEV_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/internal/swf_dev.h b/tstools/DtsEdit/src/gpac/internal/swf_dev.h
new file mode 100644 (file)
index 0000000..798ac3e
--- /dev/null
@@ -0,0 +1,361 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / Scene Management sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_SWF_DEV_H_\r
+#define _GF_SWF_DEV_H_\r
+\r
+#include <gpac/scene_manager.h>\r
+#include <gpac/color.h>\r
+\r
+#define SWF_TWIP_SCALE                         (1/20.0f)\r
+\r
+\r
+typedef struct SWFReader SWFReader;\r
+typedef struct SWFSound SWFSound;\r
+typedef struct SWFText SWFText;\r
+typedef struct SWFEditText SWFEditText;\r
+typedef struct SWF_Button SWF_Button;\r
+typedef struct SWFShape SWFShape;\r
+typedef struct SWFFont SWFFont;\r
+typedef struct SWFAction SWFAction;\r
+\r
+enum\r
+{\r
+       SWF_PLACE ,\r
+       SWF_REPLACE,\r
+       SWF_MOVE,\r
+};\r
+\r
+\r
+struct SWFReader\r
+{\r
+       GF_SceneLoader *load;\r
+       FILE *input;\r
+\r
+       char *localPath;\r
+       /*file header*/\r
+       u32 length;\r
+       char *mem;\r
+       u32 frame_rate;\r
+       u32 frame_count;\r
+       Fixed width, height;\r
+       Bool has_interact, no_as;\r
+\r
+       /*copy of the swf import flags*/        \r
+       u32 flags;\r
+\r
+       /*bit reader*/\r
+       GF_BitStream *bs;\r
+       GF_Err ioerr;   \r
+       \r
+       u32 current_frame;\r
+\r
+       /*current tag*/\r
+       u32 tag, size;\r
+\r
+       GF_List *display_list;\r
+       u32 max_depth;\r
+\r
+       /*defined fonts*/\r
+       GF_List *fonts;\r
+\r
+       /*define sounds*/\r
+       GF_List *sounds;\r
+\r
+       /*the one and only sound stream for current timeline*/\r
+       SWFSound *sound_stream;\r
+\r
+       /*when creating sprites: \r
+               1- all BIFS AUs in sprites are random access\r
+               2- depth is ignored in Sprites\r
+       */\r
+       u32 current_sprite_id;\r
+\r
+       /*the parser can decide to remove nearly aligned pppoints in lineTo sequences*/\r
+       /*flatten limit - 0 means no flattening*/\r
+       Fixed flat_limit;\r
+       /*number of points removed*/\r
+       u32 flatten_points;\r
+\r
+       u8 *jpeg_hdr;\r
+       u32 jpeg_hdr_size;\r
+\r
+\r
+       /*callback functions for translator*/\r
+       GF_Err (*set_backcol)(SWFReader *read, u32 xrgb);\r
+       GF_Err (*show_frame)(SWFReader *read);\r
+\r
+       /*checks if display list is large enough - returns 1 if yes, 0 otherwise (and allocate space)*/\r
+       Bool (*allocate_depth)(SWFReader *read, u32 depth); \r
+       GF_Err (*place_obj)(SWFReader *read, u32 depth, u32 ID, u32 prev_id, u32 type, GF_Matrix2D *mat, GF_ColorMatrix *cmat, GF_Matrix2D *prev_mat, GF_ColorMatrix *prev_cmat);\r
+       GF_Err (*remove_obj)(SWFReader *read, u32 depth, u32 ID);\r
+\r
+       GF_Err (*define_shape)(SWFReader *read, SWFShape *shape, SWFFont *parent_font, Bool last_sub_shape);\r
+       GF_Err (*define_sprite)(SWFReader *read, u32 nb_frames);\r
+       GF_Err (*define_text)(SWFReader *read, SWFText *text);\r
+       GF_Err (*define_edit_text)(SWFReader *read, SWFEditText *text);\r
+       /*@button is NULL to signal end of button declaration, non-null otherwise. "action" callback will be \r
+       called inbetween*/\r
+       GF_Err (*define_button)(SWFReader *read, SWF_Button *button);\r
+\r
+       GF_Err (*setup_image)(SWFReader *read, u32 ID, char *fileName);\r
+       /*called whenever a sound is found. For soundstreams, called twice, once on the header (declaration), \r
+       and one on the first soundstream block for offset signaling*/\r
+       GF_Err (*setup_sound)(SWFReader *read, SWFSound *snd, Bool soundstream_first_block);\r
+       GF_Err (*start_sound)(SWFReader *read, SWFSound *snd, Bool stop);\r
+       /*performs an action, returns 0 if action not supported*/\r
+       Bool (*action)(SWFReader *read, SWFAction *act);\r
+\r
+       void (*finalize)(SWFReader *read);\r
+\r
+\r
+       /* <BIFS conversion state> */\r
+\r
+       /*all simple appearances (no texture)*/\r
+       GF_List *apps;\r
+\r
+       GF_List *buttons;\r
+\r
+       /*current BIFS stream*/\r
+       GF_StreamContext *bifs_es;\r
+       GF_AUContext *bifs_au;\r
+\r
+       GF_StreamContext *bifs_dict_es;\r
+       GF_AUContext *bifs_dict_au;\r
+\r
+       /*for sound insert*/\r
+       GF_Node *root;\r
+\r
+       /*current OD AU*/\r
+       GF_StreamContext *od_es;\r
+       GF_AUContext *od_au;\r
+\r
+       GF_Node *cur_shape;\r
+       u16 prev_od_id, prev_es_id;\r
+\r
+       u32 wait_frame;\r
+       SWF_Button *btn;\r
+       GF_List *btn_over, *btn_not_over, *btn_active, *btn_not_active;\r
+\r
+       /* </BIFS conversion state> */\r
+};\r
+\r
+\r
+void swf_report(SWFReader *read, GF_Err e, char *format, ...);\r
+SWFFont *swf_find_font(SWFReader *read, u32 fontID);\r
+GF_Err swf_parse_sprite(SWFReader *read);\r
+\r
+\r
+GF_Err swf_to_bifs_init(SWFReader *read);\r
+\r
+\r
+\r
+typedef struct\r
+{\r
+       Fixed x, y;\r
+       Fixed w, h;\r
+} SWFRec;\r
+\r
+typedef struct\r
+{\r
+       /*0: not defined, otherwise index of shape*/\r
+       u32 nbType;\r
+       /*0: moveTo, 1: lineTo, 2: quad curveTo*/\r
+       u32 *types;\r
+       SFVec2f *pts;\r
+       u32 nbPts;\r
+       /*used by SWF->BIFS for IndexedCurveSet*/\r
+       u32 *idx;\r
+} SWFPath;\r
+\r
+typedef struct\r
+{\r
+       u32 type;\r
+       u32 solid_col;\r
+       u32 nbGrad;\r
+       u32 *grad_col;\r
+       u8 *grad_ratio;\r
+       GF_Matrix2D mat;\r
+       u32 img_id;\r
+       Fixed width;\r
+\r
+       SWFPath *path;\r
+} SWFShapeRec;\r
+\r
+struct SWFShape \r
+{\r
+       GF_List *fill_left, *fill_right, *lines;\r
+       u32 ID;\r
+       SWFRec rc;\r
+};\r
+\r
+/*SWF font object*/\r
+struct SWFFont\r
+{\r
+       u32 fontID;\r
+       u32 nbGlyphs;\r
+       GF_List *glyphs;\r
+\r
+       /*the following may all be overridden by a DefineFontInfo*/\r
+\r
+       /*index -> glyph code*/\r
+       u16 *glyph_codes;\r
+       /*index -> glyph advance*/\r
+       s16 *glyph_adv;\r
+\r
+       /*font flags (SWF 3.0)*/\r
+       Bool has_layout;\r
+       Bool has_shiftJIS;\r
+       Bool is_unicode, is_ansi;\r
+       Bool is_bold, is_italic;\r
+       s16 ascent, descent, leading;\r
+\r
+       /*font familly*/\r
+       char *fontName;\r
+};\r
+\r
+/*chunk of text with the same aspect (font, col)*/\r
+typedef struct\r
+{\r
+       u32 fontID;\r
+       u32 col;\r
+       /*font size*/\r
+       u32 fontSize;\r
+       /*origin point in local metrics*/\r
+       Fixed orig_x, orig_y;\r
+\r
+       u32 nbGlyphs;\r
+       u32 *indexes;\r
+       Fixed *dx;\r
+} SWFGlyphRec;\r
+\r
+struct SWFText\r
+{\r
+       u32 ID;\r
+       GF_Matrix2D mat;\r
+       GF_List *text;\r
+};\r
+\r
+struct SWFEditText \r
+{\r
+       u32 ID;\r
+       char *init_value;\r
+       SWFRec bounds;\r
+       Bool word_wrap, multiline, password, read_only, auto_size, no_select, html, outlines, has_layout, border;\r
+       u32 color;\r
+       Fixed max_length, font_height;\r
+       u32 fontID;\r
+\r
+       u32 align;\r
+       Fixed left, right, indent, leading;\r
+};\r
+\r
+\r
+enum\r
+{\r
+       SWF_SND_UNCOMP = 0,\r
+       SWF_SND_ADPCM,\r
+       SWF_SND_MP3\r
+};\r
+\r
+struct SWFSound\r
+{\r
+       u32 ID;\r
+       u8 format;\r
+       /*0: 5.5k - 1: 11k - 2: 22k - 3: 44k*/\r
+       u8 sound_rate;\r
+       u8 bits_per_sample;\r
+       Bool stereo;\r
+       u16 sample_count;\r
+       u32 frame_delay_ms;\r
+\r
+       /*IO*/\r
+       FILE *output;\r
+       char *szFileName;\r
+\r
+       /*set when sound is setup (OD inserted)*/\r
+       Bool is_setup;\r
+};\r
+\r
+typedef struct \r
+{\r
+       /*interaction states*/\r
+       Bool hitTest, down, over, up;\r
+       u32 character_id;\r
+       u16 depth;\r
+       GF_Matrix2D mx;\r
+       GF_ColorMatrix cmx;\r
+       Bool skip;\r
+} SWF_ButtonRecord;\r
+\r
+\r
+struct SWF_Button \r
+{\r
+       u32 count;\r
+       SWF_ButtonRecord buttons[40];\r
+       u32 ID;\r
+};\r
+\r
+/*AS codes.*/\r
+enum\r
+{\r
+       GF_SWF_AS3_GOTO_FRAME,\r
+       GF_SWF_AS3_GET_URL,\r
+       GF_SWF_AS3_NEXT_FRAME,\r
+       GF_SWF_AS3_PREV_FRAME,\r
+       GF_SWF_AS3_PLAY,\r
+       GF_SWF_AS3_STOP,\r
+       GF_SWF_AS3_TOGGLE_QUALITY,\r
+       GF_SWF_AS3_STOP_SOUNDS,\r
+       GF_SWF_AS3_WAIT_FOR_FRAME,\r
+       GF_SWF_AS3_SET_TARGET,\r
+       GF_SWF_AS3_GOTO_LABEL,\r
+};\r
+\r
+enum\r
+{\r
+       GF_SWF_COND_IDLE_TO_OVERDOWN = 1,\r
+       GF_SWF_COND_OUTDOWN_TO_IDLE = 1<<1,\r
+       GF_SWF_COND_OUTDOWN_TO_OVERDOWN = 1<<2,\r
+       GF_SWF_COND_OVERDOWN_TO_OUTDOWN = 1<<3,\r
+       GF_SWF_COND_OVERDOWN_TO_OUTUP = 1<<4,\r
+       GF_SWF_COND_OVERUP_TO_OVERDOWN = 1<<5,\r
+       GF_SWF_COND_OVERUP_TO_IDLE = 1<<6,\r
+       GF_SWF_COND_IDLE_TO_OVERUP = 1<<7,\r
+       GF_SWF_COND_OVERDOWN_TO_IDLE = 1<<8,\r
+};\r
+\r
+struct SWFAction\r
+{\r
+       u32 type;\r
+       u32 frame_number;\r
+       u32 button_mask, button_key;\r
+       /*target (geturl/set_target), label (goto_frame)*/\r
+       char *target;\r
+       char *url;\r
+};\r
+\r
+\r
+\r
+#endif /*_GF_SWF_DEV_H_*/\r
diff --git a/tstools/DtsEdit/src/gpac/internal/terminal_dev.h b/tstools/DtsEdit/src/gpac/internal/terminal_dev.h
new file mode 100644 (file)
index 0000000..a199064
--- /dev/null
@@ -0,0 +1,844 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / Stream Management sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_TERMINAL_DEV_H_\r
+#define _GF_TERMINAL_DEV_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+\r
+#include <gpac/terminal.h>\r
+#include <gpac/mpeg4_odf.h>\r
+\r
+#include <gpac/modules/service.h>\r
+#include <gpac/modules/codec.h>\r
+#include <gpac/modules/ipmp.h>\r
+#include <gpac/mediaobject.h>\r
+#include <gpac/thread.h>\r
+\r
+typedef struct _inline_scene GF_InlineScene;\r
+typedef struct _media_manager GF_MediaManager;\r
+typedef struct _object_clock GF_Clock;\r
+typedef struct _es_channel GF_Channel;\r
+typedef struct _generic_codec GF_Codec;\r
+typedef struct _composition_memory GF_CompositionMemory;\r
+\r
+\r
+struct _net_service\r
+{\r
+       /*the module handling this service - must be declared first to typecast with GF_DownlaodSession upon deletion*/\r
+       GF_InputService *ifce;\r
+\r
+       /*the terminal*/\r
+       struct _tag_terminal *term;\r
+       /*service url*/\r
+       char *url;\r
+       /*od_manager owning service, NULL for services created for remote channels*/\r
+       struct _od_manager *owner;\r
+       /*number of attached remote channels ODM (ESD URLs)*/\r
+       u32 nb_ch_users;\r
+       /*number of attached remote ODM (OD URLs)*/\r
+       u32 nb_odm_users;\r
+       \r
+       /*clock objects. Kept at service level since ESID namespace is the service one*/\r
+       GF_List *Clocks;\r
+       /*all downloaders objects used in this service*/\r
+       GF_List *dnloads;\r
+       /*cache asscoiated with service, if any*/\r
+       GF_StreamingCache *cache;\r
+};\r
+\r
+\r
+/*opens service - performs URL concatenation if parent service specified*/\r
+GF_ClientService *gf_term_service_new(GF_Terminal *term, GF_ObjectManager *owner, const char *url, const char *parent_url, GF_Err *ret_code);\r
+/*destroy service*/\r
+void gf_term_service_del(GF_ClientService *nets);\r
+\r
+/*access to the module interfaces - cf net_api.h GF_InputService for details*/\r
+GF_Err gf_term_service_command(GF_ClientService *ns, GF_NetworkCommand *com);\r
+Bool gf_term_service_can_handle_url(GF_ClientService *ns, char *url);\r
+\r
+GF_Err gf_term_channel_get_sl_packet(GF_ClientService *ns, LPNETCHANNEL channel, char **out_data_ptr, u32 *out_data_size, GF_SLHeader *out_sl_hdr, Bool *is_compressed, GF_Err *out_reception_status, Bool *is_new_data);\r
+GF_Err gf_term_channel_release_sl_packet(GF_ClientService *ns, LPNETCHANNEL channel);\r
+\r
+/*cache open/close*/\r
+GF_Err gf_term_service_cache_load(GF_ClientService *ns);\r
+GF_Err gf_term_service_cache_close(GF_ClientService *ns, Bool no_save);\r
+\r
+/*forwards all clocks of the given amount of time. Can only be used when terminal is in paused mode\r
+this is mainly designed for movie dumping in MP4Client*/\r
+GF_Err gf_term_step_clocks(GF_Terminal * term, u32 ms_diff);\r
+\r
+void gf_term_sample_clocks(GF_Terminal *term);\r
+\r
+/*\r
+               Inline scene stuff\r
+*/\r
+struct _inline_scene\r
+{\r
+       /*root OD of the subscene, ALWAYS namespace of the parent scene*/\r
+       struct _od_manager *root_od;\r
+       /*scene codec: top level decoder decoding/generating the scene - can be BIFS, VRML parser, etc*/\r
+       struct _generic_codec *scene_codec;\r
+       /*OD codec - specific to MPEG-4, only present at the inline level (media ressources are always scoped here)*/\r
+       struct _generic_codec *od_codec;\r
+\r
+       /*struct _od_managers used, namespace of this scene. The chain does not have the root_od\r
+       it only contains OD sent through OD UPDATE in the OD stream(s) attached \r
+       to this scene. Remote ODs are not added, only there parents are*/\r
+       GF_List *ODlist;\r
+       /*list of MOs (links between OD and nodes)*/\r
+       GF_List *media_objects;\r
+       /*list of externproto libraries*/\r
+       GF_List *extern_protos;\r
+       /*list of nodes using this inline*/\r
+       GF_List *inline_nodes;\r
+       /*list of extra scene graphs (text streams, generic OSDs, ...)*/\r
+       GF_List *extra_scenes;\r
+       /*inline scene graph*/\r
+       GF_SceneGraph *graph;\r
+       /*graph state - if not attached, no traversing of inline\r
+       0: not attached\r
+       1: attached\r
+       2: temp graph attached. The temp graph is generated when waiting for the first scene AU to be processed\r
+       */\r
+       u32 graph_attached;\r
+       /*togles inline restart - needed because the restart may be triggered from inside the scene or from\r
+       parent scene, hence 2 render passes must be used\r
+       special value 2 means scene URL changes (for anchor navigation*/\r
+       u32 needs_restart;\r
+       /*duration of inline scene*/\r
+       u64 duration;\r
+       /*if not 0, all objects in the scene will run on this clock. Needed in GPAC when clock references do not\r
+       respect object graph (eg IOD depending on external stream for clock)*/\r
+       u16 force_sub_clock_id;\r
+       /*world info node or title node*/\r
+       void *world_info;\r
+\r
+       Bool is_dynamic_scene;\r
+       /*clock for dynamic scene - current assumption is that all selected streams are synchronized in the dyn scene*/\r
+       GF_Clock *dyn_ck;\r
+       /*URLs of current video, audio and subs (we can't store objects since they may be destroyed when seeking)*/\r
+       SFURL visual_url, audio_url, text_url;\r
+       /*set to 1 when single time-line presentation with ONE OD AU is detected - the goal is to prevent\r
+       OD shutdown/startup when seeking. This will also remove unneeded net traffic for AddChannel/RemoveChannel\r
+       like RTSP TEARDOWN/SETUP*/\r
+       Bool static_media_ressources;\r
+\r
+       /*current simulation time of the compositor*/\r
+       Double simulation_time;\r
+\r
+       /*current IRI fragment if any*/\r
+       char *fragment_uri;\r
+\r
+       /*secondary resource scene*/\r
+       Bool secondary_resource;\r
+\r
+       char *redirect_xml_base;\r
+};\r
+\r
+GF_InlineScene *gf_inline_new(GF_InlineScene *parentScene);\r
+void gf_inline_del(GF_InlineScene *is);\r
+struct _od_manager *gf_inline_find_odm(GF_InlineScene *is, u16 OD_ID);\r
+void gf_inline_disconnect(GF_InlineScene *is, Bool for_shutdown);\r
+void gf_inline_remove_object(GF_InlineScene *is, GF_ObjectManager *odm, Bool for_shutdown);\r
+/*browse all (media) channels and send buffering info to the app*/\r
+void gf_inline_buffering_info(GF_InlineScene *is);\r
+void gf_inline_attach_to_compositor(GF_InlineScene *is);\r
+struct _mediaobj *gf_inline_get_media_object(GF_InlineScene *is, MFURL *url, u32 obj_type_hint, Bool lock_timelines);\r
+struct _mediaobj *gf_inline_get_media_object_ex(GF_InlineScene *is, MFURL *url, u32 obj_type_hint, Bool lock_timelines, struct _mediaobj *sync_ref, Bool always_load_new, GF_Node *node_ptr);\r
+void gf_inline_setup_object(GF_InlineScene *is, GF_ObjectManager *odm);\r
+/*restarts inline scene - care has to be taken not to remove the scene while it is traversed*/\r
+void gf_inline_restart(GF_InlineScene *is);\r
+/*updates scene duration based on settings*/\r
+void gf_inline_set_duration(GF_InlineScene *is);\r
+/*locate media object by ODID (non dynamic ODs) or URL (dynamic ODs)*/\r
+struct _mediaobj *gf_inline_find_object(GF_InlineScene *is, u16 ODID, char *url);\r
+/*returns scene time in sec - exact meaning of time depends on standard used*/\r
+Double gf_inline_get_time(void *_is);\r
+/*returns true if the given node DEF name is the url target view (eg blabla#myview)*/\r
+Bool gf_inline_default_scene_viewpoint(GF_Node *node);\r
+/*register extra scene graph for on-screen display*/\r
+void gf_inline_register_extra_graph(GF_InlineScene *is, GF_SceneGraph *extra_scene, Bool do_remove);\r
+/*forces scene size info (without changing pixel metrics) - this may be needed by modules using extra graphs (like timedtext)*/\r
+void gf_inline_force_scene_size(GF_InlineScene *is, u32 width, u32 height);\r
+/*regenerate a scene graph based on available objects - can only be called for dynamic OD streams*/\r
+void gf_inline_regenerate(GF_InlineScene *is);\r
+/*selects given ODM for dynamic scenes*/\r
+void gf_inline_select_object(GF_InlineScene *is, GF_ObjectManager *odm);\r
+/*restarts dynamic scene from given time: scene graph is not reseted, objects are just restarted\r
+instead of closed and reopened. If a media control is present on inline, from_time is overriden by MC range*/\r
+void gf_inline_restart_dynamic(GF_InlineScene *is, u64 from_time);\r
+/*owner inline node has been modified*/\r
+void gf_inline_on_modified(GF_Node *node);\r
+/*returns scene graph associated with an externProto lib - exported for VRML/X3D loaded*/\r
+GF_SceneGraph *gf_inline_get_proto_lib(void *_is, MFURL *lib_url);\r
+/*exported for compositor: handles filtering of "self" parameter indicating anchor only acts on container inline scene\r
+not root one. Returns 1 if handled (cf user.h, navigate event)*/\r
+Bool gf_inline_process_anchor(GF_Node *caller, GF_Event *evt);\r
+/*extern proto fetcher*/\r
+GF_SceneGraph *gf_inline_get_proto_lib(void *SceneCallback, MFURL *lib_url);\r
+void gf_inline_force_scene_size_video(GF_InlineScene *is, GF_MediaObject *mo);\r
+void gf_inline_sample_time(GF_InlineScene *is);\r
+/*compares object URL with another URL - ONLY USE THIS WITH DYNAMIC ODs*/\r
+Bool gf_mo_is_same_url(GF_MediaObject *obj, MFURL *inline_url);\r
+\r
+void gf_mo_update_caps(GF_MediaObject *mo);\r
+\r
+\r
+const char *gf_inline_get_fragment_uri(GF_Node *node);\r
+void gf_inline_set_fragment_uri(GF_Node *node, const char *uri);\r
+\r
+enum\r
+{\r
+       /*threading up to decoder*/\r
+       GF_TERM_THREAD_FREE,\r
+       /*single thread for all decoders*/\r
+       GF_TERM_THREAD_SINGLE,\r
+       /*all media (image, video, audio) decoders are threaded*/\r
+       GF_TERM_THREAD_MULTI,\r
+};\r
+\r
+enum\r
+{\r
+       GF_TERM_RUNNING= 1,\r
+       GF_TERM_DEAD = 1<<1,\r
+       GF_TERM_SINGLE_THREAD = 1<<2,\r
+       GF_TERM_MULTI_THREAD = 1<<3,\r
+       GF_TERM_SYSDEC_RESYNC = 1<<4,\r
+       GF_TERM_SINGLE_CLOCK = 1<<5,\r
+       GF_TERM_DRAW_FRAME = 1<<6\r
+};\r
+\r
+\r
+\r
+struct _tag_terminal\r
+{\r
+       u32 flags;\r
+\r
+       /*callback to user application*/        \r
+       GF_User *user;\r
+       /*scene compositor*/\r
+       struct __tag_compositor *compositor;\r
+       /*file downloader*/\r
+       GF_DownloadManager *downloader;\r
+       /*top level scene*/\r
+       GF_InlineScene *root_scene;\r
+\r
+       /*Media manager*/\r
+       GF_List *codecs;\r
+       /*mutex for decoder access*/\r
+       GF_Mutex *mm_mx;\r
+       /*decoding thread*/\r
+       GF_Thread *mm_thread;\r
+       /*last codec used in mm loop*/\r
+       u32 last_codec;\r
+       /*thread priority*/\r
+       s32 priority;\r
+       u32 cumulated_priority;\r
+       /*frame duration*/\r
+       u32 frame_duration;\r
+\r
+       /*net services*/\r
+       GF_List *net_services;\r
+       /*net services to be destroyed*/\r
+       GF_List *net_services_to_remove;\r
+       /*channels waiting for service CONNECT ack to be setup*/\r
+       GF_List *channels_pending;\r
+       /*media objects pending for stop/play*/\r
+       GF_List *media_queue;\r
+       /*network lock*/\r
+       GF_Mutex *net_mx;\r
+       /*all X3D key/mouse/string sensors*/\r
+       GF_List *x3d_sensors;\r
+       /*all input stream decoders*/\r
+       GF_List *input_streams;\r
+       \r
+       /*options (cf config doc)*/\r
+       Bool enable_cache;\r
+       /*data timeout for network buffering in ms - if no data is received within this timeout\r
+       the initial buffering aborts. */\r
+       u32 net_data_timeout;\r
+\r
+       u32 play_state;\r
+\r
+       u32 reload_state;\r
+       char *reload_url;\r
+\r
+       /*special list used by nodes needing a call to RenderNode but not in the traverese scene graph (VRML/MPEG-4 protos only). \r
+       For these nodes, the traverse effect passed will be NULL. This is only used by InputSensor node at the moment*/\r
+       GF_List *nodes_pending;\r
+\r
+       /*root node of the user prefs*/\r
+       GF_SceneGraph *dcci_doc;\r
+\r
+       GF_List *extensions;\r
+       GF_List *unthreaded_extensions;\r
+};\r
+\r
+\r
+\r
+GF_Err gf_term_init_scheduler(GF_Terminal *term, u32 threading_mode);\r
+void gf_term_stop_scheduler(GF_Terminal *term);\r
+void gf_term_add_codec(GF_Terminal *term, GF_Codec *codec);\r
+void gf_term_remove_codec(GF_Terminal *term, GF_Codec *codec);\r
+void gf_term_start_codec(GF_Codec *codec);\r
+void gf_term_stop_codec(GF_Codec *codec);\r
+void gf_term_set_threading(GF_Terminal *term, u32 mode);\r
+void gf_term_set_priority(GF_Terminal *term, s32 Priority);\r
+\r
+\r
+/*error report function*/\r
+void gf_term_message(GF_Terminal *app, const char *service, const char *message, GF_Err error);\r
+/*creates service for given OD / URL*/\r
+void gf_term_connect_object(GF_Terminal *app, GF_ObjectManager *odm, char *serviceURL, char *parent_url);\r
+/*creates service for given channel / URL*/\r
+GF_Err gf_term_connect_remote_channel(GF_Terminal *app, GF_Channel *ch, char *URL);\r
+\r
+/*called by media manager to perform service maintenance:\r
+servive shutdown: this is needed because service handler may be asynchronous\r
+object Play: this is needed to properly handle multiplexed sources (all channels must be connected before play)\r
+service restart\r
+*/\r
+void gf_term_handle_services(GF_Terminal *app);\r
+/*close service and queue for delete*/\r
+void gf_term_close_services(GF_Terminal *app, GF_ClientService *service);\r
+\r
+/*locks net manager*/\r
+void gf_term_lock_net(GF_Terminal *app, Bool LockIt);\r
+\r
+\r
+/*locks scene compositor*/\r
+void gf_term_lock_compositor(GF_Terminal *app, Bool LockIt);\r
+/*get scene compositor time - FIXME this is not flexible enough for SMIL/Multiple time containers*/\r
+u32 gf_term_get_time(GF_Terminal *term);\r
+/*forces scene composition*/\r
+void gf_term_invalidate_compositor(GF_Terminal *term);\r
+\r
+/*callbacks for scene graph library so that all related ESM nodes are properly instanciated*/\r
+void gf_term_node_callback(void *_is, u32 type, GF_Node *node, void *param);\r
+\r
+/*add/rem node requiring a call to render without being present in traversed graph (VRML/MPEG-4 protos). \r
+For these nodes, the traverse effect passed will be NULL.*/\r
+void gf_term_queue_node_traverse(GF_Terminal *term, GF_Node *node);\r
+void gf_term_unqueue_node_traverse(GF_Terminal *term, GF_Node *node);\r
+\r
+\r
+\r
+/*clock*/\r
+struct _object_clock \r
+{\r
+       u16 clockID;    \r
+       GF_Terminal *term;\r
+       GF_Mutex *mx;\r
+       /*no_time_ctrl : set if ANY stream running on this clock has no time control capabilities - this avoids applying\r
+       mediaControl and others that would break stream dependencies*/\r
+       Bool use_ocr, clock_init, has_seen_eos, no_time_ctrl;\r
+       u32 init_time, StartTime, PauseTime, Paused;\r
+       /*the number of streams buffering on this clock*/\r
+       u32 Buffering;\r
+       /*associated media control if any*/\r
+       struct _media_control *mc;\r
+       /*for MC only (no FlexTime)*/\r
+       Fixed speed;\r
+       u32 discontinuity_time;\r
+       s32 drift;\r
+};\r
+\r
+/*destroys clock*/\r
+void gf_clock_del(GF_Clock *ck);\r
+/*finds a clock by ID or by ES_ID*/\r
+GF_Clock *gf_clock_find(GF_List *Clocks, u16 clockID, u16 ES_ID);\r
+/*attach clock returns a new clock or the clock this stream (ES_ID) depends on (OCR_ES_ID)\r
+hasOCR indicates whether the stream being attached carries object clock references\r
+@clocks: list of clocks in ES namespace (service)\r
+@is: inline scene to solve clock dependencies\r
+*/\r
+GF_Clock *gf_clock_attach(GF_List *clocks, GF_InlineScene *is, u16 OCR_ES_ID, u16 ES_ID, s32 hasOCR);\r
+/*reset clock (only called by channel owning clock)*/\r
+void gf_clock_reset(GF_Clock *ck);\r
+/*stops clock (only called for scene clock)*/\r
+void gf_clock_stop(GF_Clock *ck);\r
+/*return clock time in ms*/\r
+u32 gf_clock_time(GF_Clock *ck);\r
+/*return ellapsed time in ms since start of the clock*/\r
+u32 gf_clock_ellapse_time(GF_Clock *ck);\r
+/*sets clock time - FIXME: drift updates for OCRs*/\r
+void gf_clock_set_time(GF_Clock *ck, u32 TS);\r
+/*return clock time in ms without drift adjustment - used by audio objects only*/\r
+u32 gf_clock_real_time(GF_Clock *ck);\r
+/*pause the clock*/\r
+void gf_clock_pause(GF_Clock *ck);\r
+/*resume the clock*/\r
+void gf_clock_resume(GF_Clock *ck);\r
+/*returns true if clock started*/\r
+Bool gf_clock_is_started(GF_Clock *ck);\r
+/*toggles buffering on (clock is paused at the first stream buffering) */\r
+void gf_clock_buffer_on(GF_Clock *ck);\r
+/*toggles buffering off (clock is paused at the last stream restarting) */\r
+void gf_clock_buffer_off(GF_Clock *ck);\r
+/*set clock speed scaling factor*/\r
+void gf_clock_set_speed(GF_Clock *ck, Fixed speed);\r
+/*set clock drift - used to resync audio*/\r
+void gf_clock_adjust_drift(GF_Clock *ck, s32 ms_drift);\r
+\r
+enum\r
+{\r
+       /*channel is setup and waits for connection request*/\r
+       GF_ESM_ES_SETUP = 0,\r
+       /*waiting for server reply*/\r
+       GF_ESM_ES_WAIT_FOR_ACK,\r
+       /*connection OK*/\r
+       GF_ESM_ES_CONNECTED,\r
+       /*data exchange on this service/channel*/\r
+       GF_ESM_ES_RUNNING,\r
+       /*deconnection OK - a download channel can automatically disconnect when download is done*/\r
+       GF_ESM_ES_DISCONNECTED,\r
+       /*service/channel is not (no longer) available/found and should be removed*/\r
+       GF_ESM_ES_UNAVAILABLE\r
+};\r
+\r
+/*data channel (elementary stream)*/\r
+struct _es_channel \r
+{\r
+       /*security check on channel*/\r
+       u32 chan_id;\r
+       /*service this channel belongs to*/\r
+       GF_ClientService *service;\r
+       /*stream descriptor*/\r
+       GF_ESD *esd;\r
+       /*parent OD for this stream*/\r
+       struct _od_manager *odm;\r
+       u32 es_state;\r
+       Bool is_pulling;\r
+       u32 media_padding_bytes;\r
+       /*IO mutex*/\r
+       GF_Mutex *mx;\r
+       u32 AU_Count;\r
+       /*decoding buffers for push mode*/\r
+       struct _decoding_buffer * AU_buffer_first, * AU_buffer_last;\r
+       /*static decoding buffer for pull mode*/\r
+       struct _decoding_buffer * AU_buffer_pull;\r
+       /*channel buffer flag*/\r
+       Bool BufferOn;\r
+       /*min level to trigger buffering on, max to trigger it off. */\r
+       u32 MinBuffer, MaxBuffer;\r
+       /*amount of buffered media - this is the DTS of the last received AU minus the onject clock time, to make sure\r
+       we always have MaxBuffer ms ready for composition when resuming the clock*/\r
+       s32 BufferTime;\r
+       /*last received AU time - if exceeding a certain time and buffering is on, buffering is turned off.\r
+       This is needed for streams with very short duration (less than buffer time) and stream with only one AU (BIFS/OD)*/\r
+       u32 last_au_time;\r
+       /*Current reassemnbling buffer - currently packets are NOT reordered, only AUs are*/\r
+       char *buffer;\r
+       u32 len, allocSize;\r
+       /*only for last packet of an AU*/\r
+       u8 padingBits;\r
+       Bool IsEndOfStream;\r
+       /*      SL reassembler  */\r
+       /*current AU TSs*/\r
+       u32 DTS, CTS;\r
+       /*AU and Packet seq num info*/\r
+       u32 au_sn, pck_sn;\r
+       u32 max_au_sn, max_pck_sn;\r
+       /*the AU length indicated in the SL Header. */\r
+       u32 AULength;\r
+       /*state indicator: 0 OK, 1: not tuned in, 2: has error and needs RAP*/\r
+       u32 stream_state;\r
+       /*the AU in reception is RAP*/\r
+       Bool IsRap;\r
+       /*signal that next AU is an AU start*/\r
+       Bool NextIsAUStart;\r
+       /*if codec resilient, packet drops are not considered as fatal for AU reconstruction (eg no wait for RAP)*/\r
+       Bool codec_resilient;\r
+       /*when starting a channel, the first AU is ALWAYS fetched when buffering - this forces\r
+       BIFS and OD to be decoded and first frame render, in order to detect media objects that would also need\r
+       buffering - note this doesn't affect the clock, it is still paused if buffering*/\r
+       Bool first_au_fetched;\r
+\r
+       /* used in Carousel, to skip packets until the end of AU */ \r
+       Bool skip_carousel_au;\r
+       \r
+       /* TimeStamp to Media Time mapping*/\r
+       /*TS (in TSResolution) corresponding to the SeedTime of the decoder. Delivered by net, otherwise 0*/\r
+       u64 seed_ts;\r
+       /*media time offset corresponding to SeedTS. This is needed when the channel doesn't own the clock*/\r
+       u32 ts_offset;\r
+       /*scaling factors to remap to timestamps in milliseconds*/\r
+       u64 ts_res;\r
+       Double ocr_scale;\r
+       /*clock driving this stream - currently only CTS is supported (no OCR)*/\r
+       struct _object_clock *clock;\r
+       /*flag for clock init. Only a channel owning the clock will set this flag on clock init*/\r
+       Bool IsClockInit;\r
+\r
+       /*duration of last received AU if any, 0 if not known (most of the time)*/\r
+       u32 au_duration;\r
+       /*A channel with this flag set considers each incoming packet as a complete AU and assigns timestamps \r
+       upon reception matching the reception time, then dispatching it into the decoding buffer (only tested\r
+       with audi video). This flag is turned on by setting esd->slconfig->predefined to 'SLPredef_SkipSL' */\r
+       Bool skip_sl;\r
+\r
+       /*indicates that decoding can be called directly when receiving a complete AU on this channel\r
+       This is used by systems streams in non-seekable (eg broadcast/multicast, MPEG-2 TS multiplexes) to \r
+       make sure resources are setup as fast as possible. If the AU is too early, it will be kept in the \r
+       decoding buffer*/\r
+       Bool dispatch_after_db;\r
+\r
+       /*indicates that decoding is called directly when receiving a packet on this channel\r
+       This is used to bypass SL defragmenting and decoding buffer for EIT internal streams*/\r
+       Bool bypass_sl_and_db;\r
+\r
+       GF_IPMPTool *ipmp_tool;\r
+       Bool is_protected;\r
+\r
+       /*TSs as received from network - these are used for cache storage*/\r
+       u64 net_dts, net_cts;\r
+};\r
+\r
+/*creates a new channel for this stream*/\r
+GF_Channel *gf_es_new(GF_ESD *esd);\r
+/*destroys channel*/\r
+void gf_es_del(GF_Channel *ch);\r
+/*(un)locks channel*/\r
+void gf_es_lock(GF_Channel *ch, u32 LockIt);\r
+/*setup channel for reception of data*/\r
+GF_Err gf_es_start(GF_Channel *ch);\r
+/*stop channel from receiving data*/\r
+GF_Err gf_es_stop(GF_Channel *ch);\r
+/*handles reception of an SL PDU*/\r
+void gf_es_receive_sl_packet(GF_ClientService *serv, GF_Channel *ch, char *StreamBuf, u32 StreamLength, GF_SLHeader *header, GF_Err reception_status);\r
+/*signals end of stream on the channel*/\r
+void gf_es_on_eos(GF_Channel *ch);\r
+/*fetches first AU available for decoding on this channel*/\r
+struct _decoding_buffer *gf_es_get_au(GF_Channel *ch);\r
+/*drops first AU on this channel*/\r
+void gf_es_drop_au(GF_Channel *ch);\r
+/*performs final setup upon connection confirm*/\r
+void gf_es_on_connect(GF_Channel *ch);\r
+/*reconfigure SL for this channel*/\r
+void gf_es_reconfig_sl(GF_Channel *ch, GF_SLConfig *slc);\r
+/*hack for streaming: whenever a time map (media time <-> TS time) event is received on the channel reset decoding buffer\r
+this is needed because all server tested resend packets on already running channel*/\r
+void gf_es_map_time(GF_Channel *ch, Bool reset);\r
+/*dummy channels are used by scene decoders which don't use ESM but load directly the scene graph themselves\r
+these channels are ALWAYS pulling ones, and this function will init the channel clock if needed*/\r
+void gf_es_init_dummy(GF_Channel *ch);\r
+/*setup DRM info*/\r
+void gf_es_config_drm(GF_Channel *ch, GF_NetComDRMConfig *isma_cryp);\r
+\r
+/*\r
+               decoder stuff\r
+*/\r
+enum\r
+{\r
+       /*stop: the decoder is not playing*/\r
+       GF_ESM_CODEC_STOP       =       0,\r
+       /*stop: the decoder is playing*/\r
+       GF_ESM_CODEC_PLAY       =       1,\r
+       /*End Of Stream: when the base layer signals it's done, this triggers media-specific\r
+       handling of the CB. \r
+       For video, the output is kept alive, For audio, the output is reseted (don't want audio loop ;)*/\r
+       GF_ESM_CODEC_EOS        =       2,\r
+       /*pause: the decoder is stoped but the CB is kept intact\r
+       THIS IS NOT USED AS A CODEC STATUS, but only for signaling that the CB shouldn't \r
+       be reseted - the real status of a "paused" decoder is STOP*/\r
+       GF_ESM_CODEC_PAUSE      =       3,\r
+       /*Buffer: transition state: the decoder runs (fetch data/decode) but the clock\r
+       is not running (no composition). This is used for rebuffering channels (rtp...)*/\r
+       GF_ESM_CODEC_BUFFER =   4\r
+};\r
+\r
+enum\r
+{\r
+       GF_ESM_CODEC_HAS_UPSTREAM = 1,\r
+       /*the codec uses the interface from another codec (only used by private scene streams to handle\r
+       any intern sprite/animation streams)*/\r
+       GF_ESM_CODEC_IS_USE = 1<<1,\r
+       /*set for OD codec when static (ressources are declared in OD stream esd a la ISMA*/\r
+       GF_ESM_CODEC_IS_STATIC_OD = 1<<2,\r
+};\r
+\r
+struct _generic_codec \r
+{\r
+       /*codec type (streamType from base layer)*/\r
+       u32 type;\r
+       u32 flags;\r
+       /*current decoder interface */\r
+       GF_BaseDecoder *decio;\r
+       /*composition memory for media streams*/\r
+       struct _composition_memory *CB;\r
+       /*input media channles*/\r
+       GF_List *inChannels;\r
+       /*a pointer to the OD that owns the decoder.*/\r
+       struct _od_manager *odm;\r
+       u32 Status;\r
+       Bool Muted;\r
+       struct _object_clock *ck;\r
+       /*priority of this media object. This is ALWAYS the base layer priority\r
+       PriorityBoost is set when the CB is under critical limit (for now only audio uses the feature)\r
+       and results in a bigger time slice for the codec. Only on/off value for now*/\r
+       u32 Priority, PriorityBoost;\r
+       /*last processed DTS - sanity check for scalability*/\r
+       u32 last_unit_dts;\r
+       /*last processed CTS on base layer - seeking detection*/\r
+       u32 last_unit_cts;\r
+       /*in case the codec performs temporal re-ordering itself*/\r
+       Bool is_reordering;\r
+       u32 prev_au_size;\r
+       u32 bytes_per_sec;\r
+       Double fps;\r
+\r
+       /*statistics*/\r
+       u32 last_stat_start, cur_bit_size;\r
+       u32 avg_bit_rate, max_bit_rate;\r
+       u32 total_dec_time, nb_dec_frames, max_dec_time;\r
+       /*number of droped frames*/\r
+       u32 nb_droped;\r
+\r
+       /*for CTS reconstruction (channels not using SL): we cannot just update timing at each frame, not precise enough \r
+       since we use ms and not microsec TSs*/\r
+       u32 cur_audio_bytes, cur_video_frames;\r
+};\r
+\r
+GF_Codec *gf_codec_new(GF_ObjectManager *odm, GF_ESD *base_layer, s32 PL, GF_Err *e);\r
+void gf_codec_del(GF_Codec *codec);\r
+GF_Err gf_codec_add_channel(GF_Codec *codec, GF_Channel *ch);\r
+/*returns TRUE if stream was present, false otherwise*/\r
+Bool gf_codec_remove_channel(GF_Codec *codec, GF_Channel *ch);\r
+GF_Err gf_codec_process(GF_Codec *codec, u32 TimeAvailable);\r
+GF_Err gf_codec_get_capability(GF_Codec *codec, GF_CodecCapability *cap);\r
+GF_Err gf_codec_set_capability(GF_Codec *codec, GF_CodecCapability cap);\r
+void gf_codec_set_status(GF_Codec *codec, u32 Status);\r
+/*returns a new codec using an existing loaded decoder - only used by private scene to handle != timelines, for \r
+instance when loading a BT with an animation stream*/\r
+GF_Codec *gf_codec_use_codec(GF_Codec *codec, GF_ObjectManager *odm);\r
+\r
+/*OD manager*/\r
+\r
+enum\r
+{\r
+       /*flag set if object cannot be time-controloed*/\r
+       GF_ODM_NO_TIME_CTRL = (1<<1),\r
+       /*flag set if subscene uses parent scene timeline*/\r
+       GF_ODM_INHERIT_TIMELINE = (1<<2),\r
+       /*flag set if object has been redirected*/\r
+       GF_ODM_REMOTE_OD = (1<<3),\r
+       /*flag set if object has profile indications*/\r
+       GF_ODM_HAS_PROFILES = (1<<4),\r
+       /*flag set if object governs profile of inline subscenes*/\r
+       GF_ODM_INLINE_PROFILES = (1<<5),\r
+       /*flag set if object declared by network service, not from OD stream*/\r
+       GF_ODM_NOT_IN_OD_STREAM = (1<<6),\r
+\r
+       /*dynamic flags*/\r
+       \r
+       /*flag set if associated subscene must be regenerated*/\r
+       GF_ODM_REGENERATE_SCENE = (1<<10),\r
+};\r
+\r
+enum\r
+{\r
+       GF_ODM_STATE_STOP,\r
+       GF_ODM_STATE_PLAY,\r
+       GF_ODM_STATE_IN_SETUP,\r
+       GF_ODM_STATE_BLOCKED,\r
+};\r
+\r
+struct _od_manager\r
+{\r
+       /*pointer to terminal*/\r
+       struct _tag_terminal *term;\r
+       /*the service used by this ODM. If the service private data is this ODM, then the service was created for this ODM*/\r
+       GF_ClientService *net_service;\r
+       /*parent scene or NULL for root scene*/\r
+       struct _inline_scene *parentscene;\r
+       /*channels associated with this object (media channels, OCR, IPMP, OCI, etc)*/\r
+       GF_List *channels;\r
+       /*sub scene for inline/animation or NULL */\r
+       struct _inline_scene *subscene;\r
+       /*object codec (media or BIFS for AnimationStream) attached if any*/\r
+       struct _generic_codec *codec;\r
+       /*OCI codec attached if any*/\r
+       struct _generic_codec *oci_codec;\r
+       /*OCR codec attached if any*/\r
+       struct _generic_codec *ocr_codec;\r
+\r
+       /*MPEG-4 object descriptor*/\r
+       GF_ObjectDescriptor *OD;\r
+\r
+       /*exclusive access is required since rendering and media management don't always take place in the same thread*/\r
+       GF_Mutex *mx;\r
+\r
+       u32 flags;\r
+\r
+       /*PLs*/\r
+       u8 Audio_PL, Graphics_PL, OD_PL, Scene_PL, Visual_PL;\r
+       \r
+       /*interface with scene rendering*/\r
+       struct _mediaobj *mo;\r
+       \r
+       /*number of channels with connection not yet acknowledge*/\r
+       u32 pending_channels;\r
+       u32 state;\r
+       /* during playback: timing as evaluated by the composition memory or the scene codec */\r
+       u32 current_time;\r
+       /*full object duration 0 if unknown*/\r
+       u64 duration;\r
+       /*\r
+       upon start: media start time as requested by scene compositor (eg not media control)\r
+       set to -1 upon stop to postpone stop request\r
+       */\r
+       u64 media_start_time, media_stop_time;\r
+\r
+       /*the one and only media control currently attached to this object*/\r
+       struct _media_control *media_ctrl;\r
+       /*the list of media control controling the object*/\r
+       GF_List *mc_stack;\r
+       /*the media sensor(s) attached to this object*/\r
+       GF_List *ms_stack;\r
+};\r
+\r
+\r
+GF_ObjectManager *gf_odm_new();\r
+void gf_odm_del(GF_ObjectManager *ODMan);\r
+void gf_odm_lock(GF_ObjectManager *odm, u32 LockIt);\r
+\r
+/*setup service entry point*/\r
+void gf_odm_setup_entry_point(GF_ObjectManager *odm, const char *sub_url);\r
+/*setup OD*/\r
+void gf_odm_setup_object(GF_ObjectManager *odm, GF_ClientService *parent_serv);\r
+/*disctonnect OD and removes it if desired (otherwise only STOP is propagated)*/\r
+void gf_odm_disconnect(GF_ObjectManager *odman, Bool do_remove);\r
+/*setup an ESD*/\r
+GF_Err gf_odm_setup_es(GF_ObjectManager *odm, GF_ESD *esd, GF_ClientService *service, GF_MediaObject *sync_ref);\r
+/*removes an ESD (this destroys associated channel if any)*/\r
+void gf_odm_remove_es(GF_ObjectManager *odm, u16 ES_ID);\r
+/*set stream duration - updates object duration accordingly*/\r
+void gf_odm_set_duration(GF_ObjectManager *odm, GF_Channel *, u64 stream_duration);\r
+/*signals end of stream on channels*/\r
+void gf_odm_on_eos(GF_ObjectManager *odm, GF_Channel *);\r
+/*start Object streams and queue object for network PLAY*/\r
+void gf_odm_start(GF_ObjectManager *odm);\r
+/*stop OD streams*/\r
+void gf_odm_stop(GF_ObjectManager *odm, Bool force_close);\r
+/*send PLAY request to network - needed to properly handle multiplexed inputs \r
+ONLY called by service handler (media manager thread)*/\r
+void gf_odm_play(GF_ObjectManager *odm);\r
+\r
+/*returns 1 if this is a segment switch, 0 otherwise - takes care of object restart if segment switch*/\r
+Bool gf_odm_check_segment_switch(GF_ObjectManager *odm);\r
+/*pause object (mediaControl use only)*/\r
+void gf_odm_pause(GF_ObjectManager *odm);\r
+/*resume object (mediaControl use only)*/\r
+void gf_odm_resume(GF_ObjectManager *odm);\r
+/*set object speed*/\r
+void gf_odm_set_speed(GF_ObjectManager *odm, Fixed speed);\r
+/*returns the clock of the media stream (video, audio or bifs), NULL otherwise */\r
+struct _object_clock *gf_odm_get_media_clock(GF_ObjectManager *odm);\r
+/*adds segment descriptors targeted by the URL to the list and sort them - the input list must be empty*/\r
+void gf_odm_init_segments(GF_ObjectManager *odm, GF_List *list, MFURL *url);\r
+/*returns true if this OD depends on the given clock*/\r
+Bool gf_odm_shares_clock(GF_ObjectManager *odm, struct _object_clock *ock);\r
+\r
+GF_Segment *gf_odm_find_segment(GF_ObjectManager *odm, char *descName);\r
+/*locks ODM with destruction check - returns 0 if object manager is not attached to object*/\r
+Bool gf_odm_lock_mo(struct _mediaobj *mo);\r
+\r
+\r
+/*GF_MediaObject: link between real object manager and scene. although there is a one-to-one mapping between a \r
+MediaObject and an ObjectManager, we have to keep them seperated in order to handle OD remove commands which destroy\r
+ObjectManagers. */\r
+struct _mediaobj\r
+{\r
+       /*type is as defined in constants.h # GF_MEDIA_OBJECT_* */\r
+       u32 type;\r
+       /*one of the above flags*/\r
+       u32 flags;\r
+\r
+\r
+       /* private to ESM*/\r
+\r
+       /*media object manager - private to the sync engine*/\r
+       struct _od_manager *odm;\r
+       /*OD ID of the object*/\r
+       u32 OD_ID;\r
+       /*OD URL for object not using MPEG4 OD urls*/\r
+       MFURL URLs;\r
+       /*session join*/\r
+       u32 num_open;\r
+       /*shared object restart handling*/\r
+       u32 num_to_restart, num_restart;\r
+       Fixed speed;\r
+\r
+       /*shared object info: if 0 a new frame will be checked, otherwise current is returned*/\r
+       u32 nb_fetch;\r
+       /*frame presentation time*/\r
+       u32 timestamp;\r
+       /*data frame size*/\r
+       u32 framesize;\r
+       /*pointer to data frame */\r
+       char *frame;\r
+       /*nodes currently registered with the media object - used to dispatch MediaAccessEvents*/\r
+       GF_List *nodes;\r
+       /*pointer to the node responsible for the creation of this media object\r
+       ONLY used for scene media type (animationStreams) \r
+       Reset upon creation of the decoder.\r
+       */\r
+       void *node_ptr;\r
+};\r
+\r
+GF_MediaObject *gf_mo_new();\r
+\r
+\r
+/*used for delayed channel setup*/\r
+typedef struct \r
+{\r
+       struct _generic_codec *dec;\r
+       struct _es_channel *ch; \r
+} GF_ChannelSetup;\r
+\r
+/*post-poned channel connect*/\r
+GF_Err gf_odm_post_es_setup(struct _es_channel *ch, struct _generic_codec *dec, GF_Err err);\r
+\r
+/*\r
+       special entry point: specify directly a service interface for service input\r
+*/\r
+void gf_term_attach_service(GF_Terminal *term, GF_InputService *service_hdl);\r
+\r
+/*media access events */\r
+void gf_term_service_media_event(GF_ObjectManager *odm, u32 event_type);\r
+\r
+u32 URL_GetODID(MFURL *url);\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif /*_GF_TERMINAL_DEV_H_*/\r
+\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/internal/vobsub.h b/tstools/DtsEdit/src/gpac/internal/vobsub.h
new file mode 100644 (file)
index 0000000..6d95a3c
--- /dev/null
@@ -0,0 +1,82 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) by  Falco (Ivan Vecera) 2006\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / Media Tools sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+\r
+#ifndef _GF_VOBSUB_H_\r
+#define _GF_VOBSUB_H_\r
+\r
+#include <gpac/tools.h>\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#define VOBSUBIDXVER 7\r
+\r
+typedef struct _tag_vobsub_pos\r
+{\r
+       u64  filepos;\r
+       u64  start;\r
+       u64  stop;\r
+} vobsub_pos;\r
+\r
+typedef struct _tag_vobsub_lang\r
+{\r
+       u32      id;\r
+       char    *name;\r
+       GF_List *subpos;\r
+} vobsub_lang;\r
+\r
+typedef struct _tag_vobsub_file\r
+{\r
+       u32         width;\r
+       u32         height;\r
+       u8          palette[16][4];\r
+       u32         num_langs;\r
+       vobsub_lang langs[32];\r
+} vobsub_file;\r
+\r
+GFINLINE static void vobsub_trim_ext(char *filename)\r
+{\r
+       char *pos = strchr(filename, '.');\r
+\r
+       if (pos != NULL) {\r
+               if (!stricmp(pos, ".idx") || !stricmp(pos, ".sub")) {\r
+                       *pos = '\0';\r
+               }\r
+       }\r
+}\r
+\r
+s32    vobsub_lang_name(u16 id);\r
+char  *vobsub_lang_id(char *name);\r
+GF_Err vobsub_read_idx(FILE *file, vobsub_file *vobsub, int *version);\r
+void   vobsub_free(vobsub_file *vobsub);\r
+GF_Err vobsub_get_subpic_duration(char *data, u32 psize, u32 dsize, u32 *duration);\r
+GF_Err vobsub_packetize_subpicture(FILE *fsub, u64 pts, char *data, u32 dataSize);\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* _GF_VOBSUB_H_ */\r
diff --git a/tstools/DtsEdit/src/gpac/ismacryp.h b/tstools/DtsEdit/src/gpac/ismacryp.h
new file mode 100644 (file)
index 0000000..1f2c34f
--- /dev/null
@@ -0,0 +1,116 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / Authoring Tools sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_ISMACRYP_H_\r
+#define _GF_ISMACRYP_H_\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/isomedia.h>\r
+\r
+enum\r
+{\r
+       /*no selective encryption*/\r
+       GF_ISMACRYP_SELENC_NONE = 0,\r
+       /*only encrypts RAP samples*/\r
+       GF_ISMACRYP_SELENC_RAP = 1,\r
+       /*only encrypts non-RAP samples*/\r
+       GF_ISMACRYP_SELENC_NON_RAP = 2,\r
+       /*selective encryption of random samples*/\r
+       GF_ISMACRYP_SELENC_RAND = 3,\r
+       /*selective encryption of a random sample in given range*/\r
+       GF_ISMACRYP_SELENC_RAND_RANGE = 4,\r
+       /*selective encryption of first sample in given range*/\r
+       GF_ISMACRYP_SELENC_RANGE = 5,\r
+       /*encryption of all samples but the preview range*/\r
+       GF_ISMACRYP_SELENC_PREVIEW = 6,\r
+};\r
+\r
+typedef struct\r
+{\r
+       /*0: ISMACryp - 1: OMA DRM*/\r
+       u32 enc_type;\r
+       u32 trackID;\r
+       unsigned char key[16];\r
+       unsigned char salt[16];\r
+\r
+       /*the rest is only used for encryption*/\r
+       char KMS_URI[5000];\r
+       char Scheme_URI[5000];\r
+       /*selecive encryption type*/\r
+       u32 sel_enc_type;\r
+       u32 sel_enc_range;\r
+       /*IPMP signaling: 0: none, 1: IPMP, 2: IPMPX\r
+       when IPMP signaling is enabled, the OD stream will be updated with\r
+       IPMP Update commands*/\r
+       u32 ipmp_type;\r
+       /*if not set and IPMP enabled, defaults to TrackID*/\r
+       u32 ipmp_desc_id;\r
+\r
+       /*OMA extensions*/\r
+       /*0: none, 1: AES CBC, 2: AES CTR*/\r
+       u8 encryption;\r
+       char TextualHeaders[5000];\r
+       u32 TextualHeadersLen;\r
+       char TransactionID[17];\r
+\r
+} GF_TrackCryptInfo;\r
+\r
+/*encrypts track - logs, progress: info callbacks, NULL for stdout*/\r
+GF_Err gf_ismacryp_encrypt_track(GF_ISOFile *mp4, GF_TrackCryptInfo *tci, void (*progress)(void *cbk, u32 done, u32 total), void *cbk);\r
+\r
+/*decrypts track - logs, progress: info callbacks, NULL for stdout*/\r
+GF_Err gf_ismacryp_decrypt_track(GF_ISOFile *mp4, GF_TrackCryptInfo *tci, void (*progress)(void *cbk, u32 done, u32 total), void *cbk);\r
+\r
+/*decrypt a file \r
+@drm_file: location of DRM data (cf MP4Box doc).\r
+@LogMsg: redirection for message or NULL for stdout\r
+*/\r
+GF_Err gf_ismacryp_decrypt_file(GF_ISOFile *mp4file, const char *drm_file);\r
+\r
+/*Crypt a the file \r
+@drm_file: location of DRM data.\r
+@LogMsg: redirection for message or NULL for stdout\r
+*/\r
+GF_Err gf_ismacryp_crypt_file(GF_ISOFile *mp4file, const char *drm_file);\r
+\r
+/*loads key and salt from a LOCAL gpac-DRM file (cf MP4Box doc)*/\r
+GF_Err gf_ismacryp_gpac_get_info(u32 stream_id, char *drm_file, char *key, char *salt);\r
+\r
+/*loads key and salt for MPEG4IP protected files*/\r
+Bool gf_ismacryp_mpeg4ip_get_info(char *kms_uri, char *key, char *salt);\r
+\r
+/*computes file hash. If file is ISO-based, computre hash according to OMA (P)DCF (without MutableDRMInformation box)*/\r
+GF_Err gf_media_get_file_hash(const char *file, u8 hash[20]);\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif /*_GF_ISMACRYP_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/iso639.h b/tstools/DtsEdit/src/gpac/iso639.h
new file mode 100644 (file)
index 0000000..16d4632
--- /dev/null
@@ -0,0 +1,523 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC \r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_ISO_639_H\r
+#define _GF_ISO_639_H\r
+\r
+\r
+/*ISO 639 code names \r
+       - first string is readable english name of the language\r
+       - second string is 3-char code of language as per ISO/IEC 639-2\r
+       - third string is 2-char code of language as per ISO/IEC 639-1, and may be empty \r
+*/\r
+static const char *GF_ISO639_Lang[] = \r
+{\r
+       "Abkhazian","abk", "ab",\r
+       "Achinese","ace", "",\r
+       "Acoli","ach", "",\r
+       "Adangme","ada", "",\r
+       "Adygei","ady", "",\r
+       "Adyghe","ady", "",\r
+       "Afar","aar", "aa",\r
+       "Afrihili","afh", "",\r
+       "Afrikaans","afr", "af",\r
+       "Afro-Asiatic (Other)","afa", "",\r
+       "Akan","aka", "",\r
+       "Akkadian","akk", "",\r
+       "Albanian","alb/sqi", "sq",\r
+       "Aleut","ale", "",\r
+       "Algonquian languages","alg", "",\r
+       "Altaic (Other)","tut", "",\r
+       "Amharic","amh", "am",\r
+       "Apache languages","apa", "",\r
+       "Arabic","ara", "ar",\r
+       "Aragonese","arg", "",\r
+       "Aramaic","arc", "",\r
+       "Arapaho","arp", "",\r
+       "Araucanian","arn", "",\r
+       "Arawak","arw", "",\r
+       "Armenian","arm/hye", "hy",\r
+       "Artificial (Other)","art", "",\r
+       "Assamese","ast", "as",\r
+       "Athapascan languages","ath", "",\r
+       "Australian languages","aus", "",\r
+       "Austronesian (Other)","map", "",\r
+       "Avaric","ava", "",\r
+       "Avestan","ave", "",\r
+       "Awadhi","awa", "",\r
+       "Aymara","aym", "ay",\r
+       "Azerbaijani","aze", "az",\r
+       "Bable","ast", "",\r
+       "Balinese","ban", "",\r
+       "Baltic (Other)","bat", "",\r
+       "Baluchi","bal", "",\r
+       "Bambara","bam", "",\r
+       "Bamileke languages","bai", "",\r
+       "Banda","bad", "",\r
+       "Bantu (Other)","bnt", "",\r
+       "Basa","bas", "",\r
+       "Bashkir","bak", "ba",\r
+       "Basque","baq/eus", "eu",\r
+       "Batak (Indonesia)","btk", "",\r
+       "Beja","bej", "",\r
+       "Belarusian","bel", "be",\r
+       "Bemba","bem", "",\r
+       "Bengali","ben", "bn",\r
+       "Berber (Other)","ber", "",\r
+       "Bhojpuri","bho", "",\r
+       "Bihari","bih", "bh",\r
+       "Bikol","bik", "",\r
+       "Bini","bin", "",\r
+       "Bislama","bis", "bi",\r
+       "Bokmål, Norwegian","nob", "",\r
+       "Bosnian","bos", "",\r
+       "Braj","bra", "",\r
+       "Breton","bre", "br",\r
+       "Buginese","bug", "",\r
+       "Bulgarian","bul", "bg",\r
+       "Buriat","bua", "",\r
+       "Burmese","bur/mya", "my",\r
+       "Caddo","cad", "",\r
+       "Carib","car", "",\r
+       "Castilian","spa", "",\r
+       "Catalan","cat", "ca",\r
+       "Caucasian (Other)","cau", "",\r
+       "Cebuano","ceb", "",\r
+       "Celtic (Other)","cel", "",\r
+       "Central American Indian (Other)","cai", "",\r
+       "Chagatai","chg", "",\r
+       "Chamic languages","cmc", "",\r
+       "Chamorro","cha", "",\r
+       "Chechen","che", "",\r
+       "Cherokee","chr" , "",\r
+       "Chewa","nya", "",\r
+       "Cheyenne","chy", "",\r
+       "Chibcha","chb", "",\r
+       "Chichewa","nya", "",\r
+       "Chinese","chi/zho", "zh",\r
+       "Chinook jargon","chn", "",\r
+       "Chipewyan","chp", "",\r
+       "Choctaw","cho", "",\r
+       "Chuang","zha", "",\r
+       "Church Slavic (Slavonic)","chu", "",\r
+       "Chuukese","chk", "",\r
+       "Chuvash","chv", "",\r
+       "Coptic","cop", "",\r
+       "Cornish","cor", "",\r
+       "Corsican","cos", "co",\r
+       "Cree","cre" , "",\r
+       "Creek","mus" , "",\r
+       "Creoles and pidgins(Other)","crp", "",\r
+       "Creoles and pidgins, English-based (Other)","cpe", "",\r
+       "Creoles and pidgins, French-based (Other)","cpf", "",\r
+       "Creoles and pidgins, Portuguese-based (Other)","cpp", "",\r
+       "Crimean Tatar","crh", "",\r
+       "Crimean Turkish","crh", "",\r
+       "Croatian","scr/hrv", "hr",\r
+       "Cushitic (Other)","cus", "",\r
+       "Czech","cze/ces", "cs",\r
+       "Dakota","dak", "",\r
+       "Danish","dan", "da",\r
+       "Dargwa","dar", "",\r
+       "Dayak","day", "",\r
+       "Delaware","del", "",\r
+       "Dinka","din", "",\r
+       "Divehi","div" , "",\r
+       "Dogri","doi", "",\r
+       "Dogrib","dgr" , "",\r
+       "Dravidian (Other)","dra", "",\r
+       "Duala","dua", "",\r
+       "Dutch","dut/nld", "nl",\r
+       "Dutch, Middle (ca. 1050-1350)","dum", "",\r
+       "Dyula","dyu", "",\r
+       "Dzongkha","dzo", "dz",\r
+       "Efik","efi", "",\r
+       "Egyptian (Ancient)","egy", "",\r
+       "Ekajuk","eka", "",\r
+       "Elamite","elx", "",\r
+       "English","eng", "en",\r
+       "English, Middle (1100-1500)","enm", "",\r
+       "English, Old (ca.450-1100)","ang", "",\r
+       "Erzya","myv", "",\r
+       "Esperanto","epo", "eo",\r
+       "Estonian","est", "et",\r
+       "Ewe","ewe", "",\r
+       "Ewondo","ewo", "",\r
+       "Fang","fan", "",\r
+       "Fanti","fat" , "",\r
+       "Faroese","fao", "fo",\r
+       "Fijian","fij", "fj",\r
+       "Finnish","fin", "fi",\r
+       "Finno-Ugrian (Other)","fiu", "",\r
+       "Fon","fon", "",\r
+       "French","fre/fra", "fr",\r
+       "French, Middle (ca.1400-1600)","frm", "",\r
+       "French, Old (842-ca.1400)","fro", "",\r
+       "Frisian","fry", "fy",\r
+       "Friulian","fur" , "",\r
+       "Fulah","ful", "",\r
+       "Ga","gaa", "",\r
+       "Gaelic","gla", "",\r
+       "Gallegan","glg", "gl",\r
+       "Ganda","lug", "",\r
+       "Gayo","gay", "",\r
+       "Gbaya","gba" , "",\r
+       "Geez","gez", "",\r
+       "Georgian","geo/kat", "ka",\r
+       "German","ger/deu", "de",\r
+       "German, Low","nds" , "",\r
+       "German, Middle High (ca.1050-1500)","gmh", "",\r
+       "German, Old High (ca.750-1050)","goh", "",\r
+       "Germanic (Other)","gem", "",\r
+       "Gikuyu","kik", "",\r
+       "Gilbertese","gil", "",\r
+       "Gondi","gon", "",\r
+       "Gorontalo","gor", "",\r
+       "Gothic","got", "",\r
+       "Grebo","grb", "",\r
+       "Greek, Ancient (to 1453)","grc", "",\r
+       "Greek, Modern (1453-)","gre/ell", "el",\r
+       "Guarani","grn", "gn",\r
+       "Gujarati","guj", "gu",\r
+       "Gwich´in","gwi", "",\r
+       "Haida","hai", "",\r
+       "Haitian","hat", "",\r
+       "Haitian Creole","hat", "",\r
+       "Hausa","hau", "ha",\r
+       "Hawaiian","haw", "",\r
+       "Hebrew","heb", "he",\r
+       "Herero","her", "",\r
+       "Hiligaynon","hil", "",\r
+       "Himachali","him", "",\r
+       "Hindi","hin", "hi",\r
+       "Hiri Motu","hmo", "",\r
+       "Hittite","hit", "",\r
+       "Hmong","hmn", "",\r
+       "Hungarian","hun", "hu",\r
+       "Hupa","hup", "",\r
+       "Iban","iba", "",\r
+       "Icelandic","ice/isl", "is",\r
+       "Ido","ido", "",\r
+       "Igbo","ibo" , "",\r
+       "Ijo","ijo", "",\r
+       "Iloko","ilo", "",\r
+       "Inari Sami","smn", "",\r
+       "Indic (Other)","inc", "",\r
+       "Indo-European (Other)","ine", "",\r
+       "Indonesian","ind", "id",\r
+       "Ingush","inh", "",\r
+       "Interlingua (International Auxiliary Language Association)","ina", "ia",\r
+       "Interlingue","ile", "",\r
+       "Inuktitut","iku", "iu",\r
+       "Inupiaq","ipk", "ik",\r
+       "Iranian (Other)","ira", "",\r
+       "Irish","gle", "ga",\r
+       "Irish, Middle (900-1200)","mga", "",\r
+       "Irish, Old (to 900)","sga", "",\r
+       "Iroquoian languages","iro", "",\r
+       "Italian","ita", "it",\r
+       "Japanese","jpn", "ja",\r
+       "Javanese","jav", "jv",\r
+       "Judeo-Arabic","jrb", "",\r
+       "Judeo-Persian","jpr", "",\r
+       "Kabardian","kbd", "",\r
+       "Kabyle","kab", "",\r
+       "Kachin","kac", "",\r
+       "Kalaallisut","kal", "kl",\r
+       "Kalmyk","xal", "",\r
+       "Kamba","kam", "",\r
+       "Kannada","kan", "kn",\r
+       "Kanuri","kau", "",\r
+       "Karachay-Balkar","krc", "",\r
+       "Kara-Kalpak","kaa", "",\r
+       "Karen","kar", "",\r
+       "Kashmiri","kas", "ks",\r
+       "Kashubian","csb", "",\r
+       "Kawi","kaw", "",\r
+       "Kazakh","kaz", "kk",\r
+       "Khasi","kha", "",\r
+       "Khmer","khm", "km",\r
+       "Khoisan (Other)","khi", "",\r
+       "Khotanese","kho", "",\r
+       "Kikuyu","kik", "",\r
+       "Kimbundu","kmb", "",\r
+       "Kinyarwanda","kin", "rw",\r
+       "Kirghiz","kir", "ky",\r
+       "Komi","kom", "",\r
+       "Kongo","kon" , "",\r
+       "Konkani","kok" , "",\r
+       "Korean","kor", "ko",\r
+       "Kosraean","kos" , "",\r
+       "Kpelle","kpe" , "",\r
+       "Kru","kro" , "",\r
+       "Kuanyama","kua", "",\r
+       "Kumyk","kum" , "",\r
+       "Kurdish","kur", "ku",\r
+       "Kurukh","kru" , "",\r
+       "Kutenai","kut", "",\r
+       "Kwanyama","kua", "",\r
+       "Ladino","lad" , "",\r
+       "Lahnda","lah" , "",\r
+       "Lamba","lam" , "",\r
+       "Lao","lao", "lo",\r
+       "Latin","lat", "la",\r
+       "Latvian","lav", "lv",\r
+       "Letzeburgesch","ltz", "",\r
+       "Lezghian (lezLimburgan - limLimburger - limlimburgish)","lim", "",\r
+       "Lingala","lin", "ln",\r
+       "Lithuanian","lit", "lt",\r
+       "Low German","nds", "",\r
+       "Low Saxon","nds", "",\r
+       "Lozi","loz" , "",\r
+       "Luba-Katanga","lub" , "",\r
+       "Luba-Lulua","lua" , "",\r
+       "Luiseno","lui", "",\r
+       "Lule Sami","smj", "",\r
+       "Lunda","lun" , "",\r
+       "Luo (Kenya and Tanzania)","luo", "",\r
+       "Luxembourgish","ltz", "",\r
+       "Lushai","lus" , "",\r
+       "Macedonian","mac/mkd", "mk",\r
+       "Madurese","mad" , "",\r
+       "Magahi","mag" , "",\r
+       "Maithili","mai", "",\r
+       "Makasar","mak", "",\r
+       "Malagasy","mlg", "mg",\r
+       "Malay","may/msa", "ms",\r
+       "Malayalam","mal", "",\r
+       "Maltese","mlt", "ml",\r
+       "Manchu","mnc", "",\r
+       "Mandar","mdr", "",\r
+       "Mandingo","man", "",\r
+       "Manipuri","mni" , "",\r
+       "Manobo languages","mno" , "",\r
+       "Manx","glv", "",\r
+       "Maori","mao/mri", "mi",\r
+       "Marathi","mar", "mr",\r
+       "Mari","chm" , "",\r
+       "Marshallese","mah", "",\r
+       "Marwari","mwr" , "",\r
+       "Masai","mas" , "",\r
+       "Mayan languages","myn" , "",\r
+       "Mende","men" , "",\r
+       "Micmac","mic" , "",\r
+       "Minangkabau","min" , "",\r
+       "Miscellaneous languages","mis" , "",\r
+       "Mohawk","moh" , "",\r
+       "Moksha","mdf", "",\r
+       "Moldavian","mol", "mo",\r
+       "Mon-Khmer (Other)","mkh" , "",\r
+       "Mongo","lol" , "",\r
+       "Mongolian","mon", "mn",\r
+       "Mossi","mos" , "",\r
+       "Multiple languages","mul" , "",\r
+       "Munda languages","mun" , "",\r
+       "Nahuatl","nah" , "",\r
+       "Nauru","nau", "na",\r
+       "Navaho","nav", "",\r
+       "Navajo","nav", "",\r
+       "Ndebele, North","nde", "",\r
+       "Ndebele, South","nbl", "",\r
+       "Ndonga, ndoNeapolitan","nap", "",\r
+       "Nepali","nep", "ne",\r
+       "Newari","new" , "",\r
+       "Nias","nia" , "",\r
+       "Niger-Kordofanian (Other)","nic", "",\r
+       "Nilo-Saharan (Other)","ssa" , "",\r
+       "Niuean","niu" , "",\r
+       "Nogai","nog", "",\r
+       "Norse, Old","non", "",\r
+       "North American Indian (Other)","nai" , "",\r
+       "Northern Sami","sme", "",\r
+       "North Ndebele","nde", "",\r
+       "Norwegian","nor", "no",\r
+       "Norwegian Bokmål","nob", "",\r
+       "Norwegian Nynorsk","nno", "",\r
+       "Nubian languages","nub" , "",\r
+       "Nyamwezi","nym" , "",\r
+       "Nyanja","nya", "",\r
+       "Nyankole","nyn", "",\r
+       "Nynorsk, Norwegian","nno" , "",\r
+       "Nyoro","nyo" , "",\r
+       "Nzima","nzi" , "",\r
+       "Occitan (post 1500)","oci", "oc",\r
+       "Ojibwa","oji" , "",\r
+       "Old Bulgarian","chu", "",\r
+       "Old Church Slavonic","chu", "",\r
+       "Old Slavonic","chu", "",\r
+       "Oriya","ori", "or",\r
+       "Oromo","orm", "om",\r
+       "Osage","osa", "",\r
+       "Ossetian - Ossetic","oss", "",\r
+       "Otomian languages","oto", "",\r
+       "Pahlavi","pal" , "",\r
+       "Palauan","pau", "",\r
+       "Pali","pli", "",\r
+       "Pampanga","pam", "",\r
+       "Pangasinan","pag", "",\r
+       "Panjabi","pan", "pa",\r
+       "Papiamento","pap" , "",\r
+       "Papuan (Other)","paa" , "",\r
+       "Persian","per/fas", "fa",\r
+       "Persian, Old (ca.600-400)","peo" , "",\r
+       "Philippine (Other)","phi" , "",\r
+       "Phoenician","phn" , "",\r
+       "Pohnpeian","pon" , "",\r
+       "Polish","pol", "pl",\r
+       "Portuguese","por", "pt",\r
+       "Prakrit languages","pra", "",\r
+       "Provençal","oci", "",\r
+       "Provençal, Old (to 1500)","pro" , "",\r
+       "Pushto","pus", "ps",\r
+       "Quechua","que", "qu",\r
+       "Raeto-Romance","roh", "rm",\r
+       "Rajasthani","raj", "",\r
+       "Rapanui","rap", "",\r
+       "Rarotongan","rar", "",\r
+       "Romance (Other)","roa", "",\r
+       "Romanian","rum/ron", "ro",\r
+       "Romany","rom" , "",\r
+       "Rundi","run", "rn",\r
+       "Russian","rus", "ru",\r
+       "Salishan languages","sal" , "",\r
+       "Samaritan Aramaic","sam" , "",\r
+       "Sami languages (Other)","smi" , "",\r
+       "Samoan","smo", "sm",\r
+       "Sandawe","sad" , "",\r
+       "Sango","sag", "sg",\r
+       "Sanskrit","san", "sa",\r
+       "Santali","sat", "",\r
+       "Sardinian","srd", "",\r
+       "Sasak","sas" , "",\r
+       "Saxon, Low","nds", "",\r
+       "Scots","sco", "",\r
+       "Scottish Gaelic","gla"  , "",\r
+       "Selkup","sel" , "",\r
+       "Semitic (Other)","sem" , "",\r
+       "Serbian","srp", "sr",\r
+       "Serbo-Croatian", "scr", "sh",\r
+       "Serer","srr" , "",\r
+       "Shan","shn" , "",\r
+       "Shona","sna", "sn",\r
+       "Sichuan Yi","iii", "",\r
+       "Sidamo","sid" , "",\r
+       "Sign languages","sgn" , "",\r
+       "Siksika","bla" , "",\r
+       "Sindhi","snd", "sd",\r
+       "Sinhalese","sin", "si",\r
+       "Sino-Tibetan (Other)","sit", "",\r
+       "Siouan languages","sio", "",\r
+       "Skolt Sami","sms" , "",\r
+       "Slave (Athapascan)","den" , "",\r
+       "Slavic (Other)","sla" , "",\r
+       "Slovak","slo", "sk",\r
+       "Slovenian","slv", "sl",\r
+       "Sogdian","sog" , "",\r
+       "Somali","som", "so",\r
+       "Songhai","son" , "",\r
+       "Soninke","snk" , "",\r
+       "Sorbian languages","wen" , "",\r
+       "Sotho, Northern","nso" , "",\r
+       "Sotho, Southern","sot", "st",\r
+       "South American Indian (Other)","sai" , "",\r
+       "Southern Sami","sma", "",\r
+       "South Ndebele","nbl", "",\r
+       "Spanish","spa", "es",\r
+       "Sukuma","suk", "",\r
+       "Sumerian","sux" , "",\r
+       "Sundanese","sun", "su",\r
+       "Susu","sus" , "",\r
+       "Swahili","swa", "sw",\r
+       "Swati","ssw", "ss",\r
+       "Swedish","swe", "sv",\r
+       "Syriac","syr", "",\r
+       "Tagalog","tgl", "tl",\r
+       "Tahitian","tah", "",\r
+       "Tai (Other)","tai" , "",\r
+       "Tajik","tgk", "tg",\r
+       "Tamashek","tmh" , "",\r
+       "Tamil","tam", "ta",\r
+       "Tatar","tat", "tt",\r
+       "Telugu","tel", "te",\r
+       "Tereno","ter" , "",\r
+       "Tetum","tet" , "",\r
+       "Thai","tha", "th",\r
+       "Tibetan","tib", "bo",\r
+       "Tigre","tig" , "",\r
+       "Tigrinya","tir", "ti",\r
+       "Timne","tem" , "",\r
+       "Tiv","tiv" , "",\r
+       "Tlingit","tli" , "",\r
+       "Tok Pisin","tpi" , "",\r
+       "Tokelau","tkl" , "",\r
+       "Tonga (Nyasa)","tog" , "to",\r
+       "Tonga (Tonga Islands)","ton", "",\r
+       "Tsimshian","tsi" , "",\r
+       "Tsonga","tso", "ts",\r
+       "Tswana","tsn", "tn",\r
+       "Tumbuka","tum" , "",\r
+       "Tupi languages","tup", "",\r
+       "Turkish","tur", "tr",\r
+       "Turkish, Ottoman (1500-1928)","ota" , "",\r
+       "Turkmen","tuk", "tk",\r
+       "Tuvalu","tvl", "",\r
+       "Tuvinian","tyv" , "",\r
+       "Twi","twi", "tw",\r
+       "Udmurt (udmUgaritic)","uga" , "",\r
+       "Uighur","uig", "ug",\r
+       "Ukrainian","ukr", "uk",\r
+       "Umbundu","umb" , "",\r
+       "Undetermined","und", "",\r
+       "Urdu","urd", "ur",\r
+       "Uzbek","uzb", "uz",\r
+       "Vai","vai", "",\r
+       "Venda","ven" , "",\r
+       "Vietnamese","vie", "vi",\r
+       "Volapük","vol", "vo",\r
+       "Votic","vot", "",\r
+       "Wakashan languages","wak" , "",\r
+       "Walamo","wal" , "",\r
+       "Walloon","wln", "",\r
+       "Waray","war", "",\r
+       "Washo","was" , "",\r
+       "Welsh","wel", "cy",\r
+       "Wolof","wol", "wo",\r
+       "Xhosa","xho", "xh",\r
+       "Yakut","sah" , "",\r
+       "Yao","yao" , "",\r
+       "Yapese","yap", "",\r
+       "Yiddish","yid", "yi",\r
+       "Yoruba","yor", "yo",\r
+       "Yupik languages","ypk" , "",\r
+       "Zande","znd" , "",\r
+       "Zapotec","zap" , "",\r
+       "Zenaga","zen" , "",\r
+       "Zhuang","zha", "za",\r
+       "Zulu","zul", "zu",\r
+       "Zuni","zun", "",\r
+       NULL\r
+};\r
+\r
+\r
+#endif\r
diff --git a/tstools/DtsEdit/src/gpac/isomedia.h b/tstools/DtsEdit/src/gpac/isomedia.h
new file mode 100644 (file)
index 0000000..bcd329f
--- /dev/null
@@ -0,0 +1,1852 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / ISO Media File Format sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+\r
+\r
+#ifndef _GF_ISOMEDIA_H_\r
+#define _GF_ISOMEDIA_H_\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+\r
+#include <gpac/mpeg4_odf.h>\r
+\r
+\r
+/*the isomedia file*/\r
+typedef struct __tag_isom GF_ISOFile;\r
+\r
+/*media sample object*/\r
+typedef struct\r
+{\r
+       /*data size*/\r
+       u32 dataLength;\r
+       /*data with padding if requested*/\r
+       char *data;\r
+       /*decoding time*/\r
+       u64 DTS;\r
+       /*relative offset for composition if needed*/\r
+       u32 CTS_Offset;\r
+       /*Random Access Point flag:\r
+        0: not random access\r
+        1: regular RAP, \r
+        2: sample is a redundant RAP. If set when adding the sample, this will create a sample dependency entry\r
+       */\r
+       u8 IsRAP;\r
+} GF_ISOSample;\r
+\r
+\r
+/*creates a new empty sample*/\r
+GF_ISOSample *gf_isom_sample_new();\r
+\r
+/*delete a sample. NOTE:the buffer content will be destroyed by default.\r
+if you wish to keep the buffer, set dataLength to 0 in the sample \r
+before deleting it\r
+the pointer is set to NULL after deletion*/\r
+void gf_isom_sample_del(GF_ISOSample **samp);\r
+\r
+\r
+\r
+/********************************************************************\r
+                               FILE FORMAT CONSTANTS\r
+********************************************************************/\r
+\r
+/*Modes for file opening\r
+               NOTE 1: All the READ function in this API can be used in EDIT/WRITE mode. \r
+However, some unexpected errors or values may happen in that case, depending\r
+on how much modifications you made (timing, track with 0 samples, ...)\r
+               On the other hand, none of the EDIT/WRITE functions will work in \r
+READ mode.\r
+               NOTE 2: The output structure of a edited file will sometimes be different \r
+from the original file, but the media-data and meta-data will be identical.\r
+The only change happens in the file media-data container(s) during edition\r
+               NOTE 3: when editing the file, you MUST set the final name of the modified file\r
+to something different. This API doesn't allow file overwriting.\r
+*/\r
+enum \r
+{\r
+       /*Opens file for dumping: same as read-only but keeps all movie fragments info untouched*/\r
+       GF_ISOM_OPEN_READ_DUMP = 0,\r
+       /*Opens a file in READ ONLY mode*/\r
+       GF_ISOM_OPEN_READ,\r
+       /*Opens a file in WRITE ONLY mode. Media Data is captured on the fly. In this mode, \r
+       the editing functions are disabled.*/\r
+       GF_ISOM_OPEN_WRITE,\r
+       /*Opens an existing file in EDIT mode*/\r
+       GF_ISOM_OPEN_EDIT,\r
+       /*Creates a new file in EDIT mode*/\r
+       GF_ISOM_WRITE_EDIT\r
+};\r
+\r
+/*Movie Options for file writing*/\r
+enum\r
+{\r
+       /*FLAT: the MediaData (MPEG4 ESs) is stored at the begining of the file*/\r
+       GF_ISOM_STORE_FLAT = 1,\r
+       /*STREAMABLE: the MetaData (File Info) is stored at the begining of the file \r
+       for fast access during download*/\r
+       GF_ISOM_STORE_STREAMABLE,\r
+       /*INTERLEAVED: Same as STREAMABLE, plus the media data is mixed by chunk  of fixed duration*/\r
+       GF_ISOM_STORE_INTERLEAVED,\r
+       /*INTERLEAVED +DRIFT: Same as INTERLEAVED, and adds time drift control to avoid creating too long chunks*/\r
+       GF_ISOM_STORE_DRIFT_INTERLEAVED,\r
+       /*tightly interleaves samples based on their DTS, therefore allowing better placement of samples in the file.\r
+       This is used for both http interleaving and Hinting optimizations*/\r
+       GF_ISOM_STORE_TIGHT\r
+\r
+};\r
+\r
+/*Some track may depend on other tracks for several reasons. They reference these tracks \r
+through the following Reference Types*/\r
+enum\r
+{\r
+       /*ref type for the OD track dependencies*/\r
+       GF_ISOM_REF_OD                  = GF_4CC( 'm', 'p', 'o', 'd' ),\r
+       /*ref type for stream dependencies*/\r
+       GF_ISOM_REF_DECODE = GF_4CC( 'd', 'p', 'n', 'd' ),\r
+       /*ref type for OCR (Object Clock Reference) dependencies*/\r
+       GF_ISOM_REF_OCR                         = GF_4CC( 's', 'y', 'n', 'c' ),\r
+       /*ref type for IPI (Intellectual Property Information) dependencies*/\r
+       GF_ISOM_REF_IPI                         = GF_4CC( 'i', 'p', 'i', 'r' ),\r
+       /*ref type for timed Meta Data tracks*/\r
+       GF_ISOM_REF_META                = GF_4CC( 'c', 'd', 's', 'c' ),\r
+       /*ref type for Hint tracks*/\r
+       GF_ISOM_REF_HINT                = GF_4CC( 'h', 'i', 'n', 't' ),\r
+       /*ref type for QT Chapter tracks*/\r
+       GF_ISOM_REF_CHAP                = GF_4CC( 'c', 'h', 'a', 'p' )\r
+};\r
+\r
+/*Track Edition flag*/\r
+enum {\r
+       /*empty segment in the track (no media for this segment)*/\r
+       GF_ISOM_EDIT_EMPTY              =       0x00,\r
+       /*dwelled segment in the track (one media sample for this segment)*/\r
+       GF_ISOM_EDIT_DWELL              =       0x01,\r
+       /*normal segment in the track*/\r
+       GF_ISOM_EDIT_NORMAL             =       0x02\r
+};\r
+\r
+/*Generic Media Types (YOU HAVE TO USE ONE OF THESE TYPES FOR COMPLIANT ISO MEDIA FILES)*/\r
+enum\r
+{\r
+       /*base media types*/\r
+       GF_ISOM_MEDIA_VISUAL    = GF_4CC( 'v', 'i', 'd', 'e' ),\r
+       GF_ISOM_MEDIA_AUDIO             = GF_4CC( 's', 'o', 'u', 'n' ),\r
+       GF_ISOM_MEDIA_HINT              = GF_4CC( 'h', 'i', 'n', 't' ),\r
+       GF_ISOM_MEDIA_META              = GF_4CC( 'm', 'e', 't', 'a' ),\r
+       GF_ISOM_MEDIA_TEXT              = GF_4CC( 't', 'e', 'x', 't' ),\r
+       GF_ISOM_MEDIA_SUBPIC    = GF_4CC( 's', 'u', 'b', 'p' ),\r
+\r
+       /*MPEG-4 media types*/\r
+       GF_ISOM_MEDIA_OD                = GF_4CC( 'o', 'd', 's', 'm' ),\r
+       GF_ISOM_MEDIA_OCR               = GF_4CC( 'c', 'r', 's', 'm' ),\r
+       GF_ISOM_MEDIA_SCENE             = GF_4CC( 's', 'd', 's', 'm' ),\r
+       GF_ISOM_MEDIA_MPEG7             = GF_4CC( 'm', '7', 's', 'm' ),\r
+       GF_ISOM_MEDIA_OCI               = GF_4CC( 'o', 'c', 's', 'm' ),\r
+       GF_ISOM_MEDIA_IPMP              = GF_4CC( 'i', 'p', 's', 'm' ),\r
+       GF_ISOM_MEDIA_MPEGJ             = GF_4CC( 'm', 'j', 's', 'm' ),\r
+       /*GPAC-defined, for any track using MPEG-4 systems signaling but with undefined streaml types*/\r
+       GF_ISOM_MEDIA_ESM               = GF_4CC( 'g', 'e', 's', 'm' ),\r
+\r
+       /*DIMS media type (same as scene but with a different mediaInfo)*/\r
+       GF_ISOM_MEDIA_DIMS              = GF_4CC( 'd', 'i', 'm', 's' ),\r
+\r
+       GF_ISOM_MEDIA_FLASH             = GF_4CC( 'f', 'l', 's', 'h' )\r
+};\r
+\r
+/* Encryption Scheme Type in the SchemeTypeInfoBox */\r
+enum \r
+{\r
+       GF_ISOM_ISMACRYP_SCHEME = GF_4CC( 'i', 'A', 'E', 'C' )\r
+};\r
+\r
+/*specific media sub-types - you shall make sure the media sub type is what you expect*/\r
+enum\r
+{\r
+       /*reserved, internal use in the lib. Indicates the track complies to MPEG-4 system\r
+       specification, and the usual OD framework tools may be used*/\r
+       GF_ISOM_SUBTYPE_MPEG4           = GF_4CC( 'M', 'P', 'E', 'G' ),\r
+       \r
+       /*reserved, internal use in the lib. Indicates the track is of GF_ISOM_SUBTYPE_MPEG4\r
+       but it is encrypted.*/\r
+       GF_ISOM_SUBTYPE_MPEG4_CRYP      = GF_4CC( 'E', 'N', 'C', 'M' ),\r
+\r
+       /*AVC/H264 media type - not listed as an MPEG-4 type, ALTHOUGH this library automatically remaps\r
+       GF_AVCConfig to MPEG-4 ESD*/\r
+       GF_ISOM_SUBTYPE_AVC_H264                = GF_4CC( 'a', 'v', 'c', '1' ),\r
+\r
+       /*3GPP(2) extension subtypes*/\r
+       GF_ISOM_SUBTYPE_3GP_H263                = GF_4CC( 's', '2', '6', '3' ),\r
+       GF_ISOM_SUBTYPE_3GP_AMR         = GF_4CC( 's', 'a', 'm', 'r' ),\r
+       GF_ISOM_SUBTYPE_3GP_AMR_WB      = GF_4CC( 's', 'a', 'w', 'b' ),\r
+       GF_ISOM_SUBTYPE_3GP_EVRC                = GF_4CC( 's', 'e', 'v', 'c' ),\r
+       GF_ISOM_SUBTYPE_3GP_QCELP       = GF_4CC( 's', 'q', 'c', 'p' ),\r
+       GF_ISOM_SUBTYPE_3GP_SMV         = GF_4CC( 's', 's', 'm', 'v' ),\r
+\r
+       /*3GPP DIMS*/\r
+       GF_ISOM_SUBTYPE_3GP_DIMS        = GF_4CC( 'd', 'i', 'm', 's' ),\r
+\r
+       GF_ISOM_SUBTYPE_AC3                     = GF_4CC( 'a', 'c', '-', '3' ),\r
+};\r
+\r
+\r
+\r
+\r
+/*direction for sample search (including SyncSamples search)\r
+Function using search allways specify the desired time in composition (presentation) time\r
+\r
+               (Sample N-1)    DesiredTime             (Sample N)\r
+\r
+FORWARD: will give the next sample given the desired time (eg, N)\r
+BACKWARD: will give the previous sample given the desired time (eg, N-1)\r
+SYNCFORWARD: will search from the desired point in time for a sync sample if any\r
+               If no sync info, behaves as FORWARD\r
+SYNCBACKWARD: will search till the desired point in time for a sync sample if any\r
+               If no sync info, behaves as BACKWARD\r
+SYNCSHADOW: use the sync shadow information to retrieve the sample.\r
+               If no SyncShadow info, behave as SYNCBACKWARD\r
+*/\r
+enum\r
+{\r
+       GF_ISOM_SEARCH_FORWARD          =       1,\r
+       GF_ISOM_SEARCH_BACKWARD         =       2,\r
+       GF_ISOM_SEARCH_SYNC_FORWARD     =       3,\r
+       GF_ISOM_SEARCH_SYNC_BACKWARD    =       4,\r
+       GF_ISOM_SEARCH_SYNC_SHADOW              =       5\r
+};\r
+\r
+/*Predefined File Brand codes (MPEG-4 and JPEG2000)*/\r
+enum\r
+{\r
+       /*file complying to the generic ISO Media File (base specification ISO/IEC 14496-12)\r
+       this is the default brand when creating a new movie*/\r
+       GF_ISOM_BRAND_ISOM = GF_4CC( 'i', 's', 'o', 'm' ),\r
+       /*file complying to the generic ISO Media File (base specification ISO/IEC 14496-12) + Meta extensions*/\r
+       GF_ISOM_BRAND_ISO2 =  GF_4CC( 'i', 's', 'o', '2' ),\r
+       /*file complying to ISO/IEC 14496-1 2001 edition. A .mp4 file without a brand\r
+       is equivalent to a file compatible with this brand*/\r
+       GF_ISOM_BRAND_MP41 = GF_4CC( 'm', 'p', '4', '1' ),\r
+       /*file complying to ISO/IEC 14496-14 (MP4 spec)*/\r
+       GF_ISOM_BRAND_MP42 = GF_4CC( 'm', 'p', '4', '2' ),\r
+       /*file complying to ISO/IEC 15444-3 (JPEG2000) without profile restriction*/\r
+       GF_ISOM_BRAND_MJP2 = GF_4CC( 'm', 'j', 'p', '2' ),\r
+       /*file complying to ISO/IEC 15444-3 (JPEG2000) with simple profile restriction*/\r
+       GF_ISOM_BRAND_MJ2S = GF_4CC( 'm', 'j', '2', 's' ),\r
+       /*old versions of 3GPP spec (without timed text)*/\r
+       GF_ISOM_BRAND_3GP4 = GF_4CC('3', 'g', 'p', '4'),\r
+       GF_ISOM_BRAND_3GP5 = GF_4CC('3', 'g', 'p', '5'),\r
+       /*final version of 3GPP file spec*/\r
+       GF_ISOM_BRAND_3GP6 = GF_4CC('3', 'g', 'p', '6'),\r
+       /*generci 3GPP file (several audio tracks, etc..)*/\r
+       GF_ISOM_BRAND_3GG6 = GF_4CC('3', 'g', 'g', '6'),\r
+       /*3GPP2 file spec*/\r
+       GF_ISOM_BRAND_3G2A = GF_4CC('3', 'g', '2', 'a'),\r
+       /*AVC file spec*/\r
+       GF_ISOM_BRAND_AVC1 = GF_4CC('a', 'v', 'c', '1'),\r
+       /* file complying to ISO/IEC 21000-9:2005 (MPEG-21 spec)*/\r
+       GF_ISOM_BRAND_MP21 = GF_4CC('m', 'p', '2', '1'),\r
+};\r
+\r
+\r
+/*MPEG-4 ProfileAndLevel codes*/\r
+enum\r
+{\r
+       GF_ISOM_PL_AUDIO,\r
+       GF_ISOM_PL_VISUAL,\r
+       GF_ISOM_PL_GRAPHICS,\r
+       GF_ISOM_PL_SCENE,\r
+       GF_ISOM_PL_OD,\r
+       GF_ISOM_PL_MPEGJ,\r
+       /*not a profile, just set/unset inlineFlag*/\r
+       GF_ISOM_PL_INLINE,\r
+};\r
+\r
+\r
+/********************************************************************\r
+                               GENERAL API FUNCTIONS\r
+********************************************************************/\r
+\r
+/*get the last fatal error that occured in the file\r
+ANY FUNCTION OF THIS API WON'T BE PROCESSED IF THE FILE HAS AN ERROR\r
+Note: some function may return an error while the movie has no error\r
+the last error is a FatalError, and is not always set if a bad \r
+param is specified...*/\r
+GF_Err gf_isom_last_error(GF_ISOFile *the_file);\r
+\r
+/*returns 1 if target file is an IsoMedia file, 0 otherwise*/\r
+Bool gf_isom_probe_file(const char *fileName);\r
+\r
+/*Opens an isoMedia File.\r
+tmp_dir: for the 2 edit modes only, specifies a location for temp file. If NULL, the librairy will use the default\r
+OS temporary file management schemes.*/\r
+GF_ISOFile *gf_isom_open(const char *fileName, u32 OpenMode, const char *tmp_dir);\r
+\r
+/*close the file, write it if new/edited*/\r
+GF_Err gf_isom_close(GF_ISOFile *the_file);\r
+\r
+/*delete the movie without saving it.*/\r
+void gf_isom_delete(GF_ISOFile *the_file);\r
+\r
+/*Get the mode of an open file*/\r
+u8 gf_isom_get_mode(GF_ISOFile *the_file);\r
+\r
+Bool gf_isom_is_JPEG2000(GF_ISOFile *mov);\r
+\r
+/********************************************************************\r
+                               STREAMING API FUNCTIONS\r
+********************************************************************/\r
+/*open a movie that can be uncomplete in READ_ONLY mode\r
+to use for http streaming & co\r
+\r
+NOTE: you must buffer the data to a local file, this mode DOES NOT handle \r
+http/ftp/... streaming\r
+\r
+BytesMissing is the predicted number of bytes missing for the file to be loaded\r
+Note that if the file is not optimized for streaming, this number is not accurate\r
+If the movie is successfully loaded (the_file non-NULL), BytesMissing is zero\r
+*/\r
+GF_Err gf_isom_open_progressive(const char *fileName, GF_ISOFile **the_file, u64 *BytesMissing);\r
+\r
+/*If requesting a sample fails with error GF_ISOM_INCOMPLETE_FILE, use this function\r
+to get the number of bytes missing to retrieve the sample*/\r
+u64 gf_isom_get_missing_bytes(GF_ISOFile *the_file, u32 trackNumber);\r
+\r
+\r
+/*Fragmented movie extensions*/\r
+\r
+/*return 0 if movie isn't fragmented, 1 otherwise*/\r
+u32 gf_isom_is_fragmented(GF_ISOFile *the_file);\r
+/*return 0 if track isn't fragmented, 1 otherwise*/\r
+u32 gf_isom_is_track_fragmented(GF_ISOFile *the_file, u32 TrackID);\r
+\r
+/*a file being downloaded may be a fragmented file. In this case only partial info \r
+is available once the file is successfully open (gf_isom_open_progressive), and since there is \r
+no information wrt number fragments (which could actually be generated on the fly \r
+at the sender side), you must call this function on regular bases in order to\r
+load newly downloaded fragments. Note this may result in Track/Movie duration changes\r
+and SampleCount change too ...*/\r
+GF_Err gf_isom_refresh_fragmented(GF_ISOFile *the_file, u64 *MissingBytes);\r
+\r
+/*check if file has movie info, eg has tracks & dynamic media. Some files may just use\r
+the base IsoMedia structure without "moov" container*/\r
+Bool gf_isom_has_movie(GF_ISOFile *file);\r
+\r
+/********************************************************************\r
+                               READING API FUNCTIONS\r
+********************************************************************/\r
+\r
+/*return the number of tracks in the movie, or -1 if error*/\r
+u32 gf_isom_get_track_count(GF_ISOFile *the_file);\r
+\r
+/*return the timescale of the movie, 0 if error*/\r
+u32 gf_isom_get_timescale(GF_ISOFile *the_file);\r
+\r
+/*return the duration of the movie, 0 if error*/\r
+u64 gf_isom_get_duration(GF_ISOFile *the_file);\r
+\r
+/*return the creation info of the movie*/\r
+GF_Err gf_isom_get_creation_time(GF_ISOFile *the_file, u64 *creationTime, u64 *modificationTime);\r
+\r
+/*return the trackID of track number n, or 0 if error*/\r
+u32 gf_isom_get_track_id(GF_ISOFile *the_file, u32 trackNumber);\r
+\r
+/*return the track number of the track of specified ID, or 0 if error*/\r
+u32 gf_isom_get_track_by_id(GF_ISOFile *the_file, u32 trackID);\r
+\r
+/*gets the enable flag of a track 0: NO, 1: yes, 2: error*/\r
+u8 gf_isom_is_track_enabled(GF_ISOFile *the_file, u32 trackNumber);\r
+\r
+/* determines if the track is encrypted 0: NO, 1: yes, 2: error*/\r
+u8 gf_isom_is_track_encrypted(GF_ISOFile *the_file, u32 trackNumber);\r
+\r
+/*get the track duration return 0 if bad param*/\r
+u64 gf_isom_get_track_duration(GF_ISOFile *the_file, u32 trackNumber);\r
+\r
+/*return the media type FOUR CHAR code type of the media*/\r
+u32 gf_isom_get_media_type(GF_ISOFile *the_file, u32 trackNumber);\r
+\r
+/*return the media type FOUR CHAR code type of the media*/\r
+u32 gf_isom_get_media_subtype(GF_ISOFile *the_file, u32 trackNumber, u32 DescriptionIndex);\r
+\r
+/*return the media type FOUR CHAR code type of an MPEG4 media (eg, mp4a, mp4v, enca, encv, etc...)\r
+returns 0 if not MPEG-4 subtype*/\r
+u32 gf_isom_get_mpeg4_subtype(GF_ISOFile *the_file, u32 trackNumber, u32 DescriptionIndex);\r
+\r
+/*Get the media (composition) time given the absolute time in the Movie\r
+mediaTime is set to 0 if the media is not playing at that time (empty time segment)*/\r
+GF_Err gf_isom_get_media_time(GF_ISOFile *the_file, u32 trackNumber, u32 movieTime, u64 *MediaTime);\r
+\r
+/*Get the number of "streams" stored in the media - a media can have several stream descriptions...*/\r
+u32 gf_isom_get_sample_description_count(GF_ISOFile *the_file, u32 trackNumber);\r
+\r
+/*Get the stream description index (eg, the ESD) for a given time IN MEDIA TIMESCALE\r
+return 0 if error or if empty*/\r
+u32 gf_isom_get_sample_description_index(GF_ISOFile *the_file, u32 trackNumber, u64 for_time);\r
+\r
+/*returns 1 if samples refering to the given stream description are present in the file\r
+0 otherwise*/\r
+Bool gf_isom_is_self_contained(GF_ISOFile *the_file, u32 trackNumber, u32 sampleDescriptionIndex);\r
+\r
+/*get the media duration (without edit) return 0 if no samples (URL streams)*/\r
+u64 gf_isom_get_media_duration(GF_ISOFile *the_file, u32 trackNumber);\r
+\r
+/*Get the timeScale of the media. */\r
+u32 gf_isom_get_media_timescale(GF_ISOFile *the_file, u32 trackNumber);\r
+\r
+/*return the maximum chunk duration of the track in milliseconds*/\r
+u32 gf_isom_get_max_chunk_duration(GF_ISOFile *the_file, u32 trackNumber);\r
+\r
+/*Get the HandlerDescription name. The outName must be:\r
+                (outName != NULL && *outName == NULL)\r
+the handler name is the string version of the MediaTypes*/\r
+GF_Err gf_isom_get_handler_name(GF_ISOFile *the_file, u32 trackNumber, const char **outName);\r
+\r
+/*Check a DataReference of this track (index >= 1)\r
+A Data Reference allows to construct a file without integrating the media data*/\r
+GF_Err gf_isom_check_data_reference(GF_ISOFile *the_file, u32 trackNumber, u32 StreamDescriptionIndex);\r
+\r
+/*get the location of the data. If URL && URN are NULL, the data is in this file\r
+both strings are const: don't free them.*/\r
+GF_Err gf_isom_get_data_reference(GF_ISOFile *the_file, u32 trackNumber, u32 StreamDescriptionIndex, const char **outURL, const char **outURN);\r
+\r
+/*Get the number of samples - return 0 if error*/\r
+u32 gf_isom_get_sample_count(GF_ISOFile *the_file, u32 trackNumber);\r
+\r
+/*Get constant sample size, or 0 if size not constant*/\r
+u32 gf_isom_get_constant_sample_size(GF_ISOFile *the_file, u32 trackNumber);\r
+/*returns total amount of media bytes in track*/\r
+u64 gf_isom_get_media_data_size(GF_ISOFile *the_file, u32 trackNumber);\r
+\r
+/*It may be desired to fetch samples with a bigger allocated buffer than their real size, in case the decoder\r
+reads more data than available. This sets the amount of extra bytes to allocate when reading samples from this track\r
+NOTE: the dataLength of the sample does NOT include padding*/\r
+GF_Err gf_isom_set_sample_padding(GF_ISOFile *the_file, u32 trackNumber, u32 padding_bytes);\r
+\r
+/*return a sample given its number, and set the StreamDescIndex of this sample\r
+this index allows to retrieve the stream description if needed (2 media in 1 track)\r
+return NULL if error*/\r
+GF_ISOSample *gf_isom_get_sample(GF_ISOFile *the_file, u32 trackNumber, u32 sampleNumber, u32 *StreamDescriptionIndex);\r
+\r
+/*same as gf_isom_get_sample but doesn't fetch media data\r
+@StreamDescriptionIndex (optional): set to stream description index\r
+@data_offset (optional): set to sample start offset in file.\r
+       \r
+         NOTE: when both StreamDescriptionIndex and data_offset are NULL, only DTS, CTS_Offset and RAP indications are \r
+retrieved (faster)\r
+*/\r
+GF_ISOSample *gf_isom_get_sample_info(GF_ISOFile *the_file, u32 trackNumber, u32 sampleNumber, u32 *StreamDescriptionIndex, u64 *data_offset);\r
+\r
+/*retrieves given sample DTS*/\r
+u64 gf_isom_get_sample_dts(GF_ISOFile *the_file, u32 trackNumber, u32 sampleNumber);\r
+\r
+/*returns sample duration in media timeScale*/\r
+u32 gf_isom_get_sample_duration(GF_ISOFile *the_file, u32 trackNumber, u32 sampleNumber);\r
+\r
+/*gets a sample given a desired decoding time IN MEDIA TIME SCALE\r
+and set the StreamDescIndex of this sample\r
+this index allows to retrieve the stream description if needed (2 media in 1 track)\r
+return GF_EOS if the desired time exceeds the media duration\r
+WARNING: the sample may not be sync even though the sync was requested (depends on the media and the editList)\r
+the SampleNum is optional. If non-NULL, will contain the sampleNumber*/\r
+GF_Err gf_isom_get_sample_for_media_time(GF_ISOFile *the_file, u32 trackNumber, u64 desiredTime, u32 *StreamDescriptionIndex, u8 SearchMode, GF_ISOSample **sample, u32 *SampleNum);\r
+\r
+/*retrieves given sample DTS*/\r
+u32 gf_isom_get_sample_from_dts(GF_ISOFile *the_file, u32 trackNumber, u64 dts);\r
+\r
+/*Track Edition functions*/\r
+\r
+/*return a sample given a desired time in the movie. MovieTime is IN MEDIA TIME SCALE , handles edit list.\r
+and set the StreamDescIndex of this sample\r
+this index allows to retrieve the stream description if needed (2 media in 1 track)\r
+sample must be set to NULL before calling. \r
+\r
+result Sample is NULL if an error occured\r
+if no sample is playing, an empty sample is returned with no data and a DTS set to MovieTime when serching in sync modes\r
+if no sample is playing, the closest sample in the edit time-line is returned when serching in regular modes\r
+\r
+WARNING: the sample may not be sync even though the sync was requested (depends on the media and the editList)\r
+\r
+Note: this function will handle re-timestamping the sample according to the mapping  of the media time-line \r
+on the track time-line. The sample TSs (DTS / CTS offset) are expressed in MEDIA TIME SCALE \r
+(to match the media stream TS resolution as indicated in media header / SLConfig)\r
+\r
+sampleNumber is optional and gives the number of the sample in the media\r
+*/\r
+GF_Err gf_isom_get_sample_for_movie_time(GF_ISOFile *the_file, u32 trackNumber, u64 movieTime, u32 *StreamDescriptionIndex, u8 SearchMode, GF_ISOSample **sample, u32 *sampleNumber);\r
+\r
+/*get the number of edited segment*/\r
+u32 gf_isom_get_edit_segment_count(GF_ISOFile *the_file, u32 trackNumber);\r
+\r
+/*Get the desired segment information*/\r
+GF_Err gf_isom_get_edit_segment(GF_ISOFile *the_file, u32 trackNumber, u32 SegmentIndex, u64 *EditTime, u64 *SegmentDuration, u64 *MediaTime, u8 *EditMode);\r
+\r
+/*get the number of languages for the copyright*/\r
+u32 gf_isom_get_copyright_count(GF_ISOFile *the_file);\r
+/*get the copyright and its language code given the index*/\r
+GF_Err gf_isom_get_copyright(GF_ISOFile *the_file, u32 Index, const char **threeCharCodes, const char **notice);\r
+/*get the opaque watermark info if any - returns GF_NOT_SUPPORTED if not present*/\r
+GF_Err gf_isom_get_watermark(GF_ISOFile *the_file, bin128 UUID, u8** data, u32* length);\r
+\r
+/*get the number of chapter for movie or track if trackNumber !=0*/\r
+u32 gf_isom_get_chapter_count(GF_ISOFile *the_file, u32 trackNumber);\r
+/*get the given movie or track (trackNumber!=0) chapter time and name - index is 1-based\r
+@chapter_time: retrives start time in milliseconds - may be NULL.\r
+@name: retrieves chapter name - may be NULL - SHALL NOT be destroyed by user\r
+*/\r
+GF_Err gf_isom_get_chapter(GF_ISOFile *the_file, u32 trackNumber, u32 Index, u64 *chapter_time, const char **name);\r
+\r
+/*\r
+return 0 if the media has no sync point info (eg, all samples are RAPs)\r
+return 1 if the media has sync points (eg some samples are RAPs)\r
+return 2 if the media has empty sync point info (eg no samples are RAPs). This will likely only happen \r
+                       in scalable context\r
+*/\r
+u8 gf_isom_has_sync_points(GF_ISOFile *the_file, u32 trackNumber);\r
+\r
+/*returns number of sync points*/\r
+u32 gf_isom_get_sync_point_count(GF_ISOFile *the_file, u32 trackNumber);\r
+\r
+/*returns 1 if one sample of the track is found to have a composition time offset (DTS<CTS)*/\r
+Bool gf_isom_has_time_offset(GF_ISOFile *the_file, u32 trackNumber);\r
+\r
+/*returns 1 if the track has sync shadow samples*/\r
+Bool gf_isom_has_sync_shadows(GF_ISOFile *the_file, u32 trackNumber);\r
+\r
+/*returns 1 if the track has sample dep indications*/\r
+Bool gf_isom_has_sample_dependency(GF_ISOFile *the_file, u32 trackNumber);\r
+\r
+/*rough estimation of file size, only works for completely self-contained files and without fragmentation\r
+for the current time*/\r
+u64 gf_isom_estimate_size(GF_ISOFile *the_file);\r
+\r
+u32 gf_isom_get_next_alternate_group_id(GF_ISOFile *movie);\r
+\r
+\r
+/*\r
+               MPEG-4 Systems extensions\r
+*/\r
+\r
+/*check if files has root OD/IOD or not*/\r
+Bool gf_isom_has_root_od(GF_ISOFile *the_file);\r
+\r
+/*return the root Object descriptor of the movie (can be NULL, OD or IOD, you have to check its tag)\r
+YOU HAVE TO DELETE THE DESCRIPTOR\r
+*/\r
+GF_Descriptor *gf_isom_get_root_od(GF_ISOFile *the_file);\r
+\r
+/*check the presence of a track in IOD. 0: NO, 1: YES, 2: ERROR*/\r
+u8 gf_isom_is_track_in_root_od(GF_ISOFile *the_file, u32 trackNumber);\r
+\r
+/*Get the GF_ESD given the StreamDescriptionIndex - YOU HAVE TO DELETE THE DESCRIPTOR*/\r
+GF_ESD *gf_isom_get_esd(GF_ISOFile *the_file, u32 trackNumber, u32 StreamDescriptionIndex);\r
+\r
+/*Get the decoderConfigDescriptor given the StreamDescriptionIndex - YOU HAVE TO DELETE THE DESCRIPTOR*/\r
+GF_DecoderConfig *gf_isom_get_decoder_config(GF_ISOFile *the_file, u32 trackNumber, u32 StreamDescriptionIndex);\r
+\r
+/*sets default TrackID (or ES_ID) for clock references. If trackNumber is 0, default sync track ID is reseted\r
+and will be reassigned at next ESD fetch*/\r
+void gf_isom_set_default_sync_track(GF_ISOFile *file, u32 trackNumber);\r
+\r
+/*Return the number of track references of a track for a given ReferenceType - return -1 if error*/\r
+s32 gf_isom_get_reference_count(GF_ISOFile *the_file, u32 trackNumber, u32 referenceType);\r
+\r
+/*Return the referenced track number for a track and a given ReferenceType and Index\r
+return -1 if error, 0 if the reference is a NULL one, or the trackNumber\r
+*/\r
+GF_Err gf_isom_get_reference(GF_ISOFile *the_file, u32 trackNumber, u32 referenceType, u32 referenceIndex, u32 *refTrack);\r
+\r
+u8 gf_isom_get_pl_indication(GF_ISOFile *the_file, u8 PL_Code);\r
+\r
+/*locates the first ObjectDescriptor using the given track by inspecting any OD tracks*/\r
+u32 gf_isom_find_od_for_track(GF_ISOFile *file, u32 track);\r
+\r
+/*returns file name*/\r
+const char *gf_isom_get_filename(GF_ISOFile *the_file);\r
+\r
+/*\r
+               Update of the Reading API for IsoMedia Version 2\r
+*/\r
+\r
+/*retrieves the brand of the file. The brand is introduced in V2 to differenciate\r
+MP4, MJPEG2000 and QT while indicating compatibilities\r
+the brand is one of the above defined code, or any other registered brand\r
+\r
+minorVersion is an optional parameter (can be set to NULL) , \r
+               "informative integer for the minor version of the major brand"\r
+AlternateBrandsCount is an optional parameter (can be set to NULL) , \r
+       giving the number of compatible brands. \r
+\r
+       The function will set brand to 0 if no brand indication is found in the file\r
+*/\r
+GF_Err gf_isom_get_brand_info(GF_ISOFile *the_file, u32 *brand, u32 *minorVersion, u32 *AlternateBrandsCount);\r
+\r
+/*gets an alternate brand indication. BrandIndex is 1-based\r
+Note that the Major brand should always be indicated in the alternate brands*/\r
+GF_Err gf_isom_get_alternate_brand(GF_ISOFile *the_file, u32 BrandIndex, u32 *brand);\r
+\r
+/*get the number of padding bits at the end of a given sample if any*/\r
+GF_Err gf_isom_get_sample_padding_bits(GF_ISOFile *the_file, u32 trackNumber, u32 sampleNumber, u8 *NbBits);\r
+/*indicates whether the track samples use padding bits or not*/\r
+Bool gf_isom_has_padding_bits(GF_ISOFile *the_file, u32 trackNumber);\r
+\r
+/*returns width and height of the given visual sample desc - error if not a visual track*/\r
+GF_Err gf_isom_get_visual_info(GF_ISOFile *the_file, u32 trackNumber, u32 StreamDescriptionIndex, u32 *Width, u32 *Height);\r
+\r
+/*returns samplerate, channels and bps of the given audio track - error if not a audio track*/\r
+GF_Err gf_isom_get_audio_info(GF_ISOFile *the_file, u32 trackNumber, u32 StreamDescriptionIndex, u32 *SampleRate, u32 *Channels, u8 *bitsPerSample);\r
+\r
+/*returns track visual info - all coord values are expressed as 16.16 fixed point floats*/\r
+GF_Err gf_isom_get_track_layout_info(GF_ISOFile *the_file, u32 trackNumber, u32 *width, u32 *height, s32 *translation_x, s32 *translation_y, s16 *layer);\r
+\r
+/*returns width and height of the given visual sample desc - error if not a visual track*/\r
+GF_Err gf_isom_get_pixel_aspect_ratio(GF_ISOFile *the_file, u32 trackNumber, u32 StreamDescriptionIndex, u32 *hSpacing, u32 *vSpacing);\r
+\r
+/*\r
+       User Data Manipulation (cf write API too)\r
+*/\r
+\r
+/* Gets the number of UserDataItems with the same ID / UUID in the desired track or \r
+in the movie if trackNumber is set to 0*/\r
+u32 gf_isom_get_user_data_count(GF_ISOFile *the_file, u32 trackNumber, u32 UserDataType, bin128 UUID);\r
+/* Gets the UserData for the specified item from the track or the movie if trackNumber is set to 0\r
+data is allocated by the function and is yours to free\r
+you musty pass (userData != NULL && *userData=NULL)*/\r
+GF_Err gf_isom_get_user_data(GF_ISOFile *the_file, u32 trackNumber, u32 UserDataType, bin128 UUID, u32 UserDataIndex, char **userData, u32 *userDataSize);\r
+\r
+\r
+/*gets 3char media language code - @three_char_code must be at least 4 char long*/\r
+GF_Err gf_isom_get_media_language(GF_ISOFile *the_file, u32 trackNumber, char *three_char_code);\r
+\r
+/*Unknown sample description*/\r
+typedef struct\r
+{\r
+       /*codec tag is the containing box's tag, 0 if UUID is used*/\r
+       u32 codec_tag;\r
+       /*entry UUID if no tag is used*/\r
+       bin128 UUID;\r
+\r
+       u16 version;\r
+       u16 revision;\r
+       u32 vendor_code;\r
+\r
+       /*video codecs only*/\r
+       u32 temporal_quality;\r
+       u32 spacial_quality;\r
+       u16 width, height;\r
+       u32 h_res, v_res;\r
+       u16 depth;\r
+       u16 color_table_index;\r
+       char compressor_name[33];\r
+\r
+       /*audio codecs only*/\r
+       u32 samplerate;\r
+       u16 nb_channels;\r
+       u16 bits_per_sample;\r
+\r
+       /*if present*/\r
+       char *extension_buf;\r
+       u32 extension_buf_size;\r
+} GF_GenericSampleDescription;\r
+\r
+/*returns wrapper for unknown entries - you must delete it yourself*/\r
+GF_GenericSampleDescription *gf_isom_get_generic_sample_description(GF_ISOFile *the_file, u32 trackNumber, u32 StreamDescriptionIndex);\r
+\r
+/*retrieves default values for a track fragment. Each variable is optional and \r
+if set will contain the default value for this track samples*/\r
+GF_Err gf_isom_get_fragment_defaults(GF_ISOFile *the_file, u32 trackNumber, \r
+                                                        u32 *defaultDuration, u32 *defaultSize, u32 *defaultDescriptionIndex,\r
+                                                        u32 *defaultRandomAccess, u8 *defaultPadding, u16 *defaultDegradationPriority);\r
+\r
+\r
+/*non standard extensions used for video packets in order to keep AU structure in the file format \r
+(no normative tables for that). Info is NOT written to disk.\r
+*/\r
+/*get number of fragments for a sample */\r
+u32 gf_isom_get_sample_fragment_count(GF_ISOFile *the_file, u32 trackNumber, u32 sampleNumber);\r
+/*get sample fragment size*/\r
+u16 gf_isom_get_sample_fragment_size(GF_ISOFile *the_file, u32 trackNumber, u32 sampleNumber, u32 FragmentIndex);\r
+\r
+/*returns 1 if file is single AV (max one audio, one video, one text and basic od/bifs)*/\r
+Bool gf_isom_is_single_av(GF_ISOFile *file);\r
+\r
+/*guess which std this file refers to. return value:\r
+       GF_ISOM_BRAND_ISOM: unrecognized std\r
+       GF_ISOM_BRAND_3GP5: 3GP file (max 1 audio, 1 video) without text track\r
+       GF_ISOM_BRAND_3GP6: 3GP file (max 1 audio, 1 video) with text track\r
+       GF_ISOM_BRAND_3GG6: 3GP file multitrack file\r
+       GF_ISOM_BRAND_3G2A: 3GP2 file\r
+       GF_ISOM_BRAND_AVC1: AVC file\r
+       FCC("ISMA"): ISMA file (may overlap with 3GP)\r
+       GF_ISOM_BRAND_MP42: any generic MP4 file (eg with BIFS/OD/MPEG-4 systems stuff)\r
+\r
+  for files without movie, returns the file meta handler type\r
+*/\r
+u32 gf_isom_guess_specification(GF_ISOFile *file);\r
+\r
+\r
+#ifndef GPAC_READ_ONLY\r
+\r
+\r
+/********************************************************************\r
+                               EDITING/WRITING API FUNCTIONS\r
+********************************************************************/\r
+\r
+/*set the timescale of the movie*/\r
+GF_Err gf_isom_set_timescale(GF_ISOFile *the_file, u32 timeScale);\r
+\r
+/*creates a new Track. If trackID = 0, the trackID is chosen by the API\r
+returns the track number or 0 if error*/\r
+u32 gf_isom_new_track(GF_ISOFile *the_file, u32 trackID, u32 MediaType, u32 TimeScale);\r
+\r
+/*removes the desired track - internal cross dependancies will be updated.\r
+WARNING: any OD streams with references to this track through  ODUpdate, ESDUpdate, ESDRemove commands\r
+will be rewritten*/\r
+GF_Err gf_isom_remove_track(GF_ISOFile *the_file, u32 trackNumber);\r
+\r
+/*sets the enable flag of a track*/\r
+GF_Err gf_isom_set_track_enabled(GF_ISOFile *the_file, u32 trackNumber, u8 enableTrack);\r
+\r
+/*changes the trackID - all track references present in the file are updated\r
+returns error if trackID is already in used in the file*/\r
+GF_Err gf_isom_set_track_id(GF_ISOFile *the_file, u32 trackNumber, u32 trackID);\r
+\r
+/*Add samples to a track. Use streamDescriptionIndex to specify the desired stream (if several)*/\r
+GF_Err gf_isom_add_sample(GF_ISOFile *the_file, u32 trackNumber, u32 StreamDescriptionIndex, GF_ISOSample *sample);\r
+\r
+/*Add sync shadow sample to a track. \r
+- There must be a regular sample with the same DTS. \r
+- Sync Shadow samples MUST be RAP\r
+- Currently, adding sync shadow must be done in order (no sample insertion)\r
+*/\r
+GF_Err gf_isom_add_sample_shadow(GF_ISOFile *the_file, u32 trackNumber, GF_ISOSample *sample);\r
+\r
+/*add data to current sample in the track. Use this function for media with\r
+fragmented options such as MPEG-4 video packets. This will update the data size.\r
+CANNOT be used with OD media type*/\r
+GF_Err gf_isom_append_sample_data(GF_ISOFile *the_file, u32 trackNumber, char *data, u32 data_size);\r
+\r
+/*Add sample references to a track. The dataOffset is the offset of the data in the referenced file\r
+you MUST have created a StreamDescription with URL or URN specifying your referenced file\r
+Use streamDescriptionIndex to specify the desired stream (if several)*/\r
+GF_Err gf_isom_add_sample_reference(GF_ISOFile *the_file, u32 trackNumber, u32 StreamDescriptionIndex, GF_ISOSample *sample, u64 dataOffset);\r
+\r
+/*set the duration of the last media sample. If not set, the duration of the last sample is the\r
+duration of the previous one if any, or media TimeScale (default value).*/\r
+GF_Err gf_isom_set_last_sample_duration(GF_ISOFile *the_file, u32 trackNumber, u32 duration);\r
+\r
+/*sets a track reference*/\r
+GF_Err gf_isom_set_track_reference(GF_ISOFile *the_file, u32 trackNumber, u32 referenceType, u32 ReferencedTrackID);\r
+\r
+/*removes a track reference*/\r
+GF_Err gf_isom_remove_track_reference(GF_ISOFile *the_file, u32 trackNumber, u32 referenceType, u32 ReferenceIndex);\r
+\r
+/*sets track handler name. name is either NULL (reset), a UTF-8 formatted string or a UTF8 file \r
+resource in the form "file://path/to/file_utf8" */\r
+GF_Err gf_isom_set_handler_name(GF_ISOFile *the_file, u32 trackNumber, const char *nameUTF8);\r
+\r
+/*Update the sample size table - this is needed when using @gf_isom_append_sample_data in case the resulting samples\r
+are of same sizes (typically in 3GP speech tracks)*/\r
+GF_Err gf_isom_refresh_size_info(GF_ISOFile *file, u32 trackNumber);\r
+\r
+/*Update Sample functions*/\r
+\r
+/*update a given sample of the media.\r
+@data_only: if set, only the sample data is updated, not other info*/\r
+GF_Err gf_isom_update_sample(GF_ISOFile *the_file, u32 trackNumber, u32 sampleNumber, GF_ISOSample *sample, Bool data_only);\r
+\r
+/*update a sample reference in the media. Note that the sample MUST exists,\r
+that sample->data MUST be NULL and sample->dataLength must be NON NULL;*/\r
+GF_Err gf_isom_update_sample_reference(GF_ISOFile *the_file, u32 trackNumber, u32 sampleNumber, GF_ISOSample *sample, u64 data_offset);\r
+\r
+/*Remove a given sample*/\r
+GF_Err gf_isom_remove_sample(GF_ISOFile *the_file, u32 trackNumber, u32 sampleNumber);\r
+\r
+/*changes media time scale*/\r
+GF_Err gf_isom_set_media_timescale(GF_ISOFile *the_file, u32 trackNumber, u32 new_timescale);\r
+\r
+/*set the save file name of the (edited) movie. \r
+If the movie is edited, the default fileName is avp_#openName)\r
+NOTE: you cannot save an edited file under the same name (overwrite not allowed)\r
+If the movie is created (WRITE mode), the default filename is #openName*/\r
+GF_Err gf_isom_set_final_name(GF_ISOFile *the_file, char *filename);\r
+\r
+\r
+/*set the storage mode of a file (FLAT, STREAMABLE, INTERLEAVED)*/\r
+GF_Err gf_isom_set_storage_mode(GF_ISOFile *the_file, u8 storageMode);\r
+u8 gf_isom_get_storage_mode(GF_ISOFile *the_file);\r
+\r
+/*set the interleaving time of media data (INTERLEAVED mode only)\r
+InterleaveTime is in MovieTimeScale*/\r
+GF_Err gf_isom_set_interleave_time(GF_ISOFile *the_file, u32 InterleaveTime);\r
+u32 gf_isom_get_interleave_time(GF_ISOFile *the_file);\r
+\r
+/*set the copyright in one language.*/\r
+GF_Err gf_isom_set_copyright(GF_ISOFile *the_file, const char *threeCharCode, char *notice);\r
+\r
+/*deletes copyright (1-based indexes)*/\r
+GF_Err gf_isom_remove_copyright(GF_ISOFile *the_file, u32 index);\r
+\r
+\r
+GF_Err gf_isom_set_alternate_group_id(GF_ISOFile *movie, u32 trackNumber, u32 groupId);\r
+\r
+/*add chapter info:\r
+if trackNumber is 0, the chapter info is added to the movie, otherwise to the track\r
+@timestamp: chapter start time in milliseconds. Chapters are added in order to the file. If a chapter with same timestamp\r
+       is found, its name is updated but no entry is created.\r
+@name: chapter name. If NULL, defaults to 'Chapter N'\r
+*/\r
+GF_Err gf_isom_add_chapter(GF_ISOFile *the_file, u32 trackNumber, u64 timestamp, char *name);\r
+\r
+/*deletes copyright (1-based index, index 0 for all)*/\r
+GF_Err gf_isom_remove_chapter(GF_ISOFile *the_file, u32 trackNumber, u32 index);\r
+\r
+/*set watermark info for movie*/\r
+GF_Err gf_isom_set_watermark(GF_ISOFile *the_file, bin128 UUID, u8* data, u32 length);\r
+\r
+/*Track Edition functions - used to change the normal playback of the media if desired\r
+NOTE: IT IS THE USER RESPONSABILITY TO CREATE A CONSISTENT TIMELINE FOR THE TRACK\r
+This API provides the basic hooks and some basic consistency checking\r
+but can not check the desired functionality of the track edits\r
+*/\r
+\r
+/*update or insert a new edit segment in the track time line. Edits are used to modify\r
+the media normal timing. EditTime and EditDuration are expressed in Movie TimeScale\r
+If a segment with EditTime already exists, IT IS ERASED\r
+if there is a segment before this new one, its duration is adjust to match EditTime of\r
+the new segment\r
+WARNING: The first segment always have an EditTime of 0. You should insert an empty or dwelled segment first.*/\r
+GF_Err gf_isom_set_edit_segment(GF_ISOFile *the_file, u32 trackNumber, u64 EditTime, u64 EditDuration, u64 MediaTime, u8 EditMode);\r
+\r
+/*same as above except only modifies duartion type and mediaType*/\r
+GF_Err gf_isom_modify_edit_segment(GF_ISOFile *the_file, u32 trackNumber, u32 seg_index, u64 EditDuration, u64 MediaTime, u8 EditMode);\r
+/*same as above except only appends new segment*/\r
+GF_Err gf_isom_append_edit_segment(GF_ISOFile *the_file, u32 trackNumber, u64 EditDuration, u64 MediaTime, u8 EditMode);\r
+\r
+/*remove the edit segments for the whole track*/\r
+GF_Err gf_isom_remove_edit_segments(GF_ISOFile *the_file, u32 trackNumber);\r
+\r
+/*remove the given edit segment (1-based index). If this is not the last segment, the next segment duration\r
+is updated to maintain a continous timeline*/\r
+GF_Err gf_isom_remove_edit_segment(GF_ISOFile *the_file, u32 trackNumber, u32 seg_index);\r
+\r
+/*\r
+                               User Data Manipulation\r
+\r
+               You can add specific typed data to either a track or the movie: the UserData\r
+       The type must be formated as a FourCC if you have a registered 4CC type\r
+       but the usual is to set a UUID (128 bit ID for box type) which never conflict\r
+       with existing structures in the format\r
+               To manipulate a UUID user data set the UserDataType to 0 and specify a valid UUID.\r
+Otherwise the UUID parameter is ignored\r
+               Several items with the same ID or UUID can be added (this allows you to store any\r
+       kind/number of private information under a unique ID / UUID)\r
+*/\r
+/*Add a user data item in the desired track or in the movie if TrackNumber is 0*/\r
+GF_Err gf_isom_add_user_data(GF_ISOFile *the_file, u32 trackNumber, u32 UserDataType, bin128 UUID, char *data, u32 DataLength);\r
+\r
+/*remove all user data items from the desired track or from the movie if TrackNumber is 0*/\r
+GF_Err gf_isom_remove_user_data(GF_ISOFile *the_file, u32 trackNumber, u32 UserDataType, bin128 UUID);\r
+\r
+/*remove a user data item from the desired track or from the movie if TrackNumber is 0\r
+use the UDAT read functions to get the item index*/\r
+GF_Err gf_isom_remove_user_data_item(GF_ISOFile *the_file, u32 trackNumber, u32 UserDataType, bin128 UUID, u32 UserDataIndex);\r
+\r
+/*remove track, moov (trackNumber=0) or file-level (trackNumber=0xFFFFFFFF) UUID box of matching type*/\r
+GF_Err gf_isom_remove_uuid(GF_ISOFile *movie, u32 trackNumber, bin128 UUID);\r
+/*adds track, moov (trackNumber=0) or file-level (trackNumber=0xFFFFFFFF) UUID box of given type*/\r
+GF_Err gf_isom_add_uuid(GF_ISOFile *movie, u32 trackNumber, bin128 UUID, char *data, u32 data_size);\r
+\r
+/*\r
+               Update of the Writing API for IsoMedia Version 2\r
+*/     \r
+\r
+/*use a compact track version for sample size. This is not usually recommended \r
+except for speech codecs where the track has a lot of small samples\r
+compaction is done automatically while writing based on the track's sample sizes*/\r
+GF_Err gf_isom_use_compact_size(GF_ISOFile *the_file, u32 trackNumber, u8 CompactionOn);\r
+\r
+/*sets the brand of the movie*/\r
+GF_Err gf_isom_set_brand_info(GF_ISOFile *the_file, u32 MajorBrand, u32 MinorVersion);\r
+\r
+/*adds or remove an alternate brand for the movie*/\r
+GF_Err gf_isom_modify_alternate_brand(GF_ISOFile *the_file, u32 Brand, u8 AddIt);\r
+\r
+/*removes all alternate brands except major brand*/\r
+GF_Err gf_isom_reset_alt_brands(GF_ISOFile *movie);\r
+\r
+/*set the number of padding bits at the end of a given sample if needed\r
+if the function is never called the padding bit info is ignored\r
+this MUST be called on an existin sample*/\r
+GF_Err gf_isom_set_sample_padding_bits(GF_ISOFile *the_file, u32 trackNumber, u32 sampleNumber, u8 NbBits);\r
+\r
+\r
+/*since v2 you must specify w/h of video tracks for authoring tools (no decode the video cfg / first sample)*/\r
+GF_Err gf_isom_set_visual_info(GF_ISOFile *the_file, u32 trackNumber, u32 StreamDescriptionIndex, u32 Width, u32 Height);\r
+\r
+/*mainly used for 3GPP text since most ISO-based formats ignore these (except MJ2K) \r
+all coord values are expressed as 16.16 fixed point floats*/\r
+GF_Err gf_isom_set_track_layout_info(GF_ISOFile *the_file, u32 trackNumber, u32 width, u32 height, s32 translation_x, s32 translation_y, s16 layer);\r
+\r
+GF_Err gf_isom_set_pixel_aspect_ratio(GF_ISOFile *the_file, u32 trackNumber, u32 StreamDescriptionIndex, u32 hSpacing, u32 vSpacing);\r
+\r
+/*set SR & nbChans for audio description*/\r
+GF_Err gf_isom_set_audio_info(GF_ISOFile *the_file, u32 trackNumber, u32 StreamDescriptionIndex, u32 sampleRate, u32 nbChannels, u8 bitsPerSample);\r
+\r
+/*non standard extensions: set/remove a fragment of a sample - this is used for video packets\r
+in order to keep AU structure in the file format (no normative tables for that). Info is NOT written to disk*/\r
+GF_Err gf_isom_add_sample_fragment(GF_ISOFile *the_file, u32 trackNumber, u32 sampleNumber, u16 FragmentSize);\r
+GF_Err gf_isom_remove_sample_fragment(GF_ISOFile *the_file, u32 trackNumber, u32 sampleNumber);\r
+/*remove all sample fragment info for this track*/\r
+GF_Err gf_isom_remove_sample_fragments(GF_ISOFile *the_file, u32 trackNumber);\r
+\r
+/*set CTS unpack mode (used for B-frames & like): in unpack mode, each sample uses one entry in CTTS tables\r
+unpack=0: set unpack on - !!creates a CTTS table if none found!!\r
+unpack=1: set unpack off and repacks all table info\r
+*/\r
+GF_Err gf_isom_set_cts_packing(GF_ISOFile *the_file, u32 trackNumber, Bool unpack);\r
+/*modify CTS offset of a given sample (used for B-frames) - MUST be called in unpack mode only*/\r
+GF_Err gf_isom_modify_cts_offset(GF_ISOFile *the_file, u32 trackNumber, u32 sample_number, u32 offset);\r
+/*remove CTS offset table (used for B-frames)*/\r
+GF_Err gf_isom_remove_cts_info(GF_ISOFile *the_file, u32 trackNumber);\r
+\r
+/*set 3char code media language*/\r
+GF_Err gf_isom_set_media_language(GF_ISOFile *the_file, u32 trackNumber, char *three_char_code);\r
+\r
+/*removes given stream description*/\r
+GF_Err gf_isom_remove_sample_description(GF_ISOFile *the_file, u32 trackNumber, u32 streamDescIndex);\r
+\r
+/*\r
+       some authoring extensions\r
+*/\r
+/*sets name for authoring - if name is NULL reset authoring name*/\r
+GF_Err gf_isom_set_track_name(GF_ISOFile *the_file, u32 trackNumber, char *name);\r
+/*gets authoring name*/\r
+const char *gf_isom_get_track_name(GF_ISOFile *the_file, u32 trackNumber);\r
+\r
+/*\r
+                       MPEG-4 Extensions\r
+*/\r
+\r
+/*set a profile and level indication for the movie iod (created if needed)\r
+if the flag is ProfileLevel is 0 this means the movie doesn't require\r
+the specific codec (equivalent to 0xFF value in MPEG profiles)*/\r
+GF_Err gf_isom_set_pl_indication(GF_ISOFile *the_file, u8 PL_Code, u8 ProfileLevel);\r
+\r
+/*set the rootOD ID of the movie if you need it. By default, movies are created without root ODs*/\r
+GF_Err gf_isom_set_root_od_id(GF_ISOFile *the_file, u32 OD_ID);\r
+\r
+/*set the rootOD URL of the movie if you need it (only needed to create empty file pointing \r
+to external ressource)*/\r
+GF_Err gf_isom_set_root_od_url(GF_ISOFile *the_file, char *url_string);\r
+\r
+/*remove the root OD*/\r
+GF_Err gf_isom_remove_root_od(GF_ISOFile *the_file);\r
+\r
+/*Add a system descriptor to the OD of the movie*/\r
+GF_Err gf_isom_add_desc_to_root_od(GF_ISOFile *the_file, GF_Descriptor *theDesc);\r
+\r
+/*add a track to the root OD*/\r
+GF_Err gf_isom_add_track_to_root_od(GF_ISOFile *the_file, u32 trackNumber);\r
+\r
+/*remove a track to the root OD*/\r
+GF_Err gf_isom_remove_track_from_root_od(GF_ISOFile *the_file, u32 trackNumber);\r
+\r
+/*Create a new StreamDescription (GF_ESD) in the file. The URL and URN are used to \r
+describe external media, this will creat a data reference for the media*/\r
+GF_Err gf_isom_new_mpeg4_description(GF_ISOFile *the_file, u32 trackNumber, GF_ESD *esd, char *URLname, char *URNname, u32 *outDescriptionIndex);\r
+\r
+/*use carefully. Very usefull when you made a lot of changes (IPMP, IPI, OCI, ...)\r
+THIS WILL REPLACE THE WHOLE DESCRIPTOR ...*/\r
+GF_Err gf_isom_change_mpeg4_description(GF_ISOFile *the_file, u32 trackNumber, u32 StreamDescriptionIndex, GF_ESD *newESD);\r
+\r
+/*Add a system descriptor to the ESD of a stream - you have to delete the descriptor*/\r
+GF_Err gf_isom_add_desc_to_description(GF_ISOFile *the_file, u32 trackNumber, u32 StreamDescriptionIndex, GF_Descriptor *theDesc);\r
+\r
+\r
+/*Default extensions*/\r
+\r
+/*Create a new unknown StreamDescription in the file. The URL and URN are used to \r
+describe external media, this will creat a data reference for the media\r
+use this to store media not currently supported by the ISO media format\r
+*/\r
+GF_Err gf_isom_new_generic_sample_description(GF_ISOFile *the_file, u32 trackNumber, char *URLname, char *URNname, GF_GenericSampleDescription *udesc, u32 *outDescriptionIndex);\r
+\r
+/*change the data field of an unknown sample description*/\r
+GF_Err gf_isom_change_generic_sample_description(GF_ISOFile *the_file, u32 trackNumber, u32 StreamDescriptionIndex, GF_GenericSampleDescription *udesc);\r
+\r
+/*\r
+special shortcut for stream description cloning from a given input file (this avoids inspecting for media type)\r
+@the_file, @trackNumber: destination file and track\r
+@orig_file, @orig_track, @orig_desc_index: orginal file, track and sample description\r
+@URLname, @URNname, @outDescriptionIndex: same usage as with gf_isom_new_mpeg4_description\r
+*/\r
+GF_Err gf_isom_clone_sample_description(GF_ISOFile *the_file, u32 trackNumber, GF_ISOFile *orig_file, u32 orig_track, u32 orig_desc_index, char *URLname, char *URNname, u32 *outDescriptionIndex);\r
+\r
+/*special shortcut: clones a track (everything except media data and sample info (DTS? CTS, RAPs, etc...) \r
+also clones sampleDescriptions\r
+@keep_data_ref: if set, external data references are kept, otherwise they are removed (track media data will be self-contained)\r
+@dest_track: track number of cloned track*/\r
+GF_Err gf_isom_clone_track(GF_ISOFile *orig_file, u32 orig_track, GF_ISOFile *dest_file, Bool keep_data_ref, u32 *dest_track);\r
+/*special shortcut: clones IOD PLs from orig to dest if any*/\r
+GF_Err gf_isom_clone_pl_indications(GF_ISOFile *orig, GF_ISOFile *dest);\r
+/*clones root OD from input to output file, without copying root OD track references*/\r
+GF_Err gf_isom_clone_root_od(GF_ISOFile *input, GF_ISOFile *output);\r
+\r
+/*returns true if same set of sample description in both tracks - this does include self-contained checking\r
+and reserved flags. The specific media cfg (DSI & co) is not analysed, only\r
+a brutal memory comparaison is done*/\r
+Bool gf_isom_is_same_sample_description(GF_ISOFile *f1, u32 tk1, GF_ISOFile *f2, u32 tk2);\r
+\r
+GF_Err gf_isom_set_JPEG2000(GF_ISOFile *mov, Bool set_on);\r
+\r
+/*\r
+                       Movie Fragments Writing API\r
+               Movie Fragments is a feature of ISO media files for fragmentation\r
+       of a presentation meta-data and interleaving with its media data.\r
+       This enables faster http fast start for big movies, and also reduces the risk\r
+       of data loss in case of a recording crash, because meta data and media data\r
+       can be written to disk at regular times\r
+               This API provides simple function calls to setup such a movie and write it\r
+       The process implies:\r
+               1- creating a movie in the usual way (track, stream descriptions, (IOD setup\r
+       copyright, ...)\r
+               2- possibly add some samples in the regular fashion\r
+               3- setup track fragments for all track that will be written in a fragmented way\r
+       (note that you can create/write a track that has no fragmentation at all)\r
+               4- finalize the movie for fragmentation (this will flush all meta-data and \r
+       any media-data added to disk, ensuring all vital information for the presentation\r
+       is stored on file and not lost in case of crash/poweroff)\r
+       \r
+         then 5-6 as often as desired\r
+               5- start a new movie fragment\r
+               6- add samples to each setup track\r
+\r
+\r
+  IMPORTANT NOTES:\r
+               * Movie Fragments can only be used in GF_ISOM_OPEN_WRITE mode (capturing)\r
+  and no editing functionalities can be used\r
+               * the fragmented movie API uses TrackID and not TrackNumber \r
+*/\r
+\r
+/*\r
+setup a track for fragmentation by specifying some default values for \r
+storage efficiency\r
+*TrackID: track identifier\r
+*DefaultStreamDescriptionIndex: the default description used by samples in this track\r
+*DefaultSampleDuration: default duration of samples in this track\r
+*DefaultSampleSize: default size of samples in this track (0 if unknown)\r
+*DefaultSampleIsSync: default key-flag (RAP) of samples in this track\r
+*DefaultSamplePadding: default padding bits for samples in this track\r
+*DefaultDegradationPriority: default degradation priority for samples in this track\r
+\r
+*/\r
+GF_Err gf_isom_setup_track_fragment(GF_ISOFile *the_file, u32 TrackID, \r
+                                                        u32 DefaultStreamDescriptionIndex,\r
+                                                        u32 DefaultSampleDuration,\r
+                                                        u32 DefaultSampleSize,\r
+                                                        u8 DefaultSampleIsSync,\r
+                                                        u8 DefaultSamplePadding,\r
+                                                        u16 DefaultDegradationPriority);\r
+\r
+/*flushes data to disk and prepare movie fragmentation*/\r
+GF_Err gf_isom_finalize_for_fragment(GF_ISOFile *the_file);\r
+\r
+/*starts a new movie fragment*/\r
+GF_Err gf_isom_start_fragment(GF_ISOFile *the_file);\r
+\r
+\r
+enum\r
+{\r
+       /*indicates that the track fragment has no samples but still has a duration\r
+       (silence-detection in audio codecs, ...). \r
+       param: indicates duration*/\r
+       GF_ISOM_TRAF_EMPTY,\r
+       /*I-Frame detection: this can reduce file size by detecting I-frames and\r
+       optimizing sample flags (padding, priority, ..)\r
+       param: on/off (0/1)*/\r
+       GF_ISOM_TRAF_RANDOM_ACCESS,\r
+       /*activate data cache on track fragment. This is usefull when writing interleaved\r
+       media from a live source (typically audio-video), and greatly reduces file size\r
+       param: Number of samples (> 1) to cache before disk flushing. You shouldn't try \r
+       to cache too many samples since this will load your memory. base that on FPS/SR*/\r
+       GF_ISOM_TRAF_DATA_CACHE\r
+};\r
+\r
+/*set options. Options can be set at the begining of each new fragment only, and for the\r
+lifetime of the fragment*/\r
+GF_Err gf_isom_set_fragment_option(GF_ISOFile *the_file, u32 TrackID, u32 Code, u32 param);\r
+\r
+\r
+/*adds a sample to a fragmented track\r
+\r
+*TrackID: destination track\r
+*sample: sample to add\r
+*StreamDescriptionIndex: stream description for this sample. If 0, the default one \r
+is used\r
+*Duration: sample duration.\r
+Note: because of the interleaved nature of the meta/media data, the sample duration\r
+MUST be provided (in case of regular tracks, this was computed internally by the lib)\r
+*PaddingBits: padding bits for the sample, or 0\r
+*DegradationPriority for the sample, or 0\r
+\r
+*/\r
+\r
+GF_Err gf_isom_fragment_add_sample(GF_ISOFile *the_file, u32 TrackID, GF_ISOSample *sample, \r
+                                                                u32 StreamDescriptionIndex, \r
+                                                                u32 Duration,\r
+                                                                u8 PaddingBits, u16 DegradationPriority);\r
+\r
+/*appends data into last sample of track for video fragments/other media\r
+CANNOT be used with OD tracks*/\r
+GF_Err gf_isom_fragment_append_data(GF_ISOFile *the_file, u32 TrackID, char *data, u32 data_size, u8 PaddingBits);\r
+\r
+\r
+\r
+/******************************************************************\r
+               GENERIC Publishing API\r
+******************************************************************/\r
+\r
+/*Removes all sync shadow entries for a given track. The shadow samples are NOT removed; they must be removed\r
+by the user app*/\r
+GF_Err gf_isom_remove_sync_shadows(GF_ISOFile *the_file, u32 trackNumber);\r
+\r
+/*Use this function to do the shadowing if you use shadowing.\r
+the sample to be shadowed MUST be a non-sync sample (ignored if not)\r
+the sample shadowing must be a Sync sample (error if not)*/\r
+GF_Err gf_isom_set_sync_shadow(GF_ISOFile *the_file, u32 trackNumber, u32 sampleNumber, u32 syncSample);\r
+\r
+/*set the GroupID of a track (only used for optimized interleaving). By setting GroupIDs\r
+you can specify the storage order for media data of a group of streams. This is usefull\r
+for BIFS presentation so that static resources of the scene can be downloaded before BIFS*/\r
+GF_Err gf_isom_set_track_group(GF_ISOFile *the_file, u32 trackNumber, u32 GroupID);\r
+\r
+/*set the priority of a track within a Group (used for optimized interleaving and hinting). \r
+This allows tracks to be stored before other within a same group, for instance the \r
+hint track data can be stored just before the media data, reducing disk seeking\r
+for a same time, within a group of tracks, the track with the lowest inversePriority will \r
+be written first*/\r
+GF_Err gf_isom_set_track_priority_in_group(GF_ISOFile *the_file, u32 trackNumber, u32 InversePriority);\r
+\r
+/*set the max SamplesPerChunk (for file optimization, mainly in FLAT and STREAMABLE modes)*/\r
+GF_Err gf_isom_set_max_samples_per_chunk(GF_ISOFile *the_file, u32 trackNumber, u32 maxSamplesPerChunk);\r
+\r
+/*associate a given SL config with a given ESD while extracting the OD information\r
+all the SL params must be fixed by the calling app!\r
+The SLConfig is stored by the API for further use. A NULL pointer will result\r
+in using the default SLConfig (predefined = 2) remapped to predefined = 0\r
+This is usefull while reading the IOD / OD stream of an MP4 file. Note however that\r
+only full AUs are extracted, therefore the calling application must SL-packetize the streams*/\r
+GF_Err gf_isom_set_extraction_slc(GF_ISOFile *the_file, u32 trackNumber, u32 StreamDescriptionIndex, GF_SLConfig *slConfig);\r
+\r
+GF_Err gf_isom_get_extraction_slc(GF_ISOFile *the_file, u32 trackNumber, u32 StreamDescriptionIndex, GF_SLConfig **slConfig);\r
+\r
+u32 gf_isom_get_track_group(GF_ISOFile *the_file, u32 trackNumber);\r
+u32 gf_isom_get_track_priority_in_group(GF_ISOFile *the_file, u32 trackNumber);\r
+\r
+/*stores movie config (storage mode, interleave time, track groupIDs, priorities and names) in UDTA(kept on disk)\r
+if @remove_all is set, removes all stored info, otherwise recompute all stored info*/\r
+GF_Err gf_isom_store_movie_config(GF_ISOFile *the_file, Bool remove_all);\r
+/*restores movie config (storage mode, interleave time, track groupIDs, priorities and names) if found*/\r
+GF_Err gf_isom_load_movie_config(GF_ISOFile *the_file);\r
+\r
+/*setup interleaving for storage (shortcut for storeage mode + interleave_time)*/\r
+GF_Err gf_isom_make_interleave(GF_ISOFile *mp4file, Double TimeInSec);\r
+\r
+\r
+/******************************************************************\r
+               GENERIC HINTING WRITING API\r
+******************************************************************/\r
+\r
+/*supported hint formats - ONLY RTP now*/\r
+enum\r
+{\r
+       GF_ISOM_HINT_RTP = GF_4CC('r', 't', 'p', ' '),\r
+};\r
+\r
+\r
+/*Setup the resources based on the hint format\r
+This function MUST be called after creating a new hint track and before\r
+any other calls on this track*/\r
+GF_Err gf_isom_setup_hint_track(GF_ISOFile *the_file, u32 trackNumber, u32 HintType);\r
+\r
+/*Create a HintDescription for the HintTrack\r
+the rely flag indicates whether a reliable transport protocol is desired/required\r
+for data transport\r
+       0: not desired (UDP/IP). NB: most RTP streaming servers only support UDP/IP for data\r
+       1: preferable (TCP/IP if possible or UDP/IP)\r
+       2: required (TCP/IP only)\r
+The HintDescriptionIndex is set, to be used when creating a HINT sample\r
+*/\r
+GF_Err gf_isom_new_hint_description(GF_ISOFile *the_file, u32 trackNumber, s32 HintTrackVersion, s32 LastCompatibleVersion, u8 Rely, u32 *HintDescriptionIndex);\r
+\r
+/*Starts a new sample for the hint track. A sample is just a collection of packets\r
+the transmissionTime is indicated in the media timeScale of the hint track*/\r
+GF_Err gf_isom_begin_hint_sample(GF_ISOFile *the_file, u32 trackNumber, u32 HintDescriptionIndex, u32 TransmissionTime);\r
+\r
+/*stores the hint sample in the file once all your packets for this sample are done\r
+set IsRandomAccessPoint if you want to indicate that this is a random access point \r
+in the stream*/\r
+GF_Err gf_isom_end_hint_sample(GF_ISOFile *the_file, u32 trackNumber, u8 IsRandomAccessPoint);\r
+\r
+\r
+/******************************************************************\r
+               PacketHandling functions\r
+               Data can be added at the end or at the beginning of the current packet\r
+               by setting AtBegin to 1 the data will be added at the begining\r
+               This allows constructing the packet payload before any meta-data\r
+******************************************************************/\r
+\r
+/*adds a blank chunk of data in the sample that is skipped while streaming*/\r
+GF_Err gf_isom_hint_blank_data(GF_ISOFile *the_file, u32 trackNumber, u8 AtBegin);\r
+\r
+/*adds a chunk of data in the packet that is directly copied while streaming\r
+NOTE: dataLength MUST BE <= 14 bytes, and you should only use this function\r
+to add small blocks of data (encrypted parts, specific headers, ...)*/\r
+GF_Err gf_isom_hint_direct_data(GF_ISOFile *the_file, u32 trackNumber, char *data, u32 dataLength, u8 AtBegin);\r
+\r
+/*adds a reference to some sample data in the packet\r
+SourceTrackID: the ID of the track where the referenced sample is\r
+SampleNumber: the sample number containing the data to be added\r
+DataLength: the length of bytes to copy in the packet\r
+offsetInSample: the offset in bytes in the sample at which to begin copying data\r
+\r
+extra_data: only used when the sample is actually the sample that will contain this packet\r
+(usefull to store en encrypted version of a packet only available while streaming)\r
+       In this case, set SourceTrackID to the HintTrack ID and SampleNumber to 0\r
+       In this case, the DataOffset MUST BE NULL and length will indicate the extra_data size\r
+\r
+Note that if you want to reference a previous HintSample in the hintTrack, you will \r
+have to parse the sample yourself ...\r
+*/\r
+GF_Err gf_isom_hint_sample_data(GF_ISOFile *the_file, u32 trackNumber, u32 SourceTrackID, u32 SampleNumber, u16 DataLength, u32 offsetInSample, char *extra_data, u8 AtBegin);\r
+\r
+\r
+/*adds a reference to some stream description data in the packet (headers, ...)\r
+SourceTrackID: the ID of the track where the referenced sample is\r
+StreamDescriptionIndex: the index of the stream description in the desired track\r
+DataLength: the length of bytes to copy in the packet\r
+offsetInDescription: the offset in bytes in the description at which to begin copying data\r
+\r
+Since it is far from being obvious what this offset is, we recommend not using this \r
+function. The ISO Media Format specification is currently being updated to solve\r
+this issue*/\r
+GF_Err gf_isom_hint_sample_description_data(GF_ISOFile *the_file, u32 trackNumber, u32 SourceTrackID, u32 StreamDescriptionIndex, u16 DataLength, u32 offsetInDescription, u8 AtBegin);\r
+\r
+\r
+/******************************************************************\r
+               RTP SPECIFIC WRITING API\r
+******************************************************************/\r
+\r
+/*Creates a new RTP packet in the HintSample. If a previous packet was created, \r
+it is stored in the hint sample and a new packet is created.\r
+- relativeTime: RTP time offset of this packet in the HintSample if any - in hint track \r
+time scale. Used for data smoothing by servers.\r
+- PackingBit: the 'P' bit of the RTP packet header\r
+- eXtensionBit: the'X' bit of the RTP packet header\r
+- MarkerBit: the 'M' bit of the RTP packet header\r
+- PayloadType: the payload type, on 7 bits, format 0x0XXXXXXX\r
+- B_frame: indicates if this is a B-frame packet. Can be skipped by a server\r
+- IsRepeatedPacket: indicates if this is a duplicate packet of a previous one.\r
+Can be skipped by a server\r
+- SequenceNumber: the RTP base sequence number of the packet. Because of support for repeated\r
+packets, you have to set the sequence number yourself.*/\r
+GF_Err gf_isom_rtp_packet_begin(GF_ISOFile *the_file, u32 trackNumber, s32 relativeTime, u8 PackingBit, u8 eXtensionBit, u8 MarkerBit, u8 PayloadType, u8 B_frame, u8 IsRepeatedPacket, u16 SequenceNumber);\r
+\r
+/*set the flags of the RTP packet*/\r
+GF_Err gf_isom_rtp_packet_set_flags(GF_ISOFile *the_file, u32 trackNumber, u8 PackingBit, u8 eXtensionBit, u8 MarkerBit, u8 disposable_packet, u8 IsRepeatedPacket);\r
+\r
+/*set the time offset of this packet. This enables packets to be placed in the hint track \r
+in decoding order, but have their presentation time-stamp in the transmitted \r
+packet in a different order. Typically used for MPEG video with B-frames\r
+*/\r
+GF_Err gf_isom_rtp_packet_set_offset(GF_ISOFile *the_file, u32 trackNumber, s32 timeOffset);\r
+\r
+                                                                  \r
+/*set some specific info in the HintDescription for RTP*/\r
+\r
+/*sets the RTP TimeScale that the server use to send packets\r
+some RTP payloads may need a specific timeScale that is not the timeScale in the file format\r
+the default timeScale choosen by the API is the MediaTimeScale of the hint track*/\r
+GF_Err gf_isom_rtp_set_timescale(GF_ISOFile *the_file, u32 trackNumber, u32 HintDescriptionIndex, u32 TimeScale);\r
+/*sets the RTP TimeOffset that the server will add to the packets\r
+if not set, the server adds a random offset*/\r
+GF_Err gf_isom_rtp_set_time_offset(GF_ISOFile *the_file, u32 trackNumber, u32 HintDescriptionIndex, u32 TimeOffset);\r
+/*sets the RTP SequenceNumber Offset that the server will add to the packets\r
+if not set, the server adds a random offset*/\r
+GF_Err gf_isom_rtp_set_time_sequence_offset(GF_ISOFile *the_file, u32 trackNumber, u32 HintDescriptionIndex, u32 SequenceNumberOffset);\r
+\r
+\r
+\r
+/******************************************************************\r
+               SDP SPECIFIC WRITING API\r
+******************************************************************/\r
+/*add an SDP line to the SDP container at the track level (media-specific SDP info)\r
+NOTE: the \r\n end of line for SDP is automatically inserted*/\r
+GF_Err gf_isom_sdp_add_track_line(GF_ISOFile *the_file, u32 trackNumber, const char *text);\r
+/*remove all SDP info at the track level*/\r
+GF_Err gf_isom_sdp_clean_track(GF_ISOFile *the_file, u32 trackNumber);\r
+\r
+/*add an SDP line to the SDP container at the movie level (presentation SDP info)\r
+NOTE: the \r\n end of line for SDP is automatically inserted*/\r
+GF_Err gf_isom_sdp_add_line(GF_ISOFile *the_file, const char *text);\r
+/*remove all SDP info at the movie level*/\r
+GF_Err gf_isom_sdp_clean(GF_ISOFile *the_file);\r
+\r
+#endif /*GPAC_READ_ONLY*/\r
+\r
+/*Get SDP info at the movie level*/\r
+GF_Err gf_isom_sdp_get(GF_ISOFile *the_file, const char **sdp, u32 *length);\r
+/*Get SDP info at the track level*/\r
+GF_Err gf_isom_sdp_track_get(GF_ISOFile *the_file, u32 trackNumber, const char **sdp, u32 *length);\r
+\r
+u32 gf_isom_get_payt_count(GF_ISOFile *the_file, u32 trackNumber);\r
+const char *gf_isom_get_payt_info(GF_ISOFile *the_file, u32 trackNumber, u32 index, u32 *payID);\r
+\r
+/*dumps file structures into XML trace file */\r
+GF_Err gf_isom_dump(GF_ISOFile *file, FILE *trace);\r
+/*dumps RTP hint samples structure into XML trace file\r
+       @trackNumber, @SampleNum: hint track and hint sample number\r
+       @trace: output\r
+*/\r
+GF_Err gf_isom_dump_hint_sample(GF_ISOFile *the_file, u32 trackNumber, u32 SampleNum, FILE * trace);\r
+\r
+\r
+\r
+/*small hint reader - performs data caching*/\r
+\r
+/*resets hint reading parameters, returns an error if the hint type is not supported for reading\r
+packet sequence number is always reseted to 0\r
+@sample_start: indicates from where the packets should be read (regular 1-based sample number)\r
+@ts_offset: constant offset for timestamps, must be expressed in media timescale (which is the hint timescale).\r
+       usually 0 (no offset)\r
+@sn_offset: offset for packet sequence number (first packet will have a SN of 1 + sn_offset)\r
+       usually 0\r
+@ssrc: sync source identifier for RTP\r
+*/\r
+GF_Err gf_isom_reset_hint_reader(GF_ISOFile *the_file, u32 trackNumber, u32 sample_start, u32 ts_offset, u32 sn_offset, u32 ssrc);\r
+\r
+/*reads next hint packet. ALl packets are read in transmission (decoding) order\r
+returns an error if not supported, or GF_EOS when no more packets are available\r
+currently only RTP reader is supported\r
+@pck_data, @pck_size: output packet data (must be freed by caller) - contains all info to be sent \r
+       on the wire, eg for RTP contains the RTP header and the data\r
+@disposable (optional): indicates that the packet can be droped when late (B-frames & co)\r
+@repeated (optional): indicates this is a repeated packet (same one has already been sent)\r
+@trans_ts (optional): indicates the transmission time of the packet, expressed in hint timescale, taking into account\r
+the ts_offset specified in gf_isom_reset_hint_reader. Depending on packets this may not be the same\r
+as the hint sample timestamp + ts_offset, some packets may need to be sent earlier (B-frames)\r
+@sample_num (optional): indicates hint sample number the packet belongs to\r
+*/\r
+GF_Err gf_isom_next_hint_packet(GF_ISOFile *the_file, u32 trackNumber, char **pck_data, u32 *pck_size, Bool *disposable, Bool *repeated, u32 *trans_ts, u32 *sample_num);\r
+\r
+\r
+/*\r
+                               3GPP specific extensions\r
+       NOTE: MPEG-4 OD Framework cannot be used with 3GPP files.\r
+       Stream Descriptions are not GF_ESD, just generic config options as specified in this file\r
+*/\r
+\r
+/*Generic 3GP/3GP2 config record*/\r
+typedef struct \r
+{\r
+       /*GF_4CC record type, one fo the above GF_ISOM_SUBTYPE_3GP_ * subtypes*/\r
+       u32 type;\r
+       /*4CC vendor name*/\r
+       u32 vendor;\r
+       /*codec version*/\r
+       u8 decoder_version;\r
+       /*number of sound frames per IsoMedia sample, >0 and <=15. The very last sample may contain less frames. */\r
+       u8 frames_per_sample;\r
+\r
+       /*H263 ONLY - Level and profile*/\r
+       u8 H263_level, H263_profile;\r
+\r
+       /*AMR(WB) ONLY - num of mode for the codec*/\r
+       u16 AMR_mode_set;\r
+       /*AMR(WB) ONLY - changes in codec mode per sample*/\r
+       u8 AMR_mode_change_period;\r
+} GF_3GPConfig;\r
+\r
+\r
+/*return the 3GP config for this tream description, NULL if not a 3GPP track*/\r
+GF_3GPConfig *gf_isom_3gp_config_get(GF_ISOFile *the_file, u32 trackNumber, u32 StreamDescriptionIndex);\r
+#ifndef GPAC_READ_ONLY\r
+/*create the track config*/\r
+GF_Err gf_isom_3gp_config_new(GF_ISOFile *the_file, u32 trackNumber, GF_3GPConfig *config, char *URLname, char *URNname, u32 *outDescriptionIndex);\r
+/*update the track config - subtypes shall NOT differ*/\r
+GF_Err gf_isom_3gp_config_update(GF_ISOFile *the_file, u32 trackNumber, GF_3GPConfig *config, u32 DescriptionIndex);\r
+#endif /*GPAC_READ_ONLY*/\r
+\r
+/*AVC/H264 extensions - GF_AVCConfig is defined in mpeg4_odf.h*/\r
+\r
+/*gets uncompressed AVC config - user is responsible for deleting it*/\r
+GF_AVCConfig *gf_isom_avc_config_get(GF_ISOFile *the_file, u32 trackNumber, u32 DescriptionIndex);\r
+\r
+#ifndef GPAC_READ_ONLY\r
+/*creates new AVC config*/\r
+GF_Err gf_isom_avc_config_new(GF_ISOFile *the_file, u32 trackNumber, GF_AVCConfig *cfg, char *URLname, char *URNname, u32 *outDescriptionIndex);\r
+/*updates AVC config*/\r
+GF_Err gf_isom_avc_config_update(GF_ISOFile *the_file, u32 trackNumber, u32 DescriptionIndex, GF_AVCConfig *cfg);\r
+#endif\r
+\r
+\r
+/*\r
+       3GP timed text handling\r
+\r
+       NOTE: currently only writing API is developped, the reading one is not used in MPEG-4 since\r
+       MPEG-4 maps 3GP timed text to MPEG-4 Streaming Text (part 17)\r
+*/\r
+\r
+/*set streamihng text reading mode: if do_convert is set, all text samples will be retrieved as TTUs\r
+and ESD will be emulated for text tracks.*/\r
+GF_Err gf_isom_text_set_streaming_mode(GF_ISOFile *the_file, Bool do_convert);\r
+\r
+/*exports text track to given format\r
+@dump_type: 0 for TTXT, 1 for srt, 2 for SVG\r
+*/\r
+GF_Err gf_isom_text_dump(GF_ISOFile *the_file, u32 track, FILE *dump, u32 dump_type);\r
+\r
+/*returns encoded TX3G box (text sample description for 3GPP text streams) as needed by RTP or other standards:\r
+       @sidx: 1-based stream description index\r
+       @sidx_offset: \r
+               if 0, the sidx will NOT be written before the encoded TX3G\r
+               if not 0, the sidx will be written before the encoded TX3G, with the given offset. Offset sshould be at \r
+               least 128 for most commmon usage of TX3G (RTP, MPEG-4 timed text, etc)\r
+\r
+*/\r
+GF_Err gf_isom_text_get_encoded_tx3g(GF_ISOFile *file, u32 track, u32 sidx, u32 sidx_offset, char **tx3g, u32 *tx3g_size);\r
+\r
+/*checks if this text description is already inserted\r
+@outDescIdx: set to 0 if not found, or descIndex\r
+@same_style, @same_box: indicates if default styles and box are used\r
+*/\r
+GF_Err gf_isom_text_has_similar_description(GF_ISOFile *the_file, u32 trackNumber, GF_TextSampleDescriptor *desc, u32 *outDescIdx, Bool *same_box, Bool *same_styles);\r
+\r
+/*text sample formatting*/\r
+typedef struct _3gpp_text_sample GF_TextSample;\r
+/*creates text sample handle*/\r
+GF_TextSample *gf_isom_new_text_sample();\r
+/*destroy text sample handle*/\r
+void gf_isom_delete_text_sample(GF_TextSample *tx_samp);\r
+\r
+#ifndef GPAC_READ_ONLY\r
+\r
+/*Create a new TextSampleDescription in the file. \r
+The URL and URN are used to describe external media, this will create a data reference for the media\r
+GF_TextSampleDescriptor is defined in mpeg4_odf.h\r
+*/\r
+GF_Err gf_isom_new_text_description(GF_ISOFile *the_file, u32 trackNumber, GF_TextSampleDescriptor *desc, char *URLname, char *URNname, u32 *outDescriptionIndex);\r
+/*change the text sample description*/\r
+GF_Err gf_isom_update_text_description(GF_ISOFile *movie, u32 trackNumber, u32 descriptionIndex, GF_TextSampleDescriptor *desc);\r
+\r
+/*reset text sample content*/\r
+GF_Err gf_isom_text_reset(GF_TextSample * tx_samp);\r
+/*reset text sample styles but keep text*/\r
+GF_Err gf_isom_text_reset_styles(GF_TextSample * samp);\r
+\r
+/*sets UTF16 marker for text data. This MUST be called on an empty sample. If text data added later \r
+on (cf below) is not formatted as UTF16 data(2 bytes char) the resulting text sample won't be compliant, \r
+but this library WON'T WARN*/\r
+GF_Err gf_isom_text_set_utf16_marker(GF_TextSample * samp);\r
+/*append text to sample - text_len is the number of bytes to be written from text_data. This allows \r
+handling UTF8 and UTF16 strings in a transparent manner*/\r
+GF_Err gf_isom_text_add_text(GF_TextSample * tx_samp, char *text_data, u32 text_len);\r
+/*append style modifyer to sample*/\r
+GF_Err gf_isom_text_add_style(GF_TextSample * tx_samp, GF_StyleRecord *rec);\r
+/*appends highlight modifier for the sample \r
+       @start_char: first char highlighted, \r
+       @end_char: first char not highlighted*/\r
+GF_Err gf_isom_text_add_highlight(GF_TextSample * samp, u16 start_char, u16 end_char);\r
+/*sets highlight color for the whole sample*/\r
+GF_Err gf_isom_text_set_highlight_color(GF_TextSample * samp, u8 r, u8 g, u8 b, u8 a);\r
+GF_Err gf_isom_text_set_highlight_color_argb(GF_TextSample * samp, u32 argb);\r
+/*appends a new karaoke sequence in the sample\r
+       @start_time: karaoke start time expressed in text stream timescale, but relative to the sample media time\r
+*/\r
+GF_Err gf_isom_text_add_karaoke(GF_TextSample * samp, u32 start_time);\r
+/*appends a new segment in the current karaoke sequence - you must build sequences in order to be compliant\r
+       @end_time: segment end time expressed in text stream timescale, but relative to the sample media time\r
+       @start_char: first char highlighted, \r
+       @end_char: first char not highlighted\r
+*/\r
+GF_Err gf_isom_text_set_karaoke_segment(GF_TextSample * samp, u32 end_time, u16 start_char, u16 end_char);\r
+/*sets scroll delay for the whole sample (scrolling is enabled through GF_TextSampleDescriptor.DisplayFlags)\r
+       @scroll_delay: delay for scrolling expressed in text stream timescale\r
+*/\r
+GF_Err gf_isom_text_set_scroll_delay(GF_TextSample * samp, u32 scroll_delay);\r
+/*appends hyperlinking for the sample\r
+       @URL: ASCII url\r
+       @altString: ASCII hint (tooltip, ...) for end user\r
+       @start_char: first char hyperlinked, \r
+       @end_char: first char not hyperlinked\r
+*/\r
+GF_Err gf_isom_text_add_hyperlink(GF_TextSample * samp, char *URL, char *altString, u16 start_char, u16 end_char);\r
+/*sets current text box (display pos&size within the text track window) for the sample*/\r
+GF_Err gf_isom_text_set_box(GF_TextSample * samp, s16 top, s16 left, s16 bottom, s16 right);\r
+/*appends blinking for the sample\r
+       @start_char: first char blinking, \r
+       @end_char: first char not blinking\r
+*/\r
+GF_Err gf_isom_text_add_blink(GF_TextSample * samp, u16 start_char, u16 end_char);\r
+/*sets wrap flag for the sample - currently only 0 (no wrap) and 1 ("soft wrap") are allowed in 3GP*/\r
+GF_Err gf_isom_text_set_wrap(GF_TextSample * samp, u8 wrap_flags);\r
+\r
+/*formats sample as a regular GF_ISOSample. The resulting sample will always be marked as random access\r
+text sample content is kept untouched*/\r
+GF_ISOSample *gf_isom_text_to_sample(GF_TextSample * tx_samp);\r
+\r
+#endif //GPAC_READ_ONLY\r
+\r
+/*****************************************************\r
+               ISMACryp Samples\r
+*****************************************************/\r
+/*flags for GF_ISMASample*/\r
+enum \r
+{\r
+       /*signals the stream the sample belongs to uses selective encryption*/\r
+       GF_ISOM_ISMA_USE_SEL_ENC = 1,\r
+       /*signals the sample is encrypted*/\r
+       GF_ISOM_ISMA_IS_ENCRYPTED = 2,\r
+};\r
+\r
+typedef struct\r
+{\r
+       /*IV in ISMACryp is Byte Stream Offset*/\r
+       u64 IV;\r
+       u8 IV_length;/*repeated from sampleDesc for convenience*/\r
+       u8 *key_indicator;\r
+       u8 KI_length;/*repeated from sampleDesc for convenience*/\r
+       u32 dataLength;\r
+       char *data;\r
+       u32 flags;\r
+} GF_ISMASample;\r
+/**\r
+ * creates a new empty ISMA sample\r
+ */\r
+GF_ISMASample *gf_isom_ismacryp_new_sample();\r
+\r
+/*delete an ISMA sample. NOTE:the buffers content will be destroyed by default.\r
+if you wish to keep the buffer, set dataLength to 0 in the sample before deleting it*/\r
+void gf_isom_ismacryp_delete_sample(GF_ISMASample *samp);\r
+\r
+/*decodes ISMACryp sample based on all info in ISMACryp sample description*/\r
+GF_ISMASample *gf_isom_ismacryp_sample_from_data(char *data, u32 dataLength, Bool use_selective_encryption, u8 KI_length, u8 IV_length);\r
+/*rewrites samp content from s content*/\r
+GF_Err gf_isom_ismacryp_sample_to_sample(GF_ISMASample *s, GF_ISOSample *dest);\r
+\r
+/*decodes ISMACryp sample based on sample and its descrition index - returns NULL if not an ISMA sample \r
+Note: input sample is NOT destroyed*/\r
+GF_ISMASample *gf_isom_get_ismacryp_sample(GF_ISOFile *the_file, u32 trackNumber, GF_ISOSample *samp, u32 sampleDescriptionIndex);\r
+\r
+/*returns whether the given media is a protected one or not - return scheme protection 4CC*/\r
+u32 gf_isom_is_media_encrypted(GF_ISOFile *the_file, u32 trackNumber, u32 sampleDescriptionIndex);\r
+\r
+/*returns whether the given media is a protected ISMACryp one or not*/\r
+Bool gf_isom_is_ismacryp_media(GF_ISOFile *the_file, u32 trackNumber, u32 sampleDescriptionIndex);\r
+\r
+/*returns whether the given media is a protected ISMACryp one or not*/\r
+Bool gf_isom_is_omadrm_media(GF_ISOFile *the_file, u32 trackNumber, u32 sampleDescriptionIndex);\r
+\r
+GF_Err gf_isom_get_omadrm_info(GF_ISOFile *the_file, u32 trackNumber, u32 sampleDescriptionIndex, u32 *outOriginalFormat,\r
+                                                          u32 *outSchemeType, u32 *outSchemeVersion,\r
+                                                          const char **outContentID, const char **outRightsIssuerURL, const char **outTextualHeaders, u32 *outTextualHeadersLen, u64 *outPlaintextLength, u32 *outEncryptionType, Bool *outSelectiveEncryption, u32 *outIVLength, u32 *outKeyIndicationLength);\r
+/*retrieves ISMACryp info for the given track & SDI - all output parameters are optional - URIs SHALL NOT BE MODIFIED BY USER\r
+       @outOriginalFormat: retrieves orginal protected media format - usually GF_ISOM_SUBTYPE_MPEG4\r
+       @outSchemeType: retrieves 4CC of protection scheme (GF_ISOM_ISMACRYP_SCHEME = iAEC in ISMACryp 1.0)\r
+       outSchemeVersion: retrieves version of protection scheme (1 in ISMACryp 1.0)\r
+       outSchemeURI: retrieves URI location of scheme \r
+       outKMS_URI: retrieves URI location of key management system - only valid with ISMACryp 1.0\r
+       outSelectiveEncryption: specifies whether sample-based encryption is used in media - only valid with ISMACryp 1.0\r
+       outIVLength: specifies length of Initial Vector - only valid with ISMACryp 1.0\r
+       outKeyIndicationLength: specifies length of key indicator - only valid with ISMACryp 1.0\r
+\r
+  outSelectiveEncryption, outIVLength and outKeyIndicationLength are usually not needed to decode an \r
+  ISMA sample when using gf_isom_get_ismacryp_sample fct above\r
+*/\r
+GF_Err gf_isom_get_ismacryp_info(GF_ISOFile *the_file, u32 trackNumber, u32 sampleDescriptionIndex, u32 *outOriginalFormat, u32 *outSchemeType, u32 *outSchemeVersion, const char **outSchemeURI, const char **outKMS_URI, Bool *outSelectiveEncryption, u32 *outIVLength, u32 *outKeyIndicationLength);\r
+\r
+\r
+#ifndef GPAC_READ_ONLY\r
+/*removes ISMACryp protection info (does not perform decryption :)*/\r
+GF_Err gf_isom_remove_ismacryp_protection(GF_ISOFile *the_file, u32 trackNumber, u32 StreamDescriptionIndex);\r
+\r
+/*creates ISMACryp protection info (does not perform encryption :)*/\r
+GF_Err gf_isom_set_ismacryp_protection(GF_ISOFile *the_file, u32 trackNumber, u32 desc_index, u32 scheme_type, \r
+                                                  u32 scheme_version, char *scheme_uri, char *kms_URI,\r
+                                                  Bool selective_encryption, u32 KI_length, u32 IV_length);\r
+\r
+/*change scheme URI and/or KMS URI for crypted files. Other params cannot be changed once the media is crypted\r
+       @scheme_uri: new scheme URI, or NULL to keep previous\r
+       @kms_uri: new KMS URI, or NULL to keep previous\r
+*/\r
+GF_Err gf_isom_change_ismacryp_protection(GF_ISOFile *the_file, u32 trackNumber, u32 StreamDescriptionIndex, char *scheme_uri, char *kms_uri);\r
+\r
+\r
+GF_Err gf_isom_set_oma_protection(GF_ISOFile *the_file, u32 trackNumber, u32 desc_index,\r
+                                                  char *contentID, char *kms_URI, u32 encryption_type, u64 plainTextLength, char *textual_headers, u32 textual_headers_len,\r
+                                                  Bool selective_encryption, u32 KI_length, u32 IV_length);\r
+\r
+#endif\r
+\r
+/*xml dumpers*/\r
+GF_Err gf_isom_dump_ismacryp_protection(GF_ISOFile *the_file, u32 trackNumber, FILE * trace);\r
+GF_Err gf_isom_dump_ismacryp_sample(GF_ISOFile *the_file, u32 trackNumber, u32 SampleNum, FILE *trace);\r
+\r
+\r
+/********************************************************************\r
+                               GENERAL META API FUNCTIONS\r
+       \r
+         Meta can be stored at several places in the file layout:\r
+               * root level (like moov, ftyp and co)\r
+               * moov level\r
+               * track level\r
+       Meta API uses the following parameters for all functions:\r
+       \r
+        gf_isom_*_meta_*(GF_ISOFile *file, Bool root_meta, u32 track_num, ....) with:\r
+               @root_meta: if set, accesses file root meta\r
+               @track_num: if root_meta not set, specifies whether the target meta is at the\r
+                       moov level (track_num=0) or at the track level.\r
+\r
+********************************************************************/\r
+\r
+/*gets meta type. Returned value: 0 if no meta found, or four char code of meta (eg, "mp21", "smil", ...)*/\r
+u32 gf_isom_get_meta_type(GF_ISOFile *file, Bool root_meta, u32 track_num);\r
+\r
+/*indicates if the meta has an XML container (note that XML data can also be included as items). \r
+return value: 0 (no XML or error), 1 (XML text), 2 (BinaryXML, eg BiM) */\r
+u32 gf_isom_has_meta_xml(GF_ISOFile *file, Bool root_meta, u32 track_num);\r
+\r
+/*extracts XML (if any) from given meta\r
+       @outName: output file path and location for writing\r
+       @is_binary: indicates if XML is Bim or regular XML\r
+*/\r
+GF_Err gf_isom_extract_meta_xml(GF_ISOFile *file, Bool root_meta, u32 track_num, char *outName, Bool *is_binary);\r
+\r
+/*returns number of items described in this meta*/\r
+u32 gf_isom_get_meta_item_count(GF_ISOFile *file, Bool root_meta, u32 track_num);\r
+\r
+/*gets item info for the given item\r
+       @item_num: 1-based index of item to query\r
+       @itemID (optional): item ID in file\r
+       @is_self_reference: item is the file itself\r
+       @item_name (optional): item name\r
+       @item_mime_type (optional): item mime type\r
+       @item_encoding (optional): item content encoding type\r
+       @item_url, @item_urn (optional): url/urn of external resource containing this item data if any. \r
+               When item is fully contained in file, these are set to NULL\r
+\r
+*/\r
+GF_Err gf_isom_get_meta_item_info(GF_ISOFile *file, Bool root_meta, u32 track_num, u32 item_num, \r
+                                                       u32 *itemID, u32 *protection_idx, Bool *is_self_reference,\r
+                                                       const char **item_name, const char **item_mime_type, const char **item_encoding,\r
+                                                       const char **item_url, const char **item_urn);\r
+\r
+\r
+/*gets item idx from item ID*/\r
+u32 gf_isom_get_meta_item_by_id(GF_ISOFile *file, Bool root_meta, u32 track_num, u32 item_ID);\r
+\r
+/*extracts item from given meta\r
+       @item_num: 1-based index of item to query\r
+*/\r
+GF_Err gf_isom_extract_meta_item(GF_ISOFile *file, Bool root_meta, u32 track_num, u32 item_num, const char *dump_file_name);\r
+\r
+/*retirves primary item ID, 0 if none found (primary can also be stored through meta XML)*/\r
+u32 gf_isom_get_meta_primary_item_id(GF_ISOFile *file, Bool root_meta, u32 track_num);\r
+\r
+#ifndef GPAC_READ_ONLY\r
+\r
+/*sets meta type (four char int, eg "mp21", ... \r
+       Creates a meta box if none found\r
+       if metaType is 0, REMOVES META \r
+*/\r
+GF_Err gf_isom_set_meta_type(GF_ISOFile *file, Bool root_meta, u32 track_num, u32 metaType);\r
+\r
+/*removes meta XML info if any*/\r
+GF_Err gf_isom_remove_meta_xml(GF_ISOFile *file, Bool root_meta, u32 track_num);\r
+\r
+/*set meta XML data from file - erase any previously (Binary)XML info*/\r
+GF_Err gf_isom_set_meta_xml(GF_ISOFile *file, Bool root_meta, u32 track_num, char *XMLFileName, Bool IsBinaryXML);\r
+\r
+/*adds item to meta:\r
+       @self_reference: indicates this item is the file itself\r
+       @resource_path: file to add - can be NULL when URL/URN is used\r
+       @item_name: item name - if NULL, use file name. CANNOT BE NULL if resource_path is not set\r
+       @mime_type: item mime type - if NULL, use "application/octet-stream"\r
+       @content_encoding: content encoding type - if NULL, none specified\r
+       @URL, @URN: if set, resource will be remote (same as stream descriptions)\r
+*/\r
+GF_Err gf_isom_add_meta_item(GF_ISOFile *file, Bool root_meta, u32 track_num, Bool self_reference, char *resource_path, const char *item_name, const char *mime_type, const char *content_encoding, const char *URL, const char *URN);\r
+\r
+/*removes item from meta*/\r
+GF_Err gf_isom_remove_meta_item(GF_ISOFile *file, Bool root_meta, u32 track_num, u32 item_num);\r
+\r
+/*sets the given item as the primary one. You SHALL NOT use this if the meta has a valid XML data*/\r
+GF_Err gf_isom_set_meta_primary_item(GF_ISOFile *file, Bool root_meta, u32 track_num, u32 item_num);\r
+\r
+#endif\r
+\r
+\r
+/********************************************************************\r
+                               Timed Meta-Data extensions\r
+********************************************************************/\r
+\r
+GF_Err gf_isom_get_timed_meta_data_info(GF_ISOFile *file, u32 track, u32 sampleDescription, Bool *is_xml, const char **mime_or_namespace, const char **content_encoding, const char **schema_loc);\r
+\r
+#ifndef GPAC_READ_ONLY\r
+/*create a new timed metat data sample description for this track*/\r
+GF_Err gf_isom_timed_meta_data_config_new(GF_ISOFile *movie, u32 trackNumber, Bool is_xml, char *mime_or_namespace, char *content_encoding, char *schema_loc, char *URLname, char *URNname, u32 *outDescriptionIndex);\r
+#endif\r
+\r
+\r
+/********************************************************************\r
+                               iTunes info tags\r
+********************************************************************/\r
+enum\r
+{\r
+       /*probe is only used ti check if iTunes info are present*/\r
+       GF_ISOM_ITUNE_PROBE = 0,\r
+       GF_ISOM_ITUNE_ALBUM     = GF_4CC( 0xA9, 'a', 'l', 'b' ),\r
+       GF_ISOM_ITUNE_ARTIST = GF_4CC( 0xA9, 'A', 'R', 'T' ),\r
+       GF_ISOM_ITUNE_COMMENT = GF_4CC( 0xA9, 'c', 'm', 't' ),\r
+       GF_ISOM_ITUNE_COMPILATION = GF_4CC( 'c', 'p', 'i', 'l' ),\r
+       GF_ISOM_ITUNE_COMPOSER = GF_4CC( 0xA9, 'c', 'o', 'm' ),\r
+       GF_ISOM_ITUNE_COVER_ART = GF_4CC( 'c', 'o', 'v', 'r' ),\r
+       GF_ISOM_ITUNE_CREATED = GF_4CC( 0xA9, 'd', 'a', 'y' ),\r
+       GF_ISOM_ITUNE_DISK = GF_4CC( 'd', 'i', 's', 'k' ),\r
+       GF_ISOM_ITUNE_TOOL = GF_4CC( 0xA9, 't', 'o', 'o' ),\r
+       GF_ISOM_ITUNE_GENRE = GF_4CC( 'g', 'n', 'r', 'e' ),\r
+       GF_ISOM_ITUNE_GROUP = GF_4CC( 0xA9, 'g', 'r', 'p' ),\r
+       GF_ISOM_ITUNE_ITUNES_DATA = GF_4CC( '-', '-', '-', '-' ),\r
+       GF_ISOM_ITUNE_NAME = GF_4CC( 0xA9, 'n', 'a', 'm' ),\r
+       GF_ISOM_ITUNE_TEMPO = GF_4CC( 't', 'm', 'p', 'o' ),\r
+       GF_ISOM_ITUNE_TRACK = GF_4CC( 0xA9, 't', 'r', 'k' ),\r
+       GF_ISOM_ITUNE_TRACKNUMBER = GF_4CC( 't', 'r', 'k', 'n' ),\r
+       GF_ISOM_ITUNE_WRITER = GF_4CC( 0xA9, 'w', 'r', 't' ),\r
+       GF_ISOM_ITUNE_ENCODER = GF_4CC( 0xA9, 'e', 'n', 'c' ),\r
+       GF_ISOM_ITUNE_ALBUM_ARTIST = GF_4CC( 'a', 'A', 'R', 'T' ),\r
+       GF_ISOM_ITUNE_GAPELESS = GF_4CC( 'p', 'g', 'a', 'p' ),\r
+};\r
+/*get the given tag info. \r
+!! 'genre' may be coded by ID, the libisomedia doesn't translate the ID. In such a case, the result data is set to NULL \r
+and the data_len to the genre ID\r
+returns GF_URL_ERROR if no tag is present in the file\r
+*/\r
+GF_Err gf_isom_apple_get_tag(GF_ISOFile *mov, u32 tag, const char **data, u32 *data_len);\r
+#ifndef GPAC_READ_ONLY\r
+/*set the given tag info. If data and data_len are 0, removes the given tag\r
+For 'genre', data may be NULL in which case the genre ID taken from the data_len parameter\r
+*/\r
+GF_Err gf_isom_apple_set_tag(GF_ISOFile *mov, u32 tag, const char *data, u32 data_len);\r
+\r
+/*sets compatibility tag on AVC tracks (needed by iPod to play files... hurray for standards)*/\r
+GF_Err gf_isom_set_ipod_compatible(GF_ISOFile *the_file, u32 trackNumber);\r
+#endif\r
+\r
+\r
+/*3GPP Alternate Group API - (c) 2007 ENST & ResonateMP4*/\r
+\r
+/*gets the number of switching groups declared in this track if any:\r
+trackNumber: track number\r
+alternateGroupID: alternate group id of track if speciifed, 0 otherwise\r
+nb_groups: number of switching groups defined for this track\r
+*/\r
+GF_Err gf_isom_get_track_switch_group_count(GF_ISOFile *movie, u32 trackNumber, u32 *alternateGroupID, u32 *nb_groups);\r
+\r
+/*returns the list of criteria (expressed as 4CC IDs, cf 3GPP TS 26.244)\r
+trackNumber: track number\r
+group_index: 1-based index of the group to inspect\r
+switchGroupID: ID of the switch group if any, 0 otherwise (alternate-only group)\r
+criteriaListSize: number of criteria items in returned list\r
+*/\r
+const u32 *gf_isom_get_track_switch_parameter(GF_ISOFile *movie, u32 trackNumber, u32 group_index, u32 *switchGroupID, u32 *criteriaListSize);\r
+\r
+#ifndef GPAC_READ_ONLY\r
+/*sets a new (switch) group for this track\r
+trackNumber: track\r
+trackRefGroup: number of a track belonging to the same alternate group. If 0, a new alternate group will be created for this track\r
+is_switch_group: if set, indicates that a switch group identifier shall be assigned to the created group. Otherwise, the criteria list is associated with the entire alternate group\r
+switchGroupID: SHALL NOT BE NULL\r
+       input: specifies the desired switchGroupID to use. If value is 0, next available switchGroupID in file is used.\r
+       output: indicates the switchGroupID used.\r
+criteriaList, criteriaListCount: criteria list and size. Criterias are expressed as 4CC IDs, cf 3GPP TS 26.244\r
+*/\r
+GF_Err gf_isom_set_track_switch_parameter(GF_ISOFile *movie, u32 trackNumber, u32 trackRefGroup, Bool is_switch_group, u32 *switchGroupID, u32 *criteriaList, u32 criteriaListCount);\r
+\r
+/*resets track switch group information for the track or for the entire alternate group this track belongs to if reset_all_group is set*/\r
+GF_Err gf_isom_reset_track_switch_parameter(GF_ISOFile *movie, u32 trackNumber, Bool reset_all_group);\r
+\r
+/*resets ALL track switch group information in the entire movie*/\r
+GF_Err gf_isom_reset_switch_parameters(GF_ISOFile *movie);\r
+\r
+#endif\r
+\r
+\r
+typedef struct\r
+{\r
+       u8 profile;\r
+       u8 level;\r
+       u8 pathComponents;\r
+       Bool fullRequestHost;\r
+       Bool streamType;\r
+       u8 containsRedundant;\r
+       const char *textEncoding;\r
+       const char *contentEncoding;\r
+       const char *content_script_types;\r
+} GF_DIMSDescription;\r
+\r
+GF_Err gf_isom_get_dims_description(GF_ISOFile *movie, u32 trackNumber, u32 descriptionIndex, GF_DIMSDescription *desc);\r
+#ifndef GPAC_READ_ONLY\r
+GF_Err gf_isom_new_dims_description(GF_ISOFile *movie, u32 trackNumber, GF_DIMSDescription *desc, char *URLname, char *URNname, u32 *outDescriptionIndex);\r
+GF_Err gf_isom_update_dims_description(GF_ISOFile *movie, u32 trackNumber, GF_DIMSDescription *desc, char *URLname, char *URNname, u32 DescriptionIndex);\r
+#endif\r
+\r
+\r
+\r
+\r
+/*AC3 config record*/\r
+typedef struct \r
+{\r
+       u8 fscod;\r
+       u8 bsid;\r
+       u8 bsmod;\r
+       u8 acmod;\r
+       u8 lfon;\r
+       u8 brcode;\r
+} GF_AC3Config;\r
+\r
+#ifndef GPAC_READ_ONLY\r
+GF_Err gf_isom_ac3_config_new(GF_ISOFile *the_file, u32 trackNumber, GF_AC3Config *cfg, char *URLname, char *URNname, u32 *outDescriptionIndex);\r
+#endif\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif /*_GF_ISOMEDIA_H_*/\r
+\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/laser.h b/tstools/DtsEdit/src/gpac/laser.h
new file mode 100644 (file)
index 0000000..4e05d63
--- /dev/null
@@ -0,0 +1,88 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Authors: Jean le Feuvre\r
+ *                             Copyright (c) 2005-200X ENST\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / BIFS codec sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_LASER_H_\r
+#define _GF_LASER_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/nodes_svg.h>\r
+\r
+/*for LASeRConfig*/\r
+#include <gpac/mpeg4_odf.h>\r
+\r
+#ifndef GPAC_DISABLE_SVG\r
+\r
+typedef struct __tag_laser_codec GF_LASeRCodec;\r
+\r
+\r
+/*LASeR decoder constructor*/\r
+GF_LASeRCodec *gf_laser_decoder_new(GF_SceneGraph *scenegraph);\r
+void gf_laser_decoder_del(GF_LASeRCodec *codec);\r
+\r
+/*sets the scene time. Scene time is the real clock of the bifs stream in secs*/\r
+void gf_laser_decoder_set_clock(GF_LASeRCodec *codec, Double (*GetSceneTime)(void *st_cbk), void *st_cbk );\r
+\r
+/*setup a stream*/\r
+GF_Err gf_laser_decoder_configure_stream(GF_LASeRCodec *codec, u16 ESID, char *DecoderSpecificInfo, u32 DecoderSpecificInfoLength);\r
+/*removes a stream*/\r
+GF_Err gf_laser_decoder_remove_stream(GF_LASeRCodec *codec, u16 ESID);\r
+\r
+/*decode a laser AU and applies it to the graph (non-memory mode only)*/\r
+GF_Err gf_laser_decode_au(GF_LASeRCodec *codec, u16 ESID, char *data, u32 data_length);\r
+\r
+/*Memory laser decoding - fills the command list with the content of the AU - cf scenegraph_vrml.h for commands usage\r
+       @ESID: ID of input stream\r
+       @data, @data_length: BIFS AU\r
+       @com_list: target list for decoded commands\r
+*/\r
+GF_Err gf_laser_decode_command_list(GF_LASeRCodec *codec, u16 ESID, char *data, u32 data_length, GF_List *com_list);\r
+\r
+\r
+/*constructor - @graph: scene graph being encoded*/\r
+GF_LASeRCodec *gf_laser_encoder_new(GF_SceneGraph *graph);\r
+/*destructor*/\r
+void gf_laser_encoder_del(GF_LASeRCodec *codec);\r
+/*setup a destination stream*/\r
+GF_Err gf_laser_encoder_new_stream(GF_LASeRCodec *codec, u16 ESID, GF_LASERConfig *cfg);\r
+/*encodes a list of commands for the given stream in the output buffer - data is dynamically allocated for output*/\r
+GF_Err gf_laser_encode_au(GF_LASeRCodec *codec, u16 ESID, GF_List *command_list, Bool reset_encoding_context, char **out_data, u32 *out_data_length);\r
+/*returns encoded config desc*/\r
+GF_Err gf_laser_encoder_get_config(GF_LASeRCodec *codec, u16 ESID, char **out_data, u32 *out_data_length);\r
+\r
+/*Encodes current graph as a scene replace*/\r
+GF_Err gf_laser_encoder_get_rap(GF_LASeRCodec *codec, char **out_data, u32 *out_data_length);\r
+\r
+\r
+#endif\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/libgpac_static.lib b/tstools/DtsEdit/src/gpac/libgpac_static.lib
new file mode 100644 (file)
index 0000000..f9d9236
Binary files /dev/null and b/tstools/DtsEdit/src/gpac/libgpac_static.lib differ
diff --git a/tstools/DtsEdit/src/gpac/libgpac_static_msvcr.lib b/tstools/DtsEdit/src/gpac/libgpac_static_msvcr.lib
new file mode 100644 (file)
index 0000000..43711a3
Binary files /dev/null and b/tstools/DtsEdit/src/gpac/libgpac_static_msvcr.lib differ
diff --git a/tstools/DtsEdit/src/gpac/list.h b/tstools/DtsEdit/src/gpac/list.h
new file mode 100644 (file)
index 0000000..ca3239d
--- /dev/null
@@ -0,0 +1,168 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / common tools sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_LIST_H_\r
+#define _GF_LIST_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/*!\r
+ *     \file <gpac/list.h>\r
+ *     \brief list functions.\r
+ */\r
+\r
+/*!\r
+ *     \addtogroup list_grp list\r
+ *     \ingroup utils_grp\r
+ *     \brief List object\r
+ *\r
+ *     This section documents the list object of the GPAC framework.\r
+ *     @{\r
+ */\r
+\r
+#include <gpac/tools.h>\r
+\r
+typedef struct _tag_array GF_List;\r
+\r
+/*!\r
+ *     \brief list constructor\r
+ *\r
+ *     Constructs a new list object\r
+ *     \return new list object\r
+ */\r
+GF_List *gf_list_new();\r
+/*!\r
+ *     \brief list destructor\r
+ *\r
+ *     Destructs a list object\r
+ *     \param ptr list object to destruct\r
+ *     \note It is the caller responsability to destroy the content of the list if needed\r
+ */\r
+void gf_list_del(GF_List *ptr);\r
+/*!\r
+ *     \brief get count\r
+ *\r
+ *     Returns number of items in the list\r
+ *     \param ptr target list object\r
+ *     \return number of items in the list\r
+ */\r
+u32 gf_list_count(GF_List *ptr);\r
+/*!\r
+ *     \brief add item\r
+ *\r
+ *     Adds an item at the end of the list\r
+ *     \param ptr target list object\r
+ *     \param item item to add\r
+ */\r
+GF_Err gf_list_add(GF_List *ptr, void* item);\r
+/*!\r
+ *     \brief inserts item\r
+ *\r
+ *     Insert an item in the list\r
+ *     \param ptr target list object\r
+ *     \param item item to add\r
+ *     \param position insertion position. It is expressed between 0 and gf_list_count-1, and any bigger value is equivalent to gf_list_add\r
+ */\r
+GF_Err gf_list_insert(GF_List *ptr, void *item, u32 position);\r
+/*!\r
+ *     \brief removes item\r
+ *\r
+ *     Removes an item from the list given its position\r
+ *     \param ptr target list object\r
+ *     \param position position of the item to remove. It is expressed between 0 and gf_list_count-1.\r
+ *     \note It is the caller responsability to destroy the content of the list if needed\r
+ */\r
+GF_Err gf_list_rem(GF_List *ptr, u32 position);\r
+/*!\r
+ *     \brief gets item\r
+ *\r
+ *     Gets an item from the list given its position\r
+ *     \param ptr target list object\r
+ *     \param position position of the item to get. It is expressed between 0 and gf_list_count-1.\r
+ */\r
+void *gf_list_get(GF_List *ptr, u32 position);\r
+/*!\r
+ *     \brief finds item\r
+ *\r
+ *     Finds an item in the list\r
+ *     \param ptr target list object.\r
+ *     \param item the item to find.\r
+ *     \return 0-based item position in the list, or -1 if the item could not be found.\r
+ */\r
+s32 gf_list_find(GF_List *ptr, void *item);\r
+/*!\r
+ *     \brief deletes item\r
+ *\r
+ *     Deletes an item from the list\r
+ *     \param ptr target list object.\r
+ *     \param item the item to find.\r
+ *     \return 0-based item position in the list before removal, or -1 if the item could not be found.\r
+ */\r
+s32 gf_list_del_item(GF_List *ptr, void *item);\r
+/*!\r
+ *     \brief resets list\r
+ *\r
+ *     Resets the content of the list\r
+ *     \param ptr target list object.\r
+ *     \note It is the caller responsability to destroy the content of the list if needed\r
+ */\r
+void gf_list_reset(GF_List *ptr);\r
+/*!\r
+ *     \brief gets last item\r
+ *\r
+ *     Gets last item o fthe list \r
+ *     \param ptr target list object\r
+ */\r
+void *gf_list_last(GF_List *ptr);\r
+/*!\r
+ *     \brief removes last item\r
+ *\r
+ *     Removes the last item of the list\r
+ *     \param ptr target list object\r
+ *     \note It is the caller responsability to destroy the content of the list if needed\r
+ */\r
+GF_Err gf_list_rem_last(GF_List *ptr);\r
+\r
+\r
+/*!\r
+ *     \brief list enumerator\r
+ *\r
+ *     Retrieves given list item and increment current position\r
+ *     \param ptr target list object\r
+ *     \param pos target item position. The position is automatically incremented regardless of the return value\r
+ *     \note A typical enumeration will start with a value of 0 until NULL is returned.\r
+ */\r
+void *gf_list_enum(GF_List *ptr, u32 *pos);\r
+\r
+/*! @} */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif         /*_GF_LIST_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/math.h b/tstools/DtsEdit/src/gpac/math.h
new file mode 100644 (file)
index 0000000..27d4cd4
--- /dev/null
@@ -0,0 +1,1048 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / common tools sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_MATH_H_\r
+#define _GF_MATH_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/*!\r
+ *     \file <gpac/math.h>\r
+ *     \brief math and trigo functions.\r
+ */\r
+\r
+#include <gpac/setup.h>\r
+       \r
+/*NOTE: there is a conflict on Win32 VC6 with C++ and gpac headers when including <math.h>*/\r
+#if !defined(__cplusplus) || defined(__SYMBIAN32__)\r
+#include <math.h>\r
+#endif\r
+\r
+/*!\r
+ \cond DUMMY_DOXY_SECTION\r
+*/\r
+\r
+#ifndef GPAC_FIXED_POINT\r
+/*note: \r
+               to turn fp on, change to GPAC_FIXED_POINT\r
+               to turn fp off, change to GPAC_NO_FIXED_POINT\r
+       this is needed by configure+sed to modify this file directly\r
+*/\r
+#define GPAC_NO_FIXED_POINT\r
+#endif\r
+\r
+/*!\r
+ \endcond\r
+*/\r
+\r
+\r
+/*!\r
+ *\addtogroup math_grp math\r
+ *\ingroup utils_grp\r
+ *\brief Mathematics and Trigonometric functions\r
+ *\r
+ *This section documents the math and trigo functions used in the GPAC framework. GPAC can be compiled with\r
+ *fixed-point support, representing float values on a 16.16 signed integer, which implies a developer \r
+ *must take care of float computations when using GPAC.\n\r
+ *A developper should not need to know in which mode the framework has been compiled as long as he uses\r
+ *the math functions of GPAC which work in both float and fixed-point mode.\n\r
+ *Using fixed-point version is decided at compilation time and cannot be changed. The feature is signaled\r
+ *through the following macros:\r
+ *- GPAC_FIXED_POINT: when defined, GPAC has been compiled in fixed-point mode\r
+ *- GPAC_NO_FIXED_POINT: when defined, GPAC has been compiled in regular (float) mode\r
+ *     @{\r
+ */\r
+\r
+\r
+/*****************************************************************************************\r
+                       FIXED-POINT SUPPORT - HARDCODED FOR 16.16 representation\r
+       the software rasterizer also use a 16.16 representation even in non-fixed version\r
+******************************************************************************************/\r
+\r
+#ifdef GPAC_FIXED_POINT\r
+\r
+/*!\r
+ *Fixed 16.16 number\r
+ *\hideinitializer\r
+ \note This documentation has been generated for a fixed-point version of the GPAC framework.\r
+ */\r
+typedef s32 Fixed;\r
+#define FIX_ONE                        0x10000L\r
+#define INT2FIX(v)             ((Fixed)( ((s32) (v) ) << 16))\r
+#define FLT2FIX(v)             ((Fixed) ((v) * FIX_ONE))\r
+#define FIX2INT(v)             ((s32)(((v)+((FIX_ONE>>1)))>>16))\r
+#define FIX2FLT(v)             ((Float)( ((Float)(v)) / ((Float) FIX_ONE)))\r
+#define FIX_EPSILON            2\r
+#define FIX_MAX                        0x7FFFFFFF\r
+#define FIX_MIN                        -FIX_MAX\r
+#define GF_PI2         102944\r
+#define GF_PI          205887\r
+#define GF_2PI         411774\r
+\r
+/*!\return 1/a, expressed as fixed number*/\r
+Fixed gf_invfix(Fixed a);\r
+/*!\return a*b, expressed as fixed number*/\r
+Fixed gf_mulfix(Fixed a, Fixed b);\r
+/*!\return a*b/c, expressed as fixed number*/\r
+Fixed gf_muldiv(Fixed a, Fixed b, Fixed c);\r
+/*!\return a/b, expressed as fixed number*/\r
+Fixed gf_divfix(Fixed a, Fixed b);\r
+/*!\return sqrt(a), expressed as fixed number*/\r
+Fixed gf_sqrt(Fixed x);\r
+/*!\return ceil(a), expressed as fixed number*/\r
+Fixed gf_ceil(Fixed a);\r
+/*!\return floor(a), expressed as fixed number*/\r
+Fixed gf_floor(Fixed a);\r
+/*!\return cos(a), expressed as fixed number*/\r
+Fixed gf_cos(Fixed angle);\r
+/*!\return sin(a), expressed as fixed number*/\r
+Fixed gf_sin(Fixed angle);\r
+/*!\return tan(a), expressed as fixed number*/\r
+Fixed gf_tan(Fixed angle);\r
+/*!\return acos(a), expressed as fixed number*/\r
+Fixed gf_acos(Fixed angle);\r
+/*!\return asin(a), expressed as fixed number*/\r
+Fixed gf_asin(Fixed angle);\r
+/*!\return atan(y, x), expressed as fixed number*/\r
+Fixed gf_atan2(Fixed y, Fixed x);\r
+\r
+#else\r
+\r
+\r
+/*!Fixed is 32bit float number\r
+ \note This documentation has been generated for a float version of the GPAC framework.\r
+*/\r
+typedef Float Fixed;\r
+#define FIX_ONE                        1.0f\r
+#define INT2FIX(v)             ((Float) (v))\r
+#define FLT2FIX(v)             ((Float) (v))\r
+#define FIX2INT(v)             ((s32)(v))\r
+#define FIX2FLT(v)             ((Float) (v))\r
+#define FIX_EPSILON            GF_EPSILON_FLOAT\r
+#define FIX_MAX                        GF_MAX_FLOAT\r
+#define FIX_MIN                        -GF_MAX_FLOAT\r
+#define GF_PI2         1.5707963267949f\r
+#define GF_PI          3.1415926535898f\r
+#define GF_2PI         6.2831853071796f\r
+\r
+/*!\hideinitializer 1/_a, expressed as fixed number*/\r
+#define gf_invfix(_a)  (FIX_ONE/(_a))\r
+/*!\hideinitializer _a*_b, expressed as fixed number*/\r
+#define gf_mulfix(_a, _b)              ((_a)*(_b))\r
+/*!\hideinitializer _a*_b/_c, expressed as fixed number*/\r
+#define gf_muldiv(_a, _b, _c)  ((_c) ? (_a)*(_b)/(_c) : GF_MAX_FLOAT)\r
+/*!\hideinitializer _a/_b, expressed as fixed number*/\r
+#define gf_divfix(_a, _b)              ((_b) ? (_a)/(_b) : GF_MAX_FLOAT)\r
+/*!\hideinitializer sqrt(_a), expressed as fixed number*/\r
+#define gf_sqrt(_a) ((Float) sqrt(_a))\r
+/*!\hideinitializer ceil(_a), expressed as fixed number*/\r
+#define gf_ceil(_a) ((Float) ceil(_a))\r
+/*!\hideinitializer floor(_a), expressed as fixed number*/\r
+#define gf_floor(_a) ((Float) floor(_a))\r
+/*!\hideinitializer cos(_a), expressed as fixed number*/\r
+#define gf_cos(_a) ((Float) cos(_a))\r
+/*!\hideinitializer sin(_a), expressed as fixed number*/\r
+#define gf_sin(_a) ((Float) sin(_a))\r
+/*!\hideinitializer tan(_a), expressed as fixed number*/\r
+#define gf_tan(_a) ((Float) tan(_a))\r
+/*!\hideinitializer atan2(_y,_x), expressed as fixed number*/\r
+#define gf_atan2(_y, _x) ((Float) atan2(_y, _x))\r
+/*!\hideinitializer acos(_a), expressed as fixed number*/\r
+#define gf_acos(_a) ((Float) acos(_a))\r
+/*!\hideinitializer asin(_a), expressed as fixed number*/\r
+#define gf_asin(_a) ((Float) asin(_a))\r
+\r
+#endif\r
+\r
+/*!\def FIX_ONE\r
+ \hideinitializer\r
+ Fixed unit value\r
+*/\r
+/*!\def INT2FIX(v)\r
+ \hideinitializer\r
+ Conversion from integer to fixed\r
+*/\r
+/*!\def FLT2FIX(v)\r
+ \hideinitializer\r
+ Conversion from float to fixed\r
+*/\r
+/*!\def FIX2INT(v)\r
+ \hideinitializer\r
+ Conversion from fixed to integer\r
+*/\r
+/*!\def FIX2FLT(v)\r
+ \hideinitializer\r
+ Conversion from fixed to float\r
+*/\r
+/*!\def FIX_EPSILON\r
+ \hideinitializer\r
+ Epsilon Fixed (positive value closest to 0)\r
+*/\r
+/*!\def FIX_MAX\r
+ \hideinitializer\r
+ Maximum Fixed (maximum representable fixed value)\r
+*/\r
+/*!\def FIX_MIN\r
+ \hideinitializer\r
+ Minimum Fixed (minimum representable fixed value)\r
+*/\r
+/*!\def GF_PI2\r
+ \hideinitializer\r
+ PI/2 expressed as Fixed\r
+*/\r
+/*!\def GF_PI\r
+ \hideinitializer\r
+ PI expressed as Fixed\r
+*/\r
+/*!\def GF_2PI\r
+ \hideinitializer\r
+ 2*PI expressed as Fixed\r
+*/\r
+\r
+Fixed gf_angle_diff(Fixed a, Fixed b);\r
+\r
+/*!\r
+ *     \brief Field bit-size \r
+ *\r
+ *     Gets the number of bits needed to represent the value.\r
+ *     \param MaxVal Maximum value to be represented.\r
+ *     \return number of bits required to represent the value.\r
+ */\r
+u32 gf_get_bit_size(u32 MaxVal);\r
+\r
+/*!\r
+ *     \brief Get power of 2\r
+ *\r
+ *     Gets the closest power of 2 greater or equal to the value.\r
+ *     \param val value to be used.\r
+ *     \return requested power of 2.\r
+ */\r
+u32 gf_get_next_pow2(u32 val);\r
+\r
+/*!\r
+ *\addtogroup math2d_grp math2d\r
+ *\ingroup math_grp\r
+ *\brief 2D Mathematics functions\r
+ *\r
+ *This section documents mathematic tools for 2D geometry and color matrices operations\r
+ *     @{\r
+ */\r
+\r
+/*!\brief 2D point\r
+ *\r
+ *The 2D point object is used in all the GPAC framework for both point and vector representation.\r
+*/\r
+typedef struct __vec2f\r
+{\r
+       Fixed x;\r
+       Fixed y;\r
+} GF_Point2D;\r
+/*!\r
+ *\brief get 2D vector length\r
+ *\r
+ *Gets the length of a 2D vector\r
+ *\return length of the vector\r
+ */\r
+Fixed gf_v2d_len(GF_Point2D *vec);\r
+/*!\r
+ *\brief 2D vector from polar coordinates\r
+ *\r
+ *Constructs a 2D vector from its polar coordinates\r
+ *\param length the length of the vector\r
+ *\param angle the angle of the vector in radians\r
+ *\return the 2D vector\r
+ */\r
+GF_Point2D gf_v2d_from_polar(Fixed length, Fixed angle);\r
+\r
+/*!\brief rectangle 2D\r
+ *\r
+ *The 2D rectangle used in the GPAC project.\r
+ */\r
+typedef struct\r
+{\r
+       /*!the left coordinate of the rectangle*/\r
+       Fixed x;\r
+       /*!the top coordinate of the rectangle, regardless of the canvas orientation. In other words, y is always the \r
+       greatest coordinate value,      even if the rectangle is presented bottom-up. This insures proper rectangles testing*/\r
+       Fixed y;\r
+       /*!the width of the rectangle. Width must be greater than or equal to 0*/\r
+       Fixed width;\r
+       /*!the height of the rectangle. Height must be greater than or equal to 0*/\r
+       Fixed height;\r
+} GF_Rect;\r
+\r
+/*!\r
+ \brief rectangle union\r
+ *\r
+ *Gets the union of two rectangles.\r
+ *\param rc1 first rectangle of the union. Upon return, this rectangle will contain the result of the union\r
+ *\param rc2 second rectangle of the union\r
+*/\r
+void gf_rect_union(GF_Rect *rc1, GF_Rect *rc2);\r
+/*!\r
+ \brief centers a rectangle\r
+ *\r
+ *Builds a rectangle centered on the origin\r
+ *\param w width of the rectangle\r
+ *\param h height of the rectangle\r
+ *\return centered rectangle object\r
+*/\r
+GF_Rect gf_rect_center(Fixed w, Fixed h);\r
+/*!\r
+ \brief rectangle overlap test\r
+ *\r
+ *Tests if two rectangles overlap.\r
+ *\param rc1 first rectangle to test\r
+ *\param rc2 second rectangle to test\r
+ *\return 1 if rectangles overlap, 0 otherwise\r
+*/\r
+Bool gf_rect_overlaps(GF_Rect rc1, GF_Rect rc2);\r
+/*!\r
+ \brief rectangle identity test\r
+ *\r
+ *Tests if two rectangles are identical.\r
+ *\param rc1 first rectangle to test\r
+ *\param rc2 second rectangle to test\r
+ *\return 1 if rectangles are identical, 0 otherwise\r
+*/\r
+Bool gf_rect_equal(GF_Rect rc1, GF_Rect rc2);\r
+\r
+/*!\r
+ *\brief pixel-aligned rectangle\r
+ *\r
+ *Pixel-aligned rectangle used in the GPAC framework. This is usually needed for 2D drawing algorithms.\r
+ */\r
+typedef struct\r
+{\r
+       /*!the left coordinate of the rectangle*/\r
+       s32 x;\r
+       /*!the top coordinate of the rectangle, regardless of the canvas orientation. In other words, y is always the \r
+       greatest coordinate value, even if the rectangle is presented bottom-up. This insures proper rectangles operations*/\r
+       s32 y;\r
+       /*!the width of the rectangle. Width must be greater than or equal to 0*/\r
+       s32 width;\r
+       /*!the height of the rectangle. Height must be greater than or equal to 0*/\r
+       s32 height;\r
+} GF_IRect;\r
+/*!\r
+ *\brief gets the pixelized version of a rectangle\r
+ *\r
+ *Returns the smallest pixel-aligned rectangle completely containing a rectangle\r
+ *\param r the rectangle to transform\r
+ *\return the pixel-aligned transformed rectangle\r
+*/\r
+GF_IRect gf_rect_pixelize(GF_Rect *r);\r
+\r
+\r
+/*!\r
+ *\brief 2D matrix\r
+ *\r
+ *The 2D affine matrix object usied in GPAC. The transformation of P(x,y) in P'(X, Y) is:\r
+ \code\r
+       X = m[0]*x + m[1]*y + m[2];\r
+       Y = m[3]*x + m[4]*y + m[5];\r
+ \endcode\r
+*/\r
+typedef struct\r
+{\r
+       Fixed m[6];\r
+} GF_Matrix2D;\r
+\r
+/*!\brief matrix initialization\r
+ *\hideinitializer\r
+ *\r
+ *Inits the matrix to the identity matrix\r
+*/\r
+#define gf_mx2d_init(_obj) { memset((_obj).m, 0, sizeof(Fixed)*6); (_obj).m[0] = (_obj).m[4] = FIX_ONE; }\r
+/*!\brief matrix copy\r
+ *\hideinitializer\r
+ *\r
+ *Copies the matrix _from to the matrix _obj\r
+*/\r
+#define gf_mx2d_copy(_obj, from) memcpy((_obj).m, (from).m, sizeof(Fixed)*6)\r
+/*!\brief matrix identity testing\r
+ *\hideinitializer\r
+ *\r
+ *This macro evaluates to 1 if the matrix _obj is the identity matrix, 0 otherwise\r
+*/\r
+#define gf_mx2d_is_identity(_obj) ((!(_obj).m[1] && !(_obj).m[2] && !(_obj).m[3] && !(_obj).m[5] && ((_obj).m[0]==FIX_ONE) && ((_obj).m[4]==FIX_ONE)) ? 1 : 0)\r
+\r
+/*!\brief 2D matrix multiplication\r
+ *\r
+ *Multiplies two 2D matrices from*_this\r
+ *\param _this matrix being transformed. Once the function is called, _this contains the result matrix\r
+ *\param from transformation matrix to add\r
+*/\r
+void gf_mx2d_add_matrix(GF_Matrix2D *_this, GF_Matrix2D *from);\r
+\r
+/*!\brief 2D matrix pre-multiplication\r
+ *\r
+ *Multiplies two 2D matrices _this*from\r
+ *\param _this matrix being transformed. Once the function is called, _this contains the result matrix\r
+ *\param from transformation matrix to add\r
+*/\r
+void gf_mx2d_pre_multiply(GF_Matrix2D *_this, GF_Matrix2D *from);\r
+\r
+/*!\brief matrix translating\r
+ *\r
+ *Translates a 2D matrix\r
+ *\param _this matrix being transformed. Once the function is called, _this contains the result matrix\r
+ *\param cx horizontal translation\r
+ *\param cy vertical translation\r
+*/\r
+void gf_mx2d_add_translation(GF_Matrix2D *_this, Fixed cx, Fixed cy);\r
+/*!\brief matrix rotating\r
+ *\r
+ *Rotates a 2D matrix\r
+ *\param _this matrix being transformed. Once the function is called, _this contains the result matrix\r
+ *\param cx horizontal rotation center coordinate\r
+ *\param cy vertical rotation center coordinate\r
+ *\param angle rotation angle in radians\r
+*/\r
+void gf_mx2d_add_rotation(GF_Matrix2D *_this, Fixed cx, Fixed cy, Fixed angle);\r
+/*!\brief matrix scaling\r
+ *\r
+ *Scales a 2D matrix\r
+ *\param _this matrix being transformed. Once the function is called, _this contains the result matrix\r
+ *\param scale_x horizontal scaling factor\r
+ *\param scale_y vertical scaling factor\r
+*/\r
+void gf_mx2d_add_scale(GF_Matrix2D *_this, Fixed scale_x, Fixed scale_y);\r
+/*!\brief matrix uncentered scaling\r
+ *\r
+ *Scales a 2D matrix with a non-centered scale\r
+ *\param _this matrix being transformed. Once the function is called, _this contains the result matrix\r
+ *\param scale_x horizontal scaling factor\r
+ *\param scale_y vertical scaling factor\r
+ *\param cx horizontal scaling center coordinate\r
+ *\param cy vertical scaling center coordinate\r
+ *\param angle scale orienttion angle in radians\r
+*/\r
+void gf_mx2d_add_scale_at(GF_Matrix2D *_this, Fixed scale_x, Fixed scale_y, Fixed cx, Fixed cy, Fixed angle);\r
+/*!\brief matrix skewing\r
+ *\r
+ *Skews a 2D matrix\r
+ *\param _this matrix being transformed. Once the function is called, _this contains the result matrix\r
+ *\param skew_x horizontal skew factor\r
+ *\param skew_y vertical skew factor\r
+*/\r
+void gf_mx2d_add_skew(GF_Matrix2D *_this, Fixed skew_x, Fixed skew_y);\r
+/*!\brief matrix horizontal skewing\r
+ *\r
+ *Skews a 2D matrix horizontally by a given angle\r
+ *\param _this matrix being transformed. Once the function is called, _this contains the result matrix\r
+ *\param angle horizontal skew angle in radians\r
+*/\r
+void gf_mx2d_add_skew_x(GF_Matrix2D *_this, Fixed angle);\r
+/*!\brief matrix vertical skewing\r
+ *\r
+ *Skews a 2D matrix vertically by a given angle\r
+ *\param _this matrix being transformed. Once the function is called, _this contains the result matrix\r
+ *\param angle vertical skew angle in radians\r
+*/\r
+void gf_mx2d_add_skew_y(GF_Matrix2D *_this, Fixed angle);\r
+/*!\brief matrix inversing\r
+ *\r
+ *Inverses a 2D matrix \r
+ *\param _this matrix being transformed. Once the function is called, _this contains the result matrix\r
+*/\r
+void gf_mx2d_inverse(GF_Matrix2D *_this);\r
+/*!\brief matrix coordinate transformation\r
+ *\r
+ *Applies a 2D matrix transformation to coordinates\r
+ *\param _this transformation matrix\r
+ *\param x pointer to horizontal coordinate. Once the function is called, x contains the transformed horizontal coordinate\r
+ *\param y pointer to vertical coordinate. Once the function is called, y contains the transformed vertical coordinate\r
+*/\r
+void gf_mx2d_apply_coords(GF_Matrix2D *_this, Fixed *x, Fixed *y);\r
+/*!\brief matrix point transformation\r
+ *\r
+ *Applies a 2D matrix transformation to a 2D point\r
+ *\param _this transformation matrix\r
+ *\param pt pointer to 2D point. Once the function is called, pt contains the transformed point\r
+*/\r
+void gf_mx2d_apply_point(GF_Matrix2D *_this, GF_Point2D *pt);\r
+/*!\brief matrix rectangle transformation\r
+ *\r
+ *Applies a 2D matrix transformation to a rectangle, giving the enclosing rectangle of the transformed one\r
+ *\param _this transformation matrix\r
+ *\param rc pointer to rectangle. Once the function is called, rc contains the transformed rectangle\r
+*/\r
+void gf_mx2d_apply_rect(GF_Matrix2D *_this, GF_Rect *rc);\r
+\r
+/*!\brief matrix decomposition\r
+ *\r
+ *Decomposes a 2D matrix M as M=Scale x Rotation x Translation if possible\r
+ *\param _this transformation matrix\r
+ *\param scale resulting scale part\r
+ *\param rotate resulting rotation part\r
+ *\param translate resulting translation part\r
+ *\return 0 if matrix cannot be decomposed, 1 otherwise\r
+*/\r
+Bool gf_mx2d_decompose(GF_Matrix2D *_this, GF_Point2D *scale, Fixed *rotate, GF_Point2D *translate);\r
+\r
+/*! @} */\r
+\r
+\r
+/*!\r
+ *\addtogroup math3d_grp math3d\r
+ *\ingroup math_grp\r
+ *\brief 3D Mathematics functions\r
+ *\r
+ *This section documents mathematic tools for 3D geometry operations\r
+ *     @{\r
+ */\r
+\r
+/*!\brief 3D point or vector\r
+ *\r
+ *The 3D point object is used in all the GPAC framework for both point and vector representation.\r
+*/\r
+typedef struct __vec3f\r
+{\r
+       Fixed x;\r
+       Fixed y;\r
+       Fixed z;\r
+} GF_Vec;\r
+\r
+/*base vector operations are MACROs for faster access*/\r
+/*!\hideinitializer macro evaluating to 1 if vectors are equal, 0 otherwise*/\r
+#define gf_vec_equal(v1, v2) (((v1).x == (v2).x) && ((v1).y == (v2).y) && ((v1).z == (v2).z))\r
+/*!\hideinitializer macro reversing a vector v = v*/\r
+#define gf_vec_rev(v) { (v).x = -(v).x; (v).y = -(v).y; (v).z = -(v).z; }\r
+/*!\hideinitializer macro performing the minus operation res = v1 - v2*/\r
+#define gf_vec_diff(res, v1, v2) { (res).x = (v1).x - (v2).x; (res).y = (v1).y - (v2).y; (res).z = (v1).z - (v2).z; }\r
+/*!\hideinitializer macro performing the add operation res = v1 + v2*/\r
+#define gf_vec_add(res, v1, v2) { (res).x = (v1).x + (v2).x; (res).y = (v1).y + (v2).y; (res).z = (v1).z + (v2).z; }\r
+\r
+/*!\r
+ *\brief get 3D vector length\r
+ *\r
+ *Gets the length of a 3D vector\r
+ *\return length of the vector\r
+ */\r
+Fixed gf_vec_len(GF_Vec v);\r
+/*!\r
+ *\brief get 3D vector square length\r
+ *\r
+ *Gets the square length of a 3D vector\r
+ *\return square length of the vector\r
+ */\r
+Fixed gf_vec_lensq(GF_Vec v);\r
+/*!\r
+ *\brief get 3D vector dot product\r
+ *\r
+ *Gets the dot product of two vectors\r
+ *\return dot product of the vectors\r
+ */\r
+Fixed gf_vec_dot(GF_Vec v1, GF_Vec v2);\r
+/*!\r
+ *\brief vector normalization\r
+ *\r
+ *Norms the vector, eg make its length equal to \ref FIX_ONE\r
+ *\param v vector to normalize\r
+ */\r
+void gf_vec_norm(GF_Vec *v);\r
+/*!\r
+ *\brief vector scaling\r
+ *\r
+ *Scales a vector by a given amount\r
+ *\param v vector to scale\r
+ *\param f scale factor\r
+ *\return scaled vector\r
+ */\r
+GF_Vec gf_vec_scale(GF_Vec v, Fixed f);\r
+/*!\r
+ *\brief vector cross product\r
+ *\r
+ *Gets the cross product of two vectors\r
+ *\param v1 first vector\r
+ *\param v2 second vector\r
+ *\return cross-product vector\r
+ */\r
+GF_Vec gf_vec_cross(GF_Vec v1, GF_Vec v2);\r
+\r
+/*!\brief 4D vector\r
+ *\r
+ *The 4D vector object is used in all the GPAC framework for 4 dimension vectors, VRML Rotations and quaternions representation.\r
+*/\r
+typedef struct __vec4f\r
+{\r
+       Fixed x;\r
+       Fixed y;\r
+       Fixed z;\r
+       Fixed q;\r
+} GF_Vec4;\r
+\r
+\r
+/*!\brief 3D matrix\r
+ *\r
+ *The 3D matrix object used in GPAC. The matrix is oriented like OpenGL matrices (column-major ordering), with \r
+ the translation part at the end of the coefficients list.\r
+ \note Unless specified otherwise, the matrix object is always expected to represent an affine transformation.\r
+ */\r
+typedef struct\r
+{\r
+       Fixed m[16];\r
+} GF_Matrix;\r
+\r
+\r
+/*!\hideinitializer gets the len of a quaternion*/\r
+#define gf_quat_len(v) gf_sqrt(gf_mulfix((v).q,(v).q) + gf_mulfix((v).x,(v).x) + gf_mulfix((v).y,(v).y) + gf_mulfix((v).z,(v).z))\r
+/*!\hideinitializer normalizes a quaternion*/\r
+#define gf_quat_norm(v) { \\r
+       Fixed __mag = gf_quat_len(v);   \\r
+       (v).x = gf_divfix((v).x, __mag); (v).y = gf_divfix((v).y, __mag); (v).z = gf_divfix((v).z, __mag); (v).q = gf_divfix((v).q, __mag);     \\r
+       }       \\r
+\r
+/*!\brief quaternion to rotation\r
+ *\r
+ *Transforms a quaternion to a Rotation, expressed as a 4 dimension vector with x,y,z for axis and q for rotation angle\r
+ *\param quat the quaternion to transform\r
+ *\return the rotation value\r
+ */\r
+GF_Vec4 gf_quat_to_rotation(GF_Vec4 *quat);\r
+/*!\brief quaternion from rotation\r
+ *\r
+ *Transforms a Rotation to a quaternion\r
+ *\param rot the rotation to transform\r
+ *\return the quaternion value\r
+ */\r
+GF_Vec4 gf_quat_from_rotation(GF_Vec4 rot);\r
+/*!inverses a quaternion*/\r
+GF_Vec4 gf_quat_get_inv(GF_Vec4 *quat);\r
+/*!\brief quaternion multiplication\r
+ *\r
+ *Multiplies two quaternions\r
+ *\param q1 the first quaternion\r
+ *\param q2 the second quaternion\r
+ *\return the resulting quaternion\r
+ */\r
+GF_Vec4 gf_quat_multiply(GF_Vec4 *q1, GF_Vec4 *q2);\r
+/*!\brief quaternion vector rotating\r
+ *\r
+ *Rotates a vector with a quaternion \r
+ *\param quat the quaternion modelizing the rotation\r
+ *\param vec the vector to rotate\r
+ *\return the resulting vector\r
+ */\r
+GF_Vec gf_quat_rotate(GF_Vec4 *quat, GF_Vec *vec);\r
+/*!\brief quaternion from axis and cos\r
+ *\r
+ *Constructs a quaternion from an axis and a cosinus value (shortcut to \ref gf_quat_from_rotation)\r
+ *\param axis the rotation axis\r
+ *\param cos_a the rotation cosinus value\r
+ *\return the resulting quaternion\r
+ */\r
+GF_Vec4 gf_quat_from_axis_cos(GF_Vec axis, Fixed cos_a);\r
+/*!\brief quaternion interpolation\r
+ *\r
+ *Interpolates two quaternions using spherical linear interpolation\r
+ *\param q1 the first quaternion\r
+ *\param q2 the second quaternion\r
+ *\param frac the fraction of the interpolation, between 0 and \ref FIX_ONE\r
+ *\return the interpolated quaternion\r
+ */\r
+GF_Vec4 gf_quat_slerp(GF_Vec4 q1, GF_Vec4 q2, Fixed frac);\r
+\r
+/*!\brief 3D Bounding Box\r
+ *\r
+ *The 3D Bounding Box is a 3D Axis-Aligned Bounding Box used to in various tools of the GPAC framework for bounds \r
+ estimation of a 3D object. It features an axis-aligned box and a sphere bounding volume for fast intersection tests.\r
+ */\r
+typedef struct\r
+{\r
+       /*!minimum x, y, and z of the object*/\r
+       GF_Vec min_edge;\r
+       /*!maximum x, y, and z of the object*/\r
+       GF_Vec max_edge;\r
+\r
+       /*!center of the bounding box.\note this is computed from min_edge and max_edge*/\r
+       GF_Vec center;\r
+       /*!radius of the bounding sphere for this box.\note this is computed from min_edge and max_edge*/\r
+       Fixed radius;\r
+       /*!the bbox center and radius are valid*/\r
+       Bool is_set;\r
+} GF_BBox;\r
+/*!updates information of the bounding box based on the edge information*/\r
+void gf_bbox_refresh(GF_BBox *b);\r
+/*!builds a bounding box from a 2D rectangle*/\r
+void gf_bbox_from_rect(GF_BBox *box, GF_Rect *rc);\r
+/*!builds a rectangle from a 3D bounding box.\note The z dimension is lost and no projection is performed*/\r
+void gf_rect_from_bbox(GF_Rect *rc, GF_BBox *box);\r
+/*!\brief bounding box expansion\r
+ *\r
+ *Checks if a point is inside a bounding box and updates the bounding box to include it if not the case\r
+ *\param box the bounding box object\r
+ *\param pt the 3D point to check\r
+*/\r
+void gf_bbox_grow_point(GF_BBox *box, GF_Vec pt);\r
+/*!performs the union of two bounding boxes*/\r
+void gf_bbox_union(GF_BBox *b1, GF_BBox *b2);\r
+/*!checks if two bounding boxes are equal or not*/\r
+Bool gf_bbox_equal(GF_BBox *b1, GF_BBox *b2);\r
+/*!checks if a point is inside a bounding box or not*/\r
+Bool gf_bbox_point_inside(GF_BBox *box, GF_Vec *p);\r
+/*!\brief get box vertices\r
+ *\r
+ *Returns the 8 bounding box vertices given the minimum and maximum edge. Vertices are ordered to respect \r
+ "p-vertex indexes", (vertex from a box closest to plane) and so that n-vertex (vertex from a box farthest from plane) \r
+ is 7-p_vx_idx\r
+ *\param bmin minimum edge of the box\r
+ *\param bmax maximum edge of the box\r
+ *\param vecs list of 8 3D points used to store the vertices.\r
+*/\r
+void gf_bbox_get_vertices(GF_Vec bmin, GF_Vec bmax, GF_Vec *vecs);\r
+\r
+\r
+/*!\brief matrix initialization\r
+ *\hideinitializer\r
+ *\r
+ *Inits the matrix to the identity matrix\r
+*/\r
+#define gf_mx_init(_obj) { memset((_obj).m, 0, sizeof(Fixed)*16); (_obj).m[0] = (_obj).m[5] = (_obj).m[10] = (_obj).m[15] = FIX_ONE; }\r
+/*!\brief matrix copy\r
+ *\hideinitializer\r
+ *\r
+ *Copies the matrix _from to the matrix _obj\r
+*/\r
+#define gf_mx_copy(_obj, from) memcpy(&(_obj), &(from), sizeof(GF_Matrix));\r
+/*!\brief matrix constructor from 2D\r
+ *\r
+ *Initializes a 3D matrix from a 2D matrix.\note all z-related coefficients will be set to default.\r
+*/\r
+void gf_mx_from_mx2d(GF_Matrix *mx, GF_Matrix2D *mat2D);\r
+/*!\brief matrix identity testing\r
+ *\r
+ *Tests if two matrices are equal or not.\r
+ \return 1 if matrices are same, 0 otherwise\r
+*/\r
+Bool gf_mx_equal(GF_Matrix *mx1, GF_Matrix *mx2);\r
+/*!\brief matrix translation\r
+ *\r
+ *Translates a matrix \r
+ *\param mx the matrix being transformed. Once the function is called, contains the result matrix\r
+ *\param tx horizontal translation\r
+ *\param ty vertical translation\r
+ *\param tz depth translation\r
+*/\r
+void gf_mx_add_translation(GF_Matrix *mx, Fixed tx, Fixed ty, Fixed tz);\r
+/*!\brief matrix scaling\r
+ *\r
+ *Scales a matrix \r
+ *\param mx the matrix being transformed. Once the function is called, contains the result matrix\r
+ *\param sx horizontal translation scaling\r
+ *\param sy vertical translation scaling\r
+ *\param sz depth translation scaling\r
+*/\r
+void gf_mx_add_scale(GF_Matrix *mx, Fixed sx, Fixed sy, Fixed sz);\r
+/*!\brief matrix rotating\r
+ *\r
+ *Rotates a matrix \r
+ *\param mx the matrix being transformed. Once the function is called, contains the result matrix\r
+ *\param angle rotation angle in radians\r
+ *\param x horizontal coordinate of rotation axis\r
+ *\param y vertical coordinate of rotation axis\r
+ *\param z depth coordinate of rotation axis\r
+*/\r
+void gf_mx_add_rotation(GF_Matrix *mx, Fixed angle, Fixed x, Fixed y, Fixed z);\r
+/*!\brief matrices multiplication \r
+ *\r
+ *Multiplies a matrix with another one mx = mx*mul\r
+ *\param mx the matrix being transformed. Once the function is called, contains the result matrix\r
+ *\param mul the matrix to add\r
+*/\r
+void gf_mx_add_matrix(GF_Matrix *mx, GF_Matrix *mul);\r
+/*!\brief 2D matrix multiplication\r
+ *\r
+ *Adds a 2D affine matrix to a matrix\r
+ *\param mx the matrix \r
+ *\param mat2D the matrix to premultiply\r
+ */\r
+void gf_mx_add_matrix_2d(GF_Matrix *mx, GF_Matrix2D *mat2D);\r
+\r
+/*!\brief affine matrix inversion\r
+ *\r
+ *Inverses an affine matrix.\warning Results are undefined if the matrix is not an affine one\r
+ *\param mx the matrix to inverse\r
+ */\r
+void gf_mx_inverse(GF_Matrix *mx);\r
+/*!\brief matrix point transformation\r
+ *\r
+ *Applies a 3D matrix transformation to a 3D point\r
+ *\param mx transformation matrix\r
+ *\param pt pointer to 3D point. Once the function is called, pt contains the transformed point\r
+*/\r
+void gf_mx_apply_vec(GF_Matrix *mx, GF_Vec *pt);\r
+/*!\brief matrix rectangle transformation\r
+ *\r
+ *Applies a 3D matrix transformation to a rectangle, giving the enclosing rectangle of the transformed one.\note all depth information are discarded.\r
+ *\param _this transformation matrix\r
+ *\param rc pointer to rectangle. Once the function is called, rc contains the transformed rectangle\r
+*/\r
+void gf_mx_apply_rect(GF_Matrix *_this, GF_Rect *rc);\r
+/*!\brief ortho matrix construction\r
+ *\r
+ *Creates an orthogonal projection matrix\r
+ *\param mx matrix to initialize\r
+ *\param left min horizontal coordinate of viewport\r
+ *\param right max horizontal coordinate of viewport\r
+ *\param bottom min vertical coordinate of viewport\r
+ *\param top max vertical coordinate of viewport\r
+ *\param z_near min depth coordinate of viewport\r
+ *\param z_far max depth coordinate of viewport\r
+*/\r
+void gf_mx_ortho(GF_Matrix *mx, Fixed left, Fixed right, Fixed bottom, Fixed top, Fixed z_near, Fixed z_far);\r
+/*!\brief perspective matrix construction\r
+ *\r
+ *Creates a perspective projection matrix\r
+ *\param mx matrix to initialize\r
+ *\param foc camera field of view angle in radian\r
+ *\param aspect_ratio viewport aspect ratio\r
+ *\param z_near min depth coordinate of viewport\r
+ *\param z_far max depth coordinate of viewport\r
+*/\r
+void gf_mx_perspective(GF_Matrix *mx, Fixed foc, Fixed aspect_ratio, Fixed z_near, Fixed z_far);\r
+/*!\brief creates look matrix\r
+ *\r
+ *Creates a transformation matrix looking at a given direction from a given point (camera matrix).\r
+ *\param mx matrix to initialize\r
+ *\param position position\r
+ *\param target look direction\r
+ *\param up_vector vector describing the up direction\r
+*/\r
+void gf_mx_lookat(GF_Matrix *mx, GF_Vec position, GF_Vec target, GF_Vec up_vector);\r
+/*!\brief matrix box transformation\r
+ *\r
+ *Applies a 3D matrix transformation to a bounding box, giving the enclosing box of the transformed one\r
+ *\param mx transformation matrix\r
+ *\param b pointer to bounding box. Once the function is called, contains the transformed bounding box\r
+*/\r
+void gf_mx_apply_bbox(GF_Matrix *mx, GF_BBox *b);\r
+/*!\brief matrix box sphere transformation\r
+ *\r
+ *Applies a 3D matrix transformation to a bounding box, computing only the enclosing sphere of the transformed one.\r
+ *\param mx transformation matrix\r
+ *\param b pointer to bounding box. Once the function is called, contains the transformed bounding sphere\r
+*/\r
+void gf_mx_apply_bbox_sphere(GF_Matrix *mx, GF_BBox *box);\r
+/*!\brief non-affine matrix multiplication\r
+ *\r
+ *Multiplies two non-affine matrices mx = mx*mul\r
+*/\r
+void gf_mx_add_matrix_4x4(GF_Matrix *mat, GF_Matrix *mul);\r
+/*!\brief non-affine matrix inversion\r
+ *\r
+ *Inverses a non-affine matrices\r
+ *\return 1 if inversion was done, 0 if inversion not possible.\r
+*/\r
+Bool gf_mx_inverse_4x4(GF_Matrix *mx);\r
+/*!\brief matrix 4D vector transformation\r
+ *\r
+ *Applies a 3D non-affine matrix transformation to a 4 dimension vector\r
+ *\param mx transformation matrix\r
+ *\param vec pointer to the vector. Once the function is called, contains the transformed vector\r
+*/\r
+void gf_mx_apply_vec_4x4(GF_Matrix *mx, GF_Vec4 *vec);\r
+/*!\brief matrix decomposition\r
+ *\r
+ *Decomposes a matrix into translation, scale, shear and rotate\r
+ *\param mx the matrix to decompose\r
+ *\param translate the decomposed translation part\r
+ *\param scale the decomposed scaling part\r
+ *\param rotate the decomposed rotation part, expressed as a Rotataion (axis + angle)\r
+ *\param shear the decomposed shear part\r
+ */\r
+void gf_mx_decompose(GF_Matrix *mx, GF_Vec *translate, GF_Vec *scale, GF_Vec4 *rotate, GF_Vec *shear);\r
+/*!\brief matrix vector rotation\r
+ *\r
+ *Rotates a vector with a given matrix, ignoring any translation.\r
+ *\param mx transformation matrix\r
+ *\param pt pointer to 3D vector. Once the function is called, pt contains the transformed vector\r
+ */\r
+void gf_mx_rotate_vector(GF_Matrix *mx, GF_Vec *pt);\r
+/*!\brief matrix initialization from vectors\r
+ *\r
+ *Inits a matrix to rotate the local axis in the given vectors\r
+ \param mx matrix to initialize\r
+ \param x_axis target normalized X axis\r
+ \param y_axis target normalized Y axis\r
+ \param z_axis target normalized Z axis\r
+*/\r
+void gf_mx_rotation_matrix_from_vectors(GF_Matrix *mx, GF_Vec x_axis, GF_Vec y_axis, GF_Vec z_axis);\r
+/*!\brief matrix to 2D matrix \r
+ *\r
+ *Inits a 2D matrix by removing all depth info from a 3D matrix\r
+ *\param mx2d 2D matrix to initialize\r
+ *\param mx 3D matrix to use\r
+*/\r
+void gf_mx2d_from_mx(GF_Matrix2D *mx2d, GF_Matrix *mx);\r
+\r
+/*!\brief Plane object*/\r
+typedef struct\r
+{\r
+       /*!normal vector to the plane*/\r
+       GF_Vec normal;\r
+       /*!distance from origin of the plane*/\r
+       Fixed d;\r
+} GF_Plane;\r
+/*!\brief matrix plane transformation\r
+ *\r
+ *Transorms a plane by a given matrix\r
+ *\param mx the matrix to use\r
+ *\param plane pointer to 3D plane. Once the function is called, plane contains the transformed plane\r
+ */\r
+void gf_mx_apply_plane(GF_Matrix *mx, GF_Plane *plane);\r
+/*!\brief point to plane distance\r
+ *\r
+ *Gets the distance between a point and a plne\r
+ *\param plane the plane to use\r
+ *\param p pointer to ^point to check\r
+ *\return the distance between the place and the point\r
+ */\r
+Fixed gf_plane_get_distance(GF_Plane *plane, GF_Vec *p);\r
+/*!\brief closest point on a line\r
+ *\r
+ *Gets the closest point on a line from a given point in space\r
+ *\param line_pt a point of the line to test\r
+ *\param line_vec the normalized direction vector of the line\r
+ *\param pt the point to check\r
+ *\return the closest point on the line to the desired point\r
+ */\r
+GF_Vec gf_closest_point_to_line(GF_Vec line_pt, GF_Vec line_vec, GF_Vec pt);\r
+/*!\brief box p-vertex index\r
+ *\r
+ *Gets the p-vertex index for a given plane. The p-vertex index is the index of the closest vertex of a bounding box to the plane. The vertices of a box are always \r
+ *ordered in GPAC? cf \ref gf_bbox_get_vertices\r
+ *\param p the plane to check\r
+ *\return the p-vertex index value, ranging from 0 to 7\r
+*/\r
+u32 gf_plane_get_p_vertex_idx(GF_Plane *p);\r
+/*!\brief plane line intersection\r
+ *\r
+ *Checks for the intersection of a plane and a line\r
+ *\param plane plane to test\r
+ *\param linepoint a point on the line to test\r
+ *\param linevec normalized direction vector of the line to test\r
+ *\param outPoint optional pointer to retrieve the intersection point, NULL otherwise\r
+ *\return 1 if line and plane intersect, 0 otherwise\r
+*/\r
+Bool gf_plane_intersect_line(GF_Plane *plane, GF_Vec *linepoint, GF_Vec *linevec, GF_Vec *outPoint);\r
+\r
+/*!Classification types for box/plane position used in \ref gf_bbox_plane_relation*/\r
+enum \r
+{      \r
+       /*!box is in front of the plane*/\r
+       GF_BBOX_FRONT,\r
+       /*!box intersects the plane*/\r
+       GF_BBOX_INTER,\r
+       /*!box is back of the plane*/\r
+       GF_BBOX_BACK\r
+};\r
+/*!\brief box-plane relation\r
+ *\r
+ *Gets the spatial relation between a box and a plane\r
+ *\param box the box to check\r
+ *\param p the plane to check\r
+ *\return the relation type\r
+ */\r
+u32 gf_bbox_plane_relation(GF_BBox *box, GF_Plane *p);\r
+\r
+/*!\brief 3D Ray\r
+ *\r
+ *The 3D ray object is used in GPAC for all collision and mouse interaction tests\r
+*/\r
+typedef struct\r
+{\r
+       /*!origin point of the ray*/\r
+       GF_Vec orig;\r
+       /*!normalized direction vector of the ray*/\r
+       GF_Vec dir;\r
+} GF_Ray;\r
+\r
+/*!\brief ray constructor\r
+ *\r
+ *Constructs a ray object\r
+ *\param start starting point of the ray\r
+ *\param end end point of the ray, or any point on the ray\r
+ *\return the ray object\r
+*/\r
+GF_Ray gf_ray(GF_Vec start, GF_Vec end);\r
+/*!\brief matrix ray transformation\r
+ *\r
+ *Transforms a ray by a given transformation matrix\r
+ *\param mx the matrix to use\r
+ *\param r pointer to the ray. Once the function is called, contains the transformed ray\r
+*/\r
+void gf_mx_apply_ray(GF_Matrix *mx, GF_Ray *r);\r
+/*!\brief ray box intersection test\r
+ *\r
+ *Checks if a ray intersects a box or not\r
+ *\param ray the ray to check\r
+ *\param min_edge the minimum edge of the box to check\r
+ *\param max_edge the maximum edge of the box to check\r
+ *\param out_point optional location of a 3D point to store the intersection, NULL otherwise.\r
+ *\return retuns 1 if the ray intersects the box, 0 otherwise\r
+*/\r
+Bool gf_ray_hit_box(GF_Ray *ray, GF_Vec min_edge, GF_Vec max_edge, GF_Vec *out_point);\r
+/*!\brief ray sphere intersection test\r
+ *\r
+ *Checks if a ray intersects a box or not\r
+ *\param ray the ray to check\r
+ *\param center the center of the sphere to check. If NULL, the origin (0,0,0)is used\r
+ *\param radius the radius of the sphere to check\r
+ *\param out_point optional location of a 3D point to store the intersection, NULL otherwise\r
+ *\return retuns 1 if the ray intersects the sphere, 0 otherwise\r
+*/\r
+Bool gf_ray_hit_sphere(GF_Ray *ray, GF_Vec *center, Fixed radius, GF_Vec *out_point);\r
+/*!\brief ray triangle intersection test\r
+ *\r
+ *Checks if a ray intersects a triangle or not\r
+ *\param ray the ray to check\r
+ *\param v0 first vertex of the triangle\r
+ *\param v1 second vertex of the triangle\r
+ *\param v2 third vertex of the triangle\r
+ *\param dist optional location of a fixed number to store the intersection distance from ray origin if any, NULL otherwise\r
+ *\return retuns 1 if the ray intersects the triangle, 0 otherwise\r
+*/\r
+Bool gf_ray_hit_triangle(GF_Ray *ray, GF_Vec *v0, GF_Vec *v1, GF_Vec *v2, Fixed *dist);\r
+/*same as above and performs backface cull (solid meshes)*/\r
+/*!\brief ray triangle intersection test\r
+ *\r
+ *Checks if a ray intersects a triangle or not, performing backface culling. For parameters details, look at \ref gf_ray_hit_triangle_backcull\r
+ */\r
+Bool gf_ray_hit_triangle_backcull(GF_Ray *ray, GF_Vec *v0, GF_Vec *v1, GF_Vec *v2, Fixed *dist);\r
+\r
+/*! @} */\r
+\r
+/*! @} */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif         /*_GF_MATH_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/media_tools.h b/tstools/DtsEdit/src/gpac/media_tools.h
new file mode 100644 (file)
index 0000000..2842137
--- /dev/null
@@ -0,0 +1,335 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / Authoring Tools sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_MEDIA_H_\r
+#define _GF_MEDIA_H_\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/isomedia.h>\r
+#include <gpac/avparse.h>\r
+\r
+/*                     \r
+                       track importers\r
+\r
+       All these can import a file into a dedicated track. If esd is NULL the track is blindly added \r
+       otherwise it is added with the requested ESID if non-0, otherwise the new trackID is stored in ESID\r
+       if use_data_ref is set, data is only referenced in the file\r
+       if duration is not 0, only the first duration seconds are imported\r
+       NOTE: if an ESD is specified, its decoderSpecificInfo is also updated\r
+*/\r
+/*track importer flags*/\r
+enum\r
+{\r
+       /*references data rather than copy, whenever possible*/\r
+       GF_IMPORT_USE_DATAREF = 1,\r
+       /*for AVI video: imports at constant FPS (eg imports N-Vops due to encoder drops)*/\r
+       GF_IMPORT_NO_FRAME_DROP = 1<<1,\r
+       /*for CMP ASP only: forces treating the input as packed bitsream and discards all n-vops*/\r
+       GF_IMPORT_FORCE_PACKED = 1<<2,\r
+       /*for AAC audio: forces SBR mode with implicit signaling (backward compatible)*/\r
+       GF_IMPORT_SBR_IMPLICIT = 1<<3,\r
+       /*for AAC audio: forces SBR mode with explicit signaling (non-backward compatible). \r
+       Will override GF_IMPORT_SBR_IMPLICIT flag when set*/\r
+       GF_IMPORT_SBR_EXPLICIT = 1<<4,\r
+       /*forces MPEG-4 import - some 3GP2 streams have both native IsoMedia sample description and MPEG-4 one possible*/\r
+       GF_IMPORT_FORCE_MPEG4 = 1<<5,\r
+       /*special flag for text import at run time (never set on probe), indicates to leave the text box empty\r
+       so that we dynamically adapt to display size*/\r
+       GF_IMPORT_SKIP_TXT_BOX = 1<<6,\r
+       /*indicates to keep unknown tracks from .MOV/.IsoMedia files*/\r
+       GF_IMPORT_KEEP_ALL_TRACKS = 1<<7,\r
+       /*uses compact size in .MOV/.IsoMedia files*/\r
+       GF_IMPORT_USE_COMPACT_SIZE = 1<<8,\r
+       \r
+       /*when set, only updates tracks info and return*/\r
+       GF_IMPORT_PROBE_ONLY    = 1<<20,\r
+       /*only set when probing, signals several frames per sample possible*/\r
+       GF_IMPORT_3GPP_AGGREGATION = 1<<21,\r
+       /*only set when probing, signals video FPS overridable*/\r
+       GF_IMPORT_OVERRIDE_FPS = 1<<22,\r
+       /*only set when probing, signals duration not usable*/\r
+       GF_IMPORT_NO_DURATION = 1<<23,\r
+       /*when set by user during import, will abort*/\r
+       GF_IMPORT_DO_ABORT = 1<<31\r
+};\r
+\r
+#define GF_IMPORT_MAX_TRACKS   100\r
+struct __track_video_info\r
+{\r
+       u32 width, height, par;\r
+       Double FPS;\r
+};\r
+struct __track_audio_info\r
+{\r
+       u32 sample_rate, nb_channels;\r
+};\r
+\r
+struct __track_import_info\r
+{\r
+       u32 track_num;\r
+       /*track type (GF_ISOM_MEDIA_****)*/\r
+       u32 type;\r
+       /*media type ('MPG1', 'MPG2', ISO 4CC, AVI 4CC)*/\r
+       u32 media_type;\r
+       /*possible import flags*/\r
+       u32 flags;\r
+       /*media format info*/\r
+       struct __track_video_info video_info;\r
+       struct __track_audio_info audio_info;\r
+\r
+       u32 lang;\r
+       /*for MPEG2 TS: program number*/\r
+       u16 prog_num;\r
+};\r
+\r
+struct __program_import_info\r
+{\r
+       u32 number;\r
+       char name[40];\r
+};\r
+\r
+/*track dumper*/\r
+typedef struct __track_import\r
+{\r
+       GF_ISOFile *dest;\r
+       /*media to import:\r
+               MP4/ISO media: trackID\r
+               AVI files: \r
+                       0: first video and first audio,\r
+                       1: video track\r
+                       2->any: audio track(s)\r
+               MPEG-PS files with N video streams: \r
+                       0: first video and first audio\r
+                       1->N: video track\r
+                       N+1->any: audio track\r
+       TrackNums can be obtain with probing\r
+       */\r
+       u32 trackID;\r
+       /*media source - selects importer type based on extension*/\r
+       char *in_name;\r
+       /*import duration if any*/\r
+       u32 duration;\r
+       /*importer flags*/\r
+       u32 flags;\r
+       /*if non 0, force video FPS (CMP, AVI, OGG, H264) - also used by SUB import*/\r
+       Double video_fps;\r
+       /*optional ESD*/\r
+       GF_ESD *esd;\r
+       /*optional format indication for media source (used in IM1)*/\r
+       char *streamFormat;\r
+       /*frame per sample cumulation (3GP media only) - MAX 15, ignored in data ref*/\r
+       u32 frames_per_sample;\r
+       /*track ID of imported media in destination file*/\r
+       u32 final_trackID;\r
+       \r
+       /*for MP4 import only*/\r
+       GF_ISOFile *orig;\r
+\r
+       /*for text import*/\r
+       u32 fontSize;\r
+       char *fontName;\r
+\r
+       /*number of tracks after probing - may be set to 0, in which case no track \r
+       selection can be performed. It may also be inaccurate if probing doesn't\r
+       detect all available tracks (cf ogg import)*/\r
+       u32 nb_tracks;\r
+       /*track info after probing (GF_IMPORT_PROBE_ONLY set).*/\r
+       struct __track_import_info tk_info[GF_IMPORT_MAX_TRACKS];\r
+\r
+       /*for MPEG-TS and similar: program names*/\r
+       u32 nb_progs;\r
+       struct __program_import_info pg_info[GF_IMPORT_MAX_TRACKS];\r
+\r
+       GF_Err last_error;\r
+} GF_MediaImporter;\r
+\r
+GF_Err gf_media_import(GF_MediaImporter *importer);\r
+\r
+enum\r
+{\r
+       /*track dumper types are formatted as flags for conveniency for \r
+       authoring tools, but never used as a OR'ed set*/\r
+       /*native format (JPG, PNG, MP3, etc) if supported*/\r
+       GF_EXPORT_NATIVE = 1,\r
+       /*raw samples (including hint tracks for rtp)*/\r
+       GF_EXPORT_RAW_SAMPLES = (1<<1),\r
+       /*NHNT format (any MPEG-4 media)*/\r
+       GF_EXPORT_NHNT = (1<<2),\r
+       /*AVI (MPEG4 video and AVC tracks only)*/\r
+       GF_EXPORT_AVI = (1<<3),\r
+       /*MP4 (all except OD)*/\r
+       GF_EXPORT_MP4 = (1<<4),\r
+       /*AVI->RAW to dump video (trackID=1) or audio (trackID>=2)*/\r
+       GF_EXPORT_AVI_NATIVE = (1<<5),\r
+       /*NHML format (any media)*/\r
+       GF_EXPORT_NHML = (1<<6),\r
+       /*SAF format*/\r
+       GF_EXPORT_SAF = (1<<7),\r
+\r
+       /*following ones are real flags*/\r
+       /*\r
+       for MP4 extraction, indicates track should be added to dest file if any\r
+       for raw extraction, indicates data shall be appended at the end of output file if present\r
+       */\r
+       GF_EXPORT_MERGE = (1<<10),\r
+       /*indicates QCP file format possible as well as native (EVRC and SMV audio only)*/\r
+       GF_EXPORT_USE_QCP = (1<<11),\r
+       /*indicates full NHML dump*/\r
+       GF_EXPORT_NHML_FULL = (1<<11),\r
+       /*ony probes extraction format*/\r
+       GF_EXPORT_PROBE_ONLY = (1<<30),\r
+       /*when set by user during export, will abort*/\r
+       GF_EXPORT_DO_ABORT = (1<<31),\r
+};\r
+\r
+/*track dumper*/\r
+typedef struct __track_exporter\r
+{\r
+       GF_ISOFile *file;\r
+       u32 trackID;\r
+       /*sample number to export for GF_EXPORT_RAW_SAMPLES only*/\r
+       u32 sample_num;\r
+       /*out name WITHOUT extension*/\r
+       char *out_name;\r
+       /*dump type*/\r
+       u32 flags;\r
+       /*non-IsoMedia file (AVI)*/\r
+       char *in_name;\r
+} GF_MediaExporter;\r
+\r
+/*if error returns same value as error signaled in message*/\r
+GF_Err gf_media_export(GF_MediaExporter *dump);\r
+\r
+\r
+\r
+/*\r
+       RTP IsoMedia file hinting\r
+*/\r
+typedef struct __tag_isom_hinter GF_RTPHinter;\r
+\r
+GF_RTPHinter *gf_hinter_track_new(GF_ISOFile *file, u32 TrackNum, \r
+                                                       u32 Path_MTU, u32 max_ptime, u32 default_rtp_rate, u32 hint_flags, u8 PayloadID, \r
+                                                       Bool copy_media, u32 InterleaveGroupID, u8 InterleaveGroupPriority, GF_Err *e);\r
+/*delete the track hinter*/\r
+void gf_hinter_track_del(GF_RTPHinter *tkHinter);\r
+/*hints all samples in the media track*/\r
+GF_Err gf_hinter_track_process(GF_RTPHinter *tkHint);\r
+/*returns media bandwidth in kbps*/\r
+u32 gf_hinter_track_get_bandwidth(GF_RTPHinter *tkHinter);\r
+/*retrieves hinter flags*/\r
+u32 gf_hinter_track_get_flags(GF_RTPHinter *tkHinter);\r
+/*retrieves rtp payload name \r
+       @payloadName: static buffer for retrieval, minimum 30 bytes\r
+*/\r
+void gf_hinter_track_get_payload_name(GF_RTPHinter *tkHint, char *payloadName);\r
+\r
+/*finalizes hinting process for the track (setup flags, write SDP for RTP, ...)\r
+       @AddSystemInfo: if non-0, systems info are duplicated in the SDP (decoder cfg, PL IDs ..)\r
+*/\r
+GF_Err gf_hinter_track_finalize(GF_RTPHinter *tkHint, Bool AddSystemInfo);\r
+\r
+/*SDP IOD flag*/\r
+enum\r
+{\r
+       /*no IOD included*/\r
+       GF_SDP_IOD_NONE = 0,\r
+       /*base64 encoding of the regular MPEG-4 IOD*/\r
+       GF_SDP_IOD_REGULAR,\r
+       /*base64 encoding of IOD containing BIFS and OD tracks (one AU only) - this is used for ISMA 1.0 profiles\r
+       note that the "hinted" file will loose all systems info*/\r
+       GF_SDP_IOD_ISMA,\r
+       /*same as ISMA but removes all clock references from IOD*/\r
+       GF_SDP_IOD_ISMA_STRICT,\r
+};\r
+\r
+/*finalizes hinting process for the file (setup flags, write SDP for RTP, ...)\r
+       @IOD_Profile: see above\r
+       @bandwidth: total bandwidth in kbps of all hinted tracks, 0 means no bandwidth info at session level\r
+*/\r
+GF_Err gf_hinter_finalize(GF_ISOFile *file, u32 IOD_Profile, u32 bandwidth);\r
+\r
+\r
+/*returns TRUE if the encoded data fits in an ESD url - streamType is the systems stream type needed to\r
+signal data mime-type (OD, BIFS or any) */\r
+Bool gf_hinter_can_embbed_data(char *data, u32 data_size, u32 streamType);\r
+\r
+/*save file as fragmented movie*/\r
+GF_Err gf_media_fragment_file(GF_ISOFile *input, char *output_file, Double MaxFragmentDuration);\r
+\r
+/*adds chapter info contained in file - import_fps is optional (most formats don't use it), defaults to 25*/\r
+GF_Err gf_media_import_chapters(GF_ISOFile *file, char *chap_file, Double import_fps);\r
+\r
+\r
+/*make the file ISMA compliant: creates ISMA BIFS / OD tracks if needed, and update audio/video IDs\r
+the file should not contain more than one audio and one video track\r
+@keepImage: if set, generates system info if image is found - only used for image imports\r
+*/\r
+GF_Err gf_media_make_isma(GF_ISOFile *mp4file, Bool keepESIDs, Bool keepImage, Bool no_ocr);\r
+\r
+/*make the file 3GP compliant && sets profile\r
+*/\r
+GF_Err gf_media_make_3gpp(GF_ISOFile *mp4file);\r
+\r
+/*make the file playable on a PSP\r
+*/\r
+GF_Err gf_media_make_psp(GF_ISOFile *mp4file);\r
+\r
+/*creates (if needed) a GF_ESD for the given track - THIS IS RESERVED for local playback\r
+only, since the OTI used when emulated is not standard...*/\r
+GF_ESD *gf_media_map_esd(GF_ISOFile *mp4, u32 track);\r
+\r
+/*changes pixel aspect ratio for visual tracks if supported. Negative values remove any PAR info*/\r
+GF_Err gf_media_change_par(GF_ISOFile *file, u32 track, s32 ar_num, s32 ar_den);\r
+\r
+\r
+/*SAF Multiplexer object. The multiplexer supports concurencial (multi-threaded) access*/\r
+typedef struct __saf_muxer GF_SAFMuxer;\r
+/*SAF Multiplexer constructor*/\r
+GF_SAFMuxer *gf_saf_mux_new();\r
+/*SAF Multiplexer destructor*/\r
+void gf_saf_mux_del(GF_SAFMuxer *mux);\r
+/*adds a new stream in the SAF multiplex*/\r
+GF_Err gf_saf_mux_stream_add(GF_SAFMuxer *mux, u32 stream_id, u32 ts_res, u32 buffersize_db, u8 stream_type, u8 object_type, char *mime_type, char *dsi, u32 dsi_len, char *remote_url);\r
+/*removes a stream from the SAF multiplex*/\r
+GF_Err gf_saf_mux_stream_rem(GF_SAFMuxer *mux, u32 stream_id);\r
+/*adds an AU to the given stream. !!AU data will be freed by the multiplexer!! \r
+AUs are not reinterleaved based on their CTS, in order to enable audio interleaving\r
+*/\r
+GF_Err gf_saf_mux_add_au(GF_SAFMuxer *mux, u32 stream_id, u32 CTS, char *data, u32 data_len, Bool is_rap);\r
+/*gets the content of the multiplexer for the given time.\r
+if force_end_of_session is set, this flushes the SAF Session - no more operations will be allowed on the muxer*/\r
+GF_Err gf_saf_mux_for_time(GF_SAFMuxer *mux, u32 time_ms, Bool force_end_of_session, char **out_data, u32 *out_size);\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif /*_GF_MEDIA_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/mediaobject.h b/tstools/DtsEdit/src/gpac/mediaobject.h
new file mode 100644 (file)
index 0000000..2dc23b0
--- /dev/null
@@ -0,0 +1,149 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / Stream Management sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+\r
+\r
+#ifndef _GF_MEDIA_OBJECT_H_\r
+#define _GF_MEDIA_OBJECT_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/scenegraph_vrml.h>\r
+\r
+\r
+/*\r
+               Media Object\r
+\r
+  opaque handler for all natural media objects (audio, video, image) so that compositor and systems engine\r
+are not too tied up. \r
+       NOTE: the media object location relies on the node parent graph (this is to deal with namespaces in OD framework)\r
+therefore it is the task of the media management app to setup clear links between the scene graph and its ressources\r
+(but this is not mandatory, cf URLs in VRML )\r
+\r
+       TODO - add interface for shape coding positioning in mediaObject and in the decoder API\r
+*/\r
+\r
+typedef struct _mediaobj GF_MediaObject;\r
+\r
+/*locate media object related to the given node - url designes the object to find - returns NULL if\r
+URL cannot be handled - note that until the mediaObject.isInit member is true, the media object is not valid\r
+(and could actually never be) */\r
+GF_MediaObject *gf_mo_register(GF_Node *node, MFURL *url, Bool lock_timelines);\r
+/*unregister the node from the media object*/\r
+void gf_mo_unregister(GF_Node *node, GF_MediaObject *mo);\r
+\r
+/*opens media object*/\r
+void gf_mo_play(GF_MediaObject *mo, Double clipBegin, Double clipEnd, Bool can_loop);\r
+/*stops media object - video memory is not reset, last frame is kept*/\r
+void gf_mo_stop(GF_MediaObject *mo);\r
+/*restarts media object - shall be used for all looping media instead of stop/play for mediaControl\r
+to restart appropriated objects*/\r
+void gf_mo_restart(GF_MediaObject *mo);\r
+\r
+void gf_mo_pause(GF_MediaObject *mo);\r
+void gf_mo_resume(GF_MediaObject *mo);\r
+\r
+/*\r
+       Note on mediaControl: mediaControl is the media management app responsability, therefore\r
+is hidden from the rendering app. Since MediaControl overrides default settings of the node (speed and loop)\r
+you must use the gf_mo_get_speed and gf_mo_get_loop in order to know whether the related field applies or not\r
+*/\r
+\r
+/*set speed of media - speed is not always applied, depending on media control settings.\r
+NOTE: audio pitching is the responsability of the rendering app*/\r
+void gf_mo_set_speed(GF_MediaObject *mo, Fixed speed);\r
+/*returns current speed of media - in_speed is the speed of the media as set in the node (MovieTexture, \r
+AudioClip and AudioSource) - the return value is the real speed of the media as overloaded by mediaControl if any*/\r
+Fixed gf_mo_get_speed(GF_MediaObject *mo, Fixed in_speed);\r
+/*returns looping flag of media - in_loop is the looping flag of the media as set in the node (MovieTexture, \r
+AudioClip) - the return value is the real loop flag of the media as overloaded by mediaControl if any*/\r
+Bool gf_mo_get_loop(GF_MediaObject *mo, Bool in_loop);\r
+/*returns media object duration*/\r
+Double gf_mo_get_duration(GF_MediaObject *mo);\r
+/*returns whether the object should be deactivated (stop) or not - this checks object status as well as \r
+mediaControl status */\r
+Bool gf_mo_should_deactivate(GF_MediaObject *mo);\r
+/*checks whether the target object is changed - you MUST use this in order to detect url changes*/\r
+Bool gf_mo_url_changed(GF_MediaObject *mo, MFURL *url);\r
+\r
+\r
+/*fetch media data \r
+\r
+*/\r
+char *gf_mo_fetch_data(GF_MediaObject *mo, Bool resync, Bool *eos, u32 *timestamp, u32 *size);\r
+\r
+/*release given amount of media data - nb_bytes is used for audio - if forceDrop is set, the unlocked frame will be \r
+droped if all bytes are consumed, otherwise it will be droped based on object time - typically, video fetches with the resync\r
+flag set and release without forceDrop, while audio fetches without resync but forces buffer drop. If forceDrop is set to 2, \r
+the frame will be stated as a discraded frame*/\r
+void gf_mo_release_data(GF_MediaObject *mo, u32 nb_bytes, s32 forceDrop);\r
+/*get media time*/\r
+void gf_mo_get_media_time(GF_MediaObject *mo, u32 *media_time, u32 *media_dur);\r
+/*get object clock*/\r
+void gf_mo_get_object_time(GF_MediaObject *mo, u32 *obj_time);\r
+/*returns mute flag of media - if muted the media shouldn't be displayed*/\r
+Bool gf_mo_is_muted(GF_MediaObject *mo);\r
+/*returns end of stream state*/\r
+Bool gf_mo_is_done(GF_MediaObject *mo);\r
+/*resyncs clock - only audio objects are allowed to use this*/\r
+void gf_mo_adjust_clock(GF_MediaObject *mo, s32 ms_drift);\r
+\r
+u32 gf_mo_get_last_frame_time(GF_MediaObject *mo);\r
+\r
+Bool gf_mo_get_visual_info(GF_MediaObject *mo, u32 *width, u32 *height, u32 *stride, u32 *pixel_ar, u32 *pixelFormat);\r
+\r
+Bool gf_mo_get_audio_info(GF_MediaObject *mo, u32 *sample_rate, u32 *bits_per_sample, u32 *num_channels, u32 *channel_config);\r
+\r
+/*checks if the service associated withthis object has an audio stream*/\r
+Bool gf_mo_has_audio(GF_MediaObject *mo);\r
+\r
+enum\r
+{\r
+       /*this is set to 0 by the OD manager whenever a change occur in the media (w/h change, SR change, etc) \r
+       as a hint for the compositor*/\r
+       GF_MO_IS_INIT = (1<<1),\r
+       /*used by animation stream to remove TEXT from display upon delete and URL change*/\r
+       GF_MO_DISPLAY_REMOVE = (1<<2),\r
+};\r
+\r
+u32 gf_mo_get_flags(GF_MediaObject *mo);\r
+void gf_mo_set_flag(GF_MediaObject *mo, u32 flag, Bool set_on);\r
+\r
+/*loads a new resource as indicated in the xlink:href attribute of the node. If this points to a fragment\r
+of the current document, returns NULL. This will automatically trigger a play request on the resource*/\r
+GF_MediaObject *gf_mo_load_xlink_resource(GF_Node *node, Bool primary_resource, Double clipBegin, Double clipEnd);\r
+void gf_mo_unload_xlink_resource(GF_Node *node, GF_MediaObject *mo);\r
+/*returns scene graph associated with a scene/document object, or NULL if wrong type or not loaded*/\r
+GF_SceneGraph *gf_mo_get_scenegraph(GF_MediaObject *mo);\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif /*_GF_MEDIA_OBJECT_H_*/\r
+\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/module.h b/tstools/DtsEdit/src/gpac/module.h
new file mode 100644 (file)
index 0000000..5d2bfd0
--- /dev/null
@@ -0,0 +1,235 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / common tools sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_MODULE_H_\r
+#define _GF_MODULE_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/*!\r
+ *     \file <gpac/module.h>\r
+ *     \brief plugable module functions.\r
+ */\r
+\r
+/*!\r
+ *     \addtogroup mods_grp plugable modules\r
+ *     \ingroup utils_grp\r
+ *     \brief Plugable Module functions\r
+ *\r
+ *This section documents the plugable module functions of the GPAC framework.\r
+ *A module is a dynamic/shared library providing one or several interfaces to the GPAC framework.\r
+ *A module cannot provide several interfaces of the same type. Each module must export the following functions:\r
+ \code\r
+ *     Bool QueryInterface(u32 interface_type);\r
+ \endcode\r
+ *     This function is used to query supported interfaces. It returns non zero if the module handles this interface type, 0 otherwise.\n\r
+ \code\r
+       GF_BaseInterface *LoadInterface(u32 interface_type);\r
+ \endcode\r
+ *     This function is used to load an interface. It returns the interface object, NULL if error.\n\r
+ \code\r
+       void ShutdownInterface(GF_BaseInterface *interface);\r
+ \endcode\r
+ *This function is used to destroy an interface.\n\n\r
+ *Each interface must begin with the interface macro in order to be type-casted to the base interface structure.\r
+ \code\r
+       struct {\r
+               GF_DECL_MODULE_INTERFACE\r
+               extensions;\r
+       };\r
+ \endcode\r
+ *     @{\r
+ */\r
+\r
+#include <gpac/config_file.h>\r
+\r
+typedef struct __tag_mod_man GF_ModuleManager;\r
+\r
+/*!\r
+ *\brief common module interface\r
+ *\hideinitializer\r
+ *\r
+ *This is the module interface declaration macro. It must be placed first in an interface structure declaration.\r
+*/\r
+#define GF_DECL_MODULE_INTERFACE       \\r
+       u32 InterfaceType;                              \\r
+       const char *module_name;                \\r
+       const char *author_name;                \\r
+       void *HPLUG;                                    \\r
+\r
+/*!\r
+ *\brief Base Interface\r
+ *\r
+ *This structure represent a base interface, e.g. the minimal interface declaration without functionalities. Each interface is\r
+ *type-casted to this structure and shall always be checked against its interface type. API Versioning is taken care of in the \r
+ *interface type itsel, changing at each modification of the interface API\r
+ */\r
+typedef struct\r
+{\r
+       GF_DECL_MODULE_INTERFACE\r
+} GF_BaseInterface;\r
+\r
+/*!\r
+ *\brief module interface registration\r
+ *\hideinitializer\r
+ *\r
+ *This is the module interface registration macro. A module must call this macro whenever creating a new interface.\r
+ *- \e _ifce: interface being registered\r
+ *- \e _ifce_type: the four character code defining the interface type.\r
+ *- \e _ifce_name: a printable string giving the interface name (const char *).\r
+ *- \e _ifce_author: a printable string giving the author name (const char *).\r
+ *\n\r
+ *This is a sample GPAC codec interface declaration:\r
+ \code\r
+GF_BaseInterface *MyDecoderInterfaceLoad() {\r
+       GF_MediaDecoder *ifce;\r
+       GF_SAFEALLOC(ifce, GF_MediaDecoder);\r
+       GF_REGISTER_MODULE_INTERFACE(ifce, GF_MEDIA_DECODER_INTERFACE, "Sample Decoder", "The Author")\r
+       //follows any initialization private to the decoder\r
+       return (GF_BaseInterface *)ifce;\r
+}\r
+ \endcode\r
+*/\r
+#define GF_REGISTER_MODULE_INTERFACE(_ifce, _ifce_type, _ifce_name, _ifce_author) \\r
+       _ifce->InterfaceType = _ifce_type;      \\r
+       _ifce->module_name = _ifce_name ? _ifce_name : "unknown";       \\r
+       _ifce->author_name = _ifce_author ? _ifce_author : "gpac distribution"; \\r
+       \r
+/*!\r
+ *\brief module manager construtcor\r
+ *\r
+ *Constructs a module manager object.\r
+ *\param directory absolute path to the directory where the manager shall look for modules\r
+ *\param cfgFile GPAC configuration file handle. If this is NULL, the modules won't be able to share the configuration\r
+ *file with the rest of the GPAC framework.\r
+ *\return the module manager object\r
+*/\r
+GF_ModuleManager *gf_modules_new(const char *directory, GF_Config *cfgFile);\r
+/*!\r
+ *\brief module manager destructor\r
+ *\r
+ *Destroys the module manager\r
+ *\param pm the module manager\r
+ */\r
+void gf_modules_del(GF_ModuleManager *pm);\r
+/*!\r
+ *\brief refreshes modules\r
+ *\r
+ *Refreshes all modules in the manager directory and load unloaded ones\r
+ *\param pm the module manager\r
+ *\return the number of loaded modules\r
+ */\r
+u32 gf_modules_refresh(GF_ModuleManager *pm);\r
+\r
+/*!\r
+ *\brief get module count\r
+ *\r
+ *Gets the number of modules found in the manager directory\r
+ *\param pm the module manager\r
+ *\return the number of loaded modules\r
+ */\r
+u32 gf_modules_get_count(GF_ModuleManager *pm);\r
+\r
+/*!\r
+ *\brief get module file name\r
+ *\r
+ *Gets a module shared library file name based on its index\r
+ *\param pm the module manager\r
+ *\param index the 0-based index of the module to query\r
+ *\return the name of the shared library module\r
+ */\r
+const char *gf_modules_get_file_name(GF_ModuleManager *pm, u32 index);\r
+\r
+/*!\r
+ *\brief loads an interface\r
+ *\r
+ *Loads an interface in the desired module.\r
+ *\param pm the module manager\r
+ *\param index the 0-based index of the module to load the interface from\r
+ *\param InterfaceFamily type of the interface to load\r
+ *\return the interface object if found and loaded, NULL otherwise.\r
+ */\r
+GF_BaseInterface *gf_modules_load_interface(GF_ModuleManager *pm, u32 index, u32 InterfaceFamily);\r
+\r
+/*!\r
+ *\brief loads an interface by module name\r
+ *\r
+ *Loads an interface in the desired module\r
+ *\param pm the module manager\r
+ *\param mod_name the name of the module (shared library file) or of the interface as declared when registered.\r
+ *\param InterfaceFamily type of the interface to load\r
+ *\return the interface object if found and loaded, NULL otherwise.\r
+ */\r
+GF_BaseInterface *gf_modules_load_interface_by_name(GF_ModuleManager *pm, const char *mod_name, u32 InterfaceFamily);\r
+\r
+/*!\r
+ *\brief interface shutdown\r
+ *\r
+ *Closes an interface\r
+ *\param interface_obj the interface to close\r
+ */\r
+GF_Err gf_modules_close_interface(GF_BaseInterface *interface_obj);\r
+\r
+/*!\r
+ *\brief interface option query\r
+ *\r
+ *Gets an option from the config file associated with the module manager \r
+ *\param interface_obj the interface object used\r
+ *\param secName the desired key parent section name\r
+ *\param keyName the desired key name\r
+ *\return the desired key value if found, NULL otherwise.\r
+ */\r
+const char *gf_modules_get_option(GF_BaseInterface *interface_obj, const char *secName, const char *keyName);\r
+/*!\r
+ *\brief interface option update\r
+ *\r
+ *Sets an option in the config file associated with the module manager \r
+ *\param interface_obj the interface object used\r
+ *\param secName the desired key parent section name\r
+ *\param keyName the desired key name\r
+ *\param keyValue the desired key value\r
+ *\note this will also create both section and key if they are not found in the configuration file\r
+ */\r
+GF_Err gf_modules_set_option(GF_BaseInterface *interface_obj, const char *secName, const char *keyName, const char *keyValue);\r
+\r
+/*!\r
+ *\brief get config fiole\r
+ *\r
+ *Gets the configuration file for the module instance\r
+ *\param interface_obj the interface object used\r
+ *\return handle to the config file\r
+ */\r
+GF_Config *gf_modules_get_config(GF_BaseInterface *ifce);\r
+\r
+/*! @} */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif         /*_GF_MODULE_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/modules/audio_out.h b/tstools/DtsEdit/src/gpac/modules/audio_out.h
new file mode 100644 (file)
index 0000000..66c40b5
--- /dev/null
@@ -0,0 +1,133 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / modules interfaces\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+\r
+/*\r
+\r
+               Note on video driver: this is not a graphics driver, the only thing requested from this driver\r
+       is accessing video memory and performing stretch of YUV and RGB on the backbuffer (bitmap node)\r
+       the graphics driver is a different entity that performs 2D rasterization\r
+\r
+*/\r
+\r
+#ifndef _GF_MODULE_AUDIO_OUT_H_\r
+#define _GF_MODULE_AUDIO_OUT_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/*include event system*/\r
+#include <gpac/module.h>\r
+\r
+\r
+/*\r
+       Audio hardware output module\r
+*/\r
+\r
+/*interface name and version for audio output*/\r
+#define GF_AUDIO_OUTPUT_INTERFACE              GF_4CC('G','A','O', 0x03)\r
+\r
+/*interface returned on query interface*/\r
+typedef struct _audiooutput\r
+{\r
+       /* interface declaration*/\r
+       GF_DECL_MODULE_INTERFACE\r
+\r
+       /*setup system \r
+               Win32: os_handle is HWND\r
+\r
+       if num_buffer is set, the audio driver should work with num_buffers with a total amount of audio data\r
+       equal to total_duration ms\r
+       if not set the driver is free to decide what to do\r
+       */\r
+       GF_Err (*Setup) (struct _audiooutput *aout, void *os_handle, u32 num_buffers, u32 total_duration);\r
+\r
+       /*shutdown system */\r
+       void (*Shutdown) (struct _audiooutput *aout);\r
+\r
+       /*query output frequency available - if the requested sampleRate is not available, the driver shall return the best \r
+       possible sampleRate able to handle NbChannels and NbBitsPerSample - if it doesn't handle the NbChannels\r
+       the internal mixer will do it\r
+       */\r
+       GF_Err (*QueryOutputSampleRate)(struct _audiooutput *aout, u32 *io_desired_samplerate, u32 *io_NbChannels, u32 *io_nbBitsPerSample);\r
+\r
+       /*set output config - if audio is not running, driver must start it\r
+       *SampleRate, *NbChannels, *nbBitsPerSample: \r
+               input: desired value\r
+               output: final values\r
+       channel_cfg is the channels output cfg, eg set of flags as specified in constants.h\r
+       */\r
+       GF_Err (*ConfigureOutput) (struct _audiooutput *aout, u32 *SampleRate, u32 *NbChannels, u32 *nbBitsPerSample, u32 channel_cfg);\r
+\r
+       /*returns total buffer size used in ms. This is needed to compute the min size of audio decoders output*/\r
+       u32 (*GetTotalBufferTime)(struct _audiooutput *aout);\r
+\r
+       /*returns audio delay in ms, eg time delay until written audio data is outputed by the sound card\r
+       This function is only called after ConfigureOuput*/ \r
+       u32 (*GetAudioDelay)(struct _audiooutput *aout);\r
+\r
+       /*set output volume(between 0 and 100) */\r
+       void (*SetVolume) (struct _audiooutput *aout, u32 Volume);\r
+       /*set balance (between 0 and 100, 0=full left, 100=full right)*/\r
+       void (*SetPan) (struct _audiooutput *aout, u32 pan);\r
+       /*freezes soundcard flow - must not be NULL for self threaded\r
+               PlayType: 0: pause, 1: resume, 2: reset HW buffer and play.\r
+       */\r
+       void (*Play) (struct _audiooutput *aout, u32 PlayType);\r
+       /*specifies whether the driver relies on the app to feed data or runs standalone*/\r
+       Bool SelfThreaded;\r
+\r
+       /*if not using private thread, this should perform sleep & fill of HW buffer\r
+               the audio render loop in this case is: while (run) {driver->WriteAudio(); if (reconf) Reconfig();}\r
+       the driver must therefore give back the hand to the renderer as often as possible - the usual way is:\r
+               gf_sleep untill hw data can be written\r
+               write HW data\r
+               return\r
+       */\r
+       void (*WriteAudio)(struct _audiooutput *aout);\r
+\r
+       /*if using private thread the following MUST be provided*/\r
+       void (*SetPriority)(struct _audiooutput *aout, u32 priority);\r
+\r
+       /*your private data handler - should be allocated when creating the interface object*/\r
+       void *opaque;\r
+       \r
+       /*these are assigned by the audio renderer once module is loaded*/\r
+       \r
+       /*fills the buffer with audio data, returns effective bytes written - the rest is filled with 0*/\r
+       u32 (*FillBuffer) (void *audio_renderer, char *buffer, u32 buffer_size);\r
+       void *audio_renderer;\r
+\r
+} GF_AudioOutput;\r
+\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif /*_GF_MODULE_AUDIO_OUT_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/modules/codec.h b/tstools/DtsEdit/src/gpac/modules/codec.h
new file mode 100644 (file)
index 0000000..df28e92
--- /dev/null
@@ -0,0 +1,231 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / modules interfaces\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+\r
+\r
+#ifndef _GF_MODULE_CODEC_H_\r
+#define _GF_MODULE_CODEC_H_\r
+\r
+\r
+#include <gpac/module.h>\r
+#include <gpac/mpeg4_odf.h>\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/*multimedia processing levels*/\r
+enum\r
+{\r
+       /*normal, full processing*/\r
+       GF_CODEC_LEVEL_NORMAL,\r
+       /*codec is late, should scale down processing*/\r
+       GF_CODEC_LEVEL_LATE,\r
+       /*codec is very late, should turn off post-processing, even drop*/\r
+       GF_CODEC_LEVEL_VERY_LATE,\r
+       /*input frames are already late before decoding*/\r
+       GF_CODEC_LEVEL_DROP,\r
+       /*this is a special level indicating that a seek is happening (decode but no dispatch)\r
+       it is set dynamically*/\r
+       GF_CODEC_LEVEL_SEEK\r
+};\r
+\r
+/*the structure for capabilities*/\r
+typedef struct \r
+{\r
+       /*cap code cf below*/\r
+       u16 CapCode;\r
+       union {\r
+               u32 valueInt;\r
+               Float valueFloat;\r
+       } cap;\r
+} GF_CodecCapability;\r
+\r
+\r
+/*\r
+                       all codecs capabilities\r
+*/\r
+\r
+enum\r
+{\r
+       /*size of a single composition unit */\r
+       GF_CODEC_OUTPUT_SIZE =  0x01,\r
+       /*resilency: if packets are lost within an AU, resilience means the AU won't be discarded and the codec\r
+       will try to decode */\r
+       GF_CODEC_RESILIENT,\r
+       /*critical level of composition memory - if below, media management for the object */\r
+       GF_CODEC_BUFFER_MIN,\r
+       /*maximum size in CU of composition memory */\r
+       GF_CODEC_BUFFER_MAX,\r
+       /*flags that all AUs should be discarded till next RAP (needed in case RAPs are not carried by the transport\r
+       protocol */\r
+       GF_CODEC_WAIT_RAP,\r
+       /*number of padding bytes needed - if the decoder needs padding input cannot be pulled and data is duplicated*/\r
+       GF_CODEC_PADDING_BYTES,\r
+       /*codecs can be threaded at will - by default a single thread is used for all decoders and priority is handled\r
+       by the app, but a codec can configure itself to run in a dedicated thread*/\r
+       GF_CODEC_WANTS_THREAD,\r
+\r
+       /*video width and height and horizontal pitch (in YV12 we assume half Y pitch for U and V planes) */\r
+       GF_CODEC_WIDTH,\r
+       GF_CODEC_HEIGHT,\r
+       GF_CODEC_STRIDE,\r
+       GF_CODEC_FPS,\r
+       /*Pixel Aspect Ratio, expressed as (par.num<<16) | par.den*/\r
+       GF_CODEC_PAR,\r
+       /*video color mode - color modes are defined in constants.h*/\r
+       GF_CODEC_PIXEL_FORMAT,\r
+       /*isgnal decoder performs frame re-ordering in temporal scalability*/\r
+       GF_CODEC_REORDER,\r
+       \r
+       /*Audio sample rate*/\r
+       GF_CODEC_SAMPLERATE,\r
+       /*Audio num channels*/\r
+       GF_CODEC_NB_CHAN,\r
+       /*Audio bps*/\r
+       GF_CODEC_BITS_PER_SAMPLE,\r
+       /*audio frame format*/\r
+       GF_CODEC_CHANNEL_CONFIG,\r
+       /*this is only used for audio in case transport mapping relies on sampleRate (RTP)\r
+       gets the CU duration in samplerate unit (type: int) */\r
+       GF_CODEC_CU_DURATION,\r
+\r
+       /*This is only called on scene decoders to signal that potential overlay scene should be \r
+       showed (cap.valueINT=1) or hidden (cap.valueINT=0). Currently only used with SetCap*/\r
+       GF_CODEC_SHOW_SCENE,\r
+       /*This is only called on scene decoders, GetCap only. If the decoder may continue modifying the scene once the last AU is received,\r
+       it must set cap.valueINT to 1 (typically, text stream decoder will hold the scene for a given duration\r
+       after the last AU). Otherwise the decoder will be stoped and ask to remove any extra scene being displayed*/\r
+       GF_CODEC_MEDIA_NOT_OVER,\r
+};\r
+\r
+\r
+       /* Generic interface used by both media decoders and scene decoders\r
+@AttachStream:\r
+       Add a Stream to the codec. If DependsOnESID is NULL, the stream is a base layer\r
+       UpStream means that the decoder should send feedback on this channel. \r
+       WARNING: Feedback format is not standardized by MPEG\r
+       the same API is used for both encoder and decoder (decSpecInfo is ignored\r
+       for an encoder) \r
+@DetachStream:\r
+       Remove stream\r
+@GetCapabilities:\r
+       Get the desired capability given its code\r
+@SetCapabilities\r
+       Set the desired capability given its code if possible\r
+       if the codec does not support the request capability, return GF_NOT_SUPPORTED\r
+@CanHandleStream\r
+       Can module handle this codec? Return 0 if No and !0 otherwise\r
+       decoderSpecificInfo is provided for MPEG4 audio/visual where a bunch of codecs are defined \r
+       with same objectType\r
+@GetDecoderName\r
+       returns codec name - only called once the stream is successfully attached\r
+@privateStack\r
+       user defined.\r
+*/\r
+\r
+#define GF_CODEC_BASE_INTERFACE(IFCE_NAME)             \\r
+       GF_DECL_MODULE_INTERFACE        \\r
+       GF_Err (*AttachStream)(IFCE_NAME, GF_ESD *esd);\\r
+       GF_Err (*DetachStream)(IFCE_NAME, u16 ES_ID);\\r
+       GF_Err (*GetCapabilities)(IFCE_NAME, GF_CodecCapability *capability);\\r
+       GF_Err (*SetCapabilities)(IFCE_NAME, GF_CodecCapability capability);\\r
+       Bool (*CanHandleStream)(IFCE_NAME, u32 StreamType, u32 ObjectType, char *decSpecInfo, u32 decSpecInfoSize, u32 PL);\\r
+       const char *(*GetName)(IFCE_NAME);\\r
+       void *privateStack;     \\r
+\r
+\r
+typedef struct _basedecoder\r
+{\r
+       GF_CODEC_BASE_INTERFACE(struct _basedecoder *)\r
+} GF_BaseDecoder;\r
+\r
+/*interface name and version for media decoder */\r
+#define GF_MEDIA_DECODER_INTERFACE             GF_4CC('G', 'M', 'D', 0x02)\r
+\r
+/*the media module interface. A media module MUST be implemented in synchronous mode as time \r
+and resources management is done by the terminal*/\r
+typedef struct _mediadecoder\r
+{\r
+       GF_CODEC_BASE_INTERFACE(struct _basedecoder *)\r
+\r
+       /*Process the media data in inAU. \r
+       @inBuffer, inBufferLength: encoded input data (complete framing of encoded data)\r
+       @ES_ID: stream this data belongs too (scalable object)\r
+       @outBuffer, outBufferLength: allocated data for decoding - if outBufferLength is not enough\r
+               you must set the size in outBufferLength and GF_BUFFER_TOO_SMALL \r
+\r
+       @PaddingBits is the padding at the end of the buffer (some codecs need this info)\r
+       @mmlevel: speed indicator for the decoding - cf above for values*/\r
+       GF_Err (*ProcessData)(struct _mediadecoder *, \r
+                       char *inBuffer, u32 inBufferLength,\r
+                       u16 ES_ID,\r
+                       char *outBuffer, u32 *outBufferLength,\r
+                       u8 PaddingBits, u32 mmlevel);\r
+} GF_MediaDecoder;\r
+\r
+\r
+\r
+typedef struct _inline_scene *LPINLINESCENE;\r
+\r
+/*interface name and version for scene decoder */\r
+#define GF_SCENE_DECODER_INTERFACE             GF_4CC('G', 'S', 'D', 0x02)\r
+\r
+typedef struct _scenedecoder\r
+{\r
+       GF_CODEC_BASE_INTERFACE(struct _basedecoder *)\r
+       \r
+       /*attaches scene to the decoder - a scene may be attached to several decoders of several types\r
+       (BIFS or others scene dec, ressource decoders (OD), etc. \r
+       is: inline scene owning graph (and not just graph), defined in intern/terminal_dev.h. With inline scene\r
+       the complete terminal is exposed so there's pretty much everything doable in a scene decoder\r
+       @is_scene_root: set to true if this decoder is the root of the scene, false otherwise (either another decoder\r
+       or a re-entrant call, cf below)\r
+       This is called once upon creation of the decoder (several times if re-entrant)\r
+       */\r
+       GF_Err (*AttachScene)(struct _scenedecoder *, LPINLINESCENE is, Bool is_scene_root);\r
+       /*releases scene. If the decoder manages nodes / resources in the scene, \r
+       THESE MUST BE DESTROYED. May be NULL if decoder doesn't manage nodes but only create them (like BIFS, OD) and\r
+       doesn't have to be instructed the scene is about to be resumed\r
+       This is called each time the scene is about to be reseted (eg, seek and destroy)\r
+       */\r
+       GF_Err (*ReleaseScene)(struct _scenedecoder *);\r
+       /*Process the scene data in inAU. \r
+       @inBuffer, inBufferLength: encoded input data (complete framing of encoded data)\r
+       @ES_ID: stream this data belongs too (scalable object)\r
+       @AU_Time: specifies the current AU time. This is usually unused, however is needed for decoder\r
+       handling the scene graph without input data (cf below). In this case the buffer passed is always NULL and the AU\r
+       time caries the time of the scene (or of the stream object attached to the scene decoder, cf below)\r
+       @mmlevel: speed indicator for the decoding - cf above for values*/\r
+       GF_Err (*ProcessData)(struct _scenedecoder *, char *inBuffer, u32 inBufferLength,\r
+                                       u16 ES_ID, u32 AU_Time, u32 mmlevel);\r
+\r
+} GF_SceneDecoder;\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /*_GF_MODULE_CODEC_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/modules/font.h b/tstools/DtsEdit/src/gpac/modules/font.h
new file mode 100644 (file)
index 0000000..f09899f
--- /dev/null
@@ -0,0 +1,126 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / modules interfaces\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+\r
+#ifndef _GF_MODULE_FONT_H_\r
+#define _GF_MODULE_FONT_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/path2d.h>\r
+#include <gpac/module.h>\r
+#include <gpac/user.h>\r
+\r
+\r
+typedef struct _gf_glyph\r
+{\r
+       /*glyphs are stored as linked lists*/\r
+       struct _gf_glyph *next;\r
+       /*glyph ID as used in *_get_glyphs - this may not match the UTF name*/\r
+       u32 ID;\r
+       /*UTF-name of the glyph if any*/\r
+       u32 utf_name;\r
+       GF_Path *path;\r
+       /*width of the glyph - !! this can be more than the horizontal advance !! */\r
+       u32 width;\r
+       /*glyph horizontal advance in font EM size*/\r
+       s32 horiz_advance;\r
+       /*height of the glyph - !! this can be more than the vertical advance !! */\r
+       u32 height;\r
+       /*glyph vertical advance in font EM size*/\r
+       s32 vert_advance;\r
+} GF_Glyph;\r
+\r
+enum\r
+{\r
+       /*font styles*/\r
+       GF_FONT_ITALIC = 1,\r
+       GF_FONT_OBLIQUE = 1<<1,\r
+       /*font variant (smallcaps)*/\r
+       GF_FONT_SMALLCAPS = 1<<2,\r
+       /*font decoration*/\r
+       GF_FONT_UNDERLINED = 1<<3,\r
+       GF_FONT_STRIKEOUT = 1<<4,\r
+\r
+       /*all font weight modification are placed AFTER 1<<9*/\r
+       GF_FONT_WEIGHT_100 = 1<<10,\r
+       GF_FONT_WEIGHT_LIGHTER = 1<<11,\r
+       GF_FONT_WEIGHT_200 = 1<<12,\r
+       GF_FONT_WEIGHT_300 = 1<<13,\r
+       GF_FONT_WEIGHT_400 = 1<<14,\r
+       GF_FONT_WEIGHT_NORMAL = 1<<15,\r
+       GF_FONT_WEIGHT_500 = 1<<16,\r
+       GF_FONT_WEIGHT_600 = 1<<17,\r
+       GF_FONT_WEIGHT_700 = 1<<18,\r
+       GF_FONT_WEIGHT_BOLD = 1<<19,\r
+       GF_FONT_WEIGHT_800 = 1<<20,\r
+       GF_FONT_WEIGHT_900 = 1<<21,\r
+       GF_FONT_WEIGHT_BOLDER = 1<<22\r
+};\r
+/*mask for font styles used for CSS2 selection*/\r
+#define GF_FONT_STYLE_MASK     0x00000007\r
+/*mask for all font weight*/\r
+#define GF_FONT_WEIGHT_MASK    0xFFFFFC00\r
+\r
+/*interface name and version for font engine*/\r
+#define GF_FONT_READER_INTERFACE               GF_4CC('G','F','T', 0x01)\r
+\r
+\r
+typedef struct _font_reader\r
+{\r
+       /* interface declaration*/\r
+       GF_DECL_MODULE_INTERFACE\r
+\r
+       /*inits font engine.*/\r
+       GF_Err (*init_font_engine)(struct _font_reader *dr);\r
+       /*shutdown font engine*/\r
+       GF_Err (*shutdown_font_engine)(struct _font_reader *dr);\r
+\r
+       /*set active font . @styles indicates font styles (PLAIN, BOLD, ITALIC, \r
+       BOLDITALIC and UNDERLINED, STRIKEOUT)*/\r
+       GF_Err (*set_font)(struct _font_reader *dr, const char *fontName, u32 styles);\r
+       /*gets font info*/\r
+       GF_Err (*get_font_info)(struct _font_reader *dr, char **font_name, s32 *em_size, s32 *ascent, s32 *descent, s32 *underline, s32 *line_spacing, s32 *max_advance_h, s32 *max_advance_v);\r
+\r
+       /*translate string to glyph sequence*/\r
+       GF_Err (*get_glyphs)(struct _font_reader *dr, const char *utf_string, u32 *glyph_id_buffer, u32 *io_glyph_id_buffer_size, const char *xml_lang, Bool *rev_layout);\r
+\r
+       /*loads glyph by name - returns NULL if glyph cannot be found*/\r
+       GF_Glyph *(*load_glyph)(struct _font_reader *dr, u32 glyph_name);\r
+\r
+/*module private*/\r
+       void *udta;\r
+} GF_FontReader;\r
+\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif /*_GF_MODULE_FONT_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/modules/ipmp.h b/tstools/DtsEdit/src/gpac/modules/ipmp.h
new file mode 100644 (file)
index 0000000..3648332
--- /dev/null
@@ -0,0 +1,131 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / modules interfaces\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+\r
+#ifndef _GF_MODULE_IPMP_H_\r
+#define _GF_MODULE_IPMP_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/module.h>\r
+\r
+/*\r
+       NOTE ON IPMP TOOLS\r
+\r
+  The current implementation is very basic and does not follow MPEG-4 IPMPX architecture\r
+  This is just a place holder for ISMA/OMA-like schemes\r
+  Currently all operations are synchronous...\r
+*/\r
+\r
+enum\r
+{\r
+       /*push some configuration data to the IPMP tool*/\r
+       GF_IPMP_TOOL_SETUP,\r
+       /*request access to the object (eg, PLAY)*/\r
+       GF_IPMP_TOOL_GRANT_ACCESS,\r
+       /*release access to the object (eg, STOP)*/\r
+       GF_IPMP_TOOL_RELEASE_ACCESS,\r
+       /*push some configuration data to the IPMP tool*/\r
+       GF_IPMP_TOOL_PROCESS_DATA,\r
+};\r
+\r
+typedef struct\r
+{\r
+       u32 scheme_version;\r
+       u32 scheme_type;\r
+       const char *scheme_uri;\r
+       const char *kms_uri;\r
+} GF_ISMACrypConfig;\r
+\r
+typedef struct\r
+{\r
+       u32 scheme_version;\r
+       u32 scheme_type;\r
+       const char *scheme_uri;\r
+       const char *kms_uri;\r
+       /*SHA-1 hash*/\r
+       u8 hash[20];\r
+\r
+       const char *contentID;\r
+       u32 oma_drm_crypt_type;\r
+       Bool oma_drm_use_pad, oma_drm_use_hdr;\r
+       const char *oma_drm_textual_headers;\r
+       u32 oma_drm_textual_headers_len;\r
+} GF_OMADRM2Config;\r
+\r
+/*IPMP events*/\r
+typedef struct\r
+{\r
+       /*event type*/\r
+       u32 event_type;\r
+\r
+       /*gpac's channel triggering this event, NULL if unknown/unspecified*/\r
+       struct _es_channel *channel;\r
+\r
+       /*identifier of the config data (GF_IPMP_TOOL_SETUP)*/\r
+       u32 config_data_code;\r
+       /*config data (GF_IPMP_TOOL_SETUP). Type depends on the config_data_code*/\r
+       void *config_data;\r
+\r
+       Bool restart_requested;\r
+\r
+       /*data manipulation (GF_IPMP_TOOL_PROCESS_DATA) - data is always processed in-place in a\r
+       synchronous way*/\r
+       char *data;\r
+       u32 data_size;\r
+       u32 out_data_size;\r
+       /*indicates if payload passed is encrypted or not - this is used by ISMA, OMA and 3GP*/\r
+       Bool is_encrypted;\r
+       /*ISMA payload resync indicator*/\r
+       u64 isma_BSO;\r
+} GF_IPMPEvent;\r
+\r
+/*interface name and version for IPMP tools*/\r
+#define GF_IPMP_TOOL_INTERFACE         GF_4CC('G','I','P', 0x01)\r
+\r
+typedef struct _ipmp_tool GF_IPMPTool;\r
+\r
+struct _ipmp_tool\r
+{\r
+       /* interface declaration*/\r
+       GF_DECL_MODULE_INTERFACE\r
+\r
+       /*process an ipmp event*/\r
+       GF_Err (*process)(GF_IPMPTool *dr, GF_IPMPEvent *evt);\r
+       /*tool private*/\r
+       void *udta;\r
+\r
+};\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif /*#define _GF_MODULE_IPMP_H_\r
+*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/modules/js_usr.h b/tstools/DtsEdit/src/gpac/modules/js_usr.h
new file mode 100644 (file)
index 0000000..877a087
--- /dev/null
@@ -0,0 +1,66 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / modules interfaces\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+\r
+#ifndef _GF_MODULE_JS_USR_H_\r
+#define _GF_MODULE_JS_USR_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/module.h>\r
+#include <gpac/scenegraph.h>\r
+\r
+/*interface name and version for JavaScript User Extensions*/\r
+#define GF_JS_USER_EXT_INTERFACE               GF_4CC('G','J','S', 0x01)\r
+\r
+typedef struct _js_usr_ext GF_JSUserExtension;\r
+\r
+struct _js_usr_ext\r
+{\r
+       /* interface declaration*/\r
+       GF_DECL_MODULE_INTERFACE\r
+\r
+       /*load JS extension\r
+        doc: scene graph in which the extension is loaded\r
+        jsctx: JavaScript context in which the extension is loaded. \r
+               For BIFS/VRML/X3D, one context is created per script node\r
+               For other graphs, one context is created per scene/document\r
+        global: JavaScript global object for the context\r
+        unload: if true, the extension should be unloaded from the JavaScript context (called upon destroy). Otherwise it should be loaded\r
+       */\r
+       void (*load)(GF_JSUserExtension *jsext, GF_SceneGraph *doc, struct JSContext *jsctx, struct JSObject *global, Bool unload);\r
+       /*module private*/\r
+       void *udta;\r
+};\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif /*#define _GF_MODULE_JS_USR_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/modules/raster2d.h b/tstools/DtsEdit/src/gpac/modules/raster2d.h
new file mode 100644 (file)
index 0000000..0311ce4
--- /dev/null
@@ -0,0 +1,258 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / modules interfaces\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+\r
+#ifndef _GF_MODULE_RASTER2D_H_\r
+#define _GF_MODULE_RASTER2D_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/path2d.h>\r
+#include <gpac/module.h>\r
+#include <gpac/color.h>\r
+\r
+\r
+/*stencil types*/\r
+typedef enum\r
+{\r
+       /*solid color stencil*/\r
+       GF_STENCIL_SOLID = 0,\r
+       /*linear color gradient stencil*/\r
+       GF_STENCIL_LINEAR_GRADIENT,\r
+       /*radial color gradient stencil*/\r
+       GF_STENCIL_RADIAL_GRADIENT,\r
+       /*texture stencil*/\r
+       GF_STENCIL_VERTEX_GRADIENT,\r
+       /*texture stencil*/\r
+       GF_STENCIL_TEXTURE,\r
+} GF_StencilType;\r
+\r
+\r
+/*gradient filling modes*/\r
+typedef enum\r
+{\r
+       /*edge colors are repeated until path is filled*/\r
+       GF_GRADIENT_MODE_PAD,\r
+       /*pattern is inversed each time it's repeated*/\r
+       GF_GRADIENT_MODE_SPREAD,\r
+       /*pattern is repeated to fill path*/\r
+       GF_GRADIENT_MODE_REPEAT\r
+} GF_GradientMode;\r
+\r
+\r
+/*texture tiling flags*/\r
+typedef enum\r
+{\r
+       /*texture is repeated in its horizontal direction*/\r
+       GF_TEXTURE_REPEAT_S = (1<<1),\r
+       /*texture is repeated in its horizontal direction*/\r
+       GF_TEXTURE_REPEAT_T = (1<<2),\r
+       /*texture is fliped vertically*/\r
+       GF_TEXTURE_FLIP = (1<<3),\r
+} GF_TextureTiling;\r
+\r
+/*filter levels for texturing - up to the graphics engine but the following levels are used by\r
+the client*/\r
+typedef enum\r
+{\r
+       /*high speed mapping (ex, no filtering applied)*/\r
+       GF_TEXTURE_FILTER_HIGH_SPEED,\r
+       /*compromise between speed and quality (ex, filter to nearest pixel)*/\r
+       GF_TEXTURE_FILTER_MID,\r
+       /*high quality mapping (ex, bi-linear/bi-cubic interpolation)*/\r
+       GF_TEXTURE_FILTER_HIGH_QUALITY\r
+} GF_TextureFilter;\r
+\r
+/* rasterizer antialiasing depending on the graphics engine*/\r
+typedef enum\r
+{\r
+       /*raster should use fastest mode possible (eg, no antialiasing)*/\r
+       GF_RASTER_HIGH_SPEED,\r
+       /*raster should use fast mode and good quality if possible*/\r
+       GF_RASTER_MID,\r
+       /*raster should use antialiasing*/\r
+       GF_RASTER_HIGH_QUALITY\r
+} GF_RasterLevel;\r
+\r
+\r
+/*user routines for raserizer. common syntaxes:\r
+       @cbk: user defined callback\r
+       @x, y: first pixel position of the run, in device memory (top-left) coordinates\r
+       @run_h_len: number of pixels to fill on line\r
+       @color: color to fill pixel with. USER MUST IGNORE THE ALPHA COMPONENT OF THIS COLOR, the final \r
+               alpha is computed by the lib\r
+       @alpha: blending amount (0->0xFF) for the pixels\r
+*/\r
+typedef struct\r
+{\r
+       void *cbk;\r
+       /*fills line pixels without any blending operation*/\r
+       void (*fill_run_no_alpha)(void *cbk, u32 x, u32 y, u32 run_h_len, GF_Color color);\r
+       /*fills line pixels without blending operation - alpha combines both fill color and anti-aliasing blending*/\r
+       void (*fill_run_alpha)(void *cbk, u32 x, u32 y, u32 run_h_len, GF_Color color, u32 alpha);\r
+} GF_RasterCallback;\r
+\r
+\r
+\r
+/*opaque handler for all stencils*/\r
+typedef void *GF_STENCIL;\r
+\r
+/*visual surface handler*/\r
+typedef void *GF_SURFACE;\r
+\r
+/*interface name and version for raster2D*/\r
+#define GF_RASTER_2D_INTERFACE         GF_4CC('G','R','2', 0x02)\r
+\r
+/*graphics driver*/\r
+typedef struct _raster2d_interface\r
+{\r
+       /* interface declaration*/\r
+       GF_DECL_MODULE_INTERFACE\r
+\r
+       GF_STENCIL (*stencil_new) (struct _raster2d_interface *, GF_StencilType type);\r
+       /*common destructor for all stencils*/\r
+       void (*stencil_delete) (GF_STENCIL _this);\r
+       /*set stencil transformation matrix*/\r
+       GF_Err (*stencil_set_matrix) (GF_STENCIL _this, GF_Matrix2D *mat);\r
+       /*solid brush - set brush color*/\r
+       GF_Err (*stencil_set_brush_color) (GF_STENCIL _this, GF_Color c);\r
+       /*gradient brushes*/\r
+       /*sets gradient repeat mode - return GF_NOT_SUPPORTED if driver doesn't support this to let the app compute repeat patterns\r
+       this may be called before the gradient is setup*/\r
+       GF_Err (*stencil_set_gradient_mode) (GF_STENCIL _this, GF_GradientMode mode);\r
+       /*set linear gradient.  line is defined by start and end, and you can give interpolation colors at specified positions*/\r
+       GF_Err (*stencil_set_linear_gradient) (GF_STENCIL _this, Fixed start_x, Fixed start_y, Fixed end_x, Fixed end_y);\r
+       /*radial gradient brush center point, focal point and radius - colors can only be set through set_interpolation */\r
+       GF_Err (*stencil_set_radial_gradient) (GF_STENCIL _this, Fixed cx, Fixed cy, Fixed fx, Fixed fy, Fixed x_radius, Fixed y_radius);\r
+       /*radial and linear gradient (not used with vertex) - set color interpolation at given points, \r
+               @pos[i]: distance from (center for radial, start for linear) expressed between 0 and 1 (1 being the gradient bounds)\r
+               @col[i]: associated color\r
+       NOTE 1: the colors at 0 and 1.0 MUST be provided\r
+       NOTE 2: colors shall be fed in order from 0 to 1\r
+       NOTE 3: this overrides the colors provided for linear gradient\r
+       */\r
+       GF_Err (*stencil_set_gradient_interpolation) (GF_STENCIL _this, Fixed *pos, GF_Color *col, u32 count);\r
+\r
+       /*vertex gradient : set limit path */\r
+       GF_Err (*stencil_set_vertex_path) (GF_STENCIL _this, GF_Path *path);\r
+       /*set the center of the gradient*/\r
+       GF_Err (*stencil_set_vertex_center) (GF_STENCIL _this, Fixed cx, Fixed cy, u32 color);\r
+       /*set the center of the gradient*/\r
+       GF_Err (*stencil_set_vertex_colors) (GF_STENCIL _this, u32 *colors, u32 nbCol);\r
+       \r
+       /*sets global alpha blending level for stencil (texture and gradients)\r
+       the alpha channel shall be combined with the color matrix if any*/\r
+       GF_Err (*stencil_set_alpha) (GF_STENCIL _this, u8 alpha);\r
+       \r
+       /*set stencil texture\r
+               @pixels: texture data, from top to bottom\r
+               @width, @height: texture size\r
+               @stride: texture horizontal pitch (bytes to skip to get to next row)\r
+               @pixelFormat: texture pixel format as defined in file constants.h\r
+               @destination_format_hint: this is the current pixel format of the destination surface, and is given\r
+               as a hint in case the texture needs to be converted by the stencil\r
+               @no_copy: if set, specifies the texture data shall not be cached by the module (eg it must be able\r
+               to directly modify the given memory\r
+       NOTE: this stencil acts as a data wrapper, the pixel data is not required to be locally copied\r
+       data is not required to be available for texturing until the stencil is used in a draw operation\r
+       */\r
+       GF_Err (*stencil_set_texture) (GF_STENCIL _this, char *pixels, u32 width, u32 height, u32 stride, GF_PixelFormat pixelFormat, GF_PixelFormat destination_format_hint, Bool no_copy);\r
+       /*creates internal texture - pixel data is owned by texture brush - set to NULL if not supported - this is used to \r
+       cope with engines that don't support random strides (ex: Gdiplus needs stride to be a multiple of 4) \r
+       if not set the compositor will create its own mem texture and pass it through set_texture - pixel format shall \r
+       be respected as far as Alpha is concerned (eg alpha info shall be kept and used in blit) */\r
+       GF_Err (*stencil_create_texture) (GF_STENCIL _this, u32 width, u32 height, GF_PixelFormat pixelFormat);\r
+       /*signals the texture has been modified (internal texture only)*/\r
+       void (*stencil_texture_modified) (GF_STENCIL _this);\r
+\r
+       /*sets texture tile mode*/\r
+       GF_Err (*stencil_set_tiling) (GF_STENCIL _this, GF_TextureTiling mode);\r
+       /*sets texture filtering mode*/\r
+       GF_Err (*stencil_set_filter) (GF_STENCIL _this, GF_TextureFilter filter_mode);\r
+       /*set stencil color matrix - texture stencils only. If matrix is NULL, resets current color matrix*/\r
+       GF_Err (*stencil_set_color_matrix) (GF_STENCIL _this, GF_ColorMatrix *cmat);\r
+\r
+       /*creates surface object*/\r
+       /* @center_coords: true indicates mathematical-like coord system, \r
+                                          false indicates computer-like coord system */\r
+       GF_SURFACE (*surface_new) (struct _raster2d_interface *, Bool center_coords);\r
+       /* delete surface object */\r
+       void (*surface_delete) (GF_SURFACE _this);\r
+\r
+       /* attach surface object to device object (Win32: HDC) width and height are target surface size*/\r
+       GF_Err (*surface_attach_to_device) (GF_SURFACE _this, void *os_handle, u32 width, u32 height);\r
+       /* attach surface object to stencil object*/\r
+       GF_Err (*surface_attach_to_texture) (GF_SURFACE _this, GF_STENCIL sten);\r
+       /* attach surface object to memory buffer if supported\r
+               @pixels: texture data\r
+               @width, @height: texture size\r
+               @stride: texture horizontal pitch (bytes to skip to get to next row)\r
+               @pixelFormat: texture pixel format\r
+       */\r
+       GF_Err (*surface_attach_to_buffer) (GF_SURFACE _this, char *pixels, u32 width, u32 height, u32 stride, GF_PixelFormat pixelFormat);\r
+\r
+       GF_Err (*surface_attach_to_callbacks) (GF_SURFACE _this, GF_RasterCallback *callbacks, u32 width, u32 height);\r
+\r
+       /* detach surface object */\r
+       void (*surface_detach) (GF_SURFACE _this);\r
+\r
+       /*sets rasterizer precision */\r
+       GF_Err (*surface_set_raster_level) (GF_SURFACE _this, GF_RasterLevel RasterSetting);\r
+       /* set the given matrix as the current transformations for all drawn paths\r
+       if NULL reset the current transformation */\r
+       GF_Err (*surface_set_matrix) (GF_SURFACE _this, GF_Matrix2D *mat);\r
+       /* set the given rectangle as a clipper - nothing will be drawn outside this clipper\r
+       if the clipper is NULL then no clipper is set\r
+       NB: the clipper is not affected by the surface matrix and is given in pixels\r
+       CF ABOVE NOTE ON CLIPPERS*/\r
+       GF_Err (*surface_set_clipper) (GF_SURFACE _this, GF_IRect *rc);\r
+\r
+       /*sets the given path as the current one for drawing - the surface transform is NEVER changed between\r
+       setting the path and filling, only the clipper may change*/\r
+       GF_Err (*surface_set_path) (GF_SURFACE _this, GF_Path *path);\r
+       /*fills the current path using the given stencil - can be called several times with the same current path*/\r
+       GF_Err (*surface_fill) (GF_SURFACE _this, GF_STENCIL stencil);\r
+\r
+       /*flushes to surface*/\r
+       GF_Err (*surface_flush) (GF_SURFACE _this);\r
+\r
+       /*clears given pixel rect on the surface with the given color - REQUIRED\r
+       the given rect is formatted as a clipper - CF ABOVE NOTE ON CLIPPERS*/\r
+       GF_Err (*surface_clear)(GF_SURFACE _this, GF_IRect *rc, GF_Color col);\r
+\r
+/*private:*/\r
+       void *internal;\r
+} GF_Raster2D;\r
+\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif /*_GF_MODULE_RASTER2D_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/modules/service.h b/tstools/DtsEdit/src/gpac/modules/service.h
new file mode 100644 (file)
index 0000000..26e0812
--- /dev/null
@@ -0,0 +1,467 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / modules interfaces\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_SERVICE_H_\r
+#define _GF_SERVICE_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/*for SL, ESD and OD*/\r
+#include <gpac/mpeg4_odf.h>\r
+#include <gpac/download.h>\r
+\r
+/*handle to service*/\r
+typedef struct _net_service GF_ClientService;\r
+\r
+/*handle to channel*/\r
+typedef void *LPNETCHANNEL;\r
+\r
+enum\r
+{\r
+       /*channel control, app->module. Note that most modules don't need to handle pause/resume/set_speed*/\r
+       GF_NET_CHAN_PLAY,\r
+       GF_NET_CHAN_STOP,\r
+       GF_NET_CHAN_PAUSE,\r
+       GF_NET_CHAN_RESUME,\r
+       GF_NET_CHAN_SET_SPEED,\r
+       /*channel configuration, app->module*/\r
+       GF_NET_CHAN_CONFIG,\r
+       /*channel duration, app<->module (in case duration is not known at setup)*/\r
+       GF_NET_CHAN_DURATION,\r
+       /*channel buffer, app->module*/\r
+       GF_NET_CHAN_BUFFER,\r
+       /*channel buffer query, app<-module*/\r
+       GF_NET_CHAN_BUFFER_QUERY,\r
+       /*retrieves DSI from channel (DSI may be caried by net with a != value than OD), app->module*/\r
+       GF_NET_CHAN_GET_DSI,\r
+       /*set media padding for all AUs fetched (pull mode only). \r
+       If not supported the channel will have to run in push mode. app->module*/\r
+       GF_NET_CHAN_SET_PADDING,\r
+       /*sets input channel to pull mode if possible, app->module*/\r
+       GF_NET_CHAN_SET_PULL,\r
+       /*query channel capability to pause/resume and seek(play from an arbitrary range)\r
+       a non-interactive channel doesn't have to handle SET_SPEED, PAUSE and RESUME commands but can \r
+       still work in pull mode*/\r
+       GF_NET_CHAN_INTERACTIVE,\r
+       /*map net time (OTB) to media time (up only) - this is needed by some signaling protocols when the \r
+       real play range is not the requested one */\r
+       GF_NET_CHAN_MAP_TIME,\r
+       /*reconfiguration of channel comming from network (up only) - this is used to override the SL config\r
+       if it differs from the one specified at config*/\r
+       GF_NET_CHAN_RECONFIG,\r
+       /*signal channel is ISMACryp'ted (net->term only)*/\r
+       GF_NET_CHAN_DRM_CFG,\r
+       \r
+       /*retrieves ESD for channel - net->term only, for cache configuration*/\r
+       GF_NET_CHAN_GET_ESD,\r
+       /*retrieves visual PAR as indicated in container if any*/\r
+       GF_NET_CHAN_GET_PIXEL_AR,\r
+       \r
+       /*service buffer query (for all channels running in service), app<-module*/\r
+       GF_NET_BUFFER_QUERY,\r
+       /*retrieves network stats for service/channel; app->module*/\r
+       GF_NET_GET_STATS,\r
+       /*retrieves whether service can be cached (rtp, http streaming radios, etc) or not. No associated struct*/\r
+       GF_NET_IS_CACHABLE,\r
+\r
+       /*sets info for service - net->term only*/\r
+       GF_NET_SERVICE_INFO,\r
+       /*checks if there is an audio stream in the service - term->net only*/\r
+       GF_NET_SERVICE_HAS_AUDIO,\r
+};\r
+\r
+/*channel command for all commands that don't need params:\r
+GF_NET_CHAN_SET_PULL: module shall return GF_OK or GF_NOT_SUPPORTED\r
+GF_NET_CHAN_INTERACTIVE: module shall return GF_OK or GF_NOT_SUPPORTED\r
+*/\r
+typedef struct\r
+{\r
+       /*command type*/\r
+       u32 command_type;\r
+       /*channel*/\r
+       LPNETCHANNEL on_channel;\r
+} GF_NetComBase;\r
+\r
+/*GF_NET_CHAN_PLAY, GF_NET_CHAN_SET_SPEED*/\r
+typedef struct\r
+{\r
+       u32 command_type;\r
+       LPNETCHANNEL on_channel;\r
+       /*params for GF_NET_CHAN_PLAY, ranges in sec - if range is <0, then it is ignored (eg [2, -1] with speed>0 means 2 +oo) */\r
+       Double start_range, end_range;\r
+       /*params for GF_NET_CHAN_PLAY and GF_NET_CHAN_SPEED*/\r
+       Double speed;\r
+} GF_NetComPlay;\r
+\r
+\r
+/*GF_NET_CHAN_CONFIG, GF_NET_CHAN_RECONFIG\r
+channel config may happen as soon as the channel is open, even if the module hasn't acknowledge creation\r
+channel config can also be used from network to app, with GF_NET_CHAN_RECONFIG type - only the SL config is then used\r
+*/\r
+typedef struct\r
+{\r
+       u32 command_type;\r
+       LPNETCHANNEL on_channel;\r
+\r
+       /*SL config of the stream as delivered in OD (app->channel) or by network (channel->app)*/\r
+       GF_SLConfig sl_config;          \r
+       /*stream priority packet drops are more tolerable if low priority - app->channel only*/\r
+       u32 priority;\r
+       /*sync ID: all channels with the same sync ID run on the same timeline, thus the module should \r
+       try to match this - note this may not be possible (typically RTP/RTSP)*/\r
+       u32 sync_id;\r
+       /*audio frame duration and sample rate if any - this is needed by some RTP payload*/\r
+       u32 frame_duration, sample_rate;\r
+} GF_NetComConfig;\r
+\r
+/*GF_NET_CHAN_BUFFER, GF_NET_CHAN_BUFFER_QUERY*/\r
+typedef struct\r
+{\r
+       u32 command_type;\r
+       LPNETCHANNEL on_channel;\r
+       /*the recommended buffering limits in ms - this depends on the modules preferences and on the service \r
+       type (multicast, vod, ...) - below buffer_min the stream will pause if possible until buffer_max is reached\r
+       note the app will fill in default values before querying*/\r
+       u32 min, max;\r
+       /*only used with GF_NET_CHAN_BUFFER_QUERY - amount of media in decoding buffer, in ms*/\r
+       u32 occupancy;\r
+} GF_NetComBuffer;\r
+\r
+/*GF_NET_CHAN_DURATION*/\r
+typedef struct\r
+{\r
+       u32 command_type;\r
+       LPNETCHANNEL on_channel;\r
+       /*duration in sec*/\r
+       Double duration;\r
+} GF_NetComDuration;\r
+\r
+/*GF_NET_CHAN_GET_DSI*/\r
+typedef struct\r
+{\r
+       u32 command_type;\r
+       LPNETCHANNEL on_channel;\r
+       /*carries specific info for codec - data shall be allocated by service and is freed by user*/\r
+       char *dsi;\r
+       u32 dsi_len;\r
+} GF_NetComGetDSI;\r
+\r
+/*GF_NET_CHAN_SET_PADDING*/\r
+typedef struct\r
+{\r
+       u32 command_type;\r
+       LPNETCHANNEL on_channel;\r
+       u32 padding_bytes;\r
+} GF_NetComPadding;\r
+\r
+/*GF_NET_CHAN_MAP_TIME*/\r
+typedef struct\r
+{\r
+       u32 command_type;\r
+       LPNETCHANNEL on_channel;\r
+       /*MediaTime at this timestamp*/\r
+       Double media_time;\r
+       /*TS where mapping is done (in SL TS resolution)*/\r
+       u64 timestamp;\r
+       /*specifies whether decoder input data shall be discarded or only have its timing updated*/\r
+       Bool reset_buffers;\r
+} GF_NetComMapTime;\r
+\r
+/*GF_NET_CHAN_ISMACRYP_CFG*/\r
+typedef struct\r
+{\r
+       u32 command_type;\r
+       LPNETCHANNEL on_channel;\r
+\r
+\r
+       /*per channel, regardless of DRM schemes (ISMA, OMA, )*/\r
+       u32 scheme_version;\r
+       u32 scheme_type;\r
+       const char *scheme_uri;\r
+       const char *kms_uri;\r
+       /*OMA DRM info*/\r
+       const char *contentID;\r
+       u32 oma_drm_crypt_type;\r
+       Bool oma_drm_use_pad, oma_drm_use_hdr;\r
+       const char *oma_drm_textual_headers;\r
+       u32 oma_drm_textual_headers_len;\r
+\r
+       /*SHA-1 file hash*/\r
+       u8 hash[20];\r
+} GF_NetComDRMConfig;\r
+\r
+/*GF_NET_CHAN_GET_ESD*/\r
+typedef struct\r
+{\r
+       u32 command_type;\r
+       LPNETCHANNEL on_channel;\r
+       const GF_ESD *esd;\r
+       Bool is_iod_stream;\r
+} GF_NetComGetESD;\r
+\r
+/*GF_NET_GET_STATS\r
+Notes\r
+1: only channels using network must reply. All channels fetching data through a \r
+file downloader (cf below) shall NOT answer, the app manages downloader bandwidth internally.\r
+2: BANDWIDTH USED BY SIGNALING PROTOCOL IS IGNORED IN GPAC\r
+*/\r
+typedef struct __netstatcom\r
+{\r
+       u32 command_type;\r
+       /*MAY BE NULL, in which case the module must fill in ONLY the control channel part. This\r
+       is not used yet, but could be with a protocol using a single control socket for N media channels.*/\r
+       LPNETCHANNEL on_channel;\r
+       /*percentage of packet loss from network. This cannot be figured out by the app since there is no\r
+       one-to-one mapping between the protocol packets and the final SL packet (cf RTP payloads)*/\r
+       Float pck_loss_percentage;\r
+       /*channel port, control channel port if any (eg RTCP)*/\r
+       u16 port, ctrl_port;\r
+       /*bandwidth used by channel & its control channel if any (both up and down) - expressed in bits per second*/\r
+       u32 bw_up, bw_down, ctrl_bw_down, ctrl_bw_up;\r
+       /*set to 0 if channel is not part of a multiplex. Otherwise set to the multiplex port, and \r
+       above port info shall be identifiers in the multiplex - note that multiplexing overhead is ignored \r
+       in GPAC for the current time*/\r
+       u16 multiplex_port;\r
+} GF_NetComStats;\r
+\r
+/*GF_NET_CHAN_GET_PIXEL_AR*/\r
+typedef struct\r
+{\r
+       u32 command_type;\r
+       LPNETCHANNEL on_channel;\r
+       u32 hSpacing, vSpacing;\r
+} GF_NetComPixelAR;\r
+\r
+/*GF_NET_SERVICE_INFO*/\r
+typedef struct __netinfocom\r
+{\r
+       u32 command_type;\r
+       /*currently NULL only*/\r
+       LPNETCHANNEL on_channel;\r
+       /*packed trackNumber(16 bits)/totaltrack(16 bits)*/\r
+       u32 track_info;\r
+       u32 genre;\r
+       const char *album;\r
+       const char *artist;\r
+       const char *comment;\r
+       const char *composer;\r
+       const char *name;\r
+       const char *writer;\r
+} GF_NetComInfo;\r
+\r
+/*GF_NET_CHAN_GET_PIXEL_AR*/\r
+typedef struct\r
+{\r
+       u32 command_type;\r
+       char *base_url;\r
+} GF_NetComHasAudio;\r
+\r
+typedef union __netcommand\r
+{\r
+       u32 command_type;\r
+       GF_NetComBase base;\r
+       GF_NetComPlay play;\r
+       GF_NetComConfig cfg;\r
+       GF_NetComBuffer buffer;\r
+       GF_NetComDuration duration;\r
+       GF_NetComGetDSI get_dsi;\r
+       GF_NetComPadding pad;\r
+       GF_NetComMapTime map_time;\r
+       GF_NetComStats net_stats;\r
+       GF_NetComDRMConfig drm_cfg;\r
+       GF_NetComGetESD cache_esd;\r
+       GF_NetComInfo info;\r
+       GF_NetComPixelAR par;\r
+       GF_NetComHasAudio audio;\r
+} GF_NetworkCommand;\r
+\r
+/*\r
+       network modules\r
+*/\r
+\r
+/*interface name and version for input service*/\r
+#define GF_NET_CLIENT_INTERFACE                        GF_4CC('G', 'I', 'S', 0x01)\r
+\r
+typedef struct _netinterface\r
+{\r
+       /* interface declaration*/\r
+       GF_DECL_MODULE_INTERFACE\r
+\r
+       /*retuns 1 if module can process this URL, 0 otherwise. This is only called when the file extension/mimeType cannot be\r
+       retrieved in the cfg file, otherwise the mime type/file ext is used to load service. Typically a module would \r
+       register its mime types in this function (cf gf_term_register_mime_type below)\r
+       */\r
+       Bool (*CanHandleURL)(struct _netinterface *, const char *url);\r
+\r
+       /*connects the service to the desired URL - the service handle is used for callbacks. \r
+       Only one service can be connected to a loaded interface.\r
+       */\r
+       GF_Err (*ConnectService) (struct _netinterface *, GF_ClientService *serv, const char *url);\r
+\r
+       /*disconnects service - the module is no longer used after this call - if immediate_shutdown is set the module\r
+       shall not attempt to get confirmation from remote side, it will be deleted right away\r
+       \r
+       NOTE: depending on how the client/server exchange is happening, it may happen that the CloseService is called\r
+       in the same context as a reply from your module. This can result into deadlocks if you're using threads. \r
+       You should therefore only try to destroy threads used in the interface shutdown process, which is guarantee\r
+       to be in a different context call.\r
+       */\r
+       GF_Err (*CloseService) (struct _netinterface *);\r
+\r
+       /*retrieves service decsriptor (expressed as an MPEG4 OD/IOD) for accessing this service \r
+       descriptor is allocated by plugin and destroyed by user\r
+       the IOD shall refer to the service attached to the module\r
+       @expect_type is a hint in case the service regenerates an IOD. It indicates whether the entry point expected is \r
+       INLINE, BIFS animation stream, video, audio or input sensor.\r
+       @sub_url: indicates fetching of an IOD for a given object in the service.\r
+       Only used for services handling the optional CanHandleURLInService below\r
+               NULL for main service\r
+               service extension for sub-service (cf CanHandleURLInService below). For ex,\r
+               "rtsp://myserver/file.mp4/ES_ID=3" and "rtsp://myserver/file.mp4/ES_ID=4" \r
+               or "file.avi#audio" and "file.avi#video".In this case a partial IOD for the desired object is expected\r
+       Note: once a service is acknowledged as connected, this function must be executed synchronously\r
+       The service can return NULL for a descriptor:\r
+               * if the expected media type is a single media, this means the media couldn't be found\r
+               * if the expected media type is a scene, this means the terminalk shall create and manage the scene\r
+       */\r
+       GF_Descriptor *(*GetServiceDescriptor) (struct _netinterface *, u32 expect_type, const char *sub_url);\r
+       \r
+\r
+       /*sends command to the service / channel - cf command structure*/\r
+       GF_Err (*ServiceCommand) (struct _netinterface *, GF_NetworkCommand *com);\r
+\r
+       /*data channel setup - url is either\r
+       "ES_ID=ID" where ID is the stream ID in this service\r
+       or a control string depending on the service/stream. The URL is first used to load a module able to handle it, \r
+       so the module has no redirection to handle\r
+       */\r
+       GF_Err (*ConnectChannel) (struct _netinterface *, LPNETCHANNEL channel, const char *url, Bool upstream);\r
+       /*teardown of data channel*/\r
+       GF_Err (*DisconnectChannel) (struct _netinterface *, LPNETCHANNEL channel);\r
+\r
+       /*optional - fetch MPEG4 data from channel - data shall not be duplicated and must be released at ReleaseData\r
+       SL info shall be written to provided header - if the data is a real SL packet the flag sl_compressed shall be \r
+       set to signal the app this is a full SL pdu (@out_sl_hdr is then ignored)\r
+       set to NULL if not supported\r
+       */\r
+       GF_Err (*ChannelGetSLP) (struct _netinterface *, LPNETCHANNEL channel, char **out_data_ptr, u32 *out_data_size, GF_SLHeader *out_sl_hdr, Bool *sl_compressed, GF_Err *out_reception_status, Bool *is_new_data);\r
+\r
+       /*optional - release SLP data allocated on channel by the previous call, if any\r
+       set to NULL if not supported*/\r
+       GF_Err (*ChannelReleaseSLP) (struct _netinterface *, LPNETCHANNEL channel);\r
+\r
+       /*this is needed for modules to query other modules, the typical case being 2 ESD URLs pointing to the \r
+       same media (audio and video streams in an RTSP session). This is always used on loaded modules but \r
+       doesn't have to be declared*/\r
+       Bool (*CanHandleURLInService)(struct _netinterface *, const char *url);\r
+\r
+/*private*/\r
+       void *priv;\r
+} GF_InputService;\r
+\r
+/*callback functions - these can be linked with non-LGPL modules*/\r
+/*message from service - error is set if error*/\r
+void gf_term_on_message(GF_ClientService *service, GF_Err error, const char *message);\r
+/*to call on service (if channel is NULL) or channel connect completed*/\r
+void gf_term_on_connect(GF_ClientService *service, LPNETCHANNEL ns, GF_Err response);\r
+/*to call on service (if channel is NULL) or channel disconnect completed*/\r
+void gf_term_on_disconnect(GF_ClientService *service, LPNETCHANNEL ns, GF_Err response);\r
+/* acknowledgement of service command - service commands handle both services and channels\r
+Most of the time commands are NOT acknowledged, typical acknowledgement are needed for setup and control\r
+with remote servers. \r
+command can also be triggered from the service (QoS, broadcast announcements)\r
+cf above for command usage\r
+*/\r
+void gf_term_on_command(GF_ClientService *service, GF_NetworkCommand *com, GF_Err response);\r
+/*to call when data packet is received. \r
+@data, data_size: data received\r
+@hdr: uncompressed SL header passed with data for stream sync - if not present then data shall be a valid SL packet \r
+       (header + PDU). Note that using an SLConfig resulting in an empty GF_SLHeader allows sending raw data directly\r
+@reception_status: data reception status. To signal end of stream, set this to GF_EOS\r
+*/\r
+void gf_term_on_sl_packet(GF_ClientService *service, LPNETCHANNEL ns, char *data, u32 data_size, GF_SLHeader *hdr, GF_Err reception_status);\r
+/*returns URL associated with service (so that you don't need to store it)*/\r
+const char *gf_term_get_service_url(GF_ClientService *service);\r
+\r
+/*adds a new media from network. !! The media descriptor is then owned/destroyed by the term!!\r
+media_desc: object descriptor for the new media. May be NULL to force scene rebuilt.\r
+no_scene_check: specifies if the scene description shall be rebuilt or not.\r
+*/\r
+void gf_term_add_media(GF_ClientService *service, GF_Descriptor *media_desc, Bool no_scene_update);\r
+\r
+\r
+/*check if @fileExt extension is supported for given mimeType, and if associated with module. If mimeType not registered, register it for given module*/\r
+Bool gf_term_check_extension(GF_InputService *ifce, const char *mimeType, const char *extList, const char *description, const char *fileExt);\r
+/*register mime types & file extensions - most modules should only need the check version above*/\r
+void gf_term_register_mime_type(GF_InputService *ifce, const char *mimeType, const char *extList, const char *description);\r
+\r
+GF_InputService *gf_term_get_service_interface(GF_ClientService *service);\r
+\r
+/*file downloading - can and MUST be used by any module (regardless of license) in order not to interfere \r
+with net management*/\r
+/*creates a new downloading session in the given service - if url is relative, it will be interpreted through\r
+the service URL*/\r
+GF_DownloadSession * gf_term_download_new(GF_ClientService *service, const char *url, u32 flags, gf_dm_user_io user_io, void *cbk);\r
+/*closes the downloading session*/\r
+void gf_term_download_del(GF_DownloadSession * dnload);\r
+/*send progress and connection messages to user...*/\r
+void gf_term_download_update_stats(GF_DownloadSession * sess);\r
+\r
+\r
+/*MPEG-4 media cache interface name*/\r
+#define GF_STREAMING_MEDIA_CACHE               GF_4CC('G', 'M', 'C', 0x01)\r
+\r
+typedef struct _cacheinterface\r
+{\r
+       /* interface declaration*/\r
+       GF_DECL_MODULE_INTERFACE\r
+\r
+       /*opens media cache at given place - extension is handled by cache module\r
+       @serv: service owning cache (eg, where to send data when requested)\r
+       @keep_existing_files: don't overwrite previously recorded sessions*/\r
+       GF_Err (*Open)(struct _cacheinterface *, GF_ClientService *serv, const char *location_and_name, Bool keep_existing_files);\r
+       /*closes media cache, delete file(s) if desired*/\r
+       GF_Err (*Close)(struct _cacheinterface *, Bool delete_cache);\r
+       /*writes data to cache. data is always a complete AU as reconstructed by gpac core\r
+       If first time data is written, user should query channel desc through service commands*/\r
+       GF_Err (*Write)(struct _cacheinterface *, LPNETCHANNEL ch, char *data, u32 data_size, GF_SLHeader *sl_hdr);\r
+\r
+       /*same as reader, except they MUST be provided - in other words, only PULL mode is supported for cache\r
+       at the current time*/\r
+       GF_Err (*ServiceCommand) (struct _cacheinterface *, GF_NetworkCommand *com);\r
+       GF_Err (*ChannelGetSLP) (struct _cacheinterface *, LPNETCHANNEL channel, char **out_data_ptr, u32 *out_data_size, GF_SLHeader *out_sl_hdr, Bool *sl_compressed, GF_Err *out_reception_status, Bool *is_new_data);\r
+       GF_Err (*ChannelReleaseSLP) (struct _cacheinterface *, LPNETCHANNEL channel);\r
+\r
+       /*module private*/\r
+       void *priv;\r
+} GF_StreamingCache;\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /*_GF_SERVICE_H_*/\r
diff --git a/tstools/DtsEdit/src/gpac/modules/term_ext.h b/tstools/DtsEdit/src/gpac/modules/term_ext.h
new file mode 100644 (file)
index 0000000..a470f29
--- /dev/null
@@ -0,0 +1,84 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / modules interfaces\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+\r
+#ifndef _GF_MODULE_TERM_EXT_H_\r
+#define _GF_MODULE_TERM_EXT_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/terminal.h>\r
+\r
+/*interface name and version for Terminal Extensions services*/\r
+#define GF_TERM_EXT_INTERFACE          GF_4CC('G','T','E', 0x01)\r
+\r
+typedef struct _term_ext GF_TermExt;\r
+\r
+\r
+enum\r
+{\r
+       /*start terminal extension. If 0 is returned, the module will be unloaded*/\r
+       GF_TERM_EXT_START = 1,\r
+       /*stop terminal extension*/\r
+       GF_TERM_EXT_STOP,\r
+       /*process extension - the GF_TERM_EXT_CAP_NOT_THREADED capability MUST be set*/\r
+       GF_TERM_EXT_PROCESS,\r
+};\r
+\r
+enum\r
+{\r
+       /*signal the extension is to be called on regular basis (once per simulation tick). This MUST be set during\r
+       the GF_TERM_EXT_START command and cannot be changed at run-time*/\r
+       GF_TERM_EXT_CAP_NOT_THREADED = 1<<1,\r
+};\r
+\r
+\r
+struct _term_ext\r
+{\r
+       /* interface declaration*/\r
+       GF_DECL_MODULE_INTERFACE\r
+\r
+       /*caps of the module*/\r
+       u32 caps;\r
+\r
+       /*load JS extension\r
+        termext: pointer to the module\r
+        term: pointer to GPAC terminal\r
+       */\r
+       Bool (*process)(GF_TermExt *termext, GF_Terminal *term, u32 action);\r
+\r
+       /*module private*/\r
+       void *udta;\r
+};\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif /*#define _GF_MODULE_TERM_EXT_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/modules/video_out.h b/tstools/DtsEdit/src/gpac/modules/video_out.h
new file mode 100644 (file)
index 0000000..ef50124
--- /dev/null
@@ -0,0 +1,190 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / modules interfaces\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+\r
+/*\r
+\r
+               Note on video driver: this is not a graphics driver, the only thing requested from this driver\r
+       is accessing video memory and performing stretch of YUV and RGB on the backbuffer (bitmap node)\r
+       the graphics driver is a different entity that performs 2D rasterization\r
+\r
+*/\r
+\r
+#ifndef _GF_MODULE_VIDEO_OUT_H_\r
+#define _GF_MODULE_VIDEO_OUT_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/*include module system*/\r
+#include <gpac/module.h>\r
+/*include event system*/\r
+#include <gpac/events.h>\r
+/*include framebuffer definition*/\r
+#include <gpac/color.h>\r
+\r
+/*\r
+               Video hardware output module\r
+*/\r
+\r
+enum\r
+{\r
+       /*HW supports RGB->backbuffer blitting*/\r
+       GF_VIDEO_HW_HAS_RGB = (1<<1),\r
+       /*HW supports RGBA->backbuffer blitting*/\r
+       GF_VIDEO_HW_HAS_RGBA = (1<<2),\r
+       /*HW supports YUV->backbuffer blitting*/\r
+       GF_VIDEO_HW_HAS_YUV = (1<<3),\r
+       /*HW supports YUV overlays*/\r
+       GF_VIDEO_HW_HAS_YUV_OVERLAY = (1<<4),\r
+       /*HW supports OpenGL rendering. Whether this is OpenGL or OpenGL-ES depends on compilation settings\r
+       and cannot be changed at runtime*/\r
+       GF_VIDEO_HW_OPENGL = (1<<5),\r
+       /*HW supports OpenGL offscreen rendering. Whether this is OpenGL or OpenGL-ES depends on compilation settings\r
+       and cannot be changed at runtime*/\r
+       GF_VIDEO_HW_OPENGL_OFFSCREEN = (1<<6),\r
+       /*HW supports OpenGL offscreen rendering with alpha. Whether this is OpenGL or OpenGL-ES depends on compilation settings\r
+       and cannot be changed at runtime*/\r
+       GF_VIDEO_HW_OPENGL_OFFSCREEN_ALPHA = (1<<7),\r
+};\r
+\r
+/*interface name and version for video output*/\r
+#define GF_VIDEO_OUTPUT_INTERFACE      GF_4CC('G','V','O',0x04) \r
+\r
+/*\r
+                       video output interface\r
+\r
+       the video output may run in 2 modes: 2D and 3D.\r
+\r
+       ** the 2D video output works by accessing a backbuffer surface on the video mem board - \r
+       the app accesses to the surface through the GF_VideoSurface handler. \r
+       The module may support HW blitting of RGB or YUV data to backbuffer.\r
+\r
+       ** the 3D video output only handles window management and openGL contexts setup.\r
+       The context shall be setup in Resize and SetFullScreen calls which are always happening in the main \r
+       rendering thread. This will take care of openGL context issues with multithreading\r
+\r
+       By default all modules are required to be setup in 2D. If 3D is needed, a GF_EVENT_VIDEO_SETUP will\r
+       be sent with the desired configuration.\r
+\r
+       Except Setup and Shutdown functions, all interface functions are called through the main compositor thread\r
+       or its user to avoid multithreading issues. Care must still be taken when handling events\r
+*/\r
+typedef struct _video_out\r
+{\r
+       /* interface declaration*/\r
+       GF_DECL_MODULE_INTERFACE\r
+\r
+       /*setup system - if os_handle is NULL the driver shall create the output display (common case)\r
+       the other case is currently only used by child windows on win32 and winCE\r
+       @init_flags: a list of initialization flags as specified in user.h*/\r
+       GF_Err (*Setup)(struct _video_out *vout, void *os_handle, void *os_display, u32 init_flags);\r
+       /*shutdown system */\r
+       void (*Shutdown) (struct _video_out *vout);\r
+\r
+       /*flush video: the video shall be presented to screen \r
+       the destination area to update is in client display coordinates (0,0) being top-left, (w,h) bottom-right\r
+       Note: dest is always NULL in 3D mode (buffer flip only)*/\r
+       GF_Err (*Flush) (struct _video_out *vout, GF_Window *dest);\r
+\r
+       GF_Err (*SetFullScreen) (struct _video_out *vout, Bool fs_on, u32 *new_disp_width, u32 *new_disp_height);\r
+\r
+       /*window events sent to output:\r
+       GF_EVENT_SET_CURSOR: sets cursor\r
+       GF_EVENT_SET_CAPTION: sets caption\r
+       GF_EVENT_SHOWHIDE: show/hide output window for self-managed output\r
+       GF_EVENT_SIZE:  inital window resize upon scene load\r
+       GF_EVENT_VIDEO_SETUP: all HW related setup:\r
+               * for 2D output, this means resizing the backbuffer if needed (depending on HW constraints)\r
+               * for 3D output, this means re-setup of OpenGL context (depending on HW constraints).\r
+                       * This can be a request for an offscreen rendering surface. If supported, this surface SHALL\r
+                       be readable through glReadPixels. If not supported, just return an error.\r
+                       Note that GPAC never uses more than one GL context (offscreen or main video)\r
+                       * Depending on windowing systems and implementations, it could be possible to resize a window \r
+               without destroying the GL context. If the GL context is destroyed, the module should send an event\r
+               of the same type to the player.\r
+       \r
+       This function is also called with a NULL event at the begining of each rendering cycle, in order to allow event \r
+       handling for modules uncapable of safe multithreading (eg X11)\r
+       */\r
+       GF_Err (*ProcessEvent)(struct _video_out *vout, GF_Event *event);\r
+\r
+       /*pass events to user (assigned before setup) - return 1 if the event has been processed by GPAC \r
+       (eiher scene or navigation), 0 otherwise*/\r
+       void *evt_cbk_hdl;\r
+       Bool (*on_event)(void *hdl, GF_Event *event);\r
+\r
+       /*\r
+                       All the following are 2D specific and are NEVER called in 3D mode\r
+       */\r
+       /*locks backbuffer video memory\r
+       do_lock: specifies whether backbuffer shall be locked or released\r
+       */\r
+       GF_Err (*LockBackBuffer)(struct _video_out *vout, GF_VideoSurface *video_info, Bool do_lock);\r
+\r
+       /*lock video mem through OS context (only HDC for Win32 at the moment)\r
+       do_lock: specifies whether OS context shall be locked or released*/\r
+       void *(*LockOSContext)(struct _video_out *vout, Bool do_lock);\r
+\r
+       /*blit surface src to backbuffer - if a window is not specified, the full surface is used\r
+       the blitter MUST support stretching and RGB24 sources. Support for YUV is indicated in the hw caps\r
+       of the driver. If none is supported, just set this function to NULL and let gpac performs software blitting.\r
+       Whenever this function fails, the blit will be performed in software mode\r
+       if is_overlay is set, this is an overlay on the video memory (Flush would have been called before)\r
+               overlay_type 1: this is regular overlay without color keying\r
+               overlay_type 2: this is overlay with color keying\r
+       */\r
+       GF_Err (*Blit)(struct _video_out *vout, GF_VideoSurface *video_src, GF_Window *src_wnd, GF_Window *dst_wnd, u32 overlay_type);\r
+\r
+       /*set of above HW flags*/\r
+       u32 hw_caps;\r
+       /*main pixel format of video board (informative only)*/\r
+       u32 pixel_format;\r
+       /*yuv pixel format if HW YUV blitting is supported (informative only) */\r
+       u32 yuv_pixel_format;\r
+       /*maximum resolution of the screen*/\r
+       u32 max_screen_width, max_screen_height;\r
+       /* dpi of the screen*/\r
+       u32 dpi_x, dpi_y;\r
+\r
+       /*overlay color key used by the hardware bliter - if not set, only top-level overlay can be used*/\r
+       u32 overlay_color_key;\r
+#ifdef ENABLE_JOYSTICK\r
+       u32 centered_mode;\r
+#endif\r
+\r
+       /*driver private*/\r
+       void *opaque;\r
+} GF_VideoOutput;\r
+\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif /*_GF_MODULE_VIDEO_OUT_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/mpeg4_odf.h b/tstools/DtsEdit/src/gpac/mpeg4_odf.h
new file mode 100644 (file)
index 0000000..57213b3
--- /dev/null
@@ -0,0 +1,1697 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / MPEG-4 Object Descriptor sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_MPEG4_ODF_H_\r
+#define _GF_MPEG4_ODF_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/list.h>\r
+#include <gpac/bitstream.h>\r
+#include <gpac/sync_layer.h>\r
+\r
+/***************************************\r
+                       Descriptors Tag\r
+***************************************/\r
+enum\r
+{\r
+       GF_ODF_OD_TAG                   = 0x01,\r
+       GF_ODF_IOD_TAG                  = 0x02,\r
+       GF_ODF_ESD_TAG                  = 0x03,\r
+       GF_ODF_DCD_TAG                  = 0x04,\r
+       GF_ODF_DSI_TAG                  = 0x05,\r
+       GF_ODF_SLC_TAG                  = 0x06,\r
+       GF_ODF_CI_TAG                   = 0x07,\r
+       GF_ODF_SCI_TAG                  = 0x08,\r
+       GF_ODF_IPI_PTR_TAG              = 0x09,\r
+       GF_ODF_IPMP_PTR_TAG             = 0x0A,\r
+       GF_ODF_IPMP_TAG                 = 0x0B,\r
+       GF_ODF_QOS_TAG                  = 0x0C,\r
+       GF_ODF_REG_TAG                  = 0x0D,\r
+\r
+       /*FILE FORMAT RESERVED IDs - NEVER CREATE / USE THESE DESCRIPTORS*/\r
+       GF_ODF_ESD_INC_TAG              = 0x0E,\r
+       GF_ODF_ESD_REF_TAG              = 0x0F,\r
+       GF_ODF_ISOM_IOD_TAG             = 0x10,\r
+       GF_ODF_ISOM_OD_TAG              = 0x11,\r
+       GF_ODF_ISOM_IPI_PTR_TAG = 0x12,\r
+       /*END FILE FORMAT RESERVED*/\r
+       \r
+       GF_ODF_EXT_PL_TAG               = 0x13,\r
+       GF_ODF_PL_IDX_TAG               = 0x14,\r
+       \r
+       GF_ODF_ISO_BEGIN_TAG    = 0x15,\r
+       GF_ODF_ISO_END_TAG              = 0x3F,\r
+\r
+       GF_ODF_CC_TAG                   = 0x40,\r
+       GF_ODF_KW_TAG                   = 0x41,\r
+       GF_ODF_RATING_TAG               = 0x42,\r
+       GF_ODF_LANG_TAG                 = 0x43,\r
+       GF_ODF_SHORT_TEXT_TAG   = 0x44,\r
+       GF_ODF_TEXT_TAG                 = 0x45,\r
+       GF_ODF_CC_NAME_TAG              = 0x46,\r
+       GF_ODF_CC_DATE_TAG              = 0x47,\r
+       GF_ODF_OCI_NAME_TAG             = 0x48,\r
+       GF_ODF_OCI_DATE_TAG             = 0x49,\r
+       GF_ODF_SMPTE_TAG                = 0x4A,\r
+\r
+       GF_ODF_SEGMENT_TAG              = 0x4B,\r
+       GF_ODF_MEDIATIME_TAG    = 0x4C,\r
+\r
+       GF_ODF_IPMP_TL_TAG              = 0x60,\r
+       GF_ODF_IPMP_TOOL_TAG    = 0x61,\r
+\r
+       GF_ODF_ISO_RES_BEGIN_TAG        = 0x62,\r
+       GF_ODF_ISO_RES_END_TAG          = 0xBF,\r
+       \r
+       GF_ODF_USER_BEGIN_TAG   = 0xC0,\r
+\r
+       /*internal descriptor for mux input description*/\r
+       GF_ODF_MUXINFO_TAG              = GF_ODF_USER_BEGIN_TAG,\r
+       /*internal descriptor for bifs config input description*/\r
+       GF_ODF_BIFS_CFG_TAG             = GF_ODF_USER_BEGIN_TAG + 1,\r
+       /*internal descriptor for UI config input description*/\r
+       GF_ODF_UI_CFG_TAG               = GF_ODF_USER_BEGIN_TAG + 2,\r
+       /*internal descriptor for TextConfig description*/\r
+       GF_ODF_TEXT_CFG_TAG             = GF_ODF_USER_BEGIN_TAG + 3,\r
+       GF_ODF_TX3G_TAG                 = GF_ODF_USER_BEGIN_TAG + 4,\r
+       GF_ODF_ELEM_MASK_TAG    = GF_ODF_USER_BEGIN_TAG + 5,\r
+       /*internal descriptor for LASeR config input description*/\r
+       GF_ODF_LASER_CFG_TAG    = GF_ODF_USER_BEGIN_TAG + 6,\r
+\r
+       GF_ODF_USER_END_TAG             = 0xFE,\r
+\r
+       GF_ODF_OCI_BEGIN_TAG    = 0x40,\r
+       GF_ODF_OCI_END_TAG              = (GF_ODF_ISO_RES_BEGIN_TAG - 1),\r
+\r
+       GF_ODF_EXT_BEGIN_TAG    = 0x80,\r
+       GF_ODF_EXT_END_TAG              = 0xFE,\r
+\r
+\r
+       /*descriptor for aucilary video data*/\r
+       GF_ODF_AUX_VIDEO_DATA   = GF_ODF_EXT_BEGIN_TAG + 1,\r
+};\r
+\r
+\r
+/***************************************\r
+                       Descriptors\r
+***************************************/\r
+\r
+#define BASE_DESCRIPTOR \\r
+               u8 tag;\r
+\r
+typedef struct\r
+{\r
+       BASE_DESCRIPTOR\r
+} GF_Descriptor;\r
+\r
+\r
+/*     default descriptor. \r
+       NOTE: The decoderSpecificInfo is used as a default desc with tag 0x05 */\r
+typedef struct\r
+{\r
+       BASE_DESCRIPTOR\r
+       u32 dataLength;\r
+       char *data;\r
+} GF_DefaultDescriptor;\r
+\r
+/*Object Descriptor*/\r
+typedef struct\r
+{\r
+       BASE_DESCRIPTOR\r
+       GF_List *ipmp_tools;\r
+} GF_IPMP_ToolList;\r
+\r
+/*ObjectDescriptor*/\r
+typedef struct\r
+{\r
+       BASE_DESCRIPTOR\r
+       u16 objectDescriptorID;\r
+       char *URLString;\r
+       GF_List *ESDescriptors;\r
+       GF_List *OCIDescriptors;\r
+       /*includes BOTH IPMP_DescriptorPointer (IPMP & IPMPX) and GF_IPMP_Descriptor (IPMPX only)*/\r
+       GF_List *IPMP_Descriptors;\r
+       GF_List *extensionDescriptors;\r
+} GF_ObjectDescriptor;\r
+\r
+/*GF_InitialObjectDescriptor - WARNING: even though the bitstream IOD is not\r
+a bit extension of OD, internally it is a real overclass of OD\r
+we usually typecast IOD to OD when flags are not needed !!!*/\r
+typedef struct\r
+{\r
+       BASE_DESCRIPTOR\r
+       u16 objectDescriptorID;\r
+       char *URLString;\r
+       GF_List *ESDescriptors;\r
+       GF_List *OCIDescriptors;\r
+       /*includes BOTH IPMP_DescriptorPointer (IPMP & IPMPX) and GF_IPMP_Descriptor (IPMPX only)*/\r
+       GF_List *IPMP_Descriptors;\r
+       GF_List *extensionDescriptors;\r
+\r
+       /*IOD extensions*/\r
+       u8 inlineProfileFlag;\r
+       u8 OD_profileAndLevel;\r
+       u8 scene_profileAndLevel;\r
+       u8 audio_profileAndLevel;\r
+       u8 visual_profileAndLevel;\r
+       u8 graphics_profileAndLevel;\r
+\r
+       GF_IPMP_ToolList *IPMPToolList;\r
+} GF_InitialObjectDescriptor;\r
+\r
+/*File Format Object Descriptor*/\r
+typedef struct\r
+{\r
+       BASE_DESCRIPTOR\r
+       u16 objectDescriptorID;\r
+       char *URLString;\r
+       GF_List *ES_ID_RefDescriptors;\r
+       GF_List *OCIDescriptors;\r
+       GF_List *IPMP_Descriptors;\r
+       GF_List *extensionDescriptors;\r
+       GF_List *ES_ID_IncDescriptors;\r
+} GF_IsomObjectDescriptor;\r
+\r
+/*File Format Initial Object Descriptor - same remark as IOD*/\r
+typedef struct\r
+{\r
+       BASE_DESCRIPTOR\r
+       u16 objectDescriptorID;\r
+       char *URLString;\r
+       GF_List *ES_ID_RefDescriptors;\r
+       GF_List *OCIDescriptors;\r
+       GF_List *IPMP_Descriptors;\r
+       GF_List *extensionDescriptors;\r
+       GF_List *ES_ID_IncDescriptors;\r
+\r
+       u8 inlineProfileFlag;\r
+       u8 OD_profileAndLevel;\r
+       u8 scene_profileAndLevel;\r
+       u8 audio_profileAndLevel;\r
+       u8 visual_profileAndLevel;\r
+       u8 graphics_profileAndLevel;\r
+\r
+       GF_IPMP_ToolList *IPMPToolList;\r
+} GF_IsomInitialObjectDescriptor;\r
+\r
+\r
+/*File Format ES Descriptor for IOD*/\r
+typedef struct {\r
+       BASE_DESCRIPTOR\r
+       u32 trackID;\r
+} GF_ES_ID_Inc;\r
+\r
+/*File Format ES Descriptor for OD*/\r
+typedef struct {\r
+       BASE_DESCRIPTOR\r
+       u16 trackRef;\r
+} GF_ES_ID_Ref;\r
+\r
+/*Decoder config Descriptor*/\r
+typedef struct\r
+{\r
+       BASE_DESCRIPTOR\r
+       u8 objectTypeIndication;\r
+       u8 streamType;\r
+       u8 upstream;\r
+       u32 bufferSizeDB;\r
+       u32 maxBitrate;\r
+       u32 avgBitrate;\r
+       GF_DefaultDescriptor *decoderSpecificInfo;\r
+       GF_List *profileLevelIndicationIndexDescriptor;\r
+} GF_DecoderConfig;\r
+\r
+\r
+/*Content Identification Descriptor*/\r
+typedef struct {\r
+       BASE_DESCRIPTOR\r
+       u8 compatibility;\r
+       u8 protectedContent;\r
+       u8 contentTypeFlag;\r
+       u8 contentIdentifierFlag;\r
+       u8 contentType;\r
+       u8 contentIdentifierType;\r
+       /*international code string*/\r
+       char *contentIdentifier;        \r
+} GF_CIDesc;\r
+\r
+/*Supplementary Content Identification Descriptor)*/\r
+typedef struct {\r
+       BASE_DESCRIPTOR\r
+       u32 languageCode;\r
+       char *supplContentIdentifierTitle;\r
+       char *supplContentIdentifierValue;\r
+} GF_SCIDesc;\r
+\r
+/*IPI (Intelectual Property Identification) Descriptor Pointer*/\r
+typedef struct {\r
+       BASE_DESCRIPTOR\r
+       u16 IPI_ES_Id;\r
+} GF_IPIPtr;\r
+\r
+/*IPMP Descriptor Pointer*/\r
+typedef struct {\r
+       BASE_DESCRIPTOR\r
+       u8 IPMP_DescriptorID;\r
+       u16 IPMP_DescriptorIDEx;\r
+       u16 IPMP_ES_ID; \r
+} GF_IPMPPtr;\r
+\r
+/*IPMPX control points*/\r
+enum\r
+{\r
+       /*no control point*/\r
+       IPMP_CP_NONE = 0,\r
+       /*control point between DB and decoder*/\r
+       IPMP_CP_DB = 1,\r
+       /*control point between decoder and CB*/\r
+       IPMP_CP_CB = 2,\r
+       /*control point between CB and render*/\r
+       IPMP_CP_CM = 3,\r
+       /*control point in BIFS tree (???)*/\r
+       IPMP_CP_BIFS = 4,\r
+       /*the rest is reserved or forbidden(0xFF)*/\r
+};\r
+\r
+/*IPMPX base classe*/\r
+#define GF_IPMPX_BASE  \\r
+       u8 tag; \\r
+       u8 version;     \\r
+       u32 dataID;     \\r
+\r
+typedef struct \r
+{\r
+       GF_IPMPX_BASE\r
+} GF_GF_IPMPX_Base;\r
+\r
+/*IPMP descriptor*/\r
+typedef struct {\r
+       BASE_DESCRIPTOR\r
+       u8 IPMP_DescriptorID;\r
+       u16 IPMPS_Type;\r
+       /*if IPMPS_Type=0, NULL-terminated URL, else if IPMPS_Type is not IPMPX, opaque data*/\r
+       char *opaque_data;\r
+       /*if IPMPS_Type=0, irrelevant (strlen(URL)), else if IPMPS_Type is not IPMPX, opaque data size*/\r
+       u32 opaque_data_size;\r
+\r
+       /*IPMPX specific*/\r
+       u16 IPMP_DescriptorIDEx;\r
+       bin128 IPMP_ToolID;\r
+       u8 control_point;\r
+       u8 cp_sequence_code;\r
+       GF_List *ipmpx_data;\r
+} GF_IPMP_Descriptor;\r
+\r
+\r
+/*IPMPTool*/\r
+#define MAX_IPMP_ALT_TOOLS     20\r
+typedef struct\r
+{\r
+       BASE_DESCRIPTOR\r
+       bin128 IPMP_ToolID;\r
+       /*if set, this is an alternate tool*/\r
+       u32 num_alternate;\r
+       bin128 specificToolID[MAX_IPMP_ALT_TOOLS];\r
+\r
+       struct _tagIPMPXParamDesc *toolParamDesc;\r
+       char *tool_url;\r
+} GF_IPMP_Tool;\r
+\r
+\r
+/* Elementary Mask of Bifs Config - parsing only */\r
+typedef struct {\r
+       BASE_DESCRIPTOR\r
+       u32 node_id;                    // referenced nodeID\r
+       char *node_name;                // referenced node name\r
+} GF_ElementaryMask;\r
+\r
+/*BIFSConfig - parsing only, STORED IN ESD:DCD:DSI*/\r
+typedef struct __tag_bifs_config\r
+{\r
+       BASE_DESCRIPTOR\r
+       u32 version;\r
+       u16 nodeIDbits;\r
+       u16 routeIDbits;\r
+       u16 protoIDbits;\r
+       Bool pixelMetrics;\r
+       u16 pixelWidth, pixelHeight;\r
+       /*BIFS-Anim stuff*/\r
+       Bool randomAccess;\r
+       GF_List *elementaryMasks;\r
+       /*internal extensions for encoding*/\r
+       Bool useNames;\r
+} GF_BIFSConfig;\r
+\r
+/*flags for style*/\r
+enum\r
+{\r
+       GF_TXT_STYLE_NORMAL = 0,\r
+       GF_TXT_STYLE_BOLD = 1,\r
+       GF_TXT_STYLE_ITALIC = 2,\r
+       GF_TXT_STYLE_UNDERLINED = 4\r
+};\r
+\r
+typedef struct\r
+{\r
+       u16 startCharOffset;\r
+       u16 endCharOffset;\r
+       u16 fontID;\r
+       u8 style_flags;\r
+       u8 font_size;\r
+       /*ARGB*/\r
+       u32 text_color;\r
+} GF_StyleRecord;\r
+\r
+typedef struct\r
+{\r
+       u16 fontID;\r
+       char *fontName;\r
+} GF_FontRecord;\r
+\r
+typedef struct\r
+{\r
+       s16 top, left, bottom, right;\r
+} GF_BoxRecord;\r
+\r
+/*scroll flags*/\r
+enum\r
+{\r
+       GF_TXT_SCROLL_CREDITS = 0,\r
+       GF_TXT_SCROLL_MARQUEE = 1,\r
+       GF_TXT_SCROLL_DOWN = 2,\r
+       GF_TXT_SCROLL_RIGHT = 3\r
+};\r
+\r
+/* display flags*/\r
+enum\r
+{\r
+       GF_TXT_SCROLL_IN = 0x00000020,\r
+       GF_TXT_SCROLL_OUT = 0x00000040,\r
+       /*use one of the scroll flags, eg GF_TXT_SCROLL_DIRECTION | GF_TXT_SCROLL_CREDITS*/\r
+       GF_TXT_SCROLL_DIRECTION = 0x00000180,\r
+       GF_TXT_KARAOKE  = 0x00000800,\r
+       GF_TXT_VERTICAL = 0x00020000,\r
+       GF_TXT_FILL_REGION = 0x00040000,\r
+};\r
+\r
+typedef struct\r
+{\r
+       /*this is defined as a descriptor for parsing*/\r
+       BASE_DESCRIPTOR\r
+\r
+       u32 displayFlags;\r
+       /*left, top: 0 -  centered: 1 - bottom, right: -1*/\r
+       s8 horiz_justif, vert_justif;\r
+       /*ARGB*/\r
+       u32 back_color;\r
+       GF_BoxRecord default_pos;\r
+       GF_StyleRecord  default_style;\r
+\r
+       u32 font_count;\r
+       GF_FontRecord *fonts;\r
+\r
+       /*unused in isomedia but needed for streamingText*/\r
+       u8 sample_index;\r
+} GF_TextSampleDescriptor;\r
+\r
+typedef struct\r
+{\r
+       BASE_DESCRIPTOR\r
+       /*only 0x10 shall be used for 3GP text stream*/\r
+       u8 Base3GPPFormat;\r
+       /*only 0x10 shall be used for StreamingText*/\r
+       u8 MPEGExtendedFormat;\r
+       /*only 0x10 shall be used for StreamingText (base profile, base level)*/\r
+       u8 profileLevel;\r
+       u32 timescale;\r
+       /*0 forbidden, 1: out-of-band desc only, 2: in-band desc only, 3: both*/\r
+       u8 sampleDescriptionFlags;\r
+       /*More negative layer values are towards the viewer*/\r
+       s16 layer;\r
+       /*text track width & height*/\r
+       u16 text_width;\r
+       u16 text_height;\r
+       /*compatible 3GP formats, same coding as 3GPPBaseFormat*/\r
+       u8 nb_compatible_formats;\r
+       u8 compatible_formats[20];\r
+       /*defined in isomedia.h*/\r
+       GF_List *sample_descriptions;\r
+\r
+       /*if true info below are valid (cf 3GPP for their meaning)*/\r
+       Bool has_vid_info;\r
+       u16 video_width;\r
+       u16 video_height;\r
+       s16 horiz_offset;\r
+       s16 vert_offset;\r
+} GF_TextConfig;\r
+\r
+\r
+/*MuxInfo descriptor - parsing only, stored in ESD:extDescr*/\r
+typedef struct {\r
+       BASE_DESCRIPTOR\r
+       /*input location*/\r
+       char *file_name;\r
+       /*input groupID for interleaving*/\r
+       u32 GroupID;\r
+       /*input stream format (not required, guessed from file_name)*/\r
+       char *streamFormat;\r
+       /*time offset in ms from first TS (appends an edit list in mp4)*/\r
+       u32 startTime;\r
+\r
+       /*media length to import in ms (from 0)*/\r
+       u32 duration;\r
+\r
+       /*SRT/SUB import extensions - only support for text and italic style*/\r
+       char *textNode;\r
+       char *fontNode;\r
+\r
+       /*video and SUB import*/\r
+       Double frame_rate;\r
+\r
+       /*same as importer flags, cf media.h*/\r
+       u32 import_flags;\r
+\r
+       /*indicates input file shall be destryed - used during SWF import*/\r
+       Bool delete_file;\r
+} GF_MuxInfo;\r
+\r
+typedef struct\r
+{\r
+       BASE_DESCRIPTOR\r
+       /*input type*/\r
+       char *deviceName;\r
+       /*string sensor terminaison (validation) char*/\r
+       char termChar;\r
+       /*string sensor deletion char*/\r
+       char delChar;\r
+       /*device-specific data*/\r
+       char *ui_data;\r
+       u32 ui_data_length;\r
+} GF_UIConfig;\r
+\r
+/*LASERConfig - parsing only, STORED IN ESD:DCD:DSI*/\r
+typedef struct __tag_laser_config\r
+{\r
+       BASE_DESCRIPTOR\r
+       u8 profile;\r
+       u8 level;\r
+       u8 pointsCodec;\r
+       u8 pathComponents;\r
+       u8 fullRequestHost;\r
+       u16 time_resolution;\r
+       u8 colorComponentBits;\r
+       s8 resolution;\r
+       u8 coord_bits;\r
+       u8 scale_bits_minus_coord_bits;\r
+       u8 newSceneIndicator;\r
+       u8 extensionIDBits;\r
+\r
+       /*the rest of the structure is never coded, only used for the config of GPAC...*/\r
+       Bool force_string_ids;/*forces all nodes to be defined with string IDs*/\r
+} GF_LASERConfig;\r
+\r
+\r
+/***************************************\r
+                       QoS Tags\r
+***************************************/\r
+enum\r
+{\r
+       QoSMaxDelayTag = 0x01,\r
+       QoSPrefMaxDelayTag = 0x02,\r
+       QoSLossProbTag = 0x03,\r
+       QoSMaxGapLossTag = 0x04,\r
+       QoSMaxAUSizeTag = 0x41,\r
+       QoSAvgAUSizeTag = 0x42,\r
+       QoSMaxAURateTag = 0x43\r
+};\r
+\r
+/***************************************\r
+                       QoS Qualifiers\r
+***************************************/\r
+typedef struct {\r
+       BASE_DESCRIPTOR\r
+       u8 predefined;\r
+       GF_List *QoS_Qualifiers;\r
+} GF_QoS_Descriptor;\r
+\r
+\r
+#define QOS_BASE_QUALIFIER \\r
+       u8 tag; \\r
+       u32 size;\r
+\r
+typedef struct {\r
+       QOS_BASE_QUALIFIER\r
+} GF_QoS_Default;\r
+\r
+typedef struct {\r
+       QOS_BASE_QUALIFIER\r
+       u32 MaxDelay;\r
+} GF_QoS_MaxDelay;\r
+\r
+typedef struct {\r
+       QOS_BASE_QUALIFIER\r
+       u32 PrefMaxDelay;\r
+} GF_QoS_PrefMaxDelay;\r
+\r
+typedef struct {\r
+       QOS_BASE_QUALIFIER\r
+       Float LossProb;\r
+} GF_QoS_LossProb;\r
+\r
+typedef struct {\r
+       QOS_BASE_QUALIFIER\r
+       u32 MaxGapLoss;\r
+} GF_QoS_MaxGapLoss;\r
+\r
+typedef struct {\r
+       QOS_BASE_QUALIFIER\r
+       u32 MaxAUSize;\r
+} GF_QoS_MaxAUSize;\r
+\r
+typedef struct {\r
+       QOS_BASE_QUALIFIER\r
+       u32 AvgAUSize;\r
+} GF_QoS_AvgAUSize;\r
+\r
+typedef struct {\r
+       QOS_BASE_QUALIFIER\r
+       u32 MaxAURate;\r
+} GF_QoS_MaxAURate;\r
+\r
+typedef struct {\r
+       QOS_BASE_QUALIFIER\r
+       u32 DataLength;         /*max size class : 2^28 - 1*/\r
+       char *Data;\r
+} GF_QoS_Private;\r
+\r
+\r
+/*Registration Descriptor*/\r
+typedef struct {\r
+       BASE_DESCRIPTOR\r
+       u32 formatIdentifier;\r
+       u32 dataLength;\r
+       char *additionalIdentificationInfo;\r
+} GF_Registration;\r
+\r
+/*Language Descriptor*/\r
+typedef struct {\r
+       BASE_DESCRIPTOR\r
+       u32 langCode;\r
+} GF_Language;\r
+\r
+/*Elementary Stream Descriptor*/\r
+typedef struct\r
+{\r
+       BASE_DESCRIPTOR\r
+       u16 ESID;\r
+       u16 OCRESID;\r
+       u16 dependsOnESID;\r
+       u8 streamPriority;\r
+       char *URLString;\r
+       GF_DecoderConfig *decoderConfig;\r
+       GF_SLConfig *slConfig;\r
+       GF_IPIPtr *ipiPtr;\r
+       GF_QoS_Descriptor *qos;\r
+       GF_Registration *RegDescriptor;\r
+       /*0 or 1 lang desc*/\r
+       GF_Language *langDesc;\r
+       \r
+       GF_List *IPIDataSet;\r
+       GF_List *IPMPDescriptorPointers;\r
+       GF_List *extensionDescriptors;\r
+\r
+} GF_ESD;\r
+\r
+\r
+/*Auxiliary Video Data Descriptor*/\r
+typedef struct {\r
+       BASE_DESCRIPTOR\r
+       u32 aux_video_type;\r
+       u32 position_offset_h;\r
+       u32 position_offset_v;\r
+       u32 knear;\r
+       u32 kfar;\r
+       u32 parallax_zero;\r
+       u32 parallax_scale;\r
+       u32 dref;\r
+       u32 wref;\r
+} GF_AuxVideoDescriptor;\r
+\r
+/*Content Classification Descriptor*/\r
+typedef struct {\r
+       BASE_DESCRIPTOR\r
+       u32 classificationEntity;\r
+       u16 classificationTable;\r
+       u32 dataLength;\r
+       char *contentClassificationData;\r
+} GF_CCDescriptor;\r
+\r
+\r
+/*this structure is used in GF_KeyWord*/\r
+typedef struct {\r
+       char *keyWord;\r
+} GF_KeyWordItem;\r
+\r
+/*Key Word Descriptor*/\r
+typedef struct {\r
+       BASE_DESCRIPTOR\r
+       u32 languageCode;\r
+       u8 isUTF8;\r
+       GF_List *keyWordsList;\r
+} GF_KeyWord;\r
+\r
+/*Rating Descriptor*/\r
+typedef struct {\r
+       BASE_DESCRIPTOR\r
+       u32 ratingEntity;\r
+       u16 ratingCriteria;\r
+       u32 infoLength;\r
+       char *ratingInfo;\r
+} GF_Rating;\r
+\r
+\r
+/*Short Textual Descriptor*/\r
+typedef struct {\r
+       BASE_DESCRIPTOR\r
+       u32 langCode;\r
+       u8 isUTF8;\r
+       char *eventName;\r
+       char *eventText;\r
+} GF_ShortTextual;\r
+\r
+\r
+/*this structure is used in GF_ExpandedTextual*/\r
+typedef struct {\r
+       char *text;\r
+} GF_ETD_ItemText;\r
+\r
+/*Expanded Textual Descriptor*/\r
+typedef struct {\r
+       BASE_DESCRIPTOR\r
+       u32 langCode;\r
+       u8 isUTF8;\r
+       GF_List *itemDescriptionList;\r
+       GF_List *itemTextList;\r
+       char *NonItemText;\r
+} GF_ExpandedTextual;\r
+\r
+/*this structure is used in GF_CC_Name*/\r
+typedef struct {\r
+       u32 langCode;\r
+       u8 isUTF8;\r
+       char *contentCreatorName;\r
+} GF_ContentCreatorInfo;\r
+\r
+/*Content Creator Name GF_Descriptor\r
+NOTE: the desctructor will delete all the items in the list\r
+(GF_ContentCreatorInfo items) */\r
+typedef struct {\r
+       BASE_DESCRIPTOR\r
+       GF_List *ContentCreators;\r
+} GF_CC_Name;\r
+\r
+/*Content Creation Date Descriptor*/\r
+typedef struct {\r
+       BASE_DESCRIPTOR\r
+       char contentCreationDate[5];\r
+} GF_CC_Date;\r
+\r
+\r
+/*this structure is used in GF_OCICreators*/\r
+typedef struct {\r
+       u32 langCode;\r
+       u8 isUTF8;\r
+       char *OCICreatorName;\r
+} GF_OCICreator_item;\r
+\r
+/*OCI Creator Name Descriptor*/\r
+typedef struct {\r
+       BASE_DESCRIPTOR\r
+       GF_List *OCICreators;\r
+} GF_OCICreators;\r
+\r
+/*OCI Creation Date Descriptor*/\r
+typedef struct {\r
+       BASE_DESCRIPTOR\r
+       char OCICreationDate[5];\r
+} GF_OCI_Data;\r
+\r
+\r
+/*this structure is used in GF_SMPTECamera*/\r
+typedef struct {\r
+       u8 paramID;\r
+       u32 param;\r
+} GF_SmpteParam;\r
+\r
+/*Smpte Camera Position Descriptor*/\r
+typedef struct {\r
+       BASE_DESCRIPTOR\r
+       u8 cameraID;\r
+       GF_List *ParamList;\r
+} GF_SMPTECamera;\r
+\r
+\r
+/*Extension Profile Level Descriptor*/\r
+typedef struct {\r
+       BASE_DESCRIPTOR\r
+       u8 profileLevelIndicationIndex;\r
+       u8 ODProfileLevelIndication;\r
+       u8 SceneProfileLevelIndication;\r
+       u8 AudioProfileLevelIndication;\r
+       u8 VisualProfileLevelIndication;\r
+       u8 GraphicsProfileLevelIndication;\r
+       u8 MPEGJProfileLevelIndication;\r
+} GF_PLExt;\r
+\r
+/*Profile Level Indication Index Descriptor*/\r
+typedef struct {\r
+       BASE_DESCRIPTOR\r
+       u8 profileLevelIndicationIndex;\r
+} GF_PL_IDX;\r
+\r
+\r
+/*AVC config descriptor - not a real MPEG-4 descriptor */\r
+/*used for sequenceParameterSetNALUnit and pictureParameterSetNALUnit*/\r
+typedef struct\r
+{\r
+       u16 size;\r
+       char *data;\r
+} GF_AVCConfigSlot;\r
+\r
+typedef struct \r
+{\r
+       u8 configurationVersion;\r
+       u8 AVCProfileIndication;\r
+       u8 profile_compatibility;\r
+       u8 AVCLevelIndication; \r
+       u8 nal_unit_size;\r
+       \r
+       GF_List *sequenceParameterSets;\r
+       GF_List *pictureParameterSets;\r
+} GF_AVCConfig;\r
+\r
+\r
+/************************************************************\r
+                               Media Control Extensions\r
+************************************************************/\r
+typedef struct\r
+{\r
+       BASE_DESCRIPTOR\r
+       Double startTime;\r
+       Double Duration;\r
+       char *SegmentName;\r
+} GF_Segment;\r
+\r
+typedef struct\r
+{\r
+       BASE_DESCRIPTOR\r
+       Double mediaTimeStamp;\r
+} GF_MediaTime;\r
+\r
+\r
+/****************************************************************************\r
+\r
+                       MPEG-4 SYSTEM - OBJECT DESCRIPTORS COMMANDS DECLARATION\r
+\r
+****************************************************************************/\r
+\r
+\r
+/***************************************\r
+                       Commands Tags\r
+***************************************/\r
+enum\r
+{\r
+       GF_ODF_OD_UPDATE_TAG                                    = 0x01,\r
+       GF_ODF_OD_REMOVE_TAG                                    = 0x02,\r
+       GF_ODF_ESD_UPDATE_TAG                                   = 0x03,\r
+       GF_ODF_ESD_REMOVE_TAG                                   = 0x04,\r
+       GF_ODF_IPMP_UPDATE_TAG                                  = 0x05,\r
+       GF_ODF_IPMP_REMOVE_TAG                                  = 0x06,\r
+\r
+       /*file format reserved*/\r
+       GF_ODF_ESD_REMOVE_REF_TAG                               = 0x07,\r
+\r
+       GF_ODF_COM_ISO_BEGIN_TAG                = 0x0D,\r
+       GF_ODF_COM_ISO_END_TAG          = 0xBF,\r
+       \r
+       GF_ODF_COM_USER_BEGIN_TAG       = 0xC0,\r
+       GF_ODF_COM_USER_END_TAG         = 0xFE\r
+};\r
+\r
+/***************************************\r
+                       OD commands\r
+***************************************/\r
+#define BASE_OD_COMMAND \\r
+       u8 tag;\r
+\r
+/*the (abstract) base command. */\r
+typedef struct {\r
+       BASE_OD_COMMAND\r
+} GF_ODCom;\r
+\r
+/*the default bcommand*/\r
+typedef struct {\r
+       BASE_OD_COMMAND\r
+       u32 dataSize;\r
+       char *data;\r
+} GF_BaseODCom;\r
+\r
+/*Object Descriptor Update\r
+NB: the list can contain OD or IOD, except internally in the File Format (only MP4_OD)*/\r
+typedef struct\r
+{\r
+       BASE_OD_COMMAND\r
+       GF_List *objectDescriptors;\r
+} GF_ODUpdate;\r
+\r
+/*Object Descriptor Remove*/\r
+typedef struct\r
+{\r
+       BASE_OD_COMMAND\r
+       u32 NbODs;\r
+       u16 *OD_ID;\r
+} GF_ODRemove;\r
+\r
+/*Elementary Stream Descriptor Update*/\r
+typedef struct\r
+{\r
+       BASE_OD_COMMAND\r
+       u16 ODID;\r
+       GF_List *ESDescriptors;\r
+} GF_ESDUpdate;\r
+\r
+/*Elementary Stream Descriptor Remove*/\r
+typedef struct {\r
+       BASE_OD_COMMAND\r
+       u16 ODID;\r
+       u32 NbESDs;\r
+       u16 *ES_ID;\r
+} GF_ESDRemove;\r
+\r
+/*IPMP Descriptor Update*/\r
+typedef struct {\r
+       BASE_OD_COMMAND\r
+       GF_List *IPMPDescList;\r
+} GF_IPMPUpdate;\r
+\r
+/*IPMP Descriptor Remove*/\r
+typedef struct {\r
+       BASE_OD_COMMAND\r
+       u32 NbIPMPDs;\r
+       /*now this is bad: only IPMPv1 descriptors can be removed at run tim...*/\r
+       u8 *IPMPDescID;\r
+} GF_IPMPRemove;\r
+\r
+\r
+\r
+\r
+\r
+\r
+/********************************************************************\r
+       OD Exports\r
+********************************************************************/\r
+\r
+/*OD CODEC object - just a simple reader/writer*/\r
+typedef struct tagODCoDec\r
+{\r
+       GF_BitStream *bs;\r
+       GF_List *CommandList;\r
+} GF_ODCodec;\r
+\r
+/*construction / destruction*/\r
+GF_ODCodec *gf_odf_codec_new();\r
+void gf_odf_codec_del(GF_ODCodec *codec);\r
+/* add a command to the codec command list. */\r
+GF_Err gf_odf_codec_add_com(GF_ODCodec *codec, GF_ODCom *command);\r
+/*encode the current coimmand list - once called the commands are destroyed*/\r
+GF_Err gf_odf_codec_encode(GF_ODCodec *codec, Bool delete_content);\r
+/*get the encoded AU. user is responsible of allocated space*/\r
+GF_Err gf_odf_codec_get_au(GF_ODCodec *codec, char **outAU, u32 *au_length);\r
+/* set the encoded AU to the codec*/\r
+GF_Err gf_odf_codec_set_au(GF_ODCodec *codec, char *au, u32 au_length);\r
+/*decode the previously set-up AU*/\r
+GF_Err gf_odf_codec_decode(GF_ODCodec *codec);\r
+/*get the first OD command in the list. Once called, the command is removed \r
+from the command list. Return NULL when commandList is empty*/\r
+GF_ODCom *gf_odf_codec_get_com(GF_ODCodec *codec);\r
+\r
+/*apply a command to the codec command list. Command is duplicated if needed\r
+This is used for state maintenance and RAP generation.*/\r
+GF_Err gf_odf_codec_apply_com(GF_ODCodec *codec, GF_ODCom *command);\r
+\r
+/************************************************************\r
+               GF_ODCom Functions\r
+************************************************************/\r
+\r
+/*Commands Creation / Destruction*/\r
+GF_ODCom *gf_odf_com_new(u8 tag);\r
+GF_Err gf_odf_com_del(GF_ODCom **com);\r
+\r
+\r
+/************************************************************\r
+               Descriptors Functions\r
+************************************************************/\r
+\r
+/*Descriptors Creation / Destruction*/\r
+GF_Descriptor *gf_odf_desc_new(u8 tag);\r
+void gf_odf_desc_del(GF_Descriptor *desc);\r
+\r
+/*use this function to decode a standalone descriptor\r
+the raw descriptor MUST be formatted with tag and size field!!!\r
+a new desc is created and you must delete it when done*/\r
+GF_Err gf_odf_desc_read(char *raw_desc, u32 descSize, GF_Descriptor * *outDesc);\r
+\r
+/*use this function to encode a standalone descriptor\r
+the desc will be formatted with tag and size field\r
+the output buffer is allocated and you must delete it when done*/\r
+GF_Err gf_odf_desc_write(GF_Descriptor *desc, char **outEncDesc, u32 *outSize);\r
+\r
+/*use this function to get the size of a standalone descriptor (including tag and size fields)\r
+return 0 if error*/\r
+u32 gf_odf_desc_size(GF_Descriptor *desc);\r
+\r
+/*this is usefull to duplicate on the fly a descriptor*/\r
+GF_Err gf_odf_desc_copy(GF_Descriptor *inDesc, GF_Descriptor **outDesc);\r
+\r
+\r
+/*This functions handles internally what desc can be added to another desc\r
+and adds it. NO DUPLICATION of the descriptor, so\r
+once a desc is added to its parent, destroying the parent WILL DESTROY \r
+this descriptor*/\r
+GF_Err gf_odf_desc_add_desc(GF_Descriptor *parentDesc, GF_Descriptor *newDesc);\r
+\r
+\r
+/*this is a helper for building a preformatted GF_ESD with decoderConfig, decoderSpecificInfo with no data and \r
+SLConfig descriptor with predefined*/\r
+GF_ESD *gf_odf_desc_esd_new(u32 sl_predefined);\r
+\r
+\r
+/*Since IPMP V2, we introduce a new set of functions to read / write a list of descriptors\r
+that have no containers (a bit like an OD command, but for descriptors)\r
+This is usefull for IPMPv2 DecoderSpecificInfo which contains a set of IPMP_Declarators\r
+As it could be used for other purposes we keep it generic\r
+you must create the list yourself, the functions just encode/decode from/to the list*/\r
+\r
+/*uncompress an encoded list of descriptors. You must pass an empty GF_List structure\r
+to know exactly what was in the buffer*/\r
+GF_Err gf_odf_desc_list_read(char *raw_list, u32 raw_size, GF_List *descList);\r
+/*compress all descriptors in the list into a single buffer. The buffer is allocated\r
+by the lib and must be destroyed by your app\r
+you must pass (outEncList != NULL  && *outEncList == NULL)*/\r
+GF_Err gf_odf_desc_list_write(GF_List *descList, char **outEncList, u32 *outSize);\r
+/*returns size of encoded desc list*/\r
+GF_Err gf_odf_desc_list_size(GF_List *descList, u32 *outSize);\r
+/*destroy the descriptors in a list but not the list*/\r
+GF_Err gf_odf_desc_list_del(GF_List *descList);\r
+\r
+/*retuns NULL if unknown, otherwise value*/\r
+const char *gf_odf_stream_type_name(u32 streamType);\r
+u32 gf_odf_stream_type_by_name(const char *streamType);\r
+\r
+/*special function for authoring - convert DSI to BIFSConfig*/\r
+GF_BIFSConfig *gf_odf_get_bifs_config(GF_DefaultDescriptor *dsi, u8 oti);\r
+/*special function for authoring - convert DSI to LASERConfig*/\r
+GF_Err gf_odf_get_laser_config(GF_DefaultDescriptor *dsi, GF_LASERConfig *cfg);\r
+/*sepcial function for authoring - convert DSI to TextConfig*/\r
+GF_Err gf_odf_get_text_config(GF_DefaultDescriptor *dsi, u8 oti, GF_TextConfig *cfg);\r
+/*special function for authoring - convert DSI to UIConfig*/\r
+GF_Err gf_odf_get_ui_config(GF_DefaultDescriptor *dsi, GF_UIConfig *cfg);\r
+/*converts UIConfig to dsi - does not destroy input descr but does create output one*/\r
+GF_Err gf_odf_encode_ui_config(GF_UIConfig *cfg, GF_DefaultDescriptor **out_dsi);\r
+\r
+/*simple constructor/destructor*/\r
+GF_AVCConfig *gf_odf_avc_cfg_new();\r
+void gf_odf_avc_cfg_del(GF_AVCConfig *cfg);\r
+/*gets GF_AVCConfig from MPEG-4 DSI*/\r
+GF_AVCConfig *gf_odf_avc_cfg_read(char *dsi, u32 dsi_size);\r
+/*writes GF_AVCConfig as MPEG-4 DSI*/\r
+GF_Err gf_odf_avc_cfg_write(GF_AVCConfig *cfg, char **outData, u32 *outSize);\r
+\r
+\r
+\r
+/************************************************************\r
+               QoS Qualifiers Functions\r
+************************************************************/\r
+\r
+/*QoS Qualifiers Creation / Destruction*/\r
+GF_QoS_Default *gf_odf_qos_new(u8 tag);\r
+GF_Err gf_odf_qos_del(GF_QoS_Default **qos);\r
+\r
+/*READ/WRITE functions: QoS qualifiers are special descriptors but follow the same rules as descriptors.\r
+therefore, use gf_odf_desc_read and gf_odf_desc_write for QoS*/\r
+\r
+/*same function, but for QoS, as a Qualifier IS NOT a descriptor*/\r
+GF_Err gf_odf_qos_add_qualif(GF_QoS_Descriptor *desc, GF_QoS_Default *qualif);\r
+\r
+\r
+\r
+/*\r
+       OCI Stream AU is a list of OCI event (like OD AU is a list of OD commands)\r
+*/\r
+\r
+typedef struct __tag_oci_event OCIEvent;\r
+\r
+OCIEvent *gf_oci_event_new(u16 EventID);\r
+void gf_oci_event_del(OCIEvent *event);\r
+\r
+GF_Err gf_oci_event_set_start_time(OCIEvent *event, u8 Hours, u8 Minutes, u8 Seconds, u8 HundredSeconds, u8 IsAbsoluteTime);\r
+GF_Err gf_oci_event_set_duration(OCIEvent *event, u8 Hours, u8 Minutes, u8 Seconds, u8 HundredSeconds);\r
+GF_Err gf_oci_event_add_desc(OCIEvent *event, GF_Descriptor *oci_desc);\r
+\r
+GF_Err gf_oci_event_get_id(OCIEvent *event, u16 *ID);\r
+GF_Err gf_oci_event_get_start_time(OCIEvent *event, u8 *Hours, u8 *Minutes, u8 *Seconds, u8 *HundredSeconds, u8 *IsAbsoluteTime);\r
+GF_Err gf_oci_event_get_duration(OCIEvent *event, u8 *Hours, u8 *Minutes, u8 *Seconds, u8 *HundredSeconds);\r
+u32 gf_oci_event_get_desc_count(OCIEvent *event);\r
+GF_Descriptor *gf_oci_event_get_desc(OCIEvent *event, u32 DescIndex);\r
+GF_Err gf_oci_event_rem_desc(OCIEvent *event, u32 DescIndex);\r
+\r
+\r
+\r
+typedef struct __tag_oci_codec OCICodec;\r
+\r
+/*construction / destruction\r
+IsEncoder specifies an OCI Event encoder\r
+version is for future extensions, and only 0x01 is valid for now*/\r
+OCICodec *gf_oci_codec_new(u8 IsEncoder, u8 Version);\r
+void gf_oci_codec_del(OCICodec *codec);\r
+\r
+/*                             ENCODER FUNCTIONS\r
+add a command to the codec event list. \r
+The event WILL BE DESTROYED BY THE CODEC after encoding*/\r
+GF_Err gf_oci_codec_add_event(OCICodec *codec, OCIEvent *event);\r
+\r
+/*encode AU. The memory allocation is done in place\r
+WARNING: once this function called, the codec event List is empty \r
+and events destroyed\r
+you must set *outAU = NULL*/\r
+GF_Err gf_oci_codec_encode(OCICodec *codec, char **outAU, u32 *au_length);\r
+\r
+\r
+\r
+/*Decoder: decode the previously set-up AU\r
+the input buffer is cleared once decoded*/\r
+GF_Err gf_oci_codec_decode(OCICodec *codec, char *au, u32 au_length);\r
+\r
+/*get the first OCI Event in the list. Once called, the event is removed \r
+from the event list. Return NULL when the event List is empty\r
+you MUST delete events */\r
+OCIEvent *gf_oci_codec_get_event(OCICodec *codec);\r
+\r
+\r
+/*OD dump tools*/\r
+GF_Err gf_odf_dump_au(char *data, u32 dataLength, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_com(void *p, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_desc(void *ptr, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_com_list(GF_List *commandList, FILE *trace, u32 indent, Bool XMTDump);\r
+\r
+/*OCI dump tools*/\r
+GF_Err gf_oci_dump_event(OCIEvent *ev, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_oci_dump_au(u8 version, char *au, u32 au_length, FILE *trace, u32 indent, Bool XMTDump);\r
+\r
+\r
+/*OD parsing tools (XMT/BT)*/\r
+/*returns desc tag based on name*/\r
+u32 gf_odf_get_tag_by_name(char *descName);\r
+/*field type for OD/QoS/IPMPX/etc*/\r
+enum\r
+{\r
+       /*regular type*/\r
+       GF_ODF_FT_DEFAULT = 0,\r
+       /*single descriptor type*/\r
+       GF_ODF_FT_OD = 1,\r
+       /*descriptor list type*/\r
+       GF_ODF_FT_OD_LIST = 2,\r
+       /*IPMP Data type*/\r
+       GF_ODF_FT_IPMPX = 3,\r
+       /*IPMP Data list type*/\r
+       GF_ODF_FT_IPMPX_LIST = 4,\r
+       /*IPMP ByteArray type*/\r
+       GF_ODF_FT_IPMPX_BA = 5,\r
+       /*IPMP ByteArray list type*/\r
+       GF_ODF_FT_IPMPX_BA_LIST = 6,\r
+};\r
+u32 gf_odf_get_field_type(GF_Descriptor *desc, char *fieldName);\r
+/*set non-descriptor field value - value string shall be presented without ' or " characters*/\r
+GF_Err gf_odf_set_field(GF_Descriptor *desc, char *fieldName, char *val);\r
+\r
+\r
+\r
+\r
+/*\r
+       IPMPX extensions - IPMP Data only (messages are not supported yet)\r
+*/\r
+\r
+typedef struct\r
+{\r
+       u32 length;\r
+       char *data;\r
+} GF_IPMPX_ByteArray;\r
+\r
+/*IPMPX authentication descriptors*/\r
+#define GF_IPMPX_AUTH_DESC     \\r
+       u8 tag; \\r
+\r
+typedef struct\r
+{\r
+       GF_IPMPX_AUTH_DESC\r
+} GF_IPMPX_Authentication;\r
+\r
+enum\r
+{\r
+       GF_IPMPX_AUTH_Forbidden_Tag = 0x00,\r
+       GF_IPMPX_AUTH_AlgorithmDescr_Tag = 0x01,\r
+       GF_IPMPX_AUTH_KeyDescr_Tag = 0x02,\r
+};\r
+\r
+typedef struct\r
+{\r
+       GF_IPMPX_AUTH_DESC\r
+       char *keyBody;\r
+       u32 keyBodyLength;\r
+} GF_IPMPX_AUTH_KeyDescriptor;\r
+\r
+typedef struct\r
+{\r
+       GF_IPMPX_AUTH_DESC\r
+       /*used if no specAlgoID*/\r
+       u16 regAlgoID;\r
+       GF_IPMPX_ByteArray *specAlgoID;\r
+       GF_IPMPX_ByteArray *OpaqueData;\r
+} GF_IPMPX_AUTH_AlgorithmDescriptor;\r
+\r
+\r
+/*IPMP data messages*/\r
+enum \r
+{\r
+       GF_IPMPX_OPAQUE_DATA_TAG = 0x01,\r
+       GF_IPMPX_AUDIO_WM_INIT_TAG = 0x02,\r
+       GF_IPMPX_VIDEO_WM_INIT_TAG = 0x03,\r
+       GF_IPMPX_SEL_DEC_INIT_TAG = 0x04,\r
+       GF_IPMPX_KEY_DATA_TAG = 0x05,\r
+       GF_IPMPX_AUDIO_WM_SEND_TAG = 0x06,\r
+       GF_IPMPX_VIDEO_WM_SEND_TAG = 0x07,\r
+       GF_IPMPX_RIGHTS_DATA_TAG = 0x08,\r
+       GF_IPMPX_SECURE_CONTAINER_TAG = 0x09,\r
+       GF_IPMPX_ADD_TOOL_LISTENER_TAG = 0x0A,\r
+       GF_IPMPX_REMOVE_TOOL_LISTENER_TAG = 0x0B,\r
+       GF_IPMPX_INIT_AUTHENTICATION_TAG = 0x0C,\r
+       GF_IPMPX_MUTUAL_AUTHENTICATION_TAG = 0x0D,\r
+       GF_IPMPX_USER_QUERY_TAG = 0x0E,\r
+       GF_IPMPX_USER_RESPONSE_TAG = 0x0F,\r
+       GF_IPMPX_PARAMETRIC_DESCRIPTION_TAG = 0x10,\r
+       GF_IPMPX_PARAMETRIC_CAPS_QUERY_TAG = 0x11,\r
+       GF_IPMPX_PARAMETRIC_CAPS_RESPONSE_TAG = 0x12,\r
+       /*NO ASSOCIATED STRUCTURE*/\r
+       GF_IPMPX_GET_TOOLS_TAG = 0x13,\r
+       GF_IPMPX_GET_TOOLS_RESPONSE_TAG = 0x14,\r
+       GF_IPMPX_GET_TOOL_CONTEXT_TAG = 0x15,\r
+       GF_IPMPX_GET_TOOL_CONTEXT_RESPONSE_TAG = 0x16,\r
+       GF_IPMPX_CONNECT_TOOL_TAG = 0x17,\r
+       GF_IPMPX_DISCONNECT_TOOL_TAG = 0x18,\r
+       GF_IPMPX_NOTIFY_TOOL_EVENT_TAG = 0x19,\r
+       GF_IPMPX_CAN_PROCESS_TAG = 0x1A,\r
+       GF_IPMPX_TRUST_SECURITY_METADATA_TAG = 0x1B,\r
+       GF_IPMPX_TOOL_API_CONFIG_TAG = 0x1C,\r
+\r
+       /*ISMA*/\r
+       GF_IPMPX_ISMACRYP_TAG = 0xD0, \r
+\r
+       /*intern ones for parsing (not real datas)*/\r
+       GF_IPMPX_TRUSTED_TOOL_TAG = 0xA1,\r
+       GF_IPMPX_TRUST_SPECIFICATION_TAG = 0xA2,\r
+       /*emulate algo descriptors as base IPMP classes for parsing...*/\r
+       GF_IPMPX_ALGORITHM_DESCRIPTOR_TAG = 0xA3,\r
+       GF_IPMPX_KEY_DESCRIPTOR_TAG = 0xA4,\r
+       GF_IPMPX_PARAM_DESCRIPTOR_ITEM_TAG = 0xA5,\r
+       GF_IPMPX_SEL_ENC_BUFFER_TAG = 0xA6,\r
+       GF_IPMPX_SEL_ENC_FIELD_TAG = 0xA7,\r
+};\r
+\r
+typedef char GF_IPMPX_Date[5];\r
+\r
+\r
+#define GF_IPMPX_DATA_BASE     \\r
+       u8 tag; \\r
+       u8 Version;     \\r
+       u8 dataID;      \\r
+\r
+typedef struct\r
+{\r
+       GF_IPMPX_DATA_BASE\r
+} GF_IPMPX_Data;\r
+\r
+typedef struct\r
+{\r
+       GF_IPMPX_DATA_BASE\r
+       u32 Context;\r
+       u8 AuthType;\r
+} GF_IPMPX_InitAuthentication;\r
+\r
+/*NOT a real DATA, only used as data for parsing*/\r
+typedef struct\r
+{\r
+       GF_IPMPX_DATA_BASE\r
+       GF_IPMPX_Date startDate;\r
+       u8 attackerProfile;\r
+       u32 trustedDuration;\r
+       GF_IPMPX_ByteArray      *CCTrustMetadata;\r
+} GF_IPMPX_TrustSpecification;\r
+\r
+/*NOT a real DATA, only used as data for parsing*/\r
+typedef struct\r
+{\r
+       GF_IPMPX_DATA_BASE\r
+       bin128 toolID;  \r
+       GF_IPMPX_Date AuditDate;\r
+       GF_List *trustSpecifications;\r
+} GF_IPMPX_TrustedTool;\r
+\r
+typedef struct _ipmpx_TrustSecurityMetadata\r
+{\r
+       GF_IPMPX_DATA_BASE\r
+       GF_List *TrustedTools;\r
+} GF_IPMPX_TrustSecurityMetadata;\r
+\r
+\r
+typedef struct\r
+{\r
+       GF_IPMPX_DATA_BASE\r
+       Bool failedNegotiation;\r
+\r
+       GF_List *candidateAlgorithms;\r
+       GF_List *agreedAlgorithms;\r
+       GF_IPMPX_ByteArray *AuthenticationData;\r
+\r
+       /*inclAuthCodes will be set if any of the members is set (cf spec...)*/\r
+       u32 certType;\r
+       /*GF_IPMPX_ByteArray list*/\r
+       GF_List *certificates;\r
+       GF_IPMPX_AUTH_KeyDescriptor *publicKey;\r
+       GF_IPMPX_ByteArray *opaque;\r
+       GF_IPMPX_TrustSecurityMetadata *trustData;\r
+       GF_IPMPX_ByteArray *authCodes;\r
+} GF_IPMPX_MutualAuthentication;\r
+\r
+typedef struct\r
+{\r
+       GF_IPMPX_DATA_BASE\r
+       /*if set MAC is part of the encrypted data*/\r
+       Bool isMACEncrypted;\r
+\r
+       GF_IPMPX_ByteArray *encryptedData;\r
+       GF_IPMPX_Data *protectedMsg;\r
+       GF_IPMPX_ByteArray *MAC;\r
+} GF_IPMPX_SecureContainer;\r
+\r
+typedef struct\r
+{\r
+       GF_List *ipmp_tools;\r
+} GF_IPMPX_GetToolsResponse;\r
+\r
+typedef struct\r
+{\r
+       GF_IPMPX_DATA_BASE\r
+       GF_IPMPX_ByteArray      *main_class;\r
+       GF_IPMPX_ByteArray      *subClass;\r
+       GF_IPMPX_ByteArray      *typeData;\r
+       GF_IPMPX_ByteArray      *type;\r
+       GF_IPMPX_ByteArray      *addedData;\r
+} GF_IPMPX_ParametricDescriptionItem;\r
+\r
+typedef struct _tagIPMPXParamDesc\r
+{\r
+       GF_IPMPX_DATA_BASE\r
+       GF_IPMPX_ByteArray *descriptionComment;\r
+       u8 majorVersion;\r
+       u8 minorVersion;\r
+       /*list of GF_IPMPX_ParametricDescriptionItem*/\r
+       GF_List *descriptions;\r
+} GF_IPMPX_ParametricDescription;\r
+\r
+typedef struct\r
+{\r
+       GF_IPMPX_DATA_BASE\r
+       GF_IPMPX_ParametricDescription *description;\r
+} GF_IPMPX_ToolParamCapabilitiesQuery;\r
+\r
+typedef struct\r
+{\r
+       GF_IPMPX_DATA_BASE\r
+       Bool capabilitiesSupported;\r
+} GF_IPMPX_ToolParamCapabilitiesResponse;\r
+\r
+\r
+typedef struct\r
+{\r
+       GF_IPMPX_DATA_BASE\r
+       GF_IPMP_Descriptor *toolDescriptor;\r
+} GF_IPMPX_ConnectTool;\r
+\r
+typedef struct\r
+{\r
+       GF_IPMPX_DATA_BASE\r
+       u32 IPMP_ToolContextID;\r
+} GF_IPMPX_DisconnectTool;\r
+\r
+\r
+typedef struct\r
+{\r
+       GF_IPMPX_DATA_BASE\r
+    u8 scope;\r
+       u16 IPMP_DescriptorIDEx;\r
+} GF_IPMPX_GetToolContext;\r
+\r
+\r
+typedef struct\r
+{\r
+       GF_IPMPX_DATA_BASE\r
+    u16 OD_ID;\r
+       u16 ESD_ID;\r
+    u32 IPMP_ToolContextID;\r
+} GF_IPMPX_GetToolContextResponse;\r
+\r
+/*GF_IPMPX_LISTEN_Types*/\r
+enum\r
+{\r
+       GF_IPMPX_LISTEN_CONNECTED = 0x00,\r
+       GF_IPMPX_LISTEN_CONNECTIONFAILED = 0x01,\r
+       GF_IPMPX_LISTEN_DISCONNECTED = 0x02,\r
+       GF_IPMPX_LISTEN_DISCONNECTIONFAILED = 0x03,\r
+       GF_IPMPX_LISTEN_WATERMARKDETECTED = 0x04,\r
+};\r
+\r
+typedef struct\r
+{\r
+       GF_IPMPX_DATA_BASE\r
+       u8 scope;\r
+       /*events to listen to*/\r
+       u8 eventTypeCount;\r
+       u8 eventType[10];\r
+} GF_IPMPX_AddToolNotificationListener;\r
+\r
+typedef struct\r
+{\r
+       GF_IPMPX_DATA_BASE\r
+       u8 eventTypeCount;\r
+       u8 eventType[10];\r
+} GF_IPMPX_RemoveToolNotificationListener;\r
+\r
+typedef struct\r
+{\r
+       GF_IPMPX_DATA_BASE\r
+       u16 OD_ID;\r
+       u16 ESD_ID;\r
+       u8 eventType;\r
+       u32 IPMP_ToolContextID;\r
+} GF_IPMPX_NotifyToolEvent;\r
+\r
+typedef struct\r
+{\r
+       GF_IPMPX_DATA_BASE\r
+       Bool canProcess;\r
+} GF_IPMPX_CanProcess;\r
+\r
+typedef struct\r
+{\r
+       GF_IPMPX_DATA_BASE\r
+       GF_IPMPX_ByteArray *opaqueData;\r
+} GF_IPMPX_OpaqueData;\r
+\r
+\r
+typedef struct\r
+{\r
+       GF_IPMPX_DATA_BASE\r
+       GF_IPMPX_ByteArray *keyBody;\r
+       /*flags meaning\r
+       hasStartDTS = 1;\r
+       hasStartPacketID = 1<<1;\r
+       hasExpireDTS = 1<<2;\r
+       hasExpirePacketID = 1<<3\r
+       */\r
+       u32 flags;\r
+\r
+       u64 startDTS;\r
+       u32 startPacketID;\r
+       u64 expireDTS;\r
+       u32 expirePacketID;\r
+       GF_IPMPX_ByteArray *OpaqueData;\r
+} GF_IPMPX_KeyData;\r
+\r
+typedef struct\r
+{\r
+       GF_IPMPX_DATA_BASE\r
+       GF_IPMPX_ByteArray *rightsInfo; \r
+} GF_IPMPX_RightsData;\r
+\r
+\r
+/*not a real GF_IPMPX_Data in spec, but emulated as if for parsing*/\r
+typedef struct\r
+{\r
+       GF_IPMPX_DATA_BASE\r
+       bin128 cipher_Id; \r
+       u8 syncBoundary;\r
+       /*block mode if stream cypher info is NULL*/\r
+       u8 mode;  \r
+       u16 blockSize;\r
+       u16 keySize;\r
+       GF_IPMPX_ByteArray *Stream_Cipher_Specific_Init_Info; \r
+} GF_IPMPX_SelEncBuffer;\r
+\r
+/*not a real GF_IPMPX_Data in spec, but emulated as if for parsing*/\r
+typedef struct\r
+{\r
+       GF_IPMPX_DATA_BASE\r
+       u8 field_Id; \r
+       u8 field_Scope;\r
+       u8 buf; \r
+\r
+       u16 mappingTableSize;\r
+       u16 *mappingTable;\r
+       GF_IPMPX_ByteArray *shuffleSpecificInfo;\r
+} GF_IPMPX_SelEncField;\r
+\r
+\r
+/*mediaTypeExtension*/\r
+enum\r
+{\r
+       GF_IPMPX_SE_MT_ISO_IEC = 0x00,\r
+       GF_IPMPX_SE_MT_ITU = 0x01\r
+       /*the rest is reserved or forbidden*/\r
+};\r
+\r
+/*compliance*/\r
+enum\r
+{\r
+       GF_IPMPX_SE_COMP_FULLY = 0x00,\r
+       GF_IPMPX_SE_COMP_VIDEO_PACKETS = 0x01,\r
+       GF_IPMPX_SE_COMP_VIDEO_VOP = 0x02,\r
+       GF_IPMPX_SE_COMP_VIDEO_NONE = 0x03,\r
+       GF_IPMPX_SE_COMP_VIDEO_GOB = 0x04,\r
+       /*0x05-2F       ISO Reserved for video*/\r
+       GF_IPMPX_SE_COMP_AAC_DF = 0x30,\r
+       GF_IPMPX_SE_COMP_AAC_NONE = 0x31,\r
+       /*\r
+       0x32 -  0x5F    ISO Reserved for audio\r
+       0x60 - 0xCF     ISO Reserved\r
+       0xD0 - 0xFE     User Defined\r
+       0xFF    Forbidden\r
+       */\r
+};\r
+\r
+/*syncBoundary*/\r
+enum\r
+{\r
+       GF_IPMPX_SE_SYNC_VID7EO_PACKETS = 0x00,\r
+       GF_IPMPX_SE_SYNC_VIDEO_VOP = 0x01,\r
+       GF_IPMPX_SE_SYNC_VIDEO_GOV = 0x02,\r
+       /*0x03-2F       ISO Reserved for video,*/\r
+       GF_IPMPX_SE_SYNC_AAC_DF = 0x30,\r
+       /*0x31 -  0x5F  ISO Reserved for audio\r
+       0x60 - 0xCF     ISO Reserved\r
+       0xD0 - 0xFE     User Defined\r
+       0xFF    Forbidden\r
+       */\r
+};\r
+\r
+/*field_Id*/\r
+enum\r
+{\r
+       GF_IPMPX_SE_FID_VIDEO_MV = 0x00,\r
+       GF_IPMPX_SE_FID_VIDEO_DC = 0x01,\r
+       GF_IPMPX_SE_FID_VIDEO_DCT_SIGN = 0x02,\r
+       GF_IPMPX_SE_FID_VIDEO_DQUANT = 0x03,\r
+       GF_IPMPX_SE_FID_VIDEO_DCT_COEF = 0x04,\r
+       GF_IPMPX_SE_FID_VIDEO_ALL = 0x05,\r
+       /*0x06-2F       ISO Reserved for video*/\r
+       GF_IPMPX_SE_FID_AAC_SIGN = 0x30,\r
+       GF_IPMPX_SE_FID_AAC_CODEWORDS = 0x31,\r
+       GF_IPMPX_SE_FID_AAC_SCALE = 0x32,\r
+       /*0x32 -  0x5F  ISO Reserved for audio\r
+       0x60 - 0xCF     ISO Reserved\r
+       0xD0 - 0xFE     User Defined\r
+       0xFF    Forbidden*/\r
+};\r
+\r
+\r
+typedef struct\r
+{\r
+       GF_IPMPX_DATA_BASE\r
+       u8 mediaTypeExtension; \r
+       u8 mediaTypeIndication;\r
+       u8 profileLevelIndication; \r
+       u8 compliance;\r
+\r
+       GF_List *SelEncBuffer;\r
+\r
+       GF_List *SelEncFields;\r
+\r
+       u16 RLE_DataLength;\r
+       u16 *RLE_Data;\r
+} GF_IPMPX_SelectiveDecryptionInit;\r
+\r
+\r
+/*watermark init ops*/\r
+enum\r
+{\r
+       GF_IPMPX_WM_INSERT = 0,\r
+       GF_IPMPX_WM_EXTRACT = 1,\r
+       GF_IPMPX_WM_REMARK = 2,\r
+       GF_IPMPX_WM_DETECT_COMPRESSION = 3,\r
+};\r
+\r
+/*used for both audio and video WM init*/\r
+typedef struct\r
+{\r
+       GF_IPMPX_DATA_BASE\r
+       /*\r
+       for audio: PCM defined (0x01) and all audio objectTypeIndications\r
+       for video: YUV defined (0x01) and all visual objectTypeIndications\r
+       */\r
+       u8 inputFormat;\r
+       u8 requiredOp;\r
+\r
+       /*valid for audio WM, inputFormat=0x01*/\r
+       u8 nChannels;\r
+       u8 bitPerSample;\r
+       u32 frequency;\r
+\r
+       /*valid for video WM, inputFormat=0x01*/\r
+       u16 frame_horizontal_size;\r
+       u16 frame_vertical_size;\r
+       u8 chroma_format;\r
+\r
+       u32 wmPayloadLen;\r
+       char *wmPayload;\r
+\r
+       u16 wmRecipientId;\r
+       \r
+       u32 opaqueDataSize;\r
+       char *opaqueData;\r
+} GF_IPMPX_WatermarkingInit;\r
+\r
+\r
+\r
+/*WM status*/\r
+enum\r
+{\r
+       GF_IPMPX_WM_PAYLOAD = 0,\r
+       GF_IPMPX_WM_NOPAYLOAD = 1,\r
+       GF_IPMPX_WM_NONE = 2,\r
+       GF_IPMPX_WM_UNKNOWN = 3\r
+};\r
+\r
+/*compression status*/\r
+enum\r
+{\r
+       GF_IPMPX_WM_COMPRESSION = 0,\r
+       GF_IPMPX_WM_NO_COMPRESSION = 1,\r
+       GF_IPMPX_WM_COMPRESSION_UNKNOWN = 2,\r
+};\r
+\r
+typedef struct\r
+{\r
+       GF_IPMPX_DATA_BASE\r
+       u8 wm_status;\r
+       u8 compression_status;\r
+       /*if payload is set, status is FORCED to AUDIO_GF_IPMPX_WM_PAYLOAD*/\r
+       GF_IPMPX_ByteArray *payload;\r
+       GF_IPMPX_ByteArray *opaqueData;\r
+} GF_IPMPX_SendWatermark;\r
+\r
+\r
+typedef struct\r
+{\r
+       GF_IPMPX_DATA_BASE\r
+       /*GPAC only supports non-0 IDs*/\r
+       u32 Instantiation_API_ID;\r
+       u32 Messaging_API_ID;\r
+       GF_IPMPX_ByteArray *opaqueData;\r
+} GF_IPMPX_ToolAPI_Config;\r
+\r
+typedef struct\r
+{\r
+       GF_IPMPX_DATA_BASE\r
+       u8 cryptoSuite;\r
+       u8 IV_length;\r
+       Bool use_selective_encryption;\r
+       u8 key_indicator_length;\r
+} GF_IPMPX_ISMACryp;\r
+\r
+\r
+/*constructor/destructor*/\r
+GF_IPMPX_Data *gf_ipmpx_data_new(u8 tag);\r
+void gf_ipmpx_data_del(GF_IPMPX_Data *p);\r
+\r
+/*parse from bitstream*/\r
+GF_Err gf_ipmpx_data_parse(GF_BitStream *bs, GF_IPMPX_Data **out_data);\r
+/*get IPMP_Data contained size (eg without tag & sizeofinstance)*/\r
+u32 gf_ipmpx_data_size(GF_IPMPX_Data *p);\r
+/*get fulml IPMP_Data encoded size (eg with tag & sizeofinstance)*/\r
+u32 gf_ipmpx_data_full_size(GF_IPMPX_Data *p);\r
+/*writes IPMP_Data to buffer*/\r
+GF_Err gf_ipmpx_data_write(GF_BitStream *bs, GF_IPMPX_Data *_p);\r
+\r
+/*returns GF_IPMPX_Tag based on name*/\r
+u8 gf_ipmpx_get_tag(char *dataName);\r
+/*return values: cf above */\r
+u32 gf_ipmpx_get_field_type(GF_IPMPX_Data *p, char *fieldName);\r
+GF_Err gf_ipmpx_set_field(GF_IPMPX_Data *desc, char *fieldName, char *val);\r
+/*assign subdata*/\r
+GF_Err gf_ipmpx_set_sub_data(GF_IPMPX_Data *desc, char *fieldName, GF_IPMPX_Data *subdesc);\r
+/*assign bytearray*/\r
+GF_Err gf_ipmpx_set_byte_array(GF_IPMPX_Data *p, char *field, char *str);\r
+\r
+/*ipmpx dumper*/\r
+GF_Err gf_ipmpx_dump_data(GF_IPMPX_Data *_p, FILE *trace, u32 indent, Bool XMTDump);\r
+\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /*_GF_MPEG4_ODF_H_*/\r
diff --git a/tstools/DtsEdit/src/gpac/mpegts.h b/tstools/DtsEdit/src/gpac/mpegts.h
new file mode 100644 (file)
index 0000000..c69bb7c
--- /dev/null
@@ -0,0 +1,681 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Authors: Walid B.H - Jean Le Feuvre\r
+ *    Copyright (c)2006-200X ENST - All rights reserved\r
+ *\r
+ *  This file is part of GPAC / MPEG2-TS sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+\r
+#ifndef _GF_MPEG_TS_H_\r
+#define _GF_MPEG_TS_H_\r
+\r
+#include <gpac/list.h>\r
+#include <gpac/internal/odf_dev.h>\r
+\r
+typedef struct tag_m2ts_demux GF_M2TS_Demuxer;\r
+typedef struct tag_m2ts_es GF_M2TS_ES;\r
+typedef struct tag_m2ts_section_es GF_M2TS_SECTION_ES;\r
+\r
+/*Maximum number of streams in a TS*/\r
+#define GF_M2TS_MAX_STREAMS    8192\r
+\r
+/*MPEG-2 TS Media types*/\r
+enum\r
+{\r
+       GF_M2TS_VIDEO_MPEG1                             = 0x01,\r
+       GF_M2TS_VIDEO_MPEG2                             = 0x02,\r
+       GF_M2TS_AUDIO_MPEG1                             = 0x03,\r
+       GF_M2TS_AUDIO_MPEG2                             = 0x04, \r
+       GF_M2TS_PRIVATE_SECTION                 = 0x05,\r
+       GF_M2TS_PRIVATE_DATA                    = 0x06,\r
+       GF_M2TS_AUDIO_AAC                               = 0x0F,\r
+       GF_M2TS_VIDEO_MPEG4                             = 0x10,\r
+       GF_M2TS_AUDIO_LATM_AAC                  = 0x11,\r
+\r
+       GF_M2TS_SYSTEMS_MPEG4_PES               = 0x12,\r
+       GF_M2TS_SYSTEMS_MPEG4_SECTIONS  = 0x13,\r
+\r
+       GF_M2TS_VIDEO_H264                              = 0x1B,\r
+\r
+       GF_M2TS_AUDIO_AC3                               = 0x81,\r
+       GF_M2TS_AUDIO_DTS                               = 0x8A,\r
+       GF_M2TS_SUBTITLE_DVB                    = 0x100,\r
+};\r
+/*returns readable name for given stream type*/\r
+const char *gf_m2ts_get_stream_name(u32 streamType);\r
+\r
+/*PES data framing modes*/\r
+enum\r
+{\r
+       /*use data framing: recompute start of AUs (data frames)*/\r
+       GF_M2TS_PES_FRAMING_DEFAULT,\r
+       /*don't use data framing: all packets are raw PES packets*/\r
+       GF_M2TS_PES_FRAMING_RAW,\r
+       /*skip pes processing: all transport packets related to this stream are discarded*/\r
+       GF_M2TS_PES_FRAMING_SKIP\r
+};\r
+\r
+/*PES packet flags*/\r
+enum\r
+{\r
+       GF_M2TS_PES_PCK_RAP = 1,\r
+       GF_M2TS_PES_PCK_AU_START = 1<<1,\r
+       /*visual frame starting in this packet is an I frame or IDR (AVC/H264)*/\r
+       GF_M2TS_PES_PCK_I_FRAME = 1<<2,\r
+       /*visual frame starting in this packet is a P frame*/\r
+       GF_M2TS_PES_PCK_P_FRAME = 1<<3,\r
+       /*visual frame starting in this packet is a B frame*/\r
+       GF_M2TS_PES_PCK_B_FRAME = 1<<4\r
+};\r
+\r
+/*Events used by the MPEGTS demuxer*/\r
+enum\r
+{\r
+       /*PAT has been found (service connection) - no assoctiated parameter*/\r
+       GF_M2TS_EVT_PAT_FOUND = 0,\r
+       /*PAT has been updated - no assoctiated parameter*/\r
+       GF_M2TS_EVT_PAT_UPDATE,\r
+       /*repeated PAT has been found (carousel) - no assoctiated parameter*/\r
+       GF_M2TS_EVT_PAT_REPEAT,\r
+       /*PMT has been found (service tune-in) - assoctiated parameter: new PMT*/\r
+       GF_M2TS_EVT_PMT_FOUND,\r
+       /*repeated PMT has been found (carousel) - assoctiated parameter: updated PMT*/\r
+       GF_M2TS_EVT_PMT_REPEAT,\r
+       /*PMT has been changed - assoctiated parameter: updated PMT*/\r
+       GF_M2TS_EVT_PMT_UPDATE,\r
+       /*SDT has been received - assoctiated parameter: none*/\r
+       GF_M2TS_EVT_SDT_FOUND,\r
+       /*repeated SDT has been found (carousel) - assoctiated parameter: none*/\r
+       GF_M2TS_EVT_SDT_REPEAT,\r
+       /*SDT has been received - assoctiated parameter: none*/\r
+       GF_M2TS_EVT_SDT_UPDATE,\r
+       /*INT has been received - assoctiated parameter: none*/\r
+       GF_M2TS_EVT_INT_FOUND,\r
+       /*repeated INT has been found (carousel) - assoctiated parameter: none*/\r
+       GF_M2TS_EVT_INT_REPEAT,\r
+       /*INT has been received - assoctiated parameter: none*/\r
+       GF_M2TS_EVT_INT_UPDATE,\r
+       /*PES packet has been received - assoctiated parameter: PES packet*/\r
+       GF_M2TS_EVT_PES_PCK,\r
+       /*PCR has been received - assoctiated parameter: PES packet with no data*/\r
+       GF_M2TS_EVT_PES_PCR,\r
+       /*An MPEG-4 SL Packet has been received in a section - assoctiated parameter: SL packet */\r
+       GF_M2TS_EVT_SL_PCK,\r
+       /*An IP datagram has been received in a section - assoctiated parameter: IP datagram */\r
+       GF_M2TS_EVT_IP_DATAGRAM,\r
+\r
+       /*AAC config has been extracted - associated parameter: PES Packet with encoded M4ADecSpecInfo in its data\r
+               THIS MUST BE CLEANED UP\r
+       */\r
+       GF_M2TS_EVT_AAC_CFG,\r
+#if 0\r
+       /* An EIT message for the present or following event on this TS has been received */\r
+       GF_M2TS_EVT_EIT_ACTUAL_PF,\r
+       /* An EIT message for the schedule of this TS has been received */\r
+       GF_M2TS_EVT_EIT_ACTUAL_SCHEDULE,\r
+       /* An EIT message for the present or following event of an other TS has been received */\r
+       GF_M2TS_EVT_EIT_OTHER_PF,\r
+       /* An EIT message for the schedule of an other TS has been received */\r
+       GF_M2TS_EVT_EIT_OTHER_SCHEDULE,\r
+       /* A message to inform about the current date and time in the TS */\r
+       GF_M2TS_EVT_TDT,\r
+       /* A message to inform about the current time offset in the TS */\r
+       GF_M2TS_EVT_TOT,\r
+#endif\r
+       /* A generic event message for EIT, TDT, TOT etc */\r
+       GF_M2TS_EVT_DVB_GENERAL,\r
+};\r
+\r
+enum\r
+{\r
+       GF_M2TS_TABLE_START             = 1,\r
+       GF_M2TS_TABLE_END               = 1<<1,\r
+       GF_M2TS_TABLE_FOUND             = 1<<2,\r
+       GF_M2TS_TABLE_UPDATE    = 1<<3,\r
+       GF_M2TS_TABLE_REPEAT    = 1<<4,\r
+};\r
+\r
+typedef void (*gf_m2ts_section_callback)(GF_M2TS_Demuxer *ts, GF_M2TS_SECTION_ES *es, GF_List *sections, u8 table_id, u16 ex_table_id, u8 version_number, u8 last_section_number, u32 status); \r
+\r
+typedef struct __m2ts_demux_section\r
+{\r
+       unsigned char *data;\r
+       u32 data_size;\r
+} GF_M2TS_Section;\r
+\r
+typedef struct __m2ts_demux_table\r
+{\r
+       struct __m2ts_demux_table *next;\r
+\r
+       Bool is_init;\r
+\r
+       /*table id*/\r
+       u8 table_id;\r
+       u16 ex_table_id;\r
+\r
+       /*reassembler state*/\r
+       u8 version_number;\r
+       u8 last_version_number;\r
+\r
+       u8 current_next_indicator;\r
+\r
+       u8 section_number;\r
+       u8 last_section_number;\r
+\r
+       GF_List *sections;\r
+\r
+} GF_M2TS_Table;\r
+\r
+\r
+typedef struct GF_M2TS_SectionFilter\r
+{\r
+       /*section reassembler*/\r
+       s16 cc;\r
+       /*section buffer (max 4096)*/\r
+       char *section;\r
+       /*current section length as indicated in section header*/\r
+       u16 length;\r
+       /*number of bytes received from current section*/\r
+       u16 received;\r
+       /*error indiator when reaggregating sections*/\r
+       u8 had_error;\r
+\r
+       /*section->table aggregator*/\r
+       GF_M2TS_Table *table;\r
+       \r
+       /* indicates that the section and last_section_number do not need to be checked */\r
+       Bool process_individual;\r
+\r
+       /* indicates that the section header with table id and extended table id ... is\r
+          not parsed by the TS demuxer and left for the application  */\r
+       Bool direct_dispatch;\r
+\r
+       gf_m2ts_section_callback process_section; \r
+} GF_M2TS_SectionFilter;\r
+\r
+\r
+\r
+/*MPEG-2 TS program object*/\r
+typedef struct \r
+{\r
+       GF_List *streams;\r
+       u32 pmt_pid;  \r
+       u32 pcr_pid;\r
+       u32 number;\r
+\r
+       GF_InitialObjectDescriptor *pmt_iod;\r
+\r
+       /*list of additional ODs found per program !! used by media importer only , refine this !! \r
+               this list is only created when MPEG-4 over MPEG-2 is detected\r
+               the list AND the ODs contained in it are destroyed when destroying the demuxer\r
+       */\r
+       GF_List *additional_ods;\r
+       /*first dts found on this program - this is used by parsers, but not setup by the lib*/\r
+       u64 first_dts;\r
+} GF_M2TS_Program;\r
+\r
+/*ES flags*/\r
+enum\r
+{\r
+       /*ES is a section stream*/\r
+       GF_M2TS_ES_IS_SECTION = 1,\r
+       /*ES is an mpeg-4 flexmux stream*/\r
+       GF_M2TS_ES_IS_FMC = 1<<1,\r
+       /*ES is an mpeg-4 SL-packetized stream*/\r
+       GF_M2TS_ES_IS_SL = 1<<2,\r
+       /*ES is an mpeg-4 Object Descriptor SL-packetized stream*/\r
+       GF_M2TS_ES_IS_MPEG4_OD = 1<<3,\r
+       \r
+       /*all flags above this mask are used by importers & co*/\r
+       GF_M2TS_ES_STATIC_FLAGS_MASK = 0x0000FFFF,\r
+\r
+       /*Flag used by importers*/\r
+       GF_M2TS_ES_FIRST_DTS = 1<<20,\r
+};\r
+\r
+/*Abstract Section/PES stream object, only used for type casting*/\r
+#define ABSTRACT_ES            \\r
+                       GF_M2TS_Program *program; \\r
+                       u32 flags; \\r
+                       u32 pid; \\r
+                       u32 stream_type; \\r
+                       u32 mpeg4_es_id; \\r
+                       void *user; \\r
+                       u64 first_dts;\r
+\r
+struct tag_m2ts_es\r
+{\r
+       ABSTRACT_ES\r
+};\r
+\r
+/*INT object*/\r
+typedef struct\r
+{\r
+       u32 id;\r
+} GF_M2TS_INT;\r
+\r
+struct tag_m2ts_section_es\r
+{\r
+       ABSTRACT_ES\r
+       GF_M2TS_SectionFilter *sec;\r
+\r
+       /* MPE Frame object, MPE-FEC related data */\r
+       GF_M2TS_INT *ip_mac_not_table;  \r
+};                     \r
+\r
+/*******************************************************************************/\r
+typedef struct tag_m2ts_dvb_sub\r
+{\r
+       char language[3];\r
+       u8 type;\r
+       u16 composition_page_id;\r
+       u16 ancillary_page_id;\r
+} GF_M2TS_DVB_Subtitling_Descriptor;\r
+\r
+typedef struct tag_m2ts_dvb_teletext\r
+{\r
+       char language[3];\r
+       u8 type;\r
+       u8 magazine_number;\r
+       u8 page_number;\r
+} GF_M2TS_DVB_Teletext_Descriptor;\r
+\r
+/*MPEG-2 TS ES object*/\r
+typedef struct tag_m2ts_pes\r
+{\r
+       ABSTRACT_ES\r
+       u32 lang;\r
+\r
+       /*object info*/\r
+       u32 vid_w, vid_h, vid_par, aud_sr, aud_nb_ch;\r
+       /*user private*/\r
+\r
+\r
+       /*mpegts lib private - do not touch :)*/\r
+       /*PES re-assembler*/\r
+       unsigned char *data;\r
+       u32 data_len, pes_len;\r
+       Bool rap;\r
+       u64 PTS, DTS;\r
+       \r
+       /*PES reframer - if NULL, pes processing is skiped*/\r
+       u32 frame_state;\r
+       void (*reframe)(struct tag_m2ts_demux *ts, struct tag_m2ts_pes *pes, u64 DTS, u64 CTS, unsigned char *data, u32 data_len);\r
+       /*LATM stuff - should be moved out of mpegts*/\r
+       unsigned char *buf;\r
+       u32 buf_len;\r
+\r
+       GF_M2TS_DVB_Subtitling_Descriptor sub;\r
+\r
+} GF_M2TS_PES;\r
+\r
+/*SDT information object*/\r
+typedef struct\r
+{\r
+       u16 original_network_id;\r
+       u16 transport_stream_id;\r
+       u32 service_id;\r
+       u32 EIT_schedule;\r
+       u32 EIT_present_following;\r
+       u32 running_status;\r
+       u32 free_CA_mode;\r
+       u8 service_type;\r
+       unsigned char *provider, *service;\r
+} GF_M2TS_SDT;\r
+\r
+typedef struct\r
+{\r
+       u16 network_id;\r
+       unsigned char *network_name;\r
+       u16 original_network_id;\r
+       u16 transport_stream_id;\r
+       u16 service_id;\r
+       u32 service_type;\r
+       u32 logical_channel_number;\r
+} GF_M2TS_NIT;\r
+\r
+#define GF_M2TS_BASE_DESCRIPTOR u32 tag;\r
+\r
+typedef struct {\r
+       u8 content_nibble_level_1, content_nibble_level_2, user_nibble;\r
+} GF_M2TS_DVB_Content_Descriptor;\r
+\r
+typedef struct {\r
+       char country_code[3];\r
+       u8 value;\r
+} GF_M2TS_DVB_Rating_Descriptor;\r
+\r
+typedef struct {\r
+       unsigned char lang[3];\r
+       unsigned char *event_name, *event_text;\r
+} GF_M2TS_DVB_Short_Event_Descriptor;\r
+\r
+typedef struct {\r
+       unsigned char *item;\r
+       unsigned char *description;\r
+} GF_M2TS_DVB_Extended_Event_Item;\r
+\r
+typedef struct {\r
+       unsigned char lang[3];\r
+       u32 last;\r
+       GF_List *items;\r
+       unsigned char *text;\r
+} GF_M2TS_DVB_Extended_Event_Descriptor;\r
+\r
+/*EIT information objects*/\r
+typedef struct\r
+{\r
+       u32 year, month, day, time;\r
+\r
+       /* local time offset descriptor data */\r
+       char country_code[3];\r
+       u8 country_region_id;\r
+       u8 local_time_offset_polarity;\r
+       u16 local_time_offset;\r
+       /*time_of_change*/\r
+       u32 toc_year, toc_month, toc_day, toc_time;\r
+       u16 next_time_offset;\r
+} GF_M2TS_DateTime_Event;\r
+\r
+typedef struct {\r
+       u8 stream_content;\r
+       u8 component_type;\r
+       u8 component_tag;\r
+       char language_code[3];\r
+       unsigned char *text;\r
+} GF_M2TS_Component;\r
+\r
+typedef struct\r
+{\r
+       u16 event_id;\r
+       GF_M2TS_DateTime_Event start;\r
+       u32 duration;\r
+       u8 running_status;\r
+       u8 free_CA_mode;\r
+       GF_List *short_events;\r
+       GF_List *extended_events;\r
+       GF_List *components;\r
+       GF_List *contents;\r
+       GF_List *ratings;\r
+} GF_M2TS_EIT_Event;\r
+\r
+typedef struct\r
+{\r
+       u32 original_network_id;\r
+       u32 transport_stream_id;\r
+       u16 service_id;\r
+       GF_List *events;\r
+} GF_M2TS_EIT;\r
+\r
+void gf_m2ts_decode_mjd_date(u32 date, u32 *year, u32 *month, u32 *day);\r
+\r
+\r
+/*MPEG-2 TS packet*/\r
+typedef struct\r
+{\r
+       char *data;\r
+       u32 data_len;\r
+       u32 flags;\r
+       u64 PTS, DTS;\r
+       /*parent stream*/\r
+       GF_M2TS_PES *stream;\r
+} GF_M2TS_PES_PCK;\r
+\r
+/*MPEG-4 SL packet from MPEG-2 TS*/\r
+typedef struct\r
+{\r
+       char *data;\r
+       u32 data_len;\r
+       /*parent stream */\r
+       GF_M2TS_ES *stream;\r
+} GF_M2TS_SL_PCK;\r
+\r
+/*MPEG-2 TS demuxer*/\r
+struct tag_m2ts_demux\r
+{\r
+       GF_M2TS_ES *ess[GF_M2TS_MAX_STREAMS];\r
+       GF_List *programs;\r
+       /*keep it seperate for now - TODO check if we're sure of the order*/\r
+       GF_List *SDTs;\r
+\r
+       /*user callback - MUST NOT BE NULL*/\r
+       void (*on_event)(struct tag_m2ts_demux *ts, u32 evt_type, void *par);\r
+       /*private user data*/\r
+       void *user;\r
+\r
+       /*private resync buffer*/\r
+       char *buffer;\r
+       u32 buffer_size, alloc_size;\r
+       /*default transport PID filters*/\r
+       GF_M2TS_SectionFilter *pat, *nit, *sdt, *eit, *tdt_tot_st;\r
+\r
+       /* Structure to hold all the INT tables if the TS contains IP streams */\r
+       GF_List *ip_mac_not_tables;\r
+       \r
+       Bool has_4on2;\r
+       /* analyser */\r
+       FILE *pes_out;\r
+\r
+\r
+};\r
+\r
+\r
+GF_M2TS_Demuxer *gf_m2ts_demux_new();\r
+void gf_m2ts_demux_del(GF_M2TS_Demuxer *ts);\r
+void gf_m2ts_reset_parsers(GF_M2TS_Demuxer *ts);\r
+GF_Err gf_m2ts_set_pes_framing(GF_M2TS_PES *pes, u32 mode);\r
+GF_Err gf_m2ts_process_data(GF_M2TS_Demuxer *ts, char *data, u32 data_size);\r
+\r
+u32 gf_m2ts_crc32_check(char *data, u32 len);\r
+\r
+/*MPEG-2 Descriptor tags*/\r
+enum\r
+{\r
+       /* ... */\r
+       GF_M2TS_VIDEO_STREAM_DESCRIPTOR                         = 0x02,\r
+       GF_M2TS_AUDIO_STREAM_DESCRIPTOR                         = 0x03,\r
+       GF_M2TS_HIERARCHY_DESCRIPTOR                            = 0x04,\r
+       GF_M2TS_REGISTRATION_DESCRIPTOR                         = 0x05,\r
+       GF_M2TS_DATA_STREAM_ALIGNEMENT_DESCRIPTOR               = 0x06,\r
+       GF_M2TS_TARGET_BACKGROUND_GRID_DESCRIPTOR               = 0x07,\r
+       GF_M2TS_VIEW_WINDOW_DESCRIPTOR                          = 0x08,\r
+       GF_M2TS_CA_DESCRIPTOR                                   = 0x09,\r
+       GF_M2TS_ISO_639_LANGUAGE_DESCRIPTOR                     = 0x0A,\r
+       /* ... */\r
+       GF_M2TS_STD_DESCRIPTOR                                  = 0x17,\r
+       /* ... */\r
+       GF_M2TS_MPEG4_VIDEO_DESCRIPTOR                          = 0x1B,\r
+       GF_M2TS_MPEG4_AUDIO_DESCRIPTOR                          = 0x1C,\r
+       GF_M2TS_MPEG4_IOD_DESCRIPTOR                            = 0x1D,\r
+       GF_M2TS_MPEG4_SL_DESCRIPTOR                             = 0x1E,\r
+       GF_M2TS_MPEG4_FMC_DESCRIPTOR                            = 0x1F,\r
+       /* ... */\r
+       GF_M2TS_AVC_VIDEO_DESCRIPTOR                            = 0x28,\r
+       /* ... */       \r
+       GF_M2TS_AVC_TIMING_HRD_DESCRIPTOR                       = 0x2A,\r
+       /* ... */\r
+\r
+       /* 0x2D - 0x3F - ISO/IEC 13818-6 values */\r
+       /* 0x40 - 0xFF - User Private values */\r
+       GF_M2TS_DVB_NETWORK_NAME_DESCRIPTOR                     = 0x40,\r
+       GF_M2TS_DVB_SERVICE_LIST_DESCRIPTOR                     = 0x41,\r
+       GF_M2TS_DVB_STUFFING_DESCRIPTOR                         = 0x42,\r
+       GF_M2TS_DVB_SAT_DELIVERY_SYSTEM_DESCRIPTOR              = 0x43,\r
+       GF_M2TS_DVB_CABLE_DELIVERY_SYSTEM_DESCRIPTOR            = 0x44,\r
+       GF_M2TS_DVB_VBI_DATA_DESCRIPTOR                         = 0x45,\r
+       GF_M2TS_DVB_VBI_TELETEXT_DESCRIPTOR                     = 0x46,\r
+       GF_M2TS_DVB_BOUQUET_NAME_DESCRIPTOR                     = 0x47,\r
+       GF_M2TS_DVB_SERVICE_DESCRIPTOR                          = 0x48,\r
+       GF_M2TS_DVB_COUNTRY_AVAILABILITY_DESCRIPTOR             = 0x49,\r
+       GF_M2TS_DVB_LINKAGE_DESCRIPTOR                          = 0x4A,\r
+       GF_M2TS_DVB_NVOD_REFERENCE_DESCRIPTOR                   = 0x4B,\r
+       GF_M2TS_DVB_TIME_SHIFTED_SERVICE_DESCRIPTOR             = 0x4C,\r
+       GF_M2TS_DVB_SHORT_EVENT_DESCRIPTOR                      = 0x4D,\r
+       GF_M2TS_DVB_EXTENDED_EVENT_DESCRIPTOR                   = 0x4E,\r
+       GF_M2TS_DVB_TIME_SHIFTED_EVENT_DESCRIPTOR               = 0x4F,\r
+       GF_M2TS_DVB_COMPONENT_DESCRIPTOR                        = 0x50,\r
+       GF_M2TS_DVB_MOSAIC_DESCRIPTOR                           = 0x51,\r
+       GF_M2TS_DVB_STREAM_IDENTIFIER_DESCRIPTOR                = 0x52,\r
+       GF_M2TS_DVB_CA_IDENTIFIER_DESCRIPTOR                    = 0x53,\r
+       GF_M2TS_DVB_CONTENT_DESCRIPTOR                          = 0x54,\r
+       GF_M2TS_DVB_PARENTAL_RATING_DESCRIPTOR                  = 0x55,\r
+       GF_M2TS_DVB_TELETEXT_DESCRIPTOR                         = 0x56,\r
+       /* ... */\r
+       GF_M2TS_DVB_LOCAL_TIME_OFFSET_DESCRIPTOR                = 0x58,\r
+       GF_M2TS_DVB_SUBTITLING_DESCRIPTOR                       = 0x59,\r
+       /* ... */\r
+       GF_M2TS_DVB_DATA_BROADCAST_DESCRIPTOR                   = 0x64,\r
+       /* ... */\r
+       GF_M2TS_DVB_DATA_BROADCAST_ID_DESCRIPTOR                = 0x66,\r
+       /* ... */\r
+       GF_M2TS_DVB_AC3_DESCRIPTOR                              = 0x6A,\r
+       \r
+};\r
+\r
+/* Reserved PID values */\r
+enum {\r
+       GF_M2TS_PID_PAT                 = 0x0000,\r
+       GF_M2TS_PID_CAT                 = 0x0001,\r
+       GF_M2TS_PID_TSDT                = 0x0002,\r
+       /* reserved 0x0003 to 0x000F */ \r
+       GF_M2TS_PID_NIT_ST              = 0x0010,\r
+       GF_M2TS_PID_SDT_BAT_ST          = 0x0011,\r
+       GF_M2TS_PID_EIT_ST_CIT          = 0x0012,\r
+       GF_M2TS_PID_RST_ST              = 0x0013,\r
+       GF_M2TS_PID_TDT_TOT_ST          = 0x0014,\r
+       GF_M2TS_PID_NET_SYNC            = 0x0015,\r
+       GF_M2TS_PID_RNT                 = 0x0016,\r
+       /* reserved 0x0017 to 0x001B */ \r
+       GF_M2TS_PID_IN_SIG              = 0x001C,\r
+       GF_M2TS_PID_MEAS                = 0x001D,\r
+       GF_M2TS_PID_DIT                 = 0x001E,\r
+       GF_M2TS_PID_SIT                 = 0x001F\r
+};\r
+\r
+/* max size includes first header, second header, payload and CRC */\r
+enum {\r
+       GF_M2TS_TABLE_ID_PAT                    = 0x00,\r
+       GF_M2TS_TABLE_ID_CAT                    = 0x01, \r
+       GF_M2TS_TABLE_ID_PMT                    = 0x02, \r
+       GF_M2TS_TABLE_ID_TSDT                   = 0x03, /* max size for section 1024 */\r
+       GF_M2TS_TABLE_ID_MPEG4_BIFS             = 0x04, /* max size for section 4096 */\r
+       GF_M2TS_TABLE_ID_MPEG4_OD               = 0x05, /* max size for section 4096 */\r
+       GF_M2TS_TABLE_ID_METADATA               = 0x06, \r
+       GF_M2TS_TABLE_ID_IPMP_CONTROL           = 0x07, \r
+       /* 0x08 - 0x37 reserved */\r
+       /* 0x38 - 0x3D DSM-CC defined */\r
+       GF_M2TS_TABLE_ID_DSM_CC_PRIVATE         = 0x3E, /* used for MPE (only, not MPE-FEC) */\r
+       /* 0x3F DSM-CC defined */\r
+       GF_M2TS_TABLE_ID_NIT_ACTUAL             = 0x40, /* max size for section 1024 */\r
+       GF_M2TS_TABLE_ID_NIT_OTHER              = 0x41,\r
+       GF_M2TS_TABLE_ID_SDT_ACTUAL             = 0x42, /* max size for section 1024 */\r
+       /* 0x43 - 0x45 reserved */\r
+       GF_M2TS_TABLE_ID_SDT_OTHER              = 0x46, /* max size for section 1024 */\r
+       /* 0x47 - 0x49 reserved */\r
+       GF_M2TS_TABLE_ID_BAT                    = 0x4a, /* max size for section 1024 */\r
+       /* 0x4b - 0x4d reserved */\r
+       GF_M2TS_TABLE_ID_EIT_ACTUAL_PF          = 0x4E, /* max size for section 4096 */\r
+       GF_M2TS_TABLE_ID_EIT_OTHER_PF           = 0x4F,\r
+       /* 0x50 - 0x6f EIT SCHEDULE */\r
+       GF_M2TS_TABLE_ID_EIT_SCHEDULE_MIN       = 0x50,\r
+       GF_M2TS_TABLE_ID_EIT_SCHEDULE_ACTUAL_MAX= 0x5F,\r
+       GF_M2TS_TABLE_ID_EIT_SCHEDULE_MAX       = 0x6F,\r
+\r
+       GF_M2TS_TABLE_ID_TDT                    = 0x70,\r
+       GF_M2TS_TABLE_ID_RST                    = 0x71, /* max size for section 1024 */\r
+       GF_M2TS_TABLE_ID_ST                     = 0x72, /* max size for section 4096 */\r
+       GF_M2TS_TABLE_ID_TOT                    = 0x73,\r
+       GF_M2TS_TABLE_ID_AI                     = 0x74,\r
+       GF_M2TS_TABLE_ID_CONT                   = 0x75,\r
+       GF_M2TS_TABLE_ID_RC                     = 0x76,\r
+       GF_M2TS_TABLE_ID_CID                    = 0x77,\r
+       GF_M2TS_TABLE_ID_MPE_FEC                = 0x78,\r
+       GF_M2TS_TABLE_ID_RES_NOT                = 0x79,\r
+       /* 0x7A - 0x7D reserved */\r
+       GF_M2TS_TABLE_ID_DIT                    = 0x7E,\r
+       GF_M2TS_TABLE_ID_SIT                    = 0x7F, /* max size for section 4096 */\r
+       /* 0x80 - 0xfe reserved */\r
+       /* 0xff reserved */\r
+};\r
+\r
+enum {\r
+       M2TS_ADAPTATION_RESERVED        = 0,\r
+       M2TS_ADAPTATION_NONE            = 1,\r
+       M2TS_ADAPTATION_ONLY            = 2,\r
+       M2TS_ADAPTATION_AND_PAYLOAD     = 3,\r
+};\r
+\r
+\r
+#define SECTION_HEADER_LENGTH 3 /* header till the last bit of the section_length field */\r
+#define SECTION_ADDITIONAL_HEADER_LENGTH 5 /* header from the last bit of the section_length field to the payload */\r
+#define        CRC_LENGTH 4\r
+\r
+typedef struct\r
+{\r
+       u8 sync;\r
+       u8 error;\r
+       u8 payload_start;\r
+       u8 priority;\r
+       u16 pid;\r
+       u8 scrambling_ctrl;\r
+       u8 adaptation_field;\r
+       u8 continuity_counter;\r
+} GF_M2TS_Header;\r
+\r
+typedef struct\r
+{\r
+       u32 discontinuity_indicator;\r
+       u32 random_access_indicator;\r
+       u32 priority_indicator;\r
+\r
+       u32 PCR_flag;\r
+       u64 PCR_base, PCR_ext;\r
+\r
+       u32 OPCR_flag;\r
+       u64 OPCR_base, OPCR_ext;\r
+\r
+       u32 splicing_point_flag;\r
+       u32 transport_private_data_flag;\r
+       u32 adaptation_field_extension_flag;\r
+/*     \r
+       u32 splice_countdown;\r
+       u32 transport_private_data_length;\r
+       u32 adaptation_field_extension_length;\r
+       u32 ltw_flag;\r
+       u32 piecewise_rate_flag;\r
+       u32 seamless_splice_flag;\r
+       u32 ltw_valid_flag;\r
+       u32 ltw_offset;\r
+       u32 piecewise_rate;\r
+       u32 splice_type;\r
+       u32 DTS_next_AU;\r
+*/\r
+} GF_M2TS_AdaptationField;\r
+\r
+typedef struct \r
+{\r
+       u8 id;\r
+       u16 pck_len;\r
+       u8 data_alignment;\r
+       u64 PTS, DTS;\r
+       u8 hdr_data_len;\r
+} GF_M2TS_PESHeader;\r
+\r
+#endif //_GF_MPEG_TS_H_\r
diff --git a/tstools/DtsEdit/src/gpac/network.h b/tstools/DtsEdit/src/gpac/network.h
new file mode 100644 (file)
index 0000000..f41d8c6
--- /dev/null
@@ -0,0 +1,403 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / common tools sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_NET_H_\r
+#define _GF_NET_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/*!\r
+ *     \file <gpac/network.h>\r
+ *     \brief IP network functions.\r
+ */\r
+\r
+ /*!\r
+ *     \addtogroup net_grp network\r
+ *     \ingroup utils_grp\r
+ *     \brief IP Network Functions\r
+ *\r
+ *This section documents the IP network functions of the GPAC framework.\r
+ *     @{\r
+ */\r
+\r
+#include <gpac/tools.h>\r
+\r
+\r
+/*!\r
+ *\brief URL local test\r
+ *\r
+ *Tests whether a URL describes a local file or not\r
+ *\param url the url to analyze\r
+ *\return 1 if the URL describes a local file, 0 otherwise\r
+ */\r
+Bool gf_url_is_local(const char *url);\r
+\r
+/*!\r
+ *\brief gets absolute file path\r
+ *\r
+ *Gets the absolute file path from a relative path and its parent absolute one. This can only be used with file paths.\r
+ *\param pathName the relative path name of a file\r
+ *\param parentPath the absolute parent path name \r
+ *\return absolute path name of the file, or NULL if bad paths are provided.\r
+ \note the returned string must be freed by user\r
+ */\r
+char *gf_url_get_absolute_path(const char *pathName, const char *parentPath);\r
+/*concatenates URL and gets back full URL - returned string must be freed by user*/\r
+/*!\r
+ *\brief URL concatenation\r
+ *\r
+ *Concatenates a relative URL with its parent URL\r
+ *\param parentName URL of the parent service\r
+ *\param pathName URL of the service\r
+ *\return absolute path name of the service, or NULL if bad paths are provided or if the service path is already an absolute one.\r
+ \note the returned string must be freed by user\r
+ */\r
+char *gf_url_concatenate(const char *parentName, const char *pathName);\r
+\r
+\r
+/*!\r
+ *\brief URL to file system\r
+ *\r
+ *Converts a local URL to a file system value. Removes all white spaces and similar\r
+ *\param url url to convert\r
+ */\r
+void gf_url_to_fs_path(char *url);\r
+\r
+/*!\r
+ *\brief gets UTC time \r
+ *\r
+ *Gets UTC time since midnight Jan 1970\r
+ *\param sec number of seconds\r
+ *\param msec number of milliseconds\r
+ */\r
+void gf_utc_time_since_1970(u32 *sec, u32 *msec);\r
+\r
+\r
+/*!\r
+ *     \brief NTP seconds from 1900 to 1970\r
+ *     \hideinitializer\r
+ *\r
+ *     Macro giving the number of seconds from from 1900 to 1970\r
+*/\r
+#define GF_NTP_SEC_1900_TO_1970 2208988800ul\r
+\r
+/*!\r
+ *\brief gets NTP time \r
+ *\r
+ *Gets NTP (Network Time Protocol) in seconds and fractional side\r
+ \param sec NTP time in seconds\r
+ \param frac fractional NTP time expressed in 1 / (1<<32 - 1) seconds units\r
+ */\r
+void gf_net_get_ntp(u32 *sec, u32 *frac);\r
+\r
+/*!\r
+ * Socket options\r
+ *     \hideinitializer\r
+ */\r
+enum\r
+{\r
+       /*!Reuses port.*/\r
+       GF_SOCK_REUSE_PORT = 1,\r
+       /*!Forces IPV6 if available.*/\r
+       GF_SOCK_FORCE_IPV6 = 1<<1\r
+};\r
+\r
+/*!\r
+ *\brief abstracted socket object\r
+ *\r
+ *The abstracted socket object allows you to build client and server applications very simply\r
+ *with support for unicast and multicast (no IPv6 yet)\r
+*/\r
+typedef struct __tag_socket GF_Socket;\r
+\r
+/*!Buffer size to pass for IP address retrieval*/\r
+#define GF_MAX_IP_NAME_LEN     516\r
+\r
+/*!socket is a TCP socket*/\r
+#define GF_SOCK_TYPE_TCP               0x01\r
+/*!socket is a UDP socket*/\r
+#define GF_SOCK_TYPE_UDP               0x02\r
+\r
+/*!\r
+ *\brief socket constructor\r
+ *\r
+ *Constructs a socket object\r
+ *\param SocketType the socket type to create, either UDP or TCP\r
+ *\return the socket object or NULL if network initialization failure\r
+ */\r
+GF_Socket *gf_sk_new(u32 SocketType);\r
+/*!\r
+ *\brief socket destructor\r
+ *\r
+ *Deletes a socket object\r
+ *\param sock the socket object\r
+ */\r
+void gf_sk_del(GF_Socket *sock);\r
+\r
+/*!\r
+ *\brief reset internal buffer\r
+ *\r
+ *Forces the internal socket buffer to be reseted (discarded)\r
+ *\param sock the socket object\r
+ */\r
+void gf_sk_reset(GF_Socket *sock);\r
+/*!\r
+ *\brief socket buffer size control\r
+ *\r
+ *Sets the size of the internal buffer of the socket. The socket MUST be bound or connected before.\r
+ *\param sock the socket object\r
+ *\param send_buffer if 0, sets the size of the reception buffer, otherwise sets the size of the emission buffer\r
+ *\param new_size new size of the buffer in bytes.\r
+ *\warning This operation may fail depending on the provider, hardware...\r
+ */\r
+GF_Err gf_sk_set_buffer_size(GF_Socket *sock, Bool send_buffer, u32 new_size);\r
+\r
+/*!\r
+ *\brief blocking mode control\r
+ *\r
+ *Sets the blocking mode of a socket on or off. A blocking socket will wait for the net operation to be possible \r
+ *while a non-blocking one would return an error. By default, sockets are created in blocking mode\r
+ *\param sock the socket object\r
+ *\param NonBlockingOn set to 1 to use on-blocking sockets, 0 otherwise\r
+ */\r
+GF_Err gf_sk_set_block_mode(GF_Socket *sock, Bool NonBlockingOn);\r
+/*!\r
+ *\brief socket binding\r
+ *\r
+ *Binds the given socket to the specified port.\r
+ *\param local_ip the local interface IP address if desired. If NULL, the default interface will be used.\r
+ *\param sock the socket object\r
+ *\param port port number to bind this socket to\r
+ *\param peer_name the remote server address\r
+ *\param peer_port remote port number to connect the socket to\r
+ *\param options list of option for the bind operation.\r
+ */\r
+GF_Err gf_sk_bind(GF_Socket *sock, char *local_ip, u16 port, char *peer_name, u16 peer_port, u32 options);\r
+/*!\r
+ *\brief connects a socket \r
+ *\r
+ *Connects a socket to a remote peer on a given port \r
+ *\param sock the socket object\r
+ *\param peer_name the remote server address (IP or DNS)\r
+ *\param port remote port number to connect the socket to\r
+ *\param local_ip the local (client) address (IP or DNS) if any, NULL otherwise.\r
+ */\r
+GF_Err gf_sk_connect(GF_Socket *sock, char *peer_name, u16 port, char *local_ip);\r
+/*!\r
+ *\brief data emission\r
+ *\r
+ *Sends a buffer on the socket. The socket must be in a bound or connected mode\r
+ *\param sock the socket object\r
+ *\param buffer the data buffer to send\r
+ *\param length the data length to send\r
+ */\r
+GF_Err gf_sk_send(GF_Socket *sock, char *buffer, u32 length);\r
+/*!\r
+ *\brief data reception\r
+ * \r
+ *Fetches data on a socket. The socket must be in a bound or connected state\r
+ *\param sock the socket object\r
+ *\param buffer the recpetion buffer where data is written\r
+ *\param length the allocated size of the reception buffer\r
+ *\param start_from the offset in the reception buffer where to start writing\r
+ *\param read the actual number of bytes received\r
+ */\r
+GF_Err gf_sk_receive(GF_Socket *sock, char *buffer, u32 length, u32 start_from, u32 *read);\r
+/*!\r
+ *\brief socket listening\r
+ *\r
+ *Sets the socket in a listening state. This socket must have been bound to a port before \r
+ *\param sock the socket object\r
+ *\param max_conn the maximum number of simultaneous connection this socket will accept\r
+ */\r
+GF_Err gf_sk_listen(GF_Socket *sock, u32 max_conn);\r
+/*!\r
+ *\brief socket accept\r
+ *\r
+ *Accepts an incomming connection on a listening socket\r
+ *\param sock the socket object\r
+ *\param new_conn the resulting connection socket object\r
+ */\r
+GF_Err gf_sk_accept(GF_Socket *sock, GF_Socket **new_conn);\r
+\r
+/*!\r
+ *\brief server socket mode \r
+ *\r
+ *Disable the Nable algo (e.g. set TCP_NODELAY) and set the KEEPALIVE on \r
+ *\param sock the socket object\r
+ *\param server_on sets server mode on or off\r
+*/\r
+GF_Err gf_sk_server_mode(GF_Socket *sock, Bool server_on);\r
+\r
+/*!\r
+ *\brief get local host name\r
+ *\r
+ *Retrieves local host name.\r
+ *\param buffer destination buffer for name. Buffer must be GF_MAX_IP_NAME_LEN long\r
+ */\r
+GF_Err gf_sk_get_host_name(char *buffer);\r
+\r
+/*!\r
+ *\brief get local IP\r
+ *\r
+ *Gets local IP address of a connected socket, typically used for server after an ACCEPT\r
+ *\param sock the socket object\r
+ *\param buffer destination buffer for IP address. Buffer must be GF_MAX_IP_NAME_LEN long\r
+ */\r
+GF_Err gf_sk_get_local_ip(GF_Socket *sock, char *buffer);\r
+/*!\r
+ *\brief get local info\r
+ *\r
+ *Gets local socket info of a socket\r
+ *\param sock the socket object\r
+ *\param port local port number of the socket\r
+ *\param sock_type socket type (UDP or TCP)\r
+ */\r
+GF_Err gf_sk_get_local_info(GF_Socket *sock, u16 *port, u32 *sock_type);\r
+\r
+/*!\r
+ *\brief get remote address\r
+ *\r
+ *Gets the remote address of a peer. The socket MUST be connected.\r
+ *\param sock the socket object\r
+ *\param buffer destination buffer for IP address. Buffer must be GF_MAX_IP_NAME_LEN long\r
+ */\r
+GF_Err gf_sk_get_remote_address(GF_Socket *sock, char *buffer);\r
+\r
+/*!\r
+ *\brief set remote address\r
+ *\r
+ *Sets the remote address of a socket. This is used by connectionless sockets using SendTo and ReceiveFrom\r
+ *\param sock the socket object\r
+ *\param address the remote peer address\r
+ *\param port the remote peer port\r
+ */\r
+GF_Err gf_sk_set_remote(GF_Socket *sock, char *address, u16 port);\r
+\r
+\r
+/*!\r
+ *\brief multicast setup\r
+ *\r
+ *Performs multicast setup (BIND and JOIN) for the socket object\r
+ *\param sock the socket object\r
+ *\param multi_ip_add the multicast IP address\r
+ *\param multi_port the multicast port number\r
+ *\param TTL the multicast TTL (Time-To-Live)\r
+ *\param no_bind if sets, only join the multicast\r
+ *\param local_interface_ip the local interface IP address if desired. If NULL, the default interface will be used.\r
+ */\r
+GF_Err gf_sk_setup_multicast(GF_Socket *sock, char *multi_ip_add, u16 multi_port, u32 TTL, Bool no_bind, char *local_interface_ip);\r
+/*!\r
+ *brief multicast address test\r
+ *\r
+ *tests whether an IP address is a multicast one or not\r
+ *\param multi_ip_add the multicast IP address to test\r
+ *\return 1 if the address is a multicast one, 0 otherwise\r
+ */\r
+u32 gf_sk_is_multicast_address(char *multi_ip_add);\r
+\r
+/*!\r
+ *\brief send data with wait delay\r
+ *\r
+ *Sends data with a max wait delay. This is used for http / ftp sockets mainly. The socket must be connected.\r
+ *\param sock the socket object\r
+ *\param buffer the data buffer to send\r
+ *\param length the data length to send\r
+ *\param delay_sec the maximum delay in second to wait before aborting\r
+ *\return If the operation timeed out, the function will return a GF_IP_SOCK_WOULD_BLOCK error.\r
+ */\r
+GF_Err gf_sk_send_wait(GF_Socket *sock, char *buffer, u32 length, u32 delay_sec);\r
+/* receive data with a max wait delay of Second - used for http / ftp sockets mainly*/\r
+/*!\r
+ *\brief receive data with wait delay\r
+ *\r
+ *Fetches data with a max wait delay. This is used for http / ftp sockets mainly. The socket must be connected.\r
+ *\param sock the socket object\r
+ *\param buffer the recpetion buffer where data is written\r
+ *\param length the allocated size of the reception buffer\r
+ *\param start_from the offset in the reception buffer where to start writing\r
+ *\param read the actual number of bytes received\r
+ *\param delay_sec the maximum delay in second to wait before aborting\r
+ *\return If the operation timeed out, the function will return a GF_IP_SOCK_WOULD_BLOCK error.\r
+ */\r
+GF_Err gf_sk_receive_wait(GF_Socket *sock, char *buffer, u32 length, u32 start_from, u32 *read, u32 delay_sec);\r
+\r
+/*!\r
+ *\brief gets socket handle\r
+ *\r
+ *Gets the socket low-level handle as used by OpenSSL.\r
+ *\param sock the socket object\r
+ *\return the socket handle\r
+ */\r
+s32 gf_sk_get_handle(GF_Socket *sock);\r
+\r
+\r
+/*!\r
+ *\brief gets ipv6 support\r
+ *\r
+ *Returns IPV6 support information.\r
+ *\return 2 if the machine has IPV6 support, 1 if the library was compiled with IPV6 support, 0 otherwise\r
+ */\r
+u32 gf_net_has_ipv6();\r
+\r
+\r
+/*!\r
+ *\brief checks address type\r
+ *\r
+ *Checks if an address is an IPV6 or IPV4 one.\r
+ *\return true 1 if address is IPV6 one, 0 otherwise\r
+ */\r
+Bool gf_net_is_ipv6(char *address);\r
+\r
+\r
+/*!\r
+ *     \brief MobileIP Callback\r
+ *\r
+ * The gf_net_mobileip_ctrl_cbk type is the type for the callback of the \ref gf_net_set_mobileip_callback function. By default no mobileip is used\r
+ *     \param cbck Opaque user data.\r
+ *     \param start boolean indicating wether the MobileIP subsystem should be started or stoped.\r
+ *     \return Error code if needed.\r
+ *\r
+ */\r
+typedef GF_Err (*gf_net_mobileip_ctrl_cbk)(Bool start);\r
+\r
+/*!\r
+ *\brief Assigns MobileIP callback\r
+ *\r
+ *Assigns the MobileIP control callback.\r
+ *\param _mobip_cbk MobileIP control callback\r
+ */\r
+void gf_net_mobileip_set_callback(gf_net_mobileip_ctrl_cbk _mobip_cbk, const char *MobileIP);\r
+\r
+/*! @} */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif         /*_GF_NET_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/nodes_mpeg4.h b/tstools/DtsEdit/src/gpac/nodes_mpeg4.h
new file mode 100644 (file)
index 0000000..92929b9
--- /dev/null
@@ -0,0 +1,1916 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / Scene Graph sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *\r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.        \r
+ *\r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.\r
+ *\r
+ */\r
+\r
+\r
+/*\r
+       DO NOT MOFIFY - File generated on GMT Thu Aug 07 11:43:26 2008\r
+\r
+       BY MPEG4Gen for GPAC Version 0.4.5-DEV\r
+*/\r
+\r
+#ifndef _nodes_mpeg4_H\r
+#define _nodes_mpeg4_H\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/scenegraph_vrml.h>\r
+\r
+\r
+\r
+enum {\r
+       TAG_MPEG4_Anchor = GF_NODE_RANGE_FIRST_MPEG4,\r
+       TAG_MPEG4_AnimationStream,\r
+       TAG_MPEG4_Appearance,\r
+       TAG_MPEG4_AudioBuffer,\r
+       TAG_MPEG4_AudioClip,\r
+       TAG_MPEG4_AudioDelay,\r
+       TAG_MPEG4_AudioFX,\r
+       TAG_MPEG4_AudioMix,\r
+       TAG_MPEG4_AudioSource,\r
+       TAG_MPEG4_AudioSwitch,\r
+       TAG_MPEG4_Background,\r
+       TAG_MPEG4_Background2D,\r
+       TAG_MPEG4_Billboard,\r
+       TAG_MPEG4_Bitmap,\r
+       TAG_MPEG4_Box,\r
+       TAG_MPEG4_Circle,\r
+       TAG_MPEG4_Collision,\r
+       TAG_MPEG4_Color,\r
+       TAG_MPEG4_ColorInterpolator,\r
+       TAG_MPEG4_CompositeTexture2D,\r
+       TAG_MPEG4_CompositeTexture3D,\r
+       TAG_MPEG4_Conditional,\r
+       TAG_MPEG4_Cone,\r
+       TAG_MPEG4_Coordinate,\r
+       TAG_MPEG4_Coordinate2D,\r
+       TAG_MPEG4_CoordinateInterpolator,\r
+       TAG_MPEG4_CoordinateInterpolator2D,\r
+       TAG_MPEG4_Curve2D,\r
+       TAG_MPEG4_Cylinder,\r
+       TAG_MPEG4_CylinderSensor,\r
+       TAG_MPEG4_DirectionalLight,\r
+       TAG_MPEG4_DiscSensor,\r
+       TAG_MPEG4_ElevationGrid,\r
+       TAG_MPEG4_Expression,\r
+       TAG_MPEG4_Extrusion,\r
+       TAG_MPEG4_Face,\r
+       TAG_MPEG4_FaceDefMesh,\r
+       TAG_MPEG4_FaceDefTables,\r
+       TAG_MPEG4_FaceDefTransform,\r
+       TAG_MPEG4_FAP,\r
+       TAG_MPEG4_FDP,\r
+       TAG_MPEG4_FIT,\r
+       TAG_MPEG4_Fog,\r
+       TAG_MPEG4_FontStyle,\r
+       TAG_MPEG4_Form,\r
+       TAG_MPEG4_Group,\r
+       TAG_MPEG4_ImageTexture,\r
+       TAG_MPEG4_IndexedFaceSet,\r
+       TAG_MPEG4_IndexedFaceSet2D,\r
+       TAG_MPEG4_IndexedLineSet,\r
+       TAG_MPEG4_IndexedLineSet2D,\r
+       TAG_MPEG4_Inline,\r
+       TAG_MPEG4_LOD,\r
+       TAG_MPEG4_Layer2D,\r
+       TAG_MPEG4_Layer3D,\r
+       TAG_MPEG4_Layout,\r
+       TAG_MPEG4_LineProperties,\r
+       TAG_MPEG4_ListeningPoint,\r
+       TAG_MPEG4_Material,\r
+       TAG_MPEG4_Material2D,\r
+       TAG_MPEG4_MovieTexture,\r
+       TAG_MPEG4_NavigationInfo,\r
+       TAG_MPEG4_Normal,\r
+       TAG_MPEG4_NormalInterpolator,\r
+       TAG_MPEG4_OrderedGroup,\r
+       TAG_MPEG4_OrientationInterpolator,\r
+       TAG_MPEG4_PixelTexture,\r
+       TAG_MPEG4_PlaneSensor,\r
+       TAG_MPEG4_PlaneSensor2D,\r
+       TAG_MPEG4_PointLight,\r
+       TAG_MPEG4_PointSet,\r
+       TAG_MPEG4_PointSet2D,\r
+       TAG_MPEG4_PositionInterpolator,\r
+       TAG_MPEG4_PositionInterpolator2D,\r
+       TAG_MPEG4_ProximitySensor2D,\r
+       TAG_MPEG4_ProximitySensor,\r
+       TAG_MPEG4_QuantizationParameter,\r
+       TAG_MPEG4_Rectangle,\r
+       TAG_MPEG4_ScalarInterpolator,\r
+       TAG_MPEG4_Script,\r
+       TAG_MPEG4_Shape,\r
+       TAG_MPEG4_Sound,\r
+       TAG_MPEG4_Sound2D,\r
+       TAG_MPEG4_Sphere,\r
+       TAG_MPEG4_SphereSensor,\r
+       TAG_MPEG4_SpotLight,\r
+       TAG_MPEG4_Switch,\r
+       TAG_MPEG4_TermCap,\r
+       TAG_MPEG4_Text,\r
+       TAG_MPEG4_TextureCoordinate,\r
+       TAG_MPEG4_TextureTransform,\r
+       TAG_MPEG4_TimeSensor,\r
+       TAG_MPEG4_TouchSensor,\r
+       TAG_MPEG4_Transform,\r
+       TAG_MPEG4_Transform2D,\r
+       TAG_MPEG4_Valuator,\r
+       TAG_MPEG4_Viewpoint,\r
+       TAG_MPEG4_VisibilitySensor,\r
+       TAG_MPEG4_Viseme,\r
+       TAG_MPEG4_WorldInfo,\r
+       TAG_MPEG4_AcousticMaterial,\r
+       TAG_MPEG4_AcousticScene,\r
+       TAG_MPEG4_ApplicationWindow,\r
+       TAG_MPEG4_BAP,\r
+       TAG_MPEG4_BDP,\r
+       TAG_MPEG4_Body,\r
+       TAG_MPEG4_BodyDefTable,\r
+       TAG_MPEG4_BodySegmentConnectionHint,\r
+       TAG_MPEG4_DirectiveSound,\r
+       TAG_MPEG4_Hierarchical3DMesh,\r
+       TAG_MPEG4_MaterialKey,\r
+       TAG_MPEG4_PerceptualParameters,\r
+       TAG_MPEG4_TemporalTransform,\r
+       TAG_MPEG4_TemporalGroup,\r
+       TAG_MPEG4_ServerCommand,\r
+       TAG_MPEG4_InputSensor,\r
+       TAG_MPEG4_MatteTexture,\r
+       TAG_MPEG4_MediaBuffer,\r
+       TAG_MPEG4_MediaControl,\r
+       TAG_MPEG4_MediaSensor,\r
+       TAG_MPEG4_BitWrapper,\r
+       TAG_MPEG4_CoordinateInterpolator4D,\r
+       TAG_MPEG4_DepthImage,\r
+       TAG_MPEG4_FFD,\r
+       TAG_MPEG4_Implicit,\r
+       TAG_MPEG4_XXLFM_Appearance,\r
+       TAG_MPEG4_XXLFM_BlendList,\r
+       TAG_MPEG4_XXLFM_FrameList,\r
+       TAG_MPEG4_XXLFM_LightMap,\r
+       TAG_MPEG4_XXLFM_SurfaceMapList,\r
+       TAG_MPEG4_XXLFM_ViewMapList,\r
+       TAG_MPEG4_MeshGrid,\r
+       TAG_MPEG4_NonLinearDeformer,\r
+       TAG_MPEG4_NurbsCurve,\r
+       TAG_MPEG4_NurbsCurve2D,\r
+       TAG_MPEG4_NurbsSurface,\r
+       TAG_MPEG4_OctreeImage,\r
+       TAG_MPEG4_XXParticles,\r
+       TAG_MPEG4_XXParticleInitBox,\r
+       TAG_MPEG4_XXPlanarObstacle,\r
+       TAG_MPEG4_XXPointAttractor,\r
+       TAG_MPEG4_PointTexture,\r
+       TAG_MPEG4_PositionAnimator,\r
+       TAG_MPEG4_PositionAnimator2D,\r
+       TAG_MPEG4_PositionInterpolator4D,\r
+       TAG_MPEG4_ProceduralTexture,\r
+       TAG_MPEG4_Quadric,\r
+       TAG_MPEG4_SBBone,\r
+       TAG_MPEG4_SBMuscle,\r
+       TAG_MPEG4_SBSegment,\r
+       TAG_MPEG4_SBSite,\r
+       TAG_MPEG4_SBSkinnedModel,\r
+       TAG_MPEG4_SBVCAnimation,\r
+       TAG_MPEG4_ScalarAnimator,\r
+       TAG_MPEG4_SimpleTexture,\r
+       TAG_MPEG4_SolidRep,\r
+       TAG_MPEG4_SubdivisionSurface,\r
+       TAG_MPEG4_SubdivSurfaceSector,\r
+       TAG_MPEG4_WaveletSubdivisionSurface,\r
+       TAG_MPEG4_Clipper2D,\r
+       TAG_MPEG4_ColorTransform,\r
+       TAG_MPEG4_Ellipse,\r
+       TAG_MPEG4_LinearGradient,\r
+       TAG_MPEG4_PathLayout,\r
+       TAG_MPEG4_RadialGradient,\r
+       TAG_MPEG4_SynthesizedTexture,\r
+       TAG_MPEG4_TransformMatrix2D,\r
+       TAG_MPEG4_Viewport,\r
+       TAG_MPEG4_XCurve2D,\r
+       TAG_MPEG4_XFontStyle,\r
+       TAG_MPEG4_XLineProperties,\r
+       TAG_LastImplementedMPEG4\r
+};\r
+\r
+typedef struct _tagAnchor\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       SFString description;   /*exposedField*/\r
+       MFString parameter;     /*exposedField*/\r
+       MFURL url;      /*exposedField*/\r
+       SFBool activate;        /*eventIn*/\r
+       void (*on_activate)(GF_Node *pThis);    /*eventInHandler*/\r
+} M_Anchor;\r
+\r
+\r
+typedef struct _tagAnimationStream\r
+{\r
+       BASE_NODE\r
+       SFBool loop;    /*exposedField*/\r
+       SFFloat speed;  /*exposedField*/\r
+       SFTime startTime;       /*exposedField*/\r
+       SFTime stopTime;        /*exposedField*/\r
+       MFURL url;      /*exposedField*/\r
+       SFTime duration_changed;        /*eventOut*/\r
+       SFBool isActive;        /*eventOut*/\r
+} M_AnimationStream;\r
+\r
+\r
+typedef struct _tagAppearance\r
+{\r
+       BASE_NODE\r
+       GF_Node *material;      /*exposedField*/\r
+       GF_Node *texture;       /*exposedField*/\r
+       GF_Node *textureTransform;      /*exposedField*/\r
+} M_Appearance;\r
+\r
+\r
+typedef struct _tagAudioBuffer\r
+{\r
+       BASE_NODE\r
+       SFBool loop;    /*exposedField*/\r
+       SFFloat pitch;  /*exposedField*/\r
+       SFTime startTime;       /*exposedField*/\r
+       SFTime stopTime;        /*exposedField*/\r
+       GF_ChildNodeItem *children;     /*exposedField*/\r
+       SFInt32 numChan;        /*exposedField*/\r
+       MFInt32 phaseGroup;     /*exposedField*/\r
+       SFFloat length; /*exposedField*/\r
+       SFTime duration_changed;        /*eventOut*/\r
+       SFBool isActive;        /*eventOut*/\r
+} M_AudioBuffer;\r
+\r
+\r
+typedef struct _tagAudioClip\r
+{\r
+       BASE_NODE\r
+       SFString description;   /*exposedField*/\r
+       SFBool loop;    /*exposedField*/\r
+       SFFloat pitch;  /*exposedField*/\r
+       SFTime startTime;       /*exposedField*/\r
+       SFTime stopTime;        /*exposedField*/\r
+       MFURL url;      /*exposedField*/\r
+       SFTime duration_changed;        /*eventOut*/\r
+       SFBool isActive;        /*eventOut*/\r
+} M_AudioClip;\r
+\r
+\r
+typedef struct _tagAudioDelay\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       SFTime delay;   /*exposedField*/\r
+       SFInt32 numChan;        /*field*/\r
+       MFInt32 phaseGroup;     /*field*/\r
+} M_AudioDelay;\r
+\r
+\r
+typedef struct _tagAudioFX\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       SFString orch;  /*exposedField*/\r
+       SFString score; /*exposedField*/\r
+       MFFloat params; /*exposedField*/\r
+       SFInt32 numChan;        /*field*/\r
+       MFInt32 phaseGroup;     /*field*/\r
+} M_AudioFX;\r
+\r
+\r
+typedef struct _tagAudioMix\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       SFInt32 numInputs;      /*exposedField*/\r
+       MFFloat matrix; /*exposedField*/\r
+       SFInt32 numChan;        /*field*/\r
+       MFInt32 phaseGroup;     /*field*/\r
+} M_AudioMix;\r
+\r
+\r
+typedef struct _tagAudioSource\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       MFURL url;      /*exposedField*/\r
+       SFFloat pitch;  /*exposedField*/\r
+       SFFloat speed;  /*exposedField*/\r
+       SFTime startTime;       /*exposedField*/\r
+       SFTime stopTime;        /*exposedField*/\r
+       SFInt32 numChan;        /*field*/\r
+       MFInt32 phaseGroup;     /*field*/\r
+} M_AudioSource;\r
+\r
+\r
+typedef struct _tagAudioSwitch\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       MFInt32 whichChoice;    /*exposedField*/\r
+       SFInt32 numChan;        /*field*/\r
+       MFInt32 phaseGroup;     /*field*/\r
+} M_AudioSwitch;\r
+\r
+\r
+typedef struct _tagBackground\r
+{\r
+       BASE_NODE\r
+       SFBool set_bind;        /*eventIn*/\r
+       void (*on_set_bind)(GF_Node *pThis);    /*eventInHandler*/\r
+       MFFloat groundAngle;    /*exposedField*/\r
+       MFColor groundColor;    /*exposedField*/\r
+       MFURL backUrl;  /*exposedField*/\r
+       MFURL bottomUrl;        /*exposedField*/\r
+       MFURL frontUrl; /*exposedField*/\r
+       MFURL leftUrl;  /*exposedField*/\r
+       MFURL rightUrl; /*exposedField*/\r
+       MFURL topUrl;   /*exposedField*/\r
+       MFFloat skyAngle;       /*exposedField*/\r
+       MFColor skyColor;       /*exposedField*/\r
+       SFBool isBound; /*eventOut*/\r
+} M_Background;\r
+\r
+\r
+typedef struct _tagBackground2D\r
+{\r
+       BASE_NODE\r
+       SFBool set_bind;        /*eventIn*/\r
+       void (*on_set_bind)(GF_Node *pThis);    /*eventInHandler*/\r
+       SFColor backColor;      /*exposedField*/\r
+       MFURL url;      /*exposedField*/\r
+       SFBool isBound; /*eventOut*/\r
+} M_Background2D;\r
+\r
+\r
+typedef struct _tagBillboard\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       SFVec3f axisOfRotation; /*exposedField*/\r
+} M_Billboard;\r
+\r
+\r
+typedef struct _tagBitmap\r
+{\r
+       BASE_NODE\r
+       SFVec2f scale;  /*exposedField*/\r
+} M_Bitmap;\r
+\r
+\r
+typedef struct _tagBox\r
+{\r
+       BASE_NODE\r
+       SFVec3f size;   /*field*/\r
+} M_Box;\r
+\r
+\r
+typedef struct _tagCircle\r
+{\r
+       BASE_NODE\r
+       SFFloat radius; /*exposedField*/\r
+} M_Circle;\r
+\r
+\r
+typedef struct _tagCollision\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       SFBool collide; /*exposedField*/\r
+       GF_Node *proxy; /*field*/\r
+       SFTime collideTime;     /*eventOut*/\r
+} M_Collision;\r
+\r
+\r
+typedef struct _tagColor\r
+{\r
+       BASE_NODE\r
+       MFColor color;  /*exposedField*/\r
+} M_Color;\r
+\r
+\r
+typedef struct _tagColorInterpolator\r
+{\r
+       BASE_NODE\r
+       SFFloat set_fraction;   /*eventIn*/\r
+       void (*on_set_fraction)(GF_Node *pThis);        /*eventInHandler*/\r
+       MFFloat key;    /*exposedField*/\r
+       MFColor keyValue;       /*exposedField*/\r
+       SFColor value_changed;  /*eventOut*/\r
+} M_ColorInterpolator;\r
+\r
+\r
+typedef struct _tagCompositeTexture2D\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       SFInt32 pixelWidth;     /*exposedField*/\r
+       SFInt32 pixelHeight;    /*exposedField*/\r
+       GF_Node *background;    /*exposedField*/\r
+       GF_Node *viewport;      /*exposedField*/\r
+       SFInt32 repeatSandT;    /*field*/\r
+} M_CompositeTexture2D;\r
+\r
+\r
+typedef struct _tagCompositeTexture3D\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       SFInt32 pixelWidth;     /*exposedField*/\r
+       SFInt32 pixelHeight;    /*exposedField*/\r
+       GF_Node *background;    /*exposedField*/\r
+       GF_Node *fog;   /*exposedField*/\r
+       GF_Node *navigationInfo;        /*exposedField*/\r
+       GF_Node *viewpoint;     /*exposedField*/\r
+       SFBool repeatS; /*field*/\r
+       SFBool repeatT; /*field*/\r
+} M_CompositeTexture3D;\r
+\r
+\r
+typedef struct _tagConditional\r
+{\r
+       BASE_NODE\r
+       SFBool activate;        /*eventIn*/\r
+       void (*on_activate)(GF_Node *pThis);    /*eventInHandler*/\r
+       SFBool reverseActivate; /*eventIn*/\r
+       void (*on_reverseActivate)(GF_Node *pThis);     /*eventInHandler*/\r
+       SFCommandBuffer buffer; /*exposedField*/\r
+       SFBool isActive;        /*eventOut*/\r
+} M_Conditional;\r
+\r
+\r
+typedef struct _tagCone\r
+{\r
+       BASE_NODE\r
+       SFFloat bottomRadius;   /*field*/\r
+       SFFloat height; /*field*/\r
+       SFBool side;    /*field*/\r
+       SFBool bottom;  /*field*/\r
+} M_Cone;\r
+\r
+\r
+typedef struct _tagCoordinate\r
+{\r
+       BASE_NODE\r
+       MFVec3f point;  /*exposedField*/\r
+} M_Coordinate;\r
+\r
+\r
+typedef struct _tagCoordinate2D\r
+{\r
+       BASE_NODE\r
+       MFVec2f point;  /*exposedField*/\r
+} M_Coordinate2D;\r
+\r
+\r
+typedef struct _tagCoordinateInterpolator\r
+{\r
+       BASE_NODE\r
+       SFFloat set_fraction;   /*eventIn*/\r
+       void (*on_set_fraction)(GF_Node *pThis);        /*eventInHandler*/\r
+       MFFloat key;    /*exposedField*/\r
+       MFVec3f keyValue;       /*exposedField*/\r
+       MFVec3f value_changed;  /*eventOut*/\r
+} M_CoordinateInterpolator;\r
+\r
+\r
+typedef struct _tagCoordinateInterpolator2D\r
+{\r
+       BASE_NODE\r
+       SFFloat set_fraction;   /*eventIn*/\r
+       void (*on_set_fraction)(GF_Node *pThis);        /*eventInHandler*/\r
+       MFFloat key;    /*exposedField*/\r
+       MFVec2f keyValue;       /*exposedField*/\r
+       MFVec2f value_changed;  /*eventOut*/\r
+} M_CoordinateInterpolator2D;\r
+\r
+\r
+typedef struct _tagCurve2D\r
+{\r
+       BASE_NODE\r
+       GF_Node *point; /*exposedField*/\r
+       SFFloat fineness;       /*exposedField*/\r
+       MFInt32 type;   /*exposedField*/\r
+} M_Curve2D;\r
+\r
+\r
+typedef struct _tagCylinder\r
+{\r
+       BASE_NODE\r
+       SFBool bottom;  /*field*/\r
+       SFFloat height; /*field*/\r
+       SFFloat radius; /*field*/\r
+       SFBool side;    /*field*/\r
+       SFBool top;     /*field*/\r
+} M_Cylinder;\r
+\r
+\r
+typedef struct _tagCylinderSensor\r
+{\r
+       BASE_NODE\r
+       SFBool autoOffset;      /*exposedField*/\r
+       SFFloat diskAngle;      /*exposedField*/\r
+       SFBool enabled; /*exposedField*/\r
+       SFFloat maxAngle;       /*exposedField*/\r
+       SFFloat minAngle;       /*exposedField*/\r
+       SFFloat offset; /*exposedField*/\r
+       SFBool isActive;        /*eventOut*/\r
+       SFRotation rotation_changed;    /*eventOut*/\r
+       SFVec3f trackPoint_changed;     /*eventOut*/\r
+} M_CylinderSensor;\r
+\r
+\r
+typedef struct _tagDirectionalLight\r
+{\r
+       BASE_NODE\r
+       SFFloat ambientIntensity;       /*exposedField*/\r
+       SFColor color;  /*exposedField*/\r
+       SFVec3f direction;      /*exposedField*/\r
+       SFFloat intensity;      /*exposedField*/\r
+       SFBool on;      /*exposedField*/\r
+} M_DirectionalLight;\r
+\r
+\r
+typedef struct _tagDiscSensor\r
+{\r
+       BASE_NODE\r
+       SFBool autoOffset;      /*exposedField*/\r
+       SFBool enabled; /*exposedField*/\r
+       SFFloat maxAngle;       /*exposedField*/\r
+       SFFloat minAngle;       /*exposedField*/\r
+       SFFloat offset; /*exposedField*/\r
+       SFBool isActive;        /*eventOut*/\r
+       SFFloat rotation_changed;       /*eventOut*/\r
+       SFVec2f trackPoint_changed;     /*eventOut*/\r
+} M_DiscSensor;\r
+\r
+\r
+typedef struct _tagElevationGrid\r
+{\r
+       BASE_NODE\r
+       MFFloat set_height;     /*eventIn*/\r
+       void (*on_set_height)(GF_Node *pThis);  /*eventInHandler*/\r
+       GF_Node *color; /*exposedField*/\r
+       GF_Node *normal;        /*exposedField*/\r
+       GF_Node *texCoord;      /*exposedField*/\r
+       MFFloat height; /*field*/\r
+       SFBool ccw;     /*field*/\r
+       SFBool colorPerVertex;  /*field*/\r
+       SFFloat creaseAngle;    /*field*/\r
+       SFBool normalPerVertex; /*field*/\r
+       SFBool solid;   /*field*/\r
+       SFInt32 xDimension;     /*field*/\r
+       SFFloat xSpacing;       /*field*/\r
+       SFInt32 zDimension;     /*field*/\r
+       SFFloat zSpacing;       /*field*/\r
+} M_ElevationGrid;\r
+\r
+\r
+typedef struct _tagExtrusion\r
+{\r
+       BASE_NODE\r
+       MFVec2f set_crossSection;       /*eventIn*/\r
+       void (*on_set_crossSection)(GF_Node *pThis);    /*eventInHandler*/\r
+       MFRotation set_orientation;     /*eventIn*/\r
+       void (*on_set_orientation)(GF_Node *pThis);     /*eventInHandler*/\r
+       MFVec2f set_scale;      /*eventIn*/\r
+       void (*on_set_scale)(GF_Node *pThis);   /*eventInHandler*/\r
+       MFVec3f set_spine;      /*eventIn*/\r
+       void (*on_set_spine)(GF_Node *pThis);   /*eventInHandler*/\r
+       SFBool beginCap;        /*field*/\r
+       SFBool ccw;     /*field*/\r
+       SFBool convex;  /*field*/\r
+       SFFloat creaseAngle;    /*field*/\r
+       MFVec2f crossSection;   /*field*/\r
+       SFBool endCap;  /*field*/\r
+       MFRotation orientation; /*field*/\r
+       MFVec2f scale;  /*field*/\r
+       SFBool solid;   /*field*/\r
+       MFVec3f spine;  /*field*/\r
+} M_Extrusion;\r
+\r
+\r
+typedef struct _tagFog\r
+{\r
+       BASE_NODE\r
+       SFColor color;  /*exposedField*/\r
+       SFString fogType;       /*exposedField*/\r
+       SFFloat visibilityRange;        /*exposedField*/\r
+       SFBool set_bind;        /*eventIn*/\r
+       void (*on_set_bind)(GF_Node *pThis);    /*eventInHandler*/\r
+       SFBool isBound; /*eventOut*/\r
+} M_Fog;\r
+\r
+\r
+typedef struct _tagFontStyle\r
+{\r
+       BASE_NODE\r
+       MFString family;        /*exposedField*/\r
+       SFBool horizontal;      /*exposedField*/\r
+       MFString justify;       /*exposedField*/\r
+       SFString language;      /*exposedField*/\r
+       SFBool leftToRight;     /*exposedField*/\r
+       SFFloat size;   /*exposedField*/\r
+       SFFloat spacing;        /*exposedField*/\r
+       SFString style; /*exposedField*/\r
+       SFBool topToBottom;     /*exposedField*/\r
+} M_FontStyle;\r
+\r
+\r
+typedef struct _tagForm\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       SFVec2f size;   /*exposedField*/\r
+       MFInt32 groups; /*exposedField*/\r
+       MFString constraints;   /*exposedField*/\r
+       MFInt32 groupsIndex;    /*exposedField*/\r
+} M_Form;\r
+\r
+\r
+typedef struct _tagGroup\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+} M_Group;\r
+\r
+\r
+typedef struct _tagImageTexture\r
+{\r
+       BASE_NODE\r
+       MFURL url;      /*exposedField*/\r
+       SFBool repeatS; /*field*/\r
+       SFBool repeatT; /*field*/\r
+} M_ImageTexture;\r
+\r
+\r
+typedef struct _tagIndexedFaceSet\r
+{\r
+       BASE_NODE\r
+       MFInt32 set_colorIndex; /*eventIn*/\r
+       void (*on_set_colorIndex)(GF_Node *pThis);      /*eventInHandler*/\r
+       MFInt32 set_coordIndex; /*eventIn*/\r
+       void (*on_set_coordIndex)(GF_Node *pThis);      /*eventInHandler*/\r
+       MFInt32 set_normalIndex;        /*eventIn*/\r
+       void (*on_set_normalIndex)(GF_Node *pThis);     /*eventInHandler*/\r
+       MFInt32 set_texCoordIndex;      /*eventIn*/\r
+       void (*on_set_texCoordIndex)(GF_Node *pThis);   /*eventInHandler*/\r
+       GF_Node *color; /*exposedField*/\r
+       GF_Node *coord; /*exposedField*/\r
+       GF_Node *normal;        /*exposedField*/\r
+       GF_Node *texCoord;      /*exposedField*/\r
+       SFBool ccw;     /*field*/\r
+       MFInt32 colorIndex;     /*field*/\r
+       SFBool colorPerVertex;  /*field*/\r
+       SFBool convex;  /*field*/\r
+       MFInt32 coordIndex;     /*field*/\r
+       SFFloat creaseAngle;    /*field*/\r
+       MFInt32 normalIndex;    /*field*/\r
+       SFBool normalPerVertex; /*field*/\r
+       SFBool solid;   /*field*/\r
+       MFInt32 texCoordIndex;  /*field*/\r
+} M_IndexedFaceSet;\r
+\r
+\r
+typedef struct _tagIndexedFaceSet2D\r
+{\r
+       BASE_NODE\r
+       MFInt32 set_colorIndex; /*eventIn*/\r
+       void (*on_set_colorIndex)(GF_Node *pThis);      /*eventInHandler*/\r
+       MFInt32 set_coordIndex; /*eventIn*/\r
+       void (*on_set_coordIndex)(GF_Node *pThis);      /*eventInHandler*/\r
+       MFInt32 set_texCoordIndex;      /*eventIn*/\r
+       void (*on_set_texCoordIndex)(GF_Node *pThis);   /*eventInHandler*/\r
+       GF_Node *color; /*exposedField*/\r
+       GF_Node *coord; /*exposedField*/\r
+       GF_Node *texCoord;      /*exposedField*/\r
+       MFInt32 colorIndex;     /*field*/\r
+       SFBool colorPerVertex;  /*field*/\r
+       SFBool convex;  /*field*/\r
+       MFInt32 coordIndex;     /*field*/\r
+       MFInt32 texCoordIndex;  /*field*/\r
+} M_IndexedFaceSet2D;\r
+\r
+\r
+typedef struct _tagIndexedLineSet\r
+{\r
+       BASE_NODE\r
+       MFInt32 set_colorIndex; /*eventIn*/\r
+       void (*on_set_colorIndex)(GF_Node *pThis);      /*eventInHandler*/\r
+       MFInt32 set_coordIndex; /*eventIn*/\r
+       void (*on_set_coordIndex)(GF_Node *pThis);      /*eventInHandler*/\r
+       GF_Node *color; /*exposedField*/\r
+       GF_Node *coord; /*exposedField*/\r
+       MFInt32 colorIndex;     /*field*/\r
+       SFBool colorPerVertex;  /*field*/\r
+       MFInt32 coordIndex;     /*field*/\r
+} M_IndexedLineSet;\r
+\r
+\r
+typedef struct _tagIndexedLineSet2D\r
+{\r
+       BASE_NODE\r
+       MFInt32 set_colorIndex; /*eventIn*/\r
+       void (*on_set_colorIndex)(GF_Node *pThis);      /*eventInHandler*/\r
+       MFInt32 set_coordIndex; /*eventIn*/\r
+       void (*on_set_coordIndex)(GF_Node *pThis);      /*eventInHandler*/\r
+       GF_Node *color; /*exposedField*/\r
+       GF_Node *coord; /*exposedField*/\r
+       MFInt32 colorIndex;     /*field*/\r
+       SFBool colorPerVertex;  /*field*/\r
+       MFInt32 coordIndex;     /*field*/\r
+} M_IndexedLineSet2D;\r
+\r
+\r
+typedef struct _tagInline\r
+{\r
+       BASE_NODE\r
+       MFURL url;      /*exposedField*/\r
+} M_Inline;\r
+\r
+\r
+typedef struct _tagLOD\r
+{\r
+       BASE_NODE\r
+       GF_ChildNodeItem *level;        /*exposedField*/\r
+       SFVec3f center; /*field*/\r
+       MFFloat range;  /*field*/\r
+} M_LOD;\r
+\r
+\r
+typedef struct _tagLayer2D\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       SFVec2f size;   /*exposedField*/\r
+       GF_Node *background;    /*exposedField*/\r
+       GF_Node *viewport;      /*exposedField*/\r
+} M_Layer2D;\r
+\r
+\r
+typedef struct _tagLayer3D\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       SFVec2f size;   /*exposedField*/\r
+       GF_Node *background;    /*exposedField*/\r
+       GF_Node *fog;   /*exposedField*/\r
+       GF_Node *navigationInfo;        /*exposedField*/\r
+       GF_Node *viewpoint;     /*exposedField*/\r
+} M_Layer3D;\r
+\r
+\r
+typedef struct _tagLayout\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       SFBool wrap;    /*exposedField*/\r
+       SFVec2f size;   /*exposedField*/\r
+       SFBool horizontal;      /*exposedField*/\r
+       MFString justify;       /*exposedField*/\r
+       SFBool leftToRight;     /*exposedField*/\r
+       SFBool topToBottom;     /*exposedField*/\r
+       SFFloat spacing;        /*exposedField*/\r
+       SFBool smoothScroll;    /*exposedField*/\r
+       SFBool loop;    /*exposedField*/\r
+       SFBool scrollVertical;  /*exposedField*/\r
+       SFFloat scrollRate;     /*exposedField*/\r
+       SFInt32 scrollMode;     /*exposedField*/\r
+} M_Layout;\r
+\r
+\r
+typedef struct _tagLineProperties\r
+{\r
+       BASE_NODE\r
+       SFColor lineColor;      /*exposedField*/\r
+       SFInt32 lineStyle;      /*exposedField*/\r
+       SFFloat width;  /*exposedField*/\r
+} M_LineProperties;\r
+\r
+\r
+typedef struct _tagListeningPoint\r
+{\r
+       BASE_NODE\r
+       SFBool set_bind;        /*eventIn*/\r
+       void (*on_set_bind)(GF_Node *pThis);    /*eventInHandler*/\r
+       SFBool jump;    /*exposedField*/\r
+       SFRotation orientation; /*exposedField*/\r
+       SFVec3f position;       /*exposedField*/\r
+       SFString description;   /*field*/\r
+       SFTime bindTime;        /*eventOut*/\r
+       SFBool isBound; /*eventOut*/\r
+} M_ListeningPoint;\r
+\r
+\r
+typedef struct _tagMaterial\r
+{\r
+       BASE_NODE\r
+       SFFloat ambientIntensity;       /*exposedField*/\r
+       SFColor diffuseColor;   /*exposedField*/\r
+       SFColor emissiveColor;  /*exposedField*/\r
+       SFFloat shininess;      /*exposedField*/\r
+       SFColor specularColor;  /*exposedField*/\r
+       SFFloat transparency;   /*exposedField*/\r
+} M_Material;\r
+\r
+\r
+typedef struct _tagMaterial2D\r
+{\r
+       BASE_NODE\r
+       SFColor emissiveColor;  /*exposedField*/\r
+       SFBool filled;  /*exposedField*/\r
+       GF_Node *lineProps;     /*exposedField*/\r
+       SFFloat transparency;   /*exposedField*/\r
+} M_Material2D;\r
+\r
+\r
+typedef struct _tagMovieTexture\r
+{\r
+       BASE_NODE\r
+       SFBool loop;    /*exposedField*/\r
+       SFFloat speed;  /*exposedField*/\r
+       SFTime startTime;       /*exposedField*/\r
+       SFTime stopTime;        /*exposedField*/\r
+       MFURL url;      /*exposedField*/\r
+       SFBool repeatS; /*field*/\r
+       SFBool repeatT; /*field*/\r
+       SFTime duration_changed;        /*eventOut*/\r
+       SFBool isActive;        /*eventOut*/\r
+} M_MovieTexture;\r
+\r
+\r
+typedef struct _tagNavigationInfo\r
+{\r
+       BASE_NODE\r
+       SFBool set_bind;        /*eventIn*/\r
+       void (*on_set_bind)(GF_Node *pThis);    /*eventInHandler*/\r
+       MFFloat avatarSize;     /*exposedField*/\r
+       SFBool headlight;       /*exposedField*/\r
+       SFFloat speed;  /*exposedField*/\r
+       MFString type;  /*exposedField*/\r
+       SFFloat visibilityLimit;        /*exposedField*/\r
+       SFBool isBound; /*eventOut*/\r
+} M_NavigationInfo;\r
+\r
+\r
+typedef struct _tagNormal\r
+{\r
+       BASE_NODE\r
+       MFVec3f vector; /*exposedField*/\r
+} M_Normal;\r
+\r
+\r
+typedef struct _tagNormalInterpolator\r
+{\r
+       BASE_NODE\r
+       SFFloat set_fraction;   /*eventIn*/\r
+       void (*on_set_fraction)(GF_Node *pThis);        /*eventInHandler*/\r
+       MFFloat key;    /*exposedField*/\r
+       MFVec3f keyValue;       /*exposedField*/\r
+       MFVec3f value_changed;  /*eventOut*/\r
+} M_NormalInterpolator;\r
+\r
+\r
+typedef struct _tagOrderedGroup\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       MFFloat order;  /*exposedField*/\r
+} M_OrderedGroup;\r
+\r
+\r
+typedef struct _tagOrientationInterpolator\r
+{\r
+       BASE_NODE\r
+       SFFloat set_fraction;   /*eventIn*/\r
+       void (*on_set_fraction)(GF_Node *pThis);        /*eventInHandler*/\r
+       MFFloat key;    /*exposedField*/\r
+       MFRotation keyValue;    /*exposedField*/\r
+       SFRotation value_changed;       /*eventOut*/\r
+} M_OrientationInterpolator;\r
+\r
+\r
+typedef struct _tagPixelTexture\r
+{\r
+       BASE_NODE\r
+       SFImage image;  /*exposedField*/\r
+       SFBool repeatS; /*field*/\r
+       SFBool repeatT; /*field*/\r
+} M_PixelTexture;\r
+\r
+\r
+typedef struct _tagPlaneSensor\r
+{\r
+       BASE_NODE\r
+       SFBool autoOffset;      /*exposedField*/\r
+       SFBool enabled; /*exposedField*/\r
+       SFVec2f maxPosition;    /*exposedField*/\r
+       SFVec2f minPosition;    /*exposedField*/\r
+       SFVec3f offset; /*exposedField*/\r
+       SFBool isActive;        /*eventOut*/\r
+       SFVec3f trackPoint_changed;     /*eventOut*/\r
+       SFVec3f translation_changed;    /*eventOut*/\r
+} M_PlaneSensor;\r
+\r
+\r
+typedef struct _tagPlaneSensor2D\r
+{\r
+       BASE_NODE\r
+       SFBool autoOffset;      /*exposedField*/\r
+       SFBool enabled; /*exposedField*/\r
+       SFVec2f maxPosition;    /*exposedField*/\r
+       SFVec2f minPosition;    /*exposedField*/\r
+       SFVec2f offset; /*exposedField*/\r
+       SFBool isActive;        /*eventOut*/\r
+       SFVec2f trackPoint_changed;     /*eventOut*/\r
+       SFVec2f translation_changed;    /*eventOut*/\r
+} M_PlaneSensor2D;\r
+\r
+\r
+typedef struct _tagPointLight\r
+{\r
+       BASE_NODE\r
+       SFFloat ambientIntensity;       /*exposedField*/\r
+       SFVec3f attenuation;    /*exposedField*/\r
+       SFColor color;  /*exposedField*/\r
+       SFFloat intensity;      /*exposedField*/\r
+       SFVec3f location;       /*exposedField*/\r
+       SFBool on;      /*exposedField*/\r
+       SFFloat radius; /*exposedField*/\r
+} M_PointLight;\r
+\r
+\r
+typedef struct _tagPointSet\r
+{\r
+       BASE_NODE\r
+       GF_Node *color; /*exposedField*/\r
+       GF_Node *coord; /*exposedField*/\r
+} M_PointSet;\r
+\r
+\r
+typedef struct _tagPointSet2D\r
+{\r
+       BASE_NODE\r
+       GF_Node *color; /*exposedField*/\r
+       GF_Node *coord; /*exposedField*/\r
+} M_PointSet2D;\r
+\r
+\r
+typedef struct _tagPositionInterpolator\r
+{\r
+       BASE_NODE\r
+       SFFloat set_fraction;   /*eventIn*/\r
+       void (*on_set_fraction)(GF_Node *pThis);        /*eventInHandler*/\r
+       MFFloat key;    /*exposedField*/\r
+       MFVec3f keyValue;       /*exposedField*/\r
+       SFVec3f value_changed;  /*eventOut*/\r
+} M_PositionInterpolator;\r
+\r
+\r
+typedef struct _tagPositionInterpolator2D\r
+{\r
+       BASE_NODE\r
+       SFFloat set_fraction;   /*eventIn*/\r
+       void (*on_set_fraction)(GF_Node *pThis);        /*eventInHandler*/\r
+       MFFloat key;    /*exposedField*/\r
+       MFVec2f keyValue;       /*exposedField*/\r
+       SFVec2f value_changed;  /*eventOut*/\r
+} M_PositionInterpolator2D;\r
+\r
+\r
+typedef struct _tagProximitySensor2D\r
+{\r
+       BASE_NODE\r
+       SFVec2f center; /*exposedField*/\r
+       SFVec2f size;   /*exposedField*/\r
+       SFBool enabled; /*exposedField*/\r
+       SFBool isActive;        /*eventOut*/\r
+       SFVec2f position_changed;       /*eventOut*/\r
+       SFFloat orientation_changed;    /*eventOut*/\r
+       SFTime enterTime;       /*eventOut*/\r
+       SFTime exitTime;        /*eventOut*/\r
+} M_ProximitySensor2D;\r
+\r
+\r
+typedef struct _tagProximitySensor\r
+{\r
+       BASE_NODE\r
+       SFVec3f center; /*exposedField*/\r
+       SFVec3f size;   /*exposedField*/\r
+       SFBool enabled; /*exposedField*/\r
+       SFBool isActive;        /*eventOut*/\r
+       SFVec3f position_changed;       /*eventOut*/\r
+       SFRotation orientation_changed; /*eventOut*/\r
+       SFTime enterTime;       /*eventOut*/\r
+       SFTime exitTime;        /*eventOut*/\r
+} M_ProximitySensor;\r
+\r
+\r
+typedef struct _tagQuantizationParameter\r
+{\r
+       BASE_NODE\r
+       SFBool isLocal; /*field*/\r
+       SFBool position3DQuant; /*field*/\r
+       SFVec3f position3DMin;  /*field*/\r
+       SFVec3f position3DMax;  /*field*/\r
+       SFInt32 position3DNbBits;       /*field*/\r
+       SFBool position2DQuant; /*field*/\r
+       SFVec2f position2DMin;  /*field*/\r
+       SFVec2f position2DMax;  /*field*/\r
+       SFInt32 position2DNbBits;       /*field*/\r
+       SFBool drawOrderQuant;  /*field*/\r
+       SFFloat drawOrderMin;   /*field*/\r
+       SFFloat drawOrderMax;   /*field*/\r
+       SFInt32 drawOrderNbBits;        /*field*/\r
+       SFBool colorQuant;      /*field*/\r
+       SFFloat colorMin;       /*field*/\r
+       SFFloat colorMax;       /*field*/\r
+       SFInt32 colorNbBits;    /*field*/\r
+       SFBool textureCoordinateQuant;  /*field*/\r
+       SFFloat textureCoordinateMin;   /*field*/\r
+       SFFloat textureCoordinateMax;   /*field*/\r
+       SFInt32 textureCoordinateNbBits;        /*field*/\r
+       SFBool angleQuant;      /*field*/\r
+       SFFloat angleMin;       /*field*/\r
+       SFFloat angleMax;       /*field*/\r
+       SFInt32 angleNbBits;    /*field*/\r
+       SFBool scaleQuant;      /*field*/\r
+       SFFloat scaleMin;       /*field*/\r
+       SFFloat scaleMax;       /*field*/\r
+       SFInt32 scaleNbBits;    /*field*/\r
+       SFBool keyQuant;        /*field*/\r
+       SFFloat keyMin; /*field*/\r
+       SFFloat keyMax; /*field*/\r
+       SFInt32 keyNbBits;      /*field*/\r
+       SFBool normalQuant;     /*field*/\r
+       SFInt32 normalNbBits;   /*field*/\r
+       SFBool sizeQuant;       /*field*/\r
+       SFFloat sizeMin;        /*field*/\r
+       SFFloat sizeMax;        /*field*/\r
+       SFInt32 sizeNbBits;     /*field*/\r
+       SFBool useEfficientCoding;      /*field*/\r
+} M_QuantizationParameter;\r
+\r
+\r
+typedef struct _tagRectangle\r
+{\r
+       BASE_NODE\r
+       SFVec2f size;   /*exposedField*/\r
+} M_Rectangle;\r
+\r
+\r
+typedef struct _tagScalarInterpolator\r
+{\r
+       BASE_NODE\r
+       SFFloat set_fraction;   /*eventIn*/\r
+       void (*on_set_fraction)(GF_Node *pThis);        /*eventInHandler*/\r
+       MFFloat key;    /*exposedField*/\r
+       MFFloat keyValue;       /*exposedField*/\r
+       SFFloat value_changed;  /*eventOut*/\r
+} M_ScalarInterpolator;\r
+\r
+\r
+typedef struct _tagScript\r
+{\r
+       BASE_NODE\r
+       MFScript url;   /*exposedField*/\r
+       SFBool directOutput;    /*field*/\r
+       SFBool mustEvaluate;    /*field*/\r
+} M_Script;\r
+\r
+\r
+typedef struct _tagShape\r
+{\r
+       BASE_NODE\r
+       GF_Node *appearance;    /*exposedField*/\r
+       GF_Node *geometry;      /*exposedField*/\r
+} M_Shape;\r
+\r
+\r
+typedef struct _tagSound\r
+{\r
+       BASE_NODE\r
+       SFVec3f direction;      /*exposedField*/\r
+       SFFloat intensity;      /*exposedField*/\r
+       SFVec3f location;       /*exposedField*/\r
+       SFFloat maxBack;        /*exposedField*/\r
+       SFFloat maxFront;       /*exposedField*/\r
+       SFFloat minBack;        /*exposedField*/\r
+       SFFloat minFront;       /*exposedField*/\r
+       SFFloat priority;       /*exposedField*/\r
+       GF_Node *source;        /*exposedField*/\r
+       SFBool spatialize;      /*field*/\r
+} M_Sound;\r
+\r
+\r
+typedef struct _tagSound2D\r
+{\r
+       BASE_NODE\r
+       SFFloat intensity;      /*exposedField*/\r
+       SFVec2f location;       /*exposedField*/\r
+       GF_Node *source;        /*exposedField*/\r
+       SFBool spatialize;      /*field*/\r
+} M_Sound2D;\r
+\r
+\r
+typedef struct _tagSphere\r
+{\r
+       BASE_NODE\r
+       SFFloat radius; /*field*/\r
+} M_Sphere;\r
+\r
+\r
+typedef struct _tagSphereSensor\r
+{\r
+       BASE_NODE\r
+       SFBool autoOffset;      /*exposedField*/\r
+       SFBool enabled; /*exposedField*/\r
+       SFRotation offset;      /*exposedField*/\r
+       SFBool isActive;        /*eventOut*/\r
+       SFRotation rotation_changed;    /*eventOut*/\r
+       SFVec3f trackPoint_changed;     /*eventOut*/\r
+} M_SphereSensor;\r
+\r
+\r
+typedef struct _tagSpotLight\r
+{\r
+       BASE_NODE\r
+       SFFloat ambientIntensity;       /*exposedField*/\r
+       SFVec3f attenuation;    /*exposedField*/\r
+       SFFloat beamWidth;      /*exposedField*/\r
+       SFColor color;  /*exposedField*/\r
+       SFFloat cutOffAngle;    /*exposedField*/\r
+       SFVec3f direction;      /*exposedField*/\r
+       SFFloat intensity;      /*exposedField*/\r
+       SFVec3f location;       /*exposedField*/\r
+       SFBool on;      /*exposedField*/\r
+       SFFloat radius; /*exposedField*/\r
+} M_SpotLight;\r
+\r
+\r
+typedef struct _tagSwitch\r
+{\r
+       BASE_NODE\r
+       GF_ChildNodeItem *choice;       /*exposedField*/\r
+       SFInt32 whichChoice;    /*exposedField*/\r
+} M_Switch;\r
+\r
+\r
+typedef struct _tagTermCap\r
+{\r
+       BASE_NODE\r
+       SFTime evaluate;        /*eventIn*/\r
+       void (*on_evaluate)(GF_Node *pThis);    /*eventInHandler*/\r
+       SFInt32 capability;     /*exposedField*/\r
+       SFInt32 value;  /*eventOut*/\r
+} M_TermCap;\r
+\r
+\r
+typedef struct _tagText\r
+{\r
+       BASE_NODE\r
+       MFString string;        /*exposedField*/\r
+       MFFloat length; /*exposedField*/\r
+       GF_Node *fontStyle;     /*exposedField*/\r
+       SFFloat maxExtent;      /*exposedField*/\r
+} M_Text;\r
+\r
+\r
+typedef struct _tagTextureCoordinate\r
+{\r
+       BASE_NODE\r
+       MFVec2f point;  /*exposedField*/\r
+} M_TextureCoordinate;\r
+\r
+\r
+typedef struct _tagTextureTransform\r
+{\r
+       BASE_NODE\r
+       SFVec2f center; /*exposedField*/\r
+       SFFloat rotation;       /*exposedField*/\r
+       SFVec2f scale;  /*exposedField*/\r
+       SFVec2f translation;    /*exposedField*/\r
+} M_TextureTransform;\r
+\r
+\r
+typedef struct _tagTimeSensor\r
+{\r
+       BASE_NODE\r
+       SFTime cycleInterval;   /*exposedField*/\r
+       SFBool enabled; /*exposedField*/\r
+       SFBool loop;    /*exposedField*/\r
+       SFTime startTime;       /*exposedField*/\r
+       SFTime stopTime;        /*exposedField*/\r
+       SFTime cycleTime;       /*eventOut*/\r
+       SFFloat fraction_changed;       /*eventOut*/\r
+       SFBool isActive;        /*eventOut*/\r
+       SFTime time;    /*eventOut*/\r
+} M_TimeSensor;\r
+\r
+\r
+typedef struct _tagTouchSensor\r
+{\r
+       BASE_NODE\r
+       SFBool enabled; /*exposedField*/\r
+       SFVec3f hitNormal_changed;      /*eventOut*/\r
+       SFVec3f hitPoint_changed;       /*eventOut*/\r
+       SFVec2f hitTexCoord_changed;    /*eventOut*/\r
+       SFBool isActive;        /*eventOut*/\r
+       SFBool isOver;  /*eventOut*/\r
+       SFTime touchTime;       /*eventOut*/\r
+} M_TouchSensor;\r
+\r
+\r
+typedef struct _tagTransform\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       SFVec3f center; /*exposedField*/\r
+       SFRotation rotation;    /*exposedField*/\r
+       SFVec3f scale;  /*exposedField*/\r
+       SFRotation scaleOrientation;    /*exposedField*/\r
+       SFVec3f translation;    /*exposedField*/\r
+} M_Transform;\r
+\r
+\r
+typedef struct _tagTransform2D\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       SFVec2f center; /*exposedField*/\r
+       SFFloat rotationAngle;  /*exposedField*/\r
+       SFVec2f scale;  /*exposedField*/\r
+       SFFloat scaleOrientation;       /*exposedField*/\r
+       SFVec2f translation;    /*exposedField*/\r
+} M_Transform2D;\r
+\r
+\r
+typedef struct _tagValuator\r
+{\r
+       BASE_NODE\r
+       SFBool inSFBool;        /*eventIn*/\r
+       void (*on_inSFBool)(GF_Node *pThis);    /*eventInHandler*/\r
+       SFColor inSFColor;      /*eventIn*/\r
+       void (*on_inSFColor)(GF_Node *pThis);   /*eventInHandler*/\r
+       MFColor inMFColor;      /*eventIn*/\r
+       void (*on_inMFColor)(GF_Node *pThis);   /*eventInHandler*/\r
+       SFFloat inSFFloat;      /*eventIn*/\r
+       void (*on_inSFFloat)(GF_Node *pThis);   /*eventInHandler*/\r
+       MFFloat inMFFloat;      /*eventIn*/\r
+       void (*on_inMFFloat)(GF_Node *pThis);   /*eventInHandler*/\r
+       SFInt32 inSFInt32;      /*eventIn*/\r
+       void (*on_inSFInt32)(GF_Node *pThis);   /*eventInHandler*/\r
+       MFInt32 inMFInt32;      /*eventIn*/\r
+       void (*on_inMFInt32)(GF_Node *pThis);   /*eventInHandler*/\r
+       SFRotation inSFRotation;        /*eventIn*/\r
+       void (*on_inSFRotation)(GF_Node *pThis);        /*eventInHandler*/\r
+       MFRotation inMFRotation;        /*eventIn*/\r
+       void (*on_inMFRotation)(GF_Node *pThis);        /*eventInHandler*/\r
+       SFString inSFString;    /*eventIn*/\r
+       void (*on_inSFString)(GF_Node *pThis);  /*eventInHandler*/\r
+       MFString inMFString;    /*eventIn*/\r
+       void (*on_inMFString)(GF_Node *pThis);  /*eventInHandler*/\r
+       SFTime inSFTime;        /*eventIn*/\r
+       void (*on_inSFTime)(GF_Node *pThis);    /*eventInHandler*/\r
+       SFVec2f inSFVec2f;      /*eventIn*/\r
+       void (*on_inSFVec2f)(GF_Node *pThis);   /*eventInHandler*/\r
+       MFVec2f inMFVec2f;      /*eventIn*/\r
+       void (*on_inMFVec2f)(GF_Node *pThis);   /*eventInHandler*/\r
+       SFVec3f inSFVec3f;      /*eventIn*/\r
+       void (*on_inSFVec3f)(GF_Node *pThis);   /*eventInHandler*/\r
+       MFVec3f inMFVec3f;      /*eventIn*/\r
+       void (*on_inMFVec3f)(GF_Node *pThis);   /*eventInHandler*/\r
+       SFBool outSFBool;       /*eventOut*/\r
+       SFColor outSFColor;     /*eventOut*/\r
+       MFColor outMFColor;     /*eventOut*/\r
+       SFFloat outSFFloat;     /*eventOut*/\r
+       MFFloat outMFFloat;     /*eventOut*/\r
+       SFInt32 outSFInt32;     /*eventOut*/\r
+       MFInt32 outMFInt32;     /*eventOut*/\r
+       SFRotation outSFRotation;       /*eventOut*/\r
+       MFRotation outMFRotation;       /*eventOut*/\r
+       SFString outSFString;   /*eventOut*/\r
+       MFString outMFString;   /*eventOut*/\r
+       SFTime outSFTime;       /*eventOut*/\r
+       SFVec2f outSFVec2f;     /*eventOut*/\r
+       MFVec2f outMFVec2f;     /*eventOut*/\r
+       SFVec3f outSFVec3f;     /*eventOut*/\r
+       MFVec3f outMFVec3f;     /*eventOut*/\r
+       SFFloat Factor1;        /*exposedField*/\r
+       SFFloat Factor2;        /*exposedField*/\r
+       SFFloat Factor3;        /*exposedField*/\r
+       SFFloat Factor4;        /*exposedField*/\r
+       SFFloat Offset1;        /*exposedField*/\r
+       SFFloat Offset2;        /*exposedField*/\r
+       SFFloat Offset3;        /*exposedField*/\r
+       SFFloat Offset4;        /*exposedField*/\r
+       SFBool Sum;     /*exposedField*/\r
+} M_Valuator;\r
+\r
+\r
+typedef struct _tagViewpoint\r
+{\r
+       BASE_NODE\r
+       SFBool set_bind;        /*eventIn*/\r
+       void (*on_set_bind)(GF_Node *pThis);    /*eventInHandler*/\r
+       SFFloat fieldOfView;    /*exposedField*/\r
+       SFBool jump;    /*exposedField*/\r
+       SFRotation orientation; /*exposedField*/\r
+       SFVec3f position;       /*exposedField*/\r
+       SFString description;   /*field*/\r
+       SFTime bindTime;        /*eventOut*/\r
+       SFBool isBound; /*eventOut*/\r
+} M_Viewpoint;\r
+\r
+\r
+typedef struct _tagVisibilitySensor\r
+{\r
+       BASE_NODE\r
+       SFVec3f center; /*exposedField*/\r
+       SFBool enabled; /*exposedField*/\r
+       SFVec3f size;   /*exposedField*/\r
+       SFTime enterTime;       /*eventOut*/\r
+       SFTime exitTime;        /*eventOut*/\r
+       SFBool isActive;        /*eventOut*/\r
+} M_VisibilitySensor;\r
+\r
+\r
+typedef struct _tagWorldInfo\r
+{\r
+       BASE_NODE\r
+       MFString info;  /*field*/\r
+       SFString title; /*field*/\r
+} M_WorldInfo;\r
+\r
+\r
+typedef struct _tagAcousticMaterial\r
+{\r
+       BASE_NODE\r
+       SFFloat ambientIntensity;       /*exposedField*/\r
+       SFColor diffuseColor;   /*exposedField*/\r
+       SFColor emissiveColor;  /*exposedField*/\r
+       SFFloat shininess;      /*exposedField*/\r
+       SFColor specularColor;  /*exposedField*/\r
+       SFFloat transparency;   /*exposedField*/\r
+       MFFloat reffunc;        /*field*/\r
+       MFFloat transfunc;      /*field*/\r
+       MFFloat refFrequency;   /*field*/\r
+       MFFloat transFrequency; /*field*/\r
+} M_AcousticMaterial;\r
+\r
+\r
+typedef struct _tagAcousticScene\r
+{\r
+       BASE_NODE\r
+       SFVec3f center; /*field*/\r
+       SFVec3f Size;   /*field*/\r
+       MFTime reverbTime;      /*field*/\r
+       MFFloat reverbFreq;     /*field*/\r
+       SFFloat reverbLevel;    /*exposedField*/\r
+       SFTime reverbDelay;     /*exposedField*/\r
+} M_AcousticScene;\r
+\r
+\r
+typedef struct _tagApplicationWindow\r
+{\r
+       BASE_NODE\r
+       SFBool isActive;        /*exposedField*/\r
+       SFTime startTime;       /*exposedField*/\r
+       SFTime stopTime;        /*exposedField*/\r
+       SFString description;   /*exposedField*/\r
+       MFString parameter;     /*exposedField*/\r
+       MFURL url;      /*exposedField*/\r
+       SFVec2f size;   /*exposedField*/\r
+} M_ApplicationWindow;\r
+\r
+\r
+typedef struct _tagDirectiveSound\r
+{\r
+       BASE_NODE\r
+       SFVec3f direction;      /*exposedField*/\r
+       SFFloat intensity;      /*exposedField*/\r
+       SFVec3f location;       /*exposedField*/\r
+       GF_Node *source;        /*exposedField*/\r
+       GF_Node *perceptualParameters;  /*exposedField*/\r
+       SFBool roomEffect;      /*exposedField*/\r
+       SFBool spatialize;      /*exposedField*/\r
+       MFFloat directivity;    /*field*/\r
+       MFFloat angles; /*field*/\r
+       MFFloat frequency;      /*field*/\r
+       SFFloat speedOfSound;   /*field*/\r
+       SFFloat distance;       /*field*/\r
+       SFBool useAirabs;       /*field*/\r
+} M_DirectiveSound;\r
+\r
+\r
+typedef struct _tagHierarchical3DMesh\r
+{\r
+       BASE_NODE\r
+       SFInt32 triangleBudget; /*eventIn*/\r
+       void (*on_triangleBudget)(GF_Node *pThis);      /*eventInHandler*/\r
+       SFFloat level;  /*exposedField*/\r
+       MFURL url;      /*field*/\r
+       SFBool doneLoading;     /*eventOut*/\r
+} M_Hierarchical3DMesh;\r
+\r
+\r
+typedef struct _tagMaterialKey\r
+{\r
+       BASE_NODE\r
+       SFBool isKeyed; /*exposedField*/\r
+       SFBool isRGB;   /*exposedField*/\r
+       SFColor keyColor;       /*exposedField*/\r
+       SFFloat lowThreshold;   /*exposedField*/\r
+       SFFloat highThreshold;  /*exposedField*/\r
+       SFFloat transparency;   /*exposedField*/\r
+} M_MaterialKey;\r
+\r
+\r
+typedef struct _tagPerceptualParameters\r
+{\r
+       BASE_NODE\r
+       SFFloat sourcePresence; /*exposedField*/\r
+       SFFloat sourceWarmth;   /*exposedField*/\r
+       SFFloat sourceBrilliance;       /*exposedField*/\r
+       SFFloat roomPresence;   /*exposedField*/\r
+       SFFloat runningReverberance;    /*exposedField*/\r
+       SFFloat envelopment;    /*exposedField*/\r
+       SFFloat lateReverberance;       /*exposedField*/\r
+       SFFloat heavyness;      /*exposedField*/\r
+       SFFloat liveness;       /*exposedField*/\r
+       MFFloat omniDirectivity;        /*exposedField*/\r
+       MFFloat directFilterGains;      /*exposedField*/\r
+       MFFloat inputFilterGains;       /*exposedField*/\r
+       SFFloat refDistance;    /*exposedField*/\r
+       SFFloat freqLow;        /*exposedField*/\r
+       SFFloat freqHigh;       /*exposedField*/\r
+       SFTime timeLimit1;      /*exposedField*/\r
+       SFTime timeLimit2;      /*exposedField*/\r
+       SFTime timeLimit3;      /*exposedField*/\r
+       SFTime modalDensity;    /*exposedField*/\r
+} M_PerceptualParameters;\r
+\r
+\r
+typedef struct _tagTemporalTransform\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       MFURL url;      /*exposedField*/\r
+       SFTime startTime;       /*exposedField*/\r
+       SFTime optimalDuration; /*exposedField*/\r
+       SFBool active;  /*exposedField*/\r
+       SFFloat speed;  /*exposedField*/\r
+       SFVec2f scalability;    /*exposedField*/\r
+       MFInt32 stretchMode;    /*exposedField*/\r
+       MFInt32 shrinkMode;     /*exposedField*/\r
+       SFTime maxDelay;        /*exposedField*/\r
+       SFTime actualDuration;  /*eventOut*/\r
+} M_TemporalTransform;\r
+\r
+\r
+typedef struct _tagTemporalGroup\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       SFBool costart; /*field*/\r
+       SFBool coend;   /*field*/\r
+       SFBool meet;    /*field*/\r
+       MFFloat priority;       /*exposedField*/\r
+       SFBool isActive;        /*eventOut*/\r
+       SFInt32 activeChild;    /*eventOut*/\r
+} M_TemporalGroup;\r
+\r
+\r
+typedef struct _tagServerCommand\r
+{\r
+       BASE_NODE\r
+       SFBool trigger; /*eventIn*/\r
+       void (*on_trigger)(GF_Node *pThis);     /*eventInHandler*/\r
+       SFBool enable;  /*exposedField*/\r
+       MFURL url;      /*exposedField*/\r
+       SFString command;       /*exposedField*/\r
+} M_ServerCommand;\r
+\r
+\r
+typedef struct _tagInputSensor\r
+{\r
+       BASE_NODE\r
+       SFBool enabled; /*exposedField*/\r
+       SFCommandBuffer buffer; /*exposedField*/\r
+       MFURL url;      /*exposedField*/\r
+       SFTime eventTime;       /*eventOut*/\r
+} M_InputSensor;\r
+\r
+\r
+typedef struct _tagMatteTexture\r
+{\r
+       BASE_NODE\r
+       GF_Node *surfaceA;      /*field*/\r
+       GF_Node *surfaceB;      /*field*/\r
+       GF_Node *alphaSurface;  /*field*/\r
+       SFString operation;     /*exposedField*/\r
+       SFBool overwrite;       /*field*/\r
+       SFFloat fraction;       /*exposedField*/\r
+       MFFloat parameter;      /*exposedField*/\r
+} M_MatteTexture;\r
+\r
+\r
+typedef struct _tagMediaBuffer\r
+{\r
+       BASE_NODE\r
+       SFFloat bufferSize;     /*exposedField*/\r
+       MFURL url;      /*exposedField*/\r
+       SFTime mediaStartTime;  /*exposedField*/\r
+       SFTime mediaStopTime;   /*exposedField*/\r
+       SFBool isBuffered;      /*eventOut*/\r
+       SFBool enabled; /*exposedField*/\r
+} M_MediaBuffer;\r
+\r
+\r
+typedef struct _tagMediaControl\r
+{\r
+       BASE_NODE\r
+       MFURL url;      /*exposedField*/\r
+       SFTime mediaStartTime;  /*exposedField*/\r
+       SFTime mediaStopTime;   /*exposedField*/\r
+       SFFloat mediaSpeed;     /*exposedField*/\r
+       SFBool loop;    /*exposedField*/\r
+       SFBool preRoll; /*exposedField*/\r
+       SFBool mute;    /*exposedField*/\r
+       SFBool enabled; /*exposedField*/\r
+       SFBool isPreRolled;     /*eventOut*/\r
+} M_MediaControl;\r
+\r
+\r
+typedef struct _tagMediaSensor\r
+{\r
+       BASE_NODE\r
+       MFURL url;      /*exposedField*/\r
+       SFTime mediaCurrentTime;        /*eventOut*/\r
+       SFTime streamObjectStartTime;   /*eventOut*/\r
+       SFTime mediaDuration;   /*eventOut*/\r
+       SFBool isActive;        /*eventOut*/\r
+       MFString info;  /*eventOut*/\r
+} M_MediaSensor;\r
+\r
+\r
+typedef struct _tagCoordinateInterpolator4D\r
+{\r
+       BASE_NODE\r
+       SFFloat set_fraction;   /*eventIn*/\r
+       void (*on_set_fraction)(GF_Node *pThis);        /*eventInHandler*/\r
+       MFFloat key;    /*exposedField*/\r
+       MFVec4f keyValue;       /*exposedField*/\r
+       MFVec4f value_changed;  /*eventOut*/\r
+} M_CoordinateInterpolator4D;\r
+\r
+\r
+typedef struct _tagNonLinearDeformer\r
+{\r
+       BASE_NODE\r
+       SFVec3f axis;   /*exposedField*/\r
+       MFFloat extend; /*exposedField*/\r
+       GF_Node *geometry;      /*exposedField*/\r
+       SFFloat param;  /*exposedField*/\r
+       SFInt32 type;   /*exposedField*/\r
+} M_NonLinearDeformer;\r
+\r
+\r
+typedef struct _tagPositionAnimator\r
+{\r
+       BASE_NODE\r
+       SFFloat set_fraction;   /*eventIn*/\r
+       void (*on_set_fraction)(GF_Node *pThis);        /*eventInHandler*/\r
+       SFVec2f fromTo; /*exposedField*/\r
+       MFFloat key;    /*exposedField*/\r
+       MFRotation keyOrientation;      /*exposedField*/\r
+       SFInt32 keyType;        /*exposedField*/\r
+       MFVec2f keySpline;      /*exposedField*/\r
+       MFVec3f keyValue;       /*exposedField*/\r
+       SFInt32 keyValueType;   /*exposedField*/\r
+       SFVec3f offset; /*exposedField*/\r
+       MFFloat weight; /*exposedField*/\r
+       SFVec3f endValue;       /*eventOut*/\r
+       SFRotation rotation_changed;    /*eventOut*/\r
+       SFVec3f value_changed;  /*eventOut*/\r
+} M_PositionAnimator;\r
+\r
+\r
+typedef struct _tagPositionAnimator2D\r
+{\r
+       BASE_NODE\r
+       SFFloat set_fraction;   /*eventIn*/\r
+       void (*on_set_fraction)(GF_Node *pThis);        /*eventInHandler*/\r
+       SFVec2f fromTo; /*exposedField*/\r
+       MFFloat key;    /*exposedField*/\r
+       SFInt32 keyOrientation; /*exposedField*/\r
+       SFInt32 keyType;        /*exposedField*/\r
+       MFVec2f keySpline;      /*exposedField*/\r
+       MFVec2f keyValue;       /*exposedField*/\r
+       SFInt32 keyValueType;   /*exposedField*/\r
+       SFVec2f offset; /*exposedField*/\r
+       MFFloat weight; /*exposedField*/\r
+       SFVec2f endValue;       /*eventOut*/\r
+       SFFloat rotation_changed;       /*eventOut*/\r
+       SFVec2f value_changed;  /*eventOut*/\r
+} M_PositionAnimator2D;\r
+\r
+\r
+typedef struct _tagPositionInterpolator4D\r
+{\r
+       BASE_NODE\r
+       SFFloat set_fraction;   /*eventIn*/\r
+       void (*on_set_fraction)(GF_Node *pThis);        /*eventInHandler*/\r
+       MFFloat key;    /*exposedField*/\r
+       MFVec4f keyValue;       /*exposedField*/\r
+       SFVec4f value_changed;  /*eventOut*/\r
+} M_PositionInterpolator4D;\r
+\r
+\r
+typedef struct _tagScalarAnimator\r
+{\r
+       BASE_NODE\r
+       SFFloat set_fraction;   /*eventIn*/\r
+       void (*on_set_fraction)(GF_Node *pThis);        /*eventInHandler*/\r
+       SFVec2f fromTo; /*exposedField*/\r
+       MFFloat key;    /*exposedField*/\r
+       SFInt32 keyType;        /*exposedField*/\r
+       MFVec2f keySpline;      /*exposedField*/\r
+       MFFloat keyValue;       /*exposedField*/\r
+       SFInt32 keyValueType;   /*exposedField*/\r
+       SFFloat offset; /*exposedField*/\r
+       MFFloat weight; /*exposedField*/\r
+       SFFloat endValue;       /*eventOut*/\r
+       SFFloat value_changed;  /*eventOut*/\r
+} M_ScalarAnimator;\r
+\r
+\r
+typedef struct _tagClipper2D\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       GF_Node *geometry;      /*exposedField*/\r
+       SFBool inside;  /*exposedField*/\r
+       GF_Node *transform;     /*exposedField*/\r
+       SFBool XOR;     /*exposedField*/\r
+} M_Clipper2D;\r
+\r
+\r
+typedef struct _tagColorTransform\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       SFFloat mrr;    /*exposedField*/\r
+       SFFloat mrg;    /*exposedField*/\r
+       SFFloat mrb;    /*exposedField*/\r
+       SFFloat mra;    /*exposedField*/\r
+       SFFloat tr;     /*exposedField*/\r
+       SFFloat mgr;    /*exposedField*/\r
+       SFFloat mgg;    /*exposedField*/\r
+       SFFloat mgb;    /*exposedField*/\r
+       SFFloat mga;    /*exposedField*/\r
+       SFFloat tg;     /*exposedField*/\r
+       SFFloat mbr;    /*exposedField*/\r
+       SFFloat mbg;    /*exposedField*/\r
+       SFFloat mbb;    /*exposedField*/\r
+       SFFloat mba;    /*exposedField*/\r
+       SFFloat tb;     /*exposedField*/\r
+       SFFloat mar;    /*exposedField*/\r
+       SFFloat mag;    /*exposedField*/\r
+       SFFloat mab;    /*exposedField*/\r
+       SFFloat maa;    /*exposedField*/\r
+       SFFloat ta;     /*exposedField*/\r
+} M_ColorTransform;\r
+\r
+\r
+typedef struct _tagEllipse\r
+{\r
+       BASE_NODE\r
+       SFVec2f radius; /*exposedField*/\r
+} M_Ellipse;\r
+\r
+\r
+typedef struct _tagLinearGradient\r
+{\r
+       BASE_NODE\r
+       SFVec2f endPoint;       /*exposedField*/\r
+       MFFloat key;    /*exposedField*/\r
+       MFColor keyValue;       /*exposedField*/\r
+       MFFloat opacity;        /*exposedField*/\r
+       SFInt32 spreadMethod;   /*exposedField*/\r
+       SFVec2f startPoint;     /*exposedField*/\r
+       GF_Node *transform;     /*exposedField*/\r
+} M_LinearGradient;\r
+\r
+\r
+typedef struct _tagPathLayout\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       GF_Node *geometry;      /*exposedField*/\r
+       MFInt32 alignment;      /*exposedField*/\r
+       SFFloat pathOffset;     /*exposedField*/\r
+       SFFloat spacing;        /*exposedField*/\r
+       SFBool reverseLayout;   /*exposedField*/\r
+       SFInt32 wrapMode;       /*exposedField*/\r
+       SFBool splitText;       /*exposedField*/\r
+} M_PathLayout;\r
+\r
+\r
+typedef struct _tagRadialGradient\r
+{\r
+       BASE_NODE\r
+       SFVec2f center; /*exposedField*/\r
+       SFVec2f focalPoint;     /*exposedField*/\r
+       MFFloat key;    /*exposedField*/\r
+       MFColor keyValue;       /*exposedField*/\r
+       MFFloat opacity;        /*exposedField*/\r
+       SFFloat radius; /*exposedField*/\r
+       SFInt32 spreadMethod;   /*exposedField*/\r
+       GF_Node *transform;     /*exposedField*/\r
+} M_RadialGradient;\r
+\r
+\r
+typedef struct _tagTransformMatrix2D\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       SFFloat mxx;    /*exposedField*/\r
+       SFFloat mxy;    /*exposedField*/\r
+       SFFloat tx;     /*exposedField*/\r
+       SFFloat myx;    /*exposedField*/\r
+       SFFloat myy;    /*exposedField*/\r
+       SFFloat ty;     /*exposedField*/\r
+} M_TransformMatrix2D;\r
+\r
+\r
+typedef struct _tagViewport\r
+{\r
+       BASE_NODE\r
+       SFBool set_bind;        /*eventIn*/\r
+       void (*on_set_bind)(GF_Node *pThis);    /*eventInHandler*/\r
+       SFVec2f position;       /*exposedField*/\r
+       SFVec2f size;   /*exposedField*/\r
+       SFFloat orientation;    /*exposedField*/\r
+       MFInt32 alignment;      /*exposedField*/\r
+       SFInt32 fit;    /*exposedField*/\r
+       SFString description;   /*field*/\r
+       SFTime bindTime;        /*eventOut*/\r
+       SFBool isBound; /*eventOut*/\r
+} M_Viewport;\r
+\r
+\r
+typedef struct _tagXCurve2D\r
+{\r
+       BASE_NODE\r
+       GF_Node *point; /*exposedField*/\r
+       SFFloat fineness;       /*exposedField*/\r
+       MFInt32 type;   /*exposedField*/\r
+} M_XCurve2D;\r
+\r
+\r
+typedef struct _tagXFontStyle\r
+{\r
+       BASE_NODE\r
+       MFString fontName;      /*exposedField*/\r
+       SFBool horizontal;      /*exposedField*/\r
+       MFString justify;       /*exposedField*/\r
+       SFString language;      /*exposedField*/\r
+       SFBool leftToRight;     /*exposedField*/\r
+       SFFloat size;   /*exposedField*/\r
+       SFString stretch;       /*exposedField*/\r
+       SFFloat letterSpacing;  /*exposedField*/\r
+       SFFloat wordSpacing;    /*exposedField*/\r
+       SFInt32 weight; /*exposedField*/\r
+       SFBool fontKerning;     /*exposedField*/\r
+       SFString style; /*exposedField*/\r
+       SFBool topToBottom;     /*exposedField*/\r
+       MFString featureName;   /*exposedField*/\r
+       MFInt32 featureStartOffset;     /*exposedField*/\r
+       MFInt32 featureLength;  /*exposedField*/\r
+       MFInt32 featureValue;   /*exposedField*/\r
+} M_XFontStyle;\r
+\r
+\r
+typedef struct _tagXLineProperties\r
+{\r
+       BASE_NODE\r
+       SFColor lineColor;      /*exposedField*/\r
+       SFInt32 lineStyle;      /*exposedField*/\r
+       SFBool isCenterAligned; /*exposedField*/\r
+       SFBool isScalable;      /*exposedField*/\r
+       SFInt32 lineCap;        /*exposedField*/\r
+       SFInt32 lineJoin;       /*exposedField*/\r
+       SFFloat miterLimit;     /*exposedField*/\r
+       SFFloat transparency;   /*exposedField*/\r
+       SFFloat width;  /*exposedField*/\r
+       SFFloat dashOffset;     /*exposedField*/\r
+       MFFloat dashes; /*exposedField*/\r
+       GF_Node *texture;       /*exposedField*/\r
+       GF_Node *textureTransform;      /*exposedField*/\r
+} M_XLineProperties;\r
+\r
+\r
+/*NodeDataType tags*/\r
+enum {\r
+       NDT_SFWorldNode = 1,\r
+       NDT_SF3DNode,\r
+       NDT_SF2DNode,\r
+       NDT_SFStreamingNode,\r
+       NDT_SFAppearanceNode,\r
+       NDT_SFAudioNode,\r
+       NDT_SFBackground3DNode,\r
+       NDT_SFBackground2DNode,\r
+       NDT_SFGeometryNode,\r
+       NDT_SFColorNode,\r
+       NDT_SFTextureNode,\r
+       NDT_SFCoordinateNode,\r
+       NDT_SFCoordinate2DNode,\r
+       NDT_SFExpressionNode,\r
+       NDT_SFFaceDefMeshNode,\r
+       NDT_SFFaceDefTablesNode,\r
+       NDT_SFFaceDefTransformNode,\r
+       NDT_SFFAPNode,\r
+       NDT_SFFDPNode,\r
+       NDT_SFFITNode,\r
+       NDT_SFFogNode,\r
+       NDT_SFFontStyleNode,\r
+       NDT_SFTopNode,\r
+       NDT_SFLinePropertiesNode,\r
+       NDT_SFMaterialNode,\r
+       NDT_SFNavigationInfoNode,\r
+       NDT_SFNormalNode,\r
+       NDT_SFTextureCoordinateNode,\r
+       NDT_SFTextureTransformNode,\r
+       NDT_SFViewpointNode,\r
+       NDT_SFVisemeNode,\r
+       NDT_SFViewportNode,\r
+       NDT_SFBAPNode,\r
+       NDT_SFBDPNode,\r
+       NDT_SFBodyDefTableNode,\r
+       NDT_SFBodySegmentConnectionHintNode,\r
+       NDT_SFPerceptualParameterNode,\r
+       NDT_SFTemporalNode,\r
+       NDT_SFDepthImageNode,\r
+       NDT_SFBlendListNode,\r
+       NDT_SFFrameListNode,\r
+       NDT_SFLightMapNode,\r
+       NDT_SFSurfaceMapNode,\r
+       NDT_SFViewMapNode,\r
+       NDT_SFParticleInitializerNode,\r
+       NDT_SFInfluenceNode,\r
+       NDT_SFDepthTextureNode,\r
+       NDT_SFSBBoneNode,\r
+       NDT_SFSBMuscleNode,\r
+       NDT_SFSBSegmentNode,\r
+       NDT_SFSBSiteNode,\r
+       NDT_SFBaseMeshNode,\r
+       NDT_SFSubdivSurfaceSectorNode\r
+};\r
+\r
+/*All BIFS versions handled*/\r
+#define GF_BIFS_NUM_VERSION            6\r
+\r
+enum {\r
+       GF_BIFS_V1 = 1,\r
+       GF_BIFS_V2,\r
+       GF_BIFS_V3,\r
+       GF_BIFS_V4,\r
+       GF_BIFS_V5,\r
+       GF_BIFS_V6,\r
+       GF_BIFS_LAST_VERSION = GF_BIFS_V6\r
+};\r
+\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+\r
+#endif         /*_nodes_mpeg4_H*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/nodes_svg.h b/tstools/DtsEdit/src/gpac/nodes_svg.h
new file mode 100644 (file)
index 0000000..7c10e3b
--- /dev/null
@@ -0,0 +1,491 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Authors: Cyril Concolato - Jean Le Feuvre\r
+ *    Copyright (c)2004-200X ENST - All rights reserved\r
+ *\r
+ *  This file is part of GPAC / XML-based Scene Graph sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *\r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.        \r
+ *\r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.\r
+ *\r
+ */\r
+\r
+#ifndef _GF_XML_NODES_H\r
+#define _GF_XML_NODES_H\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/scenegraph_svg.h>\r
+\r
+enum {\r
+       TAG_SVG_a = GF_NODE_RANGE_FIRST_SVG,\r
+       TAG_SVG_animate,\r
+       TAG_SVG_animateColor,\r
+       TAG_SVG_animateMotion,\r
+       TAG_SVG_animateTransform,\r
+       TAG_SVG_animation,\r
+       TAG_SVG_audio,\r
+       TAG_SVG_circle,\r
+       TAG_SVG_defs,\r
+       TAG_SVG_desc,\r
+       TAG_SVG_discard,\r
+       TAG_SVG_ellipse,\r
+       TAG_SVG_font,\r
+       TAG_SVG_font_face,\r
+       TAG_SVG_font_face_src,\r
+       TAG_SVG_font_face_uri,\r
+       TAG_SVG_foreignObject,\r
+       TAG_SVG_g,\r
+       TAG_SVG_glyph,\r
+       TAG_SVG_handler,\r
+       TAG_SVG_hkern,\r
+       TAG_SVG_image,\r
+       TAG_SVG_line,\r
+       TAG_SVG_linearGradient,\r
+       TAG_SVG_listener,\r
+       TAG_SVG_metadata,\r
+       TAG_SVG_missing_glyph,\r
+       TAG_SVG_mpath,\r
+       TAG_SVG_path,\r
+       TAG_SVG_polygon,\r
+       TAG_SVG_polyline,\r
+       TAG_SVG_prefetch,\r
+       TAG_SVG_radialGradient,\r
+       TAG_SVG_rect,\r
+       TAG_SVG_script,\r
+       TAG_SVG_set,\r
+       TAG_SVG_solidColor,\r
+       TAG_SVG_stop,\r
+       TAG_SVG_svg,\r
+       TAG_SVG_switch,\r
+       TAG_SVG_tbreak,\r
+       TAG_SVG_text,\r
+       TAG_SVG_textArea,\r
+       TAG_SVG_title,\r
+       TAG_SVG_tspan,\r
+       TAG_SVG_use,\r
+       TAG_SVG_video,\r
+\r
+       \r
+       TAG_LSR_conditional,\r
+       TAG_LSR_cursorManager,\r
+       TAG_LSR_rectClip,\r
+       TAG_LSR_selector,\r
+       TAG_LSR_simpleLayout,\r
+\r
+       /*undefined elements (when parsing) use this tag*/\r
+       TAG_SVG_UndefinedElement\r
+};\r
+\r
+/* Definition of SVG 3 attribute internal tags - 200 defined */\r
+/* TAG names are made of "TAG_SVG_ATT_" + SVG attribute name (with - replaced by _) */\r
+enum {\r
+       TAG_SVG_ATT_id = TAG_SVG_ATT_RANGE_FIRST,\r
+       TAG_SVG_ATT__class,     \r
+\r
+       TAG_SVG_ATT_requiredFeatures,\r
+       TAG_SVG_ATT_requiredExtensions,\r
+       TAG_SVG_ATT_requiredFormats,\r
+       TAG_SVG_ATT_requiredFonts,\r
+       TAG_SVG_ATT_systemLanguage,\r
+       TAG_SVG_ATT_display,\r
+       TAG_SVG_ATT_visibility,\r
+       TAG_SVG_ATT_image_rendering,\r
+       TAG_SVG_ATT_pointer_events,\r
+       TAG_SVG_ATT_shape_rendering,\r
+       TAG_SVG_ATT_text_rendering,\r
+       TAG_SVG_ATT_audio_level,\r
+       TAG_SVG_ATT_viewport_fill,\r
+       TAG_SVG_ATT_viewport_fill_opacity,\r
+       TAG_SVG_ATT_overflow,\r
+       TAG_SVG_ATT_fill_opacity,\r
+       TAG_SVG_ATT_stroke_opacity,\r
+       TAG_SVG_ATT_fill,\r
+       TAG_SVG_ATT_fill_rule,\r
+       TAG_SVG_ATT_stroke,\r
+       TAG_SVG_ATT_stroke_dasharray,\r
+       TAG_SVG_ATT_stroke_dashoffset,\r
+       TAG_SVG_ATT_stroke_linecap,\r
+       TAG_SVG_ATT_stroke_linejoin,\r
+       TAG_SVG_ATT_stroke_miterlimit,\r
+       TAG_SVG_ATT_stroke_width,\r
+       TAG_SVG_ATT_color,\r
+       TAG_SVG_ATT_color_rendering,\r
+       TAG_SVG_ATT_vector_effect,\r
+       TAG_SVG_ATT_solid_color,\r
+       TAG_SVG_ATT_solid_opacity,\r
+       TAG_SVG_ATT_display_align,\r
+       TAG_SVG_ATT_line_increment,\r
+       TAG_SVG_ATT_stop_color,\r
+       TAG_SVG_ATT_stop_opacity,\r
+       TAG_SVG_ATT_font_family,\r
+       TAG_SVG_ATT_font_size,\r
+       TAG_SVG_ATT_font_style,\r
+       TAG_SVG_ATT_font_variant,\r
+       TAG_SVG_ATT_font_weight,\r
+       TAG_SVG_ATT_text_anchor,\r
+       TAG_SVG_ATT_text_align,\r
+       TAG_SVG_ATT_text_decoration,\r
+       TAG_SVG_ATT_focusHighlight,\r
+       TAG_SVG_ATT_externalResourcesRequired,\r
+       TAG_SVG_ATT_focusable,\r
+       TAG_SVG_ATT_nav_next,\r
+       TAG_SVG_ATT_nav_prev,\r
+       TAG_SVG_ATT_nav_up,\r
+       TAG_SVG_ATT_nav_up_right,\r
+       TAG_SVG_ATT_nav_right,\r
+       TAG_SVG_ATT_nav_down_right,\r
+       TAG_SVG_ATT_nav_down,\r
+       TAG_SVG_ATT_nav_down_left,\r
+       TAG_SVG_ATT_nav_left,\r
+       TAG_SVG_ATT_nav_up_left,\r
+       TAG_SVG_ATT_transform,\r
+       TAG_SVG_ATT_target,\r
+       TAG_SVG_ATT_attributeName,\r
+       TAG_SVG_ATT_attributeType,\r
+       TAG_SVG_ATT_begin,\r
+       TAG_SVG_ATT_dur,\r
+       TAG_SVG_ATT_end,\r
+       TAG_SVG_ATT_repeatCount,\r
+       TAG_SVG_ATT_repeatDur,\r
+       TAG_SVG_ATT_restart,\r
+       TAG_SVG_ATT_smil_fill,\r
+       TAG_SVG_ATT_min,\r
+       TAG_SVG_ATT_max,\r
+       TAG_SVG_ATT_to,\r
+       TAG_SVG_ATT_calcMode,\r
+       TAG_SVG_ATT_values,\r
+       TAG_SVG_ATT_keyTimes,\r
+       TAG_SVG_ATT_keySplines,\r
+       TAG_SVG_ATT_from,\r
+       TAG_SVG_ATT_by,\r
+       TAG_SVG_ATT_additive,\r
+       TAG_SVG_ATT_accumulate,\r
+       TAG_SVG_ATT_path,\r
+       TAG_SVG_ATT_keyPoints,\r
+       TAG_SVG_ATT_rotate,\r
+       TAG_SVG_ATT_origin,\r
+       TAG_SVG_ATT_transform_type,\r
+       TAG_SVG_ATT_clipBegin,\r
+       TAG_SVG_ATT_clipEnd,\r
+       TAG_SVG_ATT_syncBehavior,\r
+       TAG_SVG_ATT_syncTolerance,\r
+       TAG_SVG_ATT_syncMaster,\r
+       TAG_SVG_ATT_syncReference,\r
+       TAG_SVG_ATT_x,\r
+       TAG_SVG_ATT_y,\r
+       TAG_SVG_ATT_width,\r
+       TAG_SVG_ATT_height,\r
+       TAG_SVG_ATT_preserveAspectRatio,\r
+       TAG_SVG_ATT_initialVisibility,\r
+       TAG_SVG_ATT_type,\r
+       TAG_SVG_ATT_cx,\r
+       TAG_SVG_ATT_cy,\r
+       TAG_SVG_ATT_r,\r
+       TAG_SVG_ATT_cursorManager_x,\r
+       TAG_SVG_ATT_cursorManager_y,\r
+       TAG_SVG_ATT_rx,\r
+       TAG_SVG_ATT_ry,\r
+       TAG_SVG_ATT_horiz_adv_x,\r
+       TAG_SVG_ATT_horiz_origin_x,\r
+       TAG_SVG_ATT_font_stretch,\r
+       TAG_SVG_ATT_unicode_range,\r
+       TAG_SVG_ATT_panose_1,\r
+       TAG_SVG_ATT_widths,\r
+       TAG_SVG_ATT_bbox,\r
+       TAG_SVG_ATT_units_per_em,\r
+       TAG_SVG_ATT_stemv,\r
+       TAG_SVG_ATT_stemh,\r
+       TAG_SVG_ATT_slope,\r
+       TAG_SVG_ATT_cap_height,\r
+       TAG_SVG_ATT_x_height,\r
+       TAG_SVG_ATT_accent_height,\r
+       TAG_SVG_ATT_ascent,\r
+       TAG_SVG_ATT_descent,\r
+       TAG_SVG_ATT_ideographic,\r
+       TAG_SVG_ATT_alphabetic,\r
+       TAG_SVG_ATT_mathematical,\r
+       TAG_SVG_ATT_hanging,\r
+       TAG_SVG_ATT_underline_position,\r
+       TAG_SVG_ATT_underline_thickness,\r
+       TAG_SVG_ATT_strikethrough_position,\r
+       TAG_SVG_ATT_strikethrough_thickness,\r
+       TAG_SVG_ATT_overline_position,\r
+       TAG_SVG_ATT_overline_thickness,\r
+       TAG_SVG_ATT_d,\r
+       TAG_SVG_ATT_unicode,\r
+       TAG_SVG_ATT_glyph_name,\r
+       TAG_SVG_ATT_arabic_form,\r
+       TAG_SVG_ATT_lang,\r
+       TAG_SVG_ATT_u1,\r
+       TAG_SVG_ATT_g1,\r
+       TAG_SVG_ATT_u2,\r
+       TAG_SVG_ATT_g2,\r
+       TAG_SVG_ATT_k,\r
+       TAG_SVG_ATT_opacity,\r
+       TAG_SVG_ATT_x1,\r
+       TAG_SVG_ATT_y1,\r
+       TAG_SVG_ATT_x2,\r
+       TAG_SVG_ATT_y2,\r
+       TAG_SVG_ATT_gradientUnits,\r
+       TAG_SVG_ATT_spreadMethod,\r
+       TAG_SVG_ATT_gradientTransform,\r
+       TAG_SVG_ATT_pathLength,\r
+       TAG_SVG_ATT_points,\r
+       TAG_SVG_ATT_mediaSize,\r
+       TAG_SVG_ATT_mediaTime,\r
+       TAG_SVG_ATT_mediaCharacterEncoding,\r
+       TAG_SVG_ATT_mediaContentEncodings,\r
+       TAG_SVG_ATT_bandwidth,\r
+       TAG_SVG_ATT_fx,\r
+       TAG_SVG_ATT_fy,\r
+       TAG_SVG_ATT_size,\r
+       TAG_SVG_ATT_choice,\r
+       TAG_SVG_ATT_delta,\r
+       TAG_SVG_ATT_offset,\r
+       TAG_SVG_ATT_syncBehaviorDefault,\r
+       TAG_SVG_ATT_syncToleranceDefault,\r
+       TAG_SVG_ATT_viewBox,\r
+       TAG_SVG_ATT_zoomAndPan,\r
+       TAG_SVG_ATT_version,\r
+       TAG_SVG_ATT_baseProfile,\r
+       TAG_SVG_ATT_contentScriptType,\r
+       TAG_SVG_ATT_snapshotTime,\r
+       TAG_SVG_ATT_timelineBegin,\r
+       TAG_SVG_ATT_playbackOrder,\r
+       TAG_SVG_ATT_editable,\r
+       TAG_SVG_ATT_text_x,\r
+       TAG_SVG_ATT_text_y,\r
+       TAG_SVG_ATT_text_rotate,\r
+       TAG_SVG_ATT_transformBehavior,\r
+       TAG_SVG_ATT_overlay,\r
+       TAG_SVG_ATT_fullscreen,\r
+       TAG_SVG_ATT_motionTransform,\r
+};\r
+\r
+struct _all_atts {\r
+       XML_Space *xml_space;\r
+       XMLRI *xml_base;\r
+       SVG_ID *xml_id;\r
+       SVG_LanguageID *xml_lang;\r
+\r
+       DOM_String *xlink_type;\r
+       XMLRI *xlink_role;\r
+       XMLRI *xlink_arcrole;\r
+       DOM_String *xlink_title;\r
+       XMLRI *xlink_href;\r
+       DOM_String *xlink_show;\r
+       DOM_String *xlink_actuate;\r
+\r
+       XMLEV_Event *event;\r
+       XMLEV_Phase *phase;\r
+       XMLEV_Propagate *propagate;\r
+       XMLEV_DefaultAction *defaultAction;\r
+       XML_IDREF *observer;\r
+       XML_IDREF *listener_target;\r
+       XMLRI *handler;\r
+\r
+       SVG_ID *id;\r
+       SVG_String *_class;\r
+       SVG_ListOfIRI *requiredFeatures;\r
+       SVG_ListOfIRI *requiredExtensions;\r
+       SVG_FormatList *requiredFormats;\r
+       SVG_FontList *requiredFonts;\r
+       SVG_LanguageIDs *systemLanguage;\r
+       SVG_Display *display;\r
+       SVG_Visibility *visibility;\r
+       SVG_RenderingHint *image_rendering;\r
+       SVG_PointerEvents *pointer_events;\r
+       SVG_RenderingHint *shape_rendering;\r
+       SVG_RenderingHint *text_rendering;\r
+       SVG_Number *audio_level;\r
+       SVG_Paint *viewport_fill;\r
+       SVG_Number *viewport_fill_opacity;\r
+       SVG_String *overflow;\r
+       SVG_Number *fill_opacity;\r
+       SVG_Number *stroke_opacity;\r
+       SVG_Paint *fill;\r
+       SVG_FillRule *fill_rule;\r
+       SVG_Paint *stroke;\r
+       SVG_StrokeDashArray *stroke_dasharray;\r
+       SVG_Length *stroke_dashoffset;\r
+       SVG_StrokeLineCap *stroke_linecap;\r
+       SVG_StrokeLineJoin *stroke_linejoin;\r
+       SVG_Number *stroke_miterlimit;\r
+       SVG_Length *stroke_width;\r
+       SVG_Paint *color;\r
+       SVG_RenderingHint *color_rendering;\r
+       SVG_VectorEffect *vector_effect;\r
+       SVG_SVGColor *solid_color;\r
+       SVG_Number *solid_opacity;\r
+       SVG_DisplayAlign *display_align;\r
+       SVG_Number *line_increment;\r
+       SVG_SVGColor *stop_color;\r
+       SVG_Number *stop_opacity;\r
+       SVG_FontFamily *font_family;\r
+       SVG_FontSize *font_size;\r
+       SVG_FontStyle *font_style;\r
+       SVG_FontVariant *font_variant;\r
+       SVG_FontWeight *font_weight;\r
+       SVG_TextAnchor *text_anchor;\r
+       SVG_TextAlign *text_align;\r
+       SVG_String *text_decoration;\r
+       SVG_FocusHighlight *focusHighlight;\r
+       SVG_Boolean *externalResourcesRequired;\r
+       SVG_Focusable *focusable;\r
+       SVG_Focus *nav_next;\r
+       SVG_Focus *nav_prev;\r
+       SVG_Focus *nav_up;\r
+       SVG_Focus *nav_up_right;\r
+       SVG_Focus *nav_right;\r
+       SVG_Focus *nav_down_right;\r
+       SVG_Focus *nav_down;\r
+       SVG_Focus *nav_down_left;\r
+       SVG_Focus *nav_left;\r
+       SVG_Focus *nav_up_left;\r
+       SVG_Transform *transform;\r
+       SVG_String *target;\r
+       SMIL_AttributeName *attributeName;\r
+       SMIL_AttributeType *attributeType;\r
+       SMIL_Times *begin;\r
+       SVG_Boolean *lsr_enabled;\r
+       SMIL_Duration *dur;\r
+       SMIL_Times *end;\r
+       SMIL_RepeatCount *repeatCount;\r
+       SMIL_Duration *repeatDur;\r
+       SMIL_Restart *restart;\r
+       SMIL_Fill *smil_fill;\r
+       SMIL_Duration *min;\r
+       SMIL_Duration *max;\r
+       SMIL_AnimateValue *to;\r
+       SMIL_CalcMode *calcMode;\r
+       SMIL_AnimateValues *values;\r
+       SMIL_KeyTimes *keyTimes;\r
+       SMIL_KeySplines *keySplines;\r
+       SMIL_AnimateValue *from;\r
+       SMIL_AnimateValue *by;\r
+       SMIL_Additive *additive;\r
+       SMIL_Accumulate *accumulate;\r
+       SVG_PathData *path;\r
+       SMIL_KeyPoints *keyPoints;\r
+       SVG_Rotate *rotate;\r
+       SVG_String *origin;\r
+       SVG_TransformType *transform_type;\r
+       SVG_Clock *clipBegin;\r
+       SVG_Clock *clipEnd;\r
+       SMIL_SyncBehavior *syncBehavior;\r
+       SMIL_SyncTolerance *syncTolerance;\r
+       SVG_Boolean *syncMaster;\r
+       XMLRI *syncReference;\r
+       SVG_Coordinate *x;\r
+       SVG_Coordinate *y;\r
+       SVG_Length *width;\r
+       SVG_Length *height;\r
+       SVG_PreserveAspectRatio *preserveAspectRatio;\r
+       SVG_InitialVisibility *initialVisibility;\r
+       SVG_ContentType *type;\r
+       SVG_Coordinate *cx;\r
+       SVG_Coordinate *cy;\r
+       SVG_Length *r;\r
+       SVG_Length *cursorManager_x;\r
+       SVG_Length *cursorManager_y;\r
+       SVG_Length *rx;\r
+       SVG_Length *ry;\r
+       SVG_Number *horiz_adv_x;\r
+       SVG_Number *horiz_origin_x;\r
+       SVG_String *font_stretch;\r
+       SVG_String *unicode_range;\r
+       SVG_String *panose_1;\r
+       SVG_String *widths;\r
+       SVG_String *bbox;\r
+       SVG_Number *units_per_em;\r
+       SVG_Number *stemv;\r
+       SVG_Number *stemh;\r
+       SVG_Number *slope;\r
+       SVG_Number *cap_height;\r
+       SVG_Number *x_height;\r
+       SVG_Number *accent_height;\r
+       SVG_Number *ascent;\r
+       SVG_Number *descent;\r
+       SVG_Number *ideographic;\r
+       SVG_Number *alphabetic;\r
+       SVG_Number *mathematical;\r
+       SVG_Number *hanging;\r
+       SVG_Number *underline_position;\r
+       SVG_Number *underline_thickness;\r
+       SVG_Number *strikethrough_position;\r
+       SVG_Number *strikethrough_thickness;\r
+       SVG_Number *overline_position;\r
+       SVG_Number *overline_thickness;\r
+       SVG_PathData *d;\r
+       SVG_String *unicode;\r
+       SVG_String *glyph_name;\r
+       SVG_String *arabic_form;\r
+       SVG_LanguageIDs *lang;\r
+       SVG_String *u1;\r
+       SVG_String *g1;\r
+       SVG_String *u2;\r
+       SVG_String *g2;\r
+       SVG_Number *k;\r
+       SVG_Number *opacity;\r
+       SVG_Coordinate *x1;\r
+       SVG_Coordinate *y1;\r
+       SVG_Coordinate *x2;\r
+       SVG_Coordinate *y2;\r
+       SVG_GradientUnit *gradientUnits;\r
+       SVG_SpreadMethod *spreadMethod;\r
+       SVG_Transform *gradientTransform;\r
+       SVG_Number *pathLength;\r
+       SVG_Points *points;\r
+       SVG_Number *mediaSize;\r
+       SVG_String *mediaTime;\r
+       SVG_String *mediaCharacterEncoding;\r
+       SVG_String *mediaContentEncodings;\r
+       SVG_Number *bandwidth;\r
+       SVG_Coordinate *fx;\r
+       SVG_Coordinate *fy;\r
+       LASeR_Size *size;\r
+       LASeR_Choice *choice;\r
+       LASeR_Size *delta;\r
+       SVG_Number *offset;\r
+       SMIL_SyncBehavior *syncBehaviorDefault;\r
+       SMIL_SyncTolerance *syncToleranceDefault;\r
+       SVG_ViewBox *viewBox;\r
+       SVG_ZoomAndPan *zoomAndPan;\r
+       SVG_String *version;\r
+       SVG_String *baseProfile;\r
+       SVG_ContentType *contentScriptType;\r
+       SVG_Clock *snapshotTime;\r
+       SVG_TimelineBegin *timelineBegin;\r
+       SVG_PlaybackOrder *playbackOrder;\r
+       SVG_Boolean *editable;\r
+       SVG_Coordinates *text_x;\r
+       SVG_Coordinates *text_y;\r
+       SVG_Numbers *text_rotate;\r
+       SVG_TransformBehavior *transformBehavior;\r
+       SVG_Overlay *overlay;\r
+       SVG_Boolean *fullscreen;\r
+       SVG_Motion *motionTransform;\r
+};\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+\r
+#endif         /*_GF_SVG_NODES_H*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/nodes_x3d.h b/tstools/DtsEdit/src/gpac/nodes_x3d.h
new file mode 100644 (file)
index 0000000..98d2511
--- /dev/null
@@ -0,0 +1,1396 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / X3D Scene Graph sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *\r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.        \r
+ *\r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.\r
+ *\r
+ */\r
+\r
+\r
+/*\r
+       DO NOT MOFIFY - File generated on GMT Thu Aug 07 11:44:22 2008\r
+\r
+       BY X3DGen for GPAC Version 0.4.5-DEV\r
+*/\r
+\r
+#ifndef _GF_X3D_NODES_H\r
+#define _GF_X3D_NODES_H\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/scenegraph_vrml.h>\r
+\r
+\r
+\r
+enum {\r
+       TAG_X3D_Anchor = GF_NODE_RANGE_FIRST_X3D,\r
+       TAG_X3D_Appearance,\r
+       TAG_X3D_Arc2D,\r
+       TAG_X3D_ArcClose2D,\r
+       TAG_X3D_AudioClip,\r
+       TAG_X3D_Background,\r
+       TAG_X3D_Billboard,\r
+       TAG_X3D_BooleanFilter,\r
+       TAG_X3D_BooleanSequencer,\r
+       TAG_X3D_BooleanToggle,\r
+       TAG_X3D_BooleanTrigger,\r
+       TAG_X3D_Box,\r
+       TAG_X3D_Circle2D,\r
+       TAG_X3D_Collision,\r
+       TAG_X3D_Color,\r
+       TAG_X3D_ColorInterpolator,\r
+       TAG_X3D_ColorRGBA,\r
+       TAG_X3D_Cone,\r
+       TAG_X3D_Contour2D,\r
+       TAG_X3D_ContourPolyline2D,\r
+       TAG_X3D_Coordinate,\r
+       TAG_X3D_CoordinateDouble,\r
+       TAG_X3D_Coordinate2D,\r
+       TAG_X3D_CoordinateInterpolator,\r
+       TAG_X3D_CoordinateInterpolator2D,\r
+       TAG_X3D_Cylinder,\r
+       TAG_X3D_CylinderSensor,\r
+       TAG_X3D_DirectionalLight,\r
+       TAG_X3D_Disk2D,\r
+       TAG_X3D_ElevationGrid,\r
+       TAG_X3D_EspduTransform,\r
+       TAG_X3D_Extrusion,\r
+       TAG_X3D_FillProperties,\r
+       TAG_X3D_Fog,\r
+       TAG_X3D_FontStyle,\r
+       TAG_X3D_GeoCoordinate,\r
+       TAG_X3D_GeoElevationGrid,\r
+       TAG_X3D_GeoLocation,\r
+       TAG_X3D_GeoLOD,\r
+       TAG_X3D_GeoMetadata,\r
+       TAG_X3D_GeoOrigin,\r
+       TAG_X3D_GeoPositionInterpolator,\r
+       TAG_X3D_GeoTouchSensor,\r
+       TAG_X3D_GeoViewpoint,\r
+       TAG_X3D_Group,\r
+       TAG_X3D_HAnimDisplacer,\r
+       TAG_X3D_HAnimHumanoid,\r
+       TAG_X3D_HAnimJoint,\r
+       TAG_X3D_HAnimSegment,\r
+       TAG_X3D_HAnimSite,\r
+       TAG_X3D_ImageTexture,\r
+       TAG_X3D_IndexedFaceSet,\r
+       TAG_X3D_IndexedLineSet,\r
+       TAG_X3D_IndexedTriangleFanSet,\r
+       TAG_X3D_IndexedTriangleSet,\r
+       TAG_X3D_IndexedTriangleStripSet,\r
+       TAG_X3D_Inline,\r
+       TAG_X3D_IntegerSequencer,\r
+       TAG_X3D_IntegerTrigger,\r
+       TAG_X3D_KeySensor,\r
+       TAG_X3D_LineProperties,\r
+       TAG_X3D_LineSet,\r
+       TAG_X3D_LoadSensor,\r
+       TAG_X3D_LOD,\r
+       TAG_X3D_Material,\r
+       TAG_X3D_MetadataDouble,\r
+       TAG_X3D_MetadataFloat,\r
+       TAG_X3D_MetadataInteger,\r
+       TAG_X3D_MetadataSet,\r
+       TAG_X3D_MetadataString,\r
+       TAG_X3D_MovieTexture,\r
+       TAG_X3D_MultiTexture,\r
+       TAG_X3D_MultiTextureCoordinate,\r
+       TAG_X3D_MultiTextureTransform,\r
+       TAG_X3D_NavigationInfo,\r
+       TAG_X3D_Normal,\r
+       TAG_X3D_NormalInterpolator,\r
+       TAG_X3D_NurbsCurve,\r
+       TAG_X3D_NurbsCurve2D,\r
+       TAG_X3D_NurbsOrientationInterpolator,\r
+       TAG_X3D_NurbsPatchSurface,\r
+       TAG_X3D_NurbsPositionInterpolator,\r
+       TAG_X3D_NurbsSet,\r
+       TAG_X3D_NurbsSurfaceInterpolator,\r
+       TAG_X3D_NurbsSweptSurface,\r
+       TAG_X3D_NurbsSwungSurface,\r
+       TAG_X3D_NurbsTextureCoordinate,\r
+       TAG_X3D_NurbsTrimmedSurface,\r
+       TAG_X3D_OrientationInterpolator,\r
+       TAG_X3D_PixelTexture,\r
+       TAG_X3D_PlaneSensor,\r
+       TAG_X3D_PointLight,\r
+       TAG_X3D_PointSet,\r
+       TAG_X3D_Polyline2D,\r
+       TAG_X3D_Polypoint2D,\r
+       TAG_X3D_PositionInterpolator,\r
+       TAG_X3D_PositionInterpolator2D,\r
+       TAG_X3D_ProximitySensor,\r
+       TAG_X3D_ReceiverPdu,\r
+       TAG_X3D_Rectangle2D,\r
+       TAG_X3D_ScalarInterpolator,\r
+       TAG_X3D_Script,\r
+       TAG_X3D_Shape,\r
+       TAG_X3D_SignalPdu,\r
+       TAG_X3D_Sound,\r
+       TAG_X3D_Sphere,\r
+       TAG_X3D_SphereSensor,\r
+       TAG_X3D_SpotLight,\r
+       TAG_X3D_StaticGroup,\r
+       TAG_X3D_StringSensor,\r
+       TAG_X3D_Switch,\r
+       TAG_X3D_Text,\r
+       TAG_X3D_TextureBackground,\r
+       TAG_X3D_TextureCoordinate,\r
+       TAG_X3D_TextureCoordinateGenerator,\r
+       TAG_X3D_TextureTransform,\r
+       TAG_X3D_TimeSensor,\r
+       TAG_X3D_TimeTrigger,\r
+       TAG_X3D_TouchSensor,\r
+       TAG_X3D_Transform,\r
+       TAG_X3D_TransmitterPdu,\r
+       TAG_X3D_TriangleFanSet,\r
+       TAG_X3D_TriangleSet,\r
+       TAG_X3D_TriangleSet2D,\r
+       TAG_X3D_TriangleStripSet,\r
+       TAG_X3D_Viewpoint,\r
+       TAG_X3D_VisibilitySensor,\r
+       TAG_X3D_WorldInfo,\r
+       TAG_LastImplementedX3D\r
+};\r
+\r
+typedef struct _tagX3DAnchor\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       SFString description;   /*exposedField*/\r
+       MFString parameter;     /*exposedField*/\r
+       MFURL url;      /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_Anchor;\r
+\r
+\r
+typedef struct _tagX3DAppearance\r
+{\r
+       BASE_NODE\r
+       GF_Node *material;      /*exposedField*/\r
+       GF_Node *texture;       /*exposedField*/\r
+       GF_Node *textureTransform;      /*exposedField*/\r
+       GF_Node *fillProperties;        /*exposedField*/\r
+       GF_Node *lineProperties;        /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_Appearance;\r
+\r
+\r
+typedef struct _tagX3DArc2D\r
+{\r
+       BASE_NODE\r
+       SFFloat endAngle;       /*field*/\r
+       SFFloat radius; /*field*/\r
+       SFFloat startAngle;     /*field*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_Arc2D;\r
+\r
+\r
+typedef struct _tagX3DArcClose2D\r
+{\r
+       BASE_NODE\r
+       SFString closureType;   /*field*/\r
+       SFFloat endAngle;       /*field*/\r
+       SFFloat radius; /*field*/\r
+       SFFloat startAngle;     /*field*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_ArcClose2D;\r
+\r
+\r
+typedef struct _tagX3DAudioClip\r
+{\r
+       BASE_NODE\r
+       SFString description;   /*exposedField*/\r
+       SFBool loop;    /*exposedField*/\r
+       SFFloat pitch;  /*exposedField*/\r
+       SFTime startTime;       /*exposedField*/\r
+       SFTime stopTime;        /*exposedField*/\r
+       MFURL url;      /*exposedField*/\r
+       SFTime duration_changed;        /*eventOut*/\r
+       SFBool isActive;        /*eventOut*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+       SFTime pauseTime;       /*exposedField*/\r
+       SFTime resumeTime;      /*exposedField*/\r
+       SFTime elapsedTime;     /*eventOut*/\r
+       SFBool isPaused;        /*eventOut*/\r
+} X_AudioClip;\r
+\r
+\r
+typedef struct _tagX3DBackground\r
+{\r
+       BASE_NODE\r
+       SFBool set_bind;        /*eventIn*/\r
+       void (*on_set_bind)(GF_Node *pThis);    /*eventInHandler*/\r
+       MFFloat groundAngle;    /*exposedField*/\r
+       MFColor groundColor;    /*exposedField*/\r
+       MFURL backUrl;  /*exposedField*/\r
+       MFURL bottomUrl;        /*exposedField*/\r
+       MFURL frontUrl; /*exposedField*/\r
+       MFURL leftUrl;  /*exposedField*/\r
+       MFURL rightUrl; /*exposedField*/\r
+       MFURL topUrl;   /*exposedField*/\r
+       MFFloat skyAngle;       /*exposedField*/\r
+       MFColor skyColor;       /*exposedField*/\r
+       SFBool isBound; /*eventOut*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+       SFTime bindTime;        /*eventOut*/\r
+} X_Background;\r
+\r
+\r
+typedef struct _tagX3DBillboard\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       SFVec3f axisOfRotation; /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_Billboard;\r
+\r
+\r
+typedef struct _tagX3DBooleanFilter\r
+{\r
+       BASE_NODE\r
+       SFBool set_boolean;     /*eventIn*/\r
+       void (*on_set_boolean)(GF_Node *pThis); /*eventInHandler*/\r
+       SFBool inputFalse;      /*eventOut*/\r
+       SFBool inputNegate;     /*eventOut*/\r
+       SFBool inputTrue;       /*eventOut*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_BooleanFilter;\r
+\r
+\r
+typedef struct _tagX3DBooleanSequencer\r
+{\r
+       BASE_NODE\r
+       SFBool next;    /*eventIn*/\r
+       void (*on_next)(GF_Node *pThis);        /*eventInHandler*/\r
+       SFBool previous;        /*eventIn*/\r
+       void (*on_previous)(GF_Node *pThis);    /*eventInHandler*/\r
+       SFFloat set_fraction;   /*eventIn*/\r
+       void (*on_set_fraction)(GF_Node *pThis);        /*eventInHandler*/\r
+       MFFloat key;    /*exposedField*/\r
+       MFBool keyValue;        /*exposedField*/\r
+       SFBool value_changed;   /*eventOut*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_BooleanSequencer;\r
+\r
+\r
+typedef struct _tagX3DBooleanToggle\r
+{\r
+       BASE_NODE\r
+       SFBool set_boolean;     /*eventIn*/\r
+       void (*on_set_boolean)(GF_Node *pThis); /*eventInHandler*/\r
+       SFBool toggle;  /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_BooleanToggle;\r
+\r
+\r
+typedef struct _tagX3DBooleanTrigger\r
+{\r
+       BASE_NODE\r
+       SFTime set_triggerTime; /*eventIn*/\r
+       void (*on_set_triggerTime)(GF_Node *pThis);     /*eventInHandler*/\r
+       SFBool triggerTrue;     /*eventOut*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_BooleanTrigger;\r
+\r
+\r
+typedef struct _tagX3DBox\r
+{\r
+       BASE_NODE\r
+       SFVec3f size;   /*field*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_Box;\r
+\r
+\r
+typedef struct _tagX3DCircle2D\r
+{\r
+       BASE_NODE\r
+       SFFloat radius; /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_Circle2D;\r
+\r
+\r
+typedef struct _tagX3DCollision\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       SFBool enabled; /*exposedField*/\r
+       GF_Node *proxy; /*field*/\r
+       SFTime collideTime;     /*eventOut*/\r
+       SFBool isActive;        /*eventOut*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_Collision;\r
+\r
+\r
+typedef struct _tagX3DColor\r
+{\r
+       BASE_NODE\r
+       MFColor color;  /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_Color;\r
+\r
+\r
+typedef struct _tagX3DColorInterpolator\r
+{\r
+       BASE_NODE\r
+       SFFloat set_fraction;   /*eventIn*/\r
+       void (*on_set_fraction)(GF_Node *pThis);        /*eventInHandler*/\r
+       MFFloat key;    /*exposedField*/\r
+       MFColor keyValue;       /*exposedField*/\r
+       SFColor value_changed;  /*eventOut*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_ColorInterpolator;\r
+\r
+\r
+typedef struct _tagX3DColorRGBA\r
+{\r
+       BASE_NODE\r
+       MFColorRGBA color;      /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_ColorRGBA;\r
+\r
+\r
+typedef struct _tagX3DCone\r
+{\r
+       BASE_NODE\r
+       SFFloat bottomRadius;   /*field*/\r
+       SFFloat height; /*field*/\r
+       SFBool side;    /*field*/\r
+       SFBool bottom;  /*field*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_Cone;\r
+\r
+\r
+typedef struct _tagX3DContour2D\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_Contour2D;\r
+\r
+\r
+typedef struct _tagX3DContourPolyline2D\r
+{\r
+       BASE_NODE\r
+       MFVec2f point;  /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_ContourPolyline2D;\r
+\r
+\r
+typedef struct _tagX3DCoordinate\r
+{\r
+       BASE_NODE\r
+       MFVec3f point;  /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_Coordinate;\r
+\r
+\r
+typedef struct _tagX3DCoordinateDouble\r
+{\r
+       BASE_NODE\r
+       MFVec3d point;  /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_CoordinateDouble;\r
+\r
+\r
+typedef struct _tagX3DCoordinate2D\r
+{\r
+       BASE_NODE\r
+       MFVec2f point;  /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_Coordinate2D;\r
+\r
+\r
+typedef struct _tagX3DCoordinateInterpolator\r
+{\r
+       BASE_NODE\r
+       SFFloat set_fraction;   /*eventIn*/\r
+       void (*on_set_fraction)(GF_Node *pThis);        /*eventInHandler*/\r
+       MFFloat key;    /*exposedField*/\r
+       MFVec3f keyValue;       /*exposedField*/\r
+       MFVec3f value_changed;  /*eventOut*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_CoordinateInterpolator;\r
+\r
+\r
+typedef struct _tagX3DCoordinateInterpolator2D\r
+{\r
+       BASE_NODE\r
+       SFFloat set_fraction;   /*eventIn*/\r
+       void (*on_set_fraction)(GF_Node *pThis);        /*eventInHandler*/\r
+       MFFloat key;    /*exposedField*/\r
+       MFVec2f keyValue;       /*exposedField*/\r
+       MFVec2f value_changed;  /*eventOut*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_CoordinateInterpolator2D;\r
+\r
+\r
+typedef struct _tagX3DCylinder\r
+{\r
+       BASE_NODE\r
+       SFBool bottom;  /*field*/\r
+       SFFloat height; /*field*/\r
+       SFFloat radius; /*field*/\r
+       SFBool side;    /*field*/\r
+       SFBool top;     /*field*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_Cylinder;\r
+\r
+\r
+typedef struct _tagX3DCylinderSensor\r
+{\r
+       BASE_NODE\r
+       SFBool autoOffset;      /*exposedField*/\r
+       SFFloat diskAngle;      /*exposedField*/\r
+       SFBool enabled; /*exposedField*/\r
+       SFFloat maxAngle;       /*exposedField*/\r
+       SFFloat minAngle;       /*exposedField*/\r
+       SFFloat offset; /*exposedField*/\r
+       SFBool isActive;        /*eventOut*/\r
+       SFRotation rotation_changed;    /*eventOut*/\r
+       SFVec3f trackPoint_changed;     /*eventOut*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+       SFString description;   /*exposedField*/\r
+       SFBool isOver;  /*eventOut*/\r
+} X_CylinderSensor;\r
+\r
+\r
+typedef struct _tagX3DDirectionalLight\r
+{\r
+       BASE_NODE\r
+       SFFloat ambientIntensity;       /*exposedField*/\r
+       SFColor color;  /*exposedField*/\r
+       SFVec3f direction;      /*exposedField*/\r
+       SFFloat intensity;      /*exposedField*/\r
+       SFBool on;      /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_DirectionalLight;\r
+\r
+\r
+typedef struct _tagX3DDisk2D\r
+{\r
+       BASE_NODE\r
+       SFFloat innerRadius;    /*field*/\r
+       SFFloat outerRadius;    /*field*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_Disk2D;\r
+\r
+\r
+typedef struct _tagX3DElevationGrid\r
+{\r
+       BASE_NODE\r
+       MFFloat set_height;     /*eventIn*/\r
+       void (*on_set_height)(GF_Node *pThis);  /*eventInHandler*/\r
+       GF_Node *color; /*exposedField*/\r
+       GF_Node *normal;        /*exposedField*/\r
+       GF_Node *texCoord;      /*exposedField*/\r
+       MFFloat height; /*field*/\r
+       SFBool ccw;     /*field*/\r
+       SFBool colorPerVertex;  /*field*/\r
+       SFFloat creaseAngle;    /*field*/\r
+       SFBool normalPerVertex; /*field*/\r
+       SFBool solid;   /*field*/\r
+       SFInt32 xDimension;     /*field*/\r
+       SFFloat xSpacing;       /*field*/\r
+       SFInt32 zDimension;     /*field*/\r
+       SFFloat zSpacing;       /*field*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_ElevationGrid;\r
+\r
+\r
+typedef struct _tagX3DExtrusion\r
+{\r
+       BASE_NODE\r
+       MFVec2f set_crossSection;       /*eventIn*/\r
+       void (*on_set_crossSection)(GF_Node *pThis);    /*eventInHandler*/\r
+       MFRotation set_orientation;     /*eventIn*/\r
+       void (*on_set_orientation)(GF_Node *pThis);     /*eventInHandler*/\r
+       MFVec2f set_scale;      /*eventIn*/\r
+       void (*on_set_scale)(GF_Node *pThis);   /*eventInHandler*/\r
+       MFVec3f set_spine;      /*eventIn*/\r
+       void (*on_set_spine)(GF_Node *pThis);   /*eventInHandler*/\r
+       SFBool beginCap;        /*field*/\r
+       SFBool ccw;     /*field*/\r
+       SFBool convex;  /*field*/\r
+       SFFloat creaseAngle;    /*field*/\r
+       MFVec2f crossSection;   /*field*/\r
+       SFBool endCap;  /*field*/\r
+       MFRotation orientation; /*field*/\r
+       MFVec2f scale;  /*field*/\r
+       SFBool solid;   /*field*/\r
+       MFVec3f spine;  /*field*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_Extrusion;\r
+\r
+\r
+typedef struct _tagX3DFillProperties\r
+{\r
+       BASE_NODE\r
+       SFBool filled;  /*exposedField*/\r
+       SFColor hatchColor;     /*exposedField*/\r
+       SFBool hatched; /*exposedField*/\r
+       SFInt32 hatchStyle;     /*exposedField*/\r
+} X_FillProperties;\r
+\r
+\r
+typedef struct _tagX3DFog\r
+{\r
+       BASE_NODE\r
+       SFColor color;  /*exposedField*/\r
+       SFString fogType;       /*exposedField*/\r
+       SFFloat visibilityRange;        /*exposedField*/\r
+       SFBool set_bind;        /*eventIn*/\r
+       void (*on_set_bind)(GF_Node *pThis);    /*eventInHandler*/\r
+       SFBool isBound; /*eventOut*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+       SFTime bindTime;        /*eventOut*/\r
+} X_Fog;\r
+\r
+\r
+typedef struct _tagX3DFontStyle\r
+{\r
+       BASE_NODE\r
+       MFString family;        /*exposedField*/\r
+       SFBool horizontal;      /*exposedField*/\r
+       MFString justify;       /*exposedField*/\r
+       SFString language;      /*exposedField*/\r
+       SFBool leftToRight;     /*exposedField*/\r
+       SFFloat size;   /*exposedField*/\r
+       SFFloat spacing;        /*exposedField*/\r
+       SFString style; /*exposedField*/\r
+       SFBool topToBottom;     /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_FontStyle;\r
+\r
+\r
+typedef struct _tagX3DGroup\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_Group;\r
+\r
+\r
+typedef struct _tagX3DImageTexture\r
+{\r
+       BASE_NODE\r
+       MFURL url;      /*exposedField*/\r
+       SFBool repeatS; /*field*/\r
+       SFBool repeatT; /*field*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_ImageTexture;\r
+\r
+\r
+typedef struct _tagX3DIndexedFaceSet\r
+{\r
+       BASE_NODE\r
+       MFInt32 set_colorIndex; /*eventIn*/\r
+       void (*on_set_colorIndex)(GF_Node *pThis);      /*eventInHandler*/\r
+       MFInt32 set_coordIndex; /*eventIn*/\r
+       void (*on_set_coordIndex)(GF_Node *pThis);      /*eventInHandler*/\r
+       MFInt32 set_normalIndex;        /*eventIn*/\r
+       void (*on_set_normalIndex)(GF_Node *pThis);     /*eventInHandler*/\r
+       MFInt32 set_texCoordIndex;      /*eventIn*/\r
+       void (*on_set_texCoordIndex)(GF_Node *pThis);   /*eventInHandler*/\r
+       GF_Node *color; /*exposedField*/\r
+       GF_Node *coord; /*exposedField*/\r
+       GF_Node *normal;        /*exposedField*/\r
+       GF_Node *texCoord;      /*exposedField*/\r
+       SFBool ccw;     /*field*/\r
+       MFInt32 colorIndex;     /*field*/\r
+       SFBool colorPerVertex;  /*field*/\r
+       SFBool convex;  /*field*/\r
+       MFInt32 coordIndex;     /*field*/\r
+       SFFloat creaseAngle;    /*field*/\r
+       MFInt32 normalIndex;    /*field*/\r
+       SFBool normalPerVertex; /*field*/\r
+       SFBool solid;   /*field*/\r
+       MFInt32 texCoordIndex;  /*field*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_IndexedFaceSet;\r
+\r
+\r
+typedef struct _tagX3DIndexedLineSet\r
+{\r
+       BASE_NODE\r
+       MFInt32 set_colorIndex; /*eventIn*/\r
+       void (*on_set_colorIndex)(GF_Node *pThis);      /*eventInHandler*/\r
+       MFInt32 set_coordIndex; /*eventIn*/\r
+       void (*on_set_coordIndex)(GF_Node *pThis);      /*eventInHandler*/\r
+       GF_Node *color; /*exposedField*/\r
+       GF_Node *coord; /*exposedField*/\r
+       MFInt32 colorIndex;     /*field*/\r
+       SFBool colorPerVertex;  /*field*/\r
+       MFInt32 coordIndex;     /*field*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_IndexedLineSet;\r
+\r
+\r
+typedef struct _tagX3DIndexedTriangleFanSet\r
+{\r
+       BASE_NODE\r
+       MFInt32 set_index;      /*eventIn*/\r
+       void (*on_set_index)(GF_Node *pThis);   /*eventInHandler*/\r
+       GF_Node *color; /*exposedField*/\r
+       GF_Node *coord; /*exposedField*/\r
+       GF_Node *normal;        /*exposedField*/\r
+       GF_Node *texCoord;      /*exposedField*/\r
+       SFBool ccw;     /*field*/\r
+       SFBool colorPerVertex;  /*field*/\r
+       SFBool normalPerVertex; /*field*/\r
+       SFBool solid;   /*field*/\r
+       MFInt32 index;  /*field*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_IndexedTriangleFanSet;\r
+\r
+\r
+typedef struct _tagX3DIndexedTriangleSet\r
+{\r
+       BASE_NODE\r
+       MFInt32 set_index;      /*eventIn*/\r
+       void (*on_set_index)(GF_Node *pThis);   /*eventInHandler*/\r
+       GF_Node *color; /*exposedField*/\r
+       GF_Node *coord; /*exposedField*/\r
+       GF_Node *normal;        /*exposedField*/\r
+       GF_Node *texCoord;      /*exposedField*/\r
+       SFBool ccw;     /*field*/\r
+       SFBool colorPerVertex;  /*field*/\r
+       SFBool normalPerVertex; /*field*/\r
+       SFBool solid;   /*field*/\r
+       MFInt32 index;  /*field*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_IndexedTriangleSet;\r
+\r
+\r
+typedef struct _tagX3DIndexedTriangleStripSet\r
+{\r
+       BASE_NODE\r
+       MFInt32 set_index;      /*eventIn*/\r
+       void (*on_set_index)(GF_Node *pThis);   /*eventInHandler*/\r
+       GF_Node *color; /*exposedField*/\r
+       GF_Node *coord; /*exposedField*/\r
+       SFFloat creaseAngle;    /*exposedField*/\r
+       GF_Node *normal;        /*exposedField*/\r
+       GF_Node *texCoord;      /*exposedField*/\r
+       SFBool ccw;     /*field*/\r
+       SFBool normalPerVertex; /*field*/\r
+       SFBool solid;   /*field*/\r
+       MFInt32 index;  /*field*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_IndexedTriangleStripSet;\r
+\r
+\r
+typedef struct _tagX3DInline\r
+{\r
+       BASE_NODE\r
+       MFURL url;      /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+       SFBool load;    /*exposedField*/\r
+} X_Inline;\r
+\r
+\r
+typedef struct _tagX3DIntegerSequencer\r
+{\r
+       BASE_NODE\r
+       SFBool next;    /*eventIn*/\r
+       void (*on_next)(GF_Node *pThis);        /*eventInHandler*/\r
+       SFBool previous;        /*eventIn*/\r
+       void (*on_previous)(GF_Node *pThis);    /*eventInHandler*/\r
+       SFFloat set_fraction;   /*eventIn*/\r
+       void (*on_set_fraction)(GF_Node *pThis);        /*eventInHandler*/\r
+       MFFloat key;    /*exposedField*/\r
+       MFInt32 keyValue;       /*exposedField*/\r
+       SFInt32 value_changed;  /*eventOut*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_IntegerSequencer;\r
+\r
+\r
+typedef struct _tagX3DIntegerTrigger\r
+{\r
+       BASE_NODE\r
+       SFBool set_boolean;     /*eventIn*/\r
+       void (*on_set_boolean)(GF_Node *pThis); /*eventInHandler*/\r
+       SFInt32 integerKey;     /*exposedField*/\r
+       SFInt32 triggerValue;   /*eventOut*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_IntegerTrigger;\r
+\r
+\r
+typedef struct _tagX3DKeySensor\r
+{\r
+       BASE_NODE\r
+       SFBool enabled; /*exposedField*/\r
+       SFInt32 actionKeyPress; /*eventOut*/\r
+       SFInt32 actionKeyRelease;       /*eventOut*/\r
+       SFBool altKey;  /*eventOut*/\r
+       SFBool controlKey;      /*eventOut*/\r
+       SFBool isActive;        /*eventOut*/\r
+       SFString keyPress;      /*eventOut*/\r
+       SFString keyRelease;    /*eventOut*/\r
+       SFBool shiftKey;        /*eventOut*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_KeySensor;\r
+\r
+\r
+typedef struct _tagX3DLineProperties\r
+{\r
+       BASE_NODE\r
+       SFBool applied; /*exposedField*/\r
+       SFInt32 linetype;       /*exposedField*/\r
+       SFFloat linewidthScaleFactor;   /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_LineProperties;\r
+\r
+\r
+typedef struct _tagX3DLineSet\r
+{\r
+       BASE_NODE\r
+       GF_Node *color; /*exposedField*/\r
+       GF_Node *coord; /*exposedField*/\r
+       MFInt32 vertexCount;    /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_LineSet;\r
+\r
+\r
+typedef struct _tagX3DLOD\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       SFVec3f center; /*field*/\r
+       MFFloat range;  /*field*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_LOD;\r
+\r
+\r
+typedef struct _tagX3DMaterial\r
+{\r
+       BASE_NODE\r
+       SFFloat ambientIntensity;       /*exposedField*/\r
+       SFColor diffuseColor;   /*exposedField*/\r
+       SFColor emissiveColor;  /*exposedField*/\r
+       SFFloat shininess;      /*exposedField*/\r
+       SFColor specularColor;  /*exposedField*/\r
+       SFFloat transparency;   /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_Material;\r
+\r
+\r
+typedef struct _tagX3DMetadataDouble\r
+{\r
+       BASE_NODE\r
+       SFString name;  /*exposedField*/\r
+       SFString reference;     /*exposedField*/\r
+       MFDouble value; /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_MetadataDouble;\r
+\r
+\r
+typedef struct _tagX3DMetadataFloat\r
+{\r
+       BASE_NODE\r
+       SFString name;  /*exposedField*/\r
+       SFString reference;     /*exposedField*/\r
+       MFFloat value;  /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_MetadataFloat;\r
+\r
+\r
+typedef struct _tagX3DMetadataInteger\r
+{\r
+       BASE_NODE\r
+       SFString name;  /*exposedField*/\r
+       SFString reference;     /*exposedField*/\r
+       MFInt32 value;  /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_MetadataInteger;\r
+\r
+\r
+typedef struct _tagX3DMetadataSet\r
+{\r
+       BASE_NODE\r
+       SFString name;  /*exposedField*/\r
+       SFString reference;     /*exposedField*/\r
+       GF_ChildNodeItem *value;        /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_MetadataSet;\r
+\r
+\r
+typedef struct _tagX3DMetadataString\r
+{\r
+       BASE_NODE\r
+       SFString name;  /*exposedField*/\r
+       SFString reference;     /*exposedField*/\r
+       MFString value; /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_MetadataString;\r
+\r
+\r
+typedef struct _tagX3DMovieTexture\r
+{\r
+       BASE_NODE\r
+       SFBool loop;    /*exposedField*/\r
+       SFFloat speed;  /*exposedField*/\r
+       SFTime startTime;       /*exposedField*/\r
+       SFTime stopTime;        /*exposedField*/\r
+       MFURL url;      /*exposedField*/\r
+       SFBool repeatS; /*field*/\r
+       SFBool repeatT; /*field*/\r
+       SFTime duration_changed;        /*eventOut*/\r
+       SFBool isActive;        /*eventOut*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+       SFTime resumeTime;      /*exposedField*/\r
+       SFTime pauseTime;       /*exposedField*/\r
+       SFTime elapsedTime;     /*eventOut*/\r
+       SFBool isPaused;        /*eventOut*/\r
+} X_MovieTexture;\r
+\r
+\r
+typedef struct _tagX3DMultiTexture\r
+{\r
+       BASE_NODE\r
+       SFFloat alpha;  /*exposedField*/\r
+       SFColor color;  /*exposedField*/\r
+       MFString function;      /*exposedField*/\r
+       MFString mode;  /*exposedField*/\r
+       MFString source;        /*exposedField*/\r
+       GF_ChildNodeItem *texture;      /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_MultiTexture;\r
+\r
+\r
+typedef struct _tagX3DMultiTextureCoordinate\r
+{\r
+       BASE_NODE\r
+       GF_ChildNodeItem *texCoord;     /*MultiTextureCoordinate*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_MultiTextureCoordinate;\r
+\r
+\r
+typedef struct _tagX3DMultiTextureTransform\r
+{\r
+       BASE_NODE\r
+       GF_ChildNodeItem *textureTransform;     /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_MultiTextureTransform;\r
+\r
+\r
+typedef struct _tagX3DNavigationInfo\r
+{\r
+       BASE_NODE\r
+       SFBool set_bind;        /*eventIn*/\r
+       void (*on_set_bind)(GF_Node *pThis);    /*eventInHandler*/\r
+       MFFloat avatarSize;     /*exposedField*/\r
+       SFBool headlight;       /*exposedField*/\r
+       SFFloat speed;  /*exposedField*/\r
+       MFString type;  /*exposedField*/\r
+       SFFloat visibilityLimit;        /*exposedField*/\r
+       SFBool isBound; /*eventOut*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+       MFString transitionType;        /*exposedField*/\r
+       SFTime bindTime;        /*eventOut*/\r
+} X_NavigationInfo;\r
+\r
+\r
+typedef struct _tagX3DNormal\r
+{\r
+       BASE_NODE\r
+       MFVec3f vector; /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_Normal;\r
+\r
+\r
+typedef struct _tagX3DNormalInterpolator\r
+{\r
+       BASE_NODE\r
+       SFFloat set_fraction;   /*eventIn*/\r
+       void (*on_set_fraction)(GF_Node *pThis);        /*eventInHandler*/\r
+       MFFloat key;    /*exposedField*/\r
+       MFVec3f keyValue;       /*exposedField*/\r
+       MFVec3f value_changed;  /*eventOut*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_NormalInterpolator;\r
+\r
+\r
+typedef struct _tagX3DOrientationInterpolator\r
+{\r
+       BASE_NODE\r
+       SFFloat set_fraction;   /*eventIn*/\r
+       void (*on_set_fraction)(GF_Node *pThis);        /*eventInHandler*/\r
+       MFFloat key;    /*exposedField*/\r
+       MFRotation keyValue;    /*exposedField*/\r
+       SFRotation value_changed;       /*eventOut*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_OrientationInterpolator;\r
+\r
+\r
+typedef struct _tagX3DPixelTexture\r
+{\r
+       BASE_NODE\r
+       SFImage image;  /*exposedField*/\r
+       SFBool repeatS; /*field*/\r
+       SFBool repeatT; /*field*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_PixelTexture;\r
+\r
+\r
+typedef struct _tagX3DPlaneSensor\r
+{\r
+       BASE_NODE\r
+       SFBool autoOffset;      /*exposedField*/\r
+       SFBool enabled; /*exposedField*/\r
+       SFVec2f maxPosition;    /*exposedField*/\r
+       SFVec2f minPosition;    /*exposedField*/\r
+       SFVec3f offset; /*exposedField*/\r
+       SFBool isActive;        /*eventOut*/\r
+       SFVec3f trackPoint_changed;     /*eventOut*/\r
+       SFVec3f translation_changed;    /*eventOut*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+       SFString description;   /*exposedField*/\r
+       SFBool isOver;  /*eventOut*/\r
+} X_PlaneSensor;\r
+\r
+\r
+typedef struct _tagX3DPointLight\r
+{\r
+       BASE_NODE\r
+       SFFloat ambientIntensity;       /*exposedField*/\r
+       SFVec3f attenuation;    /*exposedField*/\r
+       SFColor color;  /*exposedField*/\r
+       SFFloat intensity;      /*exposedField*/\r
+       SFVec3f location;       /*exposedField*/\r
+       SFBool on;      /*exposedField*/\r
+       SFFloat radius; /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_PointLight;\r
+\r
+\r
+typedef struct _tagX3DPointSet\r
+{\r
+       BASE_NODE\r
+       GF_Node *color; /*exposedField*/\r
+       GF_Node *coord; /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_PointSet;\r
+\r
+\r
+typedef struct _tagX3DPolyline2D\r
+{\r
+       BASE_NODE\r
+       MFVec2f lineSegments;   /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_Polyline2D;\r
+\r
+\r
+typedef struct _tagX3DPolypoint2D\r
+{\r
+       BASE_NODE\r
+       MFVec2f point;  /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_Polypoint2D;\r
+\r
+\r
+typedef struct _tagX3DPositionInterpolator\r
+{\r
+       BASE_NODE\r
+       SFFloat set_fraction;   /*eventIn*/\r
+       void (*on_set_fraction)(GF_Node *pThis);        /*eventInHandler*/\r
+       MFFloat key;    /*exposedField*/\r
+       MFVec3f keyValue;       /*exposedField*/\r
+       SFVec3f value_changed;  /*eventOut*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_PositionInterpolator;\r
+\r
+\r
+typedef struct _tagX3DPositionInterpolator2D\r
+{\r
+       BASE_NODE\r
+       SFFloat set_fraction;   /*eventIn*/\r
+       void (*on_set_fraction)(GF_Node *pThis);        /*eventInHandler*/\r
+       MFFloat key;    /*exposedField*/\r
+       MFVec2f keyValue;       /*exposedField*/\r
+       SFVec2f value_changed;  /*eventOut*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_PositionInterpolator2D;\r
+\r
+\r
+typedef struct _tagX3DProximitySensor\r
+{\r
+       BASE_NODE\r
+       SFVec3f center; /*exposedField*/\r
+       SFVec3f size;   /*exposedField*/\r
+       SFBool enabled; /*exposedField*/\r
+       SFBool isActive;        /*eventOut*/\r
+       SFVec3f position_changed;       /*eventOut*/\r
+       SFRotation orientation_changed; /*eventOut*/\r
+       SFTime enterTime;       /*eventOut*/\r
+       SFTime exitTime;        /*eventOut*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+       SFVec3f centerOfRotation_changed;       /*eventOut*/\r
+} X_ProximitySensor;\r
+\r
+\r
+typedef struct _tagX3DRectangle2D\r
+{\r
+       BASE_NODE\r
+       SFVec2f size;   /*field*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_Rectangle2D;\r
+\r
+\r
+typedef struct _tagX3DScalarInterpolator\r
+{\r
+       BASE_NODE\r
+       SFFloat set_fraction;   /*eventIn*/\r
+       void (*on_set_fraction)(GF_Node *pThis);        /*eventInHandler*/\r
+       MFFloat key;    /*exposedField*/\r
+       MFFloat keyValue;       /*exposedField*/\r
+       SFFloat value_changed;  /*eventOut*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_ScalarInterpolator;\r
+\r
+\r
+typedef struct _tagX3DScript\r
+{\r
+       BASE_NODE\r
+       MFScript url;   /*exposedField*/\r
+       SFBool directOutput;    /*field*/\r
+       SFBool mustEvaluate;    /*field*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_Script;\r
+\r
+\r
+typedef struct _tagX3DShape\r
+{\r
+       BASE_NODE\r
+       GF_Node *appearance;    /*exposedField*/\r
+       GF_Node *geometry;      /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_Shape;\r
+\r
+\r
+typedef struct _tagX3DSound\r
+{\r
+       BASE_NODE\r
+       SFVec3f direction;      /*exposedField*/\r
+       SFFloat intensity;      /*exposedField*/\r
+       SFVec3f location;       /*exposedField*/\r
+       SFFloat maxBack;        /*exposedField*/\r
+       SFFloat maxFront;       /*exposedField*/\r
+       SFFloat minBack;        /*exposedField*/\r
+       SFFloat minFront;       /*exposedField*/\r
+       SFFloat priority;       /*exposedField*/\r
+       GF_Node *source;        /*exposedField*/\r
+       SFBool spatialize;      /*field*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_Sound;\r
+\r
+\r
+typedef struct _tagX3DSphere\r
+{\r
+       BASE_NODE\r
+       SFFloat radius; /*field*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_Sphere;\r
+\r
+\r
+typedef struct _tagX3DSphereSensor\r
+{\r
+       BASE_NODE\r
+       SFBool autoOffset;      /*exposedField*/\r
+       SFBool enabled; /*exposedField*/\r
+       SFRotation offset;      /*exposedField*/\r
+       SFBool isActive;        /*eventOut*/\r
+       SFRotation rotation_changed;    /*eventOut*/\r
+       SFVec3f trackPoint_changed;     /*eventOut*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+       SFString description;   /*exposedField*/\r
+       SFBool isOver;  /*eventOut*/\r
+} X_SphereSensor;\r
+\r
+\r
+typedef struct _tagX3DSpotLight\r
+{\r
+       BASE_NODE\r
+       SFFloat ambientIntensity;       /*exposedField*/\r
+       SFVec3f attenuation;    /*exposedField*/\r
+       SFFloat beamWidth;      /*exposedField*/\r
+       SFColor color;  /*exposedField*/\r
+       SFFloat cutOffAngle;    /*exposedField*/\r
+       SFVec3f direction;      /*exposedField*/\r
+       SFFloat intensity;      /*exposedField*/\r
+       SFVec3f location;       /*exposedField*/\r
+       SFBool on;      /*exposedField*/\r
+       SFFloat radius; /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_SpotLight;\r
+\r
+\r
+typedef struct _tagX3DStaticGroup\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_StaticGroup;\r
+\r
+\r
+typedef struct _tagX3DStringSensor\r
+{\r
+       BASE_NODE\r
+       SFBool deletionAllowed; /*exposedField*/\r
+       SFBool enabled; /*exposedField*/\r
+       SFString enteredText;   /*eventOut*/\r
+       SFString finalText;     /*eventOut*/\r
+       SFBool isActive;        /*eventOut*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_StringSensor;\r
+\r
+\r
+typedef struct _tagX3DSwitch\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       SFInt32 whichChoice;    /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_Switch;\r
+\r
+\r
+typedef struct _tagX3DText\r
+{\r
+       BASE_NODE\r
+       MFString string;        /*exposedField*/\r
+       MFFloat length; /*exposedField*/\r
+       GF_Node *fontStyle;     /*exposedField*/\r
+       SFFloat maxExtent;      /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_Text;\r
+\r
+\r
+typedef struct _tagX3DTextureBackground\r
+{\r
+       BASE_NODE\r
+       SFBool set_bind;        /*eventIn*/\r
+       void (*on_set_bind)(GF_Node *pThis);    /*eventInHandler*/\r
+       MFFloat groundAngle;    /*exposedField*/\r
+       MFColor groundColor;    /*exposedField*/\r
+       GF_Node *backTexture;   /*exposedField*/\r
+       GF_Node *bottomTexture; /*exposedField*/\r
+       GF_Node *frontTexture;  /*exposedField*/\r
+       GF_Node *leftTexture;   /*exposedField*/\r
+       GF_Node *rightTexture;  /*exposedField*/\r
+       GF_Node *topTexture;    /*exposedField*/\r
+       MFFloat skyAngle;       /*exposedField*/\r
+       MFColor skyColor;       /*exposedField*/\r
+       MFFloat transparency;   /*exposedField*/\r
+       SFTime bindTime;        /*exposedField*/\r
+       SFBool isBound; /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_TextureBackground;\r
+\r
+\r
+typedef struct _tagX3DTextureCoordinate\r
+{\r
+       BASE_NODE\r
+       MFVec2f point;  /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_TextureCoordinate;\r
+\r
+\r
+typedef struct _tagX3DTextureCoordinateGenerator\r
+{\r
+       BASE_NODE\r
+       SFString mode;  /*exposedField*/\r
+       MFFloat parameter;      /*TextureCoordinateGenerator*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_TextureCoordinateGenerator;\r
+\r
+\r
+typedef struct _tagX3DTextureTransform\r
+{\r
+       BASE_NODE\r
+       SFVec2f center; /*exposedField*/\r
+       SFFloat rotation;       /*exposedField*/\r
+       SFVec2f scale;  /*exposedField*/\r
+       SFVec2f translation;    /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_TextureTransform;\r
+\r
+\r
+typedef struct _tagX3DTimeSensor\r
+{\r
+       BASE_NODE\r
+       SFTime cycleInterval;   /*exposedField*/\r
+       SFBool enabled; /*exposedField*/\r
+       SFBool loop;    /*exposedField*/\r
+       SFTime startTime;       /*exposedField*/\r
+       SFTime stopTime;        /*exposedField*/\r
+       SFTime cycleTime;       /*eventOut*/\r
+       SFFloat fraction_changed;       /*eventOut*/\r
+       SFBool isActive;        /*eventOut*/\r
+       SFTime time;    /*eventOut*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+       SFTime pauseTime;       /*exposedField*/\r
+       SFTime resumeTime;      /*exposedField*/\r
+       SFTime elapsedTime;     /*eventOut*/\r
+       SFBool isPaused;        /*eventOut*/\r
+} X_TimeSensor;\r
+\r
+\r
+typedef struct _tagX3DTimeTrigger\r
+{\r
+       BASE_NODE\r
+       SFBool set_boolean;     /*eventIn*/\r
+       void (*on_set_boolean)(GF_Node *pThis); /*eventInHandler*/\r
+       SFTime triggerTime;     /*eventOut*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_TimeTrigger;\r
+\r
+\r
+typedef struct _tagX3DTouchSensor\r
+{\r
+       BASE_NODE\r
+       SFBool enabled; /*exposedField*/\r
+       SFVec3f hitNormal_changed;      /*eventOut*/\r
+       SFVec3f hitPoint_changed;       /*eventOut*/\r
+       SFVec2f hitTexCoord_changed;    /*eventOut*/\r
+       SFBool isActive;        /*eventOut*/\r
+       SFBool isOver;  /*eventOut*/\r
+       SFTime touchTime;       /*eventOut*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+       SFString description;   /*exposedField*/\r
+} X_TouchSensor;\r
+\r
+\r
+typedef struct _tagX3DTransform\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+       SFVec3f center; /*exposedField*/\r
+       SFRotation rotation;    /*exposedField*/\r
+       SFVec3f scale;  /*exposedField*/\r
+       SFRotation scaleOrientation;    /*exposedField*/\r
+       SFVec3f translation;    /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_Transform;\r
+\r
+\r
+typedef struct _tagX3DTriangleFanSet\r
+{\r
+       BASE_NODE\r
+       GF_Node *color; /*exposedField*/\r
+       GF_Node *coord; /*exposedField*/\r
+       MFInt32 fanCount;       /*exposedField*/\r
+       GF_Node *normal;        /*exposedField*/\r
+       GF_Node *texCoord;      /*exposedField*/\r
+       SFBool ccw;     /*field*/\r
+       SFBool colorPerVertex;  /*field*/\r
+       SFBool normalPerVertex; /*field*/\r
+       SFBool solid;   /*field*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_TriangleFanSet;\r
+\r
+\r
+typedef struct _tagX3DTriangleSet\r
+{\r
+       BASE_NODE\r
+       GF_Node *color; /*exposedField*/\r
+       GF_Node *coord; /*exposedField*/\r
+       GF_Node *normal;        /*exposedField*/\r
+       GF_Node *texCoord;      /*exposedField*/\r
+       SFBool ccw;     /*field*/\r
+       SFBool colorPerVertex;  /*field*/\r
+       SFBool normalPerVertex; /*field*/\r
+       SFBool solid;   /*field*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_TriangleSet;\r
+\r
+\r
+typedef struct _tagX3DTriangleSet2D\r
+{\r
+       BASE_NODE\r
+       MFVec2f vertices;       /*exposedField*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_TriangleSet2D;\r
+\r
+\r
+typedef struct _tagX3DTriangleStripSet\r
+{\r
+       BASE_NODE\r
+       GF_Node *color; /*exposedField*/\r
+       GF_Node *coord; /*exposedField*/\r
+       GF_Node *normal;        /*exposedField*/\r
+       MFInt32 stripCount;     /*exposedField*/\r
+       GF_Node *texCoord;      /*exposedField*/\r
+       SFBool ccw;     /*field*/\r
+       SFBool colorPerVertex;  /*field*/\r
+       SFBool normalPerVertex; /*field*/\r
+       SFBool solid;   /*field*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_TriangleStripSet;\r
+\r
+\r
+typedef struct _tagX3DViewpoint\r
+{\r
+       BASE_NODE\r
+       SFBool set_bind;        /*eventIn*/\r
+       void (*on_set_bind)(GF_Node *pThis);    /*eventInHandler*/\r
+       SFFloat fieldOfView;    /*exposedField*/\r
+       SFBool jump;    /*exposedField*/\r
+       SFRotation orientation; /*exposedField*/\r
+       SFVec3f position;       /*exposedField*/\r
+       SFString description;   /*field*/\r
+       SFTime bindTime;        /*eventOut*/\r
+       SFBool isBound; /*eventOut*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+       SFVec3f centerOfRotation;       /*exposedField*/\r
+} X_Viewpoint;\r
+\r
+\r
+typedef struct _tagX3DVisibilitySensor\r
+{\r
+       BASE_NODE\r
+       SFVec3f center; /*exposedField*/\r
+       SFBool enabled; /*exposedField*/\r
+       SFVec3f size;   /*exposedField*/\r
+       SFTime enterTime;       /*eventOut*/\r
+       SFTime exitTime;        /*eventOut*/\r
+       SFBool isActive;        /*eventOut*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_VisibilitySensor;\r
+\r
+\r
+typedef struct _tagX3DWorldInfo\r
+{\r
+       BASE_NODE\r
+       MFString info;  /*field*/\r
+       SFString title; /*field*/\r
+       GF_Node *metadata;      /*exposedField*/\r
+} X_WorldInfo;\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+\r
+#endif         /*_GF_X3D_NODES_H*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/nodes_xbl.h b/tstools/DtsEdit/src/gpac/nodes_xbl.h
new file mode 100644 (file)
index 0000000..0fb7964
--- /dev/null
@@ -0,0 +1,70 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Authors: Cyril Concolato - Jean Le Feuvre\r
+ *    Copyright (c)2004-200X ENST - All rights reserved\r
+ *\r
+ *  This file is part of GPAC / XBL Elements \r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *\r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.        \r
+ *\r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.\r
+ *\r
+ */\r
+\r
+\r
+#ifndef _GF_XBL_NODES_H\r
+#define _GF_XBL_NODES_H\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/internal/scenegraph_dev.h>\r
+#include <gpac/svg_types.h>\r
+\r
+#define XBL_String_datatype SVG_String_datatype \r
+\r
+struct _all_atts {\r
+       DOM_String *id;\r
+       DOM_String *extends;\r
+       DOM_String *display;\r
+       DOM_String *inheritstyle;\r
+       DOM_String *includes;\r
+       DOM_String *name;\r
+       DOM_String *implements;\r
+       DOM_String *type;\r
+       DOM_String *readonly;\r
+       DOM_String *onget;\r
+       DOM_String *onset;\r
+       DOM_String *event;\r
+       DOM_String *action;\r
+       DOM_String *phase;\r
+       DOM_String *button;\r
+       DOM_String *modifiers;\r
+       DOM_String *keycode;\r
+       DOM_String *key;\r
+       DOM_String *charcode;\r
+       DOM_String *clickcount;\r
+       DOM_String *command;\r
+       DOM_String *preventdefault;\r
+       DOM_String *src;\r
+};\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+\r
+#endif         /*_GF_SVG_NODES_H*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/options.h b/tstools/DtsEdit/src/gpac/options.h
new file mode 100644 (file)
index 0000000..1db6a80
--- /dev/null
@@ -0,0 +1,291 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / Stream Management sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+\r
+\r
+#ifndef _GF_OPTIONS_H_\r
+#define _GF_OPTIONS_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+\r
+/*AspectRatio Type */\r
+enum\r
+{\r
+       GF_ASPECT_RATIO_KEEP = 0, /*keep AR*/\r
+       GF_ASPECT_RATIO_16_9, /*keep 16/9*/\r
+       GF_ASPECT_RATIO_4_3, /*keep 4/3*/\r
+       GF_ASPECT_RATIO_FILL_SCREEN /*none (all rendering area used)*/\r
+};\r
+\r
+/*AntiAlias settings*/\r
+enum\r
+{\r
+       GF_ANTIALIAS_NONE = 0, /*no antialiasing*/\r
+       GF_ANTIALIAS_TEXT, /*only text has antialiasing*/\r
+       GF_ANTIALIAS_FULL /*full antialiasing*/\r
+};\r
+\r
+/*GF_StreamingCache settings*/\r
+enum\r
+{\r
+       GF_MEDIA_CACHE_ENABLED = 0, /*cache on (with SET option, turns it on if possible)*/\r
+       GF_MEDIA_CACHE_DISABLED, /*cache off (with SET option saves current cache if any)*/\r
+       GF_MEDIA_CACHE_DISCARD, /*only used for SET option: turns cache off and discards current cache if any*/\r
+       GF_MEDIA_CACHE_RUNNING, /*only used in GET option: caching is enabled and currently running*/\r
+};\r
+\r
+/*PlayState settings*/\r
+enum\r
+{\r
+       GF_STATE_PLAYING = 0,   /*terminal is playing*/\r
+       GF_STATE_PAUSED, /*terminal is paused*/\r
+       GF_STATE_STEP_PAUSE, /*get/set only: terminal will pause after next frame (simulation tick). On get, indicates that rendering step hasn't performed yet*/\r
+};\r
+\r
+/*refresh mode*/\r
+enum\r
+{\r
+       GF_REFRESH_NORMAL = 0, /*posts normal redraw message */\r
+       GF_REFRESH_FULL, /*posts full redraw message, including reset of hardware resources*/\r
+};\r
+\r
+/*interaction level settings*/\r
+enum\r
+{      \r
+       /*regular interactions enabled (touch sensors)*/\r
+       GF_INTERACT_NORMAL = 1,\r
+       /*InputSensor interactions enabled (mouse and keyboard)*/\r
+       GF_INTERACT_INPUT_SENSOR = 2,\r
+       /*all navigation interactions enabled (mouse and keyboard)*/\r
+       GF_INTERACT_NAVIGATION = 4,\r
+\r
+       /*NOTE: GF_INTERACT_NORMAL and GF_INTERACT_NAVIGATION filter events. If set, any event processed by\r
+       these 2 modules won't be forwarded to the user*/\r
+};\r
+\r
+/*BoundingVolume settings*/\r
+enum\r
+{\r
+       GF_BOUNDS_NONE = 0, /*doesn't draw bounding volume*/\r
+       GF_BOUNDS_BOX, /*draw object bounding box / rect*/\r
+       GF_BOUNDS_AABB  /*draw object AABB tree (3D only) */\r
+};\r
+\r
+/*Wireframe settings*/\r
+enum\r
+{\r
+       GF_WIREFRAME_NONE = 0, /*draw solid volumes*/\r
+       GF_WIREFRAME_ONLY, /*draw only wireframe*/\r
+       GF_WIREFRAME_SOLID /*draw wireframe on solid object*/\r
+};\r
+\r
+\r
+/*navigation type*/\r
+enum \r
+{\r
+       /*navigation is disabled by content and cannot be forced by user*/\r
+       GF_NAVIGATE_TYPE_NONE,\r
+       /*2D navigation modes only can be used*/\r
+       GF_NAVIGATE_TYPE_2D,\r
+       /*3D navigation modes only can be used*/\r
+       GF_NAVIGATE_TYPE_3D\r
+};\r
+\r
+/*navigation modes - non-VRML ones are simply blaxxun contact ones*/\r
+enum\r
+{\r
+       /*no navigation*/\r
+       GF_NAVIGATE_NONE = 0,\r
+       /*3D navigation modes*/\r
+       /*walk navigation*/\r
+       GF_NAVIGATE_WALK,\r
+       /*fly navigation*/\r
+       GF_NAVIGATE_FLY,\r
+       /*pan navigation*/\r
+       GF_NAVIGATE_PAN,\r
+       /*game navigation*/\r
+       GF_NAVIGATE_GAME,\r
+       /*slide navigation, for 2D and 3D*/\r
+       GF_NAVIGATE_SLIDE,\r
+       /*all modes below disable collision detection & gravity in 3D*/\r
+       /*examine navigation, for 2D and 3D */\r
+       GF_NAVIGATE_EXAMINE,\r
+       /*orbit navigation - 3D only*/\r
+       GF_NAVIGATE_ORBIT,\r
+       /*QT-VR like navigation - 3D only*/\r
+       GF_NAVIGATE_VR,\r
+};\r
+\r
+/*collision flags*/\r
+enum\r
+{\r
+       /*no collision*/\r
+       GF_COLLISION_NONE,\r
+       /*regular collision*/\r
+       GF_COLLISION_NORMAL,\r
+       /*collision with camera displacement*/\r
+       GF_COLLISION_DISPLACEMENT,\r
+};\r
+\r
+/*TextTexturing settings*/\r
+enum\r
+{\r
+       GF_TEXTURE_TEXT_DEFAULT = 0, /*text drawn as texture in 3D mode, regular in 2D mode*/\r
+       GF_TEXTURE_TEXT_NEVER, /*text never drawn as texture*/\r
+       GF_TEXTURE_TEXT_ALWAYS /*text always drawn*/\r
+};\r
+\r
+/*Normal drawing settings*/\r
+enum\r
+{\r
+       GF_NORMALS_NONE = 0, /*normals never drawn*/\r
+       GF_NORMALS_FACE, /*normals drawn per face (at barycenter)*/\r
+       GF_NORMALS_VERTEX /*normals drawn per vertex*/\r
+};\r
+\r
+\r
+/*Back-face culling mode*/\r
+enum\r
+{\r
+       GF_BACK_CULL_OFF = 0, /*backface culling disabled*/\r
+       GF_BACK_CULL_ON, /*backface culliong enabled*/\r
+       GF_BACK_CULL_ALPHA, /*backface culling enabled alos for transparent meshes*/\r
+};\r
+\r
+/*high-level options*/\r
+enum\r
+{\r
+       /*set/get antialias flag (value: one of the AntiAlias enum) - may be ignored in OpenGL mode depending on graphic cards*/\r
+       GF_OPT_ANTIALIAS  =0,\r
+       /*set/get fast mode (value: boolean) */\r
+       GF_OPT_HIGHSPEED,\r
+       /*set/get fullscreen flag (value: boolean) */\r
+       GF_OPT_FULLSCREEN,\r
+       /*reset top-level transform to original (value: boolean)*/\r
+       GF_OPT_ORIGINAL_VIEW,\r
+       /*overrides BIFS size info for simple AV - this is not recommended since\r
+       it will resize the window to the size of the biggest texture (thus some elements\r
+       may be lost)*/\r
+       GF_OPT_OVERRIDE_SIZE,\r
+       /*set / get audio volume (value is intensity between 0 and 100) */\r
+       GF_OPT_AUDIO_VOLUME,\r
+       /*set / get audio pan (value is pan between 0 (all left) and 100(all right) )*/\r
+       GF_OPT_AUDIO_PAN,\r
+       /*get javascript flag (no set, depends on compil) - value: boolean, true if JS enabled in build*/\r
+       GF_OPT_HAS_JAVASCRIPT,\r
+       /*get selectable stream flag (no set) - value: boolean, true if audio/video/subtitle stream selection is \r
+       possible with content (if an MPEG-4 scene description is not present). Use regular OD browsing to get streams*/\r
+       GF_OPT_CAN_SELECT_STREAMS,\r
+       /*set/get control interaction, OR'ed combination of interaction flags*/\r
+       GF_OPT_INTERACTION_LEVEL,\r
+       /*set display window visible / get show/hide state*/\r
+       GF_OPT_VISIBLE,\r
+       /*set freeze display on/off / get freeze state freeze_display prevents any screen updates \r
+       needed when output driver uses direct video memory access*/\r
+       GF_OPT_FREEZE_DISPLAY,\r
+       /*get isOver flag: if true the file can be restarted, otherwise it should not\r
+       this is used to check is there are several timelines, timesensors or interactions, in which case \r
+       the file could be running for an undetermined period.\r
+       Note that nothing prevents the user app to restart such a file*/\r
+       GF_OPT_IS_FINISHED,\r
+       /*set/get aspect ratio (value: one of AspectRatio enum) */\r
+       GF_OPT_ASPECT_RATIO,\r
+       /*send a redraw message (SetOption only): all graphics info (display list, vectorial path) is \r
+       recomputed, and textures are reloaded in HW*/\r
+       GF_OPT_REFRESH,\r
+       /*set/get stress mode (value: boolean) - in stress mode a GF_OPT_FORCE_REDRAW is emulated at each frame*/\r
+       GF_OPT_STRESS_MODE,\r
+       /*get/set bounding volume drawing (value: one of the above option)*/\r
+       GF_OPT_DRAW_BOUNDS,\r
+       /*get/set texture text option - when enabled and usable (that depends on content), text is first rendered \r
+       to a texture and only the texture is drawn, rather than drawing all the text each time (CPU intensive)*/\r
+       GF_OPT_TEXTURE_TEXT,\r
+       /*fake option, reload config file (set only), including drivers. Plugins configs are not reloaded*/\r
+       GF_OPT_RELOAD_CONFIG,\r
+       /*get: returns whether the content enable navigation and if it's 2D or 3D.\r
+       set: reset viewpoint (whatever value is given)*/\r
+       GF_OPT_NAVIGATION_TYPE,\r
+       /*get current navigation mode - set navigation mode if allowed by content - this is not a resident\r
+       option (eg not stored in cfg)*/\r
+       GF_OPT_NAVIGATION,\r
+       /*get/set GF_StreamingCache state - cf above states for set*/\r
+       GF_OPT_MEDIA_CACHE,\r
+       /*get/set Play state - cf above states for set*/\r
+       GF_OPT_PLAY_STATE,\r
+       /*get/set OpenGL force mode - returns error if OpenGL is not supported*/\r
+       GF_OPT_USE_OPENGL,\r
+\r
+       /*set/get direct draw flag. In direct draw, the screen is entirely redrawn at each frame\r
+       value: boolean\r
+       */\r
+       GF_OPT_DIRECT_DRAW,\r
+       /*set/get scalable zoom (value: boolean)*/\r
+       GF_OPT_SCALABLE_ZOOM,\r
+       /*set/get YUV acceleration (value: boolean) */\r
+       GF_OPT_YUV_HARDWARE,\r
+       /*get (set not supported yet) hardware YUV format (value: YUV 4CC) */\r
+       GF_OPT_YUV_FORMAT,\r
+\r
+       /*max video cache size in kbytes*/\r
+       GF_OPT_VIDEO_CACHE_SIZE,\r
+\r
+       \r
+       /*              3D ONLY OPTIONS         */\r
+       /*set/get raster outline flag (value: boolean) - when set, no vectorial outlining is done, only \r
+       openGL raster outline*/\r
+       GF_OPT_RASTER_OUTLINES,\r
+       /*set/get pow2 emulation flag (value: boolean) - when set, video textures with non power of 2 dimensions\r
+       are emulated as pow2 by expanding the video buffer (image is not scaled). Otherwise the entire image\r
+       is rescaled. This flag does not affect image textures, which are always rescaled*/\r
+       GF_OPT_EMULATE_POW2,\r
+       /*get/set polygon antialiasing flag (value: boolean) (may be ugly with some cards)*/\r
+       GF_OPT_POLYGON_ANTIALIAS,\r
+       /*get/set wireframe flag (value: cf above) (may be ugly with some cards)*/\r
+       GF_OPT_WIREFRAME,\r
+       /*get/set wireframe flag (value: cf above) (may be ugly with some cards)*/\r
+       GF_OPT_NORMALS,\r
+       /*disable backface culling*/\r
+       GF_OPT_BACK_CULL,\r
+       /*get/set RECT Ext flag (value: boolean) - when set, GL rectangular texture extension is not used \r
+       (but NPO2 texturing is if available)*/\r
+       GF_OPT_NO_RECT_TEXTURE,\r
+       /*get/set bitmap draw mode. If set, bitmap doesn't use texturing but direct video copy*/\r
+       GF_OPT_BITMAP_COPY,\r
+       /*set/get headlight (value: boolean)*/\r
+       GF_OPT_HEADLIGHT,\r
+       /*set/get collision (value: cf above)*/\r
+       GF_OPT_COLLISION,\r
+       /*set/get gravity*/\r
+       GF_OPT_GRAVITY,\r
+};\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /*_GF_USER_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/path2d.h b/tstools/DtsEdit/src/gpac/path2d.h
new file mode 100644 (file)
index 0000000..7041cac
--- /dev/null
@@ -0,0 +1,611 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / common tools sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+\r
+#ifndef _GF_PATH2D_H_\r
+#define _GF_PATH2D_H_\r
+\r
+/*!\r
+ *     \file <gpac/path2d.h>\r
+ *     \brief 2D Vectorial Path functions.\r
+ */\r
+\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/math.h>\r
+#include <gpac/constants.h>\r
+\r
+\r
+/*!\r
+ *\addtogroup path_grp path2d\r
+ *\ingroup utils_grp\r
+ *\brief Vectorial 2D Path manipulation functions\r
+ *\r
+ *This section documents the 2D path object used in the GPAC framework. \r
+ *     @{\r
+ */\r
+\r
+       \r
+/*!\brief 2D Path Object\r
+ *\r
+ *The 2D path object is used to construct complex 2D shapes for later drawing\r
+ * or outlining.\r
+ */\r
+typedef struct\r
+{\r
+       /*! number of contours in path*/\r
+       u32 n_contours;\r
+       /*! number of points in path and alloc size*/\r
+       u32 n_points, n_alloc_points;\r
+       /*! path points */\r
+       GF_Point2D *points;\r
+       /*! point tags (one per point)*/\r
+       u8 *tags;\r
+       /*! contour end points*/\r
+       u32 *contours;\r
+       /*! path bbox - NEVER USE WITHOUT FIRST CALLING \ref gf_path_get_bounds*/\r
+       GF_Rect bbox;\r
+       /*! path flags*/\r
+       s32 flags;\r
+       /*! fineness to use whenever flattening the path - default is \ref FIX_ONE*/\r
+       Fixed fineness;\r
+} GF_Path;\r
+\r
+\r
+/*!\r
+ *     \brief path constructor\r
+ *\r
+ *     Constructs an empty 2D path object\r
+ *     \return new path object\r
+ */\r
+GF_Path *gf_path_new();\r
+/*!\r
+ *     \brief path destructor\r
+ *\r
+ *     Destructs a 2D path object\r
+ *     \param gp the target path\r
+ */\r
+void gf_path_del(GF_Path *gp);\r
+/*!\r
+ *     \brief path reset\r
+ *\r
+ *     Resets the 2D path object\r
+ *     \param gp the target path\r
+ */\r
+void gf_path_reset(GF_Path *gp);\r
+/*!\r
+ *     \brief path copy constuctor\r
+ *\r
+ *     Resets a copy of a 2D path object\r
+ *     \param gp the target path\r
+ *     \return new path copy\r
+ */\r
+GF_Path *gf_path_clone(GF_Path *gp);\r
+/*!\r
+ *     \brief path close\r
+ *\r
+ *     Closes current path contour\r
+ *     \param gp the target path\r
+ *     \return error code if any error, \ref GF_OK otherwise\r
+ */\r
+GF_Err gf_path_close(GF_Path *gp);\r
+/*!\r
+ *     \brief path moveTo\r
+ *\r
+ *     Starts a new contour from the specified point\r
+ *     \param gp the target path\r
+ *     \param x x-coordinate of the new point\r
+ *     \param y y-coordinate of the new point\r
+ *     \return error code if any error, \ref GF_OK otherwise\r
+ */\r
+GF_Err gf_path_add_move_to(GF_Path *gp, Fixed x, Fixed y);\r
+/*!\r
+ *     \brief starts new contour\r
+ *\r
+ *     Starts a new contour from the specified point\r
+ *     \param gp the target path\r
+ *     \param pt pointer to the new start point\r
+ *     \return error code if any error, \ref GF_OK otherwise\r
+ */\r
+GF_Err gf_path_add_move_to_vec(GF_Path *gp, GF_Point2D *pt);\r
+/*!\r
+ *     \brief adds line to path\r
+ *\r
+ *     Adds a line from the current point in path to the specified point\r
+ *     \param gp the target path\r
+ *     \param x x-coordinate of the line end\r
+ *     \param y y-coordinate of the line end\r
+ *     \return error code if any error, \ref GF_OK otherwise\r
+ */\r
+GF_Err gf_path_add_line_to(GF_Path *gp, Fixed x, Fixed y);\r
+/*!\r
+ *     \brief adds line to path\r
+ *\r
+ *     Adds a line from the current point in path to the specified point\r
+ *     \param gp the target path\r
+ *     \param pt line end\r
+ *     \return error code if any error, \ref GF_OK otherwise\r
+ */\r
+GF_Err gf_path_add_line_to_vec(GF_Path *gp, GF_Point2D *pt);\r
+/*!\r
+ *     \brief adds cubic to path\r
+ *\r
+ *     Adds a cubic bezier curve to the current contour, starting from the current path point\r
+ *     \param gp the target path\r
+ *     \param c1_x x-coordinate of the first control point of the cubic curve\r
+ *     \param c1_y y-coordinate of the first control point of the cubic curve\r
+ *     \param c2_x x-coordinate of the second control point of the cubic curve\r
+ *     \param c2_y y-coordinate of the second control point of the cubic curve\r
+ *     \param x x-coordinate of the end point of the cubic curve\r
+ *     \param y y-coordinate of the end point of the cubic curve\r
+ *     \return error code if any error, \ref GF_OK otherwise\r
+ */\r
+GF_Err gf_path_add_cubic_to(GF_Path *gp, Fixed c1_x, Fixed c1_y, Fixed c2_x, Fixed c2_y, Fixed x, Fixed y);\r
+/*!\r
+ *     \brief adds cubic to path\r
+ *\r
+ *     Adds a cubic bezier curve to the current contour, starting from the current path point\r
+ *     \param gp the target path\r
+ *     \param c1 first control point of the cubic curve\r
+ *     \param c2 second control point of the cubic curve\r
+ *     \param pt end point of the cubic curve\r
+ *     \return error code if any error, \ref GF_OK otherwise\r
+ */\r
+GF_Err gf_path_add_cubic_to_vec(GF_Path *gp, GF_Point2D *c1, GF_Point2D *c2, GF_Point2D *pt);\r
+/*!\r
+ *     \brief adds quadratic to path\r
+ *\r
+ *     Adds a quadratic bezier curve to the current contour, starting from the current path point\r
+ *     \param gp the target path\r
+ *     \param c_x x-coordinate of the control point of the quadratic curve\r
+ *     \param c_y y-coordinate of the control point of the quadratic curve\r
+ *     \param x x-coordinate of the end point of the cubic quadratic\r
+ *     \param y y-coordinate of the end point of the cubic quadratic\r
+ *     \return error code if any error, \ref GF_OK otherwise\r
+ */\r
+GF_Err gf_path_add_quadratic_to(GF_Path *gp, Fixed c_x, Fixed c_y, Fixed x, Fixed y);\r
+/*!\r
+ *     \brief adds quadratic to path\r
+ *\r
+ *     Adds a quadratic bezier curve to the current contour, starting from the current path point\r
+ *     \param gp the target path\r
+ *     \param c control point of the quadratic curve\r
+ *     \param pt end point of the cubic quadratic\r
+ *     \return error code if any error, \ref GF_OK otherwise\r
+ */\r
+GF_Err gf_path_add_quadratic_to_vec(GF_Path *gp, GF_Point2D *c, GF_Point2D *pt);\r
+/*!\r
+ *     \brief adds rectangle to path\r
+ *\r
+ *     Adds a rectangle contour to the path\r
+ *     \param gp the target path\r
+ *     \param cx x-coordinate of the rectangle center\r
+ *     \param cy y-coordinate of the rectangle center\r
+ *     \param w width of the rectangle\r
+ *     \param h height of the rectangle\r
+ *     \return error code if any error, \ref GF_OK otherwise\r
+ */\r
+GF_Err gf_path_add_rect_center(GF_Path *gp, Fixed cx, Fixed cy, Fixed w, Fixed h);\r
+/*!\r
+ *     \brief adds rectangle to path\r
+ *\r
+ *     Adds a rectangle contour to the path\r
+ *     \param gp the target path\r
+ *     \param ox left-most coordinate of the rectangle \r
+ *     \param oy top-most coordinate of the rectangle\r
+ *     \param w width of the rectangle\r
+ *     \param h height of the rectangle\r
+ *     \return error code if any error, \ref GF_OK otherwise\r
+ */\r
+GF_Err gf_path_add_rect(GF_Path *gp, Fixed ox, Fixed oy, Fixed w, Fixed h);\r
+/*!\r
+ *     \brief adds ellipse to path\r
+ *\r
+ *     Adds an ellipse contour to the path\r
+ *     \param gp the target path\r
+ *     \param cx x-coordinate of the ellipse center\r
+ *     \param cy y-coordinate of the ellipse center\r
+ *     \param a_axis length of the horizontal ellipse axis\r
+ *     \param b_axis length of the vertical ellipse axis\r
+ *     \return error code if any error, \ref GF_OK otherwise\r
+ */\r
+GF_Err gf_path_add_ellipse(GF_Path *gp, Fixed cx, Fixed cy, Fixed a_axis, Fixed b_axis);\r
+/*!\r
+ *     \brief adds N-bezier curve to path\r
+ *\r
+ *     Adds an N-degree bezier curve to the path, starting from the current point\r
+ *     \param gp the target path\r
+ *     \param pts points used to define the curve\r
+ *     \param nb_pts number of points used to define the curve. The degree of the curve is therefore (nb_pts-1).\r
+ *     \return error code if any error, \ref GF_OK otherwise\r
+ *     \note the fineness of the path must be set before calling this function.\r
+ */\r
+GF_Err gf_path_add_bezier(GF_Path *gp, GF_Point2D *pts, u32 nb_pts);\r
+/*!\r
+ *     \brief adds arc as described in MPEG-4 BIFS to path\r
+ *\r
+ *     Adds an arc contour to the path from focal and end points.\r
+ *     \param gp the target path\r
+ *     \param end_x x-coordinate of the arc end point\r
+ *     \param end_y y-coordinate of the arc end point\r
+ *     \param fa_x x-coordinate of the arc first focal point\r
+ *     \param fa_y y-coordinate of the arc first focal point\r
+ *     \param fb_x x-coordinate of the arc second focal point\r
+ *     \param fb_y y-coordinate of the arc second focal point\r
+ *     \param cw if 1, the arc will be clockwise, otherwise counter-clockwise.\r
+ *     \return error code if any error, \ref GF_OK otherwise\r
+ */\r
+GF_Err gf_path_add_arc_to(GF_Path *gp, Fixed end_x, Fixed end_y, Fixed fa_x, Fixed fa_y, Fixed fb_x, Fixed fb_y, Bool cw);\r
+/*!\r
+ *     \brief adds arc as described in SVG to path\r
+ *\r
+ *     Adds an arc contour to the path from end point, radii and 3 parameters.\r
+ *     \param gp the target path\r
+ *     \param end_x x-coordinate of the arc end point\r
+ *     \param end_y y-coordinate of the arc end point\r
+ *     \param r_x x-axis radius\r
+ *     \param r_y y-axis radius \r
+ *     \param x_axis_rotation angle for the x-axis\r
+ *     \param large_arc_flag large or short arc selection\r
+ *     \param sweep_flag if 1, the arc will be clockwise, otherwise counter-clockwise.\r
+ *     \return error code if any error, \ref GF_OK otherwise\r
+ */\r
+GF_Err gf_path_add_svg_arc_to(GF_Path *gp, Fixed end_x, Fixed end_y, Fixed r_x, Fixed r_y, Fixed x_axis_rotation, Bool large_arc_flag, Bool sweep_flag);\r
+/*!\r
+ *     \brief adds arc to path\r
+ *\r
+ *     Adds an arc contour to the path.\r
+ *     \param gp the target path\r
+ *     \param radius radius of the arc \r
+ *     \param start_angle start angle of the arc in radians\r
+ *     \param end_angle end angle of the arc in radians\r
+ *     \param close_type closing type: 0 for open arc, 1 for close arc, 2 for pie\r
+ *     \return error code if any error, \ref GF_OK otherwise\r
+ */\r
+GF_Err gf_path_add_arc(GF_Path *gp, Fixed radius, Fixed start_angle, Fixed end_angle, u32 close_type);\r
+\r
+/*!\r
+ *     \brief concatenates path\r
+ *\r
+ *     Adds a sub-path to the path with a given transform.\r
+ *     \param gp the target path\r
+ *     \param subpath the path to add\r
+ *     \param mat Matrix for subpath \r
+ *     \return error code if any error, \ref GF_OK otherwise\r
+ */\r
+GF_Err gf_path_add_subpath(GF_Path *gp, GF_Path *subpath, GF_Matrix2D *mx);\r
+/*!\r
+ *     \brief gets path control bounds\r
+ *\r
+ *     Gets the path control bounds, i.e. the rectangle covering all lineTo and bezier control points.\r
+ *     \param gp the target path\r
+ *     \param rc pointer to rectangle receiving the control rectangle\r
+ *     \return error code if any error, \ref GF_OK otherwise\r
+ */\r
+GF_Err gf_path_get_control_bounds(GF_Path *gp, GF_Rect *rc);\r
+/*!\r
+ *     \brief gets path bounds\r
+ *\r
+ *     Gets the path bounds, i.e. the rectangle covering all points in path except bezier control points.\r
+ *     \param gp the target path\r
+ *     \param rc pointer to rectangle receiving the control rectangle\r
+ *     \return error code if any error, \ref GF_OK otherwise\r
+ */\r
+GF_Err gf_path_get_bounds(GF_Path *gp, GF_Rect *rc);\r
+/*!\r
+ *     \brief flattens path \r
+ *\r
+ *     Flattens the path, i.e. transform all bezier curves to lines according to the path flatness.\r
+ *     \param gp the target path\r
+ */\r
+void gf_path_flatten(GF_Path *gp);\r
+/*!\r
+ *     \brief gets flatten copy of path \r
+ *\r
+ *     Gets a flatten copy of the path.\r
+ *     \param gp the target path\r
+ *     \return the flatten path\r
+ */\r
+GF_Path *gf_path_get_flatten(GF_Path *gp);\r
+/*!\r
+ *     \brief point over path testing\r
+ *\r
+ *     Tests if a point is over a path or not, according to the path filling rule.\r
+ *     \param gp the target path\r
+ *     \param x x-coordinate of the point to check\r
+ *     \param y y-coordinate of the point to check\r
+ *     \return 1 if the point is over the path, 0 otherwise.\r
+ */\r
+Bool gf_path_point_over(GF_Path *gp, Fixed x, Fixed y);\r
+\r
+/*!\r
+ *     \brief path init testing\r
+ *\r
+ *     Tests if the path is empty or not.\r
+ *     \param gp the target path\r
+ *     \return 1 if the path is empty, 0 otherwise.\r
+ */\r
+Bool gf_path_is_empty(GF_Path *gp);\r
+\r
+/*!\r
+ *     \brief path iterator \r
+ *\r
+ *     The path iterator object is used to compute the length of a given path as well\r
+ * as transformation matrices along this path.\r
+ */\r
+typedef struct _path_iterator GF_PathIterator;\r
+\r
+/*!\r
+ *     \brief path iterator constructor\r
+ *\r
+ *     Creates a new path iterator from a given path\r
+ *     \param gp the target path\r
+ *     \return the path iterator object.\r
+ */\r
+GF_PathIterator *gf_path_iterator_new(GF_Path *gp);\r
+/*!\r
+ *     \brief path iterator destructor\r
+ *\r
+ *     Destructs the path iterator object\r
+ *     \param it the target path iterator\r
+ */\r
+void gf_path_iterator_del(GF_PathIterator *it);\r
+\r
+/*!\r
+ *     \brief get path length\r
+ *\r
+ *     Gets a path length from its iterator\r
+ *     \param it the target path iterator\r
+ *     \return the length of the path\r
+ */\r
+Fixed gf_path_iterator_get_length(GF_PathIterator *it);\r
+/*!\r
+ *\brief gets transformation matrix at given point on path\r
+ *\r
+ * Gets the transformation of a given point on the path, given by offset from origin. \r
+ *The transform is so that a local system is translated to the given point, its x-axis tangent \r
+ *to the path and in the same direction. The path direction is from first point to last point\r
+ *of the path.\r
+ *     \param it the target path iterator\r
+ *     \param offset length on the path in local system unit\r
+ *     \param follow_tangent indicates if transformation shall be computed if offset indicates a point outside the path (<0 or >path_length). In which case the path shall be virtually extended by the tangent at origin (offset <0) or at end (offset>path_length). Otherwise the transformation is not computed and 0 is returned.\r
+ *     \param mat matrix to be transformed (transformation shall be appended) - the matrix shall not be initialized\r
+ *     \param smooth_edges indicates if discontinuities shall be smoothed. If not set, the rotation angle THETA is the slope (DX/DY) of the current segment found.\r
+ *     \param length_after_point if set and smooth_edges is set, the amount of the object that lies on next segment shall be computed according to length_after_point. \r
+ \code\r
+  Let:\r
+       len_last: length of current checked segment\r
+       len1: length of all previous segments so that len1 + len_last >= offset then if (offset + length_after_point > len1 + len_last) {\r
+       ratio = (len1 + len_last - offset) / length_after_point;\r
+       then THETA = ratio * slope(L1) + (1-ratio) * slope(L2)\r
+\r
+  Of course care must be taken for PI/2 angles and similar situations \r
+ \endcode\r
+\r
+ *     \return 1 if matrix has been updated, 0 otherwise, if failure or if point is out of path without tangent extension.\r
+ */\r
+Bool gf_path_iterator_get_transform(GF_PathIterator *it, Fixed offset, Bool follow_tangent, GF_Matrix2D *mat, Bool smooth_edges, Fixed length_after_point);\r
+\r
+\r
+\r
+/*! brief gets convexity type for a 2D polygon\r
+ *\r
+ * Gets the convexity type of the given 2D polygon\r
+ * \param pts the points of the polygon\r
+ * \param nb_pts number of points in the polygon\r
+ * \return the convexity type of the polygon\r
+*/\r
+u32 gf_polygone2d_get_convexity(GF_Point2D *pts, u32 nb_pts);\r
+\r
+\r
+/* 2D Path constants */\r
+\r
+/*!\r
+ *2D Path point tags\r
+ *     \hideinitializer\r
+ */\r
+enum\r
+{\r
+       /*/! Point is on curve (moveTo, lineTo, end of splines)*/\r
+       GF_PATH_CURVE_ON = 1,\r
+       /*! Point is a contour close*/\r
+       GF_PATH_CLOSE   = 5,\r
+       /*! Point is a quadratic control point*/\r
+       GF_PATH_CURVE_CONIC = 0,\r
+       /*! Point is a cubic control point*/\r
+       GF_PATH_CURVE_CUBIC = 2,\r
+};\r
+\r
+\r
+/*!\r
+ *2D Path flags\r
+ *     \hideinitializer\r
+ */\r
+enum\r
+{\r
+       /*! Path is filled using the zero-nonzero rule. If not set, filling uses odd/even rule*/\r
+       GF_PATH_FILL_ZERO_NONZERO = 1,\r
+       /*! When set bbox must be recomputed. \r
+       \note Read only, used to avoid wasting time on bounds calculation*/\r
+       GF_PATH_BBOX_DIRTY = 2,\r
+       /*! Indicates the path is flattened flattened\r
+       \note Read only, used to avoid wasting time on flattening*/\r
+       GF_PATH_FLATTENED = 4,\r
+};\r
+\r
+/*!\r
+ * 2D Polygon convexity type\r
+ *     \hideinitializer\r
+ */\r
+enum\r
+{\r
+       /*! Polygon is either complex or unknown*/\r
+       GF_POLYGON_COMPLEX,\r
+       /*! Polygon is complex, starting in counter-clockwise order*/\r
+       GF_POLYGON_COMPLEX_CCW,\r
+       /*! Polygon is complex, starting in clockwise order*/\r
+       GF_POLYGON_COMPLEX_CW,\r
+       /*! Polygon is a counter-clockwise convex polygon*/\r
+       GF_POLYGON_CONVEX_CCW,\r
+       /*! Polygon is a clockwise convex polygon*/\r
+       GF_POLYGON_CONVEX_CW,\r
+       /*! Polygon is a convex line (degenerated path with all segments aligned)*/\r
+       GF_POLYGON_CONVEX_LINE\r
+};\r
+\r
+/*!\r
+ * Stencil alignment type for outlining\r
+ *     \hideinitializer\r
+ */\r
+enum\r
+{      \r
+       /*! outline is centered on the path (default)*/\r
+       GF_PATH_LINE_CENTER = 0,\r
+       /*! outline is inside the path*/\r
+       GF_PATH_LINE_INSIDE,\r
+       /*! outline is outside the path*/\r
+       GF_PATH_LINE_OUTSIDE,\r
+};\r
+\r
+/*!\r
+ * Line cap type for outlining\r
+ *     \hideinitializer\r
+ */\r
+enum\r
+{\r
+       /*! End of line is flat (default)*/\r
+       GF_LINE_CAP_FLAT = 0,\r
+       /*! End of line is round*/\r
+       GF_LINE_CAP_ROUND,\r
+       /*! End of line is square*/\r
+       GF_LINE_CAP_SQUARE,\r
+       /*! End of line is triangle*/\r
+       GF_LINE_CAP_TRIANGLE,\r
+};\r
+\r
+/*!\r
+ * Line join type for outlining\r
+ *     \hideinitializer\r
+ */\r
+enum\r
+{\r
+       /*! Line join is a miter join (default)*/\r
+       GF_LINE_JOIN_MITER = 0,\r
+       /*! Line join is a round join*/\r
+       GF_LINE_JOIN_ROUND,\r
+       /*! Line join is a bevel join*/\r
+       GF_LINE_JOIN_BEVEL,\r
+       /*! Line join is a miter then bevel join*/\r
+       GF_LINE_JOIN_MITER_SVG\r
+};\r
+\r
+/*!\r
+ * Dash types for outlining\r
+ *     \hideinitializer\r
+ */\r
+enum\r
+{\r
+       /*! No dashing is used (default)*/\r
+       GF_DASH_STYLE_PLAIN = 0,\r
+       /*! Predefined dash pattern is used*/\r
+       GF_DASH_STYLE_DASH,\r
+       /*! Predefined dot pattern is used*/\r
+       GF_DASH_STYLE_DOT,\r
+       /*! Predefined dash-dot pattern is used*/\r
+       GF_DASH_STYLE_DASH_DOT,\r
+       /*! Predefined dash-dash-dot pattern is used*/\r
+       GF_DASH_STYLE_DASH_DASH_DOT,\r
+       /*! Predefined dash-dot-dot pattern is used*/\r
+       GF_DASH_STYLE_DASH_DOT_DOT,\r
+       /*! Custom pattern is used. Dash lengths are given in percentage of the pen width*/\r
+       GF_DASH_STYLE_CUSTOM,\r
+       /*! SVG pattern is used. Dash lengths are given in the same unit as the pen width\r
+       and dash offset follows SVG specs (offset in dash pattern)*/\r
+       GF_DASH_STYLE_SVG,\r
+};\r
+\r
+\r
+/*!\brief Custom dash pattern\r
+ *\r
+ *The custom dash pattern object is used to specify custom dashes when outlining a path.\r
+ */\r
+typedef struct\r
+{\r
+       /*! Number of dashes in the pattern*/\r
+       u32 num_dash;\r
+       /*! Value of the pattern dashes. Unit depends on the dash type*/\r
+       Fixed *dashes;\r
+} GF_DashSettings;\r
+\r
+/*!\brief Pen properties \r
+ *\r
+ *The pen properties object is used to specify several parameters used when building\r
+ *the vectorial outline of a path.\r
+ */\r
+typedef struct\r
+{\r
+       /*! The width of the outline*/\r
+       Fixed width;\r
+       /*! The style of the lines ends*/\r
+       u8 cap;\r
+       /*! The style of the lines joins*/\r
+       u8 join;\r
+       /*! The alignment of the outline with regard to the path*/\r
+       u8 align;\r
+       /*! The dash style of the line*/\r
+       u8 dash;\r
+       /*! The miter limit of the line joins*/\r
+       Fixed miterLimit;\r
+       /*! The initial dash offset in the outline. All points before this offset will be \r
+       * ignored when building the outline*/\r
+       Fixed dash_offset;\r
+       /*! The dash pattern used for curstom dashing*/\r
+       GF_DashSettings *dash_set;\r
+       /*! The author-specified path length. Ignored if <= 0*/\r
+       Fixed path_length;\r
+} GF_PenSettings;\r
+\r
+/*! brief builds the vectorial outline of a path\r
+ *\r
+ * Builds the vectorial outline of a path for the given settings. The outline of a path is a path.\r
+ * \param path the desired path to outline\r
+ * \param pen the properties of the virtual pen used for outlining\r
+ * \return the outline of the path \r
+*/\r
+GF_Path *gf_path_get_outline(GF_Path *path, GF_PenSettings pen);\r
+\r
+\r
+/*! @} */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif /*_GF_PATH2D_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/scene_manager.h b/tstools/DtsEdit/src/gpac/scene_manager.h
new file mode 100644 (file)
index 0000000..613c359
--- /dev/null
@@ -0,0 +1,429 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / Authoring Tools sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_SCENE_MANAGER_H_\r
+#define _GF_SCENE_MANAGER_H_\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/isomedia.h>\r
+#include <gpac/scenegraph_vrml.h>\r
+\r
+/*\r
+               Memory scene management\r
+\r
+*/\r
+\r
+/*NDT check - return 1 if node belongs to given NDT. Handles proto, and assumes undefined nodes\r
+always belong to the desired NDT*/\r
+Bool gf_node_in_table(GF_Node *node, u32 NDTType);\r
+\r
+/*generic systems access unit context*/\r
+typedef struct\r
+{      \r
+       /*AU timing in TimeStampResolution*/\r
+       u64 timing;\r
+       /*timing in sec - used if timing isn't set*/\r
+       Double timing_sec;\r
+       /*random access indication - may be overriden by encoder*/\r
+       Bool is_rap;\r
+       /*opaque command list per stream type*/\r
+       GF_List *commands;\r
+\r
+       /*pointer to owner stream*/\r
+       struct _stream_context *owner;\r
+} GF_AUContext;\r
+\r
+/*generic stream context*/\r
+typedef struct _stream_context\r
+{\r
+       /*ESID of stream, or 0 if unknown in which case it is automatically updated at encode stage*/\r
+       u16 ESID;\r
+       /*stream type - used as a hint, the encoder(s) may override it*/\r
+       u8 streamType;\r
+       u8 objectType;\r
+       u32 timeScale;\r
+       GF_List *AUs;\r
+\r
+       u64 dump_time_offset;\r
+       /*last stream AU time, when playing the context directly*/\r
+       u64 last_au_time;\r
+       /*set if stream is part of root OD (playback only)*/\r
+       Bool in_root_od;\r
+} GF_StreamContext;\r
+\r
+/*generic presentation context*/\r
+typedef struct \r
+{\r
+       /*the one and only scene graph used by the scene manager.*/\r
+       GF_SceneGraph *scene_graph;\r
+\r
+       /*all systems streams used in presentation*/\r
+       GF_List *streams;\r
+       /*(initial) object descriptor if any - if not set the encoder will generate it*/\r
+       GF_ObjectDescriptor *root_od;\r
+\r
+       /*scene resolution*/\r
+       u32 scene_width, scene_height;\r
+       Bool is_pixel_metrics;\r
+\r
+       /*BIFS encoding - these is needed for:\r
+       - protos in protos which define subscene graph, hence seperate namespace, but are coded with the same IDs\r
+       - route insertions which are not tracked by the scene graph\r
+       we could do this by hand (counting protos & route insert) but let's be lazy\r
+       */\r
+       u32 max_node_id, max_route_id, max_proto_id;\r
+} GF_SceneManager;\r
+\r
+/*scene manager constructor - @scene_graph: scene graph used by the manager. */\r
+GF_SceneManager *gf_sm_new(GF_SceneGraph *scene_graph);\r
+/*scene manager destructor - does not destroy the attached scene graph*/\r
+void gf_sm_del(GF_SceneManager *ctx);\r
+/*retrive or create a stream context in the presentation context\r
+WARNING: if a stream with the same streamType and no ESID already exists in the context, \r
+it is assigned the requested ES_ID - this is needed to solve base layer*/\r
+GF_StreamContext *gf_sm_stream_new(GF_SceneManager *ctx, u16 ES_ID, u8 streamType, u8 objectType);\r
+/*removes and destroy stream context from presentation context*/\r
+void gf_sm_stream_del(GF_SceneManager *ctx, GF_StreamContext *sc);\r
+/*locate a stream based on its id*/\r
+GF_StreamContext *gf_sm_stream_find(GF_SceneManager *ctx, u16 ES_ID);\r
+/*create a new AU context in the given stream context*/\r
+GF_AUContext *gf_sm_stream_au_new(GF_StreamContext *stream, u64 timing, Double time_ms, Bool isRap);\r
+\r
+/*reset the context: \r
+- purge all access units on all streams \r
+- destroy root OD\r
+*/\r
+void gf_sm_reset(GF_SceneManager *ctx);\r
+\r
+/*applies all commands in all streams (only BIFS for now): the context manager will only have one command per\r
+stream, this command being a random access*/\r
+GF_Err gf_sm_make_random_access(GF_SceneManager *ctx);\r
+\r
+/*translates SRT/SUB (TTXT not supported) source into BIFS command stream source\r
+       @src: GF_ESD of new stream (MUST be created before to store TS resolution)\r
+       @mux: GF_MuxInfo of src stream - shall contain a valid file, and at least the textNode member set\r
+*/\r
+GF_Err gf_sm_import_bifs_subtitle(GF_SceneManager *ctx, GF_ESD *src, GF_MuxInfo *mux);\r
+\r
+\r
+/*SWF to MPEG-4 flags*/\r
+enum\r
+{\r
+       /*all data in dictionary is in first frame*/\r
+       GF_SM_SWF_STATIC_DICT = 1,\r
+       /*remove all text*/\r
+       GF_SM_SWF_NO_TEXT = (1<<1),\r
+       /*remove embedded fonts (force device font usage)*/\r
+       GF_SM_SWF_NO_FONT = (1<<2),\r
+       /*forces XCurve2D which supports quadratic bezier*/\r
+       GF_SM_SWF_QUAD_CURVE = (1<<3),\r
+       /*forces line remove*/\r
+       GF_SM_SWF_NO_LINE = (1<<4),\r
+       /*forces XLineProperties (supports scalable lines)*/\r
+       GF_SM_SWF_SCALABLE_LINE = (1<<5),\r
+       /*forces gradient remove (using center color) */\r
+       GF_SM_SWF_NO_GRADIENT = (1<<6),\r
+       /*use a dedicated BIFS stream to control display list. This allows positioning in the movie\r
+       (jump to frame, etc..) as well as looping from inside the movie (set by default)*/\r
+       GF_SM_SWF_SPLIT_TIMELINE = (1<<7),\r
+       /*enable appearance reuse*/\r
+       GF_SM_SWF_REUSE_APPEARANCE = (1<<9),\r
+       /*enable IndexedCurve2D proto*/\r
+       GF_SM_SWF_USE_IC2D = (1<<10),\r
+};\r
+\r
+/*general loader flags*/\r
+enum\r
+{\r
+       /*if set, always load MPEG-4 nodes, otherwise X3D versions are used for vrml/x3d*/\r
+       GF_SM_LOAD_MPEG4_STRICT = 1,\r
+       /*signal loading is done for playback:  \r
+               scrips will be queued in their parent command for later loading\r
+               SFTime (MPEG-4 only) fields will be handled correctly when inserting/creating nodes based on AU timing\r
+       */\r
+       GF_SM_LOAD_FOR_PLAYBACK = 1<<1,\r
+\r
+       /*special flag indicating that the context is already loaded & valid (eg no default stream creations & co)\r
+       this is used when performing diff encoding (eg the file to load only has updates).\r
+       When set, gf_sm_load_init will NOT attempt to parse first frame*/\r
+       GF_SM_LOAD_CONTEXT_READY = 1<<2,\r
+\r
+       /* in this mode, each root svg tag will be interpreted as a REPLACE SCENE */\r
+       GF_SM_LOAD_CONTEXT_STREAMING = 1<<3,\r
+};\r
+\r
+/*loader type, usually detected based on file ext*/\r
+enum\r
+{      \r
+       GF_SM_LOAD_BT = 1, /*BT loader*/\r
+       GF_SM_LOAD_VRML, /*VRML97 loader*/\r
+       GF_SM_LOAD_X3DV, /*X3D VRML loader*/\r
+       GF_SM_LOAD_XMTA, /*XMT-A loader*/\r
+       GF_SM_LOAD_X3D, /*X3D XML loader*/\r
+       GF_SM_LOAD_SVG_DA, /*SVG loader with dynamic allocation of attributes */\r
+       GF_SM_LOAD_XSR, /*LASeR+XML loader*/\r
+       GF_SM_LOAD_DIMS, /*DIMS LASeR+XML loader*/\r
+       GF_SM_LOAD_SWF, /*SWF->MPEG-4 converter*/\r
+       GF_SM_LOAD_QT, /*MOV->MPEG-4 converter (only cubic QTVR for now)*/\r
+       GF_SM_LOAD_MP4, /*MP4 memory loader*/\r
+       GF_SM_LOAD_XBL\r
+};\r
+\r
+typedef struct\r
+{\r
+       /*scene graph worked on - may be NULL if ctx is present*/\r
+       GF_SceneGraph *scene_graph;\r
+\r
+       struct _inline_scene  *is;\r
+\r
+       /*context manager to load (MUST BE RESETED BEFORE if needed) - may be NULL for loaders not using commands, \r
+       in which case the graph will be directly updated*/\r
+       GF_SceneManager *ctx;\r
+       /*file to import except IsoMedia files*/\r
+       const char *fileName;\r
+       /*IsoMedia file to import (we need to be able to load from an opened file for scene stats)*/\r
+       GF_ISOFile *isom;\r
+       /*swf import flags*/\r
+       u32 swf_import_flags;\r
+       /*swf flatten limit: angle limit below which 2 lines are considered as aligned, \r
+       in which case the lines are merged as one. If 0, no flattening happens*/\r
+       Float swf_flatten_limit;\r
+       /*swf extraction path: if set, swf media (mp3, jpeg) are extracted to this path. If not set\r
+       media are extracted to original file directory*/\r
+       const char *localPath;\r
+\r
+       /*loader flags*/\r
+       u32 flags;\r
+\r
+       /*private to loader*/\r
+       void *loader_priv;\r
+       /*loader type, one of the above value. If not set, detected based on file extension*/\r
+       u32 type;\r
+} GF_SceneLoader;\r
+\r
+/*initializes the context loader - this will load any IOD and the first frame of the main scene*/\r
+GF_Err gf_sm_load_init(GF_SceneLoader *load);\r
+/*completely loads context*/\r
+GF_Err gf_sm_load_run(GF_SceneLoader *load);\r
+/*terminates the context loader*/\r
+void gf_sm_load_done(GF_SceneLoader *load);\r
+\r
+/*parses memory scene (any textural format) into the context\r
+!! THE LOADER TYPE MUST BE ASSIGNED (BT/WRL/XMT/X3D/SVG only) !!\r
+The string MUST be at least 4 bytes long in order to detect BOM (unicode encoding). \r
+The string can ba either UTF-8 or UTF-16 data\r
+if clean_at_end is set, associated parser is destroyed. Otherwise, a call to gf_sm_load_done must be done \r
+to clean ressources (needed for SAX progressive loading)\r
+*/\r
+GF_Err gf_sm_load_string(GF_SceneLoader *load, char *str, Bool clean_at_end);\r
+\r
+\r
+/*scene dump mode*/\r
+enum\r
+{\r
+       /*BT*/\r
+       GF_SM_DUMP_BT = 0,\r
+       /*XMT-A*/\r
+       GF_SM_DUMP_XMTA,\r
+       /*VRML Text (WRL)*/\r
+       GF_SM_DUMP_VRML,\r
+       /*X3D Text (x3dv)*/\r
+       GF_SM_DUMP_X3D_VRML,\r
+       /*X3D XML*/\r
+       GF_SM_DUMP_X3D_XML,\r
+       /*LASeR XML*/\r
+       GF_SM_DUMP_LASER,\r
+       /*SVG dump (only dumps svg root of the first LASeR unit*/\r
+       GF_SM_DUMP_SVG,\r
+       /*blind XML dump*/\r
+       GF_SM_DUMP_XML,\r
+       /*automatic selection of MPEG4 vs X3D, text mode*/\r
+       GF_SM_DUMP_AUTO_TXT,\r
+       /*automatic selection of MPEG4 vs X3D, xml mode*/\r
+       GF_SM_DUMP_AUTO_XML,\r
+};\r
+\r
+#ifndef GPAC_READ_ONLY\r
+\r
+/*dumps scene context to BT or XMT\r
+@rad_name: file name & loc without extension - if NULL dump will happen in stdout\r
+@dump_mode: one of the above*/\r
+GF_Err gf_sm_dump(GF_SceneManager *ctx, char *rad_name, u32 dump_mode);\r
+\r
+#endif\r
+\r
+\r
+/*encoding flags*/\r
+enum\r
+{\r
+       /*if flag set, DEF names are encoded*/\r
+       GF_SM_ENCODE_USE_NAMES =        1,\r
+       /*if flag set, RAP are generated inband rather than as redundant samples*/\r
+       GF_SM_ENCODE_RAP_INBAND = 2,\r
+       /*if flag set, RAP are generated inband rather than as sync shadow samples*/\r
+       GF_SM_ENCODE_RAP_SHADOW = 4,\r
+};\r
+\r
+typedef struct\r
+{\r
+       /*encoding flags*/\r
+       u32 flags;\r
+       /*delay between 2 RAP in ms. If 0 RAPs are not forced - BIFS and LASeR only for now*/\r
+       u32 rap_freq;\r
+       /*if set, any unknown stream in the scene will be looked for in @mediaSource (MP4 only)*/\r
+       char *mediaSource;\r
+       /*LASeR */\r
+       /*resolution*/\r
+       s32 resolution;\r
+       /*coordBits, scaleBits*/\r
+       u32 coord_bits, scale_bits;\r
+       /*auto quantification type:\r
+               0: none\r
+               1: LASeR\r
+               2: BIFS\r
+       */\r
+       u32 auto_quant;\r
+} GF_SMEncodeOptions;\r
+\r
+/*\r
+encodes scene context into @mp4.\r
+if @log is set, generates BIFS encoder log file\r
+*/\r
+GF_Err gf_sm_encode_to_file(GF_SceneManager *ctx, GF_ISOFile *mp4, GF_SMEncodeOptions *opt);\r
+\r
+/*Dumping tools*/\r
+typedef struct _scenedump GF_SceneDumper;\r
+/*create a scene dumper \r
+@graph: scene graph being dumped\r
+@rad_name: file radical (NULL for stdout) - if not NULL MUST BE GF_MAX_PATH length\r
+@indent_char: indent format\r
+@XMLDump: if set, dumps in XML format otherwise regular text\r
+returns NULL if can't create a file\r
+*/\r
+GF_SceneDumper *gf_sm_dumper_new(GF_SceneGraph *graph, char *rad_name, char indent_char, Bool XMLDump);\r
+void gf_sm_dumper_del(GF_SceneDumper *bd);\r
+\r
+/*dumps commands list\r
+@indent: indent to use\r
+@skip_replace_scene_header: if set and dumping in BT mode, the initial REPLACE SCENE header is skipped\r
+*/\r
+GF_Err gf_sm_dump_command_list(GF_SceneDumper *sdump, GF_List *comList, u32 indent, Bool skip_first_replace);\r
+\r
+/*dumps complete graph - \r
+@skip_proto: proto declarations are skipped\r
+@skip_routes: routes are not dumped\r
+*/\r
+GF_Err gf_sm_dump_graph(GF_SceneDumper *sdump, Bool skip_proto, Bool skip_routes);\r
+\r
+\r
+#ifndef GPAC_READ_ONLY\r
+\r
+/*stat object - to refine :)*/\r
+\r
+/*store nodes or proto stats*/\r
+typedef struct\r
+{\r
+       /*node type or protoID*/\r
+       u32 tag;\r
+       const char *name;\r
+       /*number of created nodes*/\r
+       u32 nb_created;\r
+       /*number of used nodes*/\r
+       u32 nb_used;\r
+       /*number of used nodes*/\r
+       u32 nb_del;\r
+} GF_NodeStats;\r
+\r
+typedef struct _scenestat\r
+{\r
+       GF_List *node_stats;\r
+       GF_List *proto_stats;\r
+       \r
+       /*ranges of all SFVec2fs for points only (MFVec2fs)*/\r
+       SFVec2f max_2d, min_2d;\r
+       /* resolution of 2D points (nb bits for integer part and decimal part)*/\r
+       u32 int_res_2d, frac_res_2d;\r
+       /* resolution of scale coefficient (nb bits for integer part)*/\r
+       u32 scale_int_res_2d, scale_frac_res_2d;\r
+\r
+       Fixed max_fixed, min_fixed;\r
+\r
+       /*number of parsed 2D points*/\r
+       u32 count_2d;\r
+       /*number of deleted 2D points*/\r
+       u32 rem_2d;\r
+\r
+       /*ranges of all SFVec3fs for points only (MFVec3fs)*/\r
+       SFVec3f max_3d, min_3d;\r
+       u32 count_3d;\r
+       /*number of deleted 3D points*/\r
+       u32 rem_3d;\r
+\r
+       u32 count_float, rem_float;\r
+       u32 count_color, rem_color;\r
+       /*all SFVec2f other than MFVec2fs elements*/\r
+       u32 count_2f;\r
+       /*all SFVec3f other than MFVec3fs elements*/\r
+       u32 count_3f;\r
+\r
+       u32 nb_svg_attributes;\r
+\r
+       GF_StreamContext *base_layer;\r
+} GF_SceneStatistics;\r
+\r
+typedef struct _statman GF_StatManager;\r
+\r
+/*creates new stat handler*/\r
+GF_StatManager *gf_sm_stats_new();\r
+/*deletes stat handler*/\r
+void gf_sm_stats_del(GF_StatManager *stat);\r
+/*reset statistics*/\r
+void gf_sm_stats_reset(GF_StatManager *stat);\r
+\r
+/*get statistics - do NOT modify the returned structure*/\r
+GF_SceneStatistics *gf_sm_stats_get(GF_StatManager *stat);\r
+\r
+/*produces stat report for a complete graph*/\r
+GF_Err gf_sm_stats_for_graph(GF_StatManager *stat, GF_SceneGraph *sg);\r
+\r
+/*produces stat report for the full scene*/\r
+GF_Err gf_sm_stats_for_scene(GF_StatManager *stat, GF_SceneManager *sm);\r
+\r
+/*produces stat report for the given command*/\r
+GF_Err gf_sm_stats_for_command(GF_StatManager *stat, GF_Command *com);\r
+\r
+#endif\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif /*_GF_SCENE_MANAGER_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/scenegraph.h b/tstools/DtsEdit/src/gpac/scenegraph.h
new file mode 100644 (file)
index 0000000..580491e
--- /dev/null
@@ -0,0 +1,761 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / Scene Graph sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+\r
+#ifndef _GF_SCENEGRAPH_H_\r
+#define _GF_SCENEGRAPH_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/list.h>\r
+#include <gpac/math.h>\r
+\r
+/*\r
+       TAG definitions are static, in order to be able to mix nodes from different standard\r
+       in a single scenegraph. These TAGs are only used internally (they do not match any\r
+       binary encoding)\r
+*/\r
+enum {\r
+       /*undefined node: just the base node class, used for parsing*/\r
+       TAG_UndefinedNode = 0,\r
+       /*all MPEG-4/VRML/X3D proto instances have this tag*/\r
+       TAG_ProtoNode,\r
+\r
+       /*reserved TAG ranges per standard*/\r
+\r
+       /*range for MPEG4*/\r
+       GF_NODE_RANGE_FIRST_MPEG4,\r
+       GF_NODE_RANGE_LAST_MPEG4 = GF_NODE_RANGE_FIRST_MPEG4+512,\r
+\r
+       /*range for X3D*/\r
+       GF_NODE_RANGE_FIRST_X3D, \r
+       GF_NODE_RANGE_LAST_X3D = GF_NODE_RANGE_FIRST_X3D+512,\r
+\r
+       /*all nodes after this are always parent nodes*/\r
+       GF_NODE_RANGE_LAST_VRML,\r
+\r
+       /*DOM container for BIFS/LASeR/etc updates*/\r
+       TAG_DOMUpdates,\r
+\r
+       /*all nodes below MUST be parent nodes*/\r
+       GF_NODE_FIRST_PARENT_NODE_TAG,\r
+\r
+       /*DOM text node*/\r
+       TAG_DOMText,\r
+       /*all nodes below MUST use the base DOM structure (with dyn attribute list)*/\r
+       GF_NODE_FIRST_DOM_NODE_TAG,\r
+       \r
+       /*full node*/\r
+       TAG_DOMFullNode = GF_NODE_FIRST_DOM_NODE_TAG,\r
+\r
+       /*range for SVG*/\r
+       GF_NODE_RANGE_FIRST_SVG, \r
+       GF_NODE_RANGE_LAST_SVG = GF_NODE_RANGE_FIRST_SVG+100,\r
+\r
+       /*range for XBL*/\r
+       GF_NODE_RANGE_FIRST_XBL, \r
+       TAG_XBL_bindings = GF_NODE_RANGE_FIRST_XBL,\r
+       TAG_XBL_binding,\r
+       TAG_XBL_content,\r
+       TAG_XBL_children,\r
+       TAG_XBL_implementation,\r
+       TAG_XBL_constructor,\r
+       TAG_XBL_destructor,\r
+       TAG_XBL_field,\r
+       TAG_XBL_property,\r
+       TAG_XBL_getter,\r
+       TAG_XBL_setter,\r
+       TAG_XBL_method,\r
+       TAG_XBL_parameter,\r
+       TAG_XBL_body,\r
+       TAG_XBL_handlers,\r
+       TAG_XBL_handler,\r
+       TAG_XBL_resources,\r
+       TAG_XBL_stylesheet,\r
+       TAG_XBL_image,\r
+       GF_NODE_RANGE_LAST_XBL,\r
+};\r
+\r
+\r
+\r
+/*private handler for this library on all nodes*/\r
+#define BASE_NODE      struct _nodepriv *sgprivate;\r
+\r
+/*base node type*/\r
+typedef struct _base_node\r
+{\r
+       BASE_NODE\r
+} GF_Node;\r
+\r
+/*child storage - this is not integrated in the base node, because of VRML/MPEG-4 USE: a node\r
+may be present at different places in the tree, hence have different "next" siblings.*/\r
+typedef struct _child_node\r
+{\r
+       struct _child_node *next;\r
+       GF_Node *node;\r
+} GF_ChildNodeItem;\r
+\r
+/*grouping nodes macro :\r
+       children: list of children SFNodes\r
+*/\r
+\r
+#define CHILDREN                                                                       \\r
+       struct _child_node *children;\r
+\r
+typedef struct\r
+{\r
+       BASE_NODE\r
+       CHILDREN\r
+} GF_ParentNode;\r
+\r
+/*adds a child to a given container*/\r
+GF_Err gf_node_list_add_child(GF_ChildNodeItem **list, GF_Node *n);\r
+/*adds a child to a given container, updating last position*/\r
+GF_Err gf_node_list_add_child_last(GF_ChildNodeItem **list, GF_Node *n, GF_ChildNodeItem **last_child);\r
+/*inserts a child to a given container - if pos doesn't match, append the child*/\r
+GF_Err gf_node_list_insert_child(GF_ChildNodeItem **list, GF_Node *n, u32 pos);\r
+/*removes a child to a given container - return 0 if child not found*/\r
+Bool gf_node_list_del_child(GF_ChildNodeItem **list, GF_Node *n);\r
+/*finds a child in a given container, returning its 0-based index if found, -1 otherwise*/\r
+s32 gf_node_list_find_child(GF_ChildNodeItem *list, GF_Node *n);\r
+/*finds a child in a given container given its index, returning the child or NULL if not found\r
+if pos is <0, returns the last child*/\r
+GF_Node *gf_node_list_get_child(GF_ChildNodeItem *list, s32 pos);\r
+/*gets the number of children in a given container*/\r
+u32 gf_node_list_get_count(GF_ChildNodeItem *list);\r
+/*deletes node entry at given idx, returning node if found, NULL otherwise*/\r
+GF_Node *gf_node_list_del_child_idx(GF_ChildNodeItem **list, u32 pos);\r
+\r
+\r
+\r
+/*tag is set upon creation and cannot be modified*/\r
+u32 gf_node_get_tag(GF_Node*);\r
+/*set node def\r
+       @ID: node ID, !=0 set def node - if a different node with the same ID exists, returns error. \r
+You may change the node ID by recalling the function with a different ID value. You may get a node ID\r
+by calling the gf_sg_get_next_available_node_id function\r
+       @defName: optional readable name (script, MPEGJ). To change the name, recall the function with a different name and the same ID\r
+*/\r
+GF_Err gf_node_set_id(GF_Node*n, u32 nodeID, const char *nodeDEFName);\r
+/*get def name of the node , NULL if not set*/\r
+const char *gf_node_get_name(GF_Node*);\r
+/*get def name of the node , or the string representation of the node pointer if not set*/\r
+const char *gf_node_get_log_name(GF_Node*);\r
+/*get def ID of the node, 0 if node not def*/\r
+u32 gf_node_get_id(GF_Node*);\r
+/* gets node built-in name (eg 'Appearance', ..) */\r
+const char *gf_node_get_class_name(GF_Node *Node);\r
+\r
+u32 gf_sg_node_get_tag_by_class_name(const char *name, u32 xmlns);\r
+\r
+/*unset the node ID*/\r
+GF_Err gf_node_remove_id(GF_Node *p);\r
+\r
+/*get/set user private stack*/\r
+void *gf_node_get_private(GF_Node*);\r
+void gf_node_set_private(GF_Node*, void *);\r
+\r
+/*set traversal callback function. If a node has no associated callback, the traversing of the \r
+graph won't propagate below it. It is the app responsability to setup traversing functions as needed\r
+VRML/MPEG4:  Instanciated Protos are handled internally as well as interpolators, valuators and scripts\r
+@is_destroy: set when the node is about to be destroyed\r
+*/\r
+GF_Err gf_node_set_callback_function(GF_Node *, void (*NodeFunction)(GF_Node *node, void *traverse_state, Bool is_destroy) );\r
+\r
+/*register a node (DEFed or not), specifying parent if any.\r
+A node must be registered whenever used by something (a parent node, a command, whatever) to prevent its \r
+destruction (think of it as a reference counting).\r
+NOTE: NODES ARE CREATED WITHOUT BEING REGISTERED\r
+*/\r
+GF_Err gf_node_register(GF_Node *node, GF_Node *parent_node);\r
+\r
+/*unregister a node from parent (node may or not be DEF'ed). Parent may be NULL (DEF root node, commands).\r
+This MUST be called whenever a node is destroyed (removed from a parent node)\r
+If this is the last instance of the node, the node is destroyed\r
+NOTE: NODES ARE CREATED WITHOUT BEING REGISTERED, hence they MUST be registered at least once before \r
+being destroyed\r
+*/\r
+GF_Err gf_node_unregister(GF_Node *node, GF_Node *parent_node);\r
+/*deletes all node instances in the given list*/\r
+void gf_node_unregister_children(GF_Node *node, GF_ChildNodeItem *childrenlist);\r
+\r
+/*get all parents of the node and replace the old_node by the new node in all parents\r
+Note: if the new node is not DEFed, only the first instance of "old_node" will be replaced, the other ones deleted*/\r
+GF_Err gf_node_replace(GF_Node *old_node, GF_Node *new_node, Bool updateOrderedGroup);\r
+\r
+/*returns number of instances for this node*/\r
+u32 gf_node_get_num_instances(GF_Node *node);\r
+\r
+\r
+/*calls node traverse callback routine on this node*/\r
+void gf_node_traverse(GF_Node *node, void *udta);\r
+/*allows a node to be re-rendered - by default a node in its render phase will never be rendered a second time. \r
+Use this function to enable a second render for this node - this must be called while node is being rendered*/\r
+void gf_node_allow_cyclic_traverse(GF_Node *node);\r
+\r
+/*blindly calls traverse callback on all children nodes */\r
+void gf_node_traverse_children(GF_Node *node, void *renderStack);\r
+/*returns number of parent for this node (parent are kept regardless of DEF state)*/\r
+u32 gf_node_get_parent_count(GF_Node *node);\r
+/*returns desired parent for this node (parent are kept regardless of DEF state)\r
+idx is 0-based parent index*/\r
+GF_Node *gf_node_get_parent(GF_Node *node, u32 idx);\r
+\r
+\r
+enum\r
+{\r
+       /*flag set whenever a field of the node has been modified*/\r
+       GF_SG_NODE_DIRTY = 1,\r
+       /*flag set whenever a child node of this node has been modified\r
+       NOTE: unloaded extern protos always invalidate their parent subgraph to get a chance\r
+       of being loaded. It is the user responsability to clear the CHILD_DIRTY flag before traversing\r
+       if relying on this flag for sub-tree discarding (eg, culling or similar)*/\r
+       GF_SG_CHILD_DIRTY = 1<<1,\r
+\r
+       /*flag set by bindable nodes to indicate a modification of the bindable stack. This is \r
+       only used for offscreen rendering of Layer3D*/\r
+       GF_SG_VRML_BINDABLE_DIRTY = 1<<2,\r
+\r
+       /*flag set whenever a ColorTransform node is removed from a parent node*/\r
+       GF_SG_VRML_COLOR_DIRTY = 1<<3,\r
+\r
+\r
+       /*SVG-specific flags due to mix of geometry and appearance & co attributes*/\r
+       /*SVG geometry changed is the same as base flag*/\r
+       GF_SG_SVG_GEOMETRY_DIRTY                = GF_SG_NODE_DIRTY,\r
+       GF_SG_SVG_COLOR_DIRTY                   = GF_SG_VRML_BINDABLE_DIRTY,\r
+       GF_SG_SVG_DISPLAYALIGN_DIRTY    = 1<<3,\r
+       GF_SG_SVG_FILL_DIRTY                    = 1<<4,\r
+       GF_SG_SVG_FILLOPACITY_DIRTY             = 1<<5,\r
+       GF_SG_SVG_FILLRULE_DIRTY                = 1<<6,\r
+       GF_SG_SVG_FONTFAMILY_DIRTY              = 1<<7,\r
+       GF_SG_SVG_FONTSIZE_DIRTY                = 1<<8,\r
+       GF_SG_SVG_FONTSTYLE_DIRTY               = 1<<9,\r
+       GF_SG_SVG_FONTVARIANT_DIRTY             = 1<<10,\r
+       GF_SG_SVG_FONTWEIGHT_DIRTY              = 1<<11,\r
+       GF_SG_SVG_LINEINCREMENT_DIRTY   = 1<<12,\r
+       GF_SG_SVG_OPACITY_DIRTY                 = 1<<13,\r
+       GF_SG_SVG_SOLIDCOLOR_OR_OPACITY_DIRTY           = 1<<14,\r
+       GF_SG_SVG_STOPCOLOR_OR_OPACITY_DIRTY            = 1<<15,\r
+       GF_SG_SVG_STROKE_DIRTY                  = 1<<16,\r
+       GF_SG_SVG_STROKEDASHARRAY_DIRTY = 1<<17,\r
+       GF_SG_SVG_STROKEDASHOFFSET_DIRTY= 1<<18,\r
+       GF_SG_SVG_STROKELINECAP_DIRTY   = 1<<19,\r
+       GF_SG_SVG_STROKELINEJOIN_DIRTY  = 1<<20,\r
+       GF_SG_SVG_STROKEMITERLIMIT_DIRTY= 1<<21,\r
+       GF_SG_SVG_STROKEOPACITY_DIRTY   = 1<<22,\r
+       GF_SG_SVG_STROKEWIDTH_DIRTY             = 1<<23,\r
+       GF_SG_SVG_TEXTPOSITION_DIRTY    = 1<<24,\r
+       GF_SG_SVG_DISPLAY_DIRTY                 = 1<<25,\r
+       GF_SG_SVG_VECTOREFFECT_DIRTY    = 1<<26,\r
+       GF_SG_SVG_XLINK_HREF_DIRTY              = 1<<27,\r
+};\r
+\r
+/*set dirty flags.\r
+if @flags is 0, sets the base flags on (GF_SG_NODE_DIRTY).\r
+if @flags is not 0, adds the flags to the node dirty state\r
+\r
+If @invalidate_parents is set, all parent subtrees for this node are marked as GF_SG_CHILD_DIRTY\r
+Note: parent subtree marking aborts if a node in the subtree is already marked with GF_SG_CHILD_DIRTY\r
+which means tat if you never clean the dirty flags, no propagation will take place\r
+*/\r
+void gf_node_dirty_set(GF_Node *node, u32 flags, Bool dirty_parents);\r
+\r
+/*mark all parent subtrees for this node as GF_SG_CHILD_DIRTY\r
+Note: parent subtree marking aborts if a node in the subtree is already marked with GF_SG_CHILD_DIRTY\r
+which means that if you never clean the dirty flags, no propagation will take place\r
+*/\r
+void gf_node_dirty_parents(GF_Node *node);\r
+\r
+/*set dirty flag off. It is the user responsability to clear dirty flags\r
+if @flags is 0, all flags are set off\r
+if @flags is not 0, removes the indicated flags from the node dirty state\r
+*/\r
+void gf_node_dirty_clear(GF_Node *node, u32 flags);\r
+\r
+/*if the node is in a dirty state, resets it and the state of all its children*/\r
+void gf_node_dirty_reset(GF_Node *node);\r
+\r
+/*get dirty flag value*/\r
+u32 gf_node_dirty_get(GF_Node *node);\r
+\r
+/*Notes on GF_FieldInfo\r
+all scene graph implementations should answer node field query with this interface. \r
+In case an implementation does not use this:\r
+       - the implementation shall handle the parent node dirty flag itself most of the time\r
+       - the implementation shall NOT allow referencing of a graph node in a parent graph node (when inlining\r
+content) otherwise the app is guaranteed to crash.\r
+*/\r
+\r
+/*other fieldTypes may be ignored by implmentation not using VRML/MPEG4 native types*/\r
+\r
+typedef struct\r
+{      \r
+       /*0-based index of the field in the node*/\r
+       u32 fieldIndex;\r
+       /*field type - VRML/MPEG4 types are listed in scenegraph_vrml.h*/\r
+       u32 fieldType;\r
+       /*far ptr to the field (eg GF_Node **, GF_List**, MFInt32 *, ...)*/\r
+       void *far_ptr;\r
+       /*field name*/\r
+       const char *name;\r
+       /*NDT type in case of SF/MFNode field - cf BIFS specific tools*/\r
+       u32 NDTtype;\r
+       /*event type*/\r
+       u32 eventType;\r
+       /*eventin handler if any*/\r
+       void (*on_event_in)(GF_Node *pNode);\r
+} GF_FieldInfo;\r
+\r
+/*returns number of field for this node*/\r
+u32 gf_node_get_field_count(GF_Node *node);\r
+\r
+/*fill the field info structure for the given field*/\r
+GF_Err gf_node_get_field(GF_Node *node, u32 FieldIndex, GF_FieldInfo *info);\r
+\r
+/*get the field by its name*/\r
+GF_Err gf_node_get_field_by_name(GF_Node *node, char *name, GF_FieldInfo *field);\r
+\r
+typedef struct __tag_scene_graph GF_SceneGraph;\r
+\r
+/*scene graph constructor*/\r
+GF_SceneGraph *gf_sg_new();\r
+\r
+/*creates a sub scene graph (typically used with Inline node): independent graph with same private stack, \r
+and user callbacks as parent. All routes triggered in this subgraph are executed in the parent graph (this \r
+means you only have to activate routes on the main graph)\r
+NOTE: the resulting graph is not destroyed when the parent graph is \r
+*/\r
+GF_SceneGraph *gf_sg_new_subscene(GF_SceneGraph *scene);\r
+\r
+/*destructor*/\r
+void gf_sg_del(GF_SceneGraph *sg);\r
+/*reset the full graph - all nodes, routes and protos are destroyed*/\r
+void gf_sg_reset(GF_SceneGraph *sg);\r
+\r
+/*parses the given XML document and returns a scene graph composed of GF_DOMFullNode*/\r
+GF_Err gf_sg_new_from_xml_doc(const char *src, GF_SceneGraph **scene);\r
+\r
+/*set/get user private data*/\r
+void gf_sg_set_private(GF_SceneGraph *sg, void *user_priv);\r
+void *gf_sg_get_private(GF_SceneGraph *sg);\r
+\r
+/*set the scene timer (fct returns time in sec)*/\r
+void gf_sg_set_scene_time_callback(GF_SceneGraph *scene, Double (*GetSceneTime)(void *user_priv) );\r
+\r
+enum\r
+{\r
+       /*function called upon node creation. \r
+               ctxdata is not used*/\r
+       GF_SG_CALLBACK_INIT = 0,\r
+       /*function called upon node modification. You typically will set some of the dirty flags here.\r
+               ctxdata is the fieldInfo pointer of the modified field*/\r
+       GF_SG_CALLBACK_MODIFIED,\r
+       /*function called when the a "set dirty" propagates to root node of the graph\r
+               ctxdata is not used*/\r
+       GF_SG_CALLBACK_GRAPH_DIRTY,\r
+};\r
+\r
+/*set node callback: function called upon node creation. \r
+Application should instanciate the node rendering stack and any desired callback*/\r
+void gf_sg_set_node_callback(GF_SceneGraph *sg, void (*NodeCallback)(void *user_priv, u32 type, GF_Node *node, void *ctxdata) );\r
+\r
+/*get/set the root node of the graph*/\r
+GF_Node *gf_sg_get_root_node(GF_SceneGraph *sg);\r
+void gf_sg_set_root_node(GF_SceneGraph *sg, GF_Node *node);\r
+\r
+/*finds a registered node by ID*/\r
+GF_Node *gf_sg_find_node(GF_SceneGraph *sg, u32 nodeID);\r
+/*finds a registered node by DEF name*/\r
+GF_Node *gf_sg_find_node_by_name(GF_SceneGraph *sg, char *name);\r
+\r
+/*used to signal modification of a node, indicating which field is modified - exposed for BIFS codec, \r
+should not be needed by other apps*/\r
+void gf_node_changed(GF_Node *node, GF_FieldInfo *fieldChanged);\r
+\r
+/*returns the graph this node belongs to*/\r
+GF_SceneGraph *gf_node_get_graph(GF_Node *node);\r
+\r
+/*Set size info for the graph - by default graphs have no size and are in meter metrics (VRML like)\r
+if any of width or height is 0, the graph has no size info*/\r
+void gf_sg_set_scene_size_info(GF_SceneGraph *sg, u32 width, u32 Height, Bool usePixelMetrics);\r
+/*returns 1 if pixelMetrics*/\r
+Bool gf_sg_use_pixel_metrics(GF_SceneGraph *sg);\r
+/*returns 0 if no size info, otherwise 1 and set width/height*/\r
+Bool gf_sg_get_scene_size_info(GF_SceneGraph *sg, u32 *width, u32 *Height);\r
+\r
+/*creates a node of the given tag. sg is the parent scenegraph of the node,\r
+eg the root one for scene nodes or the proto one for proto code (cf proto)\r
+Note:\r
+       - NODE IS NOT REGISTERED (no instances) AND CANNOT BE DESTROYED UNTIL REGISTERED\r
+       - this doesn't perform application setup for the node, this must be done by the caller\r
+*/\r
+GF_Node *gf_node_new(GF_SceneGraph *sg, u32 tag);\r
+/*inits node (either internal stack or user-defined) - usually called once the node has been fully loaded*/\r
+void gf_node_init(GF_Node *node);\r
+\r
+/*clones a node in the given graph and register with parent cloned. The cloning handles ID based on id_suffix:\r
+ id_suffix = NULL: all IDs are removed from the cloned subtree, (each node instance will become a hard copy)\r
+ id_suffix = "": ID will be kept exactly as they where in the original subtree - this may lead to errors due to \r
+               the presence of the same ID depending on the standard (DOM, ...).\r
+ id_suffix = anything: all IDs are translated ($(name) -> $(name)id_suffix) and bynary IDs are generated on the fly\r
+*/\r
+GF_Node *gf_node_clone(GF_SceneGraph *inScene, GF_Node *orig, GF_Node *cloned_parent, char *id_suffix, Bool deep);\r
+\r
+/*gets scene time for scene this node belongs too, 0 if timeline not specified*/\r
+Double gf_node_get_scene_time(GF_Node *node);\r
+\r
+/*retuns next available NodeID*/\r
+u32 gf_sg_get_next_available_node_id(GF_SceneGraph *sg);\r
+/*retuns max ID used in graph*/\r
+u32 gf_sg_get_max_node_id(GF_SceneGraph *sg);\r
+\r
+const char *gf_node_get_name_and_id(GF_Node*node, u32 *id);\r
+\r
+\r
+enum\r
+{\r
+       GF_SG_FOCUS_AUTO = 1,\r
+       GF_SG_FOCUS_NEXT,\r
+       GF_SG_FOCUS_PREV,\r
+       GF_SG_FOCUS_NORTH,\r
+       GF_SG_FOCUS_NORTH_EAST,\r
+       GF_SG_FOCUS_EAST,\r
+       GF_SG_FOCUS_SOUTH_EAST,\r
+       GF_SG_FOCUS_SOUTH,\r
+       GF_SG_FOCUS_SOUTH_WEST,\r
+       GF_SG_FOCUS_WEST,\r
+       GF_SG_FOCUS_NORTH_WEST\r
+};\r
+\r
+typedef struct\r
+{\r
+       const char *url;\r
+       const char **params;\r
+       u32 nb_params;\r
+} GF_JSAPIURI;\r
+\r
+typedef struct\r
+{\r
+       const char *section;\r
+       const char *key;\r
+       const char *key_val;\r
+} GF_JSAPIOPT;\r
+\r
+       /*for script message option*/\r
+typedef struct\r
+{\r
+       GF_Err e;\r
+       const char *msg;\r
+} GF_JSAPIINFO;\r
+\r
+\r
+typedef union\r
+{\r
+       u32 opt;\r
+       Fixed val;\r
+       GF_Point2D pt;\r
+       GF_Rect rc;\r
+       Double time;\r
+       GF_BBox bbox;\r
+       GF_Matrix mx;\r
+       GF_JSAPIURI uri;\r
+       GF_JSAPIOPT gpac_cfg;\r
+       GF_Node *node;\r
+       struct __gf_download_manager *dnld_man;\r
+       GF_SceneGraph *scene;\r
+       void *term;\r
+       GF_JSAPIINFO info;\r
+} GF_JSAPIParam;\r
+\r
+enum\r
+{\r
+       /*!push message from script engine.*/\r
+       GF_JSAPI_OP_MESSAGE,\r
+       /*!get scene URI.*/\r
+       GF_JSAPI_OP_GET_SCENE_URI,\r
+       /*!get current user agent scale.*/\r
+       GF_JSAPI_OP_GET_SCALE,\r
+       /*!set current user agent scale.*/\r
+       GF_JSAPI_OP_SET_SCALE,\r
+       /*!get current user agent rotation.*/\r
+       GF_JSAPI_OP_GET_ROTATION,\r
+       /*!set current user agent rotation.*/\r
+       GF_JSAPI_OP_SET_ROTATION,\r
+       /*!get current user agent translation.*/\r
+       GF_JSAPI_OP_GET_TRANSLATE,\r
+       /*!set current user agent translation.*/\r
+       GF_JSAPI_OP_SET_TRANSLATE,\r
+       /*!get node time.*/\r
+       GF_JSAPI_OP_GET_TIME,\r
+       /*!set node time.*/\r
+       GF_JSAPI_OP_SET_TIME,\r
+       /*!get current viewport.*/\r
+       GF_JSAPI_OP_GET_VIEWPORT,\r
+       /*!get object bounding box in object local coord system.*/\r
+       GF_JSAPI_OP_GET_LOCAL_BBOX,\r
+       /*!get object bounding box in world (screen) coord system.*/\r
+       GF_JSAPI_OP_GET_SCREEN_BBOX,\r
+       /*!get transform matrix at object.*/\r
+       GF_JSAPI_OP_GET_TRANSFORM,\r
+       /*!move focus according to opt value.*/\r
+       GF_JSAPI_OP_MOVE_FOCUS,\r
+       /*!set focus to given node.*/\r
+       GF_JSAPI_OP_GET_FOCUS,\r
+       /*!set focus to given node.*/\r
+       GF_JSAPI_OP_SET_FOCUS,\r
+       /*!replace target scene URL*/\r
+       GF_JSAPI_OP_LOAD_URL,\r
+       /*!get option by section and key*/\r
+       GF_JSAPI_OP_GET_OPT,\r
+       /*!get option by section and key*/\r
+       GF_JSAPI_OP_SET_OPT,\r
+       /*!retrieve download manager*/\r
+       GF_JSAPI_OP_GET_DOWNLOAD_MANAGER,\r
+       /*!get navigation speed if any*/\r
+       GF_JSAPI_OP_GET_SPEED,\r
+       /*!get current frame rate*/\r
+       GF_JSAPI_OP_GET_FPS,\r
+       /*!set current title*/\r
+       GF_JSAPI_OP_SET_TITLE,\r
+       /*!gets DCCI scenegraph if any*/\r
+       GF_JSAPI_OP_GET_DCCI,\r
+       /*!gets subscene for current node if any*/\r
+       GF_JSAPI_OP_GET_SUBSCENE,\r
+       /*!resolves relative Xlink based on xml:base*/\r
+       GF_JSAPI_OP_RESOLVE_XLINK,\r
+       /*!evaluates if the given IRI is available for playback (returns 1) or not. If the IRI is\r
+       NULL, this evaluates whether the scene is ready for composition (canvas setup) or not.*/\r
+       GF_JSAPI_OP_EVAL_IRI,\r
+\r
+       /*!gets GPAC terminal*/\r
+       GF_JSAPI_OP_GET_TERM,\r
+\r
+       /*!pauses an SVG element*/\r
+       GF_JSAPI_OP_PAUSE_SVG,\r
+       /*!resumes an SVG ELEMENT*/\r
+       GF_JSAPI_OP_RESUME_SVG,\r
+       /*!gets the DPI*/\r
+       GF_JSAPI_OP_GET_DPI_X,\r
+       GF_JSAPI_OP_GET_DPI_Y,\r
+};\r
+/*\r
+interface to various get/set options:\r
+       type: operand type, one of the above\r
+       node: target node, scene root node or NULL\r
+       param: i/o param, depending on operand type\r
+*/\r
+typedef Bool (*gf_sg_script_action)(void *callback, u32 type, GF_Node *node, GF_JSAPIParam *param);\r
+\r
+/*assign API to scene graph - by default, sub-graphs inherits the API if set*/\r
+void gf_sg_set_script_action(GF_SceneGraph *scene, gf_sg_script_action script_act, void *cbk);\r
+\r
+/*load script into engine - this should be called only for script in main scene, loading of scripts\r
+in protos is done internally when instanciating the proto*/\r
+void gf_sg_script_load(GF_Node *script);\r
+\r
+/*returns true if current lib has javascript support*/\r
+Bool gf_sg_has_scripting();\r
+\r
+\r
+\r
+/*\r
+                       scene graph command tools used for BIFS and LASeR\r
+               These are used to store updates in memory without applying changes to the graph, \r
+       for dumpers, encoders ... \r
+               The commands can then be applied through this lib\r
+*/\r
+\r
+/*\r
+               Currently defined possible modifications\r
+*/\r
+enum\r
+{\r
+       /*BIFS commands*/\r
+       GF_SG_SCENE_REPLACE = 0,\r
+       GF_SG_NODE_REPLACE,\r
+       GF_SG_FIELD_REPLACE, \r
+       GF_SG_INDEXED_REPLACE,\r
+       GF_SG_ROUTE_REPLACE,\r
+       GF_SG_NODE_DELETE,\r
+       GF_SG_INDEXED_DELETE,\r
+       GF_SG_ROUTE_DELETE,\r
+       GF_SG_NODE_INSERT,\r
+       GF_SG_INDEXED_INSERT,\r
+       GF_SG_ROUTE_INSERT,\r
+       /*extended updates (BIFS-only)*/\r
+       GF_SG_PROTO_INSERT,\r
+       GF_SG_PROTO_DELETE,\r
+       GF_SG_PROTO_DELETE_ALL,\r
+       GF_SG_MULTIPLE_REPLACE,\r
+       GF_SG_MULTIPLE_INDEXED_REPLACE,\r
+       GF_SG_GLOBAL_QUANTIZER,\r
+       /*same as NodeDelete, and also updates OrderedGroup.order when deleting a child*/\r
+       GF_SG_NODE_DELETE_EX,\r
+\r
+       /*BIFS*/\r
+       GF_SG_FIELD_REPLACE_OP, \r
+       GF_SG_INDEXED_REPLACE_OP,\r
+\r
+       GF_SG_LAST_BIFS_COMMAND,\r
+\r
+\r
+       /*LASER commands*/\r
+       GF_SG_LSR_NEW_SCENE,\r
+       GF_SG_LSR_REFRESH_SCENE,\r
+       GF_SG_LSR_ADD,\r
+       GF_SG_LSR_CLEAN,\r
+       GF_SG_LSR_REPLACE,\r
+       GF_SG_LSR_DELETE,\r
+       GF_SG_LSR_INSERT,\r
+       GF_SG_LSR_RESTORE,\r
+       GF_SG_LSR_SAVE,\r
+       GF_SG_LSR_SEND_EVENT,\r
+       GF_SG_LSR_ACTIVATE,\r
+       GF_SG_LSR_DEACTIVATE,\r
+\r
+       GF_SG_UNDEFINED\r
+};\r
+\r
+\r
+/*\r
+                               single command wrapper\r
+\r
+  NOTE: In order to maintain node registry, the nodes replaced/inserted MUST be registered with \r
+  their parents even when the command is never applied. Registering shall be performed \r
+  with gf_node_register (see below).\r
+  If you fail to do so, a node may be destroyed when destroying a command while still used\r
+  in another command or in the graph - this will just crash.\r
+*/\r
+\r
+/*structure used to store field info, pos and static pointers to GF_Node/MFNode in commands*/\r
+typedef struct\r
+{\r
+       u32 fieldIndex;\r
+       /*field type*/\r
+       u32 fieldType;\r
+       /*field pointer for multiple replace/multiple indexed replace - if multiple indexed replace, must be the SF field being changed*/\r
+       void *field_ptr;\r
+       /*replace/insert/delete pos - -1 is append except in multiple indexed replace*/\r
+       s32 pos;\r
+\r
+       /*Whenever field pointer is of type GF_Node, store the node here and set the far pointer to this address.*/\r
+       GF_Node *new_node;\r
+       /*Whenever field pointer is of type MFNode, store the node list here and set the far pointer to this address.*/\r
+       GF_ChildNodeItem *node_list;\r
+} GF_CommandField;\r
+\r
+typedef struct\r
+{\r
+       GF_SceneGraph *in_scene;\r
+       u32 tag;\r
+\r
+       /*node the command applies to - may be NULL*/\r
+       GF_Node *node;\r
+\r
+       /*list of GF_CommandField for all field commands replace/ index insert / index replace / index delete / MultipleReplace / MultipleIndexedreplace \r
+       the content is destroyed when deleting the command*/\r
+       GF_List *command_fields;\r
+\r
+       /*may be NULL, and may be present with any command inserting a node*/\r
+       GF_List *scripts_to_load;\r
+       /*for authoring purposes - must be cleaned by user*/\r
+       Bool unresolved;\r
+       char *unres_name;\r
+       \r
+       /*scene replace command: \r
+               root node is stored in com->node\r
+               protos are stored in com->new_proto_list\r
+               routes are stored as RouteInsert in the same frame\r
+               BIFS only\r
+       */\r
+       Bool use_names;\r
+\r
+       /*proto list to insert - BIFS only*/\r
+       GF_List *new_proto_list;\r
+       /*proto ID list to delete - BIFS only*/\r
+       u32 *del_proto_list;\r
+       u32 del_proto_list_size;\r
+\r
+\r
+       /*route insert, replace and delete (BIFS only)\r
+               fromNodeID is also used to identify operandElementId in LASeR Add/Replace\r
+\r
+       OR\r
+               sendEvent\r
+       */\r
+//     union {\r
+               u32 RouteID;\r
+               u32 send_event_name;\r
+//     };\r
+//     union {\r
+               char *def_name;\r
+               char *send_event_string;\r
+//     };\r
+//     union {\r
+               u32 fromNodeID;\r
+               s32 send_event_integer;\r
+//     };\r
+       u32 fromFieldIndex;\r
+\r
+//     union {\r
+               u32 toNodeID;\r
+               s32 send_event_x;\r
+//     };\r
+//     union {\r
+               u32 toFieldIndex;\r
+               s32 send_event_y;\r
+//     };\r
+       Bool aggregated;\r
+} GF_Command;\r
+\r
+\r
+/*creates command - graph only needed for SceneReplace*/\r
+GF_Command *gf_sg_command_new(GF_SceneGraph *in_scene, u32 tag);\r
+/*deletes command*/\r
+void gf_sg_command_del(GF_Command *com);\r
+/*apply command to graph - the command content is kept unchanged for authoring purposes - THIS NEEDS TESTING AND FIXING\r
+@time_offset: offset for time fields if desired*/\r
+GF_Err gf_sg_command_apply(GF_SceneGraph *inScene, GF_Command *com, Double time_offset);\r
+/*apply list if command to graph - the command content is kept unchanged for authoring purposes\r
+@time_offset: offset for time fields if desired*/\r
+GF_Err gf_sg_command_apply_list(GF_SceneGraph *graph, GF_List *comList, Double time_offset);\r
+/*returns new commandFieldInfo structure and registers it with command*/\r
+GF_CommandField *gf_sg_command_field_new(GF_Command *com);\r
+/*clones the command in another graph - needed for uncompressed conditional in protos\r
+if force_clone is not set and the target graph is the same as the command graph, nodes are just registered\r
+with the new commands rather than cloned*/\r
+GF_Command *gf_sg_command_clone(GF_Command *com, GF_SceneGraph *inGraph, Bool force_clone);\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+\r
+#endif /*_GF_SCENEGRAPH_H_*/\r
+\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/scenegraph_svg.h b/tstools/DtsEdit/src/gpac/scenegraph_svg.h
new file mode 100644 (file)
index 0000000..c153120
--- /dev/null
@@ -0,0 +1,620 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Cyril Concolato 2004\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / SVG Scene Graph sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_SG_SVG_H_\r
+#define _GF_SG_SVG_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/scenegraph.h>\r
+#include <gpac/svg_types.h>\r
+\r
+/*******************************************************************************\r
+ * \r
+ *          DOM base scene graph\r
+ *\r
+ *******************************************************************************/\r
+\r
+enum\r
+{\r
+       /*should never be used, this is only a parsing error*/\r
+       TAG_DOM_ATTRIBUTE_NULL,\r
+       /*this tag is set for a full dom attribute only - attribute name is then available*/\r
+       TAG_DOM_ATT_any,\r
+\r
+       TAG_XML_ATT_RANGE_FIRST,\r
+       TAG_XML_ATT_id = TAG_XML_ATT_RANGE_FIRST,\r
+       TAG_XML_ATT_base,\r
+       TAG_XML_ATT_lang,\r
+       TAG_XML_ATT_space,\r
+       TAG_XML_ATT_RANGE_LAST,\r
+       TAG_XLINK_ATT_RANGE_FIRST,\r
+\r
+       TAG_XLINK_ATT_type = TAG_XLINK_ATT_RANGE_FIRST,\r
+       TAG_XLINK_ATT_role,\r
+       TAG_XLINK_ATT_arcrole,\r
+       TAG_XLINK_ATT_title,\r
+       TAG_XLINK_ATT_href,\r
+       TAG_XLINK_ATT_show,\r
+       TAG_XLINK_ATT_actuate,\r
+       TAG_XLINK_ATT_RANGE_LAST,\r
+\r
+       TAG_XMLEV_ATT_RANGE_FIRST,\r
+       TAG_XMLEV_ATT_event,\r
+       TAG_XMLEV_ATT_phase,\r
+       TAG_XMLEV_ATT_propagate,\r
+       TAG_XMLEV_ATT_defaultAction,\r
+       TAG_XMLEV_ATT_observer,\r
+       TAG_XMLEV_ATT_target,\r
+       TAG_XMLEV_ATT_handler,\r
+       TAG_XMLEV_ATT_RANGE_LAST,\r
+\r
+       TAG_LSR_ATT_RANGE_FIRST,\r
+       TAG_LSR_ATT_enabled,\r
+       TAG_LSR_ATT_RANGE_LAST,\r
+       /*these attribute types are only use for binary purpose*/\r
+       TAG_LSR_ATT_children,\r
+       TAG_LSR_ATT_overflow,\r
+       TAG_LSR_ATT_rotation,\r
+       TAG_LSR_ATT_scale,\r
+       TAG_LSR_ATT_translation,\r
+       TAG_LSR_ATT_svg_width,\r
+       TAG_LSR_ATT_svg_height,\r
+       TAG_LSR_ATT_textContent,\r
+       /*WHAT THE HECK IS THIS THING IN THE SDL BUT NOWHERE IN THE SPEC ?*/\r
+       TAG_LSR_ATT_text_display,\r
+\r
+       TAG_SVG_ATT_RANGE_FIRST,\r
+\r
+       TAG_XBL_ATT_RANGE_FIRST = TAG_SVG_ATT_RANGE_FIRST + 256,\r
+       TAG_XBL_ATT_id = TAG_XBL_ATT_RANGE_FIRST,\r
+       TAG_XBL_ATT_extends,\r
+       TAG_XBL_ATT_display,\r
+       TAG_XBL_ATT_inheritstyle,\r
+       TAG_XBL_ATT_includes,\r
+       TAG_XBL_ATT_name,\r
+       TAG_XBL_ATT_implements,\r
+       TAG_XBL_ATT_type,\r
+       TAG_XBL_ATT_readonly,\r
+       TAG_XBL_ATT_onget,\r
+       TAG_XBL_ATT_onset,\r
+       TAG_XBL_ATT_event,\r
+       TAG_XBL_ATT_action,\r
+       TAG_XBL_ATT_phase,\r
+       TAG_XBL_ATT_button,\r
+       TAG_XBL_ATT_modifiers,\r
+       TAG_XBL_ATT_keycode,\r
+       TAG_XBL_ATT_key,\r
+       TAG_XBL_ATT_charcode,\r
+       TAG_XBL_ATT_clickcount,\r
+       TAG_XBL_ATT_command,\r
+       TAG_XBL_ATT_preventdefault,\r
+       TAG_XBL_ATT_src,\r
+};\r
+\r
+\r
+#define GF_DOM_BASE_ATTRIBUTE  \\r
+       u16 tag;        /*attribute identifier*/        \\r
+       u16 data_type; /*attribute datatype*/     \\r
+       void *data; /*data pointer*/                            \\r
+       struct __dom_base_attribute *next; /*next attribute*/\r
+\r
+#define GF_DOM_FULL_ATTRIBUTE  \\r
+       GF_DOM_ATTRIBUTE        \\r
+\r
+typedef struct __dom_base_attribute\r
+{\r
+       GF_DOM_BASE_ATTRIBUTE\r
+} GF_DOMAttribute;\r
+\r
+typedef struct __dom_full_attribute\r
+{\r
+       GF_DOM_BASE_ATTRIBUTE\r
+       u32 xmlns;\r
+       char *name; /*attribute name - in this case, the data field is the attribute literal value*/\r
+} GF_DOMFullAttribute;\r
+\r
+#define GF_DOM_BASE_NODE        \\r
+       BASE_NODE                               \\r
+       CHILDREN                                \\r
+       GF_DOMAttribute *attributes;\r
+\r
+typedef struct __dom_base_node\r
+{\r
+       GF_DOM_BASE_NODE\r
+} GF_DOMNode;\r
+\r
+typedef struct __dom_full_node\r
+{\r
+       GF_DOM_BASE_NODE\r
+       char *name;\r
+       u32 ns;\r
+} GF_DOMFullNode;\r
+\r
+\r
+\r
+enum\r
+{\r
+       /*no NS specified, it will be evaluated from attribute/node name*/\r
+       GF_XMLNS_NONE,\r
+\r
+       GF_XMLNS_XML,\r
+       GF_XMLNS_XLINK,\r
+       GF_XMLNS_XMLEV,\r
+       GF_XMLNS_LASER,\r
+       GF_XMLNS_SVG,\r
+       GF_XMLNS_XBL,\r
+\r
+       /*any other namespace uses the CRC32 of the namespace as an identifier*/\r
+};\r
+\r
+GF_Err gf_sg_add_namespace(GF_SceneGraph *sg, char *name, char *qname);\r
+GF_Err gf_sg_remove_namespace(GF_SceneGraph *sg, char *name, char *qname);\r
+u32 gf_sg_get_namespace_code(GF_SceneGraph *sg, char *qname);\r
+u32 gf_sg_get_namespace_code_from_name(GF_SceneGraph *sg, char *name);\r
+const char *gf_sg_get_namespace_qname(GF_SceneGraph *sg, u32 xmlns_id);\r
+\r
+u32 gf_xml_get_element_namespace(GF_Node *n);\r
+const char *gf_sg_get_namespace(GF_SceneGraph *sg, u32 xmlns_id);\r
+\r
+void gf_xml_push_namespaces(GF_DOMNode *elt);\r
+void gf_xml_pop_namespaces(GF_DOMNode *elt);\r
+\r
+\r
+\r
+\r
+enum\r
+{\r
+       GF_DOM_TEXT_REGULAR = 0,\r
+       GF_DOM_TEXT_CDATA,\r
+       /*inserted text node (typically external script)*/\r
+       GF_DOM_TEXT_INSERTED\r
+};\r
+\r
+typedef struct\r
+{\r
+       BASE_NODE\r
+       CHILDREN\r
+       char *textContent;\r
+       u32 type;\r
+} GF_DOMText;\r
+\r
+/*creates a new text node, assign string (does NOT duplicate it) and register node with parent if desired*/\r
+GF_DOMText *gf_dom_add_text_node(GF_Node *parent, char *text_data);\r
+\r
+/*creates a new text node - this DOES NOT register the node at all*/\r
+GF_DOMText *gf_dom_new_text_node(GF_SceneGraph *sg);\r
+\r
+typedef struct\r
+{\r
+       BASE_NODE\r
+       CHILDREN\r
+       char *data;\r
+       u32 data_size;\r
+       GF_List *updates;\r
+} GF_DOMUpdates;\r
+\r
+/*creates a new updates node and register node with parent*/\r
+GF_DOMUpdates *gf_dom_add_updates_node(GF_Node *parent);\r
+\r
+typedef struct\r
+{\r
+       Bool bufferValid;\r
+       u32 level;\r
+       Fixed remaining_time;\r
+       u16 status;\r
+       const char *session_name;\r
+       u32 nb_streams;\r
+       struct mae_item {u32 streamType; u32 mediaType; u32 transport; } streams[20];\r
+} GF_DOMMediaAccessEvent;\r
+\r
+/* \r
+       DOM event handling\r
+*/\r
+enum\r
+{\r
+       GF_DOM_EVENT_PHASE_CAPTURE = 1,\r
+       GF_DOM_EVENT_PHASE_AT_TARGET = 2,\r
+       GF_DOM_EVENT_PHASE_BUBBLE = 3,\r
+\r
+       /*special phase indicating the event has been canceled*/\r
+       GF_DOM_EVENT_PHASE_CANCEL = 1<<5,\r
+       /*special phase indicating the event has been canceled immediately*/\r
+       GF_DOM_EVENT_PHASE_CANCEL_ALL = 1<<6,\r
+       /*special phase indicating the default action of the event is prevented*/\r
+       GF_DOM_EVENT_PHASE_PREVENT = 1<<7,\r
+};\r
+\r
+/*possible event targets*/\r
+enum\r
+{\r
+       GF_DOM_EVENT_NODE,\r
+       GF_DOM_EVENT_DOCUMENT,\r
+       GF_DOM_EVENT_XHR,\r
+       GF_DOM_EVENT_TIMER,\r
+       GF_DOM_EVENT_CONNECTION,\r
+};\r
+\r
+typedef struct \r
+{\r
+       GF_List *evt_list;\r
+       void *ptr;\r
+       u32 ptr_type;\r
+} GF_DOMEventTarget;\r
+\r
+GF_Err gf_dom_listener_add(GF_Node *listener, GF_DOMEventTarget *evt_target);\r
+\r
+\r
+typedef struct\r
+{\r
+       /*event type, as defined in <gpac/events.h>*/\r
+       u32 type;\r
+       /*event phase type, READ-ONLY\r
+       0: at target, 1: bubbling, 2: capturing , 3: canceled\r
+       */\r
+       u8 event_phase;\r
+       u8 bubbles;\r
+       u8 cancelable;\r
+       /*output only - indicates UI events (mouse) have been detected*/\r
+       u8 has_ui_events;\r
+       \r
+       /*we don't use a GF_DOMEventTarget here since the structure is only created when events are attached */\r
+       void *target;\r
+       u32 target_type;\r
+\r
+       GF_DOMEventTarget *currentTarget;\r
+       Double timestamp;\r
+       /*UIEvent extension.    \r
+               For mouse extensions: number of clicks \r
+               For key event: the key code\r
+               For SMIL event: number of iteration (repeat)\r
+       */\r
+       u32 detail;\r
+\r
+       /*MouseEvent extension*/\r
+       s32 screenX, screenY;\r
+       s32 clientX, clientY;\r
+       u32 button;\r
+       /*key flags*/\r
+       u32 key_flags;\r
+       /*key hardware code*/\r
+       u32 key_hw_code;\r
+       GF_Node *relatedTarget;\r
+       /*Zoom event*/\r
+       GF_Rect screen_rect;\r
+       GF_Point2D prev_translate, new_translate;\r
+       Fixed prev_scale, new_scale;\r
+       /* CPU */\r
+       u32 cpu_percentage;\r
+       /* Battery */\r
+       Bool onBattery;\r
+       u32 batteryState, batteryLevel;\r
+       /*smil event time*/\r
+       Double smil_event_time;\r
+       /* mutation event */\r
+       GF_Node *relatedNode;\r
+\r
+       /*DOM event used in VRML (GPAC's internal)*/\r
+       Bool is_vrml;\r
+       GF_DOMMediaAccessEvent *mae;\r
+\r
+       /*number of listeners triggered by the event*/\r
+       u32 consumed;\r
+} GF_DOM_Event;\r
+\r
+/*fires event on the specified node\r
+BE CAREFULL: event execution may very well destroy ANY node, especially the event target node !!\r
+*/\r
+Bool gf_dom_event_fire(GF_Node *node, GF_DOM_Event *event);\r
+\r
+/*fires event on the specified node\r
+BE CAREFULL: event execution may very well destroy ANY node, especially the event target node !!\r
+use_stack: a list of parent node/use node pairs for bubbling phase - may be NULL\r
+*/\r
+Bool gf_dom_event_fire_ex(GF_Node *node, GF_DOM_Event *event, GF_List *use_stack);\r
+\r
+u32 gf_dom_event_type_by_name(const char *name);\r
+const char *gf_dom_event_get_name(u32 type);\r
+\r
+const char *gf_dom_get_key_name(u32 key_identifier);\r
+u32 gf_dom_get_key_type(char *key_name);\r
+\r
+\r
+/*listener is simply a node added to the node events list. \r
+Only one observer can be attached to a listener. The listener will remove itself from the observer\r
+event list when destructed.*/\r
+\r
+typedef struct __xml_ev_handler \r
+{\r
+       GF_DOM_BASE_NODE\r
+       void (*handle_event)(GF_Node *hdl, GF_DOM_Event *event, GF_Node *observer);\r
+       /*if handler targets a VRML script, point to the script here*/\r
+       void *js_context;\r
+       /*target EventListener object (this) */\r
+       void *evt_listen_obj;\r
+       /*function value for spidermonkey - we cannot use JS_CallFunction since it does not work on closures\r
+       we use 64 bits to store the value for portability safety*/\r
+       u64 js_fun_val;\r
+       /*compiled function for the case were CallFunction is needed*/\r
+       void *js_fun;\r
+} GF_DOMHandler;\r
+\r
+\r
+\r
+enum\r
+{\r
+       /*basic DOM events*/\r
+       GF_DOM_EVENT_DOM = 1,\r
+       /*DOM mutation events*/\r
+       GF_DOM_EVENT_MUTATION = 1<<1,\r
+       /*DOM mouse events*/\r
+       GF_DOM_EVENT_MOUSE = 1<<2,\r
+       /*DOM focus events*/\r
+       GF_DOM_EVENT_FOCUS = 1<<3,\r
+       /*DOM key events*/\r
+       GF_DOM_EVENT_KEY = 1<<4,\r
+       /*DOM/SVG/HTML UI events (resize, scroll, ...)*/\r
+       GF_DOM_EVENT_UI = 1<<5,\r
+       /*text events*/\r
+       GF_DOM_EVENT_TEXT = 1<<6,\r
+       /*SVG events*/\r
+       GF_DOM_EVENT_SVG = 1<<7,\r
+       /*SMIL events*/\r
+       GF_DOM_EVENT_SMIL = 1<<8,\r
+       /*LASeR events*/\r
+       GF_DOM_EVENT_LASER = 1<<9,\r
+       /*MediaAccess events*/\r
+       GF_DOM_EVENT_MEDIA_ACCESS = 1<<10,\r
+\r
+       /*fake events - these events are NEVER fired*/\r
+       GF_DOM_EVENT_FAKE = 1<<31,\r
+};\r
+u32 gf_dom_event_get_category(u32 type);\r
+u32 gf_sg_get_dom_event_filter(GF_SceneGraph *sg);\r
+u32 gf_node_get_dom_event_filter(GF_Node *node);\r
+\r
+void gf_sg_register_event_type(GF_SceneGraph *sg, u32 type);\r
+void gf_sg_unregister_event_type(GF_SceneGraph *sg, u32 type);\r
+\r
+/*adds a listener to the node.\r
+The listener node is NOT registered with the node (it may very well not be a direct child of the node)\r
+@listener is a listenerElement (XML event)\r
+*/\r
+GF_Err gf_node_dom_listener_add(GF_Node *node, GF_Node *listener);\r
+u32 gf_dom_listener_count(GF_Node *node);\r
+GF_Node *gf_dom_listener_get(GF_Node *node, u32 i);\r
+\r
+/*creates a default listener/handler for the given event on the given node, and return the \r
+handler element to allow for handler function override\r
+Listener/handler are stored at the node level*/\r
+GF_DOMHandler *gf_dom_listener_build(GF_Node *observer, u32 event_type, u32 event_param);\r
+\r
+\r
+void gf_node_register_iri(GF_SceneGraph *sg, XMLRI *iri);\r
+void gf_node_unregister_iri(GF_SceneGraph *sg, XMLRI *iri);\r
+u32 gf_node_animation_count(GF_Node *node);\r
+\r
+GF_Err gf_node_store_embedded_data(XMLRI *iri, const char *cache_dir, const char *base_filename);\r
+\r
+\r
+/**************************************************\r
+ *  SVG's styling properties (see 6.1 in REC 1.1) *\r
+ *************************************************/\r
+\r
+typedef struct {\r
+       /* Tiny 1.2 properties*/\r
+       SVG_Paint                                       *color;\r
+       SVG_Paint                                       *fill; \r
+       SVG_Paint                                       *stroke;\r
+       SVG_Paint                                       *solid_color;\r
+       SVG_Paint                                       *stop_color;\r
+       SVG_Paint                                       *viewport_fill;\r
+\r
+       SVG_Number                                      *fill_opacity;\r
+       SVG_Number                                      *solid_opacity;\r
+       SVG_Number                                      *stop_opacity;\r
+       SVG_Number                                      *stroke_opacity;\r
+       SVG_Number                                      *viewport_fill_opacity;\r
+       SVG_Number                                      *opacity; /* Restricted property in Tiny 1.2 */\r
+\r
+       SVG_Number                                      *audio_level;\r
+       Fixed                                           computed_audio_level;\r
+\r
+       SVG_RenderingHint                       *color_rendering;\r
+       SVG_RenderingHint                       *image_rendering;\r
+       SVG_RenderingHint                       *shape_rendering;\r
+       SVG_RenderingHint                       *text_rendering;\r
+\r
+       SVG_Display                                     *display; \r
+       SVG_Visibility                          *visibility;\r
+       SVG_Overflow                            *overflow; /* Restricted property in Tiny 1.2 */\r
+       \r
+       SVG_FontFamily                          *font_family;\r
+       SVG_FontSize                            *font_size;\r
+       SVG_FontStyle                           *font_style; \r
+       SVG_FontWeight                          *font_weight; \r
+       SVG_FontVariant                         *font_variant; \r
+       SVG_Number                                      *line_increment;        \r
+       SVG_TextAnchor                          *text_anchor;\r
+       SVG_DisplayAlign                        *display_align;\r
+       SVG_TextAlign                           *text_align;\r
+\r
+       SVG_PointerEvents                       *pointer_events;\r
+       \r
+       SVG_FillRule                            *fill_rule; \r
+       \r
+       SVG_StrokeDashArray                     *stroke_dasharray;\r
+       SVG_Length                                      *stroke_dashoffset;\r
+       SVG_StrokeLineCap                       *stroke_linecap; \r
+       SVG_StrokeLineJoin                      *stroke_linejoin; \r
+       SVG_Number                                      *stroke_miterlimit; \r
+       SVG_Length                                      *stroke_width;\r
+       SVG_VectorEffect                        *vector_effect;\r
+       \r
+       /* Full 1.1 props, i.e. not implemented */\r
+/*\r
+       SVG_String *font;\r
+       SVG_String *font_size_adjust;\r
+       SVG_String *font_stretch;\r
+       SVG_String *direction;\r
+       SVG_String *letter_spacing;\r
+       SVG_String *text_decoration;\r
+       SVG_String *unicode_bidi;\r
+       SVG_String *word_spacing;\r
+       SVG_String *clip; \r
+       SVG_String *cursor;\r
+       SVG_String *clip_path;\r
+       SVG_String *clip_rule;\r
+       SVG_String *mask;\r
+       SVG_String *enable_background;\r
+       SVG_String *filter;\r
+       SVG_String *flood_color;\r
+       SVG_String *flood_opacity;\r
+       SVG_String *lighting_color;\r
+       SVG_String *color_interpolation;\r
+       SVG_String *color_interpolation_filters;\r
+       SVG_String *color_profile;\r
+       SVG_String *marker;\r
+       SVG_String *marker_end;\r
+       SVG_String *marker_mid;\r
+       SVG_String *marker_start;\r
+       SVG_String *alignment_baseline;\r
+       SVG_String *baseline_shift;\r
+       SVG_String *dominant_baseline;\r
+       SVG_String *glyph_orientation_horizontal;\r
+       SVG_String *glyph_orientation_vertical;\r
+       SVG_String *kerning;\r
+       SVG_String *writing_mode;\r
+*/\r
+} SVGPropertiesPointers;\r
+\r
+/*************************************\r
+ * Generic SVG element functions     *\r
+ *************************************/\r
+\r
+void gf_svg_properties_init_pointers(SVGPropertiesPointers *svg_props);\r
+void gf_svg_properties_reset_pointers(SVGPropertiesPointers *svg_props);\r
+\r
+void gf_svg_apply_animations(GF_Node *node, SVGPropertiesPointers *render_svg_props);\r
+Bool gf_svg_has_appearance_flag_dirty(u32 flags);\r
+\r
+Bool gf_svg_is_element_transformable(u32 tag);\r
+\r
+void *gf_svg_create_attribute_value(u32 attribute_type);\r
+void gf_svg_delete_attribute_value(u32 type, void *value, GF_SceneGraph *sg);\r
+/* a == b */\r
+Bool gf_svg_attributes_equal(GF_FieldInfo *a, GF_FieldInfo *b);\r
+/* a = b */\r
+GF_Err gf_svg_attributes_copy(GF_FieldInfo *a, GF_FieldInfo *b, Bool clamp);\r
+/* c = a + b */\r
+GF_Err gf_svg_attributes_add(GF_FieldInfo *a, GF_FieldInfo *b, GF_FieldInfo *c, Bool clamp);\r
+Bool gf_svg_attribute_is_interpolatable(u32 type) ;\r
+/* c = coef * a + (1 - coef) * b */\r
+GF_Err gf_svg_attributes_interpolate(GF_FieldInfo *a, GF_FieldInfo *b, GF_FieldInfo *c, Fixed coef, Bool clamp);\r
+/* c = alpha * a + beta * b */\r
+GF_Err gf_svg_attributes_muladd(Fixed alpha, GF_FieldInfo *a, Fixed beta, GF_FieldInfo *b, GF_FieldInfo *c, Bool clamp);\r
+\r
+GF_Err gf_node_get_attribute_by_tag(GF_Node *node, u32 attribute_tag, Bool create_if_not_found, Bool set_default, GF_FieldInfo *field);\r
+\r
+char *gf_svg_attribute_type_to_string(u32 att_type);\r
+GF_Err gf_svg_parse_attribute(GF_Node *n, GF_FieldInfo *info, char *attribute_content, u8 anim_value_type);\r
+void gf_svg_parse_style(GF_Node *n, char *style);\r
+\r
+GF_Err gf_svg_dump_attribute(GF_Node *elt, GF_FieldInfo *info, char *attValue);\r
+GF_Err gf_svg_dump_attribute_indexed(GF_Node *elt, GF_FieldInfo *info, char *attValue);\r
+\r
+void gf_svg_path_build(GF_Path *path, GF_List *commands, GF_List *points);\r
+\r
+GF_Err gf_svg_parse_element_id(GF_Node *n, const char *nodename, Bool warning_if_defined);\r
+\r
+const char *gf_svg_get_system_paint_server_name(u32 paint_type);\r
+u32 gf_svg_get_system_paint_server_type(const char *name);\r
+\r
+\r
+Bool gf_smil_notify_timed_elements(GF_SceneGraph *sg);\r
+void gf_smil_timing_insert_clock(GF_Node *elt, Bool is_end, Double clock);\r
+\r
+void gf_svg_parse_transformlist(GF_Matrix2D *mat, char *attribute_content);\r
+\r
+typedef struct _smil_timing_rti SMIL_Timing_RTI;\r
+\r
+enum\r
+{\r
+       SMIL_TIMING_EVAL_NONE = 0,\r
+       SMIL_TIMING_EVAL_UPDATE,\r
+       SMIL_TIMING_EVAL_FREEZE,\r
+       SMIL_TIMING_EVAL_REMOVE,\r
+       SMIL_TIMING_EVAL_REPEAT,\r
+       SMIL_TIMING_EVAL_FRACTION,\r
+       SMIL_TIMING_EVAL_DISCARD,\r
+       /*signaled the animation element has been inserted in the DOM tree*/\r
+       SMIL_TIMING_EVAL_ACTIVATE,\r
+       /*signaled the animation element has been removed from the DOM tree*/\r
+       SMIL_TIMING_EVAL_DEACTIVATE,\r
+};\r
+\r
+void gf_smil_set_evaluation_callback(GF_Node *smil_time, \r
+                                                                        void (*smil_evaluate)(struct _smil_timing_rti *rti, Fixed normalized_simple_time, u32 state));\r
+\r
+void gf_smil_set_media_duration(SMIL_Timing_RTI *rti, Double media_duration);\r
+Double gf_smil_get_media_duration(SMIL_Timing_RTI *rti);\r
+GF_Node *gf_smil_get_element(SMIL_Timing_RTI *rti);\r
+\r
+Bool gf_smil_timing_is_active(GF_Node *node);\r
+void gf_smil_timing_modified(GF_Node *node, GF_FieldInfo *field);\r
+\r
+/*******************************************************************************\r
+ * \r
+ *          SVG Scene Graph for dynamic allocation of attributes                  *\r
+ *\r
+ *******************************************************************************/\r
+\r
+/*SVG attributes are just DOM ones*/\r
+typedef struct __dom_base_attribute SVGAttribute;\r
+typedef struct __dom_full_attribute SVGExtendedAttribute;\r
+typedef struct __dom_base_node SVG_Element;\r
+\r
+typedef struct __xml_ev_handler SVG_handlerElement;\r
+\r
+\r
+typedef struct _all_atts SVGAllAttributes;\r
+\r
+void gf_svg_flatten_attributes(SVG_Element *e, SVGAllAttributes *all_atts);\r
+const char *gf_svg_get_attribute_name(GF_Node *elt, u32 tag);\r
+u32 gf_svg_apply_inheritance(SVGAllAttributes *all_atts, SVGPropertiesPointers *render_svg_props) ;\r
+\r
+GF_DOMAttribute *gf_xml_create_attribute(GF_Node *node, u32 tag);\r
+u32 gf_xml_get_attribute_type(u32 tag);\r
+u32 gf_xml_get_attribute_tag(GF_Node *node, char *attribute_name, u32 ns);\r
+\r
+u32 gf_xml_get_element_tag(const char *element_name, u32 xmlns);\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif //_GF_SG_SVG_H_\r
diff --git a/tstools/DtsEdit/src/gpac/scenegraph_vrml.h b/tstools/DtsEdit/src/gpac/scenegraph_vrml.h
new file mode 100644 (file)
index 0000000..f0af8fb
--- /dev/null
@@ -0,0 +1,623 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / Scene Graph sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+\r
+#ifndef _GF_SG_VRML_H_\r
+#define _GF_SG_VRML_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/scenegraph.h>\r
+#include <gpac/math.h>\r
+\r
+/*\r
+       All extensions for VRML/MPEG-4/X3D graph structure      \r
+*/\r
+\r
+/*reserved NDT for MPEG4 (match binary coding)*/\r
+#define MPEG4_RESERVED_NDT             200\r
+\r
+/*the NDTs used in X3D not defined in MPEG4*/\r
+enum\r
+{\r
+       NDT_SFMetadataNode = MPEG4_RESERVED_NDT+1,\r
+       NDT_SFFillPropertiesNode,\r
+       NDT_SFX3DLinePropertiesNode,\r
+       NDT_SFGeoOriginNode,\r
+       NDT_SFHAnimNode,\r
+       NDT_SFHAnimDisplacerNode,\r
+       NDT_SFNurbsControlCurveNode,\r
+       NDT_SFNurbsSurfaceNode,\r
+       NDT_SFNurbsCurveNode\r
+};\r
+\r
+/*\r
+       VRML / BIFS TYPES DEFINITION\r
+*/\r
+\r
+/*\r
+                               event types, as defined in the specs \r
+       this should not be needed by non binary codecs\r
+*/\r
+enum\r
+{\r
+       GF_SG_EVENT_FIELD               =       0,\r
+       GF_SG_EVENT_EXPOSED_FIELD       =       1,\r
+       GF_SG_EVENT_IN          =       2,\r
+       GF_SG_EVENT_OUT         =       3,\r
+       GF_SG_EVENT_UNKNOWN     =       4\r
+};\r
+const char *gf_sg_vrml_get_event_type_name(u32 EventType, Bool forX3D);\r
+\r
+/*\r
+                               field coding mode\r
+\r
+       BIFS defines the bitstream syntax contextually, and therefore sometimes refer to fields as indexed\r
+  in the node ("all" mode) or just as a sub-set (in, out, def, dyn modes) of similar types\r
+*/\r
+enum\r
+{\r
+       /*all fields and events*/\r
+       GF_SG_FIELD_CODING_ALL          =       0,\r
+       /*defined fields (exposedField and Field)*/\r
+       GF_SG_FIELD_CODING_DEF          =       1,\r
+       /*input field (exposedField and eventIn)*/\r
+       GF_SG_FIELD_CODING_IN           =       2,\r
+       /*output field (exposedField and eventOut)*/\r
+       GF_SG_FIELD_CODING_OUT          =       3,\r
+       /*field that can be animated (subset of inFields) used in BIFS_Anim only*/\r
+       GF_SG_FIELD_CODING_DYN          =       4\r
+};\r
+\r
+/*get the number of field in the given mode (BIFS specific)*/\r
+u32 gf_node_get_num_fields_in_mode(GF_Node *Node, u8 IndexMode);\r
+\r
+/*             SF Types        */\r
+typedef Bool SFBool;\r
+typedef s32 SFInt32;\r
+typedef s32 SFInt;\r
+typedef Fixed SFFloat;\r
+typedef Double SFDouble;\r
+\r
+typedef struct\r
+{\r
+       char* buffer;\r
+} SFString;\r
+\r
+typedef Double SFTime;\r
+\r
+typedef struct {\r
+       Fixed   red;\r
+       Fixed   green;\r
+       Fixed   blue;\r
+} SFColor;\r
+\r
+typedef struct {\r
+       Fixed   red;\r
+       Fixed   green;\r
+       Fixed   blue;\r
+       Fixed   alpha;\r
+} SFColorRGBA;\r
+\r
+typedef struct {\r
+       u32 OD_ID;\r
+       char *url;\r
+} SFURL;\r
+\r
+typedef struct {\r
+       Double  x;\r
+       Double  y;\r
+} SFVec2d;\r
+\r
+typedef struct {\r
+       Double  x;\r
+       Double  y;\r
+       Double  z;\r
+} SFVec3d;\r
+\r
+/*typedef's to main math tools*/\r
+typedef struct __vec2f SFVec2f;\r
+typedef struct __vec3f SFVec3f;\r
+typedef struct __vec4f SFRotation;\r
+typedef struct __vec4f SFVec4f;\r
+\r
+typedef struct {\r
+       u32 width;\r
+       u32 height;\r
+       u8 numComponents;\r
+       unsigned char* pixels;\r
+} SFImage;\r
+typedef struct {\r
+       u32 bufferSize;\r
+       unsigned char* buffer;\r
+       /*uncompressed command list*/\r
+       GF_List *commandList;\r
+} SFCommandBuffer;\r
+\r
+/*Note on SFScript: the javascript or vrml script is handled in its decompressed (textual) format\r
+since most JS interpreter work with text*/\r
+typedef struct {\r
+       unsigned char* script_text;\r
+} SFScript;\r
+\r
+\r
+/*             MF Types        */\r
+\r
+/*generic MF field: all MF fields use the same syntax except MFNode which uses GF_List. You  can thus use\r
+this structure to safely typecast MF field pointers*/\r
+typedef struct {\r
+       u32 count;\r
+       char *array;\r
+} GenMFField;\r
+\r
+typedef struct {\r
+       u32 count;\r
+       s32* vals;\r
+} MFInt32;\r
+typedef struct {\r
+       u32 count;\r
+       s32* vals;\r
+} MFInt;\r
+typedef struct {\r
+       u32 count;\r
+       Fixed *vals;\r
+} MFFloat;\r
+typedef struct {\r
+       u32 count;\r
+       Double *vals;\r
+} MFDouble;\r
+typedef struct {\r
+       u32 count;\r
+       u32* vals;\r
+} MFBool;\r
+typedef struct {\r
+       u32 count;\r
+       SFColor* vals;\r
+} MFColor;\r
+typedef struct {\r
+       u32 count;\r
+       SFColorRGBA* vals;\r
+} MFColorRGBA;\r
+typedef struct {\r
+       u32 count;\r
+       SFRotation*     vals;\r
+} MFRotation;\r
+typedef struct {\r
+       u32 count;\r
+       Double* vals;\r
+} MFTime;\r
+typedef struct {\r
+       u32 count;\r
+       SFVec2f* vals;\r
+} MFVec2f;\r
+typedef struct {\r
+       u32 count;\r
+       SFVec2d* vals;\r
+} MFVec2d;\r
+typedef struct {\r
+       u32 count;\r
+       SFVec3f* vals;\r
+} MFVec3f;\r
+typedef struct {\r
+       u32 count;\r
+       SFVec3d* vals;\r
+} MFVec3d;\r
+typedef struct {\r
+       u32 count;\r
+       SFVec4f* vals;\r
+} MFVec4f;\r
+\r
+typedef struct {\r
+       u32 count;\r
+       SFURL* vals;\r
+} MFURL;\r
+typedef struct {\r
+       u32 count;\r
+       char** vals;\r
+} MFString;\r
+typedef struct {\r
+       u32 count;\r
+       SFScript *vals;\r
+} MFScript;\r
+\r
+\r
+SFColorRGBA gf_sg_sfcolor_to_rgba(SFColor val);\r
+\r
+/*field types, as defined in BIFS encoding (used for scripts and proto coding)*/\r
+enum\r
+{\r
+       GF_SG_VRML_SFBOOL               =       0,\r
+       GF_SG_VRML_SFFLOAT              =       1,\r
+       GF_SG_VRML_SFTIME               =       2,\r
+       GF_SG_VRML_SFINT32              =       3,\r
+       GF_SG_VRML_SFSTRING             =       4,\r
+       GF_SG_VRML_SFVEC3F              =       5,\r
+       GF_SG_VRML_SFVEC2F              =       6,\r
+       GF_SG_VRML_SFCOLOR              =       7,\r
+       GF_SG_VRML_SFROTATION   =       8,\r
+       GF_SG_VRML_SFIMAGE              =       9,\r
+       GF_SG_VRML_SFNODE               =       10,\r
+       /*TO CHECK*/\r
+       GF_SG_VRML_SFVEC4F              =       11,\r
+\r
+       /*used types in GPAC but not defined in the MPEG4 spec*/\r
+       GF_SG_VRML_SFURL,\r
+       GF_SG_VRML_SFSCRIPT,\r
+       GF_SG_VRML_SFCOMMANDBUFFER,\r
+       /*used types in X3D*/\r
+       GF_SG_VRML_SFDOUBLE,\r
+       GF_SG_VRML_SFCOLORRGBA,\r
+       GF_SG_VRML_SFVEC2D,\r
+       GF_SG_VRML_SFVEC3D,\r
+\r
+       GF_SG_VRML_FIRST_MF             = 32,\r
+       GF_SG_VRML_MFBOOL               = GF_SG_VRML_FIRST_MF,\r
+       GF_SG_VRML_MFFLOAT,\r
+       GF_SG_VRML_MFTIME,\r
+       GF_SG_VRML_MFINT32,\r
+       GF_SG_VRML_MFSTRING,\r
+       GF_SG_VRML_MFVEC3F,\r
+       GF_SG_VRML_MFVEC2F,\r
+       GF_SG_VRML_MFCOLOR,\r
+       GF_SG_VRML_MFROTATION,\r
+       GF_SG_VRML_MFIMAGE,\r
+       GF_SG_VRML_MFNODE,\r
+       GF_SG_VRML_MFVEC4F,\r
+\r
+       /*used types in GPAC but not defined in the MPEG4 spec*/\r
+       GF_SG_VRML_MFURL,\r
+       GF_SG_VRML_MFSCRIPT,\r
+\r
+       /*used types in X3D*/\r
+       GF_SG_VRML_MFDOUBLE,\r
+       GF_SG_VRML_MFCOLORRGBA,\r
+       GF_SG_VRML_MFVEC2D,\r
+       GF_SG_VRML_MFVEC3D,\r
+\r
+       GF_SG_VRML_UNKNOWN\r
+};\r
+const char *gf_sg_vrml_get_field_type_by_name(u32 FieldType);\r
+\r
+\r
+/*\r
+allocates a new field and gets it back. \r
+       NOTE:\r
+                       GF_SG_VRML_MFNODE will return a pointer to a GF_List structure (eg GF_List *)\r
+                       GF_SG_VRML_SFNODE will return NULL\r
+*/\r
+void *gf_sg_vrml_field_pointer_new(u32 FieldType);\r
+/*deletes a field pointer (including SF an,d MF nodes)*/\r
+void gf_sg_vrml_field_pointer_del(void *field, u32 FieldType);\r
+\r
+Bool gf_sg_vrml_is_sf_field(u32 FieldType);\r
+\r
+/*translates MF/SF to SF type*/\r
+u32 gf_sg_vrml_get_sf_type(u32 FieldType);\r
+\r
+\r
+/*\r
+       MFField manipulation  - MFNode cannot use these, use the GF_List functions instead\r
+       or the Node_* insertion functions\r
+       FieldType shall always be given when manipulating MFFields\r
+*/\r
+/*Insert (+alloc) a slot in the MFField with a specified position for insertion and sets the ptr\r
+to the newly created slot\r
+@InsertAt is the 0-based index for the new slot\r
+*/\r
+GF_Err gf_sg_vrml_mf_insert(void *mf, u32 FieldType, void **new_ptr, u32 InsertAt);\r
+/*adds at the end and gets the ptr*/\r
+GF_Err gf_sg_vrml_mf_append(void *mf, u32 FieldType, void **new_ptr);\r
+/*remove the desired item*/\r
+GF_Err gf_sg_vrml_mf_remove(void *mf, u32 FieldType, u32 RemoveFrom);\r
+/*alloc a fixed array*/\r
+GF_Err gf_sg_vrml_mf_alloc(void *mf, u32 FieldType, u32 NbItems);\r
+/*get the item in the array*/\r
+GF_Err gf_sg_vrml_mf_get_item(void *mf, u32 FieldType, void **new_ptr, u32 ItemPos);\r
+/*remove all items of the MFField*/\r
+GF_Err gf_sg_vrml_mf_reset(void *mf, u32 FieldType);\r
+\r
+/*clones a field content EXCEPT SF/MFNode. Pointers to field shall be used\r
+@dest, @orig: pointers to field\r
+@FieldType: type of the field\r
+*/\r
+void gf_sg_vrml_field_copy(void *dest, void *orig, u32 FieldType);\r
+\r
+/*indicates whether 2 fields of same type EXCEPT SF/MFNode are equal\r
+@dest, @orig: pointers to field\r
+@FieldType: type of the field\r
+*/\r
+Bool gf_sg_vrml_field_equal(void *dest, void *orig, u32 FieldType);\r
+\r
+\r
+\r
+/*VRML grouping nodes macro - note we have inverted the children field to be \r
+compatible with the base GF_ParentNode node\r
+All grouping nodes (with "children" field) implement the following: \r
+\r
+addChildren: chain containing nodes to add passed as eventIn - handled internally through ROUTE\r
+void (*on_addChildren)(GF_Node *pNode): add eventIn signaler - this is handled internally by the scene_graph and SHALL \r
+NOT BE OVERRIDEN since it takes care of node(s) routing\r
+\r
+removeChildren: chain containing nodes to remove passed as eventIn - handled internally through ROUTE\r
+\r
+void (*on_removeChildren)(GF_Node *pNode): remove eventIn signaler - this is handled internally by the scene_graph and SHALL \r
+NOT BE OVERRIDEN since it takes care of node(s) routing\r
+\r
+children: list of children SFNodes\r
+*/\r
+\r
+#define VRML_CHILDREN                                                  \\r
+       CHILDREN                                                                        \\r
+       GF_ChildNodeItem *addChildren;                                                  \\r
+       void (*on_addChildren)(GF_Node *pNode);         \\r
+       GF_ChildNodeItem *removeChildren;                                               \\r
+       void (*on_removeChildren)(GF_Node *pNode);              \\r
+\r
+typedef struct\r
+{\r
+       BASE_NODE\r
+       VRML_CHILDREN\r
+} GF_VRMLParent;\r
+\r
+void gf_sg_vrml_parent_setup(GF_Node *pNode);\r
+void gf_sg_vrml_parent_destroy(GF_Node *pNode);\r
+\r
+\r
+/*set proto loader - callback is the same as simulation time callback\r
+       GetExternProtoLib is a pointer to the proto lib loader - this callback shall return the LPSCENEGRAPH\r
+of the extern proto lib if found and loaded, NULL if not found and GF_SG_INTERNAL_PROTO for internal\r
+hardcoded protos (extensions of MPEG-4 scene graph used for module deveopment)\r
+*/\r
+#define GF_SG_INTERNAL_PROTO   (GF_SceneGraph *) 0xFFFFFFFF\r
+\r
+/*GF_Route manip: routes are used to pass events between nodes. Event handling is managed by the scene graph\r
+however only the nodes overloading the EventIn handler associated with the event will process the eventIn*/\r
+typedef struct _route GF_Route;\r
+\r
+/*creates a new route:\r
+       @fromNode: @fromField: address of the eventOut field triggering the route\r
+       @toNode: @toField: address of the destination eventIn field\r
+NOTE: routes are automatically destroyed if either the target or origin node of the route is destroyed\r
+*/\r
+GF_Route *gf_sg_route_new(GF_SceneGraph *sg, GF_Node *fromNode, u32 fromField, GF_Node *toNode, u32 toField);\r
+\r
+/*delete route*/\r
+void gf_sg_route_del(GF_Route *route);\r
+GF_Err gf_sg_route_del_by_id(GF_SceneGraph *sg,u32 routeID);\r
+\r
+/*locate route by ID/name*/\r
+GF_Route *gf_sg_route_find(GF_SceneGraph *sg, u32 RouteID);\r
+GF_Route *gf_sg_route_find_by_name(GF_SceneGraph *sg, char *name);\r
+/*assign route ID - fails if a route with same ID already exist*/\r
+GF_Err gf_sg_route_set_id(GF_Route *route, u32 ID);\r
+u32 gf_sg_route_get_id(GF_Route *route);\r
+/*assign route name if desired*/\r
+GF_Err gf_sg_route_set_name(GF_Route *route, char *name);\r
+char *gf_sg_route_get_name(GF_Route *route);\r
+\r
+/*retuns next available RouteID - Note this doesn't track inserted routes, that's the user responsability*/\r
+u32 gf_sg_get_next_available_route_id(GF_SceneGraph *sg);\r
+/*set max defined route ID used in the scene - used to handle RouteInsert commands\r
+note that this must be called by the user to be effective,; otherwise the max route ID is computed\r
+from the routes present in scene*/\r
+void gf_sg_set_max_defined_route_id(GF_SceneGraph *sg, u32 ID);\r
+\r
+\r
+/*activates all routes currently triggered - this follows the event cascade model of VRML/MPEG4:\r
+       - routes are collected during eventOut generation\r
+       - routes are activated. If eventOuts are generated during activation the cycle goes on.\r
+\r
+  A route cannot be activated twice in the same simulation tick, hence this function shall be called \r
+  ONCE AND ONLY ONCE per simulation tick\r
+\r
+Note that children scene graphs register their routes with the top-level graph, so only the main \r
+scene graph needs to be activated*/\r
+void gf_sg_activate_routes(GF_SceneGraph *sg);\r
+\r
+\r
+/*\r
+                               proto handling\r
+\r
+       The lib allows you to construct prototype nodes as defined in VRML/MPEG4 by constructing \r
+       proto interfaces and instanciating them. An instanciated proto is handled as a single node for\r
+       rendering, thus an application will never handle proto instances for rendering\r
+*/\r
+\r
+/*opaque handler for a proto object (declaration)*/\r
+typedef struct _proto GF_Proto;\r
+/*opaque handler for a proto field object (declaration)*/\r
+typedef struct _protofield GF_ProtoFieldInterface;\r
+\r
+\r
+/*retuns next available NodeID*/\r
+u32 gf_sg_get_next_available_proto_id(GF_SceneGraph *sg);\r
+\r
+/*proto constructor identified by ID/name in the given scene\r
+2 protos in the same scene may not have the same ID/name\r
+\r
+@unregistered: used for memory handling of scene graph only, the proto is not stored\r
+in the graph main proto list but in an alternate list. Several protos with the same ID/Name can be stored unregistered\r
+*/\r
+GF_Proto *gf_sg_proto_new(GF_SceneGraph *inScene, u32 ProtoID, char *name, Bool unregistered);\r
+\r
+/*destroy proto interface - can be used even if instances of the proto are still present*/\r
+GF_Err gf_sg_proto_del(GF_Proto *proto);\r
+\r
+/*used for memory handling of scene graph only. move proto from off-graph to in-graph or reverse*/\r
+GF_Err gf_sg_proto_set_in_graph(GF_Proto *proto, GF_SceneGraph *inScene, Bool set_in);\r
+\r
+/*returns graph associated with this proto. Such a graph cannot be used for rendering but is needed during\r
+construction of proto dictionaries in case of nested protos*/\r
+GF_SceneGraph *gf_sg_proto_get_graph(GF_Proto *proto);\r
+\r
+/*get/set private data*/\r
+void gf_sg_proto_set_private(GF_Proto *proto, void *ptr, void (*OnDelete)(void *ptr) );\r
+void *gf_sg_proto_get_private(GF_Proto *proto);\r
+\r
+/*add node code - a proto is build of several nodes, the first node is used for rendering\r
+and the others are kept private. This set of nodes is refered to as the proto "node code"*/\r
+GF_Err gf_sg_proto_add_node_code(GF_Proto *proto, GF_Node *pNode);\r
+\r
+/*gets number of field in the proto interface*/\r
+u32 gf_sg_proto_get_field_count(GF_Proto *proto);\r
+/*locates field declaration by name*/\r
+GF_ProtoFieldInterface *gf_sg_proto_field_find_by_name(GF_Proto *proto, char *fieldName);\r
+/*locates field declaration by index (0-based)*/\r
+GF_ProtoFieldInterface *gf_sg_proto_field_find(GF_Proto *proto, u32 fieldIndex);\r
+\r
+/*creates a new field declaration in the proto. of given fieldtype and eventType\r
+fieldName can be NULL, if so the name will be fieldN, N being the index of the created field*/\r
+GF_ProtoFieldInterface *gf_sg_proto_field_new(GF_Proto *proto, u32 fieldType, u32 eventType, char *fieldName);\r
+\r
+/*assign the node field to a field of the proto (the node field IS the proto field)\r
+the node shall be a node of the proto scenegraph, and the fieldtype/eventType of both fields shall match\r
+(except SF/MFString and MF/SFURL which are allowed) due to BIFS semantics*/\r
+GF_Err gf_sg_proto_field_set_ised(GF_Proto *proto, u32 protoFieldIndex, GF_Node *node, u32 nodeFieldIndex);\r
+/*set/get user private data for the proto field declaration*/\r
+void gf_sg_proto_field_set_private(GF_ProtoFieldInterface *field, void *ptr, void (*OnDelete)(void *ptr) );\r
+void *gf_sg_proto_field_get_private(GF_ProtoFieldInterface *field);\r
+/*returns field info of the field - this is typically used to setup the default value of the field*/\r
+GF_Err gf_sg_proto_field_get_field(GF_ProtoFieldInterface *field, GF_FieldInfo *info);\r
+\r
+/*\r
+       NOTE on proto instances:\r
+               The proto instance is handled as an GF_Node outside the scenegraph lib, and is manipulated with the same functions \r
+               as an GF_Node \r
+               The proto instance may or may not be loaded. \r
+               An unloaded instance only contains the proto instance fields \r
+               A loaded instance contains the proto instance fields plus all the proto code (Nodes, routes) and \r
+               will load any scripts present in it. This allows keeping the memory usage of proto very low, especially\r
+               when nested protos (protos used as building blocks of their parent proto) are used.\r
+*/\r
+\r
+/*creates the proto interface without the proto code.*/\r
+GF_Node *gf_sg_proto_create_instance(GF_SceneGraph *sg, GF_Proto *proto);\r
+\r
+/*lodes code in this instance - all subprotos are automatically created, thus you must only instanciate\r
+top-level protos. VRML/BIFS doesn't allow for non top-level proto instanciation in the main graph\r
+All nodes created in this proto will be forwarded to the app for initialization*/\r
+GF_Err gf_sg_proto_load_code(GF_Node *proto_inst);\r
+\r
+/*locate a prototype definition by ID or by name. when looking by name, ID is ignored*/\r
+GF_Proto *gf_sg_find_proto(GF_SceneGraph *sg, u32 ProtoID, char *name);\r
+\r
+/*deletes all protos in given scene - does NOT delete instances of protos, only the proto object is destroyed */\r
+GF_Err gf_sg_delete_all_protos(GF_SceneGraph *scene);\r
+\r
+\r
+/*tools for hardcoded proto*/\r
+/*gets proto of this node - if the node is not a prototype instance, returns NULL*/\r
+GF_Proto *gf_node_get_proto(GF_Node *node);\r
+/*returns the ID of the proto*/\r
+u32 gf_sg_proto_get_id(GF_Proto *proto);\r
+/*returns proto name*/\r
+const char *gf_sg_proto_get_class_name(GF_Proto *proto);\r
+\r
+/*Returns 1 if the given field is ISed to a startTime/stopTime field (MPEG-4 specific for updates)*/\r
+Bool gf_sg_proto_field_is_sftime_offset(GF_Node *node, GF_FieldInfo *field);\r
+\r
+/*set an ISed field in a proto instance (not a proto) - this is needed with dynamic node creation inside a proto\r
+instance (conditionals)*/\r
+GF_Err gf_sg_proto_instance_set_ised(GF_Node *protoinst, u32 protoFieldIndex, GF_Node *node, u32 nodeFieldIndex);\r
+\r
+/*returns root node (the one and only one being traversed) of this proto instance if any*/\r
+GF_Node *gf_node_get_proto_root(GF_Node *node);\r
+\r
+/*returns parent ProtoInstance node if this node is in a proto*/\r
+GF_Node *gf_node_get_proto_parent(GF_Node *node);\r
+\r
+/*indicates proto field has been parsed and its value is valid - this is needed for externProtos not specifying default\r
+values*/\r
+void gf_sg_proto_mark_field_loaded(GF_Node *proto_inst, GF_FieldInfo *info);\r
+\r
+/*\r
+                       JavaScript tools\r
+*/\r
+\r
+/*script fields type don't have the same value as the bifs ones...*/\r
+enum\r
+{\r
+       GF_SG_SCRIPT_TYPE_FIELD = 0,\r
+       GF_SG_SCRIPT_TYPE_EVENT_IN,\r
+       GF_SG_SCRIPT_TYPE_EVENT_OUT,\r
+};\r
+\r
+typedef struct _scriptfield GF_ScriptField;\r
+/*creates new sript field - script fields are dynamically added to the node, and thus can be accessed through the\r
+same functions as other GF_Node fields*/\r
+GF_ScriptField *gf_sg_script_field_new(GF_Node *script, u32 eventType, u32 fieldType, const char *name);\r
+/*retrieves field info, usefull to get the field index*/\r
+GF_Err gf_sg_script_field_get_info(GF_ScriptField *field, GF_FieldInfo *info);\r
+\r
+/*activate eventIn for script node - needed for BIFS field replace*/\r
+void gf_sg_script_event_in(GF_Node *node, GF_FieldInfo *in_field);\r
+\r
+\r
+\r
+/*set the scene proto loader function for externProto - callback is the same as the scene callback*/\r
+void gf_sg_set_proto_loader(GF_SceneGraph *scene, GF_SceneGraph *(*GetExternProtoLib)(void *SceneCallback, MFURL *lib_url));\r
+\r
+/*get a pointer to the MF URL field for externProto info - DO NOT TOUCH THIS FIELD*/\r
+MFURL *gf_sg_proto_get_extern_url(GF_Proto *proto);\r
+\r
+SFRotation gf_sg_sfrotation_interpolate(SFRotation kv1, SFRotation kv2, Fixed fraction);\r
+\r
+\r
+\r
+\r
+/*adds a new node to the "children" field\r
+position is the 0-BASED index in the list of children, -1 means end of list (append)\r
+DOES NOT CHECK CHILD/PARENT type compatibility\r
+*/\r
+GF_Err gf_node_insert_child(GF_Node *parent, GF_Node *new_child, s32 Position);\r
+/*removes an existing node from the "children" field*/\r
+GF_Err gf_node_remove_child(GF_Node *parent, GF_Node *toremove_child);\r
+/*remove and replace given child by specified node. If node is NULL, only delete target node\r
+position is the 0-BASED index in the list of children, -1 means end of list (append)\r
+DOES NOT CHECK CHILD/PARENT type compatibility\r
+*/\r
+GF_Err gf_node_replace_child(GF_Node *node, GF_ChildNodeItem **container, s32 pos, GF_Node *newNode);\r
+\r
+/*signals eventOut has been set. FieldIndex/eventName identify the eventOut field. Routes are automatically triggered\r
+when the event is signaled*/\r
+void gf_node_event_out(GF_Node *node, u32 FieldIndex);\r
+void gf_node_event_out_str(GF_Node *node, const char *eventName);\r
+\r
+\r
+/*exported for parsers*/\r
+u32 gf_node_mpeg4_type_by_class_name(const char *node_name);\r
+u32 gf_node_x3d_type_by_class_name(const char *node_name);\r
+\r
+/*exported for URL handling in compositor*/\r
+void gf_sg_mfurl_del(MFURL url);\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+\r
+#endif /*_GF_SG_VRML_H_*/\r
diff --git a/tstools/DtsEdit/src/gpac/setup.h b/tstools/DtsEdit/src/gpac/setup.h
new file mode 100644 (file)
index 0000000..3edc13a
--- /dev/null
@@ -0,0 +1,377 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / general OS configuration file\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_SETUP_H_\r
+#define _GF_SETUP_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+\r
+/*WIN32 and WinCE config*/\r
+#if defined(WIN32) || defined(_WIN32_WCE)\r
+\r
+#ifdef GPAC_HAVE_CONFIG_H\r
+\r
+#if defined(__GNUC__)\r
+#include <gpac/internal/config.h>\r
+#else\r
+#include <gpac/internal/config_static.h>\r
+#endif\r
+\r
+#endif\r
+\r
+/*common win32 parts*/\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+\r
+\r
+typedef unsigned __int64 u64;\r
+typedef unsigned int u32;\r
+typedef unsigned short u16;\r
+typedef unsigned char u8;\r
+typedef __int64 s64;\r
+typedef int s32;\r
+typedef short s16;\r
+typedef char s8;\r
+\r
+#if defined(__GNUC__)\r
+#define GFINLINE inline\r
+#else\r
+#define GFINLINE __inline\r
+#endif\r
+\r
+#define GF_PATH_SEPARATOR      '\\'\r
+#define GF_MAX_PATH    1024\r
+\r
+/*WINCE config*/\r
+#if defined(_WIN32_WCE)\r
+\r
+/*winCE read-only (smaller)*/\r
+#ifndef GPAC_READ_ONLY\r
+#define GPAC_READ_ONLY\r
+#endif\r
+\r
+/*winCE always fixed-point*/\r
+#ifndef GPAC_FIXED_POINT\r
+#define GPAC_FIXED_POINT\r
+#endif\r
+\r
+/*win32 assert*/\r
+#ifndef assert\r
+\r
+void CE_Assert(u32 valid, char *file, u32 line);\r
+\r
+#ifndef NDEBUG\r
+#define assert( t )    CE_Assert((unsigned int) (t), __FILE__, __LINE__ )\r
+#else\r
+#define assert(t)\r
+#endif\r
+\r
+#endif\r
+\r
+\r
+/*performs wide->char and char->wide conversion on a buffer GF_MAX_PATH long*/\r
+void CE_WideToChar(unsigned short *w_str, char *str);\r
+void CE_CharToWide(char *str, unsigned short *w_str);\r
+\r
+\r
+#define strdup _strdup\r
+#define stricmp _stricmp\r
+#define strnicmp _strnicmp\r
+#define strupr _strupr\r
+\r
+#ifndef _PTRDIFF_T_DEFINED\r
+typedef int ptrdiff_t;\r
+#define PTRDIFF(p1, p2, type)  ((p1) - (p2))\r
+#define _PTRDIFF_T_DEFINED\r
+#endif\r
+\r
+#ifndef _SIZE_T_DEFINED\r
+typedef unsigned int size_t;\r
+#define _SIZE_T_DEFINED\r
+#endif\r
+\r
+#ifndef offsetof\r
+#define offsetof(s,m) ((size_t)&(((s*)0)->m))\r
+#endif\r
+\r
+#ifndef getenv\r
+#define getenv(a) 0L\r
+#endif\r
+\r
+#define strupr _strupr\r
+#define strlwr _strlwr\r
+\r
+//#define GPAC_DISABLE_LOG\r
+\r
+#else  /*END WINCE*/\r
+\r
+/*WIN32 not-WinCE*/\r
+#include <ctype.h>\r
+#include <string.h>\r
+#include <float.h>\r
+#include <limits.h>\r
+#include <stdarg.h>\r
+#include <assert.h>\r
+\r
+\r
+#endif /*END WIN32 non win-ce*/\r
+/*end WIN32 config*/\r
+\r
+/*start SYMBIAN config*/\r
+#elif defined(__SYMBIAN32__)\r
+\r
+#define GFINLINE inline\r
+#define GF_PATH_SEPARATOR      '\\'\r
+\r
+/*we must explicitely export our functions...*/\r
+#define GF_EXPORT EXPORT_C\r
+\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+#include <stdarg.h>\r
+#include <limits.h>\r
+#include <ctype.h>\r
+#include <string.h>\r
+#include <assert.h>\r
+\r
+#ifdef __SERIES60_3X__\r
+\r
+typedef unsigned __int64 u64;\r
+typedef __int64 s64;\r
+\r
+#else \r
+\r
+/*FIXME - we don't have 64bit support here we should get rid of all 64bits divisions*/\r
+//typedef unsigned long long u64;\r
+//typedef long long s64;\r
+\r
+typedef unsigned int u64;\r
+typedef signed int s64;\r
+\r
+#endif /*symbian 8*/\r
+\r
+/*SYMBIAN always fixed-point*/\r
+#ifndef GPAC_FIXED_POINT\r
+#define GPAC_FIXED_POINT\r
+#endif\r
+\r
+\r
+typedef unsigned int u32;\r
+typedef unsigned short u16;\r
+typedef unsigned char u8;\r
+typedef int s32;\r
+typedef short s16;\r
+typedef signed char s8;\r
+\r
+#pragma mpwc_relax on\r
+\r
+#define GF_MAX_PATH    260\r
+\r
+/*sorry this was developed under w32 :)*/\r
+#define stricmp                strcasecmp\r
+#define strnicmp       strncasecmp\r
+\r
+#ifndef strupr\r
+char * my_str_upr(char *str);\r
+#define strupr my_str_upr\r
+#endif\r
+\r
+#ifndef strlwr\r
+char * my_str_lwr(char *str);\r
+#define strlwr my_str_lwr\r
+#endif\r
+\r
+#ifndef DBL_MAX\r
+#include <libc/ieeefp.h>\r
+#define DBL_MAX        (__IEEE_DBL_MAXPOWTWO)\r
+#endif\r
+\r
+#ifndef FLT_MAX\r
+#include <libc/ieeefp.h>\r
+#define FLT_MAX        (__IEEE_FLT_MAXPOWTWO)\r
+#endif\r
+\r
+#ifndef FLT_EPSILON\r
+#define FLT_EPSILON 1\r
+#endif\r
+\r
+/*end SYMBIAN config*/\r
+\r
+#else \r
+\r
+/*UNIX likes*/\r
+\r
+#ifdef GPAC_HAVE_CONFIG_H\r
+#include "config.h"\r
+#endif\r
+\r
+\r
+/*force large file support*/\r
+#ifndef _FILE_OFFSET_BITS\r
+#define _FILE_OFFSET_BITS 64\r
+#endif\r
+#ifndef _LARGEFILE_SOURCE\r
+#define _LARGEFILE_SOURCE\r
+#endif\r
+#ifndef _LARGEFILE64_SOURCE\r
+#define _LARGEFILE64_SOURCE\r
+#endif\r
+\r
+#include <stdint.h>\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+#include <stdarg.h>\r
+#include <limits.h>\r
+#include <float.h>\r
+#include <ctype.h>\r
+#include <string.h>\r
+#include <assert.h>\r
+\r
+\r
+typedef uint64_t u64;\r
+typedef uint32_t u32;\r
+typedef uint16_t u16;\r
+typedef uint8_t u8;\r
+typedef int64_t s64;\r
+typedef int32_t s32;\r
+typedef int16_t s16;\r
+typedef int8_t s8;\r
+\r
+#define GFINLINE       inline\r
+\r
+/*sorry this was developed under w32 :)*/\r
+#define stricmp                strcasecmp\r
+#define strnicmp       strncasecmp\r
+\r
+#ifndef strupr\r
+char * my_str_upr(char *str);\r
+#define strupr my_str_upr\r
+#endif\r
+\r
+#ifndef strlwr\r
+char * my_str_lwr(char *str);\r
+#define strlwr my_str_lwr\r
+#endif\r
+\r
+#define GF_PATH_SEPARATOR      '/'\r
+\r
+#ifdef PATH_MAX\r
+#define GF_MAX_PATH    PATH_MAX\r
+#else\r
+/*PATH_MAX not defined*/\r
+#define GF_MAX_PATH    1023\r
+#endif\r
+\r
+\r
+#endif /* end platform specific Win32/WinCE/UNIX*/\r
+\r
+/*define what's missing*/\r
+#ifndef NULL\r
+#define NULL 0\r
+#endif\r
+\r
+\r
+typedef double Double;\r
+typedef float Float;\r
+/* 128 bit IDs */\r
+typedef u8 bin128[16];\r
+\r
+#define GF_MAX_DOUBLE          DBL_MAX\r
+#define GF_MIN_DOUBLE          -GF_MAX_DOUBLE\r
+#define GF_MAX_FLOAT           FLT_MAX\r
+#define GF_MIN_FLOAT           -GF_MAX_FLOAT\r
+#define GF_EPSILON_FLOAT       FLT_EPSILON\r
+#define GF_SHORT_MAX           SHRT_MAX\r
+#define GF_SHORT_MIN           SHRT_MIN\r
+\r
+#ifndef MIN\r
+#define MIN(X, Y) ((X)<(Y)?(X):(Y))\r
+#endif\r
+#ifndef MAX\r
+#define MAX(X, Y) ((X)>(Y)?(X):(Y))\r
+#endif\r
+\r
+#define ABSDIFF(a, b)  ( ( (a) > (b) ) ? ((a) - (b)) : ((b) - (a)) )\r
+\r
+#ifndef ABS\r
+#define ABS(a) ( ( (a) > 0 ) ? (a) : - (a) )\r
+#endif\r
+\r
+#ifndef Bool\r
+typedef u32 Bool;\r
+#endif\r
+\r
+/*GPAC memory tracking*/\r
+#define GPAC_MEMORY_TRACKING   0\r
+\r
+#if GPAC_MEMORY_TRACKING\r
+void *gf_malloc(size_t size);\r
+void *gf_realloc(void *ptr, size_t size);\r
+void gf_free(void *ptr);\r
+char *gf_strdup(const char *str);\r
+\r
+#undef malloc\r
+#define malloc gf_malloc\r
+#undef realloc\r
+#define realloc gf_realloc\r
+#undef free\r
+#define free gf_free\r
+#undef strdup\r
+#define strdup gf_strdup\r
+\r
+#endif\r
+/*end GPAC memory tracking*/\r
+\r
+#if defined (WIN32) && !defined(__GNUC__)\r
+#define LLD "%I64d"\r
+#define LLU "%I64u"\r
+#define LLD_CAST\r
+#define LLU_CAST\r
+#elif defined (__SYMBIAN32__)\r
+#define LLD "%d"\r
+#define LLU "%u"\r
+#define LLD_CAST (u32)\r
+#define LLU_CAST (s32)\r
+#else\r
+#define LLD "%lld"\r
+#define LLU "%llu"\r
+#define LLD_CAST\r
+#define LLU_CAST\r
+#endif\r
+\r
+\r
+#ifndef GF_EXPORT\r
+/*use def files for windows or let compiler decide*/\r
+#define GF_EXPORT \r
+#endif\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /*_GF_SETUP_H_*/\r
diff --git a/tstools/DtsEdit/src/gpac/svg_types.h b/tstools/DtsEdit/src/gpac/svg_types.h
new file mode 100644 (file)
index 0000000..0697007
--- /dev/null
@@ -0,0 +1,887 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Authors: Cyril Concolato - Jean Le Feuvre\r
+ *                     Copyright (c) 2004-200X ENST\r
+ *                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / Scene Graph sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_SVG_SVG_TYPES_H_\r
+#define _GF_SVG_SVG_TYPES_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/path2d.h>\r
+\r
+\r
+\r
+/* Attributes in SVG can be accessed using a GF_FieldInfo structure \r
+   like it is done in the BIFS part of the implementation:\r
+\r
+       fieldIndex:             attribute tag to identify the attribute in the element in the case of dynamic alloc (default)\r
+                    or index of the attribute in the element in the case of static allocation of attributes\r
+\r
+       fieldType:              attribute data type as in the enumeration below\r
+       \r
+       name:                   attribute name (WARNING: this may be NULL)\r
+\r
+       far_ptr:                pointer to the actual data with one of the type given in this file\r
+\r
+       NDTType:                unused in SVG\r
+       eventType:              unused in SVG\r
+       on_event_in:    unused in SVG \r
+*/\r
+\r
+/* SVG attribute types */\r
+enum {\r
+       SVG_Unknown_datatype                                    = 0,\r
+\r
+       /* keyword enum types */\r
+       XML_Space_datatype,\r
+       XMLEV_Propagate_datatype,\r
+       XMLEV_DefaultAction_datatype,\r
+       XMLEV_Phase_datatype,\r
+       SVG_FillRule_datatype,\r
+       SVG_StrokeLineJoin_datatype,\r
+       SVG_StrokeLineCap_datatype,\r
+       SVG_FontStyle_datatype,\r
+       SVG_FontWeight_datatype,\r
+       SVG_FontVariant_datatype,\r
+       SVG_TextAnchor_datatype,\r
+       SVG_TransformType_datatype, \r
+       SVG_Display_datatype, \r
+       SVG_Visibility_datatype,\r
+       SVG_Overflow_datatype,\r
+       SVG_ZoomAndPan_datatype,\r
+       SVG_DisplayAlign_datatype,\r
+       SVG_PointerEvents_datatype,\r
+       SVG_RenderingHint_datatype,\r
+       SVG_VectorEffect_datatype,\r
+       SVG_PlaybackOrder_datatype,\r
+       SVG_TimelineBegin_datatype,\r
+       SVG_GradientUnit_datatype,\r
+       SVG_InitialVisibility_datatype,\r
+       SVG_FocusHighlight_datatype,\r
+       SVG_Overlay_datatype,\r
+       SVG_TransformBehavior_datatype,\r
+       SVG_SpreadMethod_datatype,\r
+       SVG_TextAlign_datatype,\r
+       SVG_Focusable_datatype,\r
+       SMIL_SyncBehavior_datatype,\r
+       SMIL_SyncTolerance_datatype,\r
+       SMIL_AttributeType_datatype,\r
+       SMIL_CalcMode_datatype,\r
+       SMIL_Additive_datatype,\r
+       SMIL_Accumulate_datatype,\r
+       SMIL_Restart_datatype,\r
+       SMIL_Fill_datatype,     \r
+\r
+       SVG_LAST_U8_PROPERTY,\r
+\r
+       DOM_String_datatype,\r
+       DOM_StringList_datatype,\r
+\r
+       XMLEV_Event_datatype,\r
+       XMLRI_datatype,\r
+       XMLRI_List_datatype,\r
+       XML_IDREF_datatype,\r
+\r
+       SMIL_KeyTimes_datatype,\r
+       SMIL_KeySplines_datatype,\r
+       SMIL_KeyPoints_datatype,\r
+       SMIL_Times_datatype,\r
+\r
+       /* animated (untyped) value */\r
+       SMIL_AnimateValue_datatype,\r
+       SMIL_AnimateValues_datatype,\r
+       SMIL_Duration_datatype,\r
+       SMIL_RepeatCount_datatype,\r
+       SMIL_AttributeName_datatype,\r
+\r
+       /* SVG Number */\r
+       SVG_Number_datatype,\r
+       SVG_FontSize_datatype,\r
+       SVG_Length_datatype,\r
+       SVG_Coordinate_datatype,\r
+       SVG_Rotate_datatype,\r
+\r
+       /* List of */\r
+       SVG_Numbers_datatype,\r
+       SVG_Points_datatype,\r
+       SVG_Coordinates_datatype,\r
+\r
+       /*all other types*/\r
+       SVG_Boolean_datatype,\r
+       SVG_Color_datatype,\r
+       SVG_Paint_datatype,\r
+       SVG_PathData_datatype,\r
+       SVG_FontFamily_datatype,\r
+       SVG_ID_datatype,\r
+\r
+       SVG_StrokeDashArray_datatype,\r
+       SVG_PreserveAspectRatio_datatype,\r
+       SVG_ViewBox_datatype,\r
+       SVG_GradientOffset_datatype,\r
+       SVG_Focus_datatype,\r
+       SVG_Clock_datatype,\r
+       SVG_ContentType_datatype,\r
+       SVG_LanguageID_datatype,\r
+\r
+       /* Matrix related types */\r
+       SVG_Transform_datatype,\r
+       SVG_Transform_Translate_datatype,\r
+       SVG_Transform_Scale_datatype,\r
+       SVG_Transform_SkewX_datatype,\r
+       SVG_Transform_SkewY_datatype,\r
+       SVG_Transform_Rotate_datatype,\r
+       SVG_Motion_datatype,\r
+\r
+       /*LASeR types*/\r
+       LASeR_Choice_datatype,\r
+       LASeR_Size_datatype,\r
+};\r
+\r
+/* Definition of SVG base data types */\r
+typedef char *DOM_String;\r
+typedef DOM_String SVG_String;\r
+typedef DOM_String SVG_ContentType;\r
+typedef DOM_String SVG_LanguageID;\r
+typedef DOM_String SVG_TextContent;\r
+\r
+/* types not yet handled properly, i.e. for the moment using strings */\r
+typedef DOM_String SVG_ID;\r
+typedef DOM_String SVG_LinkTarget;\r
+typedef DOM_String SVG_GradientOffset;\r
+\r
+typedef Double SVG_Clock;\r
+\r
+typedef GF_List *ListOfXXX;\r
+typedef GF_List *SVG_Numbers;\r
+typedef GF_List *SVG_Coordinates;\r
+typedef GF_List        *SVG_FeatureList;\r
+typedef GF_List        *SVG_ExtensionList;\r
+typedef GF_List        *SVG_FormatList;\r
+typedef GF_List        *SVG_ListOfIRI;\r
+typedef GF_List        *SVG_LanguageIDs;\r
+typedef GF_List        *SVG_FontList;\r
+typedef GF_List *SVG_TransformList;\r
+typedef GF_List *SVG_Points;\r
+typedef GF_List *SMIL_Times;\r
+typedef GF_List *SMIL_KeyTimes;\r
+typedef GF_List *SMIL_KeyPoints;\r
+/* Fixed between 0 and 1 */\r
+typedef GF_List *SMIL_KeySplines;\r
+\r
+typedef GF_Matrix2D SVG_Motion;\r
+\r
+/* SMIL Anim types */\r
+typedef struct {\r
+       /*field type*/\r
+       u32 type;\r
+       /*field pointer*/\r
+       void *field_ptr;\r
+       /*attribute name for textual parsing*/\r
+       char *name;\r
+       /*attribute tag for live transcoding*/\r
+       u32 tag;\r
+} SMIL_AttributeName;\r
+\r
+enum {\r
+       /*clock time*/\r
+       GF_SMIL_TIME_CLOCK                      = 0,\r
+       /*wallclock time*/\r
+       GF_SMIL_TIME_WALLCLOCK          = 1,\r
+       /*resolved time of an event, discarded when restarting animation.*/\r
+       GF_SMIL_TIME_EVENT_RESOLVED     = 2,\r
+       /*event time*/\r
+       GF_SMIL_TIME_EVENT                      = 3,\r
+       /*indefinite time*/\r
+       GF_SMIL_TIME_INDEFINITE         = 4,\r
+};\r
+\r
+#define GF_SMIL_TIME_IS_CLOCK(v) (v<=GF_SMIL_TIME_EVENT_RESOLVED)\r
+#define GF_SMIL_TIME_IS_SPECIFIED_CLOCK(v) (v<GF_SMIL_TIME_EVENT_RESOLVED)\r
+\r
+typedef struct\r
+{\r
+       u32 type;\r
+       /*for accessKey and mouse button, or repeatCount when the event is a SMIL repeat */\r
+       u32 parameter;\r
+} XMLEV_Event;\r
+\r
+typedef struct {\r
+       /* Type of timing value*/\r
+       u8 type;\r
+       /* in case of syncbase, event, repeat value: this is the pointer to the source of the event */\r
+       GF_Node *element; \r
+       /* id of the element before resolution of the pointer to the element */\r
+       char *element_id; \r
+       /* listener associated with event */\r
+       GF_Node *listener; \r
+\r
+       /* event type and parameter */\r
+       XMLEV_Event event; \r
+       /*set if event is \r
+               begin rather than beginEvent,\r
+               end rather than endEvent,\r
+               repeat rather than repeatEvent */\r
+       Bool is_absolute_event;\r
+       /*clock offset (absolute or relative to event)*/\r
+       Double clock;\r
+\r
+} SMIL_Time;\r
+\r
+enum {\r
+       SMIL_DURATION_AUTO  = 0,\r
+       SMIL_DURATION_INDEFINITE,\r
+       SMIL_DURATION_MEDIA,\r
+       SMIL_DURATION_NONE,\r
+       SMIL_DURATION_DEFINED,\r
+};\r
+typedef struct {\r
+       u8 type;\r
+       Double clock_value;\r
+} SMIL_Duration;\r
+\r
+enum {\r
+       SMIL_RESTART_ALWAYS = 0,\r
+       SMIL_RESTART_NEVER,\r
+       SMIL_RESTART_WHENNOTACTIVE,\r
+};\r
+typedef u8 SMIL_Restart;\r
+\r
+enum {\r
+       SMIL_FILL_FREEZE=0,\r
+       SMIL_FILL_REMOVE,\r
+       \r
+};\r
+typedef u8 SMIL_Fill;\r
+\r
+enum {\r
+       SMIL_REPEATCOUNT_INDEFINITE  = 0,\r
+       SMIL_REPEATCOUNT_DEFINED         = 1,\r
+       /* used only for static allocation of SVG attributes */\r
+       SMIL_REPEATCOUNT_UNSPECIFIED = 2\r
+};\r
+typedef struct {\r
+       u8 type;\r
+       Fixed count;\r
+} SMIL_RepeatCount;\r
+\r
+typedef struct {\r
+       u8 type;\r
+       void *value;\r
+} SMIL_AnimateValue;\r
+\r
+typedef struct {\r
+       u8 type;\r
+       GF_List *values;\r
+} SMIL_AnimateValues;\r
+\r
+enum {\r
+       SMIL_ADDITIVE_REPLACE = 0,\r
+       SMIL_ADDITIVE_SUM\r
+}; \r
+typedef u8 SMIL_Additive;\r
+\r
+enum {\r
+       SMIL_ACCUMULATE_NONE = 0,\r
+       SMIL_ACCUMULATE_SUM\r
+}; \r
+typedef u8 SMIL_Accumulate;\r
+\r
+enum {\r
+       /*WARNING: default value is linear, order changed for LASeR coding*/\r
+       SMIL_CALCMODE_DISCRETE = 0,\r
+       SMIL_CALCMODE_LINEAR,\r
+       SMIL_CALCMODE_PACED,\r
+       SMIL_CALCMODE_SPLINE\r
+};\r
+typedef u8 SMIL_CalcMode;\r
+/* end of SMIL Anim types */\r
+\r
+enum {\r
+       XMLRI_ELEMENTID = 0,\r
+       XMLRI_STRING,\r
+       XMLRI_STREAMID\r
+};\r
+typedef struct __xml_ri {\r
+       u8 type;\r
+       char *string;\r
+       void *target;\r
+       u32 lsr_stream_id;\r
+} XMLRI;\r
+\r
+/*the same structure is used to watch for IDREF changes (LASeR node replace)*/\r
+typedef struct __xml_ri XML_IDREF;\r
+\r
+enum\r
+{\r
+       SVG_FOCUS_AUTO = 0, \r
+       SVG_FOCUS_SELF, \r
+       SVG_FOCUS_IRI, \r
+};\r
+\r
+typedef struct\r
+{\r
+       u8 type;\r
+       XMLRI target;\r
+} SVG_Focus;\r
+\r
+enum {\r
+       SVG_FONTFAMILY_INHERIT = 0,\r
+       SVG_FONTFAMILY_VALUE\r
+};\r
+\r
+typedef struct {\r
+       u8 type;\r
+       SVG_String value;\r
+} SVG_FontFamily;\r
+\r
+enum {\r
+       SVG_FONTSTYLE_INHERIT = 0,\r
+       SVG_FONTSTYLE_ITALIC = 1,  \r
+       SVG_FONTSTYLE_NORMAL = 2,\r
+       SVG_FONTSTYLE_OBLIQUE = 3\r
+}; \r
+typedef u8 SVG_FontStyle;\r
+\r
+/*the values are chosen to match LASeR code points*/\r
+enum {\r
+       SVG_PATHCOMMAND_M = 3,\r
+       SVG_PATHCOMMAND_L = 2,\r
+       SVG_PATHCOMMAND_C = 0,\r
+       SVG_PATHCOMMAND_S = 5,\r
+       SVG_PATHCOMMAND_Q = 4,\r
+       SVG_PATHCOMMAND_T = 6,\r
+       SVG_PATHCOMMAND_A = 20,\r
+       SVG_PATHCOMMAND_Z = 8\r
+};\r
+\r
+#define USE_GF_PATH 1\r
+\r
+#if USE_GF_PATH\r
+typedef GF_Path SVG_PathData;\r
+#else\r
+typedef struct {\r
+       GF_List *commands;\r
+       GF_List *points;\r
+} SVG_PathData;\r
+#endif\r
+\r
+typedef struct {\r
+       Fixed x, y;\r
+} SVG_Point;\r
+\r
+typedef struct {\r
+       Fixed x, y, angle;\r
+} SVG_Point_Angle;\r
+\r
+typedef struct {\r
+       Bool is_set;\r
+       Fixed x, y, width, height;\r
+} SVG_ViewBox;\r
+\r
+typedef Bool SVG_Boolean;\r
+\r
+/*WARNING - THESE ARE PATH FLAGS, CHECK IF WORKING*/\r
+enum {\r
+       SVG_FILLRULE_EVENODD= 0,\r
+       SVG_FILLRULE_NONZERO,\r
+       SVG_FILLRULE_INHERIT\r
+};\r
+typedef u8 SVG_FillRule;\r
+       \r
+enum {\r
+       SVG_STROKELINEJOIN_MITER = GF_LINE_JOIN_MITER_SVG,\r
+       SVG_STROKELINEJOIN_ROUND = GF_LINE_JOIN_ROUND,\r
+       SVG_STROKELINEJOIN_BEVEL = GF_LINE_JOIN_BEVEL,\r
+       SVG_STROKELINEJOIN_INHERIT = 100\r
+};\r
+typedef u8 SVG_StrokeLineJoin;\r
+\r
+/* Warning: GPAC naming is not the same as SVG naming for line cap Flat = butt and Butt = square*/\r
+enum {\r
+       SVG_STROKELINECAP_BUTT = GF_LINE_CAP_FLAT,\r
+       SVG_STROKELINECAP_ROUND = GF_LINE_CAP_ROUND,\r
+       SVG_STROKELINECAP_SQUARE = GF_LINE_CAP_SQUARE,\r
+       SVG_STROKELINECAP_INHERIT = 100\r
+};\r
+typedef u8 SVG_StrokeLineCap;\r
+\r
+enum {\r
+       SVG_OVERFLOW_INHERIT    = 0,\r
+       SVG_OVERFLOW_VISIBLE    = 1,\r
+       SVG_OVERFLOW_HIDDEN             = 2,\r
+       SVG_OVERFLOW_SCROLL             = 3,\r
+       SVG_OVERFLOW_AUTO               = 4\r
+};\r
+typedef u8 SVG_Overflow;\r
+\r
+enum {\r
+       SVG_COLOR_RGBCOLOR = 0,\r
+       SVG_COLOR_INHERIT,\r
+       SVG_COLOR_CURRENTCOLOR,\r
+       SVG_COLOR_ACTIVE_BORDER, /*Active window border*/\r
+       SVG_COLOR_ACTIVE_CAPTION, /*Active window caption. */\r
+       SVG_COLOR_APP_WORKSPACE, /*Background color of multiple document interface. */\r
+       SVG_COLOR_BACKGROUND, /*Desktop background. */\r
+       SVG_COLOR_BUTTON_FACE, /* Face color for three-dimensional display elements. */\r
+       SVG_COLOR_BUTTON_HIGHLIGHT, /* Dark shadow for three-dimensional display elements (for edges facing away from the light source). */\r
+       SVG_COLOR_BUTTON_SHADOW, /* Shadow color for three-dimensional display elements. */\r
+       SVG_COLOR_BUTTON_TEXT, /*Text on push buttons. */\r
+       SVG_COLOR_CAPTION_TEXT, /* Text in caption, size box, and scrollbar arrow box. */\r
+       SVG_COLOR_GRAY_TEXT, /* Disabled ('grayed') text. */\r
+       SVG_COLOR_HIGHLIGHT, /* Item(s) selected in a control. */\r
+       SVG_COLOR_HIGHLIGHT_TEXT, /*Text of item(s) selected in a control. */\r
+       SVG_COLOR_INACTIVE_BORDER, /* Inactive window border. */\r
+       SVG_COLOR_INACTIVE_CAPTION, /* Inactive window caption. */\r
+       SVG_COLOR_INACTIVE_CAPTION_TEXT, /*Color of text in an inactive caption. */\r
+       SVG_COLOR_INFO_BACKGROUND, /* Background color for tooltip controls. */\r
+       SVG_COLOR_INFO_TEXT,  /*Text color for tooltip controls. */\r
+       SVG_COLOR_MENU, /*Menu background. */\r
+       SVG_COLOR_MENU_TEXT, /* Text in menus. */\r
+       SVG_COLOR_SCROLLBAR, /* Scroll bar gray area. */\r
+       SVG_COLOR_3D_DARK_SHADOW, /* Dark shadow for three-dimensional display elements. */\r
+       SVG_COLOR_3D_FACE, /* Face color for three-dimensional display elements. */\r
+       SVG_COLOR_3D_HIGHLIGHT, /* Highlight color for three-dimensional display elements. */\r
+       SVG_COLOR_3D_LIGHT_SHADOW, /* Light color for three-dimensional display elements (for edges facing the light source). */\r
+       SVG_COLOR_3D_SHADOW, /* Dark shadow for three-dimensional display elements. */\r
+       SVG_COLOR_WINDOW, /* Window background. */\r
+       SVG_COLOR_WINDOW_FRAME, /* Window frame. */\r
+       SVG_COLOR_WINDOW_TEXT /* Text in windows.*/\r
+};\r
+\r
+typedef struct {\r
+       u8 type;\r
+       Fixed red, green, blue;\r
+} SVG_Color;\r
+\r
+enum {\r
+       SVG_PAINT_NONE          = 0,\r
+       SVG_PAINT_COLOR         = 1,\r
+       SVG_PAINT_URI           = 2,\r
+       SVG_PAINT_INHERIT       = 3\r
+};\r
+\r
+typedef struct {\r
+       u8 type;\r
+       SVG_Color color;\r
+       XMLRI iri;\r
+} SVG_Paint, SVG_SVGColor;\r
+\r
+enum {\r
+       SVG_NUMBER_VALUE                = 0,\r
+       SVG_NUMBER_PERCENTAGE   = 1,\r
+       SVG_NUMBER_EMS                  = 2,\r
+       SVG_NUMBER_EXS                  = 3,\r
+       SVG_NUMBER_PX                   = 4,\r
+       SVG_NUMBER_CM                   = 5,\r
+       SVG_NUMBER_MM                   = 6,\r
+       SVG_NUMBER_IN                   = 7,\r
+       SVG_NUMBER_PT                   = 8,\r
+       SVG_NUMBER_PC                   = 9,\r
+       SVG_NUMBER_INHERIT              = 10,\r
+       SVG_NUMBER_AUTO                 = 11,\r
+       SVG_NUMBER_AUTO_REVERSE = 12\r
+};\r
+\r
+typedef struct {\r
+       u8 type;\r
+       Fixed value;\r
+} SVG_Number, \r
+  SVG_FontSize, \r
+  SVG_Length, \r
+  SVG_Coordinate, \r
+  SVG_Rotate;\r
+\r
+typedef struct {\r
+       u8 is_ref;\r
+       GF_Matrix2D mat;\r
+} SVG_Transform;\r
+\r
+enum {\r
+       SVG_TRANSFORM_MATRIX    = 0,\r
+       SVG_TRANSFORM_TRANSLATE = 1,\r
+       SVG_TRANSFORM_SCALE             = 2,\r
+       SVG_TRANSFORM_ROTATE    = 3,\r
+       SVG_TRANSFORM_SKEWX             = 4,\r
+       SVG_TRANSFORM_SKEWY             = 5\r
+};\r
+\r
+typedef u8 SVG_TransformType; \r
+\r
+enum {\r
+       SVG_FONTWEIGHT_100 = 0, \r
+       SVG_FONTWEIGHT_200,\r
+       SVG_FONTWEIGHT_300, \r
+       SVG_FONTWEIGHT_400,\r
+       SVG_FONTWEIGHT_500,\r
+       SVG_FONTWEIGHT_600,\r
+       SVG_FONTWEIGHT_700,\r
+       SVG_FONTWEIGHT_800,\r
+       SVG_FONTWEIGHT_900,\r
+       SVG_FONTWEIGHT_BOLD, \r
+       SVG_FONTWEIGHT_BOLDER, \r
+       SVG_FONTWEIGHT_INHERIT,\r
+       SVG_FONTWEIGHT_LIGHTER, \r
+       SVG_FONTWEIGHT_NORMAL\r
+};\r
+typedef u8 SVG_FontWeight;\r
+\r
+enum {\r
+       SVG_FONTVARIANT_INHERIT         = 0,\r
+       SVG_FONTVARIANT_NORMAL          = 1,\r
+       SVG_FONTVARIANT_SMALLCAPS       = 2\r
+};\r
+typedef u8 SVG_FontVariant;\r
+\r
+enum {\r
+       SVG_VISIBILITY_HIDDEN   = 0,\r
+       SVG_VISIBILITY_INHERIT  = 1,\r
+       SVG_VISIBILITY_VISIBLE  = 2,\r
+       SVG_VISIBILITY_COLLAPSE = 3\r
+};\r
+typedef u8 SVG_Visibility;\r
+\r
+enum {\r
+       SVG_DISPLAY_INHERIT = 0,\r
+       SVG_DISPLAY_NONE    = 1,\r
+       SVG_DISPLAY_INLINE  = 2,\r
+       SVG_DISPLAY_BLOCK,\r
+       SVG_DISPLAY_LIST_ITEM,\r
+       SVG_DISPLAY_RUN_IN,\r
+       SVG_DISPLAY_COMPACT,\r
+       SVG_DISPLAY_MARKER,\r
+       SVG_DISPLAY_TABLE,\r
+       SVG_DISPLAY_INLINE_TABLE,\r
+       SVG_DISPLAY_TABLE_ROW_GROUP,\r
+       SVG_DISPLAY_TABLE_HEADER_GROUP,\r
+       SVG_DISPLAY_TABLE_FOOTER_GROUP,\r
+       SVG_DISPLAY_TABLE_ROW,\r
+       SVG_DISPLAY_TABLE_COLUMN_GROUP,\r
+       SVG_DISPLAY_TABLE_COLUMN,\r
+       SVG_DISPLAY_TABLE_CELL,\r
+       SVG_DISPLAY_TABLE_CAPTION\r
+};\r
+typedef u8 SVG_Display;\r
+\r
+enum {\r
+       SVG_DISPLAYALIGN_INHERIT        = 0,\r
+       SVG_DISPLAYALIGN_AUTO           = 1,\r
+       SVG_DISPLAYALIGN_AFTER          = 2,\r
+       SVG_DISPLAYALIGN_BEFORE         = 3,\r
+       SVG_DISPLAYALIGN_CENTER         = 4\r
+};\r
+typedef u8 SVG_DisplayAlign;\r
+\r
+enum {\r
+       SVG_TEXTALIGN_INHERIT   = 0,\r
+       SVG_TEXTALIGN_START             = 1,\r
+       SVG_TEXTALIGN_CENTER    = 2,\r
+       SVG_TEXTALIGN_END               = 3\r
+};\r
+typedef u8 SVG_TextAlign;\r
+\r
+enum {\r
+       SVG_STROKEDASHARRAY_NONE        = 0,\r
+       SVG_STROKEDASHARRAY_INHERIT = 1,\r
+       SVG_STROKEDASHARRAY_ARRAY       = 2\r
+};\r
+\r
+typedef struct {\r
+       u32 count;\r
+       Fixed* vals;\r
+} Array;\r
+\r
+typedef struct {\r
+       u8 type;\r
+       Array array;\r
+} SVG_StrokeDashArray;\r
+\r
+enum {\r
+       SVG_TEXTANCHOR_INHERIT  = 0,\r
+       SVG_TEXTANCHOR_END              = 1,\r
+       SVG_TEXTANCHOR_MIDDLE   = 2,\r
+       SVG_TEXTANCHOR_START    = 3\r
+};\r
+typedef u8 SVG_TextAnchor;\r
+\r
+enum {\r
+       SVG_ANGLETYPE_UNKNOWN           = 0,\r
+       SVG_ANGLETYPE_UNSPECIFIED       = 1,\r
+       SVG_ANGLETYPE_DEG                       = 2,\r
+       SVG_ANGLETYPE_RAD                       = 3,\r
+       SVG_ANGLETYPE_GRAD                      = 4\r
+};\r
+\r
+enum {\r
+       SVG_UNIT_TYPE_UNKNOWN                   = 0,\r
+       SVG_UNIT_TYPE_USERSPACEONUSE    = 1,\r
+       SVG_UNIT_TYPE_OBJECTBOUNDINGBOX = 2\r
+};\r
+\r
+enum {\r
+       // Alignment Types\r
+       SVG_PRESERVEASPECTRATIO_NONE = 1,\r
+       SVG_PRESERVEASPECTRATIO_XMINYMIN = 2,\r
+       SVG_PRESERVEASPECTRATIO_XMIDYMIN = 3,\r
+       SVG_PRESERVEASPECTRATIO_XMAXYMIN = 4,\r
+       SVG_PRESERVEASPECTRATIO_XMINYMID = 5,\r
+       SVG_PRESERVEASPECTRATIO_XMIDYMID = 0, //default\r
+       SVG_PRESERVEASPECTRATIO_XMAXYMID = 6,\r
+       SVG_PRESERVEASPECTRATIO_XMINYMAX = 7,\r
+       SVG_PRESERVEASPECTRATIO_XMIDYMAX = 8,\r
+       SVG_PRESERVEASPECTRATIO_XMAXYMAX = 9\r
+};\r
+\r
+enum {\r
+       // Meet_or_slice Types\r
+       SVG_MEETORSLICE_MEET  = 0,\r
+       SVG_MEETORSLICE_SLICE = 1\r
+};\r
+\r
+typedef struct {\r
+       Bool defer;\r
+       u8 align;\r
+       u8 meetOrSlice;\r
+} SVG_PreserveAspectRatio; \r
+\r
+enum {\r
+       SVG_ZOOMANDPAN_DISABLE = 0,\r
+       SVG_ZOOMANDPAN_MAGNIFY,\r
+};\r
+\r
+typedef u8 SVG_ZoomAndPan;\r
+\r
+enum {\r
+       LENGTHADJUST_UNKNOWN   = 0,\r
+       LENGTHADJUST_SPACING     = 1,\r
+       LENGTHADJUST_SPACINGANDGLYPHS     = 2\r
+};\r
+\r
+enum {\r
+    // textPath Method Types\r
+       TEXTPATH_METHODTYPE_UNKNOWN   = 0,\r
+       TEXTPATH_METHODTYPE_ALIGN     = 1,\r
+       TEXTPATH_METHODTYPE_STRETCH     = 2\r
+};\r
+enum {\r
+    // textPath Spacing Types\r
+       TEXTPATH_SPACINGTYPE_UNKNOWN   = 0,\r
+       TEXTPATH_SPACINGTYPE_AUTO     = 1,\r
+       TEXTPATH_SPACINGTYPE_EXACT     = 2\r
+};\r
+\r
+enum {\r
+    // Marker Unit Types\r
+       SVG_MARKERUNITS_UNKNOWN        = 0,\r
+       SVG_MARKERUNITS_USERSPACEONUSE = 1,\r
+       SVG_MARKERUNITS_STROKEWIDTH    = 2\r
+};\r
+enum {\r
+    // Marker Orientation Types\r
+       SVG_MARKER_ORIENT_UNKNOWN      = 0,\r
+       SVG_MARKER_ORIENT_AUTO         = 1,\r
+       SVG_MARKER_ORIENT_ANGLE        = 2\r
+};\r
+\r
+enum {\r
+    // Spread Method Types\r
+       SVG_SPREADMETHOD_UNKNOWN = 0,\r
+       SVG_SPREADMETHOD_PAD     = 1,\r
+       SVG_SPREADMETHOD_REFLECT = 2,\r
+       SVG_SPREADMETHOD_REPEAT  = 3\r
+};\r
+\r
+enum {\r
+       SVG_POINTEREVENTS_INHERIT                       = 0,\r
+       SVG_POINTEREVENTS_ALL                           = 1,\r
+       SVG_POINTEREVENTS_FILL                          = 2,\r
+       SVG_POINTEREVENTS_NONE                          = 3,\r
+       SVG_POINTEREVENTS_PAINTED                       = 4,\r
+       SVG_POINTEREVENTS_STROKE                        = 5,\r
+       SVG_POINTEREVENTS_VISIBLE                       = 6,\r
+       SVG_POINTEREVENTS_VISIBLEFILL           = 7,\r
+       SVG_POINTEREVENTS_VISIBLEPAINTED        = 8,\r
+       SVG_POINTEREVENTS_VISIBLESTROKE         = 9,\r
+       SVG_POINTEREVENTS_BOUNDINGBOX           = 10\r
+};\r
+typedef u8 SVG_PointerEvents;\r
+\r
+enum {\r
+       SVG_RENDERINGHINT_INHERIT                               = 0,\r
+       SVG_RENDERINGHINT_AUTO                                  = 1,\r
+       SVG_RENDERINGHINT_OPTIMIZEQUALITY               = 2,\r
+       SVG_RENDERINGHINT_OPTIMIZESPEED                 = 3,\r
+       SVG_RENDERINGHINT_OPTIMIZELEGIBILITY    = 4,\r
+       SVG_RENDERINGHINT_CRISPEDGES                    = 5,\r
+       SVG_RENDERINGHINT_GEOMETRICPRECISION    = 6,\r
+\r
+};\r
+typedef u8 SVG_RenderingHint;\r
+\r
+enum {\r
+       SVG_VECTOREFFECT_INHERIT                        = 0,\r
+       SVG_VECTOREFFECT_NONE                           = 1,\r
+       SVG_VECTOREFFECT_NONSCALINGSTROKE       = 2,\r
+};\r
+typedef u8 SVG_VectorEffect;\r
+\r
+enum {\r
+       XMLEVENT_PROPAGATE_CONTINUE = 0,\r
+       XMLEVENT_PROPAGATE_STOP         = 1\r
+};\r
+typedef u8 XMLEV_Propagate;\r
+\r
+enum {\r
+       XMLEVENT_DEFAULTACTION_CANCEL = 0,\r
+       XMLEVENT_DEFAULTACTION_PERFORM,\r
+       \r
+};\r
+typedef u8 XMLEV_DefaultAction;\r
+\r
+enum {\r
+       XMLEVENT_PHASE_DEFAULT  = 0,\r
+       XMLEVENT_PHASE_CAPTURE  = 1\r
+};\r
+typedef u8 XMLEV_Phase;\r
+\r
+enum {\r
+       SMIL_SYNCBEHAVIOR_INHERIT               = 0,\r
+       /*LASeR order*/\r
+       SMIL_SYNCBEHAVIOR_CANSLIP,\r
+       SMIL_SYNCBEHAVIOR_DEFAULT,\r
+       SMIL_SYNCBEHAVIOR_INDEPENDENT,\r
+       SMIL_SYNCBEHAVIOR_LOCKED,\r
+};\r
+typedef u8 SMIL_SyncBehavior;\r
+\r
+enum {\r
+       SMIL_SYNCTOLERANCE_INHERIT              = 0,\r
+       SMIL_SYNCTOLERANCE_DEFAULT              = 1,\r
+       SMIL_SYNCTOLERANCE_VALUE                = 2\r
+};\r
+\r
+typedef struct {\r
+       u8 type;\r
+       SVG_Clock value;\r
+} SMIL_SyncTolerance;\r
+\r
+enum {\r
+       SMIL_ATTRIBUTETYPE_CSS  = 0,\r
+       SMIL_ATTRIBUTETYPE_XML,\r
+       SMIL_ATTRIBUTETYPE_AUTO,\r
+};\r
+typedef u8 SMIL_AttributeType;\r
+\r
+enum {\r
+       SVG_PLAYBACKORDER_ALL                   = 0,\r
+       SVG_PLAYBACKORDER_FORWARDONLY   = 1,\r
+};\r
+typedef u8 SVG_PlaybackOrder;\r
+\r
+enum {\r
+       SVG_TIMELINEBEGIN_ONLOAD=0,\r
+       SVG_TIMELINEBEGIN_ONSTART,\r
+};\r
+typedef u8 SVG_TimelineBegin;\r
+\r
+enum {\r
+       XML_SPACE_DEFAULT               = 0,\r
+       XML_SPACE_PRESERVE              = 1\r
+};\r
+typedef u8 XML_Space;\r
+\r
+\r
+enum {\r
+       SVG_GRADIENTUNITS_OBJECT = 0,\r
+       SVG_GRADIENTUNITS_USER = 1\r
+};\r
+typedef u8 SVG_GradientUnit;\r
+\r
+enum {\r
+       SVG_FOCUSHIGHLIGHT_AUTO = 0,\r
+       SVG_FOCUSHIGHLIGHT_NONE = 1\r
+};\r
+typedef u8 SVG_FocusHighlight;\r
+\r
+enum {\r
+       SVG_INITIALVISIBILTY_WHENSTARTED = 0,\r
+       SVG_INITIALVISIBILTY_ALWAYS              = 1\r
+};\r
+typedef u8 SVG_InitialVisibility;\r
+\r
+enum {\r
+       SVG_TRANSFORMBEHAVIOR_GEOMETRIC = 0,\r
+       SVG_TRANSFORMBEHAVIOR_PINNED,\r
+       SVG_TRANSFORMBEHAVIOR_PINNED180,\r
+       SVG_TRANSFORMBEHAVIOR_PINNED270,\r
+       SVG_TRANSFORMBEHAVIOR_PINNED90,\r
+};\r
+typedef u8 SVG_TransformBehavior;\r
+\r
+enum {\r
+       SVG_OVERLAY_NONE = 0,\r
+       SVG_OVERLAY_TOP,\r
+};\r
+typedef u8 SVG_Overlay;\r
+\r
+enum {\r
+       SVG_FOCUSABLE_AUTO = 0,\r
+       SVG_FOCUSABLE_TRUE,\r
+       SVG_FOCUSABLE_FALSE,\r
+};\r
+typedef u8 SVG_Focusable;\r
+\r
+\r
+enum {\r
+       SVG_SPREAD_PAD = 0,\r
+       SVG_SPREAD_REFLECT,\r
+       SVG_SPREAD_REPEAT,\r
+};\r
+typedef u8 SVG_SpreadMethod;\r
+\r
+enum {\r
+       LASeR_CHOICE_ALL   = 0,\r
+       LASeR_CHOICE_NONE  = 1,\r
+       LASeR_CHOICE_N     = 2\r
+};\r
+typedef u8 LASeR_Choice_enum;\r
+\r
+typedef struct {\r
+       u32 type;\r
+       u32 choice_index;\r
+} LASeR_Choice;\r
+\r
+typedef struct {\r
+       Fixed width, height;\r
+} LASeR_Size;\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /*_GF_SVG_SVG_TYPES_H_*/\r
+\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/sync_layer.h b/tstools/DtsEdit/src/gpac/sync_layer.h
new file mode 100644 (file)
index 0000000..90e8c7c
--- /dev/null
@@ -0,0 +1,125 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / SL header file\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_SYNC_LAYER_H_\r
+#define _GF_SYNC_LAYER_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+       \r
+/*the Sync Layer config descriptor*/\r
+typedef struct\r
+{\r
+       /*base descriptor*/\r
+       u8 tag;\r
+\r
+       u8 predefined;\r
+       u8 useAccessUnitStartFlag;\r
+       u8 useAccessUnitEndFlag;\r
+       u8 useRandomAccessPointFlag;\r
+       u8 hasRandomAccessUnitsOnlyFlag;\r
+       u8 usePaddingFlag;\r
+       u8 useTimestampsFlag;\r
+       u8 useIdleFlag;\r
+       u8 durationFlag;\r
+       u32 timestampResolution;\r
+       u32 OCRResolution;\r
+       u8 timestampLength;\r
+       u8 OCRLength;\r
+       u8 AULength;\r
+       u8 instantBitrateLength;\r
+       u8 degradationPriorityLength;\r
+       u8 AUSeqNumLength;\r
+       u8 packetSeqNumLength;\r
+       u32 timeScale;\r
+       u16 AUDuration;\r
+       u16 CUDuration;\r
+       u64 startDTS;\r
+       u64 startCTS;\r
+} GF_SLConfig;\r
+\r
+/***************************************\r
+                       SLConfig Tag\r
+***************************************/\r
+enum\r
+{\r
+       SLPredef_Null = 0x01,\r
+       SLPredef_MP4 = 0x02,\r
+       /*intern to GPAC, means NO SL at all (for streams unable to handle AU reconstruction a timing)*/\r
+       SLPredef_SkipSL = 0xF0\r
+};\r
+\r
+/*set SL predefined (assign all fields according to sl->predefined value)*/\r
+GF_Err gf_odf_slc_set_pref(GF_SLConfig *sl);\r
+\r
+\r
+typedef struct\r
+{\r
+       u8 accessUnitStartFlag;\r
+       u8 accessUnitEndFlag;\r
+       u8 paddingFlag;\r
+       u8 randomAccessPointFlag;\r
+       u8 OCRflag;\r
+       u8 idleFlag;\r
+       u8 decodingTimeStampFlag;\r
+       u8 compositionTimeStampFlag;\r
+       u8 instantBitrateFlag;\r
+       u8 degradationPriorityFlag;\r
+\r
+       u8 paddingBits;\r
+       u16 packetSequenceNumber;\r
+       u64 objectClockReference;\r
+       u16 AU_sequenceNumber;\r
+       u64 decodingTimeStamp;\r
+       u64 compositionTimeStamp;\r
+       u16 accessUnitLength;\r
+       u32 instantBitrate;\r
+       u16 degradationPriority;\r
+\r
+       /*this is NOT part of standard SL, only used internally: signals duration of access unit if known\r
+       this is usefull for streams with very random updates, to prevent buffering for instance a subtitle stream\r
+       which is likely to have no updates during the first minutes... expressed in media timescale*/\r
+       u32 au_duration;\r
+       /*ISMACryp extensions*/\r
+       u8 isma_encrypted;\r
+       u64 isma_BSO;\r
+} GF_SLHeader;\r
+\r
+\r
+/*packetize SL-PDU. If PDU is NULL or size 0, only writes the SL header*/\r
+void gf_sl_packetize(GF_SLConfig* slConfig, GF_SLHeader *Header, char *PDU, u32 size, char **outPacket, u32 *OutSize);\r
+/*gets SL header size in bytes*/\r
+u32 gf_sl_get_header_size(GF_SLConfig* slConfig, GF_SLHeader *Header);\r
+\r
+/*depacketize SL-PDU*/\r
+void gf_sl_depacketize(GF_SLConfig *slConfig, GF_SLHeader *Header, char *PDU, u32 PDULength, u32 *HeaderLen);\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /*_GF_SYNC_LAYER_H_*/\r
diff --git a/tstools/DtsEdit/src/gpac/term_info.h b/tstools/DtsEdit/src/gpac/term_info.h
new file mode 100644 (file)
index 0000000..144bf4e
--- /dev/null
@@ -0,0 +1,161 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / Stream Management sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+\r
+\r
+#ifndef _GF_TERM_INFO_H_\r
+#define _GF_TERM_INFO_H_\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/*\r
+       OD Browsing API - YOU MUST INCLUDE <gpac/terminal.h> before \r
+       (this has been separated from terminal.h to limit dependency of core to mpeg4_odf.h header)\r
+       ALL ITEMS ARE READ-ONLY AND SHALL NOT BE MODIFIED\r
+*/\r
+#include <gpac/mpeg4_odf.h>\r
+\r
+/*returns top-level OD of the presentation*/\r
+GF_ObjectManager *gf_term_get_root_object(GF_Terminal *term);\r
+/*returns number of sub-ODs in the current root. scene_od must be an inline OD*/\r
+u32 gf_term_get_object_count(GF_Terminal *term, GF_ObjectManager *scene_od);\r
+/*returns indexed (0-based) OD manager in the scene*/\r
+GF_ObjectManager *gf_term_get_object(GF_Terminal *term, GF_ObjectManager *scene_od, u32 index);\r
+/*return values:\r
+       0: regular media object, not inline\r
+       1: root scene\r
+       2: inline scene\r
+       3: externProto library\r
+*/\r
+u32 gf_term_object_subscene_type(GF_Terminal *term, GF_ObjectManager *odm);\r
+\r
+/*select given object when stream selection is available*/\r
+void gf_term_select_object(GF_Terminal *term, GF_ObjectManager *odm);\r
+\r
+typedef struct\r
+{\r
+       GF_ObjectDescriptor *od;\r
+       Double duration;\r
+       Double current_time;\r
+       /*0: stoped, 1: playing, 2: paused, 3: not setup, 4; setup failed.*/\r
+       u32 status;\r
+       /*if set, the PL flags are valid*/\r
+       Bool has_profiles;\r
+       Bool inline_pl;\r
+       u8 OD_pl; \r
+       u8 scene_pl;\r
+       u8 audio_pl;\r
+       u8 visual_pl;\r
+       u8 graphics_pl;\r
+\r
+       /*name of module handling the service service */\r
+       const char *service_handler;\r
+       /*name of service*/\r
+       const char *service_url;\r
+       /*set if the service is owned by this object*/\r
+       Bool owns_service;\r
+\r
+       /*stream buffer:\r
+               -2: stream is not playing\r
+               -1: stream has no buffering\r
+               >=0: amount of media data present in buffer, in ms\r
+       */\r
+       s32 buffer;\r
+       /*number of AUs in DB (cumulated on all input channels)*/\r
+       u32 db_unit_count;\r
+       /*number of CUs in composition memory (if any) and CM capacity*/\r
+       u16 cb_unit_count, cb_max_count;\r
+       /*clock drift in ms of object clock: this is the delay set by the audio renderer to keep AV in sync*/\r
+       s32 clock_drift;\r
+       /*codec name*/\r
+       const char *codec_name;\r
+       /*object type - match streamType (cf constants.h)*/\r
+       u32 od_type;\r
+       /*audio properties*/\r
+       u32 sample_rate, bits_per_sample, num_channels;\r
+       /*video properties (w & h also used for scene codecs)*/\r
+       u32 width, height, pixelFormat, par;\r
+\r
+       /*average birate over last second and max bitrate over one second at decoder input - expressed in bits per sec*/\r
+       u32 avg_bitrate, max_bitrate;\r
+       u32 total_dec_time, max_dec_time, nb_dec_frames, nb_droped;\r
+\r
+       /*set if ISMACryp present on the object - will need refinement for IPMPX...\r
+       0: not protected - 1: protected and OK - 2: protected and DRM failed*/\r
+       u32 protection;\r
+\r
+       u32 lang;\r
+\r
+       /*name of media if not defined in OD framework*/\r
+       const char *media_url;\r
+} GF_MediaInfo;\r
+\r
+/*fills the GF_MediaInfo structure describing the OD manager*/\r
+GF_Err gf_term_get_object_info(GF_Terminal *term, GF_ObjectManager *odm, GF_MediaInfo *info);\r
+/*gets current downloads info for the service - only use if ODM owns thesrevice, returns 0 otherwise.\r
+       @d_enum: in/out current enum - shall start to 0, incremented at each call. fct returns 0 if no more \r
+       downloads\r
+       @server: server name\r
+       @path: file/data location on server\r
+       @bytes_done, @total_bytes: file info. total_bytes may be 0 (eg http streaming)\r
+       @bytes_per_sec: guess what\r
+*/\r
+Bool gf_term_get_download_info(GF_Terminal *term, GF_ObjectManager *odm, u32 *d_enum, const char **server, const char **path, u32 *bytes_done, u32 *total_bytes, u32 *bytes_per_sec);\r
+\r
+/*same principles as above , struct __netcom is defined in service.h*/\r
+typedef struct __netstatcom NetStatCommand;\r
+Bool gf_term_get_channel_net_info(GF_Terminal *term, GF_ObjectManager *odm, u32 *d_enum, u32 *chid, NetStatCommand *netcom, GF_Err *ret_code);\r
+\r
+/*same principles as above , struct __netinfo is defined in service.h*/\r
+typedef struct __netinfocom NetInfoCommand;\r
+GF_Err gf_term_get_service_info(GF_Terminal *term, GF_ObjectManager *odm, NetInfoCommand *netcom);\r
+\r
+/*retrieves world info of the scene @od belongs to. \r
+If @odm is or points to an inlined OD the world info of the inlined content is retrieved\r
+If @odm is NULL the world info of the main scene is retrieved\r
+returns NULL if no WorldInfo available\r
+returns world title if available \r
+@descriptions: any textual descriptions is stored here\r
+  strings are not allocated\r
+*/\r
+const char *gf_term_get_world_info(GF_Terminal *term, GF_ObjectManager *scene_od, GF_List *descriptions);\r
+\r
+/*dumps scene graph in specified file, in BT or XMT format\r
+@rad_name: file radical (NULL for stdout) - if not NULL MUST BE GF_MAX_PATH length\r
+if @skip_proto is set proto declarations are not dumped\r
+If @odm is or points to an inlined OD the inlined scene is dumped\r
+If @odm is NULL the main scene is dumped\r
+*/\r
+GF_Err gf_term_dump_scene(GF_Terminal *term, char *rad_name, Bool xml_dump, Bool skip_proto, GF_ObjectManager *odm);\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif /*_GF_TERM_INFO_H_*/\r
diff --git a/tstools/DtsEdit/src/gpac/terminal.h b/tstools/DtsEdit/src/gpac/terminal.h
new file mode 100644 (file)
index 0000000..0d95ff2
--- /dev/null
@@ -0,0 +1,183 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / Stream Management sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_TERMINAL_H_\r
+#define _GF_TERMINAL_H_\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/user.h>\r
+\r
+/*creates a new terminal for a userApp callback*/\r
+GF_Terminal *gf_term_new(GF_User *user);\r
+\r
+/*delete the app - stop is done automatically, you don't have to do it before deleting the app\r
+returns GF_IO_ERR if client couldn't be shutdown normally*/\r
+GF_Err gf_term_del(GF_Terminal *term);\r
+\r
+/*connects to a URL*/\r
+void gf_term_connect(GF_Terminal *term, const char *URL);\r
+/*disconnects the url*/\r
+void gf_term_disconnect(GF_Terminal *term);\r
+/*navigates to a given destination or shutdown/restart the current one if any.\r
+This is the only safe way of restarting/jumping a presentation from inside the EventProc \r
+where doing a disconnect/connect could deadlock if toURL is NULL, uses the current URL*/\r
+void gf_term_navigate_to(GF_Terminal *term, const char *toURL);\r
+/*restarts url from given time (in ms). Return value: \r
+       0: service is not connected yet\r
+       1: service has no seeking capabilities\r
+       2: service has been seeked\r
+*/\r
+u32 gf_term_play_from_time(GF_Terminal *term, u64 from_time, Bool pause_at_first_frame);\r
+/*connect URL and seek right away - only needed when reloading the complete player (avoids waiting\r
+for connection and post a seek..)*/\r
+void gf_term_connect_from_time(GF_Terminal *term, const char *URL, u64 time_in_ms, Bool pause_at_first_frame);\r
+\r
+/*same as gf_term_connect but specifies a parent path*/\r
+void gf_term_connect_with_path(GF_Terminal *term, const char *URL, const char *parent_URL);\r
+\r
+/*returns current framerate\r
+       if @absoluteFPS is set, the return value is the absolute framerate, eg NbFrameCount/NbTimeSpent regardless of\r
+whether a frame has been drawn or not, which means the FPS returned can be much greater than the target rendering \r
+framerate\r
+       if @absoluteFPS is not set, the return value is the FPS taking into account not drawn frames (eg, less than \r
+       or equal to compositor FPS)\r
+*/\r
+Double gf_term_get_framerate(GF_Terminal *term, Bool absoluteFPS);\r
+/*get main scene current time in milliseconds*/\r
+u32 gf_term_get_time_in_ms(GF_Terminal *term);\r
+\r
+/*returns current URL address*/\r
+const char *gf_term_get_url(GF_Terminal *term);\r
+\r
+/*get viewpoints/viewports for main scene - idx is 1-based, and if greater than number of viewpoints return GF_EOS*/\r
+GF_Err gf_term_get_viewpoint(GF_Terminal *term, u32 viewpoint_idx, const char **outName, Bool *is_bound);\r
+/*set active viewpoints/viewports for main scene given its name - idx is 1-based, or 0 to set by viewpoint name\r
+if only one viewpoint is present in the scene, this will bind/unbind it*/\r
+GF_Err gf_term_set_viewpoint(GF_Terminal *term, u32 viewpoint_idx, const char *viewpoint_name);\r
+\r
+/*adds an object to the scene - only possible if scene has selectable streams (cf GF_OPT_CAN_SELECT_STREAMS option)*/\r
+GF_Err gf_term_add_object(GF_Terminal *term, const char *url, Bool auto_play);\r
+\r
+\r
+/*set/set option - most of the terminal cfg is done through options, please refer to user.h for details*/\r
+GF_Err gf_term_set_option(GF_Terminal *term, u32 opt_type, u32 opt_value);\r
+u32 gf_term_get_option(GF_Terminal *term, u32 opt_type);\r
+\r
+/*checks if given URL is understood by client.\r
+if use_parent_url is set, relative URLs are solved against the current presentation URL*/\r
+Bool gf_term_is_supported_url(GF_Terminal *term, const char *fileName, Bool use_parent_url, Bool no_mime_check);\r
+\r
+/*sets simulation frame rate*/\r
+GF_Err gf_term_set_simulation_frame_rate(GF_Terminal * term, Double frame_rate);\r
+/*gets simulation frame rate*/\r
+Double gf_term_get_simulation_frame_rate(GF_Terminal *term);\r
+\r
+/*sends a set of scene commands (BT, XMT, X3D, LASeR+XML) to the scene\r
+type indicates the language used - accepted values are \r
+       "model/x3d+xml" or "x3d": commands is an X3D+XML scene\r
+       "model/x3d+vrml" or  "xrdv": commands is an X3D+VRML scene\r
+       "model/vrml" or "vrml": commands is an VRML scene\r
+       "application/x-xmt" or "xmt": commands is an XMT-A scene or a list of XMT-A updates\r
+       "application/x-bt" or "bt": commands is a BT scene or a list of BT updates\r
+       "image/svg+xml" or "svg": commands is an SVG scene\r
+       "application/x-laser+xml" or "laser": commands is an SVG/LASeR+XML  scene or a list of LASeR+XML updates\r
+       if not specified, the type will be guessed from the current root node if any\r
+*/\r
+GF_Err gf_term_scene_update(GF_Terminal *term, char *type, char *com);\r
+\r
+\r
+/*request visual output size change:\r
+       * NOT NEEDED WHEN THE TERMINAL IS HANDLING THE DISPLAY WINDOW (cf user.h)\r
+       * if the user app manages the output window it shall resize it before calling this\r
+*/\r
+GF_Err gf_term_set_size(GF_Terminal *term, u32 NewWidth, u32 NewHeight);\r
+\r
+/*returns current text selection if any, or NULL otherwise. If probe mode is set, returns a non-NULL string ("") \r
+if some text is selected*/\r
+const char *gf_term_get_text_selection(GF_Terminal *term, Bool probe_only);\r
+/*pastes text into current selection if any. If probe mode is set, only check if text is currently edited\r
+if some text is selected*/\r
+GF_Err gf_term_paste_text(GF_Terminal *term, const char *txt, Bool probe_only);\r
+\r
+\r
+/*decodes pending media and render frame. \r
+NOTE: This can only be used when the terminal runs without visual thread (GF_TERM_NO_VISUAL_THREAD flag set)\r
+*/\r
+GF_Err gf_term_process_step(GF_Terminal *term);\r
+\r
+/*decodes all pending media and render frame until no scene changes are detected.\r
+NOTE: This can only be used when the terminal runs without visual thread (GF_TERM_NO_VISUAL_THREAD flag set)\r
+*/\r
+GF_Err gf_term_process_flush(GF_Terminal *term);\r
+\r
+/*post user interaction to terminal*/\r
+/*NOT NEEDED WHEN THE TERMINAL IS HANDLING THE DISPLAY WINDOW (cf user.h)*/\r
+Bool gf_term_user_event(GF_Terminal *term, GF_Event *event);\r
+\r
+/*post extended user mouse interaction to terminal \r
+       X and Y are point coordinates in the display expressed in 2D coord system top-left (0,0), Y increasing towards bottom\r
+       @xxx_but_down: specifiy whether the mouse button is down(2) or up (1), 0 if unchanged\r
+       @wheel: specifiy current wheel inc (0: unchanged , +1 for one wheel delta forward, -1 for one wheel delta backward)\r
+*/\r
+/*NOT NEEDED WHEN THE TERMINAL IS HANDLING THE DISPLAY WINDOW (cf user.h)*/\r
+void gf_term_mouse_input(GF_Terminal *term, GF_EventMouse *event);\r
+\r
+/*post extended user key interaction to terminal \r
+       @key_code: GPAC DOM code of input key\r
+       @hw_code: hardware code of input key\r
+       @isKeyUp: set if key is released\r
+*/\r
+/*NOT NEEDED WHEN THE TERMINAL IS HANDLING THE DISPLAY WINDOW (cf user.h)*/\r
+void gf_term_keyboard_input(GF_Terminal *term, u32 key_code, u32 hw_code, Bool isKeyUp);\r
+\r
+/*post extended user character interaction to terminal \r
+       @character: unicode character input\r
+*/\r
+/*NOT NEEDED WHEN THE TERMINAL IS HANDLING THE DISPLAY WINDOW (cf user.h)*/\r
+void gf_term_string_input(GF_Terminal *term, u32 character);\r
+\r
+\r
+\r
+/*framebuffer access*/\r
+#include <gpac/color.h>\r
+\r
+/*gets screen buffer - this locks the scene graph too until released is called*/\r
+GF_Err gf_term_get_screen_buffer(GF_Terminal *term, GF_VideoSurface *framebuffer);\r
+/*releases screen buffer and unlocks graph*/\r
+GF_Err gf_term_release_screen_buffer(GF_Terminal *term, GF_VideoSurface *framebuffer);\r
+\r
+\r
+/*ObjectManager used by both terminal and object browser (term_info.h)*/\r
+typedef struct _od_manager GF_ObjectManager;\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif /*_GF_TERMINAL_H_*/\r
diff --git a/tstools/DtsEdit/src/gpac/thread.h b/tstools/DtsEdit/src/gpac/thread.h
new file mode 100644 (file)
index 0000000..ee3a1b6
--- /dev/null
@@ -0,0 +1,271 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / common tools sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_THREAD_H_\r
+#define _GF_THREAD_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/*!\r
+ *     \file <gpac/thread.h>\r
+ *     \brief threading functions.\r
+ */\r
+\r
+ /*!\r
+ *     \addtogroup thr_grp threading\r
+ *     \ingroup utils_grp\r
+ *     \brief Threading and Mutual Exclusion Functions\r
+ *\r
+ *This section documents the threading of the GPAC framework. These provide an easy way to implement\r
+ *safe multithreaded tools.\r
+ *     @{\r
+ */\r
+\r
+#include <gpac/tools.h>\r
+\r
+/*!\r
+ *\brief Thread states\r
+ *\r
+ *Inidcates the execution status of a thread\r
+ */\r
+enum\r
+{\r
+       /*! the thread has been initialized but is not started yet*/\r
+       GF_THREAD_STATUS_STOP = 0,\r
+       /*! the thread is running*/\r
+       GF_THREAD_STATUS_RUN = 1,\r
+       /*! the thread has exited its body function*/\r
+       GF_THREAD_STATUS_DEAD = 2\r
+};\r
+\r
+/*!\r
+ *\brief abstracted thread object\r
+ *\r
+ *The abstracted thread object allows you to execute some code independently of the main process of your application.\r
+*/\r
+typedef struct __tag_thread GF_Thread;\r
+\r
+/*!\r
+ *\brief thread constructor\r
+ *\r
+ *Constructs a new thread object\r
+ *\param log name of the thread if any\r
+ */\r
+GF_Thread *gf_th_new(const char *name);\r
+/*!\r
+ *\brief thread destructor\r
+ *\r
+ * Kills the thread if running and destroys the object\r
+ *\param th the thread object\r
+ */\r
+void gf_th_del(GF_Thread *th);\r
+\r
+/*!\r
+ *     \brief thread run function callback\r
+ *\r
+ *The gf_thread_run type is the type for the callback of the \ref gf_thread_run function\r
+ *\param par opaque user data\r
+ *\return exit code of the thread, usually 1 for error and 0 if normal execution\r
+ *\r
+ */\r
+typedef u32 (*gf_thread_run)(void *par);\r
+\r
+/*!\r
+ *\brief thread execution\r
+ *\r
+ *Executes the thread with the given function\r
+ *\param th the thread object\r
+ *\param run the function this thread will call\r
+ *\param par the argument to the function the thread will call\r
+ *\note A thread may be run several times but cannot be run twice in the same time.\r
+ */\r
+GF_Err gf_th_run(GF_Thread *th, gf_thread_run run, void *par);\r
+/*!\r
+ *\brief thread stoping\r
+ *\r
+ *Waits for the thread exit until return\r
+ *\param th the thread object\r
+ */\r
+void gf_th_stop(GF_Thread *th);\r
+/*!\r
+ *\brief thread status query\r
+ *\r
+ *Gets the thread status\r
+ *\param th the thread object\r
+ */\r
+u32 gf_th_status(GF_Thread *th);\r
+\r
+/*!\r
+ * thread priorities\r
+ */\r
+enum\r
+{\r
+       /*!Idle Priority*/\r
+       GF_THREAD_PRIORITY_IDLE=0,\r
+       /*!Less Idle Priority*/\r
+       GF_THREAD_PRIORITY_LESS_IDLE,\r
+       /*!Lowest Priority*/\r
+       GF_THREAD_PRIORITY_LOWEST,\r
+       /*!Low Priority*/\r
+       GF_THREAD_PRIORITY_LOW,\r
+       /*!Normal Priority (the default one)*/\r
+       GF_THREAD_PRIORITY_NORMAL,\r
+       /*!High Priority*/\r
+       GF_THREAD_PRIORITY_HIGH,\r
+       /*!Highest Priority*/\r
+       GF_THREAD_PRIORITY_HIGHEST,\r
+       /*!First real-time priority*/\r
+       GF_THREAD_PRIORITY_REALTIME,\r
+       /*!Last real-time priority*/\r
+       GF_THREAD_PRIORITY_REALTIME_END=255\r
+};\r
+\r
+/*!\r
+ *\brief thread priority\r
+ *\r
+ *Sets the thread execution priority level.\r
+ *\param th the thread object\r
+ *\param priority the desired priority\r
+ *\note this should be used with caution, especially use of real-time priorities.\r
+ */\r
+void gf_th_set_priority(GF_Thread *th, s32 priority);\r
+/*!\r
+ *\brief current thread ID \r
+ *\r
+ *Gets the ID of the current thread the caller is in.\r
+*/\r
+u32 gf_th_id();\r
+\r
+\r
+\r
+/*!\r
+ *\brief abstracted mutex object\r
+ *\r
+ *The abstracted mutex object allows you to make sure that portions of the code (typically access to variables) cannot be executed\r
+ *by two threads (or a thread and the main process) at the same time.\r
+*/\r
+typedef struct __tag_mutex GF_Mutex;\r
+/*\r
+ *\brief mutex constructor\r
+ *\r
+ *Contructs a new mutex object\r
+ *\param log name of the thread if any\r
+*/\r
+GF_Mutex *gf_mx_new(const char *name);\r
+/*\r
+ *\brief mutex denstructor\r
+ *\r
+ *Destroys a mutex object. This will wait for the mutex to be released if needed.\r
+ *\param mx the mutex object\r
+*/\r
+void gf_mx_del(GF_Mutex *mx);\r
+/*\r
+ *\brief mutex locking\r
+ *\r
+ *Locks the mutex object, making sure that another thread locking this mutex cannot exectute until the mutex is unlocked.\r
+ *\param mx the mutex object\r
+ *\return 1 if success, 0 if error locking the mutex (which should never happen)\r
+*/\r
+u32 gf_mx_p(GF_Mutex *mx);\r
+/*\r
+ *\brief mutex unlocking\r
+ *\r
+ *Unlocks the mutex object, allowing other threads waiting on this mutex to continue their execution\r
+ *\param mx the mutex object\r
+*/\r
+void gf_mx_v(GF_Mutex *mx);\r
+/*\r
+ *\brief mutex non-blocking lock\r
+ *\r
+ *Attemps to lock the mutex object without blocking until the object is released.\r
+ *\param mx the mutex object\r
+ *\return 1 if the mutex has been successfully locked, in which case it shall then be unlocked, or 0 if the mutex is locked by another thread.\r
+*/\r
+Bool gf_mx_try_lock(GF_Mutex *mx);\r
+\r
+\r
+/*********************************************************************\r
+                                       Semaphore Object\r
+**********************************************************************/\r
+/*!\r
+ *\brief abstracted semaphore object\r
+ *\r
+ *The abstracted semaphore object allows you to control how portions of the code (typically access to variables) are executed\r
+ *by two threads (or a thread and the main process) at the same time. The best image for a semaphore is a limited set \r
+ *of money coins (always easy to understand hmm?). If no money is in the set, nobody can buy anything until a coin is \r
+ *put back in the set. When the set is full, the money is wasted (call it "the bank"...).\r
+*/\r
+typedef struct __tag_semaphore GF_Semaphore;\r
+/*\r
+ *\brief semaphore constructor\r
+ *\r
+ *Constructs a new semaphore object\r
+ *\param MaxCount the maximum notification count of this semaphore\r
+ *\param InitCount the initial notification count of this semaphore upon construction\r
+ *\return the semaphore object\r
+ */\r
+GF_Semaphore *gf_sema_new(u32 MaxCount, u32 InitCount);\r
+/*\r
+ *\brief semaphore destructor\r
+ *\r
+ *Destructs the semaphore object. This will wait for the semaphore to be released if needed.\r
+ */\r
+void gf_sema_del(GF_Semaphore *sm);\r
+/*\r
+ *\brief semaphore notifivation\r
+ *\r
+ *Notifies the semaphore of a certain amount of releases.\r
+ *\param sm the semaphore object\r
+ *\param nb_rel sm the number of release to notify\r
+ *\return the number of previous notification count in the semaphore \r
+*/\r
+u32 gf_sema_notify(GF_Semaphore *sm, u32 nb_rel);\r
+/*\r
+ *\brief semaphore wait\r
+ *\r
+ *Waits for the semaphore to be accessible (eg, may wait an infinite time).\r
+ *\param sm the semaphore object\r
+*/\r
+void gf_sema_wait(GF_Semaphore *sm);\r
+/*\r
+ *\brief semaphore time wait\r
+ *\r
+ *Waits for a certain for the semaphore to be accessible, and returns when semaphore is accessible or wait time has passed.\r
+ *\param sm the semaphore object\r
+ *\param time_out the amount of time to wait for the release in milliseconds\r
+ *\return returns 1 if the semaphore was released before the timeout, 0 if the semaphore is still not released after the timeout.\r
+*/\r
+Bool gf_sema_wait_for(GF_Semaphore *sm, u32 time_out);\r
+\r
+/*! @} */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif         /*_GF_THREAD_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/token.h b/tstools/DtsEdit/src/gpac/token.h
new file mode 100644 (file)
index 0000000..0d5ecde
--- /dev/null
@@ -0,0 +1,106 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / common tools sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_TOKEN_H_\r
+#define _GF_TOKEN_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/*!\r
+ *     \file <gpac/token.h>\r
+ *     \brief tokenizer functions.\r
+ */\r
+\r
+ /*!\r
+ *     \addtogroup tok_grp tokenizer\r
+ *     \ingroup utils_grp\r
+ *     \brief String Tokenizer Functions\r
+ *\r
+ *This section documents the basic string tokenizer of the GPAC framework.\r
+ *     @{\r
+ */\r
+\r
+#include <gpac/tools.h>\r
+\r
+/*!\r
+ *\brief get string component \r
+ *\r
+ *Gets the next string component comprised in a given set of characters\r
+ *\param buffer source string to scan\r
+ *\param start char offset from begining of buffer where tokenization shall start\r
+ *\param separators separator characters to use\r
+ *\param token output buffer location\r
+ *\param token_size output buffer allocated size\r
+ *\return position of the first char in the buffer after the last terminating separator, or -1 if token could not be found\r
+ */\r
+s32 gf_token_get(char *buffer, s32 start, char *separators, char *token, s32 token_size);\r
+/*!\r
+ *\brief get string component without delimitting characters\r
+ *\r
+ *Gets the next string component comprised in a given set of characters, removing surrounding characters\r
+ *\param buffer source string to scan\r
+ *\param start char offset from begining of buffer where tokenization shall start\r
+ *\param separators separator characters to use\r
+ *\param strip_set surrounding characters to remove\r
+ *\param token output buffer location\r
+ *\param token_size output buffer allocated size\r
+ *\return position of the first char in the buffer after the last terminating separator, or -1 if token could not be found\r
+ */\r
+s32 gf_token_get_strip(char *buffer, s32 start, char *separators, char *strip_set, char *token, s32 token_size);\r
+/*!\r
+ *\brief line removal\r
+ *\r
+ *Gets one line from buffer and remove delimiters CR, LF and CRLF\r
+ *\param buffer source string to scan\r
+ *\param start char offset from begining of buffer where tokenization shall start\r
+ *\param size size of the input buffer to analyze\r
+ *\param line_buffer output buffer location\r
+ *\param line_buffer_size output buffer allocated size\r
+ *\return position of the first char in the buffer after the last line delimiter, or -1 if no line could be found\r
+ */\r
+s32 gf_token_get_line(char     *buffer, u32 start, u32 size, char *line_buffer, u32 line_buffer_size);\r
+/*!\r
+ *\brief pattern location\r
+ *\r
+ *Locates a pattern in the buffer\r
+ *\param buffer source string to scan\r
+ *\param start char offset from begining of buffer where tokenization shall start\r
+ *\param size size of the input buffer to analyze\r
+ *\param pattern pattern to locate\r
+ *\return position of the first char in the buffer after the pattern, or -1 if pattern could not be found\r
+ */\r
+s32 gf_token_find(char *buffer, u32 start, u32 size, char *pattern);\r
+\r
+\r
+/*! @} */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif         /*_GF_TOKEN_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/tools.h b/tstools/DtsEdit/src/gpac/tools.h
new file mode 100644 (file)
index 0000000..99714fb
--- /dev/null
@@ -0,0 +1,655 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / common tools sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_TOOLS_H_\r
+#define _GF_TOOLS_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/setup.h>\r
+\r
+\r
+/*! \file "gpac/tools.h"\r
+ *     \brief Base definitions and functions of GPAC.\r
+ *\r
+ * This file contains basic functions and core definitions of the GPAC framework. This file is\r
+ * usually included by all GPAC header files since it contains the error definitions.\r
+*/\r
+\r
+/*! \defgroup utils_grp utils\r
+ *     You will find in this module the documentation of all tools used in GPAC.\r
+*/\r
+\r
+/*! \addtogroup tools_grp base utils\r
+ *     \ingroup utils_grp\r
+ *     \brief Base definitions and functions of GPAC.\r
+ *\r
+ *     This section documents some very basic functions and core definitions of the GPAC framework.\r
+ *     @{\r
+ */\r
+\r
+/*!\r
+ *     \brief GPAC Version\r
+ *     \hideinitializer\r
+ *\r
+ *     Macro giving GPAC version expressed as a printable string\r
+*/\r
+/*KEEP SPACE SEPARATORS FOR MAKE / GREP (SEE MAIN MAKEFILE)!!!, and NO SPACE in GPAC_VERSION for proper install*/\r
+#define GPAC_VERSION       "0.4.6-DEV"\r
+\r
+#define GPAC_BUILD_NUMBER      "1"\r
+#define GPAC_FULL_VERSION       GPAC_VERSION" (build "GPAC_BUILD_NUMBER")"\r
+\r
+/*!\r
+ *     \brief GPAC Version\r
+ *     \hideinitializer\r
+ *\r
+ *     Macro giving GPAC version expressed as an integer, where version X.Y.Z is coded as 0x00XXYYZZ\r
+*/\r
+#define GPAC_VERSION_INT       0x00000406\r
+\r
+/*!\r
+ *     \brief Memory allocation\r
+ *     \hideinitializer\r
+ *\r
+ *     Macro allocating memory and zero-ing it\r
+*/\r
+#define GF_SAFEALLOC(__ptr, __struct) { __ptr = (__struct *) malloc(sizeof(__struct)); if (__ptr) memset((void *) __ptr, 0, sizeof(__struct)); }\r
+\r
+/*!\r
+ *     \brief 4CC Formatting\r
+ *     \hideinitializer\r
+ *\r
+ *     Macro formating a 4-character code (or 4CC) "abcd" as 0xAABBCCDD\r
+*/\r
+#define GF_4CC(a,b,c,d) (((a)<<24)|((b)<<16)|((c)<<8)|(d))\r
+/*!\r
+ *     \brief 4CC Printing\r
+ *\r
+ *     returns a 4CC printable form\r
+*/\r
+const char *gf_4cc_to_str(u32 type);\r
+\r
+/*!\r
+ *     \brief large file opening\r
+ *\r
+ *     Opens a large file (>4GB)\r
+ *     \param file_name Same semantics as fopen\r
+ *     \param mode Same semantics as fopen\r
+ *     \return stream handle of the file object\r
+ *     \note You only need to call this function if you're suspecting the file to be a large one (usually only media files), otherwise use regular stdio.\r
+*/\r
+FILE *gf_f64_open(const char *file_name, const char *mode);\r
+/*!\r
+ *     \brief large file position query\r
+ *\r
+ *     Queries the current read/write position in a large file\r
+ *     \param f Same semantics as ftell\r
+ *     \return position in the file\r
+ *     \note You only need to call this function if you're suspecting the file to be a large one (usually only media files), otherwise use regular stdio.\r
+*/\r
+u64 gf_f64_tell(FILE *f);\r
+/*!\r
+ *     \brief large file seeking\r
+ *\r
+ *     Seeks the current read/write position in a large file\r
+ *     \param f Same semantics as fseek\r
+ *     \param pos Same semantics as fseek\r
+ *     \param whence Same semantics as fseek\r
+ *     \return new position in the file\r
+ *     \note You only need to call this function if you're suspecting the file to be a large one (usually only media files), otherwise use regular stdio.\r
+*/\r
+u64 gf_f64_seek(FILE *f, s64 pos, s32 whence);\r
+\r
+/*! @} */\r
+\r
+\r
+/*! \addtogroup errors_grp error codes\r
+ *     \ingroup utils_grp\r
+ *     \brief Errors used in GPAC.\r
+ *\r
+ *     This section documents all error codes used in the GPAC framework. Most of the GPAC's functions will use these as \r
+ * return values, and some of these errors are also used for state communication with the different modules of the framework.\r
+ *     @{\r
+ */\r
+\r
+/*!\r
+ * GPAC Error\r
+ *     \hideinitializer\r
+ *\r
+ *     positive values are warning and info, 0 means no error and negative values are errors\r
+ */\r
+typedef enum\r
+{\r
+       /*!Message from any scripting engine used in the presentation (ECMAScript, MPEG-J, ...) (Info).*/\r
+       GF_SCRIPT_INFO                                          = 3,\r
+       /*!Indicates an data frame has several AU packed (not MPEG-4 compliant). This is used by decoders to force \r
+       multiple decoding of the same data frame (Info).*/\r
+       GF_PACKED_FRAMES                                        = 2,\r
+       /*!Indicates the end of a stream or of a file (Info).*/\r
+       GF_EOS                                                          = 1,\r
+       /*!\r
+       \n\n\r
+       */\r
+       /*!Operation success (no error).*/\r
+       GF_OK                                                           = 0,\r
+       /*!\n*/\r
+       /*!One of the input parameter is not correct or cannot be used in the current operating mode of the framework.*/\r
+       GF_BAD_PARAM                                                    = -1,\r
+       /*! Memory allocation failure.*/\r
+       GF_OUT_OF_MEM                                                   = -2,\r
+       /*! Input/Output failure (disk access, system call failures)*/\r
+       GF_IO_ERR                                                               = -3,\r
+       /*! The desired feature or operation is not supported by the framework*/\r
+       GF_NOT_SUPPORTED                                                = -4,\r
+       /*! Input data has been corrupted*/\r
+       GF_CORRUPTED_DATA                                               = -5,\r
+       /*! A modification was attempted on a scene node which could not be found*/\r
+       GF_SG_UNKNOWN_NODE                                              = -6,\r
+       /*! The PROTO node interface does not match the nodes using it*/\r
+       GF_SG_INVALID_PROTO                                             = -7,\r
+       /*! An error occured in the scripting engine*/\r
+       GF_SCRIPT_ERROR                                                 = -8,\r
+       /*! Buffer is too small to contain decoded data. Decoders shall use this error whenever they need to resize their output memory buffers*/\r
+       GF_BUFFER_TOO_SMALL                                             = -9,\r
+       /*! Bitstream is not compliant to the specfication it refers to*/\r
+       GF_NON_COMPLIANT_BITSTREAM                              = -10,\r
+       /*! No decoders could be found to handle the desired media type*/\r
+       GF_CODEC_NOT_FOUND                                              = -11,\r
+       /*! The URL is not properly formatted or cannot be found*/\r
+       GF_URL_ERROR                                                    = -12,\r
+       /*! An service error has occured at the local side*/\r
+       GF_SERVICE_ERROR                                                = -13,\r
+       /*! A service error has occured at the remote (server) side*/\r
+       GF_REMOTE_SERVICE_ERROR                                 = -14,\r
+       /*! The desired stream could not be found in the service*/\r
+       GF_STREAM_NOT_FOUND                                             = -15,\r
+       /*! The IsoMedia file is not a valid one*/\r
+       GF_ISOM_INVALID_FILE                                    = -20,\r
+       /*! The IsoMedia file is not complete. Either the file is being downloaded, or it has been truncated*/\r
+       GF_ISOM_INCOMPLETE_FILE                                 = -21,\r
+       /*! The media in this IsoMedia track is not valid (usually due to a broken stream description)*/\r
+       GF_ISOM_INVALID_MEDIA                                   = -22,\r
+       /*! The requested operation cannot happen in the current opening mode of the IsoMedia file*/\r
+       GF_ISOM_INVALID_MODE                                    = -23,\r
+       /*! This IsoMedia track refers to media outside the file in an unknown way*/\r
+       GF_ISOM_UNKNOWN_DATA_REF                                = -24,\r
+\r
+       /*! An invalid MPEG-4 Object Descriptor was found*/\r
+       GF_ODF_INVALID_DESCRIPTOR                               = -30,\r
+       /*! An MPEG-4 Object Descriptor was found or added to a forbidden descriptor*/\r
+       GF_ODF_FORBIDDEN_DESCRIPTOR                             = -31,\r
+       /*! An invalid MPEG-4 BIFS command was detected*/\r
+       GF_ODF_INVALID_COMMAND                                  = -32,\r
+       /*! The scene has been encoded using an unknown BIFS version*/\r
+       GF_BIFS_UNKNOWN_VERSION                                 = -33,\r
+\r
+       /*! The remote IP address could not be solved*/\r
+       GF_IP_ADDRESS_NOT_FOUND                                 = -40,\r
+       /*! The connection to the remote peer has failed*/\r
+       GF_IP_CONNECTION_FAILURE                                = -41,\r
+       /*! The network operation has failed*/\r
+       GF_IP_NETWORK_FAILURE                                   = -42,\r
+       /*! The network connection has been closed*/\r
+       GF_IP_CONNECTION_CLOSED                                 = -43,\r
+       /*! The network operation has failed because no data is available*/\r
+       GF_IP_NETWORK_EMPTY                                             = -44,\r
+       /*! The network operation has been discarded because it would be a blocking one*/\r
+       GF_IP_SOCK_WOULD_BLOCK                                  = -45,\r
+       /*! UDP connection did not receive any data at all. Signaled by client services to reconfigure network if possible*/\r
+       GF_IP_UDP_TIMEOUT                                               = -46,\r
+\r
+       /*! Authentication with the remote host has failed*/\r
+       GF_AUTHENTICATION_FAILURE                               = -50,\r
+       /*! Script not ready for playback */\r
+       GF_SCRIPT_NOT_READY                                             = -51,\r
+} GF_Err;\r
+\r
+/*!\r
+ *     \brief Error Printing\r
+ *\r
+ *     Returns a printable version of a given error\r
+ *     \param e Error code requested\r
+ *     \return String representing the error\r
+*/\r
+const char *gf_error_to_string(GF_Err e);\r
+\r
+/*! @} */\r
+\r
+/*! \addtogroup log_grp logging tools\r
+ *     \ingroup utils_grp\r
+ *     @{\r
+ */\r
+\r
+/*!\r
+ * GPAC Log Levels\r
+ *     \hideinitializer\r
+ * \r
+ * These levels describes messages priority used when filtering logs\r
+ */\r
+enum\r
+{\r
+       /*! Log message describes an error*/\r
+       GF_LOG_ERROR = 1,\r
+       /*! Log message describes a warning*/\r
+       GF_LOG_WARNING,\r
+       /*! Log message is informational (state, etc..)*/\r
+       GF_LOG_INFO,\r
+       /*! Log message is a debug info*/\r
+       GF_LOG_DEBUG,\r
+};\r
+\r
+/*!\r
+ *     \brief Log level assignment\r
+ *\r
+ * Sets the level used for log filtering. By default no log is performed\r
+ *     \param level log level used.\r
+ *\r
+ */\r
+void gf_log_set_level(u32 level);\r
+\r
+\r
+/*!\r
+ * GPAC Log tools\r
+ *     \hideinitializer\r
+ *\r
+ * These flags describes which sub-part of GPAC generates the log and are used when filtering logs\r
+ */\r
+enum\r
+{\r
+       /*! Log message from the core library (init, threads, network calls, etc)*/\r
+       GF_LOG_CORE = 1,\r
+       /*! Log message from a raw media parser (BIFS, LASeR, A/V formats)*/\r
+       GF_LOG_CODING= 1<<1,\r
+       /*! Log message from a bitstream parser (IsoMedia, MPEG-2 TS, OGG, ...)*/\r
+       GF_LOG_CONTAINER = 1<<2,\r
+       /*! Log message from the network/service stack (messages & co)*/\r
+       GF_LOG_NETWORK = 1<<3,\r
+       /*! Log message from the RTP/RTCP stack (TS info) and packet structure & hinting (debug)*/\r
+       GF_LOG_RTP = 1<<4,\r
+       /*! Log message from authoring subsystem (file manip, import/export)*/\r
+       GF_LOG_AUTHOR = 1<<5,\r
+       /*! Log message from the sync layer of the terminal*/\r
+       GF_LOG_SYNC = 1<<6,\r
+       /*! Log message from a codec*/\r
+       GF_LOG_CODEC = 1<<7,\r
+       /*! Log message from any XML parser (context loading, etc)*/\r
+       GF_LOG_PARSER = 1<<8,\r
+       /*! Log message from the terminal/compositor, indicating media object state*/\r
+       GF_LOG_MEDIA = 1<<9,\r
+       /*! Log message from the scene graph/scene manager (handling of nodes and attribute modif, DOM core)*/\r
+       GF_LOG_SCENE = 1<<10,\r
+       /*! Log message from the scripting engine*/\r
+       GF_LOG_SCRIPT = 1<<11,\r
+       /*! Log message from event handling*/\r
+       GF_LOG_INTERACT = 1<<12,\r
+       /*! Log message from compositor*/\r
+       GF_LOG_COMPOSE = 1<<13,\r
+       /*! Log for video object cache */\r
+       GF_LOG_CACHE = 1<<14,\r
+       /*! Log message from multimedia I/O devices (audio/video input/output, ...)*/\r
+       GF_LOG_MMIO = 1<<15,\r
+       /*! Log for runtime info (times, memory, CPU usage)*/\r
+       GF_LOG_RTI = 1<<16,\r
+       /*! Log for SMIL timing and animation*/\r
+       GF_LOG_SMIL = 1<<17,\r
+\r
+};\r
+\r
+/*!\r
+ *     \brief Log modules assignment\r
+ *\r
+ * Sets the modules to be checked for log filtering. By default no modules are logged.\r
+ *     \param tools log tools filtered. This is an OR'ed combinaison of log module flags\r
+ *\r
+ */\r
+void gf_log_set_tools(u32 tools);\r
+\r
+/*!\r
+ *     \brief Log Message Callback\r
+ *\r
+ * The gf_log_cbk type is the type for the callback of the \ref gf_log_set_callback function. By default all logs are redirected to stdout\r
+ *     \param cbck Opaque user data.\r
+ *     \param log_level level of the log. This value is not guaranteed in multi-threaded context.\r
+ *     \param log_tool tool emitting the log. This value is not guaranteed in multi-threaded context.\r
+ *     \param fmt message log format.\r
+ *     \param vlist message log param.\r
+ *\r
+ */\r
+typedef void (*gf_log_cbk)(void *cbck, u32 log_level, u32 log_tool, const char* fmt, va_list vlist);\r
+\r
+/*!\r
+ *     \brief Log overwrite\r
+ *\r
+ *     Assigns a user-defined callback for printing log messages. By default all logs are redirected to stdout\r
+ *     \param usr_cbk Opaque user data \r
+ *     \param cbk  callback log function\r
+ *     \return previous callback function\r
+*/\r
+gf_log_cbk gf_log_set_callback(void *usr_cbk, gf_log_cbk cbk);\r
+\r
+/*!\r
+ \cond DUMMY_DOXY_SECTION\r
+*/\r
+\r
+#ifndef GPAC_DISABLE_LOG\r
+/*note: \r
+               to turn log on, change to GPAC_ENABLE_LOG\r
+               to turn log off, change to GPAC_DISABLE_LOG\r
+       this is needed by configure+sed to modify this file directly\r
+*/\r
+#define GPAC_ENABLE_LOG\r
+#endif\r
+\r
+/*!\r
+ \endcond\r
+*/\r
+\r
+\r
+/*this is all a bit ugly, but most compilers don't properly handle variadic macros...*/\r
+void gf_log(const char *fmt, ...);\r
+void gf_log_lt(u32 ll, u32 lt);\r
+\r
+u32 gf_log_get_level();\r
+u32 gf_log_get_tools();\r
+\r
+#ifdef GPAC_DISABLE_LOG\r
+#define GF_LOG(_ll, _lm, __args) \r
+#else\r
+/*!\r
+ *     \brief Message logging\r
+ *     \hideinitializer\r
+ *\r
+ *     Macro for logging messages. Usage is GF_LOG(log_lev, log_module, (fmt, ...)). The log function is only called if log filtering allows it. This avoids fetching logged parameters when the tool is not being logged.\r
+*/\r
+#define GF_LOG(_log_level, _log_tools, __args) if ((gf_log_get_level() >= (_log_level)) && (gf_log_get_tools() & (_log_tools))) { gf_log_lt(_log_level, _log_tools); gf_log __args ;}\r
+#endif\r
+\r
+\r
+/*! @} */\r
+\r
+/*! \addtogroup tools_grp\r
+ *     @{\r
+ */\r
+\r
+\r
+/*!\r
+ *     \brief PseudoRandom Integer Generation Initialization\r
+ *\r
+ *     Sets the starting point for generating a series of pseudorandom integers.\r
+ *     \param Reset Re-initializes the random number generator\r
+*/\r
+void gf_rand_init(Bool Reset);\r
+/*!\r
+ *     \brief PseudoRandom Integer Generation\r
+ *\r
+ *     Returns a pseudorandom integer.\r
+*/\r
+u32 gf_rand();\r
+\r
+/*!\r
+ *     \brief user name \r
+ *\r
+ *     Gets current user (login) name.\r
+*/\r
+void gf_get_user_name(char *buf, u32 buf_size);\r
+\r
+/*!\r
+ *     \brief Directory Enumeration Callback\r
+ *\r
+ * The gf_enum_dir_item type is the type for the callback of the \ref gf_enum_directory function\r
+ *     \param cbck Opaque user data.\r
+ *     \param item_name File or directory name.\r
+ *     \param item_path File or directory full path and name from filesystem root.\r
+ *     \return 1 to abort enumeration, 0 to continue enumeration.\r
+ *\r
+ */\r
+typedef Bool (*gf_enum_dir_item)(void *cbck, char *item_name, char *item_path);\r
+/*!\r
+ *     \brief Directory enumeration\r
+ *\r
+ *     Enumerates a directory content. Feedback is provided by the enum_dir_item function\r
+ *     \param dir Directory to enumerate\r
+ *     \param enum_directory If set, only directories will be enumerated, otherwise only files are.\r
+ *     \param enum_dir \ref gf_enum_dir_item callback function for enumeration. \r
+ *     \param cbck Opaque user data passed to callback function.\r
+ *     \param filter optional filter for file extensions. If a file extension without the dot '.' character is not found in the\r
+ *     filter the file will be skipped.\r
+*/\r
+GF_Err gf_enum_directory(const char *dir, Bool enum_directory, gf_enum_dir_item enum_dir, void *cbck, const char *filter);\r
+\r
+\r
+/*!\r
+ *     \brief File Deletion\r
+ *\r
+ *     Deletes a file from the disk.\r
+ *     \param fileName absolute name of the file or name relative to the current working directory.\r
+*/\r
+void gf_delete_file(char *fileName);\r
+/*!\r
+ *     \brief File Deletion\r
+ *\r
+ *     Creates a new temporary file in binary mode\r
+ *     \return stream handle to the new file ressoucre\r
+ */\r
+FILE *gf_temp_file_new();\r
+\r
+\r
+/*!\r
+ *     \brief Progress formatting\r
+ *\r
+ *     Signals progress in GPAC's operations. Note that progress signaling with this function is not thread-safe, the main purpose is to use it for authoring tools only.\r
+ *     \param title title string of the progress, or NULL for no progress\r
+ *     \param done Current amount performed of the action.\r
+ *     \param total Total amount of the action.\r
+ */\r
+void gf_set_progress(char *title, u32 done, u32 total);\r
+\r
+/*!\r
+ *     \brief Progress Callback\r
+ *\r
+ * The gf_on_progress_cbk type is the type for the callback of the \ref gf_set_progress_callback function\r
+ *     \param cbck Opaque user data.\r
+ *     \param title preogress title.\r
+ *     \param done Current amount performed of the action\r
+ *     \param total Total amount of the action.\r
+ *\r
+ */\r
+typedef void (*gf_on_progress_cbk)(void *cbck, char *title, u32 done, u32 total);\r
+\r
+/*!\r
+ *     \brief Progress overwriting\r
+ *\r
+ *     Iverwrites the progress signaling function by a user-defined one.\r
+ *     \param user_cbk Opaque user data\r
+ *     \param prog_cbk new callback function to use. Passing NULL restore default GPAC stdout notification.\r
+ */\r
+void gf_set_progress_callback(void *user_cbk, gf_on_progress_cbk prog_cbk);\r
+\r
+\r
+/*!\r
+ *     \brief Prompt checking \r
+ *\r
+ *     Checks if a character is pending in the prompt buffer.\r
+ *     \return 1 if a character is ready to be fetched, 0 otherwise.\r
+ *     \note Function not available under WindowsCE nor SymbianOS\r
+*/\r
+Bool gf_prompt_has_input();\r
+\r
+/*!\r
+ *     \brief Prompt character flush\r
+ *\r
+ *     Returns the current character entered at prompt if any.\r
+ *     \return value of the character.\r
+ *     \note Function not available under WindowsCE nor SymbianOS\r
+*/\r
+char gf_prompt_get_char();\r
+\r
+\r
+/*!\r
+ *     \brief turns prompt echo on/off\r
+ *\r
+ *     Turns the prompt character echo on/off - this is usefull when entering passwords.\r
+ *     \param echo_off indicates whether echo should be turned on or off.\r
+ *     \note Function not available under WindowsCE nor SymbianOS\r
+*/\r
+void gf_prompt_set_echo_off(Bool echo_off);\r
+\r
+/*!\r
+ *\addtogroup cpu_grp Time tools\r
+ *\ingroup utils_grp\r
+ *\brief System time and CPU functions\r
+ *\r
+ *This section documents time functionalities and CPU management in GPAC.\r
+  *    @{\r
+ */\r
+\r
+\r
+/*!\r
+ *     \brief System setup\r
+ *\r
+ *     Inits the system high-resolution clock if any, and CPU usage manager. It is strongly recommended to call this \r
+ * function before calling any other GPAC functions, since on some systems (like winCE) it may result in a better memory usage estimation.\r
+ *     \note This can be called several times but only the first call will result in system setup. \r
+ */\r
+void gf_sys_init();\r
+/*!\r
+ *     \brief System closing\r
+ *\r
+ *     Closes the system high-resolution clock and any CPU associated ressources.\r
+ *     \note This can be called several times but the system will be closed when no more users are counted.\r
+ */\r
+void gf_sys_close();\r
+/*!\r
+ *     \brief System clock query\r
+ *\r
+ *     Gets the system clock time.\r
+ *     \return System clock value since initialization in milliseconds.\r
+ */\r
+u32 gf_sys_clock();\r
+\r
+/*!\r
+ *     \brief Sleeps thread/process\r
+ *\r
+ *     Locks calling thread/process execution for a given time.\r
+ *     \param ms Amount of time to sleep in milliseconds.\r
+ */\r
+void gf_sleep(u32 ms);\r
+\r
+/*!\r
+ *     \brief CRC32 compute\r
+ *\r
+ *     Computes the CRC32 value of a buffer.\r
+ *     \param data buffer\r
+ *     \param size buffer size\r
+ *     \return computed CRC32\r
+ */\r
+u32 gf_crc_32(char *data, u32 size);\r
+\r
+\r
+/*!\brief run-time system info object\r
+ *\r
+ *The Run-Time Info object is used to get CPU and memory occupation of the calling process. \r
+ *All time values are expressed in milliseconds (accuracy is not guaranteed).\r
+*/\r
+typedef struct\r
+{\r
+       /*!start of the sampling period*/\r
+       u32 sampling_instant;\r
+       /*!duration of the sampling period*/\r
+       u32 sampling_period_duration;\r
+       /*!total amount of time (User+kernel) spent in CPU for all processes as evaluated at the end of the sampling period*/\r
+       u32 total_cpu_time;\r
+       /*!total amount of time (User+kernel) spent in CPU for the calling process as evaluated at the end of the sampling period*/\r
+       u32 process_cpu_time;\r
+       /*!amount of time (User+kernel) spent in CPU for all processes during the sampling period*/\r
+       u32 total_cpu_time_diff;\r
+       /*!total amount of time (User+kernel) spent in CPU for the calling process during the sampling period*/\r
+       u32 process_cpu_time_diff;\r
+       /*!total amount of idle time during the sampling period.*/\r
+       u32 cpu_idle_time;\r
+       /*!percentage (from 0 to 100) of CPU usage during the sampling period.*/\r
+       u32 total_cpu_usage;\r
+       /*!percentage (from 0 to 100) of the CPU usage by the calling process during the sampling period.*/\r
+       u32 process_cpu_usage;\r
+       /*!calling process ID*/\r
+       u32 pid;\r
+       /*!calling process thread count if known*/\r
+       u32 thread_count;\r
+       /*!size of calling process allocated heaps*/\r
+       u64 process_memory;\r
+       /*!total physical memory in system*/\r
+       u64 physical_memory;\r
+       /*!available physical memory in system*/\r
+       u64 physical_memory_avail;\r
+       /*!total memory currently allocated by gpac*/\r
+       u64 gpac_memory;\r
+} GF_SystemRTInfo;\r
+\r
+/*!\r
+ * Selection flags for run-time info retrieval\r
+ *     \hideinitializer\r
+ */\r
+enum\r
+{\r
+       /*!Indicates all processes' times must be fetched. If not set, only the current process times will be retrieved, and the\r
+       thread count and total times won't be available*/\r
+       GF_RTI_ALL_PROCESSES_TIMES = 1,\r
+       /*!Indicates the process allocated heap size must be fetch. If not set, only the system physical memory is fetched. \r
+       Fetching the entire ocess  allocated memory can have a large impact on performances*/\r
+       GF_RTI_PROCESS_MEMORY = 1<<1,\r
+       /*!Indicates that only system memory should be fetched. When set, all refreshing info is ignored*/\r
+       GF_RTI_SYSTEM_MEMORY_ONLY = 1<<2,\r
+};\r
+\r
+/*!\r
+ *     \brief Gets Run-Time info\r
+ *\r
+ *     Gets CPU and memory usage info for the calling process and the system. Information gathering\r
+ * is controled through timeout values.\r
+ *     \param refresh_time_ms refresh time period in milliseconds. If the last sampling was done less than this period ago, the run-time info is not refreshed.\r
+ *     \param rti holder to the run-time info structure to update.\r
+ *     \param flags specify which info is to be retrieved.\r
+ *     \return 1 if info has been updated, 0 otherwise.\r
+ *     \note You should not try to use a too small refresh time. Typical values are 500 ms or one second.\r
+ */\r
+Bool gf_sys_get_rti(u32 refresh_time_ms, GF_SystemRTInfo *rti, u32 flags);\r
+\r
+\r
+Bool gf_sys_get_battery_state(Bool *onBattery, u32 *onCharge, u32 *level);\r
+\r
+/*! @} */\r
+\r
+\r
+/*! @} */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif         /*_GF_CORE_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/user.h b/tstools/DtsEdit/src/gpac/user.h
new file mode 100644 (file)
index 0000000..1be847d
--- /dev/null
@@ -0,0 +1,111 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / Stream Management sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+\r
+\r
+#ifndef _GF_USER_H_\r
+#define _GF_USER_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+//#include <gpac/math.h>\r
+#include <gpac/events.h>\r
+#include <gpac/module.h>\r
+\r
+/*GPAC client terminal*/\r
+typedef struct _tag_terminal GF_Terminal;\r
+\r
+       \r
+\r
+enum\r
+{\r
+       /*display should be hidden upon initialization*/\r
+       GF_TERM_INIT_HIDE = 1,\r
+       /*no audio renderer will be created*/\r
+       GF_TERM_NO_AUDIO = 1<<1,\r
+       /*terminal is used without visual threading: \r
+               * media codecs are not threaded\r
+               * all composition memories are filled before rendering\r
+               * rendering is done after media decoding\r
+               * the user is responsible for updating the terminal\r
+       */\r
+       GF_TERM_NO_VISUAL_THREAD = 1<<2,\r
+       /*disables frame-rate regulation (used when dumping content)*/\r
+       GF_TERM_NO_REGULATION = 1<<3,\r
+       /*lets the main user handle window events (neede for browser plugins)*/\r
+       GF_TERM_NO_WINDOWPROC_OVERRIDE = 1<<4,\r
+       /*works in windowless mode - experimental, only supported on Win32*/\r
+       GF_TERM_WINDOWLESS = 1<<5\r
+};\r
+\r
+/*user object for all callbacks*/\r
+typedef struct \r
+{\r
+       /*user defined callback for all functions - cannot be NULL*/\r
+       void *opaque;\r
+       /*the event proc. Return value depend on the event type, usually 0\r
+       cannot be NULL if os_window_handler is specified and dont_override_window_proc is set\r
+       may be NULL otherwise*/\r
+       Bool (*EventProc)(void *opaque, GF_Event *event);\r
+\r
+       /*config file of client - cannot be NULL*/\r
+       GF_Config *config;\r
+       /*modules manager - cannot be NULL - owned by the user (to allow selection of module directory)*/\r
+       GF_ModuleManager *modules;\r
+       /*optional os window handler (HWND on win32/winCE, XWindow for X11) \r
+       if not set the video outut will create and manage the display window.*/\r
+       void *os_window_handler;\r
+       /*for now, only used by X11 (indicates display the window is on)*/\r
+       void *os_display;\r
+\r
+       /*init flags bypassing GPAC config file */\r
+       u32 init_flags;\r
+} GF_User;\r
+\r
+\r
+/*macro for event forwarding*/\r
+#define GF_USER_SENDEVENT(_user, _evt) (_user->EventProc ? _user->EventProc(_user->opaque, _evt) : 0)\r
+\r
+/*macro for message event format/send*/\r
+#define GF_USER_MESSAGE(_user, _serv, _msg, _e)        \\r
+       {       \\r
+               GF_Event evt;   \\r
+               if (_user->EventProc) { \\r
+                       evt.type = GF_EVENT_MESSAGE;    \\r
+                       evt.message.service = _serv;    \\r
+                       evt.message.message = _msg;     \\r
+                       evt.message.error = _e; \\r
+                       _user->EventProc(_user->opaque, &evt);  \\r
+               }       \\r
+       }\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /*_GF_USER_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/utf.h b/tstools/DtsEdit/src/gpac/utf.h
new file mode 100644 (file)
index 0000000..aa67f5e
--- /dev/null
@@ -0,0 +1,99 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / common tools sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_UTF_H_\r
+#define _GF_UTF_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/*!\r
+ *     \file <gpac/utf.h>\r
+ *     \brief UTF functions.\r
+ */\r
+\r
+/*!\r
+ *     \addtogroup utf_grp UTF\r
+ *     \ingroup utils_grp\r
+ *     \brief UTF encoding functions\r
+ *\r
+ *This section documents the UTF functions of the GPAC framework.\n\r
+ *The wide characters in GPAC are unsignad shorts, in other words GPAC only supports UTF8 and UTF16 coding styles.\r
+ *\note these functions are just ports of libutf8 library tools into GPAC.\r
+ *     @{\r
+ */\r
+\r
+#include <gpac/tools.h>\r
+\r
+/*!\r
+ *\brief wide-char to multibyte conversion\r
+ *\r
+ *Converts a wide-char string to a multibyte string\r
+ *\param dst multibyte destination buffer\r
+ *\param dst_len multibyte destination buffer size\r
+ *\param srcp address of the wide-char string. This will be set to the next char to be converted in the input buffer if not enough space in the destination, or NULL if conversion was completed.\r
+ *\return length (in byte) of the multibyte string or -1 if error.\r
+ */\r
+size_t gf_utf8_wcstombs(char* dst, size_t dst_len, const unsigned short** srcp);\r
+/*converts UTF8 string to wide char string - returns (-1) if error. set @srcp to next char to be\r
+converted if not enough space*/\r
+/*!\r
+ *\brief multibyte to wide-char conversion\r
+ *\r
+ *Converts a multibyte string to a wide-char string \r
+ *\param dst wide-char destination buffer\r
+ *\param dst_len wide-char destination buffer size\r
+ *\param srcp address of the multibyte character buffer. This will be set to the next char to be converted in the input buffer if not enough space in the destination, or NULL if conversion was completed.\r
+ *\return length (in unsigned short) of the wide-char string or -1 if error.\r
+ */\r
+size_t gf_utf8_mbstowcs(unsigned short* dst, size_t dst_len, const char** srcp);\r
+/*!\r
+ *\brief wide-char string length\r
+ *\r
+ *Returns the length in character of a wide-char string\r
+ *\param s the wide-char string\r
+ *\return the wide-char string length\r
+ */\r
+size_t gf_utf8_wcslen(const unsigned short *s);\r
+\r
+/*!\r
+ *\brief string bidi reordering\r
+ *\r
+ *Performs a simple reordering of words in the string based on each word direction, so that glyphs are sorted in display order.\r
+ *\param utf_string the wide-char string\r
+ *\param len the len of the wide-char string\r
+ *\return 1 if the main direction is right-to-left, 0 otherwise\r
+ */\r
+Bool gf_utf8_reorder_bidi(u16 *utf_string, u32 len);\r
+\r
+/*! @} */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif         /*_GF_UTF_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/gpac/xml.h b/tstools/DtsEdit/src/gpac/xml.h
new file mode 100644 (file)
index 0000000..092dbba
--- /dev/null
@@ -0,0 +1,158 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / common tools sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _XML_PARSER_H_\r
+#define _XML_PARSER_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/tools.h>\r
+#include <gpac/list.h>\r
+\r
+/*!\r
+ *     \file <gpac/xml.h>\r
+ *     \brief XML functions.\r
+ */\r
+\r
+/*!\r
+ *     \addtogroup xml_grp XML\r
+ *     \ingroup utils_grp\r
+ *     \brief XML Parsing functions\r
+ *\r
+ *This section documents the XML functions of the GPAC framework.\n\r
+ *     @{\r
+ */\r
+\r
+\r
+\r
+typedef struct\r
+{\r
+       /*name or namespace:name*/\r
+       char *name;\r
+       /*value*/\r
+       char *value;\r
+} GF_XMLAttribute;\r
+\r
+/*XML node types*/\r
+enum\r
+{\r
+       GF_XML_NODE_TYPE = 0,\r
+       GF_XML_TEXT_TYPE,\r
+       GF_XML_CDATA_TYPE,\r
+};\r
+\r
+typedef struct _xml_node\r
+{\r
+       u32 type;\r
+       /*\r
+       For DOM nodes: name\r
+       For other (text, css, cdata), element content\r
+       */\r
+       char *name;\r
+\r
+       /*for DOM nodes only*/\r
+       char *ns;       /*namespace*/\r
+       GF_List *attributes;\r
+       GF_List *content;\r
+} GF_XMLNode;\r
+\r
+\r
+\r
+/*\r
+       SAX XML Parser\r
+*/\r
+\r
+typedef struct _tag_sax_parser GF_SAXParser;\r
+typedef        void (*gf_xml_sax_node_start)(void *sax_cbck, const char *node_name, const char *name_space, const GF_XMLAttribute *attributes, u32 nb_attributes);\r
+typedef        void (*gf_xml_sax_node_end)(void *sax_cbck, const char *node_name, const char *name_space);\r
+typedef        void (*gf_xml_sax_text_content)(void *sax_cbck, const char *content, Bool is_cdata);\r
+\r
+typedef        void (*gf_xml_sax_progress)(void *cbck, u32 done, u32 tot);\r
+\r
+/*creates new sax parser - all callbacks are optionals*/\r
+GF_SAXParser *gf_xml_sax_new(gf_xml_sax_node_start on_node_start, \r
+                                                        gf_xml_sax_node_end on_node_end,\r
+                                                        gf_xml_sax_text_content on_text_content,\r
+                                                        void *cbck);\r
+\r
+/*destroys sax parser */\r
+void gf_xml_sax_del(GF_SAXParser *parser);\r
+/*inits parser with BOM. BOM must be 4 char string with 0 terminaison. If BOM is NULL, parsing will\r
+assume UTF-8 compatible coding*/\r
+GF_Err gf_xml_sax_init(GF_SAXParser *parser, unsigned char *BOM);\r
+/*parses input string data. string data MUST be terminated by the 0 character (eg 2 0s for UTF-16)*/\r
+GF_Err gf_xml_sax_parse(GF_SAXParser *parser, void *string_bytes);\r
+/*suspends/resume sax parsing. \r
+       When resuming on file, the function will run until suspended/end of file/error\r
+       When resuming on steram, the function will simply return\r
+*/\r
+GF_Err gf_xml_sax_suspend(GF_SAXParser *parser, Bool do_suspend);\r
+/*parses file (potentially gzipped). OnProgress is optional, used to get progress callback*/\r
+GF_Err gf_xml_sax_parse_file(GF_SAXParser *parser, const char *fileName, gf_xml_sax_progress OnProgress);\r
+/*get current line number*/\r
+u32 gf_xml_sax_get_line(GF_SAXParser *parser);\r
+/*get file size - may be inaccurate if gzipped (only compressed file size is known)*/\r
+u32 gf_xml_sax_get_file_size(GF_SAXParser *parser);\r
+/*get current file position*/\r
+u32 gf_xml_sax_get_file_pos(GF_SAXParser *parser);\r
+\r
+/*peeks a node forward in the file. May be used to pick the attribute of the first node found matching a given (attributeName, attributeValue) couple*/\r
+char *gf_xml_sax_peek_node(GF_SAXParser *parser, char *att_name, char *att_value, char *substitute, char *get_attr, char *end_pattern, Bool *is_substitute);\r
+\r
+/*file mode only, returns 1 if file is compressed, 0 otherwise*/\r
+Bool gf_xml_sax_binary_file(GF_SAXParser *parser);\r
+\r
+const char *gf_xml_sax_get_error(GF_SAXParser *parser);\r
+\r
+char *gf_xml_get_root_type(const char *file, GF_Err *ret_code);\r
+\r
+u32 gf_xml_sax_get_node_start_pos(GF_SAXParser *parser);\r
+u32 gf_xml_sax_get_node_end_pos(GF_SAXParser *parser);\r
+\r
+\r
+typedef struct _tag_dom_parser GF_DOMParser;\r
+GF_DOMParser *gf_xml_dom_new();\r
+void gf_xml_dom_del(GF_DOMParser *parser);\r
+GF_Err gf_xml_dom_parse(GF_DOMParser *parser, const char *file, gf_xml_sax_progress OnProgress, void *cbk);\r
+GF_XMLNode *gf_xml_dom_get_root(GF_DOMParser *parser);\r
+const char *gf_xml_dom_get_error(GF_DOMParser *parser);\r
+u32 gf_xml_dom_get_line(GF_DOMParser *parser);\r
+\r
+char *gf_xml_dom_serialize(GF_XMLNode *node, Bool content_only);\r
+\r
+\r
+GF_XMLNode *gf_xml_dom_detach_root(GF_DOMParser *parser);\r
+void gf_xml_dom_node_del(GF_XMLNode *node);\r
+\r
+/*! @} */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif         /*_XML_PARSER_H_*/\r
+\r
diff --git a/tstools/DtsEdit/src/stdafx.cpp b/tstools/DtsEdit/src/stdafx.cpp
new file mode 100644 (file)
index 0000000..cfeea92
--- /dev/null
@@ -0,0 +1,8 @@
+// stdafx.cpp : \95W\8f\80\83C\83\93\83N\83\8b\81[\83h DTSRepair.pch \82Ì\82Ý\82ð\r
+// \8aÜ\82Þ\83\\81[\83\83t\83@\83C\83\8b\82Í\81A\83v\83\8a\83R\83\93\83p\83C\83\8b\8dÏ\82Ý\83w\83b\83_\81[\82É\82È\82è\82Ü\82·\81B\r
+// stdafx.obj \82É\82Í\83v\83\8a\83R\83\93\83p\83C\83\8b\8dÏ\82Ý\8c^\8fî\95ñ\82ª\8aÜ\82Ü\82ê\82Ü\82·\81B\r
+\r
+#include "stdafx.h"\r
+\r
+// TODO: \82±\82Ì\83t\83@\83C\83\8b\82Å\82Í\82È\82­\81ASTDAFX.H \82Å\95K\97v\82È\r
+// \92Ç\89Á\83w\83b\83_\81[\82ð\8eQ\8fÆ\82µ\82Ä\82­\82¾\82³\82¢\81B\r
diff --git a/tstools/DtsEdit/src/stdafx.h b/tstools/DtsEdit/src/stdafx.h
new file mode 100644 (file)
index 0000000..63e2ff2
--- /dev/null
@@ -0,0 +1,19 @@
+// stdafx.h : \95W\8f\80\82Ì\83V\83X\83e\83\80 \83C\83\93\83N\83\8b\81[\83\83t\83@\83C\83\8b\82Ì\83C\83\93\83N\83\8b\81[\83\83t\83@\83C\83\8b\81A\82Ü\82½\82Í\r
+// \8eQ\8fÆ\89ñ\90\94\82ª\91½\82­\81A\82©\82Â\82 \82Ü\82è\95Ï\8dX\82³\82ê\82È\82¢\81A\83v\83\8d\83W\83F\83N\83g\90ê\97p\82Ì\83C\83\93\83N\83\8b\81[\83\83t\83@\83C\83\8b\r
+// \82ð\8bL\8fq\82µ\82Ü\82·\81B\r
+//\r
+\r
+#pragma once\r
+\r
+#ifndef _WIN32_WINNT           // Windows XP \88È\8d~\82Ì\83o\81[\83W\83\87\83\93\82É\8cÅ\97L\82Ì\8b@\94\\82Ì\8eg\97p\82ð\8b\96\89Â\82µ\82Ü\82·\81B                   \r
+#define _WIN32_WINNT 0x0501    // \82±\82ê\82ð Windows \82Ì\91¼\82Ì\83o\81[\83W\83\87\83\93\8cü\82¯\82É\93K\90Ø\82È\92l\82É\95Ï\8dX\82µ\82Ä\82­\82¾\82³\82¢\81B\r
+#endif                                         \r
+\r
+#include <windows.h>\r
+//#include <stdio.h>\r
+//#include <tchar.h>\r
+\r
+// TODO: \83v\83\8d\83O\83\89\83\80\82É\95K\97v\82È\92Ç\89Á\83w\83b\83_\81[\82ð\82±\82±\82Å\8eQ\8fÆ\82µ\82Ä\82­\82¾\82³\82¢\81B\r
+#include <gpac/isomedia.h>\r
+#include <gpac/internal/isomedia_dev.h>\r
+#include "common.h"\r
diff --git a/tstools/DtsEdit/src/stdint.h b/tstools/DtsEdit/src/stdint.h
new file mode 100644 (file)
index 0000000..92dfa88
--- /dev/null
@@ -0,0 +1,186 @@
+/* ISO C9x  7.18  Integer types <stdint.h>
+ * Based on ISO/IEC SC22/WG14 9899 Committee draft (SC22 N2794)
+ *
+ *  THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ *  Contributor: Danny Smith <danny_r_smith_2001@yahoo.co.nz>
+ *
+ *  This source code is offered for use in the public domain. You may
+ *  use, modify or distribute it freely.
+ *
+ *  This code is distributed in the hope that it will be useful but
+ *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ *  DISCLAIMED. This includes but is not limited to warranties of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ *  Date: 2000-12-02
+ */
+
+
+#ifndef _STDINT_H
+#define _STDINT_H
+#define __need_wint_t
+#define __need_wchar_t
+#include <stddef.h>
+
+/* 7.18.1.1  Exact-width integer types */
+typedef signed char int8_t;
+typedef unsigned char   uint8_t;
+typedef short  int16_t;
+typedef unsigned short  uint16_t;
+typedef int  int32_t;
+typedef unsigned   uint32_t;
+typedef __int64  int64_t;
+typedef unsigned __int64 uint64_t;
+
+/* 7.18.1.2  Minimum-width integer types */
+typedef signed char int_least8_t;
+typedef unsigned char   uint_least8_t;
+typedef short  int_least16_t;
+typedef unsigned short  uint_least16_t;
+typedef int  int_least32_t;
+typedef unsigned   uint_least32_t;
+typedef __int64  int_least64_t;
+typedef unsigned __int64   uint_least64_t;
+
+/*  7.18.1.3  Fastest minimum-width integer types 
+ *  Not actually guaranteed to be fastest for all purposes
+ *  Here we use the exact-width types for 8 and 16-bit ints. 
+ */
+typedef char int_fast8_t;
+typedef unsigned char uint_fast8_t;
+typedef short  int_fast16_t;
+typedef unsigned short  uint_fast16_t;
+typedef int  int_fast32_t;
+typedef unsigned  int  uint_fast32_t;
+typedef __int64  int_fast64_t;
+typedef unsigned __int64   uint_fast64_t;
+
+/* 7.18.1.4  Integer types capable of holding object pointers */
+/*typedef int intptr_t;
+typedef unsigned uintptr_t;*/
+
+/* 7.18.1.5  Greatest-width integer types */
+typedef __int64  intmax_t;
+typedef unsigned __int64   uintmax_t;
+
+/* 7.18.2  Limits of specified-width integer types */
+#if !defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS)
+
+/* 7.18.2.1  Limits of exact-width integer types */
+#define INT8_MIN (-128) 
+#define INT16_MIN (-32768)
+#define INT32_MIN (-2147483647 - 1)
+#define INT64_MIN  (-9223372036854775807LL - 1)
+
+#define INT8_MAX 127
+#define INT16_MAX 32767
+#define INT32_MAX 2147483647
+#define INT64_MAX 9223372036854775807LL
+
+#define UINT8_MAX 0xff /* 255U */
+#define UINT16_MAX 0xffff /* 65535U */
+#define UINT32_MAX 0xffffffff  /* 4294967295U */
+#define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */
+
+/* 7.18.2.2  Limits of minimum-width integer types */
+#define INT_LEAST8_MIN INT8_MIN
+#define INT_LEAST16_MIN INT16_MIN
+#define INT_LEAST32_MIN INT32_MIN
+#define INT_LEAST64_MIN INT64_MIN
+
+#define INT_LEAST8_MAX INT8_MAX
+#define INT_LEAST16_MAX INT16_MAX
+#define INT_LEAST32_MAX INT32_MAX
+#define INT_LEAST64_MAX INT64_MAX
+
+#define UINT_LEAST8_MAX UINT8_MAX
+#define UINT_LEAST16_MAX UINT16_MAX
+#define UINT_LEAST32_MAX UINT32_MAX
+#define UINT_LEAST64_MAX UINT64_MAX
+
+/* 7.18.2.3  Limits of fastest minimum-width integer types */
+#define INT_FAST8_MIN INT8_MIN
+#define INT_FAST16_MIN INT16_MIN
+#define INT_FAST32_MIN INT32_MIN
+#define INT_FAST64_MIN INT64_MIN
+
+#define INT_FAST8_MAX INT8_MAX
+#define INT_FAST16_MAX INT16_MAX
+#define INT_FAST32_MAX INT32_MAX
+#define INT_FAST64_MAX INT64_MAX
+
+#define UINT_FAST8_MAX UINT8_MAX
+#define UINT_FAST16_MAX UINT16_MAX
+#define UINT_FAST32_MAX UINT32_MAX
+#define UINT_FAST64_MAX UINT64_MAX
+
+/* 7.18.2.4  Limits of integer types capable of holding
+    object pointers */ 
+#define INTPTR_MIN INT32_MIN
+#define INTPTR_MAX INT32_MAX
+#define UINTPTR_MAX UINT32_MAX
+
+/* 7.18.2.5  Limits of greatest-width integer types */
+#define INTMAX_MIN INT64_MIN
+#define INTMAX_MAX INT64_MAX
+#define UINTMAX_MAX UINT64_MAX
+
+/* 7.18.3  Limits of other integer types */
+#define PTRDIFF_MIN INT32_MIN
+#define PTRDIFF_MAX INT32_MAX
+
+#define SIG_ATOMIC_MIN INT32_MIN
+#define SIG_ATOMIC_MAX INT32_MAX
+
+#define SIZE_MAX UINT32_MAX
+
+#ifndef WCHAR_MIN  /* also in wchar.h */ 
+#define WCHAR_MIN 0
+#define WCHAR_MAX ((wchar_t)-1) /* UINT16_MAX */
+#endif
+
+/*
+ * wint_t is unsigned short for compatibility with MS runtime
+ */
+#define WINT_MIN 0
+#define WINT_MAX ((wint_t)-1) /* UINT16_MAX */
+
+#endif /* !defined ( __cplusplus) || defined __STDC_LIMIT_MACROS */
+
+
+/* 7.18.4  Macros for integer constants */
+#if !defined ( __cplusplus) || defined (__STDC_CONSTANT_MACROS)
+
+/* 7.18.4.1  Macros for minimum-width integer constants
+
+    Accoding to Douglas Gwyn <gwyn@arl.mil>:
+       "This spec was changed in ISO/IEC 9899:1999 TC1; in ISO/IEC
+       9899:1999 as initially published, the expansion was required
+       to be an integer constant of precisely matching type, which
+       is impossible to accomplish for the shorter types on most
+       platforms, because C99 provides no standard way to designate
+       an integer constant with width less than that of type int.
+       TC1 changed this to require just an integer constant
+       *expression* with *promoted* type."
+
+       The trick used here is from Clive D W Feather.
+*/
+
+#define INT8_C(val) (INT_LEAST8_MAX-INT_LEAST8_MAX+(val))
+#define INT16_C(val) (INT_LEAST16_MAX-INT_LEAST16_MAX+(val))
+#define INT32_C(val) (INT_LEAST32_MAX-INT_LEAST32_MAX+(val))
+#define INT64_C(val) (INT_LEAST64_MAX-INT_LEAST64_MAX+(val))
+
+#define UINT8_C(val) (UINT_LEAST8_MAX-UINT_LEAST8_MAX+(val))
+#define UINT16_C(val) (UINT_LEAST16_MAX-UINT_LEAST16_MAX+(val))
+#define UINT32_C(val) (UINT_LEAST32_MAX-UINT_LEAST32_MAX+(val))
+#define UINT64_C(val) (UINT_LEAST64_MAX-UINT_LEAST64_MAX+(val))
+
+/* 7.18.4.2  Macros for greatest-width integer constants */
+#define INTMAX_C(val) (INTMAX_MAX-INTMAX_MAX+(val))
+#define UINTMAX_C(val) (UINTMAX_MAX-UINTMAX_MAX+(val))
+
+#endif  /* !defined ( __cplusplus) || defined __STDC_CONSTANT_MACROS */
+
+#endif
diff --git a/tstools/DtsEdit/ディレイカット.bat b/tstools/DtsEdit/ディレイカット.bat
new file mode 100644 (file)
index 0000000..182371a
--- /dev/null
@@ -0,0 +1,21 @@
+@ECHO OFF\r
+SETLOCAL ENABLEDELAYEDEXPANSION\r
+\r
+IF EXIST "%~dp0" CD /D "%~dp0"\r
+\r
+rem \95¡\90\94\83t\83@\83C\83\8b\82Ì\83\8b\81[\83v\8f\88\97\9d\r
+SET ARGV=%*\r
+FOR %%I IN (!ARGV!) DO CALL :DTSEDIT "%%~I"\r
+GOTO :EOF\r
+\r
+\r
+:DTSEDIT\r
+SET OUT_FILE=%~dpn1.nodelay%~x1\r
+SET TC_FILE=%~dpn1.timecode.txt\r
+\r
+DtsEdit "%~dpnx1" -o "%TC_FILE%"\r
+DtsEdit "%~dpnx1" -tc "%TC_FILE%" -o "%OUT_FILE%" -mlt 4\r
+\r
+del "%TC_FILE%"\r
+GOTO :EOF\r
+\r
diff --git a/tstools/Makefile b/tstools/Makefile
new file mode 100755 (executable)
index 0000000..03d2141
--- /dev/null
@@ -0,0 +1,22 @@
+PREFIX = /usr/local/share
+MAJOR = 0
+MINOR = 9
+REVISION = 0
+VER = $(MAJOR).$(MINOR).$(REVISION)
+
+DEST = $(PREFIX)/rec10/tstools
+
+all: 
+       cd epgdump;make all
+clean:
+       cd epgdump;make clean
+install: 
+       mkdir $(DEST)
+       cd BonTsDemux;cp ./*.* $(DEST)/
+       cd jTsSplitter;cp ./*.* $(DEST)/
+       cd cfr2tc;cp ./cfr2tc.exe $(DEST)/
+       cd DtsEdit;cp ./DtsEdit.exe $(DEST)/
+       cd epgdump;make install
+uninstall:
+       rm -r $(DEST)
+       cd epgdump;make uninstall
diff --git a/tstools/cfr2tc/cfr2tc-README.txt b/tstools/cfr2tc/cfr2tc-README.txt
new file mode 100644 (file)
index 0000000..5edd07c
--- /dev/null
@@ -0,0 +1,103 @@
+       cfr2tc v1.4 by tritical - Help File  --  July 26, 2006\r
+--------------------------------------------------------------------------\r
+\r
+\r
+INFO:\r
+\r
+      This program takes an avi file with a video stream containing null\r
+   frames and outputs a new avi file containing the same video stream, but\r
+   with all null frames removed and a v1 or v2 timecode file.  It also has\r
+   timecode file only modes that create the timecode file but do not create\r
+   a new avi file.  As of v1.4 there is also the option to output an avs\r
+   script instead of a new avi file.\r
+\r
+\r
+SYNTAX/EXAMPLE:\r
+\r
+\r
+   cfr2tc input_avi_file output_avi_or_avs_file timecode_file mode\r
+\r
+\r
+   cfr2tc c:\test.avi c:\video.avi c:\timecodes.txt 1\r
+\r
+   cfr2tc c:\test.avi c:\script.avs c:\timecodes.txt 5\r
+\r
+\r
+PARAMETERS:\r
+\r
+\r
+   input_avi_file -\r
+\r
+      The name and path of the input avi file.  The avi file can have\r
+      multiple streams, but only one of which can be a video stream.\r
+      The avi file must also use an "idx1" index.\r
+\r
+\r
+   output_avi_or_avs_file -\r
+\r
+      The name and path of the destination (output) avi or avs file\r
+      that will be created.  If using avi output, the resulting avi\r
+      file will contain only the video stream with null frames\r
+      removed.  If using avs output, the resulting avs file will\r
+      contain trim().selectevery().assumefps() statements to exactly\r
+      replicate the video you would get using avi output.  The main\r
+      reason for avs output is to eliminate the need for creating a new\r
+      avi file.  The "mode" parameter can be used to switch between\r
+      avi output, avs output, and timecode only output.\r
+\r
+\r
+   timecode_file -\r
+\r
+      The name and path of the timecode file that will be created.\r
+      The type of timecode file created (v1 or v2) is controlled\r
+      via the "mode" parameter.\r
+\r
+\r
+   mode -\r
+\r
+      Controls whether a v1 or v2 timecode file is created. Possible\r
+      settings:\r
+\r
+         1 - v1 timecode file, avi output\r
+         2 - v2 timecode file, avi output\r
+         3 - v1 timecode file, no avi output\r
+         4 - v2 timecode file, no avi output\r
+         5 - v1 timecode file, avs output\r
+         6 - v2 timecode file, avs output\r
+\r
+\r
+CHANGE LIST:\r
+\r
+\r
+   26/07/2006  v1.4\r
+\r
+      + Added avs output modes (modes 5 and 6)\r
+      + A few minor internal changes\r
+      + update copyright\r
+\r
+\r
+   29/12/2005  v1.3\r
+\r
+      + Use a larger io buffer for avi file reading/writing\r
+      - Fixed a few typos in output messages\r
+\r
+\r
+   26/12/2005  v1.2\r
+\r
+      + v1 timecode format output cosmetics\r
+\r
+\r
+   26/12/2005  v1.1\r
+\r
+      + Add timecode only output ability (modes 3/4)\r
+      + Print elapsed process time\r
+      + Optimizations and efficiency improvements\r
+\r
+\r
+   25/12/2005  v1.0\r
+\r
+      - initial release\r
+\r
+\r
+\r
+contact:   forum.doom9.org  nick = tritical  or  email:  kes25c@mizzou.edu\r
diff --git a/tstools/cfr2tc/cfr2tc.exe b/tstools/cfr2tc/cfr2tc.exe
new file mode 100644 (file)
index 0000000..e33deda
Binary files /dev/null and b/tstools/cfr2tc/cfr2tc.exe differ
diff --git a/tstools/cfr2tc/cfr2tc/cfr2tc.cpp b/tstools/cfr2tc/cfr2tc/cfr2tc.cpp
new file mode 100644 (file)
index 0000000..ac013eb
--- /dev/null
@@ -0,0 +1,1043 @@
+/*\r
+**                   cfr2tc v1.4 - July 26, 2006\r
+**\r
+**   This program takes an avi file with a video stream containing null\r
+**   frames and outputs a new avi file containing the same video stream\r
+**   but with all null frames removed and a v1 or v2 timecode file.\r
+**\r
+**   Copyright (C) 2005-2006 Kevin Stone\r
+**\r
+**   This program is free software; you can redistribute it and/or modify\r
+**   it under the terms of the GNU General Public License as published by\r
+**   the Free Software Foundation; either version 2 of the License, or\r
+**   (at your option) any later version.\r
+**\r
+**   This program is distributed in the hope that it will be useful,\r
+**   but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+**   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+**   GNU General Public License for more details.\r
+**\r
+**   You should have received a copy of the GNU General Public License\r
+**   along with this program; if not, write to the Free Software\r
+**   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
+*/\r
+\r
+#include <windows.h>\r
+#include <stdio.h>\r
+#include <time.h>\r
+#include <malloc.h>\r
+\r
+#define VERSION "v1.4"\r
+\r
+typedef DWORD FOURCC;\r
+\r
+typedef struct\r
+{\r
+       FOURCC riff;\r
+       DWORD fileSize;\r
+       DWORD fileType;\r
+} RIFFHEADER;\r
+\r
+class CHUNKHEADER\r
+{\r
+public:\r
+       FOURCC ckID;\r
+       DWORD ckSize;\r
+       DWORD ckDataSize;\r
+       void *ckData;\r
+       CHUNKHEADER::CHUNKHEADER() : ckID(0), ckSize(0), ckData(0), ckDataSize(0) {};\r
+       CHUNKHEADER::~CHUNKHEADER() { if (ckData) free(ckData); }\r
+};\r
+\r
+class LISTHEADER\r
+{\r
+public:\r
+       FOURCC lstID;\r
+       DWORD lstSize;\r
+       FOURCC lstType;\r
+       CHUNKHEADER *chkHd;\r
+       LISTHEADER::LISTHEADER() : lstID(0), lstSize(0), lstType(0), chkHd(0) {};\r
+       LISTHEADER::~LISTHEADER() { if (chkHd) delete chkHd; }\r
+       LISTHEADER& LISTHEADER::operator=(LISTHEADER& ob2)\r
+       {\r
+               lstID = ob2.lstID;\r
+               lstSize = ob2.lstSize;\r
+               lstType = ob2.lstType;\r
+               if (chkHd) delete chkHd;\r
+               chkHd = new CHUNKHEADER();\r
+               chkHd->ckID = ob2.chkHd->ckID;\r
+               chkHd->ckSize = ob2.chkHd->ckSize;\r
+               chkHd->ckDataSize = ob2.chkHd->ckDataSize;\r
+               if (chkHd->ckData) free(chkHd->ckData);\r
+               chkHd->ckData = malloc(chkHd->ckDataSize);\r
+               memcpy(chkHd->ckData,ob2.chkHd->ckData,chkHd->ckDataSize);\r
+               return *this;\r
+       }\r
+};\r
+\r
+class TBUF\r
+{\r
+public:\r
+       DWORD size;\r
+       void *data;\r
+       TBUF::TBUF() : data(0), size(0) {};\r
+       TBUF::~TBUF() { if (data) free(data); }\r
+};\r
+\r
+typedef struct \r
+{\r
+       FOURCC fccType;\r
+       FOURCC fccHandler;\r
+       DWORD  dwFlags;\r
+       WORD   wPriority;\r
+       WORD   wLanguage;\r
+       DWORD  dwInitialFrames;\r
+       DWORD  dwScale;\r
+       DWORD  dwRate;\r
+       DWORD  dwStart;\r
+       DWORD  dwLength;\r
+       DWORD  dwSuggestedBufferSize;\r
+       DWORD  dwQuality;\r
+       DWORD  dwSampleSize;\r
+       struct {\r
+               short int left;\r
+               short int top;\r
+               short int right;\r
+               short int bottom;\r
+       }  rcFrame;\r
+} AVISTREAMHEADER;\r
+\r
+typedef struct \r
+{\r
+       DWORD  dwMicroSecPerFrame;\r
+       DWORD  dwMaxBytesPerSec;\r
+       DWORD  dwPaddingGranularity;\r
+       DWORD  dwFlags;\r
+       DWORD  dwTotalFrames;\r
+       DWORD  dwInitialFrames;\r
+       DWORD  dwStreams;\r
+       DWORD  dwSuggestedBufferSize;\r
+       DWORD  dwWidth;\r
+       DWORD  dwHeight;\r
+       DWORD  dwReserved[4];\r
+} AVIMAINHEADER;\r
+\r
+typedef struct \r
+{\r
+       DWORD   dwGrandFrames;\r
+       DWORD   dwFuture[61];\r
+} AVIEXTHEADER;\r
+\r
+typedef struct\r
+{\r
+       DWORD   dwChunkId;\r
+       DWORD   dwFlags;\r
+       DWORD   dwOffset;\r
+       DWORD   dwSize;\r
+} AVIOLDINDEX;\r
+\r
+// globals\r
+TBUF tbuf;\r
+DWORD wpos = 0;\r
+\r
+DWORD MAKE_FOURCC(char* fourCC)\r
+{\r
+       return (fourCC[0]|(fourCC[1]<<8)|(fourCC[2]<<16)|(fourCC[3]<<24));\r
+}\r
+\r
+bool checkRiffHeader(FILE *f, FILE *o, RIFFHEADER *rh, bool write)\r
+{\r
+       if (!fread(rh,1,12,f)) return false;\r
+       if (rh->riff != MAKE_FOURCC("RIFF")) return false;\r
+       if (rh->fileType != MAKE_FOURCC("AVI ")) return false;\r
+       if (write) { wpos += 12; if (!fwrite(rh,1,12,o)) return false; }\r
+       return true;\r
+}\r
+\r
+bool scanForList(FILE *f, FILE *o, LISTHEADER *lh, char *fourCC, char *fourCCStop,\r
+                                bool force, bool write, bool &stop)\r
+{\r
+       lh->lstID = 0;\r
+       stop = false;\r
+repeat:\r
+       if (!fread(&lh->lstID,1,2,f)) return false;\r
+       while(1)\r
+       {\r
+               if (!fread(((unsigned char*)&lh->lstID)+2,1,2,f)) return false;\r
+               if (lh->lstID == 0x5453494C) break;\r
+               if (write) { wpos += 2; if (!fwrite(&lh->lstID,1,2,o)) return false; }\r
+               lh->lstID = lh->lstID>>16;\r
+       }\r
+       if (!fread(&lh->lstSize,4,1,f)) return false;\r
+       if (!fread(&lh->lstType,4,1,f)) return false;\r
+       if (lh->lstType != MAKE_FOURCC(fourCC)) \r
+       {\r
+               if (force) return false;\r
+               if (lh->lstType == MAKE_FOURCC(fourCCStop))\r
+               {\r
+                       if (fseek(f,-12,SEEK_CUR)) return false;\r
+                       stop = true;\r
+                       return false;\r
+               }\r
+               DWORD fsize = lh->lstSize-4-(lh->lstSize&1);\r
+               if (write)\r
+               {\r
+                       if (tbuf.size <= fsize+12)\r
+                       {\r
+                               if (tbuf.data) free(tbuf.data);\r
+                               tbuf.data = malloc(fsize+12);\r
+                               if (!tbuf.data) return false;\r
+                               tbuf.size = fsize+12;\r
+                       }\r
+                       if (!fread(tbuf.data,fsize,1,f)) return false;\r
+                       if (!fwrite(&lh->lstID,4,1,o)) return false;\r
+                       if (!fwrite(&lh->lstSize,4,1,o)) return false;\r
+                       if (!fwrite(&lh->lstType,4,1,o)) return false;\r
+                       if (!fwrite(tbuf.data,fsize,1,o)) return false;\r
+                       wpos += 12+fsize;\r
+               }\r
+               else\r
+               {\r
+                       if (fseek(f,fsize,SEEK_CUR)) \r
+                               return false;\r
+               }\r
+               goto repeat;\r
+       }\r
+       if (fseek(f,-12,SEEK_CUR)) return false;\r
+       return true;\r
+}\r
+\r
+bool readLH(FILE *f, LISTHEADER *lh)\r
+{\r
+       if (!fread(&lh->lstID,4,1,f)) return false;\r
+       if (!fread(&lh->lstSize,4,1,f)) return false;\r
+       if (!fread(&lh->lstType,4,1,f)) return false;\r
+       return true;\r
+}\r
+\r
+bool writeLH(FILE *o, LISTHEADER *lh)\r
+{\r
+       if (!fwrite(&lh->lstID,4,1,o)) return false;\r
+       if (!fwrite(&lh->lstSize,4,1,o)) return false;\r
+       if (!fwrite(&lh->lstType,4,1,o)) return false;\r
+       wpos += 12;\r
+       return true;\r
+}\r
+\r
+bool readLHChunk(FILE *f, LISTHEADER *lh, char *fourCC, DWORD size)\r
+{\r
+       if (lh->chkHd) delete lh->chkHd;\r
+       lh->chkHd = new CHUNKHEADER();\r
+       if (!lh->chkHd) return false;\r
+       if (!fread(&lh->chkHd->ckID,4,1,f)) return false;\r
+       if (lh->chkHd->ckID != MAKE_FOURCC(fourCC)) return false;\r
+       if (!fread(&lh->chkHd->ckSize,4,1,f)) return false;\r
+       if (lh->chkHd->ckSize != size) return false;\r
+       if (lh->chkHd->ckData) free(lh->chkHd->ckData);\r
+       lh->chkHd->ckDataSize = lh->chkHd->ckSize+(lh->chkHd->ckSize&1);\r
+       lh->chkHd->ckData = malloc(lh->chkHd->ckDataSize);\r
+       if (!lh->chkHd->ckData) return false;\r
+       if (!fread(lh->chkHd->ckData,lh->chkHd->ckSize,1,f)) return false;\r
+       return true;\r
+}\r
+\r
+bool writeLHChunk(FILE *o, LISTHEADER *lh)\r
+{\r
+       if (!fwrite(&lh->chkHd->ckID,4,1,o)) return false;\r
+       if (!fwrite(&lh->chkHd->ckSize,4,1,o)) return false;\r
+       if (!fwrite(lh->chkHd->ckData,lh->chkHd->ckDataSize,1,o)) return false;\r
+       wpos += 8+lh->chkHd->ckDataSize;\r
+       return true;\r
+}\r
+\r
+bool scanForChunk(FILE *f, FILE *o, CHUNKHEADER *ch, char *fourCC, bool force, bool write)\r
+{\r
+repeat:\r
+       if (!fread(&ch->ckID,4,1,f)) return false;\r
+       if (!fread(&ch->ckSize,4,1,f)) return false;\r
+       if (ch->ckID == MAKE_FOURCC(fourCC) ||\r
+               ((MAKE_FOURCC(fourCC)&0xFFFF0000) == 0x63640000 && (ch->ckID&0xFFFF0000) == 0x62640000) ||\r
+               ((MAKE_FOURCC(fourCC)&0xFFFF0000) == 0x62640000 && (ch->ckID&0xFFFF0000) == 0x63640000))\r
+       {\r
+               if (fseek(f, -8, SEEK_CUR)) return false;\r
+               return true;\r
+       }\r
+       else\r
+       {\r
+               if (force) return false;\r
+               DWORD pad_size = ch->ckSize+(ch->ckSize&1);\r
+               if (write) \r
+               {\r
+                       if (tbuf.size <= pad_size+12)\r
+                       {\r
+                               if (tbuf.data) free(tbuf.data);\r
+                               tbuf.data = malloc(pad_size+12);\r
+                               if (!tbuf.data) return false;\r
+                               tbuf.size = pad_size+12;\r
+                       }\r
+                       if (!fread(tbuf.data,pad_size,1,f)) return false;\r
+                       if (!fwrite(&ch->ckID,4,1,o)) return false;\r
+                       if (!fwrite(&ch->ckSize,4,1,o)) return false;\r
+                       if (!fwrite(tbuf.data,pad_size,1,o)) return false;\r
+                       wpos += 8+pad_size;\r
+               }\r
+               else\r
+               {\r
+                       if (fseek(f,pad_size,SEEK_CUR))\r
+                               return false;\r
+               }\r
+               goto repeat;\r
+       }\r
+       return false;\r
+}\r
+\r
+bool readChunk(FILE *f, CHUNKHEADER *ch)\r
+{\r
+       if (!fread(&ch->ckID,4,1,f)) return false;\r
+       if (!fread(&ch->ckSize,4,1,f)) return false;\r
+       DWORD pad_size = ch->ckSize+(ch->ckSize&1);\r
+       if (ch->ckDataSize <= pad_size+12)\r
+       {\r
+               if (ch->ckData) free(ch->ckData);\r
+               ch->ckData = malloc(pad_size+12);\r
+               if (!ch->ckData) return false;\r
+               ch->ckDataSize = pad_size+12;\r
+       }\r
+       if (!fread(ch->ckData,pad_size,1,f) && pad_size != 0) return false;\r
+       return true;\r
+}\r
+\r
+bool readChunkHD(FILE *f, CHUNKHEADER *ch, bool seek)\r
+{\r
+       if (!fread(&ch->ckID,4,1,f)) return false;\r
+       if (!fread(&ch->ckSize,4,1,f)) return false;\r
+       if (seek) { if (fseek(f,ch->ckSize+(ch->ckSize&1),SEEK_CUR)) return false; }\r
+       return true;\r
+}\r
+\r
+bool writeChunk(FILE *o, CHUNKHEADER *ch)\r
+{\r
+       if (!fwrite(&ch->ckID,4,1,o)) return false;\r
+       if (!fwrite(&ch->ckSize,4,1,o)) return false;\r
+       DWORD pad_size = ch->ckSize+(ch->ckSize&1);\r
+       if (!fwrite(ch->ckData,pad_size,1,o)) return false;\r
+       wpos += 8+pad_size;\r
+       return true;\r
+}\r
+\r
+bool writeChunkHD(FILE *o, CHUNKHEADER *ch)\r
+{\r
+       if (!fwrite(&ch->ckID,4,1,o)) return false;\r
+       if (!fwrite(&ch->ckSize,4,1,o)) return false;\r
+       wpos += 8;\r
+       return true;\r
+}\r
+\r
+bool readIndexChunk(FILE *f, AVIOLDINDEX *index, int size)\r
+{\r
+       if (!fread(index,size,1,f)) return false;\r
+       return true;\r
+}\r
+\r
+bool writeIndexChunk(FILE *o, AVIOLDINDEX *index, int size)\r
+{\r
+       if (!fwrite(index,size,1,o)) return false;\r
+       wpos += size;\r
+       return true;\r
+}\r
+\r
+void closeFiles(FILE *f, FILE *o, FILE *tcf, DWORD *repCount, DWORD *offsets, \r
+                               bool ul, char *oname, char *tcfname, char *fbuf, char *obuf)\r
+{\r
+       if (f) fclose(f);\r
+       if (o) \r
+       {\r
+               fclose(o);\r
+               if (ul && oname) unlink(oname);\r
+       }\r
+       if (tcf) \r
+       {\r
+               fclose(tcf);\r
+               if (ul && tcfname) unlink(tcfname);\r
+       }\r
+       if (repCount) free(repCount);\r
+       if (offsets) free(offsets);\r
+       if (fbuf) _aligned_free(fbuf);\r
+       if (obuf) _aligned_free(obuf);\r
+}\r
+\r
+bool getInfo(FILE *f, DWORD &frameCount, DWORD &newFrameCount, double &fps, DWORD *&repCount,\r
+                        DWORD *&offsets, DWORD &nmovi_size, DWORD &nhdrl_size)\r
+{\r
+       bool stop;\r
+\r
+       /* Check for valid RIFF header. */\r
+       RIFFHEADER rh;\r
+       if (!checkRiffHeader(f, NULL, &rh, false))\r
+       {\r
+               printf("Invalid RIFF header (not an avi file).\n");\r
+               return false;\r
+       }\r
+\r
+       /* Scan until first "LIST" fourcc.  The first one should be "hdrl" type. */\r
+       LISTHEADER hdrl;\r
+       if (!scanForList(f, NULL, &hdrl, "hdrl", "FFFF", true, false, stop))\r
+       {\r
+               printf("First LIST is invalid.\n");\r
+               return false;\r
+       }\r
+       if (!readLH(f, &hdrl)) return false;\r
+       nhdrl_size = hdrl.lstSize;\r
+\r
+       /* Next should be the "avih" chunk with the main AVI Header. */\r
+       if (!readLHChunk(f, &hdrl, "avih", sizeof(AVIMAINHEADER)))\r
+       {\r
+               printf("Error reading avih CHUNK.\n");\r
+               return false;\r
+       }\r
+       AVIMAINHEADER* am = (AVIMAINHEADER*)hdrl.chkHd->ckData;\r
+       frameCount = am->dwTotalFrames;\r
+       DWORD streamCount = am->dwStreams;\r
+\r
+       /* Make sure that the file has an "idx1" index. */\r
+       if (!(am->dwFlags&0x00000010))\r
+       {\r
+               printf("File has no \"idx1\" index (dwFlags).\n");\r
+               return false;\r
+       }\r
+\r
+       /* Make sure that AVIF_MUSTUSEINDEX is not set. */\r
+       if (am->dwFlags&0x00000020)\r
+       {\r
+               printf("Cannot use a file with AVIF_MUSTUSEINDEX flag set.\n");\r
+               return false;\r
+       }\r
+\r
+       /* Next should be an "strl" list for each stream. */\r
+       LISTHEADER strl;\r
+       int count = 0, vstream = -20;\r
+       for (DWORD j=0; j<streamCount; ++j)\r
+       {\r
+               LISTHEADER tstrl;\r
+               if (!scanForList(f, NULL, &tstrl, "strl", "FFFF", true, false, stop))\r
+               {\r
+                       printf("strl LIST is invalid or was not found.\n");\r
+                       return false;\r
+               }\r
+               if (!readLH(f, &tstrl)) return false;\r
+               /* Next should be the "strh" chunk which is an AVISTREAMHEADER structure. */\r
+               if (!readLHChunk(f, &tstrl, "strh", sizeof(AVISTREAMHEADER)))\r
+               {\r
+                       printf("Error reading strh CHUNK.\n");\r
+                       return false;\r
+               }\r
+               /* See if it is a video stream. */\r
+               if (((AVISTREAMHEADER*)tstrl.chkHd->ckData)->fccType == MAKE_FOURCC("vids"))\r
+               {\r
+                       ++count;\r
+                       vstream = j;\r
+                       if (count > 1)\r
+                       {\r
+                               printf("More than 1 video stream present.\n");\r
+                               return false;\r
+                       }\r
+                       strl = tstrl;\r
+               }\r
+               else nhdrl_size -= 8+tstrl.lstSize;\r
+               if (fseek(f,tstrl.lstSize-12-sizeof(AVISTREAMHEADER),SEEK_CUR)) \r
+                       return false;\r
+       }\r
+       if (!count)\r
+       {\r
+               printf("No video stream present.\n");\r
+               return false;\r
+       }\r
+       AVISTREAMHEADER* ash = (AVISTREAMHEADER*)strl.chkHd->ckData;\r
+       fps = double(ash->dwRate)/double(ash->dwScale);\r
+       \r
+       /* Make sure that AVISF_VIDEO_PALCHANGES is not set. */\r
+       if (ash->dwFlags&0x00010000)\r
+       {\r
+               printf("Cannot use a stream with AVISF_VIDEO_PALCHANGES flag set.\n");\r
+               return false;\r
+       }\r
+\r
+       /* Next grab the AVI2 "odml" LIST. */\r
+       LISTHEADER odml;\r
+       if (!scanForList(f, NULL, &odml, "odml", "movi", false, false, stop))\r
+       {\r
+               if (stop) { goto noodml; }\r
+               printf("odml LIST was invalid or was not found.\n");\r
+               return false;\r
+       }\r
+       if (!readLH(f, &odml)) return false;\r
+\r
+       /* Now should be the "dmlh" CHUNK. */\r
+       if (!readLHChunk(f, &odml, "dmlh", sizeof(AVIEXTHEADER)))\r
+       {\r
+               printf("Error reading dmlh CHUNK.\n");\r
+               return false;\r
+       }\r
+\r
+       /* Make sure frame counts match. */\r
+       if (frameCount != ((AVIEXTHEADER*)odml.chkHd->ckData)->dwGrandFrames)\r
+       {\r
+               printf("Frame counts don't match.\n");\r
+               return false;\r
+       }\r
+\r
+       /* Next scan to the "movi" list. */\r
+noodml:\r
+       LISTHEADER movi;\r
+       if (!scanForList(f, NULL, &movi, "movi", "FFFF", false, false, stop))\r
+       {\r
+               printf("movi LIST was invalid or was not found.\n");\r
+               return false;\r
+       }\r
+       if (!readLH(f, &movi)) return false;\r
+\r
+       /* Allocate repCount/offsets array */\r
+       repCount = (DWORD*)malloc(frameCount*sizeof(DWORD));\r
+       if (!repCount)\r
+       {\r
+               printf("malloc failure (repCount).\n");\r
+               return false;\r
+       }\r
+       memset(repCount, 0, frameCount*sizeof(DWORD));\r
+       offsets = (DWORD*)malloc(frameCount*sizeof(DWORD));\r
+       if (!offsets)\r
+       {\r
+               printf("malloc failure (offsets).\n");\r
+               return false;\r
+       }\r
+       memset(offsets, 0, frameCount*sizeof(DWORD));\r
+\r
+       /* Seek to "idx1" index and parse info. */\r
+       if (fseek(f,movi.lstSize-4,SEEK_CUR)) return false;\r
+       CHUNKHEADER idx1;\r
+       AVIOLDINDEX index;\r
+       if (!scanForChunk(f, NULL, &idx1, "idx1", false, false))\r
+       {\r
+               printf("idx1 index chunk was not found or invalid.\n");\r
+               return false;\r
+       }\r
+       if (!readChunkHD(f, &idx1, false)) return false;\r
+       DWORD i = 0, v = 0, ncount = 0, sum = 4;\r
+       nmovi_size = 0;\r
+       char buf1[5], buf2[5];\r
+       sprintf(buf1,"%2.2d%s", vstream, "dc");\r
+       sprintf(buf2,"%2.2d%s", vstream, "db");\r
+       while(1)\r
+       {\r
+               if (!readIndexChunk(f, &index, sizeof(AVIOLDINDEX))) break;\r
+               if (index.dwChunkId != MAKE_FOURCC(buf1) && index.dwChunkId != MAKE_FOURCC(buf2)) \r
+                       continue;\r
+               if (index.dwSize == 0) { repCount[v-1]++; ++ncount; }\r
+               else \r
+               {\r
+                       offsets[v] = sum;\r
+                       sum += 8+index.dwSize+(index.dwSize&1);\r
+                       ++v;\r
+               }\r
+               if (!(i&15))\r
+                       printf("\rFrame Parsing Progress: %3.2f%c (%d)", \r
+                               double(i)*100.0/double(frameCount), '%', ncount); \r
+               ++i;\r
+       }\r
+       printf("\rFrame Parsing Progress: %3.2f%c (%d)\n", \r
+               double(i)*100.0/double(frameCount), '%', ncount);\r
+       if (i != frameCount)\r
+       {\r
+               printf("Number of data chunks does not match frame count.\n");\r
+               return false;\r
+       }\r
+       nmovi_size = sum;\r
+       newFrameCount = v;\r
+       if (newFrameCount == frameCount)\r
+       {\r
+               printf("Video stream does not contain any NULL frames.\n");\r
+               return false;\r
+       }\r
+       return true;\r
+}\r
+\r
+bool createTCFile(FILE *tcf, DWORD newFrameCount, double fps, DWORD *repCount, int mode)\r
+{\r
+       if (mode == 1 || mode == 3 || mode == 5)\r
+       {\r
+               fprintf(tcf, "# timecode format v1\n");\r
+               int mfps;\r
+               bool tfr = int(fps*1000000+0.5f) == 119880120 ? true : false; \r
+               if (tfr) \r
+               {\r
+                       mfps = 29970030;\r
+                       fprintf(tcf, "Assume 29.970030\n");\r
+               }\r
+               else \r
+               {\r
+                       mfps = 29970000;\r
+                       fprintf(tcf, "Assume 29.970000\n");\r
+               }\r
+               DWORD i = 0;\r
+               int crep, prep = -20, last = 0;\r
+               double rate;\r
+               while (i < newFrameCount)\r
+               {\r
+                       crep = repCount[i];\r
+                       if (crep != prep && prep != -20)\r
+                       {\r
+                               if (int(rate*1000000+0.5f) != mfps)\r
+                                       fprintf(tcf, "%d,%d,%4.6f\n", last, i-1, rate);\r
+                               last = i;\r
+                       }\r
+                       rate = fps/double(repCount[i]+1);\r
+                       prep = crep;\r
+                       ++i;\r
+               }\r
+               if (int(rate*1000000+0.5f) != mfps)\r
+                       fprintf(tcf, "%d,%d,%4.6f\n", last, newFrameCount-1, rate);\r
+               fprintf(tcf, "# Total Frames:  %d\n", newFrameCount);\r
+       }\r
+       else if (mode == 2 || mode == 4 || mode == 6)\r
+       {\r
+               fprintf(tcf, "# timecode format v2\n");\r
+               DWORD i = 0, sum = 0;\r
+               while (i < newFrameCount)\r
+               {\r
+                       fprintf(tcf, "%3.6f\n", double(sum)*1000.0/fps);\r
+                       sum += repCount[i]+1;\r
+                       ++i;\r
+               }\r
+       }\r
+       else\r
+       {\r
+               printf("Invalid mode value.\n");\r
+               return false;\r
+       }\r
+       fclose(tcf);\r
+       tcf = NULL;\r
+       printf("Timecode file created successfully.\n");\r
+       return true;\r
+}\r
+\r
+bool createAVIFile(FILE *f, FILE *o, DWORD newFrameCount, DWORD frameCount, DWORD *offsets,\r
+                                  DWORD nmovi_size, DWORD nhdrl_size)\r
+{\r
+       bool stop;\r
+\r
+       /* Reset file pointers to beginning. */\r
+       if (fseek(f,0,SEEK_SET)) return false;\r
+       if (fseek(o,0,SEEK_SET)) return false;\r
+\r
+       /* Check for valid RIFF header. */\r
+       RIFFHEADER rh;\r
+       if (!checkRiffHeader(f, o, &rh, true))\r
+       {\r
+               printf("Invalid RIFF header (not an avi file).\n");\r
+               return false;\r
+       }\r
+\r
+       /* Scan until first "LIST" fourcc.  The first one should be "hdrl" type. */\r
+       LISTHEADER hdrl;\r
+       if (!scanForList(f, o, &hdrl, "hdrl", "FFFF", true, true, stop))\r
+       {\r
+               printf("First LIST is invalid.\n");\r
+               return false;\r
+       }\r
+       if (!readLH(f, &hdrl)) return false;\r
+       hdrl.lstSize = nhdrl_size;\r
+       if (!writeLH(o, &hdrl)) return false;\r
+\r
+       /* Next should be the "avih" chunk with the main AVI Header. */\r
+       if (!readLHChunk(f, &hdrl, "avih", sizeof(AVIMAINHEADER)))\r
+       {\r
+               printf("Error reading avih CHUNK.\n");\r
+               return false;\r
+       }\r
+       AVIMAINHEADER* am = (AVIMAINHEADER*)hdrl.chkHd->ckData;\r
+       DWORD streamCount = am->dwStreams;\r
+       am->dwMicroSecPerFrame = 33367;\r
+       am->dwStreams = 1;\r
+       am->dwTotalFrames = newFrameCount;\r
+       if (!writeLHChunk(o, &hdrl)) return false;\r
+\r
+       /* Next should be an "strl" list for each stream. */\r
+       LISTHEADER strl;\r
+       int count = 0, vstream = -20;\r
+       DWORD tsize = 0;\r
+       for (DWORD j=0; j<streamCount; ++j)\r
+       {\r
+               LISTHEADER tstrl;\r
+               if (!scanForList(f, o, &tstrl, "strl", "FFFF", true, false, stop))\r
+               {\r
+                       printf("strl LIST is invalid or was not found.\n");\r
+                       return false;\r
+               }\r
+               if (!readLH(f, &tstrl)) return false;\r
+               /* Next should be the "strh" chunk which is an AVISTREAMHEADER structure. */\r
+               if (!readLHChunk(f, &tstrl, "strh", sizeof(AVISTREAMHEADER)))\r
+               {\r
+                       printf("Error reading strh CHUNK.\n");\r
+                       return false;\r
+               }\r
+               /* See if it is a video stream. */\r
+               if (((AVISTREAMHEADER*)tstrl.chkHd->ckData)->fccType == MAKE_FOURCC("vids"))\r
+               {\r
+                       ++count;\r
+                       vstream = j;\r
+                       if (count > 1)\r
+                       {\r
+                               printf("More than 1 video stream present.\n");\r
+                               return false;\r
+                       }\r
+                       strl = tstrl;\r
+                       tsize = strl.lstSize-12-sizeof(AVISTREAMHEADER);\r
+                       if (tbuf.size <= tsize+12)\r
+                       {\r
+                               if (tbuf.data) free(tbuf.data);\r
+                               tbuf.data = malloc(tsize+12);\r
+                               if (!tbuf.data) return false;\r
+                               tbuf.size = tsize+12;\r
+                       }\r
+                       if (!fread(tbuf.data,tsize,1,f)) return false;\r
+               }\r
+               else\r
+               {\r
+                       if (fseek(f,tstrl.lstSize-12-sizeof(AVISTREAMHEADER),SEEK_CUR)) \r
+                               return false;\r
+               }\r
+       }\r
+       if (!count)\r
+       {\r
+               printf("No video stream present.\n");\r
+               return false;\r
+       }\r
+       AVISTREAMHEADER* ash = (AVISTREAMHEADER*)strl.chkHd->ckData;\r
+       ash->dwLength = newFrameCount;\r
+       ash->dwRate = 30000;\r
+       ash->dwScale = 1001;\r
+       if (!writeLH(o, &strl)) return false;\r
+       if (!writeLHChunk(o, &strl)) return false;\r
+       if (!fwrite(tbuf.data,tsize,1,o)) return false;\r
+       wpos += tsize;\r
+\r
+       /* Next grab the AVI2 "odml" LIST. */\r
+       LISTHEADER odml;\r
+       if (!scanForList(f, o, &odml, "odml", "movi", false, true, stop))\r
+       {\r
+               if (stop) { goto noodml; }\r
+               printf("odml LIST was invalid or was not found.\n");\r
+               return false;\r
+       }\r
+       if (!readLH(f, &odml)) return false;\r
+       if (!writeLH(o, &odml)) return false;\r
+\r
+       /* Now should be the "dmlh" CHUNK. */\r
+       if (!readLHChunk(f, &odml, "dmlh", sizeof(AVIEXTHEADER)))\r
+       {\r
+               printf("Error reading dmlh CHUNK.\n");\r
+               return false;\r
+       }\r
+       AVIEXTHEADER *aeh = (AVIEXTHEADER*)odml.chkHd->ckData;\r
+       aeh->dwGrandFrames = newFrameCount;\r
+       if (!writeLHChunk(o, &odml)) return false;\r
+\r
+       /* Next scan to the "movi" list. */\r
+noodml:\r
+       LISTHEADER movi;\r
+       if (!scanForList(f, o, &movi, "movi", "FFFF", false, true, stop))\r
+       {\r
+               printf("movi LIST was invalid or was not found.\n");\r
+               return false;\r
+       }\r
+       if (!readLH(f, &movi)) return false;\r
+       movi.lstSize = nmovi_size;\r
+       if (!writeLH(o, &movi)) return false;\r
+\r
+       /* Read all data chunks in the stream and count drop frames. */\r
+       CHUNKHEADER ch;\r
+       DWORD i = 0, v = 0, sum = 0;\r
+       char buf1[5], buf2[5];\r
+       sprintf(buf1,"%2.2d%s", vstream, "dc");\r
+       sprintf(buf2,"%2.2d%s", vstream, "db");\r
+       while (i < frameCount)\r
+       {\r
+               if (!scanForChunk(f, o, &ch, buf1, false, false)) break;\r
+               if (!readChunk(f, &ch)) return false;\r
+               if (ch.ckSize != 0) \r
+               {\r
+                       ch.ckID &= 0xFFFF0000;\r
+                       ch.ckID |= 0x00003030;\r
+                       if (!writeChunk(o, &ch)) return false; \r
+               }\r
+               if (!(i&15))\r
+                       printf("\rFrame Modification Progress: %3.2f%c", \r
+                               double(i)*100.0/double(frameCount), '%'); \r
+               ++i;\r
+       }\r
+       printf("\rFrame Modification Progress: %3.2f%c\n", \r
+               double(i)*100.0/double(frameCount), '%');\r
+       if (i != frameCount)\r
+       {\r
+               printf("Number of data chunks does not match frame count.\n");\r
+               return false;\r
+       }\r
+\r
+       /* Read the "idx1" index and modify the entries as required. */\r
+       i = 0, sum = 0;\r
+       CHUNKHEADER idx1;\r
+       AVIOLDINDEX index;\r
+       if (!scanForChunk(f, o, &idx1, "idx1", false, true))\r
+       {\r
+               printf("idx1 index chunk was not found or invalid.\n");\r
+               return false;\r
+       }\r
+       if (!readChunkHD(f, &idx1, false)) return false;\r
+       idx1.ckSize = newFrameCount*sizeof(AVIOLDINDEX);\r
+       if (!writeChunkHD(o, &idx1)) return false;\r
+       while(1)\r
+       {\r
+               if (!readIndexChunk(f, &index, sizeof(AVIOLDINDEX))) break;\r
+               if (index.dwChunkId == MAKE_FOURCC(buf1) || index.dwChunkId == MAKE_FOURCC(buf2)) \r
+               {\r
+                       if (index.dwSize == 0) continue;\r
+                       index.dwOffset = offsets[i];\r
+                       index.dwChunkId &= 0xFFFF0000;\r
+                       index.dwChunkId |= 0x00003030;\r
+                       if (!writeIndexChunk(o, &index, sizeof(AVIOLDINDEX))) return false;\r
+                       if (!(i&15))\r
+                               printf("\rIndex Modification Progress: %3.2f%c", \r
+                                       double(i)*100.0/double(newFrameCount), '%');\r
+                       ++i;\r
+               }\r
+       }\r
+       printf("\rIndex Modification Progress: %3.2f%c\n", \r
+               double(i)*100.0/double(newFrameCount), '%');\r
+       if (i != newFrameCount)\r
+       {\r
+               printf("Number of index chunks does not match frame count.\n");\r
+               return false;\r
+       }\r
+\r
+       /* flush the end bits */\r
+       while (1)\r
+       {\r
+               DWORD ret = (DWORD)fread(tbuf.data,1,tbuf.size,f);\r
+               if (!ret) break;\r
+               if (!fwrite(tbuf.data,1,ret,o)) return false;\r
+               wpos += ret;\r
+       }\r
+\r
+       /* Modify the size value of the RIFF Header at the\r
+               beginning of the file. */\r
+       if (fseek(o, 0, SEEK_SET)) return false;\r
+       rh.fileSize = wpos-8;\r
+       if (!fwrite(&rh,1,12,o))\r
+       {\r
+               printf("Error writing to output file.\n");\r
+               return false;\r
+       }\r
+       return true;\r
+}\r
+\r
+bool createAVSFile(FILE *avsf, char *filename, DWORD newFrameCount, DWORD *repCount)\r
+{\r
+       DWORD *startFrames = (DWORD*)malloc(newFrameCount*sizeof(DWORD));\r
+       if (!startFrames)\r
+               return false;\r
+       DWORD *endFrames = (DWORD*)malloc(newFrameCount*sizeof(DWORD));\r
+       if (!endFrames)\r
+       {\r
+               free(startFrames);\r
+               return false;\r
+       }\r
+       DWORD *frameCounts = (DWORD*)malloc(newFrameCount*sizeof(DWORD));\r
+       if (!frameCounts)\r
+       {\r
+               free(startFrames);\r
+               free(endFrames);\r
+               return false;\r
+       }\r
+       memset(startFrames,0,newFrameCount*sizeof(DWORD));\r
+       memset(endFrames,0,newFrameCount*sizeof(DWORD));\r
+       memset(frameCounts,0,newFrameCount*sizeof(DWORD));\r
+       DWORD sectionCount = 0;\r
+       DWORD frameSum = 0;\r
+       long last = -1;\r
+       for (DWORD i=0; i<newFrameCount-1; ++i)\r
+       {\r
+               if (repCount[i] != repCount[i+1])\r
+               {\r
+                       startFrames[sectionCount] = frameSum;\r
+                       frameCounts[sectionCount] = repCount[i]+1;\r
+                       frameSum += (repCount[i]+1)*(i-last);\r
+                       endFrames[sectionCount] = frameSum-1;\r
+                       last = i;\r
+                       ++sectionCount;\r
+               }\r
+       }\r
+       startFrames[sectionCount] = frameSum;\r
+       frameCounts[sectionCount] = repCount[i]+1;\r
+       frameSum += (repCount[i]+1)*(i-last);\r
+       endFrames[sectionCount] = frameSum-1;\r
+       ++sectionCount;\r
+       fprintf(avsf, "Avisource(\"%s\")\n", filename);\r
+       char abuf[4096], tbuf[40];\r
+       sprintf(abuf,"");\r
+       for (DWORD j=0; j<sectionCount; ++j)\r
+       {\r
+               fprintf(avsf, "cfr%03d = Trim(%d,%d).SelectEvery(%d,0).AssumeFPS(30000,1001)\n", j,\r
+                       startFrames[j], endFrames[j], frameCounts[j]);\r
+               if (j == 0) sprintf(tbuf,"cfr%03d",j);\r
+               else sprintf(tbuf,"+cfr%03d",j);\r
+               strcat(abuf,tbuf);\r
+       }\r
+       fprintf(avsf, "%s\n", abuf);\r
+       free(startFrames);\r
+       free(endFrames);\r
+       free(frameCounts);\r
+       return true;\r
+}\r
+\r
+int main(int argc, char *argv[])\r
+{\r
+       DWORD frameCount, newFrameCount;\r
+       DWORD nmovi_size, nhdrl_size;\r
+       DWORD *repCount = 0, *offsets = 0;\r
+       clock_t start, finish;\r
+       double fps;\r
+       char *fbuf = 0, *obuf = 0;\r
+\r
+       printf("\ncfr2tc %s by tritical.\n", VERSION);\r
+\r
+       /* Check for valid syntax. */\r
+       if (argc != 5)\r
+       {\r
+               printf("Invalid syntax used.\n");\r
+               printf("Usage:    cfr2tc input_avi_file output_avi_or_avs_file timecode_file mode\n");\r
+               printf("Example:  cfr2tc c:\\test.avi c:\\video.avi c:\\timecodes.txt 1\n");\r
+               printf("Mode settings:  1 - v1 timecode file, avi output\n");\r
+               printf("                2 - v2 timecode file, avi output\n");\r
+               printf("                3 - v1 timecode file, no video output\n");\r
+               printf("                4 - v2 timecode file, no video output\n");\r
+               printf("                5 - v1 timecode file, avs output\n");\r
+               printf("                6 - v2 timecode file, avs output\n");\r
+               return 1;\r
+       }\r
+       start = clock();\r
+\r
+       /* Check for valid mode setting. */\r
+       int mode = atoi(argv[4]);\r
+       if (mode < 1 || mode > 6)\r
+       {\r
+               printf("Invalid mode setting (%d).\n", mode);\r
+               return 2;\r
+       }\r
+\r
+       /* Open the specified avi file. */\r
+       FILE *f = fopen(argv[1],"rb");\r
+       if (!f)\r
+       {\r
+               printf("Error opening input avi file.\n");\r
+               return 3;\r
+       }\r
+       fbuf = (char*)_aligned_malloc(65536*sizeof(char),32);\r
+       if (!fbuf)\r
+       {\r
+               printf("Error allocating file buffer for input avi file.\n");\r
+               closeFiles(f, NULL, NULL, repCount, offsets, false, NULL, NULL, fbuf, obuf);\r
+               return 4;\r
+       }\r
+       if (setvbuf(f,fbuf,_IOFBF,65536))\r
+       {\r
+               printf("Error setting input avi file buffer.\n");\r
+               closeFiles(f, NULL, NULL, repCount, offsets, false, NULL, NULL, fbuf, obuf);\r
+               return 5;\r
+       }\r
+\r
+       /* Open the output avi file. */\r
+       FILE *o = NULL;\r
+       if (mode < 3)\r
+       {\r
+               o = fopen(argv[2],"wb");\r
+               if (!o)\r
+               {\r
+                       printf("Error opening output avi file.\n");\r
+                       closeFiles(f, NULL, NULL, repCount, offsets, false, NULL, NULL, fbuf, obuf);\r
+                       return 6;\r
+               }\r
+               obuf = (char*)_aligned_malloc(65536*sizeof(char),32);\r
+               if (!obuf)\r
+               {\r
+                       printf("Error allocating file buffer for output avi file.\n");\r
+                       closeFiles(f, o, NULL, repCount, offsets, true, argv[2], NULL, fbuf, obuf);\r
+                       return 7;\r
+               }\r
+               if (setvbuf(o,obuf,_IOFBF,65536))\r
+               {\r
+                       printf("Error setting output avi file buffer.\n");\r
+                       closeFiles(f, o, NULL, repCount, offsets, true, argv[2], NULL, fbuf, obuf);\r
+                       return 8;\r
+               }\r
+       }\r
+\r
+       /* Open the timecode file. */\r
+       FILE *tcf = fopen(argv[3],"w");\r
+       if (!tcf)\r
+       {\r
+               printf("Error opening timecode file.\n");\r
+               closeFiles(f, o, NULL, repCount, offsets, true, argv[2], NULL, fbuf, obuf);\r
+               return 9;\r
+       }\r
+\r
+       /* Find fps and number of null frames. */\r
+       if (!getInfo(f, frameCount, newFrameCount, fps, repCount, offsets, nmovi_size, nhdrl_size))\r
+       {\r
+               closeFiles(f, o, tcf, repCount, offsets, true, argv[2], argv[3], fbuf, obuf);\r
+               return 10;\r
+       }\r
+\r
+       /* Create the timecode file. */\r
+       if (!createTCFile(tcf, newFrameCount, fps, repCount, mode))\r
+       {\r
+               closeFiles(f, o, tcf, repCount, offsets, true, argv[2], argv[3], fbuf, obuf);\r
+               return 11;\r
+       }\r
+\r
+       /* Create the output avi file with NULL frames removed. */\r
+       if (mode < 3)\r
+       {\r
+               if (!createAVIFile(f, o, newFrameCount, frameCount, offsets, nmovi_size, nhdrl_size))\r
+               {\r
+                       closeFiles(f, o, tcf, repCount, offsets, true, argv[2], argv[3], fbuf, obuf);\r
+                       return 12;\r
+               }\r
+       }\r
+\r
+       /* Create avs script */\r
+       if (mode > 4)\r
+       {\r
+               FILE *avsf = fopen(argv[2],"w");\r
+               if (!avsf)\r
+               {\r
+                       printf("Error creating avs file.\n");\r
+                       closeFiles(f, o, tcf, repCount, offsets, true, argv[2], argv[3], fbuf, obuf);\r
+                       return 13;\r
+               }\r
+               if (!createAVSFile(avsf, argv[1], newFrameCount, repCount))\r
+               {\r
+                       fclose(avsf);\r
+                       unlink(argv[2]);\r
+                       closeFiles(f, o, tcf, repCount, offsets, true, argv[2], argv[3], fbuf, obuf);\r
+                       return 14;\r
+               }\r
+               fclose(avsf);\r
+       }\r
+\r
+       /* Cleanup and finish. */\r
+       finish = clock();\r
+       printf("All processing completed successfully.\n");\r
+       printf("Time elapsed:  %3.3f seconds.\n", (double)(finish-start)/CLOCKS_PER_SEC);\r
+       closeFiles(f, o, tcf, repCount, offsets, false, NULL, NULL, fbuf, obuf);\r
+       return 0;\r
+}
\ No newline at end of file
diff --git a/tstools/cfr2tc/cfr2tc/cfr2tc.rc b/tstools/cfr2tc/cfr2tc/cfr2tc.rc
new file mode 100644 (file)
index 0000000..0746be5
--- /dev/null
@@ -0,0 +1,98 @@
+// Microsoft Visual C++ generated resource script.\r
+//\r
+#include "resource.h"\r
+\r
+#define APSTUDIO_READONLY_SYMBOLS\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Generated from the TEXTINCLUDE 2 resource.\r
+//\r
+#include "afxres.h"\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+#undef APSTUDIO_READONLY_SYMBOLS\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+// English (U.S.) resources\r
+\r
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r
+#ifdef _WIN32\r
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US\r
+#pragma code_page(1252)\r
+#endif //_WIN32\r
+\r
+#ifdef APSTUDIO_INVOKED\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// TEXTINCLUDE\r
+//\r
+\r
+1 TEXTINCLUDE \r
+BEGIN\r
+    "resource.h\0"\r
+END\r
+\r
+2 TEXTINCLUDE \r
+BEGIN\r
+    "#include ""afxres.h""\r\n"\r
+    "\0"\r
+END\r
+\r
+3 TEXTINCLUDE \r
+BEGIN\r
+    "\r\n"\r
+    "\0"\r
+END\r
+\r
+#endif    // APSTUDIO_INVOKED\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Version\r
+//\r
+\r
+VS_VERSION_INFO VERSIONINFO\r
+ FILEVERSION 1,4,0,0\r
+ PRODUCTVERSION 1,4,0,0\r
+ FILEFLAGSMASK 0x17L\r
+#ifdef _DEBUG\r
+ FILEFLAGS 0x1L\r
+#else\r
+ FILEFLAGS 0x0L\r
+#endif\r
+ FILEOS 0x4L\r
+ FILETYPE 0x1L\r
+ FILESUBTYPE 0x0L\r
+BEGIN\r
+    BLOCK "StringFileInfo"\r
+    BEGIN\r
+        BLOCK "040904b0"\r
+        BEGIN\r
+            VALUE "FileDescription", "cfr2tc v1.4"\r
+            VALUE "FileVersion", "1, 4, 0, 0"\r
+            VALUE "LegalCopyright", "Copyright (C) 2005-2006  Kevin Stone"\r
+            VALUE "ProductVersion", "1, 4, 0, 0"\r
+        END\r
+    END\r
+    BLOCK "VarFileInfo"\r
+    BEGIN\r
+        VALUE "Translation", 0x409, 1200\r
+    END\r
+END\r
+\r
+#endif    // English (U.S.) resources\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+\r
+\r
+#ifndef APSTUDIO_INVOKED\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Generated from the TEXTINCLUDE 3 resource.\r
+//\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+#endif    // not APSTUDIO_INVOKED\r
+\r
diff --git a/tstools/cfr2tc/cfr2tc/cfr2tc.sln b/tstools/cfr2tc/cfr2tc/cfr2tc.sln
new file mode 100644 (file)
index 0000000..e7f42c6
--- /dev/null
@@ -0,0 +1,21 @@
+Microsoft Visual Studio Solution File, Format Version 8.00\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cfr2tc", "cfr2tc.vcproj", "{704D6D1C-F126-416E-9303-F62F4C8D7886}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+       EndProjectSection\r
+EndProject\r
+Global\r
+       GlobalSection(SolutionConfiguration) = preSolution\r
+               Debug = Debug\r
+               Release = Release\r
+       EndGlobalSection\r
+       GlobalSection(ProjectConfiguration) = postSolution\r
+               {704D6D1C-F126-416E-9303-F62F4C8D7886}.Debug.ActiveCfg = Debug|Win32\r
+               {704D6D1C-F126-416E-9303-F62F4C8D7886}.Debug.Build.0 = Debug|Win32\r
+               {704D6D1C-F126-416E-9303-F62F4C8D7886}.Release.ActiveCfg = Release|Win32\r
+               {704D6D1C-F126-416E-9303-F62F4C8D7886}.Release.Build.0 = Release|Win32\r
+       EndGlobalSection\r
+       GlobalSection(ExtensibilityGlobals) = postSolution\r
+       EndGlobalSection\r
+       GlobalSection(ExtensibilityAddIns) = postSolution\r
+       EndGlobalSection\r
+EndGlobal\r
diff --git a/tstools/cfr2tc/cfr2tc/cfr2tc.vcproj b/tstools/cfr2tc/cfr2tc/cfr2tc.vcproj
new file mode 100644 (file)
index 0000000..c24c970
--- /dev/null
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="7.10"\r
+       Name="cfr2tc"\r
+       ProjectGUID="{704D6D1C-F126-416E-9303-F62F4C8D7886}"\r
+       Keyword="Win32Proj">\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"/>\r
+       </Platforms>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="Debug"\r
+                       IntermediateDirectory="Debug"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="2">\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"\r
+                               MinimalRebuild="TRUE"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="5"\r
+                               BufferSecurityCheck="TRUE"\r
+                               EnableFunctionLevelLinking="TRUE"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="TRUE"\r
+                               DebugInformationFormat="4"/>\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"/>\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               OutputFile="$(OutDir)/cfr2tc.exe"\r
+                               LinkIncremental="2"\r
+                               GenerateDebugInformation="TRUE"\r
+                               ProgramDatabaseFile="$(OutDir)/cfr2tc.pdb"\r
+                               SubSystem="1"\r
+                               OptimizeReferences="1"\r
+                               EnableCOMDATFolding="1"\r
+                               TargetMachine="1"/>\r
+                       <Tool\r
+                               Name="VCMIDLTool"/>\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"/>\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"/>\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"/>\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"/>\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"/>\r
+                       <Tool\r
+                               Name="VCManagedWrapperGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCAuxiliaryManagedWrapperGeneratorTool"/>\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="Release"\r
+                       IntermediateDirectory="Release"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="2">\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               ImproveFloatingPointConsistency="TRUE"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"\r
+                               RuntimeLibrary="4"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="TRUE"\r
+                               DebugInformationFormat="3"/>\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"/>\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               OutputFile="$(OutDir)/cfr2tc.exe"\r
+                               LinkIncremental="1"\r
+                               GenerateDebugInformation="TRUE"\r
+                               SubSystem="1"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               TargetMachine="1"/>\r
+                       <Tool\r
+                               Name="VCMIDLTool"/>\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"/>\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"/>\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"/>\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"/>\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"/>\r
+                       <Tool\r
+                               Name="VCManagedWrapperGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCAuxiliaryManagedWrapperGeneratorTool"/>\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">\r
+                       <File\r
+                               RelativePath=".\cfr2tc.cpp">\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">\r
+                       <File\r
+                               RelativePath=".\resource.h">\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"\r
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">\r
+                       <File\r
+                               RelativePath=".\cfr2tc.rc">\r
+                       </File>\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
diff --git a/tstools/cfr2tc/cfr2tc/resource.h b/tstools/cfr2tc/cfr2tc/resource.h
new file mode 100644 (file)
index 0000000..6ce7548
--- /dev/null
@@ -0,0 +1,14 @@
+//{{NO_DEPENDENCIES}}\r
+// Microsoft Visual C++ generated include file.\r
+// Used by cfr2tc.rc\r
+\r
+// Next default values for new objects\r
+// \r
+#ifdef APSTUDIO_INVOKED\r
+#ifndef APSTUDIO_READONLY_SYMBOLS\r
+#define _APS_NEXT_RESOURCE_VALUE        101\r
+#define _APS_NEXT_COMMAND_VALUE         40001\r
+#define _APS_NEXT_CONTROL_VALUE         1001\r
+#define _APS_NEXT_SYMED_VALUE           101\r
+#endif\r
+#endif\r
diff --git a/tstools/cfr2tc/gpl.txt b/tstools/cfr2tc/gpl.txt
new file mode 100644 (file)
index 0000000..45645b4
--- /dev/null
@@ -0,0 +1,340 @@
+                   GNU GENERAL PUBLIC LICENSE\r
+                      Version 2, June 1991\r
+\r
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.\r
+                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
+ Everyone is permitted to copy and distribute verbatim copies\r
+ of this license document, but changing it is not allowed.\r
+\r
+                           Preamble\r
+\r
+  The licenses for most software are designed to take away your\r
+freedom to share and change it.  By contrast, the GNU General Public\r
+License is intended to guarantee your freedom to share and change free\r
+software--to make sure the software is free for all its users.  This\r
+General Public License applies to most of the Free Software\r
+Foundation's software and to any other program whose authors commit to\r
+using it.  (Some other Free Software Foundation software is covered by\r
+the GNU Library General Public License instead.)  You can apply it to\r
+your programs, too.\r
+\r
+  When we speak of free software, we are referring to freedom, not\r
+price.  Our General Public Licenses are designed to make sure that you\r
+have the freedom to distribute copies of free software (and charge for\r
+this service if you wish), that you receive source code or can get it\r
+if you want it, that you can change the software or use pieces of it\r
+in new free programs; and that you know you can do these things.\r
+\r
+  To protect your rights, we need to make restrictions that forbid\r
+anyone to deny you these rights or to ask you to surrender the rights.\r
+These restrictions translate to certain responsibilities for you if you\r
+distribute copies of the software, or if you modify it.\r
+\r
+  For example, if you distribute copies of such a program, whether\r
+gratis or for a fee, you must give the recipients all the rights that\r
+you have.  You must make sure that they, too, receive or can get the\r
+source code.  And you must show them these terms so they know their\r
+rights.\r
+\r
+  We protect your rights with two steps: (1) copyright the software, and\r
+(2) offer you this license which gives you legal permission to copy,\r
+distribute and/or modify the software.\r
+\r
+  Also, for each author's protection and ours, we want to make certain\r
+that everyone understands that there is no warranty for this free\r
+software.  If the software is modified by someone else and passed on, we\r
+want its recipients to know that what they have is not the original, so\r
+that any problems introduced by others will not reflect on the original\r
+authors' reputations.\r
+\r
+  Finally, any free program is threatened constantly by software\r
+patents.  We wish to avoid the danger that redistributors of a free\r
+program will individually obtain patent licenses, in effect making the\r
+program proprietary.  To prevent this, we have made it clear that any\r
+patent must be licensed for everyone's free use or not licensed at all.\r
+\r
+  The precise terms and conditions for copying, distribution and\r
+modification follow.\r
+\f\r
+                   GNU GENERAL PUBLIC LICENSE\r
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\r
+\r
+  0. This License applies to any program or other work which contains\r
+a notice placed by the copyright holder saying it may be distributed\r
+under the terms of this General Public License.  The "Program", below,\r
+refers to any such program or work, and a "work based on the Program"\r
+means either the Program or any derivative work under copyright law:\r
+that is to say, a work containing the Program or a portion of it,\r
+either verbatim or with modifications and/or translated into another\r
+language.  (Hereinafter, translation is included without limitation in\r
+the term "modification".)  Each licensee is addressed as "you".\r
+\r
+Activities other than copying, distribution and modification are not\r
+covered by this License; they are outside its scope.  The act of\r
+running the Program is not restricted, and the output from the Program\r
+is covered only if its contents constitute a work based on the\r
+Program (independent of having been made by running the Program).\r
+Whether that is true depends on what the Program does.\r
+\r
+  1. You may copy and distribute verbatim copies of the Program's\r
+source code as you receive it, in any medium, provided that you\r
+conspicuously and appropriately publish on each copy an appropriate\r
+copyright notice and disclaimer of warranty; keep intact all the\r
+notices that refer to this License and to the absence of any warranty;\r
+and give any other recipients of the Program a copy of this License\r
+along with the Program.\r
+\r
+You may charge a fee for the physical act of transferring a copy, and\r
+you may at your option offer warranty protection in exchange for a fee.\r
+\r
+  2. You may modify your copy or copies of the Program or any portion\r
+of it, thus forming a work based on the Program, and copy and\r
+distribute such modifications or work under the terms of Section 1\r
+above, provided that you also meet all of these conditions:\r
+\r
+    a) You must cause the modified files to carry prominent notices\r
+    stating that you changed the files and the date of any change.\r
+\r
+    b) You must cause any work that you distribute or publish, that in\r
+    whole or in part contains or is derived from the Program or any\r
+    part thereof, to be licensed as a whole at no charge to all third\r
+    parties under the terms of this License.\r
+\r
+    c) If the modified program normally reads commands interactively\r
+    when run, you must cause it, when started running for such\r
+    interactive use in the most ordinary way, to print or display an\r
+    announcement including an appropriate copyright notice and a\r
+    notice that there is no warranty (or else, saying that you provide\r
+    a warranty) and that users may redistribute the program under\r
+    these conditions, and telling the user how to view a copy of this\r
+    License.  (Exception: if the Program itself is interactive but\r
+    does not normally print such an announcement, your work based on\r
+    the Program is not required to print an announcement.)\r
+\f\r
+These requirements apply to the modified work as a whole.  If\r
+identifiable sections of that work are not derived from the Program,\r
+and can be reasonably considered independent and separate works in\r
+themselves, then this License, and its terms, do not apply to those\r
+sections when you distribute them as separate works.  But when you\r
+distribute the same sections as part of a whole which is a work based\r
+on the Program, the distribution of the whole must be on the terms of\r
+this License, whose permissions for other licensees extend to the\r
+entire whole, and thus to each and every part regardless of who wrote it.\r
+\r
+Thus, it is not the intent of this section to claim rights or contest\r
+your rights to work written entirely by you; rather, the intent is to\r
+exercise the right to control the distribution of derivative or\r
+collective works based on the Program.\r
+\r
+In addition, mere aggregation of another work not based on the Program\r
+with the Program (or with a work based on the Program) on a volume of\r
+a storage or distribution medium does not bring the other work under\r
+the scope of this License.\r
+\r
+  3. You may copy and distribute the Program (or a work based on it,\r
+under Section 2) in object code or executable form under the terms of\r
+Sections 1 and 2 above provided that you also do one of the following:\r
+\r
+    a) Accompany it with the complete corresponding machine-readable\r
+    source code, which must be distributed under the terms of Sections\r
+    1 and 2 above on a medium customarily used for software interchange; or,\r
+\r
+    b) Accompany it with a written offer, valid for at least three\r
+    years, to give any third party, for a charge no more than your\r
+    cost of physically performing source distribution, a complete\r
+    machine-readable copy of the corresponding source code, to be\r
+    distributed under the terms of Sections 1 and 2 above on a medium\r
+    customarily used for software interchange; or,\r
+\r
+    c) Accompany it with the information you received as to the offer\r
+    to distribute corresponding source code.  (This alternative is\r
+    allowed only for noncommercial distribution and only if you\r
+    received the program in object code or executable form with such\r
+    an offer, in accord with Subsection b above.)\r
+\r
+The source code for a work means the preferred form of the work for\r
+making modifications to it.  For an executable work, complete source\r
+code means all the source code for all modules it contains, plus any\r
+associated interface definition files, plus the scripts used to\r
+control compilation and installation of the executable.  However, as a\r
+special exception, the source code distributed need not include\r
+anything that is normally distributed (in either source or binary\r
+form) with the major components (compiler, kernel, and so on) of the\r
+operating system on which the executable runs, unless that component\r
+itself accompanies the executable.\r
+\r
+If distribution of executable or object code is made by offering\r
+access to copy from a designated place, then offering equivalent\r
+access to copy the source code from the same place counts as\r
+distribution of the source code, even though third parties are not\r
+compelled to copy the source along with the object code.\r
+\f\r
+  4. You may not copy, modify, sublicense, or distribute the Program\r
+except as expressly provided under this License.  Any attempt\r
+otherwise to copy, modify, sublicense or distribute the Program is\r
+void, and will automatically terminate your rights under this License.\r
+However, parties who have received copies, or rights, from you under\r
+this License will not have their licenses terminated so long as such\r
+parties remain in full compliance.\r
+\r
+  5. You are not required to accept this License, since you have not\r
+signed it.  However, nothing else grants you permission to modify or\r
+distribute the Program or its derivative works.  These actions are\r
+prohibited by law if you do not accept this License.  Therefore, by\r
+modifying or distributing the Program (or any work based on the\r
+Program), you indicate your acceptance of this License to do so, and\r
+all its terms and conditions for copying, distributing or modifying\r
+the Program or works based on it.\r
+\r
+  6. Each time you redistribute the Program (or any work based on the\r
+Program), the recipient automatically receives a license from the\r
+original licensor to copy, distribute or modify the Program subject to\r
+these terms and conditions.  You may not impose any further\r
+restrictions on the recipients' exercise of the rights granted herein.\r
+You are not responsible for enforcing compliance by third parties to\r
+this License.\r
+\r
+  7. If, as a consequence of a court judgment or allegation of patent\r
+infringement or for any other reason (not limited to patent issues),\r
+conditions are imposed on you (whether by court order, agreement or\r
+otherwise) that contradict the conditions of this License, they do not\r
+excuse you from the conditions of this License.  If you cannot\r
+distribute so as to satisfy simultaneously your obligations under this\r
+License and any other pertinent obligations, then as a consequence you\r
+may not distribute the Program at all.  For example, if a patent\r
+license would not permit royalty-free redistribution of the Program by\r
+all those who receive copies directly or indirectly through you, then\r
+the only way you could satisfy both it and this License would be to\r
+refrain entirely from distribution of the Program.\r
+\r
+If any portion of this section is held invalid or unenforceable under\r
+any particular circumstance, the balance of the section is intended to\r
+apply and the section as a whole is intended to apply in other\r
+circumstances.\r
+\r
+It is not the purpose of this section to induce you to infringe any\r
+patents or other property right claims or to contest validity of any\r
+such claims; this section has the sole purpose of protecting the\r
+integrity of the free software distribution system, which is\r
+implemented by public license practices.  Many people have made\r
+generous contributions to the wide range of software distributed\r
+through that system in reliance on consistent application of that\r
+system; it is up to the author/donor to decide if he or she is willing\r
+to distribute software through any other system and a licensee cannot\r
+impose that choice.\r
+\r
+This section is intended to make thoroughly clear what is believed to\r
+be a consequence of the rest of this License.\r
+\f\r
+  8. If the distribution and/or use of the Program is restricted in\r
+certain countries either by patents or by copyrighted interfaces, the\r
+original copyright holder who places the Program under this License\r
+may add an explicit geographical distribution limitation excluding\r
+those countries, so that distribution is permitted only in or among\r
+countries not thus excluded.  In such case, this License incorporates\r
+the limitation as if written in the body of this License.\r
+\r
+  9. The Free Software Foundation may publish revised and/or new versions\r
+of the General Public License from time to time.  Such new versions will\r
+be similar in spirit to the present version, but may differ in detail to\r
+address new problems or concerns.\r
+\r
+Each version is given a distinguishing version number.  If the Program\r
+specifies a version number of this License which applies to it and "any\r
+later version", you have the option of following the terms and conditions\r
+either of that version or of any later version published by the Free\r
+Software Foundation.  If the Program does not specify a version number of\r
+this License, you may choose any version ever published by the Free Software\r
+Foundation.\r
+\r
+  10. If you wish to incorporate parts of the Program into other free\r
+programs whose distribution conditions are different, write to the author\r
+to ask for permission.  For software which is copyrighted by the Free\r
+Software Foundation, write to the Free Software Foundation; we sometimes\r
+make exceptions for this.  Our decision will be guided by the two goals\r
+of preserving the free status of all derivatives of our free software and\r
+of promoting the sharing and reuse of software generally.\r
+\r
+                           NO WARRANTY\r
+\r
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\r
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN\r
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\r
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\r
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS\r
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE\r
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\r
+REPAIR OR CORRECTION.\r
+\r
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\r
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\r
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\r
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\r
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\r
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\r
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\r
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\r
+POSSIBILITY OF SUCH DAMAGES.\r
+\r
+                    END OF TERMS AND CONDITIONS\r
+\f\r
+           How to Apply These Terms to Your New Programs\r
+\r
+  If you develop a new program, and you want it to be of the greatest\r
+possible use to the public, the best way to achieve this is to make it\r
+free software which everyone can redistribute and change under these terms.\r
+\r
+  To do so, attach the following notices to the program.  It is safest\r
+to attach them to the start of each source file to most effectively\r
+convey the exclusion of warranty; and each file should have at least\r
+the "copyright" line and a pointer to where the full notice is found.\r
+\r
+    <one line to give the program's name and a brief idea of what it does.>\r
+    Copyright (C) <year>  <name of author>\r
+\r
+    This program is free software; you can redistribute it and/or modify\r
+    it under the terms of the GNU General Public License as published by\r
+    the Free Software Foundation; either version 2 of the License, or\r
+    (at your option) any later version.\r
+\r
+    This program is distributed in the hope that it will be useful,\r
+    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+    GNU General Public License for more details.\r
+\r
+    You should have received a copy of the GNU General Public License\r
+    along with this program; if not, write to the Free Software\r
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
+\r
+\r
+Also add information on how to contact you by electronic and paper mail.\r
+\r
+If the program is interactive, make it output a short notice like this\r
+when it starts in an interactive mode:\r
+\r
+    Gnomovision version 69, Copyright (C) year name of author\r
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\r
+    This is free software, and you are welcome to redistribute it\r
+    under certain conditions; type `show c' for details.\r
+\r
+The hypothetical commands `show w' and `show c' should show the appropriate\r
+parts of the General Public License.  Of course, the commands you use may\r
+be called something other than `show w' and `show c'; they could even be\r
+mouse-clicks or menu items--whatever suits your program.\r
+\r
+You should also get your employer (if you work as a programmer) or your\r
+school, if any, to sign a "copyright disclaimer" for the program, if\r
+necessary.  Here is a sample; alter the names:\r
+\r
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program\r
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.\r
+\r
+  <signature of Ty Coon>, 1 April 1989\r
+  Ty Coon, President of Vice\r
+\r
+This General Public License does not permit incorporating your program into\r
+proprietary programs.  If your program is a subroutine library, you may\r
+consider it more useful to permit linking proprietary applications with the\r
+library.  If this is what you want to do, use the GNU Library General\r
+Public License instead of this License.\r
diff --git a/tstools/epgdump/Makefile b/tstools/epgdump/Makefile
new file mode 100755 (executable)
index 0000000..ab2ce18
--- /dev/null
@@ -0,0 +1,28 @@
+PREFIX         = /usr/local
+TARGETS        = epgdump
+OBJ_TARGETS    = epgdump.o aribstr.o eit.o ts.o util.o sdt.o
+HEDDERDEPEND   = eit.h sdt.h aribstr.h ts.h util.h
+
+LANG           = C
+CC             = gcc
+CFLAGS         = -std=c99 -O2 -Wall -g
+LIBS           = 
+
+.c.o:                  ${CC} ${CFLAGS} -c $<
+
+all:                   ${TARGETS}
+
+${TARGETS}:            ${OBJ_TARGETS}
+                       ${CC} ${CFLAGS} ${OBJ_TARGETS} -o $@ ${LDFLAGS} ${LIBS}
+
+${OBJ_TARGETS}:        ${HEDDERDEPEND}
+
+clean:
+                       rm -f core ${TARGETS} *.o
+
+install:               ${TARGETS}
+                       install -m755 ${TARGETS} ${PREFIX}/bin
+
+uninstall:             ${TARGETS}
+                       rm ${PREFIX}/bin/${TARGETS}
+
diff --git a/tstools/epgdump/aribstr.c b/tstools/epgdump/aribstr.c
new file mode 100755 (executable)
index 0000000..1e736ea
--- /dev/null
@@ -0,0 +1,599 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <iconv.h>
+
+#include "aribstr.h"
+
+#define CODE_UNKNOWN           0       // ÉÔÌÀ¤Ê¥°¥é¥Õ¥£¥Ã¥¯¥»¥Ã¥È(ÈóÂбþ)
+#define CODE_KANJI             1       // Kanji
+#define CODE_ALPHANUMERIC      2       // Alphanumeric
+#define CODE_HIRAGANA          3       // Hiragana
+#define CODE_KATAKANA          4       // Katakana
+#define CODE_MOSAIC_A          5       // Mosaic A
+#define CODE_MOSAIC_B          6       // Mosaic B
+#define CODE_MOSAIC_C          7       // Mosaic C
+#define CODE_MOSAIC_D          8       // Mosaic D
+#define CODE_PROP_ALPHANUMERIC         9       // Proportional Alphanumeric
+#define CODE_PROP_HIRAGANA     10      // Proportional Hiragana
+#define CODE_PROP_KATAKANA     11      // Proportional Katakana
+#define CODE_JIS_X0201_KATAKANA 12     // JIS X 0201 Katakana
+#define CODE_JIS_KANJI_PLANE_1         13      // JIS compatible Kanji Plane 1
+#define CODE_JIS_KANJI_PLANE_2         14      // JIS compatible Kanji Plane 2
+#define CODE_ADDITIONAL_SYMBOLS        15      // Additional symbols
+
+
+#define TCHAR char
+#define BYTE  char
+#define WORD  int
+#define DWORD int
+#define bool  int
+#define true  1
+#define false 0
+#define TEXT(a) a
+#define _T(a) a
+#define CODE_SET int
+
+static int m_CodeG[4];
+static int *m_pLockingGL;
+static int *m_pLockingGR;
+static int *m_pSingleGL;
+       
+static BYTE m_byEscSeqCount;
+static BYTE m_byEscSeqIndex;
+static bool m_bIsEscSeqDrcs;
+
+
+static const DWORD AribToStringInternal(TCHAR *lpszDst, const BYTE *pSrcData, const DWORD dwSrcLen);
+static const DWORD ProcessCharCode(TCHAR *lpszDst, const WORD wCode, const CODE_SET CodeSet);
+
+static const DWORD PutKanjiChar(TCHAR *lpszDst, const WORD wCode);
+static const DWORD PutAlphanumericChar(TCHAR *lpszDst, const WORD wCode);
+static const DWORD PutHiraganaChar(TCHAR *lpszDst, const WORD wCode);
+static const DWORD PutKatakanaChar(TCHAR *lpszDst, const WORD wCode);
+static const DWORD PutJisKatakanaChar(TCHAR *lpszDst, const WORD wCode);
+static const DWORD PutSymbolsChar(TCHAR *lpszDst, const WORD wCode);
+
+static void ProcessEscapeSeq(const BYTE byCode);
+
+static void LockingShiftGL(const BYTE byIndexG);
+static void LockingShiftGR(const BYTE byIndexG);
+static void SingleShiftGL(const BYTE byIndexG);
+
+static const bool DesignationGSET(const BYTE byIndexG, const BYTE byCode);
+static const bool DesignationDRCS(const BYTE byIndexG, const BYTE byCode);
+
+static WORD convertjis(DWORD);
+
+static const bool abCharSizeTable[] =
+{
+       false,  // CODE_UNKNOWN                                 ÉÔÌÀ¤Ê¥°¥é¥Õ¥£¥Ã¥¯¥»¥Ã¥È(ÈóÂбþ)
+       true,   // CODE_KANJI                                   Kanji
+       false,  // CODE_ALPHANUMERIC                    Alphanumeric
+       false,  // CODE_HIRAGANA                                Hiragana
+       false,  // CODE_KATAKANA                                Katakana
+       false,  // CODE_MOSAIC_A                                Mosaic A
+       false,  // CODE_MOSAIC_B                                Mosaic B
+       false,  // CODE_MOSAIC_C                                Mosaic C
+       false,  // CODE_MOSAIC_D                                Mosaic D
+       false,  // CODE_PROP_ALPHANUMERIC               Proportional Alphanumeric
+       false,  // CODE_PROP_HIRAGANA                   Proportional Hiragana
+       false,  // CODE_PROP_KATAKANA                   Proportional Katakana
+       false,  // CODE_JIS_X0201_KATAKANA              JIS X 0201 Katakana
+       true,   // CODE_JIS_KANJI_PLANE_1               JIS compatible Kanji Plane 1
+       true,   // CODE_JIS_KANJI_PLANE_2               JIS compatible Kanji Plane 2
+       true    // CODE_ADDITIONAL_SYMBOLS              Additional symbols
+};
+
+int AribToString(
+       char *lpszDst, 
+       const char *pSrcData, 
+       const int dwSrcLen) {
+  
+       return AribToStringInternal(lpszDst, pSrcData, dwSrcLen);
+}
+
+
+const DWORD AribToStringInternal(TCHAR *lpszDst, 
+                                                                const BYTE *pSrcData, const DWORD dwSrcLen)
+{
+       if(!pSrcData || !dwSrcLen || !lpszDst)return 0UL;
+  
+       DWORD dwSrcPos = 0UL;
+       DWORD dwDstLen = 0UL;
+       int   dwSrcData;
+  
+       // ¾õÂÖ½é´üÀßÄê
+       m_byEscSeqCount = 0U;
+       m_pSingleGL = NULL;
+
+       m_CodeG[0] = CODE_KANJI;
+       m_CodeG[1] = CODE_ALPHANUMERIC;
+       m_CodeG[2] = CODE_HIRAGANA;
+       m_CodeG[3] = CODE_KATAKANA;
+
+       m_pLockingGL = &m_CodeG[0];
+       m_pLockingGR = &m_CodeG[2];
+
+       while(dwSrcPos < dwSrcLen){
+               dwSrcData = pSrcData[dwSrcPos] & 0xFF;
+
+               if(!m_byEscSeqCount){
+      
+                       // GL/GRÎΰè
+                       if((dwSrcData >= 0x21U) && (dwSrcData <= 0x7EU)){
+                               // GLÎΰè
+                               const CODE_SET CurCodeSet = (m_pSingleGL)? *m_pSingleGL : *m_pLockingGL;
+                               m_pSingleGL = NULL;
+                               
+                               if(abCharSizeTable[CurCodeSet]){
+                                       // 2¥Ð¥¤¥È¥³¡¼¥É
+                                       if((dwSrcLen - dwSrcPos) < 2UL)break;
+                                       
+                                       dwDstLen += ProcessCharCode(&lpszDst[dwDstLen], ((WORD)pSrcData[dwSrcPos + 0] << 8) | (WORD)pSrcData[dwSrcPos + 1], CurCodeSet);
+                                       dwSrcPos++;
+                               }
+                               else{
+                                       // 1¥Ð¥¤¥È¥³¡¼¥É
+                                       dwDstLen += ProcessCharCode(&lpszDst[dwDstLen], (WORD)dwSrcData, CurCodeSet);
+                               }
+                       }
+                       else if((dwSrcData >= 0xA1U) && (dwSrcData <= 0xFEU)){
+                               // GRÎΰè
+                               const CODE_SET CurCodeSet = *m_pLockingGR;
+                               
+                               if(abCharSizeTable[CurCodeSet]){
+                                       // 2¥Ð¥¤¥È¥³¡¼¥É
+                                       if((dwSrcLen - dwSrcPos) < 2UL)break;
+                                       
+                                       dwDstLen += ProcessCharCode(&lpszDst[dwDstLen], ((WORD)(pSrcData[dwSrcPos + 0] & 0x7FU) << 8) | (WORD)(pSrcData[dwSrcPos + 1] & 0x7FU), CurCodeSet);
+                                       dwSrcPos++;
+                               }
+                               else{
+                                       // 1¥Ð¥¤¥È¥³¡¼¥É
+                                       dwDstLen += ProcessCharCode(&lpszDst[dwDstLen], (WORD)(dwSrcData & 0x7FU), CurCodeSet);
+                               }
+                       }
+                       else{
+                               // À©¸æ¥³¡¼¥É
+                               switch(dwSrcData){
+                               case 0x0FU      : LockingShiftGL(0U);                           break;  // LS0
+                               case 0x0EU      : LockingShiftGL(1U);                           break;  // LS1
+                               case 0x19U      : SingleShiftGL(2U);                            break;  // SS2
+                               case 0x1DU      : SingleShiftGL(3U);                            break;  // SS3
+                               case 0x1BU      : m_byEscSeqCount = 1U;                         break;  // ESC
+                               case 0x20U      :
+                               case 0xA0U      : lpszDst[dwDstLen++] = TEXT(' ');      break;  // SP
+                               default         : break;        // ÈóÂбþ
+                               }
+                       }
+               }
+               else{
+                       // ¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹½èÍý
+                       ProcessEscapeSeq(dwSrcData);
+               }
+               
+               dwSrcPos++;
+       }
+
+       // ½ªÃ¼Ê¸»ú
+       lpszDst[dwDstLen] = TEXT('\0');
+
+       return dwDstLen;
+}
+
+const DWORD ProcessCharCode(TCHAR *lpszDst, const WORD wCode, const CODE_SET CodeSet)
+{
+       switch(CodeSet){
+       case CODE_KANJI :
+       case CODE_JIS_KANJI_PLANE_1 :
+       case CODE_JIS_KANJI_PLANE_2 :
+               // ´Á»ú¥³¡¼¥É½ÐÎÏ
+               return PutKanjiChar(lpszDst, wCode);
+
+       case CODE_ALPHANUMERIC :
+       case CODE_PROP_ALPHANUMERIC :
+               // ±Ñ¿ô»ú¥³¡¼¥É½ÐÎÏ
+               return PutAlphanumericChar(lpszDst, wCode);
+
+       case CODE_HIRAGANA :
+       case CODE_PROP_HIRAGANA :
+               // ¤Ò¤é¤¬¤Ê¥³¡¼¥É½ÐÎÏ
+               return PutHiraganaChar(lpszDst, wCode);
+
+       case CODE_PROP_KATAKANA :
+       case CODE_KATAKANA :
+               // ¥«¥¿¥«¥Ê¥³¡¼¥É½ÐÎÏ
+               return PutKatakanaChar(lpszDst, wCode);
+
+       case CODE_JIS_X0201_KATAKANA :
+               // JIS¥«¥¿¥«¥Ê¥³¡¼¥É½ÐÎÏ
+               return PutJisKatakanaChar(lpszDst, wCode);
+#if 1
+       case CODE_ADDITIONAL_SYMBOLS :
+               // Äɲå·¥ó¥Ü¥ë¥³¡¼¥É½ÐÎÏ
+               return PutSymbolsChar(lpszDst, wCode);
+#endif
+       default :
+               return 0UL;
+       }
+}
+
+const DWORD PutKanjiChar(TCHAR *lpszDst, const WORD wCode)
+{
+       // JIS¢ªShift-JIS´Á»ú¥³¡¼¥ÉÊÑ´¹
+       const WORD wShiftJIS = convertjis(wCode);
+
+#ifdef _UNICODE
+       // Shift-JIS ¢ª UNICODE
+       const char szShiftJIS[3] = {(char)(wShiftJIS >> 8), (char)(wShiftJIS & 0x00FFU), '\0'};
+       ::MultiByteToWideChar(CP_OEMCP, MB_PRECOMPOSED, szShiftJIS, 2, lpszDst, 2);
+
+       return 1UL;
+#else
+       // Shift-JIS ¢ª Shift-JIS
+       lpszDst[0] = (wShiftJIS >> 8) & 0xFF;
+       lpszDst[1] = (char)(wShiftJIS & 0x00FFU);
+  
+       return 2UL;
+#endif
+}
+
+const DWORD PutAlphanumericChar(TCHAR *lpszDst, const WORD wCode)
+{
+       // ±Ñ¿ô»úʸ»ú¥³¡¼¥ÉÊÑ´¹
+       static const TCHAR *acAlphanumericTable = 
+               TEXT("¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡")
+               TEXT("¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡")
+               TEXT("¡¡¡ª¡É¡ô¡ð¡ó¡õ¡Ç¡Ê¡Ë¡ö¡Ü¡¤¡Ý¡¥¡¿")
+               TEXT("£°£±£²£³£´£µ£¶£·£¸£¹¡§¡¨¡ã¡á¡ä¡©")
+               TEXT("¡÷£Á£Â£Ã£Ä£Å£Æ£Ç£È£É£Ê£Ë£Ì£Í£Î£Ï")
+               TEXT("£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡Î¡ï¡Ï¡°¡²")
+               TEXT("¡¡£á£â£ã£ä£å£æ£ç£è£é£ì£ë£ì£í£î£ï")
+               TEXT("£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡Ð¡Ã¡Ñ¡±¡¡");
+
+#ifdef _UNICODE
+       lpszDst[0] = acAlphanumericTable[wCode];
+
+       return 1UL;
+#else
+       lpszDst[0] = acAlphanumericTable[wCode * 2U + 0U];
+       lpszDst[1] = acAlphanumericTable[wCode * 2U + 1U];
+
+       return 2UL;
+#endif
+}
+
+const DWORD PutHiraganaChar(TCHAR *lpszDst, const WORD wCode)
+{
+       // ¤Ò¤é¤¬¤Êʸ»ú¥³¡¼¥ÉÊÑ´¹
+       static const TCHAR *acHiraganaTable = 
+               TEXT("¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡")
+               TEXT("¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡")
+               TEXT("¡¡¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯")
+               TEXT("¤°¤±¤²¤³¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿")
+               TEXT("¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï")
+               TEXT("¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û¤Ü¤Ý¤Þ¤ß")
+               TEXT("¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï")
+               TEXT("¤ð¤ñ¤ò¤ó¡¡¡¡¡¡¡µ¡¶¡¼¡£¡Ö¡×¡¢¡¦¡¡");
+       
+#ifdef _UNICODE
+       lpszDst[0] = acHiraganaTable[wCode];
+
+       return 1UL;
+#else
+       lpszDst[0] = acHiraganaTable[wCode * 2U + 0U];
+       lpszDst[1] = acHiraganaTable[wCode * 2U + 1U];
+
+       return 2UL;
+#endif
+}
+
+const DWORD PutKatakanaChar(TCHAR *lpszDst, const WORD wCode)
+{
+       // ¥«¥¿¥«¥Ê±Ñ¿ô»úʸ»ú¥³¡¼¥ÉÊÑ´¹
+       static const TCHAR *acKatakanaTable = 
+               TEXT("¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡")
+               TEXT("¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡")
+               TEXT("¡¡¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯")
+               TEXT("¥°¥±¥²¥³¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿")
+               TEXT("¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï")
+               TEXT("¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û¥Ü¥Ý¥Þ¥ß")
+               TEXT("¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï")
+               TEXT("¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡³¡´¡¼¡£¡Ö¡×¡¢¡¦¡¡");
+       
+#ifdef _UNICODE
+       lpszDst[0] = acKatakanaTable[wCode];
+
+       return 1UL;
+#else
+       lpszDst[0] = acKatakanaTable[wCode * 2U + 0U];
+       lpszDst[1] = acKatakanaTable[wCode * 2U + 1U];
+
+       return 2UL;
+#endif
+}
+
+const DWORD PutJisKatakanaChar(TCHAR *lpszDst, const WORD wCode)
+{
+       // JIS¥«¥¿¥«¥Êʸ»ú¥³¡¼¥ÉÊÑ´¹
+       static const TCHAR *acJisKatakanaTable = 
+               TEXT("¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡")
+               TEXT("¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡")
+               TEXT("¡¡¡£¡Ö¡×¡¢¡¦¥ò¥¡¥£¥¥¥§¥©¥ã¥å¥ç¥Ã")
+               TEXT("¡¼¥¢¥¤¥¦¥¨¥ª¥«¥­¥¯¥±¥³¥µ¥·¥¹¥»¥½")
+               TEXT("¥¿¥Á¥Ä¥Æ¥È¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ò¥Õ¥Ø¥Û¥Þ")
+               TEXT("¥ß¥à¥á¥â¥ä¥æ¥è¥é¥ê¥ë¥ì¥í¥ï¥ó¡«¡¬")
+               TEXT("¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡")
+               TEXT("¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡");
+       
+#ifdef _UNICODE
+       lpszDst[0] = acJisKatakanaTable[wCode];
+
+       return 1UL;
+#else
+       lpszDst[0] = acJisKatakanaTable[wCode * 2U + 0U];
+       lpszDst[1] = acJisKatakanaTable[wCode * 2U + 1U];
+
+       return 2UL;
+#endif
+}
+
+const DWORD PutSymbolsChar(TCHAR *lpszDst, const WORD wCode)
+{
+       // Äɲå·¥ó¥Ü¥ëʸ»ú¥³¡¼¥ÉÊÑ´¹(¤È¤ê¤¢¤¨¤ºÉ¬Íפ½¤¦¤Ê¤â¤Î¤À¤±)
+       static const TCHAR *aszSymbolsTable1[] =
+               {
+                       _T("[HV]"),             _T("[SD]"),             _T("[£Ð]"),             _T("[£×]"),             _T("[MV]"),             _T("[¼ê]"),             _T("[»ú]"),             _T("[ÁÐ]"),                     // 0x7A50 - 0x7A57      90/48 - 90/55
+                       _T("[¥Ç]"),             _T("[£Ó]"),             _T("[Æó]"),             _T("[¿]"),             _T("[²ò]"),             _T("[SS]"),             _T("[£Â]"),             _T("[£Î]"),                     // 0x7A58 - 0x7A5F      90/56 - 90/63
+                       _T("¢£"),               _T("¡ü"),               _T("[Å·]"),             _T("[¸ò]"),             _T("[±Ç]"),             _T("[̵]"),             _T("[ÎÁ]"),             _T("[ǯÎðÀ©¸Â]"),       // 0x7A60 - 0x7A67      90/64 - 90/71
+                       _T("[Á°]"),             _T("[¸å]"),             _T("[ºÆ]"),             _T("[¿·]"),             _T("[½é]"),             _T("[½ª]"),             _T("[À¸]"),             _T("[ÈÎ]"),                     // 0x7A68 - 0x7A6F      90/72 - 90/79
+                       _T("[À¼]"),             _T("[¿á]"),             _T("[PPV]"),    _T("(Èë)"),             _T("¤Û¤«")                                                                                                                      // 0x7A70 - 0x7A74      90/80 - 90/84
+               };
+
+       static const TCHAR *aszSymbolsTable2[] =
+               {
+                       _T("¢ª"),               _T("¢«"),               _T("¢¬"),               _T("¢­"),               _T("¡ü"),               _T("¡û"),               _T("ǯ"),               _T("·î"),                       // 0x7C21 - 0x7C28      92/01 - 92/08
+                       _T("Æü"),               _T("±ß"),               _T("­Ö"),               _T("ΩÊý£í"),   _T("­Ñ"),               _T("Ê¿Êý­Ñ"),   _T("ΩÊý­Ñ"),   _T("£°."),                      // 0x7C29 - 0x7C30      92/09 - 92/16
+                       _T("£±."),              _T("£²."),              _T("£³."),              _T("£´."),              _T("£µ."),              _T("£¶."),              _T("£·."),              _T("£¸."),                      // 0x7C31 - 0x7C38      92/17 - 92/24
+                       _T("£¹."),              _T("»á"),               _T("Éû"),               _T("¸µ"),               _T("¸Î"),               _T("Á°"),               _T("¿·"),               _T("£°,"),                      // 0x7C39 - 0x7C40      92/25 - 92/32
+                       _T("£±,"),              _T("£²,"),              _T("£³,"),              _T("£´,"),              _T("£µ,"),              _T("£¶,"),              _T("£·,"),              _T("£¸,"),                      // 0x7C41 - 0x7C48      92/33 - 92/40
+                       _T("£¹,"),              _T("(¼Ò)"),             _T("(ºâ)"),             _T("(Í­)"),             _T("(³ô)"),             _T("(Âå)"),             _T("(Ìä)"),             _T("¡ä"),                       // 0x7C49 - 0x7C50      92/41 - 92/48
+                       _T("¡ã"),               _T("¡Ú"),               _T("¡Û"),               _T("¡þ"),               _T("^2"),               _T("^3"),               _T("(CD)"),             _T("(vn)"),                     // 0x7C51 - 0x7C58      92/49 - 92/56
+                       _T("(ob)"),             _T("(cb)"),             _T("(ce"),              _T("mb)"),              _T("(hp)"),             _T("(br)"),             _T("(p)"),              _T("(s)"),                      // 0x7C59 - 0x7C60      92/57 - 92/64
+                       _T("(ms)"),             _T("(t)"),              _T("(bs)"),             _T("(b)"),              _T("(tb)"),             _T("(tp)"),             _T("(ds)"),             _T("(ag)"),                     // 0x7C61 - 0x7C68      92/65 - 92/72
+                       _T("(eg)"),             _T("(vo)"),             _T("(fl)"),             _T("(ke"),              _T("y)"),               _T("(sa"),              _T("x)"),               _T("(sy"),                      // 0x7C69 - 0x7C70      92/73 - 92/80
+                       _T("n)"),               _T("(or"),              _T("g)"),               _T("(pe"),              _T("r)"),               _T("(R)"),              _T("(C)"),              _T("(ä·)"),                     // 0x7C71 - 0x7C78      92/81 - 92/88
+                       _T("DJ"),               _T("[±é]"),             _T("Fax")                                                                                                                                                                                       // 0x7C79 - 0x7C7B      92/89 - 92/91
+               };
+
+       static const TCHAR *aszSymbolsTable3[] =
+               {
+                       _T("(·î)"),             _T("(²Ð)"),             _T("(¿å)"),             _T("(ÌÚ)"),             _T("(¶â)"),             _T("(ÅÚ)"),             _T("(Æü)"),             _T("(½Ë)"),                     // 0x7D21 - 0x7D28      93/01 - 93/08
+                       _T("­í"),               _T("­î"),               _T("­ï"),               _T("­ß"),               _T("­â"),               _T("­ä"),               _T("(¢©)"),             _T("¡û"),                       // 0x7D29 - 0x7D30      93/09 - 93/16
+                       _T("¡ÌËÜ¡Í"),   _T("¡Ì»°¡Í"),   _T("¡ÌÆó¡Í"),   _T("¡Ì°Â¡Í"),   _T("¡ÌÅÀ¡Í"),   _T("¡ÌÂÇ¡Í"),   _T("¡ÌÅð¡Í"),   _T("¡Ì¾¡¡Í"),           // 0x7D31 - 0x7D38      93/17 - 93/24
+                       _T("¡ÌÇÔ¡Í"),   _T("¡Ì£Ó¡Í"),   _T("¡ÎÅê¡Ï"),   _T("¡ÎÊá¡Ï"),   _T("¡Î°ì¡Ï"),   _T("¡ÎÆó¡Ï"),   _T("¡Î»°¡Ï"),   _T("¡ÎÍ·¡Ï"),           // 0x7D39 - 0x7D40      93/25 - 93/32
+                       _T("¡Îº¸¡Ï"),   _T("¡ÎÃæ¡Ï"),   _T("¡Î±¦¡Ï"),   _T("¡Î»Ø¡Ï"),   _T("¡ÎÁö¡Ï"),   _T("¡ÎÂÇ¡Ï"),   _T("­È"),               _T("­Ô"),                       // 0x7D41 - 0x7D48      93/33 - 93/40
+                       _T("Hz"),               _T("ha"),               _T("km"),               _T("Ê¿Êýkm"),   _T("hPa"),              _T("¡¦"),               _T("¡¦"),               _T("1/2"),                      // 0x7D49 - 0x7D50      93/41 - 93/48
+                       _T("0/3"),              _T("1/3"),              _T("2/3"),              _T("1/4"),              _T("3/4"),              _T("1/5"),              _T("2/5"),              _T("3/5"),                      // 0x7D51 - 0x7D58      93/49 - 93/56
+                       _T("4/5"),              _T("1/6"),              _T("5/6"),              _T("1/7"),              _T("1/8"),              _T("1/9"),              _T("1/10"),             _T("À²¤ì"),                     // 0x7D59 - 0x7D60      93/57 - 93/64
+                       _T("ÆÞ¤ê"),             _T("±«"),               _T("Àã"),               _T("¢¤"),               _T("¢¥"),               _T("¢¦"),               _T("¢§"),               _T("¢¡"),                       // 0x7D61 - 0x7D68      93/65 - 93/72
+                       _T("¡¦"),               _T("¡¦"),               _T("¡¦"),               _T("¡þ"),               _T("¡ý"),               _T("!!"),               _T("!?"),               _T("ÆÞ/À²"),            // 0x7D69 - 0x7D70      93/73 - 93/80
+                       _T("±«"),               _T("±«"),               _T("Àã"),               _T("ÂçÀã"),             _T("Íë"),               _T("Í뱫"),             _T("¡¡"),               _T("¡¦"),                       // 0x7D71 - 0x7D78      93/81 - 93/88
+                       _T("¡¦"),               _T("¢ö"),               _T("­ä")                                                                                                                                                                                        // 0x7D79 - 0x7D7B      93/89 - 93/91
+               };
+
+       static const TCHAR *aszSymbolsTable4[] =
+               {
+                       _T("­µ"),               _T("­¶"),               _T("­·"),               _T("­¸"),               _T("­¹"),               _T("­º"),               _T("­»"),               _T("­¼"),                       // 0x7E21 - 0x7E28      94/01 - 94/08
+                       _T("­½"),               _T("­¾"),               _T("XI"),               _T("X­¶"),              _T("­±"),               _T("­²"),               _T("­³"),               _T("­´"),                       // 0x7E29 - 0x7E30      94/09 - 94/16
+                       _T("(1)"),              _T("(2)"),              _T("(3)"),              _T("(4)"),              _T("(5)"),              _T("(6)"),              _T("(7)"),              _T("(8)"),                      // 0x7E31 - 0x7E38      94/17 - 94/24
+                       _T("(9)"),              _T("(10)"),             _T("(11)"),             _T("(12)"),             _T("(21)"),             _T("(22)"),             _T("(23)"),             _T("(24)"),                     // 0x7E39 - 0x7E40      94/25 - 94/32
+                       _T("(A)"),              _T("(B)"),              _T("(C)"),              _T("(D)"),              _T("(E)"),              _T("(F)"),              _T("(G)"),              _T("(H)"),                      // 0x7E41 - 0x7E48      94/33 - 94/40
+                       _T("(I)"),              _T("(J)"),              _T("(K)"),              _T("(L)"),              _T("(M)"),              _T("(N)"),              _T("(O)"),              _T("(P)"),                      // 0x7E49 - 0x7E50      94/41 - 94/48
+                       _T("(Q)"),              _T("(R)"),              _T("(S)"),              _T("(T)"),              _T("(U)"),              _T("(V)"),              _T("(W)"),              _T("(X)"),                      // 0x7E51 - 0x7E58      94/49 - 94/56
+                       _T("(Y)"),              _T("(Z)"),              _T("(25)"),             _T("(26)"),             _T("(27)"),             _T("(28)"),             _T("(29)"),             _T("(30)"),                     // 0x7E59 - 0x7E60      94/57 - 94/64
+                       _T("­¡"),               _T("­¢"),               _T("­£"),               _T("­¤"),               _T("­¥"),               _T("­¦"),               _T("­§"),               _T("­¨"),                       // 0x7E61 - 0x7E68      94/65 - 94/72
+                       _T("­©"),               _T("­ª"),               _T("­«"),               _T("­¬"),               _T("­­"),               _T("­®"),               _T("­¯"),               _T("­°"),                       // 0x7E69 - 0x7E70      94/73 - 94/80
+                       _T("­¡"),               _T("­¢"),               _T("­£"),               _T("­¤"),               _T("­¥"),               _T("­¦"),               _T("­§"),               _T("­¨"),                       // 0x7E71 - 0x7E78      94/81 - 94/88
+                       _T("­©"),               _T("­ª"),               _T("­«"),               _T("­¬"),               _T("(31)")                                                                                                                      // 0x7E79 - 0x7E7D      94/89 - 94/93
+               };
+
+       // ¥·¥ó¥Ü¥ë¤òÊÑ´¹¤¹¤ë
+       if((wCode >= 0x7A50U) && (wCode <= 0x7A74U)){
+               strcpy(lpszDst, aszSymbolsTable1[wCode - 0x7A50U]);
+       }
+       else if((wCode >= 0x7C21U) && (wCode <= 0x7C7BU)){
+               strcpy(lpszDst, aszSymbolsTable2[wCode - 0x7C21U]);
+       }
+       else if((wCode >= 0x7D21U) && (wCode <= 0x7D7BU)){
+               strcpy(lpszDst, aszSymbolsTable3[wCode - 0x7D21U]);
+       }
+       else if((wCode >= 0x7E21U) && (wCode <= 0x7E7DU)){
+               strcpy(lpszDst, aszSymbolsTable4[wCode - 0x7E21U]);
+       }
+       else{
+               strcpy(lpszDst, TEXT("¡¦"));
+       }
+
+       return strlen(lpszDst);
+}
+
+void ProcessEscapeSeq(const BYTE byCode)
+{
+       // ¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹½èÍý
+       switch(m_byEscSeqCount){
+               // 1¥Ð¥¤¥ÈÌÜ
+       case 1U :
+               switch(byCode){
+                       // Invocation of code elements
+               case 0x6EU      : LockingShiftGL(2U);   m_byEscSeqCount = 0U;   return;         // LS2
+               case 0x6FU      : LockingShiftGL(3U);   m_byEscSeqCount = 0U;   return;         // LS3
+               case 0x7EU      : LockingShiftGR(1U);   m_byEscSeqCount = 0U;   return;         // LS1R
+               case 0x7DU      : LockingShiftGR(2U);   m_byEscSeqCount = 0U;   return;         // LS2R
+               case 0x7CU      : LockingShiftGR(3U);   m_byEscSeqCount = 0U;   return;         // LS3R
+
+                       // Designation of graphic sets
+               case 0x24U      :       
+               case 0x28U      : m_byEscSeqIndex = 0U;         break;
+               case 0x29U      : m_byEscSeqIndex = 1U;         break;
+               case 0x2AU      : m_byEscSeqIndex = 2U;         break;
+               case 0x2BU      : m_byEscSeqIndex = 3U;         break;
+               default         : m_byEscSeqCount = 0U;         return;         // ¥¨¥é¡¼
+               }
+               break;
+
+               // 2¥Ð¥¤¥ÈÌÜ
+       case 2U :
+               if(DesignationGSET(m_byEscSeqIndex, byCode)){
+                       m_byEscSeqCount = 0U;
+                       return;
+               }
+                       
+               switch(byCode){
+               case 0x20       : m_bIsEscSeqDrcs = true;       break;
+               case 0x28       : m_bIsEscSeqDrcs = true;       m_byEscSeqIndex = 0U;   break;
+               case 0x29       : m_bIsEscSeqDrcs = false;      m_byEscSeqIndex = 1U;   break;
+               case 0x2A       : m_bIsEscSeqDrcs = false;      m_byEscSeqIndex = 2U;   break;
+               case 0x2B       : m_bIsEscSeqDrcs = false;      m_byEscSeqIndex = 3U;   break;
+               default         : m_byEscSeqCount = 0U;         return;         // ¥¨¥é¡¼
+               }
+               break;
+
+               // 3¥Ð¥¤¥ÈÌÜ
+       case 3U :
+               if(!m_bIsEscSeqDrcs){
+                       if(DesignationGSET(m_byEscSeqIndex, byCode)){
+                               m_byEscSeqCount = 0U;
+                               return;
+                       }
+               }
+               else{
+                       if(DesignationDRCS(m_byEscSeqIndex, byCode)){
+                               m_byEscSeqCount = 0U;
+                               return;
+                       }
+               }
+
+               if(byCode == 0x20U){
+                       m_bIsEscSeqDrcs = true;
+               }
+               else{
+                       // ¥¨¥é¡¼
+                       m_byEscSeqCount = 0U;
+                       return;
+               }
+               break;
+
+               // 4¥Ð¥¤¥ÈÌÜ
+       case 4U :
+               DesignationDRCS(m_byEscSeqIndex, byCode);
+               m_byEscSeqCount = 0U;
+               return;
+       }
+
+       m_byEscSeqCount++;
+}
+
+void LockingShiftGL(const BYTE byIndexG)
+{
+       // LSx
+       m_pLockingGL = &m_CodeG[byIndexG];
+}
+
+void LockingShiftGR(const BYTE byIndexG)
+{
+       // LSxR
+       m_pLockingGR = &m_CodeG[byIndexG];
+}
+
+void SingleShiftGL(const BYTE byIndexG)
+{
+       // SSx
+       m_pSingleGL  = &m_CodeG[byIndexG];
+}
+
+const bool DesignationGSET(const BYTE byIndexG, const BYTE byCode)
+{
+       // G¤Î¥°¥é¥Õ¥£¥Ã¥¯¥»¥Ã¥È¤ò³ä¤êÅö¤Æ¤ë
+       switch(byCode){
+       case 0x42U      : m_CodeG[byIndexG] = CODE_KANJI;                               return true;    // Kanji
+       case 0x4AU      : m_CodeG[byIndexG] = CODE_ALPHANUMERIC;                return true;    // Alphanumeric
+       case 0x30U      : m_CodeG[byIndexG] = CODE_HIRAGANA;                    return true;    // Hiragana
+       case 0x31U      : m_CodeG[byIndexG] = CODE_KATAKANA;                    return true;    // Katakana
+       case 0x32U      : m_CodeG[byIndexG] = CODE_MOSAIC_A;                    return true;    // Mosaic A
+       case 0x33U      : m_CodeG[byIndexG] = CODE_MOSAIC_B;                    return true;    // Mosaic B
+       case 0x34U      : m_CodeG[byIndexG] = CODE_MOSAIC_C;                    return true;    // Mosaic C
+       case 0x35U      : m_CodeG[byIndexG] = CODE_MOSAIC_D;                    return true;    // Mosaic D
+       case 0x36U      : m_CodeG[byIndexG] = CODE_PROP_ALPHANUMERIC;   return true;    // Proportional Alphanumeric
+       case 0x37U      : m_CodeG[byIndexG] = CODE_PROP_HIRAGANA;               return true;    // Proportional Hiragana
+       case 0x38U      : m_CodeG[byIndexG] = CODE_PROP_KATAKANA;               return true;    // Proportional Katakana
+       case 0x49U      : m_CodeG[byIndexG] = CODE_JIS_X0201_KATAKANA;  return true;    // JIS X 0201 Katakana
+       case 0x39U      : m_CodeG[byIndexG] = CODE_JIS_KANJI_PLANE_1;   return true;    // JIS compatible Kanji Plane 1
+       case 0x3AU      : m_CodeG[byIndexG] = CODE_JIS_KANJI_PLANE_2;   return true;    // JIS compatible Kanji Plane 2
+       case 0x3BU      : m_CodeG[byIndexG] = CODE_ADDITIONAL_SYMBOLS;  return true;    // Additional symbols
+       default         : return false;         // ÉÔÌÀ¤Ê¥°¥é¥Õ¥£¥Ã¥¯¥»¥Ã¥È
+       }
+}
+
+const bool DesignationDRCS(const BYTE byIndexG, const BYTE byCode)
+{
+       // DRCS¤Î¥°¥é¥Õ¥£¥Ã¥¯¥»¥Ã¥È¤ò³ä¤êÅö¤Æ¤ë
+       switch(byCode){
+       case 0x40U      : m_CodeG[byIndexG] = CODE_UNKNOWN;                             return true;    // DRCS-0
+       case 0x41U      : m_CodeG[byIndexG] = CODE_UNKNOWN;                             return true;    // DRCS-1
+       case 0x42U      : m_CodeG[byIndexG] = CODE_UNKNOWN;                             return true;    // DRCS-2
+       case 0x43U      : m_CodeG[byIndexG] = CODE_UNKNOWN;                             return true;    // DRCS-3
+       case 0x44U      : m_CodeG[byIndexG] = CODE_UNKNOWN;                             return true;    // DRCS-4
+       case 0x45U      : m_CodeG[byIndexG] = CODE_UNKNOWN;                             return true;    // DRCS-5
+       case 0x46U      : m_CodeG[byIndexG] = CODE_UNKNOWN;                             return true;    // DRCS-6
+       case 0x47U      : m_CodeG[byIndexG] = CODE_UNKNOWN;                             return true;    // DRCS-7
+       case 0x48U      : m_CodeG[byIndexG] = CODE_UNKNOWN;                             return true;    // DRCS-8
+       case 0x49U      : m_CodeG[byIndexG] = CODE_UNKNOWN;                             return true;    // DRCS-9
+       case 0x4AU      : m_CodeG[byIndexG] = CODE_UNKNOWN;                             return true;    // DRCS-10
+       case 0x4BU      : m_CodeG[byIndexG] = CODE_UNKNOWN;                             return true;    // DRCS-11
+       case 0x4CU      : m_CodeG[byIndexG] = CODE_UNKNOWN;                             return true;    // DRCS-12
+       case 0x4DU      : m_CodeG[byIndexG] = CODE_UNKNOWN;                             return true;    // DRCS-13
+       case 0x4EU      : m_CodeG[byIndexG] = CODE_UNKNOWN;                             return true;    // DRCS-14
+       case 0x4FU      : m_CodeG[byIndexG] = CODE_UNKNOWN;                             return true;    // DRCS-15
+       case 0x70U      : m_CodeG[byIndexG] = CODE_UNKNOWN;                             return true;    // Macro
+       default         : return false;         // ÉÔÌÀ¤Ê¥°¥é¥Õ¥£¥Ã¥¯¥»¥Ã¥È
+       }
+}
+
+WORD convertjis(DWORD jiscode) {
+       char code[3];
+       char xcode[4];
+       iconv_t cd;
+  
+       size_t inbyte = 2;
+       size_t outbyte = 4;
+
+       const char *fptr;
+       char *tptr;
+
+       WORD rtn;
+
+       code[0] = jiscode >> 8;
+       code[1] = jiscode & 0xFF;
+       code[3] = '\0';
+
+       /*
+         cd = iconv_open("ISO-2022-JP","UTF-8");
+
+         fptr = code;
+         tptr = xcode;
+         iconv(cd, &fptr, &inbyte, &tptr, &outbyte);
+
+         iconv_close(cd);
+       */
+
+       xcode[0] = code[0] | 0x80;
+       xcode[1] = code[1] | 0x80;
+
+       rtn = ((xcode[0] << 8) & 0xFF00) | (xcode[1] & 0xFF);
+
+       return rtn;
+
+}
diff --git a/tstools/epgdump/aribstr.h b/tstools/epgdump/aribstr.h
new file mode 100755 (executable)
index 0000000..6178525
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef ARIBSTR_H
+#define ARIBSTR_H 1
+
+#ifdef __cplusplus
+extern "C"{
+#endif /* __cplusplus */
+
+       int AribToString(char *lpszDst, const char *pSrcData, const int dwSrcLen);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/tstools/epgdump/eit.c b/tstools/epgdump/eit.c
new file mode 100755 (executable)
index 0000000..23857df
--- /dev/null
@@ -0,0 +1,673 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "eit.h"
+
+char           *subtitle_cnv_str[] = {
+//     "¡¡Âè",
+//     "¡¼Âè",
+//     "-Âè",
+//     " Âè",
+//     "¡¡¡Ö",
+//     "¡¡¡ô",
+//     "¡Ê",
+//     "¡Ö",
+       NULL
+};
+static void timecmp(int *,int *,int *,
+                                       int, int, int);
+
+int parseEIThead(unsigned char *data, EIThead *h) {
+       int boff = 0;
+
+       memset(h, 0, sizeof(EIThead));
+
+       h->table_id = getBit(data, &boff, 8);
+       h->section_syntax_indicator = getBit(data, &boff, 1);
+       h->reserved_future_use = getBit(data, &boff, 1);
+       h->reserved1 = getBit(data, &boff, 2);
+       h->section_length =getBit(data, &boff,12);
+       h->service_id = getBit(data, &boff, 16);
+       h->reserved2 = getBit(data, &boff, 2);
+       h->version_number = getBit(data, &boff, 5);
+       h->current_next_indicator = getBit(data, &boff, 1);
+       h->section_number = getBit(data, &boff, 8);
+       h->last_section_number = getBit(data, &boff, 8);
+       h->transport_stream_id = getBit(data, &boff, 16);
+       h->original_network_id = getBit(data, &boff, 16);
+       h->segment_last_section_number = getBit(data, &boff, 8);
+       h->last_table_id = getBit(data, &boff, 8);
+  
+       return 14;
+}
+
+int parseEITbody(unsigned char *data, EITbody *b)
+{
+       int boff = 0;
+       int tnum;
+       char buf[4];
+
+       memset(b, 0, sizeof(EITbody));
+
+       b->event_id = getBit(data, &boff, 16);
+
+       memcpy(b->start_time, data + boff / 8, 5);
+       /* b->start_time = getBit(data, &boff, 40); */
+       boff += 40;
+       memcpy(b->duration, data + boff / 8, 3);
+       /* b->duration = getBit(data, &boff, 24); */
+       boff += 24;
+       b->running_status = getBit(data, &boff, 3);
+       b->free_CA_mode = getBit(data, &boff, 1);
+       b->descriptors_loop_length = getBit(data, &boff, 12);
+
+       /* ÆüÉÕÊÑ´¹ */
+       tnum = (b->start_time[0] & 0xFF) << 8 | (b->start_time[1] & 0xFF);
+  
+       b->yy = (tnum - 15078.2) / 365.25;
+       b->mm = ((tnum - 14956.1) - (int)(b->yy * 365.25)) / 30.6001;
+       b->dd = (tnum - 14956) - (int)(b->yy * 365.25) - (int)(b->mm * 30.6001);
+
+       if(b->dd == 0) {
+               printf("aa");
+       }
+
+       if(b->mm == 14 || b->mm == 15) {
+               b->yy += 1;
+               b->mm = b->mm - 1 - (1 * 12);
+       } else {
+               b->mm = b->mm - 1;
+       }
+
+       b->yy += 1900;
+  
+       memset(buf, '\0', sizeof(buf));
+       sprintf(buf, "%x", b->start_time[2]);
+       b->hh = atoi(buf);
+       memset(buf, '\0', sizeof(buf));
+       sprintf(buf, "%x", b->start_time[3]);
+       b->hm = atoi(buf);
+       memset(buf, '\0', sizeof(buf));
+       sprintf(buf, "%x", b->start_time[4]);
+       b->ss = atoi(buf);
+
+       if((b->duration[0] == 0xFF) && (b->duration[1] == 0xFF) && (b->duration[2] == 0xFF)){
+               b->dhh = b->dhm = b->dss = 0;
+       }else{
+               memset(buf, '\0', sizeof(buf));
+       sprintf(buf, "%x", b->duration[0]);
+       b->dhh = atoi(buf);
+               memset(buf, '\0', sizeof(buf));
+       sprintf(buf, "%x", b->duration[1]);
+       b->dhm = atoi(buf);
+               memset(buf, '\0', sizeof(buf));
+       sprintf(buf, "%x", b->duration[2]);
+       b->dss = atoi(buf);
+       }
+       return 12;
+}
+
+int parseSEVTdesc(unsigned char *data, SEVTdesc *desc) {
+       int boff = 0;
+  
+       memset(desc, 0, sizeof(SEVTdesc));
+
+       desc->descriptor_tag = getBit(data, &boff, 8);
+       if((desc->descriptor_tag & 0xFF) != 0x4D) {
+               return -1;
+       }
+       desc->descriptor_length = getBit(data, &boff, 8);
+       memcpy(desc->ISO_639_language_code, data + boff / 8, 3);
+       /* desc->ISO_639_language_code = getBit(data, &boff, 24); */
+       boff += 24;
+       desc->event_name_length = getBit(data, &boff, 8);
+       getStr(desc->event_name, data, &boff, desc->event_name_length);
+       desc->text_length = getBit(data, &boff, 8);
+       getStr(desc->text, data, &boff, desc->text_length);
+
+       return desc->descriptor_length + 2;
+}
+
+int parseContentDesc(unsigned char *data, ContentDesc *desc) {
+       int boff = 0;
+  
+       memset(desc, 0, sizeof(ContentDesc));
+
+       desc->descriptor_tag = getBit(data, &boff, 8);
+       if((desc->descriptor_tag & 0xFF) != 0x54) {
+               return -1;
+       }
+       desc->descriptor_length = getBit(data, &boff, 8);
+       memcpy(desc->content, data+(boff/8), desc->descriptor_length);
+       //getStr(desc->content, data, &boff, desc->descriptor_length);
+       return desc->descriptor_length + 2;
+}
+
+int parseSeriesDesc(unsigned char *data, SeriesDesc *desc) {
+       int boff = 0;
+  
+       memset(desc, 0, sizeof(SeriesDesc));
+
+       desc->descriptor_tag = getBit(data, &boff, 8);
+       if((desc->descriptor_tag & 0xFF) != 0xD5) {
+               return -1;
+       }
+       desc->descriptor_length = getBit(data, &boff, 8);
+       desc->series_id = getBit(data, &boff, 16);
+       desc->repeat_label = getBit(data, &boff, 4);
+       desc->program_pattern = getBit(data, &boff, 3);
+       desc->expire_date_valid_flag = getBit(data, &boff, 1);
+
+       desc->expire_date = getBit(data, &boff, 16);
+       //memcpy(desc->expire_date, data + boff / 8, 2);
+       //boff += 16;
+
+       desc->episode_number = getBit(data, &boff, 12);
+       desc->last_episode_number = getBit(data, &boff, 12);
+
+       getStr(desc->series_name_char, data, &boff, desc->descriptor_length - 8);
+       return desc->descriptor_length + 2;
+}
+
+int parseEEVTDhead(unsigned char *data, EEVTDhead *desc) {
+       int boff = 0;
+  
+       memset(desc, 0, sizeof(EEVTDhead));
+
+       desc->descriptor_tag = getBit(data, &boff, 8);
+       if((desc->descriptor_tag & 0xFF) != 0x4E) {
+               return -1;
+       }
+       desc->descriptor_length = getBit(data, &boff, 8);
+       desc->descriptor_number = getBit(data, &boff, 4);
+       desc->last_descriptor_number = getBit(data, &boff, 4);
+       memcpy(desc->ISO_639_language_code, data + boff / 8, 3);
+       /* desc->ISO_639_language_code = getBit(data, &boff, 24); */
+       boff += 24;
+
+       desc->length_of_items = getBit(data, &boff, 8);
+
+       return 7;
+}
+
+int parseEEVTDitem(unsigned char *data, EEVTDitem *desc) {
+       int boff = 0;
+  
+       memset(desc, 0, sizeof(EEVTDitem));
+
+       desc->item_description_length = getBit(data, &boff, 8);
+       getStr(desc->item_description, data, &boff, desc->item_description_length);
+
+       desc->item_length = getBit(data, &boff, 8);
+//     memcpy(desc->item, data + (boff / 8), desc->item_length);
+       getStr(desc->item, data, &boff, desc->item_length);
+
+       return desc->item_description_length + desc->item_length + 2;
+}
+
+int parseEEVTDtail(unsigned char *data, EEVTDtail *desc) {
+       int boff = 0;
+  
+       memset(desc, 0, sizeof(EEVTDtail));
+
+       desc->text_length = getBit(data, &boff, 8);
+       getStr(desc->text, data, &boff, desc->text_length);
+
+       return desc->text_length + 1;
+}
+
+int checkEEVTDitem(EEVTDitem *save, EEVTDitem *new, int descriptor_number) {
+
+       EEVTDitem swap;
+       int boff = 0;
+       if(new == NULL) {
+               if(save->item_length != 0) {
+                       swap = *save;
+                       getStr(save->item, (unsigned char*)swap.item, &boff, swap.item_length);
+
+
+                        //save->descriptor_number = descriptor_number;
+                        //*new = swap;
+                       //*save = swap;
+                        if (swap.descriptor_number==1){
+//                            printf("descriptor_num %d   typeB\n",swap.descriptor_number);
+                        }
+
+                       return 1;
+               } else {
+
+
+                        //printf("descriptor_num %d   typeC\n",swap.descriptor_number);
+
+
+
+                       return 0;
+               }
+       }
+
+       if(new->item_description_length == 0) {
+               /* Â³¤­ Êݸ */
+               memcpy(save->item + save->item_length, new->item, new->item_length);
+               save->item_length += new->item_length;
+
+
+                if (swap.descriptor_number==1){
+                            printf("descriptor_num %d   typeD\n",swap.descriptor_number);
+                        }
+
+
+               return 0;
+       } else {
+               /* ¥Ö¥ì¡¼¥¯¡£save¤ò°õºþÂоݤˤ¹¤ë¡£save¤ò¥¯¥ê¥¢? */
+               if(save->item_length != 0) {
+                       /* ÂàÈòºÑ¤ß¤¬¤¢¤ê */
+                       swap = *save;
+                       getStr(save->item, (unsigned char*)swap.item, &boff, swap.item_length);
+                       swap = *new;
+                       *new = *save;
+                       *save = swap;
+                       save->descriptor_number = descriptor_number;
+                       
+
+
+
+                        if (swap.descriptor_number==1){
+                            printf("descriptor_num %d   typeE\n",swap.descriptor_number);
+                        }
+                        
+
+               } else {
+                       *save = *new;
+                       save->descriptor_number = descriptor_number;
+
+                        if (swap.descriptor_number==1){
+                            printf("descriptor_num %d   typeF\n",swap.descriptor_number);
+                        }
+
+
+                       return 0;
+               }
+       }
+
+       return 1;
+}
+EIT_CONTROL    *searcheit(EIT_CONTROL *top, int servid, int eventid)
+{
+       EIT_CONTROL     *cur ;
+       cur = top ;
+
+       while(cur != NULL){
+               if((cur->event_id == eventid) && (cur->servid == servid)){
+                       return cur ;
+               }
+
+               cur = cur->next ;
+       }
+       return NULL ;
+}
+void   conv_title_subtitle(EIT_CONTROL *eitptr)
+{
+       int             lp = 0 ;
+       size_t  addsize ;
+       char    *ptr ;
+       char    *newsubtitle ;
+
+       for(lp = 0 ; subtitle_cnv_str[lp] != NULL ; lp++){
+               ptr = strstr(eitptr->title, subtitle_cnv_str[lp]);
+               if(ptr == NULL){
+                       continue ;
+               }
+               // ¥¿¥¤¥È¥ë¤¬¤Ê¤¯¤Ê¤é¤Ê¤¤¤è¤¦¤Ë
+               if(ptr == eitptr->title){
+                       continue ;
+               }
+               newsubtitle = calloc(1, ((strlen(ptr) + 1) + (strlen(eitptr->subtitle) + 1)));
+               memcpy(newsubtitle, ptr, strlen(ptr));
+               newsubtitle[strlen(ptr)] = ' ';
+               *ptr = NULL ;
+               strcat(newsubtitle, eitptr->subtitle);
+               free(eitptr->subtitle);
+               eitptr->subtitle = newsubtitle ;
+               return ;
+       }
+}
+void   enqueue(EIT_CONTROL *top, EIT_CONTROL *eitptr)
+{
+       EIT_CONTROL     *cur ;
+       cur = top ;
+       int             rc ;
+
+       if(top->next == NULL){
+               top->next = eitptr ;
+               eitptr->prev = top ;
+               return ;
+       }
+       cur = top->next ;
+       while(cur != NULL){
+               rc = memcmp(&cur->yy, &eitptr->yy, (sizeof(int) * 3));
+               if(rc == 0){
+                       rc = memcmp(&cur->hh, &eitptr->hh, (sizeof(int) * 3));
+                       if(rc == 0){
+                               free(eitptr->title);
+                               free(eitptr->subtitle);
+                               free(eitptr);
+                               return ;
+                       }
+                       if(rc > 0){
+                               if(cur->prev != 0){
+                                       cur->prev->next = eitptr ;
+                                       eitptr->prev = cur->prev ;
+                               }
+                               cur->prev = eitptr ;
+                               eitptr->next = cur ;
+                               conv_title_subtitle(eitptr);
+                               return ;
+                       }
+               }
+               if(rc > 0){
+                       if(cur->prev != 0){
+                               cur->prev->next = eitptr ;
+                               eitptr->prev = cur->prev ;
+                       }
+                       cur->prev = eitptr ;
+                       eitptr->next = cur ;
+                       conv_title_subtitle(eitptr);
+                       return ;
+               }
+               if(cur->next == NULL){
+                       cur->next = eitptr ;
+                       eitptr->prev = cur ;
+                       conv_title_subtitle(eitptr);
+                       return ;
+               }
+               cur = cur->next ;
+       }
+       return ;
+
+}
+
+void dumpEIT(unsigned char *ptr, int serv_id, int original_network_id, int transport_stream_id, EIT_CONTROL *eittop)
+{
+
+       EIThead  eith;
+       EITbody  eitb;
+       SEVTdesc sevtd;
+
+       EEVTDhead eevthead;
+       EEVTDitem eevtitem;
+       EEVTDtail eevttail;
+
+       EEVTDitem save_eevtitem;
+
+       EIT_CONTROL     *cur ;
+       EIT_CONTROL     *curtmp ;
+
+       int len = 0;
+       int loop_len = 0;
+       int loop_blen = 0;
+       int loop_elen = 0;
+       int str_alen = 0;
+
+       int ehh, emm, ess;
+
+       /* EIT */
+       len = parseEIThead(ptr, &eith); 
+
+       ptr += len;
+       loop_len = eith.section_length - (len - 3 + 4); // 3¤Ï¶¦Ḁ̈إåÀĹ 4¤ÏCRC
+       while(loop_len > 0) {
+               /* Ï¢Â³¤¹¤ë³ÈÄ¥¥¤¥Ù¥ó¥È¤Ï¡¢´Á»ú¥³¡¼¥É¤¬µã¤­Ê̤줷¤Æ
+                  Ê¬³ä¤µ¤ì¤ë¤è¤¦¤À¡£Ï¢Â³¤«¤É¤¦¤«¤Ï¡¢item_description_length¤¬
+                  ÀßÄꤵ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤ÇȽÃǤǤ­¤ë¤è¤¦¤À¡£ */
+               memset(&save_eevtitem, 0, sizeof(EEVTDitem));
+
+               len = parseEITbody(ptr, &eitb);
+               ptr += len;
+               loop_len -= len;
+    
+               /* printf("evtid:%d\n", eitb.event_id); */
+    
+               loop_blen = eitb.descriptors_loop_length;
+               loop_len -= loop_blen;
+               while(loop_blen > 0) {
+
+                       len = parseSEVTdesc(ptr, &sevtd);
+                       if(len > 0) {
+
+                               /*
+                                 if(eith.service_id == 19304 && 
+                                 eitb.event_id == 46564) {
+                                 printf("aa");
+                                 }
+                               */
+
+                               ehh = eitb.hh;
+                               emm = eitb.hm;
+                               ess = eitb.ss;
+                               if(eith.service_id != serv_id){
+                                       ptr += len;
+                                       loop_blen -= len;
+                                       continue ;
+                               }
+
+                               timecmp(&ehh, &emm, &ess,
+                                               eitb.dhh, eitb.dhm, eitb.dss);
+                               cur = searcheit(eittop, eith.service_id, eitb.event_id);
+                               if(cur == NULL){
+                                       curtmp = NULL;
+                                       cur = calloc(1, sizeof(EIT_CONTROL));
+                               }
+                               else {
+                                       curtmp = cur;
+                               }
+                               cur->event_id = eitb.event_id ;
+                               cur->servid = eith.service_id ;
+                               cur->title = calloc(1, (strlen(sevtd.event_name) + 1));
+
+                               memcpy(cur->title, sevtd.event_name, strlen(sevtd.event_name));
+                               cur->subtitle = calloc(1, (strlen(sevtd.text) + 1));
+                               memcpy(cur->subtitle, sevtd.text, strlen(sevtd.text));
+                               cur->yy = eitb.yy;
+                               cur->mm = eitb.mm;
+                               cur->dd = eitb.dd;
+                               cur->hh = eitb.hh;
+                               cur->hm = eitb.hm;
+                               cur->ss = eitb.ss;
+                               cur->ehh = eitb.dhh;
+                               cur->emm = eitb.dhm;
+                               cur->ess = eitb.dss ;
+                               cur->table_id = eith.table_id ;
+                               if ( !curtmp ) enqueue(eittop, cur);
+                       } else {
+                               len = parseEEVTDhead(ptr, &eevthead);
+
+                               /*
+                                 if(eith.service_id == 19304 && 
+                                 eitb.event_id == 46564) {
+                                 printf("aa");
+                                 }
+                               */
+
+                               if(len > 0) {
+                                       ptr += len;
+                                       loop_blen -= len;
+
+                                       loop_elen = eevthead.length_of_items;
+                                       loop_len -= loop_elen;
+                                       while(loop_elen > 0) {
+                                               len = parseEEVTDitem(ptr, &eevtitem);
+
+                                               ptr += len;
+                                               loop_elen -= len;
+                                               loop_blen -= len;
+                                                
+                                               if (1||checkEEVTDitem(&save_eevtitem, &eevtitem,
+                                                                                 eevthead.descriptor_number)) {
+#if 0
+                                                       {
+                                                            if (eevtitem.descriptor_number>0){
+                                                                //printf("descriptor_num %d\n",eevtitem.descriptor_number);
+                                                            }
+
+                                                            /* long format */
+                                                            //printf("descriptor_num %d\n",eevtitem.descriptor_number);
+#if 1
+                                                            printf("EEVT,%d,%d,%d,%s,%s\n",
+                                                                               eith.service_id,
+                                                                                       eitb.event_id,
+                                                                                       eevtitem.descriptor_number, // ÂàÈò¹àÌÜ
+                                                                               eevtitem.item_description,
+                                                                               eevtitem.item);
+#endif
+
+                                                       }
+#endif
+                                                       cur = searcheit(eittop, eith.service_id, eitb.event_id);
+                                                       if(cur == NULL){
+                                                               curtmp = NULL;
+                                                               cur = calloc(1, sizeof(EIT_CONTROL));
+                                                       }
+                                                       else {
+                                                               curtmp = cur;
+                                                       }
+
+#if 1
+                                                       if ( cur->desc ) {
+                                                               str_alen = strlen( cur->desc );
+                                                       }
+                                                       else {
+                                                               str_alen = 0;
+                                                       }
+                                                       eevtitem.item_description_length = strlen(eevtitem.item_description);
+                                                       eevtitem.item_length = strlen(eevtitem.item);
+                                                       cur->desc = realloc(cur->desc, str_alen + eevtitem.item_description_length + eevtitem.item_length + 1000);
+                                                       if ( !str_alen ) *cur->desc = '\0';
+
+                                                       if ( eevtitem.item_description_length && !strstr(cur->desc, eevtitem.item_description) ) {
+                                                               strcat(cur->desc, eevtitem.item_description);
+                                                               strcat(cur->desc, "\t");
+                                                       }
+
+                                                       if ( eevtitem.item_length && !strstr(cur->desc, eevtitem.item)  ) {
+                                                               strcat(cur->desc, eevtitem.item);
+                                                               strcat(cur->desc, "\\n");
+                                                       }
+#endif
+                                                       if ( !curtmp ) enqueue(eittop, cur);
+                                               }
+                                       }
+
+                                       len = parseEEVTDtail(ptr, &eevttail);
+#if 0
+                                       { /* long format */
+                                               printf("EEVTt,%d,%d,%d,%s\n", 
+                                                               eith.service_id,
+                                                               eitb.event_id,
+                                                               eevthead.descriptor_number,
+                                                               eevttail.text);
+                                       }
+#endif
+                               } else {
+                                       ContentDesc contentDesc;
+                                       len = parseContentDesc(ptr, &contentDesc);
+                                       if (len > 0) {
+                                               int header_printed = 0;
+                                               for (int i = 0; i < contentDesc.descriptor_length - 1; i+=2) {
+                                                       /*
+                                                       if (0xff == (unsigned char)contentDesc.content[i])
+                                                               continue;
+                                                       */
+#if 0
+                                                       if (!header_printed) {
+                                                               fprintf(out, "Content,%d,%d",
+                                                                       eith.service_id,
+                                                                       eitb.event_id);
+                                                               header_printed = 1;
+                                                       }
+#endif
+
+#if 0
+                                                       fprintf(out, ",%02x%02x", (unsigned char)contentDesc.content[i], (unsigned char)contentDesc.content[i+1]);
+#endif
+                                               }
+                                               if((eith.original_network_id == original_network_id) && (eith.transport_stream_id == transport_stream_id)){
+                                                       cur = searcheit(eittop, eith.service_id, eitb.event_id);
+                                                       if(cur != NULL){
+                                                               cur->content_type = (unsigned char)(contentDesc.content[0] >> 4);
+#if 0
+                                                               fprintf(stdout, "%s:", cur->title);
+                                                               fprintf(stdout, ",%02x%02x", (unsigned char)contentDesc.content[0], (unsigned char)contentDesc.content[1]);
+                                                               fprintf(stdout, ",%02x%02x\n", (unsigned char)contentDesc.content[2], (unsigned char)contentDesc.content[3]);
+#endif
+
+                                                       }
+#if 0
+                                                       if (header_printed) {
+                                                               fprintf(out, "\n");
+                                                       }
+#endif
+                                               }
+                                       } else {
+                                               SeriesDesc seriesDesc;
+                                               len = parseSeriesDesc(ptr, &seriesDesc);
+                                               if (len > 0) {
+#if 0
+                                                       printf("Series,%d,%d,series=%d,repeat=%01x,pattern=%d,expire_valid=%d,expire=%04x,epinum=%d,lastepinum=%d,%s\n",
+                                                               eith.service_id,
+                                                               eitb.event_id,
+                                                               seriesDesc.series_id,
+                                                               seriesDesc.repeat_label,
+                                                               seriesDesc.program_pattern,
+                                                               seriesDesc.expire_date_valid_flag,
+                                                               seriesDesc.expire_date,
+                                                               seriesDesc.episode_number,
+                                                               seriesDesc.last_episode_number,
+                                                               seriesDesc.series_name_char);
+#endif
+                                               } else {
+                                                       len = parseOTHERdesc(ptr);
+                                               }
+                                       }
+                               }
+                       }
+                       ptr += len;
+                       loop_blen -= len;
+               }
+               /* ºÇ¸å¤Î¥Ö¥ì¡¼¥¯¥Á¥§¥Ã¥¯ */
+    
+               if(checkEEVTDitem(&save_eevtitem, NULL, 0)) {
+#if 0
+                       if(mode == 1) { /* long format */
+                               fprintf(out, "EEVT,%d,%d,%d,%s,%s\n", 
+                                               eith.service_id,
+                                               eitb.event_id,
+                                               save_eevtitem.descriptor_number,
+                                               save_eevtitem.item_description,
+                                               save_eevtitem.item);
+                       }
+#endif
+               }
+       }
+
+       return;
+}
+
+void timecmp(int *thh, int *tmm, int *tss,
+                        int dhh, int dmm, int dss) {
+
+       int ama;
+
+       *tss += dss;
+       ama = *tss % 60;
+       *tmm += (*tss / 60);
+       *tss = ama;
+
+       *tmm += dmm;
+       ama   = *tmm % 60;
+       *thh += (*tmm / 60);
+       *tmm  = ama;
+
+       *thh += dhh;
+
+}
diff --git a/tstools/epgdump/eit.h b/tstools/epgdump/eit.h
new file mode 100755 (executable)
index 0000000..15f910b
--- /dev/null
@@ -0,0 +1,120 @@
+#ifndef EIT_H
+#define EIT_H 1
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "util.h"
+#include "ts_ctl.h"
+
+typedef struct _EIThead {
+       char table_id;
+       int section_syntax_indicator;
+       int reserved_future_use;
+       int reserved1;
+       int section_length;
+       int service_id;
+       int reserved2;
+       int version_number;
+       int current_next_indicator;
+       int section_number;
+       int last_section_number;
+       int transport_stream_id;
+       int original_network_id;
+       int segment_last_section_number;
+       int last_table_id;
+} EIThead;
+
+typedef struct _EITbody {
+       int event_id;
+       char start_time[5];
+       char duration[3];
+       int running_status;
+       int free_CA_mode;
+       int descriptors_loop_length;
+       /* °Ê²¼¤Ï²òÀÏ·ë²ÌÊݸÍÑ */
+       int yy;
+       int mm;
+       int dd;
+       int hh;
+       int hm;
+       int ss;
+       int dhh;
+       int dhm;
+       int dss;
+} EITbody;
+
+typedef struct _SEVTdesc {
+       int  descriptor_tag;
+       int  descriptor_length;
+       char ISO_639_language_code[3];
+       int  event_name_length;
+       char event_name[MAXSECLEN];
+       int  text_length;
+       char text[MAXSECLEN];
+} SEVTdesc;
+
+typedef struct _ContentDesc {
+       int descriptor_tag;
+       int descriptor_length;
+       char content[MAXSECLEN];
+} ContentDesc;
+
+typedef struct _SeriesDesc {
+       int descriptor_tag;
+       int descriptor_length;
+       int series_id;
+       int repeat_label;
+       int program_pattern;
+       int expire_date_valid_flag;
+       int expire_date;
+       int episode_number;
+       int last_episode_number;
+       char series_name_char[MAXSECLEN];
+} SeriesDesc;
+
+typedef struct _EEVTDhead {
+       int  descriptor_tag;
+       int  descriptor_length;
+       int  descriptor_number;
+       int  last_descriptor_number;
+       char ISO_639_language_code[3];
+       int  length_of_items;
+} EEVTDhead;
+
+typedef struct _EEVTDitem {
+       int  item_description_length;
+       char item_description[MAXSECLEN];
+       int  item_length;
+       char item[MAXSECLEN];
+       /* ÂàÈòÍÑ */
+       int  descriptor_number;
+} EEVTDitem;
+
+typedef struct _EEVTDtail {
+       int  text_length;
+       char text[MAXSECLEN];
+} EEVTDtail;
+
+#ifdef __cplusplus
+extern "C"{
+#endif /* __cplusplus */
+
+       int parseEIThead(unsigned char *data, EIThead *h);
+       int parseEITbody(unsigned char *data, EITbody *b);
+       int parseSEVTdesc(unsigned char *data, SEVTdesc *desc) ;
+
+       int parseContentDesc(unsigned char *data, ContentDesc *desc);
+       int parseSeriesDesc(unsigned char *data, SeriesDesc *desc);
+
+       int parseEEVTDhead(unsigned char *data, EEVTDhead *desc) ;
+       int parseEEVTDitem(unsigned char *data, EEVTDitem *desc) ;
+       int parseEEVTDtail(unsigned char *data, EEVTDtail *desc) ;
+
+       void dumpEIT(unsigned char *data, int serv_id, int original_network_id, int transport_stream_id, EIT_CONTROL *eittop);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/tstools/epgdump/epgdump.c b/tstools/epgdump/epgdump.c
new file mode 100755 (executable)
index 0000000..11f37ec
--- /dev/null
@@ -0,0 +1,423 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <getopt.h>
+#include <iconv.h>
+#include <time.h>
+
+#include "ts.h"
+#include "sdt.h"
+#include "eit.h"
+#include "ts_ctl.h"
+
+typedef                struct  _ContentTYPE{
+       char    *japanese ;
+       char    *english ;
+}CONTENT_TYPE;
+
+#define                CAT_COUNT               16
+static  CONTENT_TYPE   ContentCatList[CAT_COUNT] = {
+       { "¥Ë¥å¡¼¥¹¡¦ÊóÆ»", "news" },
+       { "¥¹¥Ý¡¼¥Ä", "sports" },
+       { "¾ðÊó", "information" },
+       { "¥É¥é¥Þ", "drama" },
+       { "²»³Ú", "music" },
+       { "¥Ð¥é¥¨¥Æ¥£", "variety" },
+       { "±Ç²è", "cinema" },
+       { "¥¢¥Ë¥á¡¦Æû£", "anime" },
+       { "¥É¥­¥å¥á¥ó¥¿¥ê¡¼¡¦¶µÍÜ", "documentary" },
+       { "±é·à", "stage" },
+       { "¼ñÌ£¡¦¼ÂÍÑ", "hobby" },
+       { "Ê¡»ã", "etc" },                      //Ê¡»ã
+       { "ͽÈ÷", "etc" }, //ͽÈ÷
+       { "ͽÈ÷", "etc" }, //ͽÈ÷
+       { "ͽÈ÷", "etc" }, //ͽÈ÷
+       { "¤½¤Î¾", "etc" } //¤½¤Î¾
+};
+typedef struct _TAG_STATION
+{
+       char    *name;
+       char    *ontv;
+       int             tsId;           // OriginalNetworkID
+       int             onId;           // TransportStreamID
+       int             svId;           // ServiceID
+} STATION;
+
+static STATION bsSta[] = {
+       { "NHK BS1", "3001.ontvjapan.com", 16625, 4, 101},
+       { "NHK BS2", "3002.ontvjapan.com", 16625, 4, 102},
+       { "NHK BSh", "3003.ontvjapan.com", 16626, 4, 103},
+       { "BSÆü¥Æ¥ì", "3004.ontvjapan.com", 16592, 4, 141},
+       { "BSÄ«Æü", "3005.ontvjapan.com", 16400, 4, 151},
+       { "BS-i", "3006.ontvjapan.com", 16401, 4, 161},
+       { "BS¥¸¥ã¥Ñ¥ó", "3007.ontvjapan.com", 16433, 4, 171},
+       { "BS¥Õ¥¸", "3008.ontvjapan.com", 16593, 4, 181},
+       { "WOWOW", "3009.ontvjapan.com", 16432, 4, 191},
+       { "WOWOW2", "3010.ontvjapan.com", 16432, 4, 192},
+       { "WOWOW3", "3011.ontvjapan.com", 16432, 4, 193},
+       { "BS11", "3013.ontvjapan.com", 16528, 4, 211},
+       { "TwellV", "3014.ontvjapan.com", 16530, 4, 222},
+};
+
+static int bsStaCount = sizeof(bsSta) / sizeof (STATION);
+
+
+
+static STATION csSta[] = {
+       { "¥¹¥¿¡¼£ã£è¥×¥é¥¹", "1002.ontvjapan.com", 24608, 6, 237},
+       { "ÆüËܱDzèÀìÌç£ã£è£È£Ä", "1086.ontvjapan.com", 24608, 6, 239},
+       { "¥Õ¥¸¥Æ¥ì¥Ó£Ã£Ó£È£Ä", "306ch.epgdata.ontvjapan", 24608, 6, 306},
+       { "¥·¥ç¥Ã¥×¥Á¥ã¥ó¥Í¥ë", "1059.ontvjapan.com", 24704, 6, 55},
+       { "¥¶¡¦¥·¥Í¥Þ", "1217.ontvjapan.com", 24736, 6, 228},
+       { "¥¹¥«¥Á¥ã¥ó£È£Ä£¸£°£°", "800ch.epgdata.ontvjapan", 24736, 6, 800},
+       { "¥¹¥«¥Á¥ã¥ó£¸£°£±", "801ch.epgdata.ontvjapan", 24736, 6, 801},
+       { "¥¹¥«¥Á¥ã¥ó£¸£°£²", "802ch.epgdata.ontvjapan", 24736, 6, 802},
+       { "£å£²¥×¥í¥â", "100ch.epgdata.ontvjapan", 28736, 7, 100},
+       { "¥¤¥ó¥¿¡¼¥í¡¼¥«¥ë£Ô£Ö", "194ch.epgdata.ontvjapan", 28736, 7, 194},
+       { "£Ê¥¹¥Ý¡¼¥Ä¡¡£Å£Ó£Ð£Î", "1025.ontvjapan.com", 28736, 7, 256},
+       { "£Æ£Ï£Ø", "1016.ontvjapan.com", 28736, 7, 312},
+       { "¥¹¥Ú¡¼¥¹¥·¥ã¥ï¡¼£Ô£Ö", "1018.ontvjapan.com", 28736, 7, 322},
+       { "¥«¡¼¥È¥¥¡¼¥ó¡¡¥Í¥Ã¥È", "1046.ontvjapan.com", 28736, 7, 331},
+       { "¥È¥¥¡¼¥ó¡¦¥Ç¥£¥º¥Ë¡¼", "1213.ontvjapan.com", 28736, 7, 334},
+       { "Åì±Ç¥Á¥ã¥ó¥Í¥ë", "1010.ontvjapan.com", 28768, 7, 221},
+       { "±ÒÀ±·à¾ì", "1005.ontvjapan.com", 28768, 7, 222},
+       { "¥Á¥ã¥ó¥Í¥ë£Î£Å£Ã£Ï", "1008.ontvjapan.com", 28768, 7, 223},
+       { "Íβè¡ú¥·¥Í¥Õ¥£¥ë", "1009.ontvjapan.com", 28768, 7, 224},
+       { "¥¹¥¿¡¼¡¦¥¯¥é¥·¥Ã¥¯", "1003.ontvjapan.com", 28768, 7, 238},
+       { "»þÂå·àÀìÌç¥Á¥ã¥ó¥Í¥ë", "1133.ontvjapan.com", 28768, 7, 292},
+       { "¥¹¡¼¥Ñ¡¼¥É¥é¥Þ", "1006.ontvjapan.com", 28768, 7, 310},
+       { "£Á£Ø£Î", "1014.ontvjapan.com", 28768, 7, 311},
+       { "¥Ê¥·¥ç¥¸¥ª¥Á¥ã¥ó¥Í¥ë", "1204.ontvjapan.com", 28768, 7, 343},
+       { "¥ï¥ó¥Æ¥ó¥Ý¡¼¥¿¥ë", "110ch.epgdata.ontvjapan", 28864, 7, 110},
+       { "¥´¥ë¥Õ¥Á¥ã¥ó¥Í¥ë", "1028.ontvjapan.com", 28864, 7, 260},
+       { "¥Æ¥ìÄ«¥Á¥ã¥ó¥Í¥ë", "1092.ontvjapan.com", 28864, 7, 303},
+       { "£Í£Ô£Ö", "1019.ontvjapan.com", 28864, 7, 323},
+       { "¥ß¥å¡¼¥¸¥Ã¥¯¡¦¥¨¥¢", "1024.ontvjapan.com", 28864, 7, 324},
+       { "Ä«Æü¥Ë¥å¡¼¥¹¥¿¡¼", "1067.ontvjapan.com", 28864, 7, 352},
+       { "£Â£Â£Ã¥ï¡¼¥ë¥É", "1070.ontvjapan.com", 28864, 7, 353},
+       { "£Ã£Î£Î£ê", "1069.ontvjapan.com", 28864, 7, 354},
+       { "¥¸¥ã¥¹¥È¡¦¥¢¥¤", "361ch.epgdata.ontvjapan", 28864, 7, 361},
+       { "£Ê¥¹¥Ý¡¼¥Ä¡¡£±", "1041.ontvjapan.com", 28896, 7, 251},
+       { "£Ê¥¹¥Ý¡¼¥Ä¡¡£²", "1042.ontvjapan.com", 28896, 7, 252},
+       { "£Ê¥¹¥Ý¡¼¥Ä£Ð£ì£õ£ó£È", "1043.ontvjapan.com", 28896, 7, 253},
+       { "£Ç£Á£Ï£Ò£Á", "1026.ontvjapan.com", 28896, 7, 254},
+       { "£ó£ë£ù¡¦£Á¥¹¥Ý¡¼¥Ä¡Ü", "1040.ontvjapan.com", 28896, 7, 255},
+       { "ÊõÄÍ¥×¥í¥â¥Á¥ã¥ó¥Í¥ë", "101ch.epgdata.ontvjapan", 28928, 7, 101},
+       { "£Ó£Ë£Ù¡¦£Ó£Ô£Á£Ç£Å", "1207.ontvjapan.com", 28928, 7, 290},
+       { "¥Á¥ã¥ó¥Í¥ë¶ä²Ï", "305ch.epgdata.ontvjapan", 28928, 7, 305},
+       { "£Á£Ô-£Ø", "1201.ontvjapan.com", 28928, 7, 333},
+       { "¥Ò¥¹¥È¥ê¡¼¥Á¥ã¥ó¥Í¥ë", "1050.ontvjapan.com", 28928, 7, 342},
+       { "¥¹¥«¥Á¥ã¥ó£¸£°£³", "803ch.epgdata.ontvjapan", 28928, 7, 803},
+       { "¥¹¥«¥Á¥ã¥ó£¸£°£´", "804ch.epgdata.ontvjapan", 28928, 7, 804},
+       { "¥à¡¼¥Ó¡¼¥×¥é¥¹£È£Ä", "1007.ontvjapan.com", 28960, 7, 240},
+       { "¥´¥ë¥Õ¥Í¥Ã¥È¥ï¡¼¥¯", "1027.ontvjapan.com", 28960, 7, 262},
+       { "£Ì£á£Ì£á¡¡£È£Ä", "1074.ontvjapan.com", 28960, 7, 314},
+       { "¥Õ¥¸¥Æ¥ì¥Ó£Ï£Î£Å", "1073.ontvjapan.com", 28992, 7, 307},
+       { "¥Õ¥¸¥Æ¥ì¥Ó£Ô£×£Ï", "1072.ontvjapan.com", 28992, 7, 308},
+       { "¥¢¥Ë¥Þ¥Ã¥¯¥¹", "1047.ontvjapan.com", 28992, 7, 332},
+       { "¥Ç¥£¥¹¥«¥Ð¥ê¡¼", "1062.ontvjapan.com", 28992, 7, 340},
+       { "¥¢¥Ë¥Þ¥ë¥×¥é¥Í¥Ã¥È", "1193.ontvjapan.com", 28992, 7, 341},
+       { "£Ã-£Ô£Â£Ó¥¦¥¨¥ë¥«¥à", "160ch.epgdata.ontvjapan", 29024, 7, 160},
+       { "£Ñ£Ö£Ã", "1120.ontvjapan.com", 29024, 7, 161},
+       { "¥×¥é¥¤¥à£³£¶£µ¡¥£Ô£Ö", "185ch.epgdata.ontvjapan", 29024, 7, 185},
+       { "¥Õ¥¡¥ß¥ê¡¼·à¾ì", "1015.ontvjapan.com", 29024, 7, 293},
+       { "£Ô£Â£Ó¥Á¥ã¥ó¥Í¥ë", "3201.ontvjapan.com", 29024, 7, 301},
+       { "¥Ç¥£¥º¥Ë¡¼¥Á¥ã¥ó¥Í¥ë", "1090.ontvjapan.com", 29024, 7, 304},
+       { "MUSIC ON! TV", "1022.ontvjapan.com", 29024, 7, 325},
+       { "¥­¥Ã¥º¥¹¥Æ¡¼¥·¥ç¥ó", "1045.ontvjapan.com", 29024, 7, 330},
+       { "£Ô£Â£Ó¥Ë¥å¡¼¥¹¥Ð¡¼¥É", "1076.ontvjapan.com", 29024, 7, 351},
+       { "£Ã£ÓÆüËÜÈÖÁÈ¥¬¥¤¥É", "147ch.epgdata.ontvjapan", 29056, 7, 147},
+       { "Æü¥Æ¥ì£Ç¡Ü", "1068.ontvjapan.com", 29056, 7, 257},
+       { "fashion TV", "5004.ontvjapan.com", 29056, 7, 291},
+       { "Æü¥Æ¥ì¥×¥é¥¹", "300ch.epgdata.ontvjapan", 29056, 7, 300},
+       { "¥¨¥³¥ß¥å¡¼¥¸¥Ã¥¯£Ô£Ö", "1023.ontvjapan.com", 29056, 7, 320},
+       { "Music Japan TV", "1208.ontvjapan.com", 29056, 7, 321},
+       { "Æü¥Æ¥ì£Î£Å£×£Ó£²£´", "2002.ontvjapan.com", 29056, 7, 350},
+};
+
+static int csStaCount = sizeof(csSta) / sizeof (STATION);
+SVT_CONTROL    *svttop = NULL;
+#define                SECCOUNT        4
+char   title[1024];
+char   subtitle[1024];
+char   desc[102400] = {0};
+char   Category[1024];
+char   ServiceName[1024];
+iconv_t        cd ;
+
+void   xmlspecialchars(char *str)
+{
+       strrep(str, "&", "&amp;");
+       strrep(str, "'", "&apos;");
+       strrep(str, "\"", "&quot;");
+       strrep(str, "<", "&lt;");
+       strrep(str, ">", "&gt;");
+}
+
+
+
+void   GetSDT(FILE *infile, SVT_CONTROL *svttop, SECcache *secs, int count)
+{
+       SECcache  *bsecs;
+
+       while((bsecs = readTS(infile, secs, count)) != NULL) {
+               /* SDT */
+               if((bsecs->pid & 0xFF) == 0x11) {
+                       dumpSDT(bsecs->buf, svttop);
+               }
+       }
+}
+void   GetEIT(FILE *infile, FILE *outfile, STATION *psta, SECcache *secs, int count)
+{
+       SECcache  *bsecs;
+       EIT_CONTROL     *eitcur ;
+       EIT_CONTROL     *eitnext ;
+       EIT_CONTROL     *eittop = NULL;
+       char    *outptr ;
+       char    *inptr ;
+       size_t  ilen;
+       size_t  olen;
+       time_t  l_time ;
+       time_t  end_time ;
+       struct  tm      tl ;
+       struct  tm      *endtl ;
+       char    cendtime[32];
+       char    cstarttime[32];
+
+       eittop = calloc(1, sizeof(EIT_CONTROL));
+       eitcur = eittop ;
+       fseek(infile, 0, SEEK_SET);
+       while((bsecs = readTS(infile, secs, SECCOUNT)) != NULL) {
+               /* EIT */
+               if((bsecs->pid & 0xFF) == 0x12) {
+                       dumpEIT(bsecs->buf, psta->svId, psta->onId, psta->tsId, eittop);
+               }else if((bsecs->pid & 0xFF) == 0x26) {
+                       dumpEIT(bsecs->buf, psta->svId, psta->onId, psta->tsId, eittop);
+               }else if((bsecs->pid & 0xFF) == 0x27) {
+                       dumpEIT(bsecs->buf, psta->svId, psta->onId, psta->tsId, eittop);
+               }
+       }
+       eitcur = eittop ;
+       while(eitcur != NULL){
+               if(!eitcur->servid){
+                       eitcur = eitcur->next ;
+                       continue ;
+               }
+               if(eitcur->content_type > CAT_COUNT){
+                       eitcur->content_type = CAT_COUNT -1 ;
+               }
+               outptr = title ;
+               memset(title, '\0', sizeof(title));
+               ilen = strlen(eitcur->title);
+               olen = sizeof(title);
+               inptr = eitcur->title;
+               iconv(cd, &inptr, &ilen, &outptr, &olen);
+               xmlspecialchars(title);
+
+               memset(subtitle, '\0', sizeof(subtitle));
+               ilen = strlen(eitcur->subtitle);
+               olen = sizeof(subtitle);
+               outptr = subtitle ;
+               inptr = eitcur->subtitle;
+               iconv(cd, &inptr, &ilen, &outptr, &olen);
+               xmlspecialchars(subtitle);
+
+               memset(desc, '\0', sizeof(desc));
+               if ( eitcur->desc ) {
+                       ilen = strlen(eitcur->desc);
+                       olen = sizeof(desc);
+                       outptr = desc ;
+                       inptr = eitcur->desc;
+                       iconv(cd, &inptr, &ilen, &outptr, &olen);
+                       xmlspecialchars(desc);
+               }
+
+               memset(Category, '\0', sizeof(Category));
+               ilen = strlen(ContentCatList[eitcur->content_type].japanese);
+               olen = sizeof(Category);
+               outptr = Category ;
+               inptr = ContentCatList[eitcur->content_type].japanese;
+               iconv(cd, &inptr, &ilen, &outptr, &olen);
+               xmlspecialchars(Category);
+
+               tl.tm_sec = eitcur->ss ;
+               tl.tm_min = eitcur->hm ;
+               tl.tm_hour = eitcur->hh ;
+               tl.tm_mday = eitcur->dd ;
+               tl.tm_mon = (eitcur->mm - 1);
+               tl.tm_year = (eitcur->yy - 1900);
+               tl.tm_wday = 0;
+               tl.tm_isdst = 0;
+               tl.tm_yday = 0;
+               l_time = mktime(&tl);
+               if((eitcur->ehh == 0) && (eitcur->emm == 0) && (eitcur->ess == 0)){
+                       (void)time(&l_time);
+                       end_time = l_time + (60 * 5);           // £µÊ¬¸å¤ËÀßÄê
+               endtl = localtime(&end_time);
+               }else{
+                       end_time = l_time + eitcur->ehh * 3600 + eitcur->emm * 60 + eitcur->ess;
+                       endtl = localtime(&end_time);
+               }
+               memset(cendtime, '\0', sizeof(cendtime));
+               memset(cstarttime, '\0', sizeof(cstarttime));
+               strftime(cendtime, (sizeof(cendtime) - 1), "%Y%m%d%H%M%S", endtl);
+               strftime(cstarttime, (sizeof(cstarttime) - 1), "%Y%m%d%H%M%S", &tl);
+#if 1
+               fprintf(outfile, "  <programme start=\"%s +0900\" stop=\"%s +0900\" channel=\"%s\">\n", 
+                               cstarttime, cendtime, psta->ontv);
+               fprintf(outfile, "    <title lang=\"ja_JP\">%s</title>\n", title);
+               fprintf(outfile, "    <desc lang=\"ja_JP\">%s</desc>\n", subtitle);
+               fprintf(outfile, "    <longdesc lang=\"ja_JP\">%s</longdesc>\n", desc);
+               fprintf(outfile, "    <category lang=\"ja_JP\">%s</category>\n", Category);
+//             fprintf(outfile, "    <category lang=\"en\">%s</category>\n", ContentCatList[eitcur->content_type].english);
+               fprintf(outfile, "  </programme>\n");
+#else
+               fprintf(outfile, "(%x:%x:%x)%s,%s,%s,%s,%s,%s\n",
+                                       eitcur->servid, eitcur->table_id, eitcur->event_id,
+                                       cstarttime, cendtime,
+                                       title, subtitle,
+                                       Category,
+                                       ContentCatList[eitcur->content_type].english);
+#endif
+#if 0
+               fprintf(outfile, "(%x:%x)%04d/%02d/%02d,%02d:%02d:%02d,%02d:%02d:%02d,%s,%s,%s,%s\n",
+                                       eitcur->table_id, eitcur->event_id,
+                                       eitcur->yy, eitcur->mm, eitcur->dd,
+                                       eitcur->hh, eitcur->hm, eitcur->ss,
+                                       eitcur->ehh, eitcur->emm, eitcur->ess,
+                                       eitcur->title, eitcur->subtitle,
+                                       ContentCatList[eitcur->content_type].japanese,
+                                       ContentCatList[eitcur->content_type].english);
+#endif
+               eitnext = eitcur->next ;
+               free(eitcur->title);
+               free(eitcur->subtitle);
+               free(eitcur);
+               eitcur = eitnext ;
+       }
+       free(eittop);
+       eittop = NULL;
+}
+int main(int argc, char *argv[])
+{
+
+       FILE *infile = stdin;
+       FILE *outfile = stdout;
+       int             arg_maxcount = 1 ;
+       char    *arg_onTV ;
+       int   mode = 1;
+       int             staCount ;
+       int   eitcnt;
+       char *file;
+       int   inclose = 0;
+       int   outclose = 0;
+       int             flag = 0 ;
+       SVT_CONTROL     *svtcur ;
+       SVT_CONTROL     *svtsave ;
+       char    *outptr ;
+       char    *inptr ;
+       size_t  ilen;
+       size_t  olen;
+       SECcache   secs[SECCOUNT];
+       int rtn;
+       int             lp ;
+       STATION *pStas ;
+       int             act ;
+
+       /* ¶½Ì£¤Î¤¢¤ëpid¤ò»ØÄê */
+       memset(secs, 0,  sizeof(SECcache) * SECCOUNT);
+       secs[0].pid = 0x11;
+       secs[1].pid = 0x12;
+       secs[2].pid = 0x26;
+       secs[3].pid = 0x27;
+
+       if(argc == 4){
+               arg_onTV = argv[1];
+               file = argv[2];
+               if(strcmp(file, "-")) {
+                       infile = fopen(file, "r");
+                       inclose = 1;
+               }
+               if(strcmp(argv[3], "-")) {
+                       outfile = fopen(argv[3], "w+");
+                       outclose = 1;
+               }
+       }else{
+               fprintf(stdout, "Usage : %s /BS <tsFile> <outfile>\n", argv[0]);
+               fprintf(stdout, "Usage : %s <ontvcode> <tsFile> <outfile>\n", argv[0]);
+               fprintf(stdout, "ontvcode ¥Á¥ã¥ó¥Í¥ë¼±Ê̻ҡ£****.ontvjapan.com ¤Ê¤É\n");
+               fprintf(stdout, "/BS      BS¥â¡¼¥É¡£°ì¤Ä¤ÎTS¤«¤éBSÁ´¶É¤Î¥Ç¡¼¥¿¤òÆɤ߹þ¤ß¤Þ¤¹¡£\n");
+               fprintf(stdout, "/CS      CS¥â¡¼¥É¡£°ì¤Ä¤ÎTS¤«¤éÊ£¿ô¶É¤Î¥Ç¡¼¥¿¤òÆɤ߹þ¤ß¤Þ¤¹¡£\n");
+               return 0;
+       }
+
+       if(strcmp(arg_onTV, "/BS") == 0){
+               pStas = bsSta;
+               staCount = bsStaCount;
+               act = 0 ;
+       }else if(strcmp(arg_onTV, "/CS") == 0){
+               pStas = csSta;
+               staCount = csStaCount;
+               act = 0 ;
+       }else{
+               act = 1 ;
+               svttop = calloc(1, sizeof(SVT_CONTROL));
+               GetSDT(infile, svttop, secs, SECCOUNT);
+               svtcur = svttop->next ; //ÀèƬ
+               if(svtcur == NULL){
+                       free(svttop);
+                       return ;
+               }
+
+               pStas = calloc(1, sizeof(STATION));
+               pStas->tsId = svtcur->transport_stream_id ;
+               pStas->onId = svtcur->original_network_id ;
+               pStas->svId = svtcur->event_id ;
+               pStas->ontv = arg_onTV ;
+               pStas->name = svtcur->servicename ;
+               staCount = 1;
+       }
+
+       fprintf(outfile, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+       fprintf(outfile, "<!DOCTYPE tv SYSTEM \"xmltv.dtd\">\n\n");
+       fprintf(outfile, "<tv generator-info-name=\"tsEPG2xml\" generator-info-url=\"http://localhost/\">\n");
+
+       cd = iconv_open("UTF-8", "EUC-JP");
+       for(lp = 0 ; lp < staCount ; lp++){
+               memset(ServiceName, '\0', sizeof(ServiceName));
+               ilen = strlen(pStas[lp].name);
+               olen = sizeof(ServiceName);
+               outptr = ServiceName ;
+               inptr = pStas[lp].name ;
+               iconv(cd, &inptr, &ilen, &outptr, &olen);
+               xmlspecialchars(ServiceName);
+
+               fprintf(outfile, "  <channel id=\"%s\">\n", pStas[lp].ontv);
+               fprintf(outfile, "    <display-name lang=\"ja_JP\">%s</display-name>\n", ServiceName);
+               fprintf(outfile, "  </channel>\n");
+       }
+       for(lp = 0 ; lp < staCount ; lp++){
+               GetEIT(infile, outfile, &pStas[lp], secs, SECCOUNT);
+       }
+       fprintf(outfile, "</tv>\n");
+       if(inclose) {
+               fclose(infile);
+       }
+
+       if(outclose) {
+               fclose(outfile);
+       }
+       iconv_close(cd);
+       if(act){
+               free(pStas);
+               svtcur = svttop ;       //ÀèƬ
+               while(svtcur != NULL){
+                       svtsave = svtcur->next ;
+                       free(svtcur);
+                       svtcur = svtsave ;
+               }
+       }
+
+       return 0;
+}
diff --git a/tstools/epgdump/epgdump_segfault_fix_patch(last).txt b/tstools/epgdump/epgdump_segfault_fix_patch(last).txt
new file mode 100755 (executable)
index 0000000..e402651
--- /dev/null
@@ -0,0 +1,30 @@
+diff -Nur epgdumpr2_orig/ts.c epgdumpr2/ts.c
+--- epgdumpr2_orig/ts.c        2009-03-15 21:35:57.000000000 +0900
++++ epgdumpr2/ts.c     2009-07-19 18:38:17.000000000 +0900
+@@ -202,6 +202,11 @@
+                       pk.payloadlen -= 1;
+               }
+               memset(pk.payload, 0xFF, sizeof(pk.payload));
++#if 1 /* 07/07/2009 add: */
++              if( pk.payloadlen > sizeof(pk.payload) ){
++                      continue;
++              }
++#endif
+               memcpy(pk.payload, payptr, pk.payloadlen);
+     
+               /*
+@@ -307,6 +312,14 @@
+ int checkcrc(SECcache *secs) {
++#if 1 /* 07/07/2009 add: °Û¾ï¾õÂÖ²óÈò¤Î¤¿¤á */
++      /* ¥»¥¯¥·¥ç¥óºÇÂçŤòĶ¤¨¤ë¤³¤È¤Ê¤É¤¢¤êÆÀ¤Ê¤¤¤Ï¤º¤À¤¬... */
++      if( secs->seclen > MAXSECLEN ){
++              /* ¤è¤¯Ê¬¤«¤é¤ó¤Î¤ÇÇË´þ¤·¤Æ¤ä¤ë */
++              return 0;
++      }
++#endif
++
+       /* ¥»¥¯¥·¥ç¥ó¤Î½ª¤ê¤ËÃÖ¤«¤ì¤ë4¥Ð¥¤¥È¤ÎCRC32¤Ï¡¢
+          CRC·×»»¤Î·ë²Ì0¤Ë¤Ê¤ë¤è¤¦¤ËÀßÄꤵ¤ì¤ë¡£
+          Ãͤ¬È¯À¸¤·¤¿¾ì¹ç¤Ï¡¢¥¨¥é¡¼¤Ê¤Î¤ÇÂоݳ°¤Ë¤¹¤ë */
diff --git a/tstools/epgdump/patch2ch b/tstools/epgdump/patch2ch
new file mode 100755 (executable)
index 0000000..e9bd2c7
--- /dev/null
@@ -0,0 +1,18 @@
+begin-base64 644 t1.uuc
+H4sIAFTfZkoAA+2TTU8TQRjHe91+ikm80G63ndltu1AiqSFwUg568dY0223Z
+AG2zu01AwocBnzVESSCgVkBLAwQq1cIJD8YYExOEkphAvBpnaA1WkRPBg88v
+m3nb5+U//+yaxVymNFZMOWYumy6NuqmsNZ4qpl1jOOyOu74rgXLi0aiYmR7X
+WnOMnp2LdVTXfYypGo3TmM5UH2XxmE59hF5N+8spOW7aJsSXL+RKxrB1SZxp
+O9ch6HrJWNksUYZKNjFbX4Ktpgq2lYu4Ttg4Pzvb+hVFuShMUintUaimsBhR
+WUKLJWJ6mP6EyLSHUr8sy7+Va6fpCushrDuhdSfYn2nJJFFUqobiRBYTYySZ
+9BNJkooj4WJ6YrSQzoyaeaLcJKxXnE+JYcwcc0y36zwkROj44GCIONYDs5D9
+5UUg0OuXb1hZwqRIkFA9wh8hi6QzmQQJRvyyJFnZLtLZre+CQiQwKYIlo5B3
+rXzJ7BW7KV7czHOP26qM4kSHKr4ounaoszyXRAQiJxI8c0CjunBAY9yB6JkD
+fmLlXWIMm8aIYRtd9wb6jTTfkaBjGk6ATPKIv99r4X3la+Xb+v7iae0EGrAG
+n1pX5aHeqjfvlb0D73Rle/1gcxlONp/DLDRhCWqwA69hBo62qnwFsAsrUIW5
+cDjcyhY+ie5KHx9bNt25dZ8ruz0w1HaHN4AvML8zB0/gEE557+3t+tPvUIYt
++AzNtuG26ZbsPKHCwnMHZe5Hh0BovHoMR1Df2OfVjqEZ9fY88GrQ6L/br6mw
+Oz3DM7iPfFt+t7oKjXJz8Q2FOhff5CoeQb36cfMInonc6Yet2I23MFebr77g
+itYqx8sHooo36x1Ov+RZXO36XuXD0gKvsdxS+69/XwRBEARBEARBEARBEARB
+EARBEARBEARBEOQ/5wfnyBSoACgAAA==
+==== 
diff --git a/tstools/epgdump/patch_r2 b/tstools/epgdump/patch_r2
new file mode 100755 (executable)
index 0000000..6d59eb9
--- /dev/null
@@ -0,0 +1,145 @@
+diff -rcw epgdumpr2.old/eit.c epgdumpr2/eit.c
+*** epgdumpr2.old/eit.c        2009-03-15 19:02:33.000000000 +0900
+--- epgdumpr2/eit.c    2009-03-24 20:45:25.961750270 +0900
+***************
+*** 6,11 ****
+--- 6,14 ----
+  
+  char         *subtitle_cnv_str[] = {
+       "¡¡Âè",
++      "¡¼Âè",
++      "-Âè",
++      " Âè",
+       "¡¡¡Ö",
+       "¡¡¡ô",
+       "¡Ê",
+***************
+*** 39,45 ****
+       return 14;
+  }
+  
+! int parseEITbody(unsigned char *data, EITbody *b) {
+       int boff = 0;
+       int tnum;
+       char buf[4];
+--- 42,49 ----
+       return 14;
+  }
+  
+! int parseEITbody(unsigned char *data, EITbody *b)
+! {
+       int boff = 0;
+       int tnum;
+       char buf[4];
+***************
+*** 78,97 ****
+  
+       b->yy += 1900;
+    
+       sprintf(buf, "%x", b->start_time[2]);
+       b->hh = atoi(buf);
+       sprintf(buf, "%x", b->start_time[3]);
+       b->hm = atoi(buf);
+       sprintf(buf, "%x", b->start_time[4]);
+       b->ss = atoi(buf);
+  
+       sprintf(buf, "%x", b->duration[0]);
+       b->dhh = atoi(buf);
+       sprintf(buf, "%x", b->duration[1]);
+       b->dhm = atoi(buf);
+       sprintf(buf, "%x", b->duration[2]);
+       b->dss = atoi(buf);
+!   
+       return 12;
+  }
+  
+--- 82,110 ----
+  
+       b->yy += 1900;
+    
++      memset(buf, '\0', sizeof(buf));
+       sprintf(buf, "%x", b->start_time[2]);
+       b->hh = atoi(buf);
++      memset(buf, '\0', sizeof(buf));
+       sprintf(buf, "%x", b->start_time[3]);
+       b->hm = atoi(buf);
++      memset(buf, '\0', sizeof(buf));
+       sprintf(buf, "%x", b->start_time[4]);
+       b->ss = atoi(buf);
+  
++      if((b->duration[0] == 0xFF) && (b->duration[1] == 0xFF) && (b->duration[2] == 0xFF)){
++              b->dhh = b->dhm = b->dss = 0;
++      }else{
++              memset(buf, '\0', sizeof(buf));
+               sprintf(buf, "%x", b->duration[0]);
+               b->dhh = atoi(buf);
++              memset(buf, '\0', sizeof(buf));
+               sprintf(buf, "%x", b->duration[1]);
+               b->dhm = atoi(buf);
++              memset(buf, '\0', sizeof(buf));
+               sprintf(buf, "%x", b->duration[2]);
+               b->dss = atoi(buf);
+!      }
+       return 12;
+  }
+  
+***************
+*** 269,274 ****
+--- 282,291 ----
+               if(ptr == NULL){
+                       continue ;
+               }
++              // ¥¿¥¤¥È¥ë¤¬¤Ê¤¯¤Ê¤é¤Ê¤¤¤è¤¦¤Ë
++              if(ptr == eitptr->title){
++                      continue ;
++              }
+               newsubtitle = calloc(1, ((strlen(ptr) + 1) + (strlen(eitptr->subtitle) + 1)));
+               memcpy(newsubtitle, ptr, strlen(ptr));
+               newsubtitle[strlen(ptr)] = ' ';
+diff -rcw epgdumpr2.old/epgdump.c epgdumpr2/epgdump.c
+*** epgdumpr2.old/epgdump.c    2009-03-15 21:29:33.000000000 +0900
+--- epgdumpr2/epgdump.c        2009-03-24 20:55:30.885022486 +0900
+***************
+*** 177,183 ****
+       char    *inptr ;
+       size_t  ilen;
+       size_t  olen;
+!      time_t  time ;
+       time_t  end_time ;
+       struct  tm      tl ;
+       struct  tm      *endtl ;
+--- 177,183 ----
+       char    *inptr ;
+       size_t  ilen;
+       size_t  olen;
+!      time_t  l_time ;
+       time_t  end_time ;
+       struct  tm      tl ;
+       struct  tm      *endtl ;
+***************
+*** 239,247 ****
+               tl.tm_wday = 0;
+               tl.tm_isdst = 0;
+               tl.tm_yday = 0;
+!              time = mktime(&tl);
+!              end_time = time + eitcur->ehh * 3600 + eitcur->emm * 60 + eitcur->ess;
+               endtl = localtime(&end_time);
+               memset(cendtime, '\0', sizeof(cendtime));
+               memset(cstarttime, '\0', sizeof(cstarttime));
+               strftime(cendtime, (sizeof(cendtime) - 1), "%Y%m%d%H%M%S", endtl);
+--- 239,253 ----
+               tl.tm_wday = 0;
+               tl.tm_isdst = 0;
+               tl.tm_yday = 0;
+!              l_time = mktime(&tl);
+!              if((eitcur->ehh == 0) && (eitcur->emm == 0) && (eitcur->ess == 0)){
+!                      (void)time(&l_time);
+!                      end_time = l_time + (60 * 5);           // £µÊ¬¸å¤ËÀßÄê
+                       endtl = localtime(&end_time);
++              }else{
++                      end_time = l_time + eitcur->ehh * 3600 + eitcur->emm * 60 + eitcur->ess;
++                      endtl = localtime(&end_time);
++              }
+               memset(cendtime, '\0', sizeof(cendtime));
+               memset(cstarttime, '\0', sizeof(cstarttime));
+               strftime(cendtime, (sizeof(cendtime) - 1), "%Y%m%d%H%M%S", endtl);
diff --git a/tstools/epgdump/readme.txt b/tstools/epgdump/readme.txt
new file mode 100755 (executable)
index 0000000..7727058
--- /dev/null
@@ -0,0 +1,57 @@
+xmltv-epg
+
+MPEG-TS\82É\8aÜ\82Ü\82ê\82éepg\82ðxml\82Å\8fo\97Í\82·\82é\83v\83\8d\83O\83\89\83\80\82Å\82·\81B
+\81\9fN/E9PqspSk\8e\81\82ªrecfriio Solaris\94Å(http://2sen.dip.jp/cgi-bin/friioup/source/up0737.zip)\82É\8aÜ\82Ü\82ê\82éepgdump\82ð
+Linux\94Å\82ð\89ü\91¢\82µ\82½\82à\82Ì\82ð\83x\81[\83X\82Éxmltv\97p\82Ìxml\83t\83@\83C\83\8b\82ð\8dì\90¬\82µ\82Ü\82·\81B
+
+\82Ü\82½\81A\83^\83C\83g\83\8b\93à\82É\8aÜ\82Ü\82ê\82é
+    "\81@\91æ"\82â\81A"\81@\81u"\81A"\81@\81\94"\81A"\81i"\81A"\81u"\81A\82ð\83T\83u\83^\83C\83g\83\8b\82Æ\82µ\82Ä\88µ\82¤\97l\82É\8fC\90³\82µ\82Ä\82¢\82Ü\82·\81B
+\97á\81F
+
+\83^\83C\83g\83\8b\82ª\81A
+\96¾\93ú\82Ì\82æ\82¢\82¿\81I\81u\82 \82Ì\8e\9e\8cN\82Í\83\8f\83\8b\82©\82Á\82½\81v
+\82Ì\8fê\8d\87
+\96¾\93ú\82Ì\82æ\82¢\82¿\81I\82ª\83^\83C\83g\83\8b\82É\81A\81u\82 \82Ì\8e\9e\8cN\82Í\83\8f\83\8b\82©\82Á\82½\81v\82ª\83T\83u\83^\83C\83g\83\8b\82É\92Ç\89Á\82³\82ê\82Ü\82·\81B
+
+\83T\83u\83^\83C\83g\83\8b\82Æ\82µ\82Ä\88µ\82¤\82à\82Ì\82ð\91\9d\82â\82·\8fê\8d\87\82Í\81Aeit.c\82É\82 \82ésubtitle_cnv_str\82É\92Ç\89Á\82µ\82Ä\82­\82¾\82³\82¢\81B
+
+\8eg\97p\95û\96@\82Í\88È\89º\82Ì\92Ê\82è\82Å\82·\81B
+
+Usage : ./epgdump /BS <tsFile> <outfile>
+Usage : ./epgdump <ontvcode> <tsFile> <outfile>
+ontvcode \83`\83\83\83\93\83l\83\8b\8e¯\95Ê\8eq\81B****.ontvjapan.com \82È\82Ç
+/BS      BS\83\82\81[\83h\81B\88ê\82Â\82ÌTS\82©\82çBS\91S\8bÇ\82Ì\83f\81[\83^\82ð\93Ç\82Ý\8d\9e\82Ý\82Ü\82·\81B
+/CS      CS\83\82\81[\83h\81B\88ê\82Â\82ÌTS\82©\82ç\95¡\90\94\8bÇ\82Ì\83f\81[\83^\82ð\93Ç\82Ý\8d\9e\82Ý\82Ü\82·\81B
+
+make\82·\82é\82Æepgdump\82ª\83r\83\8b\83h\82³\82ê\82Ü\82·\81B
+
+epgdump\83\89\83C\83Z\83\93\83X(Solaris\94Å\82æ\82è\88ø\97p):
+>epgdump\82É\8aÖ\82µ\82Ä\82Í\81ABonTest Ver.1.40\82©\82ç\82»\82Ì\82Ü\82Ü\83\\81[\83X\82ð\8e\9d\82Á\82Ä\82«\82Ä\82¢\82é\95\94\95ª\82à
+>\82 \82é\82½\82ß\81A\82»\82Ì\83\89\83C\83Z\83\93\83X\82É\8f]\82¢\82µ\82Ü\82·\81B
+>BonTest\82ÌReadme.txt\82æ\82è
+>>
+>>\82R\81D\83\89\83C\83Z\83\93\83X\82É\82Â\82¢\82Ä
+>>\81@\81@\81E\96{\83p\83b\83P\81[\83W\82É\8aÜ\82Ü\82ê\82é\91S\82Ä\82Ì\83\\81[\83X\83R\81[\83h\81A\83o\83C\83i\83\8a\82É\82Â\82¢\82Ä\92\98\8dì\8c \82Í\88ê\90Ø\8eå\92£\82µ\82Ü\82¹\82ñ\81B
+>>\81@\81@\81E\83I\83\8a\83W\83i\83\8b\82Ì\82Ü\82Ü\96\94\82Í\89ü\95Ï\82µ\81A\8ae\8e©\82Ì\83\\83t\83g\83E\83F\83A\82É\8e©\97R\82É\93Y\95t\81A\91g\82Ý\8d\9e\82Þ\82±\82Æ\82ª\82Å\82«\82Ü\82·\81B
+>>\81@\81@\81E\92A\82µGPL\82É\8f]\82¤\82±\82Æ\82ð\97v\8b\81\82µ\82Ü\82·\82Ì\82Å\82±\82ê\82ç\82ð\8ds\82¤\8fê\8d\87\82Í\83\\81[\83X\83R\81[\83h\82Ì\8aJ\8e¦\82ª\95K\90{\82Æ\82È\82è\82Ü\82·\81B
+>>\81@\81@\81E\82±\82Ì\82Æ\82«\96{\83\\83t\83g\83E\83F\83A\82Ì\92\98\8dì\8c \95\\8e¦\82ð\8ds\82¤\82©\82Ç\82¤\82©\82Í\94C\88Ó\82Å\82·\81B
+>>\81@\81@\81E\96{\83\\83t\83g\83E\83F\83A\82ÍFAAD2\82Ì\83\89\83C\83u\83\89\83\8a\94Å\83o\83C\83i\83\8a\82ð\8eg\97p\82µ\82Ä\82¢\82Ü\82·\81B
+>>
+>>\81@\81@\81@"Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
+>>
+>>\81@\81@\81E\83r\83\8b\83h\82É\95K\97v\82È\8aÂ\8b«
+>>\81@\81@\81@- Microsoft Visual Studio 2005 \88È\8fã\81@\81¦MFC\82ª\95K\97v
+>>\81@\81@\81@- Microsoft Windows SDK v6.0 \88È\8fã\81@\81@\81¦DirectShow\8aî\92ê\83N\83\89\83X\82Ì\83R\83\93\83p\83C\83\8b\8dÏ\82Ý\83\89\83C\83u\83\89\83\8a\82ª\95K\97v
+>>\81@\81@\81@- Microsoft DirectX 9.0 SDK \88È\8fã
+
+Special Thanks:
+\81ESolaris\94Å\8aJ\94­\8eÒ\82Ì\95û
+\81E\8ag\92£\83c\81[\83\8b\92\86\82Ì\90l
+\81E\81\9fN/E9PqspSk\8e\81
+\81EARIB(\8e\91\97¿\82Ì\96³\97¿\83_\83E\83\93\83\8d\81[\83h\82É\91Î\82µ\82Ä)
+
+\93®\8dì\8am\94F\8aÂ\8b«:
+  Debian GNU/Linux sid
+  Linux 2.6.27.19 SMP PREEMPT x86_64
+
+tomy \81\9fCfWlfzSGyg
diff --git a/tstools/epgdump/sdt.c b/tstools/epgdump/sdt.c
new file mode 100755 (executable)
index 0000000..46a74ff
--- /dev/null
@@ -0,0 +1,166 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "sdt.h"
+#include "ts_ctl.h"
+
+int parseSDThead(unsigned char *data, SDThead *h) {
+       int boff = 0;
+
+       memset(h, 0, sizeof(SDThead));
+
+       boff = 0;
+       h->table_id = getBit(data, &boff, 8);
+       h->section_syntax_indicator = getBit(data, &boff, 1);
+       h->reserved_future_use1 = getBit(data, &boff, 1);
+       h->reserved1 = getBit(data, &boff, 2);
+       h->section_length = getBit(data, &boff, 12);
+       h->transport_stream_id = getBit(data, &boff, 16);
+       h->reserved2 = getBit(data, &boff, 2);
+       h->version_number = getBit(data, &boff, 5);
+       h->current_next_indicator = getBit(data, &boff, 1);
+       h->section_number = getBit(data, &boff, 8);
+       h->last_section_number = getBit(data, &boff, 8);
+       h->original_network_id = getBit(data, &boff, 16);
+       h->reserved_future_use2 = getBit(data, &boff, 8);
+
+       return 11;
+}
+
+int parseSDTbody(unsigned char *data, SDTbody *b) {
+       int boff = 0;
+
+       memset(b, 0, sizeof(SDTbody));
+
+       b->service_id = getBit(data, &boff, 16);
+       b->reserved_future_use1 = getBit(data, &boff, 3);
+       b->EIT_user_defined_flags = getBit(data, &boff, 3);
+       b->EIT_schedule_flag = getBit(data, &boff, 1);
+       b->EIT_present_following_flag = getBit(data, &boff, 1);
+       b->running_status = getBit(data, &boff, 3);
+       b->free_CA_mode = getBit(data, &boff, 1);
+       b->descriptors_loop_length = getBit(data, &boff, 12);
+
+       return 5;
+}
+
+int parseSVCdesc(unsigned char *data, SVCdesc *desc) {
+       int boff = 0;
+  
+       memset(desc, 0, sizeof(SVCdesc));
+
+       desc->descriptor_tag = getBit(data, &boff, 8);
+       desc->descriptor_length = getBit(data, &boff, 8);
+       desc->service_type = getBit(data, &boff, 8);
+       desc->service_provider_name_length = getBit(data, &boff, 8);
+       getStr(desc->service_provider_name, data, &boff, desc->service_provider_name_length);
+       desc->service_name_length = getBit(data, &boff, 8);
+       getStr(desc->service_name, data, &boff, desc->service_name_length);
+
+       return desc->descriptor_length + 2;
+}
+int            serachid(SVT_CONTROL *top, int service_id)
+{
+       SVT_CONTROL     *cur = top ;
+       while(cur != NULL){
+               if(cur->event_id == service_id){
+                       return 1 ;
+               }
+               cur = cur->next ;
+       }
+       return 0 ;
+}
+
+void   enqueue_sdt(SVT_CONTROL *top, SVT_CONTROL *sdtptr)
+{
+       SVT_CONTROL     *cur ;
+
+       if(top->next == NULL){
+               top->next = sdtptr ;
+               top->prev = top ;
+               return ;
+       }
+       cur = top->next ;
+       while(cur != NULL){
+               if(sdtptr->event_id < cur->event_id){
+                       if(cur->prev != NULL){
+                               cur->prev->next = sdtptr ;
+                               sdtptr->prev = cur->prev ;
+                       }
+                       cur->prev = sdtptr ;
+                       sdtptr->next = cur ;
+                       return ;
+               }
+               if(cur->next == NULL){
+                       cur->next = sdtptr ;
+                       sdtptr->prev = cur ;
+                       return ;
+               }
+               cur = cur->next ;
+       }
+       return ;
+
+}
+
+void dumpSDT(unsigned char *ptr, SVT_CONTROL *top)
+{
+
+       SDThead  sdth;
+       SDTbody  sdtb;
+       SVCdesc  desc;
+       SVT_CONTROL     *svtptr ;
+       int             rc ;
+
+       int len = 0;
+       int loop_len = 0;
+
+       /* SDT */
+       len = parseSDThead(ptr, &sdth); 
+       ptr += len;
+       loop_len = sdth.section_length - (len - 3 + 4); // 3¤Ï¶¦Ḁ̈إåÀĹ 4¤ÏCRC
+       while(loop_len > 0) {
+               len = parseSDTbody(ptr, &sdtb);
+               ptr += len;
+               loop_len -= len;
+               parseSVCdesc(ptr, &desc);
+
+               rc = serachid(top, sdtb.service_id);
+               if(rc == 0){
+                       svtptr = calloc(1, sizeof(SVT_CONTROL));
+                       svtptr->event_id = sdtb.service_id;
+                       svtptr->original_network_id = sdth.original_network_id;
+                       svtptr->transport_stream_id = sdth.transport_stream_id;
+                       svtptr->event_id = sdtb.service_id;
+                       memcpy(svtptr->servicename, desc.service_name, strlen(desc.service_name));
+                       enqueue_sdt(top, svtptr);
+#if 0
+                       printf("SDT=%s,%d,%x,%x,%x,%x,%x,%x,%x\n",
+                               desc.service_name, sdtb.service_id, sdtb.reserved_future_use1,
+                               sdtb.EIT_user_defined_flags, sdtb.EIT_schedule_flag, sdtb.EIT_present_following_flag,
+                               sdtb.running_status, sdtb.free_CA_mode, sdtb.descriptors_loop_length);
+/*
+#else
+0x01:\83f\83W\83^\83\8bTV\83T\81[\83r\83X
+0xA5:\83v\83\8d\83\82\81[\83V\83\87\83\93\89f\91\9c\83T\81[\83r\83X
+0x0C:\83f\81[\83^\83T\81[\83r\83X
+ */
+                       printf("SDT=(%x:%x)%s,%d,%d,%d,%d,%d(%d,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x)\n",
+                                       sdth.table_id, desc.service_type, 
+                                       desc.service_name, sdtb.service_id,
+                                       desc.descriptor_tag, desc.descriptor_length, desc.service_type,
+                                       desc.service_provider_name_length, desc.service_name_length,
+                                       sdth.table_id, sdth.section_syntax_indicator, sdth.reserved_future_use1,
+                                       sdth.reserved1, sdth.section_length, sdth.transport_stream_id,
+                                       sdth.reserved2, sdth.version_number, sdth.current_next_indicator,
+                                       sdth.section_number, sdth.last_section_number, sdth.original_network_id,
+                                       sdth.reserved_future_use2);
+#endif
+               }
+
+               ptr += sdtb.descriptors_loop_length;
+               loop_len -= sdtb.descriptors_loop_length;
+       }
+  
+       return;
+}
diff --git a/tstools/epgdump/sdt.h b/tstools/epgdump/sdt.h
new file mode 100755 (executable)
index 0000000..81f7335
--- /dev/null
@@ -0,0 +1,61 @@
+#ifndef SDT_H
+#define SDT_H 1
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "util.h"
+#include "ts_ctl.h"
+
+typedef struct _SDThead {
+       char table_id;
+       int  section_syntax_indicator;
+       int  reserved_future_use1;
+       int  reserved1;
+       int  section_length;
+       int  transport_stream_id;
+       int  reserved2;
+       int  version_number;
+       int  current_next_indicator;
+       int  section_number;
+       int  last_section_number;
+       int  original_network_id;
+       int  reserved_future_use2;
+} SDThead;
+
+typedef struct _SDTbody {
+       int  service_id;
+       int  reserved_future_use1;
+       int  EIT_user_defined_flags;
+       int  EIT_schedule_flag;
+       int  EIT_present_following_flag;
+       int  running_status;
+       int  free_CA_mode;
+       int  descriptors_loop_length;
+} SDTbody;
+
+typedef struct _SVCdesc {
+       int  descriptor_tag;
+       int  descriptor_length;
+       int  service_type;
+       int  service_provider_name_length;
+       char service_provider_name[MAXSECLEN];
+       int  service_name_length;
+       char service_name[MAXSECLEN];
+} SVCdesc;
+
+
+#ifdef __cplusplus
+extern "C"{
+#endif /* __cplusplus */
+
+       int parseSDThead(unsigned char *data, SDThead *h);
+       int parseSDTbody(unsigned char *data, SDTbody *b);
+       int parseSVCdesc(unsigned char *data, SVCdesc *desc);
+       void dumpSDT(unsigned char *data, SVT_CONTROL *top);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/tstools/epgdump/ts.c b/tstools/epgdump/ts.c
new file mode 100755 (executable)
index 0000000..c6cac1c
--- /dev/null
@@ -0,0 +1,332 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "ts.h"
+
+static unsigned int CalcCrc(unsigned int crc, unsigned char *buf, int len);
+static int checkcrc(SECcache *secs);
+
+SECcache *readTS(FILE *in, SECcache secs[], int size) {
+       static int rcount = 0;
+       static int ridx = -1;
+
+       TSpacket pk;
+  
+       unsigned char buf[1024];
+
+       int boff;
+       int len;
+       unsigned char *payptr;
+
+       int inchar;
+       int i;
+
+       /* sync¥Ð¥¤¥È¤Þ¤ÇÆɤßÈô¤Ð¤· */
+       if(rcount == 0) {
+               while((inchar = fgetc(in)) != EOF) {
+                       if((inchar & 0xFF) == 0x47) {
+                               //fseek(in, -1, SEEK_CUR);
+                               ungetc(inchar, in);
+                               break;
+                       }
+               }
+               if(inchar == EOF) {
+                       return NULL;
+               }
+       }
+
+retry:
+  
+       /* Ì᤹¤Ù¤­»Ä¤ê¤¬¤¢¤ë¤«? */
+       if(ridx >= 0 && secs[ridx].cont) {
+               /* ¥Ð¥Ã¥Õ¥¡¥Á¥§¥Ã¥¯ */
+               if((secs[ridx].cur.payload[secs[ridx].curlen] & 0xFF) == 0xFF) {
+                       secs[ridx].cont = 0;
+                       secs[ridx].seclen = 0;
+                       secs[ridx].setlen = 0;
+                       secs[ridx].curlen = 0;
+               } else {
+                       len = secs[ridx].cur.payloadlen - secs[ridx].curlen;
+                       /* Á´ÉôÀßÄêºÑ¤ß¥Á¥§¥Ã¥¯ */
+                       if(len == 0) {
+                               secs[ridx].cont = 0;
+                               secs[ridx].seclen = 0;
+                               secs[ridx].setlen = 0;
+                               secs[ridx].curlen = 0;
+                       } else {
+                               /* ¤³¤³¤Çseclen¤¬¸Ù¤ë¤è¤¦¤ËTSʬ³ä¤µ¤ì¤Æ¤¤¤ë¤Èº¤¤ë¤Ê @@
+                                  if(secs[ridx].pid == 0x12) {
+                                  int check = secs[ridx].cur.payload[secs[ridx].curlen] & 0xFF;
+                                  if(!(check == 0x4E ||
+                                  check == 0x4F ||
+                                  (check >= 0x50 && check <= 0x6F))) {
+                                  secs[ridx].curlen -= 3;
+                                  }
+                                  }
+                               */
+       
+                               boff = 12;
+                               secs[ridx].seclen = getBit(&secs[ridx].cur.payload[secs[ridx].curlen], &boff, 12) + 3; // ¥Ø¥Ã¥À
+       
+                               /*
+                                 if(secs[ridx].seclen == 2334) {
+                                 printf("aa");
+                                 }
+                               */
+       
+                               /* TS¥Ç¡¼¥¿Ä¹-ÀßÄêºÑ¤ß¥Ç¡¼¥¿Ä¹ */
+                               if(secs[ridx].seclen > len) {
+                                       memcpy(secs[ridx].buf, &secs[ridx].cur.payload[secs[ridx].curlen], len);
+                                       secs[ridx].setlen = len;
+                                       secs[ridx].curlen = 0;
+                                       secs[ridx].cont   = 1;
+                                       /* ¼¡¤Î¥ì¥³¡¼¥ÉÆɤ߹þ¤ß */
+                               } else {
+                                       memcpy(secs[ridx].buf, 
+                                                  &secs[ridx].cur.payload[secs[ridx].curlen], secs[ridx].seclen);
+                                       secs[ridx].setlen  = secs[ridx].seclen;
+                                       secs[ridx].curlen += secs[ridx].seclen;
+                                       secs[ridx].cont = 1;
+
+                                       /* CRC¤Î¥Á¥§¥Ã¥¯ */
+                                       if(checkcrc(&(secs[ridx]))) {
+                                               return &(secs[ridx]); /* Ìá¤ë */
+                                       }
+                                       goto retry; /* ¤â¤¦°ì²ó */
+                               }
+                       }
+               }
+       }
+
+       int roffset = 0;
+       while(1) {
+               if(fread(buf+roffset, 188-roffset, 1, in) != 1) {
+                       /* »Ä¤ê¤Î½èÍý? */
+                       return NULL;
+               }
+               roffset = 0;
+               rcount++;
+
+               if((buf[0] & 0xFF) != 0x47) {
+                       /* ºÇ½é¤ÏbufÃæ¤Ë0x47¤¬¤¢¤ë¤«¥Á¥§¥Ã¥¯ */
+                       for(i = 1; i < 188; i++) {
+                               if((buf[i] & 0xFF) == 0x47) {
+                                       break;
+                               }
+                       }
+
+                       if(i < 188) {
+                               /* ¤½¤³¤«¤éºÆÆɤ߹þ¤ß¤·¤ÆÍߤ·¤¤¤Î¤Çseek */
+                               //fseek(in, (188 - i) * -1, SEEK_CUR);
+                               roffset = i;
+                               memmove(buf, buf + i, 188 - i);
+                               continue;
+                       }
+
+                       while((inchar = fgetc(in)) != EOF) {
+                               if((inchar & 0xFF) == 0x47) {
+                                       //fseek(in, -1, SEEK_CUR);
+                                       ungetc(inchar, in);
+                                       break;
+                               }
+                       }
+                       if(inchar == EOF) {
+                               return NULL;
+                       }
+                       continue;
+               }
+
+               /*
+                 if(rcount == 406502) {
+                 printf("aa");
+                 }
+               */
+
+    
+               pk.rcount = rcount;
+    
+               boff = 0;
+               pk.sync = getBit(buf, &boff, 8);
+               pk.transport_error_indicator = getBit(buf, &boff, 1);
+               pk.payload_unit_start_indicator = getBit(buf, &boff, 1);
+               pk.transport_priority = getBit(buf, &boff, 1);
+               pk.pid = getBit(buf, &boff, 13);
+               pk.transport_scrambling_control = getBit(buf, &boff, 2);
+               pk.adaptation_field_control = getBit(buf, &boff, 2);
+               pk.continuity_counter = getBit(buf, &boff, 4);
+
+               /*
+                 adaptation_field_control 2 bslbf
+                 continuity_counter 4 uimsbf
+                 if(adaptation_field_control = = '10' || adaptation_field_control = = '11'){
+                 adaptation_field()
+                 }
+                 ...
+                 adaptation_field() {
+                 adaptation_field_length 8 uimsbf
+                 if (adaptation_field_length > 0) {
+                 discontinuity_indicator....
+
+                 00 Reserved for future use by ISO/IEC
+                 01 No adaptation_field, payload only
+                 10 Adaptation_field only, no payload
+                 11 Adaptation_field followed by payload
+
+               */
+
+               pk.payloadlen = 184;
+
+               if(pk.adaptation_field_control == 2) {
+                       continue;
+               }
+
+               if(pk.adaptation_field_control == 3) {
+                       len = getBit(buf, &boff, 8);
+                       payptr = buf + (boff / 8) + len;
+                       pk.payloadlen -= (len + 1);
+               } else {
+                       payptr = buf + (boff / 8);
+               }
+               if(pk.payloadlen < 0){
+                       continue ;
+               }
+
+               /* 
+                  if the Transport Stream packet carries the first byte of a PSI section, the payload_unit_start_indicator value
+                  shall be '1', indicating that the first byte of the payload of this Transport Stream packet carries the pointer_field.
+               */
+               if(pk.payload_unit_start_indicator == 1) {
+                       /* pointer_field¤Ï¤¤¤é¤Ê¤¤ */
+                       payptr += 1;
+                       pk.payloadlen -= 1;
+               }
+               memset(pk.payload, 0xFF, sizeof(pk.payload));
+#if 1  /* 07/07/2009 add: */
+               if( pk.payloadlen > sizeof(pk.payload) ){
+                       continue;
+               }
+#endif
+               memcpy(pk.payload, payptr, pk.payloadlen);
+    
+               /*
+                 if(pk.rcount == 62) {
+                 printf("62\n");
+                 }
+
+                 if(pk.rcount == 63) {
+                 printf("63\n");
+                 }
+               */
+    
+               /* ¶½Ì£¤Î¤¢¤ëpid¤«³Îǧ */
+               for(int i = 0;i < size; i++) {
+                       if(secs[i].pid == pk.pid) {
+                               secs[i].cur = pk;
+                               /* ÅÓÃæ½èÍýÃ椫ºÇ½é¤«? */
+                               if(!secs[i].cont) {
+                                       /* ºÇ½é ¥»¥¯¥·¥ç¥óŤòÄ´¤Ù¤ë */
+                                       boff = 12;
+                                       secs[i].seclen = getBit(secs[i].cur.payload, &boff, 12) + 3; // ¥Ø¥Ã¥À;
+                                       /*
+                                         if(secs[i].seclen == 2334) {
+                                         printf("aa");
+                                         }
+                                       */
+
+                                       if(secs[i].seclen > secs[i].cur.payloadlen) {
+                                               memcpy(secs[i].buf, secs[i].cur.payload, secs[i].cur.payloadlen);
+                                               secs[i].setlen = secs[i].cur.payloadlen;
+                                               secs[i].cont = 1;
+                                               continue;
+                                       } 
+                                       memcpy(secs[i].buf, secs[i].cur.payload, secs[i].seclen);
+                                       secs[i].setlen = secs[i].seclen;
+                                       secs[i].curlen = secs[i].seclen;
+                                       secs[i].cont = 1;
+                                       ridx = i;
+                                       /* CRC¤Î¥Á¥§¥Ã¥¯ */
+                                       if(checkcrc(&(secs[ridx]))) {
+                                               return &(secs[i]); /* ¼è¤ê¹ç¤¨¤ºÌá¤ë */
+                                       }
+                                       goto retry; /* »Ä¤ê½èÍý¤Ø */
+                               }
+                               /* ¥»¥¯¥·¥ç¥óĹ-ÀßÄêºÑ¤ßĹ */
+                               len = secs[i].seclen - secs[i].setlen;
+                               if(len > secs[i].cur.payloadlen) {
+                                       /* Á´ÂΞÁ÷ */
+                                       memcpy(&secs[i].buf[secs[i].setlen], 
+                                                  secs[i].cur.payload, secs[i].cur.payloadlen);
+                                       secs[i].setlen += secs[i].cur.payloadlen;
+                                       continue;
+                               }
+                               /* ¥»¥¯¥·¥ç¥óŤλĤê¤òÀßÄê */
+                               memcpy(&secs[i].buf[secs[i].setlen], secs[i].cur.payload, len);
+                               secs[i].setlen  = secs[i].seclen;
+                               secs[i].curlen += len;
+                               secs[i].cont    = 1;
+                               ridx = i;
+                               /* CRC¤Î¥Á¥§¥Ã¥¯ */
+                               if(checkcrc(&(secs[ridx]))) {
+                                       return &(secs[i]);
+                               }
+                               goto retry; /* »Ä¤ê½èÍý¤Ø */
+                       }
+               }
+       }
+
+       //return NULL;
+}
+
+/* BonTest/TsStream.cpp¤«¤é¤Î¥Ñ¥¯¥ê */
+unsigned int CalcCrc(unsigned int crc, unsigned char *buf, int len) {
+       unsigned int c = crc;
+       int n;
+
+       static const unsigned int CrcTable[256] = {
+               0x00000000UL, 0x04C11DB7UL, 0x09823B6EUL, 0x0D4326D9UL, 0x130476DCUL, 0x17C56B6BUL, 0x1A864DB2UL, 0x1E475005UL, 0x2608EDB8UL, 0x22C9F00FUL, 0x2F8AD6D6UL, 0x2B4BCB61UL, 0x350C9B64UL, 0x31CD86D3UL, 0x3C8EA00AUL, 0x384FBDBDUL,
+               0x4C11DB70UL, 0x48D0C6C7UL, 0x4593E01EUL, 0x4152FDA9UL, 0x5F15ADACUL, 0x5BD4B01BUL, 0x569796C2UL, 0x52568B75UL, 0x6A1936C8UL, 0x6ED82B7FUL, 0x639B0DA6UL, 0x675A1011UL, 0x791D4014UL, 0x7DDC5DA3UL, 0x709F7B7AUL, 0x745E66CDUL,
+               0x9823B6E0UL, 0x9CE2AB57UL, 0x91A18D8EUL, 0x95609039UL, 0x8B27C03CUL, 0x8FE6DD8BUL, 0x82A5FB52UL, 0x8664E6E5UL, 0xBE2B5B58UL, 0xBAEA46EFUL, 0xB7A96036UL, 0xB3687D81UL, 0xAD2F2D84UL, 0xA9EE3033UL, 0xA4AD16EAUL, 0xA06C0B5DUL,
+               0xD4326D90UL, 0xD0F37027UL, 0xDDB056FEUL, 0xD9714B49UL, 0xC7361B4CUL, 0xC3F706FBUL, 0xCEB42022UL, 0xCA753D95UL, 0xF23A8028UL, 0xF6FB9D9FUL, 0xFBB8BB46UL, 0xFF79A6F1UL, 0xE13EF6F4UL, 0xE5FFEB43UL, 0xE8BCCD9AUL, 0xEC7DD02DUL,
+               0x34867077UL, 0x30476DC0UL, 0x3D044B19UL, 0x39C556AEUL, 0x278206ABUL, 0x23431B1CUL, 0x2E003DC5UL, 0x2AC12072UL, 0x128E9DCFUL, 0x164F8078UL, 0x1B0CA6A1UL, 0x1FCDBB16UL, 0x018AEB13UL, 0x054BF6A4UL, 0x0808D07DUL, 0x0CC9CDCAUL,
+               0x7897AB07UL, 0x7C56B6B0UL, 0x71159069UL, 0x75D48DDEUL, 0x6B93DDDBUL, 0x6F52C06CUL, 0x6211E6B5UL, 0x66D0FB02UL, 0x5E9F46BFUL, 0x5A5E5B08UL, 0x571D7DD1UL, 0x53DC6066UL, 0x4D9B3063UL, 0x495A2DD4UL, 0x44190B0DUL, 0x40D816BAUL,
+               0xACA5C697UL, 0xA864DB20UL, 0xA527FDF9UL, 0xA1E6E04EUL, 0xBFA1B04BUL, 0xBB60ADFCUL, 0xB6238B25UL, 0xB2E29692UL, 0x8AAD2B2FUL, 0x8E6C3698UL, 0x832F1041UL, 0x87EE0DF6UL, 0x99A95DF3UL, 0x9D684044UL, 0x902B669DUL, 0x94EA7B2AUL,
+               0xE0B41DE7UL, 0xE4750050UL, 0xE9362689UL, 0xEDF73B3EUL, 0xF3B06B3BUL, 0xF771768CUL, 0xFA325055UL, 0xFEF34DE2UL, 0xC6BCF05FUL, 0xC27DEDE8UL, 0xCF3ECB31UL, 0xCBFFD686UL, 0xD5B88683UL, 0xD1799B34UL, 0xDC3ABDEDUL, 0xD8FBA05AUL,
+               0x690CE0EEUL, 0x6DCDFD59UL, 0x608EDB80UL, 0x644FC637UL, 0x7A089632UL, 0x7EC98B85UL, 0x738AAD5CUL, 0x774BB0EBUL, 0x4F040D56UL, 0x4BC510E1UL, 0x46863638UL, 0x42472B8FUL, 0x5C007B8AUL, 0x58C1663DUL, 0x558240E4UL, 0x51435D53UL,
+               0x251D3B9EUL, 0x21DC2629UL, 0x2C9F00F0UL, 0x285E1D47UL, 0x36194D42UL, 0x32D850F5UL, 0x3F9B762CUL, 0x3B5A6B9BUL, 0x0315D626UL, 0x07D4CB91UL, 0x0A97ED48UL, 0x0E56F0FFUL, 0x1011A0FAUL, 0x14D0BD4DUL, 0x19939B94UL, 0x1D528623UL,
+               0xF12F560EUL, 0xF5EE4BB9UL, 0xF8AD6D60UL, 0xFC6C70D7UL, 0xE22B20D2UL, 0xE6EA3D65UL, 0xEBA91BBCUL, 0xEF68060BUL, 0xD727BBB6UL, 0xD3E6A601UL, 0xDEA580D8UL, 0xDA649D6FUL, 0xC423CD6AUL, 0xC0E2D0DDUL, 0xCDA1F604UL, 0xC960EBB3UL,
+               0xBD3E8D7EUL, 0xB9FF90C9UL, 0xB4BCB610UL, 0xB07DABA7UL, 0xAE3AFBA2UL, 0xAAFBE615UL, 0xA7B8C0CCUL, 0xA379DD7BUL, 0x9B3660C6UL, 0x9FF77D71UL, 0x92B45BA8UL, 0x9675461FUL, 0x8832161AUL, 0x8CF30BADUL, 0x81B02D74UL, 0x857130C3UL,
+               0x5D8A9099UL, 0x594B8D2EUL, 0x5408ABF7UL, 0x50C9B640UL, 0x4E8EE645UL, 0x4A4FFBF2UL, 0x470CDD2BUL, 0x43CDC09CUL, 0x7B827D21UL, 0x7F436096UL, 0x7200464FUL, 0x76C15BF8UL, 0x68860BFDUL, 0x6C47164AUL, 0x61043093UL, 0x65C52D24UL,
+               0x119B4BE9UL, 0x155A565EUL, 0x18197087UL, 0x1CD86D30UL, 0x029F3D35UL, 0x065E2082UL, 0x0B1D065BUL, 0x0FDC1BECUL, 0x3793A651UL, 0x3352BBE6UL, 0x3E119D3FUL, 0x3AD08088UL, 0x2497D08DUL, 0x2056CD3AUL, 0x2D15EBE3UL, 0x29D4F654UL,
+               0xC5A92679UL, 0xC1683BCEUL, 0xCC2B1D17UL, 0xC8EA00A0UL, 0xD6AD50A5UL, 0xD26C4D12UL, 0xDF2F6BCBUL, 0xDBEE767CUL, 0xE3A1CBC1UL, 0xE760D676UL, 0xEA23F0AFUL, 0xEEE2ED18UL, 0xF0A5BD1DUL, 0xF464A0AAUL, 0xF9278673UL, 0xFDE69BC4UL,
+               0x89B8FD09UL, 0x8D79E0BEUL, 0x803AC667UL, 0x84FBDBD0UL, 0x9ABC8BD5UL, 0x9E7D9662UL, 0x933EB0BBUL, 0x97FFAD0CUL, 0xAFB010B1UL, 0xAB710D06UL, 0xA6322BDFUL, 0xA2F33668UL, 0xBCB4666DUL, 0xB8757BDAUL, 0xB5365D03UL, 0xB1F740B4UL
+       };              
+
+       for (n = 0; n < len; n++) {
+               c = (c << 8) ^ CrcTable[((((c >> 24) & 0xFF) ^ buf[n]) & 0XFF)];
+       }
+
+       return c;
+}
+
+
+int checkcrc(SECcache *secs) {
+
+#if 1  /* 07/07/2009 add: °Û¾ï¾õÂÖ²óÈò¤Î¤¿¤á */
+       /* ¥»¥¯¥·¥ç¥óºÇÂçŤòĶ¤¨¤ë¤³¤È¤Ê¤É¤¢¤êÆÀ¤Ê¤¤¤Ï¤º¤À¤¬... */
+       if( secs->seclen > MAXSECLEN ){
+               /* ¤è¤¯Ê¬¤«¤é¤ó¤Î¤ÇÇË´þ¤·¤Æ¤ä¤ë */
+               return 0;
+       }
+#endif
+
+       /* ¥»¥¯¥·¥ç¥ó¤Î½ª¤ê¤ËÃÖ¤«¤ì¤ë4¥Ð¥¤¥È¤ÎCRC32¤Ï¡¢
+          CRC·×»»¤Î·ë²Ì0¤Ë¤Ê¤ë¤è¤¦¤ËÀßÄꤵ¤ì¤ë¡£
+          Ãͤ¬È¯À¸¤·¤¿¾ì¹ç¤Ï¡¢¥¨¥é¡¼¤Ê¤Î¤ÇÂоݳ°¤Ë¤¹¤ë */
+       if(CalcCrc(0xffffffffU, secs->buf, secs->seclen)) {
+//             fprintf(stderr, "tblid:0x%x CRC error\n", secs->buf[0]);
+               return 0;
+       }
+       return 1;
+}
+
diff --git a/tstools/epgdump/ts.h b/tstools/epgdump/ts.h
new file mode 100755 (executable)
index 0000000..da39812
--- /dev/null
@@ -0,0 +1,46 @@
+#ifndef TS_H
+#define TS_H 1
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "util.h"
+
+#define TSPAYLOADMAX 184
+
+typedef struct _TSpacket { 
+       char     sync;
+       int      transport_error_indicator;
+       int      payload_unit_start_indicator;
+       int      transport_priority;
+       int      pid;
+       int      transport_scrambling_control;
+       int      adaptation_field_control;
+       int      continuity_counter;
+       int      adaptation_field;
+       unsigned char payload[TSPAYLOADMAX];
+       int      payloadlen;
+       int      rcount;
+} TSpacket;
+
+typedef struct _SECcache { 
+       int      pid;
+       unsigned char buf[MAXSECLEN];
+       int      seclen;
+       int      setlen;
+       TSpacket cur;
+       int      curlen;
+       int      cont;
+} SECcache;
+
+#ifdef __cplusplus
+extern "C"{
+#endif /* __cplusplus */
+
+       SECcache *readTS(FILE *in, SECcache secs[], int secscount);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/tstools/epgdump/ts_ctl.h b/tstools/epgdump/ts_ctl.h
new file mode 100755 (executable)
index 0000000..1d74dd0
--- /dev/null
@@ -0,0 +1,40 @@
+#ifndef        __TS_CONTROL_H__
+#define        __TS_CONTROL_H__
+
+#include       "util.h"
+
+typedef        struct  _SVT_CONTROL    SVT_CONTROL;
+struct _SVT_CONTROL{
+       SVT_CONTROL     *next ;
+       SVT_CONTROL     *prev ;
+       int             event_id ;                      // ¥¤¥Ù¥ó¥ÈID
+       int             original_network_id ;                   // OriginalNetworkID
+       int             transport_stream_id ;                   // TransporrtStreamID
+       char    servicename[MAXSECLEN] ;                // ¥µ¡¼¥Ó¥¹Ì¾
+};
+
+typedef        struct  _EIT_CONTROL    EIT_CONTROL;
+struct _EIT_CONTROL{
+       EIT_CONTROL     *next ;
+       EIT_CONTROL     *prev ;
+       int             table_id ;
+       int             servid ;
+       int             event_id ;                      // ¥¤¥Ù¥ó¥ÈID
+       int             content_type ;          // ¥³¥ó¥Æ¥ó¥È¥¿¥¤¥×
+    int                yy;
+    int                mm;
+    int                dd;
+    int                hh;
+    int                hm;
+       int             ss;
+       int             dhh;
+       int             dhm;
+       int             dss;
+       int             ehh;
+       int             emm;
+       int             ess;
+       char    *title ;                        // ¥¿¥¤¥È¥ë
+       char    *subtitle ;                     // ¥µ¥Ö¥¿¥¤¥È¥ë
+       char    *desc ;                 // Description
+};
+#endif
diff --git a/tstools/epgdump/util.c b/tstools/epgdump/util.c
new file mode 100755 (executable)
index 0000000..1dc39bb
--- /dev/null
@@ -0,0 +1,76 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "aribstr.h"
+#include "util.h"
+
+int strrep(char *buf, char *mae, char *ato)
+{
+    char *mituke;
+       size_t maelen, atolen;
+                   
+       maelen = strlen(mae);
+       atolen = strlen(ato);
+       if (maelen == 0 || (mituke = strstr(buf, mae)) == NULL) return 0;
+       memmove(mituke + atolen, mituke + maelen, strlen(buf) - (mituke + maelen - buf ) + 1);
+       memcpy(mituke, ato, atolen);
+       return 1;
+}
+int getBit(unsigned char *byte, int *pbit, int gbit) {
+       int pbyte = *pbit / 8;
+       unsigned char *fbyte = byte + pbyte;
+
+       int cutbit = *pbit - (pbyte * 8);
+       int lcutbit = 32 - (cutbit + gbit);
+
+       unsigned char tbuf[4]; /* int¤ÎºÇÂç32bit */
+       unsigned int tnum;
+
+       memcpy(tbuf, fbyte, sizeof(unsigned char) * 4);
+
+       /* ÀèƬ¥Ð¥¤¥È¤«¤éÉÔÍ×bit¤ò¥«¥Ã¥È */
+       tbuf[0] = tbuf[0] << cutbit;
+       tbuf[0] = tbuf[0] >> cutbit;
+
+       /* int¤Ë¤·¤Æ¤·¤Þ¤¦ */
+       tnum = tbuf[0] << 24 | tbuf[1] << 16 | tbuf[2] << 8 | tbuf[3];
+
+       /* ¸å¤í¤ÎÉÔÍץХ¤¥È¤ò¥«¥Ã¥È */
+       tnum = tnum >> lcutbit;
+
+       *pbit += gbit;
+
+       return tnum;
+  
+}
+
+void getStr(char *tostr, unsigned char *byte, int *pbit, int len) {
+       char str[MAXSECLEN];
+       int pbyte = *pbit / 8;
+       unsigned char *fbyte = byte + pbyte;
+
+       memset(str, 0, sizeof(char) * MAXSECLEN);
+       memcpy(str, fbyte, len);
+
+       *pbit += (len * 8);
+  
+       AribToString(tostr, str, len);
+
+       return;
+  
+}
+
+int parseOTHERdesc(unsigned char *data) {
+       int boff = 0;
+       int descriptor_tag;
+       int descriptor_length;
+
+       descriptor_tag = getBit(data, &boff, 8);
+       descriptor_length = getBit(data, &boff, 8);
+
+       /* printf("other desc_tag:0x%x\n", descriptor_tag); */
+
+       return descriptor_length + 2;
+}
+
diff --git a/tstools/epgdump/util.h b/tstools/epgdump/util.h
new file mode 100755 (executable)
index 0000000..483f624
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef UTIL_H
+#define UTILH 1
+
+#define MAXSECLEN 4096
+
+#ifdef __cplusplus
+extern "C"{
+#endif /* __cplusplus */
+
+       int   getBit(unsigned char *byte, int *pbit, int gbit);
+       void  getStr(char *tostr, unsigned char *byte, int *pbit, int len);
+       int   parseOTHERdesc(unsigned char *data);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/tstools/epgdump/xmldata.c b/tstools/epgdump/xmldata.c
new file mode 100755 (executable)
index 0000000..56e087b
--- /dev/null
@@ -0,0 +1,93 @@
+static STATION bsSta[] = {
+       { "NHK BS1", "3001.ontvjapan.com", 16625, 4, 101},
+       { "NHK BS2", "3002.ontvjapan.com", 16625, 4, 102},
+       { "NHK BSh", "3003.ontvjapan.com", 16626, 4, 103},
+       { "BSÆü¥Æ¥ì", "3004.ontvjapan.com", 16592, 4, 141},
+       { "BSÄ«Æü", "3005.ontvjapan.com", 16400, 4, 151},
+       { "BS-i", "3006.ontvjapan.com", 16401, 4, 161},
+       { "BS¥¸¥ã¥Ñ¥ó", "3007.ontvjapan.com", 16433, 4, 171},
+       { "BS¥Õ¥¸", "3008.ontvjapan.com", 16593, 4, 181},
+       { "WOWOW", "3009.ontvjapan.com", 16432, 4, 191},
+       { "WOWOW2", "3010.ontvjapan.com", 16432, 4, 192},
+       { "WOWOW3", "3011.ontvjapan.com", 16432, 4, 193},
+       { "BS11", "3013.ontvjapan.com", 16528, 4, 211},
+       { "TwellV", "3014.ontvjapan.com", 16530, 4, 222},
+};
+
+static int bsStaCount = sizeof(bsSta) / sizeof (STATION);
+
+
+
+static STATION csSta[] = {
+       { "¥¹¥¿¡¼£ã£è¥×¥é¥¹", "1002.ontvjapan.com", 24608, 6, 237},
+       { "ÆüËܱDzèÀìÌç£ã£è£È£Ä", "1086.ontvjapan.com", 24608, 6, 239},
+       { "¥Õ¥¸¥Æ¥ì¥Ó£Ã£Ó£È£Ä", "306ch.epgdata.ontvjapan", 24608, 6, 306},
+       { "¥·¥ç¥Ã¥×¥Á¥ã¥ó¥Í¥ë", "1059.ontvjapan.com", 24704, 6, 55},
+       { "¥¶¡¦¥·¥Í¥Þ", "1217.ontvjapan.com", 24736, 6, 228},
+       { "¥¹¥«¥Á¥ã¥ó£È£Ä£¸£°£°", "800ch.epgdata.ontvjapan", 24736, 6, 800},
+       { "¥¹¥«¥Á¥ã¥ó£¸£°£±", "801ch.epgdata.ontvjapan", 24736, 6, 801},
+       { "¥¹¥«¥Á¥ã¥ó£¸£°£²", "802ch.epgdata.ontvjapan", 24736, 6, 802},
+       { "£å£²¥×¥í¥â", "100ch.epgdata.ontvjapan", 28736, 7, 100},
+       { "¥¤¥ó¥¿¡¼¥í¡¼¥«¥ë£Ô£Ö", "194ch.epgdata.ontvjapan", 28736, 7, 194},
+       { "£Ê¥¹¥Ý¡¼¥Ä¡¡£Å£Ó£Ð£Î", "1025.ontvjapan.com", 28736, 7, 256},
+       { "£Æ£Ï£Ø", "1016.ontvjapan.com", 28736, 7, 312},
+       { "¥¹¥Ú¡¼¥¹¥·¥ã¥ï¡¼£Ô£Ö", "1018.ontvjapan.com", 28736, 7, 322},
+       { "¥«¡¼¥È¥¥¡¼¥ó¡¡¥Í¥Ã¥È", "1046.ontvjapan.com", 28736, 7, 331},
+       { "¥È¥¥¡¼¥ó¡¦¥Ç¥£¥º¥Ë¡¼", "1213.ontvjapan.com", 28736, 7, 334},
+       { "Åì±Ç¥Á¥ã¥ó¥Í¥ë", "1010.ontvjapan.com", 28768, 7, 221},
+       { "±ÒÀ±·à¾ì", "1005.ontvjapan.com", 28768, 7, 222},
+       { "¥Á¥ã¥ó¥Í¥ë£Î£Å£Ã£Ï", "1008.ontvjapan.com", 28768, 7, 223},
+       { "Íβè¡ú¥·¥Í¥Õ¥£¥ë", "1009.ontvjapan.com", 28768, 7, 224},
+       { "¥¹¥¿¡¼¡¦¥¯¥é¥·¥Ã¥¯", "1003.ontvjapan.com", 28768, 7, 238},
+       { "»þÂå·àÀìÌç¥Á¥ã¥ó¥Í¥ë", "1133.ontvjapan.com", 28768, 7, 292},
+       { "¥¹¡¼¥Ñ¡¼¥É¥é¥Þ", "1006.ontvjapan.com", 28768, 7, 310},
+       { "£Á£Ø£Î", "1014.ontvjapan.com", 28768, 7, 311},
+       { "¥Ê¥·¥ç¥¸¥ª¥Á¥ã¥ó¥Í¥ë", "1204.ontvjapan.com", 28768, 7, 343},
+       { "¥ï¥ó¥Æ¥ó¥Ý¡¼¥¿¥ë", "110ch.epgdata.ontvjapan", 28864, 7, 110},
+       { "¥´¥ë¥Õ¥Á¥ã¥ó¥Í¥ë", "1028.ontvjapan.com", 28864, 7, 260},
+       { "¥Æ¥ìÄ«¥Á¥ã¥ó¥Í¥ë", "1092.ontvjapan.com", 28864, 7, 303},
+       { "£Í£Ô£Ö", "1019.ontvjapan.com", 28864, 7, 323},
+       { "¥ß¥å¡¼¥¸¥Ã¥¯¡¦¥¨¥¢", "1024.ontvjapan.com", 28864, 7, 324},
+       { "Ä«Æü¥Ë¥å¡¼¥¹¥¿¡¼", "1067.ontvjapan.com", 28864, 7, 352},
+       { "£Â£Â£Ã¥ï¡¼¥ë¥É", "1070.ontvjapan.com", 28864, 7, 353},
+       { "£Ã£Î£Î£ê", "1069.ontvjapan.com", 28864, 7, 354},
+       { "¥¸¥ã¥¹¥È¡¦¥¢¥¤", "361ch.epgdata.ontvjapan", 28864, 7, 361},
+       { "£Ê¥¹¥Ý¡¼¥Ä¡¡£±", "1041.ontvjapan.com", 28896, 7, 251},
+       { "£Ê¥¹¥Ý¡¼¥Ä¡¡£²", "1042.ontvjapan.com", 28896, 7, 252},
+       { "£Ê¥¹¥Ý¡¼¥Ä£Ð£ì£õ£ó£È", "1043.ontvjapan.com", 28896, 7, 253},
+       { "£Ç£Á£Ï£Ò£Á", "1026.ontvjapan.com", 28896, 7, 254},
+       { "£ó£ë£ù¡¦£Á¥¹¥Ý¡¼¥Ä¡Ü", "1040.ontvjapan.com", 28896, 7, 255},
+       { "ÊõÄÍ¥×¥í¥â¥Á¥ã¥ó¥Í¥ë", "101ch.epgdata.ontvjapan", 28928, 7, 101},
+       { "£Ó£Ë£Ù¡¦£Ó£Ô£Á£Ç£Å", "1207.ontvjapan.com", 28928, 7, 290},
+       { "¥Á¥ã¥ó¥Í¥ë¶ä²Ï", "305ch.epgdata.ontvjapan", 28928, 7, 305},
+       { "£Á£Ô-£Ø", "1201.ontvjapan.com", 28928, 7, 333},
+       { "¥Ò¥¹¥È¥ê¡¼¥Á¥ã¥ó¥Í¥ë", "1050.ontvjapan.com", 28928, 7, 342},
+       { "¥¹¥«¥Á¥ã¥ó£¸£°£³", "803ch.epgdata.ontvjapan", 28928, 7, 803},
+       { "¥¹¥«¥Á¥ã¥ó£¸£°£´", "804ch.epgdata.ontvjapan", 28928, 7, 804},
+       { "¥à¡¼¥Ó¡¼¥×¥é¥¹£È£Ä", "1007.ontvjapan.com", 28960, 7, 240},
+       { "¥´¥ë¥Õ¥Í¥Ã¥È¥ï¡¼¥¯", "1027.ontvjapan.com", 28960, 7, 262},
+       { "£Ì£á£Ì£á¡¡£È£Ä", "1074.ontvjapan.com", 28960, 7, 314},
+       { "¥Õ¥¸¥Æ¥ì¥Ó£·£³£¹", "1073.ontvjapan.com", 28992, 7, 258},
+       { "¥Õ¥¸¥Æ¥ì¥Ó£·£²£±", "1072.ontvjapan.com", 28992, 7, 302},
+       { "¥¢¥Ë¥Þ¥Ã¥¯¥¹", "1047.ontvjapan.com", 28992, 7, 332},
+       { "¥Ç¥£¥¹¥«¥Ð¥ê¡¼", "1062.ontvjapan.com", 28992, 7, 340},
+       { "¥¢¥Ë¥Þ¥ë¥×¥é¥Í¥Ã¥È", "1193.ontvjapan.com", 28992, 7, 341},
+       { "£Ã-£Ô£Â£Ó¥¦¥¨¥ë¥«¥à", "160ch.epgdata.ontvjapan", 29024, 7, 160},
+       { "£Ñ£Ö£Ã", "1120.ontvjapan.com", 29024, 7, 161},
+       { "¥×¥é¥¤¥à£³£¶£µ¡¥£Ô£Ö", "185ch.epgdata.ontvjapan", 29024, 7, 185},
+       { "¥Õ¥¡¥ß¥ê¡¼·à¾ì", "1015.ontvjapan.com", 29024, 7, 293},
+       { "£Ô£Â£Ó¥Á¥ã¥ó¥Í¥ë", "3201.ontvjapan.com", 29024, 7, 301},
+       { "¥Ç¥£¥º¥Ë¡¼¥Á¥ã¥ó¥Í¥ë", "1090.ontvjapan.com", 29024, 7, 304},
+       { "MUSIC ON! TV", "1022.ontvjapan.com", 29024, 7, 325},
+       { "¥­¥Ã¥º¥¹¥Æ¡¼¥·¥ç¥ó", "1045.ontvjapan.com", 29024, 7, 330},
+       { "£Ô£Â£Ó¥Ë¥å¡¼¥¹¥Ð¡¼¥É", "1076.ontvjapan.com", 29024, 7, 351},
+       { "£Ã£ÓÆüËÜÈÖÁÈ¥¬¥¤¥É", "147ch.epgdata.ontvjapan", 29056, 7, 147},
+       { "Æü¥Æ¥ì£Ç¡Ü", "1068.ontvjapan.com", 29056, 7, 257},
+       { "fashion TV", "5004.ontvjapan.com", 29056, 7, 291},
+       { "Æü¥Æ¥ì¥×¥é¥¹", "300ch.epgdata.ontvjapan", 29056, 7, 300},
+       { "¥¨¥³¥ß¥å¡¼¥¸¥Ã¥¯£Ô£Ö", "1023.ontvjapan.com", 29056, 7, 320},
+       { "Music Japan TV", "1208.ontvjapan.com", 29056, 7, 321},
+       { "Æü¥Æ¥ì£Î£Å£×£Ó£²£´", "2002.ontvjapan.com", 29056, 7, 350},
+};
+
+static int csStaCount = sizeof(csSta) / sizeof (STATION);
diff --git a/tstools/jTsSplitter/jTsSplitter.jar b/tstools/jTsSplitter/jTsSplitter.jar
new file mode 100644 (file)
index 0000000..3c231de
Binary files /dev/null and b/tstools/jTsSplitter/jTsSplitter.jar differ