-27/08/09:
- - Added overwrite of profile and level of AVC streams when adding tracks in mp4box(from ISOFF or .264). Use ":profile=X" and ":level=Z" when importing
- - Fixed chapters and text tracks handling for iTunes. Using the -ipd option in MP4Box should fix all subtitles tracks.
- When adding a track (including subtitle), it is now possible to override the track layout. For example:
- MP4Box -add test.srt:layout=0x20x0x-1 test.mp4
- will set the track box to be max width of the file tracks, 20 pixels height, translated by 0 pixels left and aligned to the bottom (max height - 20)
- To add a chapter track, you simply have to add ":chap" in the -add command.
- - Added modular compilation of most libgpac features. See configure or include/gpac/configuration
- - Fixed streaming interoperability with Live555
- - More fixed and speed improvement in VRML/BIFS scripting
- - Added support for PBuffers on Win32/DirectX
+Full Changelog is available here:
+https://sourceforge.net/apps/trac/gpac/log/
+
+25/05/2012: GPAC 0.5.0
+ - MPEG-DASH and Apple HLS support in GPAC Clients
+ - MPEG-DASH segmenter for ISO files and MPEG-2 TS in MP4Box
+ - MP42TS generator now supports HLS output
+ - Support for MPEG-U and W3C widgets
+ - UPnP and DLNA support in the player through Platinum libraries, interfaced in JavaScript
+ - Better support for AVC and SVC muxing in MP4
+ - Support for OpenSVC decoder
+ - Stereo and Multi-view renderer for auto-stereoscopic screens
+ - iOS and Android support (but Symbian support has been dropped)
+ - Camera input through "camera://default" URLs on Windows, OSX 32bit, Linux V4L v1 and Android
+ - experimental audio filters
+ - Better T-DMB support
+ - experimental DVB-MPE and DSM-CC support
+ - BIFS ExtendedCore2D profile support
+ - more work on GUI
+ - and many many fixes and improvements in players and MP4Box
02/12/08: GPAC 0.4.5
- Support for AC3 in ISO Media, AC3 decoder (liba52) RTP hinting
-Installation instructions for latest GPAC svn version:
+Installation instructions for latest GPAC svn version and GPAC release 0.5.0 - May 2012:
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
-Installation instructions for GPAC 0.4.5 - December 2008:
+Other Installation instructions for GPAC
* Foreword
limited (no still image, no audio, no video, no text, no scripting). It is therefore recommended to download the
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.4.5 is gpac_extra_libs 0.4.5.
+
+ 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
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.
* faad2, version 2.0 or above (2.6.1 working)
* liba52, version 0.7.4
* OpenJPEG, version 1.3
-
- Windows user are invited to download and install the Microsoft Platform SDK at
- http://www.microsoft.com/msdownload/platformsdk/sdkupdate
- If you don't have enough bandwidth (it's big) the GDIplus SDK is also included in the gpac_extra_lib package
+ * OpenSVCDecoder, version 1.3
* Installing GPAC
/!\ GPAC won't compile if the 'svnversion' command (shipped with every Subversion package) is not in your path /!\
+!!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
$(MAKE) -C modules all
version:
- @if which svnversion >/dev/null; then echo "#define GPAC_SVN_REVISION \"$(shell svnversion $(SRC_PATH) )\"" > $(SRC_PATH)/include/gpac/version.h ; else echo "No SVN Version found"; fi
+ @if [ -d ".svn" ]; then if which svnversion >/dev/null; then echo "#define GPAC_SVN_REVISION \"$(shell svnversion $(SRC_PATH) )\"" > $(SRC_PATH)/include/gpac/version.h ; else echo "No SVN Version found"; fi; fi
lib: version
$(MAKE) -C src all
ifeq ($(DISABLE_ISOFF), no)
$(INSTALL) $(INSTFLAGS) -m 755 bin/gcc/MP4Box "$(DESTDIR)$(prefix)/bin"
endif
+ifeq ($(DISABLE_PLAYER), no)
$(INSTALL) $(INSTFLAGS) -m 755 bin/gcc/MP4Client "$(DESTDIR)$(prefix)/bin"
+endif
if [ -d $(DESTDIR)$(prefix)/$(libdir)/pkgconfig ] ; then \
$(INSTALL) $(INSTFLAGS) -m 644 gpac.pc "$(DESTDIR)$(prefix)/$(libdir)/pkgconfig" ; \
fi
-README for GPAC version 0.4.5, December 2008.
+README for GPAC version 0.5.0, May 2012.
GPAC is a multimedia framework oriented towards rich media and distributed under the LGPL license (see COPYING).
GPAC supports many multimedia formats, from simple audiovisual containers (avi, mov, mpg) to complex
presentation formats (MPEG-4 Systems, SVG Tiny 1.2, VRML/X3D). GPAC supports scripting of presentation for MPEG4/VRML/X3D through
mozilla SpiderMonkey javascript engine.
-GPAC currently supports local playback, http download and play and RTP/RTSP streaming over UDP (unicast or multicast) or TCP.
+GPAC currently supports local playback, http progressive download, Adaptive HTTP Streaming (MPEG-DASH, HLS), RTP/RTSP streaming over UDP (unicast or multicast) or TCP and TS demuxing (from file, IP or DVB4Linux).
GPAC also features MP4Box, a multimedia swiss-army knife for the prompt.
For compilation and installation instruction, check INSTALL file
-todo items as of version 0.4.5:
- * more refinement for several top scenes support (display overlays & co).
-
-utopic roadmap
-v0.5.0:
- * maybe support for glyph-based texturing rather than string-based
- * SMIL support ?
-
-v0.6.0:
- * M4Flex (ex FlexMux) support
- * Flexible IPMP integration
- * JNI interfacing and MPEG-J APIs
- * native SWF support in client ?
-
-v1.0.0:
- * full rendering (MPEG-4 AFX ?)
-
-Future work on authoring tools is not still well defined. The current state has bt/vrml/XMT-A support, it could be interesting to have XMT-O support. The SWF converter
-still needs lots of work to support ActionScript and co but this will likely not be developed by your servitor. Other graphics converter are more-or-less droped.
-The main authoring focus should now be a better V4Studio-like app, to create simple content as well as act as a live studio.
-
-
-droped items:
-* Hardware accelerated 2D raster: from most doc on OpenGL and co, there is no waranty of any kind that backbuffer content is not altered when swaping buffers.
-This is a big issue since the 2D renderer main strength is to compute diffs between frames... 2D acceleration is however available with the 3D renderer
-* MatteTexture fix: given the lack of acceleration in 2D, the matteTexture in the 2D renderer will be just to slow to be usable, and therefore won't be fixed
-for a while... MatteTexture with the 3D renderer will be fixed however, trying to use openGL texenv stuff and multitexturing
+todo items as of version 0.5.0:
+ * more work on DASH support
+ * improve stereo/multiview renderer and texture+depth support
+ * more work on DIMS/RME and scene generation support
+ * rearchitecture of modules
+ * more SVG support (filter , SVG 2.0)
+
\ No newline at end of file
include ../config.mak
-APPDIRS=mp4client
+APPDIRS=
+
+ifeq ($(DISABLE_PLAYER), no)
+APPDIRS+=mp4client
+endif
ifeq ($(DISABLE_ISOFF), no)
APPDIRS+=mp4box
ifeq ($(DISABLE_M2TS), no)
-ifeq ($(DISABLE_SENG), no)
APPDIRS+=mp42ts
endif
endif
-endif
V4STUDIODIR=
INSTDIRS=mp4client
vpath %.c $(SRC_PATH)/applications/mp42ts
-CFLAGS= $(OPTFLAGS) -I"$(SRC_PATH)/include"
+CFLAGS= $(OPTFLAGS) -DGPAC_HAVE_CONFIG_H -I"$(SRC_PATH)/include"
ifeq ($(DEBUGBUILD), yes)
CFLAGS+=-g
#include <gpac/media_tools.h>
#include <gpac/constants.h>
#include <gpac/base_coding.h>
+#include <gpac/mpegts.h>
+
+#ifndef GPAC_DISABLE_STREAMING
#include <gpac/ietf.h>
+#endif
+
+#ifndef GPAC_DISABLE_SENG
#include <gpac/scene_engine.h>
-#include <gpac/mpegts.h>
+#endif
#ifdef GPAC_DISABLE_ISOM
u32 nb_streams, pcr_idx;
GF_ESInterface streams[40];
GF_Descriptor *iod;
+#ifndef GPAC_DISABLE_SENG
GF_SceneEngine *seng;
+#endif
GF_Thread *th;
char *src_name;
u32 rate;
} GF_SimpleDataDescriptor;
//TODO: find a clean way to save this data
+#ifndef GPAC_DISABLE_PLAYER
static u32 audio_OD_stream_id = (u32)-1;
+#endif
+
#define AUDIO_OD_ESID 100
#define AUDIO_DATA_ESID 101
#define VIDEO_DATA_ESID 105
GF_MP42TS_FILE, /*open mpeg2ts file*/
GF_MP42TS_UDP, /*open udp socket*/
GF_MP42TS_RTP, /*open rtp socket*/
+#ifndef GPAC_DISABLE_PLAYER
GF_MP42TS_HTTP, /*open http downloader*/
+#endif
};
static GF_Err mp4_input_ctrl(GF_ESInterface *ifce, u32 act_type, void *param)
}
+#ifndef GPAC_DISABLE_SENG
static GF_Err seng_input_ctrl(GF_ESInterface *ifce, u32 act_type, void *param)
{
if (act_type==GF_ESI_INPUT_DESTROY) {
return GF_OK;
}
+#endif
+
#ifndef GPAC_DISABLE_STREAMING
typedef struct
}
/*AAC import features*/
+#ifndef GPAC_DISABLE_PLAYER
+
void *audio_prog = NULL;
static void SampleCallBack(void *calling_object, u16 ESID, char *data, u32 size, u64 ts);
#define DONT_USE_TERMINAL_MODULE_API
return GF_OK;
}
+#endif
+
+
static void SampleCallBack(void *calling_object, u16 ESID, char *data, u32 size, u64 ts)
{
u32 i;
if (calling_object) {
M2TSProgram *prog = (M2TSProgram *)calling_object;
+#ifndef GPAC_DISABLE_PLAYER
if (ESID == AUDIO_DATA_ESID) {
if (audio_OD_stream_id != (u32)-1) {
/*this is the first time we get some audio data. Therefore we are sure we can retrieve the audio descriptor. Then we'll
/*overwrite timing as it is flushed to 0 on discontinuities*/
ts += audio_discontinuity_offset;
}
-
+#endif
i=0;
while (i<prog->nb_streams){
if (prog->streams[i].output_ctrl==NULL) {
static volatile Bool run = 1;
+#ifndef GPAC_DISABLE_SENG
static GF_ESIStream * set_broadcast_params(M2TSProgram *prog, u16 esid, u32 period, u32 ts_delta, u16 aggregate_on_stream, Bool adjust_carousel_time, Bool force_rap, Bool aggregate_au, Bool discard_pending, Bool signal_rap, Bool signal_critical, Bool version_inc)
{
u32 i=0;
} else {
esi->repeat_rate = 0;
}
-
return priv;
}
+#endif
+
+#ifndef GPAC_DISABLE_SENG
static Bool seng_output(void *param)
{
return e ? 1 : 0;
}
+#endif
+
#ifndef GPAC_DISABLE_STREAMING
static void rtp_sl_packet_cbk(void *udta, char *payload, u32 size, GF_SLHeader *hdr, GF_Err e)
}
#endif /*GPAC_DISABLE_STREAMING*/
+#ifndef GPAC_DISABLE_SENG
void fill_seng_es_ifce(GF_ESInterface *ifce, u32 i, GF_SceneEngine *seng, u32 period)
{
GF_Err e = GF_OK;
ifce->input_ctrl = seng_input_ctrl;
}
+#endif
static Bool open_program(M2TSProgram *prog, 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)
{
GF_SDPInfo *sdp;
#endif
u32 i;
- GF_Err e;
memset(prog, 0, sizeof(M2TSProgram));
prog->mpeg4_signaling = mpeg4_signaling;
GF_X_Attribute *att;
char *sdp_buf;
u32 sdp_size;
+ GF_Err e;
FILE *_sdp = fopen(src, "rt");
if (!_sdp) {
fprintf(stderr, "Error opening %s - no such file\n", src);
return 2;
} else
#endif /*GPAC_DISABLE_STREAMING*/
+
+#ifndef GPAC_DISABLE_SENG
if (strstr(src, ".bt")) //open .bt file
{
u32 load_type=0;
prog->src_name = update;
gf_th_run(prog->th, seng_output, prog);
return 1;
- } else {
+ } else
+#endif
+ {
FILE *f = fopen(src, "rt");
if (f) {
fclose(f);
*audio_input_type = GF_MP42TS_UDP;
else if (!strnicmp(arg, "rtp://", 6))
*audio_input_type = GF_MP42TS_RTP;
+#ifndef GPAC_DISABLE_PLAYER
else if (!strnicmp(arg, "http://", 7))
*audio_input_type = GF_MP42TS_HTTP;
+#endif
/*http needs to get the complete URL*/
switch(*audio_input_type) {
case GF_MP42TS_UDP:
*audio_input_ip = gf_strdup(arg+6);
}
break;
+#ifndef GPAC_DISABLE_PLAYER
case GF_MP42TS_HTTP:
/* No need to dup since it may come from argv */
*audio_input_ip = arg;
assert(audio_input_port != 0);
break;
+#endif
default:
assert(0);
}
prev_seg_time.sec = 0;
prev_seg_time.nanosec = 0;
video_buffer_size = 0;
+#ifndef GPAC_DISABLE_PLAYER
aac_reader = AAC_Reader_new();
+#endif
muxer = NULL;
single_au_pes = 0;
bifs_use_pes = 0;
/*TODO: not implemented*/
assert(0);
break;
+#ifndef GPAC_DISABLE_PLAYER
case GF_MP42TS_HTTP:
audio_prog = (void*)&progs[nb_progs-1];
aac_download_file(aac_reader, audio_input_ip);
break;
+#endif
case GF_MP42TS_FILE:
assert(0); /*audio live input is restricted to realtime/streaming*/
break;
/*****************/
last_print_time = gf_sys_clock();
while (run) {
- u32 ts, status;
+ u32 status;
/*check for some audio input from the network*/
if (audio_input_ip) {
SampleCallBack((void*)&progs[nb_progs-1], AUDIO_DATA_ESID, audio_input_buffer, read, gf_m2ts_get_sys_clock(muxer));
}
break;
+#ifndef GPAC_DISABLE_PLAYER
case GF_MP42TS_HTTP:
/*nothing to do: AAC_OnLiveData is called automatically*/
/*check we're still alive*/
gf_odf_desc_del((GF_Descriptor *)esd);
}
break;
+#endif
default:
assert(0);
}
}
#ifndef GPAC_DISABLE_STREAMING
if (ts_output_rtp != NULL) {
+ u32 ts;
hdr.SequenceNumber++;
/*muxer clock at 90k*/
ts = muxer->time.sec*90000 + muxer->time.nanosec*9/100000;
#ifndef GPAC_DISABLE_STREAMING
if (rtp_out) gf_free(rtp_out);
#endif
+#ifndef GPAC_DISABLE_PLAYER
if (aac_reader) AAC_Reader_del(aac_reader);
+#endif
if (muxer) gf_m2ts_mux_del(muxer);
for (i=0; i<nb_progs; i++) {
}
if (progs[i].iod) gf_odf_desc_del((GF_Descriptor*)progs[i].iod);
if (progs[i].mp4) gf_isom_close(progs[i].mp4);
+#ifndef GPAC_DISABLE_SENG
if (progs[i].seng){
gf_seng_terminate(progs[i].seng);
progs[i].seng = NULL;
}
+#endif
if (progs[i].th) gf_th_del(progs[i].th);
}
gf_sys_close();
vpath %.c $(SRC_PATH)/applications/mp4box
-CFLAGS= $(OPTFLAGS) -I"$(SRC_PATH)/include"
+CFLAGS= $(OPTFLAGS) -DGPAC_HAVE_CONFIG_H -I"$(SRC_PATH)/include"
ifeq ($(DEBUGBUILD), yes)
CFLAGS+=-g
LDFLAGS+=-pg
endif
-#file format is read-only
-ifeq ($(GPACREADONLY), yes)
-CFLAGS+= -DGPAC_READ_ONLY
-endif
-
-ifeq ($(DISABLE_SVG), yes)
-CFLAGS+=-DGPAC_DISABLE_SVG
-endif
-
#common obj
OBJS= main.o filedump.o fileimport.o live.o
*
*/
-#include <gpac/scene_manager.h>
+#include <gpac/tools.h>
#if defined(GPAC_DISABLE_ISOM) || defined(GPAC_DISABLE_ISOM_WRITE)
#else
+#ifndef GPAC_DISABLE_X3D
#include <gpac/nodes_x3d.h>
+#endif
+#ifndef GPAC_DISABLE_BIFS
#include <gpac/internal/bifs_dev.h>
+#endif
#include <gpac/constants.h>
#include <gpac/avparse.h>
#include <gpac/media_tools.h>
#include <gpac/iso639.h>
#include <gpac/mpegts.h>
+#ifndef GPAC_DISABLE_SMGR
+#include <gpac/scene_manager.h>
+#endif
extern u32 swf_flags;
extern Float swf_flatten_angle;
void PrintBuiltInNodes(u32 graph_type)
{
+#if !defined(GPAC_DISABLE_VRML) && !defined(GPAC_DISABLE_X3D) && !defined(GPAC_DISABLE_SVG)
GF_Node *node;
GF_SceneGraph *sg;
u32 i, nb_in, nb_not_in, start_tag, end_tag;
} else {
fprintf(stdout, "\n%d nodes supported - %d nodes not supported\n", nb_in, nb_not_in);
}
+#else
+ fprintf(stdout, "\nNo scene graph enabled in this MP4Box build\n");
+#endif
}
#ifndef GPAC_DISABLE_ISOM_DUMP
*/
-#include <gpac/scene_manager.h>
-#include <gpac/bifs.h>
+#include <gpac/tools.h>
#include <gpac/media_tools.h>
#include <gpac/constants.h>
-#include <gpac/scenegraph.h>
+#if !defined(GPAC_DISABLE_VRML) && !defined(GPAC_DISABLE_X3D) && !defined(GPAC_DISABLE_SVG)
+#include <gpac/scenegraph.h>
+#endif
+#ifndef GPAC_DISABLE_SMGR
+#include <gpac/scene_manager.h>
+#endif
+#ifndef GPAC_DISABLE_BIFS
+#include <gpac/bifs.h>
+#endif
#ifndef GPAC_DISABLE_ISOM_WRITE
#include <gpac/xml.h>
*/
-#include <gpac/filestreamer.h>
#include <gpac/constants.h>
#include <gpac/isomedia.h>
+
+#ifndef GPAC_DISABLE_SENG
#include <gpac/scene_engine.h>
+#endif
+#ifndef GPAC_DISABLE_STREAMING
+#include <gpac/filestreamer.h>
#include <gpac/rtp_streamer.h>
+#endif
#if defined(GPAC_DISABLE_ISOM) || defined(GPAC_DISABLE_ISOM_WRITE)
u32 period, ts_delta, signal_critical;
u16 es_id;
e = GF_OK;
- /* souchay : needs to initialize those two vars... */
aggregate_au = 1;
es_id = 0;
no_rap = 0;
*/
-#include <gpac/scene_manager.h>
#include <gpac/download.h>
+#ifndef GPAC_DISABLE_SMGR
+#include <gpac/scene_manager.h>
+#endif
+
#ifdef GPAC_DISABLE_ISOM
#error "Cannot compile MP4Box if GPAC is not built with ISO File Format support"
#else
#include <gpac/media_tools.h>
+
/*RTP packetizer flags*/
+#ifndef GPAC_DISABLE_STREAMING
#include <gpac/ietf.h>
+#endif
+
+#ifndef GPAC_DISABLE_MCRYPT
#include <gpac/ismacryp.h>
+#endif
+
#include <gpac/constants.h>
#include <gpac/internal/mpd.h>
#define BUFFSIZE 8192
/*in fileimport.c*/
+
+#ifndef GPAC_DISABLE_MEDIA_IMPORT
+void convert_file_info(char *inName, u32 trackID);
+#endif
+
#ifndef GPAC_DISABLE_ISOM_WRITE
GF_Err import_file(GF_ISOFile *dest, char *inName, u32 import_flags, Double force_fps, u32 frames_per_sample);
GF_Err split_isomedia_file(GF_ISOFile *mp4, Double split_dur, u32 split_size_kb, char *inName, Double InterleavingTime, Double chunk_start, Bool adjust_split_end, char *outName, const char *tmpdir);
GF_Err cat_isomedia_file(GF_ISOFile *mp4, char *fileName, u32 import_flags, Double force_fps, u32 frames_per_sample, char *tmp_dir, Bool force_cat);
-#if !defined(GPAC_DISABLE_MEDIA_IMPORT) && !defined(GPAC_DISABLE_SCENE_ENCODER)
-void convert_file_info(char *inName, u32 trackID);
+#if !defined(GPAC_DISABLE_SCENE_ENCODER)
GF_Err EncodeFile(char *in, GF_ISOFile *mp4, GF_SMEncodeOptions *opts, FILE *logs);
GF_Err EncodeFileChunk(char *chunkFile, char *bifs, char *inputContext, char *outputContext, const char *tmpdir);
#endif
u32 item_id;
} MetaAction;
-/*for SDP_EX, AddTrack and RemTrack*/
-#define MAX_CUMUL_OPS 20
-
#ifndef GPAC_DISABLE_ISOM_WRITE
static Bool parse_meta_args(MetaAction *meta, char *opts)
{
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)
{
u32 act;
u32 refTrackID = 0;
u32 nb_criteria = 0;
TSELAction *tsel_act;
char szSlot[1024], *next;
+ TSELAction *tsel_list = *__tsel_list;
has_switch_id = 0;
act = tsel_list[*nb_tsel_act].act_type;
}
}
else if (!strnicmp(szSlot, "trackID=", 8) || !strchr(szSlot, '=') ) {
- if (*nb_tsel_act>=MAX_CUMUL_OPS) {
- fprintf(stdout, "Sorry - no more than %d track selection operations allowed\n", MAX_CUMUL_OPS);
- return 0;
- }
+ __tsel_list = realloc(__tsel_list, sizeof(TSELAction) * (*nb_tsel_act + 1));
+ tsel_list = *__tsel_list;
+
tsel_act = &tsel_list[*nb_tsel_act];
memset(tsel_act, 0, sizeof(TSELAction));
tsel_act->act_type = act;
}
-#define CHECK_NEXT_ARG if (i+1==(u32)argc) { fprintf(stdout, "Missing arg - please check usage\n"); return 1; }
-
-#define CHECK_META_OPS CHECK_NEXT_ARG if (nb_meta_act>=MAX_CUMUL_OPS) { fprintf(stdout, "Sorry - no more than %d meta operations allowed\n", MAX_CUMUL_OPS); return 1; }
-
+#define CHECK_NEXT_ARG if (i+1==(u32)argc) { fprintf(stdout, "Missing arg - please check usage\n"); MP4BOX_EXIT_WITH_CODE(1); }
typedef struct
{
GF_ISOM_CONV_TYPE_PSP
};
-/*for dash*/
-#define MAX_DASH_REP 30
+#define MP4BOX_EXIT_WITH_CODE(__ret_code) \
+ if (sdp_lines) free(sdp_lines); \
+ if (metas) free(metas); \
+ if (tracks) free(tracks); \
+ if (tsel_acts) free(tsel_acts); \
+ if (brand_add) free(brand_add); \
+ if (brand_rem) free(brand_rem); \
+ if (dash_inputs) free(dash_inputs); \
+ return __ret_code; \
int mp4boxMain(int argc, char **argv)
{
#ifndef GPAC_DISABLE_SCENE_ENCODER
GF_SMEncodeOptions opts;
#endif
-#if !defined(GPAC_DISABLE_STREAMING) && !defined(GPAC_DISABLE_SENG)
- SDPLine sdp_lines[MAX_CUMUL_OPS];
-#endif
+ SDPLine *sdp_lines = NULL;
Double InterleavingTime, split_duration, split_start, import_fps, dash_duration;
- MetaAction metas[MAX_CUMUL_OPS];
- TrackAction tracks[MAX_CUMUL_OPS];
- TSELAction tsel_acts[MAX_CUMUL_OPS];
+ MetaAction *metas = NULL;
+ TrackAction *tracks = NULL;
+ TSELAction *tsel_acts = NULL;
u64 movie_time;
s32 subsegs_per_sidx;
- u32 brand_add[MAX_CUMUL_OPS];
- u32 i, MTUSize, stat_level, hint_flags, info_track_id, import_flags, nb_add, nb_cat, ismaCrypt, 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;
- Bool HintIt, needSave, FullInter, Frag, HintInter, dump_std, dump_rtp, dump_mode, regular_iod, trackID, HintCopy, remove_sys_tracks, remove_hint, force_new, remove_root_od, import_subtitle, dump_chap;
- Bool print_sdp, print_info, open_edit, track_dump_type, dump_isom, dump_cr, force_ocr, encode, do_log, do_flat, dump_srt, dump_ttxt, chunk_mode, dump_ts, do_saf, do_mpd, dump_m2ts, dump_cart, do_hash, verbose, force_cat, pack_wgt, single_group;
+ u32 *brand_add = NULL;
+ u32 *brand_rem = NULL;
+ u32 i, stat_level, hint_flags, info_track_id, import_flags, nb_add, nb_cat, ismaCrypt, 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;
+ Bool HintIt, needSave, FullInter, Frag, HintInter, dump_std, dump_rtp, dump_mode, regular_iod, trackID, remove_sys_tracks, remove_hint, force_new, remove_root_od, import_subtitle, dump_chap;
+ Bool print_sdp, print_info, open_edit, track_dump_type, dump_isom, dump_cr, force_ocr, encode, do_log, do_flat, dump_srt, dump_ttxt, dump_ts, do_saf, do_mpd, dump_m2ts, dump_cart, do_hash, verbose, force_cat, pack_wgt, single_group;
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;
+
+#ifndef GPAC_DISABLE_SCENE_ENCODER
+ Bool chunk_mode=0;
+#endif
+#ifndef GPAC_DISABLE_ISOM_HINTING
+ Bool HintCopy=0;
+ u32 MTUSize = 1450;
+#endif
GF_ISOFile *file;
Bool stream_rtp=0;
Bool live_scene=0;
Bool use_url_template=0;
Bool seg_at_rap =0;
Bool adjust_split_end = 0;
- char *dash_inputs[MAX_DASH_REP];
+ char **dash_inputs = NULL;
u32 nb_dash_inputs = 0;
char *gf_logs = NULL;
char *seg_ext = NULL;
if (argc < 2) {
PrintUsage();
- return 1;
+ MP4BOX_EXIT_WITH_CODE(1);
}
nb_tsel_acts = nb_add = nb_cat = nb_track_act = nb_sdp_ex = max_ptime = raw_sample_num = nb_meta_act = rtp_rate = major_brand = nb_alt_brand_add = nb_alt_brand_rem = car_dur = minor_version = 0;
import_flags = 0;
split_size = 0;
movie_time = 0;
- MTUSize = 1450;
- HintCopy = FullInter = HintInter = encode = do_log = old_interleave = do_saf = do_mpd = do_hash = verbose = 0;
- chunk_mode = dump_mode = Frag = force_ocr = remove_sys_tracks = agg_samples = remove_hint = keep_sys_tracks = remove_root_od = single_group = 0;
+ FullInter = HintInter = encode = do_log = old_interleave = do_saf = do_mpd = 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;
conv_type = HintIt = needSave = print_sdp = print_info = regular_iod = dump_std = open_edit = dump_isom = dump_rtp = dump_cr = dump_chap = dump_srt = dump_ttxt = force_new = dump_ts = dump_m2ts = dump_cart = import_subtitle = force_cat = pack_wgt = 0;
subsegs_per_sidx = 0;
track_dump_type = 0;
do_flat = 0;
inName = outName = mediaSource = input_ctx = output_ctx = drm_file = avi2raw = cprt = chap_file = pack_file = raw_cat = NULL;
+#ifndef GPAC_DISABLE_SWF_IMPORT
swf_flags = GF_SM_SWF_SPLIT_TIMELINE;
+#endif
swf_flatten_angle = 0.0f;
tmpdir = NULL;
if (arg[0] != '-') {
if (argc < 3) {
fprintf(stdout, "Error - only one input file found as argument, please check usage\n");
- return 1;
+ MP4BOX_EXIT_WITH_CODE(1);
} else if (inName) {
if (dash_duration) {
if (!nb_dash_inputs) {
+ dash_inputs = realloc(dash_inputs, sizeof(char *) * (nb_dash_inputs+1) );
dash_inputs[nb_dash_inputs] = inName;
nb_dash_inputs++;
}
- if (MAX_DASH_REP<=nb_dash_inputs) {
- fprintf(stdout, "Error - Max %d representations can be DASH'ed\n", MAX_DASH_REP);
- return 1;
- }
+ dash_inputs = realloc(dash_inputs, sizeof(char *) * (nb_dash_inputs+1) );
+
dash_inputs[nb_dash_inputs] = arg;
nb_dash_inputs++;
} else {
fprintf(stdout, "Error - 2 input names specified, please check usage\n");
- return 1;
+ MP4BOX_EXIT_WITH_CODE(1);
}
} else {
inName = arg;
}
}
- else if (!stricmp(arg, "-?")) { PrintUsage(); return 0; }
- else if (!stricmp(arg, "-version")) { PrintVersion(); return 0; }
+ else if (!stricmp(arg, "-?")) { PrintUsage(); MP4BOX_EXIT_WITH_CODE(0); }
+ else if (!stricmp(arg, "-version")) { PrintVersion(); MP4BOX_EXIT_WITH_CODE(0); }
else if (!stricmp(arg, "-sdp")) print_sdp = 1;
else if (!stricmp(arg, "-quiet")) quiet = 2;
else if (!stricmp(arg, "-logs")) {
if (strlen(argv[i+1])==5) trackID = 2;
else trackID = 1 + atoi(argv[i+1] + 5);
}
- else { fprintf(stdout, "Usage: \"-aviraw video\" or \"-aviraw audio\"\n"); return 1; }
+ else { fprintf(stdout, "Usage: \"-aviraw video\" or \"-aviraw audio\"\n"); MP4BOX_EXIT_WITH_CODE(1); }
track_dump_type = GF_EXPORT_AVI_NATIVE;
i++;
}
dump_iod = 1;
}
#ifndef GPAC_DISABLE_VRML
- else if (!stricmp(arg, "-node")) { CHECK_NEXT_ARG PrintNode(argv[i+1], 0); return (0); }
- else if (!stricmp(arg, "-xnode")) { CHECK_NEXT_ARG PrintNode(argv[i+1], 1); return (0); }
- else if (!stricmp(arg, "-nodes")) { PrintBuiltInNodes(0); return (0); }
- else if (!stricmp(arg, "-xnodes")) { PrintBuiltInNodes(1); return (0); }
+ else if (!stricmp(arg, "-node")) { CHECK_NEXT_ARG PrintNode(argv[i+1], 0); MP4BOX_EXIT_WITH_CODE(0); }
+ else if (!stricmp(arg, "-xnode")) { CHECK_NEXT_ARG PrintNode(argv[i+1], 1); MP4BOX_EXIT_WITH_CODE(0); }
+ else if (!stricmp(arg, "-nodes")) { PrintBuiltInNodes(0); MP4BOX_EXIT_WITH_CODE(0); }
+ else if (!stricmp(arg, "-xnodes")) { PrintBuiltInNodes(1); MP4BOX_EXIT_WITH_CODE(0); }
#endif
#ifndef GPAC_DISABLE_SVG
- else if (!stricmp(arg, "-snode")) { CHECK_NEXT_ARG PrintNode(argv[i+1], 2); return (0); }
- else if (!stricmp(arg, "-snodes")) { PrintBuiltInNodes(2); return (0); }
+ else if (!stricmp(arg, "-snode")) { CHECK_NEXT_ARG PrintNode(argv[i+1], 2); MP4BOX_EXIT_WITH_CODE(0); }
+ else if (!stricmp(arg, "-snodes")) { PrintBuiltInNodes(2); MP4BOX_EXIT_WITH_CODE(0); }
else if (!stricmp(arg, "-std")) dump_std = 1;
#endif
trackID = 0;
}
#ifdef GPAC_DISABLE_ISOM_WRITE
- if (trackID) { fprintf(stdout, "Error: Read-Only version - subtitle conversion not available\n"); return 1; }
+ if (trackID) { fprintf(stdout, "Error: Read-Only version - subtitle conversion not available\n"); MP4BOX_EXIT_WITH_CODE(1); }
#endif
if (!stricmp(arg, "-ttxt")) dump_ttxt = 1;
else dump_srt = 1;
}
}
-#ifndef GPAC_DISABLE_ISOM_WRITE
+#ifndef GPAC_DISABLE_SWF_IMPORT
/*SWF importer options*/
else if (!stricmp(arg, "-global")) swf_flags |= GF_SM_SWF_STATIC_DICT;
else if (!stricmp(arg, "-no-ctrl")) swf_flags &= ~GF_SM_SWF_SPLIT_TIMELINE;
swf_flatten_angle = (Float) atof(argv[i+1]);
i++;
}
+#endif
+#ifndef GPAC_DISABLE_ISOM_WRITE
else if (!stricmp(arg, "-isma")) { conv_type = GF_ISOM_CONV_TYPE_ISMA; open_edit = 1; }
else if (!stricmp(arg, "-3gp")) { conv_type = GF_ISOM_CONV_TYPE_3GPP; open_edit = 1; }
else if (!stricmp(arg, "-ipod")) { conv_type = GF_ISOM_CONV_TYPE_IPOD; open_edit = 1; }
else if (!stricmp(arg, "-add-sdp") || !stricmp(arg, "-sdp_ex")) {
char *id;
CHECK_NEXT_ARG
- if (nb_sdp_ex>=MAX_CUMUL_OPS) {
- fprintf(stdout, "Sorry - no more than %d extra SDP lines allowed\n", MAX_CUMUL_OPS);
- return 1;
- }
+ sdp_lines = realloc(sdp_lines, sizeof(SDPLine) * (nb_sdp_ex+1) );
+
id = strchr(argv[i+1], ':');
if (id) {
id[0] = 0;
}
else if (!stricmp(arg, "-rem") || !stricmp(arg, "-disable") || !stricmp(arg, "-enable")) {
CHECK_NEXT_ARG
- if (nb_track_act>=MAX_CUMUL_OPS) {
- fprintf(stdout, "Sorry - no more than %d track operations allowed\n", MAX_CUMUL_OPS);
- return 1;
- }
+ tracks = realloc(tracks, sizeof(TrackAction) * (nb_track_act+1));
+
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;
else if (!stricmp(arg, "-par")) {
char szTK[20], *ext;
CHECK_NEXT_ARG
- if (nb_track_act>=MAX_CUMUL_OPS) {
- fprintf(stdout, "Sorry - no more than %d track operations allowed\n", MAX_CUMUL_OPS);
- return 1;
- }
+ tracks = realloc(tracks, sizeof(TrackAction) * (nb_track_act+1));
+
tracks[nb_track_act].act_type = 4;
strcpy(szTK, argv[i+1]);
ext = strchr(szTK, '=');
if (!ext) {
fprintf(stdout, "Bad format for track par - expecting ID=PAR_NUM:PAR_DEN got %s\n", argv[i+1]);
- return 1;
+ MP4BOX_EXIT_WITH_CODE(1);
}
if (!stricmp(ext+1, "none")) {
tracks[nb_track_act].par_num = tracks[nb_track_act].par_den = -1;
else if (!stricmp(arg, "-lang")) {
char szTK[20], *ext;
CHECK_NEXT_ARG
- if (nb_track_act>=MAX_CUMUL_OPS) {
- fprintf(stdout, "Sorry - no more than %d track operations allowed\n", MAX_CUMUL_OPS);
- return 1;
- }
+ tracks = realloc(tracks, sizeof(TrackAction) * (nb_track_act+1));
+
tracks[nb_track_act].act_type = 1;
tracks[nb_track_act].lang[3] = 0;
tracks[nb_track_act].trackID = 0;
else if (!stricmp(arg, "-delay")) {
char szTK[20], *ext;
CHECK_NEXT_ARG
- if (nb_track_act>=MAX_CUMUL_OPS) {
- fprintf(stdout, "Sorry - no more than %d track operations allowed\n", MAX_CUMUL_OPS);
- return 1;
- }
+ tracks = realloc(tracks, sizeof(TrackAction) * (nb_track_act+1));
+
strcpy(szTK, argv[i+1]);
ext = strchr(szTK, '=');
if (!ext) {
fprintf(stdout, "Bad format for track delay - expecting ID=DLAY got %s\n", argv[i+1]);
- return 1;
+ MP4BOX_EXIT_WITH_CODE(1);
}
tracks[nb_track_act].act_type = 2;
tracks[nb_track_act].delay_ms = atoi(ext+1);
else if (!stricmp(arg, "-ref")) {
char *szTK, *ext;
CHECK_NEXT_ARG
- if (nb_track_act>=MAX_CUMUL_OPS) {
- fprintf(stdout, "Sorry - no more than %d track operations allowed\n", MAX_CUMUL_OPS);
- return 1;
- }
+ tracks = realloc(tracks, sizeof(TrackAction) * (nb_track_act+1));
+
szTK = argv[i+1];
ext = strchr(szTK, ':');
if (!ext) {
fprintf(stdout, "Bad format for track reference - expecting ID:XXXX:refID got %s\n", argv[i+1]);
- return 1;
+ MP4BOX_EXIT_WITH_CODE(1);
}
tracks[nb_track_act].act_type = 8;
ext[0] = 0; tracks[nb_track_act].trackID = atoi(szTK); ext[0] = ':'; szTK = ext+1;
ext = strchr(szTK, ':');
if (!ext) {
fprintf(stdout, "Bad format for track reference - expecting ID:XXXX:refID got %s\n", argv[i+1]);
- return 1;
+ MP4BOX_EXIT_WITH_CODE(1);
}
ext[0] = 0;
strncpy(tracks[nb_track_act].lang, szTK, 4);
else if (!stricmp(arg, "-name")) {
char szTK[GF_MAX_PATH], *ext;
CHECK_NEXT_ARG
- if (nb_track_act>=MAX_CUMUL_OPS) {
- fprintf(stdout, "Sorry - no more than %d track operations allowed\n", MAX_CUMUL_OPS);
- return 1;
- }
+ tracks = realloc(tracks, sizeof(TrackAction) * (nb_track_act+1));
+
strcpy(szTK, argv[i+1]);
ext = strchr(szTK, '=');
if (!ext) {
fprintf(stdout, "Bad format for track name - expecting ID=name got %s\n", argv[i+1]);
- return 1;
+ MP4BOX_EXIT_WITH_CODE(1);
}
tracks[nb_track_act].act_type = 5;
tracks[nb_track_act].hdl_name = strchr(argv[i+1], '=') + 1;
else if (!stricmp(arg, "-set-kms")) {
char szTK[20], *ext;
CHECK_NEXT_ARG
- if (nb_track_act>=MAX_CUMUL_OPS) {
- fprintf(stdout, "Sorry - no more than %d track operations allowed\n", MAX_CUMUL_OPS);
- return 1;
- }
+ tracks = realloc(tracks, sizeof(TrackAction) * (nb_track_act+1));
+
strncpy(szTK, argv[i+1], 19);
ext = strchr(szTK, '=');
tracks[nb_track_act].act_type = 3;
CHECK_NEXT_ARG
if (!strstr(argv[i+1], ":")) {
fprintf(stdout, "Chunk extraction usage: \"-splitx start:end\" expressed in seconds\n");
- return 1;
+ MP4BOX_EXIT_WITH_CODE(1);
}
sscanf(argv[i+1], "%lf:%lf", &split_start, &split_duration);
split_duration -= split_start;
}
/*meta*/
else if (!stricmp(arg, "-set-meta")) {
- CHECK_META_OPS
+ metas = realloc(metas, sizeof(MetaAction) * (nb_meta_act+1));
+
metas[nb_meta_act].act_type = 0;
parse_meta_args(&metas[nb_meta_act], argv[i+1]);
nb_meta_act++;
i++;
}
else if (!stricmp(arg, "-add-item")) {
- CHECK_META_OPS
+ metas = realloc(metas, sizeof(MetaAction) * (nb_meta_act+1));
+
metas[nb_meta_act].act_type = 1;
parse_meta_args(&metas[nb_meta_act], argv[i+1]);
nb_meta_act++;
i++;
}
else if (!stricmp(arg, "-rem-item")) {
- CHECK_META_OPS
+ metas = realloc(metas, sizeof(MetaAction) * (nb_meta_act+1));
+
metas[nb_meta_act].act_type = 2;
parse_meta_args(&metas[nb_meta_act], argv[i+1]);
nb_meta_act++;
i++;
}
else if (!stricmp(arg, "-set-primary")) {
- CHECK_META_OPS
+ metas = realloc(metas, sizeof(MetaAction) * (nb_meta_act+1));
+
metas[nb_meta_act].act_type = 3;
parse_meta_args(&metas[nb_meta_act], argv[i+1]);
nb_meta_act++;
i++;
}
else if (!stricmp(arg, "-set-xml")) {
- CHECK_META_OPS
+ metas = realloc(metas, sizeof(MetaAction) * (nb_meta_act+1));
+
metas[nb_meta_act].act_type = 4;
parse_meta_args(&metas[nb_meta_act], argv[i+1]);
nb_meta_act++;
i++;
}
else if (!stricmp(arg, "-rem-xml")) {
- CHECK_META_OPS
+ metas = realloc(metas, sizeof(MetaAction) * (nb_meta_act+1));
+
metas[nb_meta_act].act_type = 6;
if (parse_meta_args(&metas[nb_meta_act], argv[i+1])) i++;
nb_meta_act++;
open_edit = 1;
}
else if (!stricmp(arg, "-dump-xml")) {
- CHECK_META_OPS
+ metas = realloc(metas, sizeof(MetaAction) * (nb_meta_act+1));
+
metas[nb_meta_act].act_type = 7;
parse_meta_args(&metas[nb_meta_act], argv[i+1]);
nb_meta_act++;
i++;
}
else if (!stricmp(arg, "-dump-item")) {
- CHECK_META_OPS
+ metas = realloc(metas, sizeof(MetaAction) * (nb_meta_act+1));
+
metas[nb_meta_act].act_type = 8;
parse_meta_args(&metas[nb_meta_act], argv[i+1]);
nb_meta_act++;
}
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) {
+ if (parse_tsel_args(&tsel_acts, argv[i+1], &nb_tsel_acts)==0) {
fprintf(stdout, "Invalid group syntax - check usage\n");
- return 1;
+ MP4BOX_EXIT_WITH_CODE(1);
}
open_edit=1;
i++;
else if (!stricmp(arg, "-ab")) {
char *b = argv[i+1];
CHECK_NEXT_ARG
- if (nb_alt_brand_add>=MAX_CUMUL_OPS) {
- fprintf(stdout, "Sorry - no more than %d brand remove operations allowed\n", MAX_CUMUL_OPS);
- return 1;
- }
+ brand_add = realloc(brand_add, sizeof(u32) * (nb_alt_brand_add+1));
+
brand_add[nb_alt_brand_add] = GF_4CC(b[0], b[1], b[2], b[3]);
nb_alt_brand_add++;
open_edit = 1;
i++;
}
else if (!stricmp(arg, "-rb")) {
+ char *b = argv[i+1];
CHECK_NEXT_ARG
- if (nb_alt_brand_rem>=MAX_CUMUL_OPS) {
- fprintf(stdout, "Sorry - no more than %d brand remove operations allowed\n", MAX_CUMUL_OPS);
- return 1;
- }
+ brand_rem = realloc(brand_rem, sizeof(u32) * (nb_alt_brand_rem+1));
+
+ brand_rem[nb_alt_brand_rem] = GF_4CC(b[0], b[1], b[2], b[3]);
nb_alt_brand_rem++;
open_edit = 1;
i++;
#endif
else if (!stricmp(arg, "-languages")) {
PrintLanguages();
- return 0;
+ MP4BOX_EXIT_WITH_CODE(0);
}
else if (!stricmp(arg, "-h")) {
if (i+1== (u32) argc) PrintUsage();
#endif
}
else PrintUsage();
- return 0;
+ MP4BOX_EXIT_WITH_CODE(0);
}
else if (!stricmp(arg, "-v")) verbose++;
else if (!stricmp(arg, "-tag-list")) {
for (i=0; i<nb_itunes_tags; i++) {
fprintf(stdout, "\t%s\t%s\n", itags[i].name, itags[i].comment);
}
- return 0;
+ MP4BOX_EXIT_WITH_CODE(0);
} else if (!live_scene && !stream_rtp) {
fprintf(stdout, "Option %s unknown. Please check usage\n", arg);
- return 1;
+ MP4BOX_EXIT_WITH_CODE(1);
}
}
if (!inName) {
PrintUsage();
- return 1;
+ MP4BOX_EXIT_WITH_CODE(1);
}
#if !defined(GPAC_DISABLE_STREAMING) && !defined(GPAC_DISABLE_SENG)
if (live_scene) {
- return live_session(argc, argv);
+ int ret = live_session(argc, argv);
+ MP4BOX_EXIT_WITH_CODE(ret);
}
if (stream_rtp) {
- return stream_file_rtp(argc, argv);
+ int ret = stream_file_rtp(argc, argv);
+ MP4BOX_EXIT_WITH_CODE(ret);
}
#endif
FILE *fin, *fout;
s64 to_copy, done;
fin = gf_f64_open(raw_cat, "rb");
- if (!fin) return 1;
+ if (!fin) MP4BOX_EXIT_WITH_CODE(1);
fout = gf_f64_open(inName, "a+b");
if (!fout) {
fclose(fin);
- return 1;
+ MP4BOX_EXIT_WITH_CODE(1);
}
gf_f64_seek(fin, 0, SEEK_END);
to_copy = gf_f64_tell(fin);
}
fclose(fin);
fclose(fout);
- return 0;
+ MP4BOX_EXIT_WITH_CODE(0);
}
/*init libgpac*/
if (e != GF_OK) {
fprintf(stdout, "Cannot retrieve M3U8 (%s): %s\n", inName, gf_error_to_string(e));
gf_free(mpd_base_url);
- return 1;
+ MP4BOX_EXIT_WITH_CODE(1);
}
inName = "tmp_main.m3u8";
remote = 1;
}
- e = gf_m3u8_to_mpd(inName, mpd_base_url, (outName ? outName : inName), 0, "video/mp2t", NULL, 1, use_url_template);
+ 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);
if (remote) {
//gf_delete_file("tmp_main.m3u8");
}
if (e != GF_OK) {
fprintf(stdout, "Error converting M3U8 (%s) to MPD (%s): %s\n", inName, outName, gf_error_to_string(e));
- return 1;
+ MP4BOX_EXIT_WITH_CODE(1);
} else {
fprintf(stdout, "Done converting M3U8 (%s) to MPD (%s)\n", inName, outName);
- return 0;
+ MP4BOX_EXIT_WITH_CODE(0);
}
}
if (dash_duration && !nb_dash_inputs) {
+ dash_inputs = realloc(dash_inputs, sizeof(char *) * (nb_dash_inputs+1) );
dash_inputs[nb_dash_inputs] = inName;
nb_dash_inputs++;
}
fprintf(stdout, "Error importing %s: %s\n", inName, gf_error_to_string(e));
gf_isom_delete(file);
gf_delete_file("ttxt_convert");
- return 1;
+ MP4BOX_EXIT_WITH_CODE(1);
}
strcpy(outfile, outName ? outName : inName);
if (strchr(outfile, '.')) {
gf_delete_file("ttxt_convert");
if (e) {
fprintf(stdout, "Error converting %s: %s\n", inName, gf_error_to_string(e));
- return 1;
+ MP4BOX_EXIT_WITH_CODE(1);
}
- return 0;
+ MP4BOX_EXIT_WITH_CODE(0);
#else
fprintf(stdout, "Feature not supported\n");
- return 1;
+ MP4BOX_EXIT_WITH_CODE(1);
#endif
}
file = gf_isom_open(inName, open_mode, tmpdir);
if (!file) {
fprintf(stdout, "Cannot open destination file %s: %s\n", inName, gf_error_to_string(gf_isom_last_error(NULL)) );
- return 1;
+ MP4BOX_EXIT_WITH_CODE(1);
}
for (i=0; i<(u32) argc; i++) {
if (!strcmp(argv[i], "-add")) {
if (e) {
fprintf(stdout, "Error importing %s: %s\n", argv[i+1], gf_error_to_string(e));
gf_isom_delete(file);
- return 1;
+ MP4BOX_EXIT_WITH_CODE(1);
}
i++;
}
file = gf_isom_open(inName, open_mode, tmpdir);
if (!file) {
fprintf(stdout, "Cannot open destination file %s: %s\n", inName, gf_error_to_string(gf_isom_last_error(NULL)) );
- return 1;
+ MP4BOX_EXIT_WITH_CODE(1);
}
}
for (i=0; i<(u32)argc; i++) {
if (e) {
fprintf(stdout, "Error appending %s: %s\n", argv[i+1], gf_error_to_string(e));
gf_isom_delete(file);
- return 1;
+ MP4BOX_EXIT_WITH_CODE(1);
}
i++;
}
else if (chunk_mode) {
if (!inName) {
fprintf(stdout, "chunk encoding syntax: [-outctx outDump] -inctx inScene auFile\n");
- return 1;
+ MP4BOX_EXIT_WITH_CODE(1);
}
e = EncodeFileChunk(inName, outName ? outName : inName, input_ctx, output_ctx, tmpdir);
if (e) fprintf(stdout, "Error encoding chunk file %s\n", gf_error_to_string(e));
- return e ? 1 : 0;
+ MP4BOX_EXIT_WITH_CODE( e ? 1 : 0 );
}
#endif
else if (encode) {
if (!file) {
fprintf(stdout, "Error opening file %s: %s\n", inName, gf_error_to_string(gf_isom_last_error(NULL)));
- return 1;
+ MP4BOX_EXIT_WITH_CODE(1);
}
}
break;
fprintf(stdout, "Error importing %s: %s\n", inName, gf_error_to_string(e));
gf_isom_delete(file);
gf_delete_file("ttxt_convert");
- return 1;
+ MP4BOX_EXIT_WITH_CODE(1);
}
}
#endif /*GPAC_DISABLE_MEDIA_IMPORT*/
convert_file_info(inName, info_track_id);
#endif
}
- return 0;
+ MP4BOX_EXIT_WITH_CODE(0);
}
#endif /*GPAC_DISABLE_ISOM_WRITE*/
else if (open_edit) {
if (!outName && file) outName = inName;
} else if (!file_exists) {
fprintf(stdout, "Error creating file %s: %s\n", inName, gf_error_to_string(GF_URL_ERROR));
- return 1;
+ MP4BOX_EXIT_WITH_CODE(1);
} else {
fprintf(stdout, "Cannot open %s - extension not supported\n", inName);
- return 1;
+ MP4BOX_EXIT_WITH_CODE(1);
}
}
}
mdump.out_name = szFile;
e = gf_media_export(&mdump);
if (e) goto err_exit;
- return 0;
+ MP4BOX_EXIT_WITH_CODE(0);
}
if (!open_edit && !gf_isom_probe_file(inName) && track_dump_type) {
GF_MediaExporter mdump;
mdump.out_name = outfile;
e = gf_media_export(&mdump);
if (e) goto err_exit;
- return 0;
+ MP4BOX_EXIT_WITH_CODE(0);
}
#endif /*GPAC_DISABLE_MEDIA_EXPORT*/
if (!open_edit && !needSave) {
if (file) gf_isom_delete(file);
gf_sys_close();
- return 0;
+ MP4BOX_EXIT_WITH_CODE(0);
}
#ifndef GPAC_DISABLE_ISOM_WRITE
if (!file) {
fprintf(stdout, "Nothing to do - exiting\n");
gf_sys_close();
- return 0;
+ MP4BOX_EXIT_WITH_CODE(0);
}
if (outName) {
strcpy(outfile, outName);
fprintf(stdout, "Error while opening %s: %s\n", dash_inputs[i], gf_error_to_string( gf_isom_last_error(NULL) ));
gf_isom_delete(file);
gf_sys_close();
- return 1;
+ MP4BOX_EXIT_WITH_CODE(0);
}
}
for (j=0; j<gf_isom_get_track_count(in); j++) {
gf_isom_delete(file);
gf_sys_close();
- return (e!=GF_OK) ? 1 : 0;
+ MP4BOX_EXIT_WITH_CODE( (e!=GF_OK) ? 1 : 0 );
#ifndef GPAC_DISABLE_ISOM_FRAGMENTS
} else if (Frag) {
if (!InterleavingTime) InterleavingTime = 0.5;
else if (rename(outfile, inName)) fprintf(stdout, "Error renaming file %s to %s\n", outfile, inName);
}
gf_sys_close();
- return (e!=GF_OK) ? 1 : 0;
+ MP4BOX_EXIT_WITH_CODE( (e!=GF_OK) ? 1 : 0 );
#endif
}
needSave = 1;
}
for (i=0; i<nb_alt_brand_rem; i++) {
- gf_isom_modify_alternate_brand(file, brand_add[i], 0);
+ gf_isom_modify_alternate_brand(file, brand_rem[i], 0);
needSave = 1;
}
gf_sys_close();
if (e) fprintf(stdout, "Error: %s\n", gf_error_to_string(e));
- return (e!=GF_OK) ? 1 : 0;
+ MP4BOX_EXIT_WITH_CODE( (e!=GF_OK) ? 1 : 0 );
#else
/*close libgpac*/
gf_sys_close();
gf_isom_delete(file);
fprintf(stdout, "Error: Read-only version of MP4Box.\n");
- return 1;
+ MP4BOX_EXIT_WITH_CODE(1);
#endif
err_exit:
/*close libgpac*/
gf_sys_close();
if (file) gf_isom_delete(file);
fprintf(stdout, "\n\tError: %s\n", gf_error_to_string(e));
- return 1;
+ MP4BOX_EXIT_WITH_CODE(1);
}
int main( int argc, char** argv )
\r
for /f "delims=" %%a in ('svnversion ') do set gpac_revision=%%a\r
\r
-zip "GPAC_0.4.6-r%gpac_revision%_WindowsMobile.zip" ../*.dll ../*.exe ../*.plg\r
+zip "GPAC_0.5.0-r%gpac_revision%_WindowsMobile.zip" ../*.dll ../*.exe ../*.plg\r
\r
cd /d %OLDDIR%\r
for /f "delims=" %%a in ('svnversion') do set gpac_revision=%%a\r
\r
ECHO [Version] > gpaccab.inf\r
-ECHO Provider = "GPAC 0.4.6-r%gpac_revision%" >> gpaccab.inf\r
+ECHO Provider = "GPAC 0.5.0-r%gpac_revision%" >> gpaccab.inf\r
type gpac.inf >> gpaccab.inf\r
\r
CabWiz gpaccab.inf\r
ECHO off\r
\r
ECHO [CEAppManager]> gpac.ini\r
-ECHO Version = 0.4.6-r%gpac_revision%>> gpac.ini\r
+ECHO Version = 0.5.0-r%gpac_revision%>> gpac.ini\r
ECHO Component = GPAC for Windows Mobile>> gpac.ini\r
ECHO [GPAC for Windows Mobile]>> gpac.ini\r
ECHO Description = GPAC MPEG-4 Player>> gpac.ini\r
ECHO on\r
\r
ezsetup -l english -i gpac.ini -r readme.txt -e ../../../../COPYING -o gpac.exe\r
-rename gpac.exe "GPAC_0.4.6-r%gpac_revision%_WindowsMobile.exe"\r
+rename gpac.exe "GPAC_0.5.0-r%gpac_revision%_WindowsMobile.exe"\r
DEL gpaccab.cab\r
DEL gpaccab.inf\r
DEL gpac.ini\r
;[Version]
-;Provider = "GPAC 0.4.6"
+;Provider = "GPAC 0.5.0"
Signature = "$Windows NT$"
CESignature = "$Windows CE$"
-This will install GPAC version 0.4.5 for ARM PocketPC/SmartPhones 2003 Platforms\r
+This will install GPAC version 0.5.0 for ARM PocketPC/SmartPhones 2003 Platforms\r
\r
GPAC is an open source MPEG-4 framework developped by ENST and available at:\r
http://gpac.sourceforge.net\r
-;--------------------------------
-;General
-!define GPAC_VERSION 0.4.6-DEV
-!include default.out
-
-!define GPAC_ROOT ..\..\..\..
-
-InstallDir "$PROGRAMFILES\GPAC"
-InstallDirRegKey HKCU "SOFTWARE\GPAC" "InstallDir"
-
-RequestExecutionLevel user
-
-
-;--------------------------------
-;Include Modern UI
-
- !include "MUI2.nsh"
-
-WindowIcon on
-Icon "..\..\..\..\doc\osmo4.ico"
-UninstallIcon "..\..\..\..\doc\osmo4.ico"
-
-
-;--------------------------------
-;Interface Settings
-
- !define MUI_ABORTWARNING
-
-Var DIALOG
-Var Label
-Var Confirm
-
-LangString PAGE_TITLE ${LANG_ENGLISH} "Title"
-LangString PAGE_SUBTITLE ${LANG_ENGLISH} "Subtitle"
-
-Function EnableNext
- Pop $R1
- ${NSD_GetState} $Confirm $R1
- GetDlgItem $0 $HWNDPARENT 1
- ${If} $R1 == ${BST_CHECKED}
- EnableWindow $0 1
- ${Else}
- EnableWindow $0 0
- ${Endif}
-FunctionEnd
-
-Function customPage
- !insertmacro MUI_HEADER_TEXT "Patents and Royalties" "Please read carefully the following clause."
- GetDlgItem $0 $HWNDPARENT 1
- EnableWindow $0 0
- nsDialogs::Create 1018
- Pop $DIALOG
-
- ${NSD_CreateLabel} 0 0 100% 120u "Multimedia technologies are often covered by various patents which are most of the time hard to identify. These patents may or may not apply in your local jurisdiction. By installing this software, you acknowledge that you may have to pay royaltee fees in order to legally use this software. Do not proceed with this setup if you do not understand or do not agree with these terms. In any case, the authors and/or distributors bears no liability for any infringing usage of this software, which is provided for educational or research purposes."
- Pop $Label
-
- ${NSD_CreateCheckBox} 0 -30 100% 12u "I understand and accept the conditions"
- Pop $Confirm
- GetFunctionAddress $0 EnableNext
- nsDialogs::OnClick $Confirm $0
-
-
- nsDialogs::Show
-FunctionEnd
-
-;--------------------------------
-;Pages
-
- !insertmacro MUI_PAGE_WELCOME
- !insertmacro MUI_PAGE_LICENSE "${GPAC_ROOT}\COPYING"
- Page custom customPage
- !insertmacro MUI_PAGE_COMPONENTS
- !insertmacro MUI_PAGE_DIRECTORY
-
- !insertmacro MUI_PAGE_INSTFILES
- !insertmacro MUI_PAGE_FINISH
-
- !insertmacro MUI_UNPAGE_CONFIRM
- !insertmacro MUI_UNPAGE_INSTFILES
-
- !insertmacro MUI_LANGUAGE "English"
-
-ComponentText "This will install the GPAC Framework on your computer. Select which optional things you want installed."
-DirText "This will install the GPAC Framework on your computer. Choose a directory"
-
-
-Function FctWriteRegStrAuth
- ;local var
- Push $0
- Push $R0
- Push $R1
- Push $R2
- Push $R3
- ;pop function arguments
- Exch 5
- Pop $R3
- Exch 5
- Pop $R2
- Exch 5
- Pop $R1
- Exch 5
- Pop $R0
-
- ;test if calling HKCR
- StrCmp $R0 "HKCR" +1 +3
- WriteRegStr HKCR $R1 $R2 $R3
- goto lbl_end
-
- #has current user admin privileges?
- userInfo::getAccountType
- Pop $0
- StrCmp $0 "Admin" lbl_admin lbl_not_admin
-
- lbl_admin:
- WriteRegStr HKLM $R1 $R2 $R3
- goto lbl_end
-
- lbl_not_admin:
- WriteRegStr HKCU $R1 $R2 $R3
-
- lbl_end:
- Pop $R3
- Pop $R2
- Pop $R1
- Pop $R0
- Pop $0
-FunctionEnd
-
-!macro WriteRegStrAuth HKREG SUBREG ENTRY VALUESTR
- Push "${HKREG}"
- Push "${SUBREG}"
- Push "${ENTRY}"
- Push "${VALUESTR}"
- Call FctWriteRegStrAuth
-!macroend
-
-!define WriteRegStrAuth "!insertmacro WriteRegStrAuth"
-
-
-Function un.FctDeleteRegKeyAuth
- ;local var
- Push $0
- Push $R0
- Push $R1
- ;pop function arguments
- Exch 3
- Pop $R1
- Exch 3
- Pop $R0
-
- ;test if calling HKCR
- StrCmp $R0 "HKCR" +1 +3
- DeleteRegKey HKCR $R1
- goto lbl_end
-
- #has current user admin privileges?
- userInfo::getAccountType
- Pop $0
- StrCmp $0 "Admin" lbl_admin lbl_not_admin
-
- lbl_admin:
- DeleteRegKey HKLM $R1
- goto lbl_end
-
- lbl_not_admin:
- DeleteRegKey HKCU $R1
-
- lbl_end:
- Pop $0
- Pop $R1
- Pop $R0
-FunctionEnd
-
-!macro DeleteRegKeyAuth HKREG SUBREG
- Push "${HKREG}"
- Push "${SUBREG}"
- Call un.FctDeleteRegKeyAuth
-!macroend
-
-!define DeleteRegKeyAuth "!insertmacro DeleteRegKeyAuth"
-
-
-Function InsertGDIPLUS
- Push $R0
- Push $R1
- ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
- StrCmp $R0 "" 0 lbl_winnt
-
- ;NOT NT
- ReadRegStr $R0 HKLM SOFTWARE\Microsoft\Windows\CurrentVersion VersionNumber
-
- StrCpy $R1 $R0 1
- ; win95, NOT SUPPORTED
- StrCmp $R1 '4' 0 lbl_err_95
- StrCpy $R1 $R0 3
- StrCmp $R1 '4.0' lbl_err_95
- ;winME or 98 otherwise
- StrCmp $R1 '4.9' lbl_add lbl_add
-
-lbl_err_nt:
- MessageBox MB_OK "Microsoft GDI+ cannot be installed on NT 3 Systems"
- Goto lbl_done
-
-lbl_err_95:
- MessageBox MB_OK "Microsoft GDI+ cannot be installed on Windows 95 and older Systems"
- Goto lbl_done
-
-lbl_winnt:
- StrCpy $R1 $R0 1
- StrCmp $R1 '3' lbl_err_nt
- StrCmp $R1 '4' lbl_add
- StrCpy $R1 $R0 3
- StrCmp $R1 '5.0' lbl_add ;2000
- StrCmp $R1 '5.1' lbl_xp ;XP
- StrCmp $R1 '5.2' lbl_done ;.NET server
-
-lbl_add:
- File ".\Gdiplus.dll"
-
-lbl_xp:
- File "..\gm_gdip_raster.dll"
-
-lbl_done:
-FunctionEnd
-
-
-;osmo4 install
-Section "Osmo4/GPAC Player" SecOsmo4
- SectionIn RO
- SetOutPath $INSTDIR
-
- File /oname=ReadMe.txt "${GPAC_ROOT}\README"
- File /oname=License.txt "${GPAC_ROOT}\COPYING"
- File /oname=Changelog.txt "${GPAC_ROOT}\Changelog"
- File "${GPAC_ROOT}\doc\configuration.html"
- File "${GPAC_ROOT}\doc\gpac.mp4"
-
- File "..\Osmo4.exe"
- File "..\..\..\..\doc\osmo4.ico"
- File "..\libgpac.dll"
- File "..\gm_dummy_in.dll"
- File "..\gm_dx_hw.dll"
- File "..\js32.dll"
- File "..\gm_gpac_js.dll"
- File "..\libeay32.dll"
- File "..\ssleay32.dll"
- File "..\gm_ismacryp.dll"
-
- ;create default cache
- SetOutPath $INSTDIR\cache
-
-
- ;copy GUI
- SetOutPath $INSTDIR\gui
- File "..\..\..\..\gui\gui.bt"
- File "..\..\..\..\gui\gui.js"
- File "..\..\..\..\gui\gwlib.js"
- File "..\..\..\..\gui\mpegu-core.js"
- SetOutPath $INSTDIR\gui\icons
- File /r /x .svn ..\..\..\..\gui\icons\*
- SetOutPath $INSTDIR\gui\extensions
- File /r /x .svn ..\..\..\..\gui\extensions\*
-
- SetOutPath $INSTDIR
-
- ${WriteRegStrAuth} HKCU "SOFTWARE\GPAC" "InstallDir" "$INSTDIR"
- ${WriteRegStrAuth} HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Osmo4" "DisplayName" "Osmo4/GPAC (remove only)"
- ${WriteRegStrAuth} HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Osmo4" "UninstallString" "$INSTDIR\uninstall.exe"
- WriteUninstaller "uninstall.exe"
-
-SectionEnd
-
-SubSection "GPAC Plugins" SecPlugins
-
-
-;
-; 2 install modes, normal one and full one
-
-Section "MPEG-4 BIFS Decoder" SecBIFS
- SectionIn 1
- File "..\gm_bifs_dec.dll"
-SectionEnd
-
-Section "MPEG-4 ODF Decoder" SecODF
- SectionIn 1
- File "..\gm_odf_dec.dll"
-SectionEnd
-
-Section "MPEG-4 LASeR Decoder" SecLASeR
- SectionIn 1
- File "..\gm_laser_dec.dll"
-SectionEnd
-
-Section "MPEG-4 SAF Demultiplexer" SecSAF
- SectionIn 1
- File "..\gm_saf_in.dll"
-SectionEnd
-
-Section "Textual MPEG-4 Loader" SecTextLoad
- SectionIn 1
- File "..\gm_ctx_load.dll"
-SectionEnd
-
-Section "Image Package (PNG, JPEG, BMP)" SecIMG
- SectionIn 1
- File "..\gm_img_in.dll"
-SectionEnd
-
-Section "AAC Audio" SecAAC
- SectionIn 1
- File "..\gm_aac_in.dll"
-SectionEnd
-
-Section "MP3 Audio" SecMP3
- SectionIn 1
- File "..\gm_mp3_in.dll"
-SectionEnd
-
-Section "AC3 Audio" SecAC3
- SectionIn 1
- File "..\gm_ac3_in.dll"
-SectionEnd
-
-Section "FFMPEG" SecFFMPEG
- SectionIn 1
- File "..\gm_ffmpeg_in.dll"
- File "..\avcodec-*.dll"
- File "..\avformat-*.dll"
- File "..\avutil-*.dll"
- File "..\swscale-*.dll"
-SectionEnd
-
-Section "XviD Video Decoder" SecXVID
- SectionIn 1
- File "..\gm_xvid_dec.dll"
-SectionEnd
-
-;Section "AMR NB & WB" SecAMRFT
-; SectionIn 1
-; File "..\gm_amr_float_dec.dll"
-;SectionEnd
-
-Section "Subtitles" SecSUBS
- SectionIn 1
- File "..\gm_timedtext.dll"
-SectionEnd
-
-Section "ISO File Format" SecISOFF
- SectionIn 1
- File "..\gm_isom_in.dll"
-SectionEnd
-
-Section "MPEG-2 TS" SecM2TS
- SectionIn 1
- File "..\gm_mpegts_in.dll"
-SectionEnd
-
-Section "RTP/RTSP" SecRTP
- SectionIn 1
- File "..\gm_rtp_in.dll"
-SectionEnd
-
-Section "SVG" SecSVG
- SectionIn 1
- File "..\gm_svg_in.dll"
-SectionEnd
-
-
-Section "GDI+" SecGDIP
- SectionIn 1
- call InsertGDIPLUS
-SectionEnd
-
-Section "GPAC 2D Raster" SecG2DS
- SectionIn 1
- File "..\gm_soft_raster.dll"
-SectionEnd
-
-Section "FreeType" SecFT
- SectionIn 1
- File "..\gm_ft_font.dll"
-SectionEnd
-
-Section "Windows MME Audio" SecWAVE
- SectionIn 1
- File "..\gm_wav_out.dll"
-SectionEnd
-
-Section "Xiph" SecXIPH
- SectionIn 1
- File "..\gm_ogg.dll"
-SectionEnd
-
-Section "OpenSVC Decoder" SecOSVC
- SectionIn 1
- File "..\OpenSVCdecoder.plg"
- File "..\gm_opensvc_dec.dll"
-SectionEnd
-
-Section "MPEG DASH Suppport" SecDASH
- SectionIn 1
- File "..\gm_mpd_in.dll"
-SectionEnd
-
-Section "UPnP Support" SecUPnP
- SectionIn 1
- File "..\gm_platinum.dll"
-SectionEnd
-
-Section "Widget Manager" SecMPEGU
- SectionIn 1
- File "..\gm_widgetman.dll"
-SectionEnd
-
-;Section "MobileIP Framework" SecMobIP
-; SectionIn 1
-; File "..\gm_mobile_ip.dll"
-; File "..\MobileSession.dll"
-;SectionEnd
-
-
-;Section "OFFIS Audio compressor" SecOffisComp
-; SectionIn 1
-; ;copy GUI
-; File "..\gm_offis_compressor.dll"
-; File "..\QtCore4.dll"
-; File "..\QtGui4.dll"
-; SetOutPath $INSTDIR\gui\extensions
-; File /r /x .svn ..\..\..\..\gui\extensions\offis*
-; SetOutPath $INSTDIR
-;SectionEnd
-
-SubSectionEnd
-
-
-Section "MP4Box" SecMP4B
- SectionIn 1
- SetOutPath $INSTDIR
- File "..\MP4Box.exe"
- File "..\MP42TS.exe"
-
- Push $INSTDIR
- Call AddToPath
-SectionEnd
-
-
-Section "GPAC SDK" SecSDK
- SectionIn 1
- SetOutPath $INSTDIR\sdk\include
- File /r /x CVS ..\..\..\..\include\*.h
- SetOutPath $INSTDIR\sdk\lib
- File ..\libgpac.lib
- File ..\..\..\..\extra_lib\lib\win32\release\js32.lib
-SectionEnd
-
-
-!define HK_MOZ "SOFTWARE\MozillaPlugins\@gpac/osmozilla,version=1.0"
-
-Section "Osmozilla" SecZILLA
- SectionIn 1
- SetOutPath $INSTDIR
- File "..\nposmozilla.dll"
- File "..\nposmozilla.xpt"
-
- ${WriteRegStrAuth} HKCU "SOFTWARE\MozillaPlugins\@gpac/osmozilla,version=1.0" "Path" "$INSTDIR\nposmozilla.dll"
- ${WriteRegStrAuth} HKCU "SOFTWARE\MozillaPlugins\@gpac/osmozilla,version=1.0" "XPTPath" "$INSTDIR\nposmozilla.xpt"
- ${WriteRegStrAuth} HKCU "SOFTWARE\MozillaPlugins\@gpac/osmozilla,version=1.0" "Version" "${GPAC_VERSION}"
- ${WriteRegStrAuth} HKCU "SOFTWARE\MozillaPlugins\@gpac/osmozilla,version=1.0" "Vendor" "GPAC"
- ${WriteRegStrAuth} HKCU "SOFTWARE\MozillaPlugins\@gpac/osmozilla,version=1.0" "Description" "GPAC plugin"
- ${WriteRegStrAuth} HKCU "SOFTWARE\MozillaPlugins\@gpac/osmozilla,version=1.0" "ProductName" "Osmozilla"
-SectionEnd
-
-
-Section "GPAX" SecGPAX
- SectionIn 1
- SetOutPath $INSTDIR
- File "..\GPAX.dll"
- RegDLL "$INSTDIR\GPAX.dll"
-SectionEnd
-
-
-Section "MP4Client" SecMP4C
- SectionIn 1
- SetOutPath $INSTDIR
- File "..\MP4Client.exe"
-SectionEnd
-
-
-
-Section "Windows Runtime Libraries" SecMSVCRT
- SectionIn 1
- File "..\Microsoft.VC90.CRT.manifest"
- File "..\Microsoft.VC90.MFC.manifest"
- File "..\msvcr90.dll"
- File "..\mfc90.dll"
-SectionEnd
-
-
-
-
-SubSection "Osmo4 Shortcuts"
-
-Section "Add Start Menu Shortcuts"
- SectionIn 1
- #has current user admin privileges?
- userInfo::getAccountType
- Pop $0
- StrCmp $0 "Admin" +1 +2
- SetShellVarContext all
- CreateDirectory "$SMPROGRAMS\Osmo4"
- CreateShortCut "$SMPROGRAMS\Osmo4\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
- CreateShortCut "$SMPROGRAMS\Osmo4\Osmo4 (Classic UI).lnk" "$INSTDIR\Osmo4.exe" ""
- CreateShortCut "$SMPROGRAMS\Osmo4\Osmo4 (New UI).lnk" "$INSTDIR\MP4Client.exe" "-gui"
- CreateShortCut "$SMPROGRAMS\Osmo4\Osmo4 (New UI With Console).lnk" "$INSTDIR\MP4Client.exe" ""
- CreateShortCut "$SMPROGRAMS\Osmo4\Readme.lnk" "$INSTDIR\ReadMe.txt"
- CreateShortCut "$SMPROGRAMS\Osmo4\License.lnk" "$INSTDIR\License.txt"
- CreateShortCut "$SMPROGRAMS\Osmo4\History.lnk" "$INSTDIR\changelog.txt"
- CreateShortCut "$SMPROGRAMS\Osmo4\Configuration Info.lnk" "$INSTDIR\configuration.html"
-SectionEnd
-
-Section "Add shortcut to QuickLaunch"
- SectionIn 1
- CreateShortCut "$QUICKLAUNCH\Osmo4.lnk" "$INSTDIR\Osmo4.exe" "" "$INSTDIR\Osmo4.exe" 0
-SectionEnd
-
-Section "Add shortcut to Desktop"
- SectionIn 1
- CreateShortCut "$DESKTOP\Osmo4.lnk" "$INSTDIR\Osmo4.exe" "" "$INSTDIR\Osmo4.exe" 0
-SectionEnd
-
-!define SHCNE_ASSOCCHANGED 0x08000000
-!define SHCNF_IDLIST 0
-
-Section "Make Osmo4 the default MPEG-4 Player"
- SectionIn 1
- ;write file association
- ${WriteRegStrAuth} HKCR GPAC\mp4\DefaultIcon "" "$INSTDIR\Osmo4.ico, 0"
- ${WriteRegStrAuth} HKCR GPAC\mp4\Shell\open\command "" "$INSTDIR\Osmo4.exe %L"
- ${WriteRegStrAuth} HKCR .mp4 "" "GPAC\mp4"
- !system 'shell32.dll::SHChangeNotify(i, i, i, i) v (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
-
-SectionEnd
-
-Section "Associate 3GPP files (3GP) with Osmo4"
- SectionIn 1
- ;write file association
- ${WriteRegStrAuth} HKCR GPAC\3gp\DefaultIcon "" "$INSTDIR\Osmo4.ico, 0"
- ${WriteRegStrAuth} HKCR GPAC\3gp\Shell\open\command "" "$INSTDIR\Osmo4.exe %L"
- ${WriteRegStrAuth} HKCR .3gp "" "GPAC\3gp"
- !system 'shell32.dll::SHChangeNotify(i, i, i, i) v (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
-SectionEnd
-
-Section "Associate 3GPP2 files (3G2) with Osmo4"
- SectionIn 1
- ;write file association
- ${WriteRegStrAuth} HKCR GPAC\3g2\DefaultIcon "" "$INSTDIR\Osmo4.ico, 0"
- ${WriteRegStrAuth} HKCR GPAC\3g2\Shell\open\command "" "$INSTDIR\Osmo4.exe %L"
- ${WriteRegStrAuth} HKCR .3g2 "" "GPAC\3g2"
- !system 'shell32.dll::SHChangeNotify(i, i, i, i) v (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
-SectionEnd
-
-SubSectionEnd
-
-
-
-!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
- !insertmacro MUI_DESCRIPTION_TEXT ${SecOsmo4} "Osmo4 player"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecPlugins} "GPAC Plugins"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecBIFS} "MPEG-4 BIFS Scene Decoder"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecODF} "MPEG-4 Object Descriptor Decoder"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecLASeR} "MPEG-4 LASeR Scene Decoder"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecTextLoad} "Support for uncompressed MPEG-4 (BT and XMT), VRML and X3D textual formats"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecSAF} "MPEG-4 SAF Demultiplexer"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecIMG} "Support for PNG, JPEG, BMP and JPEG2000 images"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecAAC} "Support for MPEG-4 Audio HE-AAC decoder and web radios"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecMP3} "Support for MPEG-1/2 Audio (inc. MP3) decoder and web radios"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecAC3} "Support for Dolby AC3 decoder and web radios"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecFFMPEG} "Support for FFMPEG libraries for various format decoding and demultiplexing"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecXVID} "Support for XVID library for MPEG-4 Video Part 2 decoding"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecAMRFT} "Support for AMR and AMR WideBand decoder and web radios"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecSUBS} "Subtitle support include SRT, SUB, 3GPP and MPEG-4 Text formats"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecISOFF} "Support for ISO-based file formats (3GP, MP4, MJ2K)"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecM2TS} "Support for MPEG-2 Transport Stream"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecRTP} "Support for RTP and RTSP IP streaming"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecSVG} "Support for SVG including progressive loading"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecGDIP} "GDIPlus-based rasterizer"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecG2DS} "GPAC software rasterizer"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecFT} "FreeType font parsing"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecWAVE} "Windows MME Audio output support"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecXIPH} "Support for XIPP OGG, Vorbis and Theora media"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecOSVC} "Support for SVC decoding through OpenSVC Decoder"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecDASH} "HTTP Streaming using MPEG DASH"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecUPnP} "Support for UPnP based on Platinum"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecMPEGU} "Support for W3C and MPEG-U Widgets"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecMobIP} "UNIGE Mobile IP Framework"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecOffisComp} "OFFIS Audio Compressor"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecMP4B} "MP4Box command-line tool for various multimedia operations"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecSDK} "GPAC SDK: headers and library files needed to develop modules for GPAC or appllication based on GPAC"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecZILLA} "GPAC playback support NPAPI-based browsers (FireFox/Gecko, Safari/WebKit)"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecGPAX} "GPAC playback support using ActiveX component (Internet Explorer)"
- !insertmacro MUI_DESCRIPTION_TEXT ${SecMP4C} "GPAC command-line player and AVI dumper"
-
-!insertmacro MUI_FUNCTION_DESCRIPTION_END
-
-
-Function .onInstSuccess
-; MessageBox MB_YESNO "GPAC Framework installation complete. Do you want to launch the Osmo4 player?" IDNO NoLaunch
-; Exec $INSTDIR\Osmo4.exe
-; NoLaunch:
-FunctionEnd
-
-
-
-
-
-; uninstall stuff
-
-UninstallText "This will uninstall OSMO4/GPAC from your computer. Hit next to continue."
-
-; special uninstall section.
-Section "Uninstall"
- ; remove registry keys
- ${DeleteRegKeyAuth} HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Osmo4"
- ${DeleteRegKeyAuth} HKCU "SOFTWARE\GPAC"
- ${DeleteRegKeyAuth} HKCU "SOFTWARE\MozillaPlugins\@gpac/osmozilla,version=1.0"
- ${DeleteRegKeyAuth} HKCR GPAC\mp4\DefaultIcon
- ${DeleteRegKeyAuth} HKCR GPAC\mp4\shell\open\command
- ${DeleteRegKeyAuth} HKCR GPAC\mp4
- ${DeleteRegKeyAuth} HKCR .mp4
- ${DeleteRegKeyAuth} HKCR GPAC\3gp\DefaultIcon
- ${DeleteRegKeyAuth} HKCR GPAC\3gp\shell\open\command
- ${DeleteRegKeyAuth} HKCR GPAC\3gp
- ${DeleteRegKeyAuth} HKCR .3gp
- ${DeleteRegKeyAuth} HKCR GPAC\3g2\DefaultIcon
- ${DeleteRegKeyAuth} HKCR GPAC\3g2\shell\open\command
- ${DeleteRegKeyAuth} HKCR GPAC\3g2
- ${DeleteRegKeyAuth} HKCR .3g2
- ${DeleteRegKeyAuth} HKCR GPAC
-
- UnRegDLL "$INSTDIR\GPAX.dll"
- RMDir /r $INSTDIR
- Push $INSTDIR
- Call un.RemoveFromPath
- #has current user admin privileges?
- userInfo::getAccountType
- Pop $0
- StrCmp $0 "Admin" +1 +2
- SetShellVarContext all
- Delete "$SMPROGRAMS\Osmo4\*.*"
- RMDir "$SMPROGRAMS\Osmo4"
- Delete "$QUICKLAUNCH\Osmo4.lnk"
- Delete "$DESKTOP\Osmo4.lnk"
-
-SectionEnd
-
-;path modif functions
-!verbose 3
-!include "WinMessages.NSH"
-!verbose 4
+;--------------------------------\r
+;General\r
+!define GPAC_VERSION 0.5.0\r
+!include default.out\r
+\r
+!define GPAC_ROOT ..\..\..\..\r
+\r
+InstallDir "$PROGRAMFILES\GPAC"\r
+InstallDirRegKey HKCU "SOFTWARE\GPAC" "InstallDir"\r
+\r
+RequestExecutionLevel user\r
+\r
+\r
+;--------------------------------\r
+;Include Modern UI\r
+\r
+ !include "MUI2.nsh"\r
+\r
+WindowIcon on\r
+Icon "..\..\..\..\doc\osmo4.ico"\r
+UninstallIcon "..\..\..\..\doc\osmo4.ico"\r
+\r
+\r
+;--------------------------------\r
+;Interface Settings\r
+\r
+ !define MUI_ABORTWARNING\r
+\r
+Var DIALOG\r
+Var Label\r
+Var Confirm\r
+\r
+LangString PAGE_TITLE ${LANG_ENGLISH} "Title"\r
+LangString PAGE_SUBTITLE ${LANG_ENGLISH} "Subtitle"\r
+\r
+Function EnableNext\r
+ Pop $R1\r
+ ${NSD_GetState} $Confirm $R1\r
+ GetDlgItem $0 $HWNDPARENT 1\r
+ ${If} $R1 == ${BST_CHECKED}\r
+ EnableWindow $0 1\r
+ ${Else} \r
+ EnableWindow $0 0\r
+ ${Endif} \r
+FunctionEnd\r
+\r
+Function customPage\r
+ !insertmacro MUI_HEADER_TEXT "Patents and Royalties" "Please read carefully the following clause."\r
+ GetDlgItem $0 $HWNDPARENT 1\r
+ EnableWindow $0 0\r
+ nsDialogs::Create 1018\r
+ Pop $DIALOG\r
+\r
+ ${NSD_CreateLabel} 0 0 100% 120u "Multimedia technologies are often covered by various patents which are most of the time hard to identify. These patents may or may not apply in your local jurisdiction. By installing this software, you acknowledge that you may have to pay royaltee fees in order to legally use this software. Do not proceed with this setup if you do not understand or do not agree with these terms. In any case, the authors and/or distributors bears no liability for any infringing usage of this software, which is provided for educational or research purposes."\r
+ Pop $Label\r
+\r
+ ${NSD_CreateCheckBox} 0 -30 100% 12u "I understand and accept the conditions"\r
+ Pop $Confirm\r
+ GetFunctionAddress $0 EnableNext\r
+ nsDialogs::OnClick $Confirm $0\r
+ \r
+ \r
+ nsDialogs::Show\r
+FunctionEnd\r
+\r
+;--------------------------------\r
+;Pages\r
+\r
+ !insertmacro MUI_PAGE_WELCOME\r
+ !insertmacro MUI_PAGE_LICENSE "${GPAC_ROOT}\COPYING" \r
+ Page custom customPage\r
+ !insertmacro MUI_PAGE_COMPONENTS\r
+ !insertmacro MUI_PAGE_DIRECTORY\r
+ \r
+ !insertmacro MUI_PAGE_INSTFILES\r
+ !insertmacro MUI_PAGE_FINISH\r
+ \r
+ !insertmacro MUI_UNPAGE_CONFIRM\r
+ !insertmacro MUI_UNPAGE_INSTFILES\r
+\r
+ !insertmacro MUI_LANGUAGE "English"\r
+\r
+ComponentText "This will install the GPAC Framework on your computer. Select which optional things you want installed."\r
+DirText "This will install the GPAC Framework on your computer. Choose a directory"\r
+\r
+\r
+Function FctWriteRegStrAuth\r
+ ;local var\r
+ Push $0\r
+ Push $R0\r
+ Push $R1\r
+ Push $R2\r
+ Push $R3\r
+ ;pop function arguments\r
+ Exch 5\r
+ Pop $R3\r
+ Exch 5\r
+ Pop $R2\r
+ Exch 5\r
+ Pop $R1\r
+ Exch 5\r
+ Pop $R0\r
+\r
+ ;test if calling HKCR\r
+ StrCmp $R0 "HKCR" +1 +3\r
+ WriteRegStr HKCR $R1 $R2 $R3\r
+ goto lbl_end\r
+ \r
+ #has current user admin privileges?\r
+ userInfo::getAccountType\r
+ Pop $0\r
+ StrCmp $0 "Admin" lbl_admin lbl_not_admin\r
+\r
+ lbl_admin:\r
+ WriteRegStr HKLM $R1 $R2 $R3\r
+ goto lbl_end\r
+\r
+ lbl_not_admin:\r
+ WriteRegStr HKCU $R1 $R2 $R3\r
+\r
+ lbl_end:\r
+ Pop $R3\r
+ Pop $R2\r
+ Pop $R1\r
+ Pop $R0\r
+ Pop $0\r
+FunctionEnd\r
+\r
+!macro WriteRegStrAuth HKREG SUBREG ENTRY VALUESTR\r
+ Push "${HKREG}"\r
+ Push "${SUBREG}"\r
+ Push "${ENTRY}"\r
+ Push "${VALUESTR}"\r
+ Call FctWriteRegStrAuth\r
+!macroend\r
+ \r
+!define WriteRegStrAuth "!insertmacro WriteRegStrAuth"\r
+\r
+\r
+Function un.FctDeleteRegKeyAuth\r
+ ;local var\r
+ Push $0\r
+ Push $R0\r
+ Push $R1\r
+ ;pop function arguments\r
+ Exch 3\r
+ Pop $R1\r
+ Exch 3\r
+ Pop $R0\r
+\r
+ ;test if calling HKCR\r
+ StrCmp $R0 "HKCR" +1 +3\r
+ DeleteRegKey HKCR $R1\r
+ goto lbl_end\r
+ \r
+ #has current user admin privileges?\r
+ userInfo::getAccountType\r
+ Pop $0\r
+ StrCmp $0 "Admin" lbl_admin lbl_not_admin\r
+ \r
+ lbl_admin:\r
+ DeleteRegKey HKLM $R1\r
+ goto lbl_end\r
+ \r
+ lbl_not_admin:\r
+ DeleteRegKey HKCU $R1\r
+\r
+ lbl_end:\r
+ Pop $0\r
+ Pop $R1\r
+ Pop $R0\r
+FunctionEnd\r
+\r
+!macro DeleteRegKeyAuth HKREG SUBREG\r
+ Push "${HKREG}"\r
+ Push "${SUBREG}"\r
+ Call un.FctDeleteRegKeyAuth\r
+!macroend\r
+ \r
+!define DeleteRegKeyAuth "!insertmacro DeleteRegKeyAuth"\r
+\r
+\r
+Function InsertGDIPLUS\r
+ Push $R0\r
+ Push $R1\r
+ ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion\r
+ StrCmp $R0 "" 0 lbl_winnt\r
+\r
+ ;NOT NT\r
+ ReadRegStr $R0 HKLM SOFTWARE\Microsoft\Windows\CurrentVersion VersionNumber\r
+\r
+ StrCpy $R1 $R0 1\r
+ ; win95, NOT SUPPORTED\r
+ StrCmp $R1 '4' 0 lbl_err_95\r
+ StrCpy $R1 $R0 3\r
+ StrCmp $R1 '4.0' lbl_err_95\r
+ ;winME or 98 otherwise\r
+ StrCmp $R1 '4.9' lbl_add lbl_add\r
+\r
+lbl_err_nt:\r
+ MessageBox MB_OK "Microsoft GDI+ cannot be installed on NT 3 Systems"\r
+ Goto lbl_done\r
+\r
+lbl_err_95:\r
+ MessageBox MB_OK "Microsoft GDI+ cannot be installed on Windows 95 and older Systems"\r
+ Goto lbl_done\r
+\r
+lbl_winnt:\r
+ StrCpy $R1 $R0 1\r
+ StrCmp $R1 '3' lbl_err_nt\r
+ StrCmp $R1 '4' lbl_add\r
+ StrCpy $R1 $R0 3\r
+ StrCmp $R1 '5.0' lbl_add ;2000\r
+ StrCmp $R1 '5.1' lbl_xp ;XP\r
+ StrCmp $R1 '5.2' lbl_done ;.NET server\r
+\r
+lbl_add:\r
+ File ".\Gdiplus.dll"\r
+\r
+lbl_xp:\r
+ File "..\gm_gdip_raster.dll"\r
+\r
+lbl_done:\r
+FunctionEnd\r
+\r
+\r
+;osmo4 install\r
+Section "Osmo4/GPAC Player" SecOsmo4\r
+ SectionIn RO\r
+ SetOutPath $INSTDIR\r
+\r
+ File /oname=ReadMe.txt "${GPAC_ROOT}\README"\r
+ File /oname=License.txt "${GPAC_ROOT}\COPYING"\r
+ File /oname=Changelog.txt "${GPAC_ROOT}\Changelog"\r
+ File "${GPAC_ROOT}\doc\configuration.html"\r
+ File "${GPAC_ROOT}\doc\gpac.mp4"\r
+\r
+ File "..\Osmo4.exe"\r
+ File "..\..\..\..\doc\osmo4.ico"\r
+ File "..\libgpac.dll"\r
+ File "..\gm_dummy_in.dll"\r
+ File "..\gm_dx_hw.dll"\r
+ File "..\js32.dll"\r
+ File "..\gm_gpac_js.dll"\r
+ File "..\libeay32.dll"\r
+ File "..\ssleay32.dll"\r
+ File "..\gm_ismacryp.dll"\r
+\r
+ ;create default cache\r
+ SetOutPath $INSTDIR\cache\r
+\r
+\r
+ ;copy GUI\r
+ SetOutPath $INSTDIR\gui\r
+ File "..\..\..\..\gui\gui.bt"\r
+ File "..\..\..\..\gui\gui.js"\r
+ File "..\..\..\..\gui\gwlib.js"\r
+ File "..\..\..\..\gui\mpegu-core.js"\r
+ SetOutPath $INSTDIR\gui\icons\r
+ File /r /x .svn ..\..\..\..\gui\icons\*\r
+ SetOutPath $INSTDIR\gui\extensions\r
+ File /r /x .svn ..\..\..\..\gui\extensions\*\r
+\r
+ SetOutPath $INSTDIR\r
+ \r
+ ${WriteRegStrAuth} HKCU "SOFTWARE\GPAC" "InstallDir" "$INSTDIR"\r
+ ${WriteRegStrAuth} HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Osmo4" "DisplayName" "Osmo4/GPAC (remove only)"\r
+ ${WriteRegStrAuth} HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Osmo4" "UninstallString" "$INSTDIR\uninstall.exe"\r
+ WriteUninstaller "uninstall.exe"\r
+\r
+SectionEnd\r
+\r
+SubSection "GPAC Plugins" SecPlugins\r
+\r
+\r
+;\r
+; 2 install modes, normal one and full one\r
+\r
+Section "MPEG-4 BIFS Decoder" SecBIFS\r
+ SectionIn 1\r
+ File "..\gm_bifs_dec.dll"\r
+SectionEnd\r
+\r
+Section "MPEG-4 ODF Decoder" SecODF\r
+ SectionIn 1\r
+ File "..\gm_odf_dec.dll"\r
+SectionEnd\r
+\r
+Section "MPEG-4 LASeR Decoder" SecLASeR\r
+ SectionIn 1\r
+ File "..\gm_laser_dec.dll"\r
+SectionEnd\r
+\r
+Section "MPEG-4 SAF Demultiplexer" SecSAF\r
+ SectionIn 1\r
+ File "..\gm_saf_in.dll"\r
+SectionEnd\r
+\r
+Section "Textual MPEG-4 Loader" SecTextLoad\r
+ SectionIn 1\r
+ File "..\gm_ctx_load.dll"\r
+SectionEnd\r
+\r
+Section "Image Package (PNG, JPEG, BMP)" SecIMG\r
+ SectionIn 1\r
+ File "..\gm_img_in.dll"\r
+SectionEnd\r
+\r
+Section "AAC Audio" SecAAC\r
+ SectionIn 1\r
+ File "..\gm_aac_in.dll"\r
+SectionEnd\r
+\r
+Section "MP3 Audio" SecMP3\r
+ SectionIn 1\r
+ File "..\gm_mp3_in.dll"\r
+SectionEnd\r
+\r
+Section "AC3 Audio" SecAC3\r
+ SectionIn 1\r
+ File "..\gm_ac3_in.dll"\r
+SectionEnd\r
+\r
+Section "FFMPEG" SecFFMPEG\r
+ SectionIn 1\r
+ File "..\gm_ffmpeg_in.dll"\r
+ File "..\avcodec-*.dll"\r
+ File "..\avformat-*.dll"\r
+ File "..\avutil-*.dll"\r
+ File "..\swscale-*.dll"\r
+SectionEnd\r
+\r
+Section "XviD Video Decoder" SecXVID\r
+ SectionIn 1\r
+ File "..\gm_xvid_dec.dll"\r
+SectionEnd\r
+\r
+;Section "AMR NB & WB" SecAMRFT\r
+; SectionIn 1\r
+; File "..\gm_amr_float_dec.dll"\r
+;SectionEnd\r
+\r
+Section "Subtitles" SecSUBS\r
+ SectionIn 1\r
+ File "..\gm_timedtext.dll"\r
+SectionEnd\r
+\r
+Section "ISO File Format" SecISOFF\r
+ SectionIn 1\r
+ File "..\gm_isom_in.dll"\r
+SectionEnd\r
+\r
+Section "MPEG-2 TS" SecM2TS\r
+ SectionIn 1\r
+ File "..\gm_mpegts_in.dll"\r
+SectionEnd\r
+\r
+Section "RTP/RTSP" SecRTP\r
+ SectionIn 1\r
+ File "..\gm_rtp_in.dll"\r
+SectionEnd\r
+\r
+Section "SVG" SecSVG\r
+ SectionIn 1\r
+ File "..\gm_svg_in.dll"\r
+SectionEnd\r
+\r
+\r
+Section "GDI+" SecGDIP\r
+ SectionIn 1\r
+ call InsertGDIPLUS\r
+SectionEnd\r
+\r
+Section "GPAC 2D Raster" SecG2DS\r
+ SectionIn 1\r
+ File "..\gm_soft_raster.dll"\r
+SectionEnd\r
+\r
+Section "FreeType" SecFT\r
+ SectionIn 1\r
+ File "..\gm_ft_font.dll"\r
+SectionEnd\r
+\r
+Section "Windows MME Audio" SecWAVE\r
+ SectionIn 1\r
+ File "..\gm_wav_out.dll"\r
+SectionEnd\r
+\r
+Section "Xiph" SecXIPH\r
+ SectionIn 1\r
+ File "..\gm_ogg.dll"\r
+SectionEnd\r
+\r
+Section "OpenSVC Decoder" SecOSVC\r
+ SectionIn 1\r
+ File "..\OpenSVCdecoder.plg"\r
+ File "..\gm_opensvc_dec.dll"\r
+SectionEnd\r
+\r
+Section "MPEG DASH Suppport" SecDASH\r
+ SectionIn 1\r
+ File "..\gm_mpd_in.dll"\r
+SectionEnd\r
+\r
+Section "UPnP Support" SecUPnP\r
+ SectionIn 1\r
+ File "..\gm_platinum.dll"\r
+SectionEnd\r
+\r
+Section "Widget Manager" SecMPEGU\r
+ SectionIn 1\r
+ File "..\gm_widgetman.dll"\r
+SectionEnd\r
+\r
+;Section "MobileIP Framework" SecMobIP\r
+; SectionIn 1\r
+; File "..\gm_mobile_ip.dll"\r
+; File "..\MobileSession.dll"\r
+;SectionEnd\r
+\r
+\r
+;Section "OFFIS Audio compressor" SecOffisComp\r
+; SectionIn 1\r
+; ;copy GUI\r
+; File "..\gm_offis_compressor.dll"\r
+; File "..\QtCore4.dll"\r
+; File "..\QtGui4.dll"\r
+; SetOutPath $INSTDIR\gui\extensions\r
+; File /r /x .svn ..\..\..\..\gui\extensions\offis*\r
+; SetOutPath $INSTDIR\r
+;SectionEnd\r
+\r
+SubSectionEnd\r
+\r
+\r
+Section "MP4Box" SecMP4B\r
+ SectionIn 1\r
+ SetOutPath $INSTDIR\r
+ File "..\MP4Box.exe"\r
+ File "..\MP42TS.exe"\r
+\r
+ Push $INSTDIR\r
+ Call AddToPath\r
+SectionEnd\r
+\r
+\r
+Section "GPAC SDK" SecSDK\r
+ SectionIn 1\r
+ SetOutPath $INSTDIR\sdk\include\r
+ File /r /x CVS ..\..\..\..\include\*.h\r
+ SetOutPath $INSTDIR\sdk\lib\r
+ File ..\libgpac.lib\r
+ File ..\..\..\..\extra_lib\lib\win32\release\js32.lib\r
+SectionEnd\r
+\r
+\r
+!define HK_MOZ "SOFTWARE\MozillaPlugins\@gpac/osmozilla,version=1.0"\r
+\r
+Section "Osmozilla" SecZILLA\r
+ SectionIn 1\r
+ SetOutPath $INSTDIR\r
+ File "..\nposmozilla.dll"\r
+ File "..\nposmozilla.xpt"\r
+\r
+ ${WriteRegStrAuth} HKCU "SOFTWARE\MozillaPlugins\@gpac/osmozilla,version=1.0" "Path" "$INSTDIR\nposmozilla.dll"\r
+ ${WriteRegStrAuth} HKCU "SOFTWARE\MozillaPlugins\@gpac/osmozilla,version=1.0" "XPTPath" "$INSTDIR\nposmozilla.xpt"\r
+ ${WriteRegStrAuth} HKCU "SOFTWARE\MozillaPlugins\@gpac/osmozilla,version=1.0" "Version" "${GPAC_VERSION}"\r
+ ${WriteRegStrAuth} HKCU "SOFTWARE\MozillaPlugins\@gpac/osmozilla,version=1.0" "Vendor" "GPAC"\r
+ ${WriteRegStrAuth} HKCU "SOFTWARE\MozillaPlugins\@gpac/osmozilla,version=1.0" "Description" "GPAC plugin"\r
+ ${WriteRegStrAuth} HKCU "SOFTWARE\MozillaPlugins\@gpac/osmozilla,version=1.0" "ProductName" "Osmozilla"\r
+SectionEnd\r
+\r
+\r
+Section "GPAX" SecGPAX\r
+ SectionIn 1\r
+ SetOutPath $INSTDIR\r
+ File "..\GPAX.dll"\r
+ RegDLL "$INSTDIR\GPAX.dll"\r
+SectionEnd\r
+\r
+\r
+Section "MP4Client" SecMP4C\r
+ SectionIn 1\r
+ SetOutPath $INSTDIR\r
+ File "..\MP4Client.exe"\r
+SectionEnd \r
+ \r
+ \r
+ \r
+Section "Windows Runtime Libraries" SecMSVCRT\r
+ SectionIn 1\r
+ File "..\Microsoft.VC90.CRT.manifest"\r
+ File "..\Microsoft.VC90.MFC.manifest" \r
+ File "..\msvcr90.dll"\r
+ File "..\mfc90.dll"\r
+SectionEnd\r
+\r
+\r
+\r
+\r
+SubSection "Osmo4 Shortcuts"\r
+\r
+Section "Add Start Menu Shortcuts"\r
+ SectionIn 1\r
+ #has current user admin privileges?\r
+ userInfo::getAccountType\r
+ Pop $0\r
+ StrCmp $0 "Admin" +1 +2\r
+ SetShellVarContext all\r
+ CreateDirectory "$SMPROGRAMS\Osmo4"\r
+ CreateShortCut "$SMPROGRAMS\Osmo4\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0\r
+ CreateShortCut "$SMPROGRAMS\Osmo4\Osmo4 (Classic UI).lnk" "$INSTDIR\Osmo4.exe" ""\r
+ CreateShortCut "$SMPROGRAMS\Osmo4\Osmo4 (New UI).lnk" "$INSTDIR\MP4Client.exe" "-gui" \r
+ CreateShortCut "$SMPROGRAMS\Osmo4\Osmo4 (New UI With Console).lnk" "$INSTDIR\MP4Client.exe" ""\r
+ CreateShortCut "$SMPROGRAMS\Osmo4\Readme.lnk" "$INSTDIR\ReadMe.txt"\r
+ CreateShortCut "$SMPROGRAMS\Osmo4\License.lnk" "$INSTDIR\License.txt"\r
+ CreateShortCut "$SMPROGRAMS\Osmo4\History.lnk" "$INSTDIR\changelog.txt"\r
+ CreateShortCut "$SMPROGRAMS\Osmo4\Configuration Info.lnk" "$INSTDIR\configuration.html"\r
+SectionEnd\r
+\r
+Section "Add shortcut to QuickLaunch"\r
+ SectionIn 1\r
+ CreateShortCut "$QUICKLAUNCH\Osmo4.lnk" "$INSTDIR\Osmo4.exe" "" "$INSTDIR\Osmo4.exe" 0\r
+SectionEnd\r
+\r
+Section "Add shortcut to Desktop"\r
+ SectionIn 1\r
+ CreateShortCut "$DESKTOP\Osmo4.lnk" "$INSTDIR\Osmo4.exe" "" "$INSTDIR\Osmo4.exe" 0\r
+SectionEnd\r
+\r
+!define SHCNE_ASSOCCHANGED 0x08000000\r
+!define SHCNF_IDLIST 0\r
+\r
+Section "Make Osmo4 the default MPEG-4 Player"\r
+ SectionIn 1\r
+ ;write file association\r
+ ${WriteRegStrAuth} HKCR GPAC\mp4\DefaultIcon "" "$INSTDIR\Osmo4.ico, 0"\r
+ ${WriteRegStrAuth} HKCR GPAC\mp4\Shell\open\command "" "$INSTDIR\Osmo4.exe %L"\r
+ ${WriteRegStrAuth} HKCR .mp4 "" "GPAC\mp4"\r
+ !system 'shell32.dll::SHChangeNotify(i, i, i, i) v (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'\r
+\r
+SectionEnd\r
+\r
+Section "Associate 3GPP files (3GP) with Osmo4"\r
+ SectionIn 1\r
+ ;write file association\r
+ ${WriteRegStrAuth} HKCR GPAC\3gp\DefaultIcon "" "$INSTDIR\Osmo4.ico, 0"\r
+ ${WriteRegStrAuth} HKCR GPAC\3gp\Shell\open\command "" "$INSTDIR\Osmo4.exe %L"\r
+ ${WriteRegStrAuth} HKCR .3gp "" "GPAC\3gp"\r
+ !system 'shell32.dll::SHChangeNotify(i, i, i, i) v (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'\r
+SectionEnd\r
+\r
+Section "Associate 3GPP2 files (3G2) with Osmo4"\r
+ SectionIn 1\r
+ ;write file association\r
+ ${WriteRegStrAuth} HKCR GPAC\3g2\DefaultIcon "" "$INSTDIR\Osmo4.ico, 0"\r
+ ${WriteRegStrAuth} HKCR GPAC\3g2\Shell\open\command "" "$INSTDIR\Osmo4.exe %L"\r
+ ${WriteRegStrAuth} HKCR .3g2 "" "GPAC\3g2"\r
+ !system 'shell32.dll::SHChangeNotify(i, i, i, i) v (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'\r
+SectionEnd\r
+\r
+SubSectionEnd\r
+\r
+\r
+\r
+!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecOsmo4} "Osmo4 player"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecPlugins} "GPAC Plugins"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecBIFS} "MPEG-4 BIFS Scene Decoder"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecODF} "MPEG-4 Object Descriptor Decoder"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecLASeR} "MPEG-4 LASeR Scene Decoder"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecTextLoad} "Support for uncompressed MPEG-4 (BT and XMT), VRML and X3D textual formats"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecSAF} "MPEG-4 SAF Demultiplexer"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecIMG} "Support for PNG, JPEG, BMP and JPEG2000 images"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecAAC} "Support for MPEG-4 Audio HE-AAC decoder and web radios"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecMP3} "Support for MPEG-1/2 Audio (inc. MP3) decoder and web radios"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecAC3} "Support for Dolby AC3 decoder and web radios"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecFFMPEG} "Support for FFMPEG libraries for various format decoding and demultiplexing"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecXVID} "Support for XVID library for MPEG-4 Video Part 2 decoding"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecAMRFT} "Support for AMR and AMR WideBand decoder and web radios"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecSUBS} "Subtitle support include SRT, SUB, 3GPP and MPEG-4 Text formats"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecISOFF} "Support for ISO-based file formats (3GP, MP4, MJ2K)"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecM2TS} "Support for MPEG-2 Transport Stream"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecRTP} "Support for RTP and RTSP IP streaming"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecSVG} "Support for SVG including progressive loading"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecGDIP} "GDIPlus-based rasterizer"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecG2DS} "GPAC software rasterizer"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecFT} "FreeType font parsing"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecWAVE} "Windows MME Audio output support"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecXIPH} "Support for XIPP OGG, Vorbis and Theora media"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecOSVC} "Support for SVC decoding through OpenSVC Decoder"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecDASH} "HTTP Streaming using MPEG DASH"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecUPnP} "Support for UPnP based on Platinum"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecMPEGU} "Support for W3C and MPEG-U Widgets"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecMobIP} "UNIGE Mobile IP Framework"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecOffisComp} "OFFIS Audio Compressor"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecMP4B} "MP4Box command-line tool for various multimedia operations"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecSDK} "GPAC SDK: headers and library files needed to develop modules for GPAC or appllication based on GPAC"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecZILLA} "GPAC playback support NPAPI-based browsers (FireFox/Gecko, Safari/WebKit)"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecGPAX} "GPAC playback support using ActiveX component (Internet Explorer)"\r
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecMP4C} "GPAC command-line player and AVI dumper"\r
+ \r
+!insertmacro MUI_FUNCTION_DESCRIPTION_END\r
+\r
+\r
+Function .onInstSuccess\r
+; MessageBox MB_YESNO "GPAC Framework installation complete. Do you want to launch the Osmo4 player?" IDNO NoLaunch\r
+; Exec $INSTDIR\Osmo4.exe\r
+; NoLaunch:\r
+FunctionEnd\r
+\r
+\r
+\r
+\r
+\r
+; uninstall stuff\r
+\r
+UninstallText "This will uninstall OSMO4/GPAC from your computer. Hit next to continue."\r
+\r
+; special uninstall section.\r
+Section "Uninstall"\r
+ ; remove registry keys\r
+ ${DeleteRegKeyAuth} HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Osmo4"\r
+ ${DeleteRegKeyAuth} HKCU "SOFTWARE\GPAC"\r
+ ${DeleteRegKeyAuth} HKCU "SOFTWARE\MozillaPlugins\@gpac/osmozilla,version=1.0"\r
+ ${DeleteRegKeyAuth} HKCR GPAC\mp4\DefaultIcon\r
+ ${DeleteRegKeyAuth} HKCR GPAC\mp4\shell\open\command\r
+ ${DeleteRegKeyAuth} HKCR GPAC\mp4\r
+ ${DeleteRegKeyAuth} HKCR .mp4\r
+ ${DeleteRegKeyAuth} HKCR GPAC\3gp\DefaultIcon\r
+ ${DeleteRegKeyAuth} HKCR GPAC\3gp\shell\open\command\r
+ ${DeleteRegKeyAuth} HKCR GPAC\3gp\r
+ ${DeleteRegKeyAuth} HKCR .3gp\r
+ ${DeleteRegKeyAuth} HKCR GPAC\3g2\DefaultIcon\r
+ ${DeleteRegKeyAuth} HKCR GPAC\3g2\shell\open\command\r
+ ${DeleteRegKeyAuth} HKCR GPAC\3g2\r
+ ${DeleteRegKeyAuth} HKCR .3g2\r
+ ${DeleteRegKeyAuth} HKCR GPAC\r
+\r
+ UnRegDLL "$INSTDIR\GPAX.dll"\r
+ RMDir /r $INSTDIR\r
+ Push $INSTDIR\r
+ Call un.RemoveFromPath\r
+ #has current user admin privileges?\r
+ userInfo::getAccountType\r
+ Pop $0\r
+ StrCmp $0 "Admin" +1 +2\r
+ SetShellVarContext all\r
+ Delete "$SMPROGRAMS\Osmo4\*.*"\r
+ RMDir "$SMPROGRAMS\Osmo4"\r
+ Delete "$QUICKLAUNCH\Osmo4.lnk"\r
+ Delete "$DESKTOP\Osmo4.lnk"\r
+\r
+SectionEnd\r
+\r
+;path modif functions\r
+!verbose 3\r
+!include "WinMessages.NSH"\r
+!verbose 4\r
\r
!ifndef WriteEnvStr_RegKey\r
!ifdef ALL_USERS\r
!else\r
!define WriteEnvStr_RegKey 'HKCU "Environment"'\r
!endif\r
-!endif
-
-; AddToPath - Adds the given dir to the search path.
-; Input - head of the stack
-; Note - Win9x systems requires reboot
-
+!endif\r
+\r
+; AddToPath - Adds the given dir to the search path.\r
+; Input - head of the stack\r
+; Note - Win9x systems requires reboot\r
+\r
Function AddToPath\r
Exch $0\r
Push $1\r
Pop $2\r
Pop $1\r
Pop $0\r
-FunctionEnd
-
-; RemoveFromPath - Remove a given dir from the path
-; Input: head of the stack
-
+FunctionEnd\r
+\r
+; RemoveFromPath - Remove a given dir from the path\r
+; Input: head of the stack\r
+\r
Function un.RemoveFromPath\r
Exch $0\r
Push $1\r
Pop $2\r
Pop $1\r
Pop $0\r
-FunctionEnd
-
-###########################################
-# Utility Functions #
-###########################################
-
-; IsNT
-; no input
-; output, top of the stack = 1 if NT or 0 if not
-;
-; Usage:
-; Call IsNT
-; Pop $R0
-; ($R0 at this point is 1 or 0)
-
+FunctionEnd\r
+\r
+###########################################\r
+# Utility Functions #\r
+###########################################\r
+\r
+; IsNT\r
+; no input\r
+; output, top of the stack = 1 if NT or 0 if not\r
+;\r
+; Usage:\r
+; Call IsNT\r
+; Pop $R0\r
+; ($R0 at this point is 1 or 0)\r
+\r
!macro IsNT un\r
Function ${un}IsNT\r
Push $0\r
; NT!!!\r
Pop $0\r
Push 1\r
-FunctionEnd
-!macroend
-!insertmacro IsNT ""
-!insertmacro IsNT "un."
-
-; StrStr
-; input, top of stack = string to search for
-; top of stack-1 = string to search in
-; output, top of stack (replaces with the portion of the string remaining)
-; modifies no other variables.
-;
-; Usage:
-; Push "this is a long ass string"
-; Push "ass"
-; Call StrStr
-; Pop $R0
-; ($R0 at this point is "ass string")
-
+FunctionEnd\r
+!macroend\r
+!insertmacro IsNT ""\r
+!insertmacro IsNT "un."\r
+\r
+; StrStr\r
+; input, top of stack = string to search for\r
+; top of stack-1 = string to search in\r
+; output, top of stack (replaces with the portion of the string remaining)\r
+; modifies no other variables.\r
+;\r
+; Usage:\r
+; Push "this is a long ass string"\r
+; Push "ass"\r
+; Call StrStr\r
+; Pop $R0\r
+; ($R0 at this point is "ass string")\r
+\r
!macro StrStr un\r
Function ${un}StrStr\r
Exch $R1 ; st=haystack,old$R1, $R1=needle\r
FunctionEnd\r
!macroend\r
!insertmacro StrStr ""\r
-!insertmacro StrStr "un."
+!insertmacro StrStr "un."\r
has_dvb4linux="no"
has_xmlrpc="no"
has_openjpeg="no"
-has_libxml2="no"
gprof_build="no"
static_build="no"
want_pic="no"
disable_bifs="no"
disable_bifs_enc="no"
disable_laser="no"
-disable_beng="no"
+disable_saf="no"
+disable_smgr="no"
+disable_seng="no"
disable_qtvr="no"
disable_avi="no"
disable_m2ps="no"
disable_isoff_hint="no"
disable_isoff_frag="no"
disable_streaming="no"
+disable_player="no"
+disable_scenegraph="no"
+disable_dvbx="no"
+disable_vobsub="no"
+disable_ttxt="no"
enable_depth_compositor="no"
enable_renoir="no"
has_avcap="no"
--disable-bifs disable BIFS
--disable-bifs-enc disable BIFS coder
--disable-laser disable LASeR coder
- --disable-beng disable scene encoder engine
+ --disable-saf disable SAF container
+ --disable-seng disable scene encoder engine
--disable-qtvr disable import of Cubic QTVR files
--disable-avi disable AVI
--disable-ogg disable OGG
--disable-isoff-hint disable ISO File Format hinting
--disable-isoff-frag disable fragments in ISO File Format
--disable-streaming disable RTP/RTSP/SDP
+ --disable-dvb disable DVB-specific tools (MPE, FEC, DSM-CC)
+ --disable-vobsub disable VobSub support
+ --disable-sman disable scene manager
+ --disable-ttxt disable TTXT (3GPP / MPEG-4 Timed Text) support
+ --disable-player disable player (terminal and compositor)
+ --disable-scenegraph disable scenegraph, scene parsers and player (terminal and compositor)
Extra libraries configuration. You can turn a libray off or force using the local version in gpac/extra_lib/
--use-js=OPT force SpiderMonkey ECMAScript OPT=[no,local]
fi
#end wx test
-#if svg isn't disabled
-if test "$disable_svg" != "yes"; then
- #then check libxm2 presence via pkg-config
- if $pkg_config libxml-2.0 --exists > /dev/null 2>&1 ; then
- libxml2_cflags=`$pkg_config libxml-2.0 --cflags`
- libxml2_lib_flags=`$pkg_config libxml-2.0 --libs`
- has_libxml2="yes"
- fi
-fi
-
-
-
#look for IPv6
cat > $TMPC << EOF
#include <sys/types.h>
--enable-pulseaudio=*) has_pulseaudio="yes"
;;
- --disable-all) has_pulseaudio="no"; has_alsa="no"; disable_3d="yes"; disable_svg="yes"; disable_vrml="yes"; disable_od="yes"; disable_bifs="yes"; disable_bifs_enc="yes"; disable_laser="yes"; disable_beng="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_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-all) has_pulseaudio="no"; has_alsa="no"; 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_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_ttxt="yes"; disable_saf="yes"; disable_smgr="yes"
;;
--disable-3d) disable_3d="yes"
;;
--enable-laser) disable_laser="no"
;;
- --disable-beng) disable_beng="yes"
+ --disable-seng) disable_seng="yes"
;;
- --enable-beng) disable_beng="no"
+ --enable-seng) disable_seng="no"
;;
--disable-qtvr) disable_qtvr="yes"
;;
;;
--enable-streaming) disable_streaming="no"
;;
-
+ --disable-player) disable_player="yes"
+ ;;
+ --enable-player) disable_player="no"
+ ;;
+ --disable-scenegraph) disable_scenegraph="yes"
+ ;;
+ --enable-scenegraph) disable_scenegraph="no"
+ ;;
+ --disable-dvbx) disable_dvbx="yes"
+ ;;
+ --enable-dvbx) disable_dvbx="no"
+ ;;
+ --disable-vobsub) disable_vobsub="yes"
+ ;;
+ --enable-vobsub) disable_vobsub="no"
+ ;;
+ --disable-ttxt) disable_ttxt="yes"
+ ;;
+ --enable-ttxt) disable_ttxt="no"
+ ;;
+ --disable-saf) disable_saf="yes"
+ ;;
+ --enable-saf) disable_saf="no"
+ ;;
+ --disable-smgr) disable_smgr="yes"
+ ;;
+ --enable-smgr) disable_smgr="no"
+ ;;
esac
done
fi
fi
-
+if test "$disable_scenegraph" = "yes" ; then
+disable_3d="yes"
+disable_svg="yes"
+disable_vrml="yes"
+disable_x3d="yes"
+disable_od="no"
+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"
+fi
#prepare for config.h writing
TMPH="${TMPDIR1}/gpac-conf-${RANDOM}-$$-${RANDOM}.h"
version_micro=`grep '#define GPAC_VERSION_MICRO ' $source_path/include/gpac/tools.h | sed -e 's/.*\([0-9]\)\+$/\1/'`
soname_version="${version_major}.${version_minor}.${version_micro}"
-if which svnversion >/dev/null
-then
+if [ -d ".svn" ]; then
+ if which svnversion >/dev/null
+ then
revision="`svnversion \"$source_path\"`"
echo "#define GPAC_SVN_REVISION \"$revision\"" > $source_path/include/gpac/version.h
-else
+ else
echo "Cannot find SVN revision"
+ fi
+else
+ echo "#define GPAC_SVN_REVISION \"4065\"" > $source_path/include/gpac/version.h
fi
echo ""
echo "IPV6 Support: $has_ipv6"
+if test "$disable_player" = "yes" ; then
+ echo "Player disabled"
+ echo "#define GPAC_DISABLE_PLAYER" >> $TMPH
+ disable_laser="yes"
+fi
+if test "$disable_smgr" = "yes" ; then
+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_svg="yes"
+ echo "Scene Manager disabled"
+ echo "#define GPAC_DISABLE_SMGR" >> $TMPH
+fi
if test "$disable_svg" = "yes" ; then
echo "SVG disabled"
echo "#define GPAC_DISABLE_SVG" >> $TMPH
+ disable_laser="yes"
fi
if test "$disable_vrml" = "yes" ; then
echo "MPEG-4/VRML/X3D disabled"
echo "LASeR coder disabled"
echo "#define GPAC_DISABLE_LASER" >> $TMPH
fi
-if test "$disable_beng" = "yes" ; then
+if test "$disable_saf" = "yes" ; then
+ echo "SAF container disabled"
+ echo "#define GPAC_DISABLE_SAF" >> $TMPH
+fi
+if test "$disable_seng" = "yes" ; then
echo "Scene encoder engine disabled"
echo "#define GPAC_DISABLE_SENG" >> $TMPH
fi
echo "RTP/RTSP/SDP streaming disabled"
echo "#define GPAC_DISABLE_STREAMING" >> $TMPH
fi
+if test "$disable_dvbx" = "yes" ; then
+ echo "DVB MPE and DSM-CC disabled"
+ echo "#define GPAC_DISABLE_MPE" >> $TMPH
+ echo "#define GPAC_DISABLE_DSMCC" >> $TMPH
+fi
+if test "$disable_vobsub" = "yes" ; then
+ echo "VobSub disabled"
+ echo "#define GPAC_DISABLE_VOBSUB" >> $TMPH
+fi
+if test "$disable_ttxt" = "yes" ; then
+ echo "TimedText disabled"
+ echo "#define GPAC_DISABLE_TTXT" >> $TMPH
+fi
if test "$enable_depth_compositor" = "yes" ; then
echo "Depth Compositor enabled"
echo "FREENECT_LDLAGS=$freenect_ld" >> config.mak
fi
+echo "DISABLE_PLAYER=$disable_player" >> config.mak
+echo "DISABLE_STREAMING=$disable_streaming" >> config.mak
echo "DISABLE_SVG=$disable_svg" >> config.mak
+echo "DISABLE_LASER=$disable_laser" >> config.mak
+echo "DISABLE_SAF=$disable_saf" >> config.mak
+echo "DISABLE_BIFS=$disable_bifs" >> config.mak
+echo "DISABLE_SENG=$disable_seng" >> config.mak
+echo "DISABLE_LOADER_ISOFF=$disable_loader_isoff" >> config.mak
echo "DISABLE_LOADER_BT=$disable_loader_bt" >> config.mak
-echo "HAS_LIBXML2=$has_libxml2" >> config.mak
-if test "$has_libxml2" = "yes"; then
- echo "XML2_CFLAGS=$libxml2_cflags" >> config.mak
- echo "XML2_LIBS=$libxml2_lib_flags" >> config.mak
-fi
+echo "DISABLE_LOADER_XMT=$disable_loader_xmt" >> config.mak
+echo "DISABLE_LOADER_QTVR=$disable_qtvr" >> config.mak
+echo "DISABLE_LOADER_SWF=$disable_swf" >> config.mak
+echo "DISABLE_SCENE_STATS=$disable_scene_stats" >> config.mak
+echo "DISABLE_SCENE_DUMP=$disable_scene_dump" >> config.mak
+echo "DISABLE_SCENE_ENCODE=$disable_scene_encode" >> config.mak
+echo "DISABLE_SCENEGRAPH=$disable_scenegraph" >> config.mak
+echo "DISABLE_MCRYPT=$disable_mcrypt" >> config.mak
+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_HINT=$disable_isoff_hint" >> config.mak
+echo "DISABLE_VOBSUB=$disable_vobsub" >> config.mak
+echo "DISABLE_TTXT=$disable_ttxt" >> config.mak
+echo "DISABLE_SMGR=$disable_smgr" >> config.mak
+
if test "$disable_parsers" = "yes" ; then
disable_m2ts_mux="yes"
fi
else
echo "DISABLE_M2TS=no" >> config.mak
fi
-if test "$disable_beng" = "no"; then
- echo "DISABLE_SENG=no" >> config.mak
-fi
+
echo "GPAC_USE_TINYGL=$has_tinygl" >> config.mak
echo "OGL_INCLS=$INCL3D" >> config.mak
-Installation instructions for GPAC 0.4.5 on GCC-powered platforms
+Installation instructions for GPAC on GCC-powered platforms
last modified: December 2008
0 Foreword
-Installation instructions for GPAC 0.4.5 on Familiar+GPE platforms
+Installation instructions for GPAC on Familiar+GPE platforms
last modified: December 2008
0 Foreword
last modified: December 2008
0 Foreword
+ ! GPAC versions later than 0.4.5 are no longer supported on Symbian !
+
Compilation has only been tested with GCCE & Nokia S60 SDK
In order to fully compile, you must get:
- the complete S60 3rd edition SDK (maintainance release)
-Installation instructions for GPAC 0.4.5 on windows platform
-last modified: December 2008
+Installation instructions for GPAC on windows platform
+last modified: May 2012
0 Foreword
- Compilation has only been tested with MSVC 6 and VS2005 (VC8).
+ For any question on the installation procedure, please refer to http://gpac.sourceforge.net/home_download.php
The output directory for all plugins and applications is
- gpac/bin/w32_deb in debug mode
- gpac/bin/w32_rel in release mode
+ gpac/bin/win32/debug in debug mode
+ gpac/bin/win32/release in release mode
As of 0.2.2, GPAC cannot be compiled without ZLIB. You'd better make sure it is installed locally or on your system (zlib is provided in gpac_extra_libs package)
open the GPAC workspace:
gpac/build/msvc6/GPAC.dsw with MSVC6
- gpac/build/msvc8/gpac.sln with VS2005
+ gpac/build/msvc8/gpac.sln with VS2005
+ gpac/build/msvc9/gpac.sln with VS2008
NEVER ATTEMPT TO LOAD A PROJECT OUTSIDE THIS WORKSPACE, AS DEPENDENCY RULES WILL BE BROKEN
-Installation instructions for GPAC 0.4.5 on windows CE platform
-last modified: Mai 2007
+Installation instructions for GPAC on windows CE platform
+last modified: Mai 2012
0 Foreword
Compilation has only been tested with evc4 and ARM platforms
- GPAC 0.4.5 should be stable on most devices running PocketPC/SmartPhone 2003. It has know bugs with higher versions
+ GPAC should be stable on most devices running PocketPC/SmartPhone 2003. It has know bugs with higher versions
of the Windows Mobile OS, but should still be stable.
The output directory for all plugins and applications for Windows PocketPC 2003 is
- gpac/bin/arm_ppc03_deb in debug mode
- gpac/bin/arm_ppc03_rel in release mode
+ gpac/bin/Smartphone 2003/Debug in debug mode
+ gpac/bin/Smartphone 2003/Release in release mode
As of 0.2.2, GPAC cannot be compiled without ZLIB. You'd better make sure it is installed locally or on your system (zlib is provided in gpac_extra_libs package)
II GPAC compilation
- open /build/msevc4/GPAC.dsw (GPAC workspace) with MS eVC4
+ open /build/msvc8/gpac.sln (GPAC workspace) with MSVC 2005
+ open /build/msvc9/gpac.sln (GPAC workspace) with MSVC 2008
NEVER ATTEMPT TO LOAD A PROJECT OUTSIDE THIS WORKSPACE
-Codes used in GPAC are according to ISO/IEC 639-2/T as of GPAC 0.4.6-DEV internal rev. 6
+Codes used in GPAC are according to ISO/IEC 639-2/T
"Abkhazian","abk","ab",
"Achinese","ace","",
# Project related configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = libgpac
-PROJECT_NUMBER = 0.4.5
+PROJECT_NUMBER = 0.5.0
OUTPUT_DIRECTORY = .
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
-.TH "GPAC" 1 "December 2006" "GPAC Configuration" "GPAC Configuration"
+.TH "GPAC" 1 "May 2012" "GPAC Configuration" "GPAC Configuration"
.
.SH NAME
.LP
.SH "DESCRIPTION"
.LP
GPAC stands (does it ?) for GPAC Project on Advanced Content. It is an implementation of the MPEG-4 Systems standard written in ANSI C. GPAC provides tools for media playback, vector graphics and 3D rendering, MPEG-4 authoring and distribution.
-This man page is about configuration of the GPAC framework version 0.4.5.
+This man page is about configuration of the GPAC framework version 0.5.0.
.
.SH INTRODUCTION
Some applications in the GPAC framework use a configuration file shared among modules and reloadable at run time. This file is located in the user home directory and called ".gpacrc".
# $Id: gpac.spec,v 1.5 2008-12-02 18:04:42 jeanlf Exp $
Summary: GPAC is a multimedia framework covering MPEG-4, VRML/X3D and SVG.
Name: gpac
-Version: 0.4.5
-Release: DEV
+Version: 0.5.0
+Release: 0.5.0
License: LGPL
Group: Applications/Multimedia
-Source0: gpac-0.4.5.tar.gz%{?_with_amr:Source1:http://www.3gpp.org/ftp/Specs/archive/26_series/26.073/26073-700.zip}
+Source0: gpac-0.5.0.tar.gz%{?_with_amr:Source1:http://www.3gpp.org/ftp/Specs/archive/26_series/26.073/26073-700.zip}
URL: http://gpac.sourceforge.net/
BuildRoot: %{_tmppath}/%{name}-root
Requires: SDL
The main development goal is to provide a clean (a.k.a. readable by as many
people as possible), small and flexible alternative to the MPEG-4 Systems
reference software (known as IM1 and distributed in ISO/IEC 14496-5).
+GPAC covers a very large part of the MPEG-4 standard, and features what can probably
+be seen as the most advanced and robust 2D MPEG-4 Player available worldwide, as well as
+a decent 3D MPEG-4/VRML player.
The second development goal is to achieve integration of recent multimedia
-standards (SVG/SMIL, VRML, X3D, SWF, etc) into a single framework.
-GPAC already supports most of VRML97 and SVG Tiny 1.2, as well as some X3D and simple SWF support.
-
-GPAC already features 2D and 3D multimedia playback, MPEG-4 Systems
-encoders/multiplexers and publishing tools for content distribution.
+standards for content playback (SVG/SMIL, VRML, X3D, SWF, etc) and content delivery into a single framework.
+GPAC features 2D and 3D multimedia playback, MPEG-4 Systems (BIFS and LASeR) encoders, multiplexers and
+publishing tools for content distribution, such as RTP streamers, MPEG-2 TS muxers, ISO Base Media File (MP4 & 3GP a.k.a. ISO/IEC 14496-12)
+and MPEG DASH muxers.
GPAC is licensed under the GNU Lesser General Public License.
-The current GPAC release (0.4.5) already covers a very large part of the MPEG-4 standard,
-and features what can probably be seen as the most advanced and robust 2D MPEG-4
-Player available worldwide, as well as a decent 3D MPEG-4/VRML player.
Available rpmbuild rebuild options :
--without : js freetype faad a52 jpeg png mad xvid ffmpeg
#endif /*GPAC_DISABLE_MCRYPT*/
-/*SHA1 from Christophe Devine*/
-typedef struct
-{
- u32 total[2];
- u32 state[5];
- u8 buffer[64];
-} GF_SHA1Context;
-
-/*
- * Core SHA-1 functions
- */
-void gf_sha1_starts(GF_SHA1Context *ctx );
-void gf_sha1_update(GF_SHA1Context *ctx, u8 *input, u32 length);
-void gf_sha1_finish(GF_SHA1Context *ctx, u8 digest[20] );
-
-/*
- * Output SHA-1(file contents), returns 0 if successful.
- */
-int gf_sha1_file(const char *filename, u8 digest[20]);
-
-/*
- * Output SHA-1(buf)
- */
-void gf_sha1_csum(u8 *buf, u32 buflen, u8 digest[20]);
-
-/*
- * Output HMAC-SHA-1(key,buf)
- */
-void gf_sha1_hmac(u8 *key, u32 keylen, u8 *buf, u32 buflen, u8 digest[20]);
-
-
#ifdef __cplusplus
}
#endif
/*
DO NOT MOFIFY - File generated on GMT Tue Nov 08 09:10:57 2011
- BY MPEG4Gen for GPAC Version 0.4.6-DEV
+ BY MPEG4Gen for GPAC Version 0.5.0
*/
#ifndef _NDT_H
/*compositor exclusive access to the scene and display*/
GF_Mutex *mx;
+ /*list of modules containing hardcoded proto implementations*/
+ GF_List *proto_modules;
+
/*the main scene graph*/
GF_SceneGraph *scene;
/*extra scene graphs (OSD, etc), always registered in draw order. That's the module responsability
/**
* GPAC - Multimedia Framework C SDK
*
- * Copyright (c) Jean Le Feuvre 2000-2005
+ * Authors: Pierre Souchay
+ * Copyright (c) Telecom ParisTech 2010-2012
* All rights reserved
*
* This file is part of GPAC
* 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.
- * Written by Pierre Souchay for VizionR SAS
*
*/
#ifndef M3U8_PLAYLIST_H
#define _GF_MEDIA_DEV_H_
#include <gpac/media_tools.h>
+
+#ifndef GPAC_DISABLE_STREAMING
#include <gpac/ietf.h>
+#endif
#ifndef GPAC_DISABLE_ISOM
void gf_media_get_sample_average_infos(GF_ISOFile *file, u32 Track, u32 *avgSize, u32 *MaxSize, u32 *TimeDelta, u32 *maxCTSDelta, u32 *const_duration, u32 *bandwidth);
#define _GF_VOBSUB_H_
#include <gpac/tools.h>
+#include <gpac/list.h>
#ifdef __cplusplus
extern "C" {
/*loads key and salt for MPEG4IP protected files*/
Bool gf_ismacryp_mpeg4ip_get_info(char *kms_uri, char *key, char *salt);
-
-/*computes file hash. If file is ISO-based, computre hash according to OMA (P)DCF (without MutableDRMInformation box)*/
-GF_Err gf_media_get_file_hash(const char *file, u8 hash[20]);
enum
{
#include <gpac/isomedia.h>
#include <gpac/avparse.h>
+/*computes file hash. If file is ISO-based, computre hash according to OMA (P)DCF (without MutableDRMInformation box)*/
+GF_Err gf_media_get_file_hash(const char *file, u8 hash[20]);
#ifndef GPAC_DISABLE_ISOM
/*creates (if needed) a GF_ESD for the given track - THIS IS RESERVED for local playback
--- /dev/null
+/*
+ * GPAC - Multimedia Framework C SDK
+ *
+ * Authors: Ivica Arsov, Jean Le Feuvre
+ * Copyright (c) Telecom ParisTech 2012
+ * All rights reserved
+ *
+ * This file is part of GPAC / modules interfaces
+ *
+ * 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.
+ *
+ */
+
+
+#ifndef _GF_MODULE_PROTO_MOD_H_
+#define _GF_MODULE_PROTO_MOD_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <gpac/module.h>
+#include <gpac/scenegraph.h>
+#include <gpac/compositor.h>
+
+/*interface name and version for Built-in proto User Extensions*/
+#define GF_HARDCODED_PROTO_INTERFACE GF_4CC('G','H','P', '1')
+
+typedef struct _hc_proto_mod
+{
+ /* interface declaration*/
+ GF_DECL_MODULE_INTERFACE
+
+ /*load hardcoded proto
+ compositor: compositor used for loading
+ node: proto node to be loaded
+ */
+ Bool (*init)(GF_Compositor* compositor, GF_Node* node);
+
+ /*check if the module can load a proto
+ url: url to check
+ */
+ Bool (*can_load_proto)(const char* url);
+
+ /*module private*/
+ void *udta;
+} GF_HardcodedProto;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /*#define _GF_MODULE_PROTO_MOD_H_*/
+
#endif /*GPAC_DISABLE_MPEG2TS_MUX*/
/******************* Demux DVB ****************************/
-#include <gpac/ait.h>
-#include <gpac/dsmcc.h>
+
#define UDP_BUFFER_SIZE 0x40000
#define M2TS_BUFFER_MAX 400
/*
DO NOT MOFIFY - File generated on GMT Tue Nov 08 09:10:57 2011
- BY MPEG4Gen for GPAC Version 0.4.6-DEV
+ BY MPEG4Gen for GPAC Version 0.5.0
*/
#ifndef _nodes_mpeg4_H
/*
DO NOT MOFIFY - File generated on GMT Fri Jul 31 16:39:50 2009
- BY X3DGen for GPAC Version 0.4.6-DEV
+ BY X3DGen for GPAC Version 0.5.0
*/
#ifndef _GF_X3D_NODES_H
* NO SPACE in GPAC_VERSION for proper install
* SONAME versions must be digits (not strings)
*/
-#define GPAC_VERSION "0.4.6-DEV"
+#define GPAC_VERSION "0.5.0"
#define GPAC_VERSION_MAJOR 2
#define GPAC_VERSION_MINOR 0
#define GPAC_VERSION_MICRO 0
GF_Err gf_gz_decompress_payload(char *data, u32 data_len, char **uncompressed_data, u32 *out_size);
+/*SHA1*/
+typedef struct __sha1_context GF_SHA1Context;
+
+/*
+ * Core SHA-1 functions
+ */
+GF_SHA1Context *gf_sha1_starts();
+void gf_sha1_update(GF_SHA1Context *ctx, u8 *input, u32 length);
+void gf_sha1_finish(GF_SHA1Context *ctx, u8 digest[20] );
+
+/*
+ * Output SHA-1(file contents), returns 0 if successful.
+ */
+int gf_sha1_file(const char *filename, u8 digest[20]);
+
+/*
+ * Output SHA-1(buf)
+ */
+void gf_sha1_csum(u8 *buf, u32 buflen, u8 digest[20]);
+
+
#ifdef GPAC_ANDROID
typedef void (*fm_callback_func)(void *cbk_obj, u32 type, u32 param, int *value);
extern void gf_fm_request_set_callback(void *cbk_obj, fm_callback_func cbk_func);
include ../config.mak
#all OS and lib independent
-PLUGDIRS=aac_in ac3_in audio_filter bifs_dec ctx_load dummy_in soft_raster mp3_in isom_in odf_dec rtp_in timedtext img_in svg_in saf_in mpegts_in ismacryp mpd_in
+PLUGDIRS=aac_in ac3_in audio_filter bifs_dec dummy_in soft_raster mp3_in isom_in odf_dec rtp_in timedtext img_in saf_in mpegts_in ismacryp mpd_in
+
+ifeq ($(DISABLE_SMGR), no)
+PLUGDIRS+=ctx_load svg_in
+endif
ifeq ($(DISABLE_SVG), no)
PLUGDIRS+=laser_dec svg_in widgetman
endif
+ifeq ($(DISABLE_PLAYER), yes)
+PLUGDIRS=
+endif
+
all: plugs
//#define FFMPEG_DUMP_REMOTE
-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(52, 102, 0)
+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(52, 113, 1)
#define USE_PRE_0_7 1
#endif
static JSBool upnpdevice_getProperty(JSContext *c, JSObject *obj, SMJS_PROP_GETTER, jsval *vp)
{
char *prop_name;
- GPAC_DeviceItem *dev = (GPAC_DeviceItem *)JS_GetPrivate(c, obj);
+ GPAC_DeviceItem *dev = (GPAC_DeviceItem *)SMJS_GET_PRIVATE(c, obj);
if (!dev) return JS_FALSE;
if (!SMJS_ID_IS_STRING(id)) return JS_TRUE;
}
else if (!strcmp(prop_name, "ServicesCount")) {
u32 count = gf_list_count(dev->m_Services);
+ if (!count) {
+ dev->RefreshServiceList();
+ count = gf_list_count(dev->m_Services);
+ }
*vp = INT_TO_JSVAL(count);
}
SMJS_FREE(c, prop_name);
{
PLT_Service* service;
char *service_uuid;
- GPAC_DeviceItem *item = (GPAC_DeviceItem *)JS_GetPrivate(c, obj);
+ GPAC_DeviceItem *item = (GPAC_DeviceItem *)SMJS_GET_PRIVATE(c, obj);
if (!item || (argc!=2) ) return JS_FALSE;
if (!JSVAL_IS_STRING(argv[0])) return JS_FALSE;
char *service_uuid;
SMJS_OBJ
SMJS_ARGS
- GPAC_DeviceItem *item = (GPAC_DeviceItem *)JS_GetPrivate(c, obj);
+ GPAC_DeviceItem *item = (GPAC_DeviceItem *)SMJS_GET_PRIVATE(c, obj);
if (!item || !argc) return JS_FALSE;
service_uuid = SMJS_CHARS(c, argv[0]);
u32 service_index;
SMJS_OBJ
SMJS_ARGS
- GPAC_DeviceItem *item = (GPAC_DeviceItem *)JS_GetPrivate(c, obj);
+ GPAC_DeviceItem *item = (GPAC_DeviceItem *)SMJS_GET_PRIVATE(c, obj);
if (!item || !argc || !JSVAL_IS_INT(argv[0])) return JS_FALSE;
service_index = JSVAL_TO_INT(argv[0]);
item->obj = JS_NewObject(m_pJSCtx, &upnpGenericDeviceClass, 0, 0);
item->m_pUPnP = this;
gf_js_add_root(m_pJSCtx, &item->obj, GF_JSGC_OBJECT);
- JS_SetPrivate(item->js_ctx, item->obj, item);
+ SMJS_SET_PRIVATE(item->js_ctx, item->obj, item);
}
JS_LookupProperty(m_pJSCtx, m_pObj, "onDeviceAdd", &funval);
static JSBool upnp_getProperty(JSContext *c, JSObject *obj, SMJS_PROP_GETTER, jsval *vp)
{
char *prop_name;
- GF_UPnP *upnp = (GF_UPnP *)JS_GetPrivate(c, obj);
+ GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
if (!upnp) return JS_FALSE;
if (!SMJS_ID_IS_STRING(id)) return JS_TRUE;
static JSBool upnp_setProperty(JSContext *c, JSObject *obj, SMJS_PROP_SETTER, jsval *vp)
{
char *prop_name;
- GF_UPnP *upnp = (GF_UPnP *)JS_GetPrivate(c, obj);
+ GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
if (!upnp) return JS_FALSE;
if (!SMJS_ID_IS_STRING(id)) return JS_TRUE;
GPAC_DeviceItem *device;
SMJS_OBJ
SMJS_ARGS
- GF_UPnP *upnp = (GF_UPnP *)JS_GetPrivate(c, obj);
+ GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
if (!upnp || !argc || !JSVAL_IS_INT(argv[0]) ) return JS_FALSE;
idx = JSVAL_TO_INT(argv[0]);
device->obj = JS_NewObject(upnp->m_pJSCtx, &upnp->upnpGenericDeviceClass, 0, 0);
device->m_pUPnP = upnp;
gf_js_add_root(upnp->m_pJSCtx, &device->obj, GF_JSGC_OBJECT);
- JS_SetPrivate(device->js_ctx, device->obj, device);
+ SMJS_SET_PRIVATE(device->js_ctx, device->obj, device);
}
SMJS_SET_RVAL( OBJECT_TO_JSVAL(device->obj) );
return JS_TRUE;
char *serv_name;
SMJS_OBJ
SMJS_ARGS
- GF_UPnP *upnp = (GF_UPnP *)JS_GetPrivate(c, obj);
+ GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
if (!upnp || (argc!=2) || !JSVAL_IS_STRING(argv[0]) || !JSVAL_IS_STRING(argv[1]) ) return JS_FALSE;
dev_ip = SMJS_CHARS(c, argv[0]);
char *item, *resource_url;
SMJS_OBJ
SMJS_ARGS
- GF_UPnP *upnp = (GF_UPnP *)JS_GetPrivate(c, obj);
+ GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
if (!upnp || (argc<1) ) return JS_FALSE;
render = upnp_renderer_get_device(upnp, c, obj);
GPAC_MediaRendererItem *render;
SMJS_OBJ
SMJS_ARGS
- GF_UPnP *upnp = (GF_UPnP *)JS_GetPrivate(c, obj);
+ GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
if (!upnp) return JS_FALSE;
render = upnp_renderer_get_device(upnp, c, obj);
JSObject *s_obj;
SMJS_OBJ
SMJS_ARGS
- GF_UPnP *upnp = (GF_UPnP *)JS_GetPrivate(c, obj);
+ GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
if (!upnp || !upnp->m_pAVCtrlPoint || (argc!=1) ) return JS_FALSE;
GPAC_MediaRendererItem *mr = NULL;
if (!mr) return JS_FALSE;
s_obj = JS_NewObject(c, &upnp->upnpDeviceClass, 0, 0);
- JS_SetPrivate(c, s_obj, upnp);
+ SMJS_SET_PRIVATE(c, s_obj, upnp);
JS_DefineProperty(c, s_obj, "Name", STRING_TO_JSVAL( JS_NewStringCopyZ(c, mr->m_device->GetFriendlyName()) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
JS_DefineProperty(c, s_obj, "UUID", STRING_TO_JSVAL( JS_NewStringCopyZ(c, mr->m_UUID ) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
char *dir, *filter, *_dir, *_filter;
SMJS_OBJ
SMJS_ARGS
- GF_UPnP *upnp = (GF_UPnP *)JS_GetPrivate(c, obj);
+ GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
if (!upnp || (argc!=2) ) return JS_FALSE;
server = upnp_server_get_device(upnp, c, obj);
{
GPAC_MediaServerItem *server;
SMJS_OBJ
- GF_UPnP *upnp = (GF_UPnP *)JS_GetPrivate(c, obj);
+ GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
if (!upnp) return JS_FALSE;
server = upnp_server_get_device(upnp, c, obj);
u32 idx;
SMJS_OBJ
SMJS_ARGS
- PLT_MediaObject *mo = (PLT_MediaObject *)JS_GetPrivate(c, obj);
+ PLT_MediaObject *mo = (PLT_MediaObject *)SMJS_GET_PRIVATE(c, obj);
if (!mo || (argc!=1) || !JSVAL_IS_INT(argv[0]) ) return JS_FALSE;
idx = JSVAL_TO_INT(argv[0]);
if (idx<mo->m_Resources.GetItemCount()) {
JSObject *f_obj;
SMJS_OBJ
SMJS_ARGS
- GF_UPnP *upnp = (GF_UPnP *)JS_GetPrivate(c, obj);
+ GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
if (!upnp || (argc!=1) || !JSVAL_IS_INT(argv[0]) ) return JS_FALSE;
server = upnp_server_get_device(upnp, c, obj);
if (!mo) return JS_TRUE;
f_obj = JS_NewObject(c, &upnp->upnpDeviceClass, 0, 0);
- JS_SetPrivate(c, f_obj, mo);
+ SMJS_SET_PRIVATE(c, f_obj, mo);
JS_DefineProperty(c, f_obj, "ObjectID", STRING_TO_JSVAL( JS_NewStringCopyZ(c, mo->m_ObjectID)), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
JS_DefineProperty(c, f_obj, "Name", STRING_TO_JSVAL( JS_NewStringCopyZ(c, mo->m_Title)), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
u32 id;
SMJS_OBJ
SMJS_ARGS
- GF_UPnP *upnp = (GF_UPnP *)JS_GetPrivate(c, obj);
+ GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
if (!upnp || (argc!=1) || !JSVAL_IS_INT(argv[0]) ) return JS_FALSE;
server = upnp_server_get_device(upnp, c, obj);
JSObject *s_obj;
SMJS_OBJ
SMJS_ARGS
- GF_UPnP *upnp = (GF_UPnP *)JS_GetPrivate(c, obj);
+ GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
if (!upnp || !upnp->m_pAVCtrlPoint || (argc!=1)) return JS_FALSE;
}
if (!ms) return JS_FALSE;
s_obj = JS_NewObject(c, &upnp->upnpDeviceClass, 0, 0);
- JS_SetPrivate(c, s_obj, upnp);
+ SMJS_SET_PRIVATE(c, s_obj, upnp);
JS_DefineProperty(c, s_obj, "Name", STRING_TO_JSVAL( JS_NewStringCopyZ(c, ms->m_device->GetFriendlyName()) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
JS_DefineProperty(c, s_obj, "UUID", STRING_TO_JSVAL( JS_NewStringCopyZ(c, ms->m_UUID ) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
static JSBool SMJS_FUNCTION(upnp_bind_renderer)
{
SMJS_OBJ
- GF_UPnP *upnp = (GF_UPnP *)JS_GetPrivate(c, obj);
+ GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
if (!upnp) return JS_TRUE;
upnp->m_renderer_bound = 1;
NPT_String resourceURI;
SMJS_OBJ
SMJS_ARGS
- GF_UPnP *upnp = (GF_UPnP *)JS_GetPrivate(c, obj);
+ GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
if (!upnp || !upnp->m_pMediaServer || !argc || !JSVAL_IS_STRING(argv[0]) ) return JS_TRUE;
url = SMJS_CHARS(c, argv[0]);
if (!url) return JS_TRUE;
char *res_url, *res_val, *mime;
SMJS_OBJ
SMJS_ARGS
- GF_UPnP *upnp = (GF_UPnP *)JS_GetPrivate(c, obj);
+ GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
if (!upnp || !upnp->m_pMediaServer || (argc<2) || !JSVAL_IS_STRING(argv[0]) || !JSVAL_IS_STRING(argv[1]) ) return JS_TRUE;
res_url = SMJS_CHARS(c, argv[0]);
if (!res_url) return JS_TRUE;
NPT_Result res;
SMJS_OBJ
SMJS_ARGS
- GPAC_GenericDevice *device = (GPAC_GenericDevice *)JS_GetPrivate(c, obj);
+ GPAC_GenericDevice *device = (GPAC_GenericDevice *)SMJS_GET_PRIVATE(c, obj);
if (!device) return JS_FALSE;
if (argc<3) return JS_FALSE;
jsval sval;
char *str;
SMJS_OBJ
- GPAC_GenericDevice *device = (GPAC_GenericDevice *)JS_GetPrivate(c, obj);
+ GPAC_GenericDevice *device = (GPAC_GenericDevice *)SMJS_GET_PRIVATE(c, obj);
if (!device) return JS_FALSE;
if (JS_LookupProperty(device->m_pUPnP->m_pJSCtx, obj, "PresentationURL", &sval) && JSVAL_IS_STRING(sval)) {
static JSBool SMJS_FUNCTION(upnp_device_stop)
{
SMJS_OBJ
- GPAC_GenericDevice *device = (GPAC_GenericDevice *)JS_GetPrivate(c, obj);
+ GPAC_GenericDevice *device = (GPAC_GenericDevice *)SMJS_GET_PRIVATE(c, obj);
if (!device) return JS_FALSE;
PLT_DeviceHostReference devRef(device);
JS_DefineFunction(upnp->m_pJSCtx, device->obj, "SetupService", upnp_device_setup_service, 0, 0);
JS_DefineFunction(upnp->m_pJSCtx, device->obj, "Start", upnp_device_start, 0, 0);
// JS_DefineFunction(upnp->m_pJSCtx, device->obj, "Stop", upnp_device_stop, 0, 0);
- JS_SetPrivate(upnp->m_pJSCtx, device->obj, device);
+ SMJS_SET_PRIVATE(upnp->m_pJSCtx, device->obj, device);
if (!upnp->m_Devices) upnp->m_Devices = gf_list_new();
gf_list_add(upnp->m_Devices, device);
char *id, *name;
SMJS_OBJ
SMJS_ARGS
- GF_UPnP *upnp = (GF_UPnP *)JS_GetPrivate(c, obj);
+ GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
if (!upnp || (argc != 2)) return JS_FALSE;
id = SMJS_CHARS(c, argv[0]);
GPAC_GenericDevice *device;
SMJS_OBJ
SMJS_ARGS
- GF_UPnP *upnp = (GF_UPnP *)JS_GetPrivate(c, obj);
+ GF_UPnP *upnp = (GF_UPnP *)SMJS_GET_PRIVATE(c, obj);
if (!upnp || (argc != 1)) return JS_FALSE;
- device = (GPAC_GenericDevice *) JS_GetPrivate(c, JSVAL_TO_OBJECT(argv[0]) );
+ device = (GPAC_GenericDevice *) SMJS_GET_PRIVATE(c, JSVAL_TO_OBJECT(argv[0]) );
if (!device) return JS_FALSE;
gf_list_del_item(upnp->m_Devices, device);
JS_InitClass(m_pJSCtx, (JSObject*)param->global, 0, &upnpClass, 0, 0, upnpClassProps, upnpClassFuncs, 0, 0);
m_pObj = JS_DefineObject(m_pJSCtx, (JSObject*)param->global, "UPnP", &upnpClass, 0, 0);
- JS_SetPrivate(m_pJSCtx, m_pObj, this);
+ SMJS_SET_PRIVATE(m_pJSCtx, m_pObj, this);
JS_SETUP_CLASS(upnpDeviceClass, "UPNPAVDEVICE", JSCLASS_HAS_PRIVATE, JS_PropertyStub, JS_PropertyStub_forSetter, JS_FinalizeStub);
{
if (obj) {
gf_js_remove_root(js_ctx, &obj, GF_JSGC_OBJECT);
- JS_SetPrivate(js_ctx, obj, NULL);
+ SMJS_SET_PRIVATE(js_ctx, obj, NULL);
obj = NULL;
}
if (!JSVAL_IS_NULL(on_event)) {
void GPAC_DeviceItem::DetachJS() {
if (obj) {
gf_js_remove_root(js_ctx, &obj, GF_JSGC_OBJECT);
- JS_SetPrivate(js_ctx, obj, NULL);
+ SMJS_SET_PRIVATE(js_ctx, obj, NULL);
obj = NULL;
}
while (gf_list_count(m_Services)) {
u32 i;
SMJS_OBJ
SMJS_ARGS
- GPAC_ServiceItem *service = (GPAC_ServiceItem *)JS_GetPrivate(c, obj);
+ GPAC_ServiceItem *service = (GPAC_ServiceItem *)SMJS_GET_PRIVATE(c, obj);
if (!service || !argc || !JSVAL_IS_OBJECT(argv[0])) return JS_FALSE;
if (argc<1) {
u32 i;
SMJS_OBJ
SMJS_ARGS
- GPAC_ServiceItem *service = (GPAC_ServiceItem *)JS_GetPrivate(c, obj);
+ GPAC_ServiceItem *service = (GPAC_ServiceItem *)SMJS_GET_PRIVATE(c, obj);
if (!service || (argc<2) || !JSVAL_IS_STRING(argv[0]) || !JSVAL_IS_OBJECT(argv[1])) return JS_FALSE;
name = SMJS_CHARS(c, argv[0]);
return JS_TRUE;
}
+static JSBool SMJS_FUNCTION(upnp_service_get_scpd)
+{
+ NPT_String name;
+ SMJS_OBJ
+ GPAC_ServiceItem *service = (GPAC_ServiceItem *)SMJS_GET_PRIVATE(c, obj);
+ if (!service )
+ return JS_FALSE;
+
+ service->m_service->GetSCPDXML(name);
+ SMJS_SET_RVAL( STRING_TO_JSVAL( JS_NewStringCopyZ(c, name) ) );
+ return JS_TRUE;
+}
+
JSBool upnpservice_getProperty(JSContext *c, JSObject *obj, SMJS_PROP_GETTER, jsval *vp)
{
char *prop_name;
- GPAC_ServiceItem *service = (GPAC_ServiceItem *)JS_GetPrivate(c, obj);
+ GPAC_ServiceItem *service = (GPAC_ServiceItem *)SMJS_GET_PRIVATE(c, obj);
if (!service) return JS_FALSE;
if (!SMJS_ID_IS_STRING(id)) return JS_TRUE;
char *name = NULL;
SMJS_OBJ
SMJS_ARGS
- GPAC_ServiceItem *service = (GPAC_ServiceItem *)JS_GetPrivate(c, obj);
+ GPAC_ServiceItem *service = (GPAC_ServiceItem *)SMJS_GET_PRIVATE(c, obj);
if (!service || !argc || !JSVAL_IS_STRING(argv[0]) )
return JS_FALSE;
char *name = NULL;
SMJS_OBJ
SMJS_ARGS
- GPAC_ServiceItem *service = (GPAC_ServiceItem *)JS_GetPrivate(c, obj);
+ GPAC_ServiceItem *service = (GPAC_ServiceItem *)SMJS_GET_PRIVATE(c, obj);
if (!service || !argc || !JSVAL_IS_STRING(argv[0]) )
return JS_FALSE;
char *action_name = NULL;
SMJS_OBJ
SMJS_ARGS
- GPAC_ServiceItem *service = (GPAC_ServiceItem *)JS_GetPrivate(c, obj);
+ GPAC_ServiceItem *service = (GPAC_ServiceItem *)SMJS_GET_PRIVATE(c, obj);
if (!service || !argc || !JSVAL_IS_STRING(argv[0]) ) return JS_FALSE;
action_name = SMJS_CHARS(c, argv[0]);
#endif
+void GPAC_DeviceItem::RefreshServiceList()
+{
+ u32 i;
+ NPT_Array<PLT_Service*> services = m_device->GetServices();
+
+ for (i=0; i<services.GetItemCount(); i++) {
+ PLT_Service *serv = services[i];
+ FindService(serv->GetServiceType());
+ }
+}
GPAC_ServiceItem *GPAC_DeviceItem::FindService(const char *type)
{
serv->js_ctx = js_ctx;
serv->obj = JS_NewObject(serv->js_ctx, &m_pUPnP->upnpServiceClass, 0, obj);
gf_js_add_root(serv->js_ctx, &serv->obj, GF_JSGC_OBJECT);
- JS_SetPrivate(serv->js_ctx, serv->obj, serv);
+ SMJS_SET_PRIVATE(serv->js_ctx, serv->obj, serv);
JS_DefineProperty(serv->js_ctx, serv->obj, "Name", STRING_TO_JSVAL( JS_NewStringCopyZ(serv->js_ctx, service->GetServiceID()) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
JS_DefineProperty(serv->js_ctx, serv->obj, "Type", STRING_TO_JSVAL( JS_NewStringCopyZ(serv->js_ctx, service->GetServiceType()) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
JS_DefineProperty(serv->js_ctx, serv->obj, "Hostname", STRING_TO_JSVAL( JS_NewStringCopyZ(serv->js_ctx, m_device->GetURLBase().GetHost() ) ), 0, 0, JSPROP_READONLY | JSPROP_PERMANENT);
JS_DefineFunction(serv->js_ctx, serv->obj, "HasAction", upnp_service_has_action, 2, 0);
JS_DefineFunction(serv->js_ctx, serv->obj, "CallAction", upnp_service_call_action, 2, 0);
JS_DefineFunction(serv->js_ctx, serv->obj, "SetActionListener", upnp_service_set_action_listener, 2, 0);
+ JS_DefineFunction(serv->js_ctx, serv->obj, "GetSCPD", upnp_service_get_scpd, 1, 0);
#endif
char *arg_name = NULL;
SMJS_OBJ
SMJS_ARGS
- PLT_Action *action = (PLT_Action *) JS_GetPrivate(c, obj);
+ PLT_Action *action = (PLT_Action *) SMJS_GET_PRIVATE(c, obj);
if (!action || !argc || !JSVAL_IS_STRING(argv[0])) return JS_FALSE;
arg_name = SMJS_CHARS(c, argv[0]);
{
NPT_String res;
SMJS_OBJ
- PLT_Action *action = (PLT_Action *) JS_GetPrivate(c, obj);
+ PLT_Action *action = (PLT_Action *) SMJS_GET_PRIVATE(c, obj);
if (!action ) return JS_FALSE;
SMJS_SET_RVAL( INT_TO_JSVAL( action->GetErrorCode() ));
return JS_TRUE;
NPT_String res;
unsigned int code;
SMJS_OBJ
- PLT_Action *action = (PLT_Action *) JS_GetPrivate(c, obj);
+ PLT_Action *action = (PLT_Action *) SMJS_GET_PRIVATE(c, obj);
if (!action ) return JS_FALSE;
SMJS_SET_RVAL( STRING_TO_JSVAL( JS_NewStringCopyZ(c, action->GetError( code ) ) ) );
return JS_TRUE;
GF_LOG(GF_LOG_INFO, GF_LOG_NETWORK, ("[UPnP] Calling handler for response %s\n", (char *) action->GetActionDesc().GetName()));
act_obj = JS_NewObject(serv->js_ctx, &item->m_pUPnP->upnpDeviceClass, 0, item->obj);
- JS_SetPrivate(serv->js_ctx, act_obj, (void *)action.AsPointer() );
+ SMJS_SET_PRIVATE(serv->js_ctx, act_obj, (void *)action.AsPointer() );
JS_DefineFunction(serv->js_ctx, act_obj, "GetArgumentValue", upnp_action_get_argument_value, 1, 0);
JS_DefineFunction(serv->js_ctx, act_obj, "GetErrorCode", upnp_action_get_error_code, 1, 0);
JS_DefineFunction(serv->js_ctx, act_obj, "GetError", upnp_action_get_error, 1, 0);
char *name, *val;
SMJS_OBJ
SMJS_ARGS
- GPAC_Service* service = (GPAC_Service*) JS_GetPrivate(c, obj);
+ GPAC_Service* service = (GPAC_Service*) SMJS_GET_PRIVATE(c, obj);
if (!service) return JS_FALSE;
name = SMJS_CHARS(c, argv[0]);
m_pCtx = c;
m_pObj = JS_NewObject(c, &upnp->upnpDeviceClass, 0, parent);
gf_js_add_root(m_pCtx, &m_pObj, GF_JSGC_OBJECT);
- JS_SetPrivate(c, m_pObj, this);
+ SMJS_SET_PRIVATE(c, m_pObj, this);
JS_DefineFunction(c, m_pObj, "SetStateVariable", upnp_service_set_state_variable, 2, 0);
}
char *act_name;
SMJS_OBJ
SMJS_ARGS
- GPAC_GenericDevice *device = (GPAC_GenericDevice *)JS_GetPrivate(c, obj);
+ GPAC_GenericDevice *device = (GPAC_GenericDevice *)SMJS_GET_PRIVATE(c, obj);
if (!device || !argc || !JSVAL_IS_STRING(argv[0]) ) return JS_FALSE;
act_name = SMJS_CHARS(c, argv[0]);
{
SMJS_OBJ
SMJS_ARGS
- GPAC_GenericDevice *device = (GPAC_GenericDevice *)JS_GetPrivate(c, obj);
+ GPAC_GenericDevice *device = (GPAC_GenericDevice *)SMJS_GET_PRIVATE(c, obj);
if (!device) return JS_FALSE;
if (argc && JSVAL_IS_OBJECT(argv[0]) ) {
JSObject *js_action = JS_NewObject(m_pUPnP->m_pJSCtx, &m_pUPnP->upnpDeviceClass, 0, 0);
argv[0] = OBJECT_TO_JSVAL(js_action);
- JS_SetPrivate(m_pUPnP->m_pJSCtx, js_action, this);
+ SMJS_SET_PRIVATE(m_pUPnP->m_pJSCtx, js_action, this);
act_ref = action;
jsval rval;
JS_CallFunctionValue(m_pUPnP->m_pJSCtx, obj, act_proc, 1, argv, &rval);
- JS_SetPrivate(m_pUPnP->m_pJSCtx, js_action, NULL);
+ SMJS_SET_PRIVATE(m_pUPnP->m_pJSCtx, js_action, NULL);
m_pUPnP->LockJavascript(0);
if (JSVAL_IS_INT(rval) && (JSVAL_TO_INT(rval) != 0)) {
GF_UPnP *m_pUPnP;
GPAC_ServiceItem *FindService(const char *type);
+ void RefreshServiceList();
GF_List *m_Services;
#ifdef GPAC_HAS_SPIDERMONKEY
font-variant="normal"
font-weight="all"
font-stretch="all"
- font-size="all"
+ font-size="12"
unicode-range="U+0-7FFFFFFF, U+0-7FFFFFFF"
units-per-em="2048"
panose-1="0 1 2 3 4 5 6 7 8 9"
<?xml version="1.0" encoding="UTF-8"?>
-<!-- SVG Scene Dump - GPAC version 0.4.5-DEV (build 32) -->
<svg id="svg-root" version="1.1" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%" viewport-fill="#CC3B38" font-family="Arial" >
<text id="from" x="5" y="10">Léa</text>
<text id="to" x="5" y="40"></text>
<?xml version="1.0" encoding="UTF-8"?>
-<!-- SVG Scene Dump - GPAC version 0.4.5-DEV (build 32) -->
<svg id="svg-root" version="1.1" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%" viewport-fill="#CC3B38" font-family="Arial" >
<text id="from" x="5" y="10">Léa</text>
<text id="to" x="5" y="40"></text>
endif
## libgpac objects gathering: src/utils
-LIBGPAC_UTILS=utils/os_divers.o utils/os_net.o utils/os_module.o utils/os_thread.o utils/os_config_init.o utils/list.o utils/base_encoding.o utils/bitstream.o utils/color.o utils/configfile.o utils/cache.o utils/downloader.o utils/error.o utils/math.o utils/path2d.o utils/path2d_stroker.o utils/module.o utils/token.o utils/uni_bidi.o utils/url.o utils/utf.o utils/xml_parser.o utils/alloc.o utils/ringbuffer.o utils/unicode.o
+LIBGPAC_UTILS=utils/os_divers.o utils/os_net.o utils/os_module.o utils/os_thread.o utils/os_config_init.o utils/list.o utils/base_encoding.o utils/bitstream.o utils/color.o utils/configfile.o utils/cache.o utils/downloader.o utils/error.o utils/math.o utils/path2d.o utils/path2d_stroker.o utils/module.o utils/token.o utils/uni_bidi.o utils/url.o utils/utf.o utils/xml_parser.o utils/alloc.o utils/ringbuffer.o utils/unicode.o utils/sha1.o
## libgpac objects gathering: src/ietf
+LIBGPAC_IETF=
+ifeq ($(DISABLE_STREAMING), no)
LIBGPAC_IETF=ietf/rtcp.o ietf/rtp.o ietf/rtp_packetizer.o ietf/rtp_pck_3gpp.o ietf/rtp_pck_mpeg12.o ietf/rtp_pck_mpeg4.o ietf/rtsp_command.o ietf/rtsp_common.o ietf/rtsp_response.o ietf/rtsp_session.o ietf/sdp.o ietf/rtp_depacketizer.o ietf/rtp_streamer.o
+endif
## libgpac objects gathering: src/bifs
+LIBGPAC_BIFS=
+ifeq ($(DISABLE_BIFS), no)
LIBGPAC_BIFS=bifs/arith_decoder.o bifs/bifs_codec.o bifs/bifs_node_tables.o bifs/com_dec.o bifs/com_enc.o bifs/conditional.o bifs/field_decode.o bifs/field_encode.o bifs/memory_decoder.o bifs/predictive_mffield.o bifs/quantize.o bifs/script_dec.o bifs/script_enc.o bifs/unquantize.o
+endif
## libgpac objects gathering: src/isomedia
-LIBGPAC_ISOM=isomedia/avc_ext.o isomedia/box_code_3gpp.o isomedia/box_code_apple.o isomedia/box_code_base.o isomedia/box_code_isma.o isomedia/box_code_meta.o isomedia/box_dump.o isomedia/box_funcs.o isomedia/data_map.o isomedia/hint_track.o isomedia/hinting.o isomedia/isma_sample.o isomedia/isom_intern.o isomedia/isom_read.o isomedia/isom_store.o isomedia/isom_write.o isomedia/media.o isomedia/media_odf.o isomedia/meta.o isomedia/movie_fragments.o isomedia/sample_descs.o isomedia/stbl_read.o isomedia/stbl_write.o isomedia/track.o isomedia/tx3g.o
+LIBGPAC_ISOM=isomedia/avc_ext.o isomedia/box_code_3gpp.o isomedia/box_code_apple.o isomedia/box_code_base.o isomedia/box_code_isma.o isomedia/box_code_meta.o isomedia/box_dump.o isomedia/box_funcs.o isomedia/data_map.o isomedia/isma_sample.o isomedia/isom_intern.o isomedia/isom_read.o isomedia/isom_store.o isomedia/isom_write.o isomedia/media.o isomedia/media_odf.o isomedia/meta.o isomedia/movie_fragments.o isomedia/sample_descs.o isomedia/stbl_read.o isomedia/stbl_write.o isomedia/track.o isomedia/tx3g.o
+ifeq ($(DISABLE_ISOFF_HINT), no)
+LIBGPAC_ISOM+=isomedia/hint_track.o isomedia/hinting.o
+endif
## libgpac objects gathering: src/odf
LIBGPAC_ODF=odf/desc_private.o odf/descriptors.o odf/ipmpx_code.o odf/ipmpx_dump.o odf/ipmpx_parse.o odf/oci_codec.o odf/odf_code.o odf/odf_codec.o odf/odf_command.o odf/odf_dump.o odf/odf_parse.o odf/qos.o odf/slc.o
LIBGPAC_SCENE=scenegraph/base_scenegraph.o scenegraph/mpeg4_animators.o scenegraph/commands.o scenegraph/mpeg4_nodes.o scenegraph/mpeg4_valuator.o scenegraph/vrml_interpolators.o scenegraph/vrml_proto.o scenegraph/vrml_route.o scenegraph/vrml_script.o scenegraph/vrml_smjs.o scenegraph/vrml_tools.o scenegraph/x3d_nodes.o scenegraph/svg_attributes.o scenegraph/svg_types.o scenegraph/svg_smjs.o scenegraph/smil_anim.o scenegraph/smil_timing.o scenegraph/svg_properties.o scenegraph/dom_events.o scenegraph/dom_smjs.o scenegraph/xbl_process.o scenegraph/xml_ns.o
## libgpac objects gathering: src/mcrypt
-LIBGPAC_MCRYPT=mcrypt/cbc.o mcrypt/cfb.o mcrypt/ctr.o mcrypt/des.o mcrypt/ecb.o mcrypt/g_crypt.o mcrypt/ncfb.o mcrypt/nofb.o mcrypt/ofb.o mcrypt/rijndael-128.o mcrypt/rijndael-192.o mcrypt/rijndael-256.o mcrypt/stream.o mcrypt/tripledes.o mcrypt/sha1.o
+LIBGPAC_MCRYPT=
+ifeq ($(DISABLE_MCRYPT), no)
+LIBGPAC_MCRYPT+=mcrypt/cbc.o mcrypt/cfb.o mcrypt/ctr.o mcrypt/des.o mcrypt/ecb.o mcrypt/g_crypt.o mcrypt/ncfb.o mcrypt/nofb.o mcrypt/ofb.o mcrypt/rijndael-128.o mcrypt/rijndael-192.o mcrypt/rijndael-256.o mcrypt/stream.o mcrypt/tripledes.o
+endif
## libgpac objects gathering: src/media tools
-LIBGPAC_MEDIATOOLS=media_tools/ait.o media_tools/av_parsers.o media_tools/avilib.o media_tools/dsmcc.o media_tools/dvb.o media_tools/filestreamer.o media_tools/gpac_ogg.o media_tools/img.o media_tools/ismacryp.o media_tools/isom_hinter.o media_tools/isom_tools.o media_tools/media_export.o media_tools/media_import.o media_tools/mpeg2_ps.o media_tools/text_import.o media_tools/saf.o media_tools/mpegts.o media_tools/dvb_mpe.o media_tools/reedsolomon.o media_tools/vobsub.o media_tools/m2ts_mux.o media_tools/m3u8.o media_tools/mpd.o
+LIBGPAC_MEDIATOOLS=media_tools/av_parsers.o media_tools/img.o media_tools/isom_tools.o media_tools/media_export.o media_tools/media_import.o media_tools/mpegts.o media_tools/m2ts_mux.o media_tools/m3u8.o media_tools/mpd.o
+ifeq ($(DISABLE_STREAMING), no)
+LIBGPAC_MEDIATOOLS+=media_tools/filestreamer.o
+endif
+ifeq ($(DISABLE_DVBX), no)
+LIBGPAC_MEDIATOOLS+=media_tools/ait.o media_tools/dsmcc.o media_tools/dvb_mpe.o media_tools/reedsolomon.o
+endif
+ifeq ($(DISABLE_AVILIB), no)
+LIBGPAC_MEDIATOOLS+=media_tools/avilib.o
+endif
+ifeq ($(DISABLE_M2PS), no)
+LIBGPAC_MEDIATOOLS+=media_tools/mpeg2_ps.o
+endif
+ifeq ($(DISABLE_OGG), no)
+LIBGPAC_MEDIATOOLS+=media_tools/gpac_ogg.o
+endif
+ifeq ($(DISABLE_MCRYPT), no)
+LIBGPAC_MEDIATOOLS+=media_tools/ismacryp.o
+endif
+ifeq ($(DISABLE_ISOFF_HINT), no)
+LIBGPAC_MEDIATOOLS+=media_tools/isom_hinter.o
+endif
+ifeq ($(DISABLE_SAF), no)
+LIBGPAC_MEDIATOOLS+=media_tools/saf.o
+endif
+ifeq ($(DISABLE_VOBSUB), no)
+LIBGPAC_MEDIATOOLS+=media_tools/vobsub.o
+endif
+ifeq ($(DISABLE_TTXT), no)
+LIBGPAC_MEDIATOOLS+=media_tools/text_import.o
+endif
+
## libgpac objects gathering: src/scene_manager
-LIBGPAC_SCENEMANAGER=scene_manager/loader_bt.o scene_manager/loader_isom.o scene_manager/loader_qt.o scene_manager/loader_xmt.o scene_manager/scene_dump.o scene_manager/scene_manager.o scene_manager/scene_stats.o scene_manager/swf_parse.o scene_manager/swf_bifs.o scene_manager/text_to_bifs.o scene_manager/scene_engine.o scene_manager/encode_isom.o scene_manager/loader_svg.o
+LIBGPAC_SCENEMANAGER=
+ifeq ($(DISABLE_SMGR), no)
+LIBGPAC_SCENEMANAGER+=scene_manager/scene_manager.o
+endif
+ifeq ($(DISABLE_LOADER_BT), no)
+LIBGPAC_SCENEMANAGER+=scene_manager/loader_bt.o scene_manager/text_to_bifs.o
+endif
+ifeq ($(DISABLE_LOADER_XMT), no)
+LIBGPAC_SCENEMANAGER+=scene_manager/loader_xmt.o
+endif
+ifeq ($(DISABLE_LOADER_ISOFF), no)
+LIBGPAC_SCENEMANAGER+=scene_manager/loader_isom.o
+endif
+ifeq ($(DISABLE_LOADER_QTVR), no)
+LIBGPAC_SCENEMANAGER+=scene_manager/loader_qt.o
+endif
+ifeq ($(DISABLE_SVG), no)
+LIBGPAC_SCENEMANAGER+=scene_manager/loader_svg.o
+endif
+ifeq ($(DISABLE_LOADER_SWF), no)
+LIBGPAC_SCENEMANAGER+=scene_manager/swf_parse.o scene_manager/swf_bifs.o
+endif
+ifeq ($(DISABLE_SCENE_DUMP), no)
+LIBGPAC_SCENEMANAGER+=scene_manager/scene_dump.o
+endif
+ifeq ($(DISABLE_SCENE_STATS), no)
+LIBGPAC_SCENEMANAGER+=scene_manager/scene_stats.o
+endif
+ifeq ($(DISABLE_SENG), no)
+LIBGPAC_SCENEMANAGER+=scene_manager/scene_engine.o
+endif
+ifeq ($(DISABLE_SCENE_ENCODE), no)
+LIBGPAC_SCENEMANAGER+=scene_manager/encode_isom.o
+endif
## libgpac objects gathering: src/terminal
LIBGPAC_TERMINAL=terminal/channel.o terminal/clock.o terminal/decoder.o terminal/term_node_init.o terminal/input_sensor.o terminal/media_control.o terminal/media_manager.o terminal/media_memory.o terminal/media_object.o terminal/media_sensor.o terminal/mpeg4_inline.o terminal/network_service.o terminal/object_browser.o terminal/object_manager.o terminal/scene.o terminal/terminal.o terminal/svg_external.o
## libgpac objects gathering: src/compositor
LIBGPAC_COMPOSITOR=compositor/audio_input.o compositor/audio_mixer.o compositor/audio_render.o compositor/bindable.o compositor/camera.o compositor/compositor.o compositor/compositor_2d.o compositor/compositor_3d.o compositor/compositor_node_init.o compositor/drawable.o compositor/events.o compositor/font_engine.o compositor/hc_flash_shape.o compositor/hardcoded_protos.o compositor/mesh.o compositor/mesh_collide.o compositor/mesh_tesselate.o compositor/mpeg4_animstream.o compositor/mpeg4_audio.o compositor/mpeg4_background.o compositor/mpeg4_background2d.o compositor/mpeg4_bitmap.o compositor/mpeg4_composite.o compositor/mpeg4_form.o compositor/mpeg4_geometry_2d.o compositor/mpeg4_geometry_3d.o compositor/mpeg4_geometry_ifs2d.o compositor/mpeg4_geometry_ils2d.o compositor/mpeg4_gradients.o compositor/mpeg4_grouping.o compositor/mpeg4_grouping_2d.o compositor/mpeg4_grouping_3d.o compositor/mpeg4_layer_2d.o compositor/mpeg4_layer_3d.o compositor/mpeg4_layout.o compositor/mpeg4_lighting.o compositor/mpeg4_path_layout.o compositor/mpeg4_sensors.o compositor/mpeg4_sound.o compositor/mpeg4_text.o compositor/mpeg4_textures.o compositor/mpeg4_timesensor.o compositor/mpeg4_viewport.o compositor/navigate.o compositor/offscreen_cache.o compositor/svg_base.o compositor/svg_filters.o compositor/svg_font.o compositor/svg_geometry.o compositor/svg_grouping.o compositor/svg_media.o compositor/svg_paint_servers.o compositor/svg_text.o compositor/texturing.o compositor/texturing_gl.o compositor/visual_manager.o compositor/visual_manager_2d.o compositor/visual_manager_2d_draw.o compositor/visual_manager_3d.o compositor/visual_manager_3d_gl.o compositor/x3d_geometry.o
+ifeq ($(DISABLE_PLAYER), yes)
+LIBGPAC_COMPOSITOR=
+LIBGPAC_TERMINAL=
+endif
+ifeq ($(DISABLE_SCENEGRAPH), yes)
+LIBGPAC_SCENE=
+endif
+
+
+
## libgpac objects gathering: src/laser
LIBGPAC_LASER=
-ifeq ($(DISABLE_SVG), no)
+ifeq ($(DISABLE_LASER), no)
LIBGPAC_LASER=laser/lsr_enc.o laser/lsr_dec.o laser/lsr_tables.o
endif
## libgpac compositor compilation options
COMPOSITOR_CFLAGS=
-## SVG disabled
-ifeq ($(DISABLE_SVG), yes)
-COMPOSITOR_CFLAGS+=-DGPAC_DISABLE_SVG
-endif
## Add prefix before every lib
ifneq ($(prefix), /usr/local)
/*
DO NOT MOFIFY - File generated on GMT Tue Nov 08 09:10:57 2011
- BY MPEG4Gen for GPAC Version 0.4.6-DEV
+ BY MPEG4Gen for GPAC Version 0.5.0
*/
#include <gpac/internal/terminal_dev.h>
#include <gpac/options.h>
#include <gpac/utf.h>
+#include <gpac/modules/hardcoded_proto.h>
#include "nodes_stacks.h"
{
GF_Err e;
GF_Compositor *tmp;
-
GF_SAFEALLOC(tmp, GF_Compositor);
if (!tmp){
tmp->user = user;
tmp->term = term;
tmp->mx = gf_mx_new("Compositor");
-
+
+ /*load proto modules*/
+ if (user) {
+ u32 i;
+ tmp->proto_modules = gf_list_new();
+ for (i=0; i< gf_modules_get_count(user->modules); i++) {
+ GF_HardcodedProto *ifce = (GF_HardcodedProto *) gf_modules_load_interface(user->modules, i, GF_HARDCODED_PROTO_INTERFACE);
+ if (ifce) gf_list_add(tmp->proto_modules, ifce);
+ }
+ }
+
if (self_threaded) {
if (compositor->audio_renderer) gf_sc_ar_del(compositor->audio_renderer);
compositor->audio_renderer = NULL;
+ /*unload proto modules*/
+ if (compositor->proto_modules) {
+ u32 i;
+ for (i=0; i< gf_list_count(compositor->proto_modules); i++) {
+ GF_HardcodedProto *ifce = gf_list_get(compositor->proto_modules, i);
+ gf_modules_close_interface((GF_BaseInterface *) ifce);
+ }
+ gf_list_del(compositor->proto_modules);
+ }
#ifdef GF_SR_EVENT_QUEUE
gf_mx_p(compositor->ev_mx);
while (gf_list_count(compositor->events)) {
SVG_Length *w, *h;
SVG_ViewBox *vb;
Bool is_svg = 0;
-#endif
- const char *opt;
u32 tag;
GF_Node *top_node;
+#endif
+ const char *opt;
Bool had_size_info = compositor->has_size_info;
/*get pixel size if any*/
gf_sg_get_scene_size_info(compositor->scene, &width, &height);
/*default back color is black*/
if (! (compositor->user->init_flags & GF_TERM_WINDOWLESS)) compositor->back_color = 0xFF000000;
+#ifndef GPAC_DISABLE_SVG
top_node = gf_sg_get_root_node(compositor->scene);
tag = 0;
if (top_node) tag = gf_node_get_tag(top_node);
-#ifndef GPAC_DISABLE_SVG
w = h = NULL;
vb = NULL;
if ((tag>=GF_NODE_RANGE_FIRST_SVG) && (tag<=GF_NODE_RANGE_LAST_SVG)) {
static void gf_sc_setup_root_visual(GF_Compositor *compositor, GF_Node *top_node)
{
if (top_node && !compositor->root_visual_setup) {
- Bool force_navigate=0;
GF_SceneGraph *scene = compositor->scene;
u32 node_tag;
#ifndef GPAC_DISABLE_3D
+ Bool force_navigate=0;
Bool was_3d = compositor->visual->type_3d;
#endif
compositor->root_visual_setup = 1;
#include "offscreen_cache.h"
#include "mpeg4_grouping.h"
+#include <gpac/modules/hardcoded_proto.h>
+#include <gpac/internal/terminal_dev.h>
+
#ifndef GPAC_DISABLE_VRML
#ifndef GPAC_DISABLE_3D
{
MFURL *proto_url;
GF_Proto *proto;
- u32 i;
+ u32 i, j;
+ GF_HardcodedProto *ifce;
proto = gf_node_get_proto(node);
if (!proto) return;
compositor_init_hc_flashshape(compositor, node);
return;
}
+
+ /*check proto modules*/
+ if (compositor->proto_modules) {
+ j = 0;
+ while ( (ifce = (GF_HardcodedProto *)gf_list_enum(compositor->proto_modules, &j) )) {
+ if ( ifce->can_load_proto(url) && ifce->init(compositor, node) ) {
+ return;
+ }
+ }
+ }
}
}
GF_TraverseState *tr_state;
tr_state = (GF_TraverseState *)rs;
children = NULL;
- /* souchay : be sure to be initialized, -1 seems reasonable since we check if (whichChoice>=0) */
+
whichChoice = -1;
if (is_destroy) {
gf_sc_check_focus_upon_destroy(node);
#ifndef GPAC_DISABLE_3D
SFVec3f start, end;
Fixed scale;
+ ViewStack *st = (ViewStack *) gf_node_get_private(node);
#endif
GF_TraverseState *tr_state = (GF_TraverseState *)rs;
M_NavigationInfo *ni = (M_NavigationInfo *) node;
- ViewStack *st = (ViewStack *) gf_node_get_private(node);
if (is_destroy) {
DestroyViewStack(node);
#pragma comment (linker, EXPORT_SYMBOL(gf_gz_compress_payload) )
#pragma comment (linker, EXPORT_SYMBOL(gf_gz_decompress_payload) )
-/* Font */
-#pragma comment (linker, EXPORT_SYMBOL(gf_font_manager_new) )
-
/* Memory */
#ifdef GPAC_MEMORY_TRACKING
#pragma comment (linker, EXPORT_SYMBOL(gf_mem_malloc) )
/*plugin_network.h exports*/
+#ifndef GPAC_DISABLE_PLAYER
#pragma comment (linker, EXPORT_SYMBOL(gf_term_on_message) )
#pragma comment (linker, EXPORT_SYMBOL(gf_term_on_connect) )
#pragma comment (linker, EXPORT_SYMBOL(gf_term_on_disconnect) )
#pragma comment (linker, EXPORT_SYMBOL(gf_term_remove_event_filter) )
#pragma comment (linker, EXPORT_SYMBOL(gf_term_lock_media_queue) )
#pragma comment (linker, EXPORT_SYMBOL(gf_term_get_current_service_id) )
-
+#endif
/*ietf.h exports*/
#ifndef GPAC_DISABLE_STREAMING
#pragma comment (linker, EXPORT_SYMBOL(gf_ismacryp_decrypt_file) )
#pragma comment (linker, EXPORT_SYMBOL(gf_ismacryp_encrypt_track) )
#pragma comment (linker, EXPORT_SYMBOL(gf_ismacryp_decrypt_track) )
-#endif
-
#pragma comment (linker, EXPORT_SYMBOL(gf_ismacryp_gpac_get_info) )
#pragma comment (linker, EXPORT_SYMBOL(gf_ismacryp_mpeg4ip_get_info) )
-
+
+#endif
+
/*scene_manager.h exports*/
+
#ifndef GPAC_DISABLE_SCENE_STATS
#pragma comment (linker, EXPORT_SYMBOL(gf_sm_stats_new) )
#pragma comment (linker, EXPORT_SYMBOL(gf_sm_stats_del) )
#pragma comment (linker, EXPORT_SYMBOL(gf_sm_stats_for_command) )
#endif
+#ifndef GPAC_DISABLE_SMGR
#pragma comment (linker, EXPORT_SYMBOL(gf_sm_new) )
#pragma comment (linker, EXPORT_SYMBOL(gf_sm_del) )
#pragma comment (linker, EXPORT_SYMBOL(gf_sm_stream_new) )
#pragma comment (linker, EXPORT_SYMBOL(gf_sm_load_run) )
#pragma comment (linker, EXPORT_SYMBOL(gf_sm_load_suspend) )
#pragma comment (linker, EXPORT_SYMBOL(gf_sm_import_bifs_subtitle) )
+#endif
+
#ifndef GPAC_DISABLE_LOADER_BT
#pragma comment (linker, EXPORT_SYMBOL(gf_sm_load_bt_from_string) )
#endif
#endif
#endif /*GPAC_DISABLE_BIFS*/
+#if !defined(GPAC_DISABLE_VRML) && !defined(GPAC_DISABLE_X3D) && !defined(GPAC_DISABLE_SVG)
/*scenegraph.h exports*/
#pragma comment (linker, EXPORT_SYMBOL(gf_node_get_tag) )
#pragma comment (linker, EXPORT_SYMBOL(gf_node_dump_attribute) )
+
#ifndef GPAC_DISABLE_SVG
#pragma comment (linker, EXPORT_SYMBOL(gf_node_dom_listener_add) )
#pragma comment (linker, EXPORT_SYMBOL(gf_dom_event_type_by_name) )
#endif /*GPAC_DISABLE_VRML*/
+#endif //!defined(GPAC_DISABLE_VRML) && !defined(GPAC_DISABLE_X3D) && !defined(GPAC_DISABLE_SVG)
+
+#ifndef GPAC_DISABLE_PLAYER
/*terminal.h exports*/
#pragma comment (linker, EXPORT_SYMBOL(gf_term_new) )
#pragma comment (linker, EXPORT_SYMBOL(gf_term_del) )
#pragma comment (linker, EXPORT_SYMBOL(gf_term_lock_compositor) )
#pragma comment (linker, EXPORT_SYMBOL(gf_term_switch_quality) )
+/*terminal_dev exports*/
+#pragma comment (linker, EXPORT_SYMBOL(gf_scene_new) )
+#pragma comment (linker, EXPORT_SYMBOL(gf_scene_del) )
+#pragma comment (linker, EXPORT_SYMBOL(gf_scene_get_time) )
+#pragma comment (linker, EXPORT_SYMBOL(gf_scene_attach_to_compositor) )
+#pragma comment (linker, EXPORT_SYMBOL(gf_scene_find_odm) )
+#pragma comment (linker, EXPORT_SYMBOL(gf_scene_set_duration) )
+#pragma comment (linker, EXPORT_SYMBOL(gf_scene_setup_object) )
+#pragma comment (linker, EXPORT_SYMBOL(gf_scene_register_extra_graph) )
+#pragma comment (linker, EXPORT_SYMBOL(gf_scene_force_size) )
+#pragma comment (linker, EXPORT_SYMBOL(gf_scene_process_anchor) )
+#pragma comment (linker, EXPORT_SYMBOL(gf_scene_disconnect) )
+#pragma comment (linker, EXPORT_SYMBOL(gf_odm_new) )
+#pragma comment (linker, EXPORT_SYMBOL(gf_odm_setup_object) )
+#pragma comment (linker, EXPORT_SYMBOL(gf_odm_disconnect) )
+#pragma comment (linker, EXPORT_SYMBOL(gf_odm_setup_es) )
+#pragma comment (linker, EXPORT_SYMBOL(gf_odm_remove_es) )
+#pragma comment (linker, EXPORT_SYMBOL(gf_term_node_callback) )
+#pragma comment (linker, EXPORT_SYMBOL(gf_term_message) )
+#pragma comment (linker, EXPORT_SYMBOL(gf_clock_time) )
+#endif
+
+#ifndef GPAC_DISABLE_PLAYER
/*compositor.h exports*/
#pragma comment (linker, EXPORT_SYMBOL(gf_sc_new) )
#pragma comment (linker, EXPORT_SYMBOL(gf_sc_del) )
#pragma comment (linker, EXPORT_SYMBOL(gf_sc_audio_stop) )
#pragma comment (linker, EXPORT_SYMBOL(gf_sc_audio_restart) )
-/*terminal_dev exports*/
-#pragma comment (linker, EXPORT_SYMBOL(gf_scene_new) )
-#pragma comment (linker, EXPORT_SYMBOL(gf_scene_del) )
-#pragma comment (linker, EXPORT_SYMBOL(gf_scene_get_time) )
-#pragma comment (linker, EXPORT_SYMBOL(gf_scene_attach_to_compositor) )
-#pragma comment (linker, EXPORT_SYMBOL(gf_scene_find_odm) )
-#pragma comment (linker, EXPORT_SYMBOL(gf_scene_set_duration) )
-#pragma comment (linker, EXPORT_SYMBOL(gf_scene_setup_object) )
-#pragma comment (linker, EXPORT_SYMBOL(gf_scene_register_extra_graph) )
-#pragma comment (linker, EXPORT_SYMBOL(gf_scene_force_size) )
-#pragma comment (linker, EXPORT_SYMBOL(gf_scene_process_anchor) )
-#pragma comment (linker, EXPORT_SYMBOL(gf_scene_disconnect) )
-#pragma comment (linker, EXPORT_SYMBOL(gf_odm_new) )
-#pragma comment (linker, EXPORT_SYMBOL(gf_odm_setup_object) )
-#pragma comment (linker, EXPORT_SYMBOL(gf_odm_disconnect) )
-#pragma comment (linker, EXPORT_SYMBOL(gf_odm_setup_es) )
-#pragma comment (linker, EXPORT_SYMBOL(gf_odm_remove_es) )
-#pragma comment (linker, EXPORT_SYMBOL(gf_term_node_callback) )
-#pragma comment (linker, EXPORT_SYMBOL(gf_term_message) )
-#pragma comment (linker, EXPORT_SYMBOL(gf_clock_time) )
+#pragma comment (linker, EXPORT_SYMBOL(gf_font_manager_new) )
+#pragma comment (linker, EXPORT_SYMBOL(gf_font_manager_set_font) )
+#pragma comment (linker, EXPORT_SYMBOL(gf_font_manager_create_span) )
+#pragma comment (linker, EXPORT_SYMBOL(gf_font_manager_refresh_span_bounds) )
+
+#endif
/*mpegts.h exports*/
#ifndef GPAC_DISABLE_MPEG2TS
#pragma comment (linker, EXPORT_SYMBOL(gf_m2ts_crc32_check) )
/* carousel.h */
+#ifndef GPAC_DISABLE_DSMCC
#pragma comment (linker, EXPORT_SYMBOL(gf_m2ts_get_channel_application_info) )
#pragma comment (linker, EXPORT_SYMBOL(gf_m2ts_process_dsmcc) )
#pragma comment (linker, EXPORT_SYMBOL(gf_m2ts_init_dsmcc_overlord) )
#pragma comment (linker, EXPORT_SYMBOL(gf_m2ts_get_dmscc_overlord) )
#pragma comment (linker, EXPORT_SYMBOL(gf_m2ts_demux_dmscc_init) )
-
+#endif
#ifndef GPAC_DISABLE_MPEG2TS_MUX
#pragma comment (linker, EXPORT_SYMBOL(gf_laser_encoder_get_rap) )
#endif /*GPAC_DISABLE_LASER*/
-#pragma comment (linker, EXPORT_SYMBOL(gf_font_manager_new) )
-#pragma comment (linker, EXPORT_SYMBOL(gf_font_manager_set_font) )
-#pragma comment (linker, EXPORT_SYMBOL(gf_font_manager_create_span) )
-#pragma comment (linker, EXPORT_SYMBOL(gf_font_manager_refresh_span_bounds) )
-
/*download.h exports*/
#pragma comment (linker, EXPORT_SYMBOL(gf_dm_wget) )
#pragma comment (linker, EXPORT_SYMBOL(gf_dm_wget_with_cache) )
/*
DO NOT MOFIFY - File generated on GMT Tue May 15 11:18:46 2007
- BY SVGGen for GPAC Version 0.4.3-DEV
+ BY SVGGen for GPAC Version 0.5.0
*/
+++ /dev/null
-/*
- * FIPS-180-1 compliant SHA-1 implementation
- *
- * Copyright (C) 2003-2006 Christophe Devine
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License, version 2.1 as published by the Free Software Foundation.
- *
- * This library 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; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301 USA
- */
-/*
- * The SHA-1 standard was published by NIST in 1993.
- *
- * http://www.itl.nist.gov/fipspubs/fip180-1.htm
- */
-
-#ifndef _CRT_SECURE_NO_DEPRECATE
-#define _CRT_SECURE_NO_DEPRECATE 1
-#endif
-
-#include <gpac/crypt.h>
-
-/*
- * 32-bit integer manipulation macros (big endian)
- */
-#ifndef GET_UINT32_BE
-#define GET_UINT32_BE(n,b,i) \
-{ \
- (n) = ( (u32) (b)[(i) ] << 24 ) \
- | ( (u32) (b)[(i) + 1] << 16 ) \
- | ( (u32) (b)[(i) + 2] << 8 ) \
- | ( (u32) (b)[(i) + 3] ); \
-}
-#endif
-#ifndef PUT_UINT32_BE
-#define PUT_UINT32_BE(n,b,i) \
-{ \
- (b)[(i) ] = (u8) ( (n) >> 24 ); \
- (b)[(i) + 1] = (u8) ( (n) >> 16 ); \
- (b)[(i) + 2] = (u8) ( (n) >> 8 ); \
- (b)[(i) + 3] = (u8) ( (n) ); \
-}
-#endif
-
-/*
- * SHA-1 context setup
- */
-void gf_sha1_starts(GF_SHA1Context *ctx )
-{
- ctx->total[0] = 0;
- ctx->total[1] = 0;
-
- ctx->state[0] = 0x67452301;
- ctx->state[1] = 0xEFCDAB89;
- ctx->state[2] = 0x98BADCFE;
- ctx->state[3] = 0x10325476;
- ctx->state[4] = 0xC3D2E1F0;
-}
-
-static void sha1_process(GF_SHA1Context *ctx, u8 data[64] )
-{
- u32 temp, W[16], A, B, C, D, E;
-
- GET_UINT32_BE( W[0], data, 0 );
- GET_UINT32_BE( W[1], data, 4 );
- GET_UINT32_BE( W[2], data, 8 );
- GET_UINT32_BE( W[3], data, 12 );
- GET_UINT32_BE( W[4], data, 16 );
- GET_UINT32_BE( W[5], data, 20 );
- GET_UINT32_BE( W[6], data, 24 );
- GET_UINT32_BE( W[7], data, 28 );
- GET_UINT32_BE( W[8], data, 32 );
- GET_UINT32_BE( W[9], data, 36 );
- GET_UINT32_BE( W[10], data, 40 );
- GET_UINT32_BE( W[11], data, 44 );
- GET_UINT32_BE( W[12], data, 48 );
- GET_UINT32_BE( W[13], data, 52 );
- GET_UINT32_BE( W[14], data, 56 );
- GET_UINT32_BE( W[15], data, 60 );
-
-#define S(x,n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n)))
-
-#define R(t) \
-( \
- temp = W[(t - 3) & 0x0F] ^ W[(t - 8) & 0x0F] ^ \
- W[(t - 14) & 0x0F] ^ W[ t & 0x0F], \
- ( W[t & 0x0F] = S(temp,1) ) \
-)
-
-#define P(a,b,c,d,e,x) \
-{ \
- e += S(a,5) + F(b,c,d) + K + x; b = S(b,30); \
-}
-
- A = ctx->state[0];
- B = ctx->state[1];
- C = ctx->state[2];
- D = ctx->state[3];
- E = ctx->state[4];
-
-#define F(x,y,z) (z ^ (x & (y ^ z)))
-#define K 0x5A827999
-
- P( A, B, C, D, E, W[0] );
- P( E, A, B, C, D, W[1] );
- P( D, E, A, B, C, W[2] );
- P( C, D, E, A, B, W[3] );
- P( B, C, D, E, A, W[4] );
- P( A, B, C, D, E, W[5] );
- P( E, A, B, C, D, W[6] );
- P( D, E, A, B, C, W[7] );
- P( C, D, E, A, B, W[8] );
- P( B, C, D, E, A, W[9] );
- P( A, B, C, D, E, W[10] );
- P( E, A, B, C, D, W[11] );
- P( D, E, A, B, C, W[12] );
- P( C, D, E, A, B, W[13] );
- P( B, C, D, E, A, W[14] );
- P( A, B, C, D, E, W[15] );
- P( E, A, B, C, D, R(16) );
- P( D, E, A, B, C, R(17) );
- P( C, D, E, A, B, R(18) );
- P( B, C, D, E, A, R(19) );
-
-#undef K
-#undef F
-
-#define F(x,y,z) (x ^ y ^ z)
-#define K 0x6ED9EBA1
-
- P( A, B, C, D, E, R(20) );
- P( E, A, B, C, D, R(21) );
- P( D, E, A, B, C, R(22) );
- P( C, D, E, A, B, R(23) );
- P( B, C, D, E, A, R(24) );
- P( A, B, C, D, E, R(25) );
- P( E, A, B, C, D, R(26) );
- P( D, E, A, B, C, R(27) );
- P( C, D, E, A, B, R(28) );
- P( B, C, D, E, A, R(29) );
- P( A, B, C, D, E, R(30) );
- P( E, A, B, C, D, R(31) );
- P( D, E, A, B, C, R(32) );
- P( C, D, E, A, B, R(33) );
- P( B, C, D, E, A, R(34) );
- P( A, B, C, D, E, R(35) );
- P( E, A, B, C, D, R(36) );
- P( D, E, A, B, C, R(37) );
- P( C, D, E, A, B, R(38) );
- P( B, C, D, E, A, R(39) );
-
-#undef K
-#undef F
-
-#define F(x,y,z) ((x & y) | (z & (x | y)))
-#define K 0x8F1BBCDC
-
- P( A, B, C, D, E, R(40) );
- P( E, A, B, C, D, R(41) );
- P( D, E, A, B, C, R(42) );
- P( C, D, E, A, B, R(43) );
- P( B, C, D, E, A, R(44) );
- P( A, B, C, D, E, R(45) );
- P( E, A, B, C, D, R(46) );
- P( D, E, A, B, C, R(47) );
- P( C, D, E, A, B, R(48) );
- P( B, C, D, E, A, R(49) );
- P( A, B, C, D, E, R(50) );
- P( E, A, B, C, D, R(51) );
- P( D, E, A, B, C, R(52) );
- P( C, D, E, A, B, R(53) );
- P( B, C, D, E, A, R(54) );
- P( A, B, C, D, E, R(55) );
- P( E, A, B, C, D, R(56) );
- P( D, E, A, B, C, R(57) );
- P( C, D, E, A, B, R(58) );
- P( B, C, D, E, A, R(59) );
-
-#undef K
-#undef F
-
-#define F(x,y,z) (x ^ y ^ z)
-#define K 0xCA62C1D6
-
- P( A, B, C, D, E, R(60) );
- P( E, A, B, C, D, R(61) );
- P( D, E, A, B, C, R(62) );
- P( C, D, E, A, B, R(63) );
- P( B, C, D, E, A, R(64) );
- P( A, B, C, D, E, R(65) );
- P( E, A, B, C, D, R(66) );
- P( D, E, A, B, C, R(67) );
- P( C, D, E, A, B, R(68) );
- P( B, C, D, E, A, R(69) );
- P( A, B, C, D, E, R(70) );
- P( E, A, B, C, D, R(71) );
- P( D, E, A, B, C, R(72) );
- P( C, D, E, A, B, R(73) );
- P( B, C, D, E, A, R(74) );
- P( A, B, C, D, E, R(75) );
- P( E, A, B, C, D, R(76) );
- P( D, E, A, B, C, R(77) );
- P( C, D, E, A, B, R(78) );
- P( B, C, D, E, A, R(79) );
-
-#undef K
-#undef F
-
- ctx->state[0] += A;
- ctx->state[1] += B;
- ctx->state[2] += C;
- ctx->state[3] += D;
- ctx->state[4] += E;
-}
-
-/*
- * SHA-1 process buffer
- */
-void gf_sha1_update(GF_SHA1Context *ctx, u8 *input, u32 ilen )
-{
- s32 fill;
- u32 left;
-
- if( ilen <= 0 )
- return;
-
- left = ctx->total[0] & 0x3F;
- fill = 64 - left;
-
- ctx->total[0] += ilen;
- ctx->total[0] &= 0xFFFFFFFF;
-
- if( ctx->total[0] < (u32) ilen )
- ctx->total[1]++;
-
- if( left && (s32) ilen >= fill )
- {
- memcpy( (void *) (ctx->buffer + left),
- (void *) input, fill );
- sha1_process( ctx, ctx->buffer );
- input += fill;
- ilen -= fill;
- left = 0;
- }
-
- while( ilen >= 64 )
- {
- sha1_process( ctx, input );
- input += 64;
- ilen -= 64;
- }
-
- if( ilen > 0 )
- {
- memcpy( (void *) (ctx->buffer + left),
- (void *) input, ilen );
- }
-}
-
-static const u8 sha1_padding[64] =
-{
- 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-/*
- * SHA-1 final digest
- */
-void gf_sha1_finish(GF_SHA1Context *ctx, u8 output[20] )
-{
- u32 last, padn;
- u32 high, low;
- u8 msglen[8];
-
- high = ( ctx->total[0] >> 29 )
- | ( ctx->total[1] << 3 );
- low = ( ctx->total[0] << 3 );
-
- PUT_UINT32_BE( high, msglen, 0 );
- PUT_UINT32_BE( low, msglen, 4 );
-
- last = ctx->total[0] & 0x3F;
- padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last );
-
- gf_sha1_update( ctx, (u8 *) sha1_padding, padn );
- gf_sha1_update( ctx, msglen, 8 );
-
- PUT_UINT32_BE( ctx->state[0], output, 0 );
- PUT_UINT32_BE( ctx->state[1], output, 4 );
- PUT_UINT32_BE( ctx->state[2], output, 8 );
- PUT_UINT32_BE( ctx->state[3], output, 12 );
- PUT_UINT32_BE( ctx->state[4], output, 16 );
-}
-
-/*
- * Output = SHA-1( file contents )
- */
-GF_EXPORT
-s32 gf_sha1_file( const char *path, u8 output[20] )
-{
- FILE *f;
- size_t n;
- GF_SHA1Context ctx;
- u8 buf[1024];
-
- if( ( f = gf_f64_open( path, "rb" ) ) == NULL )
- return( 1 );
-
- gf_sha1_starts( &ctx );
-
- while( ( n = fread( buf, 1, sizeof( buf ), f ) ) > 0 )
- gf_sha1_update( &ctx, buf, (s32) n );
-
- gf_sha1_finish( &ctx, output );
-
- fclose( f );
- return( 0 );
-}
-
-/*
- * Output = SHA-1( input buffer )
- */
-void gf_sha1_csum( u8 *input, u32 ilen, u8 output[20] )
-{
- GF_SHA1Context ctx;
-
- gf_sha1_starts( &ctx );
- gf_sha1_update( &ctx, input, ilen );
- gf_sha1_finish( &ctx, output );
-}
-
-/*
- * Output = HMAC-SHA-1( input buffer, hmac key )
- */
-void gf_sha1_hmac( u8 *key, u32 keylen,
- u8 *input, u32 ilen,
- u8 output[20] )
-{
- s32 i;
- GF_SHA1Context ctx;
- u8 k_ipad[64];
- u8 k_opad[64];
- u8 tmpbuf[20];
-
- memset( k_ipad, 0x36, 64 );
- memset( k_opad, 0x5C, 64 );
-
- for( i = 0; i < (s32) keylen; i++ )
- {
- if( i >= 64 ) break;
-
- k_ipad[i] ^= key[i];
- k_opad[i] ^= key[i];
- }
-
- gf_sha1_starts( &ctx );
- gf_sha1_update( &ctx, k_ipad, 64 );
- gf_sha1_update( &ctx, input, ilen );
- gf_sha1_finish( &ctx, tmpbuf );
-
- gf_sha1_starts( &ctx );
- gf_sha1_update( &ctx, k_opad, 64 );
- gf_sha1_update( &ctx, tmpbuf, 20 );
- gf_sha1_finish( &ctx, output );
-
- memset( k_ipad, 0, 64 );
- memset( k_opad, 0, 64 );
- memset( tmpbuf, 0, 20 );
- memset( &ctx, 0, sizeof(GF_SHA1Context ) );
-}
-
*/
#include <gpac/internal/media_dev.h>
-#include <gpac/internal/ogg.h>
#include <gpac/constants.h>
#include <gpac/math.h>
+#ifndef GPAC_DISABLE_OGG
+#include <gpac/internal/ogg.h>
+#endif
GF_EXPORT
const char *gf_m4v_get_profile_name(u8 video_pl)
while (i < nal_size) {
/*ISO 14496-10: "Within the NAL unit, any four-byte sequence that starts with 0x000003
other than the following sequences shall not occur at any byte-aligned position:
- \96 0x00000300
- \96 0x00000301
- \96 0x00000302
- \96 0x00000303"
+ \96 0x00000300
+ \96 0x00000301
+ \96 0x00000302
+ \96 0x00000303"
*/
if (num_zero == 2 && buffer[i] < 0x04) {
/*emulation code found*/
{
/*ISO 14496-10: "Within the NAL unit, any four-byte sequence that starts with 0x000003
other than the following sequences shall not occur at any byte-aligned position:
- \96 0x00000300
- \96 0x00000301
- \96 0x00000302
- \96 0x00000303"
+ \96 0x00000300
+ \96 0x00000301
+ \96 0x00000302
+ \96 0x00000303"
*/
if (num_zero == 2
&& buffer[i] == 0x03
u8 separate_colour_plane_flag = gf_bs_read_int(bs, 1);
/*
Depending on the value of separate_colour_plane_flag, the value of the variable ChromaArrayType is assigned as follows.
- \96 If separate_colour_plane_flag is equal to 0, ChromaArrayType is set equal to chroma_format_idc.
- \96 Otherwise (separate_colour_plane_flag is equal to 1), ChromaArrayType is set equal to 0.
+ \96 If separate_colour_plane_flag is equal to 0, ChromaArrayType is set equal to chroma_format_idc.
+ \96 Otherwise (separate_colour_plane_flag is equal to 1), ChromaArrayType is set equal to 0.
*/
if (separate_colour_plane_flag) ChromaArrayType = 0;
}
return (written>1) ? written : 0;
}
+#ifndef GPAC_DISABLE_ISOM
+
static u8 avc_get_sar_idx(u32 w, u32 h)
{
u32 i;
return 0xFF;
}
-#ifndef GPAC_DISABLE_ISOM
GF_Err AVC_ChangePAR(GF_AVCConfig *avcc, s32 ar_n, s32 ar_d)
{
GF_BitStream *orig, *mod;
+++ /dev/null
-/*
- * GPAC - Multimedia Framework C SDK
- *
- * Copyright (c)2006-201X ENST - All rights reserved
- *
- * This file is part of GPAC / MPEG2-TS sub-project
- *
- * GPAC is gf_free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the gf_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 gf_free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-
-#include <gpac/tools.h>
-#include <time.h>
-
-
-/* decodes an Modified Julian Date (MJD) into a Co-ordinated Universal Time (UTC)
-See annex C of DVB-SI ETSI EN 300468 */
-void dvb_decode_mjd_date(u32 date, u16 *year, u8 *month, u8 *day)
-{
- u32 yp, mp, k;
- yp = (u32)((date - 15078.2)/365.25);
- mp = (u32)((date - 14956.1 - (u32)(yp * 365.25))/30.6001);
- *day = (u32)(date - 14956 - (u32)(yp * 365.25) - (u32)(mp * 30.6001));
- if (mp == 14 || mp == 15) k = 1;
- else k = 0;
- *year = yp + k + 1900;
- *month = mp - 1 - k*12;
- assert(*year>=1900 && *year<=2100 && *month && *month<=12 && *day && *day<=31);
-}
-
-#if 0 /*disabled since mktime doesn't exist on Windows Mobile*/
-/* decodes an Modified Julian Date (MJD) into a unix time (i.e. seconds since Jan 1st 1970) */
-void dvb_decode_mjd_to_unix_time(u8 *data, time_t *unix_time) {
- struct tm time;
- char tmp_time[10];
- u16 year = (u16)time.tm_year;
- u8 month = (u8) time.tm_mon;
- u8 day = (u8) time.tm_mday;
-
- memset(&time, 0, sizeof(struct tm));
- dvb_decode_mjd_date((data[0] << 8) | data[1], &year, &month, &day);
- time.tm_year = year - 1900;
- time.tm_mon = month-1; /* months are 0-based in time_t */
- time.tm_mday = day;
- time.tm_isdst = -1; /* we don't want to apply Daylight Saving Time */
-
- sprintf(tmp_time, "%02x", data[2]);
- time.tm_hour = atoi(tmp_time);
- sprintf(tmp_time, "%02x", data[3]);
- time.tm_min = atoi(tmp_time);
- sprintf(tmp_time, "%02x", data[4]);
- time.tm_sec = atoi(tmp_time);
- *unix_time = mktime(&time);
-}
-#endif
#include <gpac/crypt.h>
+#if !defined(GPAC_DISABLE_MCRYPT)
+
typedef struct
{
GF_List *tcis;
return 0;
}
-#if !defined(GPAC_DISABLE_MCRYPT) && !defined(GPAC_DISABLE_ISOM_WRITE)
+#ifndef GPAC_DISABLE_ISOM_WRITE
static GFINLINE void resync_IV(GF_Crypt *mc, u64 BSO, char *salt)
{
return e;
}
-#endif /*!defined(GPAC_DISABLE_MCRYPT) && !defined(GPAC_DISABLE_ISOM_WRITE)*/
-
-GF_EXPORT
-GF_Err gf_media_get_file_hash(const char *file, u8 hash[20])
-{
- u8 block[1024];
- u32 read;
- u64 size, tot;
- FILE *in;
- GF_SHA1Context ctx;
-#ifndef GPAC_DISABLE_ISOM
- GF_BitStream *bs = NULL;
- Bool is_isom = gf_isom_probe_file(file);
-#endif
-
- in = gf_f64_open(file, "rb");
- gf_f64_seek(in, 0, SEEK_END);
- size = gf_f64_tell(in);
- gf_f64_seek(in, 0, SEEK_SET);
-
- gf_sha1_starts(&ctx);
- tot = 0;
-#ifndef GPAC_DISABLE_ISOM
- if (is_isom) bs = gf_bs_from_file(in, GF_BITSTREAM_READ);
-#endif
-
- while (tot<size) {
-#ifndef GPAC_DISABLE_ISOM
- if (is_isom) {
- u64 box_size = gf_bs_peek_bits(bs, 32, 0);
- u32 box_type = gf_bs_peek_bits(bs, 32, 4);
-
- /*till end of file*/
- if (!box_size) box_size = size-tot;
- /*64-bit size*/
- else if (box_size==1) box_size = gf_bs_peek_bits(bs, 64, 8);
-
- /*skip all MutableDRMInformation*/
- if (box_type==GF_4CC('m','d','r','i')) {
- gf_bs_skip_bytes(bs, box_size);
- tot += box_size;
- } else {
- u32 bsize = 0;
- while (bsize<box_size) {
- u32 to_read = (u32) ((box_size-bsize<1024) ? (box_size-bsize) : 1024);
- gf_bs_read_data(bs, block, to_read);
- gf_sha1_update(&ctx, block, to_read);
- bsize += to_read;
- }
- tot += box_size;
- }
- } else
-#endif
- {
- read = fread(block, 1, 1024, in);
- gf_sha1_update(&ctx, block, read);
- tot += read;
- }
- }
- gf_sha1_finish(&ctx, hash);
-#ifndef GPAC_DISABLE_ISOM
- if (bs) gf_bs_del(bs);
-#endif
- fclose(in);
- return GF_OK;
-}
+#endif /* !defined(GPAC_DISABLE_ISOM_WRITE)*/
+#endif /* !defined(GPAC_DISABLE_MCRYPT)*/
#include <gpac/constants.h>
#include <gpac/config_file.h>
+
+GF_EXPORT
+GF_Err gf_media_get_file_hash(const char *file, u8 hash[20])
+{
+ u8 block[1024];
+ u32 read;
+ u64 size, tot;
+ FILE *in;
+ GF_SHA1Context *ctx;
+#ifndef GPAC_DISABLE_ISOM
+ GF_BitStream *bs = NULL;
+ Bool is_isom = gf_isom_probe_file(file);
+#endif
+
+ in = gf_f64_open(file, "rb");
+ gf_f64_seek(in, 0, SEEK_END);
+ size = gf_f64_tell(in);
+ gf_f64_seek(in, 0, SEEK_SET);
+
+ ctx = gf_sha1_starts();
+ tot = 0;
+#ifndef GPAC_DISABLE_ISOM
+ if (is_isom) bs = gf_bs_from_file(in, GF_BITSTREAM_READ);
+#endif
+
+ while (tot<size) {
+#ifndef GPAC_DISABLE_ISOM
+ if (is_isom) {
+ u64 box_size = gf_bs_peek_bits(bs, 32, 0);
+ u32 box_type = gf_bs_peek_bits(bs, 32, 4);
+
+ /*till end of file*/
+ if (!box_size) box_size = size-tot;
+ /*64-bit size*/
+ else if (box_size==1) box_size = gf_bs_peek_bits(bs, 64, 8);
+
+ /*skip all MutableDRMInformation*/
+ if (box_type==GF_4CC('m','d','r','i')) {
+ gf_bs_skip_bytes(bs, box_size);
+ tot += box_size;
+ } else {
+ u32 bsize = 0;
+ while (bsize<box_size) {
+ u32 to_read = (u32) ((box_size-bsize<1024) ? (box_size-bsize) : 1024);
+ gf_bs_read_data(bs, block, to_read);
+ gf_sha1_update(ctx, block, to_read);
+ bsize += to_read;
+ }
+ tot += box_size;
+ }
+ } else
+#endif
+ {
+ read = fread(block, 1, 1024, in);
+ gf_sha1_update(ctx, block, read);
+ tot += read;
+ }
+ }
+ gf_sha1_finish(ctx, hash);
+#ifndef GPAC_DISABLE_ISOM
+ if (bs) gf_bs_del(bs);
+#endif
+ fclose(in);
+ return GF_OK;
+}
+
#ifndef GPAC_DISABLE_ISOM
GF_Err gf_media_get_rfc_6381_codec_name(GF_ISOFile *movie, u32 track, char *szCodec)
/**
* GPAC - Multimedia Framework C SDK
*
-* Copyright (c) Jean Le Feuvre 2000-2005
+* Authors: Pierre Souchay, Jean Le Feuvre
+* Copyright (c) Telecom ParisTech 2010-2012
* All rights reserved
*
* This file is part of GPAC
* 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.
-* Written by Pierre Souchay for VizionR SAS
*
*/
#ifndef GPAC_DISABLE_MEDIA_EXPORT
+#ifndef GPAC_DISABLE_AVILIB
#include <gpac/internal/avilib.h>
+#endif
+
+#ifndef GPAC_DISABLE_OGG
#include <gpac/internal/ogg.h>
+#endif
+
+#ifndef GPAC_DISABLE_VOBSUB
#include <gpac/internal/vobsub.h>
+#endif
+
+
#include <zlib.h>
GF_Err gf_media_export_nhml(GF_MediaExporter *dumper, Bool dims_doc);
static GF_Err gf_dump_to_vobsub(GF_MediaExporter *dumper, char *szName, u32 track, char *dsi, u32 dsiSize)
{
+#ifndef GPAC_DISABLE_VOBSUB
FILE *fidx, *fsub;
u32 width, height, i, count, di;
GF_ISOSample *samp;
fclose(fidx);
return GF_OK;
+#else
+ return GF_NOT_SUPPORTED;
+#endif
}
/*QCP codec GUIDs*/
GF_Err gf_media_export_saf(GF_MediaExporter *dumper)
{
+#ifndef GPAC_DISABLE_SAF
u32 count, i, s_count, di, tot_samp, samp_done;
char out_file[GF_MAX_PATH];
GF_SAFMuxer *mux;
gf_saf_mux_del(mux);
return GF_OK;
+#else
+ return GF_NOT_SUPPORTED;
+#endif
}
#ifndef GPAC_DISABLE_MPEG2TS
#include <gpac/internal/media_dev.h>
+#ifndef GPAC_DISABLE_AVILIB
#include <gpac/internal/avilib.h>
+#endif
+#ifndef GPAC_DISABLE_OGG
#include <gpac/internal/ogg.h>
+#endif
+#ifndef GPAC_DISABLE_VOBSUB
#include <gpac/internal/vobsub.h>
+#endif
#include <gpac/xml.h>
#include <gpac/mpegts.h>
#include <gpac/constants.h>
GF_Err gf_import_saf(GF_MediaImporter *import)
{
+#ifndef GPAC_DISABLE_SAF
GF_Err e;
u32 track;
u64 tot;
gf_set_progress("Importing SAF", tot, tot);
MP4T_RecomputeBitRate(import->dest, track);
return GF_OK;
+#else
+ return GF_NOT_SUPPORTED;
+#endif
}
-
typedef struct
{
GF_MediaImporter *import;
GF_Err gf_import_vobsub(GF_MediaImporter *import)
{
+#ifndef GPAC_DISABLE_VOBSUB
static const u8 null_subpic[] = { 0x00, 0x09, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0xFF };
char filename[GF_MAX_PATH];
FILE *file = NULL;
}
return err;
+#else
+ return GF_NOT_SUPPORTED;
+#endif
}
#ifndef GPAC_DISABLE_AV_PARSERS
GF_EXPORT
GF_Err gf_media_import(GF_MediaImporter *importer)
{
+#ifndef GPAC_DISABLE_TTXT
GF_Err gf_import_timed_text(GF_MediaImporter *import);
+#endif
GF_Err e;
char *ext, *xml_type;
char *fmt = "";
return gf_import_saf(importer);
/*text subtitles*/
if (!strnicmp(ext, ".srt", 4) || !strnicmp(ext, ".sub", 4) || !strnicmp(ext, ".ttxt", 5)
- || !stricmp(fmt, "SRT") || !stricmp(fmt, "SUB") || !stricmp(fmt, "TEXT") )
- return gf_import_timed_text(importer);
+ || !stricmp(fmt, "SRT") || !stricmp(fmt, "SUB") || !stricmp(fmt, "TEXT") ) {
+#ifndef GPAC_DISABLE_TTXT
+ return gf_import_timed_text(importer);
+#else
+ return GF_NOT_SUPPORTED;
+#endif
+ }
/*VobSub*/
if (!strnicmp(ext, ".idx", 4) || !stricmp(fmt, "VOBSUB"))
return gf_import_vobsub(importer);
if (xml_type) {
if (!stricmp(xml_type, "TextStream") || !stricmp(xml_type, "text3GTrack") ) {
gf_free(xml_type);
+#ifndef GPAC_DISABLE_TTXT
return gf_import_timed_text(importer);
+#else
+ return GF_NOT_SUPPORTED;
+#endif
}
else if (!stricmp(xml_type, "NHNTStream")) {
gf_free(xml_type);
#include <unistd.h>
#endif
-#define DUMP_MPE_IP_DATAGRAMS
//#define FORCE_DISABLE_MPEG4SL_OVER_MPEG2TS
-#ifdef DUMP_MPE_IP_DATAGRAMS
+#ifndef GPAC_DISABLE_MPE
#include <gpac/dvb_mpe.h>
#endif
+#ifndef GPAC_DISABLE_DSMCC
+#include <gpac/ait.h>
+#endif
+
#define DEBUG_TS_PACKET 0
GF_M2TS_SECTION_ES *ses = (GF_M2TS_SECTION_ES *)es;
if (ses->sec) gf_m2ts_section_filter_del(ses->sec);
-#ifdef DUMP_MPE_IP_DATAGRAMS
+#ifndef GPAC_DISABLE_MPE
if (es->flags & GF_M2TS_ES_IS_MPE)
gf_dvb_mpe_section_del(es);
#endif
{
if (!sec->process_section) {
if ((ts->on_event && (sec->section[0]==GF_M2TS_TABLE_ID_AIT)) ) {
+#ifndef GPAC_DISABLE_DSMCC
GF_M2TS_SL_PCK pck;
pck.data_len = sec->length;
pck.data = sec->section;
pck.stream = (GF_M2TS_ES *)ses;
//ts->on_event(ts, GF_M2TS_EVT_AIT_FOUND, &pck);
on_ait_section(ts, GF_M2TS_EVT_AIT_FOUND, &pck);
+#endif
} else if ((ts->on_event && (sec->section[0]==GF_M2TS_TABLE_ID_DSM_CC_ENCAPSULATED_DATA || sec->section[0]==GF_M2TS_TABLE_ID_DSM_CC_UN_MESSAGE ||
sec->section[0]==GF_M2TS_TABLE_ID_DSM_CC_DOWNLOAD_DATA_MESSAGE || sec->section[0]==GF_M2TS_TABLE_ID_DSM_CC_STREAM_DESCRIPTION || sec->section[0]==GF_M2TS_TABLE_ID_DSM_CC_PRIVATE)) ) {
+
+#ifndef GPAC_DISABLE_DSMCC
GF_M2TS_SL_PCK pck;
pck.data_len = sec->length;
pck.data = sec->section;
pck.stream = (GF_M2TS_ES *)ses;
on_dsmcc_section(ts,GF_M2TS_EVT_DSMCC_FOUND,&pck);
//ts->on_event(ts, GF_M2TS_EVT_DSMCC_FOUND, &pck);
+#endif
}
-#ifdef DUMP_MPE_IP_DATAGRAMS
+#ifndef GPAC_DISABLE_MPE
else if (ts->on_mpe_event && ((ses && (ses->flags & GF_M2TS_EVT_DVB_MPE)) || (sec->section[0]==GF_M2TS_TABLE_ID_INT)) ) {
GF_M2TS_SL_PCK pck;
pck.data_len = sec->length;
GF_LOG(GF_LOG_DEBUG, GF_LOG_CONTAINER, ("[MPEG-2 TS] NIT table processing (not yet implemented)"));
}
-extern void dvb_decode_mjd_date(u32 date, u16 *year, u8 *month, u8 *day);
+/* decodes an Modified Julian Date (MJD) into a Co-ordinated Universal Time (UTC)
+See annex C of DVB-SI ETSI EN 300468 */
+static void dvb_decode_mjd_date(u32 date, u16 *year, u8 *month, u8 *day)
+{
+ u32 yp, mp, k;
+ yp = (u32)((date - 15078.2)/365.25);
+ mp = (u32)((date - 14956.1 - (u32)(yp * 365.25))/30.6001);
+ *day = (u32)(date - 14956 - (u32)(yp * 365.25) - (u32)(mp * 30.6001));
+ if (mp == 14 || mp == 15) k = 1;
+ else k = 0;
+ *year = yp + k + 1900;
+ *month = mp - 1 - k*12;
+ assert(*year>=1900 && *year<=2100 && *month && *month<=12 && *day && *day<=31);
+}
+
+
static void gf_m2ts_process_tdt_tot(GF_M2TS_Demuxer *ts, GF_M2TS_SECTION_ES *tdt_tot_es, GF_List *sections, u8 table_id, u16 ex_table_id, u8 version_number, u8 last_section_number, u32 status)
{
unsigned char *data;
}
break;
-
-
- /*to refine with generic private section redispatching to AIT or other afterwards*/
- es = gf_ait_section_new(pmt->program->number);
- ses = (GF_M2TS_SECTION_ES *)es;
- ses->sec = gf_m2ts_section_filter_new(NULL, 0);
- break;
case GF_M2TS_13818_6_ANNEX_A:
case GF_M2TS_13818_6_ANNEX_B:
case GF_M2TS_13818_6_ANNEX_C:
case GF_M2TS_MPE_SECTIONS:
GF_LOG(GF_LOG_INFO, GF_LOG_CONTAINER, ("stream type MPE found : pid = %d \n", pid));
-#ifdef DUMP_MPE_IP_DATAGRAMS
+#ifndef GPAC_DISABLE_MPE
es = gf_dvb_mpe_section_new();
if (es->flags & GF_M2TS_ES_IS_SECTION) {
/* NULL means: trigger the call to on_event with DVB_GENERAL type and the raw section as payload */
ts->eit = gf_m2ts_section_filter_new(NULL/*gf_m2ts_process_eit*/, 1);
ts->tdt_tot = gf_m2ts_section_filter_new(gf_m2ts_process_tdt_tot, 1);
-#ifdef DUMP_MPE_IP_DATAGRAMS
+#ifndef GPAC_DISABLE_MPE
gf_dvb_mpe_init(ts);
#endif
if (ts->tdt_tot)
gf_list_del(ts->SDTs);
-#ifdef DUMP_MPE_IP_DATAGRAMS
+#ifndef GPAC_DISABLE_MPE
gf_dvb_mpe_shutdown(ts);
#endif
if(gf_list_count(ts->dsmcc_controler)){
+#ifndef GPAC_DISABLE_DSMCC
GF_M2TS_DSMCC_OVERLORD* dsmcc_overlord = (GF_M2TS_DSMCC_OVERLORD*)gf_list_get(ts->dsmcc_controler,0);
gf_cleanup_dir(dsmcc_overlord->root_dir);
gf_rmdir(dsmcc_overlord->root_dir);
if(ts->dsmcc_root_dir){
gf_free(ts->dsmcc_root_dir);
}
+#endif
}
while(gf_list_count(ts->ChannelAppList)){
+#ifndef GPAC_DISABLE_DSMCC
GF_M2TS_CHANNEL_APPLICATION_INFO* ChanAppInfo = (GF_M2TS_CHANNEL_APPLICATION_INFO*)gf_list_get(ts->ChannelAppList,0);
gf_m2ts_delete_channel_application_info(ChanAppInfo);
gf_list_rem(ts->ChannelAppList,0);
+#endif
}
gf_list_del(ts->ChannelAppList);
void gf_m2ts_print_info(GF_M2TS_Demuxer *ts)
{
-#ifdef DUMP_MPE_IP_DATAGRAMS
+#ifndef GPAC_DISABLE_MPE
gf_m2ts_print_mpe_info(ts);
#endif
}
#include <gpac/internal/media_dev.h>
#include <gpac/bitstream.h>
#include <gpac/thread.h>
+#include <gpac/list.h>
enum
{
GF_EXPORT
GF_Err gf_odf_get_text_config(GF_DefaultDescriptor *dsi, u8 oti, GF_TextConfig *cfg)
{
- u32 i, j;
- Bool has_alt_format, has_sd;
+ u32 i;
+ Bool has_alt_format;
+#ifndef GPAC_DISABLE_ISOM
+ Bool has_sd;
+ u32 j;
+#endif
GF_Err e;
GF_BitStream *bs;
if (!dsi || !dsi->data || !dsi->dataLength || !cfg) return GF_BAD_PARAM;
cfg->timescale = gf_bs_read_int(bs, 24);
has_alt_format = gf_bs_read_int(bs, 1);
cfg->sampleDescriptionFlags = gf_bs_read_int(bs, 2);
+#ifndef GPAC_DISABLE_ISOM
has_sd = gf_bs_read_int(bs, 1);
+#else
+ gf_bs_read_int(bs, 1);
+#endif
cfg->has_vid_info = gf_bs_read_int(bs, 1);
gf_bs_read_int(bs, 3);
cfg->layer = gf_bs_read_int(bs, 8);
cfg->vert_offset = gf_bs_read_int(bs, 16);
}
+#ifndef GPAC_DISABLE_ISOM
exit:
+#endif
gf_bs_del(bs);
if (e) ResetTextConfig(cfg);
return e;
u32 j;
GF_Route *r;
#endif
+#ifdef GPAC_HAS_SPIDERMONKEY
Bool detach=0;
+#endif
GF_SceneGraph *pSG;
if (!pNode) return GF_OK;
if (prev) prev->next = nlist->next;
else pNode->sgprivate->parents = nlist->next;
gf_free(nlist);
+#ifdef GPAC_HAS_SPIDERMONKEY
if (pNode->sgprivate->parents==NULL) detach=1;
+#endif
break;
}
}
/*
DO NOT MOFIFY - File generated on GMT Tue Nov 08 09:10:57 2011
- BY MPEG4Gen for GPAC Version 0.4.6-DEV
+ BY MPEG4Gen for GPAC Version 0.5.0
*/
#include <gpac/nodes_mpeg4.h>
/*
DO NOT MOFIFY - File generated on GMT Fri Jul 31 16:39:50 2009
- BY X3DGen for GPAC Version 0.4.6-DEV
+ BY X3DGen for GPAC Version 0.5.0
*/
#include <gpac/nodes_svg.h>
+#ifndef GPAC_DISABLE_SVG
static GF_MediaObject *get_sync_reference(GF_Scene *scene, XMLRI *iri, u32 o_type, GF_Node *orig_ref, Bool *post_pone)
{
MFURL mfurl;
else ref = gf_sg_find_node_by_name(scene->graph, iri->string);
if (ref) {
-#ifndef GPAC_DISABLE_SVG
GF_FieldInfo info;
-#endif
/*safety check, break cyclic references*/
if (ref==orig_ref) return NULL;
switch (ref->sgprivate->tag) {
-#ifndef GPAC_DISABLE_SVG
case TAG_SVG_audio:
o_type = GF_MEDIA_OBJECT_AUDIO;
if (gf_node_get_attribute_by_tag(ref, TAG_XLINK_ATT_href, 0, 0, &info)==GF_OK) {
return get_sync_reference(scene, info.far_ptr, o_type, orig_ref ? orig_ref : ref, post_pone);
}
return NULL;
-#endif
default:
return NULL;
}
if (!res) *post_pone = 1;
return res;
}
+#endif
+
GF_EXPORT
GF_MediaObject *gf_mo_register(GF_Node *node, MFURL *url, Bool lock_timelines, Bool force_new_res)
}
}
+#ifndef GPAC_DISABLE_SVG
static void media_event_collect_info(GF_ClientService *net, GF_ObjectManager *odm, GF_DOMMediaEvent *media_event, u32 *min_time, u32 *min_buffer)
{
u32 i=0;
}
}
}
+#endif
void gf_term_service_media_event_with_download(GF_ObjectManager *odm, u32 event_type, u64 loaded_size, u64 total_size, u32 bytes_per_sec)
{
GF_EXPORT
GF_Err gf_term_scene_update(GF_Terminal *term, char *type, char *com)
{
+#ifndef GPAC_DISABLE_SMGR
GF_Err e;
GF_StreamContext *sc;
GF_ESD *esd;
}
gf_sm_del(load.ctx);
return e;
+#else
+ return GF_NOT_SUPPORTED;
+#endif
}
GF_EXPORT
#include <gpac/thread.h>
#include <gpac/list.h>
#include <gpac/base_coding.h>
-#include <gpac/crypt.h>
#include <gpac/tools.h>
#include <gpac/config_file.h>
#include <stdio.h>
*/
-#include <gpac/user.h>
+#include <gpac/tools.h>
#include <gpac/constants.h>
#include <gpac/color.h>
#include <gpac/thread.h>
#include <gpac/list.h>
#include <gpac/base_coding.h>
-#include <gpac/crypt.h>
#include <gpac/tools.h>
#include <gpac/cache.h>
--- /dev/null
+#ifndef _CRT_SECURE_NO_DEPRECATE
+#define _CRT_SECURE_NO_DEPRECATE 1
+#endif
+
+#include <gpac/tools.h>
+
+#ifndef PUT_UINT32_BE
+#define PUT_UINT32_BE(n,b,i) \
+{ \
+ (b)[(i) ] = (u8) ( (n) >> 24 ); \
+ (b)[(i) + 1] = (u8) ( (n) >> 16 ); \
+ (b)[(i) + 2] = (u8) ( (n) >> 8 ); \
+ (b)[(i) + 3] = (u8) ( (n) ); \
+}
+#endif
+
+#if 0
+/*
+ * FIPS-180-1 compliant SHA-1 implementation
+ *
+ * Copyright (C) 2003-2006 Christophe Devine
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License, version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+/*
+ * The SHA-1 standard was published by NIST in 1993.
+ *
+ * http://www.itl.nist.gov/fipspubs/fip180-1.htm
+ */
+
+
+struct __sha1_context
+{
+ u32 total[2];
+ u32 state[5];
+ u8 buffer[64];
+};
+
+/*
+ * 32-bit integer manipulation macros (big endian)
+ */
+#ifndef GET_UINT32_BE
+#define GET_UINT32_BE(n,b,i) \
+{ \
+ (n) = ( (u32) (b)[(i) ] << 24 ) \
+ | ( (u32) (b)[(i) + 1] << 16 ) \
+ | ( (u32) (b)[(i) + 2] << 8 ) \
+ | ( (u32) (b)[(i) + 3] ); \
+}
+#endif
+
+/*
+ * SHA-1 context setup
+ */
+GF_SHA1Context *gf_sha1_starts()
+{
+ GF_SHA1Context *ctx;
+ GF_SAFEALLOC(ctx, GF_SHA1Context);
+ ctx->total[0] = 0;
+ ctx->total[1] = 0;
+
+ ctx->state[0] = 0x67452301;
+ ctx->state[1] = 0xEFCDAB89;
+ ctx->state[2] = 0x98BADCFE;
+ ctx->state[3] = 0x10325476;
+ ctx->state[4] = 0xC3D2E1F0;
+ return ctx;
+}
+
+static void sha1_process(GF_SHA1Context *ctx, u8 data[64] )
+{
+ u32 temp, W[16], A, B, C, D, E;
+
+ GET_UINT32_BE( W[0], data, 0 );
+ GET_UINT32_BE( W[1], data, 4 );
+ GET_UINT32_BE( W[2], data, 8 );
+ GET_UINT32_BE( W[3], data, 12 );
+ GET_UINT32_BE( W[4], data, 16 );
+ GET_UINT32_BE( W[5], data, 20 );
+ GET_UINT32_BE( W[6], data, 24 );
+ GET_UINT32_BE( W[7], data, 28 );
+ GET_UINT32_BE( W[8], data, 32 );
+ GET_UINT32_BE( W[9], data, 36 );
+ GET_UINT32_BE( W[10], data, 40 );
+ GET_UINT32_BE( W[11], data, 44 );
+ GET_UINT32_BE( W[12], data, 48 );
+ GET_UINT32_BE( W[13], data, 52 );
+ GET_UINT32_BE( W[14], data, 56 );
+ GET_UINT32_BE( W[15], data, 60 );
+
+#define S(x,n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n)))
+
+#define R(t) \
+( \
+ temp = W[(t - 3) & 0x0F] ^ W[(t - 8) & 0x0F] ^ \
+ W[(t - 14) & 0x0F] ^ W[ t & 0x0F], \
+ ( W[t & 0x0F] = S(temp,1) ) \
+)
+
+#define P(a,b,c,d,e,x) \
+{ \
+ e += S(a,5) + F(b,c,d) + K + x; b = S(b,30); \
+}
+
+ A = ctx->state[0];
+ B = ctx->state[1];
+ C = ctx->state[2];
+ D = ctx->state[3];
+ E = ctx->state[4];
+
+#define F(x,y,z) (z ^ (x & (y ^ z)))
+#define K 0x5A827999
+
+ P( A, B, C, D, E, W[0] );
+ P( E, A, B, C, D, W[1] );
+ P( D, E, A, B, C, W[2] );
+ P( C, D, E, A, B, W[3] );
+ P( B, C, D, E, A, W[4] );
+ P( A, B, C, D, E, W[5] );
+ P( E, A, B, C, D, W[6] );
+ P( D, E, A, B, C, W[7] );
+ P( C, D, E, A, B, W[8] );
+ P( B, C, D, E, A, W[9] );
+ P( A, B, C, D, E, W[10] );
+ P( E, A, B, C, D, W[11] );
+ P( D, E, A, B, C, W[12] );
+ P( C, D, E, A, B, W[13] );
+ P( B, C, D, E, A, W[14] );
+ P( A, B, C, D, E, W[15] );
+ P( E, A, B, C, D, R(16) );
+ P( D, E, A, B, C, R(17) );
+ P( C, D, E, A, B, R(18) );
+ P( B, C, D, E, A, R(19) );
+
+#undef K
+#undef F
+
+#define F(x,y,z) (x ^ y ^ z)
+#define K 0x6ED9EBA1
+
+ P( A, B, C, D, E, R(20) );
+ P( E, A, B, C, D, R(21) );
+ P( D, E, A, B, C, R(22) );
+ P( C, D, E, A, B, R(23) );
+ P( B, C, D, E, A, R(24) );
+ P( A, B, C, D, E, R(25) );
+ P( E, A, B, C, D, R(26) );
+ P( D, E, A, B, C, R(27) );
+ P( C, D, E, A, B, R(28) );
+ P( B, C, D, E, A, R(29) );
+ P( A, B, C, D, E, R(30) );
+ P( E, A, B, C, D, R(31) );
+ P( D, E, A, B, C, R(32) );
+ P( C, D, E, A, B, R(33) );
+ P( B, C, D, E, A, R(34) );
+ P( A, B, C, D, E, R(35) );
+ P( E, A, B, C, D, R(36) );
+ P( D, E, A, B, C, R(37) );
+ P( C, D, E, A, B, R(38) );
+ P( B, C, D, E, A, R(39) );
+
+#undef K
+#undef F
+
+#define F(x,y,z) ((x & y) | (z & (x | y)))
+#define K 0x8F1BBCDC
+
+ P( A, B, C, D, E, R(40) );
+ P( E, A, B, C, D, R(41) );
+ P( D, E, A, B, C, R(42) );
+ P( C, D, E, A, B, R(43) );
+ P( B, C, D, E, A, R(44) );
+ P( A, B, C, D, E, R(45) );
+ P( E, A, B, C, D, R(46) );
+ P( D, E, A, B, C, R(47) );
+ P( C, D, E, A, B, R(48) );
+ P( B, C, D, E, A, R(49) );
+ P( A, B, C, D, E, R(50) );
+ P( E, A, B, C, D, R(51) );
+ P( D, E, A, B, C, R(52) );
+ P( C, D, E, A, B, R(53) );
+ P( B, C, D, E, A, R(54) );
+ P( A, B, C, D, E, R(55) );
+ P( E, A, B, C, D, R(56) );
+ P( D, E, A, B, C, R(57) );
+ P( C, D, E, A, B, R(58) );
+ P( B, C, D, E, A, R(59) );
+
+#undef K
+#undef F
+
+#define F(x,y,z) (x ^ y ^ z)
+#define K 0xCA62C1D6
+
+ P( A, B, C, D, E, R(60) );
+ P( E, A, B, C, D, R(61) );
+ P( D, E, A, B, C, R(62) );
+ P( C, D, E, A, B, R(63) );
+ P( B, C, D, E, A, R(64) );
+ P( A, B, C, D, E, R(65) );
+ P( E, A, B, C, D, R(66) );
+ P( D, E, A, B, C, R(67) );
+ P( C, D, E, A, B, R(68) );
+ P( B, C, D, E, A, R(69) );
+ P( A, B, C, D, E, R(70) );
+ P( E, A, B, C, D, R(71) );
+ P( D, E, A, B, C, R(72) );
+ P( C, D, E, A, B, R(73) );
+ P( B, C, D, E, A, R(74) );
+ P( A, B, C, D, E, R(75) );
+ P( E, A, B, C, D, R(76) );
+ P( D, E, A, B, C, R(77) );
+ P( C, D, E, A, B, R(78) );
+ P( B, C, D, E, A, R(79) );
+
+#undef K
+#undef F
+
+ ctx->state[0] += A;
+ ctx->state[1] += B;
+ ctx->state[2] += C;
+ ctx->state[3] += D;
+ ctx->state[4] += E;
+}
+
+/*
+ * SHA-1 process buffer
+ */
+void gf_sha1_update(GF_SHA1Context *ctx, u8 *input, u32 ilen )
+{
+ s32 fill;
+ u32 left;
+
+ if( ilen <= 0 )
+ return;
+
+ left = ctx->total[0] & 0x3F;
+ fill = 64 - left;
+
+ ctx->total[0] += ilen;
+ ctx->total[0] &= 0xFFFFFFFF;
+
+ if( ctx->total[0] < (u32) ilen )
+ ctx->total[1]++;
+
+ if( left && (s32) ilen >= fill )
+ {
+ memcpy( (void *) (ctx->buffer + left),
+ (void *) input, fill );
+ sha1_process( ctx, ctx->buffer );
+ input += fill;
+ ilen -= fill;
+ left = 0;
+ }
+
+ while( ilen >= 64 )
+ {
+ sha1_process( ctx, input );
+ input += 64;
+ ilen -= 64;
+ }
+
+ if( ilen > 0 )
+ {
+ memcpy( (void *) (ctx->buffer + left),
+ (void *) input, ilen );
+ }
+}
+
+static const u8 sha1_padding[64] =
+{
+ 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+/*
+ * SHA-1 final digest
+ */
+void gf_sha1_finish(GF_SHA1Context *ctx, u8 output[20] )
+{
+ u32 last, padn;
+ u32 high, low;
+ u8 msglen[8];
+
+ high = ( ctx->total[0] >> 29 )
+ | ( ctx->total[1] << 3 );
+ low = ( ctx->total[0] << 3 );
+
+ PUT_UINT32_BE( high, msglen, 0 );
+ PUT_UINT32_BE( low, msglen, 4 );
+
+ last = ctx->total[0] & 0x3F;
+ padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last );
+
+ gf_sha1_update( ctx, (u8 *) sha1_padding, padn );
+ gf_sha1_update( ctx, msglen, 8 );
+
+ PUT_UINT32_BE( ctx->state[0], output, 0 );
+ PUT_UINT32_BE( ctx->state[1], output, 4 );
+ PUT_UINT32_BE( ctx->state[2], output, 8 );
+ PUT_UINT32_BE( ctx->state[3], output, 12 );
+ PUT_UINT32_BE( ctx->state[4], output, 16 );
+
+ gf_free(ctx);
+}
+#else
+
+/*
+ * sha1.c
+ *
+ * Copyright (C) 1998, 2009
+ * Paul E. Jones <paulej@packetizer.com>
+ * All Rights Reserved
+ *
+ * Freeware Public License (FPL)
+ *
+ * This software is licensed as "freeware." Permission to distribute
+ * this software in source and binary forms, including incorporation
+ * into other products, is hereby granted without a fee. THIS SOFTWARE
+ * IS PROVIDED 'AS IS' AND WITHOUT ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHOR SHALL NOT BE HELD
+ * LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE, EITHER
+ * DIRECTLY OR INDIRECTLY, INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA
+ * OR DATA BEING RENDERED INACCURATE.
+ *
+ *****************************************************************************
+ * $Id: sha1.c 12 2009-06-22 19:34:25Z paulej $
+ *****************************************************************************
+ *
+ * Description:
+ * This file implements the Secure Hashing Standard as defined
+ * in FIPS PUB 180-1 published April 17, 1995.
+ *
+ * The Secure Hashing Standard, which uses the Secure Hashing
+ * Algorithm (SHA), produces a 160-bit message digest for a
+ * given data stream. In theory, it is highly improbable that
+ * two messages will produce the same message digest. Therefore,
+ * this algorithm can serve as a means of providing a "fingerprint"
+ * for a message.
+ *
+ * Portability Issues:
+ * SHA-1 is defined in terms of 32-bit "words". This code was
+ * written with the expectation that the processor has at least
+ * a 32-bit machine word size. If the machine word size is larger,
+ * the code should still function properly. One caveat to that
+ * is that the input functions taking characters and character
+ * arrays assume that only 8 bits of information are stored in each
+ * character.
+ *
+ * Caveats:
+ * SHA-1 is designed to work with messages less than 2^64 bits
+ * long. Although SHA-1 allows a message digest to be generated for
+ * messages of any number of bits less than 2^64, this
+ * implementation only works with messages with a length that is a
+ * multiple of the size of an 8-bit character.
+ *
+ */
+
+/*
+ * This structure will hold context information for the hashing
+ * operation
+ */
+struct __sha1_context
+{
+ unsigned Message_Digest[5]; /* Message Digest (output) */
+
+ unsigned Length_Low; /* Message length in bits */
+ unsigned Length_High; /* Message length in bits */
+
+ unsigned char Message_Block[64]; /* 512-bit message blocks */
+ int Message_Block_Index; /* Index into message block array */
+
+ int Computed; /* Is the digest computed? */
+ int Corrupted; /* Is the message digest corruped? */
+};
+
+/*
+ * Define the circular shift macro
+ */
+#define SHA1CircularShift(bits,word) \
+ ((((word) << (bits)) & 0xFFFFFFFF) | \
+ ((word) >> (32-(bits))))
+
+
+/*
+ * SHA1ProcessMessageBlock
+ *
+ * Description:
+ * This function will process the next 512 bits of the message
+ * stored in the Message_Block array.
+ *
+ * Parameters:
+ * None.
+ *
+ * Returns:
+ * Nothing.
+ *
+ * Comments:
+ * Many of the variable names in the SHAContext, especially the
+ * single character names, were used because those were the names
+ * used in the publication.
+ *
+ *
+ */
+void SHA1ProcessMessageBlock(GF_SHA1Context *context)
+{
+ const unsigned K[] = /* Constants defined in SHA-1 */
+ {
+ 0x5A827999,
+ 0x6ED9EBA1,
+ 0x8F1BBCDC,
+ 0xCA62C1D6
+ };
+ int t; /* Loop counter */
+ unsigned temp; /* Temporary word value */
+ unsigned W[80]; /* Word sequence */
+ unsigned A, B, C, D, E; /* Word buffers */
+
+ /*
+ * Initialize the first 16 words in the array W
+ */
+ for(t = 0; t < 16; t++)
+ {
+ W[t] = ((unsigned) context->Message_Block[t * 4]) << 24;
+ W[t] |= ((unsigned) context->Message_Block[t * 4 + 1]) << 16;
+ W[t] |= ((unsigned) context->Message_Block[t * 4 + 2]) << 8;
+ W[t] |= ((unsigned) context->Message_Block[t * 4 + 3]);
+ }
+
+ for(t = 16; t < 80; t++)
+ {
+ W[t] = SHA1CircularShift(1,W[t-3] ^ W[t-8] ^ W[t-14] ^ W[t-16]);
+ }
+
+ A = context->Message_Digest[0];
+ B = context->Message_Digest[1];
+ C = context->Message_Digest[2];
+ D = context->Message_Digest[3];
+ E = context->Message_Digest[4];
+
+ for(t = 0; t < 20; t++)
+ {
+ temp = SHA1CircularShift(5,A) +
+ ((B & C) | ((~B) & D)) + E + W[t] + K[0];
+ temp &= 0xFFFFFFFF;
+ E = D;
+ D = C;
+ C = SHA1CircularShift(30,B);
+ B = A;
+ A = temp;
+ }
+
+ for(t = 20; t < 40; t++)
+ {
+ temp = SHA1CircularShift(5,A) + (B ^ C ^ D) + E + W[t] + K[1];
+ temp &= 0xFFFFFFFF;
+ E = D;
+ D = C;
+ C = SHA1CircularShift(30,B);
+ B = A;
+ A = temp;
+ }
+
+ for(t = 40; t < 60; t++)
+ {
+ temp = SHA1CircularShift(5,A) +
+ ((B & C) | (B & D) | (C & D)) + E + W[t] + K[2];
+ temp &= 0xFFFFFFFF;
+ E = D;
+ D = C;
+ C = SHA1CircularShift(30,B);
+ B = A;
+ A = temp;
+ }
+
+ for(t = 60; t < 80; t++)
+ {
+ temp = SHA1CircularShift(5,A) + (B ^ C ^ D) + E + W[t] + K[3];
+ temp &= 0xFFFFFFFF;
+ E = D;
+ D = C;
+ C = SHA1CircularShift(30,B);
+ B = A;
+ A = temp;
+ }
+
+ context->Message_Digest[0] =
+ (context->Message_Digest[0] + A) & 0xFFFFFFFF;
+ context->Message_Digest[1] =
+ (context->Message_Digest[1] + B) & 0xFFFFFFFF;
+ context->Message_Digest[2] =
+ (context->Message_Digest[2] + C) & 0xFFFFFFFF;
+ context->Message_Digest[3] =
+ (context->Message_Digest[3] + D) & 0xFFFFFFFF;
+ context->Message_Digest[4] =
+ (context->Message_Digest[4] + E) & 0xFFFFFFFF;
+
+ context->Message_Block_Index = 0;
+}
+
+/*
+ * SHA1PadMessage
+ *
+ * Description:
+ * According to the standard, the message must be padded to an even
+ * 512 bits. The first padding bit must be a '1'. The last 64
+ * bits represent the length of the original message. All bits in
+ * between should be 0. This function will pad the message
+ * according to those rules by filling the Message_Block array
+ * accordingly. It will also call SHA1ProcessMessageBlock()
+ * appropriately. When it returns, it can be assumed that the
+ * message digest has been computed.
+ *
+ * Parameters:
+ * context: [in/out]
+ * The context to pad
+ *
+ * Returns:
+ * Nothing.
+ *
+ * Comments:
+ *
+ */
+static void SHA1PadMessage(GF_SHA1Context *context)
+{
+ /*
+ * Check to see if the current message block is too small to hold
+ * the initial padding bits and length. If so, we will pad the
+ * block, process it, and then continue padding into a second
+ * block.
+ */
+ if (context->Message_Block_Index > 55)
+ {
+ context->Message_Block[context->Message_Block_Index++] = 0x80;
+ while(context->Message_Block_Index < 64)
+ {
+ context->Message_Block[context->Message_Block_Index++] = 0;
+ }
+
+ SHA1ProcessMessageBlock(context);
+
+ while(context->Message_Block_Index < 56)
+ {
+ context->Message_Block[context->Message_Block_Index++] = 0;
+ }
+ }
+ else
+ {
+ context->Message_Block[context->Message_Block_Index++] = 0x80;
+ while(context->Message_Block_Index < 56)
+ {
+ context->Message_Block[context->Message_Block_Index++] = 0;
+ }
+ }
+
+ /*
+ * Store the message length as the last 8 octets
+ */
+ context->Message_Block[56] = (context->Length_High >> 24) & 0xFF;
+ context->Message_Block[57] = (context->Length_High >> 16) & 0xFF;
+ context->Message_Block[58] = (context->Length_High >> 8) & 0xFF;
+ context->Message_Block[59] = (context->Length_High) & 0xFF;
+ context->Message_Block[60] = (context->Length_Low >> 24) & 0xFF;
+ context->Message_Block[61] = (context->Length_Low >> 16) & 0xFF;
+ context->Message_Block[62] = (context->Length_Low >> 8) & 0xFF;
+ context->Message_Block[63] = (context->Length_Low) & 0xFF;
+
+ SHA1ProcessMessageBlock(context);
+}
+/*
+ * SHA1Reset
+ *
+ * Description:
+ * This function will initialize the SHA1Context in preparation
+ * for computing a new message digest.
+ *
+ * Parameters:
+ * context: [in/out]
+ * The context to reset.
+ *
+ * Returns:
+ * Nothing.
+ *
+ * Comments:
+ *
+ */
+GF_SHA1Context *gf_sha1_starts()
+{
+ GF_SHA1Context *context;
+ GF_SAFEALLOC(context, GF_SHA1Context);
+ context->Length_Low = 0;
+ context->Length_High = 0;
+ context->Message_Block_Index = 0;
+
+ context->Message_Digest[0] = 0x67452301;
+ context->Message_Digest[1] = 0xEFCDAB89;
+ context->Message_Digest[2] = 0x98BADCFE;
+ context->Message_Digest[3] = 0x10325476;
+ context->Message_Digest[4] = 0xC3D2E1F0;
+
+ context->Computed = 0;
+ context->Corrupted = 0;
+ return context;
+}
+
+void gf_sha1_update(GF_SHA1Context *context, u8 *message_array, u32 length )
+{
+ if (!length)
+ {
+ return;
+ }
+
+ if (context->Computed || context->Corrupted)
+ {
+ context->Corrupted = 1;
+ return;
+ }
+
+ while(length-- && !context->Corrupted)
+ {
+ context->Message_Block[context->Message_Block_Index++] =
+ (*message_array & 0xFF);
+
+ context->Length_Low += 8;
+ /* Force it to 32 bits */
+ context->Length_Low &= 0xFFFFFFFF;
+ if (context->Length_Low == 0)
+ {
+ context->Length_High++;
+ /* Force it to 32 bits */
+ context->Length_High &= 0xFFFFFFFF;
+ if (context->Length_High == 0)
+ {
+ /* Message is too long */
+ context->Corrupted = 1;
+ }
+ }
+
+ if (context->Message_Block_Index == 64)
+ {
+ SHA1ProcessMessageBlock(context);
+ }
+
+ message_array++;
+ }
+}
+void gf_sha1_finish(GF_SHA1Context *context, u8 output[20] )
+{
+ if (context->Corrupted)
+ {
+ return;
+ }
+
+ if (!context->Computed)
+ {
+ SHA1PadMessage(context);
+ context->Computed = 1;
+ }
+ PUT_UINT32_BE( context->Message_Digest[0], output, 0 );
+ PUT_UINT32_BE( context->Message_Digest[1], output, 4 );
+ PUT_UINT32_BE( context->Message_Digest[2], output, 8 );
+ PUT_UINT32_BE( context->Message_Digest[3], output, 12 );
+ PUT_UINT32_BE( context->Message_Digest[4], output, 16 );
+
+ gf_free(context);
+}
+
+#endif
+
+/*
+ * Output = SHA-1( file contents )
+ */
+GF_EXPORT
+s32 gf_sha1_file( const char *path, u8 output[20] )
+{
+ FILE *f;
+ size_t n;
+ GF_SHA1Context *ctx;
+ u8 buf[1024];
+
+ if( ( f = gf_f64_open( path, "rb" ) ) == NULL )
+ return( 1 );
+
+ ctx = gf_sha1_starts();
+
+ while( ( n = fread( buf, 1, sizeof( buf ), f ) ) > 0 )
+ gf_sha1_update(ctx, buf, (s32) n );
+
+ gf_sha1_finish(ctx, output );
+
+ fclose( f );
+ return( 0 );
+}
+
+/*
+ * Output = SHA-1( input buffer )
+ */
+void gf_sha1_csum( u8 *input, u32 ilen, u8 output[20] )
+{
+ GF_SHA1Context *ctx;
+
+ ctx = gf_sha1_starts();
+ gf_sha1_update(ctx, input, ilen );
+ gf_sha1_finish(ctx, output );
+}
+
+