Skip to content

Commit

Permalink
Merge branch 'master' into gpac-html
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanlf committed Apr 17, 2024
2 parents 02ae863 + cef9cec commit f6257d0
Show file tree
Hide file tree
Showing 65 changed files with 1,847 additions and 679 deletions.
19 changes: 11 additions & 8 deletions Changelog
@@ -1,22 +1,23 @@
# On-going: GPAC 2.3-DEV

## Emscripten support
## Emscripten|WebAssembly(WASM) support
- Session can run in worker or in main browser loop
- Automatic disable of ffdec and ffenc threads when not running in worker
- Use fetch() api for downloader
- Support for WebCodecs
- Support for getUserMedia and canvas readable streams
- gpac.html demo page


## Media Formats
- Fixes in text subtitle converters
- Improved DV muxing from mkv
- Improved DolbyVision muxing from mkv
- Dasher support for inputs with multiple stsd entries
- Allow multiplexed representations for LL-HLS
- Improved eac3 support
- QT cmov support (reading and writing)
- QT lpcm support
- Improved chaptering support
- Improved timecode inspection
- Support for big-endian PCM formats
- Support for uncv (raw video in mp4 and heif)
- Support for forced subtitles
Expand All @@ -25,7 +26,7 @@
## Filters
- Async HTTP request in all filters
- JS/Python/NodeJS bindings for httpout server
- Fixed cors and mime types in httpout for wasm and sharedArrayuffer support
- Fixed CORS and mime types in httpout for wasm and sharedArrayuffer support
- Allow compilation without threads
- Allow compilation without network
- Fixed GF_FileIO for async read and write modes
Expand All @@ -40,16 +41,18 @@
- MPEG-H decoder using IIS mpeghdec
- Templating for property assignment
- Conditional filter replacement to identify based on codecID
- Per-filter logging

## MP4Box
- add track reordering option
- Add track reordering option

## Misc
- Migrated doc from github's wiki to wiki.gpac.io
- FFMPEG 6 support
- Added features for configure (vout, aout, fonts, doc, evg)
- Allow specifying network interface by name or IP instead of IP only
- UDP/TCP recording to GPAC gpc files
- UDP/TCP capture playback and filtering from pcap, pcapng and gpc files
- Allow specifying network interface by name or IP (instead of IP only)
- UDP/TCP filtering and recording to / playback from pcap, pcapng and GPAC gpc files
- Added Nix and Docker build files


# 19/12/2022: GPAC 2.2
Expand Down
9 changes: 9 additions & 0 deletions applications/gpac/gpac.c
Expand Up @@ -557,6 +557,7 @@ int gpac_main(int _argc, char **_argv)
#endif

if (do_creds) {
gf_sys_set_args(argc, (const char **)argv);
return gpac_do_creds(creds_args);
}

Expand Down Expand Up @@ -3210,6 +3211,10 @@ static int gpac_do_creds(char *creds_args)
fprintf(stdout, "Users in group: %s\n", g);
} else {
fprintf(stdout, "No such group %s\n", creds_args);
if (gf_sys_is_test_mode()) {
if (creds) gf_cfg_del(creds);
return 0;
}
goto err_exit;
}
}
Expand All @@ -3219,6 +3224,10 @@ static int gpac_do_creds(char *creds_args)
u32 keys = gf_cfg_get_key_count(creds, creds_args);
if (!keys && !is_add) {
fprintf(stderr, "No such user %s\n", creds_args);
if (gf_sys_is_test_mode()) {
if (creds) gf_cfg_del(creds);
return 0;
}
goto err_exit;
}

