From 62521dc0f7707bdec548b21fb49398f0541ee9bb Mon Sep 17 00:00:00 2001
From: Alessio Treglia
Date: Tue, 9 Jun 2015 09:14:58 +0100
Subject: [PATCH] Imported Upstream version 0.5.2-426-gc5ad4e4~dfsg1
---
.gitattributes | 19 +
.travis.yml | 19 +
INSTALLME | 26 +-
Makefile | 130 +-
README | 5 +-
applications/Makefile | 18 +-
applications/dashcast/Makefile | 1 +
applications/dashcast/audio_data.h | 2 +-
applications/dashcast/audio_decoder.c | 21 +-
applications/dashcast/audio_encoder.c | 11 +-
applications/dashcast/audio_muxer.c | 42 +-
applications/dashcast/audio_muxer.h | 3 +
applications/dashcast/cmd_data.c | 73 +-
applications/dashcast/cmd_data.h | 1 +
applications/dashcast/controler.c | 111 +-
applications/dashcast/dashcast.c | 17 +-
applications/dashcast/task.c | 4 +-
applications/dashcast/video_data.c | 3 +-
applications/dashcast/video_data.h | 7 +-
applications/dashcast/video_decoder.c | 52 +-
applications/dashcast/video_decoder.h | 3 +-
applications/dashcast/video_encoder.c | 31 +-
applications/dashcast/video_encoder.h | 2 +-
applications/dashcast/video_muxer.c | 138 +-
applications/dashcast/video_muxer.h | 12 +-
applications/dashcast/video_scaler.c | 34 +-
applications/dashcast/video_scaler.h | 1 +
applications/generators/MPEG4/MPEG4Gen.dsp | 196 +-
applications/generators/MPEG4/MPEG4Gen.dsw | 58 +-
applications/generators/MPEG4/main.c | 18 +-
applications/generators/SVG/SVGGen.dsp | 252 +-
applications/generators/SVG/SVGGen.dsw | 58 +-
applications/generators/SVG/html.c | 4 +-
applications/generators/SVG/laser.c | 2 +-
applications/generators/SVG/main.c | 4 +-
applications/generators/X3D/X3DGen.dsp | 196 +-
applications/generators/X3D/X3DGen.dsw | 58 +-
applications/generators/X3D/main.c | 12 +-
applications/m3u82mpd/m3u82mpd.vcproj | 366 +-
applications/m3u82mpd/main.c | 4 +-
applications/mp42avi/main.c | 18 +-
applications/mp42ts/Makefile | 4 +-
applications/mp42ts/main.c | 206 +-
applications/mp4box/Makefile | 9 +-
applications/mp4box/filedump.c | 457 +-
applications/mp4box/fileimport.c | 405 +-
applications/mp4box/live.c | 24 +-
applications/mp4box/main.c | 1109 +-
applications/mp4box/wrapper.c | 4 +-
applications/mp4client/Makefile | 5 +
applications/mp4client/carbon_events.c | 109 +
applications/mp4client/extract.c | 475 +-
applications/mp4client/main.c | 881 +-
applications/mp4client/mp4client.rc | 144 +-
applications/testapps/bmp4demux/bmp4demux.sln | 40 +-
.../testapps/bmp4demux/bmp4demux.vcxproj | 379 +-
.../bmp4demux/bmp4demux.vcxproj.filters | 269 +-
applications/testapps/bmp4demux/build.sh | 2 +-
.../testapps/broadcaster/broadcaster.c | 8 +-
.../testapps/broadcaster/broadcaster.dsp | 292 +-
.../testapps/broadcaster/sdp_generator.c | 4 +-
applications/testapps/dmbrs/dmbrs.dsp | 180 +-
applications/testapps/dmbrs/main.c | 20 +-
applications/testapps/fmp4demux/build.sh | 2 +-
applications/testapps/fmp4demux/fmp4demux.sln | 40 +-
.../testapps/fmp4demux/fmp4demux.vcxproj | 377 +-
.../fmp4demux/fmp4demux.vcxproj.filters | 275 +-
applications/testapps/fmp4demux/main.c | 10 +-
applications/testapps/hevcbench/defbench.h | 222 +-
.../testapps/hevcbench/hevcbench.vcxproj | 522 +-
applications/testapps/hevcbench/main.c | 1715 ++--
applications/testapps/largefile/largefile.dsp | 204 +-
applications/testapps/largefile/largefile.dsw | 88 +-
.../testapps/loadcompare/LoadCompare.dsp | 224 +-
.../testapps/loadcompare/loadcompare.c | 16 +-
applications/testapps/mp42ts/mp42ts.vcproj | 434 +-
applications/testapps/mpedemux/main.c | 2 +-
applications/testapps/mpedemux/mpedemux.dsp | 180 +-
applications/testapps/mpeg2ts/main.c | 10 +-
applications/testapps/mpeg2ts/mpeg2ts.dsp | 200 +-
applications/testapps/segmp4demux/build.sh | 2 +-
.../testapps/segmp4demux/segmp4demux.sln | 40 +-
.../testapps/segmp4demux/segmp4demux.vcxproj | 379 +-
.../segmp4demux/segmp4demux.vcxproj.filters | 269 +-
applications/testapps/svg2bifs/svg2bifs.dsp | 180 +-
applications/ts2hds/f4m.c | 12 +-
applications/ts2hds/main.c | 41 +-
applications/udptsseg/main.c | 10 +-
applications/udptsseg/udptsseg.dsp | 188 +-
applications/udptsseg/udptsseg.vcproj | 426 +-
.../release/install/archive.bat | 25 +-
.../release/install/build_installer.bat | 77 +-
.../release/install/readme.txt | 12 +-
configure | 764 +-
doc/INSTALL.w32 | 2 +-
doc/configuration.html | 1778 ++--
extra_lib/include/DTAPI.h | 7232 +++++++++++++
.../ffmpeg_android/libavcodec/avcodec.h | 5959 ++++++-----
.../include/ffmpeg_android/libavcodec/avfft.h | 236 +
.../ffmpeg_android/libavcodec/dv_profile.h | 160 +
.../include/ffmpeg_android/libavcodec/dxva2.h | 186 +
.../ffmpeg_android/libavcodec/old_codec_ids.h | 794 ++
.../include/ffmpeg_android/libavcodec/vaapi.h | 346 +
.../include/ffmpeg_android/libavcodec/vda.h | 426 +
.../include/ffmpeg_android/libavcodec/vdpau.h | 430 +
.../ffmpeg_android/libavcodec/version.h | 364 +
.../include/ffmpeg_android/libavcodec/xvmc.h | 340 +
.../ffmpeg_android/libavformat/avformat.h | 2711 +++--
.../include/ffmpeg_android/libavformat/avio.h | 744 +-
.../ffmpeg_android/libavformat/version.h | 170 +
.../ffmpeg_android/libavutil/adler32.h | 110 +
.../include/ffmpeg_android/libavutil/aes.h | 130 +
.../ffmpeg_android/libavutil/attributes.h | 83 +-
.../ffmpeg_android/libavutil/audio_fifo.h | 306 +
.../ffmpeg_android/libavutil/audioconvert.h | 12 +
.../ffmpeg_android/libavutil/avassert.h | 132 +
.../ffmpeg_android/libavutil/avconfig.h | 2 +
.../ffmpeg_android/libavutil/avstring.h | 728 ++
.../include/ffmpeg_android/libavutil/avutil.h | 319 +-
.../include/ffmpeg_android/libavutil/base64.h | 134 +
.../ffmpeg_android/libavutil/blowfish.h | 154 +
.../include/ffmpeg_android/libavutil/bprint.h | 432 +
.../include/ffmpeg_android/libavutil/bswap.h | 218 +
.../include/ffmpeg_android/libavutil/buffer.h | 548 +
.../ffmpeg_android/libavutil/channel_layout.h | 444 +
.../include/ffmpeg_android/libavutil/common.h | 360 +-
.../include/ffmpeg_android/libavutil/cpu.h | 232 +
.../include/ffmpeg_android/libavutil/crc.h | 172 +
.../include/ffmpeg_android/libavutil/dict.h | 356 +
.../ffmpeg_android/libavutil/display.h | 172 +
.../ffmpeg_android/libavutil/downmix_info.h | 230 +
.../include/ffmpeg_android/libavutil/error.h | 91 +-
.../include/ffmpeg_android/libavutil/eval.h | 226 +
.../ffmpeg_android/libavutil/ffversion.h | 8 +
.../include/ffmpeg_android/libavutil/fifo.h | 316 +
.../include/ffmpeg_android/libavutil/file.h | 132 +
.../include/ffmpeg_android/libavutil/frame.h | 1518 +++
.../include/ffmpeg_android/libavutil/hash.h | 224 +
.../include/ffmpeg_android/libavutil/hmac.h | 198 +
.../ffmpeg_android/libavutil/imgutils.h | 426 +
.../ffmpeg_android/libavutil/intfloat.h | 154 +
.../libavutil/intfloat_readwrite.h | 16 +-
.../ffmpeg_android/libavutil/intreadwrite.h | 1258 +++
.../include/ffmpeg_android/libavutil/lfg.h | 124 +
.../include/ffmpeg_android/libavutil/log.h | 271 +-
.../include/ffmpeg_android/libavutil/lzo.h | 132 +
.../include/ffmpeg_android/libavutil/macros.h | 96 +
.../ffmpeg_android/libavutil/mathematics.h | 82 +-
.../include/ffmpeg_android/libavutil/md5.h | 162 +
.../include/ffmpeg_android/libavutil/mem.h | 310 +-
.../ffmpeg_android/libavutil/motion_vector.h | 100 +
.../ffmpeg_android/libavutil/murmur3.h | 64 +
.../ffmpeg_android/libavutil/old_pix_fmts.h | 354 +
.../include/ffmpeg_android/libavutil/opt.h | 1718 ++++
.../ffmpeg_android/libavutil/parseutils.h | 374 +
.../ffmpeg_android/libavutil/pixdesc.h | 718 ++
.../ffmpeg_android/libavutil/pixelutils.h | 104 +
.../include/ffmpeg_android/libavutil/pixfmt.h | 566 +-
.../ffmpeg_android/libavutil/random_seed.h | 86 +
.../ffmpeg_android/libavutil/rational.h | 63 +-
.../ffmpeg_android/libavutil/replaygain.h | 102 +
.../include/ffmpeg_android/libavutil/ripemd.h | 150 +
.../ffmpeg_android/libavutil/samplefmt.h | 558 +
.../include/ffmpeg_android/libavutil/sha.h | 148 +
.../include/ffmpeg_android/libavutil/sha512.h | 150 +
.../ffmpeg_android/libavutil/stereo3d.h | 304 +
.../ffmpeg_android/libavutil/threadmessage.h | 182 +
.../include/ffmpeg_android/libavutil/time.h | 112 +
.../ffmpeg_android/libavutil/timecode.h | 280 +
.../ffmpeg_android/libavutil/timestamp.h | 156 +
.../ffmpeg_android/libavutil/version.h | 310 +
.../include/ffmpeg_android/libavutil/xtea.h | 128 +
.../ffmpeg_android/libswscale/swscale.h | 169 +-
.../ffmpeg_android/libswscale/version.h | 118 +
extra_lib/include/js/jscpucfg.h | 108 +-
extra_lib/include/js/jstypes.h | 2 +-
extra_lib/include/openHevcWrapper.h | 10 +-
fixEOL.sh | 12 -
generate_installer.bat | 194 +-
gui/extensions/H2B2VS/H2B2VS.png | Bin 0 -> 22850 bytes
gui/extensions/H2B2VS/h2b2vs.js | 392 +
gui/extensions/H2B2VS/init.js | 16 +
gui/extensions/H2B2VS/logo_hd.png | Bin 0 -> 16123 bytes
gui/extensions/H2B2VS/logo_uhd.png | Bin 0 -> 50515 bytes
.../player}/applications-multimedia.svg | 0
gui/extensions/player/fileopen.js | 242 +
gui/extensions/player/init.js | 15 +
gui/extensions/player/player.js | 1436 +++
gui/extensions/player/playlist.js | 327 +
gui/extensions/player/stats.js | 606 ++
gui/extensions/widget_manager/init.js | 1854 ++--
gui/gui.bt | 30 +-
gui/gui.js | 1475 +--
gui/gui_old.js | 14 +-
gui/gwlib.js | 5390 ++++++----
gui/icons/add.svg | 12 +
gui/icons/app.svg | 35 +
gui/icons/applications-internet.svg | 622 --
gui/icons/applications-system.svg | 247 -
gui/icons/audio-volume-high.svg | 643 --
gui/icons/audio-volume-low.svg | 641 --
gui/icons/audio-volume-medium.svg | 646 --
gui/icons/audio-volume-muted.svg | 991 --
gui/icons/audio-x-generic.svg | 180 -
gui/icons/audio.svg | 19 +
gui/icons/audio_full.svg | 26 +
gui/icons/audio_mute.svg | 12 +
gui/icons/battery-caution.svg | 625 --
gui/icons/camera-photo.svg | 681 --
gui/icons/camera-video.svg | 1257 ---
gui/icons/check.svg | 11 +
gui/icons/close.svg | 16 +
gui/icons/cross.svg | 13 +
gui/icons/dialog-error.svg | 316 -
gui/icons/dialog-information.svg | 1145 ---
gui/icons/dialog-warning.svg | 359 -
gui/icons/document-new.svg | 448 -
gui/icons/document-print-preview.svg | 701 --
gui/icons/document-print.svg | 530 -
gui/icons/document-save-as.svg | 661 --
gui/icons/document-save.svg | 617 --
gui/icons/down.svg | 9 +
gui/icons/edit-find.svg | 750 --
gui/icons/emblem-symbolic-link.svg | 246 -
gui/icons/emblem-unreadable.svg | 357 -
gui/icons/expand.svg | 26 +
gui/icons/face-surprise.svg | 254 -
gui/icons/file.svg | 10 +
gui/icons/film.svg | 27 +
gui/icons/folder-open.svg | 482 -
gui/icons/folder.svg | 435 +-
gui/icons/go-bottom.svg | 225 -
gui/icons/go-down.svg | 199 -
gui/icons/go-first.svg | 203 -
gui/icons/go-home.svg | 441 -
gui/icons/go-jump.svg | 203 -
gui/icons/go-last.svg | 203 -
gui/icons/go-next.svg | 191 -
gui/icons/go-previous.svg | 852 --
gui/icons/go-top.svg | 972 --
gui/icons/go-up.svg | 195 -
gui/icons/harddrive.svg | 14 +
gui/icons/heart.svg | 8 +
gui/icons/home.svg | 11 +
gui/icons/image-missing.svg | 318 -
gui/icons/image.svg | 14 +
gui/icons/info.svg | 14 +
gui/icons/laptop.svg | 16 +
gui/icons/left.svg | 9 +
gui/icons/left_arrow.svg | 374 -
gui/icons/list-add.svg | 434 -
gui/icons/list-remove.svg | 422 -
gui/icons/list.svg | 20 +
gui/icons/live.svg | 21 +
gui/icons/media-eject.svg | 439 -
gui/icons/media-playback-pause.svg | 630 --
gui/icons/media-playback-start.svg | 308 -
gui/icons/media-playback-stop.svg | 640 --
gui/icons/media-record.svg | 326 -
gui/icons/media-seek-backward.svg | 363 -
gui/icons/media-seek-forward.svg | 370 -
gui/icons/media-skip-backward.svg | 1014 --
gui/icons/media-skip-forward.svg | 1002 --
gui/icons/media_next.svg | 12 +
gui/icons/media_prev.svg | 12 +
gui/icons/monitor.svg | 11 +
gui/icons/more.svg | 9 +
gui/icons/musical.svg | 14 +
gui/icons/navigation.svg | 17 +
gui/icons/network.svg | 27 +
gui/icons/next.svg | 11 +
gui/icons/osmo.svg | 26 +
gui/icons/overflowing.svg | 30 +
gui/icons/pause.svg | 12 +
gui/icons/pl_next.svg | 16 +
gui/icons/pl_prev.svg | 16 +
gui/icons/play.svg | 10 +
gui/icons/play_loop.svg | 16 +
gui/icons/play_shuffle.svg | 17 +
gui/icons/play_single.svg | 12 +
gui/icons/power.svg | 14 +
.../preferences-desktop-remote-desktop.svg | 1479 ---
gui/icons/preferences-system-windows.svg | 386 -
gui/icons/previous.svg | 11 +
gui/icons/process-stop.svg | 334 -
gui/icons/remove.svg | 10 +
gui/icons/resize.svg | 14 +
gui/icons/rewind.svg | 11 +
gui/icons/right.svg | 9 +
gui/icons/right_arrow.svg | 383 -
gui/icons/seek_forward.svg | 11 +
gui/icons/shrink.svg | 55 +
gui/icons/sort.svg | 25 +
gui/icons/speed.svg | 26 +
gui/icons/star.svg | 11 +
gui/icons/stop.svg | 10 +
gui/icons/stop2.svg | 10 +
gui/icons/tennis_ball.svg | 71 -
gui/icons/tennis_black.svg | 50 -
gui/icons/tennis_racket.svg | 64 -
gui/icons/tennis_racket_color.svg | 68 -
gui/icons/trash.svg | 16 +
gui/icons/tray.svg | 14 +
gui/icons/tv.svg | 21 +
gui/icons/up.svg | 9 +
gui/icons/user-trash.svg | 487 -
gui/icons/video-display.svg | 487 -
gui/icons/video-x-generic.svg | 318 -
gui/icons/view-fullscreen.svg | 520 -
gui/icons/world.svg | 64 +
gui/iphone_wm_gui.js | 12 +-
gui/webvtt-renderer.js | 562 +-
include/gpac/avparse.h | 11 +
include/gpac/bifs.h | 2 +
include/gpac/bitstream.h | 6 +-
include/gpac/cache.h | 6 +-
include/gpac/color.h | 21 +-
include/gpac/compositor.h | 10 +-
include/gpac/configuration.h | 151 +-
include/gpac/constants.h | 23 +-
include/gpac/dash.h | 132 +-
include/gpac/download.h | 32 +-
include/gpac/events.h | 6 +-
include/gpac/events_constants.h | 15 +-
include/gpac/html5_mse.h | 4 +
include/gpac/ietf.h | 9 +-
include/gpac/internal/bifs_dev.h | 2 +
include/gpac/internal/compositor_dev.h | 53 +-
include/gpac/internal/dvb_mpe_dev.h | 8 +-
include/gpac/internal/isomedia_dev.h | 138 +-
include/gpac/internal/laser_dev.h | 1 +
include/gpac/internal/m3u8.h | 183 +-
include/gpac/internal/media_dev.h | 5 +-
include/gpac/internal/mesh.h | 2 +-
include/gpac/internal/mpd.h | 66 +-
include/gpac/internal/scenegraph_dev.h | 27 +-
include/gpac/internal/smjs_api.h | 60 +-
include/gpac/internal/swf_dev.h | 12 +-
include/gpac/internal/terminal_dev.h | 160 +-
include/gpac/iso639.h | 533 +-
include/gpac/isomedia.h | 157 +-
include/gpac/{math.h => maths.h} | 2 +-
include/gpac/media_tools.h | 48 +-
include/gpac/mediaobject.h | 20 +-
include/gpac/module.h | 77 +-
include/gpac/modules/audio_out.h | 2 +-
include/gpac/modules/codec.h | 10 +-
include/gpac/modules/service.h | 94 +-
include/gpac/modules/video_out.h | 4 +-
include/gpac/mpeg4_odf.h | 13 +-
include/gpac/mpegts.h | 59 +-
include/gpac/network.h | 47 +
include/gpac/options.h | 6 +
include/gpac/path2d.h | 4 +-
include/gpac/scene_manager.h | 23 +-
include/gpac/scenegraph.h | 3 +-
include/gpac/scenegraph_svg.h | 5 +-
include/gpac/scenegraph_vrml.h | 14 +-
include/gpac/setup.h | 25 +-
include/gpac/sync_layer.h | 7 +
include/gpac/term_info.h | 9 +-
include/gpac/terminal.h | 14 +-
include/gpac/thread.h | 8 +-
include/gpac/token.h | 8 +-
include/gpac/tools.h | 70 +-
include/gpac/unicode.h | 4 +-
include/gpac/user.h | 18 +-
include/gpac/version.h | 10 +-
include/gpac/webvtt.h | 6 +-
include/gpac/xml.h | 16 +
include/win32/inttypes.h | 38 +-
mkdmg.sh | 42 +-
modules/Makefile | 2 +-
modules/aac_in/Makefile | 4 +-
modules/aac_in/aac_in.c | 46 +-
modules/aac_in/faad_dec.c | 10 +-
modules/ac3_in/Makefile | 2 +-
modules/ac3_in/ac3_in.c | 36 +-
modules/alsa/Makefile | 2 +-
modules/alsa/alsa.c | 2 +-
modules/amr_dec/Makefile | 2 +-
modules/amr_dec/amr_dec.c | 2 +-
modules/amr_dec/amr_in.c | 16 +-
modules/amr_float_dec/Makefile | 2 +-
modules/amr_float_dec/amr_api.h | 68 +-
modules/amr_float_dec/amr_float_dec.c | 2 +-
modules/audio_filter/Makefile | 2 +-
modules/audio_filter/audio_filter.c | 4 +-
modules/avcap/Makefile | 2 +-
modules/avcap/avcap.cpp | 2 +-
modules/bifs_dec/Makefile | 4 +-
modules/bifs_dec/bifs_dec.c | 2 +-
modules/ctx_load/Makefile | 4 +-
modules/ctx_load/ctx_load.c | 44 +-
modules/dektec_out/Makefile | 58 +
modules/dektec_out/dektec_video.cpp | 361 +
modules/demo_is/Makefile | 2 +-
modules/demo_is/demo_is.c | 2 +-
modules/directfb_out/Makefile | 2 +-
modules/directfb_out/directfb_out.c | 2 +-
modules/droid_audio/droidaudio.c | 2 +-
modules/droid_cam/droid_cam.c | 2 +-
modules/droid_mpegv/droid_mpegv.c | 2 +-
modules/droid_out/droid_vout-bitmap.c | 2 +-
modules/droid_out/droid_vout.c | 43 +-
modules/dummy_in/Makefile | 4 +-
modules/dummy_in/dummy_in.c | 14 +-
modules/dx_hw/Makefile | 2 +-
modules/dx_hw/copy_pixels.c | 4 +-
modules/dx_hw/dx_2d.c | 5 +-
modules/dx_hw/dx_audio.c | 6 +-
modules/dx_hw/dx_hw.h | 7 +-
modules/dx_hw/dx_video.c | 114 +-
modules/dx_hw/dx_window.c | 44 +-
modules/epoc_hw/epoc_vout.cpp | 18 +-
modules/ffmpeg_in/Makefile | 2 +-
modules/ffmpeg_in/ffmpeg_decode.c | 51 +-
modules/ffmpeg_in/ffmpeg_demux.c | 118 +-
modules/ffmpeg_in/ffmpeg_in.h | 4 +-
modules/ffmpeg_in/ffmpeg_load.c | 2 +-
modules/freenect/Makefile | 2 +-
modules/freenect/freenect.c | 2 +-
modules/ft_font/Makefile | 4 +-
modules/ft_font/ft_font.c | 155 +-
modules/gapi/gapi.cpp | 26 +-
modules/gapi/gapi.h | 4 +-
modules/gdip_raster/gdip_font.cpp | 2 +-
modules/gpac_js/Makefile | 2 +-
modules/gpac_js/gpac_js.c | 1591 ++-
modules/hyb_in/Makefile | 4 +-
modules/hyb_in/hyb_in.c | 2 +-
modules/img_in/Makefile | 4 +-
modules/img_in/img_dec.c | 2 +-
modules/img_in/img_in.c | 22 +-
modules/ios_cam/ios_cam.c | 4 +-
modules/ios_mpegv/ios_mpegv.c | 2 +-
modules/ismacryp/Makefile | 4 +-
modules/ismacryp/isma_ea.c | 43 +-
modules/isom_in/Makefile | 4 +-
modules/isom_in/isom_cache.c | 8 +-
modules/isom_in/isom_in.h | 15 +-
modules/isom_in/load.c | 11 +-
modules/isom_in/read.c | 63 +-
modules/isom_in/read_ch.c | 299 +-
modules/jack/Makefile | 2 +-
modules/jack/jack.c | 2 +-
modules/laser_dec/Makefile | 4 +-
modules/laser_dec/laser_dec.c | 2 +-
modules/libplayer/Makefile | 2 +-
modules/libplayer/libplayer.c | 2 +-
modules/mp3_in/Makefile | 4 +-
modules/mp3_in/mad_dec.c | 1 -
modules/mp3_in/mp3_in.c | 40 +-
modules/mpd_in/Makefile | 4 +-
modules/mpd_in/mpd_in.c | 514 +-
modules/mpegts_in/Makefile | 4 +-
modules/mpegts_in/mpegts_in.c | 296 +-
modules/mse_in/Makefile | 4 +-
modules/mse_in/mse_in.c | 15 +-
modules/odf_dec/Makefile | 4 +-
modules/odf_dec/odf_dec.c | 4 +-
modules/ogg/Makefile | 2 +-
modules/ogg/ogg_in.c | 20 +-
modules/ogg/ogg_load.c | 2 +-
modules/opencv_is/Makefile | 2 +-
modules/opencv_is/opencv_is.c | 2 +-
modules/openhevc_dec/Makefile | 2 +-
modules/openhevc_dec/openhevc_dec.c | 55 +-
modules/opensvc_dec/Makefile | 2 +-
modules/opensvc_dec/opensvc_dec.c | 5 +-
modules/osd/Makefile | 2 +-
modules/osd/osd.c | 9 +-
modules/oss_audio/Makefile | 4 +-
modules/oss_audio/oss.c | 2 +-
modules/platinum/GPACFileMediaServer.cpp | 9 +-
modules/platinum/GPACFileMediaServer.h | 5 +-
modules/platinum/GPACMediaRenderer.h | 4 +-
modules/platinum/GPACPlatinum.cpp | 20 +-
modules/platinum/Makefile | 2 +-
modules/pulseaudio/Makefile | 2 +-
modules/pulseaudio/pulseaudio.c | 2 +-
modules/raw_out/Makefile | 4 +-
modules/raw_out/raw_video.c | 2 +-
modules/redirect_av/Makefile | 2 +-
modules/redirect_av/ffmpeg_ts_muxer.c | 4 +-
modules/redirect_av/redirect_av.c | 6 +-
modules/redirect_av/ts_muxer.h | 2 +-
modules/rtp_in/Makefile | 4 +-
modules/rtp_in/rtp_in.c | 6 +-
modules/rtp_in/rtp_in.h | 4 +
modules/rtp_in/rtp_stream.c | 43 +-
modules/rtp_in/sdp_fetch.c | 10 +-
modules/rtp_in/sdp_load.c | 4 +-
modules/rvc_dec/Makefile | 2 +-
modules/rvc_dec/rvc_dec.c | 8 +-
modules/saf_in/Makefile | 4 +-
modules/saf_in/saf_in.c | 12 +-
modules/sdl_out/Makefile | 2 +-
modules/sdl_out/sdl_out.c | 2 +-
modules/sdl_out/sdl_out.h | 17 +-
modules/sdl_out/video.c | 557 +-
modules/soft_raster/Makefile | 4 +-
modules/soft_raster/ftgrays.c | 10 +-
modules/soft_raster/raster_argb.c | 7 +
modules/soft_raster/raster_load.c | 2 +-
modules/svg_in/Makefile | 4 +-
modules/svg_in/svg_in.c | 16 +-
modules/timedtext/Makefile | 4 +-
modules/timedtext/timedtext_dec.c | 4 +-
modules/ui_rec/Makefile | 2 +-
modules/ui_rec/ui_rec.c | 8 +-
modules/validator/Makefile | 49 +
modules/validator/README.TXT | 90 +-
modules/validator/validator.c | 164 +-
modules/vtt_in/Makefile | 4 +-
modules/vtt_in/vtt_dec.c | 20 +-
modules/vtt_in/vtt_in.c | 21 +-
modules/wav_out/Makefile | 2 +-
modules/wav_out/wav_out.c | 2 +-
modules/widgetman/Makefile | 2 +-
modules/widgetman/unzip.c | 14 +-
modules/widgetman/unzip.h | 2 +-
modules/widgetman/wgt_load.c | 12 +-
modules/widgetman/wgt_load_base.js | 4 +-
modules/widgetman/widgetman.c | 26 +-
modules/wiiis/Makefile | 2 +-
modules/wiiis/wiiis.c | 2 +-
modules/x11_out/Makefile | 4 +-
modules/x11_out/x11_out.c | 19 +-
modules/x11_out/x11_out.h | 2 +-
modules/xvid_dec/Makefile | 2 +-
modules/xvid_dec/xvid_dec.c | 2 +-
modules/xvid_dec/xvid_dec_wce.cpp | 2 +-
packagers/win32_64/nsis/gpac_installer.nsi | 1918 ++--
regression_tests/auxiliary_files/logo.bt | 252 +-
regression_tests/auxiliary_files/subtitle.srt | 2 +-
.../bifs/bifs-cachetexture_cache.bt | 180 +-
.../bifs/bifs-cachetexture_nocache.bt | 114 +-
regression_tests/bifs/bifs-environmenttest.bt | 258 +-
regression_tests/bifs/bifs-keynavigator.bt | 440 +-
.../bifs/bifs-misc-hc-proto-events.bt | 57 +
regression_tests/bifs/bifs-storage.bt | 130 +-
...ifs-timeline-mediasensor-segment-switch.bt | 2 +-
.../bifs/bifs-timeline-mediasensor-segment.bt | 2 +-
.../bifs/bifs-timeline-mediasensor.bt | 2 +-
.../html5_video/basic_arraybuffer.js | 40 +-
regression_tests/html5_video/basic_audio.svg | 22 +-
.../html5_video/basic_mediasource.js | 48 +-
.../html5_video/basic_sourcebuffer.js | 104 +-
regression_tests/html5_video/basic_url.js | 50 +-
regression_tests/html5_video/basic_video.js | 160 +-
regression_tests/html5_video/gpac-mse.js | 716 +-
regression_tests/html5_video/video.svg | 58 +-
regression_tests/html5_video/xhr.svg | 6 +-
regression_tests/ttml/ebu-ttd_sample.ttml | 39 +
.../ttml/ebu-ttd_sample_invalid_ns.ttml | 28 +
.../ttml/ebu-ttd_sample_span.ttml | 29 +
.../ttml/ebu-ttd_timing_contiguous.ttml | 30 +
.../ttml/ebu-ttd_timing_non-contiguous.ttml | 30 +
.../ttml/ebu-ttd_timing_overlapping_fail.ttml | 29 +
regression_tests/webvtt/counter.vtt | 9004 ++++++++---------
regression_tests/webvtt/simple.vtt | 62 +-
regression_tests/xmlin4/anim.swf | Bin 0 -> 6913 bytes
regression_tests/xmlin4/ebu-ttd_sample.ttml | 39 +
regression_tests/xmlin4/first.xml | 3 +
regression_tests/xmlin4/input.txt | 13 +
regression_tests/xmlin4/input.xml | 5 +
regression_tests/xmlin4/last.xml | 3 +
.../xmlin4/meta-mett-no-mime.nhml | 8 +
.../xmlin4/meta-mett-xml-header.nhml | 6 +
regression_tests/xmlin4/meta-mett-xml.nhml | 6 +
regression_tests/xmlin4/meta-mett.nhml | 8 +
.../xmlin4/meta-metx-no-namespace.nhml | 6 +
regression_tests/xmlin4/meta-metx.nhml | 6 +
regression_tests/xmlin4/run_one_test.sh | 21 +
regression_tests/xmlin4/run_tests.sh | 59 +
regression_tests/xmlin4/second.xml | 3 +
.../xmlin4/subt-sbtt-no-mime.nhml | 6 +
regression_tests/xmlin4/subt-sbtt.nhml | 6 +
.../xmlin4/subt-stpp-no-namespace.nhml | 6 +
regression_tests/xmlin4/subt-stpp.nhml | 6 +
regression_tests/xmlin4/text-stxt-header.nhml | 7 +
.../xmlin4/text-stxt-no-mime.nhml | 8 +
regression_tests/xmlin4/text-stxt.nhml | 8 +
src/Makefile | 32 +-
src/bifs/bifs_codec.c | 32 +-
src/bifs/bifs_node_tables.c | 78 -
src/bifs/com_dec.c | 52 +-
src/bifs/com_enc.c | 18 +-
src/bifs/conditional.c | 2 +-
src/bifs/field_decode.c | 44 +-
src/bifs/field_encode.c | 61 +-
src/bifs/memory_decoder.c | 16 +-
src/bifs/quantize.c | 10 +-
src/bifs/script_enc.c | 75 +-
src/bifs/unquantize.c | 1 +
src/compositor/audio_input.c | 95 +-
src/compositor/audio_mixer.c | 30 +-
src/compositor/audio_render.c | 155 +-
src/compositor/compositor.c | 264 +-
src/compositor/compositor_2d.c | 466 +-
src/compositor/drawable.c | 124 +-
src/compositor/events.c | 274 +-
src/compositor/gl_inc.h | 17 +-
src/compositor/hardcoded_protos.c | 92 +
src/compositor/mesh.c | 2 +-
src/compositor/mpeg4_audio.c | 70 +-
src/compositor/mpeg4_background2d.c | 31 +-
src/compositor/mpeg4_bitmap.c | 10 +-
src/compositor/mpeg4_composite.c | 73 +-
src/compositor/mpeg4_geometry_2d.c | 4 +-
src/compositor/mpeg4_grouping.c | 23 +-
src/compositor/mpeg4_layer_3d.c | 4 +-
src/compositor/mpeg4_layout.c | 4 -
src/compositor/mpeg4_lighting.c | 34 +-
src/compositor/mpeg4_text.c | 4 +
src/compositor/mpeg4_textures.c | 89 +-
src/compositor/nodes_stacks.h | 1 +
src/compositor/offscreen_cache.c | 4 +-
src/compositor/svg_filters.c | 2 +-
src/compositor/svg_media.c | 67 +-
src/compositor/svg_text.c | 2 +-
src/compositor/texturing.c | 23 +-
src/compositor/texturing_gl.c | 69 +-
src/compositor/visual_manager.c | 2 +-
src/compositor/visual_manager.h | 15 +-
src/compositor/visual_manager_2d.c | 6 +-
src/compositor/visual_manager_2d.h | 1 +
src/compositor/visual_manager_2d_draw.c | 22 +-
src/compositor/visual_manager_3d.c | 20 +-
src/compositor/visual_manager_3d.h | 4 +-
src/compositor/visual_manager_3d_gl.c | 588 +-
src/export.cpp | 139 +-
src/ietf/rtcp.c | 2 +-
src/ietf/rtp.c | 24 +-
src/ietf/rtp_depacketizer.c | 11 +-
src/ietf/rtp_packetizer.c | 2 +-
src/ietf/rtp_pck_mpeg4.c | 2 +-
src/ietf/rtp_streamer.c | 14 +-
src/ietf/rtsp_session.c | 4 +-
src/ietf/sdp.c | 3 +
src/isomedia/avc_ext.c | 133 +-
src/isomedia/box_code_3gpp.c | 14 -
src/isomedia/box_code_adobe.c | 7 +-
src/isomedia/box_code_base.c | 690 +-
src/isomedia/box_code_drm.c | 10 +
src/isomedia/box_code_meta.c | 2 +-
src/isomedia/box_dump.c | 424 +-
src/isomedia/box_funcs.c | 117 +-
src/isomedia/data_map.c | 50 +-
src/isomedia/drm_sample.c | 2 +-
src/isomedia/isom_intern.c | 7 +
src/isomedia/isom_read.c | 285 +-
src/isomedia/isom_store.c | 26 +-
src/isomedia/isom_write.c | 496 +-
src/isomedia/media.c | 50 +-
src/isomedia/media_odf.c | 2 +-
src/isomedia/meta.c | 36 +-
src/isomedia/movie_fragments.c | 145 +-
src/isomedia/sample_descs.c | 524 +-
src/isomedia/stbl_read.c | 22 +-
src/isomedia/stbl_write.c | 34 +-
src/isomedia/track.c | 29 +-
src/isomedia/ttml.c | 243 +-
src/isomedia/tx3g.c | 6 +-
src/laser/lsr_dec.c | 1 -
src/laser/lsr_enc.c | 363 +-
src/mcrypt/g_crypt.c | 16 +-
src/media_tools/av_parsers.c | 271 +-
src/media_tools/avilib.c | 104 +-
src/media_tools/dash_client.c | 2340 +++--
src/media_tools/dash_segmenter.c | 2185 ++--
src/media_tools/dsmcc.c | 4 +-
src/media_tools/dvb_mpe.c | 30 +-
src/media_tools/filestreamer.c | 20 +-
src/media_tools/html5_mse.c | 7 +-
src/media_tools/img.c | 29 +-
src/media_tools/ismacryp.c | 115 +-
src/media_tools/isom_hinter.c | 22 +-
src/media_tools/isom_tools.c | 108 +-
src/media_tools/m2ts_mux.c | 59 +-
src/media_tools/m3u8.c | 1304 ++-
src/media_tools/media_export.c | 543 +-
src/media_tools/media_import.c | 1381 ++-
src/media_tools/mpd.c | 1524 ++-
src/media_tools/mpeg2_ps.c | 24 +-
src/media_tools/mpegts.c | 980 +-
src/media_tools/text_import.c | 730 +-
src/media_tools/webvtt.c | 265 +-
src/odf/desc_private.c | 9 +-
src/odf/ipmpx_parse.c | 12 +-
src/odf/odf_code.c | 7 +-
src/odf/odf_parse.c | 16 +-
src/scene_manager/encode_isom.c | 39 +-
src/scene_manager/loader_bt.c | 56 +-
src/scene_manager/loader_isom.c | 4 +-
src/scene_manager/loader_qt.c | 4 +-
src/scene_manager/loader_svg.c | 24 +-
src/scene_manager/loader_xmt.c | 19 +-
src/scene_manager/scene_dump.c | 38 +-
src/scene_manager/scene_engine.c | 16 +-
src/scene_manager/scene_manager.c | 10 +-
src/scene_manager/swf_bifs.c | 18 +-
src/scene_manager/swf_parse.c | 46 +-
src/scene_manager/swf_svg.c | 38 +-
src/scene_manager/text_to_bifs.c | 16 +-
src/scenegraph/base_scenegraph.c | 27 +-
src/scenegraph/commands.c | 7 +-
src/scenegraph/dom_events.c | 2 +-
src/scenegraph/dom_smjs.c | 59 +-
src/scenegraph/svg_attributes.c | 215 +-
src/scenegraph/svg_smjs.c | 16 +-
src/scenegraph/vrml_proto.c | 34 +-
src/scenegraph/vrml_route.c | 47 +
src/scenegraph/vrml_smjs.c | 881 +-
src/scenegraph/vrml_tools.c | 8 +-
src/scenegraph/webvtt_smjs.c | 5 +-
src/scenegraph/xml_ns.c | 18 +-
src/terminal/channel.c | 297 +-
src/terminal/clock.c | 91 +-
src/terminal/decoder.c | 302 +-
src/terminal/media_control.c | 111 +-
src/terminal/media_control.h | 4 +-
src/terminal/media_manager.c | 59 +-
src/terminal/media_memory.c | 44 +-
src/terminal/media_memory.h | 10 +-
src/terminal/media_object.c | 388 +-
src/terminal/media_sensor.c | 20 +-
src/terminal/mpeg4_inline.c | 21 +-
src/terminal/network_service.c | 135 +-
src/terminal/object_browser.c | 85 +-
src/terminal/object_manager.c | 291 +-
src/terminal/scene.c | 767 +-
src/terminal/terminal.c | 275 +-
src/utils/alloc.c | 76 +-
src/utils/base_encoding.c | 6 +-
src/utils/bitstream.c | 36 +-
src/utils/cache.c | 86 +-
src/utils/color.c | 211 +-
src/utils/configfile.c | 18 +-
src/utils/downloader.c | 771 +-
src/utils/error.c | 566 +-
src/utils/gzio.cpp | 4 +-
src/utils/math.c | 2 +-
src/utils/module.c | 38 +-
src/utils/os_config_init.c | 173 +-
src/utils/os_divers.c | 824 +-
src/utils/os_file.c | 681 ++
src/utils/os_net.c | 127 +-
src/utils/os_thread.c | 60 +-
src/utils/path2d.c | 4 +-
src/utils/sha1.c | 18 +-
src/utils/symbian_os.cpp | 18 +-
src/utils/token.c | 2 +-
src/utils/url.c | 15 +-
src/utils/xml_parser.c | 348 +-
src/utils/zutil.c | 1 +
version.bat | 40 +-
758 files changed, 83431 insertions(+), 62999 deletions(-)
create mode 100644 .gitattributes
create mode 100644 .travis.yml
create mode 100644 applications/mp4client/carbon_events.c
create mode 100644 extra_lib/include/DTAPI.h
create mode 100644 extra_lib/include/ffmpeg_android/libavcodec/avfft.h
create mode 100644 extra_lib/include/ffmpeg_android/libavcodec/dv_profile.h
create mode 100644 extra_lib/include/ffmpeg_android/libavcodec/dxva2.h
create mode 100644 extra_lib/include/ffmpeg_android/libavcodec/old_codec_ids.h
create mode 100644 extra_lib/include/ffmpeg_android/libavcodec/vaapi.h
create mode 100644 extra_lib/include/ffmpeg_android/libavcodec/vda.h
create mode 100644 extra_lib/include/ffmpeg_android/libavcodec/vdpau.h
create mode 100644 extra_lib/include/ffmpeg_android/libavcodec/version.h
create mode 100644 extra_lib/include/ffmpeg_android/libavcodec/xvmc.h
create mode 100644 extra_lib/include/ffmpeg_android/libavformat/version.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/adler32.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/aes.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/audio_fifo.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/audioconvert.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/avassert.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/avstring.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/base64.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/blowfish.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/bprint.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/bswap.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/buffer.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/channel_layout.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/cpu.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/crc.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/dict.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/display.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/downmix_info.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/eval.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/ffversion.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/fifo.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/file.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/frame.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/hash.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/hmac.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/imgutils.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/intfloat.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/intreadwrite.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/lfg.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/lzo.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/macros.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/md5.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/motion_vector.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/murmur3.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/old_pix_fmts.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/opt.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/parseutils.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/pixdesc.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/pixelutils.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/random_seed.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/replaygain.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/ripemd.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/samplefmt.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/sha.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/sha512.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/stereo3d.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/threadmessage.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/time.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/timecode.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/timestamp.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/version.h
create mode 100644 extra_lib/include/ffmpeg_android/libavutil/xtea.h
create mode 100644 extra_lib/include/ffmpeg_android/libswscale/version.h
delete mode 100644 fixEOL.sh
create mode 100644 gui/extensions/H2B2VS/H2B2VS.png
create mode 100644 gui/extensions/H2B2VS/h2b2vs.js
create mode 100644 gui/extensions/H2B2VS/init.js
create mode 100644 gui/extensions/H2B2VS/logo_hd.png
create mode 100644 gui/extensions/H2B2VS/logo_uhd.png
rename gui/{icons => extensions/player}/applications-multimedia.svg (100%)
create mode 100644 gui/extensions/player/fileopen.js
create mode 100644 gui/extensions/player/init.js
create mode 100644 gui/extensions/player/player.js
create mode 100644 gui/extensions/player/playlist.js
create mode 100644 gui/extensions/player/stats.js
create mode 100644 gui/icons/add.svg
create mode 100644 gui/icons/app.svg
delete mode 100644 gui/icons/applications-internet.svg
delete mode 100644 gui/icons/applications-system.svg
delete mode 100644 gui/icons/audio-volume-high.svg
delete mode 100644 gui/icons/audio-volume-low.svg
delete mode 100644 gui/icons/audio-volume-medium.svg
delete mode 100644 gui/icons/audio-volume-muted.svg
delete mode 100644 gui/icons/audio-x-generic.svg
create mode 100644 gui/icons/audio.svg
create mode 100644 gui/icons/audio_full.svg
create mode 100644 gui/icons/audio_mute.svg
delete mode 100644 gui/icons/battery-caution.svg
delete mode 100644 gui/icons/camera-photo.svg
delete mode 100644 gui/icons/camera-video.svg
create mode 100644 gui/icons/check.svg
create mode 100644 gui/icons/close.svg
create mode 100644 gui/icons/cross.svg
delete mode 100644 gui/icons/dialog-error.svg
delete mode 100644 gui/icons/dialog-information.svg
delete mode 100644 gui/icons/dialog-warning.svg
delete mode 100644 gui/icons/document-new.svg
delete mode 100644 gui/icons/document-print-preview.svg
delete mode 100644 gui/icons/document-print.svg
delete mode 100644 gui/icons/document-save-as.svg
delete mode 100644 gui/icons/document-save.svg
create mode 100644 gui/icons/down.svg
delete mode 100644 gui/icons/edit-find.svg
delete mode 100644 gui/icons/emblem-symbolic-link.svg
delete mode 100644 gui/icons/emblem-unreadable.svg
create mode 100644 gui/icons/expand.svg
delete mode 100644 gui/icons/face-surprise.svg
create mode 100644 gui/icons/file.svg
create mode 100644 gui/icons/film.svg
delete mode 100644 gui/icons/folder-open.svg
delete mode 100644 gui/icons/go-bottom.svg
delete mode 100644 gui/icons/go-down.svg
delete mode 100644 gui/icons/go-first.svg
delete mode 100644 gui/icons/go-home.svg
delete mode 100644 gui/icons/go-jump.svg
delete mode 100644 gui/icons/go-last.svg
delete mode 100644 gui/icons/go-next.svg
delete mode 100644 gui/icons/go-previous.svg
delete mode 100644 gui/icons/go-top.svg
delete mode 100644 gui/icons/go-up.svg
create mode 100644 gui/icons/harddrive.svg
create mode 100644 gui/icons/heart.svg
create mode 100644 gui/icons/home.svg
delete mode 100644 gui/icons/image-missing.svg
create mode 100644 gui/icons/image.svg
create mode 100644 gui/icons/info.svg
create mode 100644 gui/icons/laptop.svg
create mode 100644 gui/icons/left.svg
delete mode 100644 gui/icons/left_arrow.svg
delete mode 100644 gui/icons/list-add.svg
delete mode 100644 gui/icons/list-remove.svg
create mode 100644 gui/icons/list.svg
create mode 100644 gui/icons/live.svg
delete mode 100644 gui/icons/media-eject.svg
delete mode 100644 gui/icons/media-playback-pause.svg
delete mode 100644 gui/icons/media-playback-start.svg
delete mode 100644 gui/icons/media-playback-stop.svg
delete mode 100644 gui/icons/media-record.svg
delete mode 100644 gui/icons/media-seek-backward.svg
delete mode 100644 gui/icons/media-seek-forward.svg
delete mode 100644 gui/icons/media-skip-backward.svg
delete mode 100644 gui/icons/media-skip-forward.svg
create mode 100644 gui/icons/media_next.svg
create mode 100644 gui/icons/media_prev.svg
create mode 100644 gui/icons/monitor.svg
create mode 100644 gui/icons/more.svg
create mode 100644 gui/icons/musical.svg
create mode 100644 gui/icons/navigation.svg
create mode 100644 gui/icons/network.svg
create mode 100644 gui/icons/next.svg
create mode 100644 gui/icons/osmo.svg
create mode 100644 gui/icons/overflowing.svg
create mode 100644 gui/icons/pause.svg
create mode 100644 gui/icons/pl_next.svg
create mode 100644 gui/icons/pl_prev.svg
create mode 100644 gui/icons/play.svg
create mode 100644 gui/icons/play_loop.svg
create mode 100644 gui/icons/play_shuffle.svg
create mode 100644 gui/icons/play_single.svg
create mode 100644 gui/icons/power.svg
delete mode 100644 gui/icons/preferences-desktop-remote-desktop.svg
delete mode 100644 gui/icons/preferences-system-windows.svg
create mode 100644 gui/icons/previous.svg
delete mode 100644 gui/icons/process-stop.svg
create mode 100644 gui/icons/remove.svg
create mode 100644 gui/icons/resize.svg
create mode 100644 gui/icons/rewind.svg
create mode 100644 gui/icons/right.svg
delete mode 100644 gui/icons/right_arrow.svg
create mode 100644 gui/icons/seek_forward.svg
create mode 100644 gui/icons/shrink.svg
create mode 100644 gui/icons/sort.svg
create mode 100644 gui/icons/speed.svg
create mode 100644 gui/icons/star.svg
create mode 100644 gui/icons/stop.svg
create mode 100644 gui/icons/stop2.svg
delete mode 100644 gui/icons/tennis_ball.svg
delete mode 100644 gui/icons/tennis_black.svg
delete mode 100644 gui/icons/tennis_racket.svg
delete mode 100644 gui/icons/tennis_racket_color.svg
create mode 100644 gui/icons/trash.svg
create mode 100644 gui/icons/tray.svg
create mode 100644 gui/icons/tv.svg
create mode 100644 gui/icons/up.svg
delete mode 100644 gui/icons/user-trash.svg
delete mode 100644 gui/icons/video-display.svg
delete mode 100644 gui/icons/video-x-generic.svg
delete mode 100644 gui/icons/view-fullscreen.svg
create mode 100644 gui/icons/world.svg
rename include/gpac/{math.h => maths.h} (99%)
create mode 100644 modules/dektec_out/Makefile
create mode 100644 modules/dektec_out/dektec_video.cpp
create mode 100644 modules/validator/Makefile
create mode 100644 regression_tests/bifs/bifs-misc-hc-proto-events.bt
create mode 100644 regression_tests/ttml/ebu-ttd_sample.ttml
create mode 100644 regression_tests/ttml/ebu-ttd_sample_invalid_ns.ttml
create mode 100644 regression_tests/ttml/ebu-ttd_sample_span.ttml
create mode 100644 regression_tests/ttml/ebu-ttd_timing_contiguous.ttml
create mode 100644 regression_tests/ttml/ebu-ttd_timing_non-contiguous.ttml
create mode 100644 regression_tests/ttml/ebu-ttd_timing_overlapping_fail.ttml
create mode 100644 regression_tests/xmlin4/anim.swf
create mode 100644 regression_tests/xmlin4/ebu-ttd_sample.ttml
create mode 100644 regression_tests/xmlin4/first.xml
create mode 100644 regression_tests/xmlin4/input.txt
create mode 100644 regression_tests/xmlin4/input.xml
create mode 100644 regression_tests/xmlin4/last.xml
create mode 100644 regression_tests/xmlin4/meta-mett-no-mime.nhml
create mode 100644 regression_tests/xmlin4/meta-mett-xml-header.nhml
create mode 100644 regression_tests/xmlin4/meta-mett-xml.nhml
create mode 100644 regression_tests/xmlin4/meta-mett.nhml
create mode 100644 regression_tests/xmlin4/meta-metx-no-namespace.nhml
create mode 100644 regression_tests/xmlin4/meta-metx.nhml
create mode 100644 regression_tests/xmlin4/run_one_test.sh
create mode 100644 regression_tests/xmlin4/run_tests.sh
create mode 100644 regression_tests/xmlin4/second.xml
create mode 100644 regression_tests/xmlin4/subt-sbtt-no-mime.nhml
create mode 100644 regression_tests/xmlin4/subt-sbtt.nhml
create mode 100644 regression_tests/xmlin4/subt-stpp-no-namespace.nhml
create mode 100644 regression_tests/xmlin4/subt-stpp.nhml
create mode 100644 regression_tests/xmlin4/text-stxt-header.nhml
create mode 100644 regression_tests/xmlin4/text-stxt-no-mime.nhml
create mode 100644 regression_tests/xmlin4/text-stxt.nhml
create mode 100644 src/utils/os_file.c
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..f8c796f
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,19 @@
+* text=auto
+
+*.c text
+*.cpp text
+*.h text
+*.ttx text
+Makefile text
+
+#unix
+*.sh text eol=lf
+configure text eol=lf
+
+#windows
+*.bat text eol=crlf
+*.sln text eol=crlf
+*.vcproj text eol=crlf
+*.vcxproj text eol=crlf
+*.dsp text eol=crlf
+*.dsw text eol=crlf
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..1f2675f
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,19 @@
+language: c
+compiler: gcc
+before_install:
+ - sudo apt-get update -qq
+install:
+ - sudo apt-get install build-essential fakeroot dpkg-dev devscripts ccache debhelper pkg-config g++
+ - sudo apt-get install -y zlib1g-dev libfreetype6-dev libjpeg62-dev libpng12-dev libopenjpeg-dev libmad0-dev libfaad-dev libogg-dev libvorbis-dev libtheora-dev liba52-0.7.4-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libxv-dev x11proto-video-dev libgl1-mesa-dev x11proto-gl-dev linux-sound-base libxvidcore-dev libssl-dev libjack-dev libasound2-dev libpulse-dev libsdl1.2-dev dvb-apps libavcodec-extra-53 libavdevice-dev libmozjs185-dev
+ - sudo apt-get install -y gcc-mingw-w64-i686 g++-mingw-w64-i686 binutils-mingw-w64-i686 gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64 mingw-w64-dev
+env:
+ - GPAC_CONFIGURE_PREFIX="--prefix=build/all" GPAC_CONFIGURE_OPTIONS="" GPAC_CONFIGURE_ECFLAGS="" GPAC_CONFIGURE_ELDFLAGS="" GPAC_CONFIGURE_CROSS="" TARGET=""
+ - GPAC_CONFIGURE_PREFIX="--prefix=build/disable-all" GPAC_CONFIGURE_OPTIONS="--disable-all" GPAC_CONFIGURE_ECFLAGS="" GPAC_CONFIGURE_ELDFLAGS="" GPAC_CONFIGURE_CROSS="" TARGET=""
+ - GPAC_CONFIGURE_PREFIX="--prefix=build/static-mp4box" GPAC_CONFIGURE_OPTIONS="--static-mp4box" GPAC_CONFIGURE_ECFLAGS="" GPAC_CONFIGURE_ELDFLAGS="" GPAC_CONFIGURE_CROSS="" TARGET=""
+ - GPAC_CONFIGURE_PREFIX="--prefix=build/static-modules" GPAC_CONFIGURE_OPTIONS="--static-modules" GPAC_CONFIGURE_ECFLAGS="" GPAC_CONFIGURE_ELDFLAGS="" GPAC_CONFIGURE_CROSS="" TARGET=""
+ - GPAC_CONFIGURE_PREFIX="--prefix=build/disable-manual" GPAC_CONFIGURE_OPTIONS="--use-js=no --use-mad=no --use-xvid=no --use-ogg=no --use-vorbis=no --use-theora=no --use-openjpeg=no --disable-streaming --disable-isoff-frag --disable-isoff-hint --disable-isoff-write --disable-loader-xmt --disable-loader-bt --disable-loader-isoff --disable-scene-encode --disable-mcrypt --disable-od-dump --disable-scene-dump --disable-scene-stats --disable-swf --disable-export --disable-import --disable-m2ps --disable-ogg -disable-avi --disable-qtvr --disable-seng --disable-smgr --disable-x3d --disable-3d --disable-ssl --disable-jack --disable-pulse --use-a52=no --disable-odf --disable-isoff --disable-m2ts-mux --disable-dvbx --disable-saf --disable-vobsub --disable-ttxt --disable-od-parse" GPAC_CONFIGURE_ECFLAGS="" GPAC_CONFIGURE_ELDFLAGS="" TARGET=""
+ - GPAC_CONFIGURE_PREFIX="--prefix=build/i686-w64-mingw32" GPAC_CONFIGURE_OPTIONS="--static-mp4box --use-zlib=no" GPAC_CONFIGURE_ECFLAGS="-Ibuild/i686-w64-mingw32/include -w -fPIC" GPAC_CONFIGURE_ELDFLAGS="-Lbuild/i686-w64-mingw32/lib" GPAC_CONFIGURE_CROSS="--target-os=mingw32 --cross-prefix=i686-w64-mingw32-" TARGET=""
+ - GPAC_CONFIGURE_PREFIX="--prefix=build/x86_64-w64-mingw32" GPAC_CONFIGURE_OPTIONS="--static-mp4box --use-zlib=no" GPAC_CONFIGURE_ECFLAGS="-Ibuild/x86_64-w64-mingw32/include -w -fPIC" GPAC_CONFIGURE_ELDFLAGS="-Lbuild/x86_64-w64-mingw32/lib" GPAC_CONFIGURE_CROSS="--target-os=mingw32 --cross-prefix=x86_64-w64-mingw32-" TARGET=""
+
+script:
+ - ./configure $GPAC_CONFIGURE_PREFIX $GPAC_CONFIGURE_OPTIONS --extra-cflags="$GPAC_CONFIGURE_ECFLAGS" --extra-ldflags="$GPAC_CONFIGURE_ELDFLAGS" && make clean && make $TARGET && make install
diff --git a/INSTALLME b/INSTALLME
index d648cae..d6d61b0 100644
--- a/INSTALLME
+++ b/INSTALLME
@@ -1,13 +1,15 @@
-Installation instructions for latest GPAC svn version and GPAC release 0.5.0 - May 2012:
+Installation instructions for latest GPAC GIT version - March 2015:
For Windows, Linux and Mac OS X versions, follow the instructions on http://gpac.sourceforge.net/home_download.php
For Android, follow the instructions in gpac/build/android/README
-For WindowsMobile platform, get the latest package of gpac extra libs available on GPAC svn:
-http://gpac.svn.sourceforge.net/viewvc/gpac/trunk/gpac_extra_libs/gpac_extra_libs.zip
-and follow the instructions in gpac/doc/INSTALL.wCE
+(WindowsMobile platform i sno longer maintained)
+For WindowsMobile platform, get the latest package of gpac extra libs available here:
+
+https://sourceforge.net/p/gpac/code/HEAD/tree/trunk/gpac_extra_libs/
+and follow the instructions in gpac/doc/INSTALL.wCE
@@ -21,8 +23,8 @@ limited (no still image, no audio, no video, no text, no scripting). It is there
extra lib package available at http://sourceforge.net/projects/gpac. Compilation instructions for these libraries
are provided per library in the package.
- The current extra_lib package to use with gpac 0.5.0 is gpac_extra_libs available at sourceforge:
-http://gpac.svn.sourceforge.net/viewvc/gpac/trunk/gpac_extra_libs/gpac_extra_libs.zip?view=log
+ The current extra_lib package to use with gpac 0.5.0 and above is gpac_extra_libs available here:
+https://sourceforge.net/p/gpac/code/HEAD/tree/trunk/gpac_extra_libs/
In case you have some of these libs already installed on your system, the detailed list of dependencies is
* freetype2 from version 2.1.4 on.
@@ -40,18 +42,24 @@ http://gpac.svn.sourceforge.net/viewvc/gpac/trunk/gpac_extra_libs/gpac_extra_lib
* Installing GPAC
-/!\ GPAC won't compile if the 'svnversion' command (shipped with every Subversion package) is not in your path /!\
+/!\ GPAC won't compile if the 'git' command is not in your path /!\
+
+!! WARNING !!
+The following instructions may not be completely up to data
+You should use online instructions which may be more up-to-date:
+http://gpac.io/2011/04/18/command-line-gpac-compiling-on-windows-x86-using-free-microsoft-visual-c/
-!!OUTDATED - please see online instructions instead!!
Detailed instruction for Win32 MSVC Compilation are available in gpac/doc/INSTALL.w32
Detailed instruction for WinCE eVC Compilation are available in gpac/doc/INSTALL.wCE
-s
+
Detailed instruction for GCC Compilation are available in gpac/doc/INSTALL.gcc
Detailed instruction for GCC cross-compilation for familiar+GPE systems are available in gpac/doc/INSTALL.gpe
Detailed instruction for GCCE/Symbian cross-compilation for Symbian v9.1 systems are available in gpac/doc/INSTALL.symbian
+
+Detailed instruction for iOS Compilation are available in gpac/build/xcode/README_IOS.txt
* Configuring GPAC
diff --git a/Makefile b/Makefile
index 77f440e..62b7850 100644
--- a/Makefile
+++ b/Makefile
@@ -8,21 +8,24 @@ vpath %.c $(SRC_PATH)
all: version
$(MAKE) -C src all
$(MAKE) -C applications all
+ifneq ($(MP4BOX_STATIC),yes)
$(MAKE) -C modules all
+endif
-SVNREV_PATH:=$(SRC_PATH)/include/gpac/revision.h
+GITREV_PATH:=$(SRC_PATH)/include/gpac/revision.h
+TAG:=$(shell git --git-dir=$(SRC_PATH)/.git describe --tags --abbrev=0 2> /dev/null)
+VERSION:=$(shell echo `git --git-dir=$(SRC_PATH)/.git describe --tags --long || echo "UNKNOWN"` | sed "s/^$(TAG)-//")
+BRANCH:=$(shell git --git-dir=$(SRC_PATH)/.git rev-parse --abbrev-ref HEAD 2> /dev/null ||Â echo "UNKNOWN")
version:
- @if [ -d $(SRC_PATH)/".svn" ]; then \
- if which svnversion >/dev/null; then \
- echo "#define GPAC_SVN_REVISION \"$(shell svnversion $(SRC_PATH) )\"" > $(SVNREV_PATH).new ; \
- if ! diff -q $(SVNREV_PATH) $(SVNREV_PATH).new >/dev/null ; then \
- mv $(SVNREV_PATH).new $(SVNREV_PATH) ; \
- fi ; \
- fi \
+ @if [ -d $(SRC_PATH)/".git" ]; then \
+ echo "#define GPAC_GIT_REVISION \"$(VERSION)-$(BRANCH)\"" > $(GITREV_PATH).new; \
+ if ! diff -q $(GITREV_PATH) $(GITREV_PATH).new >/dev/null ; then \
+ mv $(GITREV_PATH).new $(GITREV_PATH); \
+ fi; \
else \
- echo "No SVN Version found" ; \
- fi \
+ echo "No GIT Version found" ; \
+ fi
lib: version
$(MAKE) -C src all
@@ -38,7 +41,7 @@ mods:
instmoz:
$(MAKE) -C applications/osmozilla install
-
+
depend:
$(MAKE) -C src dep
$(MAKE) -C applications dep
@@ -55,6 +58,21 @@ distclean:
$(MAKE) -C modules distclean
rm -f config.mak config.h
+lcov_clean:
+ lcov --directory . --zerocounters
+
+lcov:
+ lcov --capture --directory . --output-file all.info
+ rm -rf coverage/
+ lcov --remove all.info /usr/pkg/include/gtest/* /usr/pkg/include/gtest/internal/gtest-* \
+ /usr/pkg/gcc44/include/c++/4.4.1/backward/binders.h /usr/pkg/gcc44/include/c++/4.4.1/bits/* \
+ /usr/pkg/gcc44/include/c++/4.4.1/ext/*.h \
+ /usr/pkg/gcc44/include/c++/4.4.1/x86_64-unknown-netbsd4.99.62/bits/gthr-default.h \
+ /usr/include/machine/byte_swap.h /usr/pkg/gcc44/include/c++/4.4.1/* \
+ /opt/local/include/mozjs185/*.h /usr/include/libkern/i386/*.h /usr/include/sys/_types/*.h /usr/include/*.h \
+ --output cover.info
+ genhtml -o coverage cover.info
+
dep: depend
# tar release (use 'make -k tar' on a checkouted tree)
@@ -71,24 +89,31 @@ install:
ifeq ($(DISABLE_ISOFF), no)
ifeq ($(CONFIG_LINUX), yes)
ifneq ($(CONFIG_FFMPEG), no)
- $(INSTALL) $(INSTFLAGS) -m 755 bin/gcc/DashCast "$(DESTDIR)$(prefix)/bin"
+ $(INSTALL) $(INSTFLAGS) -m 755 bin/gcc/DashCast$(EXE_SUFFIX) "$(DESTDIR)$(prefix)/bin"
endif
endif
endif
ifeq ($(DISABLE_ISOFF), no)
- $(INSTALL) $(INSTFLAGS) -m 755 bin/gcc/MP4Box "$(DESTDIR)$(prefix)/bin"
+ $(INSTALL) $(INSTFLAGS) -m 755 bin/gcc/MP4Box$(EXE_SUFFIX) "$(DESTDIR)$(prefix)/bin"
+ifneq ($(MP4BOX_STATIC), yes)
+ $(INSTALL) $(INSTFLAGS) -m 755 bin/gcc/MP42TS$(EXE_SUFFIX) "$(DESTDIR)$(prefix)/bin"
+endif
endif
+ifneq ($(MP4BOX_STATIC), yes)
ifeq ($(DISABLE_PLAYER), no)
- $(INSTALL) $(INSTFLAGS) -m 755 bin/gcc/MP4Client "$(DESTDIR)$(prefix)/bin"
+ $(INSTALL) $(INSTFLAGS) -m 755 bin/gcc/MP4Client$(EXE_SUFFIX) "$(DESTDIR)$(prefix)/bin"
+endif
endif
if [ -d $(DESTDIR)$(prefix)/$(libdir)/pkgconfig ] ; then \
$(INSTALL) $(INSTFLAGS) -m 644 gpac.pc "$(DESTDIR)$(prefix)/$(libdir)/pkgconfig" ; \
fi
$(INSTALL) -d "$(DESTDIR)$(moddir)"
- $(INSTALL) bin/gcc/*.$(DYN_LIB_SUFFIX) "$(DESTDIR)$(moddir)"
- rm -f $(DESTDIR)$(moddir)/libgpac.$(DYN_LIB_SUFFIX)
- rm -f $(DESTDIR)$(moddir)/nposmozilla.$(DYN_LIB_SUFFIX)
+ifneq ($(MP4BOX_STATIC),yes)
+ $(INSTALL) bin/gcc/*$(DYN_LIB_SUFFIX) "$(DESTDIR)$(moddir)"
+ rm -f $(DESTDIR)$(moddir)/libgpac$(DYN_LIB_SUFFIX)
+ rm -f $(DESTDIR)$(moddir)/nposmozilla$(DYN_LIB_SUFFIX)
$(MAKE) installdylib
+endif
$(INSTALL) -d "$(DESTDIR)$(mandir)"
$(INSTALL) -d "$(DESTDIR)$(mandir)/man1";
if [ -d doc ] ; then \
@@ -107,16 +132,50 @@ endif
$(INSTALL) -d "$(DESTDIR)$(prefix)/share/gpac/gui/icons" ; \
$(INSTALL) $(INSTFLAGS) -m 644 gui/icons/*.svg "$(DESTDIR)$(prefix)/share/gpac/gui/icons/" ; \
cp -R gui/extensions "$(DESTDIR)$(prefix)/share/gpac/gui/" ; \
- rm -rf "$(DESTDIR)$(prefix)/share/gpac/gui/extensions/*.svn" ; \
+ rm -rf "$(DESTDIR)$(prefix)/share/gpac/gui/extensions/*.git" ; \
fi
+lninstall:
+ $(INSTALL) -d "$(DESTDIR)$(prefix)"
+ $(INSTALL) -d "$(DESTDIR)$(prefix)/$(libdir)"
+ $(INSTALL) -d "$(DESTDIR)$(prefix)/bin"
+ifeq ($(DISABLE_ISOFF), no)
+ifneq ($(CONFIG_FFMPEG), no)
+ ln -sf $(BUILD_PATH)/bin/gcc/DashCast$(EXE_SUFFIX) $(DESTDIR)$(prefix)/bin/DashCast$(EXE_SUFFIX)
+endif
+endif
+ifeq ($(DISABLE_ISOFF), no)
+ ln -sf $(BUILD_PATH)/bin/gcc/MP4Box$(EXE_SUFFIX) $(DESTDIR)$(prefix)/bin/MP4Box$(EXE_SUFFIX)
+ ln -sf $(BUILD_PATH)/bin/gcc/MP42TS$(EXE_SUFFIX) $(DESTDIR)$(prefix)/bin/MP42TS$(EXE_SUFFIX)
+endif
+ifneq ($(MP4BOX_STATIC),yes)
+ifeq ($(DISABLE_PLAYER), no)
+ ln -sf $(BUILD_PATH)/bin/gcc/MP4Client$(EXE_SUFFIX) $(DESTDIR)$(prefix)/bin/MP4Client$(EXE_SUFFIX)
+endif
+endif
+ifeq ($(CONFIG_DARWIN),yes)
+ ln -s $(BUILD_PATH)/bin/gcc/libgpac$(DYN_LIB_SUFFIX) $(DESTDIR)$(prefix)/$(libdir)/libgpac$(DYN_LIB_SUFFIX).$(VERSION_MAJOR)
+ ln -sf $(DESTDIR)$(prefix)/$(libdir)/libgpac$(DYN_LIB_SUFFIX).$(VERSION_MAJOR) $(DESTDIR)$(prefix)/$(libdir)/libgpac$(DYN_LIB_SUFFIX)
+else
+ ln -s $(BUILD_PATH)/bin/gcc/libgpac$(DYN_LIB_SUFFIX).$(VERSION_SONAME) $(DESTDIR)$(prefix)/$(libdir)/libgpac$(DYN_LIB_SUFFIX).$(VERSION_SONAME)
+ ln -sf $(DESTDIR)$(prefix)/$(libdir)/libgpac$(DYN_LIB_SUFFIX).$(VERSION_SONAME) $(DESTDIR)$(prefix)/$(libdir)/libgpac.so.$(VERSION_MAJOR)
+ ln -sf $(DESTDIR)$(prefix)/$(libdir)/libgpac$(DYN_LIB_SUFFIX).$(VERSION_SONAME) $(DESTDIR)$(prefix)/$(libdir)/libgpac.so
+ifeq ($(DESTDIR)$(prefix),$(prefix))
+ ldconfig || true
+endif
+endif
+
uninstall:
$(MAKE) -C applications uninstall
rm -rf $(DESTDIR)$(moddir)
rm -rf $(DESTDIR)$(prefix)/$(libdir)/libgpac*
+ifeq ($(CONFIG_WIN32),yes)
+ rm -rf "$(DESTDIR)$(prefix)/bin/libgpac*"
+endif
rm -rf $(DESTDIR)$(prefix)/$(libdir)/pkgconfig/gpac.pc
rm -rf $(DESTDIR)$(prefix)/bin/MP4Box
rm -rf $(DESTDIR)$(prefix)/bin/MP4Client
+ rm -rf $(DESTDIR)$(prefix)/bin/MP42TS
rm -rf $(DESTDIR)$(prefix)/bin/DashCast
rm -rf $(DESTDIR)$(mandir)/man1/mp4box.1
rm -rf $(DESTDIR)$(mandir)/man1/mp4client.1
@@ -125,24 +184,27 @@ uninstall:
rm -rf $(DESTDIR)$(prefix)/include/gpac
installdylib:
+ifneq ($(MP4BOX_STATIC),yes)
ifeq ($(CONFIG_WIN32),yes)
- $(INSTALL) $(INSTFLAGS) -m 755 bin/gcc/libgpac.dll $(prefix)/$(libdir)
+ $(INSTALL) $(INSTFLAGS) -m 755 bin/gcc/libgpac.dll.a $(DESTDIR)$(prefix)/$(libdir)
+ $(INSTALL) $(INSTFLAGS) -m 755 bin/gcc/libgpac.dll $(DESTDIR)$(prefix)/bin
else
ifeq ($(DEBUGBUILD),no)
- $(STRIP) bin/gcc/libgpac.$(DYN_LIB_SUFFIX)
+ $(STRIP) bin/gcc/libgpac$(DYN_LIB_SUFFIX)
endif
ifeq ($(CONFIG_DARWIN),yes)
- $(INSTALL) -m 755 bin/gcc/libgpac.$(DYN_LIB_SUFFIX) $(DESTDIR)$(prefix)/$(libdir)/libgpac.$(VERSION).$(DYN_LIB_SUFFIX)
- ln -sf libgpac.$(VERSION).$(DYN_LIB_SUFFIX) $(DESTDIR)$(prefix)/$(libdir)/libgpac.$(DYN_LIB_SUFFIX)
+ $(INSTALL) -m 755 bin/gcc/libgpac$(DYN_LIB_SUFFIX) $(DESTDIR)$(prefix)/$(libdir)/libgpac.$(VERSION)$(DYN_LIB_SUFFIX)
+ ln -sf libgpac.$(VERSION)$(DYN_LIB_SUFFIX) $(DESTDIR)$(prefix)/$(libdir)/libgpac$(DYN_LIB_SUFFIX)
else
- $(INSTALL) $(INSTFLAGS) -m 755 bin/gcc/libgpac.$(DYN_LIB_SUFFIX).$(VERSION_SONAME) $(DESTDIR)$(prefix)/$(libdir)/libgpac.$(DYN_LIB_SUFFIX).$(VERSION_SONAME)
- ln -sf libgpac.$(DYN_LIB_SUFFIX).$(VERSION_SONAME) $(DESTDIR)$(prefix)/$(libdir)/libgpac.so.$(VERSION_MAJOR)
- ln -sf libgpac.$(DYN_LIB_SUFFIX).$(VERSION_SONAME) $(DESTDIR)$(prefix)/$(libdir)/libgpac.so
+ $(INSTALL) $(INSTFLAGS) -m 755 bin/gcc/libgpac$(DYN_LIB_SUFFIX).$(VERSION_SONAME) $(DESTDIR)$(prefix)/$(libdir)/libgpac$(DYN_LIB_SUFFIX).$(VERSION_SONAME)
+ ln -sf libgpac$(DYN_LIB_SUFFIX).$(VERSION_SONAME) $(DESTDIR)$(prefix)/$(libdir)/libgpac.so.$(VERSION_MAJOR)
+ ln -sf libgpac$(DYN_LIB_SUFFIX).$(VERSION_SONAME) $(DESTDIR)$(prefix)/$(libdir)/libgpac.so
ifeq ($(DESTDIR)$(prefix),$(prefix))
ldconfig || true
endif
endif
endif
+endif
install-lib:
mkdir -p "$(DESTDIR)$(prefix)/include/gpac"
@@ -168,20 +230,30 @@ uninstall-lib:
ifeq ($(CONFIG_DARWIN),yes)
dmg:
+ @if [ ! -z "$(shell git diff master..origin/master)" ]; then \
+ echo "Local revision and remote revision are not congruent; you may have local commit."; \
+ echo "Please consider pushing your commit before generating an installer"; \
+ exit 1; \
+ fi
rm "bin/gcc/MP4Client"
$(MAKE) -C applications/mp4client
- ./mkdmg.sh
+ ./mkdmg.sh $(arch)
endif
ifeq ($(CONFIG_LINUX),yes)
deb:
+ @if [ ! -z "$(shell git diff master..origin/master)" ]; then \
+ echo "Local revision and remote revision are not congruent; you may have local commit."; \
+ echo "Please consider pushing your commit before generating an installer"; \
+ exit 1; \
+ fi
+ git checkout -- debian/changelog
fakeroot debian/rules clean
- sed -i "s/.DEV/.DEV-r`svnversion \"$(SRC_PATH)\"`/" debian/changelog
+ sed -i "s/-DEV/-DEV-rev$(VERSION)-$(BRANCH)/" debian/changelog
fakeroot debian/rules configure
fakeroot debian/rules binary
rm -rf debian/
- svn cleanup
- svn up
+ git checkout debian
endif
help:
diff --git a/README b/README
index ccb6ea6..1e52c00 100644
--- a/README
+++ b/README
@@ -11,7 +11,8 @@ For compilation and installation instruction, check INSTALLME file
For GPAC configuration instruction, check gpac/doc/configuration.html or gpac/doc/man/gpac.1 (man gpac when installed)
-For more information, visit the GPAC website on sourceforge:
- http://gpac.sourceforge.net
+For more information, visit the GPAC website:
+ http://gpac.io
+
diff --git a/applications/Makefile b/applications/Makefile
index da358cb..e60a811 100644
--- a/applications/Makefile
+++ b/applications/Makefile
@@ -2,13 +2,21 @@ include ../config.mak
APPDIRS=
+ifeq ($(MP4BOX_STATIC),yes)
+APPDIRS+=mp4box
+else
+
ifeq ($(DISABLE_PLAYER), no)
APPDIRS+=mp4client
endif
-
ifeq ($(DISABLE_ISOFF), no)
APPDIRS+=mp4box
+ifeq ($(DISABLE_M2TS_MUX), no)
+APPDIRS+=mp42ts
+endif
+
+ifneq ($(CONFIG_WIN32), yes)
ifneq ($(CONFIG_FFMPEG), no)
ifneq ($(DISABLE_CORE_TOOLS), yes)
ifneq ($(DISABLE_AV_PARSERS), yes)
@@ -16,9 +24,9 @@ APPDIRS+=dashcast
endif
endif
endif
-ifeq ($(DISABLE_M2TS_MUX), no)
-APPDIRS+=mp42ts
endif
+
+
endif
V4STUDIODIR=
@@ -36,11 +44,13 @@ ifeq ($(USE_WXWIDGETS), yes)
#INSTDIRS+=osmo4_wx
endif
+#MP4BOX_STATIC
+endif
+
ALLDIRS=$(APPDIRS)
all: apps
-
apps:
set -e; for i in $(APPDIRS) ; do $(MAKE) -C $$i all; done
diff --git a/applications/dashcast/Makefile b/applications/dashcast/Makefile
index 0b2bb02..89eeeda 100644
--- a/applications/dashcast/Makefile
+++ b/applications/dashcast/Makefile
@@ -29,6 +29,7 @@ CFLAGS+=-DDC_AUDIO_RESAMPLER
LINKLIBS+=-lavresample
endif
+
#common obj
OBJS= dashcast.o audio_data.o audio_decoder.o audio_encoder.o audio_muxer.o circular_buffer.o cmd_data.o controler.o message_queue.o register.o video_data.o video_decoder.o video_encoder.o video_muxer.o video_scaler.o task.o
diff --git a/applications/dashcast/audio_data.h b/applications/dashcast/audio_data.h
index 2c78c3e..c2b4e35 100644
--- a/applications/dashcast/audio_data.h
+++ b/applications/dashcast/audio_data.h
@@ -85,7 +85,7 @@ typedef struct {
/* audio codec */
char codec[GF_MAX_PATH];
/* custom parameter to be passed directly to the encoder - free it once you're done */
- char *custom;
+ char custom[GF_MAX_PATH];
/* used for source switching */
char source_id[GF_MAX_PATH];
diff --git a/applications/dashcast/audio_decoder.c b/applications/dashcast/audio_decoder.c
index 76a84c8..b5fc1bf 100644
--- a/applications/dashcast/audio_decoder.c
+++ b/applications/dashcast/audio_decoder.c
@@ -147,15 +147,16 @@ static int resample_audio(AudioInputFile *audio_input_file, AudioInputData *audi
*num_planes_out = av_sample_fmt_is_planar(DC_AUDIO_SAMPLE_FORMAT) ? DC_AUDIO_NUM_CHANNELS : 1;
*output = (uint8_t**)av_malloc(*num_planes_out*sizeof(uint8_t*));
for (i=0; i<*num_planes_out; i++) {
- *output[i] = (uint8_t*)av_malloc(DC_AUDIO_MAX_CHUNCK_SIZE); //FIXME: fix using size below av_samples_get_buffer_size()
+ (*output) [i] = (uint8_t*)av_malloc(DC_AUDIO_MAX_CHUNCK_SIZE); //FIXME: fix using size below av_samples_get_buffer_size()
}
- if (avresample_convert(audio_input_file->aresampler, *output, DC_AUDIO_MAX_CHUNCK_SIZE, audio_input_data->aframe->nb_samples, audio_input_data->aframe->extended_data, audio_input_data->aframe->linesize[0], audio_input_data->aframe->nb_samples) < 0) {
+ i = avresample_convert(audio_input_file->aresampler, *output, DC_AUDIO_MAX_CHUNCK_SIZE, audio_input_data->aframe->nb_samples, audio_input_data->aframe->extended_data, audio_input_data->aframe->linesize[0], audio_input_data->aframe->nb_samples);
+ if (i < 0) {
GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Could not resample audio frame. Aborting.\n"));
return -1;
}
- return 0;
+ return i;
}
#endif
@@ -288,16 +289,18 @@ int dc_audio_decoder_read(AudioInputFile *audio_input_file, AudioInputData *audi
exit(1);
#else
uint8_t **output;
+ int nb_samp;
if (ensure_resampler(audio_input_file, sample_rate, num_channels, channel_layout, sample_format)) {
return -1;
}
- if (resample_audio(audio_input_file, audio_input_data, codec_ctx, &output, &num_planes_out, num_channels, sample_format)) {
+ nb_samp = resample_audio(audio_input_file, audio_input_data, codec_ctx, &output, &num_planes_out, num_channels, sample_format);
+ if (nb_samp<0) {
return -1;
- } else {
- data = output;
- av_samples_get_buffer_size(&data_size, num_channels, audio_input_data->aframe->nb_samples, sample_format, 0);
- }
+ }
+
+ av_samples_get_buffer_size(&data_size, DC_AUDIO_NUM_CHANNELS, nb_samp, DC_AUDIO_SAMPLE_FORMAT, 0);
+ data = output;
#endif
} else {
/*no resampling needed: read data from the AVFrame*/
@@ -344,7 +347,7 @@ int dc_audio_decoder_read(AudioInputFile *audio_input_file, AudioInputData *audi
dc_producer_advance(&audio_input_data->producer, &audio_input_data->circular_buf);
}
}
-
+
#ifdef DC_AUDIO_RESAMPLER
if (resample) {
int i;
diff --git a/applications/dashcast/audio_encoder.c b/applications/dashcast/audio_encoder.c
index f277d73..c0d6a79 100644
--- a/applications/dashcast/audio_encoder.c
+++ b/applications/dashcast/audio_encoder.c
@@ -54,11 +54,12 @@ int dc_audio_encoder_open(AudioOutputFile *audio_output_file, AudioDataConf *aud
audio_output_file->codec_ctx->codec_id = audio_output_file->codec->id;
audio_output_file->codec_ctx->codec_type = AVMEDIA_TYPE_AUDIO;
audio_output_file->codec_ctx->bit_rate = audio_data_conf->bitrate;
- audio_output_file->codec_ctx->sample_rate = audio_data_conf->samplerate;
+ audio_output_file->codec_ctx->sample_rate = DC_AUDIO_SAMPLE_RATE /*audio_data_conf->samplerate*/;
+
{
AVRational time_base;
time_base.num = 1;
- time_base.den = audio_data_conf->samplerate;
+ time_base.den = audio_output_file->codec_ctx->sample_rate;
audio_output_file->codec_ctx->time_base = time_base;
}
audio_output_file->codec_ctx->channels = audio_data_conf->channels;
@@ -69,8 +70,6 @@ int dc_audio_encoder_open(AudioOutputFile *audio_output_file, AudioDataConf *aud
#endif
if (audio_data_conf->custom) {
build_dict(audio_output_file->codec_ctx->priv_data, audio_data_conf->custom);
- gf_free(audio_data_conf->custom);
- audio_data_conf->custom = NULL;
}
audio_output_file->astream_idx = 0;
@@ -96,7 +95,7 @@ int dc_audio_encoder_open(AudioOutputFile *audio_output_file, AudioDataConf *aud
audio_output_file->aframe->nb_samples = audio_output_file->codec_ctx->frame_size;
if (avcodec_fill_audio_frame(audio_output_file->aframe, audio_output_file->codec_ctx->channels, audio_output_file->codec_ctx->sample_fmt,
- audio_output_file->adata_buf, audio_output_file->codec_ctx->frame_size * av_get_bytes_per_sample(audio_output_file->codec_ctx->sample_fmt) * audio_output_file->codec_ctx->channels, 1) < 0) {
+ audio_output_file->adata_buf, audio_output_file->codec_ctx->frame_size * av_get_bytes_per_sample(audio_output_file->codec_ctx->sample_fmt) * audio_output_file->codec_ctx->channels, 1) < 0) {
GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Fill audio frame failed\n"));
return -1;
}
@@ -301,7 +300,7 @@ int dc_audio_encoder_encode(AudioOutputFile *audio_output_file, AudioInputData *
#endif
return -1;
}
-
+
#ifdef DC_AUDIO_RESAMPLER
if (resample) {
int i;
diff --git a/applications/dashcast/audio_muxer.c b/applications/dashcast/audio_muxer.c
index 8ca4eae..50ae59e 100644
--- a/applications/dashcast/audio_muxer.c
+++ b/applications/dashcast/audio_muxer.c
@@ -26,6 +26,7 @@
#include "audio_muxer.h"
#include "libavformat/avio.h"
+#ifndef GPAC_DISABLE_ISOM
int dc_gpac_audio_moov_create(AudioOutputFile *audio_output_file, char *filename)
{
@@ -121,8 +122,7 @@ int dc_gpac_audio_moov_create(AudioOutputFile *audio_output_file, char *filename
bpsample = av_get_bytes_per_sample(audio_output_file->codec_ctx->sample_fmt) * 8;
- ret = gf_isom_set_audio_info(audio_output_file->isof, track, di,
- audio_codec_ctx->sample_rate, audio_output_file->codec_ctx->channels, bpsample);
+ ret = gf_isom_set_audio_info(audio_output_file->isof, track, di, audio_codec_ctx->sample_rate, audio_output_file->codec_ctx->channels, bpsample);
if (ret != GF_OK) {
GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("%s: gf_isom_set_audio_info\n", gf_error_to_string(ret)));
return -1;
@@ -140,7 +140,7 @@ int dc_gpac_audio_moov_create(AudioOutputFile *audio_output_file, char *filename
ret = gf_isom_setup_track_fragment(audio_output_file->isof, track, 1, audio_output_file->codec_ctx->frame_size, 0, 0, 0, 0);
if (ret != GF_OK) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("%s: gf_isom_setutrack_fragment\n", gf_error_to_string(ret)));
+ GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("%s: gf_isom_setup_track_fragment\n", gf_error_to_string(ret)));
return -1;
}
@@ -176,7 +176,7 @@ int dc_gpac_audio_isom_write(AudioOutputFile *audio_output_file)
audio_output_file->sample->dataLength = audio_output_file->packet.size;
audio_output_file->sample->DTS = audio_output_file->dts; //audio_output_file->aframe->pts;
- audio_output_file->sample->IsRAP = 1; //audio_output_file->aframe->key_frame;//audio_codec_ctx->coded_frame->key_frame;
+ audio_output_file->sample->IsRAP = RAP; //audio_output_file->aframe->key_frame;//audio_codec_ctx->coded_frame->key_frame;
GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("RAP %d , DTS %ld \n", audio_output_file->sample->IsRAP, audio_output_file->sample->DTS));
ret = gf_isom_fragment_add_sample(audio_output_file->isof, 1, audio_output_file->sample, 1, audio_output_file->codec_ctx->frame_size, 0, 0, 0);
@@ -223,6 +223,10 @@ int dc_gpac_audio_isom_close(AudioOutputFile *audio_output_file)
return 0;
}
+#endif
+
+
+
int dc_ffmpeg_audio_muxer_open(AudioOutputFile *audio_output_file, char *filename)
{
AVStream *audio_stream;
@@ -273,7 +277,7 @@ int dc_ffmpeg_audio_muxer_open(AudioOutputFile *audio_output_file, char *filenam
audio_stream->codec->bit_rate = audio_codec_ctx->bit_rate;//audio_output_file->audio_data_conf->bitrate;
audio_stream->codec->sample_rate = audio_codec_ctx->sample_rate;//audio_output_file->audio_data_conf->samplerate;
audio_stream->codec->channels = audio_codec_ctx->channels;//audio_output_file->audio_data_conf->channels;
- assert(audio_codec_ctx->codec->sample_fmts);
+ assert(audio_codec_ctx->codec->sample_fmts);
audio_stream->codec->sample_fmt = audio_codec_ctx->codec->sample_fmts[0];
// if (audio_output_file->av_fmt_ctx->oformat->flags & AVFMT_GLOBALHEADER)
@@ -353,42 +357,44 @@ int dc_audio_muxer_init(AudioOutputFile *audio_output_file, AudioDataConf *audio
snprintf(name, sizeof(name), "audio encoder %s", audio_data_conf->filename);
dc_consumer_init(&audio_output_file->consumer, AUDIO_CB_SIZE, name);
+#ifndef GPAC_DISABLE_ISOM
audio_output_file->sample = gf_isom_sample_new();
audio_output_file->isof = NULL;
- audio_output_file->muxer_type = muxer_type;
+#endif
+ audio_output_file->muxer_type = muxer_type;
audio_output_file->frame_per_seg = frame_per_seg;
audio_output_file->frame_per_frag = frame_per_frag;
-
audio_output_file->seg_marker = seg_marker;
-
return 0;
}
void dc_audio_muxer_free(AudioOutputFile *audio_output_file)
{
+#ifndef GPAC_DISABLE_ISOM
if (audio_output_file->isof != NULL) {
gf_isom_close(audio_output_file->isof);
}
-
//gf_isom_sample_del(&audio_output_file->sample);
+#endif
}
GF_Err dc_audio_muxer_open(AudioOutputFile *audio_output_file, char *directory, char *id_name, int seg)
{
- GF_Err ret;
+ GF_Err ret = GF_NOT_SUPPORTED;
char name[GF_MAX_PATH];
switch (audio_output_file->muxer_type) {
case FFMPEG_AUDIO_MUXER:
snprintf(name, sizeof(name), "%s/%s_%d_ffmpeg.mp4", directory, id_name, seg);
return dc_ffmpeg_audio_muxer_open(audio_output_file, name);
+#ifndef GPAC_DISABLE_ISOM
case GPAC_AUDIO_MUXER:
snprintf(name, sizeof(name), "%s/%s_%d_gpac.mp4", directory, id_name, seg);
dc_gpac_audio_moov_create(audio_output_file, name);
return dc_gpac_audio_isom_open_seg(audio_output_file, NULL);
case GPAC_INIT_AUDIO_MUXER:
- if (seg == 0) {
+ if (seg == 1) {
snprintf(name, sizeof(name), "%s/%s_init_gpac.mp4", directory, id_name);
dc_gpac_audio_moov_create(audio_output_file, name);
audio_output_file->first_dts = 0;
@@ -396,11 +402,13 @@ GF_Err dc_audio_muxer_open(AudioOutputFile *audio_output_file, char *directory,
snprintf(name, sizeof(name), "%s/%s_%d_gpac.m4s", directory, id_name, seg);
ret = dc_gpac_audio_isom_open_seg(audio_output_file, name);
return ret;
+#endif
default:
- return GF_BAD_PARAM;
+ ret = GF_BAD_PARAM;
+ break;
}
- return GF_BAD_PARAM;
+ return ret;
}
int dc_audio_muxer_write(AudioOutputFile *audio_output_file, int frame_nb)
@@ -408,6 +416,7 @@ int dc_audio_muxer_write(AudioOutputFile *audio_output_file, int frame_nb)
switch (audio_output_file->muxer_type) {
case FFMPEG_AUDIO_MUXER:
return dc_ffmpeg_audio_muxer_write(audio_output_file);
+#ifndef GPAC_DISABLE_ISOM
case GPAC_AUDIO_MUXER:
case GPAC_INIT_AUDIO_MUXER:
if (frame_nb % audio_output_file->frame_per_frag == 0) {
@@ -419,14 +428,17 @@ int dc_audio_muxer_write(AudioOutputFile *audio_output_file, int frame_nb)
if (frame_nb % audio_output_file->frame_per_frag == audio_output_file->frame_per_frag - 1) {
gf_isom_flush_fragments(audio_output_file->isof, 1);
}
+ //TODO - do same as video, flush based on time in case of losses
if (frame_nb + 1 == audio_output_file->frame_per_seg) {
return 1;
}
+
return 0;
+#endif
+
default:
return GF_BAD_PARAM;
}
-
return GF_BAD_PARAM;
}
@@ -435,11 +447,13 @@ int dc_audio_muxer_close(AudioOutputFile *audio_output_file)
switch (audio_output_file->muxer_type) {
case FFMPEG_AUDIO_MUXER:
return dc_ffmpeg_audio_muxer_close(audio_output_file);
+#ifndef GPAC_DISABLE_ISOM
case GPAC_AUDIO_MUXER:
dc_gpac_audio_isom_close_seg(audio_output_file);
return dc_gpac_audio_isom_close(audio_output_file);
case GPAC_INIT_AUDIO_MUXER:
return dc_gpac_audio_isom_close_seg(audio_output_file);
+#endif
default:
return GF_BAD_PARAM;
}
diff --git a/applications/dashcast/audio_muxer.h b/applications/dashcast/audio_muxer.h
index 148d8c1..7c1d95e 100644
--- a/applications/dashcast/audio_muxer.h
+++ b/applications/dashcast/audio_muxer.h
@@ -64,8 +64,11 @@ typedef struct {
AVCodec *codec;
AVCodecContext *codec_ctx;
+#ifndef GPAC_DISABLE_ISOM
GF_ISOFile *isof;
GF_ISOSample *sample;
+#endif
+
int dts;
/* The index to the audio stream in the file */
diff --git a/applications/dashcast/cmd_data.c b/applications/dashcast/cmd_data.c
index 1d35e11..176369f 100644
--- a/applications/dashcast/cmd_data.c
+++ b/applications/dashcast/cmd_data.c
@@ -55,7 +55,7 @@ int dc_str_to_resolution(char *str, int *width, int *height)
}
-#define DEFAULT_VIDEO_BITRATE 400000
+#define DEFAULT_VIDEO_BITRATE 1000000
#define DEFAULT_VIDEO_FRAMERATE 25
#define DEFAULT_VIDEO_WIDTH 640
#define DEFAULT_VIDEO_HEIGHT 480
@@ -116,6 +116,9 @@ static void dc_create_configuration(CmdData *cmd_data)
snprintf(value, sizeof(value), "%d", cmd_data->video_data_conf.crop_x);
gf_cfg_set_key(conf, section_name, "crop_x", value);
}
+ if (!gf_cfg_get_key(conf, section_name, "low_delay")) {
+ gf_cfg_set_key(conf, section_name, "low_delay", cmd_data->video_data_conf.low_delay ? "yes" : "no");
+ }
if (!gf_cfg_get_key(conf, section_name, "crop_y")) {
if (cmd_data->video_data_conf.crop_y == -1)
@@ -186,8 +189,14 @@ int dc_read_configuration(CmdData *cmd_data)
video_data_conf->crop_x = opt ? atoi(opt) : 0;
opt = gf_cfg_get_key(conf, section_name, "crop_y");
video_data_conf->crop_x = opt ? atoi(opt) : 0;
+ opt = gf_cfg_get_key(conf, section_name, "low_delay");
+ video_data_conf->low_delay = (opt && !strcmp(opt, "yes")) ? 1 : 0;
opt = gf_cfg_get_key(conf, section_name, "custom");
- video_data_conf->custom = opt ? gf_strdup(opt) : NULL;
+ if (opt) {
+ if (strlen(opt) >= GF_MAX_PATH)
+ fprintf(stderr, "Warning: video custom opt is too long. Truncating.\n");
+ strncpy(video_data_conf->custom, opt, GF_MAX_PATH-1);
+ }
gf_list_add(cmd_data->video_lst, (void *) video_data_conf);
}
else if (strcmp(section_type, "audio") == 0)
@@ -205,7 +214,11 @@ int dc_read_configuration(CmdData *cmd_data)
opt = gf_cfg_get_key(conf, section_name, "channels");
audio_data_conf->channels = opt ? atoi(opt) : DEFAULT_AUDIO_CHANNELS;
opt = gf_cfg_get_key(conf, section_name, "custom");
- audio_data_conf->custom = opt ? gf_strdup(opt) : NULL;
+ if (opt) {
+ if (strlen(opt) >= GF_MAX_PATH)
+ fprintf(stderr, "Warning: audio custom opt is too long. Truncating.\n");
+ strncpy(audio_data_conf->custom, opt, GF_MAX_PATH-1);
+ }
gf_list_add(cmd_data->audio_lst, (void *) audio_data_conf);
} else {
fprintf(stderr, "Configuration file: type %s is not supported.\n", section_type);
@@ -355,7 +368,6 @@ void dc_cmd_data_destroy(CmdData *cmd_data)
{
while (gf_list_count(cmd_data->audio_lst)) {
AudioDataConf *audio_data_conf = gf_list_last(cmd_data->audio_lst);
- gf_free(audio_data_conf->custom);
gf_list_rem_last(cmd_data->audio_lst);
gf_free(audio_data_conf);
}
@@ -363,7 +375,6 @@ void dc_cmd_data_destroy(CmdData *cmd_data)
while (gf_list_count(cmd_data->video_lst)) {
VideoDataConf *video_data_conf = gf_list_last(cmd_data->video_lst);
- gf_free(video_data_conf->custom);
gf_list_rem_last(cmd_data->video_lst);
gf_free(video_data_conf);
}
@@ -374,7 +385,7 @@ void dc_cmd_data_destroy(CmdData *cmd_data)
gf_cfg_del(cmd_data->conf);
gf_cfg_del(cmd_data->switch_conf);
if (cmd_data->logfile)
- fclose(cmd_data->logfile);
+ gf_fclose(cmd_data->logfile);
dc_task_destroy(&cmd_data->task_list);
@@ -395,6 +406,7 @@ int dc_parse_command(int argc, char **argv, CmdData *cmd_data)
const char *command_usage =
"Usage: DashCast [options]\n"
+ "GPAC version " GPAC_FULL_VERSION"\n"
"\n"
"General options:\n"
" -log-file filename set output log file. Also works with -lf\n"
@@ -437,7 +449,6 @@ int dc_parse_command(int argc, char **argv, CmdData *cmd_data)
" -vfr N force the input video framerate\n"
" -vres WxH force the video resolution (e.g. 640x480)\n"
" -vcrop XxY crop the source video from X pixels left and Y pixels top. Must be used with -vres.\n"
- " -gdr use Gradual Decoder Refresh feature for video encoding (h264 codec only)\n"
"* Audio options:\n"
" -a string set the source name for an audio input\n"
" - if input is from microphone, use \"plughw:[x],[y]\"\n"
@@ -450,7 +461,10 @@ int dc_parse_command(int argc, char **argv, CmdData *cmd_data)
#if 0 //TODO: bind to option and params - test first how it binds to current input parameters
" -vb int set the output video bitrate (in bits)\n"
#endif
- " -vcustom string send custom parameters directly to the audio encoder\n"
+ " -vcustom string send custom parameters directly to the video encoder\n"
+ " -gdr use Gradual Decoder Refresh feature for video encoding (h264 codec only)\n"
+ " -gop specify GOP size in frames - default is framerate (1 sec gop)\n"
+ " -low-delay specify that low delay settings should be used (no B-frames, fast encoding)\n"
"* Audio encoding options:\n"
" -acodec string set the output audio codec (default: aac)\n"
#if 0 //TODO: bind to option and params - test first how it binds to current input parameters
@@ -462,11 +476,11 @@ int dc_parse_command(int argc, char **argv, CmdData *cmd_data)
"\n"
"DASH options:\n"
" -seg-dur dur:int set the segment duration in millisecond (default value: 1000)\n"
- " -frag-dur dur:int set the fragment duration in millisecond (default value: 1000)\n"
- " -seg-marker marker:str add a marker box named marker at the end of DASH segment\n"
+ " -frag dur:int set the fragment duration in millisecond (default value: 1000) (same as -frag-dur)\n"
+ " -seg-marker marker:4cc add a marker box named marker at the end of DASH segment\n"
" -out outdir:str outdir is the output data directory (default: output)\n"
" -mpd mpdname:str mpdname is the MPD file name (default: dashcast.mpd)\n"
- " -ast-offset dur:int dur is the MPD availabilityStartTime shift in milliseconds (default value: 1000)\n"
+ " -ast-offset dur:int dur is the MPD availabilityStartTime shift in milliseconds (default value: 0)\n"
" -mpd-refresh dur:int dur is the MPD minimumUpdatePeriod in seconds\n"
" -time-shift dur:int dur is the MPD TimeShiftBufferDepth in seconds\n"
" - the default value is 10. Specify -1 to keep all files.\n"
@@ -482,6 +496,9 @@ int dc_parse_command(int argc, char **argv, CmdData *cmd_data)
" DashCast -vf vfwcap -vres 1280x720 -vfr 24 -v 0 -live\n"
" DashCast -vf dshow -vres 1280x720 -vfr 24 -v video=\"screen-capture-recorder\" -live (please install http://screencapturer.sf.net/)\n"
" DashCast -vf dshow -vres 1280x720 -vfr 24 -v video=\"YOUR-WEBCAM\" -pixf yuv420p -live\n"
+#elif defined(__DARWIN) || defined(__APPLE__)
+ " DashCast -vf avfoundation -vres 1280x720 -v \"FaceTime HD Camera\" -vfr 25 -live\n"
+ " DashCast -vf avfoundation -vres 1280x720 -v \"Capture screen 0\" -vfr 25 -live\n"
#else
" DashCast -vf video4linux2 -vres 1280x720 -vfr 24 -v4l2f mjpeg -v /dev/video0 -af alsa -a plughw:1,0 -live\n"
" DashCast -vf x11grab -vres 800x600 -vfr 25 -v :0.0 -live\n"
@@ -508,12 +525,14 @@ int dc_parse_command(int argc, char **argv, CmdData *cmd_data)
gf_sys_init(use_mem_track);
+ gf_log_set_tool_level(GF_LOG_ALL, GF_LOG_WARNING);
if (use_mem_track) {
gf_log_set_tool_level(GF_LOG_MEMORY, GF_LOG_INFO);
}
/* Initialize command data */
dc_cmd_data_init(cmd_data);
+ cmd_data->use_mem_track = use_mem_track;
i = 1;
while (i < argc) {
@@ -600,16 +619,18 @@ int dc_parse_command(int argc, char **argv, CmdData *cmd_data)
fprintf(stderr, "%s", command_usage);
return -1;
}
- strncpy(cmd_data->video_data_conf.codec, argv[i], GF_MAX_PATH);
+ strncpy(cmd_data->video_data_conf.codec, argv[i], GF_MAX_PATH-1);
i++;
} else if (strcmp(argv[i], "-vcustom") == 0) {
DASHCAST_CHECK_NEXT_ARG
- if (strcmp(cmd_data->video_data_conf.custom, "") != 0) {
+ if (strlen(cmd_data->video_data_conf.custom)) {
fprintf(stderr, "Video custom has already been specified: appending\n");
fprintf(stderr, "%s", command_usage);
return -1;
}
- strncpy(cmd_data->video_data_conf.custom, argv[i], GF_MAX_PATH);
+ if (strlen(argv[i]) >= GF_MAX_PATH)
+ fprintf(stderr, "Warning: video custom is too long. Truncating.\n");
+ strncpy(cmd_data->video_data_conf.custom, argv[i], GF_MAX_PATH-1);
i++;
} else if (strcmp(argv[i], "-acodec") == 0) {
DASHCAST_CHECK_NEXT_ARG
@@ -618,16 +639,18 @@ int dc_parse_command(int argc, char **argv, CmdData *cmd_data)
fprintf(stderr, "%s", command_usage);
return -1;
}
- strncpy(cmd_data->audio_data_conf.codec, argv[i], GF_MAX_PATH);
+ strncpy(cmd_data->audio_data_conf.codec, argv[i], GF_MAX_PATH-1);
i++;
} else if (strcmp(argv[i], "-acustom") == 0) {
DASHCAST_CHECK_NEXT_ARG
- if (strcmp(cmd_data->audio_data_conf.custom, "") != 0) {
+ if (strlen(cmd_data->audio_data_conf.custom)) {
fprintf(stderr, "Audio custom has already been specified: appending\n");
fprintf(stderr, "%s", command_usage);
return -1;
}
- strncpy(cmd_data->audio_data_conf.custom, argv[i], GF_MAX_PATH);
+ if (strlen(argv[i]) >= GF_MAX_PATH)
+ fprintf(stderr, "Warning: audio custom is too long. Truncating.\n");
+ strncpy(cmd_data->audio_data_conf.custom, argv[i], GF_MAX_PATH-1);
i++;
} else if (strcmp(argv[i], "-conf") == 0) {
DASHCAST_CHECK_NEXT_ARG
@@ -665,7 +688,7 @@ int dc_parse_command(int argc, char **argv, CmdData *cmd_data)
fprintf(stderr, "%s", command_usage);
return -1;
}
- strncpy(cmd_data->mpd_filename, argv[i], GF_MAX_PATH);
+ strncpy(cmd_data->mpd_filename, argv[i], GF_MAX_PATH-1);
i++;
} else if (strcmp(argv[i], "-seg-dur") == 0) {
DASHCAST_CHECK_NEXT_ARG
@@ -676,7 +699,7 @@ int dc_parse_command(int argc, char **argv, CmdData *cmd_data)
}
cmd_data->seg_dur = atoi(argv[i]);
i++;
- } else if (strcmp(argv[i], "-frag-dur") == 0) {
+ } else if ((strcmp(argv[i], "-frag-dur") == 0) || (strcmp(argv[i], "-frag") == 0)) {
DASHCAST_CHECK_NEXT_ARG
if (cmd_data->frag_dur != 0) {
fprintf(stderr, "Fragment duration has already been specified.\n");
@@ -737,7 +760,10 @@ int dc_parse_command(int argc, char **argv, CmdData *cmd_data)
fprintf(stderr, "%s", command_usage);
return -1;
}
- strncpy(cmd_data->base_url, argv[i], GF_MAX_PATH);
+ strncpy(cmd_data->base_url, argv[i], GF_MAX_PATH-1);
+ i++;
+ } else if (strcmp(argv[i], "-low-delay") == 0) {
+ cmd_data->video_data_conf.low_delay = 1;
i++;
} else if (strcmp(argv[i], "-live") == 0) {
cmd_data->mode = LIVE_CAMERA;
@@ -775,7 +801,7 @@ int dc_parse_command(int argc, char **argv, CmdData *cmd_data)
#endif
} else if (!strcmp(argv[i], "-lf") || !strcmp(argv[i], "-log-file")) {
DASHCAST_CHECK_NEXT_ARG
- cmd_data->logfile = gf_f64_open(argv[i], "wt");
+ cmd_data->logfile = gf_fopen(argv[i], "wt");
gf_log_set_callback(cmd_data->logfile, on_dc_log);
i++;
} else if (strcmp(argv[i], "-gdr") == 0) {
@@ -837,6 +863,11 @@ int dc_parse_command(int argc, char **argv, CmdData *cmd_data)
cmd_data->min_buffer_time = 1.0;
}
+ if ((cmd_data->minimum_update_period == -1) && (cmd_data->mode == LIVE_CAMERA)) {
+ fprintf(stderr, "MPD refresh time not set in live - defaulting to segment duration\n");
+ cmd_data->minimum_update_period = cmd_data->seg_dur;
+ }
+
//safety checks
if (cmd_data->video_data_conf.crop_x || cmd_data->video_data_conf.crop_y) {
if (cmd_data->video_data_conf.width == -1 && cmd_data->video_data_conf.height == -1) {
diff --git a/applications/dashcast/cmd_data.h b/applications/dashcast/cmd_data.h
index 4c706d6..73bdbf4 100644
--- a/applications/dashcast/cmd_data.h
+++ b/applications/dashcast/cmd_data.h
@@ -108,6 +108,7 @@ typedef struct {
int insert_utc;
Bool use_source_timing;
+ Bool use_mem_track;
} CmdData;
/*
diff --git a/applications/dashcast/controler.c b/applications/dashcast/controler.c
index cc6487a..08d5601 100644
--- a/applications/dashcast/controler.c
+++ b/applications/dashcast/controler.c
@@ -43,10 +43,11 @@
# error
#endif
+#include
typedef struct {
int segnum;
- u64 time;
+ u64 utc_time, ntpts;
} segtime;
@@ -72,10 +73,13 @@ typedef struct {
void optimize_seg_frag_dur(int *seg, int *frag)
{
+ int min_rem;
int seg_nb = *seg;
int frag_nb = *frag;
+ if (!frag_nb) frag_nb = 1;
- int min_rem = seg_nb % frag_nb;
+ min_rem = seg_nb % frag_nb;
+
if (seg_nb % (frag_nb + 1) < min_rem) {
min_rem = seg_nb % (frag_nb + 1);
*seg = seg_nb;
@@ -150,7 +154,7 @@ static void dc_write_mpd(CmdData *cmddata, const AudioDataConf *audio_data_conf,
optimize_seg_frag_dur(&video_seg_dur, &video_frag_dur);
}
- f = fopen(name, "w");
+ f = gf_fopen(name, "w");
//TODO: if (!f) ...
// time_t t = time(NULL);
@@ -183,7 +187,7 @@ static void dc_write_mpd(CmdData *cmddata, const AudioDataConf *audio_data_conf,
fprintf(f, " %s \n", cmddata->base_url);
}
- fprintf(f, " \n");
+ fprintf(f, " \n");
if (strcmp(cmddata->audio_data_conf.filename, "") != 0) {
fprintf(f, " \n");
@@ -246,11 +250,7 @@ static void dc_write_mpd(CmdData *cmddata, const AudioDataConf *audio_data_conf,
fprintf(f, "\n");
- fclose(f);
-
-// fprintf(stdout, "\33[34m\33[1m");
- fprintf(stdout, "MPD file generated: %s/%s\n", cmddata->out_dir, cmddata->mpd_filename);
-// fprintf(stdout, "\33[0m");
+ gf_fclose(f);
}
static u32 mpd_thread(void *params)
@@ -268,7 +268,8 @@ static u32 mpd_thread(void *params)
segtime main_seg_time;
Bool first = GF_TRUE;
main_seg_time.segnum = 0;
- main_seg_time.time = 0;
+ main_seg_time.utc_time = 0;
+ main_seg_time.ntpts = 0;
if (cmddata->mode == LIVE_CAMERA || cmddata->mode == LIVE_MEDIA) {
while (1) {
@@ -276,7 +277,7 @@ static u32 mpd_thread(void *params)
time_t t;
segtime seg_time;
seg_time.segnum = 0;
- seg_time.time = 0;
+ seg_time.utc_time = 0;
if (cmddata->exit_signal) {
break;
@@ -292,7 +293,7 @@ static u32 mpd_thread(void *params)
}
if (cmddata->ast_offset>0) {
- seg_time.time += cmddata->ast_offset;
+ seg_time.utc_time += cmddata->ast_offset;
}
if (cmddata->use_dynamic_ast) {
@@ -311,18 +312,17 @@ static u32 mpd_thread(void *params)
}
}
- //printf time at which we generate MPD
- t = seg_time.time / 1000;
- msecs = (u32) ( (seg_time.time - t*1000) );
+
+ t = (seg_time.ntpts >> 32) - GF_NTP_SEC_1900_TO_1970;
+ msecs = (u32) ( (seg_time.ntpts & 0xFFFFFFFF) * (1000.0/0xFFFFFFFF) );
ast_time = *gmtime(&t);
- strftime(availability_start_time, 64, "%Y-%m-%dT%H:%M:%S", &ast_time);
- fprintf(stdout, "Generating MPD at %s.%d\n", availability_start_time, msecs);
+ fprintf(stdout, "Generating MPD at %d-%02d-%02dT%02d:%02d:%02d.%03dZ\n", 1900 + ast_time.tm_year, ast_time.tm_mon+1, ast_time.tm_mday, ast_time.tm_hour, ast_time.tm_min, ast_time.tm_sec, msecs);
- t = main_seg_time.time / 1000;
- msecs = (u32) ( (main_seg_time.time - t*1000) );
+ t = (main_seg_time.ntpts >> 32) - GF_NTP_SEC_1900_TO_1970;
+ msecs = (u32) ( (main_seg_time.ntpts & 0xFFFFFFFF) * (1000.0/0xFFFFFFFF) );
ast_time = *gmtime(&t);
- sprintf(availability_start_time, "%d-%02d-%02dT%02d:%02d:%02d.%d", 1900 + ast_time.tm_year, ast_time.tm_mon+1, ast_time.tm_mday, ast_time.tm_hour, ast_time.tm_min, ast_time.tm_sec, msecs);
- fprintf(stdout, "StartTime: %s - startNumber %d - last number %d\n", availability_start_time, main_seg_time.segnum, seg_time.segnum);
+ sprintf(availability_start_time, "%d-%02d-%02dT%02d:%02d:%02d.%03dZ", 1900 + ast_time.tm_year, ast_time.tm_mon+1, ast_time.tm_mday, ast_time.tm_hour, ast_time.tm_min, ast_time.tm_sec, msecs);
+ fprintf(stdout, "StartTime: %s - startNumber %d - last number %d\n", availability_start_time, main_seg_time.segnum+1, seg_time.segnum+1);
if (cmddata->time_shift != -1) {
int ts, h, m, s;
@@ -334,7 +334,7 @@ static u32 mpd_thread(void *params)
snprintf(time_shift, sizeof(time_shift), "timeShiftBufferDepth=\"PT%02dH%02dM%02dS\"", h, m, s);
}
- dc_write_mpd(cmddata, audio_data_conf, video_data_conf, presentation_duration, availability_start_time, time_shift, main_seg_time.segnum, cmddata->ast_offset);
+ dc_write_mpd(cmddata, audio_data_conf, video_data_conf, presentation_duration, availability_start_time, time_shift, main_seg_time.segnum+1, cmddata->ast_offset);
}
} else {
@@ -484,7 +484,7 @@ Bool dasher_thread(void *params)
// }
//
// dash_profile = cmd_data->live ? GF_DASH_PROFILE_LIVE : GF_DASH_PROFILE_MAIN;
-// strncpy(sz_mpd, cmd_data->mpd_filename, GF_MAX_PATH);
+// strncpy(sz_mpd, cmd_data->mpd_filename, GF_MAX_PATH-1);
//
// dash_duration = cmd_data->dash_dur ? cmd_data->dash_dur / 1000 : 1;
//
@@ -752,7 +752,8 @@ u32 video_encoder_thread(void *params)
segtime time_at_segment_start;
VideoMuxerType muxer_type = VIDEO_MUXER;
VideoThreadParam *thread_params = (VideoThreadParam*)params;
-
+ u32 sec, frac;
+ Bool init_mpd = GF_FALSE;
CmdData *in_data = thread_params->in_data;
int video_conf_idx = thread_params->video_conf_idx;
VideoDataConf *video_data_conf = gf_list_get(in_data->video_lst, video_conf_idx);
@@ -798,12 +799,18 @@ u32 video_encoder_thread(void *params)
return -1;
}
- if (dc_video_encoder_open(&out_file, video_data_conf, in_data->use_source_timing) < 0) {
+ if (dc_video_encoder_open(&out_file, video_data_conf, in_data->use_source_timing, video_scaled_data->sar) < 0) {
GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot open output video stream.\n"));
in_data->exit_signal = 1;
return -1;
}
+ if (in_data->mode == LIVE_MEDIA || in_data->mode == LIVE_CAMERA) {
+ init_mpd = GF_TRUE;
+ }
+
+
+ time_at_segment_start.ntpts = 0;
start_utc = gf_net_get_utc();
seg_utc = 0;
while (1) {
@@ -811,19 +818,47 @@ u32 video_encoder_thread(void *params)
//log time at segment start, because segment availabilityStartTime is computed from AST anchor + segment duration
//logging at the end of the segment production will induce one segment delay
time_at_segment_start.segnum = seg_nb;
- time_at_segment_start.time = gf_net_get_utc();
+ time_at_segment_start.utc_time = gf_net_get_utc();
+ gf_net_get_ntp(&sec, &frac);
+
+#ifndef GPAC_DISABLE_LOG
+ if (gf_log_tool_level_on(GF_LOG_DASH, GF_LOG_INFO)) {
+ if (time_at_segment_start.ntpts) {
+ u32 ref_sec, ref_frac;
+ Double tr, t;
+ ref_sec = (time_at_segment_start.ntpts>>32) & 0xFFFFFFFFULL;
+ ref_frac = (u32) (time_at_segment_start.ntpts & 0xFFFFFFFFULL);
+ tr = ref_sec * 1000.0;
+ tr += ref_frac*1000.0 /0xFFFFFFFF;
+ t = sec * 1000.0;
+ t += frac*1000.0 /0xFFFFFFFF;
+ GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("[DashCast] NTP diff since last segment start in msec is %f\n", t - tr));
+
+ }
+ }
+#endif
- if (dc_video_muxer_open(&out_file, in_data->out_dir, video_data_conf->filename, seg_nb) < 0) {
+ time_at_segment_start.ntpts = sec;
+ time_at_segment_start.ntpts <<= 32;
+ time_at_segment_start.ntpts |= frac;
+
+ //force writing MPD before any encoding happens (eg don't wait for the end of the first segment)
+ if (init_mpd) {
+ init_mpd = GF_FALSE;
+ dc_message_queue_put(mq, &time_at_segment_start, sizeof(time_at_segment_start));
+ }
+
+ assert(! out_file.segment_started);
+
+ if (dc_video_muxer_open(&out_file, in_data->out_dir, video_data_conf->filename, seg_nb+1) < 0) {
GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot open output video file.\n"));
in_data->exit_signal = 1;
return -1;
}
// fprintf(stdout, "Header size: %d\n", ret);
while (1) {
-// if (seg_frame_max > 0) {
-// if (frame_nb == seg_frame_max)
-// break;
-// }
+ u64 ntpts = gf_net_get_ntp_ts();
+
//we have the RAP already encoded, skip coder
if (loss_state == 2) {
ret = 1;
@@ -845,13 +880,14 @@ u32 video_encoder_thread(void *params)
if (ret > 0) {
int r;
+
/*resync at first RAP: flush current broken segment and restart next one on rap*/
if ((loss_state==1) && out_file.codec_ctx->coded_frame->key_frame) {
loss_state = 2;
break;
}
- r = dc_video_muxer_write(&out_file, frame_nb, in_data->insert_utc);
+ r = dc_video_muxer_write(&out_file, frame_nb, in_data->insert_utc ? ntpts : 0);
if (r < 0) {
quit = 1;
in_data->exit_signal = 1;
@@ -884,7 +920,6 @@ u32 video_encoder_thread(void *params)
int seg_diff;
seg_utc = gf_net_get_utc();
diff = (int) (seg_utc - start_utc);
- GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("[video_encoder] UTC diff %d - cumulated segment duration %d -> %d\n", diff, (seg_nb+1) * real_video_seg_dur, diff - (seg_nb+1) * real_video_seg_dur));
//if seg UTC is after next segment UTC (current ends at seg_nb+1, next at seg_nb+2), adjust numbers
if (diff > (seg_nb+2) * real_video_seg_dur) {
@@ -895,7 +930,7 @@ u32 video_encoder_thread(void *params)
//do a rough estimate of losses to adjust timing...
if (! in_data->use_source_timing) {
- out_file.first_dts += out_file.codec_ctx->time_base.den;
+ out_file.first_dts_in_fragment += out_file.codec_ctx->time_base.den;
}
}
//wait for RAP to cut next segment
@@ -1000,7 +1035,7 @@ u32 audio_encoder_thread(void *params)
frame_per_seg = (int)((audio_data_conf->samplerate / (double) audio_output_file.codec_ctx->frame_size) * (in_data->seg_dur / 1000.0));
frame_per_frag = (int)((audio_data_conf->samplerate / (double) audio_output_file.codec_ctx->frame_size) * (in_data->frag_dur / 1000.0));
optimize_seg_frag_dur(&frame_per_seg, &frame_per_frag);
-
+
real_audio_seg_dur = (int) (frame_per_seg * (double) audio_output_file.codec_ctx->frame_size * 1000.0 / (double) audio_data_conf->samplerate);
GF_LOG(GF_LOG_INFO, GF_LOG_DASH,("[audio_encoder] frame_per_seg=%d, frame_per_frag=%d, real_audio_seg_dur=%d ms\n", frame_per_seg, frame_per_frag, real_audio_seg_dur) );
@@ -1016,7 +1051,7 @@ u32 audio_encoder_thread(void *params)
while (1) {
frame_nb = 0;
quit = 0;
- if (dc_audio_muxer_open(&audio_output_file, in_data->out_dir, audio_data_conf->filename, seg_nb) < 0) {
+ if (dc_audio_muxer_open(&audio_output_file, in_data->out_dir, audio_data_conf->filename, seg_nb+1) < 0) {
GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Cannot open output audio.\n"));
in_data->exit_signal = 1;
return -1;
@@ -1102,7 +1137,7 @@ u32 audio_encoder_thread(void *params)
}
GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("[audio_encoder] UTC diff %d - cumulated segment duration %d -> %d\n", diff, (seg_nb+1) * real_audio_seg_dur, diff - (seg_nb+1) * real_audio_seg_dur));
t.segnum = seg_nb;
- t.time = gf_net_get_utc();
+ t.utc_time = gf_net_get_utc();
//time_t t = time(NULL);
dc_message_queue_put(mq, &t, sizeof(t));
}
@@ -1225,7 +1260,7 @@ int dc_run_controler(CmdData *in_data)
}
for (i=0; ivsrc) + 1; i++) {
- dc_video_input_data_set_prop(&video_input_data, i, video_input_file[i]->width, video_input_file[i]->height, in_data->video_data_conf.crop_x, in_data->video_data_conf.crop_y, video_input_file[i]->pix_fmt);
+ dc_video_input_data_set_prop(&video_input_data, i, video_input_file[i]->width, video_input_file[i]->height, in_data->video_data_conf.crop_x, in_data->video_data_conf.crop_y, video_input_file[i]->pix_fmt, video_input_file[i]->sar);
}
for (i=0; isource_number = source_number;
- strncpy(task->id, id_name, MAX_ID_SIZE);
+ strncpy(task->id, id_name, MAX_ID_SIZE-1);
task->start_time_t = start;
task->end_time_t = end;
gf_list_add(list->tasks, task);
@@ -55,7 +55,7 @@ int dc_task_get_current(TaskList *list, Task *task)
for (i = 0; isize; i++) {
Task *cur_task = gf_list_get(list->tasks, i);
if (now_time > cur_task->start_time_t && now_time < cur_task->end_time_t) {
- //strncpy(task->id, cur_task->id, MAX_ID_SIZE);
+ //strncpy(task->id, cur_task->id, MAX_ID_SIZE-1);
//memcpy(&task->start_time, &cur_task->start_time, sizeof(struct tm));
//memcpy(&task->end_time, &cur_task->end_time, sizeof(struct tm));
task->source_number = cur_task->source_number;
diff --git a/applications/dashcast/video_data.c b/applications/dashcast/video_data.c
index 97b37df..f960d57 100644
--- a/applications/dashcast/video_data.c
+++ b/applications/dashcast/video_data.c
@@ -67,13 +67,14 @@ int dc_video_input_data_init(VideoInputData *video_input_data, /*int width, int
return 0;
}
-void dc_video_input_data_set_prop(VideoInputData *video_input_data, int index, int width, int height, int crop_x, int crop_y, int pix_fmt)
+void dc_video_input_data_set_prop(VideoInputData *video_input_data, int index, int width, int height, int crop_x, int crop_y, int pix_fmt, AVRational sar)
{
video_input_data->vprop[index].width = width;
video_input_data->vprop[index].height = height;
video_input_data->vprop[index].crop_x = crop_x;
video_input_data->vprop[index].crop_y = crop_y;
video_input_data->vprop[index].pix_fmt = pix_fmt;
+ video_input_data->vprop[index].sar = sar;
}
void dc_video_input_data_destroy(VideoInputData *video_input_data)
diff --git a/applications/dashcast/video_data.h b/applications/dashcast/video_data.h
index 26f3f6f..c5bc68f 100644
--- a/applications/dashcast/video_data.h
+++ b/applications/dashcast/video_data.h
@@ -70,7 +70,9 @@ typedef struct {
/* RFC6381 codec name, only valid when VIDEO_MUXER == GPAC_INIT_VIDEO_MUXER_AVC1 */
char codec6381[GF_MAX_PATH];
/* custom parameter to be passed directly to the encoder - free it once you're done */
- char *custom;
+ char custom[GF_MAX_PATH];
+ /*low delay is used*/
+ int low_delay;
/* used for source switching */
char source_id[GF_MAX_PATH];
@@ -88,6 +90,7 @@ typedef struct {
int height;
int crop_x, crop_y;
int pix_fmt;
+ AVRational sar;
} VideoInputProp;
/*
@@ -146,7 +149,7 @@ int dc_video_input_data_init(VideoInputData *video_input_data,/* int width, int
/*
* Set properties for a VideoInputData.
*/
-void dc_video_input_data_set_prop(VideoInputData *video_input_data, int index, int width, int height, int crop_x, int crop_y, int pix_fmt);
+void dc_video_input_data_set_prop(VideoInputData *video_input_data, int index, int width, int height, int crop_x, int crop_y, int pix_fmt, AVRational sar);
/*
* Destroy a VideoInputData.
diff --git a/applications/dashcast/video_decoder.c b/applications/dashcast/video_decoder.c
index d0c6298..de708f9 100644
--- a/applications/dashcast/video_decoder.c
+++ b/applications/dashcast/video_decoder.c
@@ -153,8 +153,17 @@ int dc_video_decoder_open(VideoInputFile *video_input_file, VideoDataConf *video
video_input_file->width = codec_ctx->width;
video_input_file->height = codec_ctx->height;
+ video_input_file->sar = codec_ctx->sample_aspect_ratio;
+
video_input_file->pix_fmt = codec_ctx->pix_fmt;
- if (video_data_conf->framerate >= 0 && codec_ctx->time_base.num) {
+ if (codec_ctx->time_base.num==1) {
+ GF_LOG(GF_LOG_WARNING, GF_LOG_DASH, ("AVCTX give frame duration of %d/%d - keeping requested rate %d, but this may result in unexpected behaviour.\n", codec_ctx->time_base.num, codec_ctx->time_base.den, video_data_conf->framerate ));
+
+ if (codec_ctx->time_base.den==1000000) {
+ codec_ctx->time_base.num = codec_ctx->time_base.den / video_data_conf->framerate;
+ }
+ }
+ else if (video_data_conf->framerate >= 0 && codec_ctx->time_base.num) {
video_data_conf->framerate = codec_ctx->time_base.den / codec_ctx->time_base.num;
}
if (video_data_conf->framerate <= 1 || video_data_conf->framerate > 1000) {
@@ -175,7 +184,7 @@ int dc_video_decoder_open(VideoInputFile *video_input_file, VideoDataConf *video
}
if (video_data_conf->framerate <= 1 || video_data_conf->framerate > 1000) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Invalid input framerate.\n"));
+ GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Invalid input framerate %d (AVCTX timebase is %d/%d).\n", video_data_conf->framerate, codec_ctx->time_base.num, codec_ctx->time_base.den));
return -1;
}
@@ -306,30 +315,39 @@ int dc_video_decoder_read(VideoInputFile *video_input_file, VideoInputData *vide
video_input_file->pts_init = 1;
video_input_file->utc_at_init = gf_net_get_utc();
video_input_file->first_pts = packet.pts;
- video_input_file->computed_pts = 0;
+ video_input_file->prev_pts = 0;
video_input_data->frame_duration = codec_ctx->time_base.num;
+
video_input_file->sync_tolerance = 9*video_input_data->frame_duration/5;
//TODO - check with audio if sync is OK
}
- //perform FPS re-linearisation
+
+ //move to 0-based PTS
pts = packet.pts - video_input_file->first_pts;
- if (pts - video_input_file->prev_pts > video_input_file->sync_tolerance) {
- u32 nb_lost=0;
- while (pts > video_input_file->computed_pts) {
- video_input_file->computed_pts += video_input_data->frame_duration;
- nb_lost++;
- }
- if (nb_lost) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("[DashCast] Capture lost %d video frames \n", nb_lost));
+ if (video_input_file->prev_pts + video_input_data->frame_duration / 2 > pts) {
+ GF_LOG(GF_LOG_WARNING, GF_LOG_DASH, ("[DashCast] Error in PTS , diff too small (previous "LLU" - current "LLU"\n", video_input_file->prev_pts, pts));
+ }
+
+
+ //check for drop frames
+#ifndef GPAC_DISABLE_LOG
+ if (0 && gf_log_tool_level_on(GF_LOG_DASH, GF_LOG_WARNING)) {
+ if (pts - video_input_file->prev_pts > video_input_file->sync_tolerance) {
+ u32 nb_lost=0;
+ while (video_input_file->prev_pts + video_input_data->frame_duration + video_input_file->sync_tolerance < pts) {
+ video_input_file->prev_pts += video_input_data->frame_duration;
+ nb_lost++;
+ }
+ if (nb_lost) {
+ GF_LOG(GF_LOG_WARNING, GF_LOG_DASH, ("[DashCast] Capture lost %d video frames \n", nb_lost));
+ }
}
}
-
-// fprintf(stdout, "Capture PTS %g - UTC diff %g - Computed PTS %g\n", (Double) pts / codec_ctx->time_base.den, (Double) (gf_net_get_utc() - video_input_file->utc_at_init) / 1000, (Double) video_input_file->computed_pts / codec_ctx->time_base.den);
+#endif
video_input_file->prev_pts = pts;
- video_data_node->vframe->pts = video_input_file->computed_pts;
- video_input_file->computed_pts += video_input_data->frame_duration;
+ video_data_node->vframe->pts = pts;
}
if (video_data_node->vframe->pts==AV_NOPTS_VALUE) {
@@ -341,7 +359,7 @@ int dc_video_decoder_read(VideoInputFile *video_input_file, VideoInputData *vide
}
video_input_file->frame_decoded++;
- GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("[DashCast] Video Frame TS "LLU" decoded at UTC "LLU" ms\n", video_data_node->vframe->pts, gf_net_get_utc() ));
+ GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("[DashCast] Video Frame TS "LLU" decoded at UTC "LLU" ms\n", video_data_node->vframe->pts, gf_net_get_utc() ));
// For a decode/encode process we must free this memory.
//But if the input is raw and there is no need to decode then
diff --git a/applications/dashcast/video_decoder.h b/applications/dashcast/video_decoder.h
index 305d95f..59a6f94 100644
--- a/applications/dashcast/video_decoder.h
+++ b/applications/dashcast/video_decoder.h
@@ -51,13 +51,14 @@ typedef struct {
int width;
int height;
int pix_fmt;
+ AVRational sar;
int mode;
int no_loop, nb_consumers;
u32 frame_decoded;
Bool pts_init;
- u64 first_pts, prev_pts, computed_pts, sync_tolerance;
+ u64 first_pts, prev_pts, sync_tolerance;
u64 utc_at_init;
} VideoInputFile;
diff --git a/applications/dashcast/video_encoder.c b/applications/dashcast/video_encoder.c
index 784e4a4..1b07cf1 100644
--- a/applications/dashcast/video_encoder.c
+++ b/applications/dashcast/video_encoder.c
@@ -56,7 +56,7 @@ void build_dict(void *priv_data, const char *options) {
gf_free(opt);
}
-int dc_video_encoder_open(VideoOutputFile *video_output_file, VideoDataConf *video_data_conf, Bool use_source_timing)
+int dc_video_encoder_open(VideoOutputFile *video_output_file, VideoDataConf *video_data_conf, Bool use_source_timing, AVRational sar)
{
video_output_file->vbuf_size = 9 * video_data_conf->width * video_data_conf->height + 10000;
video_output_file->vbuf = (uint8_t *) av_malloc(video_output_file->vbuf_size);
@@ -75,8 +75,7 @@ int dc_video_encoder_open(VideoOutputFile *video_output_file, VideoDataConf *vid
video_output_file->codec_ctx->bit_rate = video_data_conf->bitrate;
video_output_file->codec_ctx->width = video_data_conf->width;
video_output_file->codec_ctx->height = video_data_conf->height;
- video_output_file->codec_ctx->sample_aspect_ratio.num = video_data_conf->width;
- video_output_file->codec_ctx->sample_aspect_ratio.den = video_data_conf->height;
+ video_output_file->codec_ctx->sample_aspect_ratio = sar;
video_output_file->codec_ctx->time_base.num = 1;
video_output_file->codec_ctx->time_base.den = video_output_file->gop_size ? video_output_file->gop_size : video_data_conf->framerate;
@@ -127,14 +126,16 @@ int dc_video_encoder_open(VideoOutputFile *video_output_file, VideoDataConf *vid
*
*/
- if (video_data_conf->custom) {
+ if ( strlen(video_data_conf->custom) ) {
build_dict(video_output_file->codec_ctx->priv_data, video_data_conf->custom);
- gf_free(video_data_conf->custom);
- video_data_conf->custom = NULL;
- } else {
+ } else if (video_data_conf->low_delay) {
GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("Video Encoder: applying default options (preset=ultrafast tune=zerolatency)\n"));
+ av_opt_set(video_output_file->codec_ctx->priv_data, "vprofile", "baseline", 0);
av_opt_set(video_output_file->codec_ctx->priv_data, "preset", "ultrafast", 0);
av_opt_set(video_output_file->codec_ctx->priv_data, "tune", "zerolatency", 0);
+ if (strstr(video_data_conf->codec, "264")) {
+ av_opt_set(video_output_file->codec_ctx->priv_data, "x264opts", "no-mbtree:sliced-threads:sync-lookahead=0", 0);
+ }
}
if (video_output_file->gdr) {
@@ -191,10 +192,24 @@ int dc_video_encoder_encode(VideoOutputFile *video_output_file, VideoScaledData
pkt.data = video_output_file->vbuf;
pkt.size = video_output_file->vbuf_size;
pkt.pts = pkt.dts = video_data_node->vframe->pkt_dts = video_data_node->vframe->pkt_pts = video_data_node->vframe->pts;
+ video_data_node->vframe->pict_type = 0;
+ video_data_node->vframe->width = video_codec_ctx->width;
+ video_data_node->vframe->height = video_codec_ctx->height;
+ video_data_node->vframe->format = video_codec_ctx->pix_fmt;
+
+
#ifdef LIBAV_ENCODE_OLD
+ if (!video_output_file->segment_started)
+ video_data_node->vframe->pict_type = FF_I_TYPE;
+
video_output_file->encoded_frame_size = avcodec_encode_video(video_codec_ctx, video_output_file->vbuf, video_output_file->vbuf_size, video_data_node->vframe);
got_packet = video_output_file->encoded_frame_size>=0 ? 1 : 0;
#else
+ //this is correct but unfortunately doesn't work with some versions of FFMPEG (output is just grey video ...)
+
+ if (!video_output_file->segment_started)
+ video_data_node->vframe->pict_type = AV_PICTURE_TYPE_I;
+
video_output_file->encoded_frame_size = avcodec_encode_video2(video_codec_ctx, &pkt, video_data_node->vframe, &got_packet);
#endif
@@ -225,7 +240,7 @@ int dc_video_encoder_encode(VideoOutputFile *video_output_file, VideoScaledData
return -1;
}
- GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("[DashCast] Video %s Frame TS "LLU" encoded at UTC "LLU" ms\n", video_output_file->rep_id, /*video_data_node->source_number, */video_data_node->vframe->pts, gf_net_get_utc() ));
+ GF_LOG(GF_LOG_DEBUG, GF_LOG_DASH, ("[DashCast] Video %s Frame TS "LLU" encoded at UTC "LLU" ms\n", video_output_file->rep_id, /*video_data_node->source_number, */video_data_node->vframe->pts, gf_net_get_utc() ));
/* if zero size, it means the image was buffered */
// if (out_size > 0) {
diff --git a/applications/dashcast/video_encoder.h b/applications/dashcast/video_encoder.h
index 6bc7498..26e4cb6 100644
--- a/applications/dashcast/video_encoder.h
+++ b/applications/dashcast/video_encoder.h
@@ -37,7 +37,7 @@
*
* @return 0 on success, -1 on failure
*/
-int dc_video_encoder_open(VideoOutputFile *video_output_file, VideoDataConf *video_data_conf, Bool use_source_timing);
+int dc_video_encoder_open(VideoOutputFile *video_output_file, VideoDataConf *video_data_conf, Bool use_source_timing, AVRational sar);
/*
* Read the decoded video frames from circular buffer
diff --git a/applications/dashcast/video_muxer.c b/applications/dashcast/video_muxer.c
index 19facd7..7f0ae3c 100644
--- a/applications/dashcast/video_muxer.c
+++ b/applications/dashcast/video_muxer.c
@@ -25,6 +25,7 @@
#include "video_muxer.h"
#include "libavutil/opt.h"
+#include
/**
@@ -158,7 +159,7 @@ static GF_Err hevc_import_ffextradata(const u8 *extradata, const u64 extradata_s
bs = gf_bs_new(extradata, extradata_size, GF_BITSTREAM_READ);
if (!bs)
return GF_BAD_PARAM;
-
+
memset(&hevc, 0, sizeof(HEVCState));
hevc.sps_active_idx = -1;
@@ -168,7 +169,7 @@ static GF_Err hevc_import_ffextradata(const u8 *extradata, const u64 extradata_s
u8 nal_unit_type, temporal_id, layer_id;
u64 nal_start;
u32 nal_size;
-
+
if (gf_bs_read_u32(bs) != 0x00000001) {
gf_bs_del(bs);
return GF_BAD_PARAM;
@@ -212,7 +213,7 @@ static GF_Err hevc_import_ffextradata(const u8 *extradata, const u64 extradata_s
dst_cfg->constantFrameRate = hevc.vps[idx].rates[0].constand_pic_rate_idc;
dst_cfg->numTemporalLayers = hevc.vps[idx].max_sub_layers;
dst_cfg->temporalIdNested = hevc.vps[idx].temporal_id_nesting;
-
+
if (!vpss) {
GF_SAFEALLOC(vpss, GF_HEVCParamArray);
vpss->nalus = gf_list_new();
@@ -237,13 +238,13 @@ static GF_Err hevc_import_ffextradata(const u8 *extradata, const u64 extradata_s
gf_free(buffer);
return GF_BAD_PARAM;
}
-
+
assert(!(hevc.sps[idx].state & AVC_SPS_DECLARED)); //we don't expect multiple SPS
if ((hevc.sps[idx].state & AVC_SPS_PARSED) && !(hevc.sps[idx].state & AVC_SPS_DECLARED)) {
hevc.sps[idx].state |= AVC_SPS_DECLARED;
hevc.sps[idx].crc = gf_crc_32(buffer, nal_size);
}
-
+
dst_cfg->configurationVersion = 1;
dst_cfg->profile_space = hevc.sps[idx].ptl.profile_space;
dst_cfg->tier_flag = hevc.sps[idx].ptl.tier_flag;
@@ -260,7 +261,7 @@ static GF_Err hevc_import_ffextradata(const u8 *extradata, const u64 extradata_s
dst_cfg->chromaFormat = hevc.sps[idx].chroma_format_idc;
dst_cfg->luma_bit_depth = hevc.sps[idx].bit_depth_luma;
dst_cfg->chroma_bit_depth = hevc.sps[idx].bit_depth_chroma;
-
+
if (!spss) {
GF_SAFEALLOC(spss, GF_HEVCParamArray);
spss->nalus = gf_list_new();
@@ -283,7 +284,7 @@ static GF_Err hevc_import_ffextradata(const u8 *extradata, const u64 extradata_s
gf_free(buffer);
return GF_BAD_PARAM;
}
-
+
assert(hevc.pps[idx].state == 1); //we don't expect multiple PPS
if (hevc.pps[idx].state == 1) {
hevc.pps[idx].state = 2;
@@ -323,6 +324,8 @@ static GF_Err hevc_import_ffextradata(const u8 *extradata, const u64 extradata_s
#endif
}
+#ifndef GPAC_DISABLE_ISOM
+
static GF_Err dc_gpac_video_write_config(VideoOutputFile *video_output_file, u32 *di, u32 track) {
GF_Err ret;
if (video_output_file->codec_ctx->codec_id == CODEC_ID_H264) {
@@ -442,15 +445,13 @@ int dc_gpac_video_moov_create(VideoOutputFile *video_output_file, char *filename
return -1;
}
- //gf_isom_add_track_to_root_od(video_output_file->isof,1);
-
ret = gf_isom_finalize_for_fragment(video_output_file->isof, track);
if (ret != GF_OK) {
GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("%s: gf_isom_finalize_for_fragment\n", gf_error_to_string(ret)));
return -1;
}
- ret = gf_media_get_rfc_6381_codec_name(video_output_file->isof, track, video_output_file->video_data_conf->codec6381);
+ ret = gf_media_get_rfc_6381_codec_name(video_output_file->isof, track, video_output_file->video_data_conf->codec6381, GF_FALSE, GF_FALSE);
if (ret != GF_OK) {
GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("%s: gf_isom_finalize_for_fragment\n", gf_error_to_string(ret)));
return -1;
@@ -467,16 +468,6 @@ int dc_gpac_video_isom_open_seg(VideoOutputFile *video_output_file, char *filena
GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("%s: gf_isom_start_segment\n", gf_error_to_string(ret)));
return -1;
}
-
-// ret = gf_isom_set_traf_base_media_decode_time(video_output_file->isof, 1,
-// video_output_file->first_dts);
-// if (ret != GF_OK) {
-// GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("%s: gf_isom_set_traf_base_media_decode_time\n", gf_error_to_string(ret)));
-// return -1;
-// }
-//
-// video_output_file->first_dts += video_output_file->frame_per_segment;
-
GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("[DashCast] Opening new segment %s at UTC "LLU" ms\n", filename, gf_net_get_utc() ));
return 0;
}
@@ -568,9 +559,12 @@ int dc_gpac_video_isom_close(VideoOutputFile *video_output_file)
return 0;
}
+#endif
+
+
int dc_raw_h264_open(VideoOutputFile *video_output_file, char *filename)
{
- video_output_file->file = fopen(filename, "w");
+ video_output_file->file = gf_fopen(filename, "w");
return 0;
}
@@ -582,7 +576,7 @@ int dc_raw_h264_write(VideoOutputFile *video_output_file)
int dc_raw_h264_close(VideoOutputFile *video_output_file)
{
- fclose(video_output_file->file);
+ gf_fclose(video_output_file->file);
return 0;
}
@@ -719,8 +713,11 @@ int dc_video_muxer_init(VideoOutputFile *video_output_file, VideoDataConf *video
snprintf(name, sizeof(name), "video encoder %s", video_data_conf->filename);
dc_consumer_init(&video_output_file->consumer, video_cb_size, name);
+#ifndef GPAC_DISABLE_ISOM
video_output_file->sample = gf_isom_sample_new();
video_output_file->isof = NULL;
+#endif
+
video_output_file->muxer_type = muxer_type;
video_output_file->frame_per_segment = frame_per_segment;
@@ -739,12 +736,13 @@ int dc_video_muxer_init(VideoOutputFile *video_output_file, VideoDataConf *video
int dc_video_muxer_free(VideoOutputFile *video_output_file)
{
+#ifndef GPAC_DISABLE_ISOM
if (video_output_file->isof != NULL) {
gf_isom_close(video_output_file->isof);
}
gf_isom_sample_del(&video_output_file->sample);
-
+#endif
return 0;
}
@@ -759,15 +757,16 @@ GF_Err dc_video_muxer_open(VideoOutputFile *video_output_file, char *directory,
case RAW_VIDEO_H264:
snprintf(name, sizeof(name), "%s/%s_%d.264", directory, id_name, seg);
return dc_raw_h264_open(video_output_file, name);
+#ifndef GPAC_DISABLE_ISOM
case GPAC_VIDEO_MUXER:
snprintf(name, sizeof(name), "%s/%s_%d_gpac.mp4", directory, id_name, seg);
dc_gpac_video_moov_create(video_output_file, name);
return dc_gpac_video_isom_open_seg(video_output_file, NULL);
case GPAC_INIT_VIDEO_MUXER_AVC1:
- if (seg == 0) {
+ if (seg == 1) {
snprintf(name, sizeof(name), "%s/%s_init_gpac.mp4", directory, id_name);
dc_gpac_video_moov_create(video_output_file, name);
- video_output_file->first_dts = 0;
+ video_output_file->first_dts_in_fragment = 0;
}
snprintf(name, sizeof(name), "%s/%s_%d_gpac.m4s", directory, id_name, seg);
return dc_gpac_video_isom_open_seg(video_output_file, name);
@@ -775,10 +774,11 @@ GF_Err dc_video_muxer_open(VideoOutputFile *video_output_file, char *directory,
if (seg == 0) {
snprintf(name, sizeof(name), "%s/%s_init_gpac.mp4", directory, id_name);
dc_gpac_video_moov_create(video_output_file, name);
- video_output_file->first_dts = 0;
+ video_output_file->first_dts_in_fragment = 0;
}
snprintf(name, sizeof(name), "%s/%s_%d_gpac.m4s", directory, id_name, seg);
return dc_gpac_video_isom_open_seg(video_output_file, name);
+#endif
default:
return GF_BAD_PARAM;
};
@@ -786,49 +786,53 @@ GF_Err dc_video_muxer_open(VideoOutputFile *video_output_file, char *directory,
return -2;
}
-int dc_video_muxer_write(VideoOutputFile *video_output_file, int frame_nb, Bool insert_utc)
+int dc_video_muxer_write(VideoOutputFile *video_output_file, int frame_nb, u64 ntp_timestamp)
{
- u64 frame_dur;
- GF_Err ret;
switch (video_output_file->muxer_type) {
case FFMPEG_VIDEO_MUXER:
return dc_ffmpeg_video_muxer_write(video_output_file);
case RAW_VIDEO_H264:
return dc_raw_h264_write(video_output_file);
+#ifndef GPAC_DISABLE_ISOM
case GPAC_VIDEO_MUXER:
case GPAC_INIT_VIDEO_MUXER_AVC1:
case GPAC_INIT_VIDEO_MUXER_AVC3:
if (video_output_file->use_source_timing) {
+ GF_Err ret;
if (!video_output_file->fragment_started) {
video_output_file->fragment_started = 1;
ret = gf_isom_start_fragment(video_output_file->isof, 1);
if (ret < 0)
return -1;
- video_output_file->first_dts = video_output_file->codec_ctx->coded_frame->pkt_dts;
+ //insert UTC for each fragment
+ if (ntp_timestamp) {
+ gf_isom_set_fragment_reference_time(video_output_file->isof, video_output_file->trackID, ntp_timestamp, video_output_file->codec_ctx->coded_frame->pts);
+ }
+
+ video_output_file->first_dts_in_fragment = video_output_file->codec_ctx->coded_frame->pkt_dts;
if (!video_output_file->segment_started) {
- u32 sec, frac;
- u64 ntpts;
video_output_file->pts_at_segment_start = video_output_file->codec_ctx->coded_frame->pts;
video_output_file->segment_started = 1;
+ if (!video_output_file->nb_segments) {
+ video_output_file->pts_at_first_segment = video_output_file->pts_at_segment_start;
+ }
- if (insert_utc) {
- gf_net_get_ntp(&sec, &frac);
- ntpts = sec;
- ntpts <<= 32;
- ntpts |= frac;
- gf_isom_set_fragment_reference_time(video_output_file->isof, video_output_file->trackID, ntpts, video_output_file->pts_at_segment_start);
+#ifndef GPAC_DISABLE_LOG
+ if (ntp_timestamp && gf_log_tool_level_on(GF_LOG_DASH, GF_LOG_INFO)) {
+ if (!video_output_file->ntp_at_first_dts) {
+ video_output_file->ntp_at_first_dts = ntp_timestamp;
+ } else {
+ s32 ntp_diff = gf_net_get_ntp_diff_ms(video_output_file->ntp_at_first_dts);
+ s32 ts_diff = (s32) ( 1000 * (video_output_file->codec_ctx->coded_frame->pts - video_output_file->pts_at_first_segment) / video_output_file->timescale );
+
+ s32 diff_ms = ts_diff - ntp_diff;
+ GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("[DashCast] Video Segment start NTP diff: %d ms TS diff: %d ms drift: %d ms\n", ntp_diff, ts_diff, diff_ms));
+ }
}
+#endif
}
- gf_isom_set_traf_base_media_decode_time(video_output_file->isof, video_output_file->trackID, video_output_file->first_dts);
- }
-
- //keep track of previous frame dur and use last dur as the default duration for next sample
- //this works fine because we perform frame rate regulation at the capture stage
- frame_dur = video_output_file->codec_ctx->coded_frame->pts - video_output_file->last_pts;
- if (frame_dur && (video_output_file->frame_dur>(u32) frame_dur)) {
- GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("New frame dur detected: %d vs %d old\n", (u32) frame_dur, (u32) video_output_file->frame_dur));
- video_output_file->frame_dur = (u32)frame_dur;
+ gf_isom_set_traf_base_media_decode_time(video_output_file->isof, video_output_file->trackID, video_output_file->first_dts_in_fragment);
}
if (dc_gpac_video_isom_write(video_output_file) < 0) {
@@ -837,16 +841,23 @@ int dc_video_muxer_write(VideoOutputFile *video_output_file, int frame_nb, Bool
video_output_file->last_pts = video_output_file->codec_ctx->coded_frame->pts;
video_output_file->last_dts = video_output_file->codec_ctx->coded_frame->pkt_dts;
- if (( video_output_file->last_dts - video_output_file->first_dts + video_output_file->frame_dur) /video_output_file->timescale >= video_output_file->frag_dur / 1000) {
+ if (( video_output_file->last_dts - video_output_file->first_dts_in_fragment + video_output_file->frame_dur) * 1000 >= video_output_file->frag_dur * video_output_file->timescale) {
gf_isom_flush_fragments(video_output_file->isof, 1);
video_output_file->fragment_started = 0;
- GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("[DashCast] Flushed fragment to disk at UTC "LLU" ms - last coded frame PTS %d\n", gf_net_get_utc(), video_output_file->codec_ctx->coded_frame->pts));
+ GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("[DashCast] Flushed fragment at UTC "LLU" ms - First DTS "LLU" last PTS "LLU"\n", gf_net_get_utc(), video_output_file->first_dts_in_fragment, video_output_file->codec_ctx->coded_frame->pts));
}
//we may have rounding errors on the input PTS :( add half frame dur safety
+
+ //flush segments based on the cumultated duration , to avoid drift
+ if (1000 * ( video_output_file->last_pts - video_output_file->pts_at_first_segment + 3*video_output_file->frame_dur/2) / video_output_file->timescale >= (video_output_file->nb_segments+1)*video_output_file->seg_dur ) {
+ return 1;
+ }
+#if 0
if (1000 * ( video_output_file->last_pts - video_output_file->pts_at_segment_start + 3*video_output_file->frame_dur/2) /video_output_file->timescale >= video_output_file->seg_dur ) {
return 1;
}
+#endif
return 0;
}
@@ -854,44 +865,32 @@ int dc_video_muxer_write(VideoOutputFile *video_output_file, int frame_nb, Bool
gf_isom_start_fragment(video_output_file->isof, 1);
if (!video_output_file->segment_started) {
- u32 sec, frac;
- u64 ntpts;
-
video_output_file->pts_at_segment_start = video_output_file->codec_ctx->coded_frame->pts;
video_output_file->segment_started = 1;
- if (insert_utc) {
- time_t secs;
- struct tm t;
- gf_net_get_ntp(&sec, &frac);
- ntpts = sec;
- ntpts <<= 32;
- ntpts |= frac;
- gf_isom_set_fragment_reference_time(video_output_file->isof, video_output_file->trackID, ntpts, video_output_file->pts_at_segment_start);
-
- secs = sec - GF_NTP_SEC_1900_TO_1970;
- t = *gmtime(&secs);
- GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("[DashCast] Producer reference clock: Timestamp %d matches sender NTP time %d-%02d-%02dT%02d:%02d:%02dZ (NTP frac part %u) \n", (u32) video_output_file->pts_at_segment_start, 1900+t.tm_year, t.tm_mon+1, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec, (u32) frac ));
-
+ if (ntp_timestamp) {
+ gf_isom_set_fragment_reference_time(video_output_file->isof, video_output_file->trackID, ntp_timestamp, video_output_file->pts_at_segment_start);
}
}
- gf_isom_set_traf_base_media_decode_time(video_output_file->isof, video_output_file->trackID, video_output_file->first_dts);
- video_output_file->first_dts += video_output_file->frame_per_fragment;
+ gf_isom_set_traf_base_media_decode_time(video_output_file->isof, video_output_file->trackID, video_output_file->first_dts_in_fragment);
+ video_output_file->first_dts_in_fragment += video_output_file->frame_per_fragment;
}
dc_gpac_video_isom_write(video_output_file);
if (frame_nb % video_output_file->frame_per_fragment == video_output_file->frame_per_fragment - 1) {
gf_isom_flush_fragments(video_output_file->isof, 1);
- GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("[DashCast] Flushed fragment to disk at UTC "LLU" ms - last coded frame PTS %d\n", gf_net_get_utc(), video_output_file->codec_ctx->coded_frame->pts));
+ GF_LOG(GF_LOG_INFO, GF_LOG_DASH, ("[DashCast] Flushed fragment to disk at UTC "LLU" ms - last coded frame PTS "LLU"\n", gf_net_get_utc(), video_output_file->codec_ctx->coded_frame->pts));
}
if (frame_nb + 1 == video_output_file->frame_per_segment)
return 1;
return 0;
+#endif
+
default:
return -2;
}
@@ -902,18 +901,21 @@ int dc_video_muxer_write(VideoOutputFile *video_output_file, int frame_nb, Bool
int dc_video_muxer_close(VideoOutputFile *video_output_file)
{
video_output_file->fragment_started = video_output_file->segment_started = 0;
+ video_output_file->nb_segments++;
switch (video_output_file->muxer_type) {
case FFMPEG_VIDEO_MUXER:
return dc_ffmpeg_video_muxer_close(video_output_file);
case RAW_VIDEO_H264:
return dc_raw_h264_close(video_output_file);
+#ifndef GPAC_DISABLE_ISOM
case GPAC_VIDEO_MUXER:
dc_gpac_video_isom_close_seg(video_output_file);
return dc_gpac_video_isom_close(video_output_file);
case GPAC_INIT_VIDEO_MUXER_AVC1:
case GPAC_INIT_VIDEO_MUXER_AVC3:
return dc_gpac_video_isom_close_seg(video_output_file);
+#endif
default:
return -2;
}
diff --git a/applications/dashcast/video_muxer.h b/applications/dashcast/video_muxer.h
index f869589..08ded74 100644
--- a/applications/dashcast/video_muxer.h
+++ b/applications/dashcast/video_muxer.h
@@ -36,7 +36,6 @@
#include "video_scaler.h"
-
typedef enum {
FFMPEG_VIDEO_MUXER,
RAW_VIDEO_H264,
@@ -61,8 +60,11 @@ typedef struct {
FILE *file;
+#ifndef GPAC_DISABLE_ISOM
GF_ISOFile *isof;
GF_ISOSample *sample;
+#endif
+
u32 trackID;
/* Index of the video stream in the file */
int vstream_idx;
@@ -80,7 +82,8 @@ typedef struct {
int seg_dur;
int frag_dur;
- u64 first_dts;
+ u64 first_dts_in_fragment;
+ u64 ntp_at_first_dts;
u32 seg_marker;
@@ -89,10 +92,11 @@ typedef struct {
Bool use_source_timing;
- u64 pts_at_segment_start;
+ u64 pts_at_segment_start, pts_at_first_segment;
u64 last_pts, last_dts;
u64 frame_dur;
u32 timescale;
+ u32 nb_segments;
Bool fragment_started, segment_started;
const char *rep_id;
} VideoOutputFile;
@@ -103,7 +107,7 @@ int dc_video_muxer_free(VideoOutputFile *video_output_file);
int dc_video_muxer_open(VideoOutputFile *video_output_file, char *directory, char *id_name, int seg);
-int dc_video_muxer_write(VideoOutputFile *video_output_file, int frame_nb, Bool insert_utc);
+int dc_video_muxer_write(VideoOutputFile *video_output_file, int frame_nb, u64 ntp_timestamp);
int dc_video_muxer_close(VideoOutputFile *video_output_file);
diff --git a/applications/dashcast/video_scaler.c b/applications/dashcast/video_scaler.c
index 277d95f..0135d9d 100644
--- a/applications/dashcast/video_scaler.c
+++ b/applications/dashcast/video_scaler.c
@@ -143,6 +143,8 @@ int dc_video_scaler_data_set_prop(VideoInputData *video_input_data, VideoScaledD
video_scaled_data->vsprop[index].in_height = video_input_data->vprop[index].height - video_input_data->vprop[index].crop_y;
video_scaled_data->vsprop[index].in_pix_fmt = video_input_data->vprop[index].pix_fmt;
+ video_scaled_data->sar = video_input_data->vprop[index].sar;
+
video_scaled_data->vsprop[index].sws_ctx = sws_getContext(
video_scaled_data->vsprop[index].in_width,
video_scaled_data->vsprop[index].in_height,
@@ -164,18 +166,25 @@ int dc_video_scaler_scale(VideoInputData *video_input_data, VideoScaledData *vid
VideoScaledDataNode *video_scaled_data_node;
AVFrame *src_vframe;
- ret = dc_consumer_lock(&video_scaled_data->consumer, &video_input_data->circular_buf);
- if (ret < 0) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Video scaler got an end of buffer!\n"));
- return -2;
- }
-
+ //step 1: try to lock output slot. If none available, return ....
if (video_input_data->circular_buf.size > 1)
dc_consumer_unlock_previous(&video_scaled_data->consumer, &video_input_data->circular_buf);
- dc_producer_lock(&video_scaled_data->producer, &video_scaled_data->circular_buf);
+ ret = dc_producer_lock(&video_scaled_data->producer, &video_scaled_data->circular_buf);
+ //not ready
+ if (ret<0) {
+ return -1;
+ }
dc_producer_unlock_previous(&video_scaled_data->producer, &video_scaled_data->circular_buf);
+ //step 2: lock input
+ ret = dc_consumer_lock(&video_scaled_data->consumer, &video_input_data->circular_buf);
+ if (ret < 0) {
+ GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Video scaler got an end of input tbuffer!\n"));
+ return -2;
+ }
+
+ //step 3 - grab source and dest images
video_data_node = (VideoDataNode*)dc_consumer_consume(&video_scaled_data->consumer, &video_input_data->circular_buf);
video_scaled_data_node = (VideoScaledDataNode*)dc_producer_produce(&video_scaled_data->producer, &video_scaled_data->circular_buf);
index = video_data_node->source_number;
@@ -201,11 +210,16 @@ int dc_video_scaler_scale(VideoInputData *video_input_data, VideoScaledData *vid
src_height = video_input_data->vprop[index].height;
}
+
//rescale the cropped frame
- sws_scale(video_scaled_data->vsprop[index].sws_ctx,
- (const uint8_t * const *)src_vframe->data, src_vframe->linesize, 0, src_height,
- video_scaled_data_node->v_frame->data, video_scaled_data_node->v_frame->linesize);
+ ret = sws_scale(video_scaled_data->vsprop[index].sws_ctx,
+ (const uint8_t * const *)src_vframe->data, src_vframe->linesize, 0, src_height,
+ video_scaled_data_node->v_frame->data, video_scaled_data_node->v_frame->linesize);
+ if (!ret) {
+ GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("Video scaler: error while resizing picture.\n"));
+ return -1;
+ }
video_scaled_data_node->v_frame->pts = video_data_node->vframe->pts;
if (video_data_node->nb_raw_frames_ref) {
diff --git a/applications/dashcast/video_scaler.h b/applications/dashcast/video_scaler.h
index b50b9c7..3442e59 100644
--- a/applications/dashcast/video_scaler.h
+++ b/applications/dashcast/video_scaler.h
@@ -51,6 +51,7 @@ typedef struct {
int out_width;
int out_height;
int out_pix_fmt;
+ AVRational sar;
/* scaler of the libav */
//struct SwsContext * sws_ctx;
diff --git a/applications/generators/MPEG4/MPEG4Gen.dsp b/applications/generators/MPEG4/MPEG4Gen.dsp
index e5a7d9c..2339ae7 100644
--- a/applications/generators/MPEG4/MPEG4Gen.dsp
+++ b/applications/generators/MPEG4/MPEG4Gen.dsp
@@ -1,98 +1,98 @@
-# Microsoft Developer Studio Project File - Name="MPEG4Gen" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=MPEG4Gen - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "MPEG4Gen.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "MPEG4Gen.mak" CFG="MPEG4Gen - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "MPEG4Gen - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "MPEG4Gen - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "MPEG4Gen - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Obj/W32Rel"
-# PROP Intermediate_Dir "Obj/W32Rel"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x40c /d "NDEBUG"
-# ADD RSC /l 0x40c /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-
-!ELSEIF "$(CFG)" == "MPEG4Gen - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Obj/W32Deb"
-# PROP Intermediate_Dir "Obj/W32Deb"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x40c /d "_DEBUG"
-# ADD RSC /l 0x40c /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-
-!ENDIF
-
-# Begin Target
-
-# Name "MPEG4Gen - Win32 Release"
-# Name "MPEG4Gen - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\..\..\src\utils\list.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\main.c
-# End Source File
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="MPEG4Gen" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=MPEG4Gen - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "MPEG4Gen.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "MPEG4Gen.mak" CFG="MPEG4Gen - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "MPEG4Gen - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "MPEG4Gen - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "MPEG4Gen - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Obj/W32Rel"
+# PROP Intermediate_Dir "Obj/W32Rel"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "MPEG4Gen - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Obj/W32Deb"
+# PROP Intermediate_Dir "Obj/W32Deb"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x40c /d "_DEBUG"
+# ADD RSC /l 0x40c /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "MPEG4Gen - Win32 Release"
+# Name "MPEG4Gen - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\src\utils\list.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\main.c
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/applications/generators/MPEG4/MPEG4Gen.dsw b/applications/generators/MPEG4/MPEG4Gen.dsw
index e3bd23b..15ce429 100644
--- a/applications/generators/MPEG4/MPEG4Gen.dsw
+++ b/applications/generators/MPEG4/MPEG4Gen.dsw
@@ -1,29 +1,29 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "MPEG4Gen"=.\MPEG4Gen.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "MPEG4Gen"=.\MPEG4Gen.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/applications/generators/MPEG4/main.c b/applications/generators/MPEG4/main.c
index 1715182..a3f7b0e 100644
--- a/applications/generators/MPEG4/main.c
+++ b/applications/generators/MPEG4/main.c
@@ -229,7 +229,7 @@ FILE *BeginFile(char *name, u32 type)
}
}
- f = fopen(sPath, "wt");
+ f = gf_fopen(sPath, "wt");
fprintf(f, "%s\n", cprt);
@@ -258,7 +258,7 @@ void EndFile(FILE *f, char *name, u32 type)
}
fprintf(f, "\n\n#endif\t\t/*_%s_H*/\n\n", name);
}
- fclose(f);
+ gf_fclose(f);
}
void TranslateToken(char *token)
@@ -1624,7 +1624,7 @@ void generate_ndts(GF_List *NDTs, GF_List *nodes, u32 nbVersion)
char szFile[100];
FILE *f;
sprintf(szFile, "NdtListV%d.html", i+1);
- f = fopen(szFile, "wt");
+ f = gf_fopen(szFile, "wt");
fprintf(f, "\n"\
"\n"\
@@ -1684,7 +1684,7 @@ void generate_ndts(GF_List *NDTs, GF_List *nodes, u32 nbVersion)
fprintf(f, "\n");
}
- fclose(f);
+ gf_fclose(f);
}
}
@@ -1715,7 +1715,7 @@ int main (int argc, char **argv)
if (!strcmp(argv[i], "-ndt")) {
generate_ndt = 1;
} else if (argv[i][0]=='-') {
- fskip = fopen(argv[i+1], "rt");
+ fskip = gf_fopen(argv[i+1], "rt");
if (!fskip) {
printf("file %s not found\n", argv[i+1]);
return 0;
@@ -1726,10 +1726,10 @@ int main (int argc, char **argv)
nbVersion=1;
while (1) {
sprintf(szTempFile, "templates%u.txt", nbVersion);
- nodes = fopen(szTempFile, "rt");
+ nodes = gf_fopen(szTempFile, "rt");
if (!nodes) {
sprintf(szTempFile, "template%u.txt", nbVersion);
- nodes = fopen(szTempFile, "rt");
+ nodes = gf_fopen(szTempFile, "rt");
}
if (!nodes) break;
@@ -1740,7 +1740,7 @@ int main (int argc, char **argv)
//special case for viewport: it is present in V1 but empty
if (nbVersion==1) CheckInTable("SFViewportNode", NDTs);
nbVersion++;
- fclose(nodes);
+ gf_fclose(nodes);
}
nbVersion--;
printf("BIFS tables parsed: %d versions\n", nbVersion);
@@ -1752,7 +1752,7 @@ int main (int argc, char **argv)
if (fskip) {
parse_profile(BNodes, fskip);
- fclose(fskip);
+ gf_fclose(fskip);
}
//write the nodes def
diff --git a/applications/generators/SVG/SVGGen.dsp b/applications/generators/SVG/SVGGen.dsp
index c76b774..8d95fcb 100644
--- a/applications/generators/SVG/SVGGen.dsp
+++ b/applications/generators/SVG/SVGGen.dsp
@@ -1,126 +1,126 @@
-# Microsoft Developer Studio Project File - Name="SVGGen" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=SVGGen - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "SVGGen.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "SVGGen.mak" CFG="SVGGen - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "SVGGen - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "SVGGen - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "SVGGen - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x40c /d "NDEBUG"
-# ADD RSC /l 0x40c /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 libxml2.lib zlib.lib iconv.lib /nologo /subsystem:console /machine:I386 /libpath:"../../../extra_lib/lib/w32_release"
-
-!ELSEIF "$(CFG)" == "SVGGen - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include/" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
-# ADD BASE RSC /l 0x40c /d "_DEBUG"
-# ADD RSC /l 0x40c /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 libxml2.lib zlib.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../../../extra_lib/lib/w32_deb"
-
-!ENDIF
-
-# Begin Target
-
-# Name "SVGGen - Win32 Release"
-# Name "SVGGen - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\..\..\src\utils\error.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\html.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\laser.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\src\utils\list.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\main.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\v1.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\v2.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\v3.c
-# End Source File
-# End Group
-# Begin Source File
-
-SOURCE=.\svggen.h
-# End Source File
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="SVGGen" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=SVGGen - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "SVGGen.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "SVGGen.mak" CFG="SVGGen - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "SVGGen - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "SVGGen - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "SVGGen - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 libxml2.lib zlib.lib iconv.lib /nologo /subsystem:console /machine:I386 /libpath:"../../../extra_lib/lib/w32_release"
+
+!ELSEIF "$(CFG)" == "SVGGen - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include/" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
+# ADD BASE RSC /l 0x40c /d "_DEBUG"
+# ADD RSC /l 0x40c /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 libxml2.lib zlib.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../../../extra_lib/lib/w32_deb"
+
+!ENDIF
+
+# Begin Target
+
+# Name "SVGGen - Win32 Release"
+# Name "SVGGen - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\src\utils\error.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\html.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\laser.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\src\utils\list.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\main.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\v1.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\v2.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\v3.c
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\svggen.h
+# End Source File
+# End Target
+# End Project
diff --git a/applications/generators/SVG/SVGGen.dsw b/applications/generators/SVG/SVGGen.dsw
index 1b31b26..170c054 100644
--- a/applications/generators/SVG/SVGGen.dsw
+++ b/applications/generators/SVG/SVGGen.dsw
@@ -1,29 +1,29 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "SVGGen"=.\SVGGen.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "SVGGen"=.\SVGGen.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/applications/generators/SVG/html.c b/applications/generators/SVG/html.c
index 53bf02b..6fdbbee 100644
--- a/applications/generators/SVG/html.c
+++ b/applications/generators/SVG/html.c
@@ -30,7 +30,7 @@ static FILE *BeginHtml()
char sPath[GF_MAX_PATH];
sprintf(sPath, "C:%cUsers%cCyril%ccontent%csvg%cregression%cregression_table.html", GF_PATH_SEPARATOR, GF_PATH_SEPARATOR, GF_PATH_SEPARATOR, GF_PATH_SEPARATOR, GF_PATH_SEPARATOR, GF_PATH_SEPARATOR);
- f = fopen(sPath, "wt");
+ f = gf_fopen(sPath, "wt");
fprintf(f, "\n");
fprintf(f, "\n");
@@ -55,7 +55,7 @@ static void EndHtml(FILE *f)
{
fprintf(f, "\n");
fprintf(f, "\n");
- fclose(f);
+ gf_fclose(f);
}
/* Generates an HTML table */
diff --git a/applications/generators/SVG/laser.c b/applications/generators/SVG/laser.c
index 376bef3..3fc8a31 100644
--- a/applications/generators/SVG/laser.c
+++ b/applications/generators/SVG/laser.c
@@ -263,5 +263,5 @@ void generate_laser_tables_da(GF_List *atts)
}
fprintf(output, "\treturn 1;\n}\n\n");
- fclose(output);
+ gf_fclose(output);
}
\ No newline at end of file
diff --git a/applications/generators/SVG/main.c b/applications/generators/SVG/main.c
index 668c701..3a393d8 100644
--- a/applications/generators/SVG/main.c
+++ b/applications/generators/SVG/main.c
@@ -805,7 +805,7 @@ FILE *BeginFile(u32 type)
#endif
}
- f = fopen(sPath, "wt");
+ f = gf_fopen(sPath, "wt");
fprintf(f, "%s\n", COPYRIGHT);
{
@@ -840,7 +840,7 @@ void EndFile(FILE *f, u32 type)
} else {
fprintf(f, "\n");
}
- fclose(f);
+ gf_fclose(f);
}
void generateAttributes(FILE *output, GF_List *attributes, Bool inDefine)
diff --git a/applications/generators/X3D/X3DGen.dsp b/applications/generators/X3D/X3DGen.dsp
index 7afd243..b16b8dd 100644
--- a/applications/generators/X3D/X3DGen.dsp
+++ b/applications/generators/X3D/X3DGen.dsp
@@ -1,98 +1,98 @@
-# Microsoft Developer Studio Project File - Name="X3DGen" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=X3DGen - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "X3DGen.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "X3DGen.mak" CFG="X3DGen - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "X3DGen - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "X3DGen - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "X3DGen - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x40c /d "NDEBUG"
-# ADD RSC /l 0x40c /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-
-!ELSEIF "$(CFG)" == "X3DGen - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Obj/W32Deb"
-# PROP Intermediate_Dir "Obj/W32Deb"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x40c /d "_DEBUG"
-# ADD RSC /l 0x40c /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-
-!ENDIF
-
-# Begin Target
-
-# Name "X3DGen - Win32 Release"
-# Name "X3DGen - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\..\..\src\utils\list.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\main.c
-# End Source File
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="X3DGen" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=X3DGen - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "X3DGen.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "X3DGen.mak" CFG="X3DGen - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "X3DGen - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "X3DGen - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "X3DGen - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "X3DGen - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Obj/W32Deb"
+# PROP Intermediate_Dir "Obj/W32Deb"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x40c /d "_DEBUG"
+# ADD RSC /l 0x40c /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "X3DGen - Win32 Release"
+# Name "X3DGen - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\src\utils\list.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\main.c
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/applications/generators/X3D/X3DGen.dsw b/applications/generators/X3D/X3DGen.dsw
index 2aca071..2c265c5 100644
--- a/applications/generators/X3D/X3DGen.dsw
+++ b/applications/generators/X3D/X3DGen.dsw
@@ -1,29 +1,29 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "X3DGen"=.\X3DGen.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "X3DGen"=.\X3DGen.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/applications/generators/X3D/main.c b/applications/generators/X3D/main.c
index ecd6a29..339819a 100644
--- a/applications/generators/X3D/main.c
+++ b/applications/generators/X3D/main.c
@@ -180,7 +180,7 @@ FILE *BeginFile(u32 type)
sprintf(sPath, "..%c..%c..%csrc%cscenegraph%cx3d_nodes.c", GF_PATH_SEPARATOR, GF_PATH_SEPARATOR, GF_PATH_SEPARATOR, GF_PATH_SEPARATOR, GF_PATH_SEPARATOR);
}
- f = fopen(sPath, "wt");
+ f = gf_fopen(sPath, "wt");
fprintf(f, "%s\n", COPYRIGHT);
{
@@ -203,7 +203,7 @@ void EndFile(FILE *f, u32 type)
fprintf(f, "#ifdef __cplusplus\n}\n#endif\n\n");
fprintf(f, "\n\n#endif\t\t/*_GF_X3D_NODES_H*/\n\n");
}
- fclose(f);
+ gf_fclose(f);
}
void TranslateToken(char *token)
@@ -1208,7 +1208,7 @@ int main (int argc, char **argv)
X3DField *bf;
u32 nb_nodes, nb_imp;
- nodes = fopen("templates_X3D.txt", "rt");
+ nodes = gf_fopen("templates_X3D.txt", "rt");
if (!nodes) {
fprintf(stdout, "cannot open \"templates_X3D.txt\" - aborting\n");
return 0;
@@ -1218,14 +1218,14 @@ int main (int argc, char **argv)
NDTs = gf_list_new();
//all nodes are in the same list but we keep version info
ParseTemplateFile(nodes, XNodes, NDTs);
- fclose(nodes);
+ gf_fclose(nodes);
if (argc>1) {
- pf = fopen(argv[1], "rt");
+ pf = gf_fopen(argv[1], "rt");
if (!pf) fprintf(stdout, "Cannot open profile file %s\n", argv[1]);
else {
parse_profile(XNodes, pf);
- fclose(pf);
+ gf_fclose(pf);
}
}
diff --git a/applications/m3u82mpd/m3u82mpd.vcproj b/applications/m3u82mpd/m3u82mpd.vcproj
index 1887aca..b139419 100644
--- a/applications/m3u82mpd/m3u82mpd.vcproj
+++ b/applications/m3u82mpd/m3u82mpd.vcproj
@@ -1,183 +1,183 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/applications/m3u82mpd/main.c b/applications/m3u82mpd/main.c
index 5621030..2c161d5 100644
--- a/applications/m3u82mpd/main.c
+++ b/applications/m3u82mpd/main.c
@@ -58,7 +58,7 @@ int main(int argc, char **argv)
e = parse_root_playlist(m3u8_local_name, &pl, ".");
if (e != GF_OK) return -1;
- fmpd = fopen(argv[2], "wt");
+ fmpd = gf_fopen(argv[2], "wt");
fprintf(fmpd, "\n");
fprintf(fmpd, " \n");
@@ -111,7 +111,7 @@ int main(int argc, char **argv)
}
fprintf(fmpd, " \n");
fprintf(fmpd, "");
- fclose(fmpd);
+ gf_fclose(fmpd);
variant_playlist_del(pl);
if (is_local) break;
gf_sleep(update_interval);
diff --git a/applications/mp42avi/main.c b/applications/mp42avi/main.c
index 06403bf..4b6c057 100644
--- a/applications/mp42avi/main.c
+++ b/applications/mp42avi/main.c
@@ -148,7 +148,7 @@ void write_bmp(GF_VideoSurface *fb, char *rad_name, u32 img_num)
sprintf(str, "%s_%d.bmp", rad_name, img_num);
}
- fout = fopen(str, "wb");
+ fout = gf_fopen(str, "wb");
if (!fout) return;
memset(&fh, 0, sizeof(fh));
@@ -184,7 +184,7 @@ void write_bmp(GF_VideoSurface *fb, char *rad_name, u32 img_num)
}
}
- fclose(fout);
+ gf_fclose(fout);
}
@@ -200,10 +200,10 @@ void write_raw(GF_VideoSurface *fb, char *rad_name, u32 img_num)
sprintf(str, "%s_%d.raw", rad_name, img_num);
}
- fout = fopen(str, "wb");
+ fout = gf_fopen(str, "wb");
if (!fout) return;
gf_fwrite(fb->video_buffer , fb->height*fb->pitch, 1, fout);
- fclose(fout);
+ gf_fclose(fout);
}
void dump_frame(BIFSVID b2v, char *conv_buf, char *out_path, u32 dump_type, avi_t *avi_out, u32 frameNum)
@@ -365,9 +365,9 @@ void bifs3d_viewpoints_merger(GF_ISOFile *file, char *szConfigFile, u32 width, u
for (viewpoint_index = 1; viewpoint_index <= nb_viewpoints; viewpoint_index++) {
GF_SAFEALLOC(rendered_frames[viewpoint_index-1], fb.width*fb.height*3);
gf_sc_set_viewpoint(b2v.sr, viewpoint_index, NULL);
- gf_sc_draw_frame(b2v.sr);
+ gf_sc_draw_frame(b2v.sr, 0, NULL);
/*needed for background2D !!*/
- gf_sc_draw_frame(b2v.sr);
+ gf_sc_draw_frame(b2v.sr, 0, NULL);
strcpy(out_path, "");
if (out_dir) {
strcat(out_path, out_dir);
@@ -583,7 +583,7 @@ void bifs_to_vid(GF_ISOFile *file, char *szConfigFile, u32 width, u32 height, ch
}
gf_sc_set_size(b2v.sr, width, height);
- gf_sc_draw_frame(b2v.sr);
+ gf_sc_draw_frame(b2v.sr, 0, NULL);
gf_sc_get_screen_buffer(b2v.sr, &fb);
width = fb.width;
@@ -613,10 +613,10 @@ void bifs_to_vid(GF_ISOFile *file, char *szConfigFile, u32 width, u32 height, ch
if ((frameID>=0) && (j<(u32)frameID)) continue;
if ((dump_time>=0) && ((u32) dump_time>b2v.cts)) continue;
/*render frame*/
- gf_sc_draw_frame(b2v.sr);
+ gf_sc_draw_frame(b2v.sr, 0, NULL);
/*needed for background2D !!*/
if (first_dump) {
- gf_sc_draw_frame(b2v.sr);
+ gf_sc_draw_frame(b2v.sr, 0, NULL);
first_dump = 0;
}
diff --git a/applications/mp42ts/Makefile b/applications/mp42ts/Makefile
index 3e79f20..c8b88db 100644
--- a/applications/mp42ts/Makefile
+++ b/applications/mp42ts/Makefile
@@ -20,10 +20,10 @@ OBJS= main.o
LINKFLAGS=-L../../bin/gcc
ifeq ($(CONFIG_WIN32),yes)
EXE=.exe
-PROG=mp42ts$(EXE)
+PROG=MP42TS$(EXE)
else
EXT=
-PROG=mp42ts
+PROG=MP42TS
endif
LINKFLAGS+=-lgpac
diff --git a/applications/mp42ts/main.c b/applications/mp42ts/main.c
index b430b6b..eba445d 100644
--- a/applications/mp42ts/main.c
+++ b/applications/mp42ts/main.c
@@ -40,25 +40,17 @@
#include
#endif
-#ifdef GPAC_DISABLE_ISOM
-
-#error "Cannot compile MP42TS if GPAC is not built with ISO File Format support"
-
-#endif
#ifdef GPAC_DISABLE_MPEG2TS_MUX
-
#error "Cannot compile MP42TS if GPAC is not built with MPEG2-TS Muxing support"
-
#endif
-
-#define UDP_BUFFER_SIZE 0x40000
-
#define MP42TS_PRINT_TIME_MS 500 /*refresh printed info every CLOCK_REFRESH ms*/
#define MP42TS_VIDEO_FREQ 1000 /*meant to send AVC IDR only every CLOCK_REFRESH ms*/
u32 temi_url_insertion_delay = 1000;
+u32 temi_offset = 0;
+Bool temi_disable_loop = 0;
FILE *logfile = NULL;
static void on_gpac_log(void *cbk, u32 ll, u32 lm, const char *fmt, va_list list)
@@ -74,7 +66,7 @@ static GFINLINE void usage()
"GPAC Copyright (c) Telecom ParisTech 2000-2014\n"
"GPAC Configuration: " GPAC_CONFIGURATION "\n"
"Features: %s\n\n", gpac_features());
- fprintf(stderr, "mp2ts [options]\n"
+ fprintf(stderr, "mp42ts [options]\n"
"\n"
"Inputs:\n"
"-src filename[:OPTS] specifies an input file used for a TS service\n"
@@ -110,19 +102,21 @@ static GFINLINE void usage()
"-pcr-init V sets initial value V for PCR - if not set, random value is used\n"
"-pcr-offset V offsets all timestamps from PCR by V, in 90kHz. Default value is computed based on input media.\n"
"-psi-rate V sets PSI refresh rate V in ms (default 100ms).\n"
- " * If 0, PSI data is only send once at the begining or before each IDR when -rap option is set.\n"
+ " * If 0, PSI data is only send once at the beginning or before each IDR when -rap option is set.\n"
" * This should be set to 0 for DASH streams.\n"
"-time n request the muxer to stop after n ms\n"
"-single-au forces 1 PES = 1 AU (disabled by default)\n"
"-rap forces RAP/IDR to be aligned with PES start for video streams (disabled by default)\n"
" in this mode, PAT, PMT and PCR will be inserted before the first TS packet of the RAP PES\n"
"-flush-rap same as -rap but flushes all other streams (sends remaining PES packets) before inserting PAT/PMT\n"
- "-nb-pack N specifies to pack N TS packets together before sending on network or writing to file\n"
+ "-nb-pack N specifies to pack up to N TS packets together before sending on network or writing to file\n"
"-pcr-ms N sets max interval in ms between 2 PCR. Default is 100 ms\n"
"-ttl N specifies Time-To-Live for multicast. Default is 1.\n"
"-ifce IPIFCE specifies default IP interface to use. Default is IF_ANY.\n"
"-temi [URL] Inserts TEMI time codes in adaptation field. URL is optionnal\n"
- "-temi-delay DelayMS Specifies delay between two TEMI url descriptors\n"
+ "-temi-delay DelayMS Specifies delay between two TEMI url descriptors (default is 1000)\n"
+ "-temi-offset OffsetMS Specifies an offset in ms to add to TEMI (by default TEMI starts at 0)\n"
+ "-temi-noloop Do not restart the TEMI timeline at the end of the source\n"
"-sdt-rate MS Gives the SDT carrousel rate in milliseconds. If 0 (default), SDT is not sent\n"
"\n"
"MPEG-4/T-DMB options:\n"
@@ -149,7 +143,11 @@ static GFINLINE void usage()
#define MAX_MUX_SRC_PROG 100
typedef struct
{
+
+#ifndef GPAC_DISABLE_ISOM
GF_ISOFile *mp4;
+#endif
+
u32 nb_streams, pcr_idx;
GF_ESInterface streams[40];
GF_Descriptor *iod;
@@ -177,6 +175,7 @@ typedef struct
Double last_ntp;
} M2TSSource;
+#ifndef GPAC_DISABLE_ISOM
typedef struct
{
GF_ISOFile *mp4;
@@ -196,8 +195,11 @@ typedef struct
const char *temi_url;
u32 last_temi_url;
+ Bool insert_temi;
+ Bool insert_ntp;
} GF_ESIMP4;
+#endif
typedef struct
{
@@ -249,19 +251,18 @@ static u32 format_af_descriptor(char *af_data, u64 timecode, u32 timescale, u64
} else {
last_time = (u32) (1000*timecode/timescale);
}
- if (!*last_url_time || (last_time - *last_url_time + 1 >= temi_url_insertion_delay) ) {
+ if (temi_url && (!*last_url_time || (last_time - *last_url_time + 1 >= temi_url_insertion_delay)) ) {
*last_url_time = last_time + 1;
len = 0;
- gf_bs_write_int(bs, 0x00, 8);
+ gf_bs_write_int(bs, GF_M2TS_AFDESC_LOCATION_DESCRIPTOR, 8);
gf_bs_write_int(bs, len, 8);
gf_bs_write_int(bs, 0, 1); //force_reload
gf_bs_write_int(bs, 0, 1); //is_announcement
gf_bs_write_int(bs, 0, 1); //splicing_flag
- gf_bs_write_int(bs, strlen(temi_url) ? 0 : 1, 1); //external_url
gf_bs_write_int(bs, 0, 1); //use_base_temi_url
- gf_bs_write_int(bs, 0xFF, 3); //reserved
- gf_bs_write_int(bs, 0, 8); //timeline_id
+ gf_bs_write_int(bs, 0xFF, 5); //reserved
+ gf_bs_write_int(bs, 0, 7); //timeline_id
if (strlen(temi_url)) {
char *url = (char *)temi_url;
@@ -284,16 +285,17 @@ static u32 format_af_descriptor(char *af_data, u64 timecode, u32 timescale, u64
}
if (timescale || ntp) {
+ Bool use64 = (timecode > 0xFFFFFFFFUL) ? 1 : 0;
len = 3; //3 bytes flags
- if (timescale) len += 4 + ((timecode > 0xFFFFFFFFUL) ? 8 : 4);
+ if (timescale) len += 4 + (use64 ? 8 : 4);
if (ntp) len += 8;
//write timeline descriptor
- gf_bs_write_int(bs, 0x01, 8);
+ gf_bs_write_int(bs, GF_M2TS_AFDESC_TIMELINE_DESCRIPTOR, 8);
gf_bs_write_int(bs, len, 8);
- gf_bs_write_int(bs, timescale ? ((timecode > 0xFFFFFFUL) ? 2 : 1) : 0, 2); //has_timestamp
+ gf_bs_write_int(bs, timescale ? (use64 ? 2 : 1) : 0, 2); //has_timestamp
gf_bs_write_int(bs, ntp ? 1 : 0, 1); //has_ntp
gf_bs_write_int(bs, 0, 1); //has_ptp
gf_bs_write_int(bs, 0, 2); //has_timecode
@@ -301,10 +303,10 @@ static u32 format_af_descriptor(char *af_data, u64 timecode, u32 timescale, u64
gf_bs_write_int(bs, 0, 1); //paused
gf_bs_write_int(bs, 0, 1); //discontinuity
gf_bs_write_int(bs, 0xFF, 7); //reserved
- gf_bs_write_int(bs, 0, 8); //timeline_id
+ gf_bs_write_int(bs, temi_url ? 0 : 150, 8); //timeline_id
if (timescale) {
gf_bs_write_u32(bs, timescale); //timescale
- if (timecode > 0xFFFFFFUL)
+ if (use64)
gf_bs_write_u64(bs, timecode); //timestamp
else
gf_bs_write_u32(bs, (u32) timecode); //timestamp
@@ -318,6 +320,8 @@ static u32 format_af_descriptor(char *af_data, u64 timecode, u32 timescale, u64
return res;
}
+#ifndef GPAC_DISABLE_ISOM
+
static GF_Err mp4_input_ctrl(GF_ESInterface *ifce, u32 act_type, void *param)
{
char af_data[188];
@@ -345,8 +349,25 @@ static GF_Err mp4_input_ctrl(GF_ESInterface *ifce, u32 act_type, void *param)
pck.cts = priv->sample->DTS + priv->ts_offset;
if (priv->is_repeat) pck.flags |= GF_ESI_DATA_REPEAT;
- if (priv->temi_url) {
- pck.mpeg2_af_descriptors_size = format_af_descriptor(af_data, priv->sample->DTS + priv->sample->CTS_Offset, ifce->timescale, 0, priv->temi_url, &priv->last_temi_url);
+ if (priv->insert_temi) {
+ u64 ntp=0;
+ u64 tc = priv->sample->DTS + priv->sample->CTS_Offset;
+ if (temi_disable_loop) {
+ tc += priv->ts_offset;
+ }
+
+ if (temi_offset) {
+ tc += ((u64) temi_offset) * ifce->timescale / 1000;
+ }
+
+ if (priv->insert_ntp) {
+ u32 sec, frac;
+ gf_net_get_ntp(&sec, &frac);
+ ntp = sec;
+ ntp <<= 32;
+ ntp |= frac;
+ }
+ pck.mpeg2_af_descriptors_size = format_af_descriptor(af_data, tc, ifce->timescale, ntp, priv->temi_url, &priv->last_temi_url);
pck.mpeg2_af_descriptors = af_data;
}
@@ -459,7 +480,7 @@ static GF_Err mp4_input_ctrl(GF_ESInterface *ifce, u32 act_type, void *param)
static void fill_isom_es_ifce(M2TSSource *source, GF_ESInterface *ifce, GF_ISOFile *mp4, u32 track_num, u32 bifs_use_pes, Bool compute_max_size)
{
GF_ESIMP4 *priv;
- char _lan[4];
+ char *_lan;
GF_ESD *esd;
u64 avg_rate, duration;
s32 ref_count;
@@ -512,11 +533,15 @@ static void fill_isom_es_ifce(M2TSSource *source, GF_ESInterface *ifce, GF_ISOFi
}
gf_odf_desc_del((GF_Descriptor *)esd);
}
- gf_isom_get_media_language(mp4, track_num, _lan);
- if (!strcmp(_lan, "und"))
+ gf_isom_get_media_language(mp4, track_num, &_lan);
+ if (!_lan || !strcmp(_lan, "und")) {
ifce->lang = 0;
- else
+ } else {
ifce->lang = GF_4CC(_lan[0],_lan[1],_lan[2],' ');
+ }
+ if (_lan) {
+ gf_free(_lan);
+ }
ifce->timescale = gf_isom_get_media_timescale(mp4, track_num);
ifce->duration = gf_isom_get_media_timescale(mp4, track_num);
@@ -573,7 +598,6 @@ static void fill_isom_es_ifce(M2TSSource *source, GF_ESInterface *ifce, GF_ISOFi
ifce->depends_on_stream = 0;
}
- source->max_sample_size = 0;
if (compute_max_size) {
u32 i;
for (i=0; i < priv->sample_count; i++) {
@@ -584,6 +608,8 @@ static void fill_isom_es_ifce(M2TSSource *source, GF_ESInterface *ifce, GF_ISOFi
}
+#endif //GPAC_DISABLE_ISOM
+
#ifndef GPAC_DISABLE_SENG
static GF_Err seng_input_ctrl(GF_ESInterface *ifce, u32 act_type, void *param)
@@ -900,10 +926,12 @@ static void fill_rtp_es_ifce(GF_ESInterface *ifce, GF_SDPMedia *media, GF_SDPInf
}
#endif /*GPAC_DISABLE_STREAMING*/
+#ifndef GPAC_DISABLE_SENG
static GF_Err void_input_ctrl(GF_ESInterface *ifce, u32 act_type, void *param)
{
return GF_OK;
}
+#endif
/*AAC import features*/
#ifndef GPAC_DISABLE_PLAYER
@@ -1182,13 +1210,13 @@ static u32 seng_output(void *param)
fprintf(stderr, "Update file modified - processing\n");
last_src_modif = mod_time;
- srcf = gf_f64_open(source->bifs_src_name, "rt");
+ srcf = gf_fopen(source->bifs_src_name, "rt");
if (!srcf) continue;
/*checks if we have a broadcast config*/
if (!fgets(flag_buf, 200, srcf))
flag_buf[0] = '\0';
- fclose(srcf);
+ gf_fclose(srcf);
aggregate_au = force_rap = adjust_carousel_time = discard_pending = signal_rap = signal_critical = 0;
version_inc = 1;
@@ -1349,19 +1377,20 @@ void fill_seng_es_ifce(GF_ESInterface *ifce, u32 i, GF_SceneEngine *seng, u32 pe
}
#endif
-static Bool open_source(M2TSSource *source, char *src, u32 carousel_rate, u32 mpeg4_signaling, char *update, char *audio_input_ip, u16 audio_input_port, char *video_buffer, Bool force_real_time, u32 bifs_use_pes, const char *temi_url, Bool compute_max_size)
+static Bool open_source(M2TSSource *source, char *src, u32 carousel_rate, u32 mpeg4_signaling, char *update, char *audio_input_ip, u16 audio_input_port, char *video_buffer, Bool force_real_time, u32 bifs_use_pes, const char *temi_url, Bool compute_max_size, Bool insert_ntp)
{
#ifndef GPAC_DISABLE_STREAMING
GF_SDPInfo *sdp;
#endif
- u32 i;
s64 min_offset = 0;
memset(source, 0, sizeof(M2TSSource));
source->mpeg4_signaling = mpeg4_signaling;
/*open ISO file*/
+#ifndef GPAC_DISABLE_ISOM
if (gf_isom_probe_file(src)) {
+ u32 i;
u32 nb_tracks;
Bool has_bifs_od = 0;
u32 first_audio = 0;
@@ -1404,7 +1433,13 @@ static Bool open_source(M2TSSource *source, char *src, u32 carousel_rate, u32 mp
/*get first visual stream as PCR*/
if (!source->pcr_idx) {
source->pcr_idx = i+1;
- ((GF_ESIMP4 *)source->streams[i].input_udta)->temi_url = temi_url;
+ if (temi_url) {
+ ((GF_ESIMP4 *)source->streams[i].input_udta)->insert_temi = GF_TRUE;
+ if (insert_ntp)
+ ((GF_ESIMP4 *)source->streams[i].input_udta)->insert_ntp = GF_TRUE;
+ if (strcmp(temi_url, "NOTEMIURL"))
+ ((GF_ESIMP4 *)source->streams[i].input_udta)->temi_url = temi_url;
+ }
}
}
break;
@@ -1515,26 +1550,28 @@ static Bool open_source(M2TSSource *source, char *src, u32 carousel_rate, u32 mp
}
return 1;
}
+#endif
+
#ifndef GPAC_DISABLE_STREAMING
/*open SDP file*/
if (strstr(src, ".sdp")) {
GF_X_Attribute *att;
char *sdp_buf;
- u32 sdp_size;
+ u32 sdp_size, i;
GF_Err e;
- FILE *_sdp = fopen(src, "rt");
+ FILE *_sdp = gf_fopen(src, "rt");
if (!_sdp) {
fprintf(stderr, "Error opening %s - no such file\n", src);
return 0;
}
- gf_f64_seek(_sdp, 0, SEEK_END);
- sdp_size = (u32)gf_f64_tell(_sdp);
- gf_f64_seek(_sdp, 0, SEEK_SET);
+ gf_fseek(_sdp, 0, SEEK_END);
+ sdp_size = (u32)gf_ftell(_sdp);
+ gf_fseek(_sdp, 0, SEEK_SET);
sdp_buf = (char*)gf_malloc(sizeof(char)*sdp_size);
memset(sdp_buf, 0, sizeof(char)*sdp_size);
sdp_size = (u32) fread(sdp_buf, 1, sdp_size, _sdp);
- fclose(_sdp);
+ gf_fclose(_sdp);
sdp = gf_sdp_info_new();
e = gf_sdp_info_parse(sdp, sdp_buf, sdp_size);
@@ -1592,6 +1629,7 @@ static Bool open_source(M2TSSource *source, char *src, u32 carousel_rate, u32 mp
#ifndef GPAC_DISABLE_SENG
if (strstr(src, ".bt")) //open .bt file
{
+ u32 i;
u32 load_type=0;
source->seng = gf_seng_init(source, src, load_type, NULL, (load_type == GF_SM_LOAD_DIMS) ? 1 : 0);
if (!source->seng) {
@@ -1733,9 +1771,9 @@ static Bool open_source(M2TSSource *source, char *src, u32 carousel_rate, u32 mp
} else
#endif
{
- FILE *f = fopen(src, "rt");
+ FILE *f = gf_fopen(src, "rt");
if (f) {
- fclose(f);
+ gf_fclose(f);
fprintf(stderr, "Error opening %s - not a supported input media, skipping.\n", src);
} else {
fprintf(stderr, "Error opening %s - no such file.\n", src);
@@ -1744,6 +1782,10 @@ static Bool open_source(M2TSSource *source, char *src, u32 carousel_rate, u32 mp
}
}
+#ifdef GPAC_MEMORY_TRACKING
+static Bool enable_mem_tracker = GF_FALSE;
+#endif
+
/*macro to keep retro compatibility with '=' and spaces in parse_args*/
#define CHECK_PARAM(param) (!strnicmp(arg, param, strlen(param)) \
&& ( ((arg[strlen(param)] == '=') && (next_arg = arg+strlen(param)+1)) \
@@ -1758,7 +1800,7 @@ static GFINLINE GF_Err parse_args(int argc, char **argv, u32 *mux_rate, u32 *car
char** segment_dir, u32 *segment_duration, char **segment_manifest, u32 *segment_number, char **segment_http_prefix, u32 *split_rap, u32 *nb_pck_pack, u32 *pcr_ms, u32 *ttl, const char **ip_ifce, const char **temi_url, u32 *sdt_refresh_rate)
{
Bool rate_found=0, mpeg4_carousel_found=0, time_found=0, src_found=0, dst_found=0, audio_input_found=0, video_input_found=0,
- seg_dur_found=0, seg_dir_found=0, seg_manifest_found=0, seg_number_found=0, seg_http_found=0, real_time_found=0;
+ seg_dur_found=0, seg_dir_found=0, seg_manifest_found=0, seg_number_found=0, seg_http_found=0, real_time_found=0, insert_ntp=0;
char *arg = NULL, *next_arg = NULL, *error_msg = "no argument found";
u32 mpeg4_signaling = GF_M2TS_MPEG4_SIGNALING_NONE;
Bool force_real_time = 0;
@@ -1785,14 +1827,14 @@ static GFINLINE GF_Err parse_args(int argc, char **argv, u32 *mux_rate, u32 *car
goto error;
}
video_input_found = 1;
- f = fopen(next_arg, "rb");
+ f = gf_fopen(next_arg, "rb");
if (!f) {
error_msg = "video file not found: ";
goto error;
}
- gf_f64_seek(f, 0, SEEK_END);
- *video_buffer_size = (u32)gf_f64_tell(f);
- gf_f64_seek(f, 0, SEEK_SET);
+ gf_fseek(f, 0, SEEK_END);
+ *video_buffer_size = (u32)gf_ftell(f);
+ gf_fseek(f, 0, SEEK_SET);
assert(*video_buffer_size);
*video_buffer = (char*) gf_malloc(*video_buffer_size);
{
@@ -1800,7 +1842,7 @@ static GFINLINE GF_Err parse_args(int argc, char **argv, u32 *mux_rate, u32 *car
if (read != *video_buffer_size)
fprintf(stderr, "Error while reading video file, has readen %u chars instead of %u.\n", read, *video_buffer_size);
}
- fclose(f);
+ gf_fclose(f);
} else if (CHECK_PARAM("-audio")) {
if (audio_input_found) {
error_msg = "multiple '-audio' found";
@@ -1858,6 +1900,7 @@ static GFINLINE GF_Err parse_args(int argc, char **argv, u32 *mux_rate, u32 *car
} else if (!strcmp(arg, "-mem-track")) {
#ifdef GPAC_MEMORY_TRACKING
gf_sys_close();
+ enable_mem_tracker = GF_TRUE;
gf_sys_init(GF_TRUE);
gf_log_set_tool_level(GF_LOG_MEMORY, GF_LOG_INFO);
#else
@@ -1916,7 +1959,7 @@ static GFINLINE GF_Err parse_args(int argc, char **argv, u32 *mux_rate, u32 *car
if (gf_log_set_tools_levels(next_arg) != GF_OK)
return GF_BAD_PARAM;
} else if (CHECK_PARAM("-lf")) {
- logfile = gf_f64_open(next_arg, "wt");
+ logfile = gf_fopen(next_arg, "wt");
gf_log_set_callback(logfile, on_gpac_log);
} else if (CHECK_PARAM("-segment-dir")) {
if (seg_dir_found) {
@@ -1931,19 +1974,19 @@ static GFINLINE GF_Err parse_args(int argc, char **argv, u32 *mux_rate, u32 *car
}
seg_dur_found = 1;
*segment_duration = atoi(next_arg);
- } else if (CHECK_PARAM("-segment-manifest=")) {
+ } else if (CHECK_PARAM("-segment-manifest")) {
if (seg_manifest_found) {
goto error;
}
seg_manifest_found = 1;
*segment_manifest = next_arg;
- } else if (CHECK_PARAM("-segment-http-prefix=")) {
+ } else if (CHECK_PARAM("-segment-http-prefix")) {
if (seg_http_found) {
goto error;
}
seg_http_found = 1;
*segment_http_prefix = next_arg;
- } else if (CHECK_PARAM("-segment-number=")) {
+ } else if (CHECK_PARAM("-segment-number")) {
if (seg_number_found) {
goto error;
}
@@ -1961,11 +2004,13 @@ static GFINLINE GF_Err parse_args(int argc, char **argv, u32 *mux_rate, u32 *car
} else if (CHECK_PARAM("-dst-file")) {
dst_found = 1;
*ts_out = gf_strdup(next_arg);
- } else if (!strnicmp(arg, "-temi", 5)) {
- *temi_url = "";
- if (arg[5]=='=' || arg[5]==' ') {
- *temi_url = arg+6;
- if (strlen(arg+6) > 150) {
+ } else if (CHECK_PARAM("-temi")) {
+ if (next_arg[0]=='-') {
+ *temi_url = "NOTEMIURL";
+ i--;
+ } else {
+ *temi_url = next_arg;
+ if (strlen(next_arg) > 150) {
fprintf(stderr, "URLs longer than 150 bytes are not currently supported\n");
return GF_NOT_SUPPORTED;
}
@@ -1973,6 +2018,12 @@ static GFINLINE GF_Err parse_args(int argc, char **argv, u32 *mux_rate, u32 *car
}
else if (CHECK_PARAM("-temi-delay")) {
temi_url_insertion_delay = atoi(next_arg);
+ } else if (CHECK_PARAM("-temi-offset")) {
+ temi_offset = atoi(next_arg);
+ } else if (!stricmp(arg, "-temi-noloop")) {
+ temi_disable_loop = 1;
+ } else if (!stricmp(arg, "-insert-ntp")) {
+ insert_ntp = GF_TRUE;
}
else if (CHECK_PARAM("-dst-udp")) {
char *sep = strchr(next_arg, ':');
@@ -2028,7 +2079,7 @@ static GFINLINE GF_Err parse_args(int argc, char **argv, u32 *mux_rate, u32 *car
src_args = src_args + 1;
}
- res = open_source(&sources[*nb_sources], next_arg, *carrousel_rate, mpeg4_signaling, *bifs_src_name, *audio_input_ip, *audio_input_port, *video_buffer, force_real_time, *bifs_use_pes, *temi_url, (*pcr_offset == (u32) -1) ? 1 : 0);
+ res = open_source(&sources[*nb_sources], next_arg, *carrousel_rate, mpeg4_signaling, *bifs_src_name, *audio_input_ip, *audio_input_port, *video_buffer, force_real_time, *bifs_use_pes, *temi_url, (*pcr_offset == (u32) -1) ? 1 : 0, insert_ntp);
//we may have arguments
@@ -2101,7 +2152,7 @@ static GF_Err write_manifest(char *manifest, char *segment_dir, u32 segment_dura
sprintf(manifest_name, "%s", manifest);
}
- manifest_fp = fopen(tmp_manifest, "w");
+ manifest_fp = gf_fopen(tmp_manifest, "w");
if (!manifest_fp) {
fprintf(stderr, "Could not create m3u8 manifest file (%s)\n", tmp_manifest);
return GF_BAD_PARAM;
@@ -2116,7 +2167,7 @@ static GF_Err write_manifest(char *manifest, char *segment_dir, u32 segment_dura
if (end) {
fprintf(manifest_fp, "#EXT-X-ENDLIST\n");
}
- fclose(manifest_fp);
+ gf_fclose(manifest_fp);
if (!rename(tmp_manifest, manifest_name)) {
return GF_OK;
@@ -2243,16 +2294,17 @@ int main(int argc, char **argv)
/* create mp42ts muxer */
/***************************/
muxer = gf_m2ts_mux_new(mux_rate, psi_refresh_rate, real_time);
- if (muxer) gf_m2ts_mux_use_single_au_pes_mode(muxer, single_au_pes);
+ if (!muxer) {
+ fprintf(stderr, "Could not create the muxer. Aborting.\n");
+ goto exit;
+ }
+ gf_m2ts_mux_use_single_au_pes_mode(muxer, single_au_pes);
if (pcr_init_val>=0) gf_m2ts_mux_set_initial_pcr(muxer, (u64) pcr_init_val);
gf_m2ts_mux_set_pcr_max_interval(muxer, pcr_ms);
if (ts_out != NULL) {
if (segment_duration) {
- char *dot;
strcpy(segment_prefix, ts_out);
- dot = strrchr(segment_prefix, '.');
- dot[0] = 0;
if (segment_dir) {
if (strchr("\\/", segment_name[strlen(segment_name)-1])) {
sprintf(segment_name, "%s%s_%d.ts", segment_dir, segment_prefix, segment_index);
@@ -2273,7 +2325,7 @@ int main(int argc, char **argv)
ts_output_file = stdout;
is_stdout = GF_TRUE;
} else {
- ts_output_file = fopen(ts_out, "wb");
+ ts_output_file = gf_fopen(ts_out, "wb");
is_stdout = GF_FALSE;
}
if (!ts_output_file) {
@@ -2510,7 +2562,7 @@ call_flush:
gf_fwrite(ts_pck, 1, 188 * nb_pck_in_pack, ts_output_file);
if (segment_duration && (muxer->time.sec > prev_seg_time.sec + segment_duration)) {
prev_seg_time = muxer->time;
- fclose(ts_output_file);
+ gf_fclose(ts_output_file);
segment_index++;
if (segment_dir) {
if (strchr("\\/", segment_name[strlen(segment_name)-1])) {
@@ -2521,7 +2573,7 @@ call_flush:
} else {
sprintf(segment_name, "%s_%d.ts", segment_prefix, segment_index);
}
- ts_output_file = fopen(segment_name, "wb");
+ ts_output_file = gf_fopen(segment_name, "wb");
if (!ts_output_file) {
fprintf(stderr, "Error opening %s\n", segment_name);
goto exit;
@@ -2595,7 +2647,7 @@ call_flush:
u32 now=gf_sys_clock();
if (now > last_print_time + MP42TS_PRINT_TIME_MS) {
last_print_time = now;
- fprintf(stderr, "M2TS: time %d - TS time %d - avg bitrate %d\r", gf_m2ts_get_sys_clock(muxer), gf_m2ts_get_ts_clock(muxer), muxer->average_birate_kbps);
+ fprintf(stderr, "M2TS: time % 6d - TS time % 6d - avg bitrate % 8d\r", gf_m2ts_get_sys_clock(muxer), gf_m2ts_get_ts_clock(muxer), muxer->average_birate_kbps);
if (gf_prompt_has_input()) {
char c = gf_prompt_get_char();
@@ -2643,7 +2695,7 @@ exit:
if (segment_duration) {
write_manifest(segment_manifest, segment_dir, segment_duration, segment_prefix, segment_http_prefix, segment_index - segment_number, segment_index, 1);
}
- if (ts_output_file && !is_stdout) fclose(ts_output_file);
+ if (ts_output_file && !is_stdout) gf_fclose(ts_output_file);
if (ts_output_udp_sk) gf_sk_del(ts_output_udp_sk);
#ifndef GPAC_DISABLE_STREAMING
if (ts_output_rtp) gf_rtp_del(ts_output_rtp);
@@ -2672,7 +2724,10 @@ exit:
}
}
if (sources[i].iod) gf_odf_desc_del((GF_Descriptor*)sources[i].iod);
+#ifndef GPAC_DISABLE_ISOM
if (sources[i].mp4) gf_isom_close(sources[i].mp4);
+#endif
+
#ifndef GPAC_DISABLE_SENG
if (sources[i].seng) {
gf_seng_terminate(sources[i].seng);
@@ -2686,8 +2741,15 @@ exit:
if (aac_reader) AAC_Reader_del(aac_reader);
#endif
- if (logfile) fclose(logfile);
+ if (logfile) gf_fclose(logfile);
gf_sys_close();
+
+#ifdef GPAC_MEMORY_TRACKING
+ if (enable_mem_tracker && (gf_memory_size() || gf_file_handles_count() )) {
+ gf_memory_print();
+ return 2;
+ }
+#endif
return 0;
}
diff --git a/applications/mp4box/Makefile b/applications/mp4box/Makefile
index 320acab..fde035a 100644
--- a/applications/mp4box/Makefile
+++ b/applications/mp4box/Makefile
@@ -25,11 +25,13 @@ LINKFLAGS=-L../../bin/gcc -L../../extra_lib/lib/gcc
ifeq ($(CONFIG_WIN32),yes)
EXE=.exe
PROG=MP4Box$(EXE)
+
ifeq ($(MP4BOX_STATIC),yes)
+LINKFLAGS+=-lgpac_static $(EXTRALIBS)
ifneq ($(CONFIG_ZLIB),no)
LINKFLAGS+=-lz
endif
-LINKFLAGS+=-lgpac_static $(EXTRALIBS)
+
else
LINKFLAGS+=-lgpac
endif
@@ -38,11 +40,14 @@ else
EXT=
PROG=MP4Box
+
ifeq ($(MP4BOX_STATIC),yes)
+
+LINKFLAGS+=-lgpac_static $(EXTRALIBS) $(GPAC_SH_FLAGS)
+
ifneq ($(CONFIG_ZLIB),no)
LINKFLAGS+=-lz
endif
-LINKFLAGS+=-lgpac_static $(EXTRALIBS) $(GPAC_SH_FLAGS)
# spidermonkey support
ifeq ($(CONFIG_JS),no)
diff --git a/applications/mp4box/filedump.c b/applications/mp4box/filedump.c
index 1966b5e..b2ca565 100644
--- a/applications/mp4box/filedump.c
+++ b/applications/mp4box/filedump.c
@@ -56,7 +56,7 @@
extern u32 swf_flags;
extern Float swf_flatten_angle;
-extern u32 get_file_type_by_ext(char *inName);
+extern GF_FileType get_file_type_by_ext(char *inName);
void scene_coding_log(void *cbk, u32 log_level, u32 log_tool, const char *fmt, va_list vlist);
@@ -66,47 +66,20 @@ GF_Err import_file(GF_ISOFile *dest, char *inName, u32 import_flags, Double forc
void PrintLanguages()
{
- u32 i=0;
+ u32 i=0, count = gf_lang_get_count();
fprintf(stderr, "Supported ISO 639 languages and codes:\n\n");
- while (GF_ISO639_Lang[i]) {
- if (!GF_ISO639_Lang[i+2][0]) {
- i+=3;
- continue;
+ for (i=0; i=0) return gf_lang_get_name(idx);
+ return lcode;
}
GF_Err dump_cover_art(GF_ISOFile *file, char *inName)
@@ -125,10 +98,10 @@ GF_Err dump_cover_art(GF_ISOFile *file, char *inName)
}
sprintf(szName, "%s.%s", inName, (tag_len>>31) ? "png" : "jpg");
- t = gf_f64_open(szName, "wb");
+ t = gf_fopen(szName, "wb");
gf_fwrite(tag, tag_len & 0x7FFFFFFF, 1, t);
- fclose(t);
+ gf_fclose(t);
return GF_OK;
}
@@ -140,13 +113,13 @@ GF_Err set_cover_art(GF_ISOFile *file, char *inName)
char *tag, *ext;
FILE *t;
u32 tag_len;
- t = gf_f64_open(inName, "rb");
- gf_f64_seek(t, 0, SEEK_END);
- tag_len = (u32) gf_f64_tell(t);
- gf_f64_seek(t, 0, SEEK_SET);
+ t = gf_fopen(inName, "rb");
+ gf_fseek(t, 0, SEEK_END);
+ tag_len = (u32) gf_ftell(t);
+ gf_fseek(t, 0, SEEK_SET);
tag = gf_malloc(sizeof(char) * tag_len);
tag_len = (u32) fread(tag, sizeof(char), tag_len, t);
- fclose(t);
+ gf_fclose(t);
ext = strrchr(inName, '.');
if (!stricmp(ext, ".png")) tag_len |= 0x80000000;
@@ -159,13 +132,13 @@ GF_Err set_cover_art(GF_ISOFile *file, char *inName)
#ifndef GPAC_DISABLE_SCENE_DUMP
-GF_Err dump_file_text(char *file, char *inName, u32 dump_mode, Bool do_log)
+GF_Err dump_file_text(char *file, char *inName, GF_SceneDumpFormat dump_mode, Bool do_log)
{
GF_Err e;
GF_SceneManager *ctx;
GF_SceneGraph *sg;
GF_SceneLoader load;
- u32 ftype;
+ GF_FileType ftype;
gf_log_cbk prev_logs = NULL;
FILE *logs = NULL;
e = GF_OK;
@@ -178,11 +151,12 @@ GF_Err dump_file_text(char *file, char *inName, u32 dump_mode, Bool do_log)
load.swf_import_flags = swf_flags;
if (dump_mode == GF_SM_DUMP_SVG) {
load.swf_import_flags |= GF_SM_SWF_USE_SVG;
+ load.svgOutFile = inName;
}
load.swf_flatten_limit = swf_flatten_angle;
ftype = get_file_type_by_ext(file);
- if (ftype == 1) {
+ if (ftype == GF_FILE_TYPE_ISO_MEDIA) {
load.isom = gf_isom_open(file, GF_ISOM_OPEN_READ, NULL);
if (!load.isom) {
e = gf_isom_last_error(NULL);
@@ -191,9 +165,7 @@ GF_Err dump_file_text(char *file, char *inName, u32 dump_mode, Bool do_log)
gf_sg_del(sg);
return e;
}
- }
- /*SAF*/
- else if (ftype==6) {
+ } else if (ftype==GF_FILE_TYPE_LSR_SAF) {
load.isom = gf_isom_open("saf_conv", GF_ISOM_WRITE_EDIT, NULL);
#ifndef GPAC_DISABLE_MEDIA_IMPORT
if (load.isom)
@@ -216,7 +188,7 @@ GF_Err dump_file_text(char *file, char *inName, u32 dump_mode, Bool do_log)
if (do_log) {
char szLog[GF_MAX_PATH];
sprintf(szLog, "%s_dec.logs", inName);
- logs = gf_f64_open(szLog, "wt");
+ logs = gf_fopen(szLog, "wt");
gf_log_set_tool_level(GF_LOG_CODING, GF_LOG_DEBUG);
prev_logs = gf_log_set_callback(logs, scene_coding_log);
@@ -227,9 +199,9 @@ GF_Err dump_file_text(char *file, char *inName, u32 dump_mode, Bool do_log)
if (logs) {
gf_log_set_tool_level(GF_LOG_CODING, GF_LOG_ERROR);
gf_log_set_callback(NULL, prev_logs);
- fclose(logs);
+ gf_fclose(logs);
}
- if (!e) {
+ if (!e && dump_mode != GF_SM_DUMP_SVG) {
u32 count = gf_list_count(ctx->streams);
if (count)
fprintf(stderr, "Scene loaded - dumping %d systems streams\n", count);
@@ -414,7 +386,7 @@ void dump_scene_stats(char *file, char *inName, u32 stat_level)
if (inName) {
strcpy(szBuf, inName);
strcat(szBuf, "_stat.xml");
- dump = gf_f64_open(szBuf, "wt");
+ dump = gf_fopen(szBuf, "wt");
close = 1;
} else {
dump = stderr;
@@ -495,7 +467,7 @@ exit:
} else {
fprintf(dump, "\n");
}
- if (dump && close) fclose(dump);
+ if (dump && close) gf_fclose(dump);
fprintf(stderr, "done\n");
}
#endif /*GPAC_DISABLE_SCENE_STATS*/
@@ -771,9 +743,9 @@ void dump_isom_xml(GF_ISOFile *file, char *inName)
if (inName) {
strcpy(szBuf, inName);
strcat(szBuf, "_info.xml");
- dump = gf_f64_open(szBuf, "wt");
+ dump = gf_fopen(szBuf, "wt");
gf_isom_dump(file, dump);
- fclose(dump);
+ gf_fclose(dump);
} else {
gf_isom_dump(file, stderr);
}
@@ -785,14 +757,15 @@ void dump_isom_xml(GF_ISOFile *file, char *inName)
void dump_file_rtp(GF_ISOFile *file, char *inName)
{
- u32 i, j;
+ u32 i, j, size;
FILE *dump;
+ const char *sdp;
char szBuf[1024];
if (inName) {
strcpy(szBuf, inName);
strcat(szBuf, "_rtp.xml");
- dump = gf_f64_open(szBuf, "wt");
+ dump = gf_fopen(szBuf, "wt");
} else {
dump = stderr;
}
@@ -805,13 +778,16 @@ void dump_file_rtp(GF_ISOFile *file, char *inName)
if (gf_isom_get_media_type(file, i+1) != GF_ISOM_MEDIA_HINT) continue;
fprintf(dump, "\n", gf_isom_get_track_id(file, i+1));
+ gf_isom_sdp_track_get(file, i+1, &sdp, &size);
+ fprintf(dump, "%s ", sdp);
+
for (j=0; j\n");
}
fprintf(dump, "\n");
- if (inName) fclose(dump);
+ if (inName) gf_fclose(dump);
}
#endif
@@ -825,7 +801,7 @@ void dump_file_timestamps(GF_ISOFile *file, char *inName)
if (inName) {
strcpy(szBuf, inName);
strcat(szBuf, "_ts.txt");
- dump = gf_f64_open(szBuf, "wt");
+ dump = gf_fopen(szBuf, "wt");
} else {
dump = stderr;
}
@@ -834,17 +810,21 @@ void dump_file_timestamps(GF_ISOFile *file, char *inName)
for (i=0; iDTS;
cts = dts + (s32) samp->CTS_Offset;
-
- fprintf(dump, "Sample %d\tDTS "LLD"\tCTS "LLD"\t%d\t%d\t"LLD, j+1, LLD_CAST dts, LLD_CAST cts, samp->dataLength, samp->IsRAP, offset);
+ fprintf(dump, "Sample %d\tDTS "LLD"\tCTS "LLD"\t%d\t%d\t"LLD"\t%d\t%d\t%d\t%d\t%d\t%d\t%d", j+1, LLD_CAST dts, LLD_CAST cts, samp->dataLength, samp->IsRAP, offset, isLeading, dependsOn, dependedOn, redundant, is_rap, has_roll, roll_distance);
if (cts>3), (ptr[1] & 0x7) );
#endif //GPAC_DISABLE_HEVC
return;
}
bs = gf_bs_new(ptr, ptr_size, GF_BITSTREAM_READ);
- type = ptr[0] & 0x1F;
+ type = gf_bs_read_u8(bs) & 0x1F;
fprintf(dump, "code=\"%d\" type=\"", type);
res = 0;
switch (type) {
case GF_AVC_NALU_NON_IDR_SLICE:
res = gf_media_avc_parse_nalu(bs, ptr[0], avc);
fputs("Non IDR slice", dump);
-
- if (res>=0)
+
+ if (res>=0)
fprintf(dump, "\" poc=\"%d", avc->s_info.poc);
break;
case GF_AVC_NALU_DP_A_SLICE:
@@ -1035,7 +1054,7 @@ static void dump_nalu(FILE *dump, char *ptr, u32 ptr_size, Bool is_svc, Bool is_
case GF_AVC_NALU_IDR_SLICE:
res = gf_media_avc_parse_nalu(bs, ptr[0], avc);
fputs("IDR slice", dump);
- if (res>=0)
+ if (res>=0)
fprintf(dump, "\" poc=\"%d", avc->s_info.poc);
break;
case GF_AVC_NALU_SEI:
@@ -1107,6 +1126,11 @@ static void dump_nalu(FILE *dump, char *ptr, u32 ptr_size, Bool is_svc, Bool is_
break;
}
fputs("\"", dump);
+
+ if (type==GF_AVC_NALU_SEI) {
+ dump_sei(dump, (u8 *) ptr, ptr_size, is_hevc);
+ }
+
if (res<0)
fprintf(dump, " status=\"error decoding slice\"");
@@ -1119,26 +1143,38 @@ void dump_file_nal(GF_ISOFile *file, u32 trackID, char *inName)
u32 i, count, track, nalh_size, timescale, cur_extract_mode;
FILE *dump;
s32 countRef;
+ Bool is_adobe_protection = GF_FALSE;
#ifndef GPAC_DISABLE_AV_PARSERS
- Bool is_hevc = 0;
+ Bool is_hevc = GF_FALSE;
AVCState avc;
GF_AVCConfig *avccfg, *svccfg;
GF_HEVCConfig *hevccfg, *shvccfg;
GF_AVCConfigSlot *slc;
- Bool is_adobe_protection = GF_FALSE;
+#endif
+
+ track = gf_isom_get_track_by_id(file, trackID);
+ nalh_size = 0;
+#ifndef GPAC_DISABLE_AV_PARSERS
memset(&avc, 0, sizeof(AVCState));
+ avccfg = gf_isom_avc_config_get(file, track, 1);
+ svccfg = gf_isom_svc_config_get(file, track, 1);
+ hevccfg = gf_isom_hevc_config_get(file, track, 1);
+ shvccfg = gf_isom_shvc_config_get(file, track, 1);
+ if (!avccfg && !svccfg && !hevccfg && !shvccfg) {
+ fprintf(stderr, "Error: Track #%d is not NALU-based!\n", trackID);
+ return;
+ }
#endif
if (inName) {
char szBuf[GF_MAX_PATH];
strcpy(szBuf, inName);
sprintf(szBuf, "%s_%d_nalu.xml", inName, trackID);
- dump = gf_f64_open(szBuf, "wt");
+ dump = gf_fopen(szBuf, "wt");
} else {
dump = stderr;
}
- track = gf_isom_get_track_by_id(file, trackID);
count = gf_isom_get_sample_count(file, track);
@@ -1149,10 +1185,6 @@ void dump_file_nal(GF_ISOFile *file, u32 trackID, char *inName)
fprintf(dump, "\n", trackID, count, timescale);
#ifndef GPAC_DISABLE_AV_PARSERS
- avccfg = gf_isom_avc_config_get(file, track, 1);
- svccfg = gf_isom_svc_config_get(file, track, 1);
- hevccfg = gf_isom_hevc_config_get(file, track, 1);
- shvccfg = gf_isom_shvc_config_get(file, track, 1);
//for tile tracks the hvcC is stored in the 'tbas' track
if (!hevccfg && gf_isom_get_reference_count(file, track, GF_4CC('t','b','a','s'))) {
u32 tk = 0;
@@ -1223,6 +1255,7 @@ void dump_file_nal(GF_ISOFile *file, u32 trackID, char *inName)
}
#endif
}
+
#endif
fprintf(dump, " \n");
@@ -1300,7 +1333,7 @@ void dump_file_nal(GF_ISOFile *file, u32 trackID, char *inName)
fprintf(dump, " \n");
fprintf(dump, " \n");
- if (inName) fclose(dump);
+ if (inName) gf_fclose(dump);
#ifndef GPAC_DISABLE_AV_PARSERS
if (avccfg) gf_odf_avc_cfg_del(avccfg);
if (svccfg) gf_odf_avc_cfg_del(svccfg);
@@ -1324,7 +1357,7 @@ void dump_file_ismacryp(GF_ISOFile *file, char *inName)
if (inName) {
strcpy(szBuf, inName);
strcat(szBuf, "_ismacryp.xml");
- dump = gf_f64_open(szBuf, "wt");
+ dump = gf_fopen(szBuf, "wt");
} else {
dump = stderr;
}
@@ -1346,11 +1379,11 @@ void dump_file_ismacryp(GF_ISOFile *file, char *inName)
fprintf(dump, "\n");
}
fprintf(dump, "\n");
- if (inName) fclose(dump);
+ if (inName) gf_fclose(dump);
}
-void dump_timed_text_track(GF_ISOFile *file, u32 trackID, char *inName, Bool is_convert, u32 dump_type)
+void dump_timed_text_track(GF_ISOFile *file, u32 trackID, char *inName, Bool is_convert, GF_TextDumpType dump_type)
{
FILE *dump;
GF_Err e;
@@ -1373,16 +1406,18 @@ void dump_timed_text_track(GF_ISOFile *file, u32 trackID, char *inName, Bool is_
}
if (inName) {
+ char *ext;
+ ext = ((dump_type==GF_TEXTDUMPTYPE_SVG) ? "svg" : ((dump_type==GF_TEXTDUMPTYPE_SRT) ? "srt" : "ttxt"));
if (is_convert)
- sprintf(szBuf, "%s.%s", inName, (dump_type==2) ? "svg" : ((dump_type==1) ? "srt" : "ttxt") ) ;
+ sprintf(szBuf, "%s.%s", inName, ext) ;
else
- sprintf(szBuf, "%s_%d_text.%s", inName, trackID, (dump_type==2) ? "svg" : ((dump_type==1) ? "srt" : "ttxt") );
- dump = gf_f64_open(szBuf, "wt");
+ sprintf(szBuf, "%s_%d_text.%s", inName, trackID, ext);
+ dump = gf_fopen(szBuf, "wt");
} else {
dump = stdout;
}
e = gf_isom_text_dump(file, track, dump, dump_type);
- if (inName) fclose(dump);
+ if (inName) gf_fclose(dump);
if (e) fprintf(stderr, "Conversion failed (%s)\n", gf_error_to_string(e));
else fprintf(stderr, "Conversion done\n");
@@ -1405,7 +1440,7 @@ void DumpSDP(GF_ISOFile *file, char *inName)
ext = strchr(szBuf, '.');
if (ext) ext[0] = 0;
strcat(szBuf, "_sdp.txt");
- dump = gf_f64_open(szBuf, "wt");
+ dump = gf_fopen(szBuf, "wt");
} else {
dump = stderr;
fprintf(dump, "* File SDP content *\n\n");
@@ -1422,7 +1457,7 @@ void DumpSDP(GF_ISOFile *file, char *inName)
fprintf(dump, "%s", sdp);
}
fprintf(dump, "\n\n");
- if (inName) fclose(dump);
+ if (inName) gf_fclose(dump);
}
#endif
@@ -1473,7 +1508,63 @@ static char *format_date(u64 time, char *szTime)
return szTime;
}
+void print_udta(GF_ISOFile *file, u32 track_number)
+{
+ u32 i, count;
+
+ count = gf_isom_get_udta_count(file, track_number);
+ if (!count) return;
+
+ fprintf(stderr, "%d UDTA types: ", count);
+
+ for (i=0; idata, slc->size, hash);
+ fprintf(stderr, "\t%s#%d hash: ", szName, i+1);
+ for (j=0; j<20; j++) fprintf(stderr, "%02X", hash[j]);
+ fprintf(stderr, "\n");
+ }
+}
+
#ifndef GPAC_DISABLE_HEVC
void dump_hevc_track_info(GF_ISOFile *file, u32 trackNum, GF_HEVCConfig *hevccfg, HEVCState *hevc_state)
{
@@ -1593,14 +1699,23 @@ void dump_hevc_track_info(GF_ISOFile *file, u32 trackNum, GF_HEVCConfig *hevccfg
}
fprintf(stderr, "\n");
}
+
}
fprintf(stderr, "\tBit Depth luma %d - Chroma %d - %d temporal layers\n", hevccfg->luma_bit_depth, hevccfg->chroma_bit_depth, hevccfg->numTemporalLayers);
if (hevccfg->is_shvc) {
fprintf(stderr, "\t%sNum Layers: %d (scalability mask 0x%02X)%s\n", hevccfg->non_hevc_base_layer ? "Non-HEVC base layer - " : "", hevccfg->num_layers, hevccfg->scalability_mask, hevccfg->complete_representation ? "" : " - no VCL data");
}
+
+ for (k=0; kparam_array); k++) {
+ GF_HEVCParamArray *ar=gf_list_get(hevccfg->param_array, k);
+ if (ar->type==GF_HEVC_NALU_SEQ_PARAM) print_config_hash(ar->nalus, "SPS");
+ else if (ar->type==GF_HEVC_NALU_PIC_PARAM) print_config_hash(ar->nalus, "PPS");
+ else if (ar->type==GF_HEVC_NALU_VID_PARAM) print_config_hash(ar->nalus, "VPS");
+ }
}
#endif
+
void DumpTrackInfo(GF_ISOFile *file, u32 trackID, Bool full_dump)
{
Float scale;
@@ -1609,7 +1724,8 @@ void DumpTrackInfo(GF_ISOFile *file, u32 trackID, Bool full_dump)
u64 time_slice, dur, size;
u8 bps;
GF_ESD *esd;
- char sType[5], szDur[50];
+ char szDur[50];
+ char *lang;
trackNum = gf_isom_get_track_by_id(file, trackID);
if (!trackNum) {
@@ -1625,14 +1741,22 @@ void DumpTrackInfo(GF_ISOFile *file, u32 trackID, Bool full_dump)
if (gf_isom_is_track_in_root_od(file, trackNum) ) fprintf(stderr, "Track is present in Root OD\n");
if (!gf_isom_is_track_enabled(file, trackNum)) fprintf(stderr, "Track is disabled\n");
- gf_isom_get_media_language(file, trackNum, sType);
- fprintf(stderr, "Media Info: Language \"%s\" - ", GetLanguage(sType) );
+ gf_isom_get_media_language(file, trackNum, &lang);
+ fprintf(stderr, "Media Info: Language \"%s (%s)\" - ", GetLanguage(lang), lang );
+ gf_free(lang);
mtype = gf_isom_get_media_type(file, trackNum);
fprintf(stderr, "Type \"%s:", gf_4cc_to_str(mtype));
msub_type = gf_isom_get_mpeg4_subtype(file, trackNum, 1);
if (!msub_type) msub_type = gf_isom_get_media_subtype(file, trackNum, 1);
fprintf(stderr, "%s\" - %d samples\n", gf_4cc_to_str(msub_type), gf_isom_get_sample_count(file, trackNum));
+ count = gf_isom_get_track_kind_count(file, trackNum);
+ for (i = 0; i < count; i++) {
+ char *kind_scheme, *kind_value;
+ gf_isom_get_track_kind(file, trackNum, i, &kind_scheme, &kind_value);
+ fprintf(stderr, "Kind: %s - %s\n", kind_scheme, kind_value);
+ }
+
if (gf_isom_is_track_fragmented(file, trackID) ) {
u32 frag_samples;
u64 frag_duration;
@@ -1652,6 +1776,8 @@ void DumpTrackInfo(GF_ISOFile *file, u32 trackID, Bool full_dump)
fprintf(stderr, "Handler name: %s\n", handler_name);
}
+ print_udta(file, trackNum);
+
if (mtype==GF_ISOM_MEDIA_VISUAL) {
s32 tx, ty;
u32 w, h;
@@ -1738,18 +1864,23 @@ void DumpTrackInfo(GF_ISOFile *file, u32 trackID, Bool full_dump)
fprintf(stderr, "\tAVC Info: %d SPS - %d PPS", gf_list_count(avccfg->sequenceParameterSets) , gf_list_count(avccfg->pictureParameterSets) );
fprintf(stderr, " - Profile %s @ Level %g\n", gf_avc_get_profile_name(avccfg->AVCProfileIndication), ((Double)avccfg->AVCLevelIndication)/10.0 );
fprintf(stderr, "\tNAL Unit length bits: %d\n", 8*avccfg->nal_unit_size);
- slc = gf_list_get(avccfg->sequenceParameterSets, 0);
- if (slc) {
+ for (i=0; isequenceParameterSets); i++) {
+ slc = gf_list_get(avccfg->sequenceParameterSets, i);
gf_avc_get_sps_info(slc->data, slc->size, NULL, NULL, NULL, &par_n, &par_d);
if ((par_n>0) && (par_d>0)) {
u32 tw, th;
gf_isom_get_track_layout_info(file, trackNum, &tw, &th, NULL, NULL, NULL);
fprintf(stderr, "\tPixel Aspect Ratio %d:%d - Indicated track size %d x %d\n", par_n, par_d, tw, th);
}
+ if (!full_dump) break;
}
if (avccfg->chroma_bit_depth) {
fprintf(stderr, "\tChroma format %d - Luma bit depth %d - chroma bit depth %d\n", avccfg->chroma_format, avccfg->luma_bit_depth, avccfg->chroma_bit_depth);
}
+
+ print_config_hash(avccfg->sequenceParameterSets, "SPS");
+ print_config_hash(avccfg->pictureParameterSets, "PPS");
+
gf_odf_avc_cfg_del(avccfg);
}
if (svccfg) {
@@ -1768,6 +1899,10 @@ void DumpTrackInfo(GF_ISOFile *file, u32 trackID, Bool full_dump)
}
}
}
+ print_config_hash(svccfg->sequenceParameterSets, "SPS");
+ print_config_hash(svccfg->pictureParameterSets, "PPS");
+ print_config_hash(svccfg->sequenceParameterSetExtensions, "SPSEx");
+
gf_odf_avc_cfg_del(svccfg);
}
#endif /*GPAC_DISABLE_AV_PARSERS*/
@@ -1967,7 +2102,7 @@ void DumpTrackInfo(GF_ISOFile *file, u32 trackID, Bool full_dump)
else
fprintf(stderr, "Synchronized on stream %d\n", esd->OCRESID);
} else {
- fprintf(stderr, "\tDecoding Buffer size %d - Average bitrate %d kbps - Max Bitrate %d kbps\n", esd->decoderConfig->bufferSizeDB, esd->decoderConfig->avgBitrate/1000, esd->decoderConfig->maxBitrate/1000);
+ fprintf(stderr, "\tDecoding Buffer size %d - Bitrate: avg %d - max %d kbps\n", esd->decoderConfig->bufferSizeDB, esd->decoderConfig->avgBitrate/1000, esd->decoderConfig->maxBitrate/1000);
if (esd->dependsOnESID)
fprintf(stderr, "\tDepends on stream %d for decoding\n", esd->dependsOnESID);
else
@@ -2045,11 +2180,13 @@ void DumpTrackInfo(GF_ISOFile *file, u32 trackID, Bool full_dump)
gf_isom_get_visual_info(file, trackNum, 1, &w, &h);
fprintf(stderr, "\tMotionJPEG2000 stream - Resolution %d x %d\n", w, h);
} else if ((msub_type == GF_ISOM_SUBTYPE_3GP_AMR) || (msub_type == GF_ISOM_SUBTYPE_3GP_AMR_WB)) {
- fprintf(stderr, "\t3GPP AMR%s stream - Sample Rate %d - %d channel(s) %d bits per samples\n", (msub_type == GF_ISOM_SUBTYPE_3GP_AMR_WB) ? " Wide Band" : "", sr, nb_ch, (u32) bps);
+ fprintf(stderr, "\t3GPP AMR%s stream - Sample Rate %d - %d channel(s) %d bps\n", (msub_type == GF_ISOM_SUBTYPE_3GP_AMR_WB) ? " Wide Band" : "", sr, nb_ch, (u32) bps);
} else if (msub_type == GF_ISOM_SUBTYPE_3GP_EVRC) {
- fprintf(stderr, "\t3GPP EVRC stream - Sample Rate %d - %d channel(s) %d bits per samples\n", sr, nb_ch, (u32) bps);
+ fprintf(stderr, "\t3GPP EVRC stream - Sample Rate %d - %d channel(s) %d bps\n", sr, nb_ch, (u32) bps);
} else if (msub_type == GF_ISOM_SUBTYPE_3GP_QCELP) {
- fprintf(stderr, "\t3GPP QCELP stream - Sample Rate %d - %d channel(s) %d bits per samples\n", sr, nb_ch, (u32) bps);
+ fprintf(stderr, "\t3GPP QCELP stream - Sample Rate %d - %d channel(s) %d bps\n", sr, nb_ch, (u32) bps);
+ } else if (msub_type == GF_ISOM_SUBTYPE_MP3) {
+ fprintf(stderr, "\tMPEG 1/2 Audio stream - Sample Rate %d - %d channel(s) %d bps\n", sr, nb_ch, (u32) bps);
} else if (msub_type == GF_ISOM_SUBTYPE_AC3) {
u32 br = 0;
Bool lfe = 0;
@@ -2057,7 +2194,12 @@ void DumpTrackInfo(GF_ISOFile *file, u32 trackID, Bool full_dump)
#ifndef GPAC_DISABLE_AV_PARSERS
GF_AC3Config *ac3 = gf_isom_ac3_config_get(file, trackNum, 1);
if (ac3) {
+ int i;
nb_ch = gf_ac3_get_channels(ac3->streams[0].acmod);
+ for (i=0; istreams[0].nb_dep_sub; ++i) {
+ assert(ac3->streams[0].nb_dep_sub == 1);
+ nb_ch += gf_ac3_get_channels(ac3->streams[0].chan_loc);
+ }
lfe = ac3->streams[0].lfon;
br = ac3->is_ec3 ? ac3->brcode : gf_ac3_get_bitrate(ac3->brcode);
is_ec3 = ac3->is_ec3;
@@ -2106,18 +2248,76 @@ void DumpTrackInfo(GF_ISOFile *file, u32 trackID, Bool full_dump)
u32 w, h;
s16 l;
s32 tx, ty;
+ const char *content_encoding = NULL;
+ const char *mime = NULL;
+ const char *config = NULL;
+ const char *_namespace = NULL;
+ const char *schema_loc = NULL;
+ const char *auxiliary_mimes = NULL;
gf_isom_get_track_layout_info(file, trackNum, &w, &h, &tx, &ty, &l);
- fprintf(stderr, "Timed Text - Size %d x %d - Translation X=%d Y=%d - Layer %d\n", w, h, tx, ty, l);
+ if (msub_type == GF_ISOM_SUBTYPE_SBTT) {
+ gf_isom_stxt_get_description(file, trackNum, 1, &mime, &content_encoding, &config);
+ fprintf(stderr, "Textual Subtitle Stream ");
+ fprintf(stderr, "- mime %s", mime);
+ if (content_encoding != NULL) {
+ fprintf(stderr, " - encoding %s", content_encoding);
+ }
+ if (config != NULL) {
+ fprintf(stderr, " - %d bytes config", (u32) strlen(config));
+ }
+ } else if (msub_type == GF_ISOM_SUBTYPE_STXT) {
+ gf_isom_stxt_get_description(file, trackNum, 1, &mime, &content_encoding, &config);
+ fprintf(stderr, "Simple Timed Text Stream ");
+ fprintf(stderr, "- mime %s", mime);
+ if (content_encoding != NULL) {
+ fprintf(stderr, " - encoding %s", content_encoding);
+ }
+ if (config != NULL) {
+ fprintf(stderr, " - %d bytes config", (u32) strlen(config));
+ }
+ } else if (msub_type == GF_ISOM_SUBTYPE_STPP) {
+ gf_isom_xml_subtitle_get_description(file, trackNum, 1, &_namespace, &schema_loc, &auxiliary_mimes);
+ fprintf(stderr, "XML Subtitle Stream ");
+ fprintf(stderr, "- namespace %s", _namespace);
+ if (schema_loc != NULL) {
+ fprintf(stderr, " - schema-location %s", schema_loc);
+ }
+ if (auxiliary_mimes != NULL) {
+ fprintf(stderr, " - auxiliary-mime-types %s", auxiliary_mimes);
+ }
+ } else {
+ fprintf(stderr, "Unknown Text Stream");
+ }
+ fprintf(stderr, "\n Size %d x %d - Translation X=%d Y=%d - Layer %d\n", w, h, tx, ty, l);
} else if (mtype == GF_ISOM_MEDIA_META) {
- Bool is_xml = 0;
- const char *mime_or_namespace = NULL;
const char *content_encoding = NULL;
- const char *schema_loc = NULL;
- gf_isom_get_timed_meta_data_info(file, trackNum, 1, &is_xml, &mime_or_namespace, &content_encoding, &schema_loc);
- fprintf(stderr, "%s Metadata stream\n\t%s %s\n\tencoding %s", is_xml ? "Xml" : "Text", is_xml ? "namespace" : "mime-type", mime_or_namespace, content_encoding);
- if (is_xml && schema_loc != NULL)
- fprintf(stderr, "\n\tschema %s\n", schema_loc);
- fprintf(stderr, "\n");
+ if (msub_type == GF_ISOM_SUBTYPE_METT) {
+ const char *mime = NULL;
+ const char *config = NULL;
+ gf_isom_stxt_get_description(file, trackNum, 1, &mime, &content_encoding, &config);
+ fprintf(stderr, "Textual Metadata Stream - mime %s", mime);
+ if (content_encoding != NULL) {
+ fprintf(stderr, " - encoding %s", content_encoding);
+ }
+ if (config != NULL) {
+ fprintf(stderr, " - %d bytes config", (u32) strlen(config));
+ }
+ fprintf(stderr, "\n");
+ } else if (msub_type == GF_ISOM_SUBTYPE_METX) {
+ const char *_namespace = NULL;
+ const char *schema_loc = NULL;
+ gf_isom_get_xml_metadata_description(file, trackNum, 1, &_namespace, &schema_loc, &content_encoding);
+ fprintf(stderr, "XML Metadata Stream - namespace %s", _namespace);
+ if (content_encoding != NULL) {
+ fprintf(stderr, " - encoding %s", content_encoding);
+ }
+ if (schema_loc != NULL) {
+ fprintf(stderr, " - schema-location %s", schema_loc);
+ }
+ fprintf(stderr, "\n");
+ } else {
+ fprintf(stderr, "Unknown Metadata Stream\n");
+ }
} else {
GF_GenericSampleDescription *udesc = gf_isom_get_generic_sample_description(file, trackNum, 1);
if (udesc) {
@@ -2141,6 +2341,12 @@ void DumpTrackInfo(GF_ISOFile *file, u32 trackID, Bool full_dump)
}
}
+ {
+ char szCodec[100];
+ gf_media_get_rfc_6381_codec_name(file, trackNum, szCodec, GF_FALSE, GF_FALSE);
+ fprintf(stderr, "\tRFC6381 Codec Parameters: %s\n", szCodec);
+ }
+
DumpMetaItem(file, 0, trackNum, "Track Meta");
gf_isom_get_track_switch_group_count(file, trackNum, &alt_group, &nb_groups);
@@ -2166,6 +2372,18 @@ void DumpTrackInfo(GF_ISOFile *file, u32 trackID, Bool full_dump)
}
}
+ switch (gf_isom_has_sync_points(file, trackNum)) {
+ case 0:
+ fprintf(stderr, "\tAll samples are sync\n");
+ break;
+ case 1:
+ fprintf(stderr, "\tAverage GOP length: %d samples\n", (u32 ) (gf_isom_get_sample_count(file, trackNum) / gf_isom_get_sync_point_count(file, trackNum) ) );
+ break;
+ case 2:
+ fprintf(stderr, "\tNo sync sample found\n");
+ break;
+ }
+
if (!full_dump) {
fprintf(stderr, "\n");
return;
@@ -2406,6 +2624,7 @@ void DumpMovieInfo(GF_ISOFile *file)
}
}
+ print_udta(file, 0);
fprintf(stderr, "\n");
for (i=0; i\n");
- fclose(dumper.pes_out_nhml);
- fclose(dumper.pes_out_info);
+ gf_fclose(dumper.pes_out_nhml);
+ gf_fclose(dumper.pes_out_info);
}
#endif
- if (dumper.timestamps_info_file) fclose(dumper.timestamps_info_file);
+ if (dumper.timestamps_info_file) gf_fclose(dumper.timestamps_info_file);
}
diff --git a/applications/mp4box/fileimport.c b/applications/mp4box/fileimport.c
index 39fd3ba..80bfb8f 100644
--- a/applications/mp4box/fileimport.c
+++ b/applications/mp4box/fileimport.c
@@ -27,13 +27,14 @@
#include
#include
#include
+#include
+#include
+#include
#if !defined(GPAC_DISABLE_VRML) && !defined(GPAC_DISABLE_X3D) && !defined(GPAC_DISABLE_SVG)
#include
#endif
-#ifndef GPAC_DISABLE_SMGR
-#include
-#endif
+
#ifndef GPAC_DISABLE_BIFS
#include
@@ -41,7 +42,6 @@
#ifndef GPAC_DISABLE_VRML
#include
#endif
-#include
#ifndef GPAC_DISABLE_ISOM_WRITE
@@ -60,7 +60,6 @@ extern u32 swf_flags;
extern Float swf_flatten_angle;
extern Bool keep_sys_tracks;
-const char *GetLanguageCode(char *lang);
void scene_coding_log(void *cbk, u32 log_level, u32 log_tool, const char *fmt, va_list vlist);
void convert_file_info(char *inName, u32 trackID)
@@ -195,9 +194,53 @@ static void set_chapter_track(GF_ISOFile *file, u32 track, u32 chapter_ref_trak)
}
}
+GF_Err set_file_udta(GF_ISOFile *dest, u32 tracknum, u32 udta_type, char *src, Bool is_box_array)
+{
+ char *data = NULL;
+ u32 size;
+ bin128 uuid;
+ memset(uuid, 0 , 16);
+
+ if (!udta_type && !is_box_array) return GF_BAD_PARAM;
+
+ if (!src) {
+ return gf_isom_remove_user_data(dest, tracknum, udta_type, uuid);
+ }
+
+ if (!strnicmp(src, "base64", 6)) {
+ src += 7;
+ size = (u32) strlen(src);
+ data = gf_malloc(sizeof(char) * size);
+ size = gf_base64_decode(src, size, data, size);
+ } else {
+ FILE *t = gf_fopen(src, "rb");
+ if (!t) return GF_IO_ERR;
+ fseek(t, 0, SEEK_END);
+ size = ftell(t);
+ fseek(t, 0, SEEK_SET);
+ data = gf_malloc(sizeof(char)*size);
+ if (size != fread(data, 1, size, t) ) {
+ gf_free(data);
+ gf_fclose(t);
+ return GF_IO_ERR;
+ }
+ gf_fclose(t);
+ }
+
+ if (size && data) {
+ if (is_box_array) {
+ gf_isom_add_user_data_boxes(dest, tracknum, data, size);
+ } else {
+ gf_isom_add_user_data(dest, tracknum, udta_type, uuid, data, size);
+ }
+ gf_free(data);
+ }
+ return GF_OK;
+}
+
GF_Err import_file(GF_ISOFile *dest, char *inName, u32 import_flags, Double force_fps, u32 frames_per_sample)
{
- u32 track_id, i, timescale, track, stype, profile, level, new_timescale, rescale, svc_mode, tile_mode;
+ u32 track_id, i, j, timescale, track, stype, profile, level, new_timescale, rescale, svc_mode, tile_mode, txt_flags;
s32 par_d, par_n, prog_id, delay;
s32 tw, th, tx, ty, txtw, txth, txtx, txty;
Bool do_audio, do_video, do_all, disable, track_layout, text_layout, chap_ref, is_chap, is_chap_file, keep_handler, negative_cts_offset, rap_only;
@@ -206,6 +249,9 @@ GF_Err import_file(GF_ISOFile *dest, char *inName, u32 import_flags, Double forc
GF_Err e;
GF_MediaImporter import;
char *ext, szName[1000], *handler_name, *rvc_config, *chapter_name;
+ GF_List *kinds;
+ GF_TextFlagsMode txt_mode = GF_ISOM_TEXT_FLAGS_OVERWRITE;
+
rvc_predefined = 0;
chapter_name = NULL;
new_timescale = 1;
@@ -226,6 +272,7 @@ GF_Err import_file(GF_ISOFile *dest, char *inName, u32 import_flags, Double forc
disable = 0;
chap_ref = 0;
is_chap = 0;
+ kinds = gf_list_new();
track_layout = 0;
szLan = NULL;
delay = 0;
@@ -235,6 +282,7 @@ GF_Err import_file(GF_ISOFile *dest, char *inName, u32 import_flags, Double forc
negative_cts_offset = 0;
tile_mode = 0;
rap_only = 0;
+ txt_flags = 0;
tw = th = tx = ty = txtw = txth = txtx = txty = 0;
par_d = par_n = -2;
@@ -251,53 +299,9 @@ GF_Err import_file(GF_ISOFile *dest, char *inName, u32 import_flags, Double forc
if (ext2) ext2[0] = 0;
/*all extensions for track-based importing*/
- if (!strnicmp(ext+1, "lang=", 5)) szLan = GetLanguageCode(ext+6);
+ if (!strnicmp(ext+1, "dur=", 4)) import.duration = (u32) (atof(ext+5) * 1000);
+ else if (!strnicmp(ext+1, "lang=", 5)) szLan = ext+6;
else if (!strnicmp(ext+1, "delay=", 6)) delay = atoi(ext+7);
- else if (!strnicmp(ext+1, "fps=", 4)) {
- if (!strcmp(ext+5, "auto")) force_fps = GF_IMPORT_AUTO_FPS;
- else if (strchr(ext+5, '-')) {
- u32 ticks, dts_inc;
- sscanf(ext+5, "%u-%u", &ticks, &dts_inc);
- if (!dts_inc) dts_inc=1;
- force_fps = ticks;
- force_fps /= dts_inc;
- }
- else force_fps = atof(ext+5);
- }
- else if (!strnicmp(ext+1, "timescale=", 10)) {
- new_timescale = atoi(ext+11);
- }
- else if (!strnicmp(ext+1, "rescale=", 8)) {
- rescale = atoi(ext+9);
- }
- else if (!stricmp(ext+1, "chap")) is_chap = 1;
- else if (!stricmp(ext+1, "dref")) import_flags |= GF_IMPORT_USE_DATAREF;
- else if (!stricmp(ext+1, "nodrop")) import_flags |= GF_IMPORT_NO_FRAME_DROP;
- else if (!stricmp(ext+1, "packed")) import_flags |= GF_IMPORT_FORCE_PACKED;
- else if (!stricmp(ext+1, "sbr")) import_flags |= GF_IMPORT_SBR_IMPLICIT;
- else if (!stricmp(ext+1, "sbrx")) import_flags |= GF_IMPORT_SBR_EXPLICIT;
- else if (!stricmp(ext+1, "ovsbr")) import_flags |= GF_IMPORT_OVSBR;
- else if (!stricmp(ext+1, "ps")) import_flags |= GF_IMPORT_PS_IMPLICIT;
- else if (!stricmp(ext+1, "psx")) import_flags |= GF_IMPORT_PS_EXPLICIT;
- else if (!stricmp(ext+1, "svc") || !stricmp(ext+1, "shvc") ) import_flags |= GF_IMPORT_SVC_EXPLICIT;
- else if (!stricmp(ext+1, "nosvc") || !stricmp(ext+1, "noshvc")) import_flags |= GF_IMPORT_SVC_NONE;
- else if (!stricmp(ext+1, "subsamples")) import_flags |= GF_IMPORT_SET_SUBSAMPLES;
- else if (!stricmp(ext+1, "forcesync")) import_flags |= GF_IMPORT_FORCE_SYNC;
- else if (!stricmp(ext+1, "rap")) rap_only = 1;
- else if (!stricmp(ext+1, "mpeg4")) import_flags |= GF_IMPORT_FORCE_MPEG4;
- else if (!stricmp(ext+1, "swf-global")) import.swf_flags |= GF_SM_SWF_STATIC_DICT;
- else if (!stricmp(ext+1, "swf-no-ctrl")) import.swf_flags &= ~GF_SM_SWF_SPLIT_TIMELINE;
- else if (!stricmp(ext+1, "swf-no-text")) import.swf_flags |= GF_SM_SWF_NO_TEXT;
- else if (!stricmp(ext+1, "swf-no-font")) import.swf_flags |= GF_SM_SWF_NO_FONT;
- else if (!stricmp(ext+1, "swf-no-line")) import.swf_flags |= GF_SM_SWF_NO_LINE;
- else if (!stricmp(ext+1, "swf-no-grad")) import.swf_flags |= GF_SM_SWF_NO_GRADIENT;
- else if (!stricmp(ext+1, "swf-quad")) import.swf_flags |= GF_SM_SWF_QUAD_CURVE;
- else if (!stricmp(ext+1, "swf-xlp")) import.swf_flags |= GF_SM_SWF_SCALABLE_LINE;
- else if (!stricmp(ext+1, "swf-ic2d")) import.swf_flags |= GF_SM_SWF_USE_IC2D;
- else if (!stricmp(ext+1, "swf-same-app")) import.swf_flags |= GF_SM_SWF_REUSE_APPEARANCE;
- else if (!strnicmp(ext+1, "swf-flatten=", 12)) import.swf_flatten_angle = (Float) atof(ext+13);
- else if (!strnicmp(ext+1, "agg=", 4)) frames_per_sample = atoi(ext+5);
- else if (!strnicmp(ext+1, "dur=", 4)) import.duration = (u32) (atof(ext+5) * 1000);
else if (!strnicmp(ext+1, "par=", 4)) {
if (!stricmp(ext+5, "none")) {
par_n = par_d = -1;
@@ -309,14 +313,6 @@ GF_Err import_file(GF_ISOFile *dest, char *inName, u32 import_flags, Double forc
}
}
else if (!strnicmp(ext+1, "name=", 5)) handler_name = gf_strdup(ext+6);
- else if (!strnicmp(ext+1, "rvc=", 4)) {
- if (sscanf(ext+5, "%d", &rvc_predefined) != 1) {
- rvc_config = gf_strdup(ext+5);
- }
- }
- else if (!strnicmp(ext+1, "font=", 5)) import.fontName = gf_strdup(ext+6);
- else if (!strnicmp(ext+1, "size=", 5)) import.fontSize = atoi(ext+6);
- else if (!strnicmp(ext+1, "fmt=", 4)) import.streamFormat = gf_strdup(ext+5);
else if (!strnicmp(ext+1, "ext=", 4)) {
/*extensions begin with '.'*/
if (*(ext+5) == '.')
@@ -327,14 +323,66 @@ GF_Err import_file(GF_ISOFile *dest, char *inName, u32 import_flags, Double forc
strcat(import.force_ext+1, ext+5);
}
}
+ else if (!strnicmp(ext+1, "hdlr=", 5)) handler = GF_4CC(ext[6], ext[7], ext[8], ext[9]);
else if (!strnicmp(ext+1, "disable", 7)) disable = 1;
else if (!strnicmp(ext+1, "group=", 6)) {
group = atoi(ext+7);
if (!group) group = gf_isom_get_next_alternate_group_id(dest);
}
- else if (!strnicmp(ext+1, "hdlr=", 5))
- handler = GF_4CC(ext[6], ext[7], ext[8], ext[9]);
+ else if (!strnicmp(ext+1, "fps=", 4)) {
+ if (!strcmp(ext+5, "auto")) force_fps = GF_IMPORT_AUTO_FPS;
+ else if (strchr(ext+5, '-')) {
+ u32 ticks, dts_inc;
+ sscanf(ext+5, "%u-%u", &ticks, &dts_inc);
+ if (!dts_inc) dts_inc=1;
+ force_fps = ticks;
+ force_fps /= dts_inc;
+ }
+ else force_fps = atof(ext+5);
+ }
+ else if (!stricmp(ext+1, "rap")) rap_only = 1;
+ else if (!stricmp(ext+1, "trailing")) import_flags |= GF_IMPORT_KEEP_TRAILING;
+ else if (!strnicmp(ext+1, "agg=", 4)) frames_per_sample = atoi(ext+5);
+ else if (!stricmp(ext+1, "dref")) import_flags |= GF_IMPORT_USE_DATAREF;
+ else if (!stricmp(ext+1, "nodrop")) import_flags |= GF_IMPORT_NO_FRAME_DROP;
+ else if (!stricmp(ext+1, "packed")) import_flags |= GF_IMPORT_FORCE_PACKED;
+ else if (!stricmp(ext+1, "sbr")) import_flags |= GF_IMPORT_SBR_IMPLICIT;
+ else if (!stricmp(ext+1, "sbrx")) import_flags |= GF_IMPORT_SBR_EXPLICIT;
+ else if (!stricmp(ext+1, "ovsbr")) import_flags |= GF_IMPORT_OVSBR;
+ else if (!stricmp(ext+1, "ps")) import_flags |= GF_IMPORT_PS_IMPLICIT;
+ else if (!stricmp(ext+1, "psx")) import_flags |= GF_IMPORT_PS_EXPLICIT;
+ else if (!stricmp(ext+1, "mpeg4")) import_flags |= GF_IMPORT_FORCE_MPEG4;
+ else if (!stricmp(ext+1, "svc") || !stricmp(ext+1, "shvc") ) import_flags |= GF_IMPORT_SVC_EXPLICIT;
+ else if (!stricmp(ext+1, "nosvc") || !stricmp(ext+1, "noshvc")) import_flags |= GF_IMPORT_SVC_NONE;
+ /*split SVC layers*/
+ else if (!strnicmp(ext+1, "svcmode=", 8) || !strnicmp(ext+1, "shvcmode=", 9)) {
+ char *mode = ext+9;
+ if (mode[0]=='=') mode = ext+10;
+ if (!stricmp(mode, "splitnox"))
+ svc_mode = 3;
+ else if (!stricmp(mode, "splitall") || !stricmp(mode, "split"))
+ svc_mode = 2;
+ else if (!stricmp(mode, "splitbase"))
+ svc_mode = 1;
+ else if (!stricmp(mode, "merged"))
+ svc_mode = 0;
+ }
+ else if (!stricmp(ext+1, "subsamples")) import_flags |= GF_IMPORT_SET_SUBSAMPLES;
+ else if (!stricmp(ext+1, "forcesync")) import_flags |= GF_IMPORT_FORCE_SYNC;
+ else if (!stricmp(ext+1, "xps_inband")) import_flags |= GF_IMPORT_FORCE_XPS_INBAND;
+
+ /*force all composition offsets to be positive*/
+ else if (!strnicmp(ext+1, "negctts", 7)) negative_cts_offset = 1;
+ else if (!strnicmp(ext+1, "stype=", 6)) {
+ stype = GF_4CC(ext[7], ext[8], ext[9], ext[10]);
+ }
+ else if (!stricmp(ext+1, "chap")) is_chap = 1;
+ else if (!strnicmp(ext+1, "chapter=", 8)) chapter_name = gf_strdup(ext+9);
+ else if (!strnicmp(ext+1, "chapfile=", 9)) {
+ chapter_name = gf_strdup(ext+10);
+ is_chap_file=1;
+ }
else if (!strnicmp(ext+1, "layout=", 7)) {
if ( sscanf(ext+8, "%dx%dx%dx%d", &tw, &th, &tx, &ty)==4) {
track_layout = 1;
@@ -343,6 +391,26 @@ GF_Err import_file(GF_ISOFile *dest, char *inName, u32 import_flags, Double forc
tx = ty = 0;
}
}
+ else if (!strnicmp(ext+1, "rescale=", 8)) {
+ rescale = atoi(ext+9);
+ }
+ else if (!strnicmp(ext+1, "timescale=", 10)) {
+ new_timescale = atoi(ext+11);
+ }
+ else if (!stricmp(ext+1, "noedit")) import_flags |= GF_IMPORT_NO_EDIT_LIST;
+
+
+ else if (!strnicmp(ext+1, "rvc=", 4)) {
+ if (sscanf(ext+5, "%d", &rvc_predefined) != 1) {
+ rvc_config = gf_strdup(ext+5);
+ }
+ }
+ else if (!strnicmp(ext+1, "fmt=", 4)) import.streamFormat = gf_strdup(ext+5);
+ else if (!strnicmp(ext+1, "profile=", 8)) profile = atoi(ext+9);
+ else if (!strnicmp(ext+1, "level=", 6)) level = atoi(ext+7);
+
+ else if (!strnicmp(ext+1, "font=", 5)) import.fontName = gf_strdup(ext+6);
+ else if (!strnicmp(ext+1, "size=", 5)) import.fontSize = atoi(ext+6);
else if (!strnicmp(ext+1, "text_layout=", 12)) {
if ( sscanf(ext+13, "%dx%dx%dx%d", &txtw, &txth, &txtx, &txty)==4) {
text_layout = 1;
@@ -351,35 +419,55 @@ GF_Err import_file(GF_ISOFile *dest, char *inName, u32 import_flags, Double forc
txtx = txty = 0;
}
}
- else if (!strnicmp(ext+1, "stype=", 6)) {
- stype = GF_4CC(ext[7], ext[8], ext[9], ext[10]);
+
+ else if (!stricmp(ext+1, "swf-global")) import.swf_flags |= GF_SM_SWF_STATIC_DICT;
+ else if (!stricmp(ext+1, "swf-no-ctrl")) import.swf_flags &= ~GF_SM_SWF_SPLIT_TIMELINE;
+ else if (!stricmp(ext+1, "swf-no-text")) import.swf_flags |= GF_SM_SWF_NO_TEXT;
+ else if (!stricmp(ext+1, "swf-no-font")) import.swf_flags |= GF_SM_SWF_NO_FONT;
+ else if (!stricmp(ext+1, "swf-no-line")) import.swf_flags |= GF_SM_SWF_NO_LINE;
+ else if (!stricmp(ext+1, "swf-no-grad")) import.swf_flags |= GF_SM_SWF_NO_GRADIENT;
+ else if (!stricmp(ext+1, "swf-quad")) import.swf_flags |= GF_SM_SWF_QUAD_CURVE;
+ else if (!stricmp(ext+1, "swf-xlp")) import.swf_flags |= GF_SM_SWF_SCALABLE_LINE;
+ else if (!stricmp(ext+1, "swf-ic2d")) import.swf_flags |= GF_SM_SWF_USE_IC2D;
+ else if (!stricmp(ext+1, "swf-same-app")) import.swf_flags |= GF_SM_SWF_REUSE_APPEARANCE;
+ else if (!strnicmp(ext+1, "swf-flatten=", 12)) import.swf_flatten_angle = (Float) atof(ext+13);
+
+ else if (!strnicmp(ext+1, "kind=", 5)) {
+ char *kind_scheme, *kind_value;
+ char *kind_data = ext+6;
+ char *sep = strchr(kind_data, '=');
+ if (sep) {
+ *sep = 0;
+ }
+ kind_scheme = gf_strdup(kind_data);
+ if (sep) {
+ *sep = '=';
+ kind_value = gf_strdup(sep+1);
+ } else {
+ kind_value = NULL;
+ }
+ gf_list_add(kinds, kind_scheme);
+ gf_list_add(kinds, kind_value);
}
- else if (!strnicmp(ext+1, "profile=", 8)) profile = atoi(ext+9);
- else if (!strnicmp(ext+1, "level=", 6)) level = atoi(ext+7);
- else if (!strnicmp(ext+1, "chapter=", 8)) chapter_name = gf_strdup(ext+9);
- else if (!strnicmp(ext+1, "chapfile=", 9)) {
- chapter_name = gf_strdup(ext+10);
- is_chap_file=1;
+ else if (!strnicmp(ext+1, "txtflags", 8)) {
+ if (!strnicmp(ext+1, "txtflags=", 9)) {
+ sscanf(ext+10, "%x", &txt_flags);
+ }
+ else if (!strnicmp(ext+1, "txtflags+=", 10)) {
+ sscanf(ext+11, "%x", &txt_flags);
+ txt_mode = GF_ISOM_TEXT_FLAGS_TOGGLE;
+ }
+ else if (!strnicmp(ext+1, "txtflags-=", 10)) {
+ sscanf(ext+11, "%x", &txt_flags);
+ txt_mode = GF_ISOM_TEXT_FLAGS_UNTOGGLE;
+ }
}
- /*force all composition offsets to be positive*/
- else if (!strnicmp(ext+1, "negctts", 7)) negative_cts_offset = 1;
- /*split SVC layers*/
- else if (!strnicmp(ext+1, "svcmode=", 8) || !strnicmp(ext+1, "shvcmode=", 9)) {
- char *mode = ext+9;
- if (mode[0]=='=') mode = ext+10;
- if (!stricmp(mode, "splitnox"))
- svc_mode = 3;
- else if (!stricmp(mode, "splitall") || !stricmp(mode, "split"))
- svc_mode = 2;
- else if (!stricmp(mode, "splitbase"))
- svc_mode = 1;
- else if (!stricmp(mode, "merged"))
- svc_mode = 0;
- }
+ /*EXPERIMENTAL OPTIONS NOT DOCUMENTED*/
else if (!strnicmp(ext+1, "tiles", 5)) {
tile_mode = 1;
}
+
/*unrecognized, assume name has colon in it*/
else {
ext = ext2;
@@ -544,6 +632,12 @@ GF_Err import_file(GF_ISOFile *dest, char *inName, u32 import_flags, Double forc
set_chapter_track(import.dest, i+1, chap_ref);
}
+ for (j = 0; j < gf_list_count(kinds); j+=2) {
+ char *kind_scheme = (char *)gf_list_get(kinds, j);
+ char *kind_value = (char *)gf_list_get(kinds, j+1);
+ gf_isom_add_track_kind(import.dest, i+1, kind_scheme, kind_value);
+ }
+
if (profile || level)
gf_media_change_pl(import.dest, i+1, profile, level);
@@ -558,6 +652,11 @@ GF_Err import_file(GF_ISOFile *dest, char *inName, u32 import_flags, Double forc
if (gf_isom_get_hevc_shvc_type(import.dest, i+1, 1)>=GF_ISOM_HEVCTYPE_HEVC_SHVC)
check_track_for_shvc = i+1;
+ if (txt_flags) {
+ gf_isom_text_set_display_flags(import.dest, i+1, 0, txt_flags, txt_mode);
+ }
+
+
if (tile_mode) {
switch (gf_isom_get_media_subtype(import.dest, i+1, 1)) {
case GF_ISOM_SUBTYPE_HVC1:
@@ -606,7 +705,7 @@ GF_Err import_file(GF_ISOFile *dest, char *inName, u32 import_flags, Double forc
u64 to_skip = (timescale*(-delay))/1000;
if (to_skip=GF_ISOM_HEVCTYPE_HEVC_SHVC)
check_track_for_shvc = track;
+ if (txt_flags) {
+ gf_isom_text_set_display_flags(import.dest, track, 0, txt_flags, txt_mode);
+ }
+
if (tile_mode) {
switch (gf_isom_get_media_subtype(import.dest, track, 1)) {
case GF_ISOM_SUBTYPE_HVC1:
@@ -755,6 +864,12 @@ GF_Err import_file(GF_ISOFile *dest, char *inName, u32 import_flags, Double forc
exit:
+ while (gf_list_count(kinds)) {
+ char *kind = (char *)gf_list_get(kinds, 0);
+ gf_list_rem(kinds, 0);
+ if (kind) gf_free(kind);
+ }
+ gf_list_del(kinds);
if (handler_name) gf_free(handler_name);
if (chapter_name ) gf_free(chapter_name );
if (import.fontName) gf_free(import.fontName);
@@ -874,12 +989,12 @@ GF_Err split_isomedia_file(GF_ISOFile *mp4, Double split_dur, u32 split_size_kb,
case GF_ISOM_MEDIA_MPEGJ:
case GF_ISOM_MEDIA_MPEG7:
case GF_ISOM_MEDIA_FLASH:
- fprintf(stderr, "WARNING: Track ID %d (type %s) not handled by spliter - skipping\n", gf_isom_get_track_id(mp4, i+1), gf_4cc_to_str(mtype));
+ fprintf(stderr, "WARNING: Track ID %d (type %s) not handled by splitter - skipping\n", gf_isom_get_track_id(mp4, i+1), gf_4cc_to_str(mtype));
continue;
default:
/*for all other track types, only split if more than one sample*/
if (gf_isom_get_sample_count(mp4, i+1)==1) {
- fprintf(stderr, "WARNING: Track ID %d (type %s) not handled by spliter - skipping\n", gf_isom_get_track_id(mp4, i+1), gf_4cc_to_str(mtype));
+ fprintf(stderr, "WARNING: Track ID %d (type %s) not handled by splitter - skipping\n", gf_isom_get_track_id(mp4, i+1), gf_4cc_to_str(mtype));
continue;
}
tks[nb_tk].can_duplicate = 1;
@@ -911,7 +1026,7 @@ GF_Err split_isomedia_file(GF_ISOFile *mp4, Double split_dur, u32 split_size_kb,
nb_tk++;
}
if (!nb_tk) {
- fprintf(stderr, "No suitable tracks found for spliting file\n");
+ fprintf(stderr, "No suitable tracks found for splitting file\n");
gf_free(tks);
return GF_NOT_SUPPORTED;
}
@@ -997,13 +1112,21 @@ GF_Err split_isomedia_file(GF_ISOFile *mp4, Double split_dur, u32 split_size_kb,
cur_file = 0;
while (nb_tk_donedst_tk);
}
do_add = 1;
- is_last = 0;
+ is_last_rap = 0;
last_rap_sample_time = 0;
file_split_dur = split_dur;
@@ -1032,7 +1155,7 @@ GF_Err split_isomedia_file(GF_ISOFile *mp4, Double split_dur, u32 split_size_kb,
max_dts = 0;
while (do_add) {
Double time;
- u32 nb_over;
+ u32 nb_over, nb_av = 0;
/*perfom basic de-interleaving to make sure we're not importing too much of a given track*/
u32 nb_add = 0;
/*add one sample of each track*/
@@ -1041,6 +1164,8 @@ GF_Err split_isomedia_file(GF_ISOFile *mp4, Double split_dur, u32 split_size_kb,
u64 dts;
tki = &tks[i];
+ if (!tki->can_duplicate) nb_av++;
+
if (tki->stop_state)
continue;
if (tki->last_sample==tki->sample_count)
@@ -1064,9 +1189,9 @@ GF_Err split_isomedia_file(GF_ISOFile *mp4, Double split_dur, u32 split_size_kb,
t = (Double) (s64) dts;
t /= tki->time_scale;
if (tki->first_sample_done) {
- if (t>max_dts) continue;
+ if (!all_av_done && (t>max_dts)) continue;
} else {
- /*here's the trick: only take care of a/v media for deinterleaving, and ad other media
+ /*here's the trick: only take care of a/v media for splitting, and add other media
only if thir dts is less than the max AV dts found. Otherwise with some text streams we will end up importing
too much video and corrupting the last sync point indication*/
if (!tki->can_duplicate && (t>max_dts)) max_dts = t;
@@ -1084,10 +1209,10 @@ GF_Err split_isomedia_file(GF_ISOFile *mp4, Double split_dur, u32 split_size_kb,
last_rap_sample_time /= tki->time_scale;
e = gf_isom_get_sample_for_media_time(mp4, tki->tk, samp->DTS+tki->firstDTS+2, &sdi, GF_ISOM_SEARCH_SYNC_FORWARD, &next_rap, &next_rap_num);
if (e==GF_EOS)
- is_last = 1;
+ is_last_rap = 1;
if (next_rap) {
if (!next_rap->IsRAP)
- is_last = 1;
+ is_last_rap = 1;
gf_isom_sample_del(&next_rap);
}
}
@@ -1127,6 +1252,8 @@ GF_Err split_isomedia_file(GF_ISOFile *mp4, Double split_dur, u32 split_size_kb,
tki = &tks[i];
if (tki->stop_state) {
nb_over++;
+ if (!tki->can_duplicate && (tki->last_sample==tki->sample_count) )
+ nb_av--;
continue;
}
time = (Double) (s64) tki->lastDTS;
@@ -1138,8 +1265,10 @@ GF_Err split_isomedia_file(GF_ISOFile *mp4, Double split_dur, u32 split_size_kb,
) {
nb_over++;
tki->stop_state = 1;
- if (tki->last_samplesample_count)
- is_last = 0;
+ if (tki->last_samplesample_count)
+ is_last_rap = 0;
+ else if (tki->first_sample_done)
+ is_last_rap = 0;
if (rap_split && tki->next_sample_is_rap) {
file_split_dur = (Double) ( gf_isom_get_sample_dts(mp4, tki->tk, tki->last_sample+1) - tki->firstDTS);
@@ -1160,6 +1289,9 @@ GF_Err split_isomedia_file(GF_ISOFile *mp4, Double split_dur, u32 split_size_kb,
tki->first_sample_done = 0;
}
if (nb_over==nb_tk) do_add = 0;
+
+ if (!nb_av)
+ all_av_done = GF_TRUE;
}
/*remove samples - first figure out smallest duration*/
@@ -1168,7 +1300,7 @@ GF_Err split_isomedia_file(GF_ISOFile *mp4, Double split_dur, u32 split_size_kb,
Double time;
tki = &tks[i];
/*track done*/
- if ((tki->stop_state==2) || (!is_last && (tki->sample_count == tki->last_sample)) ) {
+ if ((tki->stop_state==2) || (!is_last_rap && (tki->sample_count == tki->last_sample)) ) {
if (tki->has_non_raps) last_rap_sample_time = 0;
time = (Double) (s64) ( gf_isom_get_sample_dts(mp4, tki->tk, tki->last_sample+1) - tki->firstDTS);
time /= tki->time_scale;
@@ -1193,14 +1325,15 @@ GF_Err split_isomedia_file(GF_ISOFile *mp4, Double split_dur, u32 split_size_kb,
if (adjust_split_end) {
fprintf(stderr, "Adjusting chunk end time to previous random access at %02.2f sec\n", chunk_start + last_rap_sample_time);
file_split_dur = last_rap_sample_time;
- sprintf(szFile, "%s_%d_%d%s", szName, (u32) chunk_start, (u32) (chunk_start+file_split_dur), ext);
+ if (outName) strcpy(szFile, outName);
+ else sprintf(szFile, "%s_%d_%d%s", szName, (u32) chunk_start, (u32) (chunk_start+file_split_dur), ext);
gf_isom_set_final_name(dest, szFile);
}
else file_split_dur = split_dur;
}
/*don't split if eq to copy...*/
- if (is_last && !cur_file && !chunk_start) {
+ if (is_last_rap && !cur_file && !chunk_start) {
fprintf(stderr, "Cannot split file (Not enough sync samples, duration too large or size too big)\n");
goto err_exit;
}
@@ -1211,27 +1344,25 @@ GF_Err split_isomedia_file(GF_ISOFile *mp4, Double split_dur, u32 split_size_kb,
/*if larger than last RAP, rewind till it*/
if (last_rap_sample_time && (last_rap_sample_timedst_tk);
- if (last_samp<=1) break;
- dts = gf_isom_get_sample_dts(dest, tki->dst_tk, last_samp);
- time = (Double) (s64) dts;
+ time = (Double) (s64) gf_isom_get_media_duration(dest, tki->dst_tk);
+ //time could get slightly higher than requests dur due to rounding precision. We use 1/4 of the last sample dur as safety marge
+ time -= (Double) (s64) gf_isom_get_sample_duration(dest, tki->dst_tk, tki->last_sample) / 4;
time /= tki->time_scale;
- time = (Double) (s64) gf_isom_get_media_duration(dest, tki->dst_tk);
- time /= tki->time_scale;
+ if (last_samp<=1) break;
/*done*/
if (tki->last_sample==tki->sample_count) {
@@ -1257,10 +1388,18 @@ GF_Err split_isomedia_file(GF_ISOFile *mp4, Double split_dur, u32 split_size_kb,
time /= tki->time_scale;
/*re-insert prev sample*/
if (tki->can_duplicate && (time>file_split_dur) ) {
+ Bool was_insert = GF_FALSE;
tki->last_sample--;
dts = gf_isom_get_sample_dts(mp4, tki->tk, tki->last_sample+1);
+ if (dts < tki->firstDTS) was_insert = GF_TRUE;
tki->firstDTS += (u64) (file_split_dur*tki->time_scale);
- gf_isom_set_last_sample_duration(dest, tki->dst_tk, (u32) (tki->firstDTS - dts) );
+ //the original, last sample added starts before the first sample in the file: we have re-inserted
+ //a single sample, use split duration as target duration
+ if (was_insert) {
+ gf_isom_set_last_sample_duration(dest, tki->dst_tk, (u32) (file_split_dur*tki->time_scale));
+ } else {
+ gf_isom_set_last_sample_duration(dest, tki->dst_tk, (u32) (tki->firstDTS - dts) );
+ }
} else {
tki->firstDTS = dts;
}
@@ -1291,7 +1430,7 @@ GF_Err split_isomedia_file(GF_ISOFile *mp4, Double split_dur, u32 split_size_kb,
if (gf_isom_has_time_offset(mp4, tki->tk)) {
gf_isom_set_cts_packing(dest, tki->dst_tk, 0);
}
- if (is_last && tki->can_duplicate) {
+ if (is_last_rap && tki->can_duplicate) {
gf_isom_set_last_sample_duration(dest, tki->dst_tk, gf_isom_get_sample_duration(mp4, tki->tk, tki->sample_count));
}
@@ -1351,7 +1490,7 @@ GF_Err split_isomedia_file(GF_ISOFile *mp4, Double split_dur, u32 split_size_kb,
e = gf_isom_close(dest);
dest = NULL;
if (e) fprintf(stderr, "Error storing file %s\n", gf_error_to_string(e));
- if (is_last || chunk_extraction) break;
+ if (is_last_rap || chunk_extraction) break;
cur_file++;
}
gf_set_progress("Splitting", nb_samp, nb_samp);
@@ -1650,12 +1789,21 @@ GF_Err cat_isomedia_file(GF_ISOFile *dest, char *fileName, u32 import_flags, Dou
/*check language code*/
else if (!skip_lang_test && (mtype==GF_ISOM_MEDIA_AUDIO)) {
u32 lang_src, lang_dst;
- char lang[4];
- lang[3]=0;
- gf_isom_get_media_language(orig, i+1, lang);
- lang_src = GF_4CC(lang[0], lang[1], lang[2], lang[3]);
- gf_isom_get_media_language(dest, j+1, lang);
- lang_dst = GF_4CC(lang[0], lang[1], lang[2], lang[3]);
+ char *lang = NULL;
+ gf_isom_get_media_language(orig, i+1, &lang);
+ if (lang) {
+ lang_src = GF_4CC(lang[0], lang[1], lang[2], lang[3]);
+ gf_free(lang);
+ } else {
+ lang_src = 0;
+ }
+ gf_isom_get_media_language(dest, j+1, &lang);
+ if (lang) {
+ lang_dst = GF_4CC(lang[0], lang[1], lang[2], lang[3]);
+ gf_free(lang);
+ } else {
+ lang_dst = 0;
+ }
if (lang_dst==lang_src) {
dst_tk = j+1;
break;
@@ -2114,6 +2262,7 @@ GF_Err EncodeFile(char *in, GF_ISOFile *mp4, GF_SMEncodeOptions *opts, FILE *log
gf_log_set_tool_level(GF_LOG_CODING, GF_LOG_DEBUG);
prev_logs = gf_log_set_callback(logs, scene_coding_log);
}
+ opts->src_url = in;
e = gf_sm_encode_to_file(ctx, mp4, opts);
if (logs) {
gf_log_set_tool_level(GF_LOG_CODING, GF_LOG_ERROR);
@@ -2277,9 +2426,9 @@ GF_Err EncodeBIFSChunk(GF_SceneManager *ctx, char *bifsOutputFile, GF_Err (*AUCa
e = gf_bifs_encode_au(bifsenc, sc->ESID, au->commands, &data, &data_len);
if (data) {
sprintf(szName, "%s%02d.bifs", szRad, j);
- f = gf_f64_open(szName, "wb");
+ f = gf_fopen(szName, "wb");
gf_fwrite(data, data_len, 1, f);
- fclose(f);
+ gf_fclose(f);
gf_free(data);
}
}
@@ -2433,7 +2582,7 @@ static Bool wgt_enum_files(void *cbck, char *file_name, char *file_path, GF_File
}
static Bool wgt_enum_dir(void *cbck, char *file_name, char *file_path, GF_FileEnumInfo *file_info)
{
- if (!stricmp(file_name, "cvs") || !stricmp(file_name, ".svn")) return 0;
+ if (!stricmp(file_name, "cvs") || !stricmp(file_name, ".svn") || !stricmp(file_name, ".git")) return 0;
gf_enum_directory(file_path, 0, wgt_enum_files, cbck, NULL);
return gf_enum_directory(file_path, 1, wgt_enum_dir, cbck, NULL);
}
@@ -2517,7 +2666,7 @@ GF_ISOFile *package_file(char *file_name, char *fcc, const char *tmpdir, Bool ma
for (i=0; iact_type==4) meta->act_type=5;
+ if (meta->act_type==META_ACTION_SET_XML) meta->act_type=META_ACTION_SET_BINARY_XML;
ret = 1;
}
else if (!strchr(szSlot, '=')) {
switch (meta->act_type) {
- case 0:
+ case META_ACTION_SET_TYPE:
if (!stricmp(szSlot, "null") || !stricmp(szSlot, "0")) meta->meta_4cc = 0;
else meta->meta_4cc = GF_4CC(szSlot[0], szSlot[1], szSlot[2], szSlot[3]);
ret = 1;
break;
- case 1:
- case 4:
- case 7:
+ case META_ACTION_ADD_ITEM:
+ case META_ACTION_SET_XML:
+ case META_ACTION_DUMP_ITEM:
strcpy(meta->szPath, szSlot);
ret = 1;
break;
- case 2:
- case 3:
- case 8:
+ case META_ACTION_REM_ITEM:
+ case META_ACTION_SET_PRIMARY_ITEM:
+ case META_ACTION_DUMP_XML:
meta->item_id = atoi(szSlot);
ret = 1;
break;
+ default:
+ break;
}
}
opts += strlen(szSlot);
@@ -1230,12 +1278,16 @@ static Bool parse_meta_args(MetaAction *meta, u32 act_type, char *opts)
#endif
-
+typedef enum {
+ TSEL_ACTION_SET_PARAM = 0,
+ TSEL_ACTION_REMOVE_TSEL = 1,
+ TSEL_ACTION_REMOVE_ALL_TSEL_IN_GROUP = 2,
+ TSEL_ACTION_REMOVE_ALL_TSEL_IN_FILE = 3,
+} TSELActionType;
typedef struct
{
- /*0: set tsel param - 1 remove tsel - 2 remove all tsel info in alternate group - 3 remove all tsel info in file*/
- u32 act_type;
+ TSELActionType act_type;
u32 trackID;
u32 refTrackID;
@@ -1245,9 +1297,8 @@ typedef struct
u32 switchGroupID;
} TSELAction;
-static Bool parse_tsel_args(TSELAction **__tsel_list, char *opts, u32 *nb_tsel_act)
+static Bool parse_tsel_args(TSELAction **__tsel_list, char *opts, u32 *nb_tsel_act, TSELActionType act)
{
- u32 act;
u32 refTrackID = 0;
Bool has_switch_id;
u32 switch_id = 0;
@@ -1258,7 +1309,6 @@ static Bool parse_tsel_args(TSELAction **__tsel_list, char *opts, u32 *nb_tsel_a
TSELAction *tsel_list = *__tsel_list;
has_switch_id = 0;
- act = tsel_list[*nb_tsel_act].act_type;
if (!opts) return 0;
@@ -1296,7 +1346,7 @@ static Bool parse_tsel_args(TSELAction **__tsel_list, char *opts, u32 *nb_tsel_a
}
}
else if (!strnicmp(szSlot, "trackID=", 8) || !strchr(szSlot, '=') ) {
- __tsel_list = gf_realloc(__tsel_list, sizeof(TSELAction) * (*nb_tsel_act + 1));
+ *__tsel_list = gf_realloc(*__tsel_list, sizeof(TSELAction) * (*nb_tsel_act + 1));
tsel_list = *__tsel_list;
tsel_act = &tsel_list[*nb_tsel_act];
@@ -1322,31 +1372,39 @@ static Bool parse_tsel_args(TSELAction **__tsel_list, char *opts, u32 *nb_tsel_a
#define CHECK_NEXT_ARG if (i+1==(u32)argc) { fprintf(stderr, "Missing arg - please check usage\n"); MP4BOX_EXIT_WITH_CODE(1); }
+typedef enum {
+ TRAC_ACTION_REM_TRACK = 0,
+ TRAC_ACTION_SET_LANGUAGE = 1,
+ TRAC_ACTION_SET_DELAY = 2,
+ TRAC_ACTION_SET_KMS_URI = 3,
+ TRAC_ACTION_SET_PAR = 4,
+ TRAC_ACTION_SET_HANDLER_NAME= 5,
+ TRAC_ACTION_ENABLE = 6,
+ TRAC_ACTION_DISABLE = 7,
+ TRAC_ACTION_REFERENCE = 8,
+ TRAC_ACTION_RAW_EXTRACT = 9,
+ TRAC_ACTION_REM_NON_RAP = 10,
+ TRAC_ACTION_SET_KIND = 11,
+ TRAC_ACTION_REM_KIND = 12,
+ TRAC_ACTION_SET_ID = 13,
+ TRAC_ACTION_SET_UDTA = 14,
+} TrackActionType;
+
typedef struct
{
- /*
- 0: rem track
- 1: set track language
- 2: set track delay
- 3: set track KMS URI
- 4: set visual track PAR if possible
- 5: set track handler name
- 6: enables track
- 7: disables track
- 8: referenceTrack
- 9: raw extraction
- 10: remove non-rap
- */
- u32 act_type;
- /*track ID*/
+ TrackActionType act_type;
u32 trackID;
- char lang[4];
+ char *lang;
s32 delay_ms;
const char *kms;
const char *hdl_name;
s32 par_num, par_den;
u32 dump_type, sample_num;
char *out_name;
+ char *src_name;
+ u32 udta_type;
+ char *kind_scheme, *kind_value;
+ u32 newTrackID;
} TrackAction;
enum
@@ -1366,6 +1424,12 @@ enum
for (i=0; inb_rep_descs; input_index++) { \
- gf_free(dash_inputs->rep_descs[input_index]); \
- } \
- gf_free(dash_inputs->rep_descs); \
- for (input_index = 0; input_index < dash_inputs->nb_as_descs; input_index++) { \
- gf_free(dash_inputs->as_descs[input_index]); \
- } \
- gf_free(dash_inputs->as_descs); \
- for (input_index = 0; input_index < dash_inputs->nb_as_c_descs; input_index++) { \
- gf_free(dash_inputs->as_c_descs[input_index]); \
- } \
- gf_free(dash_inputs->as_c_descs); \
- for (input_index = 0; input_index < dash_inputs->nb_p_descs; input_index++) { \
- gf_free(dash_inputs->p_descs[input_index]); \
- } \
- gf_free(dash_inputs->p_descs); \
+ u32 i, j; \
+ for (i=0;inb_baseURL) { \
+ for (j=0; jnb_baseURL; j++) { \
+ gf_free(di->baseURL[j]); \
+ } \
+ gf_free(di->baseURL); \
+ } \
+ if (di->rep_descs) { \
+ for (j=0; jnb_rep_descs; j++) { \
+ gf_free(di->rep_descs[j]); \
+ } \
+ gf_free(di->rep_descs); \
+ } \
+ if (di->as_descs) { \
+ for (j=0; jnb_as_descs; j++) { \
+ gf_free(di->as_descs[j]); \
+ } \
+ gf_free(di->as_descs); \
+ }\
+ if (di->as_c_descs) { \
+ for (j=0; jnb_as_c_descs; j++) { \
+ gf_free(di->as_c_descs[j]); \
+ } \
+ gf_free(di->as_c_descs); \
+ } \
+ if (di->p_descs) { \
+ for (j=0; jnb_p_descs; j++) { \
+ gf_free(di->p_descs[j]); \
+ } \
+ gf_free(di->p_descs); \
+ } \
+ if (di->representationID) gf_free(di->representationID); \
+ if (di->periodID) gf_free(di->periodID); \
+ if (di->xlink) gf_free(di->xlink); \
+ if (di->role) gf_free(di->role); \
+ }\
gf_free(dash_inputs); \
} \
gf_sys_close(); \
- return __ret_code; \
+ if (__ret_code) return __ret_code; \
+ goto exit; \
GF_DashSegmenterInput *set_dash_input(GF_DashSegmenterInput *dash_inputs, char *name, u32 *nb_dash_inputs)
{
GF_DashSegmenterInput *di;
- char *sep = strchr(name, ':');
- if (sep && (sep[1]=='\\')) sep = strchr(sep+1, ':');
+ char *sep;
+ // skip ./ and ../, and look for first . to figure out extension
+ if ((name[1]=='/') || (name[2]=='/') || (name[1]=='\\') || (name[2]=='\\') ) sep = strchr(name+3, '.');
+ else {
+ char *s2 = strchr(name, ':');
+ sep = strchr(name, '.');
+ if (sep && s2 && (s2 - sep) < 0) {
+ sep = name;
+ }
+ }
+
+ //then look for our opt separator :
+ sep = strchr(sep ? sep : name, ':');
+
+ if (sep && (sep[1]=='\\')) sep = strchr(sep+1, ':');
dash_inputs = gf_realloc(dash_inputs, sizeof(GF_DashSegmenterInput) * (*nb_dash_inputs + 1) );
memset(&dash_inputs[*nb_dash_inputs], 0, sizeof(GF_DashSegmenterInput) );
@@ -1415,12 +1514,14 @@ GF_DashSegmenterInput *set_dash_input(GF_DashSegmenterInput *dash_inputs, char *
while (sep) {
/* this is a real separator if it is followed by a keyword we are looking for */
if (!strnicmp(sep, ":id=", 4) ||
- !strnicmp(sep, ":period=", 8) ||
- !strnicmp(sep, ":bandwidth=", 11) ||
- !strnicmp(sep, ":role=", 6) ||
- !strnicmp(sep, ":desc", 5) ||
- !strnicmp(sep, ":xlink=", 7)) {
- break;
+ !strnicmp(sep, ":period=", 8) ||
+ !strnicmp(sep, ":BaseURL=", 9) ||
+ !strnicmp(sep, ":bandwidth=", 11) ||
+ !strnicmp(sep, ":role=", 6) ||
+ !strnicmp(sep, ":desc", 5) ||
+ !strnicmp(sep, ":duration=", 10) ||
+ !strnicmp(sep, ":xlink=", 7)) {
+ break;
} else {
sep = strchr(sep+1, ':');
}
@@ -1430,7 +1531,7 @@ GF_DashSegmenterInput *set_dash_input(GF_DashSegmenterInput *dash_inputs, char *
if (!strnicmp(opts, "id=", 3)) {
u32 i;
- strncpy(di->representationID, opts+3, 99);
+ di->representationID = gf_strdup(opts+3);
/* check to see if this representation Id has already been assigned */
for (i=0; i<(*nb_dash_inputs)-1; i++) {
GF_DashSegmenterInput *other_di;
@@ -1439,18 +1540,17 @@ GF_DashSegmenterInput *set_dash_input(GF_DashSegmenterInput *dash_inputs, char *
GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("[DASH] Error: Duplicate Representation ID \"%s\" in command line\n", di->representationID));
}
}
- } else if (!strnicmp(opts, "period=", 7)) {
- if (strlen(opts+7) > 99) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("[DASH] PeriodID cannot exceed 99 characters in MP4Box, truncating ...\n"));
- }
- strncpy(di->periodID, opts+7, 99);
- }
- else if (!strnicmp(opts, "bandwidth=", 10)) di->bandwidth = atoi(opts+10);
- else if (!strnicmp(opts, "role=", 5)) strncpy(di->role, opts+5, 99);
+ } else if (!strnicmp(opts, "period=", 7)) di->periodID = gf_strdup(opts+7);
+ else if (!strnicmp(opts, "BaseURL=", 8)) {
+ di->baseURL = (char **)gf_realloc(di->baseURL, (di->nb_baseURL+1)*sizeof(char *));
+ di->baseURL[di->nb_baseURL] = gf_strdup(opts+8);
+ di->nb_baseURL++;
+ } else if (!strnicmp(opts, "bandwidth=", 10)) di->bandwidth = atoi(opts+10);
+ else if (!strnicmp(opts, "role=", 5)) di->role = gf_strdup(opts+5);
else if (!strnicmp(opts, "desc", 4)) {
- u32 *nb_descs;
- char ***descs;
- u32 opt_offset;
+ u32 *nb_descs=NULL;
+ char ***descs=NULL;
+ u32 opt_offset=0;
u32 len;
if (!strnicmp(opts, "desc_p=", 7)) {
nb_descs = &di->nb_p_descs;
@@ -1469,19 +1569,20 @@ GF_DashSegmenterInput *set_dash_input(GF_DashSegmenterInput *dash_inputs, char *
descs = &di->rep_descs;
opt_offset = 9;
}
- (*nb_descs)++;
- opts += opt_offset;
- len = (u32) strlen(opts);
- (*descs) = (char **)gf_realloc((*descs), (*nb_descs)*sizeof(char *));
- (*descs)[(*nb_descs)-1] = (char *)gf_malloc((len+1)*sizeof(char));
- strncpy((*descs)[(*nb_descs)-1], opts, len);
- (*descs)[(*nb_descs)-1][len] = 0;
- }
- else if (!strnicmp(opts, "xlink=", 6)) {
- if (strlen(opts+6) > 199) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("[DASH] XLink cannot exceed 99 characters in MP4Box, truncating ...\n"));
+ if (opt_offset) {
+ (*nb_descs)++;
+ opts += opt_offset;
+ len = (u32) strlen(opts);
+ (*descs) = (char **)gf_realloc((*descs), (*nb_descs)*sizeof(char *));
+ (*descs)[(*nb_descs)-1] = (char *)gf_malloc((len+1)*sizeof(char));
+ strncpy((*descs)[(*nb_descs)-1], opts, len);
+ (*descs)[(*nb_descs)-1][len] = 0;
}
- strncpy(di->xlink, opts+6, 199);
+
+ }
+ else if (!strnicmp(opts, "xlink=", 6)) di->xlink = gf_strdup(opts+6);
+ else if (!strnicmp(opts, "duration=", 9)) {
+ di->period_duration = (Double) atof(opts+9);
}
if (!sep) break;
@@ -1490,7 +1591,11 @@ GF_DashSegmenterInput *set_dash_input(GF_DashSegmenterInput *dash_inputs, char *
}
}
di->file_name = name;
- if (!strlen(di->representationID)) sprintf(di->representationID, "%d", *nb_dash_inputs);
+ if (!di->representationID) {
+ char szRep[100];
+ sprintf(szRep, "%d", *nb_dash_inputs);
+ di->representationID = gf_strdup(szRep);
+ }
return dash_inputs;
}
@@ -1514,6 +1619,13 @@ static GF_Err parse_track_action_params(char *string, TrackAction *action)
action->dump_type |= GF_EXPORT_WEBVTT_META_EMBEDDED;
} else if (!strncmp("output=", param, 7)) {
action->out_name = gf_strdup(param+7);
+ } else if (!strncmp("src=", param, 4)) {
+ action->src_name = gf_strdup(param+4);
+ } else if (!strncmp("box=", param, 4)) {
+ action->src_name = gf_strdup(param+4);
+ action->sample_num = 1;
+ } else if (!strncmp("type=", param, 4)) {
+ action->udta_type = GF_4CC(param[5], param[6], param[7], param[8]);
} else if (action->dump_type == GF_EXPORT_RAW_SAMPLES) {
action->sample_num = atoi(param);
}
@@ -1532,13 +1644,87 @@ static u32 create_new_track_action(char *string, TrackAction **actions, u32 *nb_
{
*actions = (TrackAction *)gf_realloc(*actions, sizeof(TrackAction) * (*nb_track_act+1));
memset(&(*actions)[*nb_track_act], 0, sizeof(TrackAction) );
- (*actions)[*nb_track_act].act_type = 9;
+ (*actions)[*nb_track_act].act_type = TRAC_ACTION_RAW_EXTRACT;
(*actions)[*nb_track_act].dump_type = dump_type;
parse_track_action_params(string, &(*actions)[*nb_track_act]);
(*nb_track_act)++;
return dump_type;
}
+static GF_Err nhml_bs_to_bin(char *inName, char *outName, u32 dump_std)
+{
+ GF_Err e;
+ GF_XMLNode *root;
+ char *data = NULL;
+ u32 data_size;
+
+ GF_DOMParser *dom = gf_xml_dom_new();
+ e = gf_xml_dom_parse(dom, inName, NULL, NULL);
+ if (e) {
+ gf_xml_dom_del(dom);
+ fprintf(stderr, "Failed to parse XML file: %s\n", gf_error_to_string(e));
+ return e;
+ }
+ root = gf_xml_dom_get_root_idx(dom, 0);
+ if (!root) {
+ gf_xml_dom_del(dom);
+ return GF_OK;
+ }
+
+ e = gf_xml_parse_bit_sequence(root, &data, &data_size);
+ gf_xml_dom_del(dom);
+
+ if (e) {
+ fprintf(stderr, "Failed to parse binary sequence: %s\n", gf_error_to_string(e));
+ return e;
+ }
+
+ if (dump_std) {
+ fwrite(data, 1, data_size, stdout);
+ } else {
+ FILE *t;
+ char szFile[GF_MAX_PATH];
+ if (outName) {
+ strcpy(szFile, outName);
+ } else {
+ strcpy(szFile, inName);
+ strcat(szFile, ".bin");
+ }
+ t = gf_fopen(szFile, "wb");
+ if (!t) {
+ fprintf(stderr, "Failed to open file %s\n", szFile);
+ e = GF_IO_ERR;
+ } else {
+ if (fwrite(data, 1, data_size, t) != data_size) {
+ fprintf(stderr, "Failed to write output to file %s\n", szFile);
+ e = GF_IO_ERR;
+ }
+ gf_fclose(t);
+ }
+ }
+ gf_free(data);
+ return e;
+}
+
+
+static GF_Err hash_file(char *name, u32 dump_std)
+{
+ u32 i;
+ u8 hash[20];
+ GF_Err e = gf_media_get_file_hash(name, hash);
+ if (e) return e;
+ if (dump_std==2) {
+ fwrite(hash, 1, 20, stdout);
+ } else if (dump_std==1) {
+ for (i=0; i<20; i++) fprintf(stdout, "%02X", hash[i]);
+ }
+ fprintf(stderr, "File hash (SHA-1): ");
+ for (i=0; i<20; i++) fprintf(stderr, "%02X", hash[i]);
+ fprintf(stderr, "\n");
+
+ return GF_OK;
+}
+
static void on_gpac_log(void *cbk, u32 ll, u32 lm, const char *fmt, va_list list)
{
FILE *logs = cbk;
@@ -1562,19 +1748,27 @@ int mp4boxMain(int argc, char **argv)
s32 subsegs_per_sidx;
u32 *brand_add = NULL;
u32 *brand_rem = NULL;
- GF_DashSwitchingMode bitstream_switching_mode = GF_DASH_BSMODE_INBAND;
- u32 i, stat_level, hint_flags, info_track_id, import_flags, nb_add, nb_cat, crypt, agg_samples, nb_sdp_ex, max_ptime, raw_sample_num, split_size, nb_meta_act, nb_track_act, rtp_rate, major_brand, nb_alt_brand_add, nb_alt_brand_rem, old_interleave, car_dur, minor_version, conv_type, nb_tsel_acts, program_number, dump_nal, time_shift_depth, dash_dynamic, initial_moof_sn, dump_std, dump_mode, import_subtitle;
+ GF_DashSwitchingMode bitstream_switching_mode = GF_DASH_BSMODE_DEFAULT;
+ u32 i, stat_level, hint_flags, info_track_id, import_flags, nb_add, nb_cat, crypt, agg_samples, nb_sdp_ex, max_ptime, raw_sample_num, split_size, nb_meta_act, nb_track_act, rtp_rate, major_brand, nb_alt_brand_add, nb_alt_brand_rem, old_interleave, car_dur, minor_version, conv_type, nb_tsel_acts, program_number, dump_nal, time_shift_depth, initial_moof_sn, dump_std, import_subtitle;
+ GF_DashDynamicMode dash_mode=GF_DASH_STATIC;
+#ifndef GPAC_DISABLE_SCENE_DUMP
+ GF_SceneDumpFormat dump_mode;
+#endif
+ Double mpd_live_duration = 0;
Bool HintIt, needSave, FullInter, Frag, HintInter, dump_rtp, regular_iod, remove_sys_tracks, remove_hint, force_new, remove_root_od;
- Bool print_sdp, print_info, open_edit, dump_isom, dump_cr, force_ocr, encode, do_log, do_flat, dump_srt, dump_ttxt, dump_timestamps, do_saf, dump_m2ts, dump_cart, do_hash, verbose, force_cat, align_cat, pack_wgt, single_group, dash_live, no_fragments_defaults;
+ Bool print_sdp, print_info, open_edit, dump_isom, dump_cr, force_ocr, encode, do_log, do_flat, dump_srt, dump_ttxt, dump_timestamps, do_saf, dump_m2ts, dump_cart, do_hash, verbose, force_cat, align_cat, pack_wgt, single_group, dash_live, no_fragments_defaults, single_traf_per_moof;
char *inName, *outName, *arg, *mediaSource, *tmpdir, *input_ctx, *output_ctx, *drm_file, *avi2raw, *cprt, *chap_file, *pes_dump, *itunes_tags, *pack_file, *raw_cat, *seg_name, *dash_ctx_file;
u32 track_dump_type;
u32 trackID;
Double min_buffer = 1.5;
- u32 ast_shift_sec = 1;
+ s32 ast_offset_ms = 0;
u32 dump_chap = 0;
+ u32 dump_udta_type = 0;
+ u32 dump_udta_track = 0;
char **mpd_base_urls = NULL;
u32 nb_mpd_base_urls=0;
u32 dash_scale = 1000;
+ Bool insert_utc = GF_FALSE;
#ifndef GPAC_DISABLE_MPD
Bool do_mpd = 0;
@@ -1587,8 +1781,10 @@ int mp4boxMain(int argc, char **argv)
u32 MTUSize = 1450;
#endif
GF_ISOFile *file;
- u32 mpd_update_time = 0;
+ Bool frag_real_time = 0;
+ Double mpd_update_time = 0;
Bool stream_rtp=0;
+ Bool force_co64 = GF_FALSE;
Bool live_scene=0;
Bool enable_mem_tracker = 0;
Bool dump_iod=0;
@@ -1600,12 +1796,15 @@ int mp4boxMain(int argc, char **argv)
Bool segment_timeline=0;
u32 segment_marker = 0;
GF_DashProfile dash_profile = GF_DASH_PROFILE_UNKNOWN;
+ const char *dash_profile_extension = NULL;
Bool use_url_template=0;
Bool seg_at_rap=0;
Bool frag_at_rap=0;
Bool adjust_split_end = 0;
Bool memory_frags = 1;
Bool keep_utc = 0;
+ Bool do_bin_nhml = 0;
+ u32 timescale = 0;
const char *do_wget = NULL;
GF_DashSegmenterInput *dash_inputs = NULL;
u32 nb_dash_inputs = 0;
@@ -1616,6 +1815,7 @@ int mp4boxMain(int argc, char **argv)
const char *dash_more_info = NULL;
#if !defined(GPAC_DISABLE_STREAMING)
const char *grab_m2ts = NULL;
+ const char *grab_ifce = NULL;
#endif
FILE *logfile = NULL;
@@ -1631,10 +1831,13 @@ int mp4boxMain(int argc, char **argv)
movie_time = 0;
dump_nal = 0;
FullInter = HintInter = encode = do_log = old_interleave = do_saf = do_hash = verbose = 0;
- dump_mode = Frag = force_ocr = remove_sys_tracks = agg_samples = remove_hint = keep_sys_tracks = remove_root_od = single_group = 0;
+#ifndef GPAC_DISABLE_SCENE_DUMP
+ dump_mode = GF_SM_DUMP_NONE;
+#endif
+ Frag = force_ocr = remove_sys_tracks = agg_samples = remove_hint = keep_sys_tracks = remove_root_od = single_group = 0;
conv_type = HintIt = needSave = print_sdp = print_info = regular_iod = dump_std = open_edit = dump_isom = dump_rtp = dump_cr = dump_srt = dump_ttxt = force_new = dump_timestamps = dump_m2ts = dump_cart = import_subtitle = force_cat = pack_wgt = dash_live = 0;
no_fragments_defaults = 0;
- dash_dynamic = 0;
+ single_traf_per_moof = 0,
/*align cat is the new default behaviour for -cat*/
align_cat = 1;
subsegs_per_sidx = 0;
@@ -1663,8 +1866,6 @@ int mp4boxMain(int argc, char **argv)
swf_flatten_angle = 0.0f;
tmpdir = NULL;
-
-
for (i = 1; i < (u32) argc ; i++) {
if (!strcmp(argv[i], "-mem-track")) {
#ifdef GPAC_MEMORY_TRACKING
@@ -1676,6 +1877,7 @@ int mp4boxMain(int argc, char **argv)
}
}
+ /*init libgpac*/
gf_sys_init(enable_mem_tracker);
if (argc < 2) {
PrintUsage();
@@ -1731,7 +1933,7 @@ int mp4boxMain(int argc, char **argv)
i++;
}
else if (!strcmp(arg, "-log-file") || !strcmp(arg, "-lf")) {
- logfile = gf_f64_open(argv[i+1], "wt");
+ logfile = gf_fopen(argv[i+1], "wt");
gf_log_set_callback(logfile, on_gpac_log);
i++;
}
@@ -1753,6 +1955,12 @@ int mp4boxMain(int argc, char **argv)
grab_m2ts = argv[i+1];
i++;
}
+ else if (!stricmp(arg, "-ifce")) {
+ CHECK_NEXT_ARG
+ grab_ifce = argv[i+1];
+ i++;
+ }
+
#endif
#if !defined(GPAC_DISABLE_CORE_TOOLS)
else if (!stricmp(arg, "-wget")) {
@@ -1870,13 +2078,13 @@ int mp4boxMain(int argc, char **argv)
else if (!stricmp(arg, "-stdb")) dump_std = 1;
#if !defined(GPAC_DISABLE_MEDIA_EXPORT) && !defined(GPAC_DISABLE_SCENE_DUMP)
- else if (!stricmp(arg, "-bt")) dump_mode = 1 + GF_SM_DUMP_BT;
- else if (!stricmp(arg, "-xmt")) dump_mode = 1 + GF_SM_DUMP_XMTA;
- else if (!stricmp(arg, "-wrl")) dump_mode = 1 + GF_SM_DUMP_VRML;
- else if (!stricmp(arg, "-x3dv")) dump_mode = 1 + GF_SM_DUMP_X3D_VRML;
- else if (!stricmp(arg, "-x3d")) dump_mode = 1 + GF_SM_DUMP_X3D_XML;
- else if (!stricmp(arg, "-lsr")) dump_mode = 1 + GF_SM_DUMP_LASER;
- else if (!stricmp(arg, "-svg")) dump_mode = 1 + GF_SM_DUMP_SVG;
+ else if (!stricmp(arg, "-bt")) dump_mode = GF_SM_DUMP_BT;
+ else if (!stricmp(arg, "-xmt")) dump_mode = GF_SM_DUMP_XMTA;
+ else if (!stricmp(arg, "-wrl")) dump_mode = GF_SM_DUMP_VRML;
+ else if (!stricmp(arg, "-x3dv")) dump_mode = GF_SM_DUMP_X3D_VRML;
+ else if (!stricmp(arg, "-x3d")) dump_mode = GF_SM_DUMP_X3D_XML;
+ else if (!stricmp(arg, "-lsr")) dump_mode = GF_SM_DUMP_LASER;
+ else if (!stricmp(arg, "-svg")) dump_mode = GF_SM_DUMP_SVG;
#endif /*defined(GPAC_DISABLE_MEDIA_EXPORT) && !defined(GPAC_DISABLE_SCENE_DUMP)*/
else if (!stricmp(arg, "-stat")) stat_level = 1;
@@ -1887,6 +2095,23 @@ int mp4boxMain(int argc, char **argv)
else if (!stricmp(arg, "-dump-chap")) dump_chap = 1;
else if (!stricmp(arg, "-dump-chap-ogg")) dump_chap = 2;
else if (!stricmp(arg, "-hash")) do_hash = 1;
+ else if (!stricmp(arg, "-bin")) do_bin_nhml = 1;
+ else if (!stricmp(arg, "-dump-udta")) {
+ char *sep, *code;
+ CHECK_NEXT_ARG
+ sep = strchr(argv[i+1], ':');
+ if (sep) {
+ sep[0] = 0;
+ dump_udta_track = atoi(argv[i+1]);
+ sep[0] = ':';
+ code = &sep[1];
+ } else {
+ code = argv[i+1];
+ }
+ dump_udta_type = GF_4CC(code[0], code[1], code[2], code[3]);
+ i++;
+ }
+
#if 0
else if (!stricmp(arg, "-conf")) {
@@ -1934,8 +2159,8 @@ int mp4boxMain(int argc, char **argv)
MP4BOX_EXIT_WITH_CODE(1);
}
#endif
- if (!stricmp(arg, "-ttxt")) dump_ttxt = 1;
- else dump_srt = 1;
+ if (!stricmp(arg, "-ttxt")) dump_ttxt = GF_TRUE;
+ else dump_srt = GF_TRUE;
import_subtitle = 1;
} else if (!stricmp(arg, "-dm2ts")) {
dump_m2ts = 1;
@@ -2001,6 +2226,10 @@ int mp4boxMain(int argc, char **argv)
CHECK_NEXT_ARG tmpdir = argv[i+1];
i++;
}
+ else if (!stricmp(arg, "-co64")) {
+ force_co64 = GF_TRUE;
+ open_edit = 1;
+ }
else if (!stricmp(arg, "-write-buffer")) {
CHECK_NEXT_ARG
gf_isom_set_output_buffering(NULL, atoi(argv[i+1]));
@@ -2071,16 +2300,26 @@ int mp4boxMain(int argc, char **argv)
CHECK_NEXT_ARG
if (!stricmp(argv[i+1], "no") || !stricmp(argv[i+1], "off")) bitstream_switching_mode = GF_DASH_BSMODE_NONE;
else if (!stricmp(argv[i+1], "merge")) bitstream_switching_mode = GF_DASH_BSMODE_MERGED;
+ else if (!stricmp(argv[i+1], "multi")) bitstream_switching_mode = GF_DASH_BSMODE_MULTIPLE_ENTRIES;
else if (!stricmp(argv[i+1], "single")) bitstream_switching_mode = GF_DASH_BSMODE_SINGLE;
else if (!stricmp(argv[i+1], "inband")) bitstream_switching_mode = GF_DASH_BSMODE_INBAND;
- else bitstream_switching_mode = GF_DASH_BSMODE_INBAND;
+ else {
+ fprintf(stderr, "\tWARNING: Unrecognized bitstream switchin mode \"%s\" - please check usage\n", argv[i+1]);
+ MP4BOX_EXIT_WITH_CODE(1);
+ }
i++;
}
else if (!stricmp(arg, "-dynamic")) {
- dash_dynamic = 1;
+ dash_mode = GF_DASH_DYNAMIC;
+ }
+ else if (!stricmp(arg, "-last-dynamic")) {
+ dash_mode = GF_DASH_DYNAMIC_LAST;
+ }
+ else if (!stricmp(arg, "-frag-rt")) {
+ frag_real_time = GF_TRUE;
}
else if (!strnicmp(arg, "-dash-live", 10) || !strnicmp(arg, "-ddbg-live", 10)) {
- dash_dynamic = !strnicmp(arg, "-ddbg-live", 10) ? 2 : 1;
+ dash_mode = !strnicmp(arg, "-ddbg-live", 10) ? GF_DASH_DYNAMIC_DEBUG : GF_DASH_DYNAMIC;
dash_live = 1;
if (arg[10]=='=') {
dash_ctx_file = arg+11;
@@ -2089,8 +2328,12 @@ int mp4boxMain(int argc, char **argv)
dash_duration = atof(argv[i+1]) / 1000;
i++;
}
+ else if (!stricmp(arg, "-mpd-duration")) {
+ CHECK_NEXT_ARG mpd_live_duration = atof(argv[i+1]);
+ i++;
+ }
else if (!stricmp(arg, "-mpd-refresh")) {
- CHECK_NEXT_ARG mpd_update_time = atoi(argv[i+1]);
+ CHECK_NEXT_ARG mpd_update_time = atof(argv[i+1]);
i++;
}
else if (!stricmp(arg, "-time-shift")) {
@@ -2106,7 +2349,7 @@ int mp4boxMain(int argc, char **argv)
}
else if (!stricmp(arg, "-ast-offset")) {
CHECK_NEXT_ARG
- ast_shift_sec = (u32) atoi(argv[i+1]);
+ ast_offset_ms = atoi(argv[i+1]);
i++;
}
else if (!stricmp(arg, "-moof-sn")) {
@@ -2122,6 +2365,9 @@ int mp4boxMain(int argc, char **argv)
else if (!stricmp(arg, "-no-frags-default")) {
no_fragments_defaults = 1;
}
+ else if (!stricmp(arg, "-single-traf")) {
+ single_traf_per_moof = 1;
+ }
else if (!stricmp(arg, "-mpd-title")) {
CHECK_NEXT_ARG dash_title = argv[i+1];
i++;
@@ -2142,7 +2388,6 @@ int mp4boxMain(int argc, char **argv)
nb_mpd_base_urls++;
i++;
}
-
else if (!stricmp(arg, "-dash-ctx")) {
CHECK_NEXT_ARG
dash_ctx_file = argv[i+1];
@@ -2161,15 +2406,19 @@ int mp4boxMain(int argc, char **argv)
CHECK_NEXT_ARG
if (!stricmp(argv[i+1], "live") || !stricmp(argv[i+1], "simple")) dash_profile = GF_DASH_PROFILE_LIVE;
else if (!stricmp(argv[i+1], "onDemand")) dash_profile = GF_DASH_PROFILE_ONDEMAND;
- else if (!stricmp(argv[i+1], "dashavc264:live")) {
+ else if (!stricmp(argv[i+1], "hbbtv1.5:live")) {
+ dash_profile = GF_DASH_PROFILE_HBBTV_1_5_ISOBMF_LIVE;
+ } else if (!stricmp(argv[i+1], "dashavc264:live")) {
dash_profile = GF_DASH_PROFILE_AVC264_LIVE;
- no_fragments_defaults = 1;
} else if (!stricmp(argv[i+1], "dashavc264:onDemand")) {
dash_profile = GF_DASH_PROFILE_AVC264_ONDEMAND;
- no_fragments_defaults = 1;
} else if (!stricmp(argv[i+1], "main")) dash_profile = GF_DASH_PROFILE_MAIN;
else dash_profile = GF_DASH_PROFILE_FULL;
i++;
+ } else if (!stricmp(arg, "-profile-ext")) {
+ CHECK_NEXT_ARG
+ dash_profile_extension = argv[i+1];
+ i++;
} else if (!strnicmp(arg, "-url-template", 13)) {
use_url_template = 1;
if ((arg[13]=='=') && arg[14]) {
@@ -2184,6 +2433,9 @@ int mp4boxMain(int argc, char **argv)
CHECK_NEXT_ARG
m = argv[i+1];
segment_marker = GF_4CC(m[0], m[1], m[2], m[3]);
+ i++;
+ } else if (!stricmp(arg, "-insert-utc")) {
+ insert_utc = GF_TRUE;
} else if (!stricmp(arg, "-itags")) {
CHECK_NEXT_ARG itunes_tags = argv[i+1];
i++;
@@ -2210,7 +2462,7 @@ int mp4boxMain(int argc, char **argv)
if (sscanf(argv[i+1], "%d", &trackID) == 1) {
tracks = gf_realloc(tracks, sizeof(TrackAction) * (nb_track_act+1));
memset(&tracks[nb_track_act], 0, sizeof(TrackAction) );
- tracks[nb_track_act].act_type = 10;
+ tracks[nb_track_act].act_type = TRAC_ACTION_REM_NON_RAP;
tracks[nb_track_act].trackID = trackID;
nb_track_act++;
i++;
@@ -2292,7 +2544,7 @@ int mp4boxMain(int argc, char **argv)
track_dump_type = GF_EXPORT_MP4;
tracks = gf_realloc(tracks, sizeof(TrackAction) * (nb_track_act+1));
memset(&tracks[nb_track_act], 0, sizeof(TrackAction) );
- tracks[nb_track_act].act_type = 9;
+ tracks[nb_track_act].act_type = TRAC_ACTION_RAW_EXTRACT;
tracks[nb_track_act].trackID = atoi(argv[i+1]);
tracks[nb_track_act].dump_type = GF_EXPORT_MP4;
nb_track_act++;
@@ -2300,9 +2552,25 @@ int mp4boxMain(int argc, char **argv)
#endif
}
else if (!stricmp(arg, "-iod")) regular_iod = 1;
- else if (!stricmp(arg, "-flat")) do_flat = 1;
+ else if (!stricmp(arg, "-flat")) {
+ open_edit = 1;
+ do_flat = 1;
+ }
else if (!stricmp(arg, "-keep-utc")) keep_utc = 1;
else if (!stricmp(arg, "-new")) force_new = 1;
+ else if (!stricmp(arg, "-timescale")) {
+ CHECK_NEXT_ARG
+ timescale = atoi(argv[i+1]);
+ open_edit = 1;
+ i++;
+ }
+ else if (!stricmp(arg, "-udta")) {
+ CHECK_NEXT_ARG
+ create_new_track_action(argv[i+1], &tracks, &nb_track_act, 0);
+ tracks[nb_track_act-1].act_type = TRAC_ACTION_SET_UDTA;
+ open_edit = 1;
+ i++;
+ }
else if (!stricmp(arg, "-add") || !stricmp(arg, "-import") || !stricmp(arg, "-convert")) {
CHECK_NEXT_ARG
if (!stricmp(arg, "-import")) fprintf(stderr, "\tWARNING: \"-import\" is deprecated - use \"-add\"\n");
@@ -2340,11 +2608,26 @@ int mp4boxMain(int argc, char **argv)
CHECK_NEXT_ARG
tracks = gf_realloc(tracks, sizeof(TrackAction) * (nb_track_act+1));
memset(&tracks[nb_track_act], 0, sizeof(TrackAction) );
-
- if (!stricmp(arg, "-enable")) tracks[nb_track_act].act_type = 6;
- else if (!stricmp(arg, "-disable")) tracks[nb_track_act].act_type = 7;
- else tracks[nb_track_act].act_type = 0;
+ if (!stricmp(arg, "-enable")) tracks[nb_track_act].act_type = TRAC_ACTION_ENABLE;
+ else if (!stricmp(arg, "-disable")) tracks[nb_track_act].act_type = TRAC_ACTION_DISABLE;
+ else tracks[nb_track_act].act_type = TRAC_ACTION_REM_TRACK;
+ tracks[nb_track_act].trackID = atoi(argv[i+1]);
+ open_edit = 1;
+ nb_track_act++;
+ i++;
+ }
+ else if (!stricmp(arg, "-set-track-id")) {
+ char *sep;
+ CHECK_NEXT_ARG
+ tracks = gf_realloc(tracks, sizeof(TrackAction) * (nb_track_act+1));
+ memset(&tracks[nb_track_act], 0, sizeof(TrackAction) );
+ tracks[nb_track_act].act_type = TRAC_ACTION_SET_ID;
+ sep = strchr(argv[i+1], ':');
+ *sep = 0;
tracks[nb_track_act].trackID = atoi(argv[i+1]);
+ *sep = ':';
+ sep++;
+ tracks[nb_track_act].newTrackID = atoi(sep);
open_edit = 1;
nb_track_act++;
i++;
@@ -2355,7 +2638,7 @@ int mp4boxMain(int argc, char **argv)
tracks = gf_realloc(tracks, sizeof(TrackAction) * (nb_track_act+1));
memset(&tracks[nb_track_act], 0, sizeof(TrackAction) );
- tracks[nb_track_act].act_type = 4;
+ tracks[nb_track_act].act_type = TRAC_ACTION_SET_PAR;
assert(strlen(argv[i+1])+1 <= sizeof(szTK));
strncpy(szTK, argv[i+1], sizeof(szTK));
ext = strchr(szTK, '=');
@@ -2386,17 +2669,16 @@ int mp4boxMain(int argc, char **argv)
tracks = gf_realloc(tracks, sizeof(TrackAction) * (nb_track_act+1));
memset(&tracks[nb_track_act], 0, sizeof(TrackAction) );
- tracks[nb_track_act].act_type = 1;
- tracks[nb_track_act].lang[3] = 0;
+ tracks[nb_track_act].act_type = TRAC_ACTION_SET_LANGUAGE;
tracks[nb_track_act].trackID = 0;
strcpy(szTK, argv[i+1]);
ext = strchr(szTK, '=');
if (!strnicmp(argv[i+1], "all=", 4)) {
- strncpy(tracks[nb_track_act].lang, argv[i+1]+1, 3);
+ tracks[nb_track_act].lang = gf_strdup(argv[i+1]+4);
} else if (!ext) {
- strncpy(tracks[nb_track_act].lang, argv[i+1], 3);
+ tracks[nb_track_act].lang = gf_strdup(argv[i+1]);
} else {
- strncpy(tracks[nb_track_act].lang, ext+1, 3);
+ tracks[nb_track_act].lang = gf_strdup(ext+1);
ext[0] = 0;
tracks[nb_track_act].trackID = atoi(szTK);
ext[0] = '=';
@@ -2405,6 +2687,56 @@ int mp4boxMain(int argc, char **argv)
nb_track_act++;
i++;
}
+ else if (!stricmp(arg, "-kind") || !stricmp(arg, "-kind-rem")) {
+ char szTK[200], *ext;
+ char *scheme_start = NULL;
+ Bool has_track_id = GF_FALSE;
+ CHECK_NEXT_ARG
+ tracks = gf_realloc(tracks, sizeof(TrackAction) * (nb_track_act+1));
+ memset(&tracks[nb_track_act], 0, sizeof(TrackAction) );
+
+ if (!stricmp(arg, "-kind")) {
+ tracks[nb_track_act].act_type = TRAC_ACTION_SET_KIND;
+ } else {
+ tracks[nb_track_act].act_type = TRAC_ACTION_REM_KIND;
+ }
+ tracks[nb_track_act].trackID = 0;
+ if (!strnicmp(argv[i+1], "all=", 4)) {
+ scheme_start = argv[i+1]+4;
+ has_track_id = GF_TRUE;
+ }
+ if (!scheme_start) {
+ if (strlen(argv[i+1])>200) {
+ GF_LOG(GF_LOG_WARNING, GF_LOG_ALL, ("Warning: track kind parameter is too long!"));
+ }
+ strncpy(szTK, argv[i+1], 200);
+ ext = strchr(szTK, '=');
+ if (ext && !has_track_id) {
+ ext[0] = 0;
+ has_track_id = (sscanf(szTK, "%d", &tracks[nb_track_act].trackID) == 1 ? GF_TRUE : GF_FALSE);
+ if (has_track_id) {
+ scheme_start = ext+1;
+ } else {
+ scheme_start = szTK;
+ }
+ ext[0] = '=';
+ } else {
+ scheme_start = szTK;
+ }
+ }
+ ext = strchr(scheme_start, '=');
+ if (!ext) {
+ tracks[nb_track_act].kind_scheme = gf_strdup(scheme_start);
+ } else {
+ ext[0] = 0;
+ tracks[nb_track_act].kind_scheme = gf_strdup(scheme_start);
+ ext[0] = '=';
+ tracks[nb_track_act].kind_value = gf_strdup(ext+1);
+ }
+ open_edit = 1;
+ nb_track_act++;
+ i++;
+ }
else if (!stricmp(arg, "-delay")) {
char szTK[20], *ext;
CHECK_NEXT_ARG
@@ -2417,7 +2749,7 @@ int mp4boxMain(int argc, char **argv)
fprintf(stderr, "Bad format for track delay - expecting ID=DLAY got %s\n", argv[i+1]);
MP4BOX_EXIT_WITH_CODE(1);
}
- tracks[nb_track_act].act_type = 2;
+ tracks[nb_track_act].act_type = TRAC_ACTION_SET_DELAY;
tracks[nb_track_act].delay_ms = atoi(ext+1);
ext[0] = 0;
tracks[nb_track_act].trackID = atoi(szTK);
@@ -2437,7 +2769,7 @@ int mp4boxMain(int argc, char **argv)
fprintf(stderr, "Bad format for track reference - expecting ID:XXXX:refID got %s\n", argv[i+1]);
MP4BOX_EXIT_WITH_CODE(1);
}
- tracks[nb_track_act].act_type = 8;
+ tracks[nb_track_act].act_type = TRAC_ACTION_REFERENCE;
ext[0] = 0;
tracks[nb_track_act].trackID = atoi(szTK);
ext[0] = ':';
@@ -2448,7 +2780,7 @@ int mp4boxMain(int argc, char **argv)
MP4BOX_EXIT_WITH_CODE(1);
}
ext[0] = 0;
- strncpy(tracks[nb_track_act].lang, szTK, 4);
+ tracks[nb_track_act].lang = gf_strdup(szTK);
ext[0] = ':';
tracks[nb_track_act].delay_ms = (s32) atoi(ext+1);
open_edit = 1;
@@ -2467,7 +2799,7 @@ int mp4boxMain(int argc, char **argv)
fprintf(stderr, "Bad format for track name - expecting ID=name got %s\n", argv[i+1]);
MP4BOX_EXIT_WITH_CODE(1);
}
- tracks[nb_track_act].act_type = 5;
+ tracks[nb_track_act].act_type = TRAC_ACTION_SET_HANDLER_NAME;
tracks[nb_track_act].hdl_name = strchr(argv[i+1], '=') + 1;
ext[0] = 0;
tracks[nb_track_act].trackID = atoi(szTK);
@@ -2522,7 +2854,7 @@ int mp4boxMain(int argc, char **argv)
else if (!stricmp(arg, "-mpd")) {
do_mpd = 1;
CHECK_NEXT_ARG
- outName = argv[i+1];
+ inName = argv[i+1];
i++;
}
#endif
@@ -2612,7 +2944,7 @@ int mp4boxMain(int argc, char **argv)
strncpy(szTK, argv[i+1], 19);
ext = strchr(szTK, '=');
- tracks[nb_track_act].act_type = 3;
+ tracks[nb_track_act].act_type = TRAC_ACTION_SET_KMS_URI;
tracks[nb_track_act].trackID = 0;
if (!strnicmp(argv[i+1], "all=", 4)) {
tracks[nb_track_act].kms = argv[i+1] + 4;
@@ -2666,60 +2998,67 @@ int mp4boxMain(int argc, char **argv)
/*meta*/
else if (!stricmp(arg, "-set-meta")) {
metas = gf_realloc(metas, sizeof(MetaAction) * (nb_meta_act+1));
- parse_meta_args(&metas[nb_meta_act], 0, argv[i+1]);
+ parse_meta_args(&metas[nb_meta_act], META_ACTION_SET_TYPE, argv[i+1]);
nb_meta_act++;
open_edit = 1;
i++;
}
else if (!stricmp(arg, "-add-item")) {
metas = gf_realloc(metas, sizeof(MetaAction) * (nb_meta_act+1));
- parse_meta_args(&metas[nb_meta_act], 1, argv[i+1]);
+ parse_meta_args(&metas[nb_meta_act], META_ACTION_ADD_ITEM, argv[i+1]);
nb_meta_act++;
open_edit = 1;
i++;
}
else if (!stricmp(arg, "-rem-item")) {
metas = gf_realloc(metas, sizeof(MetaAction) * (nb_meta_act+1));
- parse_meta_args(&metas[nb_meta_act], 2, argv[i+1]);
+ parse_meta_args(&metas[nb_meta_act], META_ACTION_REM_ITEM, argv[i+1]);
nb_meta_act++;
open_edit = 1;
i++;
}
else if (!stricmp(arg, "-set-primary")) {
metas = gf_realloc(metas, sizeof(MetaAction) * (nb_meta_act+1));
- parse_meta_args(&metas[nb_meta_act], 3, argv[i+1]);
+ parse_meta_args(&metas[nb_meta_act], META_ACTION_SET_PRIMARY_ITEM, argv[i+1]);
nb_meta_act++;
open_edit = 1;
i++;
}
else if (!stricmp(arg, "-set-xml")) {
metas = gf_realloc(metas, sizeof(MetaAction) * (nb_meta_act+1));
- parse_meta_args(&metas[nb_meta_act], 4, argv[i+1]);
+ parse_meta_args(&metas[nb_meta_act], META_ACTION_SET_XML, argv[i+1]);
nb_meta_act++;
open_edit = 1;
i++;
}
else if (!stricmp(arg, "-rem-xml")) {
metas = gf_realloc(metas, sizeof(MetaAction) * (nb_meta_act+1));
- if (parse_meta_args(&metas[nb_meta_act], 6, argv[i+1])) i++;
+ if (parse_meta_args(&metas[nb_meta_act], META_ACTION_REM_XML, argv[i+1])) i++;
nb_meta_act++;
open_edit = 1;
}
else if (!stricmp(arg, "-dump-xml")) {
metas = gf_realloc(metas, sizeof(MetaAction) * (nb_meta_act+1));
- parse_meta_args(&metas[nb_meta_act], 7, argv[i+1]);
+ parse_meta_args(&metas[nb_meta_act], META_ACTION_DUMP_XML, argv[i+1]);
nb_meta_act++;
i++;
}
else if (!stricmp(arg, "-dump-item")) {
metas = gf_realloc(metas, sizeof(MetaAction) * (nb_meta_act+1));
- parse_meta_args(&metas[nb_meta_act], 8, argv[i+1]);
+ parse_meta_args(&metas[nb_meta_act], META_ACTION_DUMP_ITEM, argv[i+1]);
nb_meta_act++;
i++;
}
else if (!stricmp(arg, "-group-add") || !stricmp(arg, "-group-rem-track") || !stricmp(arg, "-group-rem")) {
- tsel_acts[nb_tsel_acts].act_type = !stricmp(arg, "-group-rem") ? 2 : ( !stricmp(arg, "-group-rem-track") ? 1 : 0 );
- if (parse_tsel_args(&tsel_acts, argv[i+1], &nb_tsel_acts)==0) {
+ TSELActionType act_type;
+ if (!stricmp(arg, "-group-rem")) {
+ act_type = TSEL_ACTION_REMOVE_ALL_TSEL_IN_GROUP;
+ } else if ( !stricmp(arg, "-group-rem-track")) {
+ act_type = TSEL_ACTION_REMOVE_TSEL;
+ } else {
+ act_type = TSEL_ACTION_SET_PARAM;
+ }
+ if (parse_tsel_args(&tsel_acts, argv[i+1], &nb_tsel_acts, act_type)==0) {
fprintf(stderr, "Invalid group syntax - check usage\n");
MP4BOX_EXIT_WITH_CODE(1);
}
@@ -2727,7 +3066,7 @@ int mp4boxMain(int argc, char **argv)
i++;
}
else if (!stricmp(arg, "-group-clean")) {
- tsel_acts[nb_tsel_acts].act_type = 3;
+ tsel_acts[nb_tsel_acts].act_type = TSEL_ACTION_REMOVE_ALL_TSEL_IN_FILE;
nb_tsel_acts++;
open_edit=1;
}
@@ -2880,16 +3219,16 @@ int mp4boxMain(int argc, char **argv)
char chunk[4096];
FILE *fin, *fout;
s64 to_copy, done;
- fin = gf_f64_open(raw_cat, "rb");
+ fin = gf_fopen(raw_cat, "rb");
if (!fin) MP4BOX_EXIT_WITH_CODE(1);
- fout = gf_f64_open(inName, "a+b");
+ fout = gf_fopen(inName, "a+b");
if (!fout) {
- fclose(fin);
+ gf_fclose(fin);
MP4BOX_EXIT_WITH_CODE(1);
}
- gf_f64_seek(fin, 0, SEEK_END);
- to_copy = gf_f64_tell(fin);
- gf_f64_seek(fin, 0, SEEK_SET);
+ gf_fseek(fin, 0, SEEK_END);
+ to_copy = gf_ftell(fin);
+ gf_fseek(fin, 0, SEEK_SET);
done = 0;
while (1) {
u32 nb_bytes = (u32) fread(chunk, 1, 4096, fin);
@@ -2898,20 +3237,15 @@ int mp4boxMain(int argc, char **argv)
fprintf(stderr, "Appending file %s - %02.2f done\r", raw_cat, 100.0*done/to_copy);
if (done >= to_copy) break;
}
- fclose(fin);
- fclose(fout);
+ gf_fclose(fin);
+ gf_fclose(fout);
MP4BOX_EXIT_WITH_CODE(0);
}
#if !defined(GPAC_DISABLE_STREAMING)
if (grab_m2ts) {
- return grab_live_m2ts(grab_m2ts, inName);
+ return grab_live_m2ts(grab_m2ts, grab_ifce, inName);
}
#endif
- /*init libgpac*/
- if (enable_mem_tracker) {
- gf_sys_close();
- gf_sys_init(enable_mem_tracker);
- }
if (gf_logs) {
//gf_log_set_tools_levels(gf_logs);
@@ -2935,7 +3269,7 @@ int mp4boxMain(int argc, char **argv)
#if !defined(DISABLE_CORE_TOOLS)
if (do_wget != NULL) {
- e = gf_dm_wget(do_wget, inName, 0, 0);
+ e = gf_dm_wget(do_wget, inName, 0, 0, NULL);
if (e != GF_OK) {
fprintf(stderr, "Cannot retrieve %s: %s\n", do_wget, gf_error_to_string(e) );
}
@@ -2945,25 +3279,25 @@ int mp4boxMain(int argc, char **argv)
#ifndef GPAC_DISABLE_MPD
if (do_mpd) {
- Bool remote = 0;
- char *mpd_base_url = gf_strdup(inName);
+ Bool remote = GF_FALSE;
+ char *mpd_base_url = NULL;
if (!strnicmp(inName, "http://", 7)) {
#if !defined(GPAC_DISABLE_CORE_TOOLS)
- e = gf_dm_wget(inName, "tmp_main.m3u8", 0, 0);
+ e = gf_dm_wget(inName, "tmp_main.m3u8", 0, 0, &mpd_base_url);
if (e != GF_OK) {
fprintf(stderr, "Cannot retrieve M3U8 (%s): %s\n", inName, gf_error_to_string(e));
- gf_free(mpd_base_url);
+ if (mpd_base_url) gf_free(mpd_base_url);
MP4BOX_EXIT_WITH_CODE(1);
}
- inName = "tmp_main.m3u8";
- remote = 1;
+ remote = GF_TRUE;
#else
+ gf_free(mpd_base_url);
fprintf(stderr, "HTTP Downloader disabled in this build\n");
MP4BOX_EXIT_WITH_CODE(1);
#endif
}
- e = gf_m3u8_to_mpd(inName, mpd_base_url, (outName ? outName : inName), 0, "video/mp2t", 1, use_url_template, NULL);
- gf_free(mpd_base_url);
+ e = gf_m3u8_to_mpd(remote ? "tmp_main.m3u8" : inName, mpd_base_url ? mpd_base_url : inName, (outName ? outName : inName), 0, "video/mp2t", GF_TRUE, use_url_template, NULL);
+ if (mpd_base_url) gf_free(mpd_base_url);
if (remote) {
//gf_delete_file("tmp_main.m3u8");
@@ -2984,28 +3318,40 @@ int mp4boxMain(int argc, char **argv)
if (do_saf && !encode) {
switch (get_file_type_by_ext(inName)) {
- case 2:
- case 3:
- case 4:
+ case GF_FILE_TYPE_BT_WRL_X3DV:
+ case GF_FILE_TYPE_XMT_X3D:
+ case GF_FILE_TYPE_SVG:
encode = 1;
break;
+ case GF_FILE_TYPE_NOT_SUPPORTED:
+ case GF_FILE_TYPE_ISO_MEDIA:
+ case GF_FILE_TYPE_SWF:
+ case GF_FILE_TYPE_LSR_SAF:
+ break;
}
}
#ifndef GPAC_DISABLE_SCENE_DUMP
- if (dump_mode == 1 + GF_SM_DUMP_SVG) {
+ if (dump_mode == GF_SM_DUMP_SVG) {
if (strstr(inName, ".srt") || strstr(inName, ".ttxt")) import_subtitle = 2;
}
#endif
if (import_subtitle && !trackID) {
+ /* We import the subtitle file,
+ i.e. we parse it and store the content as samples of a 3GPP Timed Text track in an ISO file,
+ possibly for later export (e.g. when converting SRT to TTXT, ...) */
#ifndef GPAC_DISABLE_MEDIA_IMPORT
GF_MediaImporter import;
+ /* Prepare the importer */
file = gf_isom_open("ttxt_convert", GF_ISOM_OPEN_WRITE, NULL);
+ if (timescale && file) gf_isom_set_timescale(file, timescale);
+
memset(&import, 0, sizeof(GF_MediaImporter));
import.dest = file;
import.in_name = inName;
+ /* Start the import */
e = gf_media_import(&import);
if (e) {
fprintf(stderr, "Error importing %s: %s\n", inName, gf_error_to_string(e));
@@ -3013,14 +3359,20 @@ int mp4boxMain(int argc, char **argv)
gf_delete_file("ttxt_convert");
MP4BOX_EXIT_WITH_CODE(1);
}
- strcpy(outfile, outName ? outName : inName);
+ /* Prepare the export */
+ strcpy(outfile, inName);
if (strchr(outfile, '.')) {
while (outfile[strlen(outfile)-1] != '.') outfile[strlen(outfile)-1] = 0;
outfile[strlen(outfile)-1] = 0;
}
#ifndef GPAC_DISABLE_ISOM_DUMP
- dump_timed_text_track(file, gf_isom_get_track_id(file, 1), dump_std ? NULL : outfile, 1, (import_subtitle==2) ? 2 : dump_srt);
+ /* Start the export of the track #1, in the appropriate dump type, indicating it's a conversion */
+ dump_timed_text_track(file, gf_isom_get_track_id(file, 1),
+ dump_std ? NULL : outfile,
+ GF_TRUE,
+ (import_subtitle==2) ? GF_TEXTDUMPTYPE_SVG : (dump_srt ? GF_TEXTDUMPTYPE_SRT : GF_TEXTDUMPTYPE_TTXT));
#endif
+ /* Clean the importer */
gf_isom_delete(file);
gf_delete_file("ttxt_convert");
if (e) {
@@ -3040,12 +3392,12 @@ int mp4boxMain(int argc, char **argv)
if (force_new) {
open_mode = (do_flat) ? GF_ISOM_OPEN_WRITE : GF_ISOM_WRITE_EDIT;
} else {
- FILE *test = gf_f64_open(inName, "rb");
+ FILE *test = gf_fopen(inName, "rb");
if (!test) {
open_mode = (do_flat) ? GF_ISOM_OPEN_WRITE : GF_ISOM_WRITE_EDIT;
if (!outName) outName = inName;
} else {
- fclose(test);
+ gf_fclose(test);
if (! gf_isom_probe_file(inName) ) {
open_mode = (do_flat) ? GF_ISOM_OPEN_WRITE : GF_ISOM_WRITE_EDIT;
if (!outName) outName = inName;
@@ -3059,6 +3411,7 @@ int mp4boxMain(int argc, char **argv)
fprintf(stderr, "Cannot open destination file %s: %s\n", inName, gf_error_to_string(gf_isom_last_error(NULL)) );
MP4BOX_EXIT_WITH_CODE(1);
}
+
for (i=0; i<(u32) argc; i++) {
if (!strcmp(argv[i], "-add")) {
char *src = argv[i+1];
@@ -3067,7 +3420,11 @@ int mp4boxMain(int argc, char **argv)
if (e) {
while (src) {
char *sep = strchr(src, '+');
- if (sep) sep[0] = 0;
+ if (sep) {
+ sep[0] = 0;
+ } else {
+ break;
+ }
e = import_file(file, src, import_flags, import_fps, agg_samples);
@@ -3093,8 +3450,6 @@ int mp4boxMain(int argc, char **argv)
/*unless explicitly asked, remove all systems tracks*/
if (!keep_sys_tracks) remove_systems_tracks(file);
needSave = 1;
- /*JLF commented: if you want ISMA, just ask for it, no more auto-detect*/
-// if (!conv_type && can_convert_to_isma(file)) conv_type = GF_ISOM_CONV_TYPE_ISMA;
}
if (nb_cat) {
@@ -3103,12 +3458,12 @@ int mp4boxMain(int argc, char **argv)
if (force_new) {
open_mode = (do_flat) ? GF_ISOM_OPEN_WRITE : GF_ISOM_WRITE_EDIT;
} else {
- FILE *test = gf_f64_open(inName, "rb");
+ FILE *test = gf_fopen(inName, "rb");
if (!test) {
open_mode = (do_flat) ? GF_ISOM_OPEN_WRITE : GF_ISOM_WRITE_EDIT;
if (!outName) outName = inName;
}
- else fclose(test);
+ else gf_fclose(test);
}
open_edit = 1;
@@ -3159,7 +3514,7 @@ int mp4boxMain(int argc, char **argv)
logfile[strlen(logfile)-1] = 0;
}
strcat(logfile, "_enc.logs");
- logs = gf_f64_open(logfile, "wt");
+ logs = gf_fopen(logfile, "wt");
}
strcpy(outfile, outName ? outName : inName);
if (strchr(outfile, '.')) {
@@ -3170,7 +3525,7 @@ int mp4boxMain(int argc, char **argv)
file = gf_isom_open(outfile, GF_ISOM_WRITE_EDIT, tmpdir);
opts.mediaSource = mediaSource ? mediaSource : outfile;
e = EncodeFile(inName, file, &opts, logs);
- if (logs) fclose(logs);
+ if (logs) gf_fclose(logs);
if (e) goto err_exit;
needSave = 1;
if (do_saf) {
@@ -3209,7 +3564,12 @@ int mp4boxMain(int argc, char **argv)
strcpy(szMPD, outfile);
strcat(szMPD, ".mpd");
- if (dash_dynamic && dash_live)
+ if ((dash_subduration>0) && (dash_duration > dash_subduration)) {
+ fprintf(stderr, "Warning: -subdur parameter (%g s) should be greater than segment duration (%g s), using segment duration instead\n", dash_subduration, dash_duration);
+ dash_subduration = dash_duration;
+ }
+
+ if (dash_mode && dash_live)
fprintf(stderr, "Live DASH-ing - press 'q' to quit, 's' to save context and quit\n");
if (!dash_ctx_file && dash_live) {
@@ -3222,15 +3582,15 @@ int mp4boxMain(int argc, char **argv)
}
if (dash_profile==GF_DASH_PROFILE_UNKNOWN)
- dash_profile = dash_dynamic ? GF_DASH_PROFILE_LIVE : GF_DASH_PROFILE_FULL;
+ dash_profile = dash_mode ? GF_DASH_PROFILE_LIVE : GF_DASH_PROFILE_FULL;
- if (!dash_dynamic) {
+ if (!dash_mode) {
time_shift_depth = 0;
mpd_update_time = 0;
} else if ((dash_profile>=GF_DASH_PROFILE_MAIN) && !use_url_template && !mpd_update_time) {
/*use a default MPD update of dash_duration sec*/
- mpd_update_time = (u32) (dash_subduration ? dash_subduration : dash_duration);
- fprintf(stderr, "Using default MPD refresh of %d seconds\n", mpd_update_time);
+ mpd_update_time = (Double) (dash_subduration ? dash_subduration : dash_duration);
+ fprintf(stderr, "Using default MPD refresh of %g seconds\n", mpd_update_time);
}
if (file && needSave) {
@@ -3238,41 +3598,63 @@ int mp4boxMain(int argc, char **argv)
file = NULL;
del_file = GF_TRUE;
}
- while (!do_abort) {
+ while (1) {
+ if (do_abort>=2) {
+ dash_mode = GF_DASH_DYNAMIC_LAST;
+ }
e = gf_dasher_segment_files(szMPD, dash_inputs, nb_dash_inputs, dash_profile, dash_title, dash_source, cprt, dash_more_info,
(const char **) mpd_base_urls, nb_mpd_base_urls,
use_url_template, segment_timeline, single_segment, single_file, bitstream_switching_mode,
seg_at_rap, dash_duration, seg_name, seg_ext, segment_marker,
interleaving_time, subsegs_per_sidx, daisy_chain_sidx, frag_at_rap, tmpdir,
- dash_ctx, dash_dynamic, mpd_update_time, time_shift_depth, dash_subduration, min_buffer,
- ast_shift_sec, dash_scale, memory_frags, initial_moof_sn, initial_tfdt, no_fragments_defaults, pssh_in_moof, samplegroups_in_traf);
+ dash_ctx, dash_mode, mpd_update_time, time_shift_depth, dash_subduration, min_buffer,
+ ast_offset_ms, dash_scale, memory_frags, initial_moof_sn, initial_tfdt, no_fragments_defaults,
+ pssh_in_moof, samplegroups_in_traf, single_traf_per_moof, mpd_live_duration, insert_utc, frag_real_time, dash_profile_extension);
+
+ if (do_abort)
+ break;
+
+ //this happens when reading file while writing them (local playback of the live session ...)
+ if (dash_live && (e==GF_IO_ERR) ) {
+ fprintf(stderr, "Error dashing file (%s) but continuing ...\n", gf_error_to_string(e) );
+ e = GF_OK;
+ }
+
if (e) break;
if (dash_live) {
+ u32 slept = gf_sys_clock();
u32 sleep_for = gf_dasher_next_update_time(dash_ctx, mpd_update_time);
- fprintf(stderr, "sleep for %d ms\n", sleep_for);
+ fprintf(stderr, "Next generation scheduled in %d ms\n", sleep_for);
while (1) {
if (gf_prompt_has_input()) {
char c = (char) gf_prompt_get_char();
- if (c=='q') {
+ if (c=='X') {
do_abort = 1;
break;
}
- if (c=='s') {
+ if (c=='q') {
do_abort = 2;
break;
}
+ if (c=='s') {
+ do_abort = 3;
+ break;
+ }
}
- if (dash_dynamic == 2) {
+ if (dash_mode == GF_DASH_DYNAMIC_DEBUG) {
break;
}
- if (sleep_for<100)
- break;
- gf_sleep(100);
+ if (!sleep_for) break;
+ gf_sleep(10);
sleep_for = gf_dasher_next_update_time(dash_ctx, mpd_update_time);
+ if (sleep_for<10) {
+ fprintf(stderr, "Slept for %d ms before generation\n", gf_sys_clock() - slept);
+ break;
+ }
}
} else {
break;
@@ -3280,12 +3662,14 @@ int mp4boxMain(int argc, char **argv)
}
if (dash_ctx) {
- if (do_abort==2) {
- char szName[1024];
- fprintf(stderr, "Enter file name to save dash context:\n");
- if (scanf("%s", szName) == 1) {
- gf_cfg_set_filename(dash_ctx, szName);
- gf_cfg_save(dash_ctx);
+ if (do_abort==3) {
+ if (!dash_ctx_file) {
+ char szName[1024];
+ fprintf(stderr, "Enter file name to save dash context:\n");
+ if (scanf("%s", szName) == 1) {
+ gf_cfg_set_filename(dash_ctx, szName);
+ gf_cfg_save(dash_ctx);
+ }
}
}
gf_cfg_del(dash_ctx);
@@ -3303,11 +3687,11 @@ int mp4boxMain(int argc, char **argv)
&& !(track_dump_type & GF_EXPORT_AVI_NATIVE)
#endif
) {
- FILE *st = gf_f64_open(inName, "rb");
+ FILE *st = gf_fopen(inName, "rb");
Bool file_exists = 0;
if (st) {
file_exists = 1;
- fclose(st);
+ gf_fclose(st);
}
switch (get_file_type_by_ext(inName)) {
case 1:
@@ -3341,7 +3725,7 @@ int mp4boxMain(int argc, char **argv)
/*used for .saf / .lsr dump*/
case 6:
#ifndef GPAC_DISABLE_SCENE_DUMP
- if ((dump_mode==1+GF_SM_DUMP_LASER) || (dump_mode==1+GF_SM_DUMP_SVG)) {
+ if ((dump_mode==GF_SM_DUMP_LASER) || (dump_mode==GF_SM_DUMP_SVG)) {
break;
}
#endif
@@ -3350,7 +3734,11 @@ int mp4boxMain(int argc, char **argv)
if (!open_edit && file_exists && !gf_isom_probe_file(inName) && track_dump_type) {
}
#ifndef GPAC_DISABLE_ISOM_WRITE
- else if (!open_edit && file_exists /* && !gf_isom_probe_file(inName) */ && !dump_mode) {
+ else if (!open_edit && file_exists /* && !gf_isom_probe_file(inName) */
+#ifndef GPAC_DISABLE_SCENE_DUMP
+ && dump_mode == GF_SM_DUMP_NONE
+#endif
+ ) {
/*************************************************************************************************/
#ifndef GPAC_DISABLE_MEDIA_IMPORT
if(dvbhdemux)
@@ -3379,8 +3767,12 @@ int mp4boxMain(int argc, char **argv)
#ifndef GPAC_DISABLE_MPEG2TS
dump_mpeg2_ts(inName, pes_dump, program_number);
#endif
-#ifndef GPAC_DISABLE_MEDIA_IMPORT
+ } else if (do_bin_nhml) {
+ nhml_bs_to_bin(inName, outName, dump_std);
+ } else if (do_hash) {
+ hash_file(inName, dump_std);
} else {
+#ifndef GPAC_DISABLE_MEDIA_IMPORT
convert_file_info(inName, info_track_id);
#endif
}
@@ -3449,7 +3841,7 @@ int mp4boxMain(int argc, char **argv)
char szFile[1024];
for (i=0; iact_type != 9) continue;
+ if (tka->act_type != TRAC_ACTION_RAW_EXTRACT) continue;
memset(&mdump, 0, sizeof(mdump));
mdump.in_name = inName;
mdump.flags = tka->dump_type;
@@ -3473,8 +3865,8 @@ int mp4boxMain(int argc, char **argv)
#endif /*GPAC_DISABLE_MEDIA_EXPORT*/
#ifndef GPAC_DISABLE_SCENE_DUMP
- if (dump_mode) {
- e = dump_file_text(inName, dump_std ? NULL : outfile, dump_mode-1, do_log);
+ if (dump_mode != GF_SM_DUMP_NONE) {
+ e = dump_file_text(inName, dump_std ? NULL : outfile, dump_mode, do_log);
if (e) goto err_exit;
}
#endif
@@ -3497,7 +3889,7 @@ int mp4boxMain(int argc, char **argv)
#ifndef GPAC_DISABLE_ISOM_DUMP
if (dump_isom) dump_isom_xml(file, dump_std ? NULL : outfile);
if (dump_cr) dump_file_ismacryp(file, dump_std ? NULL : outfile);
- if ((dump_ttxt || dump_srt) && trackID) dump_timed_text_track(file, trackID, dump_std ? NULL : outfile, 0, dump_srt);
+ if ((dump_ttxt || dump_srt) && trackID) dump_timed_text_track(file, trackID, dump_std ? NULL : outfile, 0, dump_srt ? GF_TEXTDUMPTYPE_SRT : GF_TEXTDUMPTYPE_TTXT);
#ifndef GPAC_DISABLE_ISOM_HINTING
if (dump_rtp) dump_file_rtp(file, dump_std ? NULL : outfile);
#endif
@@ -3507,15 +3899,17 @@ int mp4boxMain(int argc, char **argv)
if (dump_nal) dump_file_nal(file, dump_nal, dump_std ? NULL : outfile);
if (do_hash) {
- u8 hash[20];
- e = gf_media_get_file_hash(inName, hash);
+ e = hash_file(inName, dump_std);
if (e) goto err_exit;
- fprintf(stderr, "File %s hash (SHA-1): ", inName);
- for (i=0; i<20; i++) fprintf(stderr, "%02X", hash[i]);
- fprintf(stderr, "\n");
}
+ if (do_bin_nhml) {
+ e = nhml_bs_to_bin(inName, outName, dump_std);
+ if (e) goto err_exit;
+ }
+
if (dump_cart) dump_cover_art(file, outfile);
if (dump_chap) dump_chapters(file, outfile, (dump_chap==2) ? 1 : 0);
+ if (dump_udta_type) dump_udta(file, outfile, dump_udta_type, dump_udta_track);
if (dump_iod) {
GF_InitialObjectDescriptor *iod = (GF_InitialObjectDescriptor *)gf_isom_get_root_od(file);
@@ -3527,7 +3921,7 @@ int mp4boxMain(int argc, char **argv)
GF_BitStream *bs = NULL;
sprintf(szName, "%s.iod", outfile);
- iodf = gf_f64_open(szName, "wb");
+ iodf = gf_fopen(szName, "wb");
if (!iodf) {
fprintf(stderr, "Cannot open destination %s\n", szName);
} else {
@@ -3540,7 +3934,7 @@ int mp4boxMain(int argc, char **argv)
} else {
fprintf(stderr, "Error writing IOD %s\n", szName);
}
- fclose(iodf);
+ gf_fclose(iodf);
}
gf_free(bs);
}
@@ -3561,7 +3955,7 @@ int mp4boxMain(int argc, char **argv)
GF_MediaExporter mdump;
for (i=0; iact_type != 9) continue;
+ if (tka->act_type != TRAC_ACTION_RAW_EXTRACT) continue;
memset(&mdump, 0, sizeof(mdump));
mdump.file = file;
mdump.flags = tka->dump_type;
@@ -3610,13 +4004,13 @@ int mp4boxMain(int argc, char **argv)
switch (meta->act_type) {
#ifndef GPAC_DISABLE_ISOM_WRITE
- case 0:
+ case META_ACTION_SET_TYPE:
/*note: we don't handle file brand modification, this is an author stuff and cannot be guessed from meta type*/
e = gf_isom_set_meta_type(file, meta->root_meta, tk, meta->meta_4cc);
gf_isom_modify_alternate_brand(file, GF_ISOM_BRAND_ISO2, 1);
needSave = 1;
break;
- case 1:
+ case META_ACTION_ADD_ITEM:
self_ref = !stricmp(meta->szPath, "NULL") || !stricmp(meta->szPath, "this") || !stricmp(meta->szPath, "self");
e = gf_isom_add_meta_item(file, meta->root_meta, tk, self_ref, self_ref ? NULL : meta->szPath,
strlen(meta->szName) ? meta->szName : NULL,
@@ -3626,20 +4020,20 @@ int mp4boxMain(int argc, char **argv)
meta->use_dref ? meta->szPath : NULL, NULL);
needSave = 1;
break;
- case 2:
+ case META_ACTION_REM_ITEM:
e = gf_isom_remove_meta_item(file, meta->root_meta, tk, meta->item_id);
needSave = 1;
break;
- case 3:
+ case META_ACTION_SET_PRIMARY_ITEM:
e = gf_isom_set_meta_primary_item(file, meta->root_meta, tk, meta->item_id);
needSave = 1;
break;
- case 4:
- case 5:
- e = gf_isom_set_meta_xml(file, meta->root_meta, tk, meta->szPath, (meta->act_type==5) ? 1 : 0);
+ case META_ACTION_SET_XML:
+ case META_ACTION_SET_BINARY_XML:
+ e = gf_isom_set_meta_xml(file, meta->root_meta, tk, meta->szPath, (meta->act_type==META_ACTION_SET_BINARY_XML) ? 1 : 0);
needSave = 1;
break;
- case 6:
+ case META_ACTION_REM_XML:
if (gf_isom_get_meta_item_count(file, meta->root_meta, tk)) {
e = gf_isom_remove_meta_xml(file, meta->root_meta, tk);
needSave = 1;
@@ -3647,7 +4041,7 @@ int mp4boxMain(int argc, char **argv)
fprintf(stderr, "No meta box in input file\n");
}
break;
- case 8:
+ case META_ACTION_DUMP_XML:
if (gf_isom_get_meta_item_count(file, meta->root_meta, tk)) {
e = gf_isom_extract_meta_item(file, meta->root_meta, tk, meta->item_id, strlen(meta->szPath) ? meta->szPath : NULL);
} else {
@@ -3655,13 +4049,15 @@ int mp4boxMain(int argc, char **argv)
}
break;
#endif
- case 7:
+ case META_ACTION_DUMP_ITEM:
if (gf_isom_has_meta_xml(file, meta->root_meta, tk)) {
e = gf_isom_extract_meta_xml(file, meta->root_meta, tk, meta->szPath, NULL);
} else {
fprintf(stderr, "No meta box in input file\n");
}
break;
+ default:
+ break;
}
if (e) goto err_exit;
}
@@ -3673,7 +4069,7 @@ int mp4boxMain(int argc, char **argv)
#ifndef GPAC_DISABLE_ISOM_WRITE
for (i=0; itrackID ? gf_isom_get_track_by_id(file, tka->trackID) : 0;
u32 timescale = gf_isom_get_timescale(file);
switch (tka->act_type) {
- case 0:
+ case TRAC_ACTION_REM_TRACK:
e = gf_isom_remove_track(file, track);
if (e) {
fprintf(stderr, "Error Removing track ID %d: %s\n", tka->trackID, gf_error_to_string(e));
@@ -3868,16 +4270,34 @@ int mp4boxMain(int argc, char **argv)
}
needSave = 1;
break;
- case 1:
+ case TRAC_ACTION_SET_LANGUAGE:
for (i=0; ilang));
+ e = gf_isom_set_media_language(file, i+1, tka->lang);
if (e) goto err_exit;
needSave = 1;
}
needSave = 1;
break;
- case 2:
+ case TRAC_ACTION_SET_KIND:
+ for (i=0; ikind_scheme, tka->kind_value);
+ if (e) goto err_exit;
+ needSave = 1;
+ }
+ needSave = 1;
+ break;
+ case TRAC_ACTION_REM_KIND:
+ for (i=0; ikind_scheme, tka->kind_value);
+ if (e) goto err_exit;
+ needSave = 1;
+ }
+ needSave = 1;
+ break;
+ case TRAC_ACTION_SET_DELAY:
if (tka->delay_ms) {
u64 tk_dur;
@@ -3904,7 +4324,7 @@ int mp4boxMain(int argc, char **argv)
needSave = 1;
}
break;
- case 3:
+ case TRAC_ACTION_SET_KMS_URI:
for (i=0; inewTrackID);
+ if (newTrack != 0) {
+ fprintf(stderr, "Error: Cannot set track id with value %d because a track already exists - ignoring", tka->newTrackID);
+ } else {
+ e = gf_isom_set_track_id(file, track, tka->newTrackID);
+ needSave = 1;
+ }
+ } else {
+ fprintf(stderr, "Error: Cannot change id for track %d because it does not exist - ignoring", tka->trackID);
+ }
+ break;
+ case TRAC_ACTION_SET_PAR:
e = gf_media_change_par(file, track, tka->par_num, tka->par_den);
needSave = 1;
break;
- case 5:
+ case TRAC_ACTION_SET_HANDLER_NAME:
e = gf_isom_set_handler_name(file, track, tka->hdl_name);
needSave = 1;
break;
- case 6:
+ case TRAC_ACTION_ENABLE:
if (!gf_isom_is_track_enabled(file, track)) {
e = gf_isom_set_track_enabled(file, track, 1);
needSave = 1;
}
break;
- case 7:
+ case TRAC_ACTION_DISABLE:
if (gf_isom_is_track_enabled(file, track)) {
e = gf_isom_set_track_enabled(file, track, 0);
needSave = 1;
}
break;
- case 8:
+ case TRAC_ACTION_REFERENCE:
e = gf_isom_set_track_reference(file, track, GF_4CC(tka->lang[0], tka->lang[1], tka->lang[2], tka->lang[3]), (u32) tka->delay_ms);
needSave = 1;
break;
- case 10:
+ case TRAC_ACTION_REM_NON_RAP:
fprintf(stderr, "Removing non-rap samples from track %d\n", tka->trackID);
e = gf_media_remove_non_rap(file, track);
needSave = 1;
break;
+ case TRAC_ACTION_SET_UDTA:
+ set_file_udta(file, track, tka->udta_type, tka->src_name, tka->sample_num ? GF_TRUE : GF_FALSE);
+ needSave = 1;
+ break;
+ default:
+ break;
}
if (e) goto err_exit;
}
@@ -3994,13 +4434,13 @@ int mp4boxMain(int argc, char **argv)
case GF_ISOM_ITUNE_COVER_ART:
{
char *d, *ext;
- FILE *t = gf_f64_open(val, "rb");
- gf_f64_seek(t, 0, SEEK_END);
- tlen = (u32) gf_f64_tell(t);
- gf_f64_seek(t, 0, SEEK_SET);
+ FILE *t = gf_fopen(val, "rb");
+ gf_fseek(t, 0, SEEK_END);
+ tlen = (u32) gf_ftell(t);
+ gf_fseek(t, 0, SEEK_SET);
d = gf_malloc(sizeof(char) * tlen);
tlen = (u32) fread(d, sizeof(char), tlen, t);
- fclose(t);
+ gf_fclose(t);
ext = strrchr(val, '.');
if (!stricmp(ext, ".png")) tlen |= 0x80000000;
@@ -4048,7 +4488,7 @@ int mp4boxMain(int argc, char **argv)
case GF_ISOM_ITUNE_COMPILATION:
{
char _t[1];
- if (!stricmp(val, "yes")) _t[0] = 1;
+ if (val && !stricmp(val, "yes")) _t[0] = 1;
else _t[0] = 0;
gf_isom_apple_set_tag(file, itag, _t, 1);
}
@@ -4115,8 +4555,11 @@ int mp4boxMain(int argc, char **argv)
needSave = 1;
} else {
e = gf_isom_make_interleave(file, interleaving_time);
- if (!e && !old_interleave) e = gf_isom_set_storage_mode(file, GF_ISOM_STORE_DRIFT_INTERLEAVED);
+ if (!e && old_interleave) e = gf_isom_set_storage_mode(file, GF_ISOM_STORE_INTERLEAVED);
}
+ if (force_co64)
+ gf_isom_force_64bit_chunk_offset(file, GF_TRUE);
+
if (e) goto err_exit;
#if !defined(GPAC_DISABLE_ISOM_HINTING) && !defined(GPAC_DISABLE_SENG)
@@ -4217,6 +4660,16 @@ err_exit:
if (file) gf_isom_delete(file);
fprintf(stderr, "\n\tError: %s\n", gf_error_to_string(e));
MP4BOX_EXIT_WITH_CODE(1);
+
+exit:
+
+#ifdef GPAC_MEMORY_TRACKING
+ if (enable_mem_tracker && (gf_memory_size() || gf_file_handles_count() )) {
+ gf_memory_print();
+ return 2;
+ }
+#endif
+ return 0;
}
int main( int argc, char** argv )
diff --git a/applications/mp4box/wrapper.c b/applications/mp4box/wrapper.c
index f26fe93..d4a22c7 100644
--- a/applications/mp4box/wrapper.c
+++ b/applications/mp4box/wrapper.c
@@ -57,8 +57,8 @@ JNIEXPORT void JNICALL Java_com_enst_mp4box_mp4terminal_run(JNIEnv * env, jobjec
(*env)->ReleaseStringUTFChars(env, sCommand, sOriginalCommand);
jniLOGV("mp4terminal::end");
- fclose(ferr);
- fclose(fout);
+ gf_fclose(ferr);
+ gf_fclose(fout);
}
char ** ConvertCommandLine( const char* sCommand, int* iNbArg )
diff --git a/applications/mp4client/Makefile b/applications/mp4client/Makefile
index b699020..6aff667 100644
--- a/applications/mp4client/Makefile
+++ b/applications/mp4client/Makefile
@@ -31,6 +31,11 @@ EXT=
PROG=MP4Client
endif
+ifeq ($(CONFIG_DARWIN),yes)
+OBJS+= carbon_events.o
+LDFLAGS += -framework Carbon
+endif
+
SRCS := $(OBJS:.o=.c)
all: $(PROG)
diff --git a/applications/mp4client/carbon_events.c b/applications/mp4client/carbon_events.c
new file mode 100644
index 0000000..d4226bb
--- /dev/null
+++ b/applications/mp4client/carbon_events.c
@@ -0,0 +1,109 @@
+/*
+ * GPAC - Multimedia Framework C SDK
+ *
+ * Authors: Jean Le Feuvre
+ * Copyright (c) Telecom ParisTech 2005-2012
+ * All rights reserved
+ *
+ * This file is part of GPAC / command-line client
+ *
+ * GPAC is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * GPAC 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#if defined(__DARWIN__) || defined(__APPLE__)
+#include
+#endif
+
+
+void gf_sys_set_args(int argc, const char **argv);
+void send_open_url(const char *url);
+
+void RunApplicationEventLoop(void);
+void QuitApplicationEventLoop(void);
+
+char *my_argv[2];
+
+static int main_evt_loop_run = 1;
+
+static AEEventHandlerUPP open_app_UPP, open_doc_UPP;
+
+static pascal OSErr ae_open_app (const AppleEvent *ae_event, AppleEvent *ae_reply, long ae_ref_count)
+{
+ if (main_evt_loop_run) {
+ QuitApplicationEventLoop();
+ main_evt_loop_run = 0;
+ }
+ return (noErr);
+}
+
+static pascal OSErr ae_open_doc (const AppleEvent *ae_event, AppleEvent *ae_reply, long ae_ref_count)
+{
+ OSErr err;
+ FSRef ref;
+ AEDescList docList;
+ long count;
+
+ err = AEGetParamDesc(ae_event, keyDirectObject, typeAEList, &docList);
+ if (err)
+ return (noErr);
+
+ err = AECountItems(&docList, &count);
+ if (err == noErr) {
+ err = AEGetNthPtr(&docList, 1, typeFSRef, NULL, NULL, &ref, sizeof(FSRef), NULL);
+ if (err == noErr) {
+ char path[4096];
+ FSRefMakePath(&ref, (UInt8 *) path, 4096);
+ if (main_evt_loop_run) {
+ my_argv[1] = strdup(path);
+ gf_sys_set_args(2, (const char **) my_argv);
+ } else {
+ send_open_url(path);
+ }
+ }
+ }
+ err = AEDisposeDesc(&docList);
+
+ if (main_evt_loop_run) {
+ QuitApplicationEventLoop();
+ main_evt_loop_run = 0;
+ }
+ return (noErr);
+}
+
+void carbon_init ()
+{
+ my_argv[0] = "GPAC";
+ my_argv[1] = NULL;
+
+ open_app_UPP = NewAEEventHandlerUPP(ae_open_app);
+ AEInstallEventHandler(kCoreEventClass, kAEOpenApplication, open_app_UPP, 0L, false);
+ open_doc_UPP = NewAEEventHandlerUPP(ae_open_doc);
+ AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, open_doc_UPP, 0L, false);
+
+ main_evt_loop_run = 1;
+ RunApplicationEventLoop();
+}
+
+void carbon_uninit()
+{
+
+ DisposeAEEventHandlerUPP(open_app_UPP);
+ DisposeAEEventHandlerUPP(open_doc_UPP);
+
+ if (my_argv[1]) free(my_argv[1]);
+}
+
+
diff --git a/applications/mp4client/extract.c b/applications/mp4client/extract.c
index d82b2fb..20970df 100644
--- a/applications/mp4client/extract.c
+++ b/applications/mp4client/extract.c
@@ -63,10 +63,29 @@ typedef struct tagBITMAPINFOHEADER {
#include
#include
+
+enum
+{
+ DUMP_NONE = 0,
+ DUMP_AVI = 1,
+ DUMP_BMP = 2,
+ DUMP_PNG = 3,
+ DUMP_RAW = 4,
+ DUMP_SHA1 = 5,
+
+ //DuMP flags
+ DUMP_DEPTH_ONLY = 1<<16,
+ DUMP_RGB_DEPTH = 1<<17,
+ DUMP_RGB_DEPTH_SHAPE = 1<<18
+};
+
+
extern Bool is_connected;
extern GF_Terminal *term;
extern u64 Duration;
extern GF_Err last_error;
+extern Bool no_prog;
+
static GFINLINE u8 colmask(s32 a, s32 n)
{
@@ -87,16 +106,9 @@ static u32 put_pixel(FILE *fout, u32 type, u32 pf, char *ptr)
case GF_PIXEL_BGR_32:
case GF_PIXEL_RGBA:
- //probably due to tinygl bug - verify
-#ifndef GPAC_USE_TINYGL
- fputc(ptr[3], fout);
- fputc(ptr[2], fout);
- fputc(ptr[1], fout);
-#else
fputc(ptr[2], fout);
fputc(ptr[1], fout);
fputc(ptr[0], fout);
-#endif
return 4;
case GF_PIXEL_RGB_24:
@@ -162,7 +174,7 @@ void write_bmp(GF_VideoSurface *fb, char *rad_name, u32 img_num)
if (fb->pixel_format==GF_PIXEL_GREYSCALE) sprintf(str, "%s_%d_depth.bmp", rad_name, img_num);
else sprintf(str, "%s_%d.bmp", rad_name, img_num);
- fout = gf_f64_open(str, "wb");
+ fout = gf_fopen(str, "wb");
if (!fout) return;
memset(&fh, 0, sizeof(fh));
@@ -177,7 +189,7 @@ void write_bmp(GF_VideoSurface *fb, char *rad_name, u32 img_num)
if (fb->pixel_format==GF_PIXEL_GREYSCALE) fi.biBitCount = 24;
else fi.biBitCount = 24;
fi.biCompression = BI_RGB;
- fi.biSizeImage = fb->pitch_y * fb->height;
+ fi.biSizeImage = fb->width * fb->height * 3;
/*NOT ALIGNED!!*/
gf_fwrite(&fh.bfType, 2, 1, fout);
@@ -187,7 +199,6 @@ void write_bmp(GF_VideoSurface *fb, char *rad_name, u32 img_num)
gf_fwrite(&fh.bfOffBits, 4, 1, fout);
gf_fwrite(&fi, 1, 40, fout);
-//#ifndef GPAC_USE_TINYGL
for (j=fb->height; j>0; j--) {
ptr = fb->video_buffer + (j-1)*fb->pitch_y;
for (i=0; iwidth; i++) {
@@ -196,19 +207,7 @@ void write_bmp(GF_VideoSurface *fb, char *rad_name, u32 img_num)
ptr += res;
}
}
-//#else
-#if 0
- for (j=0; jheight; j++) {
- ptr = fb->video_buffer + j*fb->pitch;
- for (i=0; iwidth; i++) {
- u32 res = put_pixel(fout, 0, fb->pixel_format, ptr);
- assert(res);
- ptr += res;
- }
- }
-#endif
-
- fclose(fout);
+ gf_fclose(fout);
}
#include
@@ -237,12 +236,12 @@ void write_png(GF_VideoSurface *fb, char *rad_name, u32 img_num)
dst = (char*)gf_malloc(sizeof(char)*dst_size);
- fout = gf_f64_open(str, "wb");
+ fout = gf_fopen(str, "wb");
if (fout) {
GF_Err e = gf_img_png_enc(fb->video_buffer, fb->width, fb->height, fb->pitch_y, fb->pixel_format, dst, &dst_size);
if (!e) {
gf_fwrite(dst, dst_size, 1, fout);
- fclose(fout);
+ gf_fclose(fout);
}
}
@@ -262,7 +261,7 @@ void write_depthfile(GF_VideoSurface *fb, char *rad_name, u32 img_num)
depth = (unsigned char *) fb->video_buffer;
- fout = gf_f64_open("dump_depth", "wb");
+ fout = gf_fopen("dump_depth", "wb");
if (!fout) return;
for (j=0; jheight; j++) {
for (i=0; iwidth; i++) {
@@ -275,10 +274,10 @@ void write_depthfile(GF_VideoSurface *fb, char *rad_name, u32 img_num)
#endif
}
}
- fclose(fout);
+ gf_fclose(fout);
}
-void write_texture_file(GF_VideoSurface *fb, char *rad_name, u32 img_num, u32 dump_mode)
+void write_texture_file(GF_VideoSurface *fb, char *rad_name, u32 img_num, u32 dump_mode_flags)
{
FILE *fout;
@@ -287,8 +286,8 @@ void write_texture_file(GF_VideoSurface *fb, char *rad_name, u32 img_num, u32 du
buf = (unsigned char *) fb->video_buffer;
- if (dump_mode==6) fout = gf_f64_open("dump_rgbds", "wb");
- else if (dump_mode==9) fout = gf_f64_open("dump_rgbd", "wb");
+ if (dump_mode_flags & DUMP_RGB_DEPTH_SHAPE) fout = gf_fopen("dump_rgbds", "wb");
+ else if (dump_mode_flags & DUMP_RGB_DEPTH) fout = gf_fopen("dump_rgbd", "wb");
else return;
if (!fout) return;
@@ -297,7 +296,7 @@ void write_texture_file(GF_VideoSurface *fb, char *rad_name, u32 img_num, u32 du
fputc(buf[i+j*fb->pitch_y], fout);
}
}
- fclose(fout);
+ gf_fclose(fout);
}
@@ -317,7 +316,7 @@ void write_raw(GF_VideoSurface *fb, char *rad_name, u32 img_num)
sprintf(str, "%s_%d.raw", rad_name, img_num);
}
- fout = gf_f64_open(str, "wb");
+ fout = gf_fopen(str, "wb");
if (!fout) return;
@@ -329,25 +328,33 @@ void write_raw(GF_VideoSurface *fb, char *rad_name, u32 img_num)
ptr += res;
}
}
- fclose(fout);
+ gf_fclose(fout);
+}
+
+void write_hash(FILE *sha_out, char *buf, u32 size)
+{
+ u8 hash[20];
+ gf_sha1_csum((u8 *)buf, size, hash);
+ fwrite(hash, 1, 20, sha_out);
}
/* creates a .bmp format greyscale image of the byte depthbuffer and a binary with only the content of the depthbuffer */
-void dump_depth (GF_Terminal *term, char *rad_name, u32 dump_type, u32 frameNum, char *conv_buf, void *avi_out)
+void dump_depth (GF_Terminal *term, char *rad_name, u32 dump_mode_flags, u32 frameNum, char *conv_buf, void *avi_out, FILE *sha_out)
{
GF_Err e;
u32 i, k;
+
GF_VideoSurface fb;
+ u32 dump_mode = dump_mode_flags & 0x0000FFFF;
/*lock it*/
e = gf_sc_get_screen_buffer(term->compositor, &fb, 1);
if (e) fprintf(stderr, "Error grabbing depth buffer: %s\n", gf_error_to_string(e));
else fprintf(stderr, "OK\n");
/*export frame*/
- switch (dump_type) {
- case 1:
- case 8:
+ switch (dump_mode) {
+ case DUMP_AVI:
/*reverse frame*/
for (k=0; kcompositor, &fb);
+ gf_sc_release_screen_buffer(term->compositor, &fb);
}
-void dump_frame(GF_Terminal *term, char *rad_name, u32 dump_type, u32 frameNum, char *conv_buf, void *avi_out)
+void dump_frame(GF_Terminal *term, char *rad_name, u32 dump_mode_flags, u32 frameNum, char *conv_buf, void *avi_out, FILE *sha_out)
{
GF_Err e = GF_OK;
u32 i, k, out_size;
GF_VideoSurface fb;
+ u32 dump_mode = dump_mode_flags & 0x0000FFFF;
+ u32 depth_dump_mode = 0;
+
+ if (dump_mode_flags & DUMP_RGB_DEPTH_SHAPE) depth_dump_mode = 3;
+ else if (dump_mode_flags & DUMP_RGB_DEPTH) depth_dump_mode = 2;
+ else if (dump_mode_flags & DUMP_DEPTH_ONLY) depth_dump_mode = 1;
+
/*lock it*/
- if (dump_type==5 || dump_type==6) e = gf_sc_get_screen_buffer(term->compositor, &fb, 2);
- else if (dump_type== 9 || dump_type==10) e = gf_sc_get_screen_buffer(term->compositor, &fb, 3);
- else e = gf_sc_get_screen_buffer(term->compositor, &fb, 0);
+ e = gf_sc_get_screen_buffer(term->compositor, &fb, depth_dump_mode);
if (e) fprintf(stderr, "Error grabbing frame buffer: %s\n", gf_error_to_string(e));
/*export frame*/
- switch (dump_type) {
- case 1:
- case 5:
- case 10:
- case 8:
+ switch (dump_mode) {
+ case DUMP_AVI:
+ case DUMP_SHA1:
/*reverse frame*/
for (k=0; kcompositor, &fb);
}
-Bool dump_file(char *url, char *out_url, u32 dump_mode, Double fps, u32 width, u32 height, Float scale, u32 *times, u32 nb_times)
+#ifndef GPAC_DISABLE_AVILIB
+
+typedef struct
+{
+ GF_AudioListener al;
+ GF_Mutex *mx;
+ avi_t *avi;
+ u32 time_scale;
+ u64 max_dur, nb_bytes, audio_time;
+ u32 next_video_time, audio_time_init, flush_retry, nb_write, audio_clock_at_video_init;
+ u32 samplerate, bits_per_sample, nb_channel;
+} AVI_AudioListener;
+
+void avi_audio_frame(void *udta, char *buffer, u32 buffer_size, u32 time, u32 delay)
+{
+ AVI_AudioListener *avil = (AVI_AudioListener *)udta;
+
+ if (avil->audio_clock_at_video_init > time)
+ return;
+
+ if (avil->audio_time >= avil->audio_time_init + avil->max_dur)
+ return;
+
+ gf_mx_p(avil->mx);
+
+ if (!avil->time_scale) {
+ AVI_set_audio(avil->avi, avil->nb_channel, avil->samplerate, avil->bits_per_sample, WAVE_FORMAT_PCM, 0);
+ avil->time_scale = avil->nb_channel*avil->bits_per_sample*avil->samplerate/8;
+ gf_term_set_option(term, GF_OPT_FORCE_AUDIO_CONFIG, 1);
+ }
+
+ avil->nb_bytes+=buffer_size;
+ avil->flush_retry=0;
+
+ if (avil->audio_time >= avil->audio_time_init) {
+ avil->nb_write++;
+ AVI_write_audio(avil->avi, buffer, buffer_size);
+ }
+
+
+ avil->audio_time = 1000*avil->nb_bytes/avil->time_scale;
+
+ //we are behind video dump, force audio flush
+ if (avil->audio_time < avil->next_video_time) {
+ gf_term_step_clocks(term, 0);
+ }
+ gf_mx_v(avil->mx);
+}
+
+void avi_audio_reconfig(void *udta, u32 samplerate, u32 bits_per_sample, u32 nb_channel, u32 channel_cfg)
+{
+ AVI_AudioListener *avil = (AVI_AudioListener *)udta;
+
+ avil->nb_channel = nb_channel;
+ avil->samplerate = samplerate;
+ avil->bits_per_sample = bits_per_sample;
+}
+#endif
+
+Bool dump_file(char *url, char *out_url, u32 dump_mode_flags, Double fps, u32 width, u32 height, Float scale, u32 *times, u32 nb_times)
{
GF_Err e;
u32 i = 0;
@@ -593,7 +673,27 @@ Bool dump_file(char *url, char *out_url, u32 dump_mode, Double fps, u32 width, u
char szPath[GF_MAX_PATH];
char szOutPath[GF_MAX_PATH];
char *prev=NULL;
+ u32 time, prev_time, nb_frames, init_time;
+ u64 dump_dur;
+ char *conv_buf = NULL;
+#ifndef GPAC_DISABLE_AVILIB
+ avi_t *avi_out = NULL;
+ avi_t *depth_avi_out = NULL;
+ AVI_AudioListener avi_al;
+ char comp[5];
+#else
+ void *avi_out = NULL;
+ void *depth_avi_out = NULL;
+#endif
+ GF_Mutex *avi_mx = NULL;
+
+ FILE *sha_out = NULL;
+ FILE *sha_depth_out = NULL;
+ char szPath_depth[GF_MAX_PATH];
+ u32 cur_time_idx;
+ u32 mode = dump_mode_flags & 0x0000FFFF;
+ if (!out_url) out_url = url;
prev = strstr(url, "://");
if (prev) {
prev = strrchr(url, '/');
@@ -632,10 +732,8 @@ Bool dump_file(char *url, char *out_url, u32 dump_mode, Double fps, u32 width, u
gf_term_process_flush(term);
}
#ifndef GPAC_USE_TINYGL
- fprintf(stderr, "not tinygl\n");
e = gf_sc_get_screen_buffer(term->compositor, &fb, 0);
#else
- fprintf(stderr, "tinygl\n");
e = gf_sc_get_screen_buffer(term->compositor, &fb, 1);
#endif
if (e != GF_OK) {
@@ -667,105 +765,198 @@ Bool dump_file(char *url, char *out_url, u32 dump_mode, Double fps, u32 width, u
gf_sc_release_screen_buffer(term->compositor, &fb);
}
- if (dump_mode==1 || dump_mode==5 || dump_mode==8 || dump_mode==10) {
+
+ strcpy(szPath_depth, szOutPath);
+
+ if (mode==DUMP_AVI) {
#ifdef GPAC_DISABLE_AVILIB
fprintf(stderr, "AVILib is disabled in this build of GPAC\n");
return 0;
#else
- u32 time, prev_time, nb_frames;
- u64 dump_dur;
- char *conv_buf;
- avi_t *avi_out = NULL;
- avi_t *depth_avi_out = NULL;
- char szPath_depth[GF_MAX_PATH];
- char comp[5];
- strcpy(szPath_depth, szOutPath);
strcat(szOutPath, ".avi");
avi_out = AVI_open_output_file(szOutPath);
if (!avi_out) {
fprintf(stderr, "Error creating AVI file %s\n", szOutPath);
return 1;
}
- if (dump_mode==8) {
+#endif
+ }
+
+ if (mode==DUMP_SHA1) {
+ strcat(szOutPath, ".sha1");
+ sha_out = gf_fopen(szOutPath, "wb");
+ if (!sha_out) {
+ fprintf(stderr, "Error creating SHA file %s\n", szOutPath);
+ return 1;
+ }
+ }
+
+ if (dump_mode_flags & DUMP_DEPTH_ONLY) {
+ if (mode==DUMP_AVI) {
+#ifndef GPAC_DISABLE_AVILIB
strcat(szPath_depth, "_depth.avi");
depth_avi_out = AVI_open_output_file(szPath_depth);
if (!depth_avi_out) {
- fprintf(stderr, "Error creating AVI file %s\n", szPath_depth);
+ fprintf(stderr, "Error creating depth AVI file %s\n", szPath_depth);
return 1;
}
+#endif
}
+ if (mode==DUMP_SHA1) {
+ strcat(szPath_depth, "_depth.sha1");
+ sha_depth_out = gf_fopen(szPath_depth, "wb");
+ if (!sha_depth_out) {
+ fprintf(stderr, "Error creating depgth SHA file %s\n", szPath_depth);
+ return 1;
+ }
+ }
+ }
- if (!fps) fps = GF_IMPORT_DEFAULT_FPS;
- time = prev_time = 0;
- nb_frames = 0;
- if (nb_times==2) {
- prev_time = times[0];
- dump_dur = times[1] - times[0];
- } else {
- dump_dur = times[0] ? times[0] : Duration;
- }
- if (!dump_dur) {
- fprintf(stderr, "Warning: file has no duration, defaulting to 1 sec\n");
- dump_dur = 1000;
- }
+ if (!fps) fps = GF_IMPORT_DEFAULT_FPS;
+ time = prev_time = 0;
+ nb_frames = 0;
+
+ if (nb_times==2) {
+ prev_time = times[0];
+ dump_dur = times[1] - times[0];
+ } else if ((mode==DUMP_AVI) || (mode==DUMP_SHA1)) {
+ dump_dur = times[0] ? times[0] : Duration;
+ } else {
+ dump_dur = times[nb_times-1];
+ dump_dur ++;
+ }
+ if (!dump_dur) {
+ fprintf(stderr, "Warning: file has no duration, defaulting to 1 sec\n");
+ dump_dur = 1000;
+ }
+
+ if (mode==DUMP_AVI) {
+ avi_mx = gf_mx_new("AVIMutex");
+#ifndef GPAC_DISABLE_AVILIB
comp[0] = comp[1] = comp[2] = comp[3] = comp[4] = 0;
AVI_set_video(avi_out, width, height, fps, comp);
- if (dump_mode==8) AVI_set_video(depth_avi_out, width, height, fps, comp);
- if (dump_mode != 5 && dump_mode!=10) conv_buf = gf_malloc(sizeof(char) * width * height * 3);
- else conv_buf = gf_malloc(sizeof(char) * width * height * 4);
- /*step to first frame*/
- if (prev_time) gf_term_step_clocks(term, prev_time);
-
- while (time < dump_dur) {
- while ((gf_term_get_option(term, GF_OPT_PLAY_STATE) == GF_STATE_STEP_PAUSE)) {
- gf_term_process_flush(term);
- }
- fprintf(stderr, "Dumping %02d/100 %% - time %.02f sec\r", (u32) ((100.0*prev_time)/dump_dur), prev_time/1000.0 );
+
+ if (! (term->user->init_flags & GF_TERM_NO_AUDIO)) {
+ memset(&avi_al, 0, sizeof(avi_al));
+ avi_al.al.udta = &avi_al;
+ avi_al.al.on_audio_frame = avi_audio_frame;
+ avi_al.al.on_audio_reconfig = avi_audio_reconfig;
+ avi_al.mx = avi_mx;
+ avi_al.avi = avi_out;
+ avi_al.max_dur=dump_dur;
+
+ gf_sc_add_audio_listener(term->compositor, &avi_al.al);
+ }
+
+ if (dump_mode_flags & DUMP_DEPTH_ONLY)
+ AVI_set_video(depth_avi_out, width, height, fps, comp);
+#endif
+ }
+
+ if ((mode==DUMP_AVI) || (mode==DUMP_SHA1)) {
+
+ if (dump_mode_flags & (DUMP_RGB_DEPTH | DUMP_RGB_DEPTH_SHAPE) )
+ conv_buf = gf_malloc(sizeof(char) * width * height * 4);
+ else
+ conv_buf = gf_malloc(sizeof(char) * width * height * 3);
+ }
+
+ cur_time_idx = 0;
+ init_time = 0;
+ /*step to first frame*/
+ if (prev_time) {
+ gf_term_step_clocks(term, prev_time);
+ init_time = prev_time;
+ prev_time=0;
+ }
+#ifndef GPAC_DISABLE_AVILIB
+ avi_al.audio_time_init = avi_al.next_video_time = init_time;
+ avi_al.audio_clock_at_video_init = gf_term_get_clock(term);
+#endif
+
+ while (time < dump_dur) {
+ while ((gf_term_get_option(term, GF_OPT_PLAY_STATE) == GF_STATE_STEP_PAUSE)) {
+ gf_term_process_flush(term);
+ }
+
+ if ((mode==DUMP_AVI) || (mode==DUMP_SHA1)) {
+
+ if (!no_prog)
+ fprintf(stderr, "Dumping %02d/100 %% - time %.02f sec\r", (u32) ((100.0*prev_time)/dump_dur), prev_time/1000.0 );
+
+ if (avi_mx) gf_mx_p(avi_mx);
+
+ if (dump_mode_flags & DUMP_DEPTH_ONLY) {
- if (dump_mode==8) {
/*we'll dump both buffers at once*/
gf_mx_p(term->compositor->mx);
- dump_depth(term, szPath_depth, dump_mode, i+1, conv_buf, depth_avi_out);
- dump_frame(term, szOutPath, dump_mode, i+1, conv_buf, avi_out);
+ dump_depth(term, szPath_depth, dump_mode_flags, i+1, conv_buf, depth_avi_out, sha_depth_out);
+ dump_frame(term, szOutPath, mode, i+1, conv_buf, avi_out, sha_out);
gf_mx_v(term->compositor->mx);
-
+ } else {
+ dump_frame(term, szOutPath, dump_mode_flags, i+1, conv_buf, avi_out, sha_out);
}
- else dump_frame(term, szOutPath, dump_mode, i+1, conv_buf, avi_out);
- nb_frames++;
- time = (u32) (nb_frames*1000/fps);
- gf_term_step_clocks(term, time - prev_time);
- prev_time = time;
+ if (avi_mx) gf_mx_v(avi_mx);
- if (gf_prompt_has_input() && (gf_prompt_get_char()=='q')) {
- fprintf(stderr, "Aborting dump\n");
- break;
+ } else {
+ if ( times[cur_time_idx] <= time) {
+ if (dump_mode_flags & (DUMP_DEPTH_ONLY | DUMP_RGB_DEPTH | DUMP_RGB_DEPTH_SHAPE) ) {
+ dump_depth(term, szOutPath, dump_mode_flags, cur_time_idx+1, NULL, NULL, NULL);
+ } else {
+ dump_frame(term, out_url, dump_mode_flags, cur_time_idx+1, NULL, NULL, NULL);
+ }
+
+ cur_time_idx++;
+ if (cur_time_idx>=nb_times)
+ break;
}
}
- AVI_close(avi_out);
- if (dump_mode==8) AVI_close(depth_avi_out);
- gf_free(conv_buf);
- fprintf(stderr, "AVI Extraction 100/100\n");
-#endif /*GPAC_DISABLE_AVILIB*/
- } else {
- if (times[0]) gf_term_step_clocks(term, times[0]);
- for (i=0; iuser->init_flags & GF_TERM_NO_AUDIO)) {
+ avi_al.flush_retry=0;
+ while ((avi_al.flush_retry <100) && (avi_al.audio_time < dump_dur)) {
+ gf_term_step_clocks(term, 0);
+ gf_sleep(1);
+ avi_al.flush_retry++;
}
}
+
+ if (! (term->user->init_flags & GF_TERM_NO_AUDIO)) {
+ gf_sc_remove_audio_listener(term->compositor, &avi_al.al);
+ }
+ if (avi_out) AVI_close(avi_out);
+ if (depth_avi_out) AVI_close(depth_avi_out);
+ if (avi_mx) gf_mx_del(avi_mx);
+#endif
+
+ if (sha_out) gf_fclose(sha_out);
+ if (sha_depth_out) gf_fclose(sha_depth_out);
+
+ if (conv_buf) {
+ gf_free(conv_buf);
+ fprintf(stderr, "Dumping done: %d frames at %g FPS\n", nb_frames, fps);
+ }
+
return 0;
}
diff --git a/applications/mp4client/main.c b/applications/mp4client/main.c
index 4cb1f88..074ba52 100644
--- a/applications/mp4client/main.c
+++ b/applications/mp4client/main.c
@@ -23,6 +23,7 @@
*
*/
+
/*includes both terminal and od browser*/
#include
#include
@@ -47,6 +48,10 @@
#if defined(__DARWIN__) || defined(__APPLE__)
#include
#include
+
+void carbon_init();
+void carbon_uninit();
+
#endif
#else
@@ -55,7 +60,7 @@
/*local prototypes*/
void PrintWorldInfo(GF_Terminal *term);
-void ViewOD(GF_Terminal *term, u32 OD_ID, u32 number);
+void ViewOD(GF_Terminal *term, u32 OD_ID, u32 number, const char *URL);
void PrintODList(GF_Terminal *term, GF_ObjectManager *root_odm, u32 num, u32 indent, char *root_name);
void ViewODs(GF_Terminal *term, Bool show_timing);
@@ -65,11 +70,16 @@ static u32 gui_mode = 0;
static Bool restart = GF_FALSE;
static Bool reload = GF_FALSE;
+
+Bool no_prog = 0;
+
#if defined(__DARWIN__) || defined(__APPLE__)
//we keep no decoder thread because of JS_GC deadlocks between threads ...
static u32 threading_flags = GF_TERM_NO_COMPOSITOR_THREAD | GF_TERM_NO_DECODER_THREAD;
+#define VK_MOD GF_KEY_MOD_ALT
#else
static u32 threading_flags = 0;
+#define VK_MOD GF_KEY_MOD_CTRL
#endif
static Bool no_audio = GF_FALSE;
static Bool term_step = GF_FALSE;
@@ -86,7 +96,7 @@ GF_Terminal *term;
u64 Duration;
GF_Err last_error = GF_OK;
static Bool enable_add_ons = GF_TRUE;
-static Fixed playback_speed = 1.0;
+static Fixed playback_speed = FIX_ONE;
static s32 request_next_playlist_item = GF_FALSE;
FILE *playlist = NULL;
@@ -114,23 +124,54 @@ u32 last_x, last_y;
Bool right_down = GF_FALSE;
void dump_frame(GF_Terminal *term, char *rad_path, u32 dump_type, u32 frameNum);
+
+enum
+{
+ DUMP_NONE = 0,
+ DUMP_AVI = 1,
+ DUMP_BMP = 2,
+ DUMP_PNG = 3,
+ DUMP_RAW = 4,
+ DUMP_SHA1 = 5,
+
+ //DuMP flags
+ DUMP_DEPTH_ONLY = 1<<16,
+ DUMP_RGB_DEPTH = 1<<17,
+ DUMP_RGB_DEPTH_SHAPE = 1<<18
+};
+
Bool dump_file(char *the_url, char *out_url, u32 dump_mode, Double fps, u32 width, u32 height, Float scale, u32 *times, u32 nb_times);
+static Bool shell_visible = GF_TRUE;
void hide_shell(u32 cmd_type)
{
#if defined(WIN32) && !defined(_WIN32_WCE)
typedef HWND (WINAPI *GetConsoleWindowT)(void);
HMODULE hk32 = GetModuleHandle("kernel32.dll");
GetConsoleWindowT GetConsoleWindow = (GetConsoleWindowT ) GetProcAddress(hk32,"GetConsoleWindow");
- if (cmd_type==0) ShowWindow( GetConsoleWindow(), SW_SHOW);
- else if (cmd_type==1) ShowWindow( GetConsoleWindow(), SW_HIDE);
+ if (cmd_type==0) {
+ ShowWindow( GetConsoleWindow(), SW_SHOW);
+ shell_visible = GF_TRUE;
+ }
+ else if (cmd_type==1) {
+ ShowWindow( GetConsoleWindow(), SW_HIDE);
+ shell_visible = GF_FALSE;
+ }
else if (cmd_type==2) PostMessage(GetConsoleWindow(), WM_CLOSE, 0, 0);
+
#endif
}
-
+void send_open_url(const char *url)
+{
+ GF_Event evt;
+ memset(&evt, 0, sizeof(GF_Event));
+ evt.type = GF_EVENT_NAVIGATE;
+ evt.navigate.to_url = url;
+ gf_term_send_event(term, &evt);
+}
void PrintUsage()
{
@@ -143,7 +184,10 @@ void PrintUsage()
"\t-rtix fileName: same as -rti but driven by GPAC logs\n"
"\t-quiet: removes script message, buffering and downloading status\n"
"\t-strict-error: exit when the player reports its first error\n"
- "\t-opt option: Overrides an option in the configuration file. String format is section:key=value\n"
+ "\t-opt option: Overrides an option in the configuration file. String format is section:key=value. \n"
+ "\t \"section:key=null\" removes the key\n"
+ "\t \"section:*=null\" removes the section\n"
+ "\t-conf option: Same as -opt but does not start player.\n"
"\t-log-file file: sets output log file. Also works with -lf\n"
"\t-logs log_args: sets log tools and levels, formatted as a ':'-separated list of toolX[:toolZ]@levelX\n"
"\t levelX can be one of:\n"
@@ -191,51 +235,57 @@ void PrintUsage()
#else
"\t-no-thread: disables thread usage (except for audio)\n"
#endif
- "\t-no-audio: disables audio \n"
+ "\t-no-compositor-thread: disables compositor thread (iOS and Android mode)\n"
+ "\t-no-audio: disables audio \n"
"\t-no-wnd: uses windowless mode (Win32 only)\n"
"\t-no-back: uses transparent background for output window when no background is specified (Win32 only)\n"
"\t-align vh: specifies v and h alignment for windowless mode\n"
- " possible v values: t(op), m(iddle), b(ottom)\n"
- " possible h values: l(eft), m(iddle), r(ight)\n"
- " default alignment is top-left\n"
- " default alignment is top-left\n"
+ "\t possible v values: t(op), m(iddle), b(ottom)\n"
+ "\t possible h values: l(eft), m(iddle), r(ight)\n"
+ "\t default alignment is top-left\n"
+ "\t default alignment is top-left\n"
"\t-pause: pauses at first frame\n"
+ "\t-play-from T: starts from T seconds in media\n"
+ "\t-speed S: starts with speed S\n"
"\t-loop: loops presentation\n"
"\t-no-regulation: disables framerate regulation\n"
"\t-bench: disable a/v output and bench source decoding (as fast as possible)\n"
"\t-vbench: disable audio output, video sync bench source decoding/display (as fast as possible)\n"
"\t-sbench: disable all decoders and bench systems layer (as fast as possible)\n"
- "\t-fs: starts in fullscreen mode\n"
- "\t-views v1:.:vN: creates an auto-stereo scene of N views. vN can be any type of URL supported by GPAC. \n"
- " in this mode, URL argument of GPAC is ignored, GUI as well.\n"
- " this is equivalent as using views://v1:.:N as an URL.\n"
+ "\t-fs: starts in fullscreen mode\n"
+ "\t-views v1:.:vN: creates an auto-stereo scene of N views. vN can be any type of URL supported by GPAC.\n"
+ "\t in this mode, URL argument of GPAC is ignored, GUI as well.\n"
+ "\t this is equivalent as using views://v1:.:N as an URL.\n"
"\n"
"\t-exit: automatically exits when presentation is over\n"
"\t-run-for TIME: runs for TIME seconds and exits\n"
"\t-service ID: auto-tune to given service ID in a multiplex\n"
+ "\t-noprog: disable progress report\n"
+ "\t-no-save: disable saving config file on exit\n"
"\t-no-addon: disable automatic loading of media addons declared in source URL\n"
"\t-gui: starts in GUI mode. The GUI is indicated in GPAC config, section General, by the key [StartupFile]\n"
"\n"
- "Dumper Options (times is a formated as start-end, with start being sec, h:m:s:f/fps or h:m:s:ms):\n"
+ "Dumper Options (times is a formated as start-end, with start being sec, h:m:s:f/fps or h:m:s:ms):\n"
"\t-bmp [times]: dumps given frames to bmp\n"
"\t-png [times]: dumps given frames to png\n"
"\t-raw [times]: dumps given frames to raw\n"
"\t-avi [times]: dumps given file to raw avi\n"
- "\r-out filename: name of the output file\n"
+ "\t-sha [times]: dumps given file to raw SHA-1 (1 hash per frame)\n"
+ "\r-out filename: name of the output file\n"
"\t-rgbds: dumps the RGBDS pixel format texture\n"
- " with -avi [times]: dumps an rgbds-format .avi\n"
+ "\t with -avi [times]: dumps an rgbds-format .avi\n"
"\t-rgbd: dumps the RGBD pixel format texture\n"
- " with -avi [times]: dumps an rgbd-format .avi\n"
+ "\t with -avi [times]: dumps an rgbd-format .avi\n"
"\t-depth: dumps depthmap (z-buffer) frames\n"
- " with -avi [times]: dumps depthmap in grayscale .avi\n"
- " with -bmp: dumps depthmap in grayscale .bmp\n"
- " with -png: dumps depthmap in grayscale .png\n"
+ "\t with -avi [times]: dumps depthmap in grayscale .avi\n"
+ "\t with -bmp: dumps depthmap in grayscale .bmp\n"
+ "\t with -png: dumps depthmap in grayscale .png\n"
"\t-fps FPS: specifies frame rate for AVI dumping (default: %f)\n"
"\t-scale s: scales the visual size (default: 1)\n"
"\t-fill: uses fill aspect ratio for dumping (default: none)\n"
- "\t-show: show window while dumping (default: no)\n"
+ "\t-show: shows window while dumping (default: no)\n"
"\n"
- "\t-help: show this screen\n"
+ "\t-help: shows this screen\n"
"\n"
"MP4Client - GPAC command line player and dumper - version "GPAC_FULL_VERSION"\n"
"GPAC Written by Jean Le Feuvre (c) 2001-2005 - ENST (c) 2005-200X\n"
@@ -257,6 +307,7 @@ void PrintHelp()
"\tP: jumps to a given number ahead in the playlist\n"
"\tr: reload current presentation\n"
"\tD: disconnects the current presentation\n"
+ "\tG: selects object or service ID\n"
"\n"
"\tp: play/pause the presentation\n"
"\ts: step one frame ahead\n"
@@ -342,11 +393,11 @@ static void UpdateRTInfo(const char *legend)
char szMsg[1024];
if (rti.total_cpu_usage && (bench_mode<2) ) {
- sprintf(szMsg, "FPS %d CPU %2d (%02d) Mem %d kB",
- (u32) gf_term_get_framerate(term, 0), rti.total_cpu_usage, rti.process_cpu_usage, (u32) (rti.gpac_memory / 1024));
+ sprintf(szMsg, "FPS %02.02f CPU %2d (%02d) Mem %d kB",
+ gf_term_get_framerate(term, 0), rti.total_cpu_usage, rti.process_cpu_usage, (u32) (rti.gpac_memory / 1024));
} else {
- sprintf(szMsg, "FPS %d CPU %02d Mem %d kB",
- (u32) gf_term_get_framerate(term, 0), rti.process_cpu_usage, (u32) (rti.gpac_memory / 1024) );
+ sprintf(szMsg, "FPS %02.02f CPU %02d Mem %d kB",
+ gf_term_get_framerate(term, 0), rti.process_cpu_usage, (u32) (rti.gpac_memory / 1024) );
}
if (display_rti==2) {
@@ -504,6 +555,16 @@ static const char * read_line_input(char * line, int maxSize, Bool showContent)
return line;
}
+static void do_set_speed(Fixed desired_speed)
+{
+ if (gf_term_set_speed(term, desired_speed) == GF_OK) {
+ playback_speed = desired_speed;
+ fprintf(stderr, "Playing at %g speed\n", FIX2FLT(playback_speed));
+ } else {
+ fprintf(stderr, "Adjusting speed to %g not supported for this content\n", FIX2FLT(desired_speed));
+ }
+}
+
Bool GPAC_EventProc(void *ptr, GF_Event *evt)
{
if (!term) return 0;
@@ -511,14 +572,24 @@ Bool GPAC_EventProc(void *ptr, GF_Event *evt)
if (gui_mode==1) {
if (evt->type==GF_EVENT_QUIT) {
Run = 0;
+ } else if (evt->type==GF_EVENT_KEYDOWN) {
+ switch (evt->key.key_code) {
+ case GF_KEY_C:
+ if (evt->key.flags & (GF_KEY_MOD_CTRL|GF_KEY_MOD_ALT)) {
+ hide_shell(shell_visible ? 1 : 0);
+ if (shell_visible) gui_mode=2;
+ }
+ break;
+ default:
+ break;
+ }
}
return 0;
}
switch (evt->type) {
case GF_EVENT_DURATION:
- Duration = 1000;
- Duration = (u64) (((s64) Duration) * evt->duration.duration);
+ Duration = (u64) ( 1000 * (s64) evt->duration.duration);
CanSeek = evt->duration.can_seek;
break;
case GF_EVENT_MESSAGE:
@@ -621,6 +692,12 @@ Bool GPAC_EventProc(void *ptr, GF_Event *evt)
case GF_KEY_ESCAPE:
gf_term_set_option(term, GF_OPT_FULLSCREEN, !gf_term_get_option(term, GF_OPT_FULLSCREEN));
break;
+ case GF_KEY_C:
+ if (evt->key.flags & (GF_KEY_MOD_CTRL|GF_KEY_MOD_ALT)) {
+ hide_shell(shell_visible ? 1 : 0);
+ if (!shell_visible) gui_mode=1;
+ }
+ break;
case GF_KEY_F:
if (evt->key.flags & GF_KEY_MOD_CTRL) fprintf(stderr, "Rendering rate: %f FPS\n", gf_term_get_framerate(term, 0));
break;
@@ -646,11 +723,25 @@ Bool GPAC_EventProc(void *ptr, GF_Event *evt)
if (evt->key.flags & GF_KEY_MOD_CTRL)
gf_term_set_option(term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_KEEP);
break;
+ case GF_KEY_O:
+ if (evt->key.flags & GF_KEY_MOD_CTRL && is_connected) {
+ if (gf_term_get_option(term, GF_OPT_MAIN_ADDON)) {
+ fprintf(stderr, "Resuming to main content\n");
+ gf_term_set_option(term, GF_OPT_PLAY_STATE, GF_STATE_PLAY_LIVE);
+ } else {
+ fprintf(stderr, "Main addon not enabled\n");
+ }
+ }
+ break;
case GF_KEY_P:
if (evt->key.flags & GF_KEY_MOD_CTRL && is_connected) {
- Bool is_pause = gf_term_get_option(term, GF_OPT_PLAY_STATE);
+ u32 is_pause = gf_term_get_option(term, GF_OPT_PLAY_STATE) ;
fprintf(stderr, "[Status: %s]\n", is_pause ? "Playing" : "Paused");
- gf_term_set_option(term, GF_OPT_PLAY_STATE, (gf_term_get_option(term, GF_OPT_PLAY_STATE)==GF_STATE_PAUSED) ? GF_STATE_PLAYING : GF_STATE_PAUSED);
+ if ((is_pause == GF_STATE_PAUSED) && (evt->key.flags & GF_KEY_MOD_SHIFT)) {
+ gf_term_set_option(term, GF_OPT_PLAY_STATE, GF_STATE_PLAY_LIVE);
+ } else {
+ gf_term_set_option(term, GF_OPT_PLAY_STATE, (gf_term_get_option(term, GF_OPT_PLAY_STATE)==GF_STATE_PAUSED) ? GF_STATE_PLAYING : GF_STATE_PAUSED);
+ }
}
break;
case GF_KEY_S:
@@ -686,24 +777,18 @@ Bool GPAC_EventProc(void *ptr, GF_Event *evt)
gf_term_toggle_addons(term, addon_visible);
break;
case GF_KEY_UP:
- if (evt->key.flags & GF_KEY_MOD_CTRL && is_connected) {
- playback_speed *= 2;
- fprintf(stderr, "Playing at %g speed\n", FIX2FLT(playback_speed));
- gf_term_set_speed(term, playback_speed);
+ if (evt->key.flags & VK_MOD && is_connected) {
+ do_set_speed(playback_speed * 2);
}
break;
case GF_KEY_DOWN:
- if (evt->key.flags & GF_KEY_MOD_CTRL && is_connected) {
- playback_speed /= 2;
- fprintf(stderr, "Playing at %g speed\n", FIX2FLT(playback_speed));
- gf_term_set_speed(term, playback_speed);
+ if (evt->key.flags & VK_MOD && is_connected) {
+ do_set_speed(playback_speed / 2);
}
break;
case GF_KEY_LEFT:
- if (evt->key.flags & GF_KEY_MOD_CTRL && is_connected) {
- playback_speed = -playback_speed;
- fprintf(stderr, "Playing at %g speed\n", FIX2FLT(playback_speed));
- gf_term_set_speed(term, playback_speed);
+ if (evt->key.flags & VK_MOD && is_connected) {
+ do_set_speed(-1 * playback_speed );
}
break;
@@ -715,6 +800,9 @@ Bool GPAC_EventProc(void *ptr, GF_Event *evt)
is_connected = 1;
fprintf(stderr, "Service Connected\n");
eos_seen = GF_FALSE;
+ if (playback_speed != FIX_ONE)
+ gf_term_set_speed(term, playback_speed);
+
} else if (is_connected) {
fprintf(stderr, "Service %s\n", is_connected ? "Disconnected" : "Connection Failed");
is_connected = 0;
@@ -758,7 +846,7 @@ Bool GPAC_EventProc(void *ptr, GF_Event *evt)
u32 i, pos;
/*todo - force playlist mode*/
if (readonly_playlist) {
- fclose(playlist);
+ gf_fclose(playlist);
playlist = NULL;
}
readonly_playlist = 0;
@@ -927,6 +1015,7 @@ static Bool get_time_list(char *arg, u32 *times, u32 *nb_times)
return 1;
}
+static u64 last_log_time=0;
static void on_gpac_log(void *cbk, u32 ll, u32 lm, const char *fmt, va_list list)
{
FILE *logs = cbk;
@@ -936,13 +1025,17 @@ static void on_gpac_log(void *cbk, u32 ll, u32 lm, const char *fmt, va_list list
vsprintf(szMsg, fmt, list);
UpdateRTInfo(szMsg + 6 /*"[RTI] "*/);
} else {
- if (log_time_start) fprintf(logs, "[At "LLD"]", gf_sys_clock_high_res() - log_time_start);
+ if (log_time_start) {
+ u64 now = gf_sys_clock_high_res();
+ fprintf(logs, "At "LLD" (diff %d) - ", now - log_time_start, (u32) (now - last_log_time) );
+ last_log_time = now;
+ }
if (log_utc_time) {
u64 utc_clock = gf_net_get_utc() ;
time_t secs = utc_clock/1000;
struct tm t;
t = *gmtime(&secs);
- fprintf(logs, "[UTC %d-%02d-%02dT%02d:%02d:%02dZ - TS "LLU"]", 1900+t.tm_year, t.tm_mon+1, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec, utc_clock);
+ fprintf(logs, "UTC %d-%02d-%02dT%02d:%02d:%02dZ (TS "LLU") - ", 1900+t.tm_year, t.tm_mon+1, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec, utc_clock);
}
vfprintf(logs, fmt, list);
fflush(logs);
@@ -951,8 +1044,8 @@ static void on_gpac_log(void *cbk, u32 ll, u32 lm, const char *fmt, va_list list
static void init_rti_logs(char *rti_file, char *url, Bool use_rtix)
{
- if (rti_logs) fclose(rti_logs);
- rti_logs = gf_f64_open(rti_file, "wt");
+ if (rti_logs) gf_fclose(rti_logs);
+ rti_logs = gf_fopen(rti_file, "wt");
if (rti_logs) {
fprintf(rti_logs, "!! GPAC RunTime Info ");
if (url) fprintf(rti_logs, "for file %s", url);
@@ -992,7 +1085,19 @@ void set_cfg_option(char *opt_string)
strcpy(szKey, sep);
strcpy(szVal, sep2+1);
sep2[0] = '=';
- if (!stricmp(szVal, "null")) szVal[0]=0;
+
+ if (!stricmp(szKey, "*")) {
+ if (stricmp(szVal, "null")) {
+ fprintf(stderr, "Badly formatted option %s - expected Section:*=null\n", opt_string);
+ return;
+ }
+ gf_cfg_del_section(cfg_file, szSec);
+ return;
+ }
+
+ if (!stricmp(szVal, "null")) {
+ szVal[0]=0;
+ }
gf_cfg_set_key(cfg_file, szSec, szKey, szVal[0] ? szVal : NULL);
}
@@ -1000,6 +1105,8 @@ void set_cfg_option(char *opt_string)
#include
#endif
+static void progress_quiet(const void *cbck, const char *title, u64 done, u64 total) { }
+
int main (int argc, char **argv)
{
char c;
@@ -1011,10 +1118,10 @@ int main (int argc, char **argv)
Bool logs_set = GF_FALSE;
Bool start_fs = GF_FALSE;
Bool use_rtix = GF_FALSE;
- Bool rgbds_dump = GF_FALSE;
- Bool rgbd_dump = GF_FALSE;
- Bool depth_dump = GF_FALSE;
Bool pause_at_first = GF_FALSE;
+ Bool no_cfg_save = GF_FALSE;
+ Bool is_cfg_only = GF_FALSE;
+
Double play_from = 0;
#ifdef GPAC_MEMORY_TRACKING
Bool enable_mem_tracker = GF_FALSE;
@@ -1033,7 +1140,7 @@ int main (int argc, char **argv)
memset(&user, 0, sizeof(GF_User));
- dump_mode = 0;
+ dump_mode = DUMP_NONE;
fill_ar = visible = GF_FALSE;
url_arg = out_arg = the_cfg = rti_file = views = default_com = NULL;
nb_times = 0;
@@ -1052,8 +1159,11 @@ int main (int argc, char **argv)
#else
fprintf(stderr, "WARNING - GPAC not compiled with Memory Tracker - ignoring \"-mem-track\"\n");
#endif
- }
- else if (!strcmp(arg, "-h") || !strcmp(arg, "-help")) {
+ } else if (!strcmp(arg, "-gui")) {
+ gui_mode = 1;
+ } else if (!strcmp(arg, "-guid")) {
+ gui_mode = 2;
+ } else if (!strcmp(arg, "-h") || !strcmp(arg, "-help")) {
PrintUsage();
return 1;
}
@@ -1064,6 +1174,7 @@ int main (int argc, char **argv)
#else
gf_sys_init(GF_FALSE);
#endif
+ gf_sys_set_args(argc, (const char **) argv);
cfg_file = gf_cfg_init(the_cfg, NULL);
if (!cfg_file) {
@@ -1079,78 +1190,33 @@ int main (int argc, char **argv)
logs_set = GF_TRUE;
}
+ if (!gui_mode) {
+ str = gf_cfg_get_key(cfg_file, "General", "ForceGUI");
+ if (str && !strcmp(str, "yes")) gui_mode = 1;
+ }
+
for (i=1; i<(u32) argc; i++) {
char *arg = argv[i];
-// if (isalnum(arg[0]) || (arg[0]=='/') || (arg[0]=='.') || (arg[0]=='\\') ) {
- if (arg[0] != '-') {
- url_arg = arg;
- } else if (!strcmp(arg, "-c") || !strcmp(arg, "-cfg")) {
- the_cfg = argv[i+1];
- i++;
- } else if (!strcmp(arg, "-rti")) {
+
+ if (!strcmp(arg, "-rti")) {
rti_file = argv[i+1];
i++;
} else if (!strcmp(arg, "-rtix")) {
rti_file = argv[i+1];
i++;
use_rtix = GF_TRUE;
- } else if (!strcmp(arg, "-fill")) {
- fill_ar = GF_TRUE;
- } else if (!strcmp(arg, "-gui")) {
- gui_mode = 1;
- } else if (!strcmp(arg, "-guid")) {
- gui_mode = 2;
- } else if (!strcmp(arg, "-show")) {
- visible = 1;
- } else if (!strcmp(arg, "-avi")) {
- if (rgbds_dump) dump_mode = 5;
- else if (depth_dump) dump_mode = 8;
- else if (rgbd_dump) dump_mode = 10;
- else dump_mode=1;
- if ((url_arg || (i+2<(u32)argc)) && get_time_list(argv[i+1], times, &nb_times)) i++;
- } else if (!strcmp(arg, "-rgbds")) { /*get dump in rgbds pixel format*/
- rgbds_dump = 1;
- dump_mode=6; /* rgbds texture directly*/
- if (dump_mode==1) dump_mode = 5; /* .avi rgbds dump*/
- } else if (!strcmp(arg, "-rgbd")) { /*get dump in rgbd pixel format*/
- rgbd_dump = 1;
- dump_mode=9; /* rgbd texture directly*/
- if (dump_mode==1) dump_mode = 10; /* .avi rgbds dump*/
- } else if (!strcmp(arg, "-depth")) {
- depth_dump = 1;
- if (dump_mode==2) dump_mode=7; /* grayscale .bmp depth dump*/
- else if (dump_mode==1) dump_mode=8; /* .avi depth dump*/
- else if (dump_mode==11)dump_mode=12;
- else dump_mode=4; /*depth dump*/
- } else if (!strcmp(arg, "-bmp")) {
- if(depth_dump) dump_mode=7; /*grayscale depth .bmp dump*/
- else dump_mode=2;
- if ((url_arg || (i+2<(u32)argc)) && get_time_list(argv[i+1], times, &nb_times)) i++;
- } else if (!strcmp(arg, "-png")) {
- dump_mode=11;
- if ((url_arg || (i+2<(u32)argc)) && get_time_list(argv[i+1], times, &nb_times)) i++;
- } else if (!strcmp(arg, "-raw")) {
- dump_mode = 3;
- if ((url_arg || (i+2<(u32)argc)) && get_time_list(argv[i+1], times, &nb_times)) i++;
-
} else if (!stricmp(arg, "-size")) {
/*usage of %ud breaks sscanf on MSVC*/
if (sscanf(argv[i+1], "%dx%d", &forced_width, &forced_height) != 2) {
forced_width = forced_height = 0;
}
i++;
- } else if (!stricmp(arg, "-scale")) {
- sscanf(argv[i+1], "%f", &scale);
- i++;
- } else if (!stricmp(arg, "-fps")) {
- fps = atof(argv[i+1]);
- i++;
} else if (!strcmp(arg, "-quiet")) {
be_quiet = 1;
} else if (!strcmp(arg, "-strict-error")) {
gf_log_set_strict_error(1);
} else if (!strcmp(arg, "-log-file") || !strcmp(arg, "-lf")) {
- logfile = gf_f64_open(argv[i+1], "wt");
+ logfile = gf_fopen(argv[i+1], "wt");
gf_log_set_callback(logfile, on_gpac_log);
i++;
} else if (!strcmp(arg, "-logs") ) {
@@ -1163,100 +1229,178 @@ int main (int argc, char **argv)
log_time_start = 1;
} else if (!strcmp(arg, "-log-utc") || !strcmp(arg, "-lu")) {
log_utc_time = 1;
- } else if (!strcmp(arg, "-align")) {
- if (argv[i+1][0]=='m') align_mode = 1;
- else if (argv[i+1][0]=='b') align_mode = 2;
- align_mode <<= 8;
- if (argv[i+1][1]=='m') align_mode |= 1;
- else if (argv[i+1][1]=='r') align_mode |= 2;
- i++;
}
- else if (!strcmp(arg, "-no-wnd")) user.init_flags |= GF_TERM_WINDOWLESS;
- else if (!strcmp(arg, "-no-back")) user.init_flags |= GF_TERM_WINDOW_TRANSPARENT;
#if defined(__DARWIN__) || defined(__APPLE__)
else if (!strcmp(arg, "-thread")) threading_flags = 0;
#else
else if (!strcmp(arg, "-no-thread")) threading_flags = GF_TERM_NO_DECODER_THREAD | GF_TERM_NO_COMPOSITOR_THREAD | GF_TERM_WINDOW_NO_THREAD;
#endif
+ else if (!strcmp(arg, "-no-compositor-thread")) threading_flags |= GF_TERM_NO_COMPOSITOR_THREAD;
else if (!strcmp(arg, "-no-audio")) no_audio = 1;
else if (!strcmp(arg, "-no-regulation")) no_regulation = 1;
else if (!strcmp(arg, "-fs")) start_fs = 1;
- else if (!strcmp(arg, "-pause")) pause_at_first = 1;
- else if (!strcmp(arg, "-play-from")) {
- play_from = atof((const char *) argv[i+1]);
- }
- else if (!strcmp(arg, "-exit")) auto_exit = 1;
- else if (!strcmp(arg, "-mem-track")) {
-#ifdef GPAC_MEMORY_TRACKING
- enable_mem_tracker = 1;
-#else
- fprintf(stderr, "WARNING - GPAC not compiled with Memory Tracker - ignoring \"-mem-track\"\n");
-#endif
- }
- else if (!strcmp(arg, "-out")) {
- out_arg = gf_strdup(argv[i+1]);
- }
- else if (!strcmp(arg, "-loop")) loop_at_end = 1;
- else if (!strcmp(arg, "-bench")) bench_mode = 1;
- else if (!strcmp(arg, "-vbench")) bench_mode = 2;
- else if (!strcmp(arg, "-sbench")) bench_mode = 3;
- else if (!strcmp(arg, "-no-addon")) enable_add_ons = GF_FALSE;
else if (!strcmp(arg, "-opt")) {
set_cfg_option(argv[i+1]);
i++;
+ } else if (!strcmp(arg, "-conf")) {
+ set_cfg_option(argv[i+1]);
+ is_cfg_only=GF_TRUE;
+ i++;
}
else if (!strcmp(arg, "-ifce")) {
gf_cfg_set_key(cfg_file, "Network", "DefaultMCastInterface", argv[i+1]);
i++;
}
- else if (!stricmp(arg, "-views")) {
- views = argv[i+1];
- i++;
- }
- else if (!stricmp(arg, "-run-for")) {
- simulation_time_in_ms = atoi(argv[i+1]) * 1000;
- if (!simulation_time_in_ms)
- simulation_time_in_ms = 1; /*1ms*/
- i++;
- }
- else if (!stricmp(arg, "-com")) {
- default_com = argv[i+1];
- i++;
- }
- else if (!stricmp(arg, "-service")) {
- initial_service_id = atoi(argv[i+1]);
- i++;
- }
- else if (!stricmp(arg, "-help")) {
- PrintUsage();
- return 1;
- } else {
- fprintf(stderr, "Unrecognized option %s - skipping\n", arg);
+ else if (!stricmp(arg, "-help")) {
+ PrintUsage();
+ return 1;
+ }
+ else if (!stricmp(arg, "-noprog")) {
+ no_prog=1;
+ gf_set_progress_callback(NULL, progress_quiet);
+ }
+ else if (!stricmp(arg, "--no-save")) {
+ no_cfg_save=1;
+ }
+
+
+ /*arguments only used in non-gui mode*/
+ else if (!gui_mode) {
+ if (arg[0] != '-') {
+ url_arg = arg;
+ }
+ else if (!strcmp(arg, "-out")) {
+ out_arg = argv[i+1];
+ i++;
+ }
+ else if (!stricmp(arg, "-fps")) {
+ fps = atof(argv[i+1]);
+ i++;
+ } else if (!strcmp(arg, "-avi") || !strcmp(arg, "-sha")) {
+ dump_mode &= 0xFFFF0000;
+
+ if (!strcmp(arg, "-sha")) dump_mode |= DUMP_SHA1;
+ else dump_mode |= DUMP_AVI;
+
+ if ((url_arg || (i+2<(u32)argc)) && get_time_list(argv[i+1], times, &nb_times)) i++;
+ } else if (!strcmp(arg, "-rgbds")) { /*get dump in rgbds pixel format*/
+ dump_mode |= DUMP_RGB_DEPTH_SHAPE;
+ } else if (!strcmp(arg, "-rgbd")) { /*get dump in rgbd pixel format*/
+ dump_mode |= DUMP_RGB_DEPTH;
+ } else if (!strcmp(arg, "-depth")) {
+ dump_mode |= DUMP_DEPTH_ONLY;
+ } else if (!strcmp(arg, "-bmp")) {
+ dump_mode &= 0xFFFF0000;
+ dump_mode |= DUMP_BMP;
+ if ((url_arg || (i+2<(u32)argc)) && get_time_list(argv[i+1], times, &nb_times)) i++;
+ } else if (!strcmp(arg, "-png")) {
+ dump_mode &= 0xFFFF0000;
+ dump_mode |= DUMP_PNG;
+ if ((url_arg || (i+2<(u32)argc)) && get_time_list(argv[i+1], times, &nb_times)) i++;
+ } else if (!strcmp(arg, "-raw")) {
+ dump_mode &= 0xFFFF0000;
+ dump_mode |= DUMP_RAW;
+ if ((url_arg || (i+2<(u32)argc)) && get_time_list(argv[i+1], times, &nb_times)) i++;
+ } else if (!stricmp(arg, "-scale")) {
+ sscanf(argv[i+1], "%f", &scale);
+ i++;
+ }
+ else if (!strcmp(arg, "-loop")) loop_at_end = 1;
+ else if (!strcmp(arg, "-bench")) bench_mode = 1;
+ else if (!strcmp(arg, "-vbench")) bench_mode = 2;
+ else if (!strcmp(arg, "-sbench")) bench_mode = 3;
+ else if (!strcmp(arg, "-no-addon")) enable_add_ons = GF_FALSE;
+
+ else if (!strcmp(arg, "-pause")) pause_at_first = 1;
+ else if (!strcmp(arg, "-play-from")) {
+ play_from = atof((const char *) argv[i+1]);
+ }
+ else if (!strcmp(arg, "-speed")) {
+ playback_speed = FLT2FIX( atof((const char *) argv[i+1]) );
+ if (playback_speed <= 0) playback_speed = FIX_ONE;
+ }
+ else if (!strcmp(arg, "-no-wnd")) user.init_flags |= GF_TERM_WINDOWLESS;
+ else if (!strcmp(arg, "-no-back")) user.init_flags |= GF_TERM_WINDOW_TRANSPARENT;
+ else if (!strcmp(arg, "-align")) {
+ if (argv[i+1][0]=='m') align_mode = 1;
+ else if (argv[i+1][0]=='b') align_mode = 2;
+ align_mode <<= 8;
+ if (argv[i+1][1]=='m') align_mode |= 1;
+ else if (argv[i+1][1]=='r') align_mode |= 2;
+ i++;
+ } else if (!strcmp(arg, "-fill")) {
+ fill_ar = GF_TRUE;
+ } else if (!strcmp(arg, "-show")) {
+ visible = 1;
+ }
+ else if (!strcmp(arg, "-exit")) auto_exit = GF_TRUE;
+ else if (!stricmp(arg, "-views")) {
+ views = argv[i+1];
+ i++;
+ }
+ else if (!stricmp(arg, "-run-for")) {
+ simulation_time_in_ms = atoi(argv[i+1]) * 1000;
+ if (!simulation_time_in_ms)
+ simulation_time_in_ms = 1; /*1ms*/
+ i++;
+ }
+ else if (!stricmp(arg, "-com")) {
+ default_com = argv[i+1];
+ i++;
+ }
+ else if (!stricmp(arg, "-service")) {
+ initial_service_id = atoi(argv[i+1]);
+ i++;
+ } else if (!strcmp(arg, "-mem-track")) {
+
+ } else {
+ fprintf(stderr, "Unrecognized option %s - skipping\n", arg);
+ }
}
}
+ if (is_cfg_only) {
+ gf_cfg_del(cfg_file);
+ fprintf(stderr, "GPAC Config updated\n");
+ return 0;
+ }
if (dump_mode && !url_arg ) {
fprintf(stderr, "Missing argument for dump\n");
PrintUsage();
- if (logfile) fclose(logfile);
+ if (logfile) gf_fclose(logfile);
return 1;
}
- if (!url_arg && simulation_time_in_ms)
- simulation_time_in_ms += gf_sys_clock();
-
- if (!gui_mode) {
- str = gf_cfg_get_key(cfg_file, "General", "ForceGUI");
- if (str && !strcmp(str, "yes")) gui_mode = 1;
+ if (!gui_mode && !url_arg && (gf_cfg_get_key(cfg_file, "General", "StartupFile") != NULL)) {
+ gui_mode=1;
}
- if (gui_mode) {
- if (gui_mode==1) {
- hide_shell(1);
- //user.init_flags |= GF_TERM_WINDOW_NO_DECORATION;
+#ifdef WIN32
+ if (gui_mode==1) {
+ const char *opt;
+ TCHAR buffer[1024];
+ DWORD res = GetCurrentDirectory(1024, buffer);
+ buffer[res] = 0;
+ opt = gf_cfg_get_key(cfg_file, "General", "ModulesDirectory");
+ if (strstr(opt, buffer)) {
+ gui_mode=1;
+ } else {
+ gui_mode=2;
}
}
+#endif
+
+ if (gui_mode==1) {
+ hide_shell(1);
+ }
+
+ if (!url_arg && simulation_time_in_ms)
+ simulation_time_in_ms += gf_sys_clock();
+#if defined(__DARWIN__) || defined(__APPLE__)
+ carbon_init();
+#endif
+
if (dump_mode) rti_file = NULL;
@@ -1275,8 +1419,10 @@ int main (int argc, char **argv)
/*setup dumping options*/
if (dump_mode) {
- user.init_flags |= GF_TERM_NO_AUDIO | GF_TERM_NO_DECODER_THREAD | GF_TERM_NO_COMPOSITOR_THREAD | GF_TERM_NO_REGULATION /*| GF_TERM_INIT_HIDE*/;
+ user.init_flags |= GF_TERM_NO_DECODER_THREAD | GF_TERM_NO_COMPOSITOR_THREAD | GF_TERM_NO_REGULATION /*| GF_TERM_INIT_HIDE*/;
if (visible || dump_mode==8) user.init_flags |= GF_TERM_INIT_HIDE;
+ gf_cfg_set_key(cfg_file, "Audio", "DriverName", "Raw Audio Output");
+ no_cfg_save=GF_TRUE;
} else {
init_w = forced_width;
init_h = forced_height;
@@ -1289,7 +1435,7 @@ int main (int argc, char **argv)
if (user.modules) gf_modules_del(user.modules);
gf_cfg_del(cfg_file);
gf_sys_close();
- if (logfile) fclose(logfile);
+ if (logfile) gf_fclose(logfile);
return 1;
}
fprintf(stderr, "Modules Found : %d \n", i);
@@ -1304,10 +1450,12 @@ int main (int argc, char **argv)
if (threading_flags & (GF_TERM_NO_DECODER_THREAD|GF_TERM_NO_COMPOSITOR_THREAD) ) term_step = 1;
+ //in dump mode we don't want to rely on system clock but on the number of samples being consumed
+ if (dump_mode) user.init_flags |= GF_TERM_USE_AUDIO_HW_CLOCK;
if (bench_mode) {
gf_cfg_discard_changes(user.config);
- auto_exit = 1;
+ auto_exit = GF_TRUE;
gf_cfg_set_key(user.config, "Audio", "DriverName", "Raw Audio Output");
if (bench_mode!=2) {
gf_cfg_set_key(user.config, "Video", "DriverName", "Raw Video Output");
@@ -1328,7 +1476,7 @@ int main (int argc, char **argv)
gf_cfg_discard_changes(cfg_file);
gf_cfg_del(cfg_file);
gf_sys_close();
- if (logfile) fclose(logfile);
+ if (logfile) gf_fclose(logfile);
return 1;
}
fprintf(stderr, "Terminal Loaded in %d ms\n", gf_sys_clock()-i);
@@ -1379,61 +1527,59 @@ int main (int argc, char **argv)
}
dump_file(url_arg, out_arg, dump_mode, fps, forced_width, forced_height, scale, times, nb_times);
Run = 0;
- } else
-
- /*connect if requested*/
- if (views) {
- } else if (!gui_mode && url_arg) {
- char *ext;
-
- strcpy(the_url, url_arg);
- ext = strrchr(the_url, '.');
- if (ext && (!stricmp(ext, ".m3u") || !stricmp(ext, ".pls"))) {
- GF_Err e = GF_OK;
- fprintf(stderr, "Opening Playlist %s\n", the_url);
-
- strcpy(pl_path, the_url);
- /*this is not clean, we need to have a plugin handle playlist for ourselves*/
- if (!strncmp("http:", the_url, 5)) {
- GF_DownloadSession *sess = gf_dm_sess_new(term->downloader, the_url, GF_NETIO_SESSION_NOT_THREADED, NULL, NULL, &e);
- if (sess) {
- e = gf_dm_sess_process(sess);
- if (!e) strcpy(the_url, gf_dm_sess_get_cache_name(sess));
- gf_dm_sess_del(sess);
- }
+ }
+ else if (views) {
+ }
+ /*connect if requested*/
+ else if (!gui_mode && url_arg) {
+ char *ext;
+
+ strcpy(the_url, url_arg);
+ ext = strrchr(the_url, '.');
+ if (ext && (!stricmp(ext, ".m3u") || !stricmp(ext, ".pls"))) {
+ GF_Err e = GF_OK;
+ fprintf(stderr, "Opening Playlist %s\n", the_url);
+
+ strcpy(pl_path, the_url);
+ /*this is not clean, we need to have a plugin handle playlist for ourselves*/
+ if (!strncmp("http:", the_url, 5)) {
+ GF_DownloadSession *sess = gf_dm_sess_new(term->downloader, the_url, GF_NETIO_SESSION_NOT_THREADED, NULL, NULL, &e);
+ if (sess) {
+ e = gf_dm_sess_process(sess);
+ if (!e) strcpy(the_url, gf_dm_sess_get_cache_name(sess));
+ gf_dm_sess_del(sess);
}
+ }
- playlist = e ? NULL : gf_f64_open(the_url, "rt");
- readonly_playlist = 1;
- if (playlist) {
- if (1 > fscanf(playlist, "%s", the_url))
- fprintf(stderr, "Cannot read any URL from playlist\n");
- else {
- fprintf(stderr, "Opening URL %s\n", the_url);
- gf_term_connect_with_path(term, the_url, pl_path);
- }
- } else {
- if (e)
- fprintf(stderr, "Failed to open playlist %s: %s\n", the_url, gf_error_to_string(e) );
- fprintf(stderr, "Hit 'h' for help\n\n");
+ playlist = e ? NULL : gf_fopen(the_url, "rt");
+ readonly_playlist = 1;
+ if (playlist) {
+ if (1 > fscanf(playlist, "%s", the_url))
+ fprintf(stderr, "Cannot read any URL from playlist\n");
+ else {
+ fprintf(stderr, "Opening URL %s\n", the_url);
+ gf_term_connect_with_path(term, the_url, pl_path);
}
} else {
- fprintf(stderr, "Opening URL %s\n", the_url);
- if (pause_at_first) fprintf(stderr, "[Status: Paused]\n");
- gf_term_connect_from_time(term, the_url, (u64) (play_from*1000), pause_at_first);
+ if (e)
+ fprintf(stderr, "Failed to open playlist %s: %s\n", the_url, gf_error_to_string(e) );
+ fprintf(stderr, "Hit 'h' for help\n\n");
}
} else {
- fprintf(stderr, "Hit 'h' for help\n\n");
- str = gf_cfg_get_key(cfg_file, "General", "StartupFile");
- if (str) {
- strcpy(the_url, "MP4Client "GPAC_FULL_VERSION);
- gf_term_connect(term, str);
- startup_file = 1;
- }
- if (url_arg) {
- gf_cfg_set_key(cfg_file, "Temp", "GUIStartupFile", url_arg);
- }
+ fprintf(stderr, "Opening URL %s\n", the_url);
+ if (pause_at_first) fprintf(stderr, "[Status: Paused]\n");
+ gf_term_connect_from_time(term, the_url, (u64) (play_from*1000), pause_at_first);
+ }
+ } else {
+ fprintf(stderr, "Hit 'h' for help\n\n");
+ str = gf_cfg_get_key(cfg_file, "General", "StartupFile");
+ if (str) {
+ strcpy(the_url, "MP4Client "GPAC_FULL_VERSION);
+ gf_term_connect(term, str);
+ startup_file = 1;
+ is_connected = 1;
}
+ }
if (gui_mode==2) gui_mode=0;
if (start_fs) gf_term_set_option(term, GF_OPT_FULLSCREEN, 1);
@@ -1450,8 +1596,9 @@ int main (int argc, char **argv)
while (Run) {
+
/*we don't want getchar to block*/
- if (gui_mode || !gf_prompt_has_input()) {
+ if ((gui_mode==1) || !gf_prompt_has_input()) {
if (reload) {
reload = 0;
gf_term_disconnect(term);
@@ -1486,14 +1633,14 @@ int main (int argc, char **argv)
gf_sleep(rti_update_time_ms);
}
if (auto_exit && eos_seen && gf_term_get_option(term, GF_OPT_IS_OVER)) {
- Run = 0;
+ Run = GF_FALSE;
}
/*sim time*/
if (simulation_time_in_ms
&& ( (gf_term_get_time_in_ms(term)>simulation_time_in_ms) || (!url_arg && gf_sys_clock()>simulation_time_in_ms))
) {
- Run = 0;
+ Run = GF_FALSE;
}
continue;
}
@@ -1502,7 +1649,13 @@ int main (int argc, char **argv)
force_input:
switch (c) {
case 'q':
- Run = 0;
+ {
+ GF_Event evt;
+ memset(&evt, 0, sizeof(GF_Event));
+ evt.type = GF_EVENT_QUIT;
+ gf_term_send_event(term, &evt);
+ }
+// Run = 0;
break;
case 'X':
exit(0);
@@ -1527,11 +1680,11 @@ force_input:
fprintf(stderr, "Cannot read the absolute URL, aborting.\n");
break;
}
- playlist = gf_f64_open(the_url, "rt");
+ playlist = gf_fopen(the_url, "rt");
if (playlist) {
if (1 > fscanf(playlist, "%s", the_url)) {
fprintf(stderr, "Cannot read any URL from playlist, aborting.\n");
- fclose( playlist);
+ gf_fclose( playlist);
break;
}
fprintf(stderr, "Opening URL %s\n", the_url);
@@ -1668,11 +1821,15 @@ force_input:
case 'i':
if (is_connected) {
u32 ID;
- do {
- fprintf(stderr, "Enter OD ID (0 for main OD): ");
- fflush(stderr);
- } while( 1 > scanf("%ud", &ID));
- ViewOD(term, ID, (u32)-1);
+ fprintf(stderr, "Enter OD ID (0 for main OD): ");
+ fflush(stderr);
+ if (scanf("%ud", &ID) == 1) {
+ ViewOD(term, ID, (u32)-1, NULL);
+ } else {
+ char str_url[GF_MAX_PATH];
+ if (scanf("%s", str_url) == 1)
+ ViewOD(term, 0, (u32)-1, str_url);
+ }
}
break;
case 'j':
@@ -1682,7 +1839,7 @@ force_input:
fprintf(stderr, "Enter OD number (0 for main OD): ");
fflush(stderr);
} while( 1 > scanf("%ud", &num));
- ViewOD(term, (u32)-1, num);
+ ViewOD(term, (u32)-1, num, NULL);
}
break;
case 'b':
@@ -1834,7 +1991,7 @@ force_input:
e = gf_term_scene_update(term, NULL, szCom);
if (e) fprintf(stderr, "Processing command failed: %s\n", gf_error_to_string(e));
}
- break;
+ break;
case 'e':
{
GF_Err e;
@@ -1849,7 +2006,7 @@ force_input:
e = gf_term_scene_update(term, "application/ecmascript", jsCode);
if (e) fprintf(stderr, "Processing JS code failed: %s\n", gf_error_to_string(e));
}
- break;
+ break;
case 'L':
{
@@ -1863,7 +2020,7 @@ force_input:
}
gf_log_modify_tools_levels(szLog);
}
- break;
+ break;
case 'g':
{
@@ -1871,7 +2028,7 @@ force_input:
gf_sys_get_rti(rti_update_time_ms, &rti, 0);
fprintf(stderr, "GPAC allocated memory "LLD"\n", rti.gpac_memory);
}
- break;
+ break;
case 'M':
{
u32 size;
@@ -1880,7 +2037,7 @@ force_input:
} while (1 > scanf("%ud", &size));
gf_term_set_option(term, GF_OPT_VIDEO_CACHE_SIZE, size);
}
- break;
+ break;
case 'H':
{
@@ -1891,7 +2048,7 @@ force_input:
gf_term_set_option(term, GF_OPT_HTTP_MAX_RATE, http_bitrate);
}
- break;
+ break;
case 'E':
gf_term_set_option(term, GF_OPT_RELOAD_CONFIG, 1);
@@ -1913,7 +2070,7 @@ force_input:
}
set_cfg_option(szOpt);
}
- break;
+ break;
/*extract to PNG*/
case 'Z':
@@ -1944,7 +2101,7 @@ force_input:
sprintf(szFileName, "view%d_dump.png", offscreen_view);
e = gf_term_get_offscreen_buffer(term, &fb, offscreen_view-1, 0);
} else {
- sprintf(szFileName, "video_dump.png");
+ sprintf(szFileName, "gpac_video_dump_"LLU".png", gf_net_get_utc() );
e = gf_term_get_screen_buffer(term, &fb);
}
offscreen_view++;
@@ -1961,13 +2118,13 @@ force_input:
fprintf(stderr, "Error encoding PNG %s\n", gf_error_to_string(e) );
nb_pass = 0;
} else {
- FILE *png = gf_f64_open(szFileName, "wb");
+ FILE *png = gf_fopen(szFileName, "wb");
if (!png) {
fprintf(stderr, "Error writing file %s\n", szFileName);
nb_pass = 0;
} else {
gf_fwrite(dst, dst_size, 1, png);
- fclose(png);
+ gf_fclose(png);
fprintf(stderr, "Dump to %s\n", szFileName);
}
}
@@ -1996,7 +2153,7 @@ force_input:
odm = NULL;
root_od = gf_term_get_root_object(term);
if (root_od) {
- odm = gf_term_get_object(term, root_od, index);
+ odm = gf_term_get_object(term, root_od, index);
if (odm) {
gf_term_select_object(term, odm);
} else {
@@ -2005,7 +2162,7 @@ force_input:
}
}
}
- break;
+ break;
case 'h':
PrintHelp();
@@ -2019,26 +2176,50 @@ force_input:
PrintAVInfo(GF_TRUE);
}
+ /*FIXME: we have an issue in cleaning up after playing in bench mode and run-for 0 (buildbot tests). We for now disable error checks after run-for is done*/
+ if (simulation_time_in_ms) {
+ gf_log_set_strict_error(0);
+ }
+
+
i = gf_sys_clock();
gf_term_disconnect(term);
if (rti_file) UpdateRTInfo("Disconnected\n");
fprintf(stderr, "Deleting terminal... ");
- if (playlist) fclose(playlist);
+ if (playlist) gf_fclose(playlist);
+
+#if defined(__DARWIN__) || defined(__APPLE__)
+ carbon_uninit();
+#endif
+
gf_term_del(term);
- fprintf(stderr, "done (in %d ms)\n", gf_sys_clock() - i);
+ fprintf(stderr, "done (in %d ms) - ran for %d ms\n", gf_sys_clock() - i, gf_sys_clock());
fprintf(stderr, "GPAC cleanup ...\n");
gf_modules_del(user.modules);
+
+ if (no_cfg_save)
+ gf_cfg_discard_changes(cfg_file);
+
gf_cfg_del(cfg_file);
gf_sys_close();
- if (rti_logs) fclose(rti_logs);
- if (logfile) fclose(logfile);
+
+ if (rti_logs) gf_fclose(rti_logs);
+ if (logfile) gf_fclose(logfile);
if (gui_mode) {
hide_shell(2);
}
+
+#ifdef GPAC_MEMORY_TRACKING
+ if (enable_mem_tracker && (gf_memory_size() || gf_file_handles_count() )) {
+ gf_memory_print();
+ return 2;
+ }
+#endif
+
return 0;
}
@@ -2132,9 +2313,9 @@ void PrintAVInfo(Bool final)
u32 dec_run_time = v_odi.last_frame_time - v_odi.first_frame_time;
if (!dec_run_time) dec_run_time = 1;
if (v_odi.duration) fprintf(stderr, "%d%% ", (u32) (100*v_odi.current_time / v_odi.duration ) );
- fprintf(stderr, "%d frames FPS %.2f (max "LLU" us/f) rate avg %d max %d", v_odi.nb_dec_frames, ((Float)v_odi.nb_dec_frames*1000) / dec_run_time, v_odi.max_dec_time, (u32) v_odi.avg_bitrate/1000, (u32) v_odi.max_bitrate/1000);
- if (v_odi.nb_droped) {
- fprintf(stderr, " (Error during bench: %d frames drop)", v_odi.nb_droped);
+ fprintf(stderr, "%d frames FPS %.2f (max %d us/f) rate avg %d max %d", v_odi.nb_dec_frames, ((Float)v_odi.nb_dec_frames*1000) / dec_run_time, v_odi.max_dec_time, (u32) v_odi.avg_bitrate/1000, (u32) v_odi.max_bitrate/1000);
+ if (v_odi.nb_dropped) {
+ fprintf(stderr, " (Error during bench: %d frames drop)", v_odi.nb_dropped);
}
fprintf(stderr, "\n");
}
@@ -2146,8 +2327,8 @@ void PrintAVInfo(Bool final)
if (!dec_run_time) dec_run_time = 1;
if (a_odi.duration) fprintf(stderr, "%d%% ", (u32) (100*a_odi.current_time / a_odi.duration ) );
fprintf(stderr, "%d frames (ms/f %.2f avg %.2f max) rate avg %d max %d", a_odi.nb_dec_frames, ((Float)dec_run_time)/a_odi.nb_dec_frames, a_odi.max_dec_time/1000.0, (u32) a_odi.avg_bitrate/1000, (u32) a_odi.max_bitrate/1000);
- if (a_odi.nb_droped) {
- fprintf(stderr, " (Error during bench: %d frames drop)", a_odi.nb_droped);
+ if (a_odi.nb_dropped) {
+ fprintf(stderr, " (Error during bench: %d frames drop)", a_odi.nb_dropped);
}
fprintf(stderr, "\n");
}
@@ -2160,7 +2341,7 @@ void PrintAVInfo(Bool final)
if (s_odi.nb_dec_frames>2 && s_odi.total_dec_time) {
u32 dec_run_time = s_odi.last_frame_time - s_odi.first_frame_time;
if (!dec_run_time) dec_run_time = 1;
- fprintf(stderr, "%d frames FPS %.2f (max "LLD" us/f) rate avg %d max %d", s_odi.nb_dec_frames, ((Float)s_odi.nb_dec_frames*1000) / dec_run_time, s_odi.max_dec_time, (u32) s_odi.avg_bitrate/1000, (u32) s_odi.max_bitrate/1000);
+ fprintf(stderr, "%d frames FPS %.2f (max %d us/f) rate avg %d max %d", s_odi.nb_dec_frames, ((Float)s_odi.nb_dec_frames*1000) / dec_run_time, s_odi.max_dec_time, (u32) s_odi.avg_bitrate/1000, (u32) s_odi.max_bitrate/1000);
fprintf(stderr, "\n");
} else {
u32 nb_frames_drawn;
@@ -2190,7 +2371,7 @@ void PrintAVInfo(Bool final)
avg_dec_time = (Float) 1000000 * s_odi.nb_dec_frames;
avg_dec_time /= s_odi.total_dec_time;
if (s_odi.duration) fprintf(stderr, "%d%% ", (u32) (100*s_odi.current_time / s_odi.duration ) );
- fprintf(stderr, "%d f %.2f ("LLU" us max) - rate %d ", s_odi.nb_dec_frames, avg_dec_time, s_odi.max_dec_time, (u32) s_odi.instant_bitrate/1000);
+ fprintf(stderr, "%d f %.2f (%d us max) - rate %d ", s_odi.nb_dec_frames, avg_dec_time, s_odi.max_dec_time, (u32) s_odi.instant_bitrate/1000);
} else {
u32 nb_frames_drawn;
Double FPS = gf_term_get_simulation_frame_rate(term, &nb_frames_drawn);
@@ -2301,7 +2482,7 @@ void PrintODList(GF_Terminal *term, GF_ObjectManager *root_odm, u32 num, u32 ind
}
}
-void ViewOD(GF_Terminal *term, u32 OD_ID, u32 number)
+void ViewOD(GF_Terminal *term, u32 OD_ID, u32 number, const char *szURL)
{
GF_MediaInfo odi;
u32 i, j, count, d_enum,id;
@@ -2311,8 +2492,7 @@ void ViewOD(GF_Terminal *term, u32 OD_ID, u32 number)
if (!root_odm) return;
odm = NULL;
- if ((!OD_ID && (number == (u32)(-1))) ||
- ((OD_ID == (u32)(-1)) && !number)) {
+ if (!szURL && ((!OD_ID && (number == (u32)-1)) || ((OD_ID == (u32)(-1)) && !number))) {
odm = root_odm;
if ((gf_term_get_object_info(term, odm, &odi) != GF_OK)) odm=NULL;
} else {
@@ -2321,6 +2501,7 @@ void ViewOD(GF_Terminal *term, u32 OD_ID, u32 number)
odm = gf_term_get_object(term, root_odm, i);
if (!odm) break;
if (gf_term_get_object_info(term, odm, &odi) == GF_OK) {
+ if (szURL && strstr(odi.service_url, szURL)) break;
if ((number == (u32)(-1)) && (odi.od->objectDescriptorID == OD_ID)) break;
else if (i == (u32)(number-1)) break;
}
@@ -2328,6 +2509,7 @@ void ViewOD(GF_Terminal *term, u32 OD_ID, u32 number)
}
}
if (!odm) {
+ if (szURL) fprintf(stderr, "cannot find OD for URL %s\n", szURL);
if (number == (u32)-1) fprintf(stderr, "cannot find OD with ID %d\n", OD_ID);
else fprintf(stderr, "cannot find OD with number %d\n", number);
return;
@@ -2360,10 +2542,9 @@ void ViewOD(GF_Terminal *term, u32 OD_ID, u32 number)
}
fprintf(stderr, "\n");
- if (odi.owns_service) {
- fprintf(stderr, "Service Handler: %s\n", odi.service_handler);
- fprintf(stderr, "Service URL: %s\n", odi.service_url);
- }
+ fprintf(stderr, "Service Handler: %s\n", odi.service_handler);
+ fprintf(stderr, "Service URL: %s\n", odi.service_url);
+
if (odi.codec_name) {
Float avg_dec_time;
switch (odi.od_type) {
@@ -2400,7 +2581,7 @@ void ViewOD(GF_Terminal *term, u32 OD_ID, u32 number)
avg_dec_time = (Float) odi.total_dec_time;
avg_dec_time /= odi.nb_dec_frames;
}
- fprintf(stderr, "\tBitrate over last second: %d kbps\n\tMax bitrate over one second: %d kbps\n\tAverage Decoding Time %.2f ms ("LLU" max)\n\tTotal decoded frames %d\n",
+ fprintf(stderr, "\tBitrate over last second: %d kbps\n\tMax bitrate over one second: %d kbps\n\tAverage Decoding Time %.2f us %d max)\n\tTotal decoded frames %d\n",
(u32) odi.avg_bitrate/1024, odi.max_bitrate/1024, avg_dec_time, odi.max_dec_time, odi.nb_dec_frames);
}
if (odi.protection) fprintf(stderr, "Encrypted Media%s\n", (odi.protection==2) ? " NOT UNLOCKED" : "");
@@ -2462,25 +2643,17 @@ void ViewOD(GF_Terminal *term, u32 OD_ID, u32 number)
/*check language*/
if (esd->langDesc) {
- u32 i=0;
- char lan[4], *szLang;
+ s32 lang_idx;
+ char lan[4];
lan[0] = esd->langDesc->langCode>>16;
lan[1] = (esd->langDesc->langCode>>8)&0xFF;
lan[2] = (esd->langDesc->langCode)&0xFF;
lan[3] = 0;
- if ((lan[0]=='u') && (lan[1]=='n') && (lan[2]=='d')) szLang = "Undetermined";
- else {
- szLang = lan;
- while (GF_ISO639_Lang[i]) {
- if (GF_ISO639_Lang[i+2][0] && strstr(GF_ISO639_Lang[i+1], lan)) {
- szLang = (char*) GF_ISO639_Lang[i];
- break;
- }
- i+=3;
- }
+ lang_idx = gf_lang_find(lan);
+ if (lang_idx>=0) {
+ fprintf(stderr, "\tStream Language: %s\n", gf_lang_get_name(lang_idx));
}
- fprintf(stderr, "\tStream Language: %s\n", szLang);
}
}
fprintf(stderr, "\n");
@@ -2588,9 +2761,11 @@ void ViewOD(GF_Terminal *term, u32 OD_ID, u32 number)
}
}
-void PrintODTiming(GF_Terminal *term, GF_ObjectManager *odm)
+void PrintODTiming(GF_Terminal *term, GF_ObjectManager *odm, u32 indent)
{
GF_MediaInfo odi;
+ u32 ind = indent;
+ u32 i, count;
if (!odm) return;
if (gf_term_get_object_info(term, odm, &odi) != GF_OK) return;
@@ -2598,31 +2773,50 @@ void PrintODTiming(GF_Terminal *term, GF_ObjectManager *odm)
fprintf(stderr, "Service not attached\n");
return;
}
+ while (ind) {
+ fprintf(stderr, " ");
+ ind--;
+ }
- fprintf(stderr, "OD %d: ", odi.od->objectDescriptorID);
- switch (odi.status) {
- case 1:
- fprintf(stderr, "Playing - ");
- break;
- case 2:
- fprintf(stderr, "Paused - ");
- break;
- default:
- fprintf(stderr, "Stopped - ");
- break;
+ if (! odi.generated_scene) {
+
+ fprintf(stderr, "- OD %d: ", odi.od->objectDescriptorID);
+ switch (odi.status) {
+ case 1:
+ fprintf(stderr, "Playing - ");
+ break;
+ case 2:
+ fprintf(stderr, "Paused - ");
+ break;
+ default:
+ fprintf(stderr, "Stopped - ");
+ break;
+ }
+ if (odi.buffer>=0) fprintf(stderr, "Buffer: %d ms - ", odi.buffer);
+ else fprintf(stderr, "Not buffering - ");
+ fprintf(stderr, "Clock drift: %d ms", odi.clock_drift);
+ fprintf(stderr, " - time: ");
+ PrintTime((u32) (odi.current_time*1000));
+ fprintf(stderr, "\n");
+
+ } else {
+ fprintf(stderr, "+ Service %s:\n", odi.service_url);
}
- if (odi.buffer>=0) fprintf(stderr, "Buffer: %d ms - ", odi.buffer);
- else fprintf(stderr, "Not buffering - ");
- fprintf(stderr, "Clock drift: %d ms", odi.clock_drift);
- fprintf(stderr, " - time: ");
- PrintTime((u32) (odi.current_time*1000));
- fprintf(stderr, "\n");
+
+ count = gf_term_get_object_count(term, odm);
+ for (i=0; iobjectDescriptorID);
- switch (odi.status) {
- case 1:
- fprintf(stderr, "Playing");
- break;
- case 2:
- fprintf(stderr, "Paused");
- break;
- default:
- fprintf(stderr, "Stopped");
- break;
+ ind = indent;
+ while (ind) {
+ fprintf(stderr, " ");
+ ind--;
}
- if (odi.buffer>=0) fprintf(stderr, " - Buffer: %d ms", odi.buffer);
- if (odi.db_unit_count) fprintf(stderr, " - DB: %d AU", odi.db_unit_count);
- if (odi.cb_max_count) fprintf(stderr, " - CB: %d/%d CUs", odi.cb_unit_count, odi.cb_max_count);
- fprintf(stderr, "\n * %d decoded frames - %d dropped frames\n", odi.nb_dec_frames, odi.nb_droped);
- avg_dec_time = 0;
- if (odi.nb_dec_frames) {
- avg_dec_time = (Float) odi.total_dec_time;
- avg_dec_time /= odi.nb_dec_frames;
+ if (odi.generated_scene) {
+ fprintf(stderr, "+ Service %s:\n", odi.service_url);
+ } else {
+ fprintf(stderr, "- OD %d: ", odi.od->objectDescriptorID);
+ switch (odi.status) {
+ case 1:
+ fprintf(stderr, "Playing");
+ break;
+ case 2:
+ fprintf(stderr, "Paused");
+ break;
+ default:
+ fprintf(stderr, "Stopped");
+ break;
+ }
+ if (odi.buffer>=0) fprintf(stderr, " - Buffer: %d ms", odi.buffer);
+ if (odi.db_unit_count) fprintf(stderr, " - DB: %d AU", odi.db_unit_count);
+ if (odi.cb_max_count) fprintf(stderr, " - CB: %d/%d CUs", odi.cb_unit_count, odi.cb_max_count);
+
+ fprintf(stderr, "\n");
+ ind = indent;
+ while (ind) {
+ fprintf(stderr, " ");
+ ind--;
+ }
+
+ fprintf(stderr, " %d decoded frames - %d dropped frames\n", odi.nb_dec_frames, odi.nb_dropped);
+
+ ind = indent;
+ while (ind) {
+ fprintf(stderr, " ");
+ ind--;
+ }
+
+ avg_dec_time = 0;
+ if (odi.nb_dec_frames) {
+ avg_dec_time = (Float) odi.total_dec_time;
+ avg_dec_time /= odi.nb_dec_frames;
+ }
+ fprintf(stderr, " Avg Bitrate %d kbps (%d max) - Avg Decoding Time %.2f us (%d max)\n",
+ (u32) odi.avg_bitrate/1024, odi.max_bitrate/1024, avg_dec_time, odi.max_dec_time);
+ }
+
+ count = gf_term_get_object_count(term, odm);
+ for (i=0; i
-
-
-
- Debug
- Win32
-
-
- Release
- Win32
-
-
-
-
- GPAC_MINIMAL_ODF;GPAC_DISABLE_AV_PARSERS;GPAC_DISABLE_ISOM_DUMP;GPAC_DISABLE_ZILB;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {978A2D9F-E44F-4073-8032-333563BCC160}
- bmp4demux
-
-
-
- Application
- v110
- false
- MultiByte
-
-
- Application
- v110
- false
- MultiByte
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <_ProjectFileVersion>11.0.60610.1
-
-
- ../../../bin/$(Platform)\$(Configuration)/
- obj\$(Platform)\$(Configuration)\$(ProjectName)\
- true
- AllRules.ruleset
-
-
-
-
- ../../../bin/$(Platform)\$(Configuration)/
- obj\$(Platform)\$(Configuration)\$(ProjectName)\
- false
- AllRules.ruleset
-
-
-
-
-
- .\Debug/bmp4demux.tlb
-
-
-
- Disabled
- ../../../include;%(AdditionalIncludeDirectories)
- GPAC_DISABLE_MEDIA_IMPORT;GPAC_DISABLE_CORE_TOOLS;GPAC_DISABLE_ISOM_HINTING;GPAC_MINIMAL_ODF;GPAC_DISABLE_AV_PARSERS;GPAC_DISABLE_ISOM_DUMP;GPAC_DISABLE_ZILB;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
- true
- EnableFastChecks
- MultiThreadedDebugDLL
-
-
- $(IntDir)
- $(IntDir)
- $(IntDir)
- true
- Level3
- true
- EditAndContinue
-
-
-
-
- _DEBUG;%(PreprocessorDefinitions)
- 0x040c
-
-
- %(AdditionalDependencies)
- $(OutDir)$(TargetName)$(TargetExt)
- true
- $(OutDir);../../../extra_lib/lib/$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)
- true
- $(IntDir)$(ProjectName).pdb
- Console
- MachineX86
-
-
- true
- .\Debug/bmp4demux.bsc
-
-
-
-
- .\Release/bmp4demux.tlb
-
-
-
- MaxSpeed
- OnlyExplicitInline
- ../../../include;%(AdditionalIncludeDirectories)
- GPAC_DISABLE_MEDIA_IMPORT;GPAC_DISABLE_CORE_TOOLS;GPAC_DISABLE_ISOM_HINTING;GPAC_MINIMAL_ODF;GPAC_DISABLE_AV_PARSERS;GPAC_DISABLE_ISOM_DUMP;GPAC_DISABLE_ZILB;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
- true
- MultiThreadedDLL
- true
- .\Release/bmp4demux.pch
- .\Release/
- .\Release/
- .\Release/
- Level3
- true
-
-
- NDEBUG;%(PreprocessorDefinitions)
- 0x040c
-
-
- %(AdditionalDependencies)
- $(OutDir)$(TargetName)$(TargetExt)
- true
- ../../../extra_lib/lib/w32_rel;%(AdditionalLibraryDirectories)
- .\Release/bmp4demux.pdb
- Console
- MachineX86
-
-
- true
- .\Release/bmp4demux.bsc
-
-
-
-
-
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+
+
+ GPAC_MINIMAL_ODF;GPAC_DISABLE_AV_PARSERS;GPAC_DISABLE_ISOM_DUMP;GPAC_DISABLE_ZILB;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {978A2D9F-E44F-4073-8032-333563BCC160}
+ bmp4demux
+
+
+
+ Application
+ v110
+ false
+ MultiByte
+
+
+ Application
+ v100
+ false
+ MultiByte
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <_ProjectFileVersion>11.0.60610.1
+
+
+ ../../../bin/$(Platform)\$(Configuration)/
+ obj\$(Platform)\$(Configuration)\$(ProjectName)\
+ true
+ AllRules.ruleset
+
+
+
+
+ ../../../bin/$(Platform)\$(Configuration)/
+ obj\$(Platform)\$(Configuration)\$(ProjectName)\
+ false
+ AllRules.ruleset
+
+
+
+
+
+ .\Debug/bmp4demux.tlb
+
+
+
+ Disabled
+ ../../../include;%(AdditionalIncludeDirectories)
+ GPAC_DISABLE_MEDIA_IMPORT;GPAC_DISABLE_ISOM_HINTING;GPAC_MINIMAL_ODF;GPAC_DISABLE_AV_PARSERS;GPAC_DISABLE_ISOM_DUMP;GPAC_DISABLE_ZILB;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
+ true
+ EnableFastChecks
+ MultiThreadedDebugDLL
+
+
+ $(IntDir)
+ $(IntDir)
+ $(IntDir)
+ true
+ Level3
+ true
+ EditAndContinue
+
+
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ 0x040c
+
+
+ %(AdditionalDependencies)
+ $(OutDir)$(TargetName)$(TargetExt)
+ true
+ $(OutDir);../../../extra_lib/lib/$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)
+ true
+ $(IntDir)$(ProjectName).pdb
+ Console
+ MachineX86
+
+
+ true
+ .\Debug/bmp4demux.bsc
+
+
+
+
+ .\Release/bmp4demux.tlb
+
+
+
+ MaxSpeed
+ OnlyExplicitInline
+ ../../../include;%(AdditionalIncludeDirectories)
+ GPAC_DISABLE_MEDIA_IMPORT;GPAC_DISABLE_ISOM_HINTING;GPAC_MINIMAL_ODF;GPAC_DISABLE_AV_PARSERS;GPAC_DISABLE_ISOM_DUMP;GPAC_DISABLE_ZILB;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
+ true
+ MultiThreadedDLL
+ true
+ .\Release/bmp4demux.pch
+ .\Release/
+ .\Release/
+ .\Release/
+ Level3
+ true
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ 0x040c
+
+
+ %(AdditionalDependencies)
+ $(OutDir)$(TargetName)$(TargetExt)
+ true
+ ../../../extra_lib/lib/w32_rel;%(AdditionalLibraryDirectories)
+ .\Release/bmp4demux.pdb
+ Console
+ MachineX86
+
+
+ true
+ .\Release/bmp4demux.bsc
+
+
+
+
+
\ No newline at end of file
diff --git a/applications/testapps/bmp4demux/bmp4demux.vcxproj.filters b/applications/testapps/bmp4demux/bmp4demux.vcxproj.filters
index 3f80c02..4a097c1 100644
--- a/applications/testapps/bmp4demux/bmp4demux.vcxproj.filters
+++ b/applications/testapps/bmp4demux/bmp4demux.vcxproj.filters
@@ -1,134 +1,137 @@
-
-
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
- isoff
-
-
-
-
- {c9a8f639-328c-4505-be50-4859357c2c00}
-
-
- {e5ca7285-ca00-49d8-ac81-dff3d494be9a}
-
-
+
+
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ isoff
+
+
+ others
+
+
+
+
+ {c9a8f639-328c-4505-be50-4859357c2c00}
+
+
+ {e5ca7285-ca00-49d8-ac81-dff3d494be9a}
+
+
\ No newline at end of file
diff --git a/applications/testapps/bmp4demux/build.sh b/applications/testapps/bmp4demux/build.sh
index 36dab12..d1dd330 100644
--- a/applications/testapps/bmp4demux/build.sh
+++ b/applications/testapps/bmp4demux/build.sh
@@ -1,2 +1,2 @@
#!/bin/sh
-gcc -o fmp4demux main.c ../../../src/utils/os_config_init.c ../../../src/utils/os_divers.c ../../../src/utils/os_thread.c ../../../src/utils/alloc.c ../../../src/utils/bitstream.c ../../../src/utils/configfile.c ../../../src/odf/desc_private.c ../../../src/odf/descriptors.c ../../../src/utils/error.c ../../../src/utils/list.c ../../../src/odf/odf_code.c ../../../src/odf/odf_codec.c ../../../src/odf/odf_command.c ../../../src/odf/odf_parse.c ../../../src/odf/slc.c ../../../src/utils/url.c ../../../src/media_tools/webvtt.c ../../../src/isomedia/avc_ext.c ../../../src/isomedia/box_code_3gpp.c ../../../src/isomedia/box_code_adobe.c ../../../src/isomedia/box_code_apple.c ../../../src/isomedia/box_code_base.c ../../../src/isomedia/box_code_drm.c ../../../src/isomedia/box_code_meta.c ../../../src/isomedia/box_funcs.c ../../../src/isomedia/data_map.c ../../../src/isomedia/drm_sample.c ../../../src/isomedia/isom_intern.c ../../../src/isomedia/isom_read.c ../../../src/isomedia/isom_store.c ../../../src/isomedia/isom_write.c ../../../src/isomedia/media.c ../../../src/isomedia/media_odf.c ../../../src/isomedia/meta.c ../../../src/isomedia/movie_fragments.c ../../../src/isomedia/sample_descs.c ../../../src/isomedia/stbl_read.c ../../../src/isomedia/stbl_write.c ../../../src/isomedia/track.c ../../../src/isomedia/tx3g.c -L../../../bin/gcc -lpthread -ldl -I../../../include -DGPAC_MINIMAL_ODF -DGPAC_DISABLE_AV_PARSERS -DGPAC_DISABLE_ISOM_DUMP -DGPAC_DISABLE_ZLIB
+gcc -o fmp4demux main.c ../../../src/utils/os_config_init.c ../../../src/utils/os_divers.c ../../../src/utils/os_file.c ../../../src/utils/os_thread.c ../../../src/utils/alloc.c ../../../src/utils/bitstream.c ../../../src/utils/configfile.c ../../../src/odf/desc_private.c ../../../src/odf/descriptors.c ../../../src/utils/error.c ../../../src/utils/list.c ../../../src/odf/odf_code.c ../../../src/odf/odf_codec.c ../../../src/odf/odf_command.c ../../../src/odf/odf_parse.c ../../../src/odf/slc.c ../../../src/utils/url.c ../../../src/media_tools/webvtt.c ../../../src/isomedia/avc_ext.c ../../../src/isomedia/box_code_3gpp.c ../../../src/isomedia/box_code_adobe.c ../../../src/isomedia/box_code_apple.c ../../../src/isomedia/box_code_base.c ../../../src/isomedia/box_code_drm.c ../../../src/isomedia/box_code_meta.c ../../../src/isomedia/box_funcs.c ../../../src/isomedia/data_map.c ../../../src/isomedia/drm_sample.c ../../../src/isomedia/isom_intern.c ../../../src/isomedia/isom_read.c ../../../src/isomedia/isom_store.c ../../../src/isomedia/isom_write.c ../../../src/isomedia/media.c ../../../src/isomedia/media_odf.c ../../../src/isomedia/meta.c ../../../src/isomedia/movie_fragments.c ../../../src/isomedia/sample_descs.c ../../../src/isomedia/stbl_read.c ../../../src/isomedia/stbl_write.c ../../../src/isomedia/track.c ../../../src/isomedia/tx3g.c -L../../../bin/gcc -lpthread -ldl -I../../../include -DGPAC_MINIMAL_ODF -DGPAC_DISABLE_AV_PARSERS -DGPAC_DISABLE_ISOM_DUMP -DGPAC_DISABLE_ZLIB
diff --git a/applications/testapps/broadcaster/broadcaster.c b/applications/testapps/broadcaster/broadcaster.c
index 58485dc..85398a4 100644
--- a/applications/testapps/broadcaster/broadcaster.c
+++ b/applications/testapps/broadcaster/broadcaster.c
@@ -208,13 +208,13 @@ u32 tcp_server(void *par)
if((*(input->config_flag)) == 0)
{
u32 num_retry;
- fp = fopen("temp.cfg", "w+");
+ fp = gf_fopen("temp.cfg", "w+");
if (!fp) {
fprintf(stderr, "Error opening temp file for the configuration\n");
exit(1);
}
ret = gf_fwrite(buffer, 1, byte_read, fp);
- fclose(fp);
+ gf_fclose(fp);
/* parsing config info */
gf_config_file = gf_cfg_new(".", "temp.cfg");
@@ -228,7 +228,7 @@ u32 tcp_server(void *par)
gf_sk_send(conn_socket, "OK\n", 3);
memset(temp, 0, sizeof(temp));
- fp = fopen(input->config->scene_init_file, "w+");
+ fp = gf_fopen(input->config->scene_init_file, "w+");
if (!fp) {
fprintf(stderr, "Error opening temp file for reception of the initial scene\n");
exit(1);
@@ -251,7 +251,7 @@ u32 tcp_server(void *par)
break;
}
}
- fclose(fp);
+ gf_fclose(fp);
*(input->config_flag) = 1;
}
/* we only wait now for the config updates */
diff --git a/applications/testapps/broadcaster/broadcaster.dsp b/applications/testapps/broadcaster/broadcaster.dsp
index 2edf9c5..b4303ba 100644
--- a/applications/testapps/broadcaster/broadcaster.dsp
+++ b/applications/testapps/broadcaster/broadcaster.dsp
@@ -1,146 +1,146 @@
-# Microsoft Developer Studio Project File - Name="broadcaster" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=broadcaster - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "broadcaster.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "broadcaster.mak" CFG="broadcaster - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "broadcaster - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "broadcaster - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "broadcaster - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x40c /d "NDEBUG"
-# ADD RSC /l 0x40c /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-
-!ELSEIF "$(CFG)" == "broadcaster - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
-# ADD BASE RSC /l 0x40c /d "_DEBUG"
-# ADD RSC /l 0x40c /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 zlib.lib winmm.lib ws2_32.lib user32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../../../bin/w32_deb/broadcaster.exe" /pdbtype:sept /libpath:"../../../extra_lib/lib/w32_deb"
-
-!ENDIF
-
-# Begin Target
-
-# Name "broadcaster - Win32 Release"
-# Name "broadcaster - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\broadcaster.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\debug.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\RTP_serv_generator.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\RTP_serv_packetizer.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\RTP_serv_sender.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\sdp_generator.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\broadcaster.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\debug.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\RTP_serv_generator.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\RTP_serv_packetizer.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\RTP_serv_sender.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\sdp_generator.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="broadcaster" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=broadcaster - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "broadcaster.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "broadcaster.mak" CFG="broadcaster - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "broadcaster - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "broadcaster - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "broadcaster - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "broadcaster - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
+# ADD BASE RSC /l 0x40c /d "_DEBUG"
+# ADD RSC /l 0x40c /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 zlib.lib winmm.lib ws2_32.lib user32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../../../bin/w32_deb/broadcaster.exe" /pdbtype:sept /libpath:"../../../extra_lib/lib/w32_deb"
+
+!ENDIF
+
+# Begin Target
+
+# Name "broadcaster - Win32 Release"
+# Name "broadcaster - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\broadcaster.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\debug.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\RTP_serv_generator.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\RTP_serv_packetizer.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\RTP_serv_sender.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\sdp_generator.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\broadcaster.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\debug.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\RTP_serv_generator.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\RTP_serv_packetizer.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\RTP_serv_sender.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\sdp_generator.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/applications/testapps/broadcaster/sdp_generator.c b/applications/testapps/broadcaster/sdp_generator.c
index 63b00df..2547037 100644
--- a/applications/testapps/broadcaster/sdp_generator.c
+++ b/applications/testapps/broadcaster/sdp_generator.c
@@ -16,7 +16,7 @@ int sdp_generator(PNC_CallbackData *data, char *ip_dest, char *sdp_fmt)
gf_sk_get_local_info(data->chan->rtp, &port, &socket_type);
- fp = fopen("broadcaster.sdp", "w+");
+ fp = gf_fopen("broadcaster.sdp", "w+");
if(fp == NULL) {
fprintf(stderr, "Cannot open SDP file broadcaster.sdp\n");
exit(1);
@@ -61,7 +61,7 @@ int sdp_generator(PNC_CallbackData *data, char *ip_dest, char *sdp_fmt)
sprintf(temp, "%s\n", sdp_fmt);
ret = gf_fwrite(temp, 1, strlen(temp), fp);
fflush(fp);
- fclose(fp);
+ gf_fclose(fp);
dprintf(DEBUG_sdp_generator, "SDP file generated in broadcaster.sdp\n");
return GF_OK;
}
diff --git a/applications/testapps/dmbrs/dmbrs.dsp b/applications/testapps/dmbrs/dmbrs.dsp
index a94c742..8ae463f 100644
--- a/applications/testapps/dmbrs/dmbrs.dsp
+++ b/applications/testapps/dmbrs/dmbrs.dsp
@@ -1,90 +1,90 @@
-# Microsoft Developer Studio Project File - Name="dmbrs" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=dmbrs - Win32 Release
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "dmbrs.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "dmbrs.mak" CFG="dmbrs - Win32 Release"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "dmbrs - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "dmbrs - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "dmbrs - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x40c /d "NDEBUG"
-# ADD RSC /l 0x40c /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 zlib.lib winmm.lib /nologo /subsystem:console /machine:I386 /out:"../../../bin/w32_rel/dmbrs.exe" /libpath:"../../../extra_lib/lib/w32_rel"
-
-!ELSEIF "$(CFG)" == "dmbrs - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x40c /d "_DEBUG"
-# ADD RSC /l 0x40c /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 zlib.lib winmm.lib /nologo /subsystem:console /debug /machine:I386 /out:"../../../bin/w32_deb/dmbrs.exe" /pdbtype:sept /libpath:"../../../extra_lib/lib/w32_deb"
-
-!ENDIF
-
-# Begin Target
-
-# Name "dmbrs - Win32 Release"
-# Name "dmbrs - Win32 Debug"
-# Begin Source File
-
-SOURCE=.\main.c
-# End Source File
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="dmbrs" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=dmbrs - Win32 Release
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "dmbrs.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "dmbrs.mak" CFG="dmbrs - Win32 Release"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "dmbrs - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "dmbrs - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "dmbrs - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 zlib.lib winmm.lib /nologo /subsystem:console /machine:I386 /out:"../../../bin/w32_rel/dmbrs.exe" /libpath:"../../../extra_lib/lib/w32_rel"
+
+!ELSEIF "$(CFG)" == "dmbrs - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x40c /d "_DEBUG"
+# ADD RSC /l 0x40c /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 zlib.lib winmm.lib /nologo /subsystem:console /debug /machine:I386 /out:"../../../bin/w32_deb/dmbrs.exe" /pdbtype:sept /libpath:"../../../extra_lib/lib/w32_deb"
+
+!ENDIF
+
+# Begin Target
+
+# Name "dmbrs - Win32 Release"
+# Name "dmbrs - Win32 Debug"
+# Begin Source File
+
+SOURCE=.\main.c
+# End Source File
+# End Target
+# End Project
diff --git a/applications/testapps/dmbrs/main.c b/applications/testapps/dmbrs/main.c
index 6cecfef..a9b64a7 100644
--- a/applications/testapps/dmbrs/main.c
+++ b/applications/testapps/dmbrs/main.c
@@ -26,15 +26,15 @@
void save_ts(char *filename, unsigned char *data)
{
- FILE *ts_out = fopen(filename,"a+b");
+ FILE *ts_out = gf_fopen(filename,"a+b");
gf_fwrite(data, 1, 188, ts_out);
- fclose(ts_out);
+ gf_fclose(ts_out);
}
void save_rs_0(char *filename, unsigned char *data)
{
- FILE *rs_out = fopen(filename,"a+b");
+ FILE *rs_out = gf_fopen(filename,"a+b");
gf_fwrite(data, 1, 204, rs_out);
- fclose(rs_out);
+ gf_fclose(rs_out);
}
void RS_Interleaver(GF_BitStream *bs, char *out_name)
@@ -209,7 +209,7 @@ void main(int argc, char **argv)
/* generation d'un TS aléatoire */
/*
- if ((in=fopen(argv[1], "wb")) == NULL) {
+ if ((in=gf_fopen(argv[1], "wb")) == NULL) {
printf( "Impossible d'ouvrir %s en lecture.\n", argv[1]);
}
{
@@ -223,8 +223,8 @@ void main(int argc, char **argv)
gf_fwrite(buffer, 1, 188, in);
}
}
- fclose(in);
- if ((in=fopen(argv[1], "rb")) == NULL) {
+ gf_fclose(in);
+ if ((in=gf_fopen(argv[1], "rb")) == NULL) {
printf( "Impossible d'ouvrir %s en lecture.\n", argv[1]);
}
@@ -232,12 +232,12 @@ void main(int argc, char **argv)
if (bs == NULL) return;
RS_Interleaver(bs, argv[2]);
- fclose(in);
+ gf_fclose(in);
gf_bs_del(bs);
*/
- if ((in=fopen(argv[1], "rb")) == NULL) {
+ if ((in=gf_fopen(argv[1], "rb")) == NULL) {
printf( "Impossible d'ouvrir %s en lecture.\n", argv[1]);
}
@@ -245,7 +245,7 @@ void main(int argc, char **argv)
if (bs == NULL) return;
RS_Deinterleaver(bs, argv[2]);
- fclose(in);
+ gf_fclose(in);
gf_bs_del(bs);
}
\ No newline at end of file
diff --git a/applications/testapps/fmp4demux/build.sh b/applications/testapps/fmp4demux/build.sh
index 36dab12..d1dd330 100755
--- a/applications/testapps/fmp4demux/build.sh
+++ b/applications/testapps/fmp4demux/build.sh
@@ -1,2 +1,2 @@
#!/bin/sh
-gcc -o fmp4demux main.c ../../../src/utils/os_config_init.c ../../../src/utils/os_divers.c ../../../src/utils/os_thread.c ../../../src/utils/alloc.c ../../../src/utils/bitstream.c ../../../src/utils/configfile.c ../../../src/odf/desc_private.c ../../../src/odf/descriptors.c ../../../src/utils/error.c ../../../src/utils/list.c ../../../src/odf/odf_code.c ../../../src/odf/odf_codec.c ../../../src/odf/odf_command.c ../../../src/odf/odf_parse.c ../../../src/odf/slc.c ../../../src/utils/url.c ../../../src/media_tools/webvtt.c ../../../src/isomedia/avc_ext.c ../../../src/isomedia/box_code_3gpp.c ../../../src/isomedia/box_code_adobe.c ../../../src/isomedia/box_code_apple.c ../../../src/isomedia/box_code_base.c ../../../src/isomedia/box_code_drm.c ../../../src/isomedia/box_code_meta.c ../../../src/isomedia/box_funcs.c ../../../src/isomedia/data_map.c ../../../src/isomedia/drm_sample.c ../../../src/isomedia/isom_intern.c ../../../src/isomedia/isom_read.c ../../../src/isomedia/isom_store.c ../../../src/isomedia/isom_write.c ../../../src/isomedia/media.c ../../../src/isomedia/media_odf.c ../../../src/isomedia/meta.c ../../../src/isomedia/movie_fragments.c ../../../src/isomedia/sample_descs.c ../../../src/isomedia/stbl_read.c ../../../src/isomedia/stbl_write.c ../../../src/isomedia/track.c ../../../src/isomedia/tx3g.c -L../../../bin/gcc -lpthread -ldl -I../../../include -DGPAC_MINIMAL_ODF -DGPAC_DISABLE_AV_PARSERS -DGPAC_DISABLE_ISOM_DUMP -DGPAC_DISABLE_ZLIB
+gcc -o fmp4demux main.c ../../../src/utils/os_config_init.c ../../../src/utils/os_divers.c ../../../src/utils/os_file.c ../../../src/utils/os_thread.c ../../../src/utils/alloc.c ../../../src/utils/bitstream.c ../../../src/utils/configfile.c ../../../src/odf/desc_private.c ../../../src/odf/descriptors.c ../../../src/utils/error.c ../../../src/utils/list.c ../../../src/odf/odf_code.c ../../../src/odf/odf_codec.c ../../../src/odf/odf_command.c ../../../src/odf/odf_parse.c ../../../src/odf/slc.c ../../../src/utils/url.c ../../../src/media_tools/webvtt.c ../../../src/isomedia/avc_ext.c ../../../src/isomedia/box_code_3gpp.c ../../../src/isomedia/box_code_adobe.c ../../../src/isomedia/box_code_apple.c ../../../src/isomedia/box_code_base.c ../../../src/isomedia/box_code_drm.c ../../../src/isomedia/box_code_meta.c ../../../src/isomedia/box_funcs.c ../../../src/isomedia/data_map.c ../../../src/isomedia/drm_sample.c ../../../src/isomedia/isom_intern.c ../../../src/isomedia/isom_read.c ../../../src/isomedia/isom_store.c ../../../src/isomedia/isom_write.c ../../../src/isomedia/media.c ../../../src/isomedia/media_odf.c ../../../src/isomedia/meta.c ../../../src/isomedia/movie_fragments.c ../../../src/isomedia/sample_descs.c ../../../src/isomedia/stbl_read.c ../../../src/isomedia/stbl_write.c ../../../src/isomedia/track.c ../../../src/isomedia/tx3g.c -L../../../bin/gcc -lpthread -ldl -I../../../include -DGPAC_MINIMAL_ODF -DGPAC_DISABLE_AV_PARSERS -DGPAC_DISABLE_ISOM_DUMP -DGPAC_DISABLE_ZLIB
diff --git a/applications/testapps/fmp4demux/fmp4demux.sln b/applications/testapps/fmp4demux/fmp4demux.sln
index 26bfd3d..d239628 100644
--- a/applications/testapps/fmp4demux/fmp4demux.sln
+++ b/applications/testapps/fmp4demux/fmp4demux.sln
@@ -1,20 +1,20 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fmp4demux", "fmp4demux.vcxproj", "{978A2D9F-E44F-4073-8032-333563BCC160}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {978A2D9F-E44F-4073-8032-333563BCC160}.Debug|Win32.ActiveCfg = Debug|Win32
- {978A2D9F-E44F-4073-8032-333563BCC160}.Debug|Win32.Build.0 = Debug|Win32
- {978A2D9F-E44F-4073-8032-333563BCC160}.Release|Win32.ActiveCfg = Release|Win32
- {978A2D9F-E44F-4073-8032-333563BCC160}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fmp4demux", "fmp4demux.vcxproj", "{978A2D9F-E44F-4073-8032-333563BCC160}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {978A2D9F-E44F-4073-8032-333563BCC160}.Debug|Win32.ActiveCfg = Debug|Win32
+ {978A2D9F-E44F-4073-8032-333563BCC160}.Debug|Win32.Build.0 = Debug|Win32
+ {978A2D9F-E44F-4073-8032-333563BCC160}.Release|Win32.ActiveCfg = Release|Win32
+ {978A2D9F-E44F-4073-8032-333563BCC160}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/applications/testapps/fmp4demux/fmp4demux.vcxproj b/applications/testapps/fmp4demux/fmp4demux.vcxproj
index 371d252..d007fd2 100644
--- a/applications/testapps/fmp4demux/fmp4demux.vcxproj
+++ b/applications/testapps/fmp4demux/fmp4demux.vcxproj
@@ -1,189 +1,190 @@
-
-
-
-
- Debug
- Win32
-
-
- Release
- Win32
-
-
-
-
- GPAC_MINIMAL_ODF;GPAC_DISABLE_AV_PARSERS;GPAC_DISABLE_ISOM_DUMP;GPAC_DISABLE_ZILB;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {978A2D9F-E44F-4073-8032-333563BCC160}
- fmp4demux
-
-
-
- Application
- v110
- false
- MultiByte
-
-
- Application
- v110
- false
- MultiByte
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <_ProjectFileVersion>11.0.60610.1
-
-
- ../../../bin/$(Platform)\$(Configuration)/
- obj\$(Platform)\$(Configuration)\$(ProjectName)\
- true
- AllRules.ruleset
-
-
-
-
- ../../../bin/$(Platform)\$(Configuration)/
- obj\$(Platform)\$(Configuration)\$(ProjectName)\
- false
- AllRules.ruleset
-
-
-
-
-
- .\Debug/fmp4demux.tlb
-
-
-
- Disabled
- ../../../include;%(AdditionalIncludeDirectories)
- GPAC_DISABLE_MEDIA_IMPORT;GPAC_DISABLE_ISOM_HINTING;GPAC_MINIMAL_ODF;GPAC_DISABLE_AV_PARSERS;GPAC_DISABLE_ISOM_DUMP;GPAC_DISABLE_ZLIB;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
- true
- EnableFastChecks
- MultiThreadedDebugDLL
-
-
- $(IntDir)
- $(IntDir)
- $(IntDir)
- true
- Level3
- true
- EditAndContinue
-
-
- _DEBUG;%(PreprocessorDefinitions)
- 0x040c
-
-
- %(AdditionalDependencies)
- $(OutDir)$(TargetName)$(TargetExt)
- true
- $(OutDir);../../../extra_lib/lib/$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)
- true
- $(IntDir)$(ProjectName).pdb
- Console
- MachineX86
-
-
- true
- .\Debug/fmp4demux.bsc
-
-
-
-
- .\Release/fmp4demux.tlb
-
-
-
- MaxSpeed
- OnlyExplicitInline
- ../../../include;%(AdditionalIncludeDirectories)
- GPAC_DISABLE_MEDIA_IMPORT;GPAC_DISABLE_ISOM_HINTING;GPAC_MINIMAL_ODF;GPAC_DISABLE_AV_PARSERS;GPAC_DISABLE_ISOM_DUMP;GPAC_DISABLE_ZLIB;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
- true
- MultiThreadedDLL
- true
- .\Release/fmp4demux.pch
- .\Release/
- .\Release/
- .\Release/
- Level3
- true
-
-
- NDEBUG;%(PreprocessorDefinitions)
- 0x040c
-
-
- %(AdditionalDependencies)
- $(OutDir)$(TargetName)$(TargetExt)
- true
- ../../../extra_lib/lib/w32_rel;%(AdditionalLibraryDirectories)
- .\Release/fmp4demux.pdb
- Console
- MachineX86
-
-
- true
- .\Release/fmp4demux.bsc
-
-
-
-
-
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+
+
+ GPAC_MINIMAL_ODF;GPAC_DISABLE_AV_PARSERS;GPAC_DISABLE_ISOM_DUMP;GPAC_DISABLE_ZILB;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {BEBEB264-EEA8-4FCF-9467-2E7988DD923B}
+ fmp4demux
+
+
+
+ Application
+ v110
+ false
+ MultiByte
+
+
+ Application
+ v100
+ false
+ MultiByte
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <_ProjectFileVersion>11.0.60610.1
+
+
+ ../../../bin/$(Platform)\$(Configuration)/
+ obj\$(Platform)\$(Configuration)\$(ProjectName)\
+ true
+ AllRules.ruleset
+
+
+
+
+ ../../../bin/$(Platform)\$(Configuration)/
+ obj\$(Platform)\$(Configuration)\$(ProjectName)\
+ false
+ AllRules.ruleset
+
+
+
+
+
+ .\Debug/fmp4demux.tlb
+
+
+
+ Disabled
+ ../../../include;%(AdditionalIncludeDirectories)
+ GPAC_DISABLE_MEDIA_IMPORT;GPAC_DISABLE_ISOM_HINTING;GPAC_MINIMAL_ODF;GPAC_DISABLE_AV_PARSERS;GPAC_DISABLE_ISOM_DUMP;GPAC_DISABLE_ZLIB;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
+ true
+ EnableFastChecks
+ MultiThreadedDebugDLL
+
+
+ $(IntDir)
+ $(IntDir)
+ $(IntDir)
+ true
+ Level3
+ true
+ EditAndContinue
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ 0x040c
+
+
+ %(AdditionalDependencies)
+ $(OutDir)$(TargetName)$(TargetExt)
+ true
+ $(OutDir);../../../extra_lib/lib/$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)
+ true
+ $(IntDir)$(ProjectName).pdb
+ Console
+ MachineX86
+
+
+ true
+ .\Debug/fmp4demux.bsc
+
+
+
+
+ .\Release/fmp4demux.tlb
+
+
+
+ MaxSpeed
+ OnlyExplicitInline
+ ../../../include;%(AdditionalIncludeDirectories)
+ GPAC_DISABLE_MEDIA_IMPORT;GPAC_DISABLE_ISOM_HINTING;GPAC_MINIMAL_ODF;GPAC_DISABLE_AV_PARSERS;GPAC_DISABLE_ISOM_DUMP;GPAC_DISABLE_ZLIB;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
+ true
+ MultiThreadedDLL
+ true
+ .\Release/fmp4demux.pch
+ .\Release/
+ .\Release/
+ .\Release/
+ Level3
+ true
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ 0x040c
+
+
+ %(AdditionalDependencies)
+ $(OutDir)$(TargetName)$(TargetExt)
+ true
+ ../../../extra_lib/lib/w32_rel;%(AdditionalLibraryDirectories)
+ .\Release/fmp4demux.pdb
+ Console
+ MachineX86
+
+
+ true
+ .\Release/fmp4demux.bsc
+
+
+
+
+
\ No newline at end of file
diff --git a/applications/testapps/fmp4demux/fmp4demux.vcxproj.filters b/applications/testapps/fmp4demux/fmp4demux.vcxproj.filters
index b819529..5ea66a7 100644
--- a/applications/testapps/fmp4demux/fmp4demux.vcxproj.filters
+++ b/applications/testapps/fmp4demux/fmp4demux.vcxproj.filters
@@ -1,137 +1,140 @@
-
-
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
- isoff
-
-
-
-
- {c9a8f639-328c-4505-be50-4859357c2c00}
-
-
- {e5ca7285-ca00-49d8-ac81-dff3d494be9a}
-
-
+
+
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ isoff
+
+
+ others
+
+
+
+
+ {c9a8f639-328c-4505-be50-4859357c2c00}
+
+
+ {e5ca7285-ca00-49d8-ac81-dff3d494be9a}
+
+
\ No newline at end of file
diff --git a/applications/testapps/fmp4demux/main.c b/applications/testapps/fmp4demux/main.c
index 482684a..8c6c22a 100644
--- a/applications/testapps/fmp4demux/main.c
+++ b/applications/testapps/fmp4demux/main.c
@@ -208,16 +208,16 @@ int main(int argc, char **argv)
#endif
/* This is an input file to read data from. Could be replaced by any other method to retrieve the data (e.g. JavaScript, socket, ...)*/
- input = gf_f64_open(argv[1], "rb");
+ input = gf_fopen(argv[1], "rb");
if (!input) {
fprintf(stdout, "Could not open file %s for reading.\n", argv[1]);
gf_sys_close();
return 1;
}
- gf_f64_seek(input, 0, SEEK_END);
- file_size = gf_f64_tell(input);
- gf_f64_seek(input, 0, SEEK_SET);
+ gf_fseek(input, 0, SEEK_END);
+ file_size = gf_ftell(input);
+ gf_fseek(input, 0, SEEK_SET);
/* Initializing the progressive reader */
memset(&reader, 0, sizeof(ISOProgressiveReader));
@@ -308,7 +308,7 @@ exit:
gf_mx_del(reader.mutex);
gf_free(reader.data);
gf_isom_close(reader.movie);
- fclose(input);
+ gf_fclose(input);
gf_sys_close();
return ret;
diff --git a/applications/testapps/hevcbench/defbench.h b/applications/testapps/hevcbench/defbench.h
index cc54aab..2b233d6 100644
--- a/applications/testapps/hevcbench/defbench.h
+++ b/applications/testapps/hevcbench/defbench.h
@@ -1,111 +1,111 @@
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2012
- * All rights reserved
- *
- * This file is part of GPAC - sample DASH library usage
- *
- */
-
-#ifndef __DEF_BENCH_H__
-#define __DEF_BENCH_H__
-
-#include
-#include
-#include
-#define SDL_MAIN_HANDLED
-#include
-#include
-
-#define GL_GLEXT_PROTOTYPES
-
-#include
-#include
-
-
-
-
-#define GL_CHECK_ERR {s32 res = glGetError(); if (res) GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("GL Error %d file %s line %d\n", res, __FILE__, __LINE__)); }
-
-/*macros for GL proto and fun declaration*/
-#ifdef _WIN32_WCE
-#define GLAPICAST *
-#elif defined(WIN32)
-#include
-#define GLAPICAST APIENTRY *
-#else
-#define GLAPICAST *
-#endif
-
-#define GLDECL(ret, funname, args) \
-typedef ret (GLAPICAST proc_ ## funname)args; \
-extern proc_ ## funname funname; \
-
-#define GLDECL_STATIC(funname) proc_ ## funname funname = NULL
-
-#if defined GPAC_USE_TINYGL
-//no extensions with TinyGL
-#elif defined (GPAC_USE_OGL_ES)
-//no extensions with OpenGL ES
-#elif defined(WIN32) || defined (GPAC_CONFIG_WIN32)
-#define LOAD_GL_FUNCS
-#define GET_GLFUN(funname) funname = (proc_ ## funname) wglGetProcAddress(#funname)
-#elif defined(CONFIG_DARWIN_GL)
-extern void (*glutGetProcAddress(const GLubyte *procname))( void );
-#define GET_GLFUN(funname) funname = (proc_ ## funname) glutGetProcAddress(#funname)
-#else
-#define LOAD_GL_FUNCS
-extern void (*glXGetProcAddress(const GLubyte *procname))( void );
-#define GET_GLFUN(funname) funname = (proc_ ## funname) glXGetProcAddress(#funname)
-#endif
-
-
-
-#define DEL_SHADER(_a) if (_a) { glDeleteShader(_a); _a = 0; }
-#define DEL_PROGRAM(_a) if (_a) { glDeleteProgram(_a); _a = 0; }
-
-
-GLDECL(GLuint, glCreateProgram, (void) )
-GLDECL(void, glDeleteProgram, (GLuint ) )
-GLDECL(void, glLinkProgram, (GLuint program) )
-GLDECL(void, glUseProgram, (GLuint program) )
-GLDECL(GLuint, glCreateShader, (GLenum shaderType) )
-GLDECL(void, glDeleteShader, (GLuint shader) )
-GLDECL(void, glShaderSource, (GLuint shader, GLsizei count, const char **string, const GLint *length) )
-GLDECL(void, glCompileShader, (GLuint shader) )
-GLDECL(void, glAttachShader, (GLuint program, GLuint shader) )
-GLDECL(void, glDetachShader, (GLuint program, GLuint shader) )
-GLDECL(void, glGetShaderiv, (GLuint shader, GLenum type, GLint *res) )
-GLDECL(void, glGetInfoLogARB, (GLuint shader, GLint size, GLsizei *rsize, const char *logs) )
-GLDECL(GLint, glGetUniformLocation, (GLuint prog, const char *name) )
-GLDECL(void, glUniform1f, (GLint location, GLfloat v0) )
-GLDECL(void, glUniform1i, (GLint location, GLint v0) )
-GLDECL(void, glActiveTexture, (GLenum texture) )
-GLDECL(void, glClientActiveTexture, (GLenum texture) )
-GLDECL(void, glGenBuffers, (GLsizei , GLuint *) )
-GLDECL(void, glDeleteBuffers, (GLsizei , GLuint *) )
-GLDECL(void, glBindBuffer, (GLenum, GLuint ) )
-GLDECL(void, glBufferData, (GLenum, int, void *, GLenum) )
-GLDECL(void, glBufferSubData, (GLenum, int, int, void *) )
-GLDECL(void *, glMapBuffer, (GLenum, GLenum) )
-GLDECL(void *, glUnmapBuffer, (GLenum) )
-
-
-#define GL_TEXTURE_RECTANGLE_EXT 0x84F5
-
-#define GL_INFO_LOG_LENGTH 0x8B84
-#define GL_FRAGMENT_SHADER 0x8B30
-#define GL_VERTEX_SHADER 0x8B31
-#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC
-#define GL_STREAM_DRAW_ARB 0x88E0
-#define GL_WRITE_ONLY_ARB 0x88B9
-#define GL_DYNAMIC_DRAW_ARB 0x88E8
-
-#define GL_TEXTURE0 0x84C0
-#define GL_TEXTURE1 0x84C1
-#define GL_TEXTURE2 0x84C2
-
-
-#endif
+/*
+ * GPAC - Multimedia Framework C SDK
+ *
+ * Authors: Jean Le Feuvre
+ * Copyright (c) Telecom ParisTech 2012
+ * All rights reserved
+ *
+ * This file is part of GPAC - sample DASH library usage
+ *
+ */
+
+#ifndef __DEF_BENCH_H__
+#define __DEF_BENCH_H__
+
+#include
+#include
+#include
+#define SDL_MAIN_HANDLED
+#include
+#include
+
+#define GL_GLEXT_PROTOTYPES
+
+#include
+#include
+
+
+
+
+#define GL_CHECK_ERR {s32 res = glGetError(); if (res) GF_LOG(GF_LOG_ERROR, GF_LOG_MMIO, ("GL Error %d file %s line %d\n", res, __FILE__, __LINE__)); }
+
+/*macros for GL proto and fun declaration*/
+#ifdef _WIN32_WCE
+#define GLAPICAST *
+#elif defined(WIN32)
+#include
+#define GLAPICAST APIENTRY *
+#else
+#define GLAPICAST *
+#endif
+
+#define GLDECL(ret, funname, args) \
+typedef ret (GLAPICAST proc_ ## funname)args; \
+extern proc_ ## funname funname; \
+
+#define GLDECL_STATIC(funname) proc_ ## funname funname = NULL
+
+#if defined GPAC_USE_TINYGL
+//no extensions with TinyGL
+#elif defined (GPAC_USE_GLES1X)
+//no extensions with OpenGL ES
+#elif defined(WIN32) || defined (GPAC_CONFIG_WIN32)
+#define LOAD_GL_FUNCS
+#define GET_GLFUN(funname) funname = (proc_ ## funname) wglGetProcAddress(#funname)
+#elif defined(CONFIG_DARWIN_GL)
+extern void (*glutGetProcAddress(const GLubyte *procname))( void );
+#define GET_GLFUN(funname) funname = (proc_ ## funname) glutGetProcAddress(#funname)
+#else
+#define LOAD_GL_FUNCS
+extern void (*glXGetProcAddress(const GLubyte *procname))( void );
+#define GET_GLFUN(funname) funname = (proc_ ## funname) glXGetProcAddress(#funname)
+#endif
+
+
+
+#define DEL_SHADER(_a) if (_a) { glDeleteShader(_a); _a = 0; }
+#define DEL_PROGRAM(_a) if (_a) { glDeleteProgram(_a); _a = 0; }
+
+
+GLDECL(GLuint, glCreateProgram, (void) )
+GLDECL(void, glDeleteProgram, (GLuint ) )
+GLDECL(void, glLinkProgram, (GLuint program) )
+GLDECL(void, glUseProgram, (GLuint program) )
+GLDECL(GLuint, glCreateShader, (GLenum shaderType) )
+GLDECL(void, glDeleteShader, (GLuint shader) )
+GLDECL(void, glShaderSource, (GLuint shader, GLsizei count, const char **string, const GLint *length) )
+GLDECL(void, glCompileShader, (GLuint shader) )
+GLDECL(void, glAttachShader, (GLuint program, GLuint shader) )
+GLDECL(void, glDetachShader, (GLuint program, GLuint shader) )
+GLDECL(void, glGetShaderiv, (GLuint shader, GLenum type, GLint *res) )
+GLDECL(void, glGetInfoLogARB, (GLuint shader, GLint size, GLsizei *rsize, const char *logs) )
+GLDECL(GLint, glGetUniformLocation, (GLuint prog, const char *name) )
+GLDECL(void, glUniform1f, (GLint location, GLfloat v0) )
+GLDECL(void, glUniform1i, (GLint location, GLint v0) )
+GLDECL(void, glActiveTexture, (GLenum texture) )
+GLDECL(void, glClientActiveTexture, (GLenum texture) )
+GLDECL(void, glGenBuffers, (GLsizei , GLuint *) )
+GLDECL(void, glDeleteBuffers, (GLsizei , GLuint *) )
+GLDECL(void, glBindBuffer, (GLenum, GLuint ) )
+GLDECL(void, glBufferData, (GLenum, int, void *, GLenum) )
+GLDECL(void, glBufferSubData, (GLenum, int, int, void *) )
+GLDECL(void *, glMapBuffer, (GLenum, GLenum) )
+GLDECL(void *, glUnmapBuffer, (GLenum) )
+
+
+#define GL_TEXTURE_RECTANGLE_EXT 0x84F5
+
+#define GL_INFO_LOG_LENGTH 0x8B84
+#define GL_FRAGMENT_SHADER 0x8B30
+#define GL_VERTEX_SHADER 0x8B31
+#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC
+#define GL_STREAM_DRAW_ARB 0x88E0
+#define GL_WRITE_ONLY_ARB 0x88B9
+#define GL_DYNAMIC_DRAW_ARB 0x88E8
+
+#define GL_TEXTURE0 0x84C0
+#define GL_TEXTURE1 0x84C1
+#define GL_TEXTURE2 0x84C2
+
+
+#endif
diff --git a/applications/testapps/hevcbench/hevcbench.vcxproj b/applications/testapps/hevcbench/hevcbench.vcxproj
index 9f677d3..4abc588 100644
--- a/applications/testapps/hevcbench/hevcbench.vcxproj
+++ b/applications/testapps/hevcbench/hevcbench.vcxproj
@@ -1,262 +1,262 @@
-
-
-
-
- Debug
- Win32
-
-
- Debug
- x64
-
-
- Release
- Win32
-
-
- Release
- x64
-
-
-
- {F728CC84-A7D1-43D2-8A28-05CE9F2FE0D0}
-
-
-
- Application
- false
- MultiByte
-
-
- Application
- false
- MultiByte
-
-
- Application
- false
- MultiByte
-
-
- Application
- false
- MultiByte
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <_ProjectFileVersion>10.0.40219.1
- ../../../bin/$(Platform)\$(Configuration)/
- ../../../bin/$(Platform)\$(Configuration)/
- .\obj\$(Platform)\$(Configuration)\$(ProjectName)\
- .\obj\$(Platform)\$(Configuration)\$(ProjectName)\
- true
- true
- ../../../bin/$(Platform)\$(Configuration)/
- ../../../bin/$(Platform)\$(Configuration)/
- .\obj\$(Platform)\$(Configuration)\$(ProjectName)\
- .\obj\$(Platform)\$(Configuration)\$(ProjectName)\
- false
- false
-
-
-
-
-
-
-
-
-
- Disabled
- C:\works\software\signals\modules\extra_lib\include\SDL2\;../../../include;../../../extra_lib/include;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
- true
- EnableFastChecks
- MultiThreadedDebugDLL
- .\obj\mp42ts_deb/$(ProjectName).pch
- .\obj\mp42ts_deb/
- .\obj\mp42ts_deb/
- .\obj\mp42ts_deb/
- true
- Level3
- true
- EditAndContinue
-
-
- _DEBUG;%(PreprocessorDefinitions)
- 0x040c
-
-
- odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
- $(OutDir)$(TargetName)$(TargetExt)
- true
- C:\works\software\signals\modules\extra_lib\lib/$(Platform)/$(Configuration);../../../extra_lib/lib/$(Platform)/$(Configuration);%(AdditionalLibraryDirectories)
- true
- $(IntDir)$(ProjectName).pdb
- Console
- false
-
-
- MachineX86
-
-
- true
-
-
-
-
-
-
-
-
-
-
- Disabled
- C:\works\software\signals\modules\extra_lib\include\SDL2\;../../../include;../../../extra_lib/include;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
- EnableFastChecks
- MultiThreadedDebugDLL
- .\obj\mp42ts_deb/$(ProjectName).pch
- .\obj\mp42ts_deb/
- .\obj\mp42ts_deb/
- .\obj\mp42ts_deb/
- true
- Level3
- true
- ProgramDatabase
-
-
- _DEBUG;%(PreprocessorDefinitions)
- 0x040c
-
-
- odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
- $(OutDir)$(TargetName)$(TargetExt)
- true
- C:\works\software\signals\modules\extra_lib\lib/$(Platform)/$(Configuration);../../../extra_lib/lib/$(Platform)/$(Configuration);%(AdditionalLibraryDirectories)
- true
- $(IntDir)$(ProjectName).pdb
- Console
- false
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
- MaxSpeed
- OnlyExplicitInline
- C:\works\software\signals\modules\extra_lib\include\SDL2\;../../../include;../../../extra_lib/include;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
- true
- MultiThreadedDLL
- true
- .\obj\mp42ts_rel/$(ProjectName).pch
- .\obj\mp42ts_rel/
- .\obj\mp42ts_rel/
- .\obj\mp42ts_rel/
- Level3
- true
-
-
- NDEBUG;%(PreprocessorDefinitions)
- 0x040c
-
-
- odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
- $(OutDir)$(TargetName)$(TargetExt)
- true
- C:\works\software\signals\modules\extra_lib\lib/$(Platform)/$(Configuration);../../../extra_lib/lib/$(Platform)/$(Configuration);%(AdditionalLibraryDirectories)
- $(IntDir)$(ProjectName).pdb
- Console
- false
-
-
- MachineX86
-
-
- true
-
-
-
-
-
-
-
-
-
-
- Full
- AnySuitable
- ../../../include;../../../extra_lib/include;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
- true
- MultiThreadedDLL
- true
- .\obj\mp42ts_rel/$(ProjectName).pch
- .\obj\mp42ts_rel/
- .\obj\mp42ts_rel/
- .\obj\mp42ts_rel/
- Level3
- true
- true
- Speed
-
-
- NDEBUG;%(PreprocessorDefinitions)
- 0x040c
-
-
- odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
- $(OutDir)$(TargetName)$(TargetExt)
- true
- ../../../extra_lib/lib/$(Platform)/$(Configuration);%(AdditionalLibraryDirectories)
- $(IntDir)$(ProjectName).pdb
- Console
- false
-
-
-
-
- true
-
-
-
-
-
-
-
- {d3540754-e0cf-4604-ac11-82de9bd4d814}
-
-
-
-
-
+
+
+
+
+ Debug
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ Win32
+
+
+ Release
+ x64
+
+
+
+ {F728CC84-A7D1-43D2-8A28-05CE9F2FE0D0}
+
+
+
+ Application
+ false
+ MultiByte
+
+
+ Application
+ false
+ MultiByte
+
+
+ Application
+ false
+ MultiByte
+
+
+ Application
+ false
+ MultiByte
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <_ProjectFileVersion>10.0.40219.1
+ ../../../bin/$(Platform)\$(Configuration)/
+ ../../../bin/$(Platform)\$(Configuration)/
+ .\obj\$(Platform)\$(Configuration)\$(ProjectName)\
+ .\obj\$(Platform)\$(Configuration)\$(ProjectName)\
+ true
+ true
+ ../../../bin/$(Platform)\$(Configuration)/
+ ../../../bin/$(Platform)\$(Configuration)/
+ .\obj\$(Platform)\$(Configuration)\$(ProjectName)\
+ .\obj\$(Platform)\$(Configuration)\$(ProjectName)\
+ false
+ false
+
+
+
+
+
+
+
+
+
+ Disabled
+ C:\works\software\signals\modules\extra_lib\include\SDL2\;../../../include;../../../extra_lib/include;%(AdditionalIncludeDirectories)
+ WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
+ true
+ EnableFastChecks
+ MultiThreadedDebugDLL
+ .\obj\mp42ts_deb/$(ProjectName).pch
+ .\obj\mp42ts_deb/
+ .\obj\mp42ts_deb/
+ .\obj\mp42ts_deb/
+ true
+ Level3
+ true
+ EditAndContinue
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ 0x040c
+
+
+ odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
+ $(OutDir)$(TargetName)$(TargetExt)
+ true
+ C:\works\software\signals\modules\extra_lib\lib/$(Platform)/$(Configuration);../../../extra_lib/lib/$(Platform)/$(Configuration);%(AdditionalLibraryDirectories)
+ true
+ $(IntDir)$(ProjectName).pdb
+ Console
+ false
+
+
+ MachineX86
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+ Disabled
+ C:\works\software\signals\modules\extra_lib\include\SDL2\;../../../include;../../../extra_lib/include;%(AdditionalIncludeDirectories)
+ WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
+ EnableFastChecks
+ MultiThreadedDebugDLL
+ .\obj\mp42ts_deb/$(ProjectName).pch
+ .\obj\mp42ts_deb/
+ .\obj\mp42ts_deb/
+ .\obj\mp42ts_deb/
+ true
+ Level3
+ true
+ ProgramDatabase
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ 0x040c
+
+
+ odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
+ $(OutDir)$(TargetName)$(TargetExt)
+ true
+ C:\works\software\signals\modules\extra_lib\lib/$(Platform)/$(Configuration);../../../extra_lib/lib/$(Platform)/$(Configuration);%(AdditionalLibraryDirectories)
+ true
+ $(IntDir)$(ProjectName).pdb
+ Console
+ false
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+ MaxSpeed
+ OnlyExplicitInline
+ C:\works\software\signals\modules\extra_lib\include\SDL2\;../../../include;../../../extra_lib/include;%(AdditionalIncludeDirectories)
+ WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
+ true
+ MultiThreadedDLL
+ true
+ .\obj\mp42ts_rel/$(ProjectName).pch
+ .\obj\mp42ts_rel/
+ .\obj\mp42ts_rel/
+ .\obj\mp42ts_rel/
+ Level3
+ true
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ 0x040c
+
+
+ odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
+ $(OutDir)$(TargetName)$(TargetExt)
+ true
+ C:\works\software\signals\modules\extra_lib\lib/$(Platform)/$(Configuration);../../../extra_lib/lib/$(Platform)/$(Configuration);%(AdditionalLibraryDirectories)
+ $(IntDir)$(ProjectName).pdb
+ Console
+ false
+
+
+ MachineX86
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+ Full
+ AnySuitable
+ ../../../include;../../../extra_lib/include;%(AdditionalIncludeDirectories)
+ WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
+ true
+ MultiThreadedDLL
+ true
+ .\obj\mp42ts_rel/$(ProjectName).pch
+ .\obj\mp42ts_rel/
+ .\obj\mp42ts_rel/
+ .\obj\mp42ts_rel/
+ Level3
+ true
+ true
+ Speed
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ 0x040c
+
+
+ odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
+ $(OutDir)$(TargetName)$(TargetExt)
+ true
+ ../../../extra_lib/lib/$(Platform)/$(Configuration);%(AdditionalLibraryDirectories)
+ $(IntDir)$(ProjectName).pdb
+ Console
+ false
+
+
+
+
+ true
+
+
+
+
+
+
+
+ {d3540754-e0cf-4604-ac11-82de9bd4d814}
+
+
+
+
+
\ No newline at end of file
diff --git a/applications/testapps/hevcbench/main.c b/applications/testapps/hevcbench/main.c
index 034e221..83bd46e 100644
--- a/applications/testapps/hevcbench/main.c
+++ b/applications/testapps/hevcbench/main.c
@@ -1,857 +1,858 @@
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Authors: Jean Le Feuvre
- * Copyright (c) Telecom ParisTech 2012
- * All rights reserved
- *
- * This file is part of GPAC - sample DASH library usage
- *
- */
-
-#include "defbench.h"
-
-
-
-#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__GNUC__)
-# pragma comment(lib, "libLibOpenHevcWrapper")
-#pragma comment(lib, "SDL2")
-//#pragma comment(lib, "SDL2main")
-#pragma comment(lib, "opengl32")
-#endif
-
-//0: memcpy - 1: memmove - 2: u32 * cast and for loop copy of u32* - 3: memset 0 - 4: not touching the mapped buffer: 5: full memcpy, rely on stride in pixelstorei
-#define COPY_TYPE 0
-//set to 1 to disable final gltexImage in PBO mode
-#define NO_TEX 0
-
-
-SDL_Window *window = NULL;
-SDL_GLContext *glctx= NULL;
-SDL_Renderer *render= NULL;
-GLint txid[3];
-u8 *pY = NULL;
-u8 *pU = NULL;
-u8 *pV = NULL;
-u32 width = 0;
-u32 height = 0;
-u32 size=0;
-u32 bpp=8;
-u32 Bpp=1;
-GLint memory_format=GL_UNSIGNED_BYTE;
-GLint pixel_format=GL_LUMINANCE;
-GLint texture_type=GL_TEXTURE_RECTANGLE_EXT;
-u32 gl_nb_frames = 1;
-u64 gl_upload_time = 0;
-u64 gl_draw_time = 0;
-Bool pbo_mode = GF_TRUE;
-Bool first_tx_load = GF_FALSE;
-Bool use_vsync=0;
-
-GLint glsl_program;
-GLint vertex_shader;
-GLint fragment_shader;
-
-GLint pbo_Y=0;
-GLint pbo_U=0;
-GLint pbo_V=0;
-
-GLDECL_STATIC(glActiveTexture);
-GLDECL_STATIC(glClientActiveTexture);
-GLDECL_STATIC(glCreateProgram);
-GLDECL_STATIC(glDeleteProgram);
-GLDECL_STATIC(glLinkProgram);
-GLDECL_STATIC(glUseProgram);
-GLDECL_STATIC(glCreateShader);
-GLDECL_STATIC(glDeleteShader);
-GLDECL_STATIC(glShaderSource);
-GLDECL_STATIC(glCompileShader);
-GLDECL_STATIC(glAttachShader);
-GLDECL_STATIC(glDetachShader);
-GLDECL_STATIC(glGetShaderiv);
-GLDECL_STATIC(glGetInfoLogARB);
-GLDECL_STATIC(glGetUniformLocation);
-GLDECL_STATIC(glUniform1f);
-GLDECL_STATIC(glUniform1i);
-GLDECL_STATIC(glGenBuffers);
-GLDECL_STATIC(glDeleteBuffers);
-GLDECL_STATIC(glBindBuffer);
-GLDECL_STATIC(glBufferData);
-GLDECL_STATIC(glBufferSubData);
-GLDECL_STATIC(glMapBuffer);
-GLDECL_STATIC(glUnmapBuffer);
-
-
-static char *glsl_yuv_shader = "\
- #version 140\n\
- #extension GL_ARB_texture_rectangle : enable\n\
- uniform sampler2DRect y_plane;\
- uniform sampler2DRect u_plane;\
- uniform sampler2DRect v_plane;\
- uniform float width;\
- uniform float height;\
- const vec3 offset = vec3(-0.0625, -0.5, -0.5);\
- const vec3 R_mul = vec3(1.164, 0.000, 1.596);\
- const vec3 G_mul = vec3(1.164, -0.391, -0.813);\
- const vec3 B_mul = vec3(1.164, 2.018, 0.000);\
- out vec4 FragColor;\
- void main(void) \
- {\
- vec2 texc;\
- vec3 yuv, rgb;\
- texc = gl_TexCoord[0].st;\
- texc.y = 1.0 - texc.y;\
- texc.x *= width;\
- texc.y *= height;\
- yuv.x = texture2DRect(y_plane, texc).r; \
- texc.x /= 2.0;\
- texc.y /= 2.0;\
- yuv.y = texture2DRect(u_plane, texc).r; \
- yuv.z = texture2DRect(v_plane, texc).r; \
- yuv += offset; \
- rgb.r = dot(yuv, R_mul); \
- rgb.g = dot(yuv, G_mul); \
- rgb.b = dot(yuv, B_mul); \
- FragColor = vec4(rgb, 1.0);\
- }";
-
-static char *default_glsl_vertex = "\
- varying vec3 gfNormal;\
- varying vec3 gfView;\
- void main(void)\
- {\
- gfView = vec3(gl_ModelViewMatrix * gl_Vertex);\
- gfNormal = normalize(gl_NormalMatrix * gl_Normal);\
- gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\
- gl_TexCoord[0] = gl_MultiTexCoord0;\
- }";
-
-
-
-Bool sdl_compile_shader(u32 shader_id, const char *name, const char *source)
-{
- GLint blen = 0;
- GLsizei slen = 0;
- u32 len;
- if (!source || !shader_id) return 0;
- len = (u32) strlen(source);
- glShaderSource(shader_id, 1, &source, &len);
- glCompileShader(shader_id);
-
- glGetShaderiv(shader_id, GL_INFO_LOG_LENGTH , &blen);
- if (blen > 1) {
- char* compiler_log = (char*) gf_malloc(blen);
-#ifdef CONFIG_DARWIN_GL
- glGetInfoLogARB((GLhandleARB) shader_id, blen, &slen, compiler_log);
-#else
- glGetInfoLogARB(shader_id, blen, &slen, compiler_log);
-#endif
- GF_LOG(GF_LOG_ERROR, GF_LOG_COMPOSE, ("[GLSL] Failed to compile shader %s: %s\n", name, compiler_log));
- gf_free (compiler_log);
- return 0;
- }
- return 1;
-}
-
-void sdl_init(u32 _width, u32 _height, u32 _bpp, u32 stride, Bool use_pbo)
-{
- u32 i, flags;
- Float hw, hh;
- GLint loc;
- GF_Matrix mx;
- width = _width;
- height = _height;
- bpp = _bpp;
-
-
- SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
- SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
- SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 0);
- SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
- SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
- SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
-
- flags = SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_BORDERLESS | SDL_WINDOW_MAXIMIZED;
- if (use_vsync) flags |= SDL_RENDERER_PRESENTVSYNC;
- window = SDL_CreateWindow("", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, width, height, flags);
- glctx = SDL_GL_CreateContext(window);
- SDL_GL_MakeCurrent(window, glctx);
-
- render = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);
-
-
-#if (COPY_TYPE==5)
- size = stride*height;
-#else
- size = width*height;
-#endif
- if (bpp>8) {
- size *= 2;
- Bpp = 2;
- }
- pY = gf_malloc(size*sizeof(u8));
- memset(pY, 0x80, size*sizeof(u8));
- pU = gf_malloc(size/4*sizeof(u8));
- memset(pU, 0, size/4*sizeof(u8));
- pV = gf_malloc(size/4*sizeof(u8));
- memset(pV, 0, size/4*sizeof(u8));
-
- glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
- glViewport(0, 0, width, height);
-
- gf_mx_init(mx);
- hw = ((Float)width)/2;
- hh = ((Float)height)/2;
- gf_mx_ortho(&mx, -hw, hw, -hh, hh, 50, -50);
- glMatrixMode(GL_PROJECTION);
- glLoadMatrixf(mx.m);
-
-
- glMatrixMode(GL_TEXTURE);
- glLoadIdentity();
-
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-
- glClear(GL_DEPTH_BUFFER_BIT);
- glDisable(GL_NORMALIZE);
- glDisable(GL_DEPTH_TEST);
- glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
- glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glDisable(GL_LINE_SMOOTH);
- glDisable(GL_LINE_SMOOTH);
- glDisable(GL_LIGHTING);
- glDisable(GL_BLEND);
- glDisable(GL_TEXTURE_2D);
- glDisable(GL_CULL_FACE);
-
-
- GET_GLFUN(glActiveTexture);
- GET_GLFUN(glClientActiveTexture);
- GET_GLFUN(glCreateProgram);
- GET_GLFUN(glDeleteProgram);
- GET_GLFUN(glLinkProgram);
- GET_GLFUN(glUseProgram);
- GET_GLFUN(glCreateShader);
- GET_GLFUN(glDeleteShader);
- GET_GLFUN(glShaderSource);
- GET_GLFUN(glCompileShader);
- GET_GLFUN(glAttachShader);
- GET_GLFUN(glDetachShader);
- GET_GLFUN(glGetShaderiv);
- GET_GLFUN(glGetInfoLogARB);
- GET_GLFUN(glGetUniformLocation);
- GET_GLFUN(glUniform1f);
- GET_GLFUN(glUniform1i);
- GET_GLFUN(glGenBuffers);
- GET_GLFUN(glDeleteBuffers);
- GET_GLFUN(glBindBuffer);
- GET_GLFUN(glBufferData);
- GET_GLFUN(glBufferSubData);
- GET_GLFUN(glMapBuffer);
- GET_GLFUN(glUnmapBuffer);
-
- glsl_program = glCreateProgram();
- vertex_shader = glCreateShader(GL_VERTEX_SHADER);
- sdl_compile_shader(vertex_shader, "vertex", default_glsl_vertex);
-
- fragment_shader = glCreateShader(GL_FRAGMENT_SHADER);
- sdl_compile_shader(fragment_shader, "fragment", glsl_yuv_shader);
-
- glAttachShader(glsl_program, vertex_shader);
- glAttachShader(glsl_program, fragment_shader);
- glLinkProgram(glsl_program);
-
- glGenTextures(3, txid);
- for (i=0; i<3; i++) {
-
- glEnable(texture_type);
- glBindTexture(texture_type, txid[i] );
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- if (bpp>8) {
- glPixelTransferi(GL_RED_SCALE, 64);
- memory_format=GL_UNSIGNED_SHORT;
- }
- glTexParameteri(texture_type, GL_TEXTURE_WRAP_S, GL_CLAMP);
- glTexParameteri(texture_type, GL_TEXTURE_WRAP_T, GL_CLAMP);
- glTexParameteri(texture_type, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameteri(texture_type, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-
- if (bpp>8) {
- glPixelStorei(GL_UNPACK_ALIGNMENT, 2);
- } else {
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- }
- glDisable(texture_type);
- }
-
- //sets uniforms: y, u, v textures point to texture slots 0, 1 and 2
- glUseProgram(glsl_program);
- for (i=0; i<3; i++) {
- const char *txname = (i==0) ? "y_plane" : (i==1) ? "u_plane" : "v_plane";
- loc = glGetUniformLocation(glsl_program, txname);
- if (loc == -1) {
- GF_LOG(GF_LOG_ERROR, GF_LOG_COMPOSE, ("[Compositor] Failed to locate texture %s in YUV shader\n", txname));
- continue;
- }
- glUniform1i(loc, i);
- }
- loc = glGetUniformLocation(glsl_program, "width");
- if (loc>= 0) {
- Float w = (Float) width;
- glUniform1f(loc, w);
- }
- loc = glGetUniformLocation(glsl_program, "height");
- if (loc>= 0) {
- Float h = (Float) height;
- glUniform1f(loc, h);
- }
-
- glUseProgram(0);
-
-
- if (glMapBuffer==NULL) use_pbo = GF_FALSE;
-
-
- pbo_mode = use_pbo;
- first_tx_load = use_pbo ? GF_FALSE : GF_TRUE;
- if (use_pbo) {
- glGenBuffers(1, &pbo_Y);
- glGenBuffers(1, &pbo_U);
- glGenBuffers(1, &pbo_V);
-
- glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pbo_Y);
- glBufferData(GL_PIXEL_UNPACK_BUFFER_ARB, size, NULL, GL_DYNAMIC_DRAW_ARB);
-
- glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pbo_U);
- glBufferData(GL_PIXEL_UNPACK_BUFFER_ARB, size/4, NULL, GL_DYNAMIC_DRAW_ARB);
-
- glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pbo_V);
- glBufferData(GL_PIXEL_UNPACK_BUFFER_ARB, size/4, NULL, GL_DYNAMIC_DRAW_ARB);
-
- glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
- }
-}
-
-void sdl_close()
-{
- DEL_SHADER(vertex_shader);
- DEL_SHADER(fragment_shader);
- DEL_PROGRAM(glsl_program );
-
- if (pbo_mode && pbo_Y) {
- glDeleteBuffers(1, &pbo_Y);
- glDeleteBuffers(1, &pbo_U);
- glDeleteBuffers(1, &pbo_V);
- }
-
- if (pY) gf_free(pY);
- if (pU) gf_free(pU);
- if (pV) gf_free(pV);
-
- if (glctx) SDL_GL_DeleteContext(glctx);
- if (render) SDL_DestroyRenderer(render);
- if (window) SDL_DestroyWindow(window);
-}
-
-void sdl_draw_quad()
-{
- Float w = ((Float)width)/2;
- Float h = ((Float)height)/2;
-
- glBegin(GL_QUADS);
-
- glVertex3f(w, h, 0);
- glTexCoord2f(1, 0);
-
- glVertex3f(w, -h, 0);
- glTexCoord2f(0, 0);
-
- glVertex3f(-w, -h, 0);
- glTexCoord2f(0, 1);
-
- glVertex3f(-w, h, 0);
- glTexCoord2f(1, 1);
-
- glEnd();
-}
-
-
-void sdl_draw_frame(u8 *pY, u8 *pU, u8 *pV, u32 w, u32 h, u32 bit_depth, u32 stride)
-{
- u32 needs_stride = 0;
- u64 now, end;
-
- if (stride != w) {
- if (bit_depth==10) {
- if (stride != 2*w) {
- needs_stride = stride / 2;
- }
- } else {
- needs_stride = stride;
- }
- }
-
- glEnable(texture_type);
-
- now = gf_sys_clock_high_res();
-
-
- if (first_tx_load) {
- glBindTexture(texture_type, txid[0] );
- if (needs_stride) glPixelStorei(GL_UNPACK_ROW_LENGTH, needs_stride);
- glTexImage2D(texture_type, 0, 1, w, h, 0, pixel_format, memory_format, pY);
-
- glBindTexture(texture_type, txid[1] );
- if (needs_stride) glPixelStorei(GL_UNPACK_ROW_LENGTH, needs_stride/2);
- glTexImage2D(texture_type, 0, 1, w/2, h/2, 0, pixel_format, memory_format, pU);
-
- glBindTexture(texture_type, txid[2] );
- if (needs_stride) glPixelStorei(GL_UNPACK_ROW_LENGTH, needs_stride/2);
- glTexImage2D(texture_type, 0, 1, w/2, h/2, 0, pixel_format, memory_format, pV);
-
- if (needs_stride) glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
- first_tx_load = GF_FALSE;
- } else if (pbo_mode) {
- u32 i, linesize, count, p_stride;
- u8 *ptr;
-#if (COPY_TYPE==2)
- u32 *s, *d;
- u32 j, c2;
-#endif
-
- glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
-
- glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pbo_Y);
- ptr =(u8 *)glMapBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, GL_WRITE_ONLY_ARB);
-#if (COPY_TYPE==5)
- memcpy(ptr, pY, size);
-#elif (COPY_TYPE==3)
- memset(ptr, 0x80, size);
-#elif (COPY_TYPE==4)
-#else
- linesize = width*Bpp;
- p_stride = stride;
- count = h;
-#if (COPY_TYPE==2)
- c2 = linesize/4;
- s = (u32 *)pY;
- d = (u32 *)ptr;
-#endif
- for (i=0; i=GF_ISOM_HEVCTYPE_HEVC_ONLY) {
- track = i+1;
- break;
- }
- }
-
- if (!track) {
- gf_isom_close(isom);
- sdl_close();
- gf_sys_close();
- return 0;
- }
-
- count = gf_isom_get_sample_count(isom, track);
- start = gf_sys_clock_high_res();
-
- esd = gf_isom_get_esd(isom, track, 1);
- ohevc = libOpenHevcInit(nb_threads, mode);
- if (esd->decoderConfig && esd->decoderConfig->decoderSpecificInfo && esd->decoderConfig->decoderSpecificInfo->data) {
- libOpenHevcCopyExtraData(ohevc, esd->decoderConfig->decoderSpecificInfo->data, esd->decoderConfig->decoderSpecificInfo->dataLength+8);
- }
-
- libOpenHevcSetActiveDecoders(ohevc, 1);
- libOpenHevcSetViewLayers(ohevc, 1);
-
- libOpenHevcStartDecoder(ohevc);
- gf_odf_desc_del((GF_Descriptor *)esd);
- gf_isom_set_sample_padding(isom, track, 8);
-
- run=1;
- check_prompt=0;
- for (i=0; idata, sample->dataLength, sample->DTS+sample->CTS_Offset) ) {
- if (no_display) {
- OpenHevc_Frame HVCFrame_ptr;
- libOpenHevcGetOutput(ohevc, 1, &HVCFrame_ptr);
- } else if (use_raw_memory) {
- OpenHevc_Frame HVCFrame_ptr;
- libOpenHevcGetOutput(ohevc, 1, &HVCFrame_ptr);
-
-
- if (!sdl_is_init && !no_display) {
- sdl_init(HVCFrame_ptr.frameInfo.nWidth, HVCFrame_ptr.frameInfo.nHeight, HVCFrame_ptr.frameInfo.nBitDepth, HVCFrame_ptr.frameInfo.nYPitch, use_pbo);
- sdl_is_init=1;
- start = gf_sys_clock_high_res();
- nb_frames_at_start = i+1;
- }
-
- sdl_draw_frame((u8 *) HVCFrame_ptr.pvY, (u8 *) HVCFrame_ptr.pvU, (u8 *) HVCFrame_ptr.pvV, HVCFrame_ptr.frameInfo.nWidth, HVCFrame_ptr.frameInfo.nHeight, HVCFrame_ptr.frameInfo.nBitDepth, HVCFrame_ptr.frameInfo.nYPitch);
- } else {
- OpenHevc_Frame_cpy HVCFrame;
- memset(&HVCFrame, 0, sizeof(OpenHevc_Frame_cpy) );
-
- libOpenHevcGetPictureInfoCpy(ohevc, &HVCFrame.frameInfo);
-
- if (!sdl_is_init && !no_display) {
- sdl_init(HVCFrame.frameInfo.nWidth, HVCFrame.frameInfo.nHeight, HVCFrame.frameInfo.nBitDepth, HVCFrame.frameInfo.nYPitch, use_pbo);
- sdl_is_init=1;
- start = gf_sys_clock_high_res();
- nb_frames_at_start = i+1;
- }
-
- HVCFrame.pvY = (void*) pY;
- HVCFrame.pvU = (void*) pU;
- HVCFrame.pvV = (void*) pV;
-
- libOpenHevcGetOutputCpy(ohevc, 1, &HVCFrame);
-
- sdl_draw_frame(pY, pU, pV, HVCFrame.frameInfo.nWidth, HVCFrame.frameInfo.nHeight, HVCFrame.frameInfo.nBitDepth, HVCFrame.frameInfo.nYPitch);
- }
- }
-
- gf_isom_sample_del(&sample);
-
- now = gf_sys_clock_high_res();
- fprintf(stderr, "%d %% %d frames in %d ms - FPS %03.2f - push time "LLD" ms - draw "LLD" ms\r", 100*(i+1-nb_frames_at_start)/count, i+1-nb_frames_at_start, (now-start)/1000, 1000000.0 * (i+1-nb_frames_at_start) / (now-start), gl_upload_time / gl_nb_frames/1000 , (gl_draw_time - gl_upload_time) / gl_nb_frames/1000 );
- } else {
- gf_sleep(10);
- i--;
- }
- check_prompt++;
- if (check_prompt==50) {
- if (gf_prompt_has_input()) {
- switch (gf_prompt_get_char()) {
- case 'q':
- run = 0;
- break;
- case 'm':
- use_raw_memory = !use_raw_memory;
- break;
- case 'p':
- if (paused) {
- paused=0;
- start += gf_sys_clock_high_res()-pause_time;
- } else {
- paused = 1;
- pause_time=gf_sys_clock_high_res();
- }
- break;
- case 'r':
- start = gf_sys_clock_high_res();
- nb_frames_at_start = i+1;
- gl_upload_time = gl_draw_time = 0;
- gl_nb_frames=1;
- break;
-
- }
- }
- check_prompt=0;
- }
- }
- now = gf_sys_clock_high_res();
- fprintf(stderr, "\nDecoded %d frames in %d ms - FPS %g\n", i+1, (now-start)/1000, 1000000.0 * (i+1) / (now-start) );
-
- libOpenHevcClose(ohevc);
- gf_isom_close(isom);
-
- if (!no_display)
- sdl_close();
-
- gf_sys_close();
- return 1;
-}
-
+/*
+ * GPAC - Multimedia Framework C SDK
+ *
+ * Authors: Jean Le Feuvre
+ * Copyright (c) Telecom ParisTech 2012
+ * All rights reserved
+ *
+ * This file is part of GPAC - sample DASH library usage
+ *
+ */
+
+#include "defbench.h"
+
+
+
+#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__GNUC__)
+# pragma comment(lib, "libLibOpenHevcWrapper")
+#pragma comment(lib, "SDL2")
+//#pragma comment(lib, "SDL2main")
+#pragma comment(lib, "opengl32")
+#endif
+
+//0: memcpy - 1: memmove - 2: u32 * cast and for loop copy of u32* - 3: memset 0 - 4: not touching the mapped buffer: 5: full memcpy, rely on stride in pixelstorei
+#define COPY_TYPE 0
+//set to 1 to disable final gltexImage in PBO mode
+#define NO_TEX 0
+
+
+SDL_Window *window = NULL;
+SDL_GLContext *glctx= NULL;
+SDL_Renderer *render= NULL;
+GLint txid[3];
+u8 *pY = NULL;
+u8 *pU = NULL;
+u8 *pV = NULL;
+u32 width = 0;
+u32 height = 0;
+u32 size=0;
+u32 bpp=8;
+u32 Bpp=1;
+GLint memory_format=GL_UNSIGNED_BYTE;
+GLint pixel_format=GL_LUMINANCE;
+GLint texture_type=GL_TEXTURE_RECTANGLE_EXT;
+u32 gl_nb_frames = 1;
+u64 gl_upload_time = 0;
+u64 gl_draw_time = 0;
+Bool pbo_mode = GF_TRUE;
+Bool first_tx_load = GF_FALSE;
+Bool use_vsync=0;
+
+GLint glsl_program;
+GLint vertex_shader;
+GLint fragment_shader;
+
+GLint pbo_Y=0;
+GLint pbo_U=0;
+GLint pbo_V=0;
+
+GLDECL_STATIC(glActiveTexture);
+GLDECL_STATIC(glClientActiveTexture);
+GLDECL_STATIC(glCreateProgram);
+GLDECL_STATIC(glDeleteProgram);
+GLDECL_STATIC(glLinkProgram);
+GLDECL_STATIC(glUseProgram);
+GLDECL_STATIC(glCreateShader);
+GLDECL_STATIC(glDeleteShader);
+GLDECL_STATIC(glShaderSource);
+GLDECL_STATIC(glCompileShader);
+GLDECL_STATIC(glAttachShader);
+GLDECL_STATIC(glDetachShader);
+GLDECL_STATIC(glGetShaderiv);
+GLDECL_STATIC(glGetInfoLogARB);
+GLDECL_STATIC(glGetUniformLocation);
+GLDECL_STATIC(glUniform1f);
+GLDECL_STATIC(glUniform1i);
+GLDECL_STATIC(glGenBuffers);
+GLDECL_STATIC(glDeleteBuffers);
+GLDECL_STATIC(glBindBuffer);
+GLDECL_STATIC(glBufferData);
+GLDECL_STATIC(glBufferSubData);
+GLDECL_STATIC(glMapBuffer);
+GLDECL_STATIC(glUnmapBuffer);
+
+
+static char *glsl_yuv_shader = "\
+ #version 140\n\
+ #extension GL_ARB_texture_rectangle : enable\n\
+ uniform sampler2DRect y_plane;\
+ uniform sampler2DRect u_plane;\
+ uniform sampler2DRect v_plane;\
+ uniform float width;\
+ uniform float height;\
+ const vec3 offset = vec3(-0.0625, -0.5, -0.5);\
+ const vec3 R_mul = vec3(1.164, 0.000, 1.596);\
+ const vec3 G_mul = vec3(1.164, -0.391, -0.813);\
+ const vec3 B_mul = vec3(1.164, 2.018, 0.000);\
+ out vec4 FragColor;\
+ void main(void) \
+ {\
+ vec2 texc;\
+ vec3 yuv, rgb;\
+ texc = gl_TexCoord[0].st;\
+ texc.y = 1.0 - texc.y;\
+ texc.x *= width;\
+ texc.y *= height;\
+ yuv.x = texture2DRect(y_plane, texc).r; \
+ texc.x /= 2.0;\
+ texc.y /= 2.0;\
+ yuv.y = texture2DRect(u_plane, texc).r; \
+ yuv.z = texture2DRect(v_plane, texc).r; \
+ yuv += offset; \
+ rgb.r = dot(yuv, R_mul); \
+ rgb.g = dot(yuv, G_mul); \
+ rgb.b = dot(yuv, B_mul); \
+ FragColor = vec4(rgb, 1.0);\
+ }";
+
+static char *default_glsl_vertex = "\
+ varying vec3 gfNormal;\
+ varying vec3 gfView;\
+ void main(void)\
+ {\
+ gfView = vec3(gl_ModelViewMatrix * gl_Vertex);\
+ gfNormal = normalize(gl_NormalMatrix * gl_Normal);\
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\
+ gl_TexCoord[0] = gl_MultiTexCoord0;\
+ }";
+
+
+
+Bool sdl_compile_shader(u32 shader_id, const char *name, const char *source)
+{
+ GLint blen = 0;
+ GLsizei slen = 0;
+ u32 len;
+ if (!source || !shader_id) return 0;
+ len = (u32) strlen(source);
+ glShaderSource(shader_id, 1, &source, &len);
+ glCompileShader(shader_id);
+
+ glGetShaderiv(shader_id, GL_INFO_LOG_LENGTH , &blen);
+ if (blen > 1) {
+ char* compiler_log = (char*) gf_malloc(blen);
+#ifdef CONFIG_DARWIN_GL
+ glGetInfoLogARB((GLhandleARB) shader_id, blen, &slen, compiler_log);
+#else
+ glGetInfoLogARB(shader_id, blen, &slen, compiler_log);
+#endif
+ GF_LOG(GF_LOG_ERROR, GF_LOG_COMPOSE, ("[GLSL] Failed to compile shader %s: %s\n", name, compiler_log));
+ gf_free (compiler_log);
+ return 0;
+ }
+ return 1;
+}
+
+void sdl_init(u32 _width, u32 _height, u32 _bpp, u32 stride, Bool use_pbo)
+{
+ u32 i, flags;
+ Float hw, hh;
+ GLint loc;
+ GF_Matrix mx;
+ width = _width;
+ height = _height;
+ bpp = _bpp;
+
+
+ SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
+ SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
+ SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 0);
+ SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
+ SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
+ SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
+
+ flags = SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_BORDERLESS | SDL_WINDOW_MAXIMIZED;
+ if (use_vsync) flags |= SDL_RENDERER_PRESENTVSYNC;
+ window = SDL_CreateWindow("", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, width, height, flags);
+ glctx = SDL_GL_CreateContext(window);
+ SDL_GL_MakeCurrent(window, glctx);
+
+ render = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);
+
+
+#if (COPY_TYPE==5)
+ size = stride*height;
+#else
+ size = width*height;
+#endif
+ if (bpp>8) {
+ size *= 2;
+ Bpp = 2;
+ }
+ pY = gf_malloc(size*sizeof(u8));
+ memset(pY, 0x80, size*sizeof(u8));
+ pU = gf_malloc(size/4*sizeof(u8));
+ memset(pU, 0, size/4*sizeof(u8));
+ pV = gf_malloc(size/4*sizeof(u8));
+ memset(pV, 0, size/4*sizeof(u8));
+
+ glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
+ glViewport(0, 0, width, height);
+
+ gf_mx_init(mx);
+ hw = ((Float)width)/2;
+ hh = ((Float)height)/2;
+ gf_mx_ortho(&mx, -hw, hw, -hh, hh, 50, -50);
+ glMatrixMode(GL_PROJECTION);
+ glLoadMatrixf(mx.m);
+
+
+ glMatrixMode(GL_TEXTURE);
+ glLoadIdentity();
+
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+
+ glClear(GL_DEPTH_BUFFER_BIT);
+ glDisable(GL_NORMALIZE);
+ glDisable(GL_DEPTH_TEST);
+ glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
+ glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glDisable(GL_LINE_SMOOTH);
+ glDisable(GL_LINE_SMOOTH);
+ glDisable(GL_LIGHTING);
+ glDisable(GL_BLEND);
+ glDisable(GL_TEXTURE_2D);
+ glDisable(GL_CULL_FACE);
+
+
+ GET_GLFUN(glActiveTexture);
+ GET_GLFUN(glClientActiveTexture);
+ GET_GLFUN(glCreateProgram);
+ GET_GLFUN(glDeleteProgram);
+ GET_GLFUN(glLinkProgram);
+ GET_GLFUN(glUseProgram);
+ GET_GLFUN(glCreateShader);
+ GET_GLFUN(glDeleteShader);
+ GET_GLFUN(glShaderSource);
+ GET_GLFUN(glCompileShader);
+ GET_GLFUN(glAttachShader);
+ GET_GLFUN(glDetachShader);
+ GET_GLFUN(glGetShaderiv);
+ GET_GLFUN(glGetInfoLogARB);
+ GET_GLFUN(glGetUniformLocation);
+ GET_GLFUN(glUniform1f);
+ GET_GLFUN(glUniform1i);
+ GET_GLFUN(glGenBuffers);
+ GET_GLFUN(glDeleteBuffers);
+ GET_GLFUN(glBindBuffer);
+ GET_GLFUN(glBufferData);
+ GET_GLFUN(glBufferSubData);
+ GET_GLFUN(glMapBuffer);
+ GET_GLFUN(glUnmapBuffer);
+
+ glsl_program = glCreateProgram();
+ vertex_shader = glCreateShader(GL_VERTEX_SHADER);
+ sdl_compile_shader(vertex_shader, "vertex", default_glsl_vertex);
+
+ fragment_shader = glCreateShader(GL_FRAGMENT_SHADER);
+ sdl_compile_shader(fragment_shader, "fragment", glsl_yuv_shader);
+
+ glAttachShader(glsl_program, vertex_shader);
+ glAttachShader(glsl_program, fragment_shader);
+ glLinkProgram(glsl_program);
+
+ glGenTextures(3, txid);
+ for (i=0; i<3; i++) {
+
+ glEnable(texture_type);
+ glBindTexture(texture_type, txid[i] );
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+ if (bpp>8) {
+ glPixelTransferi(GL_RED_SCALE, 64);
+ memory_format=GL_UNSIGNED_SHORT;
+ }
+ glTexParameteri(texture_type, GL_TEXTURE_WRAP_S, GL_CLAMP);
+ glTexParameteri(texture_type, GL_TEXTURE_WRAP_T, GL_CLAMP);
+ glTexParameteri(texture_type, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameteri(texture_type, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+
+ if (bpp>8) {
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 2);
+ } else {
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+ }
+ glDisable(texture_type);
+ }
+
+ //sets uniforms: y, u, v textures point to texture slots 0, 1 and 2
+ glUseProgram(glsl_program);
+ for (i=0; i<3; i++) {
+ const char *txname = (i==0) ? "y_plane" : (i==1) ? "u_plane" : "v_plane";
+ loc = glGetUniformLocation(glsl_program, txname);
+ if (loc == -1) {
+ GF_LOG(GF_LOG_ERROR, GF_LOG_COMPOSE, ("[Compositor] Failed to locate texture %s in YUV shader\n", txname));
+ continue;
+ }
+ glUniform1i(loc, i);
+ }
+ loc = glGetUniformLocation(glsl_program, "width");
+ if (loc>= 0) {
+ Float w = (Float) width;
+ glUniform1f(loc, w);
+ }
+ loc = glGetUniformLocation(glsl_program, "height");
+ if (loc>= 0) {
+ Float h = (Float) height;
+ glUniform1f(loc, h);
+ }
+
+ glUseProgram(0);
+
+
+ if (glMapBuffer==NULL) use_pbo = GF_FALSE;
+
+
+ pbo_mode = use_pbo;
+ first_tx_load = use_pbo ? GF_FALSE : GF_TRUE;
+ if (use_pbo) {
+ glGenBuffers(1, &pbo_Y);
+ glGenBuffers(1, &pbo_U);
+ glGenBuffers(1, &pbo_V);
+
+ glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pbo_Y);
+ glBufferData(GL_PIXEL_UNPACK_BUFFER_ARB, size, NULL, GL_DYNAMIC_DRAW_ARB);
+
+ glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pbo_U);
+ glBufferData(GL_PIXEL_UNPACK_BUFFER_ARB, size/4, NULL, GL_DYNAMIC_DRAW_ARB);
+
+ glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pbo_V);
+ glBufferData(GL_PIXEL_UNPACK_BUFFER_ARB, size/4, NULL, GL_DYNAMIC_DRAW_ARB);
+
+ glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
+ }
+}
+
+void sdl_close()
+{
+ DEL_SHADER(vertex_shader);
+ DEL_SHADER(fragment_shader);
+ DEL_PROGRAM(glsl_program );
+
+ if (pbo_mode && pbo_Y) {
+ glDeleteBuffers(1, &pbo_Y);
+ glDeleteBuffers(1, &pbo_U);
+ glDeleteBuffers(1, &pbo_V);
+ }
+
+ if (pY) gf_free(pY);
+ if (pU) gf_free(pU);
+ if (pV) gf_free(pV);
+
+ if (glctx) SDL_GL_DeleteContext(glctx);
+ if (render) SDL_DestroyRenderer(render);
+ if (window) SDL_DestroyWindow(window);
+}
+
+void sdl_draw_quad()
+{
+ Float w = ((Float)width)/2;
+ Float h = ((Float)height)/2;
+
+ glBegin(GL_QUADS);
+
+ glVertex3f(w, h, 0);
+ glTexCoord2f(1, 0);
+
+ glVertex3f(w, -h, 0);
+ glTexCoord2f(0, 0);
+
+ glVertex3f(-w, -h, 0);
+ glTexCoord2f(0, 1);
+
+ glVertex3f(-w, h, 0);
+ glTexCoord2f(1, 1);
+
+ glEnd();
+}
+
+
+void sdl_draw_frame(u8 *pY, u8 *pU, u8 *pV, u32 w, u32 h, u32 bit_depth, u32 stride)
+{
+ u32 needs_stride = 0;
+ u64 now, end;
+
+ if (stride != w) {
+ if (bit_depth==10) {
+ if (stride != 2*w) {
+ needs_stride = stride / 2;
+ }
+ } else {
+ needs_stride = stride;
+ }
+ }
+
+ glEnable(texture_type);
+
+ now = gf_sys_clock_high_res();
+
+
+ if (first_tx_load) {
+ glBindTexture(texture_type, txid[0] );
+ if (needs_stride) glPixelStorei(GL_UNPACK_ROW_LENGTH, needs_stride);
+ glTexImage2D(texture_type, 0, 1, w, h, 0, pixel_format, memory_format, pY);
+
+ glBindTexture(texture_type, txid[1] );
+ if (needs_stride) glPixelStorei(GL_UNPACK_ROW_LENGTH, needs_stride/2);
+ glTexImage2D(texture_type, 0, 1, w/2, h/2, 0, pixel_format, memory_format, pU);
+
+ glBindTexture(texture_type, txid[2] );
+ if (needs_stride) glPixelStorei(GL_UNPACK_ROW_LENGTH, needs_stride/2);
+ glTexImage2D(texture_type, 0, 1, w/2, h/2, 0, pixel_format, memory_format, pV);
+
+ if (needs_stride) glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+ first_tx_load = GF_FALSE;
+ } else if (pbo_mode) {
+ u32 i, linesize, count, p_stride;
+ u8 *ptr;
+#if (COPY_TYPE==2)
+ u32 *s, *d;
+ u32 j, c2;
+#endif
+
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+
+ glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pbo_Y);
+ ptr =(u8 *)glMapBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, GL_WRITE_ONLY_ARB);
+#if (COPY_TYPE==5)
+ memcpy(ptr, pY, size);
+#elif (COPY_TYPE==3)
+ memset(ptr, 0x80, size);
+#elif (COPY_TYPE==4)
+#else
+ linesize = width*Bpp;
+ p_stride = stride;
+ count = h;
+#if (COPY_TYPE==2)
+ c2 = linesize/4;
+ s = (u32 *)pY;
+ d = (u32 *)ptr;
+#endif
+ for (i=0; i=GF_ISOM_HEVCTYPE_HEVC_ONLY) {
+ track = i+1;
+ break;
+ }
+ }
+
+ if (!track) {
+ gf_isom_close(isom);
+ sdl_close();
+ gf_sys_close();
+ return 0;
+ }
+
+ count = gf_isom_get_sample_count(isom, track);
+ start = gf_sys_clock_high_res();
+
+ esd = gf_isom_get_esd(isom, track, 1);
+ ohevc = libOpenHevcInit(nb_threads, mode);
+ if (esd->decoderConfig && esd->decoderConfig->decoderSpecificInfo && esd->decoderConfig->decoderSpecificInfo->data) {
+ libOpenHevcCopyExtraData(ohevc, esd->decoderConfig->decoderSpecificInfo->data, esd->decoderConfig->decoderSpecificInfo->dataLength+8);
+ }
+
+ libOpenHevcSetActiveDecoders(ohevc, 1);
+ libOpenHevcSetViewLayers(ohevc, 1);
+
+ libOpenHevcStartDecoder(ohevc);
+ gf_odf_desc_del((GF_Descriptor *)esd);
+ gf_isom_set_sample_padding(isom, track, 8);
+
+ run=1;
+ check_prompt=0;
+ for (i=0; idata, sample->dataLength, sample->DTS+sample->CTS_Offset) ) {
+ if (no_display) {
+ OpenHevc_Frame HVCFrame_ptr;
+ libOpenHevcGetOutput(ohevc, 1, &HVCFrame_ptr);
+ } else if (use_raw_memory) {
+ OpenHevc_Frame HVCFrame_ptr;
+ libOpenHevcGetOutput(ohevc, 1, &HVCFrame_ptr);
+
+
+ if (!sdl_is_init && !no_display) {
+ sdl_init(HVCFrame_ptr.frameInfo.nWidth, HVCFrame_ptr.frameInfo.nHeight, HVCFrame_ptr.frameInfo.nBitDepth, HVCFrame_ptr.frameInfo.nYPitch, use_pbo);
+ sdl_is_init=1;
+ start = gf_sys_clock_high_res();
+ nb_frames_at_start = i+1;
+ }
+
+ sdl_draw_frame((u8 *) HVCFrame_ptr.pvY, (u8 *) HVCFrame_ptr.pvU, (u8 *) HVCFrame_ptr.pvV, HVCFrame_ptr.frameInfo.nWidth, HVCFrame_ptr.frameInfo.nHeight, HVCFrame_ptr.frameInfo.nBitDepth, HVCFrame_ptr.frameInfo.nYPitch);
+ } else {
+ OpenHevc_Frame_cpy HVCFrame;
+ memset(&HVCFrame, 0, sizeof(OpenHevc_Frame_cpy) );
+
+ libOpenHevcGetPictureInfoCpy(ohevc, &HVCFrame.frameInfo);
+
+ if (!sdl_is_init && !no_display) {
+ sdl_init(HVCFrame.frameInfo.nWidth, HVCFrame.frameInfo.nHeight, HVCFrame.frameInfo.nBitDepth, HVCFrame.frameInfo.nYPitch, use_pbo);
+ sdl_is_init=1;
+ start = gf_sys_clock_high_res();
+ nb_frames_at_start = i+1;
+ }
+
+ HVCFrame.pvY = (void*) pY;
+ HVCFrame.pvU = (void*) pU;
+ HVCFrame.pvV = (void*) pV;
+
+ libOpenHevcGetOutputCpy(ohevc, 1, &HVCFrame);
+
+ sdl_draw_frame(pY, pU, pV, HVCFrame.frameInfo.nWidth, HVCFrame.frameInfo.nHeight, HVCFrame.frameInfo.nBitDepth, HVCFrame.frameInfo.nYPitch);
+ }
+ }
+
+ gf_isom_sample_del(&sample);
+
+ now = gf_sys_clock_high_res();
+ fprintf(stderr, "%d %% %d frames in %d ms - FPS %03.2f - push time "LLD" ms - draw "LLD" ms\r", 100*(i+1-nb_frames_at_start)/count, i+1-nb_frames_at_start, (now-start)/1000, 1000000.0 * (i+1-nb_frames_at_start) / (now-start), gl_upload_time / gl_nb_frames/1000 , (gl_draw_time - gl_upload_time) / gl_nb_frames/1000 );
+ } else {
+ gf_sleep(10);
+ i--;
+ }
+ check_prompt++;
+ if (check_prompt==50) {
+ if (gf_prompt_has_input()) {
+ switch (gf_prompt_get_char()) {
+ case 'q':
+ run = 0;
+ break;
+ case 'm':
+ use_raw_memory = !use_raw_memory;
+ break;
+ case 'p':
+ if (paused) {
+ paused=0;
+ start += gf_sys_clock_high_res()-pause_time;
+ } else {
+ paused = 1;
+ pause_time=gf_sys_clock_high_res();
+ }
+ break;
+ case 'r':
+ start = gf_sys_clock_high_res();
+ nb_frames_at_start = i+1;
+ gl_upload_time = gl_draw_time = 0;
+ gl_nb_frames=1;
+ break;
+
+ }
+ }
+ check_prompt=0;
+ }
+ }
+ now = gf_sys_clock_high_res();
+ fprintf(stderr, "\nDecoded %d frames in %d ms - FPS %g\n", i+1, (now-start)/1000, 1000000.0 * (i+1) / (now-start) );
+
+ libOpenHevcClose(ohevc);
+ gf_isom_close(isom);
+
+ if (!no_display)
+ sdl_close();
+
+ gf_sys_close();
+ return 1;
+}
+
diff --git a/applications/testapps/largefile/largefile.dsp b/applications/testapps/largefile/largefile.dsp
index 3a568ad..e6b0c21 100644
--- a/applications/testapps/largefile/largefile.dsp
+++ b/applications/testapps/largefile/largefile.dsp
@@ -1,102 +1,102 @@
-# Microsoft Developer Studio Project File - Name="largefile" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=largefile - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "largefile.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "largefile.mak" CFG="largefile - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "largefile - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "largefile - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "largefile - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x40c /d "NDEBUG"
-# ADD RSC /l 0x40c /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 winmm.lib /nologo /subsystem:console /machine:I386
-
-!ELSEIF "$(CFG)" == "largefile - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x40c /d "_DEBUG"
-# ADD RSC /l 0x40c /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 winmm.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-
-!ENDIF
-
-# Begin Target
-
-# Name "largefile - Win32 Release"
-# Name "largefile - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\main.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="largefile" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=largefile - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "largefile.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "largefile.mak" CFG="largefile - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "largefile - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "largefile - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "largefile - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 winmm.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "largefile - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x40c /d "_DEBUG"
+# ADD RSC /l 0x40c /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 winmm.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "largefile - Win32 Release"
+# Name "largefile - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\main.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/applications/testapps/largefile/largefile.dsw b/applications/testapps/largefile/largefile.dsw
index d1ebaae..12e531a 100644
--- a/applications/testapps/largefile/largefile.dsw
+++ b/applications/testapps/largefile/largefile.dsw
@@ -1,44 +1,44 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "largefile"=.\largefile.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name libgpac
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "libgpac"=..\..\..\build\msvc6\libgpac.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "largefile"=.\largefile.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libgpac
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "libgpac"=..\..\..\build\msvc6\libgpac.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/applications/testapps/loadcompare/LoadCompare.dsp b/applications/testapps/loadcompare/LoadCompare.dsp
index 033efac..5eed27f 100644
--- a/applications/testapps/loadcompare/LoadCompare.dsp
+++ b/applications/testapps/loadcompare/LoadCompare.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="LoadCompare" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=LoadCompare - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "LoadCompare.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "LoadCompare.mak" CFG="LoadCompare - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "LoadCompare - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "LoadCompare - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "LoadCompare - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "LoadCompare___Win32_Release"
-# PROP BASE Intermediate_Dir "LoadCompare___Win32_Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "obj/loadcompare_rel"
-# PROP Intermediate_Dir "obj/loadcompare_rel"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /I "../../../extra_lib/include/zlib" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FR /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x40c /d "NDEBUG"
-# ADD RSC /l 0x40c /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 zlib.lib winmm.lib libxml2.lib /nologo /subsystem:console /machine:I386 /out:"../../../bin/w32_rel/LoadCompare.exe" /libpath:"../../../extra_lib/lib/w32_rel"
-
-!ELSEIF "$(CFG)" == "LoadCompare - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "LoadCompare___Win32_Debug"
-# PROP BASE Intermediate_Dir "LoadCompare___Win32_Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "obj/loadcompare_deb"
-# PROP Intermediate_Dir "obj/loadcompare_deb"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../extra_lib/include/zlib" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
-# ADD BASE RSC /l 0x40c /d "_DEBUG"
-# ADD RSC /l 0x40c /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 zlib.lib winmm.lib libxml2.lib /nologo /subsystem:console /pdb:"obj/loadcompare_deb//LoadCompare.pdb" /debug /machine:I386 /out:"../../../bin/w32_deb/LoadCompare.exe" /pdbtype:sept /libpath:"../../../extra_lib/lib/w32_deb"
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF
-
-# Begin Target
-
-# Name "LoadCompare - Win32 Release"
-# Name "LoadCompare - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\loadcompare.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\modules\svg_loader\lsr_parser.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\modules\svg_loader\svg_parser.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="LoadCompare" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=LoadCompare - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "LoadCompare.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "LoadCompare.mak" CFG="LoadCompare - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "LoadCompare - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "LoadCompare - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "LoadCompare - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "LoadCompare___Win32_Release"
+# PROP BASE Intermediate_Dir "LoadCompare___Win32_Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "obj/loadcompare_rel"
+# PROP Intermediate_Dir "obj/loadcompare_rel"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /I "../../../extra_lib/include/zlib" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FR /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 zlib.lib winmm.lib libxml2.lib /nologo /subsystem:console /machine:I386 /out:"../../../bin/w32_rel/LoadCompare.exe" /libpath:"../../../extra_lib/lib/w32_rel"
+
+!ELSEIF "$(CFG)" == "LoadCompare - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "LoadCompare___Win32_Debug"
+# PROP BASE Intermediate_Dir "LoadCompare___Win32_Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "obj/loadcompare_deb"
+# PROP Intermediate_Dir "obj/loadcompare_deb"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../extra_lib/include/zlib" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
+# ADD BASE RSC /l 0x40c /d "_DEBUG"
+# ADD RSC /l 0x40c /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 zlib.lib winmm.lib libxml2.lib /nologo /subsystem:console /pdb:"obj/loadcompare_deb//LoadCompare.pdb" /debug /machine:I386 /out:"../../../bin/w32_deb/LoadCompare.exe" /pdbtype:sept /libpath:"../../../extra_lib/lib/w32_deb"
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "LoadCompare - Win32 Release"
+# Name "LoadCompare - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\loadcompare.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\modules\svg_loader\lsr_parser.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\modules\svg_loader\svg_parser.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/applications/testapps/loadcompare/loadcompare.c b/applications/testapps/loadcompare/loadcompare.c
index 8774281..54e2dec 100644
--- a/applications/testapps/loadcompare/loadcompare.c
+++ b/applications/testapps/loadcompare/loadcompare.c
@@ -382,14 +382,14 @@ GF_Err get_size(GF_LoadCompare *lc, char *item_name, char *item_path, u32 *size)
*size = 0;
- file = fopen(item_path, "rt");
+ file = gf_fopen(item_path, "rt");
if (!file) {
if (lc->verbose) fprintf(stdout, "Could not open file %s\n", item_path);
e = GF_IO_ERR;
} else {
fseek(file, 0, SEEK_END);
*size = (u32)ftell(file);
- fclose(file);
+ gf_fclose(file);
if (*size == 0) {
if (lc->verbose) fprintf(stdout, "File %s has a size of 0\n", item_path);
e = GF_IO_ERR;
@@ -436,19 +436,19 @@ GF_Err create_gz_file(GF_LoadCompare *lc, char *item_name, char *item_path, u32
strcpy(gz_path, item_name);
strcat(gz_path, "z");
gz = gzopen(gz_path, "wb");
- file = fopen(item_path, "rt");
+ file = gf_fopen(item_path, "rt");
if (!gz || !file) {
if (lc->verbose) fprintf(stdout, "Could not open file %s or %s\n", item_path, gz_path);
e = GF_IO_ERR;
} else {
while ((read = fread(buffer, 1, 100, file))) gzwrite(gz, buffer, read);
- fclose(file);
+ gf_fclose(file);
gzclose(gz);
- file = fopen(gz_path, "rb");
+ file = gf_fopen(gz_path, "rb");
fseek(file, 0, SEEK_END);
*size = (u32)ftell(file);
- fclose(file);
+ gf_fclose(file);
if (*size == 0) {
if (lc->verbose) fprintf(stdout, "File %s has a size of 0\n", gz_path);
e = GF_IO_ERR;
@@ -645,7 +645,7 @@ int main(int argc, char **argv)
}
gf_sys_init();
- if (out) lc.out = fopen(out, "wt");
+ if (out) lc.out = gf_fopen(out, "wt");
if (!lc.out) {
fprintf(stderr, "Cannot open output file %s\n", out);
return -1;
@@ -691,7 +691,7 @@ int main(int argc, char **argv)
}
gf_list_del(lc.data);
- if (lc.out) fclose(lc.out);
+ if (lc.out) gf_fclose(lc.out);
gf_sys_close();
return 0;
}
diff --git a/applications/testapps/mp42ts/mp42ts.vcproj b/applications/testapps/mp42ts/mp42ts.vcproj
index 31e13cb..0b2ab64 100644
--- a/applications/testapps/mp42ts/mp42ts.vcproj
+++ b/applications/testapps/mp42ts/mp42ts.vcproj
@@ -1,217 +1,217 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/applications/testapps/mpedemux/main.c b/applications/testapps/mpedemux/main.c
index f10076e..a3389d3 100644
--- a/applications/testapps/mpedemux/main.c
+++ b/applications/testapps/mpedemux/main.c
@@ -87,7 +87,7 @@ int main(int argc, char **argv)
mpedemux->ts_demux->on_event = mpedemux_on_event;
mpedemux->ts_demux->user = mpedemux;
- mpedemux->ts_file = fopen(argv[1], "rb");
+ mpedemux->ts_file = gf_fopen(argv[1], "rb");
while (1) {
/*read chunks by chunks*/
diff --git a/applications/testapps/mpedemux/mpedemux.dsp b/applications/testapps/mpedemux/mpedemux.dsp
index b4f3317..5aae5e6 100644
--- a/applications/testapps/mpedemux/mpedemux.dsp
+++ b/applications/testapps/mpedemux/mpedemux.dsp
@@ -1,90 +1,90 @@
-# Microsoft Developer Studio Project File - Name="mpedemux" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=mpedemux - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "mpedemux.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "mpedemux.mak" CFG="mpedemux - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "mpedemux - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "mpedemux - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "mpedemux - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x40c /d "NDEBUG"
-# ADD RSC /l 0x40c /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 zlib.lib winmm.lib ws2_32.lib js32.lib /nologo /subsystem:console /machine:I386 /out:"../../../bin/w32_rel/mpedemux.exe" /libpath:"../../../extra_lib/lib/w32_rel"
-
-!ELSEIF "$(CFG)" == "mpedemux - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
-# ADD BASE RSC /l 0x40c /d "_DEBUG"
-# ADD RSC /l 0x40c /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 zlib.lib winmm.lib ws2_32.lib js32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../../../bin/w32_deb/mpedemux.exe" /pdbtype:sept /libpath:"../../../extra_lib/lib/w32_deb"
-
-!ENDIF
-
-# Begin Target
-
-# Name "mpedemux - Win32 Release"
-# Name "mpedemux - Win32 Debug"
-# Begin Source File
-
-SOURCE=.\main.c
-# End Source File
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="mpedemux" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=mpedemux - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "mpedemux.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "mpedemux.mak" CFG="mpedemux - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "mpedemux - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "mpedemux - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "mpedemux - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 zlib.lib winmm.lib ws2_32.lib js32.lib /nologo /subsystem:console /machine:I386 /out:"../../../bin/w32_rel/mpedemux.exe" /libpath:"../../../extra_lib/lib/w32_rel"
+
+!ELSEIF "$(CFG)" == "mpedemux - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
+# ADD BASE RSC /l 0x40c /d "_DEBUG"
+# ADD RSC /l 0x40c /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 zlib.lib winmm.lib ws2_32.lib js32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../../../bin/w32_deb/mpedemux.exe" /pdbtype:sept /libpath:"../../../extra_lib/lib/w32_deb"
+
+!ENDIF
+
+# Begin Target
+
+# Name "mpedemux - Win32 Release"
+# Name "mpedemux - Win32 Debug"
+# Begin Source File
+
+SOURCE=.\main.c
+# End Source File
+# End Target
+# End Project
diff --git a/applications/testapps/mpeg2ts/main.c b/applications/testapps/mpeg2ts/main.c
index 0d27634..a9f3a84 100644
--- a/applications/testapps/mpeg2ts/main.c
+++ b/applications/testapps/mpeg2ts/main.c
@@ -46,7 +46,7 @@ int main(int argc, char **argv)
u32 size, fsize, fdone;
GF_M2TS_Demuxer *ts;
- FILE *src = fopen(argv[1], "rb");
+ FILE *src = gf_fopen(argv[1], "rb");
ts = gf_m2ts_demux_new();
ts->on_event = on_m2ts_event;
@@ -63,9 +63,9 @@ int main(int argc, char **argv)
if (has_seen_pat) break;
}
- dest = fopen("pes.mp3", "wb");
+ dest = gf_fopen("pes.mp3", "wb");
gf_m2ts_reset_parsers(ts);
- gf_f64_seek(src, 0, SEEK_SET);
+ gf_fseek(src, 0, SEEK_SET);
fdone = 0;
while (!feof(src)) {
size = fread(data, 1, 188, src);
@@ -78,9 +78,9 @@ int main(int argc, char **argv)
}
gf_set_progress("MPEG-2 TS Parsing", fsize, fsize);
- fclose(src);
+ gf_fclose(src);
gf_m2ts_demux_del(ts);
- if (dest) fclose(dest);
+ if (dest) gf_fclose(dest);
return 0;
}
diff --git a/applications/testapps/mpeg2ts/mpeg2ts.dsp b/applications/testapps/mpeg2ts/mpeg2ts.dsp
index 37052e4..656390f 100644
--- a/applications/testapps/mpeg2ts/mpeg2ts.dsp
+++ b/applications/testapps/mpeg2ts/mpeg2ts.dsp
@@ -1,100 +1,100 @@
-# Microsoft Developer Studio Project File - Name="mpeg2ts" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=mpeg2ts - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "mpeg2ts.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "mpeg2ts.mak" CFG="mpeg2ts - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "mpeg2ts - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "mpeg2ts - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "mpeg2ts - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x40c /d "NDEBUG"
-# ADD RSC /l 0x40c /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-
-!ELSEIF "$(CFG)" == "mpeg2ts - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x40c /d "_DEBUG"
-# ADD RSC /l 0x40c /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 zlib.lib winmm.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-
-!ENDIF
-
-# Begin Target
-
-# Name "mpeg2ts - Win32 Release"
-# Name "mpeg2ts - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\main.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="mpeg2ts" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=mpeg2ts - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "mpeg2ts.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "mpeg2ts.mak" CFG="mpeg2ts - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "mpeg2ts - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "mpeg2ts - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "mpeg2ts - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "mpeg2ts - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x40c /d "_DEBUG"
+# ADD RSC /l 0x40c /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 zlib.lib winmm.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "mpeg2ts - Win32 Release"
+# Name "mpeg2ts - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\main.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/applications/testapps/segmp4demux/build.sh b/applications/testapps/segmp4demux/build.sh
index 36dab12..d1dd330 100644
--- a/applications/testapps/segmp4demux/build.sh
+++ b/applications/testapps/segmp4demux/build.sh
@@ -1,2 +1,2 @@
#!/bin/sh
-gcc -o fmp4demux main.c ../../../src/utils/os_config_init.c ../../../src/utils/os_divers.c ../../../src/utils/os_thread.c ../../../src/utils/alloc.c ../../../src/utils/bitstream.c ../../../src/utils/configfile.c ../../../src/odf/desc_private.c ../../../src/odf/descriptors.c ../../../src/utils/error.c ../../../src/utils/list.c ../../../src/odf/odf_code.c ../../../src/odf/odf_codec.c ../../../src/odf/odf_command.c ../../../src/odf/odf_parse.c ../../../src/odf/slc.c ../../../src/utils/url.c ../../../src/media_tools/webvtt.c ../../../src/isomedia/avc_ext.c ../../../src/isomedia/box_code_3gpp.c ../../../src/isomedia/box_code_adobe.c ../../../src/isomedia/box_code_apple.c ../../../src/isomedia/box_code_base.c ../../../src/isomedia/box_code_drm.c ../../../src/isomedia/box_code_meta.c ../../../src/isomedia/box_funcs.c ../../../src/isomedia/data_map.c ../../../src/isomedia/drm_sample.c ../../../src/isomedia/isom_intern.c ../../../src/isomedia/isom_read.c ../../../src/isomedia/isom_store.c ../../../src/isomedia/isom_write.c ../../../src/isomedia/media.c ../../../src/isomedia/media_odf.c ../../../src/isomedia/meta.c ../../../src/isomedia/movie_fragments.c ../../../src/isomedia/sample_descs.c ../../../src/isomedia/stbl_read.c ../../../src/isomedia/stbl_write.c ../../../src/isomedia/track.c ../../../src/isomedia/tx3g.c -L../../../bin/gcc -lpthread -ldl -I../../../include -DGPAC_MINIMAL_ODF -DGPAC_DISABLE_AV_PARSERS -DGPAC_DISABLE_ISOM_DUMP -DGPAC_DISABLE_ZLIB
+gcc -o fmp4demux main.c ../../../src/utils/os_config_init.c ../../../src/utils/os_divers.c ../../../src/utils/os_file.c ../../../src/utils/os_thread.c ../../../src/utils/alloc.c ../../../src/utils/bitstream.c ../../../src/utils/configfile.c ../../../src/odf/desc_private.c ../../../src/odf/descriptors.c ../../../src/utils/error.c ../../../src/utils/list.c ../../../src/odf/odf_code.c ../../../src/odf/odf_codec.c ../../../src/odf/odf_command.c ../../../src/odf/odf_parse.c ../../../src/odf/slc.c ../../../src/utils/url.c ../../../src/media_tools/webvtt.c ../../../src/isomedia/avc_ext.c ../../../src/isomedia/box_code_3gpp.c ../../../src/isomedia/box_code_adobe.c ../../../src/isomedia/box_code_apple.c ../../../src/isomedia/box_code_base.c ../../../src/isomedia/box_code_drm.c ../../../src/isomedia/box_code_meta.c ../../../src/isomedia/box_funcs.c ../../../src/isomedia/data_map.c ../../../src/isomedia/drm_sample.c ../../../src/isomedia/isom_intern.c ../../../src/isomedia/isom_read.c ../../../src/isomedia/isom_store.c ../../../src/isomedia/isom_write.c ../../../src/isomedia/media.c ../../../src/isomedia/media_odf.c ../../../src/isomedia/meta.c ../../../src/isomedia/movie_fragments.c ../../../src/isomedia/sample_descs.c ../../../src/isomedia/stbl_read.c ../../../src/isomedia/stbl_write.c ../../../src/isomedia/track.c ../../../src/isomedia/tx3g.c -L../../../bin/gcc -lpthread -ldl -I../../../include -DGPAC_MINIMAL_ODF -DGPAC_DISABLE_AV_PARSERS -DGPAC_DISABLE_ISOM_DUMP -DGPAC_DISABLE_ZLIB
diff --git a/applications/testapps/segmp4demux/segmp4demux.sln b/applications/testapps/segmp4demux/segmp4demux.sln
index 8430f20..ca63192 100644
--- a/applications/testapps/segmp4demux/segmp4demux.sln
+++ b/applications/testapps/segmp4demux/segmp4demux.sln
@@ -1,20 +1,20 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "segmp4demux", "segmp4demux.vcxproj", "{978A2D9F-E44F-4073-8032-333563BCC160}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {978A2D9F-E44F-4073-8032-333563BCC160}.Debug|Win32.ActiveCfg = Debug|Win32
- {978A2D9F-E44F-4073-8032-333563BCC160}.Debug|Win32.Build.0 = Debug|Win32
- {978A2D9F-E44F-4073-8032-333563BCC160}.Release|Win32.ActiveCfg = Release|Win32
- {978A2D9F-E44F-4073-8032-333563BCC160}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "segmp4demux", "segmp4demux.vcxproj", "{978A2D9F-E44F-4073-8032-333563BCC160}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {978A2D9F-E44F-4073-8032-333563BCC160}.Debug|Win32.ActiveCfg = Debug|Win32
+ {978A2D9F-E44F-4073-8032-333563BCC160}.Debug|Win32.Build.0 = Debug|Win32
+ {978A2D9F-E44F-4073-8032-333563BCC160}.Release|Win32.ActiveCfg = Release|Win32
+ {978A2D9F-E44F-4073-8032-333563BCC160}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/applications/testapps/segmp4demux/segmp4demux.vcxproj b/applications/testapps/segmp4demux/segmp4demux.vcxproj
index aba1919..94ff320 100644
--- a/applications/testapps/segmp4demux/segmp4demux.vcxproj
+++ b/applications/testapps/segmp4demux/segmp4demux.vcxproj
@@ -1,190 +1,191 @@
-
-
-
-
- Debug
- Win32
-
-
- Release
- Win32
-
-
-
-
- GPAC_MINIMAL_ODF;GPAC_DISABLE_AV_PARSERS;GPAC_DISABLE_ISOM_DUMP;GPAC_DISABLE_ZILB;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {978A2D9F-E44F-4073-8032-333563BCC160}
- segmp4demux
-
-
-
- Application
- v110
- false
- MultiByte
-
-
- Application
- v110
- false
- MultiByte
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <_ProjectFileVersion>11.0.60610.1
-
-
- ../../../bin/$(Platform)\$(Configuration)/
- obj\$(Platform)\$(Configuration)\$(ProjectName)\
- true
- AllRules.ruleset
-
-
-
-
- ../../../bin/$(Platform)\$(Configuration)/
- obj\$(Platform)\$(Configuration)\$(ProjectName)\
- false
- AllRules.ruleset
-
-
-
-
-
- .\Debug/segmp4demux.tlb
-
-
-
- Disabled
- ../../../include;%(AdditionalIncludeDirectories)
- GPAC_DISABLE_MEDIA_IMPORT;GPAC_DISABLE_ISOM_HINTING;GPAC_MINIMAL_ODF;GPAC_DISABLE_AV_PARSERS;GPAC_DISABLE_ISOM_DUMP;GPAC_DISABLE_ZLIB;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
- true
- EnableFastChecks
- MultiThreadedDebugDLL
-
-
- $(IntDir)
- $(IntDir)
- $(IntDir)
- true
- Level3
- true
- EditAndContinue
-
-
-
-
- _DEBUG;%(PreprocessorDefinitions)
- 0x040c
-
-
- %(AdditionalDependencies)
- $(OutDir)$(TargetName)$(TargetExt)
- true
- $(OutDir);../../../extra_lib/lib/$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)
- true
- $(IntDir)$(ProjectName).pdb
- Console
- MachineX86
-
-
- true
- .\Debug/segmp4demux.bsc
-
-
-
-
- .\Release/segmp4demux.tlb
-
-
-
- MaxSpeed
- OnlyExplicitInline
- ../../../include;%(AdditionalIncludeDirectories)
- GPAC_DISABLE_MEDIA_IMPORT;GPAC_DISABLE_CORE_TOOLS;GPAC_DISABLE_ISOM_HINTING;GPAC_MINIMAL_ODF;GPAC_DISABLE_AV_PARSERS;GPAC_DISABLE_ISOM_DUMP;GPAC_DISABLE_ZILB;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
- true
- MultiThreadedDLL
- true
- .\Release/segmp4demux.pch
- .\Release/
- .\Release/
- .\Release/
- Level3
- true
-
-
- NDEBUG;%(PreprocessorDefinitions)
- 0x040c
-
-
- %(AdditionalDependencies)
- $(OutDir)$(TargetName)$(TargetExt)
- true
- ../../../extra_lib/lib/w32_rel;%(AdditionalLibraryDirectories)
- .\Release/segmp4demux.pdb
- Console
- MachineX86
-
-
- true
- .\Release/segmp4demux.bsc
-
-
-
-
-
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+
+
+ GPAC_MINIMAL_ODF;GPAC_DISABLE_AV_PARSERS;GPAC_DISABLE_ISOM_DUMP;GPAC_DISABLE_ZILB;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {365CEAE9-305B-43C9-B531-904E500F0809}
+ segmp4demux
+
+
+
+ Application
+ v110
+ false
+ MultiByte
+
+
+ Application
+ v100
+ false
+ MultiByte
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <_ProjectFileVersion>11.0.60610.1
+
+
+ ../../../bin/$(Platform)\$(Configuration)/
+ obj\$(Platform)\$(Configuration)\$(ProjectName)\
+ true
+ AllRules.ruleset
+
+
+
+
+ ../../../bin/$(Platform)\$(Configuration)/
+ obj\$(Platform)\$(Configuration)\$(ProjectName)\
+ false
+ AllRules.ruleset
+
+
+
+
+
+ .\Debug/segmp4demux.tlb
+
+
+
+ Disabled
+ ../../../include;%(AdditionalIncludeDirectories)
+ GPAC_DISABLE_MEDIA_IMPORT;GPAC_DISABLE_ISOM_HINTING;GPAC_MINIMAL_ODF;GPAC_DISABLE_AV_PARSERS;GPAC_DISABLE_ISOM_DUMP;GPAC_DISABLE_ZLIB;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
+ true
+ EnableFastChecks
+ MultiThreadedDebugDLL
+
+
+ $(IntDir)
+ $(IntDir)
+ $(IntDir)
+ true
+ Level3
+ true
+ EditAndContinue
+
+
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ 0x040c
+
+
+ %(AdditionalDependencies)
+ $(OutDir)$(TargetName)$(TargetExt)
+ true
+ $(OutDir);../../../extra_lib/lib/$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)
+ true
+ $(IntDir)$(ProjectName).pdb
+ Console
+ MachineX86
+
+
+ true
+ .\Debug/segmp4demux.bsc
+
+
+
+
+ .\Release/segmp4demux.tlb
+
+
+
+ MaxSpeed
+ OnlyExplicitInline
+ ../../../include;%(AdditionalIncludeDirectories)
+ GPAC_DISABLE_MEDIA_IMPORT;GPAC_DISABLE_CORE_TOOLS;GPAC_DISABLE_ISOM_HINTING;GPAC_MINIMAL_ODF;GPAC_DISABLE_AV_PARSERS;GPAC_DISABLE_ISOM_DUMP;GPAC_DISABLE_ZILB;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
+ true
+ MultiThreadedDLL
+ true
+ .\Release/segmp4demux.pch
+ .\Release/
+ .\Release/
+ .\Release/
+ Level3
+ true
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ 0x040c
+
+
+ %(AdditionalDependencies)
+ $(OutDir)$(TargetName)$(TargetExt)
+ true
+ ../../../extra_lib/lib/w32_rel;%(AdditionalLibraryDirectories)
+ .\Release/segmp4demux.pdb
+ Console
+ MachineX86
+
+
+ true
+ .\Release/segmp4demux.bsc
+
+
+
+
+
\ No newline at end of file
diff --git a/applications/testapps/segmp4demux/segmp4demux.vcxproj.filters b/applications/testapps/segmp4demux/segmp4demux.vcxproj.filters
index 3f80c02..4a097c1 100644
--- a/applications/testapps/segmp4demux/segmp4demux.vcxproj.filters
+++ b/applications/testapps/segmp4demux/segmp4demux.vcxproj.filters
@@ -1,134 +1,137 @@
-
-
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- isoff
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
- others
-
-
- isoff
-
-
-
-
- {c9a8f639-328c-4505-be50-4859357c2c00}
-
-
- {e5ca7285-ca00-49d8-ac81-dff3d494be9a}
-
-
+
+
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ isoff
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ others
+
+
+ isoff
+
+
+ others
+
+
+
+
+ {c9a8f639-328c-4505-be50-4859357c2c00}
+
+
+ {e5ca7285-ca00-49d8-ac81-dff3d494be9a}
+
+
\ No newline at end of file
diff --git a/applications/testapps/svg2bifs/svg2bifs.dsp b/applications/testapps/svg2bifs/svg2bifs.dsp
index 335a2ce..066739a 100644
--- a/applications/testapps/svg2bifs/svg2bifs.dsp
+++ b/applications/testapps/svg2bifs/svg2bifs.dsp
@@ -1,90 +1,90 @@
-# Microsoft Developer Studio Project File - Name="svg2bifs" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=svg2bifs - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "svg2bifs.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "svg2bifs.mak" CFG="svg2bifs - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "svg2bifs - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "svg2bifs - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "svg2bifs - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x40c /d "NDEBUG"
-# ADD RSC /l 0x40c /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 /nologo /subsystem:console /machine:I386 /out:"../../../bin/w32_rel/svg2bifs.exe" /libpath:"../../../extra_lib/lib/w32_rel"
-
-!ELSEIF "$(CFG)" == "svg2bifs - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x40c /d "_DEBUG"
-# ADD RSC /l 0x40c /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /out:"../../../bin/w32_deb/svg2bifs.exe" /pdbtype:sept /libpath:"../../../extra_lib/lib/w32_deb"
-
-!ENDIF
-
-# Begin Target
-
-# Name "svg2bifs - Win32 Release"
-# Name "svg2bifs - Win32 Debug"
-# Begin Source File
-
-SOURCE=.\main.c
-# End Source File
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="svg2bifs" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=svg2bifs - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "svg2bifs.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "svg2bifs.mak" CFG="svg2bifs - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "svg2bifs - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "svg2bifs - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "svg2bifs - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 /nologo /subsystem:console /machine:I386 /out:"../../../bin/w32_rel/svg2bifs.exe" /libpath:"../../../extra_lib/lib/w32_rel"
+
+!ELSEIF "$(CFG)" == "svg2bifs - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x40c /d "_DEBUG"
+# ADD RSC /l 0x40c /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /out:"../../../bin/w32_deb/svg2bifs.exe" /pdbtype:sept /libpath:"../../../extra_lib/lib/w32_deb"
+
+!ENDIF
+
+# Begin Target
+
+# Name "svg2bifs - Win32 Release"
+# Name "svg2bifs - Win32 Debug"
+# Begin Source File
+
+SOURCE=.\main.c
+# End Source File
+# End Target
+# End Project
diff --git a/applications/ts2hds/f4m.c b/applications/ts2hds/f4m.c
index 74f9603..0a51ba1 100644
--- a/applications/ts2hds/f4m.c
+++ b/applications/ts2hds/f4m.c
@@ -70,7 +70,7 @@ AdobeMultirate *adobe_alloc_multirate_manifest(char *id)
am->base_url = "http://localhost/hds/tmp";
am->id = id;
sprintf(filename, "%s.f4m", am->id);
- am->f = fopen(filename, "wt");
+ am->f = gf_fopen(filename, "wt");
if (!am->f) {
fprintf(stderr, "Couldn't create Adobe multirate manifest file: %s\n", filename);
assert(0);
@@ -85,7 +85,7 @@ AdobeMultirate *adobe_alloc_multirate_manifest(char *id)
as->id = "HD";
as->bitrate = 100;
sprintf(filename, "%s_%s_%d.f4m", am->id, as->id, as->bitrate);
- as->f = fopen(filename, "wt");
+ as->f = gf_fopen(filename, "wt");
if (!as->f) {
fprintf(stderr, "Couldn't create Adobe stream manifest file: %s\n", filename);
assert(0);
@@ -105,13 +105,13 @@ void adobe_free_multirate_manifest(AdobeMultirate *am)
u32 i;
if (am->f)
- fclose(am->f);
+ gf_fclose(am->f);
for (i=0; istreams); i++) {
AdobeStream *as = gf_list_get(am->streams, i);
assert(as);
if (as->f)
- fclose(as->f);
+ gf_fclose(as->f);
//TODO: base_url and id may be stored as gf_strdup in the future
gf_list_rem(am->streams, i);
gf_free(as);
@@ -154,9 +154,9 @@ GF_Err adobe_gen_multirate_manifest(AdobeMultirate* am, char *bootstrap, size_t
char filename[GF_MAX_PATH];
FILE *bstfile;
sprintf(filename, "%s_%d.bootstrap", as->id, as->bitrate);
- bstfile = fopen(filename, "wb");
+ bstfile = gf_fopen(filename, "wb");
gf_fwrite(bootstrap, bootstrap_size, 1, bstfile);
- fclose(bstfile);
+ gf_fclose(bstfile);
}
#endif
e = adobe_gen_stream_manifest(as);
diff --git a/applications/ts2hds/main.c b/applications/ts2hds/main.c
index 0932fb3..6a707c8 100644
--- a/applications/ts2hds/main.c
+++ b/applications/ts2hds/main.c
@@ -51,7 +51,7 @@ static GFINLINE void usage(const char * progname)
#ifdef GPAC_MEMORY_TRACKING
"\t-mem-track: enables memory tracker\n"
#endif
- );
+ , progname);
}
@@ -118,7 +118,7 @@ int main(int argc, char **argv)
/* declarations */
/********************/
char *input, *output, tmpstr[GF_MAX_PATH];
- GF_ISOFile *isom_file_in, *isom_file_out;
+ GF_ISOFile *isom_file_in;
GF_MediaImporter import;
AdobeHDSCtx ctx;
GF_Err e;
@@ -136,7 +136,6 @@ int main(int argc, char **argv)
input = NULL;
output = NULL;
isom_file_in = NULL;
- isom_file_out = NULL;
memset(&import, 0, sizeof(GF_MediaImporter));
e = GF_OK;
memset(&ctx, 0, sizeof(ctx));
@@ -160,16 +159,16 @@ int main(int argc, char **argv)
u32 metamoov64_len;
unsigned char metamoov[GF_MAX_PATH];
u32 metamoov_len=GF_MAX_PATH;
- FILE *f = fopen("metamoov64"/*input*/, "rt");
- gf_f64_seek(f, 0, SEEK_END);
- metamoov64_len = (u32)gf_f64_tell(f);
- gf_f64_seek(f, 0, SEEK_SET);
+ FILE *f = gf_fopen("metamoov64"/*input*/, "rt");
+ gf_fseek(f, 0, SEEK_END);
+ metamoov64_len = (u32)gf_ftell(f);
+ gf_fseek(f, 0, SEEK_SET);
fread(metamoov64, metamoov64_len, 1, f);
metamoov_len = gf_base64_decode(metamoov64, metamoov64_len, metamoov, metamoov_len);
- fclose(f);
- f = fopen("metamoov", "wb");
+ gf_fclose(f);
+ f = gf_fopen("metamoov", "wb");
fwrite(metamoov, metamoov_len, 1, f);
- fclose(f);
+ gf_fclose(f);
return 0;
}
#endif
@@ -183,17 +182,17 @@ int main(int argc, char **argv)
GF_AdobeBootstrapInfoBox *abst = (GF_AdobeBootstrapInfoBox *)abst_New();
GF_BitStream *bs;
#if 1 //64
- FILE *f = fopen("bootstrap64"/*input*/, "rt");
- gf_f64_seek(f, 0, SEEK_END);
- bootstrap64_len = (u32)gf_f64_tell(f);
- gf_f64_seek(f, 0, SEEK_SET);
+ FILE *f = gf_fopen("bootstrap64"/*input*/, "rt");
+ gf_fseek(f, 0, SEEK_END);
+ bootstrap64_len = (u32)gf_ftell(f);
+ gf_fseek(f, 0, SEEK_SET);
fread(bootstrap64, bootstrap64_len, 1, f);
bootstrap_len = gf_base64_decode(bootstrap64, bootstrap64_len, bootstrap, bootstrap_len);
#else //binary bootstrap
- FILE *f = fopen("bootstrap.bin"/*input*/, "rb");
- gf_f64_seek(f, 0, SEEK_END);
- bootstrap_len = (u32)gf_f64_tell(f);
- gf_f64_seek(f, 0, SEEK_SET);
+ FILE *f = gf_fopen("bootstrap.bin"/*input*/, "rb");
+ gf_fseek(f, 0, SEEK_END);
+ bootstrap_len = (u32)gf_ftell(f);
+ gf_fseek(f, 0, SEEK_SET);
fread(bootstrap, bootstrap_len, 1, f);
#endif
bs = gf_bs_new(bootstrap+8, bootstrap_len-8, GF_BITSTREAM_READ);
@@ -207,13 +206,13 @@ int main(int argc, char **argv)
abst_Write((GF_Box*)abst, bs);
bootstrap_len = (u32)gf_bs_get_position(bs);
gf_bs_del(bs);
- fclose(f);
- f = fopen("bootstrap", "wt");
+ gf_fclose(f);
+ f = gf_fopen("bootstrap", "wt");
bootstrap64_len = gf_base64_encode(bootstrap, bootstrap_len, bootstrap64, GF_MAX_PATH);
fwrite(bootstrap64, bootstrap64_len, 1, f);
fprintf(f, "\n\n");
abst_dump((GF_Box*)abst, f);
- fclose(f);
+ gf_fclose(f);
abst_del((GF_Box*)abst);
return 0;
}
diff --git a/applications/udptsseg/main.c b/applications/udptsseg/main.c
index 3163737..5f41603 100644
--- a/applications/udptsseg/main.c
+++ b/applications/udptsseg/main.c
@@ -47,7 +47,7 @@ static GF_Err write_manifest(char *manifest, char *segment_dir, u32 segment_dura
sprintf(manifest_name, "%s", manifest);
}
- manifest_fp = fopen(tmp_manifest, "w");
+ manifest_fp = gf_fopen(tmp_manifest, "w");
if (!manifest_fp) {
fprintf(stderr, "Could not create m3u8 manifest file (%s)\n", tmp_manifest);
return GF_BAD_PARAM;
@@ -62,7 +62,7 @@ static GF_Err write_manifest(char *manifest, char *segment_dir, u32 segment_dura
if (end) {
fprintf(manifest_fp, "#EXT-X-ENDLIST\n");
}
- fclose(manifest_fp);
+ gf_fclose(manifest_fp);
if (!rename(tmp_manifest, manifest_name)) {
return GF_OK;
@@ -213,7 +213,7 @@ int main(int argc, char **argv)
}
//write_manifest(segment_manifest, segment_dir, segment_duration, segment_prefix, segment_http_prefix, segment_index, 0, 0);
}
- ts_output_file = fopen(ts_out, "wb");
+ ts_output_file = gf_fopen(ts_out, "wb");
if (!ts_output_file) {
fprintf(stderr, "Error opening %s\n", ts_out);
goto exit;
@@ -265,7 +265,7 @@ int main(int argc, char **argv)
}
if ((now - last_segment_time) > segment_duration*1000) {
last_segment_time = now;
- fclose(ts_output_file);
+ gf_fclose(ts_output_file);
fprintf(stderr, "Closing segment %s (%d bytes)\n", segment_name, last_segment_size);
last_segment_size = 0;
segment_index++;
@@ -278,7 +278,7 @@ int main(int argc, char **argv)
} else {
sprintf(segment_name, "%s_%d.ts", segment_prefix, segment_index);
}
- ts_output_file = fopen(segment_name, "wb");
+ ts_output_file = gf_fopen(segment_name, "wb");
if (!ts_output_file) {
fprintf(stderr, "Error opening segment %s\n", segment_name);
goto exit;
diff --git a/applications/udptsseg/udptsseg.dsp b/applications/udptsseg/udptsseg.dsp
index 5b39e61..008363c 100644
--- a/applications/udptsseg/udptsseg.dsp
+++ b/applications/udptsseg/udptsseg.dsp
@@ -1,94 +1,94 @@
-# Microsoft Developer Studio Project File - Name="udptsseg" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=udptsseg - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "udptsseg.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "udptsseg.mak" CFG="udptsseg - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "udptsseg - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "udptsseg - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "udptsseg - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x40c /d "NDEBUG"
-# ADD RSC /l 0x40c /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 /nologo /subsystem:console /machine:I386 /out:"../../../bin/w32_rel/udptsseg.exe" /libpath:"../../../extra_lib/lib/w32_rel"
-
-!ELSEIF "$(CFG)" == "udptsseg - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
-# ADD BASE RSC /l 0x40c /d "_DEBUG"
-# ADD RSC /l 0x40c /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /out:"../../../bin/w32_deb/udptsseg.exe" /pdbtype:sept /libpath:"../../../extra_lib/lib/w32_deb"
-# SUBTRACT LINK32 /nodefaultlib
-
-!ENDIF
-
-# Begin Target
-
-# Name "udptsseg - Win32 Release"
-# Name "udptsseg - Win32 Debug"
-# Begin Source File
-
-SOURCE=.\main.c
-# End Source File
-# Begin Source File
-
-# End Source File
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="udptsseg" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=udptsseg - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "udptsseg.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "udptsseg.mak" CFG="udptsseg - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "udptsseg - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "udptsseg - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "udptsseg - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 /nologo /subsystem:console /machine:I386 /out:"../../../bin/w32_rel/udptsseg.exe" /libpath:"../../../extra_lib/lib/w32_rel"
+
+!ELSEIF "$(CFG)" == "udptsseg - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
+# ADD BASE RSC /l 0x40c /d "_DEBUG"
+# ADD RSC /l 0x40c /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /out:"../../../bin/w32_deb/udptsseg.exe" /pdbtype:sept /libpath:"../../../extra_lib/lib/w32_deb"
+# SUBTRACT LINK32 /nodefaultlib
+
+!ENDIF
+
+# Begin Target
+
+# Name "udptsseg - Win32 Release"
+# Name "udptsseg - Win32 Debug"
+# Begin Source File
+
+SOURCE=.\main.c
+# End Source File
+# Begin Source File
+
+# End Source File
+# End Target
+# End Project
diff --git a/applications/udptsseg/udptsseg.vcproj b/applications/udptsseg/udptsseg.vcproj
index 903fc49..8d40855 100644
--- a/applications/udptsseg/udptsseg.vcproj
+++ b/applications/udptsseg/udptsseg.vcproj
@@ -1,213 +1,213 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bin/smartphone 2003 (armv4)/release/install/archive.bat b/bin/smartphone 2003 (armv4)/release/install/archive.bat
index 7ec194b..d8b2c8d 100644
--- a/bin/smartphone 2003 (armv4)/release/install/archive.bat
+++ b/bin/smartphone 2003 (armv4)/release/install/archive.bat
@@ -1,9 +1,16 @@
-set OLDDIR=%CD%
-cd /d %~dp0
-
-for /f "delims=" %%a in ('svnversion ') do set gpac_revision=%%a
-set gpac_version="0.5.1-DEV-r%gpac_revision%"
-
-zip "GPAC_%gpac_version%_WindowsMobile.zip" ../*.dll ../*.exe ../*.plg
-
-cd /d %OLDDIR%
+set OLDDIR=%CD%
+cd /d %~dp0
+
+for /f "delims=" %%a in ('git describe --tags --long') do @set VERSION=%%a
+for /f "delims=" %%a in ('git describe --tags --abbrev=0') do @set TAG=%%a-
+for /f "delims=" %%a in ('git rev-parse --abbrev-ref HEAD') do @set BRANCH=%%a
+REM remove anotated tag from VERSION
+setlocal enabledelayedexpansion
+call set VERSION=%%VERSION:!TAG!=%%
+setlocal disabledelayedexpansion
+set revision="%VERSION%-%BRANCH%"
+set gpac_version="0.5.2-DEV-r%gpac_revision%"
+
+zip "GPAC_%gpac_version%_WindowsMobile.zip" ../*.dll ../*.exe ../*.plg
+
+cd /d %OLDDIR%
diff --git a/bin/smartphone 2003 (armv4)/release/install/build_installer.bat b/bin/smartphone 2003 (armv4)/release/install/build_installer.bat
index ad3dcad..368a708 100644
--- a/bin/smartphone 2003 (armv4)/release/install/build_installer.bat
+++ b/bin/smartphone 2003 (armv4)/release/install/build_installer.bat
@@ -1,35 +1,42 @@
-set OLDDIR=%CD%
-cd /d %~dp0
-
-for /f "delims=" %%a in ('svnversion') do set gpac_revision=%%a
-
-set gpac_version="0.5.1-DEV-r%gpac_revision%"
-
-ECHO [Version] > gpaccab.inf
-ECHO Provider = "GPAC %gpac_version%" >> gpaccab.inf
-type gpac.inf >> gpaccab.inf
-
-CabWiz gpaccab.inf
-
-ECHO off
-
-ECHO [CEAppManager]> gpac.ini
-ECHO Version = %gpac_version%>> gpac.ini
-ECHO Component = GPAC for Windows Mobile>> gpac.ini
-ECHO [GPAC for Windows Mobile]>> gpac.ini
-ECHO Description = GPAC MPEG-4 Player>> gpac.ini
-ECHO Uninstall = GPAC Osmophone>> gpac.ini
-ECHO IconFile = ..\..\..\..\doc\osmo4.ico>> gpac.ini
-ECHO IconIndex = 0 >> gpac.ini
-ECHO CabFiles = gpaccab.cab >> gpac.ini
-
-ECHO on
-
-ezsetup -l english -i gpac.ini -r readme.txt -e ../../../../COPYING -o gpac.exe
-rename gpac.exe "GPAC_%gpac_version%_WindowsMobile.exe"
-DEL gpaccab.cab
-DEL gpaccab.inf
-DEL gpac.ini
-DEL *.tmp
-
-cd /d %OLDDIR%
+set OLDDIR=%CD%
+cd /d %~dp0
+
+for /f "delims=" %%a in ('git describe --tags --long') do @set VERSION=%%a
+for /f "delims=" %%a in ('git describe --tags --abbrev=0') do @set TAG=%%a-
+for /f "delims=" %%a in ('git rev-parse --abbrev-ref HEAD') do @set BRANCH=%%a
+REM remove anotated tag from VERSION
+setlocal enabledelayedexpansion
+call set VERSION=%%VERSION:!TAG!=%%
+setlocal disabledelayedexpansion
+set revision="%VERSION%-%BRANCH%"
+
+set gpac_version="0.5.2-DEV-r%gpac_revision%"
+
+ECHO [Version] > gpaccab.inf
+ECHO Provider = "GPAC %gpac_version%" >> gpaccab.inf
+type gpac.inf >> gpaccab.inf
+
+CabWiz gpaccab.inf
+
+ECHO off
+
+ECHO [CEAppManager]> gpac.ini
+ECHO Version = %gpac_version%>> gpac.ini
+ECHO Component = GPAC for Windows Mobile>> gpac.ini
+ECHO [GPAC for Windows Mobile]>> gpac.ini
+ECHO Description = GPAC MPEG-4 Player>> gpac.ini
+ECHO Uninstall = GPAC Osmophone>> gpac.ini
+ECHO IconFile = ..\..\..\..\doc\osmo4.ico>> gpac.ini
+ECHO IconIndex = 0 >> gpac.ini
+ECHO CabFiles = gpaccab.cab >> gpac.ini
+
+ECHO on
+
+ezsetup -l english -i gpac.ini -r readme.txt -e ../../../../COPYING -o gpac.exe
+rename gpac.exe "GPAC_%gpac_version%_WindowsMobile.exe"
+DEL gpaccab.cab
+DEL gpaccab.inf
+DEL gpac.ini
+DEL *.tmp
+
+cd /d %OLDDIR%
diff --git a/bin/smartphone 2003 (armv4)/release/install/readme.txt b/bin/smartphone 2003 (armv4)/release/install/readme.txt
index 08442c1..43ce565 100644
--- a/bin/smartphone 2003 (armv4)/release/install/readme.txt
+++ b/bin/smartphone 2003 (armv4)/release/install/readme.txt
@@ -1,6 +1,6 @@
-This will install GPAC for ARM PocketPC/SmartPhones 2003 Platforms
-
-GPAC is an open source MPEG-4 framework developped by ENST and available at:
- http://gpac.sourceforge.net
-
-WARNING: THIS RELEASE COMES WITH NO WARRANTY, AND MAY EVEN DAMAGE YOUR HANDHELD DEVICE. PLEASE READ CAREFULLY THE LICENSE HEREJOIN
+This will install GPAC for ARM PocketPC/SmartPhones 2003 Platforms
+
+GPAC is an open source MPEG-4 framework developped by ENST and available at:
+ http://gpac.sourceforge.net
+
+WARNING: THIS RELEASE COMES WITH NO WARRANTY, AND MAY EVEN DAMAGE YOUR HANDHELD DEVICE. PLEASE READ CAREFULLY THE LICENSE HEREJOIN
diff --git a/configure b/configure
index 446acd6..55d7b4c 100755
--- a/configure
+++ b/configure
@@ -26,6 +26,7 @@ TMPCXX="${TMPDIR1}/gpac-conf-${RANDOM}-$$-${RANDOM}.cpp"
TMPE="${TMPDIR1}/gpac-conf-${RANDOM}-$$-${RANDOM}"
TMPO="${TMPDIR1}/gpac-conf-${RANDOM}-$$-${RANDOM}.o"
TMPS="${TMPDIR1}/gpac-conf-${RANDOM}-$$-${RANDOM}.S"
+TMPL="${TMPDIR1}/gpac-conf-${RANDOM}-$$-${RANDOM}.LOG"
#default parameters
@@ -90,7 +91,6 @@ has_x11_xv="no"
no_gcc_opt="no"
use_fixed_point="no"
use_memory_tracking="no"
-use_std_alloc="no"
has_opengl="no"
has_tinygl="no"
enable_tinygl="no"
@@ -102,6 +102,7 @@ has_openjpeg="no"
gprof_build="no"
static_build="no"
want_pic="no"
+want_gcov="no"
has_joystick="no"
has_xul="no"
enable_joystick="no"
@@ -178,13 +179,16 @@ need_inet_aton="no"
CFLAGS=""
CXXFLAGS=""
GPAC_SH_FLAGS=-lpthread
-DYN_LIB_SUFFIX="so"
+DYN_LIB_SUFFIX=".so"
X11_PATH="/usr/X11R6"
OSS_CFLAGS=""
OSS_LDFLAGS=""
INSTFLAGS=""
is_64="no"
+ffmpeg_extra_ldflags=""
+logs="config.log"
+echo "Logs for GPAC configure $GPAC_CONFIGURATION" > $logs
#configure usage
@@ -216,14 +220,16 @@ GPAC configuration options:
--dxsdk-path=DX_PATH specify directX SDK for MinGW [$dxsdk_path]
--xulsdk-path=XUL_PATH specify Mozilla XUL (Gecko) SDK include path [$xulsdk_path]
--mozdir=MOZ_PATH specify mozilla main directory path for system install
+ --extra-ff-ldflags=ELDFLAGS add ELDFLAGS to FFMPEG LDFLAGS [$ffmpeg_extra_ldflags]
--enable-debug produce debug version
--enable-gprof enable profiling
+ --enable-gcov enable coverage
--enable-pic enable Position Independant Code for shared objects
--strip enable strip
--std-allocator uses standard lib memory allocator
- --static-modules uses static modules whenever possible
- --track-memory enable tracking of all memory allocated by gpac
+ --static-modules includes static modules in libgpac whenever possible
+ --enable-mem-track enable tracking of all memory allocated by gpac
--disable-opt disable GCC optimizations
--disable-ipv6 disable IPV6 support
--disable-wx disable wxWidgets support
@@ -244,8 +250,8 @@ GPAC configuration options:
--enable-amr-nb enable AMR NB library
--enable-amr-wb enable AMR WB library
--enable-amr enable both AMR NB and WB libraries
- --enable-static-bin GPAC static build
- --static-mp4box configure for static linking of MP4Box.
+ --enable-static-bin link statically against libgpac
+ --static-mp4box configure for static linking of MP4Box only.
--enable-depth enables depth handling in the compositor
Configuration options for libgpac - all options can be enabled with --enable-optname
@@ -323,9 +329,9 @@ for opt do
;;
--mandir=*) mandir=`echo $opt | cut -d '=' -f 2`
;;
- --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2` && echo "\ncross-prefix detected: $cross_prefix"
+ --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2` && echo "cross-prefix detected: $cross_prefix"
;;
- --target-os=*) targetos=`echo $opt | cut -d '=' -f 2` && echo "\ntarget-os detected: $targetos"
+ --target-os=*) targetos=`echo $opt | cut -d '=' -f 2` && echo "target-os detected: $targetos"
;;
--cc=*) cc_orig=`echo $opt | cut -d '=' -f 2`
;;
@@ -339,6 +345,8 @@ for opt do
;;
--extra-ldflags=*) LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
;;
+ --extra-ff-ldflags=*) ffmpeg_extra_ldflags=`echo $opt | cut -d '=' -f 2`
+ ;;
--extra-libs=*) extralibs=${opt#--extra-libs=}
;;
--cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
@@ -349,11 +357,14 @@ for opt do
;;
--enable-pic) want_pic="yes";
;;
+ --enable-gcov) want_gcov="yes";
+ ;;
--verbose) verbose="yes";
;;
esac
done
+
cc="${cc_orig}"
cxx="${cxx_orig}"
@@ -382,7 +393,7 @@ case "$cpu" in
if [ -z "`echo $CFLAGS | grep -- -m32`" ]; then
cpu="x86_64"
want_pic="yes"
- is_64="yes"
+ is_64="yes"
fi
fi
;;
@@ -422,14 +433,6 @@ if test -z "$CFLAGS"; then
CFLAGS=""
fi
-#if test "$win32" = "yes" ; then
-# cross_prefix=""
-#fi
-
-#if test "$mingw32" = "yes" ; then
-# cross_prefix=""
-#fi
-
cc="${cross_prefix}${cc}"
#for ccache
@@ -444,8 +447,8 @@ windres="${cross_prefix}${windres}"
#check pkg_config
if test "$cross_prefix" = "" ; then
- if ! $pkg_config --version >/dev/null 2>&1 ; then
- pkg_config="no"
+ if ! $pkg_config --version >/dev/null 2>>$logs ; then
+ pkg_config="no"
fi
fi
@@ -456,8 +459,10 @@ source_path_used="yes"
if test -z "$source_path" -o "$source_path" = "." ; then
source_path="`pwd`"
source_path_used="no"
+ build_path=$source_path
else
source_path="`cd \"$source_path\"; pwd`"
+ build_path="`pwd`"
fi
@@ -472,7 +477,7 @@ case $targetos in
prefix="/boot/home/config"
CFLAGS="$CFLAGS -DPIC -fomit-frame-pointer"
# 3 gcc releases known for BeOS, each with ugly bugs
- gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f3-)"
+ gcc_version="$($cc -v 2>>$logs | grep version | cut -d ' ' -f3-)"
case "$gcc_version" in
2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
;;
@@ -502,9 +507,8 @@ case $targetos in
#include
int main( void ) { return 0; }
EOF
-
CFLAGS_NO_LTO=$(echo ${CFLAGS} | sed -e 's/\ -flto[-A-Za-z0-9=]*//g')
- $cc ${CFLAGS_NO_LTO} -o $TMPO $TMPC 2>/dev/null && $($readelf -h $TMPO | grep "Class:.*ELF64$" >/dev/null 2>&1)
+ $cc ${CFLAGS_NO_LTO} -o $TMPO $TMPC 2>>$logs && $($readelf -h $TMPO | grep "Class:.*ELF64$" >/dev/null 2>>$logs)
if test $? -eq 0; then
is_64="yes"
fi
@@ -549,7 +553,7 @@ EOF
cc="cc"
Mac_Applications="/Applications"
SHFLAGS="-dynamiclib"
- DYN_LIB_SUFFIX="dylib"
+ DYN_LIB_SUFFIX=".dylib"
extralibs=""
GPAC_SH_FLAGS=""
strip="strip -x"
@@ -557,7 +561,7 @@ EOF
LDFLAGS="$LDFLAGS"
fi
darwin="yes"
- gcc_version=`$cc -v 2>&1 | grep version | cut -d ' ' -f3`
+ gcc_version=`$cc -v 2>>$logs | grep version | cut -d ' ' -f3`
case "$gcc_version" in
*2.95*)
CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
@@ -571,10 +575,11 @@ EOF
esac
;;
- MINGW32*)
+ MINGW32*|mingw32|MINGW64*|mingw64)
js_flags="-DXP_PC -D_declspec=__declspec"
mingw32="yes"
win32="yes"
+ want_pic="no"
extralibs="$extralibs -lws2_32 -lwinmm"
CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
if test "$cross_prefix" != "" ; then
@@ -582,25 +587,35 @@ EOF
fi
;;
- CYGWIN*)
+ CYGWIN*|cygwin*)
js_flags=-DXP_PC
extralibs="$extralibs -lws2_32 -lwinmm"
cygwin="yes"
win32="yes"
;;
- Linux)
+ Linux|linux|android)
js_flags="-DXP_UNIX -I/usr/include/js"
LDFLAGS="$LDFLAGS -Wl,--warn-common -Wl,-z,defs"
- #OSS_LDFLAGS="-laoss"
linux="yes"
case "$cpu" in
sh4)
CFLAGS="$CFLAGS -isystem \"$prefix/include\""
- #LDFLAGS="$LDFLAGS -L$prefix/lib"
;;
esac
- ;;
+ cat > $TMPC << EOF
+#include
+#if !defined (__BIONIC__)
+#error
+#endif
+EOF
+ if $cc -c $CFLAGS $TMPC 0>/dev/null 2>$TMPL ; then
+ #bionic libc (android)
+ CFLAGS="$CFLAGS -DPTHREAD_HAS_NO_CANCEL"
+ GPAC_SH_FLAGS=""
+ fi
+ ;;
+
*) ;;
esac
@@ -608,7 +623,7 @@ esac
#defines directory for binaries and libs (ex. for TinyGL)
target_bin_dir=""
if test "$cross_prefix" = "" ; then
- target_bin_dir=`${cc} -v 2>&1 | sed -n '2p' | awk ' {print $2}'`-${cc_orig}
+ target_bin_dir=`${cc} -v 2>>$logs | sed -n '2p' | awk ' {print $2}'`-${cc_orig}
else
target_bin_dir=${cross_prefix}${cc_orig}
fi
@@ -626,17 +641,45 @@ local_inc=$source_path/extra_lib/include
local_lib=extra_lib/lib/gcc
+dolog() {
+ rv=$?
+ if [ $rv -eq 0 ] ; then
+ return 0;
+ fi
+
+ echo "*** CC/CXX Test Failed (args $@) : ">>$logs
+ echo "">>$logs
+ cat $TMPL >> $logs
+ echo "">>$logs
+ echo "Source was: ">>$logs
+ cat $TMPC >> $logs
+ echo "">>$logs
+ echo "">>$logs
+ return 1;
+}
+
+docc() {
+ $cc -o $TMPO $TMPC $@ 0>/dev/null 2>$TMPL
+ dolog $@
+}
+
+
+docxx() {
+ $cc -o $TMPO $TMPC $@ 0>/dev/null 2>$TMPL
+ dolog $@
+}
+
#check GCC flags support
cat > $TMPC << EOF
#include
int main( void ) { return 0; }
EOF
CFLAGS="$CFLAGS -Wall"
-if $cc -o $TMPO $TMPC -fno-strict-aliasing 2> /dev/null ; then
+if docc -fno-strict-aliasing ; then
CFLAGS="$CFLAGS -fno-strict-aliasing"
fi
CXXFLAGS="$CFLAGS"
-if $cc -o $TMPO $TMPC -lz -Wno-pointer-sign 2> /dev/null ; then
+if docc -lz -Wno-pointer-sign ; then
CFLAGS="$CFLAGS -Wno-pointer-sign"
fi
@@ -658,6 +701,11 @@ if test "$want_pic" = "yes" ; then
CXXFLAGS="$CXXFLAGS -fPIC -DPIC"
fi
+if test "$want_gcov" = "yes" ; then
+ CFLAGS="$CFLAGS --coverage"
+ CXXFLAGS="$CXXFLAGS --coverage"
+ LDFLAGS="$LDFLAGS --coverage"
+fi
#force use of cflags with cc
cc_naked=$cc
@@ -668,27 +716,27 @@ cxx="$cxx $CXXFLAGS"
#look for zlib
cat > $TMPC << EOF
#include
-int main( void ) { }
+int main( void ) { return 0; }
EOF
-if $cc -o $TMPO $TMPC -msse2 $LDFLAGS 2> /dev/null ; then
+if docc -msse2 $LDFLAGS ; then
CFLAGS="$CFLAGS -msse2"
fi
#look for zlib
cat > $TMPC << EOF
+#include
+#include
#include
int main( void ) { if (strcmp(zlibVersion(), ZLIB_VERSION)) { puts("zlib version differs !!!"); return 1; } return 0; }
EOF
has_zlib="no"
-#if test "$cross_prefix" = "" ; then
- if $cc -o $TMPO $TMPC -lz $LDFLAGS 2> /dev/null ; then
- has_zlib="system"
- fi
-#fi
+if docc -lz $LDFLAGS ; then
+ has_zlib="system"
+fi
if test "$has_zlib" = "no" ; then
- if $cc -o $TMPO $TMPC -I"$local_inc/zlib" -L$local_lib -lz 2> /dev/null ; then
+ if docc -I"$local_inc/zlib" -L$local_lib -lz ; then
has_zlib="local"
fi
fi
@@ -696,12 +744,12 @@ fi
#check dlopen
cat > $TMPC << EOF
#include
-int main( void ) { return (int) dlopen("foo", 0); }
+int main( void ) { dlopen("foo", 0); return 0; }
EOF
-if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
+if docc ; then
dlopen="yes"
-elif $cc -o $TMPE $TMPC $LDFLAGS -ldl > /dev/null 2>&1 ; then
+elif docc $LDFLAGS -ldl ; then
GPAC_SH_FLAGS="$GPAC_SH_FLAGS -ldl"
fi
@@ -716,43 +764,43 @@ if test "$has_js" = "no" ; then
cat > $TMPC << EOF
#include
-int main( void ) { JSContext *cx; jsval *rp; return JS_AddValueRoot(cx, rp); }
+int main( void ) { JSContext *cx=NULL; jsval rp; return JS_AddValueRoot(cx, &rp); }
EOF
#try local
js_inc="$local_inc/js"
js_flags="-DXP_UNIX -I$local_inc/js"
- if $cc -o $TMPO $TMPC $js_flags -L$local_lib -ljs -lpthread 2> /dev/null ; then
+ if docc $js_flags -L$local_lib -ljs -lpthread ; then
has_js="local"
#dc added
elif test "$pkg_config" != "no"; then
#try pkg-config
- if $pkg_config --exists mozilla-js 2> /dev/null ; then
+ if $pkg_config --exists mozilla-js ; then
mozjs_pkgcfg="mozilla-js"
- elif $pkg_config --exists mozjs 2> /dev/null ; then
+ elif $pkg_config --exists mozjs ; then
mozjs_pkgcfg="mozjs"
- elif $pkg_config --exists mozjs185 2> /dev/null ; then
+ elif $pkg_config --exists mozjs185 ; then
mozjs_pkgcfg="mozjs185"
- fi
+ fi
if test $mozjs_pkgcfg != "no" ; then
js_flags=`$pkg_config --cflags $mozjs_pkgcfg`
js_lib_pkg=`$pkg_config --libs $mozjs_pkgcfg`
- if $cc -o $TMPO $TMPC $js_flags $js_lib_pkg $LDFLAGS -lpthread 2> /dev/null ; then
+ if docc $js_flags $js_lib_pkg $LDFLAGS -lpthread ; then
has_js="system"
js_lib=`$pkg_config --libs $mozjs_pkgcfg`
fi
#try firefox folders (starting at ubuntu 11.10, no pkg-config)
- elif ls -d /usr/lib/firefox* > /dev/null 2>&1 ; then
+ elif ls -d /usr/lib/firefox* > /dev/null 2>>$logs ; then
firefox_version=`cd /usr/lib ; ls -d firefox* | grep -v addons | grep -v devel ; cd - > /dev/null`
for i in $firefox_version ; do
if test "$has_js" = "no" ; then
js_inc="/usr/include/$i"
js_flags="-DXP_UNIX -I$js_inc"
js_lib="-L/usr/lib/$i/ -lxul -lmozsqlite3 -lmozalloc -lnssutil3 -lnss3 -lnspr4 -lsmime3"
- if $cc -o $TMPO $TMPC $js_flags $js_lib 2> /dev/null ; then
+ if docc $js_flags $js_lib ; then
has_js="$i"
- elif $cc -o $TMPO $TMPC $js_flags -lnssutil3 $js_lib -lssl3 2> /dev/null ; then
+ elif docc $js_flags -lnssutil3 $js_lib -lssl3 ; then
#firefox 11 compatibility
has_js="$i"
js_lib="-lnssutil3 $js_lib -lssl3"
@@ -765,14 +813,14 @@ EOF
#try prefix (DC)
js_inc="$prefix/include/js"
js_flags="-DXP_UNIX -I$prefix/include/js"
- if $cc -o $TMPO $TMPC $js_flags -L$prefix/lib -ljs -lpthread 2> /dev/null ; then
+ if docc $js_flags -L$prefix/lib -ljs -lpthread ; then
has_js="prefix"
#dc added end
else
- if $cc -o $TMPO $TMPC $js_flags $LDFLAGS -ljs -lpthread 2> /dev/null ; then
+ if docc $js_flags $LDFLAGS -ljs -lpthread ; then
js_inc="/usr/include"
has_js="system"
- elif $cc -o $TMPO $TMPC -DXP_UNIX -I$alt_macosx_dir/include/js -L$alt_macosx_dir/lib $LDFLAGS -ljs -lpthread 2> /dev/null ; then
+ elif docc -DXP_UNIX -I$alt_macosx_dir/include/js -L$alt_macosx_dir/lib $LDFLAGS -ljs -lpthread 2>>$logs ; then
has_js="system"
js_flags="-DXP_UNIX -I$alt_macosx_dir/include/js"
js_lib="-L$alt_macosx_dir/lib -ljs"
@@ -781,14 +829,14 @@ EOF
#debian spidermonkey (smjs)
js_flags="-DXP_UNIX -I/usr/include/smjs"
js_inc="/usr/include/smjs"
- if $cc -o $TMPO $TMPC $js_flags $LDFLAGS -lsmjs -lpthread 2> /dev/null ; then
+ if docc $js_flags $LDFLAGS -lsmjs -lpthread ; then
has_js="system"
js_lib="-lsmjs"
else
#debian spidermonkey (mozjs)
js_flags="-DXP_UNIX -I/usr/include/mozjs"
js_inc="/usr/include/mozjs"
- if $cc -o $TMPO $TMPC $js_flags $LDFLAGS -lmozjs -lpthread 2> /dev/null ; then
+ if docc $js_flags $LDFLAGS -lmozjs -lpthread ; then
has_js="system"
js_lib="-lmozjs"
fi
@@ -808,7 +856,7 @@ fi
#spidermonkey test for regular API
if test "$has_js" = "no" ; then
- cat > $TMPC << EOF
+cat > $TMPC << EOF
#include
int main( void ) { return 0; }
EOF
@@ -819,40 +867,39 @@ EOF
if test "$cpu" = "sh4" ; then
lm_lib="-lm"
fi
- if $cc -o $TMPO $TMPC $js_flags $lm_lib -L$local_lib -ljs 2> /dev/null ; then
+ if docc $js_flags $lm_lib -L$local_lib -ljs ; then
has_js="local"
#dc added
else
-
#try prefix (DC)
js_inc="$prefix/include/js"
js_flags="-DXP_UNIX -I$prefix/include/js"
- if $cc -o $TMPO $TMPC $js_flags -L$prefix/lib -ljs 2> /dev/null ; then
+ if docc $js_flags -L$prefix/lib -ljs ; then
has_js="prefix"
#dc added end
elif test "$pkg_config" != "no"; then
- if $pkg_config --exists mozilla-js 2> /dev/null ; then
- mozjs_pkgcfg="mozilla-js"
- elif $pkg_config --exists mozjs 2> /dev/null ; then
- mozjs_pkgcfg="mozjs"
- elif $pkg_config --exists mozjs185 2> /dev/null ; then
- mozjs_pkgcfg="mozjs185"
- fi
-
- if test $mozjs_pkgcfg != "no" ; then
+ if $pkg_config --exists mozilla-js ; then
+ mozjs_pkgcfg="mozilla-js"
+ elif $pkg_config --exists mozjs ; then
+ mozjs_pkgcfg="mozjs"
+ elif $pkg_config --exists mozjs185 ; then
+ mozjs_pkgcfg="mozjs185"
+ fi
+
+ if test $mozjs_pkgcfg != "no" ; then
js_flags=`$pkg_config --cflags $mozjs_pkgcfg`
js_lib_pkg=`$pkg_config --libs $mozjs_pkgcfg`
- if $cc -o $TMPO $TMPC $js_flags $js_lib_pkg $LDFLAGS -lpthread 2> /dev/null ; then
+ if docc $js_flags $js_lib_pkg $LDFLAGS -lpthread ; then
has_js="system"
js_lib=`$pkg_config --libs $mozjs_pkgcfg`
fi
fi
fi
- if test "$has_js" = "no" ; then
- if $cc -o $TMPO $TMPC $js_flags $LDFLAGS -ljs 2> /dev/null ; then
+ if test "$has_js" = "no" ; then
+ if docc $js_flags $LDFLAGS -ljs ; then
js_inc="/usr/include"
has_js="system"
- elif $cc -o $TMPO $TMPC -DXP_UNIX -I$alt_macosx_dir/include/js -L$alt_macosx_dir/lib $LDFLAGS -ljs 2> /dev/null ; then
+ elif docc -DXP_UNIX -I$alt_macosx_dir/include/js -L$alt_macosx_dir/lib $LDFLAGS -ljs 2>>$logs ; then
has_js="system"
js_flags="-DXP_UNIX -I$alt_macosx_dir/include/js"
js_lib="-L$alt_macosx_dir/lib -ljs"
@@ -861,14 +908,14 @@ EOF
#debian spidermonkey (smjs)
js_flags="-DXP_UNIX -I/usr/include/smjs"
js_inc="/usr/include/smjs"
- if $cc -o $TMPO $TMPC $js_flags $LDFLAGS -lsmjs 2> /dev/null ; then
+ if docc $js_flags $LDFLAGS -lsmjs ; then
has_js="system"
js_lib="-lsmjs"
else
#debian spidermonkey (mozjs)
js_flags="-DXP_UNIX -I/usr/include/mozjs"
js_inc="/usr/include/mozjs"
- if $cc -o $TMPO $TMPC $js_flags $LDFLAGS -lmozjs 2> /dev/null ; then
+ if docc $js_flags $LDFLAGS -lmozjs ; then
has_js="system"
js_lib="-lmozjs"
fi
@@ -885,35 +932,36 @@ if test "$has_js" != "no" ; then
#if the lib has been compiled with or without the macro. We currently just decide that if the macro is present
#in the header, it was enabled in the build
if test "$new_js_api" = "no" ; then
- if grep MOZILLA_1_8_BRANCH $js_inc/jsapi.h > /dev/null 2>&1 ; then
+ if grep MOZILLA_1_8_BRANCH $js_inc/jsapi.h > /dev/null 2>>$logs ; then
js_flags="-DMOZILLA_1_8_BRANCH $js_flags"
echo "WARNING: Turning on MOZILLA_1_8_BRANCH SpiderMonkey macro"
echo "If you have troubles with scripts in GPAC, disable this macro and recompile"
fi
else
+
cat > $TMPC << EOF
#include
-int main( void ) { JSObject *obj; JS_GetPrivate(obj); }
+int main( void ) { JSObject *obj; JS_GetPrivate(obj); return 0; }
EOF
- if $cc -o $TMPO $TMPC $js_flags $LDFLAGS $js_lib 2> /dev/null ; then
+ if docc $js_flags $LDFLAGS $js_lib ; then
cat > $TMPC << EOF
#include
-int main( void ) { jsval *vp; JSObject *obj = JS_NewObjectForConstructor(c, vp); }
+int main( void ) { jsval vp; JSContext *cx=NULL; JSObject *obj = JS_NewObjectForConstructor(cx, &vp); return 0; }
EOF
- if $cc -o $TMPO $TMPC $js_flags $LDFLAGS $js_lib 2> /dev/null ; then
- js_flags="-DUSE_FFDEV_12 $js_flags"
- elif grep JSMutableHandleValue $js_inc/jsapi.h | grep JSHasInstanceOp > /dev/null 2>&1 ; then
- js_flags="-DUSE_FFDEV_18 $js_flags"
- elif grep JSMutableHandleValue $js_inc/jsapi.h > /dev/null 2>&1 ; then
- js_flags="-DUSE_FFDEV_18 $js_flags"
- elif ! grep JS_ConstructObject $js_inc/jsapi.h > /dev/null 2>&1 ; then
- js_flags="-DUSE_FFDEV_16 $js_flags"
- elif grep JSHandleObject $js_inc/jsapi.h > /dev/null 2>&1 ; then
- js_flags="-DUSE_FFDEV_15 $js_flags"
+ if docc $js_flags $LDFLAGS $js_lib ; then
+ js_flags="-DUSE_FFDEV_12 $js_flags"
+ elif grep JSMutableHandleValue $js_inc/jsapi.h | grep JSHasInstanceOp > /dev/null 2>>$logs ; then
+ js_flags="-DUSE_FFDEV_18 $js_flags"
+ elif grep JSMutableHandleValue $js_inc/jsapi.h > /dev/null 2>>$logs ; then
+ js_flags="-DUSE_FFDEV_18 $js_flags"
+ elif ! grep JS_ConstructObject $js_inc/jsapi.h > /dev/null 2>>$logs ; then
+ js_flags="-DUSE_FFDEV_16 $js_flags"
+ elif grep JSHandleObject $js_inc/jsapi.h > /dev/null 2>>$logs ; then
+ js_flags="-DUSE_FFDEV_15 $js_flags"
else
- js_flags="-DUSE_FFDEV_14 $js_flags"
- fi
+ js_flags="-DUSE_FFDEV_14 $js_flags"
+ fi
fi
fi
fi
@@ -924,15 +972,14 @@ fi
if test "$has_js" != "no" ; then
cat > $TMPC << EOF
-cat > $TMPC << EOF
#include
-int main( void ) { JSContext *cx; JS_SetRuntimeThread(cx); }
+int main( void ) { JSContext *cx=NULL; JS_SetRuntimeThread(cx); return 0;}
EOF
- if $cc -o $TMPO $TMPC $js_flags $LDFLAGS $js_lib 2> /dev/null ; then
- js_flags="$js_flags"
- else
- js_flags="-DNO_JS_RUNTIMETHREAD $js_flags"
- fi
+ if docc $js_flags $LDFLAGS $js_lib ; then
+ js_flags="$js_flags"
+ else
+ js_flags="-DNO_JS_RUNTIMETHREAD $js_flags"
+ fi
fi
@@ -945,7 +992,7 @@ cat > $TMPC << EOF
#include
int main( void ) { return 0; }
EOF
-if $cxx -o $TMPO $TMPC -I$local_inc/platinum $LDFLAGS -L$local_lib -lPlatinum -lPltMediaServer -lPltMediaConnect -lPltMediaRenderer -lNeptune -lZlib -lpthread 2> /dev/null ; then
+if docxx -o $TMPO $TMPC -I$local_inc/platinum $LDFLAGS -L$local_lib -lPlatinum -lPltMediaServer -lPltMediaConnect -lPltMediaRenderer -lNeptune -lZlib -lpthread ; then
has_platinum="yes"
fi
@@ -967,7 +1014,7 @@ int main( void ) {
return 0;
}
EOF
-if $cxx -o $TMPO $TMPC $LDFLAGS $avcap_cflags $avcap_ldflags 2> /dev/null ; then
+if docxx -o $TMPO $TMPC $LDFLAGS $avcap_cflags $avcap_ldflags ; then
has_avcap="yes"
else
if test "$darwin" = "yes" ; then
@@ -977,7 +1024,7 @@ else
avcap_cflags="-I$local_inc -I$local_inc/avcap/linux"
avcap_ldflags="-lavcap -lpthread"
fi
- if $cxx -o $TMPO $TMPC $avcap_cflags $LDFLAGS -L$local_lib $avcap_ldflags 2> /dev/null ; then
+ if docxx -o $TMPO $TMPC $avcap_cflags $LDFLAGS -L$local_lib $avcap_ldflags ; then
has_avcap="yes"
avcap_ldflags="-L../../$local_lib $avcap_ldflags"
fi
@@ -987,24 +1034,24 @@ fi
#look for opensvc support
if test "$darwin" = "yes" ; then
-osvc_cflags="-I/usr/include -I/usr/local/include"
-osvc_ldflags="-L/usr/lib -L/usr/local/lib -lOpenSVCDec"
+ osvc_cflags="-I/usr/include -I/usr/local/include"
+ osvc_ldflags="-L/usr/lib -L/usr/local/lib -lOpenSVCDec"
else
-osvc_cflags=""
-osvc_ldflags="-lOpenSVCDec"
+ osvc_cflags=""
+ osvc_ldflags="-lOpenSVCDec"
fi
cat > $TMPC << EOF
#include
int main( void ) { return 0; }
EOF
-if $cxx -o $TMPO $TMPC $osvc_cflags $LDFLAGS $osvc_ldflags 2> /dev/null ; then
+if docc $osvc_cflags $LDFLAGS $osvc_ldflags ; then
has_opensvc="yes"
else
osvc_cflags="-I$local_inc"
osvc_ldflags="-lOpenSVCDec"
-if $cxx -o $TMPO $TMPC $osvc_cflags $LDFLAGS -L$local_lib $osvc_ldflags 2> /dev/null ; then
+if docc $osvc_cflags $LDFLAGS -L$local_lib $osvc_ldflags ; then
has_opensvc="yes"
osvc_ldflags="-L../../$local_lib $osvc_ldflags"
fi
@@ -1014,14 +1061,14 @@ fi
#look for openhevc support
if test "$darwin" = "yes" ; then
-ohevc_cflags="-I/usr/include -I/usr/local/include"
-ohevc_ldflags="-L/usr/lib -L/usr/local/lib -lLibOpenHevcWrapper -lm -lpthread "
+ ohevc_cflags="-I/usr/include -I/usr/local/include"
+ ohevc_ldflags="-L/usr/lib -L/usr/local/lib -lLibOpenHevcWrapper -lm -lpthread "
elif test "$cross_prefix" = "" ; then
-ohevc_cflags=""
-ohevc_ldflags="-lLibOpenHevcWrapper -lm -lpthread"
+ ohevc_cflags=""
+ ohevc_ldflags="-lLibOpenHevcWrapper -lm -lpthread"
else
-ohevc_cflags="-I${prefix}include"
-ohevc_ldflags="-lLibOpenHevcWrapper -lm -lpthread"
+ ohevc_cflags="-I${prefix}include"
+ ohevc_ldflags="-lLibOpenHevcWrapper -lm -lpthread"
fi
cat > $TMPC << EOF
@@ -1029,12 +1076,12 @@ cat > $TMPC << EOF
#include
int main( void ) { libOpenHevcInit(1, 1); return 0; }
EOF
-if $cc -o $TMPO $TMPC $ohevc_cflags $ohevc_ldflags $LDFLAGS 2> /dev/null ; then
+if docc $ohevc_cflags $ohevc_ldflags $LDFLAGS ; then
has_openhevc="yes"
else
ohevc_cflags="-I$local_inc"
ohevc_ldflags="-lLibOpenHevcWrapper -lm -lpthread"
- if $cc -o $TMPO $TMPC $ohevc_cflags $ohevc_ldflags $LDFLAGS -L$local_lib 2> /dev/null ; then
+ if docc $ohevc_cflags $ohevc_ldflags $LDFLAGS -L$local_lib ; then
has_openhevc="yes"
ohevc_ldflags="-L../../$local_lib $ohevc_ldflags"
fi
@@ -1049,24 +1096,25 @@ cat > $TMPC << EOF
#include FT_OUTLINE_H
int main( void ) { return 0; }
EOF
+ft_cflags="-I$prefix/include "
+ft_lflags="-L$prefix/lib -lfreetype"
+if docc $CFLAGS_DIR $ft_cflags $ft_lflags $LDFLAGS ; then
+ has_ft="system"
+fi
if test "$cross_prefix" = "" ; then
- ft_cflags="-I$prefix/include "
- ft_lflags="-L$prefix/lib -lfreetype"
- if $cc $CFLAGS_DIR -o $TMPO $TMPC $ft_cflags $ft_lflags $LDFLAGS 2> /dev/null ; then
- has_ft="system"
- else
- ft_cflags="`freetype-config --cflags 2> /dev/null`"
- ft_lflags="`freetype-config --libs 2> /dev/null`"
- if $cc -o $TMPO $TMPC $ft_cflags $ft_lflags $LDFLAGS 2> /dev/null ; then
+ if test "$has_ft" = "no" ; then
+ ft_cflags="`freetype-config --cflags 2>>$logs`"
+ ft_lflags="`freetype-config --libs 2>>$logs`"
+ if docc $ft_cflags $ft_lflags $LDFLAGS ; then
has_ft="system"
fi
fi
fi
if test "$has_ft" = "no" ; then
- if test "`which freetype-config 2> /dev/null`" != ""; then
+ if test "`which freetype-config 2>>$logs`" != ""; then
ft_cflags="-I$local_inc/freetype"
ft_lflags="-L$local_lib -lfreetype"
- if $cc -o $TMPO $TMPC $ft_cflags $ft_lflags 2> /dev/null ; then
+ if docc $ft_cflags $ft_lflags ; then
has_ft="local"
fi
fi
@@ -1090,7 +1138,7 @@ else
LINK_SSL="-lssl -lcrypto"
fi
-if $cc -o $TMPO $TMPC $LINK_SSL $LDFLAGS 2> /dev/null ; then
+if docc $LINK_SSL $LDFLAGS ; then
has_ssl="yes"
fi
@@ -1103,31 +1151,34 @@ cat > $TMPC << EOF
int main( void ) { return 0; }
EOF
+if docc $LDFLAGS -ljpeg ; then
+ has_jpeg="system"
+fi
if test "$cross_prefix" = "" ; then
- if $cc -o $TMPO $TMPC $LDFLAGS -ljpeg 2> /dev/null ; then
- has_jpeg="system"
- elif test "$alt_macosx_dir" != "" ; then
- if cc -o $TMPO $TMPC -I$alt_macosx_dir/include -L$alt_macosx_dir/lib $LDFLAGS -ljpeg 2> /dev/null ; then
- has_jpeg="system"
- fi
- elif test "`which $prefix/bin/jpeg-config 2> /dev/null`" != ""; then
- jpeg_cflags="`$prefix/bin/jpeg-config --cflags`"
- jpeg_lflags="`$prefix/bin/jpeg-config --libs`"
- if $cc -o $TMPO $TMPC $jpeg_cflags $jpeg_lflags $LDFLAGS 2> /dev/null ; then
- has_jpeg="system"
- fi
- else
- jpeg_cflags="-I$prefix/include"
- jpeg_lflags="-L$prefix/lib -ljpeg"
- if $cc -o $TMPO $TMPC $jpeg_cflags $jpeg_lflags $LDFLAGS 2> /dev/null ; then
- has_jpeg="system"
+ if test "$has_jpeg" = "no" ; then
+ if test "$alt_macosx_dir" != "" ; then
+ if cc -o $TMPO $TMPC -I$alt_macosx_dir/include -L$alt_macosx_dir/lib $LDFLAGS -ljpeg 2>>$logs ; then
+ has_jpeg="system"
+ fi
+ elif test "`which $prefix/bin/jpeg-config 2>>$logs`" != ""; then
+ jpeg_cflags="`$prefix/bin/jpeg-config --cflags`"
+ jpeg_lflags="`$prefix/bin/jpeg-config --libs`"
+ if docc $jpeg_cflags $jpeg_lflags $LDFLAGS ; then
+ has_jpeg="system"
+ fi
+ else
+ jpeg_cflags="-I$prefix/include"
+ jpeg_lflags="-L$prefix/lib -ljpeg"
+ if docc $jpeg_cflags $jpeg_lflags $LDFLAGS ; then
+ has_jpeg="system"
+ fi
fi
fi
fi
if test "$has_jpeg" = "no" ; then
jpeg_cflags="-I$local_inc/jpeg"
jpeg_lflags="-L$local_lib -ljpeg"
- if $cc -o $TMPO $TMPC $jpeg_cflags $jpeg_lflags 2> /dev/null ; then
+ if docc $jpeg_cflags $jpeg_lflags ; then
has_jpeg="local"
fi
fi
@@ -1141,18 +1192,21 @@ cat > $TMPC << EOF
int main( void ) { return 0; }
EOF
+if docc $LDFLAGS -lopenjpeg ; then
+ has_openjpeg="system"
+fi
if test "$cross_prefix" = "" ; then
- if $cc -o $TMPO $TMPC $LDFLAGS -lopenjpeg 2> /dev/null ; then
- has_openjpeg="system"
- elif test "$alt_macosx_dir" != "" ; then
- if cc -o $TMPO $TMPC -I$alt_macosx_dir/include -L$alt_macosx_dir/lib $LDFLAGS -ljpeg 2> /dev/null ; then
- has_openjpeg="system"
+ if test "$has_openjpeg" = "no" ; then
+ if test "$alt_macosx_dir" != "" ; then
+ if cc -o $TMPO $TMPC -I$alt_macosx_dir/include -L$alt_macosx_dir/lib $LDFLAGS -ljpeg 2>>$logs ; then
+ has_openjpeg="system"
+ fi
fi
fi
fi
if test "$has_openjpeg" = "no" ; then
- if $cc -o $TMPO $TMPC -I$local_inc/openjpeg -L$local_lib -lopenjpeg 2> /dev/null ; then
+ if docc -I$local_inc/openjpeg -L$local_lib -lopenjpeg ; then
has_openjpeg="local"
fi
fi
@@ -1165,23 +1219,24 @@ cat > $TMPC << EOF
int main( void ) { return 0; }
EOF
+png_cflags="-I$prefix/include"
+png_lflags="-L$prefix/lib -lpng -lz"
+if docc $png_cflags $png_lflags $LDFLAGS ; then
+ has_png="system"
+elif docc $LDFLAGS -lpng -lz ; then
+ has_png="system"
+fi
if test "$cross_prefix" = "" ; then
- png_cflags="-I$prefix/include"
- png_lflags="-L$prefix/lib -lpng -lz"
- #-nostdlib prevents from searching standard compiler libraries
- #if $cc -o $TMPO $TMPC -nostdlib $png_cflags $png_lflags 2> /dev/null ; then
- if $cc -o $TMPO $TMPC $png_cflags $png_lflags $LDFLAGS 2> /dev/null ; then
- has_png="system"
- elif $cc -o $TMPO $TMPC $LDFLAGS -lpng -lz 2> /dev/null ; then
- has_png="system"
- elif test "$alt_macosx_dir" != "" ; then
- if $cc -o $TMPO $TMPC -I$alt_macosx_dir/include -L$alt_macosx_dir/lib $LDFLAGS -lpng 2> /dev/null ; then
- has_png="system"
+ if test "$has_png" = "no" ; then
+ if test "$alt_macosx_dir" != "" ; then
+ if docc -I$alt_macosx_dir/include -L$alt_macosx_dir/lib $LDFLAGS -lpng 2>>$logs ; then
+ has_png="system"
+ fi
fi
fi
fi
if test "$has_png" = "no" ; then
- if $cc -o $TMPO $TMPC -I$local_inc/png -L$local_lib -lpng 2> /dev/null ; then
+ if docc -I$local_inc/png -L$local_lib -lpng ; then
has_png="local"
fi
fi
@@ -1194,17 +1249,20 @@ cat > $TMPC << EOF
int main( void ) { return 0; }
EOF
+if docc $LDFLAGS -lmad ; then
+ has_mad="system"
+fi
if test "$cross_prefix" = "" ; then
- if $cc -o $TMPO $TMPC $LDFLAGS -lmad 2> /dev/null ; then
- has_mad="system"
- elif test "$alt_macosx_dir" != "" ; then
- if $cc -o $TMPO $TMPC -I$alt_macosx_dir/include -L$alt_macosx_dir/lib $LDFLAGS -lmad 2> /dev/null ; then
- has_mad="system"
+ if test "$has_mad" = "no" ; then
+ if test "$alt_macosx_dir" != "" ; then
+ if docc -I$alt_macosx_dir/include -L$alt_macosx_dir/lib $LDFLAGS -lmad 2>>$logs ; then
+ has_mad="system"
+ fi
fi
fi
fi
if test "$has_mad" = "no" ; then
- if $cc -o $TMPO $TMPC -I$local_inc/mad -L$local_lib -lmad 2> /dev/null ; then
+ if docc -I$local_inc/mad -L$local_lib -lmad ; then
has_mad="local"
fi
fi
@@ -1213,6 +1271,7 @@ fi
#look for A52DEC support
cat > $TMPC << EOF
+#include
#define uint32_t unsigned int
#define uint8_t unsigned char
#include
@@ -1220,17 +1279,20 @@ cat > $TMPC << EOF
int main( void ) { return 0; }
EOF
+if docc $LDFLAGS -la52 ; then
+ has_a52="system"
+fi
if test "$cross_prefix" = "" ; then
- if $cc -o $TMPO $TMPC $LDFLAGS -la52 2> /dev/null ; then
- has_a52="system"
- elif test "$alt_macosx_dir" != "" ; then
- if $cc -o $TMPO $TMPC -I$alt_macosx_dir/include -L$alt_macosx_dir/lib $LDFLAGS -la52 2> /dev/null ; then
- has_a52="system"
+ if test "$has_a52" = "no" ; then
+ if test "$alt_macosx_dir" != "" ; then
+ if docc -I$alt_macosx_dir/include -L$alt_macosx_dir/lib $LDFLAGS -la52 2>>$logs ; then
+ has_a52="system"
+ fi
fi
fi
fi
if test "$has_a52" = "no" ; then
- if $cc -o $TMPO $TMPC -I$local_inc -L$local_lib -la52 2> /dev/null ; then
+ if docc -I$local_inc -L$local_lib -la52 ; then
has_a52="local"
fi
fi
@@ -1243,19 +1305,22 @@ cat > $TMPC << EOF
int main( void ) { return 0; }
EOF
+if docc -I$prefix/include -L$prefix/lib $LDFLAGS -lxvidcore -lpthread ; then
+ has_xvid="system"
+elif docc $LDFLAGS -lxvidcore -lpthread ; then
+ has_xvid="system"
+fi
if test "$cross_prefix" = "" ; then
- if $cc -o $TMPO $TMPC -I$prefix/include -L$prefix/lib $LDFLAGS -lxvidcore -lpthread 2> /dev/null ; then
- has_xvid="system"
- elif $cc -o $TMPO $TMPC $LDFLAGS -lxvidcore -lpthread 2> /dev/null ; then
- has_xvid="system"
- elif test "$alt_macosx_dir" != "" ; then
- if $cc -o $TMPO $TMPC -I$alt_macosx_dir/include -L$alt_macosx_dir/lib $LDFLAGS -lxvidcore -lpthread 2> /dev/null ; then
- has_xvid="system"
+ if test "$has_xvid" = "no" ; then
+ if test "$alt_macosx_dir" != "" ; then
+ if docc -I$alt_macosx_dir/include -L$alt_macosx_dir/lib $LDFLAGS -lxvidcore -lpthread 2>>$logs ; then
+ has_xvid="system"
+ fi
fi
fi
fi
if test "$has_xvid" = "no" ; then
- if $cc -o $TMPO $TMPC -I$local_inc/xvid -L$local_lib -lxvidcore -lpthread 2> /dev/null ; then
+ if docc -I$local_inc/xvid -L$local_lib -lxvidcore -lpthread ; then
has_xvid="local"
fi
fi
@@ -1268,17 +1333,20 @@ cat > $TMPC << EOF
int main( void ) { return 0; }
EOF
+if docc $LDFLAGS -lfaad -lm ; then
+ has_faad="system"
+fi
if test "$cross_prefix" = "" ; then
- if $cc -o $TMPO $TMPC $LDFLAGS -lfaad -lm 2> /dev/null ; then
- has_faad="system"
- elif test "$alt_macosx_dir" != "" ; then
- if $cc -o $TMPO $TMPC -I$alt_macosx_dir/include -L$alt_macosx_dir/lib $LDFLAGS -lfaad 2> /dev/null ; then
- has_faad="system"
+ if test "$has_faad" = "no" ; then
+ if test "$alt_macosx_dir" != "" ; then
+ if docc -I$alt_macosx_dir/include -L$alt_macosx_dir/lib $LDFLAGS -lfaad 2>>$logs ; then
+ has_faad="system"
+ fi
fi
fi
fi
if test "$has_faad" = "no" ; then
- if $cc -o $TMPO $TMPC -I$local_inc/faad -L$local_lib -lfaad -lm 2> /dev/null ; then
+ if docc -I$local_inc/faad -L$local_lib -lfaad -lm ; then
has_faad="local"
fi
fi
@@ -1288,9 +1356,10 @@ fi
#look for FFMPEG support
ffmpeg_cflags=""
-ffmpeg_lflags="-lz -lavcodec -lavformat -lavutil -lswscale -lavdevice"
+ffmpeg_lflags="-lz -lavcodec -lavformat -lavutil -lswscale -lavdevice $ffmpeg_extra_ldflags"
+
if test "$cross_prefix" = "" -a "$pkg_config" != "no"; then
- if $pkg_config --exists libavcodec libavformat libswscale libavdevice libavutil 2> /dev/null ; then
+ if $pkg_config --exists libavcodec libavformat libswscale libavdevice libavutil ; then
ffmpeg_cflags=`$pkg_config --cflags libavcodec libavformat libswscale libavutil libavdevice`
ffmpeg_lflags=`$pkg_config --libs libavcodec libavformat libswscale libavutil libavdevice`
has_ffmpeg="system"
@@ -1304,17 +1373,18 @@ int main(void) {
}
EOF
-if $cc -o $TMPO $TMPC $ffmpeg_cflags $ffmpeg_lflags $LDFLAGS 2> /dev/null ; then
+if docc $ffmpeg_cflags $ffmpeg_lflags $LDFLAGS ; then
old_ffmpeg_inc="no"
else
old_ffmpeg_inc="yes"
cat > $TMPC << EOF
#include
+#include
int main(void) {
AVFrame *f1, *f2;
+ printf("ID %d", AV_CODEC_ID_H264);
f2 = av_frame_clone(f1);
- AV_CODEC_ID_H264;
return 0;
}
EOF
@@ -1323,29 +1393,33 @@ fi
cat > $TMPC << EOF
#include
+#include
int main(void) {
- CODEC_ID_H264;
+ printf("ID %d", CODEC_ID_H264);
return 0;
}
EOF
-if test "$cross_prefix" = "" ; then
- if $cc -o $TMPO $TMPC -I$prefix/include -L$prefix/lib $ffmpeg_lflags $LDFLAGS 2> /dev/null ; then
- has_ffmpeg="system"
- ffmpeg_cflags="-I$prefix/include"
- ffmpeg_lflags="-L$prefix/lib $ffmpeg_lflags"
- elif $cc -o $TMPO $TMPC $ffmpeg_lflags $LDFLAGS 2> /dev/null ; then
- has_ffmpeg="system"
- elif test "$alt_macosx_dir" != "" ; then
- if $cc -o $TMPO $TMPC -I$alt_macosx_dir/include -L$alt_macosx_dir/lib $ffmpeg_lflags $LDFLAGS 2> /dev/null ; then
- has_ffmpeg="system"
- ffmpeg_cflags="-I$alt_macosx_dir/include"
- ffmpeg_lflags="-L$alt_macosx_dir/lib $ffmpeg_lflags"
+if docc -I$prefix/include -L$prefix/lib $ffmpeg_lflags $LDFLAGS ; then
+ has_ffmpeg="system"
+ ffmpeg_cflags="-I$prefix/include"
+ ffmpeg_lflags="-L$prefix/lib $ffmpeg_lflags"
+elif docc $ffmpeg_lflags $LDFLAGS ; then
+ has_ffmpeg="system"
+fi
+if test "$cross_prefix" = "" ; then
+ if test "$has_ffmpeg" = "no" ; then
+ if test "$alt_macosx_dir" != "" ; then
+ if docc -I$alt_macosx_dir/include -L$alt_macosx_dir/lib $ffmpeg_lflags $LDFLAGS 2>>$logs ; then
+ has_ffmpeg="system"
+ ffmpeg_cflags="-I$alt_macosx_dir/include"
+ ffmpeg_lflags="-L$alt_macosx_dir/lib $ffmpeg_lflags"
+ fi
fi
fi
fi
if test "$has_ffmpeg" = "no" ; then
- if $cc -o $TMPO $TMPC -I$local_inc -L$local_lib $ffmpeg_lflags 2> /dev/null ; then
+ if docc -I$local_inc -L$local_lib $ffmpeg_lflags ; then
has_ffmpeg="local"
ffmpeg_cflags="-I$local_inc"
ffmpeg_lflags="-L$local_lib $ffmpeg_lflags"
@@ -1355,12 +1429,13 @@ fi
cat > $TMPC << EOF
#include
#include
+#include
int main(void) {
- CODEC_ID_H264;
+ printf("ID %d", CODEC_ID_H264);
return 0;
}
EOF
-if $cc -o $TMPO $TMPC $ffmpeg_cflags $ffmpeg_lflags 2> /dev/null ; then
+if docc $ffmpeg_cflags $ffmpeg_lflags ; then
is_libav="no"
else
@@ -1372,7 +1447,7 @@ int main(void) {
}
EOF
- if $cc -o $TMPO $TMPC $ffmpeg_cflags $ffmpeg_lflags 2> /dev/null ; then
+ if docc $ffmpeg_cflags $ffmpeg_lflags ; then
is_libav="yes"
else
is_libav="new"
@@ -1384,11 +1459,12 @@ cat > $TMPC << EOF
#include "libavresample/avresample.h"
int main(void) {
AVAudioResampleContext *aresampler = avresample_alloc_context();
+ free(aresampler);
return 0;
}
EOF
-if $cc -o $TMPO $TMPC $ffmpeg_cflags $ffmpeg_lflags -lavresample 2> /dev/null ; then
+if docc $ffmpeg_cflags $ffmpeg_lflags -lavresample ; then
has_libavresample="yes"
else
has_libavresample="no"
@@ -1400,7 +1476,7 @@ freenect_flags=""
freenect_ld="-lfreenect"
has_freenect="no"
if test "$pkg_config" != "no"; then
- if $pkg_config --exists libfreenect 2> /dev/null ; then
+ if $pkg_config --exists libfreenect ; then
freenect_flags=`$pkg_config --cflags libfreenect`
freenect_libs=`$pkg_config --libs libfreenect`
has_freenect="system"
@@ -1415,19 +1491,22 @@ cat > $TMPC << EOF
int main( void ) { return 0; }
EOF
+if docc $LDFLAGS -lfreenect ; then
+ has_freenect="system"
+fi
if test "$cross_prefix" = "" ; then
- if $cc -o $TMPO $TMPC $LDFLAGS -lfreenect 2> /dev/null ; then
- has_freenect="system"
- elif test "$alt_macosx_dir" != "" ; then
- if $cc -o $TMPO $TMPC -I$alt_macosx_dir/include -L$alt_macosx_dir/lib $LDFLAGS -lfreenect 2> /dev/null ; then
- has_freenect="system"
- freenect_flags=-I$alt_macosx_dir/include
- freenect_ld=-L$alt_macosx_dir/lib -lfreenect
+ if test "$has_freenect" = "no" ; then
+ if test "$alt_macosx_dir" != "" ; then
+ if docc -I$alt_macosx_dir/include -L$alt_macosx_dir/lib $LDFLAGS -lfreenect 2>>$logs ; then
+ has_freenect="system"
+ freenect_flags=-I$alt_macosx_dir/include
+ freenect_ld=-L$alt_macosx_dir/lib -lfreenect
+ fi
fi
fi
fi
if test "$has_freenect" = "no" ; then
- if $cc -o $TMPO $TMPC -I$local_inc/freenect -L$local_lib -lfreenect 2> /dev/null ; then
+ if docc -I$local_inc/freenect -L$local_lib -lfreenect ; then
has_freenect="local"
freenect_flags=-I$local_inc/freenect
freenect_ld=-L$local_lib -lfreenect
@@ -1443,13 +1522,13 @@ cat > $TMPC << EOF
int main( void ) { return 0; }
EOF
-if $cc -o $TMPO $TMPC $LDFLAGS -lvorbis 2> /dev/null ; then
+if docc $LDFLAGS -lvorbis ; then
has_vorbis="system"
elif test "$alt_macosx_dir" != "" ; then
- if $cc -o $TMPO $TMPC -I$alt_macosx_dir/include -L$alt_macosx_dir/lib $LDFLAGS -lvorbis 2> /dev/null ; then
+ if docc -I$alt_macosx_dir/include -L$alt_macosx_dir/lib $LDFLAGS -lvorbis 2>>$logs ; then
has_vorbis="system"
fi
-elif $cc -o $TMPO $TMPC -I$local_inc -L$local_lib -lvorbis -lm 2> /dev/null ; then
+elif docc -I$local_inc -L$local_lib -lvorbis -lm ; then
has_vorbis="local"
fi
@@ -1461,13 +1540,13 @@ cat > $TMPC << EOF
int main( void ) { return 0; }
EOF
-if $cc -o $TMPO $TMPC $LDFLAGS -ltheora 2> /dev/null ; then
+if docc $LDFLAGS -ltheora ; then
has_theora="system"
elif test "$alt_macosx_dir" != "" ; then
- if $cc -o $TMPO $TMPC -I$alt_macosx_dir/include -L$alt_macosx_dir/lib $LDFLAGS -ltheora -logg 2> /dev/null ; then
+ if docc -I$alt_macosx_dir/include -L$alt_macosx_dir/lib $LDFLAGS -ltheora -logg 2>>$logs ; then
has_theora="system"
fi
-elif $cc -o $TMPO $TMPC -I$local_inc -L$local_lib -ltheora -logg -lm 2> /dev/null ; then
+elif docc -I$local_inc -L$local_lib -ltheora -logg -lm ; then
has_theora="local"
fi
@@ -1479,13 +1558,13 @@ cat > $TMPC << EOF
int main( void ) { return 0; }
EOF
-if $cc -o $TMPO $TMPC $LDFLAGS -logg 2> /dev/null ; then
+if docc $LDFLAGS -logg ; then
has_ogg="system"
elif test "$alt_macosx_dir" != "" ; then
- if $cc -o $TMPO $TMPC -I$alt_macosx_dir/include -L$alt_macosx_dir/lib $LDFLAGS -logg 2> /dev/null ; then
+ if docc -I$alt_macosx_dir/include -L$alt_macosx_dir/lib $LDFLAGS -logg 2>>$logs ; then
has_ogg="system"
fi
-elif $cc -o $TMPO $TMPC -I$local_inc -L$local_lib -logg -lm 2> /dev/null ; then
+elif docc -I$local_inc -L$local_lib -logg -lm ; then
has_ogg="local"
else
has_vorbis=no
@@ -1502,7 +1581,7 @@ if test "$darwin" = "yes" ; then
int main( void ) { return 0; }
EOF
- if $cc -o $TMPO $TMPC -DLIBOSS_INTERNAL -I$alt_macosx_dir/include/ -I$alt_macosx_dir/include/liboss -L$alt_macosx_dir/lib -loss $LDFLAGS 2> /dev/null ; then
+ if docc -DLIBOSS_INTERNAL -I$alt_macosx_dir/include/ -I$alt_macosx_dir/include/liboss -L$alt_macosx_dir/lib -loss $LDFLAGS 2>>$logs ; then
has_oss_audio="yes"
OSS_CFLAGS="-DLIBOSS_INTERNAL -I$alt_macosx_dir/include/ -I$alt_macosx_dir/include/liboss"
OSS_LDFLAGS="-L$alt_macosx_dir/lib -loss"
@@ -1518,7 +1597,7 @@ else
int main( void ) { return 0; }
EOF
- if $cc -o $TMPO $TMPC 2> /dev/null ; then
+ if docc ; then
has_oss_audio="yes"
else
cat > $TMPC << EOF
@@ -1529,7 +1608,7 @@ EOF
int main( void ) { return 0; }
EOF
- if $cc -o $TMPO $TMPC $LDFLAGS 2> /dev/null ; then
+ if docc $LDFLAGS ; then
has_oss_audio="yes"
fi
fi
@@ -1543,7 +1622,7 @@ has_wx="no"
wx_too_old="no"
if test "$cross_prefix" = "" ; then
- if type wx-config >/dev/null 2>&1; then
+ if type wx-config >/dev/null 2>>$logs; then
wx_version=`wx-config --version | sed 's/[^0-9]//g'`
@@ -1571,7 +1650,7 @@ if test "$cross_prefix" = "" ; then
int main( void ) { return 0; }
EOF
- if $cc $wx_cflags -o $TMPO $TMPCXX $wx_lflags > /dev/null 2>&1 ; then
+ if $cc $wx_cflags -o $TMPO $TMPCXX $wx_lflags > /dev/null 2>>$logs ; then
wx_version=`wx-config --version | sed 's/[^0-9]//g'`
if test "$wx_version" -lt 254 ; then
wx_too_old="yes"
@@ -1585,6 +1664,7 @@ fi
#look for IPv6
cat > $TMPC << EOF
+#include
#include
#include
#include
@@ -1594,11 +1674,14 @@ struct sockaddr_storage saddr;
struct ipv6_mreq mreq6;
getaddrinfo(0,0,0,0);
getnameinfo(0,0,0,0,0,0,0);
+memset(&saddr, 0, sizeof(saddr));
+memset(&mreq6, 0, sizeof(mreq6));
IN6_IS_ADDR_MULTICAST( (struct in6_addr *) 0);
+return 0;
}
EOF
-if $cc -o $TMPE $TMPC $LDFLAGS $extralibs > /dev/null 2>&1 ; then
+if docc $LDFLAGS $extralibs ; then
has_ipv6="yes"
fi
@@ -1612,7 +1695,7 @@ int main( void ) {
}
EOF
-if $cc -o $TMPE $TMPC $LDFLAGS > /dev/null 2>&1 ; then
+if docc $LDFLAGS ; then
has_dvb4linux="yes"
fi
@@ -1624,10 +1707,11 @@ cat > $TMPC << EOF
#include
#include
int main( void ) {
+return 0;
}
EOF
-if $cc -o $TMPE $TMPC $LDFLAGS > /dev/null 2>&1 ; then
+if docc $LDFLAGS ; then
has_xmlrpc="yes"
fi
@@ -1637,10 +1721,11 @@ fi
cat > $TMPC << EOF
#include
int main( void ) {
+return 0;
}
EOF
-if $cc -o $TMPE $TMPC $LDFLAGS > /dev/null 2>&1 ; then
+if docc $LDFLAGS ; then
has_alsa="yes"
fi
@@ -1650,10 +1735,11 @@ fi
cat > $TMPC << EOF
#include
int main( void ) {
+return 0;
}
EOF
-if $cc -o $TMPE $TMPC $LDFLAGS > /dev/null 2>&1 ; then
+if docc $LDFLAGS ; then
has_pulseaudio="yes"
fi
@@ -1663,9 +1749,10 @@ fi
cat > $TMPC << EOF
#include
int main( void ) {
+return 0;
}
EOF
-if $cc -o $TMPE $TMPC $LDFLAGS > /dev/null 2>&1 ; then
+if docc $LDFLAGS ; then
has_jack="yes"
fi
@@ -1678,7 +1765,7 @@ int main( void ) { return 0; }
EOF
directfb_inc="/usr/include/directfb"
directfb_lib="-ldirectfb -lfusion -ldirect"
-if $cc -o $TMPO $TMPC -I$directfb_inc -L$directfb_lib $LDFLAGS 2> /dev/null ; then
+if docc -I$directfb_inc -L$directfb_lib $LDFLAGS ; then
has_directfb="yes"
fi
@@ -1690,7 +1777,7 @@ cat > $TMPC << EOF
int main( void ) { return 0; }
EOF
-if $cc -o $TMPO $TMPC -I$X11_PATH/include -L$X11_PATH/lib $LDFLAGS 2> /dev/null ; then
+if docc -I$X11_PATH/include -L$X11_PATH/lib $LDFLAGS ; then
has_x11="yes"
#look for X11 shared memory support
@@ -1702,7 +1789,7 @@ if $cc -o $TMPO $TMPC -I$X11_PATH/include -L$X11_PATH/lib $LDFLAGS 2> /dev/null
int main( void ) { return 0; }
EOF
- if $cc -o $TMPO $TMPC -I$X11_PATH/include -L$X11_PATH/lib $LDFLAGS 2> /dev/null ; then
+ if docc -I$X11_PATH/include -L$X11_PATH/lib $LDFLAGS ; then
has_x11_shm="yes"
fi
@@ -1714,7 +1801,7 @@ EOF
int main( void ) { return 0; }
EOF
- if $cc -o $TMPO $TMPC -I$X11_PATH/include -L$X11_PATH/lib $LDFLAGS 2> /dev/null ; then
+ if docc -I$X11_PATH/include -L$X11_PATH/lib $LDFLAGS ; then
has_x11_xv="yes"
fi
@@ -1731,7 +1818,7 @@ for opt do
;;
--enable-sdl-static=*) sdl_static="yes"
;;
- --enable-jack=*) has_jack="yes"
+ --enable-jack) has_jack="yes"
;;
--X11-path=*) X11_PATH=`echo $opt | cut -d '=' -f 2`
;;
@@ -1743,7 +1830,7 @@ for opt do
;;
--enable-amr-nb-fixed) has_amr_nb_fixed="yes"
;;
- --disable-pulseaudio=*) has_pulseaudio="no"
+ --disable-pulseaudio) has_pulseaudio="no"
;;
--enable-amr-nb) has_amr_nb="yes"
;;
@@ -1753,7 +1840,7 @@ for opt do
;;
--disable-oggvorbis) has_oggvorbis="no"
;;
- --disable-jack=*) has_jack="no"
+ --disable-jack) has_jack="no"
;;
--disable-alsa) has_alsa="no"
;;
@@ -1777,9 +1864,7 @@ for opt do
;;
--strip) INSTFLAGS="-s $INSTFLAGS"
;;
- --std-allocator) use_std_alloc="yes"
- ;;
- --track-memory) use_memory_tracking="yes"
+ --enable-mem-track) use_memory_tracking="yes"
;;
--enable-tinygl) enable_tinygl="yes"
;;
@@ -1836,12 +1921,12 @@ for opt do
echo
fi
fi
- has_zlib=$tmp_has_zlib
- elif test "$tmp_has_zlib" = "no" ; then
- echo
- echo "WARNING!! : you have forced not to use ZLIB. This will disable some core functionalities of GPAC."
- echo
- has_zlib="force-no"
+ has_zlib=$tmp_has_zlib
+ elif test "$tmp_has_zlib" = "no" ; then
+ echo
+ echo "WARNING!! : you have forced not to use ZLIB. This will disable some core functionalities of GPAC."
+ echo
+ has_zlib="force-no"
fi
;;
--use-ogg=*) has_ogg=${opt#--use-ogg=}
@@ -1854,7 +1939,7 @@ for opt do
;;
--enable-joystick) enable_joystick="yes"
;;
- --enable-pulseaudio=*) has_pulseaudio="yes"
+ --enable-pulseaudio) has_pulseaudio="yes"
;;
--disable-all) has_pulseaudio="no"; has_alsa="no"; disable_core_tools="yes"; disable_3d="yes"; disable_svg="yes"; disable_vrml="yes"; disable_od="yes"; disable_bifs="yes"; disable_bifs_enc="yes"; disable_laser="yes"; disable_seng="yes"; disable_qtvr="yes"; disable_avi="yes"; disable_ogg="yes"; disable_m2ps="yes"; disable_m2ts="yes"; disable_m2ts_mux="yes"; disable_parsers="yes"; disable_import="yes"; disable_export="yes"; disable_swf="yes"; disable_scene_stats="yes"; disable_scene_dump="yes"; disable_scene_encode="yes"; disable_loader_isoff="yes"; disable_od_dump="yes"; disable_od_parse="yes"; disable_isom_dump="yes"; disable_mcrypt="yes"; disable_isoff="yes"; disable_isoff_write="yes"; disable_isoff_hint="yes"; disable_isoff_frag="yes"; disable_streaming="yes"; disable_x3d="yes"; disable_loader_bt="yes"; disable_loader_xmt="yes"; has_dvb4linux="no"; disable_player="yes"; disable_vobsub="yes"; disable_scenegraph="yes"; disable_dvbx="yes"; disable_ttxt="yes"; disable_ttml="yes"; disable_saf="yes"; disable_smgr="yes"; disable_mpd="yes"; disable_dash="yes"; disable_isoff_hds="yes"; disable_hevc="yes"
;;
@@ -2105,9 +2190,9 @@ if test "$disable_3d" = "no" ; then
else
LINK3D="-lGL -lGLU -lX11"
fi
- if $cc -o $TMPO $TMPC $LINK3D $LDFLAGS 2> /dev/null ; then
+ if docc $LINK3D $LDFLAGS ; then
has_opengl="yes"
- elif $cc -o $TMPO $TMPC -I$X11_PATH/include -L$X11_PATH/lib $LDFLAGS 2> /dev/null ; then
+ elif docc -I$X11_PATH/include -L$X11_PATH/lib $LDFLAGS ; then
has_opengl="yes"
INCL3D="-I$X11_PATH/include"
LINK3D="-L$X11_PATH/lib $LINK3D"
@@ -2119,11 +2204,11 @@ fi
cat > $TMPC << EOF
#include
-int main( void ) { int a ; a = TINYGL ; }
+int main( void ) { int a ; a = TINYGL ; return 0;}
EOF
if test "$enable_tinygl" = "yes" ;then
- if $cc -o $TMPO $TMPC $LDFLAGS -lTinyGL 2> /dev/null ; then
+ if docc $LDFLAGS -lTinyGL ; then
has_tinygl="yes"
has_opengl="yes"
LINK3D="-lTinyGL"
@@ -2138,15 +2223,15 @@ cat > $TMPCXX << EOF
int main( void ) { return 0; }
EOF
-if $cc -o $TMPO $TMPCXX -I$xulsdk_path $LDFLAGS 2> /dev/null ; then
+if docxx -I$xulsdk_path $LDFLAGS ; then
has_xul="system"
xul_flags="-I$xulsdk_path $xul_flags"
fi
if test "$pkg_config" != "no"; then
if test "$has_xul" = "no" ; then
- if $pkg_config --exists libxul 2> /dev/null ; then
- if $cxx -o $TMPO $TMPCXX `$pkg_config --cflags libxul` `$pkg_config --libs libxul` ; then
+ if $pkg_config --exists libxul 2>>$logs ; then
+ if docxx -o $TMPO $TMPCXX `$pkg_config --cflags libxul` `$pkg_config --libs libxul` ; then
has_xul="system"
xul_flags="`$pkg_config --cflags libxul` `$pkg_config --libs libxul`"
fi
@@ -2155,13 +2240,13 @@ if test "$pkg_config" != "no"; then
fi
if test "$has_xul" = "no" ; then
- if $cc -o $TMPO $TMPCXX $xul_flags -I$local_inc/gecko-sdk/include $LDFLAGS 2> /dev/null ; then
+ if docxx $xul_flags -I$local_inc/gecko-sdk/include $LDFLAGS ; then
has_xul="local"
xul_flags="-I$local_inc/gecko-sdk/include $xul_flags"
else
#xulrunner directories are sometimes included through js/xul/ff packages
if test ! "$has_js" = "no" -a ! "$has_js" = "local" ; then
- if $cc -o $TMPO $TMPCXX $js_flags $js_lib_pkg $LDFLAGS 2> /dev/null ; then
+ if docxx $js_flags $js_lib_pkg $LDFLAGS ; then
if test "$mozjs_pkgcfg" != "no" ; then
xul_flags=`$pkg_config --cflags $mozjs_pkgcfg`
has_xul="$has_js"
@@ -2179,7 +2264,7 @@ cat > $TMPC << EOF
int main( void ) { return 0; }
EOF
if test "$enable_joystick" = "yes" ;then
- if $cc -o $TMPO $TMPC $LDFLAGS 2> /dev/null ; then
+ if docc $LDFLAGS ; then
has_joystick="yes"
fi
fi
@@ -2196,11 +2281,11 @@ if test "$win32" = "yes" ; then
int main( void ) { return 0; }
EOF
- if $cc -o $TMPO $TMPC $LDFLAGS 2> /dev/null ; then
+ if docc $LDFLAGS ; then
has_mingw_directx="yes"
else
dx_path="$dxsdk_path"
- if $cc -o $TMPO $TMPC -I$dxsdk_path/include -L$dxsdk_path/lib -lddraw 2> /dev/null ; then
+ if docc -I$dxsdk_path/include -L$dxsdk_path/lib -lddraw ; then
has_mingw_directx="yes"
fi
fi
@@ -2221,7 +2306,7 @@ fi
#if test "$cross_prefix" = "" ; then
- if type $sdl_config >/dev/null 2>&1; then
+ if type $sdl_config >/dev/null 2>>$logs; then
cat > $TMPC << EOF
#include
@@ -2236,7 +2321,7 @@ EOF
fi
sdl_cflags=`$sdl_config --cflags`
- if $cc -o $TMPO $sdl_cflags $TMPC $LDFLAGS $sdl_lib_flags > /dev/null 2>&1 ; then
+ if docc $sdl_cflags $LDFLAGS $sdl_lib_flags ; then
_sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
if test "$_sdlversion" -lt 121 ; then
sdl_too_old=yes
@@ -2256,7 +2341,7 @@ if test "$has_sdl" = "no" ; then
fi
if test "$cross_prefix" = "" ; then
- if type $sdl_config >/dev/null 2>&1; then
+ if type $sdl_config >/dev/null 2>>$logs; then
cat > $TMPC << EOF
#include
@@ -2271,7 +2356,7 @@ EOF
fi
sdl_cflags=`$sdl_config --cflags`
- if $cc -o $TMPO $sdl_cflags $TMPC $LDFLAGS $sdl_lib_flags > /dev/null 2>&1 ; then
+ if docc $sdl_cflags $LDFLAGS $sdl_lib_flags ; then
_sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
if test "$_sdlversion" -lt 121 ; then
sdl_too_old=yes
@@ -2298,7 +2383,7 @@ return (*((uint8_t*)(&i))) == 0x67;
}
EOF
- if $cc -o $TMPO $TMPC $LDFLAGS 2>/dev/null ; then
+ if docc $LDFLAGS 2>>$logs ; then
$TMPO && bigendian="yes"
else
echo big/little endian test failed
@@ -2326,6 +2411,22 @@ if test "$static_mp4box" = "yes"; then
has_js="no"
has_jpeg="no"
has_png="no"
+ has_mad="no"
+ has_ft="no"
+ has_openjpeg="no"
+ has_mad="no"
+ has_faad="no"
+ has_xvid="no"
+ has_ffmpeg="no"
+ has_ogg="no"
+ has_theora="no"
+ has_vorbis="no"
+ has_a52="no"
+ has_opensvc="no"
+ has_openhevc="no"
+ has_freenect="no"
+ has_platinum="no"
+ static_build="yes"
fi
if test "$cpu" = "sh4"; then
@@ -2337,45 +2438,45 @@ if test "$cpu" = "sh4"; then
fi
if test "$disable_player" = "yes" ; then
-disable_scenegraph="yes"
+ disable_scenegraph="yes"
fi
if test "$disable_scenegraph" = "yes" ; then
-disable_3d="yes"
-disable_svg="yes"
-disable_vrml="yes"
-disable_x3d="yes"
-disable_bifs="yes"
-disable_bifs_enc="yes"
-disable_laser="yes"
-disable_seng="yes"
-disable_qtvr="yes"
-disable_swf="yes"
-disable_scene_stats="yes"
-disable_scene_dump="yes"
-disable_scene_encode="yes"
-disable_loader_isoff="yes"
-disable_loader_bt="yes"
-disable_loader_xmt="yes"
-disable_streaming="yes"
-disable_player="yes"
-disable_smgr="yes"
-has_js="no"
+ disable_3d="yes"
+ disable_svg="yes"
+ disable_vrml="yes"
+ disable_x3d="yes"
+ disable_bifs="yes"
+ disable_bifs_enc="yes"
+ disable_laser="yes"
+ disable_seng="yes"
+ disable_qtvr="yes"
+ disable_swf="yes"
+ disable_scene_stats="yes"
+ disable_scene_dump="yes"
+ disable_scene_encode="yes"
+ disable_loader_isoff="yes"
+ disable_loader_bt="yes"
+ disable_loader_xmt="yes"
+ disable_streaming="yes"
+ disable_player="yes"
+ disable_smgr="yes"
+ has_js="no"
fi
if test "$disable_mpd" = "yes"; then
-disable_dash="yes"
+ disable_dash="yes"
fi
if test "$disable_od_parse" = "yes" ; then
-disable_loader_isoff="yes"
-disable_loader_bt="yes"
-disable_loader_xmt="yes"
+ disable_loader_isoff="yes"
+ disable_loader_bt="yes"
+ disable_loader_xmt="yes"
fi
if test "$disable_parsers" = "yes" ; then
-has_jpeg="no"
-has_png="no"
+ has_jpeg="no"
+ has_png="no"
fi
#prepare for config.h writing
@@ -2386,23 +2487,22 @@ echo "#define GF_CONFIG_H" >> $TMPH
echo "#define GPAC_CONFIGURATION \"$GPAC_CONFIGURATION\"" >> $TMPH
version="`grep '#define GPAC_VERSION ' \"$source_path/include/gpac/version.h\" | cut -d '"' -f 2`"
-version_major=`grep '#define GPAC_VERSION_MAJOR ' $source_path/include/gpac/version.h | sed -e 's/.*\([0-9]\)\+$/\1/'`
-version_minor=`grep '#define GPAC_VERSION_MINOR ' $source_path/include/gpac/version.h | sed -e 's/.*\([0-9]\)\+$/\1/'`
-version_micro=`grep '#define GPAC_VERSION_MICRO ' $source_path/include/gpac/version.h | sed -e 's/.*\([0-9]\)\+$/\1/'`
+version_major=`grep '#define GPAC_VERSION_MAJOR ' $source_path/include/gpac/version.h | sed 's/[^0-9]*//g'`
+version_minor=`grep '#define GPAC_VERSION_MINOR ' $source_path/include/gpac/version.h | sed 's/[^0-9]*//g'`
+version_micro=`grep '#define GPAC_VERSION_MICRO ' $source_path/include/gpac/version.h | sed 's/[^0-9]*//g'`
soname_version="${version_major}.${version_minor}.${version_micro}"
-if [ -d ".svn" ]; then
- if which svnversion 2> /dev/null
- then
- revision="`svnversion \"$source_path\"`"
- echo "#define GPAC_SVN_REVISION \"$revision\"" > $source_path/include/gpac/revision.h
- else
- echo "Cannot find SVN revision"
- fi
+
+if [ -d ".git" ]; then
+ TAG=$(git describe --tags --abbrev=0 2>>$logs)
+ VERSION=$(echo `git describe --tags --long 2>>$logs || echo "UNKNOWN"` | sed "s/^$TAG-//")
+ BRANCH=$(git rev-parse --abbrev-ref HEAD 2>>$logs ||Â echo "UNKNOWN")
+ revision="$VERSION-$BRANCH"
+ echo "#define GPAC_GIT_REVISION \"$revision\"" > $source_path/include/gpac/revision.h
else
- if [ ! -e "$source_path/include/gpac/revision.h" ]; then
- echo "#define GPAC_SVN_REVISION \"4065\"" > $source_path/include/gpac/revision.h
- fi
+ if [ ! -e "$source_path/include/gpac/revision.h" ]; then
+ echo "#define GPAC_GIT_REVISION \"UNKNOWN-UNKNOWN\"" > $source_path/include/gpac/revision.h
+ fi
fi
echo ""
@@ -2423,7 +2523,6 @@ echo "debug version: $debuginfo"
echo "GProf enabled: $gprof_build"
echo "Static build enabled: $static_build"
echo "Memory tracking enabled: $use_memory_tracking"
-echo "Use standard memory allocator: $use_std_alloc"
echo "Fixed-Point Version: $use_fixed_point"
echo "IPV6 Support: $has_ipv6"
echo "Static Modules: $static_modules"
@@ -2742,12 +2841,6 @@ if test "$has_amr_wb" = "yes" ; then
fi
echo ""
-if test "$use_memory_tracking" = "yes"; then
- echo "!! WARNING: GPAC Memory tracking is enabled !!"
- echo "!! This may corrupt third-party tools using libgpac !!"
- echo "!! Use at your own risk, and only for GPAC benchmarking !!"
- echo ""
-fi
#needs gmon for win32 gprof
if test "$gprof_build" = "yes"; then
@@ -2841,8 +2934,6 @@ fi
if test "$use_memory_tracking" = "yes"; then
echo "#define GPAC_MEMORY_TRACKING" >> $TMPH
-elif test "$use_std_alloc" = "yes"; then
- echo "#define GPAC_STD_ALLOCATOR" >> $TMPH
fi
@@ -2881,9 +2972,11 @@ fi
if test "$win32" = "no" ; then
echo "GPAC_SH_FLAGS=$GPAC_SH_FLAGS" >> config.mak
+ echo "EXE_SUFFIX=" >> config.mak
echo "DYN_LIB_SUFFIX=$DYN_LIB_SUFFIX" >> config.mak
else
- echo "DYN_LIB_SUFFIX=dll" >> config.mak
+ echo "EXE_SUFFIX=.exe" >> config.mak
+ echo "DYN_LIB_SUFFIX=.dll" >> config.mak
fi
@@ -2970,6 +3063,7 @@ echo "DISABLE_DVBX=$disable_dvbx" >> config.mak
echo "DISABLE_AVILIB=$disable_avi" >> config.mak
echo "DISABLE_M2PS=$disable_m2ps" >> config.mak
echo "DISABLE_OGG=$disable_ogg" >> config.mak
+echo "DISABLE_ISOFF=$disable_isoff" >> config.mak
echo "DISABLE_ISOFF_HINT=$disable_isoff_hint" >> config.mak
echo "DISABLE_VOBSUB=$disable_vobsub" >> config.mak
echo "DISABLE_TTXT=$disable_ttxt" >> config.mak
@@ -2996,12 +3090,6 @@ echo "DISABLE_M2TS=$disable_m2ts" >> config.mak
echo "GPAC_USE_TINYGL=$has_tinygl" >> config.mak
echo "OGL_INCLS=$INCL3D" >> config.mak
-if test "$disable_isoff" = "yes" -o "$disable_isoff_write" = "yes" ; then
- echo "DISABLE_ISOFF=yes" >> config.mak
-else
- echo "DISABLE_ISOFF=no" >> config.mak
-fi
-
echo "HAS_OPENGL=$has_opengl" >> config.mak
if test "$has_opengl" = "yes" ; then
@@ -3038,6 +3126,7 @@ echo "CONFIG_AMR_NB_FT=$has_amr_nb" >> config.mak
echo "CONFIG_AMR_WB_FT=$has_amr_wb" >> config.mak
echo "DEBUGBUILD=$debuginfo" >> config.mak
echo "GPROFBUILD=$gprof_build" >> config.mak
+echo "MP4BOX_STATIC=$static_mp4box" >> config.mak
echo "STATICBUILD=$static_build" >> config.mak
echo "CONFIG_IPV6=$has_ipv6" >> config.mak
@@ -3127,8 +3216,6 @@ else
fi
echo "X11_INC_PATH=$X11_PATH/include" >> config.mak
-echo "MP4BOX_STATIC=$static_mp4box" >> config.mak
-
echo "RENOIR_ENABLE=$enable_renoir" >> config.mak
GPAC_ENST_INC=no
@@ -3141,10 +3228,11 @@ if test "$enst_dir" = "enst"; then
cat > $TMPC << EOF
#include
int main( void ) {
+return 0;
}
EOF
- if $cc -o $TMPE $TMPC -L$local_lib -liconv > /dev/null 2>&1 ; then
+ if docc -L$local_lib -liconv ; then
GPAC_ENST=yes
echo "LIBGPAC_ENST=`cd src; ls enst/*.c | sed -e 's/\.c/.o/' | tr -s '\r\n' ' ' ; cd ..`" >> config.mak
else
@@ -3190,7 +3278,7 @@ if test "$source_path_used" = "yes" ; then
ln -sf "$source_path/modules/Makefile" modules/Makefile
for dir in $MOD_DIRS ; do
- if ls "$source_path/$dir/Makefile" > /dev/null 2>&1; then
+ if [ -f "$source_path/$dir/Makefile" ]; then
mkdir -p "$dir"
ln -sf "$source_path/$dir/Makefile" "$dir/Makefile"
fi
@@ -3208,6 +3296,7 @@ else
fi
echo "SRC_PATH=$source_path" >> config.mak
+echo "BUILD_PATH=$build_path" >> config.mak
echo "LOCAL_INC_PATH=$local_inc" >> config.mak
@@ -3222,6 +3311,7 @@ else
echo "config.h is unchanged"
fi
+echo "Check config.log for detection failures"
rm -f $TMPO $TMPC $TMPE $TMPS $TMPCXX $TMPH
diff --git a/doc/INSTALL.w32 b/doc/INSTALL.w32
index 21411fb..a338b23 100644
--- a/doc/INSTALL.w32
+++ b/doc/INSTALL.w32
@@ -30,7 +30,7 @@ II GPAC compilation
If you have not installed the SpiderMonkey (JavaScript, libjs), JPEG or PNG libraries, remove the indicated macros in the file gpac/include/gpac/internal/config_static.h
recompile (libgpac_dll compilation will fail if zlib is not found)
- Note: If you wish to build the fixed-point version of GPAC (not recommended), you will have to modify by hand the file gpac/include/gpac/math.h
+ Note: If you wish to build the fixed-point version of GPAC (not recommended), you will have to modify by hand the file gpac/include/gpac/maths.h
and replace the line
#define GPAC_NO_FIXED_POINT
by the line
diff --git a/doc/configuration.html b/doc/configuration.html
index 8c8bdbd..b1c2ec4 100644
--- a/doc/configuration.html
+++ b/doc/configuration.html
@@ -1,875 +1,903 @@
-
-
-
-
-
- GPAC Configuration documentation
-
-
-
-
-GPAC Configuration file documentation Version 0.5.0
-
-Last Modified $LastChangedDate: 2014-06-10 15:08:09 +0100 (Tue, 10 Jun 2014) $
-
-
-
-
-Overview
-
-Some applications in the GPAC framework use a configuration file shared among modules and reloadable at run time. Modules may use the configuration file as well (to avoid multiple config files). This doc attempts to provide explanations for the different options.
-
-The config file is based on the win32 .ini file model, thus is ordered by sections and keys.
- A section is declared as SectionName . Defined sections are:
-
-General
-RecentFiles
-Systems
-Compositor
-Audio
-Video
-Network
-FontEngine
-Downloader
-HTTPProxy
-Streaming
-MimeTypes
-StreamingCache
-SAXLoader
-XviD
-FFMPEG
-ISOReader
-DVB
-DASH
-ALSA
-Shortcuts
-OpenHEVC
-DSMCC
-
-
-
-A key is declared as keyName =value . The key value is not interpreted and always handled as ASCII text.
-
-
-
-On Windows plateforms , this config file is called "GPAC.cfg" and is usually located in C:\\Program Files\\GPAC. Note that Osmo4 will always create a config file in its own directory when none is found.
-
-
-
-On Windows CE plateform , this config file is called "GPAC.cfg" and is usually located in \\Program Files\\GPAC. Note that Osmo4 / CE will always create a config file in its own directory when none is found.
-
-
-
-On GNU/Linux plateforms , this config file is called ".gpacrc" and is always located at the root of the user home directory (for ex, /home/jean/.gpacrc).
-
-
-
-
-
-Note on module names:
- Module names as given in the config file are names exported by each interface and not name of the physical library file (.dll, .so, ... ). The physical file name can however be used to identify a module - it will then be replaced by the module name.
-
-
-
-
-
-Section "General" Back to top
-
-The General section of the config file holds player specific options.
-
-ModulesDirectory [value: path to directory ]
-
-Specifies the path to modules directory. The MPEG-4 Systems engine cannot be loaded without modules. This option is used by GPAC clients on all platforms.
-
-CacheDirectory [value: path to storage directory ]
-
-Specifies location of temp files. The user must have write access to this location. Although not used by applications, this is used by several modules.
-
-StartupFile [value: filename ]
-
-Specifies file to load upon startup of most clients (Osmo4/MP4Client). If not specified, no file is loaded.
-
-
-LogFile [value: filename ]
-
-Specifies where to output GPAC's log. By default, the logs are written to stdout. Note that GPAC may be compiled without log support. This is not used by MP4Client.
-
-Logs [value: tool[:tool]@level:tool[:tool]@level ]
-
-Specifies log level for each tool. By default, only errors are logged. Available levels are:
-
-quiet : no logging is performed on the tool
-error : only errors are logged
-warning : warnings are also logged.
-info : information messages are also logged
-debug : debug messages are also logged
-
-
-Available tools are:
-
-core : libgpac core
-coding : bitstream formats (audio, video, scene)
-container : container formats (ISO File, MPEG-2 TS, AVI, ...)
-network : network data exept RTP trafic
-rtp : rtp, rtcp and rtsp trafic
-author : authoring tools (hint, import, export)
-sync : terminal sync layer
-codec : terminal codec messages
-parser : scene parsers (svg, xmt, bt) and other
-media : terminal media object management
-scene : scene graph and scene manager
-script : scripting engine messages
-interact : user interaction messages
-compose : composition engine (events, etc)
-cache : HTTP cache
-mmio : Audio/Video HW I/O management
-rti : Run-time info (CPU, mem, ...)
-smil : SMIL timing and animation
-memory : GPAC memory tracker
-audio : Audio renderer and mixers
-module : used by some modules
-mutex : mutex information
-console : console messages, such as script alert() and error notifications
-
-
-
-
-
-
-
-Options defined for Osmo4 (Windows version and wxWidgets version):
-Loop [value: "yes" "no" ]
-
-Specifies whether the presentation has to be restarted when done playing.
-
-ConsoleOff [value: "yes" "no" ]
-
-Specifies whether application messages (script, buffering, download progress) are displayed in the console or not.
-
-SingleInstance [value: "yes", "no" ]
-
-Specifies if the player should be a single instance application or not (Osmo4-Win32 only).
-
-LookForSubtitles [value: "yes" "no" ]
-
-Specifies if Osmo4 shall look for subtitle files when opening a presentation.
-
-ViewXMT [value: "yes" "no" ]
-
-Specifies if scene dumping shall be done in XML (XMT, X3D) or in VRML-like syntax (BT, WRL).
-
-ConfigPanel [value: positive integer ]
-
-Specifies the latest config panel selected by user.
-
-NoMIMETypeFetch [value: "yes", "no" ]
-
-Specifies if the player has to check for mime type when following hyperlinks, or only follow links of known extensions.
-
-Loop [value: "yes", "no" ]
-
-Specifies if the playlist shall be restarted when playback is over.
-
-PLEntry [value: positive integer ]
-
-Indicates active playlist entry when player was last closed. Playlist backup is:
-
-
-"gpac_pl.m3u" on win32 platforms, stored in same directory as application
-".gpac_pl.m3u" on other platforms, stored in user home directory
-
-FillScreen [value: "yes", "no" ]
-
-Specifies if the display area shall fill all available space on screen. WindowsMobile/Symbian only
-
-DisableBackLight [value: "yes", "no" ]
-
-Specifies if the screen backlighting shall be disabled while playing. WindowsMobile/Symbian only
-
-LastWorkingDir [value: "yes", "no" ]
-
-Specifies the directory of the last local file opened. Smartphone Windows only
-
-Browser [value: string ]
-
-Specifies prefered browser for WWW anchors and scene graph viewing - Only used by Osmo4/wxWidgets.
-
-
-
-Section "RecentFiles" Back to top
-
-The "RecentFiles" section of the config file holds last accessed files (hardcoded to no more than 20) in the last access order. The keys are
-the file names and no value is used. This section is only used by GUI clients (osmo4/wxOsmo4)
-
-
-
-Section "Systems" Back to top
-
-The "Systems" section of the config file holds all configuration options for the MPEG-4 Systems engine.
-
-LanguageName [value: string ]
-
-Specifies the user prefered language in readable english. This is used to select streams in case of alternate content in an audio object.
-
-Language3CC [value: 3-char code from ISO 639-2 ]
-
-Specifies the user prefered language as expressed in ISO 639-2. This is used to select streams in case of alternate content in an audio object.
-
-Language2CC [value: 2-char code from ISO 639-1 ]
-
-Specifies the user prefered language as expressed in ISO 639-1. This is used to select streams in case of alternate content in an audio object.
-
-DrawLateFrames [value: "yes" "no" ]
-
-If set, late frames will still be drawn. If not set, the late frames are droped (or executed for systems decoders) untill the decoder output is back in sync. This is by default on to keep better testing heavy content or slow renderers, but should be set to off when needing a better sync or monitoring skipped frames.
-
-ForceSingleClock [value: "yes" "no" ]
-
-One big problem with MP4 files is that the notion of "duration" has been unclear for a long time, and most content available (audio-video files) specifiy a
-wrong BIFS duration. In such a case the movie cannot be controled/seeked into. Another problem with ISMA streaming is that BIFS/OD don't use the same clock as
-audio/video, thus seeking the main timeline does not seek AV media. Setting the ForceSingleClock will handle both cases by using a single timeline for all media
-streams and setting the duration to the one of the longest stream.
-
-ThreadingPolicy [value: "Free" "Single" "Multi" ]
-
-Specifies how media decoders are to be threaded. "Free" lets decoders decide of their threading, "Single" means that all decoders are managed in a single thread performing scheduling and priority
-handling and "Multi" means that each decoder runs in its own thread.
-
-Priority [value: "low" "normal" "high" "real-time" ]
-
-Specifies the priority of the decoders (priority is applied to decoder thread(s) regardless of threading mode).
-
-TimeSlice [value: unsigned integer ]
-
-Specifies the target maximum time (in ms) of one cycle of the media manager (the media manager will attempts to call all the active decoders within this time. Depending on the threading mode this option can be ignored;
-
-ModuleUnload [value: "yes" "no" ]
-
-Specifies whether modules should be unloaded if not used or not. Default: "yes".
-
-ResyncLateClock [value: unsigned integer ]
-
-Specifies the threshold after which late clocks are resynchronized to timestamps for OCR streams. By default, no threashold (0) is used and clocks are never resynchronized. This allows to
-resync clocks to the media owning the clock when the decoding is really too slow, and should only be used for debugging purposes.
-
-NoVisualThread [value: "yes" "no" ]
-
-Specifies whether the visual rendering is done in the main codec manager or in a dedicated thread.
-
-DefAudioDec , DefVideoDec and DefImageDec [value: string ]
-
-Specifies which module to use by default for audio/video/image decoding. The string is the name of the module to be used (same considerations as other modules, cf introduction).
-
-codec_XX _XX [value: string ]
-
-Allows to specify default media module (audio/video) per stream type and object type. This is usefull if you have more than one decoder for a given type (ex, XviD and FFMPEG for MPEG-4 visual SP). The syntax is:
- codec_AA _BB =modulename
-where AA is the hexadecimal MPEG-4 streamType value for the codec (04=visual, 05=audio) and BB is the hexadecimal MPEG-4 objectTypeIndication of the media (0x20 = MPEG-4 video, 0x40=MPEG-4 Audio, ...).
-The string is the name of the module to be used (same considerations as other modules, cf introduction).
-
-
-
-Section "Compositor" Back to top
-
-The "Compositor" section of the config file holds all configuration options for the compositor (logical rendering engine).
-
-Raster2D [value: string ]
-
-Specifies the 2D rasterizer to use for vectorial drawing. Same as above, this module cannot be reloaded during a presentation.
-FrameRate [value: float ]
-
-Specifies the simulation frame-rate of the presentation - this value is also used by the MPEG-4 Systems engine to determine when a BIFS frame is mature for decoding.
-AntiAlias [value: "None" "All" "Text" ]
-
-Specifies antialiasing settings - whether the setting is applied or not depends on the graphics module / graphic card.
-
-
-"None" : no anti-aliasing
-"Text" : anti-aliasing for text only
-"All" : complete anti-aliasing
-
-HighSpeed [value: "yes" "no" ]
-
-Specifies whether rendering should target speed or quality - whether the setting is applied or not depends on the renderer, graphics module / graphic card.
-ForceSceneSize [value: "yes" "no" ]
-
-Forces the scene to resize to the biggest bitmap available if no size info is given in the BIFS configuration.
-StressMode [value: "yes" "no" ]
-
-Specifies that the renderer runs in worst case scenario, recomputing display lists and reloading textures (sending them to graphics card) at each frame even when no change has occured.
-BoundingVolume [value: "None" "Box" "AABB" ]
-
-Specifies whether the bounding volume of an object shall be drawn or not. Note that the 2D renderer only uses rectangles as bounding volumes. The "AABB" value is used by the
-3D renderer only, and specifies the object bounding-box tree shall be drawn.
-ColorKey [value: unsigned hexadecimal integer, formated as AARRGGBB ]
-
-Specifies the color key to use for windowless rendering. GPAC currently doesn't support true alpha blitting to desktop due to limitations in most windowing toolkit, it therefore uses color keying mechanism. The alpha part of the key is used for global transparency of GPAC's output, if supported.
-
-BackColor [value: unsigned hexadecimal integer, formated as AARRGGBB ]
-
-Specifies the background color to use when displaying transparent images or video with no scene compoistion instructions.
-
-DrawMode [value: "immediate" "defer" "defer-debug" ]
-
-Specifies whether immediate drawing should be used or not. In immediate mode, the screen is completely redrawn at each frame. In defer mode
-object positioning is tracked from frame to frame and dirty rectangles info is collected in order to redraw the minimal amount of the screen buffer. Whether
-the setting is applied or not depends on the graphics module (currently all modules handle both mode). Defer Debug mode only renders changed areas.
-ScalableZoom [value: "yes" "no" ]
-
-Specifies whether scalable zoom should be used or not. When scalable zoom is enabled, resizing the output window will also recompute all vectorial objects. Otherwise only the final buffer is stretched.
-DisableYUV [value: "yes" "no" ]
-
-Disables YUV hardware support (YUV hardware support may not be available for the current video output module).
-TextureFromDecoderMemory [value: "yes" "no" ]
-
-Allows video textures to be build directly from video decoder internal buffers. This may increase performances on some systems. Default is no.
-
-
-
-ForceOpenGL [value: "always", "disable", "hybrid", "raster" ]
-
-Specifies that 2D rendering will be performed by OpenGL rather than raster 2D. This will involve polygon tesselation which may not be supported on all platforms, and 2D graphics will not loo as nice as 2D mode. The hybrid mode performs software drawing of 2D graphics with no textures (better quality) and uses OpenGL for all textures. The raster mode only uses OpenGL for pixel IO but does not perform polygin fill (no tesselation) (slow, mainly for test purposes).
-DefaultNavigationMode [value: "Walk", "Fly", "Examine" ]
-
-Overrides the default navigation mode of MPEG-4/VRML (Walk) and X3D (Examine).
-RasterOutlines [value: "yes" "no" ]
-
-Specifies that outlining shall be done through OpenGL pen width rather than vectorial outlining.
-PolygonAA [value: "yes" "no" ]
-
-Specifies whether polygon antialiasing should be used in full antialiasing mode. If not set, only lines and points antialiasing are used.
-DisableBackFaceCulling [value: "yes" "no" ]
-
-Specifies whether backface culling shall be disable or not. If not set, backface culling is performed.
-Wireframe [value: "WireNone" "WireOnly" "WireOnSolid" ]
-
-Specifies wireframe drawing options:
-
-"WireNone" : objects are drawn as solid
-"WireOnly" : objects are drawn as wireframe only
-"WireOnSolid" : objects are drawn as solid and wireframe is then drawn
-
-DisableRectExt [value: "yes" "no" ]
-
-Specifies whether OpenGL rectangular texture extension (GL_EXT_texture_rectangle or GL_NV_texture_rectangle) shall be used or not.
-
-"yes": textures whose dimensions are not power of two are rescaled except if hardware support non-power-of-two textures (GL_ARB_texture_non_power_of_two) natively.
-"no": if extension is available, textures are used without rescaling. Note that in this case texture transformations are disabled.
-
-EmulatePOW2 [value: "yes" "no" ]
-
-Enables power of 2 emulation. Ignored if openGL rectangular texture extension is enabled.
-
-"yes": video texture is not resized but emulated with padding. This usually speeds up video mapping on shapes but disables texture transformations.
-"no": video is resized to a power of 2 texture when mapping to a shape.
-
-DisableGLUScale [value: "yes" "no" ]
-
-Disables usage of gluScaleImage, which may be slower but nicer than GPAC's software stretch routines.
-TextureTextMode (value: "Default", "Never", "Always" ]
-
-Specifies whether text shall be drawn to a texture and then rendered or directly rendered. Using textured text can improve text rendering in 3D and also improve text-on-video like content. Default value will use texturing for OpenGL rendering.
-OpenGLExtensions [value: string ]
-
-Read-only option listing the OpenGL extensions supported by the GL driver. Only valid after the 3D renderer has been used.
-
-StereoType [value: "None", "SideBySide", "TopToBottom", "Anaglyph", "Columns", "Rows", "SPV19", "Custom" ]
-
-Specifies the stereo output type (default "None"). If your graphic card does not support OpenGL shaders, only SideBySide and TopToBottom modes will be available.
-
-"SideBySide": images are displayed side by side from left to right.
-"TopToBottom": images are displayed from top (laft view) to bottom (right view).
-"Anaglyph": Standard color anaglyph (red for left view, green and blue for right view) is used.
-"Columns": images are interleaved by columns, left view on even columns and left view on odd columns.
-"Rows": images are interleaved by columns, left view on even rows and left view on odd rows.
-"SPV19": images are interleaved by for SpatialView 19'' 5 views display, fullscreen mode.
-"Custom": images are interleaved according to the shader specified by InterleaverShader
-
-
-NumViews [value: unsigned integer ]
-
-Specifies the number of views to use in stereo mode. If mode is "Anaglyph", "Columns" or "Rows", the number of views is forced to 2.
-
-InterleaverShader [value: path to fragment shader file ]
-
-Specifies the fragment shader file to use for view interleaving. Each view is rendered in its own texture. The shader is exposed each view as uniform sampler2D gfViewX , where X is the view number starting from the left (gfView1 ).
-
-ReverseViews [value: "yes", "no" ]
-
-Specifies if the view order should be reversed (from right to left) or not.
-EyeSeparation [value: float ]
-
-Specifies the eye separation in cm (distance between the cameras). Default: 6.3 cm.
-CameraLayout [value: "OffAxis", Linear", "Circular" ]
-
-Specifies the camera layout. The default value is OffAxis in (auto-)stereo modes, ignored in mono mode.
-ViewDistance [value: integer ]
-
-Specifies the distance in cm between the camera and the zero-disparity plane. There is currently no automatic calibration of depth in GPAC.
-
-
-
-
-
-Section "Audio" Back to top
-The "Audio" section of the config file holds all configuration options for the audio rendering engine and hardware.
-DriverName [value: string ]
-
-Specifies the driver to use for audio rendering. This driver cannot be reloaded at run-time, the complete system must be restarted.
-ForceConfig [value: "yes" "no" ]
-
-Forces a given sound card configuration to be used. If not set the sound card will be setup to use 2 audio buffers of 1024 samples each.
-This may not work properly on some audio cards due to hardware latency, therefore forcing the config may be very usefull.
-NumBuffers [value: positive integer, 0 forbidden ]
-
-When config is forced, specifies the number of audio buffers to allocate (audio buffers are played in ring).
-TotalDuration [value: positive integer, 0 forbidden ]
-
-When config is forced, specifies the total audio buffer size in milliseconds. Be aware that the longer the audio buffer is, the longer the audio latency will be when pausing an
-audio object. The quality of fast forward audio playback will also be degradated when using large audio buffers.
-NoResync [value: "yes" "no" ]
-
-Disables audio resynchronization: audio data is never dropped but may get out of sync.
-DisableMultiChannel [value: "yes" "no" ]
-
-Disables audio multichannel output and always downmix to stereo. This may be usefull if the multichannel output behaves weirdly.
-DisableNotification [value: "yes" "no" ]
-
-Disables usage of audio buffer notifications when supported (currently only DirectSound supports it). If DirectSound audio sounds weird try without notifications.
-Volume [value: integer (0-100)]
-
-Default audio volume used when launching GPAC.
-Pan [value: integer (0-100)]
-
-Default audio stereo balance used when launching GPAC - 0 for full left, 100 for full right, 50 for balanced.
-Filter [value: string]
-
-Defines a set of audio filters. Audio filters are declared as a list of strings separated with ";;". The exact syntax of the string is filter specific.
-
-
-
-
-Section "Video" Back to top
-The "Video" section of the config file holds all configuration options for the video renderer and hardware.
-DriverName [value: string ]
-
-Specifies the driver to use for video memory access. This driver cannot be reloaded at run-time, the complete system must be restarted.
-SwitchResolution [value: "yes" "no" ]
-
-Specifies fullscreen resolution mode. If enabled, selects smallest video resolution larger than scene size, otherwise use current video resolution.
-HardwareMemory [value: "Auto" "Always" "Never" ]
-
-Only valid for 2D renderer. Specifies if main video backbuffer is always on hardware, always on system memory or selected by GPAC (default mode). Depending on the scene type, this may drastically change the playback speed.
-DisableColorKeying [value: "yes" "no" ]
-
-Only valid for 2D renderer. Specifies if partial overlays should be disabled. If not disabled, hardware color keying for overlays is tested and used if present. Otherwise, only the top-most video with no overlapping objects will be drawn using overlays. Default value is "no".
-UseGLDoubleBuffering [value: "yes" "no" ]
-
-Specifies if OpenGL double buffering shall be used. Default is "no".
-GLNbBitsPerComponent [value: positive integer ]
-
-Specifies the number of bits per color component. Default is 5.
-GLNbBitsDepth [value: positive integer ]
-
-Specifies the number of bits for the depth buffer. Default is 16.
-X113DOffscreenMode [value: "Window" "VisibleWindow" "Pixmap" ]
-
-Specifies the type of OpenGL offscreen rendering in X11. Default mode is "Pixmap".
-
-"Window" : A hidden window is used to perform offscreen rendering. Depending on your video driver and X11 configuration, this may not work.
-"VisibleWindow" : A visible window is used to perform offscreen rendering. This can be usefull while debugging.
-"Pixmap" : An X11 Pixmap is used to perform offscreen rendering. Depending on your video driver and X11 configuration, this may not work and can even crash the player.
-
-
-
-
-
-Section "Network" Back to top
-The "Network" section of the config file holds all configuration options for the network used by modules and systems engine.
-AutoReconfigUDP [value: "yes" "no" ]
-
-Specifies if network manager shall reconnect a scene if UDP is not present.
-DataTimeout [value: positive integer ]
-
-Specifies timeout in ms befor initial media buffering aborts. Default terminal value is 20000 (20 seconds).
-UDPNotAvailable [value: "yes" "no" ]
-
-Specifies if UDP traffic is not available. This is automatically set by GPAC if AutoReconfigUDP is set.
-UDPTimeout [value: positive integer ]
-
-Specifies timeout in ms for initial UDP detection. Once a UDP packet is recieved the timeout is ignored.
-BufferLength [value: positive integer ]
-
-Specifies the length of the decoding buffer in milliseconds. The client will wait for the buffer to be filled before starting decoding. A module may decide to use a different value based on protocol and network jitters.
-RebufferLength [value: positive integer ]
-
-Specifies rebuffering length of the decoding buffer in milliseconds. Whenever the decoding buffer fullness is less than this value, the object clock is paused and
-the stream rebuffered till BufferLength. Therefore a value of 0 means no rebuffering. A module may decide to use a different value based on protocol and network jitters.
-
-MobileIP [value: IP Address ]
-
-Specifies a Mobile IP interface overriding the default IP. If set, all sockets will be locally bound to this IP address.
-
-DefaultMCastInterface [value: IP Address ]
-
-Specifies a default IP interface for Multicast overriding the default IP.If not set, the multicast will be setup using the default IP.
-
-HTTPRebuffer [value: positive integer ]
-
-Specifies the default HTTP rebuffer time in ms. When playback position reaches download position, playback will be paused if this integer is not zero. Playback will resume once the HTTPRebuffer ms of playback are available. Default value is 5000 ms.
-
-HTTPAutoRebuffer [value: "yes", "no" ]
-
-Specifies whether auto rebuffering is used. When auto-rebuffering is used, playback only resumes when estimated time to download the rest of the movie is less than remaining time of the playback. Default value is no.
-
-
-
-
-
-Section "FontEngine" Back to top
-The "FontEngine" section of the config file holds all configuration options for the font handling. The GPAC rendering module handles text through vectorial outline, allowing graphics module development without having to
-integrate text rendering which is always heavy work.
-FontReader [value: string ]
-
-Specifies the module to use for font handling. This module cannot be reloaded at run-time, GPAC must be restarted.
-WaitForFontLoad [value: "yes" "no" ]
-
-Forces to wait for SVG fonts to be loaded before displaying frames - default is "no".
-FontDirectory (value: path to TrueType (*.ttf, *.ttc) font directory ]
-
-Specifies the directory where fonts are located - currently only one directory can be specified (however nothing stops a font module from using a private directory).
-Note:
-The freetype module will scan the entire sub-directories for fonts.
-
-FontSerif [value: string ]}: specifies default SERIF font.
-FontSans [value: string ]}: specifies default SANS font.
-FontFixed [value: string ]}: specifies default fixed font.
-
-Note:
-The FreeType module uses this section to cache familly names to font file name associations.
-
-
-
-
-Section "Downloader" Back to top
-The "Downloader" section of the config file holds all configuration options for file downloading and caching.
-CleanCache [value: "yes" "no" ]
-
-Specifies whether downloaded files shall be removed once used.
-DisableCache [value: "yes" "no" ]
-
-Specifies whether HTTP caching instructions are disabled or not.
-MaxRate [value: positive integer ]
-
-Specifies a maximum data rate in kilo bits per seconds for file downloading. This is used for simulation purposes. A value of 0 means no rate restriction.
-UserAgent [value: string ]
-
-Specifies an alternate user agent (default one is "GPAC $VERSION").
-HTTPHeadTimeout [value: positive integer ]
-
-Specifies timeout in milliseconds before considering HEAD request failed. 0 means no HEAD request is issued, only GET.
-
-
-
-Section "HTTPProxy" Back to top
-The "HTTPProxy" section of the config file holds configuration option for HTTP proxy adressing. Currently only one proxy can be enabled, and no URI selection is done.
-Enabled [value: "yes" "no" ]
-
-Specifies whether the proxy should be used or not when downloading files.
-Name [value: string ]
-
-Specifies the proxy name (IP address or resolved name) without protocol identifier (eg, no "http://"). If not present, the proxy is disabled.
-Port [value: positive integer ]
-
-Specifies the port to use with the proxy. If no port is specified, the default HTTP port (80) is used.
-
-
-
-Section "Streaming" Back to top
-The "Streaming" section of the config file holds all configuration options for real-time streaming using IETF SDP/RTSP/RTP/RTCP protocols.
-DefaultPort [value: unsigned short ]
-
-Specifies the default port to use when connecting to a server (ignored if a port is specified in the url) if the port is 80 or 8080 (HTTP), the client will connect to the
-RTSP server through an HTTP tunnel, and transport will take place on the RTSP connection.
-ReorderSize [value: positive integer ]
-
-Size of the RTP reordering buffer - 0 means no reordering. Ignored when transport takes place on the RTSP connection. The bigger this value, the longer the reordering delay will be.
-RTPoverRTSP [value: "yes" "no" "OnlyCritical" ]
-
-Specifies whether RTP packets should be carried on the RTSP connection (TCP or UDP), or carried on UDP. If the connection port is an HTTP port, this value is assumed to be true. If set to OnlyCritical , transport will take place on TCP only if a critical media (eg, neither audio nor video) is found in the session.
-RTSPTimeout [value: positive integer ]
-
-Specifies connection timeout with the server: an RTSP request is considered as failed when the timeout expires.
-ForceFirstPort [value: positive integer ]
-
-Specifies first port for RTP channels. If not set, the default first port used by GPAC is 7040.
-NATKeepAlive [value: positive integer ]
-
-Specifies the maximum inactivity period in milliseconds for RTP sockets. If no data is received after this period, an empty RTP packet will be sent in order to keep any NAT alive. If 0 (default), disables NAT keep-alive packets.
-ForceMulticastIP [value: IP4 or IP6 address ]
-
-Forces the specified multicast address to be used instead of the regular unicast. Note that some servers may not support multicast initiation by the client.
-ForceMulticastTTL [value: Positive integer ]
-
-Indicates the TTL to use when the client initiates the multicast. Default value is 127.
-FirstPacketDrop [value: positive integer ]
-
-Specifies the sequence number of the first RTP packet to be droped - 0 means no packet drop. Used for packet drop simulation tests.
-PacketDropFrequency [value: positive integer ]
-
-Specifies the frequency at which SL packets are droped. If value is 20, one packet every 20 recieved packets will be droped. Used for packet drop simulation tests.
-
-
-
-
-Section "MimeTypes" Back to top
-This section is used to keep MIME types and file associations for GPAC modules.
- The format of the key is:
-mimeType =" fileExt1 filexExt2 .. filexExtN" " MimeType description" ModuleName
-
-The description is used for GUI purposes (open file dialogs). You may modify the file extension list to support your own extensions.
-MIME Type is always checked when processing a remote ressource (eg http file) in order to load the appropriated modules.
-If MIME type is not available, provided extensions are first checked, then all input modules are queried.
-
-
-
-
-
-Section "StreamingCache" Back to top
-The "StreamingCache" section of the config file holds all configuration options for the streaming cache. Streaming cache allows for recording of
-live sources such as RTP/RTSP sessions and internet radios. This is currently just an experimental feature in GPAC.
-RecordDirectory [value: path ]
-
-Specifies path for recorded files. Cached data is written directly to disk (no re-interleaving or similar processes).
-If not specified, the default cache directory (cf General ) is used.
-BaseFileName [value: string ]
-
-Specifies the base name for recorded files. If not present in configuration file, the service name (URL) is used.
-KeepExistingFiles [value: "yes" "no" ]
-
-Specifies if cached files with same name should be kept or not. If not, an integer number is added to the cached file name, the higest number for the latest file.
-
-
-
-
-Section "SAXLoader" Back to top
-The "SAXLoader" section of the config file holds all configuration options for XML SAX parsing of SVG, XMT and X3D files.
-Progressive [value: "yes" "no" "DOM" ]
-Specifies XML parsing mode used by different file loaders using the SAX parser.
-
-"yes" : SAX parsing is used with progressive loading of the document.
-"no" : SAX parsing is used, document will first be completely downloaded.
-"DOM" : DOM parsing is used, document will first be completely downloaded. Only supported by libXML2 plugin, otherwise handled as "no".
-
-MaxDuration [value positive integer ]
-
-Specifies the maximum amount of time the SAX parser should spent loading a portion of the document. Only used with SAX Progressive mode
-
-
-
-
-Section "XviD" Back to top
-The "XviD" section of the config file holds all configuration options for the XviD codec.
-PostProc [value: "FilmEffect" "Deblock_Y" "Deblock_UV" ]
-
-Specifies filters to apply when decoding video. The string is a list of filters separated with a space character.
-
-"FilmEffect" : xvid 1.0.0 filmEffect.
-"Deblock_Y" : Y plane deblocking filter.
-"Deblock_UV" : UV plane deblocking filter.
-
-Threaded [value "yes" "no" ]
-Specifies whether the decoder should run in its own thread or not.
-
-
-
-
-Section "FFMPEG" Back to top
-The "FFMPEG" section of the config file holds all configuration options for the FFMPEG demuxer and decoder.
-DataBufferMS [value: positive integer ]
-
-Specifies the amount of video/audio data (in milliseconds) to be bufferer before starting decoding. For developpers only.
-IOBufferSize [value: positive integer ]
-
-Specifies the size (in bytes) of the buffer used to fecth data from network (http playback only). Default size is 8192 bytes.
-
-
-
-
-Section "ISOReader" Back to top
-The "ISOReader" section of the config file holds all configuration options for the ISO Media File demuxer.
-IgnoreMPEG-4ForBrands [value: Full 4CC or 4CC pattern (abc* ab*) ]
-
-Ignores all MPEG-4 systems tracks and IOD for files showing the listed brands in their compatible brand list.
-
-
-
-
-Section "DVB" Back to top
-The "DVB" section of the config file holds all configuration options for DVB playback on GNU/Linux systems.
-ChannelsFile [value: Absolute file path ]
-
-Specifies the DVB channels configuration file as produced by dvbtools' scan util.
-
-
-
-
-Section "DASH" Back to top
-The "DASH" section of the config file holds all configuration options for DASH or HLS/M3U8 playback.
-KeepFiles [value: yes, no ]
-
-Specifies whether downloaded files should not be deleted.
-AutoSwitchCount [value: positive integer ]
-
-For debug purposes, instructs the player to switch representation every N segments. If 0 (default), switching is disabled.
-BufferMode [value: segments, minBuffer, none ]
-
-Selects buffer mode:
-
-segments: buffers complete segments as indicated in MPD before handing them to the player.
-minBuffer: asks the player to buffer media for the time indicated in the MPD (default mode), but segments are not pre-buffered.
-none: uses the player settings for buffering.
-
-
-DisableSwitching [value: yes, no ]
-
-Disables automatic adaptation logic. Default is no
-MemoryStorage [value: yes, no ]
-
-Files are only stored in memory and destroyed after playback, no disk IO is used. Default is yes
-UseMaxResolution [value: yes, no ]
-
-Forces the player to set the output video resolution to the max resolution available instead of resizing the window. Default is yes
-UseScreenResolution [value: yes, no ]
-
-Disables all resolutions that are higher than the screen resolution. Default is yes
-StartRepresentation [value: minBandwidth, maxBandwidth, minQuality, maxQuality ]
-
-Instructs the DASH client to start playing the indicated representation before doing any switching. Default is minBandwidth.
-InitialTimeshift [value: positive integer ]
-
-If between 0 and 100, indicates the percentage of the timeshift buffer when starting playback.
-If more than 100, indicates the number of milliseconds to rewind in the timeshift buffer when starting playback.
-Default is 0 to tune to the live point.
-LowLatency [value: always, chunk, no ]
-
-Sets low-latency mode enabled. In low-latency mode, media data is parsed as soon as possible while segment is being downloaded. Default is no.
-If chunk is selected, media data is re-parsed at each HTTP 1.1 chunk end. If always is selected, media data is re-parsed as soon as HTTP data is received.
-AllowAbort [value: yes, no ]
-
-Enables aborts of HTTP transfer when rate gets too low. This may result in a packet drops. Default is no.
-UseServerUTC [value: yes, no ]
-
-Enables using Server-UTC HTTP header to compensate any drift between client and server. Default is yes.
-DebugAdaptationSet [value: integer ]
-
-Plays only the adaptation set indicated by its index in the MPD. If index is negative, all sets are used (default mode).
-
-
-
-
-
-Section "ALSA" Back to top
-The "ALSA" section of the config file holds all configuration options of the ALSA audio output module on GNU/Linux systems.
-DeviceName [value: string ]
-
-Specifies the ALSA device to use. Default device is "hw:0,0".
-
-
-
-
-Section "StreamingText" Back to top
-The "StreamingText" section of the config file holds all configuration options for the 3GPP/MPEG-4 Streaming Text decoder.
-UseTexturing [value: "yes" "no" ]
-
-Specifies whether the text shall be drawn using an intermediate texture or not.<OutlineText [value: "yes" "no" ]
-
-Specifies whether the text shall be drawn with a black thin outline or not.
-
-
-
-
-
-Section "Shortcuts" Back to top
-The "Shortcuts" section of the config file holds all shortcuts in GPAC. You can define a shorcut for an action as:
-'action'='keyname' or 'action'='ctrl+keyname' or 'action'='alt+keyname' or "='action'='ctrl+alt+keyname'
-Shift is not supported as a key modifier, and case is insensitive.
-Currently defined actions are as follows:
-Play or Pause
-Stop
-Step
-Exit
-Mute
-VolumeUp
-VolumeDown
-JumpForward
-JumpBackward
-JumpStart
-JumpEnd
-FastForward
-FineForward
-SlowForward
-FastRewind
-FineRewind
-SlowRewind
-Next
-Previous
-
-
-
-
-Section "DSMCC" Back to top
-
-The "DSMCC" section of the config file holds the configuration option for the processing of DSMCC data.
-
-Activated [value: "true" "false" ]
-
-Specifies if the DSMCC data will be processed (true). It implies creations of directories and files in the temp directory.
-
-
-
-
-
-Section "OpenHEVC" Back to top
-
-The openHEVC section of the config file holds the configuration option for the OpenHEVC decoder.
-
-NumThreads [value: unsigned integer]
-
-Specifies the number of threads to allocate to the OpenHEVC decoder. Default is the number of detected cores minus one, or one if core detection fails.
-ThreadingType [value: frame , wpp , frame+wpp ]
-
-Specifies the threading type for the openHEVC decoder. Default is frame (wpp disabled).
-CBUnits [value: unsigned integer ]
-
-Specifies the number of decoded frames in memory before display. Default value is 4.
-PackHFR [value: yes , no ]
-
-Packs 4 consecutive frames in a single 4x frame.
-
-
-
-
-
-Section "DirectFB" Back to top
-
-The "DirectFB" section of the config file holds the configuration options for the DirectFB output module. You may also want to check the official documentation .
-
-DisableAcceleration [value: "yes" "no" ]
-
-Forces to disable hardware acceleration.
-DisableDisplay [value: "yes" "no" ]
-
-Specifies the DisableDisplay parameter value.
-FlipSyncMode [value: "waitsync" "wait" "sync" "swap" ]
-
-Specifies the flip sync mode.
-DisableBlit [value: "yes" "no" ]
-
-Forces to disable hardware blitting.
-WindowMode [value: "X11" "SDL" ]
-
-Specifies the underlying windowing library.
-
-
-
+
+
+
+
+
+ GPAC Configuration documentation
+
+
+
+
+GPAC Configuration file documentation Version 0.5.2-dev
+
+
+
+
+
+Overview
+
+Some applications in the GPAC framework use a configuration file shared among modules and reloadable at run time. Modules may use the configuration file as well (to avoid multiple config files). This doc attempts to provide explanations for the different options.
+
+The config file is ordered by sections and keys.
+ A section is declared as SectionName . Defined sections are:
+
+General
+RecentFiles
+Systems
+Compositor
+Audio
+Video
+Network
+FontEngine
+Downloader
+HTTPProxy
+Streaming
+MimeTypes
+StreamingCache
+SAXLoader
+XviD
+FFMPEG
+ISOReader
+DVB
+DASH
+ALSA
+Shortcuts
+DSMCC
+OpenHEVC
+DirectFB
+DektecVideo
+
+
+
+A key is declared as keyName =value . The key value is not interpreted and always handled as ASCII text.
+
+
+
+On Windows plateforms , this config file is called "GPAC.cfg" and is usually located in C:\\Program Files\\GPAC. Note that Osmo4 will always create a config file in its own directory when none is found.
+
+
+
+On Windows CE plateform , this config file is called "GPAC.cfg" and is usually located in \\Program Files\\GPAC. Note that Osmo4 / CE will always create a config file in its own directory when none is found.
+
+
+
+On GNU/Linux plateforms , this config file is called ".gpacrc" and is always located at the root of the user home directory (for ex, /home/jean/.gpacrc).
+
+
+
+
+
+Note on module names:
+ Module names as given in the config file are names exported by each interface and not name of the physical library file (.dll, .so, ... ). The physical file name can however be used to identify a module - it will then be replaced by the module name.
+
+
+
+
+
+Section "General" Back to top
+
+The General section of the config file holds player specific options.
+
+ModulesDirectory [value: path to directory ]
+
+Specifies the path to modules directory. The MPEG-4 Systems engine cannot be loaded without modules. This option is used by GPAC clients on all platforms.
+
+CacheDirectory [value: path to storage directory ]
+
+Specifies location of temp files. The user must have write access to this location. Although not used by applications, this is used by several modules.
+
+StartupFile [value: filename ]
+
+Specifies file to load upon startup of most clients (Osmo4/MP4Client). If not specified, no file is loaded.
+
+
+LogFile [value: filename ]
+
+Specifies where to output GPAC's log. By default, the logs are written to stdout. Note that GPAC may be compiled without log support. This is not used by MP4Client.
+
+Logs [value: tool[:tool]@level:tool[:tool]@level ]
+
+Specifies log level for each tool. By default, only errors are logged. Available levels are:
+
+quiet : no logging is performed on the tool
+error : only errors are logged
+warning : warnings are also logged.
+info : information messages are also logged
+debug : debug messages are also logged
+
+
+Available tools are:
+
+core : libgpac core
+coding : bitstream formats (audio, video, scene)
+container : container formats (ISO File, MPEG-2 TS, AVI, ...)
+network : network data exept RTP trafic
+rtp : rtp, rtcp and rtsp trafic
+author : authoring tools (hint, import, export)
+sync : terminal sync layer
+codec : terminal codec messages
+parser : scene parsers (svg, xmt, bt) and other
+media : terminal media object management
+scene : scene graph and scene manager
+script : scripting engine messages
+interact : user interaction messages
+compose : composition engine (events, etc)
+cache : HTTP cache
+mmio : Audio/Video HW I/O management
+rti : Run-time info (CPU, mem, ...)
+smil : SMIL timing and animation
+memory : GPAC memory tracker
+audio : Audio renderer and mixers
+module : used by some modules
+mutex : mutex information
+console : console messages, such as script alert() and error notifications
+
+
+
+
+
+
+
+Options defined for Osmo4 (Windows version and wxWidgets version):
+Loop [value: "yes" "no" ]
+
+Specifies whether the presentation has to be restarted when done playing.
+
+ConsoleOff [value: "yes" "no" ]
+
+Specifies whether application messages (script, buffering, download progress) are displayed in the console or not.
+
+SingleInstance [value: "yes", "no" ]
+
+Specifies if the player should be a single instance application or not (Osmo4-Win32 only).
+
+LookForSubtitles [value: "yes" "no" ]
+
+Specifies if Osmo4 shall look for subtitle files when opening a presentation.
+
+ViewXMT [value: "yes" "no" ]
+
+Specifies if scene dumping shall be done in XML (XMT, X3D) or in VRML-like syntax (BT, WRL).
+
+ConfigPanel [value: positive integer ]
+
+Specifies the latest config panel selected by user.
+
+NoMIMETypeFetch [value: "yes", "no" ]
+
+Specifies if the player has to check for mime type when following hyperlinks, or only follow links of known extensions.
+
+Loop [value: "yes", "no" ]
+
+Specifies if the playlist shall be restarted when playback is over.
+
+PLEntry [value: positive integer ]
+
+Indicates active playlist entry when player was last closed. Playlist backup is:
+
+
+"gpac_pl.m3u" on win32 platforms, stored in same directory as application
+".gpac_pl.m3u" on other platforms, stored in user home directory
+
+FillScreen [value: "yes", "no" ]
+
+Specifies if the display area shall fill all available space on screen. WindowsMobile/Symbian only
+
+DisableBackLight [value: "yes", "no" ]
+
+Specifies if the screen backlighting shall be disabled while playing. WindowsMobile/Symbian only
+
+LastWorkingDir [value: "yes", "no" ]
+
+Specifies the directory of the last local file opened. Smartphone Windows only
+
+Browser [value: string ]
+
+Specifies prefered browser for WWW anchors and scene graph viewing - Only used by Osmo4/wxWidgets.
+
+
+
+Section "RecentFiles" Back to top
+
+The "RecentFiles" section of the config file holds last accessed files (hardcoded to no more than 20) in the last access order. The keys are
+the file names and no value is used. This section is only used by GUI clients (osmo4/wxOsmo4)
+
+
+
+Section "Systems" Back to top
+
+The "Systems" section of the config file holds all configuration options for the MPEG-4 Systems engine.
+
+LanguageName [value: string ]
+
+Specifies the user prefered language in readable english. This is used to select streams in case of alternate content in an audio object.
+
+Language3CC [value: 3-char code from ISO 639-2 ]
+
+Specifies the user prefered language as expressed in ISO 639-2. This is used to select streams in case of alternate content in an audio object.
+
+Language2CC [value: 2-char code from ISO 639-1 ]
+
+Specifies the user prefered language as expressed in ISO 639-1. This is used to select streams in case of alternate content in an audio object.
+
+DrawLateFrames [value: "yes" "no" ]
+
+If set, late frames will still be drawn. If not set, the late frames are droped (or executed for systems decoders) untill the decoder output is back in sync. This is by default on to keep better testing heavy content or slow renderers, but should be set to off when needing a better sync or monitoring skipped frames.
+
+ForceSingleClock [value: "yes" "no" ]
+
+One big problem with MP4 files is that the notion of "duration" has been unclear for a long time, and most content available (audio-video files) specifiy a
+wrong BIFS duration. In such a case the movie cannot be controled/seeked into. Another problem with ISMA streaming is that BIFS/OD don't use the same clock as
+audio/video, thus seeking the main timeline does not seek AV media. Setting the ForceSingleClock will handle both cases by using a single timeline for all media
+streams and setting the duration to the one of the longest stream.
+
+ThreadingPolicy [value: "Free" "Single" "Multi" ]
+
+Specifies how media decoders are to be threaded. "Free" lets decoders decide of their threading, "Single" means that all decoders are managed in a single thread performing scheduling and priority
+handling and "Multi" means that each decoder runs in its own thread.
+
+Priority [value: "low" "normal" "high" "real-time" ]
+
+Specifies the priority of the decoders (priority is applied to decoder thread(s) regardless of threading mode).
+
+TimeSlice [value: unsigned integer ]
+
+Specifies the target maximum time (in ms) of one cycle of the media manager (the media manager will attempts to call all the active decoders within this time. Depending on the threading mode this option can be ignored;
+
+ModuleUnload [value: "yes" "no" ]
+
+Specifies whether modules should be unloaded if not used or not. Default: "yes".
+
+ResyncLateClock [value: unsigned integer ]
+
+Specifies the threshold after which late clocks are resynchronized to timestamps for OCR streams. By default, no threashold (0) is used and clocks are never resynchronized. This allows to
+resync clocks to the media owning the clock when the decoding is really too slow, and should only be used for debugging purposes.
+
+NoVisualThread [value: "yes" "no" ]
+
+Specifies whether the visual rendering is done in the main codec manager or in a dedicated thread.
+
+DefAudioDec , DefVideoDec and DefImageDec [value: string ]
+
+Specifies which module to use by default for audio/video/image decoding. The string is the name of the module to be used (same considerations as other modules, cf introduction).
+
+codec_XX _XX [value: string ]
+
+Allows to specify default media module (audio/video) per stream type and object type. This is usefull if you have more than one decoder for a given type (ex, XviD and FFMPEG for MPEG-4 visual SP). The syntax is:
+ codec_AA _BB =modulename
+where AA is the hexadecimal MPEG-4 streamType value for the codec (04=visual, 05=audio) and BB is the hexadecimal MPEG-4 objectTypeIndication of the media (0x20 = MPEG-4 video, 0x40=MPEG-4 Audio, ...).
+The string is the name of the module to be used (same considerations as other modules, cf introduction).
+
+
+
+Section "Compositor" Back to top
+
+The "Compositor" section of the config file holds all configuration options for the compositor (logical rendering engine).
+
+Raster2D [value: string ]
+
+Specifies the 2D rasterizer to use for vectorial drawing. Same as above, this module cannot be reloaded during a presentation.
+FrameRate [value: float ]
+
+Specifies the simulation frame-rate of the presentation - this value is also used by the MPEG-4 Systems engine to determine when a BIFS frame is mature for decoding.
+AntiAlias [value: "None" "All" "Text" ]
+
+Specifies antialiasing settings - whether the setting is applied or not depends on the graphics module / graphic card.
+
+
+"None" : no anti-aliasing
+"Text" : anti-aliasing for text only
+"All" : complete anti-aliasing
+
+HighSpeed [value: "yes" "no" ]
+
+Specifies whether rendering should target speed or quality - whether the setting is applied or not depends on the renderer, graphics module / graphic card.
+ForceSceneSize [value: "yes" "no" ]
+
+Forces the scene to resize to the biggest bitmap available if no size info is given in the BIFS configuration.
+StressMode [value: "yes" "no" ]
+
+Specifies that the renderer runs in worst case scenario, recomputing display lists and reloading textures (sending them to graphics card) at each frame even when no change has occured.
+BoundingVolume [value: "None" "Box" "AABB" ]
+
+Specifies whether the bounding volume of an object shall be drawn or not. Note that the 2D renderer only uses rectangles as bounding volumes. The "AABB" value is used by the
+3D renderer only, and specifies the object bounding-box tree shall be drawn.
+ColorKey [value: unsigned hexadecimal integer, formated as AARRGGBB ]
+
+Specifies the color key to use for windowless rendering. GPAC currently doesn't support true alpha blitting to desktop due to limitations in most windowing toolkit, it therefore uses color keying mechanism. The alpha part of the key is used for global transparency of GPAC's output, if supported.
+
+BackColor [value: unsigned hexadecimal integer, formated as AARRGGBB ]
+
+Specifies the background color to use when displaying transparent images or video with no scene compoistion instructions.
+
+DrawMode [value: "immediate" "defer" "defer-debug" ]
+
+Specifies whether immediate drawing should be used or not. In immediate mode, the screen is completely redrawn at each frame. In defer mode
+object positioning is tracked from frame to frame and dirty rectangles info is collected in order to redraw the minimal amount of the screen buffer. Whether
+the setting is applied or not depends on the graphics module (currently all modules handle both mode). Defer Debug mode only renders changed areas.
+ScalableZoom [value: "yes" "no" ]
+
+Specifies whether scalable zoom should be used or not. When scalable zoom is enabled, resizing the output window will also recompute all vectorial objects. Otherwise only the final buffer is stretched.
+DisableYUV [value: "yes" "no" ]
+
+Disables YUV hardware support (YUV hardware support may not be available for the current video output module).
+TextureFromDecoderMemory [value: "yes" "no" ]
+
+Allows video textures to be build directly from video decoder internal buffers. This may increase performances on some systems. Default is no.
+ForceOpenGL [value: "always", "disable", "hybrid", "raster" ]
+
+Specifies that 2D rendering will be performed by OpenGL rather than raster 2D. This will involve polygon tesselation which may not be supported on all platforms, and 2D graphics will not loo as nice as 2D mode. The hybrid mode performs software drawing of 2D graphics with no textures (better quality) and uses OpenGL for all textures. The raster mode only uses OpenGL for pixel IO but does not perform polygin fill (no tesselation) (slow, mainly for test purposes).
+EnablePBO [value: "yes", "no" ]
+
+Uses PixelBufferObjects to push YUV textures to GPU in OpenGL Mode.. This may slightly increase the performances of the playback.
+DefaultNavigationMode [value: "Walk", "Fly", "Examine" ]
+
+Overrides the default navigation mode of MPEG-4/VRML (Walk) and X3D (Examine).
+RasterOutlines [value: "yes" "no" ]
+
+Specifies that outlining shall be done through OpenGL pen width rather than vectorial outlining.
+PolygonAA [value: "yes" "no" ]
+
+Specifies whether polygon antialiasing should be used in full antialiasing mode. If not set, only lines and points antialiasing are used.
+DisableBackFaceCulling [value: "yes" "no" ]
+
+Specifies whether backface culling shall be disable or not. If not set, backface culling is performed.
+Wireframe [value: "WireNone" "WireOnly" "WireOnSolid" ]
+
+Specifies wireframe drawing options:
+
+"WireNone" : objects are drawn as solid
+"WireOnly" : objects are drawn as wireframe only
+"WireOnSolid" : objects are drawn as solid and wireframe is then drawn
+
+DisableRectExt [value: "yes" "no" ]
+
+Specifies whether OpenGL rectangular texture extension (GL_EXT_texture_rectangle or GL_NV_texture_rectangle) shall be used or not.
+
+"yes": textures whose dimensions are not power of two are rescaled except if hardware support non-power-of-two textures (GL_ARB_texture_non_power_of_two) natively.
+"no": if extension is available, textures are used without rescaling. Note that in this case texture transformations are disabled.
+
+EmulatePOW2 [value: "yes" "no" ]
+
+Enables power of 2 emulation. Ignored if openGL rectangular texture extension is enabled.
+
+"yes": video texture is not resized but emulated with padding. This usually speeds up video mapping on shapes but disables texture transformations.
+"no": video is resized to a power of 2 texture when mapping to a shape.
+
+DisableGLUScale [value: "yes" "no" ]
+
+Disables usage of gluScaleImage, which may be slower but nicer than GPAC's software stretch routines.
+TextureTextMode (value: "Default", "Never", "Always" ]
+
+Specifies whether text shall be drawn to a texture and then rendered or directly rendered. Using textured text can improve text rendering in 3D and also improve text-on-video like content. Default value will use texturing for OpenGL rendering.
+OpenGLExtensions [value: string ]
+
+Read-only option listing the OpenGL extensions supported by the GL driver. Only valid after the 3D renderer has been used.
+
+StereoType [value: "None", "SideBySide", "TopToBottom", "Anaglyph", "Columns", "Rows", "SPV19", "Custom" ]
+
+Specifies the stereo output type (default "None"). If your graphic card does not support OpenGL shaders, only SideBySide and TopToBottom modes will be available.
+
+"SideBySide": images are displayed side by side from left to right.
+"TopToBottom": images are displayed from top (laft view) to bottom (right view).
+"Anaglyph": Standard color anaglyph (red for left view, green and blue for right view) is used.
+"Columns": images are interleaved by columns, left view on even columns and left view on odd columns.
+"Rows": images are interleaved by columns, left view on even rows and left view on odd rows.
+"SPV19": images are interleaved by for SpatialView 19'' 5 views display, fullscreen mode.
+"Custom": images are interleaved according to the shader specified by InterleaverShader
+
+
+NumViews [value: unsigned integer ]
+
+Specifies the number of views to use in stereo mode. If mode is "Anaglyph", "Columns" or "Rows", the number of views is forced to 2.
+
+InterleaverShader [value: path to fragment shader file ]
+
+Specifies the fragment shader file to use for view interleaving. Each view is rendered in its own texture. The shader is exposed each view as uniform sampler2D gfViewX , where X is the view number starting from the left (gfView1 ).
+
+ReverseViews [value: "yes", "no" ]
+
+Specifies if the view order should be reversed (from right to left) or not.
+EyeSeparation [value: float ]
+
+Specifies the eye separation in cm (distance between the cameras). Default: 6.3 cm.
+CameraLayout [value: "OffAxis", Linear", "Circular" ]
+
+Specifies the camera layout. The default value is OffAxis in (auto-)stereo modes, ignored in mono mode.
+ViewDistance [value: integer ]
+
+Specifies the distance in cm between the camera and the zero-disparity plane. There is currently no automatic calibration of depth in GPAC.
+
+
+
+
+
+Section "Audio" Back to top
+The "Audio" section of the config file holds all configuration options for the audio rendering engine and hardware.
+DriverName [value: string ]
+
+Specifies the driver to use for audio rendering. This driver cannot be reloaded at run-time, the complete system must be restarted.
+ForceConfig [value: "yes" "no" ]
+
+Forces a given sound card configuration to be used. If not set the sound card will be setup to use 2 audio buffers of 1024 samples each.
+This may not work properly on some audio cards due to hardware latency, therefore forcing the config may be very usefull.
+NumBuffers [value: positive integer, 0 forbidden ]
+
+When config is forced, specifies the number of audio buffers to allocate (audio buffers are played in ring).
+TotalDuration [value: positive integer, 0 forbidden ]
+
+When config is forced, specifies the total audio buffer size in milliseconds. Be aware that the longer the audio buffer is, the longer the audio latency will be when pausing an
+audio object. The quality of fast forward audio playback will also be degradated when using large audio buffers.
+NoResync [value: "yes" "no" ]
+
+Disables audio resynchronization: audio data is never dropped but may get out of sync.
+DisableMultiChannel [value: "yes" "no" ]
+
+Disables audio multichannel output and always downmix to stereo. This may be usefull if the multichannel output behaves weirdly.
+DisableNotification [value: "yes" "no" ]
+
+Disables usage of audio buffer notifications when supported (currently only DirectSound supports it). If DirectSound audio sounds weird try without notifications.
+Volume [value: integer (0-100)]
+
+Default audio volume used when launching GPAC.
+Pan [value: integer (0-100)]
+
+Default audio stereo balance used when launching GPAC - 0 for full left, 100 for full right, 50 for balanced.
+Filter [value: string]
+
+Defines a set of audio filters. Audio filters are declared as a list of strings separated with ";;". The exact syntax of the string is filter specific.
+
+
+
+
+Section "Video" Back to top
+The "Video" section of the config file holds all configuration options for the video renderer and hardware.
+DriverName [value: string ]
+
+Specifies the driver to use for video memory access. This driver cannot be reloaded at run-time, the complete system must be restarted.
+SwitchResolution [value: "yes" "no" ]
+
+Specifies fullscreen resolution mode. If enabled, selects smallest video resolution larger than scene size, otherwise use current video resolution.
+HardwareMemory [value: "Auto" "Always" "Never" ]
+
+Only valid for 2D renderer. Specifies if main video backbuffer is always on hardware, always on system memory or selected by GPAC (default mode). Depending on the scene type, this may drastically change the playback speed.
+DisableColorKeying [value: "yes" "no" ]
+
+Only valid for 2D renderer. Specifies if partial overlays should be disabled. If not disabled, hardware color keying for overlays is tested and used if present. Otherwise, only the top-most video with no overlapping objects will be drawn using overlays. Default value is "no".
+UseGLDoubleBuffering [value: "yes" "no" ]
+
+Specifies if OpenGL double buffering shall be used. Default is "no".
+GLNbBitsPerComponent [value: positive integer ]
+
+Specifies the number of bits per color component. Default is 5.
+GLNbBitsDepth [value: positive integer ]
+
+Specifies the number of bits for the depth buffer. Default is 16.
+X113DOffscreenMode [value: "Window" "VisibleWindow" "Pixmap" ]
+
+Specifies the type of OpenGL offscreen rendering in X11. Default mode is "Pixmap".
+
+"Window" : A hidden window is used to perform offscreen rendering. Depending on your video driver and X11 configuration, this may not work.
+"VisibleWindow" : A visible window is used to perform offscreen rendering. This can be usefull while debugging.
+"Pixmap" : An X11 Pixmap is used to perform offscreen rendering. Depending on your video driver and X11 configuration, this may not work and can even crash the player.
+
+
+
+
+
+Section "Network" Back to top
+The "Network" section of the config file holds all configuration options for the network used by modules and systems engine.
+AutoReconfigUDP [value: "yes" "no" ]
+
+Specifies if network manager shall reconnect a scene if UDP is not present.
+DataTimeout [value: positive integer ]
+
+Specifies timeout in ms befor initial media buffering aborts. Default terminal value is 20000 (20 seconds).
+UDPNotAvailable [value: "yes" "no" ]
+
+Specifies if UDP traffic is not available. This is automatically set by GPAC if AutoReconfigUDP is set.
+UDPTimeout [value: positive integer ]
+
+Specifies timeout in ms for initial UDP detection. Once a UDP packet is recieved the timeout is ignored.
+BufferLength [value: positive integer ]
+
+Specifies the length of the decoding buffer in milliseconds. The client will wait for the buffer to be filled before starting decoding. A module may decide to use a different value based on protocol and network jitters.
+RebufferLength [value: positive integer ]
+
+Specifies rebuffering length of the decoding buffer in milliseconds. Whenever the decoding buffer fullness is less than this value, the object clock is paused and
+the stream rebuffered till BufferLength. Therefore a value of 0 means no rebuffering. A module may decide to use a different value based on protocol and network jitters.
+
+LowLatencyBufferMax [value: positive integer ]
+
+Specifies the maximum buffer level for low latency mode, in ms. If media buffer max is above this value, full buffering will be done (clock resume at first frame displayed). Default value is 500 ms.
+
+MobileIP [value: IP Address ]
+
+Specifies a Mobile IP interface overriding the default IP. If set, all sockets will be locally bound to this IP address.
+
+DefaultMCastInterface [value: IP Address ]
+
+Specifies a default IP interface for Multicast overriding the default IP.If not set, the multicast will be setup using the default IP.
+
+HTTPRebuffer [value: positive integer ]
+
+Specifies the default HTTP rebuffer time in ms. When playback position reaches download position, playback will be paused if this integer is not zero. Playback will resume once the HTTPRebuffer ms of playback are available. Default value is 5000 ms.
+
+HTTPAutoRebuffer [value: "yes", "no" ]
+
+Specifies whether auto rebuffering is used. When auto-rebuffering is used, playback only resumes when estimated time to download the rest of the movie is less than remaining time of the playback. Default value is no.
+
+
+
+
+
+
+Section "FontEngine" Back to top
+The "FontEngine" section of the config file holds all configuration options for the font handling. The GPAC rendering module handles text through vectorial outline, allowing graphics module development without having to
+integrate text rendering which is always heavy work.
+FontReader [value: string ]
+
+Specifies the module to use for font handling. This module cannot be reloaded at run-time, GPAC must be restarted.
+WaitForFontLoad [value: "yes" "no" ]
+
+Forces to wait for SVG fonts to be loaded before displaying frames - default is "no".
+FontDirectory (value: path to TrueType (*.ttf, *.ttc) font directory ]
+
+Specifies the directory where fonts are located - currently only one directory can be specified (however nothing stops a font module from using a private directory).
+Note:
+The freetype module will scan the entire sub-directories for fonts.
+
+FontSerif [value: string ]}: specifies default SERIF font.
+FontSans [value: string ]}: specifies default SANS font.
+FontFixed [value: string ]}: specifies default fixed font.
+
+Note:
+The FreeType module uses this section to cache familly names to font file name associations.
+
+
+
+
+Section "Downloader" Back to top
+The "Downloader" section of the config file holds all configuration options for file downloading and caching.
+CleanCache [value: "yes" "no" ]
+
+Specifies whether downloaded files shall be removed once used.
+DisableCache [value: "yes" "no" ]
+
+Specifies whether HTTP caching instructions are disabled or not.
+AllowOfflineCache [value: "yes" "no" ]
+
+When enabled, allows HTTP request to use cached file if any when network is not available.
+MaxRate [value: positive integer ]
+
+Specifies a maximum data rate in kilo bits per seconds for file downloading. This is used for simulation purposes. A value of 0 means no rate restriction.
+UserAgent [value: string ]
+
+Specifies an alternate user agent (default one is "GPAC $VERSION").
+HTTPHeadTimeout [value: positive integer ]
+
+Specifies timeout in milliseconds before considering HEAD request failed. 0 means no HEAD request is issued, only GET.
+
+
+
+Section "HTTPProxy" Back to top
+The "HTTPProxy" section of the config file holds configuration option for HTTP proxy adressing. Currently only one proxy can be enabled, and no URI selection is done.
+Enabled [value: "yes" "no" ]
+
+Specifies whether the proxy should be used or not when downloading files.
+Name [value: string ]
+
+Specifies the proxy name (IP address or resolved name) without protocol identifier (eg, no "http://"). If not present, the proxy is disabled.
+Port [value: positive integer ]
+
+Specifies the port to use with the proxy. If no port is specified, the default HTTP port (80) is used.
+
+
+
+Section "Streaming" Back to top
+The "Streaming" section of the config file holds all configuration options for real-time streaming using IETF SDP/RTSP/RTP/RTCP protocols.
+DefaultPort [value: unsigned short ]
+
+Specifies the default port to use when connecting to a server (ignored if a port is specified in the url) if the port is 80 or 8080 (HTTP), the client will connect to the
+RTSP server through an HTTP tunnel, and transport will take place on the RTSP connection.
+ReorderSize [value: positive integer ]
+
+Size of the RTP reordering buffer - 0 means no reordering. Ignored when transport takes place on the RTSP connection. The bigger this value, the longer the reordering delay will be.
+RTPoverRTSP [value: "yes" "no" "OnlyCritical" ]
+
+Specifies whether RTP packets should be carried on the RTSP connection (TCP or UDP), or carried on UDP. If the connection port is an HTTP port, this value is assumed to be true. If set to OnlyCritical , transport will take place on TCP only if a critical media (eg, neither audio nor video) is found in the session.
+RTSPTimeout [value: positive integer ]
+
+Specifies connection timeout with the server: an RTSP request is considered as failed when the timeout expires.
+ForceFirstPort [value: positive integer ]
+
+Specifies first port for RTP channels. If not set, the default first port used by GPAC is 7040.
+NATKeepAlive [value: positive integer ]
+
+Specifies the maximum inactivity period in milliseconds for RTP sockets. If no data is received after this period, an empty RTP packet will be sent in order to keep any NAT alive. If 0 (default), disables NAT keep-alive packets.
+ForceMulticastIP [value: IP4 or IP6 address ]
+
+Forces the specified multicast address to be used instead of the regular unicast. Note that some servers may not support multicast initiation by the client.
+ForceMulticastTTL [value: Positive integer ]
+
+Indicates the TTL to use when the client initiates the multicast. Default value is 127.
+FirstPacketDrop [value: positive integer ]
+
+Specifies the sequence number of the first RTP packet to be droped - 0 means no packet drop. Used for packet drop simulation tests.
+PacketDropFrequency [value: positive integer ]
+
+Specifies the frequency at which SL packets are droped. If value is 20, one packet every 20 recieved packets will be droped. Used for packet drop simulation tests.
+
+
+
+
+Section "MimeTypes" Back to top
+This section is used to keep MIME types and file associations for GPAC modules.
+ The format of the key is:
+mimeType =" fileExt1 filexExt2 .. filexExtN" " MimeType description" ModuleName
+
+The description is used for GUI purposes (open file dialogs). You may modify the file extension list to support your own extensions.
+MIME Type is always checked when processing a remote ressource (eg http file) in order to load the appropriated modules.
+If MIME type is not available, provided extensions are first checked, then all input modules are queried.
+
+
+
+
+
+Section "StreamingCache" Back to top
+The "StreamingCache" section of the config file holds all configuration options for the streaming cache. Streaming cache allows for recording of
+live sources such as RTP/RTSP sessions and internet radios. This is currently just an experimental feature in GPAC.
+RecordDirectory [value: path ]
+
+Specifies path for recorded files. Cached data is written directly to disk (no re-interleaving or similar processes).
+If not specified, the default cache directory (cf General ) is used.
+BaseFileName [value: string ]
+
+Specifies the base name for recorded files. If not present in configuration file, the service name (URL) is used.
+KeepExistingFiles [value: "yes" "no" ]
+
+Specifies if cached files with same name should be kept or not. If not, an integer number is added to the cached file name, the higest number for the latest file.
+
+
+
+
+Section "SAXLoader" Back to top
+The "SAXLoader" section of the config file holds all configuration options for XML SAX parsing of SVG, XMT and X3D files.
+Progressive [value: "yes" "no" "DOM" ]
+Specifies XML parsing mode used by different file loaders using the SAX parser.
+
+"yes" : SAX parsing is used with progressive loading of the document.
+"no" : SAX parsing is used, document will first be completely downloaded.
+"DOM" : DOM parsing is used, document will first be completely downloaded. Only supported by libXML2 plugin, otherwise handled as "no".
+
+MaxDuration [value positive integer ]
+
+Specifies the maximum amount of time the SAX parser should spent loading a portion of the document. Only used with SAX Progressive mode
+
+
+
+
+Section "XviD" Back to top
+The "XviD" section of the config file holds all configuration options for the XviD codec.
+PostProc [value: "FilmEffect" "Deblock_Y" "Deblock_UV" ]
+
+Specifies filters to apply when decoding video. The string is a list of filters separated with a space character.
+
+"FilmEffect" : xvid 1.0.0 filmEffect.
+"Deblock_Y" : Y plane deblocking filter.
+"Deblock_UV" : UV plane deblocking filter.
+
+Threaded [value "yes" "no" ]
+Specifies whether the decoder should run in its own thread or not.
+
+
+
+
+Section "FFMPEG" Back to top
+The "FFMPEG" section of the config file holds all configuration options for the FFMPEG demuxer and decoder.
+DataBufferMS [value: positive integer ]
+
+Specifies the amount of video/audio data (in milliseconds) to be bufferer before starting decoding. For developpers only.
+IOBufferSize [value: positive integer ]
+
+Specifies the size (in bytes) of the buffer used to fecth data from network (http playback only). Default size is 8192 bytes.
+
+
+
+
+Section "ISOReader" Back to top
+The "ISOReader" section of the config file holds all configuration options for the ISO Media File demuxer.
+IgnoreMPEG-4ForBrands [value: Full 4CC or 4CC pattern (abc* ab*) ]
+
+Ignores all MPEG-4 systems tracks and IOD for files showing the listed brands in their compatible brand list.
+
+
+
+
+Section "DVB" Back to top
+The "DVB" section of the config file holds all configuration options for DVB playback on GNU/Linux systems.
+ChannelsFile [value: Absolute file path ]
+
+Specifies the DVB channels configuration file as produced by dvbtools' scan util.
+
+
+
+
+Section "DASH" Back to top
+The "DASH" section of the config file holds all configuration options for DASH or HLS/M3U8 playback.
+KeepFiles [value: yes, no ]
+
+Specifies whether downloaded files should not be deleted.
+AutoSwitchCount [value: positive integer ]
+
+For debug purposes, instructs the player to switch representation every N segments. If 0 (default), switching is disabled.
+BufferMode [value: segments, minBuffer, none ]
+
+Selects buffer mode:
+
+segments: buffers complete segments as indicated in MPD before handing them to the player.
+minBuffer: asks the player to buffer media for the time indicated in the MPD (default mode), but segments are not pre-buffered.
+none: uses the player settings for buffering.
+
+
+DisableSwitching [value: yes, no ]
+
+Disables automatic adaptation logic. Default is no
+MemoryStorage [value: yes, no ]
+
+Files are only stored in memory and destroyed after playback, no disk IO is used. Default is yes
+UseMaxResolution [value: yes, no ]
+
+Forces the player to set the output video resolution to the max resolution available instead of resizing the window. Default is yes
+UseScreenResolution [value: yes, no ]
+
+Disables all resolutions that are higher than the screen resolution. Default is yes
+StartRepresentation [value: minBandwidth, maxBandwidth, minQuality, maxQuality ]
+
+Instructs the DASH client to start playing the indicated representation before doing any switching. Default is minBandwidth.
+InitialTimeshift [value: positive integer ]
+
+If between 0 and 100, indicates the percentage of the timeshift buffer when starting playback.
+If more than 100, indicates the number of milliseconds to rewind in the timeshift buffer when starting playback.
+Default is 0 to tune to the live point.
+LowLatency [value: always, chunk, no ]
+
+Sets low-latency mode enabled. In low-latency mode, media data is parsed as soon as possible while segment is being downloaded. Default is no.
+If chunk is selected, media data is re-parsed at each HTTP 1.1 chunk end. If always is selected, media data is re-parsed as soon as HTTP data is received.
+AllowAbort [value: yes, no ]
+
+Enables aborts of HTTP transfer when rate gets too low. This may result in a packet drops. Default is no.
+UseServerUTC [value: yes, no ]
+
+Enables using Server-UTC HTTP header to compensate any drift between client and server. Default is yes.
+DebugAdaptationSet [value: integer ]
+
+Plays only the adaptation set indicated by its index in the MPD. If index is negative, all sets are used (default mode).
+
+SwitchProbeCount [value: unsigned integer ]
+
+Sets how many segments the client shall wait before switching up bandwidth. If 0, switch will happen as soon as the bandwidth is enough, but this is more prone to network variations.
+Default value is 1.
+
+
+
+
+
+
+
+Section "ALSA" Back to top
+The "ALSA" section of the config file holds all configuration options of the ALSA audio output module on GNU/Linux systems.
+DeviceName [value: string ]
+
+Specifies the ALSA device to use. Default device is "hw:0,0".
+
+
+
+
+Section "StreamingText" Back to top
+The "StreamingText" section of the config file holds all configuration options for the 3GPP/MPEG-4 Streaming Text decoder.
+UseTexturing [value: "yes" "no" ]
+
+Specifies whether the text shall be drawn using an intermediate texture or not.<OutlineText [value: "yes" "no" ]
+
+Specifies whether the text shall be drawn with a black thin outline or not.
+
+
+
+
+
+Section "Shortcuts" Back to top
+The "Shortcuts" section of the config file holds all shortcuts in GPAC. You can define a shorcut for an action as:
+'action'='keyname' or 'action'='ctrl+keyname' or 'action'='alt+keyname' or "='action'='ctrl+alt+keyname'
+Shift is not supported as a key modifier, and case is insensitive.
+Currently defined actions are as follows:
+Play or Pause
+Stop
+Step
+Exit
+Mute
+VolumeUp
+VolumeDown
+JumpForward
+JumpBackward
+JumpStart
+JumpEnd
+FastForward
+FineForward
+SlowForward
+FastRewind
+FineRewind
+SlowRewind
+Next
+Previous
+
+
+
+
+Section "DSMCC" Back to top
+
+The "DSMCC" section of the config file holds the configuration option for the processing of DSMCC data.
+
+Activated [value: "true" "false" ]
+
+Specifies if the DSMCC data will be processed (true). It implies creations of directories and files in the temp directory.
+
+
+
+
+
+Section "OpenHEVC" Back to top
+
+The openHEVC section of the config file holds the configuration option for the OpenHEVC decoder.
+
+NumThreads [value: unsigned integer]
+
+Specifies the number of threads to allocate to the OpenHEVC decoder. Default is the number of detected cores minus one, or one if core detection fails.
+ThreadingType [value: frame , wpp , frame+wpp ]
+
+Specifies the threading type for the openHEVC decoder. Default is frame (wpp disabled).
+CBUnits [value: unsigned integer ]
+
+Specifies the number of decoded frames in memory before display. Default value is 4.
+PackHFR [value: yes , no ]
+
+Packs 4 consecutive frames in a single 4x frame.
+
+
+
+
+
+Section "DirectFB" Back to top
+
+The "DirectFB" section of the config file holds the configuration options for the DirectFB output module. You may also want to check the official documentation .
+
+DisableAcceleration [value: "yes" "no" ]
+
+Forces to disable hardware acceleration.
+DisableDisplay [value: "yes" "no" ]
+
+Specifies the DisableDisplay parameter value.
+FlipSyncMode [value: "waitsync" "wait" "sync" "swap" ]
+
+Specifies the flip sync mode.
+DisableBlit [value: "yes" "no" ]
+
+Forces to disable hardware blitting.
+WindowMode [value: "X11" "SDL" ]
+
+Specifies the underlying windowing library.
+
+
+
+
+
+Section "DektecVideo" Back to top
+
+The "DektecVideo" section of the config file holds the configuration options for the Dektec SDI video output module.
+
+SDIOutput [value: unsigned integer ]
+
+Specifies the output port of the card. Default value is 1.
+
+
+