From 0bc2d93a49a1e6b0915490103922075e07b67e97 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Thu, 22 Mar 2012 11:06:18 +0100 Subject: [PATCH] Imported Upstream version 0.4.5+svn3959~dfsg0 --- applications/mp42ts/main.c | 12 + .../release/nsis_install/gpac_installer.nsi | 397 +++++++++--------- configure | 6 +- include/gpac/media_tools.h | 8 +- modules/mpd_in/mpd_in.c | 7 +- modules/ogg/ogg_in.c | 3 +- modules/timedtext/timedtext_dec.c | 2 +- modules/widgetman/unzip.c | 2 +- modules/widgetman/widgetman.c | 13 +- src/export.cpp | 11 +- src/media_tools/media_import.c | 2 + src/utils/os_net.c | 11 +- 12 files changed, 256 insertions(+), 218 deletions(-) diff --git a/applications/mp42ts/main.c b/applications/mp42ts/main.c index dc4a10a..80b2245 100644 --- a/applications/mp42ts/main.c +++ b/applications/mp42ts/main.c @@ -30,6 +30,13 @@ #include +#ifdef GPAC_DISABLE_ISOM + +#error "Cannot compile MP42TS if GPAC is not built with ISO File Format support" + +#else + + #define DEFAULT_PCR_OFFSET 18000 #define UDP_BUFFER_SIZE 0x40000 @@ -405,7 +412,11 @@ static void fill_isom_es_ifce(M2TSProgram *prog, GF_ESInterface *ifce, GF_ISOFil ifce->sl_config->timestampResolution = 90000; } +#ifdef GPAC_DISABLE_ISOM_WRITE + fprintf(stdout, "Warning: GPAC was compiled without ISOM Write support, can't set SL Config!\n"); +#else gf_isom_set_extraction_slc(mp4, track_num, 1, ifce->sl_config); +#endif ifce->input_ctrl = mp4_input_ctrl; if (priv != ifce->input_udta){ @@ -2197,3 +2208,4 @@ exit: return 1; } +#endif /*GPAC_DISABLE_ISOM*/ diff --git a/bin/win32/release/nsis_install/gpac_installer.nsi b/bin/win32/release/nsis_install/gpac_installer.nsi index 367006e..b391018 100644 --- a/bin/win32/release/nsis_install/gpac_installer.nsi +++ b/bin/win32/release/nsis_install/gpac_installer.nsi @@ -657,169 +657,169 @@ SectionEnd !verbose 3 !include "WinMessages.NSH" !verbose 4 + +!ifndef WriteEnvStr_RegKey + !ifdef ALL_USERS + !define WriteEnvStr_RegKey \ + 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"' + !else + !define WriteEnvStr_RegKey 'HKCU "Environment"' + !endif +!endif ; AddToPath - Adds the given dir to the search path. ; Input - head of the stack ; Note - Win9x systems requires reboot -Function AddToPath - Exch $0 - Push $1 - Push $2 - Push $3 - - # don't add if the path doesn't exist - IfFileExists $0 "" AddToPath_done - - ReadEnvStr $1 PATH - Push "$1;" - Push "$0;" - Call StrStr - Pop $2 - StrCmp $2 "" "" AddToPath_done - Push "$1;" - Push "$0\;" - Call StrStr - Pop $2 - StrCmp $2 "" "" AddToPath_done - GetFullPathName /SHORT $3 $0 - Push "$1;" - Push "$3;" - Call StrStr - Pop $2 - StrCmp $2 "" "" AddToPath_done - Push "$1;" - Push "$3\;" - Call StrStr - Pop $2 - StrCmp $2 "" "" AddToPath_done - - Call IsNT - Pop $1 - StrCmp $1 1 AddToPath_NT - ; Not on NT - StrCpy $1 $WINDIR 2 - FileOpen $1 "$1\autoexec.bat" a - FileSeek $1 -1 END - FileReadByte $1 $2 - IntCmp $2 26 0 +2 +2 # DOS EOF - FileSeek $1 -1 END # write over EOF - FileWrite $1 "$\r$\nSET PATH=%PATH%;$3$\r$\n" - FileClose $1 - SetRebootFlag true - Goto AddToPath_done - - AddToPath_NT: - ReadRegStr $1 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" - StrCpy $2 $1 1 -1 # copy last char - StrCmp $2 ";" 0 +2 # if last char == ; - StrCpy $1 $1 -1 # remove last char - StrCmp $1 "" AddToPath_NTdoIt - StrCpy $0 "$1;$0" - AddToPath_NTdoIt: - WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" $0 - - ReadRegStr $1 HKCU "Environment" "PATH" - StrCpy $2 $1 1 -1 # copy last char - StrCmp $2 ";" 0 +2 # if last char == ; - StrCpy $1 $1 -1 # remove last char - StrCmp $1 "" AddToPath_NTdoIt2 - StrCpy $0 "$1;$0" - AddToPath_NTdoIt2: - WriteRegExpandStr HKCU "Environment" "PATH" $0 - SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 - - AddToPath_done: - Pop $3 - Pop $2 - Pop $1 - Pop $0 +Function AddToPath + Exch $0 + Push $1 + Push $2 + Push $3 + + # don't add if the path doesn't exist + IfFileExists "$0\*.*" "" AddToPath_done + + ReadEnvStr $1 PATH + Push "$1;" + Push "$0;" + Call StrStr + Pop $2 + StrCmp $2 "" "" AddToPath_done + Push "$1;" + Push "$0\;" + Call StrStr + Pop $2 + StrCmp $2 "" "" AddToPath_done + GetFullPathName /SHORT $3 $0 + Push "$1;" + Push "$3;" + Call StrStr + Pop $2 + StrCmp $2 "" "" AddToPath_done + Push "$1;" + Push "$3\;" + Call StrStr + Pop $2 + StrCmp $2 "" "" AddToPath_done + + Call IsNT + Pop $1 + StrCmp $1 1 AddToPath_NT + ; Not on NT + StrCpy $1 $WINDIR 2 + FileOpen $1 "$1\autoexec.bat" a + FileSeek $1 -1 END + FileReadByte $1 $2 + IntCmp $2 26 0 +2 +2 # DOS EOF + FileSeek $1 -1 END # write over EOF + FileWrite $1 "$\r$\nSET PATH=%PATH%;$3$\r$\n" + FileClose $1 + SetRebootFlag true + Goto AddToPath_done + + AddToPath_NT: + ReadRegStr $1 ${WriteEnvStr_RegKey} "PATH" + StrCpy $2 $1 1 -1 # copy last char + StrCmp $2 ";" 0 +2 # if last char == ; + StrCpy $1 $1 -1 # remove last char + StrCmp $1 "" AddToPath_NTdoIt + StrCpy $0 "$1;$0" + AddToPath_NTdoIt: + WriteRegExpandStr ${WriteEnvStr_RegKey} "PATH" $0 + SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 + + AddToPath_done: + Pop $3 + Pop $2 + Pop $1 + Pop $0 FunctionEnd ; RemoveFromPath - Remove a given dir from the path ; Input: head of the stack -Function un.RemoveFromPath - Exch $0 - Push $1 - Push $2 - Push $3 - Push $4 - Push $5 - Push $6 - - IntFmt $6 "%c" 26 # DOS EOF - - Call un.IsNT - Pop $1 - StrCmp $1 1 unRemoveFromPath_NT - ; Not on NT - StrCpy $1 $WINDIR 2 - FileOpen $1 "$1\autoexec.bat" r - GetTempFileName $4 - FileOpen $2 $4 w - GetFullPathName /SHORT $0 $0 - StrCpy $0 "SET PATH=%PATH%;$0" - Goto unRemoveFromPath_dosLoop - - unRemoveFromPath_dosLoop: - FileRead $1 $3 - StrCpy $5 $3 1 -1 # read last char - StrCmp $5 $6 0 +2 # if DOS EOF - StrCpy $3 $3 -1 # remove DOS EOF so we can compare - StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoopRemoveLine - StrCmp $3 "$0$\n" unRemoveFromPath_dosLoopRemoveLine - StrCmp $3 "$0" unRemoveFromPath_dosLoopRemoveLine - StrCmp $3 "" unRemoveFromPath_dosLoopEnd - FileWrite $2 $3 - Goto unRemoveFromPath_dosLoop - unRemoveFromPath_dosLoopRemoveLine: - SetRebootFlag true - Goto unRemoveFromPath_dosLoop - - unRemoveFromPath_dosLoopEnd: - FileClose $2 - FileClose $1 - StrCpy $1 $WINDIR 2 - Delete "$1\autoexec.bat" - CopyFiles /SILENT $4 "$1\autoexec.bat" - Delete $4 - Goto unRemoveFromPath_done - - unRemoveFromPath_NT: - ReadRegStr $1 HKCU "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" - StrCpy $5 $1 1 -1 # copy last char - StrCmp $5 ";" +2 # if last char != ; - StrCpy $1 "$1;" # append ; - Push $1 - Push "$0;" - Call un.StrStr ; Find `$0;` in $1 - Pop $2 ; pos of our dir - StrCmp $2 "" unRemoveFromPath_done - ; else, it is in path - # $0 - path to add - # $1 - path var - StrLen $3 "$0;" - StrLen $4 $2 - StrCpy $5 $1 -$4 # $5 is now the part before the path to remove - StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove - StrCpy $3 $5$6 - - StrCpy $5 $3 1 -1 # copy last char - StrCmp $5 ";" 0 +2 # if last char == ; - StrCpy $3 $3 -1 # remove last char - - WriteRegExpandStr HKCU "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" $3 - SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 - - unRemoveFromPath_done: - Pop $6 - Pop $5 - Pop $4 - Pop $3 - Pop $2 - Pop $1 - Pop $0 +Function un.RemoveFromPath + Exch $0 + Push $1 + Push $2 + Push $3 + Push $4 + Push $5 + Push $6 + + IntFmt $6 "%c" 26 # DOS EOF + + Call un.IsNT + Pop $1 + StrCmp $1 1 unRemoveFromPath_NT + ; Not on NT + StrCpy $1 $WINDIR 2 + FileOpen $1 "$1\autoexec.bat" r + GetTempFileName $4 + FileOpen $2 $4 w + GetFullPathName /SHORT $0 $0 + StrCpy $0 "SET PATH=%PATH%;$0" + Goto unRemoveFromPath_dosLoop + + unRemoveFromPath_dosLoop: + FileRead $1 $3 + StrCpy $5 $3 1 -1 # read last char + StrCmp $5 $6 0 +2 # if DOS EOF + StrCpy $3 $3 -1 # remove DOS EOF so we can compare + StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoopRemoveLine + StrCmp $3 "$0$\n" unRemoveFromPath_dosLoopRemoveLine + StrCmp $3 "$0" unRemoveFromPath_dosLoopRemoveLine + StrCmp $3 "" unRemoveFromPath_dosLoopEnd + FileWrite $2 $3 + Goto unRemoveFromPath_dosLoop + unRemoveFromPath_dosLoopRemoveLine: + SetRebootFlag true + Goto unRemoveFromPath_dosLoop + + unRemoveFromPath_dosLoopEnd: + FileClose $2 + FileClose $1 + StrCpy $1 $WINDIR 2 + Delete "$1\autoexec.bat" + CopyFiles /SILENT $4 "$1\autoexec.bat" + Delete $4 + Goto unRemoveFromPath_done + + unRemoveFromPath_NT: + ReadRegStr $1 ${WriteEnvStr_RegKey} "PATH" + StrCpy $5 $1 1 -1 # copy last char + StrCmp $5 ";" +2 # if last char != ; + StrCpy $1 "$1;" # append ; + Push $1 + Push "$0;" + Call un.StrStr ; Find `$0;` in $1 + Pop $2 ; pos of our dir + StrCmp $2 "" unRemoveFromPath_done + ; else, it is in path + # $0 - path to add + # $1 - path var + StrLen $3 "$0;" + StrLen $4 $2 + StrCpy $5 $1 -$4 # $5 is now the part before the path to remove + StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove + StrCpy $3 $5$6 + + StrCpy $5 $3 1 -1 # copy last char + StrCmp $5 ";" 0 +2 # if last char == ; + StrCpy $3 $3 -1 # remove last char + + WriteRegExpandStr ${WriteEnvStr_RegKey} "PATH" $3 + SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 + + unRemoveFromPath_done: + Pop $6 + Pop $5 + Pop $4 + Pop $3 + Pop $2 + Pop $1 + Pop $0 FunctionEnd ########################################### @@ -835,20 +835,20 @@ FunctionEnd ; Pop $R0 ; ($R0 at this point is 1 or 0) -!macro IsNT un -Function ${un}IsNT - Push $0 - ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion - StrCmp $0 "" 0 IsNT_yes - ; we are not NT. - Pop $0 - Push 0 - Return - - IsNT_yes: - ; NT!!! - Pop $0 - Push 1 +!macro IsNT un +Function ${un}IsNT + Push $0 + ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion + StrCmp $0 "" 0 IsNT_yes + ; we are not NT. + Pop $0 + Push 0 + Return + + IsNT_yes: + ; NT!!! + Pop $0 + Push 1 FunctionEnd !macroend !insertmacro IsNT "" @@ -867,36 +867,35 @@ FunctionEnd ; Pop $R0 ; ($R0 at this point is "ass string") -!macro StrStr un -Function ${un}StrStr -Exch $R1 ; st=haystack,old$R1, $R1=needle - Exch ; st=old$R1,haystack - Exch $R2 ; st=old$R1,old$R2, $R2=haystack - Push $R3 - Push $R4 - Push $R5 - StrLen $R3 $R1 - StrCpy $R4 0 - ; $R1=needle - ; $R2=haystack - ; $R3=len(needle) - ; $R4=cnt - ; $R5=tmp - loop: - StrCpy $R5 $R2 $R3 $R4 - StrCmp $R5 $R1 done - StrCmp $R5 "" done - IntOp $R4 $R4 + 1 - Goto loop -done: - StrCpy $R1 $R2 "" $R4 - Pop $R5 - Pop $R4 - Pop $R3 - Pop $R2 - Exch $R1 -FunctionEnd -!macroend -!insertmacro StrStr "" +!macro StrStr un +Function ${un}StrStr +Exch $R1 ; st=haystack,old$R1, $R1=needle + Exch ; st=old$R1,haystack + Exch $R2 ; st=old$R1,old$R2, $R2=haystack + Push $R3 + Push $R4 + Push $R5 + StrLen $R3 $R1 + StrCpy $R4 0 + ; $R1=needle + ; $R2=haystack + ; $R3=len(needle) + ; $R4=cnt + ; $R5=tmp + loop: + StrCpy $R5 $R2 $R3 $R4 + StrCmp $R5 $R1 done + StrCmp $R5 "" done + IntOp $R4 $R4 + 1 + Goto loop +done: + StrCpy $R1 $R2 "" $R4 + Pop $R5 + Pop $R4 + Pop $R3 + Pop $R2 + Exch $R1 +FunctionEnd +!macroend +!insertmacro StrStr "" !insertmacro StrStr "un." - diff --git a/configure b/configure index 4c956c1..d08a25d 100755 --- a/configure +++ b/configure @@ -2504,13 +2504,17 @@ if test "$has_libxml2" = "yes"; then fi if test "$disable_m2ts_mux" = "yes" -o "$disable_m2ts" = "yes" ; then echo "DISABLE_M2TS=yes" >> config.mak +else + echo "DISABLE_M2TS=no" >> config.mak fi echo "GPAC_USE_TINYGL=$has_tinygl" >> config.mak echo "OGL_INCLS=$INCL3D" >> config.mak if test "$disable_isoff" = "yes" -o "$disable_isoff_write" = "yes" ; then - echo "DISABLE_ISOFF=$disable_isoff" >> config.mak + echo "DISABLE_ISOFF=yes" >> config.mak +else + echo "DISABLE_ISOFF=no" >> config.mak fi echo "HAS_OPENGL=$has_opengl" >> config.mak diff --git a/include/gpac/media_tools.h b/include/gpac/media_tools.h index a9bf5c7..bd3b2a8 100644 --- a/include/gpac/media_tools.h +++ b/include/gpac/media_tools.h @@ -38,7 +38,11 @@ extern "C" { /*creates (if needed) a GF_ESD for the given track - THIS IS RESERVED for local playback only, since the OTI used when emulated is not standard...*/ GF_ESD *gf_media_map_esd(GF_ISOFile *mp4, u32 track); +#endif +#ifndef GPAC_DISABLE_ISOM_WRITE +/*changes pixel aspect ratio for visual tracks if supported. Negative values remove any PAR info*/ +GF_Err gf_media_change_par(GF_ISOFile *file, u32 track, s32 ar_num, s32 ar_den); #endif @@ -248,10 +252,6 @@ GF_Err gf_media_avc_rewrite_samples(GF_ISOFile *file, u32 track, u32 prev_size_i #endif /*GPAC_DISABLE_MEDIA_IMPORT*/ -/*changes pixel aspect ratio for visual tracks if supported. Negative values remove any PAR info*/ -GF_Err gf_media_change_par(GF_ISOFile *file, u32 track, s32 ar_num, s32 ar_den); - - #ifndef GPAC_DISABLE_ISOM_WRITE /*starts MPD file */ diff --git a/modules/mpd_in/mpd_in.c b/modules/mpd_in/mpd_in.c index 48d4751..d73d4b4 100644 --- a/modules/mpd_in/mpd_in.c +++ b/modules/mpd_in/mpd_in.c @@ -209,10 +209,12 @@ void MPD_NetIO_Segment(void *cbk, GF_NETIO_Parameter *param) if ((param->msg_type == GF_NETIO_PARSE_HEADER) && !strcmp(param->name, "Content-Type")) { if (!group->service_mime) { group->service_mime = gf_strdup(param->value); - } else if (strcmp(group->service_mime, param->value)) { + } else if (stricmp(group->service_mime, param->value)) { GF_MPD_Representation *rep = gf_list_get(group->adaptation_set->representations, group->active_rep_index); if (! MPD_GetMimeType(NULL, rep, group->adaptation_set) ) rep->mime_type = gf_strdup(param->value); rep->disabled = 1; + GF_LOG(GF_LOG_WARNING, GF_LOG_MODULE, + ("[MPD_IN] Disabling representation since mime does not match: expected %s, but had %s for %s!\n", group->service_mime, param->value, gf_dm_sess_get_resource_name(group->segment_dnload))); group->force_switch_bandwidth = 1; gf_dm_sess_abort(group->segment_dnload); return; @@ -1688,9 +1690,10 @@ restart_period: } } - if (e == GF_OK || group->segment_must_be_streamed) { + if (local_file_name && (e == GF_OK || group->segment_must_be_streamed )) { gf_mx_p(mpdin->dl_mutex); assert(group->nb_cached_segmentsmax_cached_segments); + assert( local_file_name ); group->cached[group->nb_cached_segments].cache = gf_strdup(local_file_name); group->cached[group->nb_cached_segments].url = gf_strdup( resource_name ); group->cached[group->nb_cached_segments].start_range = 0; diff --git a/modules/ogg/ogg_in.c b/modules/ogg/ogg_in.c index 4c8ced5..522557f 100644 --- a/modules/ogg/ogg_in.c +++ b/modules/ogg/ogg_in.c @@ -390,7 +390,8 @@ void OGG_SignalEndOfStream(OGGReader *read, OGGStream *st) } } -GFINLINE void OGG_SendPackets(OGGReader *read, OGGStream *st, ogg_packet *oggpacket) +/*GFINLINE*/ +void OGG_SendPackets(OGGReader *read, OGGStream *st, ogg_packet *oggpacket) { GF_SLHeader slh; memset(&slh, 0, sizeof(GF_SLHeader)); diff --git a/modules/timedtext/timedtext_dec.c b/modules/timedtext/timedtext_dec.c index 26c0836..a674431 100644 --- a/modules/timedtext/timedtext_dec.c +++ b/modules/timedtext/timedtext_dec.c @@ -63,7 +63,7 @@ The decoder only accepts complete timed text units TTU(1). In band reconfig (TTU(5) is not supported, nor fragmented TTUs (2, 3, 4). - UTF16 support should workbut MP4Box does not support it at encoding time. + UTF16 support should work but MP4Box does not support it at encoding time. */ typedef struct diff --git a/modules/widgetman/unzip.c b/modules/widgetman/unzip.c index df1430c..c3feb08 100644 --- a/modules/widgetman/unzip.c +++ b/modules/widgetman/unzip.c @@ -1142,7 +1142,7 @@ int mymkdir(dirname) } int makedir (newdir) - char *newdir; + const char *newdir; { char *buffer ; char *p; diff --git a/modules/widgetman/widgetman.c b/modules/widgetman/widgetman.c index 75e3df3..593f60b 100644 --- a/modules/widgetman/widgetman.c +++ b/modules/widgetman/widgetman.c @@ -73,7 +73,7 @@ static Bool is_same_path(const char *p1, const char *p2, u32 len) static void widget_package_extract_file(GF_WidgetPackage *wpack, GF_WidgetPackageResource *res) { - u32 i, count; + u32 i; if (wpack->is_zip) { unz_global_info gi; @@ -115,7 +115,9 @@ static void widget_package_extract_file(GF_WidgetPackage *wpack, GF_WidgetPackag break; } unzClose(uf); +#ifndef GPAC_DISABLE_ISOM } else { + u32 count; GF_ISOFile *isom = gf_isom_open(wpack->package_path, GF_ISOM_OPEN_READ, 0); if (!isom ) return; @@ -134,6 +136,7 @@ static void widget_package_extract_file(GF_WidgetPackage *wpack, GF_WidgetPackag break; } gf_isom_close(isom); +#endif /*GPAC_DISABLE_ISOM*/ } } @@ -228,8 +231,13 @@ static Bool widget_package_relocate_uri(void *__self, const char *parent_uri, co return 0; } + static GF_WidgetPackage *widget_isom_new(GF_WidgetManager *wm, const char *path) { +#ifdef GPAC_DISABLE_ISOM + GF_LOG(GF_LOG_ERROR, GF_LOG_MODULE, ("[Widgetman] GPAC was compiled without ISO File Format support\n")); + return NULL; +#else GF_WidgetPackageResource *pack_res; char szPath[GF_MAX_PATH]; const char *dir; @@ -311,6 +319,7 @@ static GF_WidgetPackage *widget_isom_new(GF_WidgetManager *wm, const char *path) gf_list_add(wm->term->uri_relocators, wzip); gf_mx_v(wm->term->net_mx); return wzip; +#endif /*GPAC_DISABLE_ISOM*/ } static GF_WidgetPackage *widget_zip_new(GF_WidgetManager *wm, const char *path) @@ -410,10 +419,12 @@ GF_WidgetPackage *widget_package_new(GF_WidgetManager *wm, const char *path) if (gf_unzip_probe(path)) { return widget_zip_new(wm, path); } +#ifndef GPAC_DISABLE_ISOM /*ISOFF-based packaged widget */ else if (gf_isom_probe_file(path)) { return widget_isom_new(wm, path); } +#endif return NULL; } diff --git a/src/export.cpp b/src/export.cpp index 0e67cd5..6d63bd9 100644 --- a/src/export.cpp +++ b/src/export.cpp @@ -563,8 +563,10 @@ #pragma comment (linker, EXPORT_SYMBOL(gf_isom_get_timed_meta_data_info) ) #pragma comment (linker, EXPORT_SYMBOL(gf_isom_box_new) ) #pragma comment (linker, EXPORT_SYMBOL(gf_isom_box_del) ) +#ifndef GPAC_DISABLE_ISOM_WRITE #pragma comment (linker, EXPORT_SYMBOL(gf_isom_box_write) ) #pragma comment (linker, EXPORT_SYMBOL(gf_isom_box_size) ) +#endif #pragma comment (linker, EXPORT_SYMBOL(gf_isom_open_progressive) ) #pragma comment (linker, EXPORT_SYMBOL(gf_isom_get_missing_bytes) ) #pragma comment (linker, EXPORT_SYMBOL(gf_isom_is_fragmented) ) @@ -656,6 +658,8 @@ #pragma comment (linker, EXPORT_SYMBOL(gf_isom_get_meta_item_info) ) #pragma comment (linker, EXPORT_SYMBOL(gf_isom_get_meta_type) ) #pragma comment (linker, EXPORT_SYMBOL(gf_isom_has_meta_xml) ) +#pragma comment (linker, EXPORT_SYMBOL(gf_isom_extract_meta_xml) ) +#pragma comment (linker, EXPORT_SYMBOL(gf_isom_extract_meta_item) ) #pragma comment (linker, EXPORT_SYMBOL(gf_isom_has_movie) ) #pragma comment (linker, EXPORT_SYMBOL(gf_isom_has_segment) ) #pragma comment (linker, EXPORT_SYMBOL(gf_isom_is_single_av) ) @@ -785,7 +789,6 @@ #pragma comment (linker, EXPORT_SYMBOL(gf_isom_3gp_config_update) ) #pragma comment (linker, EXPORT_SYMBOL(gf_isom_new_text_description) ) #pragma comment (linker, EXPORT_SYMBOL(gf_isom_new_text_sample) ) -#pragma comment (linker, EXPORT_SYMBOL(gf_isom_delete_text_sample) ) #pragma comment (linker, EXPORT_SYMBOL(gf_isom_text_reset) ) #pragma comment (linker, EXPORT_SYMBOL(gf_isom_text_add_text) ) #pragma comment (linker, EXPORT_SYMBOL(gf_isom_text_add_style) ) @@ -817,8 +820,6 @@ #pragma comment (linker, EXPORT_SYMBOL(gf_isom_set_meta_xml) ) #pragma comment (linker, EXPORT_SYMBOL(gf_isom_set_meta_xml_memory) ) #pragma comment (linker, EXPORT_SYMBOL(gf_isom_remove_meta_xml) ) -#pragma comment (linker, EXPORT_SYMBOL(gf_isom_extract_meta_xml) ) -#pragma comment (linker, EXPORT_SYMBOL(gf_isom_extract_meta_item) ) #pragma comment (linker, EXPORT_SYMBOL(gf_isom_apple_set_tag) ) #pragma comment (linker, EXPORT_SYMBOL(gf_isom_get_next_alternate_group_id) ) #pragma comment (linker, EXPORT_SYMBOL(gf_isom_set_ipod_compatible) ) @@ -868,6 +869,7 @@ /*isomedia_dev.h exports*/ #pragma comment (linker, EXPORT_SYMBOL(gf_isom_parse_texte_sample) ) +#pragma comment (linker, EXPORT_SYMBOL(gf_isom_delete_text_sample) ) #ifndef GPAC_DISABLE_STREAMING #pragma comment (linker, EXPORT_SYMBOL(gf_rtp_streamer_new) ) @@ -1057,8 +1059,9 @@ #pragma comment (linker, EXPORT_SYMBOL(gf_media_avc_rewrite_samples) ) #endif /*GPAC_DISABLE_MEDIA_IMPORT*/ +#ifndef GPAC_DISABLE_ISOM_WRITE #pragma comment (linker, EXPORT_SYMBOL(gf_media_change_par) ) - +#endif #ifndef GPAC_DISABLE_AV_PARSERS #pragma comment (linker, EXPORT_SYMBOL(gf_avc_get_sps_info) ) diff --git a/src/media_tools/media_import.c b/src/media_tools/media_import.c index f097a4a..5b632f5 100644 --- a/src/media_tools/media_import.c +++ b/src/media_tools/media_import.c @@ -6846,6 +6846,7 @@ GF_Err gf_media_change_pl(GF_ISOFile *file, u32 track, u32 profile, u32 level) #endif /*GPAC_DISABLE_MEDIA_IMPORT*/ +#ifndef GPAC_DISABLE_ISOM_WRITE GF_EXPORT GF_Err gf_media_change_par(GF_ISOFile *file, u32 track, s32 ar_num, s32 ar_den) { @@ -6897,3 +6898,4 @@ GF_Err gf_media_change_par(GF_ISOFile *file, u32 track, s32 ar_num, s32 ar_den) } return gf_isom_set_track_layout_info(file, track, tk_w<<16, tk_h<<16, 0, 0, 0); } +#endif /*GPAC_DISABLE_ISOM_WRITE*/ diff --git a/src/utils/os_net.c b/src/utils/os_net.c index 569916e..412a803 100644 --- a/src/utils/os_net.c +++ b/src/utils/os_net.c @@ -256,12 +256,14 @@ Bool gf_net_is_ipv6(const char *address) } #ifdef GPAC_HAS_IPV6 +#define MAX_PEER_NAME_LEN 1024 static struct addrinfo *gf_sk_get_ipv6_addr(const char *PeerName, u16 PortNumber, int family, int flags, int sock_type) { struct addrinfo *res=NULL; struct addrinfo hints; - char node[50], portstring[20], *service, *dest; - + char node[MAX_PEER_NAME_LEN], portstring[20]; + char *service, *dest; + service = dest = NULL; #ifdef WIN32 if (!wsa_init) { WSADATA Data; @@ -281,11 +283,12 @@ static struct addrinfo *gf_sk_get_ipv6_addr(const char *PeerName, u16 PortNumber service = (char *)portstring; } if (PeerName) { - strcpy(node, PeerName); + strncpy(node, PeerName, MAX_PEER_NAME_LEN); if (node[0]=='[') { node[strlen(node)-1] = 0; - strcpy(node, &node[1]); + strncpy(node, &node[1], MAX_PEER_NAME_LEN); } + node[MAX_PEER_NAME_LEN - 1] = 0; dest = (char *) node; } if (getaddrinfo((const char *)dest, (const char *)service, &hints, &res) != 0) return NULL; -- 2.30.2