Expand Down
20 changes: 15 additions & 5 deletions applications/gpac/gpac_help.c
Expand Up @@ -2,7 +2,7 @@
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2017-2023
* Copyright (c) Telecom ParisTech 2017-2024
* All rights reserved
*
* This file is part of GPAC / gpac application
Expand Down Expand Up @@ -491,6 +491,7 @@ const char *gpac_doc =
"- gpac: argument separator for URLs (no value)\n"
"- ccp: filter replacement control (string list value)\n"
"- NCID: ID of netcap configuration to use (string)\n"
"- LT: set additionnal log tools and levels for the filter usin same syntax as -logs, e.g. `:LT=filter@debug` (string value)\n"
"- DBG: debug missing input PID property (`=pid`), missing input packet property (`=pck`) or both (`=all`)\n"
"\n"
"The buffer control options are used to change the default buffering of PIDs of a filter:\n"
Expand Down Expand Up @@ -1495,7 +1496,10 @@ static void print_filter_arg(const GF_FilterArgs *a, u32 gen_doc)
gf_sys_format_help(helpout, help_flags | GF_PRINTARG_HIGHLIGHT_FIRST, "%s", a->arg_name);
gf_sys_format_help(helpout, help_flags, "</a> (%s", is_enum ? "enum" : gf_props_get_type_name(a->arg_type));
} else {
gf_sys_format_help(helpout, help_flags | GF_PRINTARG_HIGHLIGHT_FIRST, "%s (%s", a->arg_name, is_enum ? "enum" : gf_props_get_type_name(a->arg_type));
gf_sys_format_help(helpout, help_flags | GF_PRINTARG_HIGHLIGHT_FIRST, "%s (%s%s", a->arg_name,
is_enum ? "enum" : gf_props_get_type_name(a->arg_type),
(a->flags & GF_FS_ARG_META_ARRAY) ? " array" : ""
);
}
if (a->arg_default_val) {
if (!strcmp(a->arg_default_val, "2147483647"))
Expand All @@ -1508,10 +1512,11 @@ static void print_filter_arg(const GF_FilterArgs *a, u32 gen_doc)
// gf_sys_format_help(helpout, help_flags, ", no default");
}
if (a->min_max_enum && !is_enum) {
const char *min_max_type = strchr(a->min_max_enum, '|') ? "Enum" : "minmax";
if (!strcmp(a->min_max_enum, "-2147483648-I"))
gf_sys_format_help(helpout, help_flags, ", %s: -I-I", /*strchr(a->min_max_enum, '|') ? "Enum" : */"minmax");
gf_sys_format_help(helpout, help_flags, ", %s: -I-I", min_max_type);
else
gf_sys_format_help(helpout, help_flags, ", %s: %s", /*strchr(a->min_max_enum, '|') ? "Enum" : */"minmax", a->min_max_enum);
gf_sys_format_help(helpout, help_flags, ", %s: %s", min_max_type, a->min_max_enum);
}
if (a->flags & GF_FS_ARG_UPDATE) gf_sys_format_help(helpout, help_flags, ", updatable");
// if (a->flags & GF_FS_ARG_META) gf_sys_format_help(helpout, help_flags, ", meta");
Expand Down Expand Up @@ -1836,7 +1841,12 @@ static void print_filter(const GF_FilterRegister *reg, GF_SysArgMode argmode, GF

if (a->min_max_enum) {
//check format
if ((a->arg_type!=GF_PROP_UINT_LIST) && !(a->flags&GF_FS_ARG_META) && strchr(a->min_max_enum, '|') && (!a->arg_default_val || strcmp(a->arg_default_val, "-1")) ) {
if ((a->arg_type!=GF_PROP_UINT_LIST)
&& (a->arg_type<GF_PROP_FIRST_ENUM)
&& !(a->flags&GF_FS_ARG_META)
&& strchr(a->min_max_enum, '|')
&& (!a->arg_default_val || strcmp(a->arg_default_val, "-1"))
) {
const char *a_val = a->min_max_enum;
while (a_val[0] == '|') a_val++;
if (strstr(a->arg_desc, "see filter "))
Expand Down
4 changes: 3 additions & 1 deletion applications/mp4box/fileimport.c
Expand Up @@ -653,7 +653,7 @@ GF_Err apply_edits(GF_ISOFile *dest, u32 track, char *edits)
frac /= media_rate.den;
rate = (rate<<16) | (u16) frac;
//adjust media dur if rate > 1
if (media_rate.num>media_rate.den) {
if (media_rate.num > (s64) media_rate.den) {
media_dur = media_dur*media_rate.den / media_rate.num;
}
}
Expand Down Expand Up @@ -2879,6 +2879,8 @@ GF_Err cat_isomedia_file(GF_ISOFile *dest, char *fileName, u32 import_flags, GF_
if (gf_isom_get_sample_description_count(orig, i+1) != gf_isom_get_sample_description_count(dest, dst_tk)) dst_tk = 0;
/*if not forcing cat, check the media codec config is the same*/
if (!gf_isom_is_same_sample_description(orig, i+1, 0, dest, dst_tk, 0)) {
//we will need to merge the same descriptions
if (!force_cat && !dst_tk_sample_entry) dst_tk_sample_entry = dst_tk;
dst_tk = 0;
}
/*we force the same visual resolution*/
Expand Down
18 changes: 18 additions & 0 deletions include/gpac/constants.h
Expand Up @@ -1001,6 +1001,24 @@ u16 gf_audio_fmt_get_dolby_chanmap(u32 cicp_layout);
\return CICP code point, or 0 if no more to enumerate*/
u32 gf_audio_fmt_cicp_enum(u32 idx, const char **short_name, u64 *ch_mask);

/*! get CICP code from name
\param name channel layout name
\return channel CICP code
*/
u32 gf_audio_fmt_get_cicp_from_name(const char *name);

/*! get CICP name from code
\param cicp_code channel cicp code
\return channel CICP name
*/
const char *gf_audio_fmt_get_cicp_name(u32 cicp_code);

/*! get all CICP layout names
\return CICP names separated with '|'
*/
const char *gf_audio_fmt_cicp_all_names();


/*! Color primaries as defined by ISO/IEC 23001-8 / 23091-2
*/
typedef enum
Expand Down
2 changes: 2 additions & 0 deletions include/gpac/crypt_tools.h
Expand Up @@ -192,6 +192,8 @@ typedef struct

/*! CENS/CBCS pattern */
u32 crypt_byte_block, skip_byte_block;
/*! forces a minimum clear range for subsamples (ignored otherwise) - the final offset is at least the slice header size*/
u32 crypt_byte_offset;

/* ! for avc1 ctr CENC edition 1 */
Bool allow_encrypted_slice_header;
Expand Down
22 changes: 19 additions & 3 deletions include/gpac/filters.h
Expand Up @@ -238,7 +238,10 @@ typedef enum
GF_FS_FLAG_REQUIRE_SOURCE_ID = 1<<12,
/*! Flag set to force all explicitly added filters to be loaded in deferred link state - linking will only happen once \ref gf_filter_reconnect_output is called on the filter.
*/
GF_FS_FLAG_FORCE_DEFER_LINK = 1<<13
GF_FS_FLAG_FORCE_DEFER_LINK = 1<<13,
/*! Flag set to ignore all PLAY events from sinks - use \ref gf_fs_send_deferred_play to start playback
*/
GF_FS_FLAG_PREVENT_PLAY = 1<<14
} GF_FilterSessionFlags;

/*! Creates a new filter session. This will also load all available filter registers not blacklisted.
Expand Down Expand Up @@ -286,7 +289,7 @@ Generic filter options are:
- ccp: filter replacement control (string list value)
- NCID: ID of netcap configuration to use (string)
- DBG: debug missing input PID property (`=pid`), missing input packet property (`=pck`) or both (`=all`)
- DL: enable defer linkling of filter (no value) - the filter output pids will not be connected until a call to \ref gf_filter_reconnect_output
- DL: enable defer linking of filter (no value) - the filter output pids will not be connected until a call to \ref gf_filter_reconnect_output
\param session filter session
Expand Down Expand Up @@ -420,6 +423,11 @@ void gf_fs_add_filter_register(GF_FilterSession *session, const GF_FilterRegiste
*/
void gf_fs_remove_filter_register(GF_FilterSession *session, GF_FilterRegister *freg);

/*! Sends PLAY event on all sinks, ignored if GF_FS_FLAG_PREVENT_PLAY flag is not set
\param session filter session
*/
void gf_fs_send_deferred_play(GF_FilterSession *session);

/*! Posts a user task to the session
\param session filter session
\param task_execute the callback function for the task. The callback can return:
Expand Down Expand Up @@ -893,6 +901,8 @@ typedef enum
GF_PROP_CICP_COL_TFC = GF_PROP_FIRST_ENUM+3,
/*! CICP Color Matrix*/
GF_PROP_CICP_COL_MX = GF_PROP_FIRST_ENUM+4,
/*! CICP Layout*/
GF_PROP_CICP_LAYOUT = GF_PROP_FIRST_ENUM+5,
/*! not allowed*/
GF_PROP_LAST_DEFINED
} GF_PropType;
Expand Down Expand Up @@ -2017,6 +2027,8 @@ typedef enum
The filter should lock itself whenever appropriate using \ref gf_filter_lock
*/
GF_FS_ARG_UPDATE_SYNC = 1<<8,
/*! internal flag used by meta filters (ffmpeg & co) to indicate the argument is an array of the indicated type*/
GF_FS_ARG_META_ARRAY = 1<<9,
} GF_FSArgumentFlags;

/*! Structure holding arguments for a filter*/
Expand Down Expand Up @@ -2313,14 +2325,18 @@ typedef enum
GF_FS_REG_FORCE_REMUX = 1<<12,
/*! Indicates the filter must always be run by the same thread, except for the initialize and finalize methods*/
GF_FS_REG_SINGLE_THREAD = 1<<13,
/*! Indicates the filter needs to be initialized even if temoorary - see \ref gf_filter_is_temporary. Always enabled if GF_FS_REG_META is set */
/*! Indicates the filter needs to be initialized even if temporary - see \ref gf_filter_is_temporary. Always enabled if GF_FS_REG_META is set */
GF_FS_REG_TEMP_INIT = 1<<14,
/*! Indicates the filter uses libc sync file read - only needed for emscripten multithreaded support for now, translated into GF_FS_REG_MAIN_THREAD */
GF_FS_REG_USE_SYNC_READ = 1<<15,
/*! Indicates the filter may block the main thread (configure, process) - only needed for emscripten multithreaded support*/
GF_FS_REG_BLOCK_MAIN = 1<<16,
/*! Indicates the filter uses async tools (JS promises & co) blocking the calling thread until resolved - only needed for emscripten multithreaded support*/
GF_FS_REG_ASYNC_BLOCK = 1<<17,
/*! Indicates a dynamic instance of the filter can be reused in resolver even if the source PID already has a possible link to an explicit non-sink filter
This is typically required by PID merger filters allowing implicit loading (tileagg, hevcmerge, etc)
*/
GF_FS_REG_DYNAMIC_REUSE = 1<<18,


/*! flag dynamically set at runtime for custom filters*/
Expand Down
1 change: 1 addition & 0 deletions include/gpac/internal/media_dev.h
Expand Up @@ -993,6 +993,7 @@ typedef struct

//set to one if a temporal delim is found when calling aom_av1_parse_temporal_unit_from_section5
u8 has_temporal_delim;
u8 has_frame_data;
} AV1State;

GF_Err aom_av1_parse_temporal_unit_from_section5(GF_BitStream *bs, AV1State *state);
Expand Down
39 changes: 37 additions & 2 deletions include/gpac/tools.h
Expand Up @@ -397,7 +397,18 @@ Validate and parse str into integer
\param ans integer to fill
\return GF_TRUE if str represents an integer without any leading space nor extra chars
*/
Bool gf_strict_atoi(const char* str, int* ans);
Bool gf_strict_atoi(const char* str, s32* ans);

/*!
\brief strict convert str into unsigned integer
Validate and parse str into integer
\param str text to convert to integer
\param ans unsigned integer to fill
\return GF_TRUE if str represents an unsigned integer without any leading space nor extra chars
*/
Bool gf_strict_atoui(const char* str, u32* ans);


/*! @} */

Expand Down Expand Up @@ -804,6 +815,7 @@ typedef enum
/*! special value used to set a level for all tools*/
GF_LOG_ALL,
GF_LOG_TOOL_MAX = GF_LOG_ALL,
GF_LOG_TOOL_UNDEFINED
} GF_LOG_Tool;

/*!
Expand Down Expand Up @@ -945,7 +957,30 @@ Resets log file if any log file name was specified, by closing and reopening a n
*/
void gf_log_reset_file();


//! Extra log instructions
typedef struct log_extra
{
//! number of tools and levels
u32 nb_tools;
//! additionnal tools
GF_LOG_Tool *tools;
//! additionnal levels for the tools
GF_LOG_Level *levels;
//! exit if error
Bool strict;
} GF_LogExtra;

/*! Register a new extra log levels
\param log extra levels to add - may be NULL but shall be valid until call to \ref gf_log_pop_extra or \ref gf_log_reset_extras or end of app
*/
void gf_log_push_extra(const GF_LogExtra *log);
/*! Unregister an extra log levels
\param log extra levels to add - may be NULL
*/
void gf_log_pop_extra(const GF_LogExtra *log);
/*! Unregister all extra log levels
*/
void gf_log_reset_extras();

/*! @} */

Expand Down

0 comments on commit f6257d0

Please sign in to comment.