Skip to content

Commit

Permalink
Merge branch 'buildbot-stacksize'
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanlf committed Oct 18, 2024
2 parents d032182 + 3bb379d commit 9c26192
Show file tree
Hide file tree
Showing 52 changed files with 2,059 additions and 2,449 deletions.
40 changes: 20 additions & 20 deletions applications/gpac/compositor_tools.c
Original file line number Diff line number Diff line change
Expand Up @@ -1225,21 +1225,22 @@ Bool mp4c_task()
return GF_FALSE;
}

static char szBuf[8192];

Bool mp4c_handle_prompt(u8 char_val)
{
MP4C_Command cmdtype = get_gui_cmd(char_val);
switch (cmdtype) {
case MP4C_OPEN:
{
char szURL[2000];
gf_sc_disconnect(compositor);
fprintf(stderr, "Enter the absolute URL\n");
if (1 > scanf("%1999s", szURL)) {
if (1 > scanf("%8191s", szBuf)) {
fprintf(stderr, "Cannot read absolute URL, aborting\n");
break;
}
if (rti_file) init_rti_logs(rti_file, use_rtix);
gf_sc_connect_from_time(compositor, szURL, 0, 0, 0, NULL);
gf_sc_connect_from_time(compositor, szBuf, 0, 0, 0, NULL);
}
break;
case MP4C_RELOAD:
Expand Down Expand Up @@ -1333,21 +1334,21 @@ Bool mp4c_handle_prompt(u8 char_val)

case MP4C_DUMPSCENE:
if (is_connected) {
char radname[GF_MAX_PATH], *sExt;
char *sExt;
Bool xml_dump, std_out;
radname[0] = 0;
szBuf[0] = 0;
do {
fprintf(stderr, "Enter file radical name (+\'.x\' for XML dumping) - \"std\" for stderr: ");
fflush(stderr);
} while( 1 > scanf("%1023s", radname));
sExt = strrchr(radname, '.');
} while( 1 > scanf("%8191s", szBuf));
sExt = strrchr(szBuf, '.');
xml_dump = 0;
if (sExt) {
if (!stricmp(sExt, ".x")) xml_dump = 1;
sExt[0] = 0;
}
std_out = strnicmp(radname, "std", 3) ? 0 : 1;
GF_Err e = gf_sc_dump_scene(compositor, std_out ? NULL : radname, NULL, xml_dump, 0);
std_out = strnicmp(szBuf, "std", 3) ? 0 : 1;
GF_Err e = gf_sc_dump_scene(compositor, std_out ? NULL : szBuf, NULL, xml_dump, 0);
if (e<0)
fprintf(stderr, "Dump failed: %s\n", gf_error_to_string(e));
else
Expand Down Expand Up @@ -1395,42 +1396,41 @@ Bool mp4c_handle_prompt(u8 char_val)
break;
case MP4C_UPDATE:
{
char szCom[8192];
fprintf(stderr, "Enter command to send:\n");
szCom[0] = 0;
if (1 > scanf("%8191[^\t\n]", szCom)) {
szBuf[0] = 0;
if (1 > scanf("%8191[^\t\n]", szBuf)) {
fprintf(stderr, "Cannot read command to send, aborting.\n");
break;
}
GF_Err e = gf_sc_scene_update(compositor, NULL, szCom);
GF_Err e = gf_sc_scene_update(compositor, NULL, szBuf);
if (e) fprintf(stderr, "Processing command failed: %s\n", gf_error_to_string(e));
}
break;
case MP4C_EVALJS:
{
char jsCode[8192];
fprintf(stderr, "Enter JavaScript code to evaluate:\n");
jsCode[0] = 0;
if (1 > scanf("%8191[^\t\n]", jsCode)) {
szBuf[0] = 0;
if (1 > scanf("%8191[^\t\n]", szBuf)) {
fprintf(stderr, "Cannot read code to evaluate, aborting.\n");
break;
}
GF_Err e = gf_sc_scene_update(compositor, "application/ecmascript", jsCode);
GF_Err e = gf_sc_scene_update(compositor, "application/ecmascript", szBuf);
if (e) fprintf(stderr, "Processing JS code failed: %s\n", gf_error_to_string(e));
}
break;

case MP4C_LOGS:
{
char szLog[1024], *cur_logs;
char *cur_logs;
cur_logs = gf_log_get_tools_levels();
fprintf(stderr, "Enter new log level (current tools %s):\n", cur_logs);
gf_free(cur_logs);
if (scanf("%1023s", szLog) < 1) {
szBuf[0] = 0;
if (scanf("%8191s", szBuf) < 1) {
fprintf(stderr, "Cannot read new log level, aborting.\n");
break;
}
gf_log_modify_tools_levels(szLog);
gf_log_modify_tools_levels(szBuf);
}
break;

Expand Down
48 changes: 28 additions & 20 deletions applications/mp4box/filedump.c
Original file line number Diff line number Diff line change
Expand Up @@ -1523,7 +1523,7 @@ static GF_Err dump_isom_obu(GF_ISOFile *file, GF_ISOTrackID trackID, FILE *dump,
GF_Err e = GF_OK;
#if !defined(GPAC_DISABLE_AV_PARSERS) && !defined(GPAC_DISABLE_INSPECT)
u32 i, count, track, timescale;
AV1State av1;
AV1State *av1_state;
ObuType obu_type = 0;
u64 obu_size = 0;
u32 hdr_size = 0;
Expand All @@ -1532,10 +1532,13 @@ static GF_Err dump_isom_obu(GF_ISOFile *file, GF_ISOTrackID trackID, FILE *dump,

track = gf_isom_get_track_by_id(file, trackID);

gf_av1_init_state(&av1);
av1.config = gf_isom_av1_config_get(file, track, 1);
if (!av1.config) {
GF_SAFEALLOC(av1_state, AV1State);
if (!av1_state) return GF_OUT_OF_MEM;
gf_av1_init_state(av1_state);
av1_state->config = gf_isom_av1_config_get(file, track, 1);
if (!av1_state->config) {
M4_LOG(GF_LOG_ERROR, ("Error: Track #%d is not AV1!\n", trackID));
gf_free(av1_state);
return GF_ISOM_INVALID_FILE;
}

Expand All @@ -1546,16 +1549,17 @@ static GF_Err dump_isom_obu(GF_ISOFile *file, GF_ISOTrackID trackID, FILE *dump,

fprintf(dump, " <OBUConfig>\n");

for (i=0; i<gf_list_count(av1.config->obu_array); i++) {
GF_AV1_OBUArrayEntry *obu = gf_list_get(av1.config->obu_array, i);
for (i=0; i<gf_list_count(av1_state->config->obu_array); i++) {
GF_AV1_OBUArrayEntry *obu = gf_list_get(av1_state->config->obu_array, i);
bs = gf_bs_new(obu->obu, (u32) obu->obu_length, GF_BITSTREAM_READ);
e = gf_av1_parse_obu(bs, &obu_type, &obu_size, &hdr_size, &av1);
e = gf_av1_parse_obu(bs, &obu_type, &obu_size, &hdr_size, av1_state);
if (e<GF_OK) {
if (av1.config) gf_odf_av1_cfg_del(av1.config);
gf_av1_reset_state(&av1, GF_TRUE);
if (av1_state->config) gf_odf_av1_cfg_del(av1_state->config);
gf_av1_reset_state(av1_state, GF_TRUE);
gf_free(av1_state);
return e;
}
gf_inspect_dump_obu(dump, &av1, obu->obu, obu->obu_length, obu_type, obu_size, hdr_size, dump_crc);
gf_inspect_dump_obu(dump, av1_state, obu->obu, obu->obu_length, obu_type, obu_size, hdr_size, dump_crc);
gf_bs_del(bs);
}
fprintf(dump, " </OBUConfig>\n");
Expand Down Expand Up @@ -1584,14 +1588,14 @@ static GF_Err dump_isom_obu(GF_ISOFile *file, GF_ISOTrackID trackID, FILE *dump,

bs = gf_bs_new(ptr, size, GF_BITSTREAM_READ);
while (size) {
e = gf_av1_parse_obu(bs, &obu_type, &obu_size, &hdr_size, &av1);
e = gf_av1_parse_obu(bs, &obu_type, &obu_size, &hdr_size, av1_state);
if (e<GF_OK) break;

if (obu_size > size) {
fprintf(dump, " <!-- OBU number %d is corrupted: size is %d but only %d remains -->\n", idx, (u32) obu_size, size);
break;
}
gf_inspect_dump_obu(dump, &av1, ptr, obu_size, obu_type, obu_size, hdr_size, dump_crc);
gf_inspect_dump_obu(dump, av1_state, ptr, obu_size, obu_type, obu_size, hdr_size, dump_crc);
ptr += obu_size;
size -= (u32)obu_size;
idx++;
Expand All @@ -1608,8 +1612,9 @@ static GF_Err dump_isom_obu(GF_ISOFile *file, GF_ISOTrackID trackID, FILE *dump,
fprintf(dump, " </OBUSamples>\n");
fprintf(dump, "</OBUTrack>\n");

if (av1.config) gf_odf_av1_cfg_del(av1.config);
gf_av1_reset_state(&av1, GF_TRUE);
if (av1_state->config) gf_odf_av1_cfg_del(av1_state->config);
gf_av1_reset_state(av1_state, GF_TRUE);
gf_free(av1_state);
#endif
return e;
}
Expand Down Expand Up @@ -2991,9 +2996,10 @@ static void DumpStsdInfo(GF_ISOFile *file, u32 trackNum, Bool full_dump, Bool du
GF_HEVCConfig *hevccfg, *lhvccfg;
GF_OperatingPointsInformation *oinf;
#if !defined(GPAC_DISABLE_AV_PARSERS)
HEVCState hevc_state;
memset(&hevc_state, 0, sizeof(HEVCState));
hevc_state.sps_active_idx = -1;
HEVCState *hvc_state;
GF_SAFEALLOC(hvc_state, HEVCState);
if (!hvc_state) return;
hvc_state->sps_active_idx = -1;
#endif

gf_isom_get_visual_info(file, trackNum, stsd_idx, &w, &h);
Expand Down Expand Up @@ -3024,7 +3030,7 @@ static void DumpStsdInfo(GF_ISOFile *file, u32 trackNum, Bool full_dump, Bool du
if (hevccfg) {
dump_hevc_track_info(file, trackNum, hevccfg
#if !defined(GPAC_DISABLE_AV_PARSERS)
, &hevc_state
, hvc_state
#endif
);
gf_odf_hevc_cfg_del(hevccfg);
Expand All @@ -3033,12 +3039,14 @@ static void DumpStsdInfo(GF_ISOFile *file, u32 trackNum, Bool full_dump, Bool du
if (lhvccfg) {
dump_hevc_track_info(file, trackNum, lhvccfg
#if !defined(GPAC_DISABLE_AV_PARSERS)
, &hevc_state
, hvc_state
#endif
);
gf_odf_hevc_cfg_del(lhvccfg);
}

#if !defined(GPAC_DISABLE_AV_PARSERS)
gf_free(hvc_state);
#endif
if (gf_isom_get_oinf_info(file, trackNum, &oinf)) {
fprintf(stderr, "\n\tOperating Points Information -");
fprintf(stderr, " scalability_mask %d (", oinf->scalability_mask);
Expand Down
Loading

0 comments on commit 9c26192

Please sign in to comment.