Index: head/multimedia/gpac-libgpac/Makefile =================================================================== --- head/multimedia/gpac-libgpac/Makefile (revision 542530) +++ head/multimedia/gpac-libgpac/Makefile (revision 542531) @@ -1,61 +1,66 @@ # Created by: Michael Johnson # $FreeBSD$ PORTNAME= gpac -PORTVERSION= 0.5.0 -PORTREVISION= 2 +DISTVERSIONPREFIX= v +DISTVERSION= 1.0.0 PORTEPOCH= 1 CATEGORIES= multimedia -MASTER_SITES= SF/${PORTNAME}/GPAC/GPAC%20${PORTVERSION} PKGNAMESUFFIX= -libgpac MAINTAINER= multimedia@FreeBSD.org COMMENT= Gpac MPEG-4 Systems library and headers LICENSE= LGPL21 -WRKSRC= ${WRKDIR}/gpac +BUILD_DEPENDS= bash:shells/bash + ALL_TARGET= lib INSTALL_TARGET= install-lib -USES= gmake dos2unix +USES= gmake dos2unix shebangfix +SHEBANG_FILES= check_revision.sh +bash_OLD_CMD+= /bin/sh +USE_GITHUB= yes +GH_ACCOUNT= gpac +GH_PROJECT= gpac HAS_CONFIGURE= yes USE_LDCONFIG= yes DOS2UNIX_FILES= src/utils/os_config_init.c OPTIONS_DEFINE= IPV6 JPEG OPENGL SSL PNG XVIDEO OPTIONS_DEFAULT= JPEG SSL PNG CFLAGS+= -I${WRKSRC}/include -I${LOCALBASE}/include LDFLAGS+= -L${LOCALBASE}/lib CONFIGURE_ARGS= --prefix="${PREFIX}" --cc="${CC}" --X11-path="${LOCALBASE}" \ --extra-cflags="${CFLAGS}" --extra-ldflags="${LDFLAGS}" \ --enable-pic \ --disable-wx \ --use-js=no --use-a52=no --use-faad=no --use-ffmpeg=no \ --use-ft=no --use-mad=no --use-ogg=no --use-xvid=no \ --use-openjpeg=no --use-theora=no --use-vorbis=no SSL_USES= ssl SSL_CONFIGURE_ENABLE= ssl OPENGL_USES= gl OPENGL_USE= GL=gl GL=glu OPENGL_CONFIGURE_ENABLE=3d XVIDEO_LIB_DEPENDS= libXv.so:x11/libXv XVIDEO_CONFIGURE_OFF= --disable-x11-xv --disable-x11-shm IPV6_CONFIGURE_ENABLE= ipv6 JPEG_USES= jpeg JPEG_CONFIGURE_ON= --use-jpeg=local JPEG_CONFIGURE_OFF= --use-jpeg=no PNG_LIB_DEPENDS= libpng.so:graphics/png PNG_CONFIGURE_ON= --use-png=local PNG_CONFIGURE_OFF= --use-png=no post-patch: ${REINPLACE_CMD} -e 's|s/\.\*\\(\[0-9\]\\)\\+\$$/\\1/|s/^[^0-9]*//| ;\ /CFLAGS=/s/-O3//' ${WRKSRC}/configure post-install: ${INSTALL_DATA} ${WRKSRC}/gpac.pc ${STAGEDIR}${PREFIX}/libdata/pkgconfig .include Index: head/multimedia/gpac-libgpac/distinfo =================================================================== --- head/multimedia/gpac-libgpac/distinfo (revision 542530) +++ head/multimedia/gpac-libgpac/distinfo (revision 542531) @@ -1,2 +1,3 @@ -SHA256 (gpac-0.5.0.tar.gz) = 42971ac39511a1b6d1db39af664ce887b38c8657328c88cd200d87a02de81c24 -SIZE (gpac-0.5.0.tar.gz) = 7861057 +TIMESTAMP = 1595078627 +SHA256 (gpac-gpac-v1.0.0_GH0.tar.gz) = ebcca41993e51706c891dba4e9fe03b59bc671c41910bc6c303ba3feeb7f1b20 +SIZE (gpac-gpac-v1.0.0_GH0.tar.gz) = 10289999 Index: head/multimedia/gpac-libgpac/files/patch-export-x264-symbols =================================================================== --- head/multimedia/gpac-libgpac/files/patch-export-x264-symbols (revision 542530) +++ head/multimedia/gpac-libgpac/files/patch-export-x264-symbols (nonexistent) @@ -1,28 +0,0 @@ ---- src/isomedia/avc_ext.c.orig 2012-03-27 13:48:05.000000000 +0400 -+++ src/isomedia/avc_ext.c 2013-03-12 01:00:39.595690860 +0400 -@@ -170,6 +170,7 @@ - - - #ifndef GPAC_DISABLE_ISOM_WRITE -+GF_EXPORT - GF_Err gf_isom_avc_config_new(GF_ISOFile *the_file, u32 trackNumber, GF_AVCConfig *cfg, char *URLname, char *URNname, u32 *outDescriptionIndex) - { - GF_TrackBox *trak; ---- src/isomedia/isom_write.c.orig 2012-03-29 16:36:23.000000000 +0400 -+++ src/isomedia/isom_write.c 2013-03-12 01:00:39.605699394 +0400 -@@ -1140,6 +1140,7 @@ - return Track_SetStreamDescriptor(trak, StreamDescriptionIndex, entry->dataReferenceIndex, esd, NULL); - } - -+GF_EXPORT - GF_Err gf_isom_set_visual_info(GF_ISOFile *movie, u32 trackNumber, u32 StreamDescriptionIndex, u32 Width, u32 Height) - { - GF_Err e; -@@ -1187,6 +1188,7 @@ - } - } - -+GF_EXPORT - GF_Err gf_isom_set_pixel_aspect_ratio(GF_ISOFile *movie, u32 trackNumber, u32 StreamDescriptionIndex, u32 hSpacing, u32 vSpacing) - { - GF_Err e; Property changes on: head/multimedia/gpac-libgpac/files/patch-export-x264-symbols ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/multimedia/gpac-libgpac/files/patch-src-utils-os_config_init.c =================================================================== --- head/multimedia/gpac-libgpac/files/patch-src-utils-os_config_init.c (revision 542530) +++ head/multimedia/gpac-libgpac/files/patch-src-utils-os_config_init.c (revision 542531) @@ -1,39 +1,36 @@ ---- src/utils/os_config_init.c.orig 2012-03-27 13:48:05.000000000 +0400 -+++ src/utils/os_config_init.c 2013-10-12 14:29:52.214068862 +0400 -@@ -51,6 +51,9 @@ +--- src/utils/os_config_init.c.orig 2020-06-16 16:17:17 UTC ++++ src/utils/os_config_init.c +@@ -58,6 +58,9 @@ #else #ifdef GPAC_CONFIG_LINUX #include +#elif defined GPAC_CONFIG_FREEBSD +#include +#include #endif - #define CFG_FILE_NAME ".gpacrc" - #define TEST_MODULE "gm_dummy_in.so" -@@ -225,7 +228,11 @@ - { - char app_path[GF_MAX_PATH]; + #ifdef GPAC_CONFIG_ANDROID + #define DEFAULT_ANDROID_PATH_APP "/data/data/com.gpac.Osmo4" +@@ -294,6 +297,8 @@ static Bool get_default_install_path(char *file_path, char *sep; -+#ifdef GPAC_CONFIG_FREEBSD + #if (defined(__DARWIN__) || defined(__APPLE__) || defined(GPAC_CONFIG_LINUX)) + u32 size; ++#elif defined(GPAC_CONFIG_FREEBSD) + size_t size = GF_MAX_PATH; -+#else - u32 size = GF_MAX_PATH; -+#endif + #endif /*on OSX, Linux & co, user home is where we store the cfg file*/ - if (path_type==GF_PATH_CFG) { -@@ -252,6 +259,14 @@ - if (sep) sep[0] = 0; - return 1; - } +@@ -369,6 +374,14 @@ static Bool get_default_install_path(char *file_path, + if (sep) { + strcpy(file_path, sep); + } ++ return 1; ++ } +#elif defined(GPAC_CONFIG_FREEBSD) + int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 }; + sysctl(mib, 4, file_path, &size, NULL, 0); + if (size>0) { + char *sep = strrchr(file_path, '/'); + if (sep) sep[0] = 0; -+ return 1; -+ } + return 1; + } #endif - return 0; - } Index: head/multimedia/gpac-libgpac/files/patch-src-utils-os_divers.c =================================================================== --- head/multimedia/gpac-libgpac/files/patch-src-utils-os_divers.c (revision 542530) +++ head/multimedia/gpac-libgpac/files/patch-src-utils-os_divers.c (revision 542531) @@ -1,126 +1,126 @@ ---- src/utils/os_divers.c.orig 2012-04-04 18:47:33.000000000 +0400 -+++ src/utils/os_divers.c 2013-10-12 14:25:42.047109095 +0400 -@@ -1533,6 +1533,123 @@ +--- src/utils/os_divers.c.orig 2020-06-16 16:17:17 UTC ++++ src/utils/os_divers.c +@@ -1680,6 +1680,123 @@ Bool gf_sys_get_rti_os(u32 refresh_time_ms, GF_SystemR return 1; } +#elif defined GPAC_CONFIG_FREEBSD + +#include +#include +#include +#include + +#define GETSYSCTL(name, var) getsysctl(name, &(var), sizeof(var)) +int getsysctl(const char *name, void *ptr, size_t len) { + size_t nlen = len; + if (sysctlbyname(name, ptr, &nlen, NULL, 0) == -1) { + GF_LOG(GF_LOG_ERROR, GF_LOG_CORE, ("[RTI] sysctl(%s...) failed: %s\n", name, strerror(errno))); + return -1; + } + if (nlen != len) { + GF_LOG(GF_LOG_ERROR, GF_LOG_CORE, ("[RTI] sysctl(%s...) expected %lu, got %lu\n", + name, (unsigned long)len, (unsigned long)nlen)); + return -1; + } + return 0; +} + +static int stathz = 128; + +Bool gf_sys_get_rti_os(u32 refresh_time_ms, GF_SystemRTInfo *rti, u32 flags) +{ + size_t length; + u32 entry_time; + struct kinfo_proc kinfo; + unsigned long result; + u32 u_k_time = 0, idle_time = 0; + u64 process_u_k_time = 0; + long cp_time[CPUSTATES]; + struct clockinfo clockinfo; + + entry_time = gf_sys_clock(); + if (last_update_time && (entry_time - last_update_time < refresh_time_ms)) { + memcpy(rti, &the_rti, sizeof(GF_SystemRTInfo)); + return 0; + } + + int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, the_rti.pid }; + length = sizeof(kinfo); + + if (sysctl(mib, 4, &kinfo, &length, NULL, 0) == 0) { + process_u_k_time = (u64)(kinfo.ki_rusage.ru_utime.tv_usec + kinfo.ki_rusage.ru_stime.tv_usec) + + (u64)(kinfo.ki_rusage.ru_utime.tv_sec + kinfo.ki_rusage.ru_stime.tv_sec) * (u64)1000000; + } + + if (GETSYSCTL("kern.cp_time", cp_time) == 0) { + u_k_time = cp_time[CP_USER] + cp_time[CP_NICE] + cp_time[CP_SYS] + cp_time[CP_INTR]; + idle_time = cp_time[CP_IDLE]; + } + + the_rti.physical_memory = the_rti.physical_memory_avail = 0; + if (GETSYSCTL("hw.physmem", result) == 0) { + the_rti.physical_memory = result; + } + + if (GETSYSCTL("hw.usermem", result) == 0) { + the_rti.physical_memory_avail = result; + } + + the_rti.sampling_instant = last_update_time; + + if (last_update_time) { + the_rti.sampling_period_duration = (entry_time - last_update_time); + the_rti.process_cpu_time_diff = (process_u_k_time - last_process_k_u_time) / 1000; + + /*oops, we have no choice but to assume 100% cpu usage during this period*/ + if (!u_k_time) { + the_rti.total_cpu_time_diff = the_rti.sampling_period_duration; + u_k_time = last_cpu_u_k_time + the_rti.sampling_period_duration; + the_rti.cpu_idle_time = 0; + the_rti.total_cpu_usage = 100; + if (!the_rti.process_cpu_time_diff) the_rti.process_cpu_time_diff = the_rti.total_cpu_time_diff; + the_rti.process_cpu_usage = (u32) ( 100 * the_rti.process_cpu_time_diff / the_rti.sampling_period_duration); + } else { + u64 samp_sys_time, cpu_idle_time; + /*move to ms (kern.cp_time gives times in 1/stathz unit*/ + the_rti.total_cpu_time_diff = (u_k_time - last_cpu_u_k_time) * 1000 / stathz; + + /*we're not that accurate....*/ + if (the_rti.total_cpu_time_diff > the_rti.sampling_period_duration) + the_rti.sampling_period_duration = the_rti.total_cpu_time_diff; + + if (!idle_time) idle_time = (the_rti.sampling_period_duration - the_rti.total_cpu_time_diff) * stathz / 1000; + samp_sys_time = u_k_time - last_cpu_u_k_time; + cpu_idle_time = idle_time - last_cpu_idle_time; + the_rti.total_cpu_usage = (u32) ( 100 * samp_sys_time / (cpu_idle_time + samp_sys_time ) ); + /*move to ms (kern.cp_time gives times in 1/stathz unit*/ + the_rti.cpu_idle_time = cpu_idle_time * 1000 / stathz; + if (!the_rti.process_cpu_time_diff) the_rti.process_cpu_time_diff = the_rti.total_cpu_time_diff; + the_rti.process_cpu_usage = (u32) ( stathz * the_rti.process_cpu_time_diff / (cpu_idle_time + samp_sys_time) / 10 ); + } + } else { + mem_at_startup = the_rti.physical_memory_avail; + if (GETSYSCTL("kern.clockrate", clockinfo) == 0) { + if (clockinfo.stathz > 0) { + stathz = clockinfo.stathz; + } + } + } + the_rti.process_memory = mem_at_startup - the_rti.physical_memory_avail; + +#ifdef GPAC_MEMORY_TRACKING + the_rti.gpac_memory = gpac_allocated_memory; +#endif + + last_process_k_u_time = process_u_k_time; + last_cpu_idle_time = idle_time; + last_cpu_u_k_time = u_k_time; + last_update_time = entry_time; + memcpy(rti, &the_rti, sizeof(GF_SystemRTInfo)); + return 1; +} + //linux #else Index: head/multimedia/gpac-libgpac/files/patch-src_quickjs_quickjs.c =================================================================== --- head/multimedia/gpac-libgpac/files/patch-src_quickjs_quickjs.c (nonexistent) +++ head/multimedia/gpac-libgpac/files/patch-src_quickjs_quickjs.c (revision 542531) @@ -0,0 +1,29 @@ +--- src/quickjs/quickjs.c.orig 2020-06-16 16:17:17 UTC ++++ src/quickjs/quickjs.c +@@ -38,6 +38,8 @@ + #include + #elif defined(__linux__) || defined(__NX__) + #include ++#elif defined(__FreeBSD__) ++#include + #endif + + #include "cutils.h" +@@ -1515,7 +1517,7 @@ static inline size_t js_def_malloc_usable_size(void *p + return _msize(ptr); + #elif defined(EMSCRIPTEN) + return 0; +-#elif defined(__linux__) || defined(__NX__) ++#elif defined(__linux__) || defined(__NX__) || defined(__FreeBSD__) + return malloc_usable_size(ptr); + #else + /* change this to `return 0;` if compilation fails */ +@@ -1589,7 +1591,7 @@ static const JSMallocFunctions def_malloc_funcs = { + (size_t (*)(const void *))_msize, + #elif defined(EMSCRIPTEN) + NULL, +-#elif defined(__linux__) || defined(__NX__) ++#elif defined(__linux__) || defined(__NX__) || defined(__FreeBSD__) + (size_t (*)(const void *))malloc_usable_size, + #else + /* change this to `NULL,` if compilation fails */ Property changes on: head/multimedia/gpac-libgpac/files/patch-src_quickjs_quickjs.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/multimedia/gpac-libgpac/pkg-plist =================================================================== --- head/multimedia/gpac-libgpac/pkg-plist (revision 542530) +++ head/multimedia/gpac-libgpac/pkg-plist (revision 542531) @@ -1,96 +1,98 @@ +include/gpac/00_doxy.h +include/gpac/Remotery.h include/gpac/ait.h +include/gpac/atsc.h include/gpac/avparse.h include/gpac/base_coding.h include/gpac/bifs.h include/gpac/bitstream.h include/gpac/cache.h include/gpac/color.h include/gpac/compositor.h include/gpac/config_file.h include/gpac/configuration.h include/gpac/constants.h include/gpac/crypt.h +include/gpac/crypt_tools.h +include/gpac/dash.h include/gpac/download.h include/gpac/dsmcc.h include/gpac/dvb_mpe.h -include/gpac/esi.h include/gpac/events.h include/gpac/events_constants.h -include/gpac/filestreamer.h +include/gpac/evg.h +include/gpac/filters.h +include/gpac/html5_media.h +include/gpac/html5_mse.h include/gpac/ietf.h include/gpac/internal/avilib.h include/gpac/internal/bifs_dev.h include/gpac/internal/bifs_tables.h include/gpac/internal/camera.h include/gpac/internal/compositor_dev.h include/gpac/internal/crypt_dev.h include/gpac/internal/dvb_mpe_dev.h include/gpac/internal/ietf_dev.h include/gpac/internal/isomedia_dev.h include/gpac/internal/laser_dev.h include/gpac/internal/m3u8.h include/gpac/internal/media_dev.h include/gpac/internal/mesh.h -include/gpac/internal/mpd.h include/gpac/internal/odf_dev.h include/gpac/internal/odf_parse_common.h include/gpac/internal/ogg.h include/gpac/internal/reedsolomon.h include/gpac/internal/scenegraph_dev.h -include/gpac/internal/smjs_api.h include/gpac/internal/swf_dev.h -include/gpac/internal/terminal_dev.h include/gpac/internal/vobsub.h include/gpac/ismacryp.h include/gpac/iso639.h include/gpac/isomedia.h include/gpac/laser.h include/gpac/list.h -include/gpac/math.h +include/gpac/main.h +include/gpac/maths.h include/gpac/media_tools.h include/gpac/mediaobject.h include/gpac/module.h include/gpac/modules/audio_out.h include/gpac/modules/codec.h +include/gpac/modules/compositor_ext.h include/gpac/modules/font.h include/gpac/modules/hardcoded_proto.h include/gpac/modules/ipmp.h -include/gpac/modules/js_usr.h -include/gpac/modules/raster2d.h -include/gpac/modules/service.h -include/gpac/modules/term_ext.h include/gpac/modules/video_out.h +include/gpac/mpd.h include/gpac/mpeg4_odf.h include/gpac/mpegts.h include/gpac/network.h include/gpac/nodes_mpeg4.h include/gpac/nodes_svg.h include/gpac/nodes_x3d.h -include/gpac/nodes_xbl.h include/gpac/options.h include/gpac/path2d.h -include/gpac/ringbuffer.h +include/gpac/revision.h include/gpac/rtp_streamer.h include/gpac/scene_engine.h include/gpac/scene_manager.h include/gpac/scenegraph.h include/gpac/scenegraph_svg.h include/gpac/scenegraph_vrml.h include/gpac/setup.h include/gpac/svg_types.h include/gpac/sync_layer.h include/gpac/term_info.h include/gpac/terminal.h include/gpac/thread.h include/gpac/token.h include/gpac/tools.h -include/gpac/unicode.h include/gpac/user.h include/gpac/utf.h include/gpac/version.h +include/gpac/webvtt.h include/gpac/xml.h lib/libgpac.so -lib/libgpac.so.2 -lib/libgpac.so.2.0.0 +lib/libgpac.so.10 +lib/libgpac.so.10.0.0 lib/libgpac_static.a libdata/pkgconfig/gpac.pc