From b82f9f21e7d06e2beb5b6b73f5e625a24cd77e8b Mon Sep 17 00:00:00 2001 From: "yilun.zhang" Date: Wed, 21 Oct 2026 16:34:48 +0800 Subject: [PATCH] Rebase latest oar Signed-off-by: yilun.zhang --- code/dep_external/src/oar | 2 +- .../codec/aac/aac_multistream_decoder.c | 5 +- .../codec/flac/flac_multistream_decoder.c | 2 +- .../codec/opus/opus_multistream2_decoder.c | 2 +- .../src/iamf_dec/codec/pcm/iamf_pcm_decoder.c | 4 +- code/src/iamf_dec/iamf_audio_block.c | 4 +- code/src/iamf_dec/iamf_database.c | 25 ++++----- code/src/iamf_dec/iamf_decoder.c | 29 +++++----- .../src/iamf_dec/iamf_element_reconstructor.c | 12 ++-- code/src/iamf_dec/iamf_post_processor.c | 4 +- code/src/iamf_dec/iamf_presentation.c | 49 ++++++++--------- code/src/iamf_dec/iamf_synchronizer.c | 4 +- code/src/iamf_dec/obu/audio_element_obu.c | 55 +++++++++---------- code/src/iamf_dec/obu/codec_config_obu.c | 12 ++-- code/src/iamf_dec/obu/iamf_obu.c | 2 +- code/src/iamf_dec/obu/metadata_obu.c | 2 +- code/src/iamf_dec/obu/mix_presentation_obu.c | 34 ++++++------ code/src/iamf_dec/obu/parameter_block_obu.c | 6 +- 18 files changed, 123 insertions(+), 130 deletions(-) diff --git a/code/dep_external/src/oar b/code/dep_external/src/oar index ca14b543..a7a5cc89 160000 --- a/code/dep_external/src/oar +++ b/code/dep_external/src/oar @@ -1 +1 @@ -Subproject commit ca14b54381b6e8482a72dcc65c3adb17d6751db0 +Subproject commit a7a5cc890ee088e71ff6dc13628e6e7fe74a1481 diff --git a/code/src/iamf_dec/codec/aac/aac_multistream_decoder.c b/code/src/iamf_dec/codec/aac/aac_multistream_decoder.c index b5dad549..53ac29c2 100755 --- a/code/src/iamf_dec/codec/aac/aac_multistream_decoder.c +++ b/code/src/iamf_dec/codec/aac/aac_multistream_decoder.c @@ -121,8 +121,7 @@ static int aac_multistream_decode_native( if (info) { fs = info->frameSize; if (fs > def_max_aac_frame_size) { - warning("frame size %d , is larger than %u", fs, - def_max_aac_frame_size); + warn("frame size %d , is larger than %u", fs, def_max_aac_frame_size); fs = def_max_aac_frame_size; } @@ -140,7 +139,7 @@ static int aac_multistream_decode_native( (*copy_channel_out)(out, st->buffer, fs, info->numChannels); out += (fs * info->numChannels); } else { - warning("Can not get stream info."); + warn("Can not get stream info."); } } diff --git a/code/src/iamf_dec/codec/flac/flac_multistream_decoder.c b/code/src/iamf_dec/codec/flac/flac_multistream_decoder.c index ca57a586..4bb87d20 100755 --- a/code/src/iamf_dec/codec/flac/flac_multistream_decoder.c +++ b/code/src/iamf_dec/codec/flac/flac_multistream_decoder.c @@ -172,7 +172,7 @@ static int flac_multistream_decode_native(flac_ms_decoder_t *st, } if (handle->fs != frame_size) - warning("Different frame size %d vs %d", frame_size, handle->fs); + warn("Different frame size %d vs %d", frame_size, handle->fs); ss = handle->fs * handle->stream_info.channels * 4; memcpy(out, handle->buffer, ss); diff --git a/code/src/iamf_dec/codec/opus/opus_multistream2_decoder.c b/code/src/iamf_dec/codec/opus/opus_multistream2_decoder.c index dcb84622..136425d1 100755 --- a/code/src/iamf_dec/codec/opus/opus_multistream2_decoder.c +++ b/code/src/iamf_dec/codec/opus/opus_multistream2_decoder.c @@ -208,7 +208,7 @@ int opus_multistream2_decode(Opus_Ms2_Decoder_t *st, uint8_t *buffer[], return opus_multistream2_decoder_decode_native( st, buffer, (opus_int32 *)size, pcm, frame_size, opus_copy_channel_out_short_plane); - warning("flag is 0x%x, is not implemented.", st->flags); + warn("flag is 0x%x, is not implemented.", st->flags); return IAMF_ERR_UNIMPLEMENTED; } diff --git a/code/src/iamf_dec/codec/pcm/iamf_pcm_decoder.c b/code/src/iamf_dec/codec/pcm/iamf_pcm_decoder.c index f6581bc1..321b4a9d 100755 --- a/code/src/iamf_dec/codec/pcm/iamf_pcm_decoder.c +++ b/code/src/iamf_dec/codec/pcm/iamf_pcm_decoder.c @@ -155,8 +155,8 @@ static int iamf_pcm_decode(iamf_codec_context_t *ths, uint8_t *buf[], ths->streams, frame_size, samples); if (samples != frame_size) - warning("real samples and frame size are different: %d vs %d", samples, - frame_size); + warn("real samples and frame size are different: %d vs %d", samples, + frame_size); c = 0; for (; c < ths->coupled_streams; ++c) { diff --git a/code/src/iamf_dec/iamf_audio_block.c b/code/src/iamf_dec/iamf_audio_block.c index 5d1b9f17..4cdbd7f8 100755 --- a/code/src/iamf_dec/iamf_audio_block.c +++ b/code/src/iamf_dec/iamf_audio_block.c @@ -176,7 +176,7 @@ int iamf_audio_block_channels_concat(iamf_audio_block_t* dst, num_samples = src[0]->num_samples_per_channel; if (num_samples > dst->capacity_per_channel) { - warning("iamf_audio_block_channels_concat: capacity exceeded!"); + warn("iamf_audio_block_channels_concat: capacity exceeded!"); return -22; } @@ -184,7 +184,7 @@ int iamf_audio_block_channels_concat(iamf_audio_block_t* dst, if (!src[i] || src[i]->num_samples_per_channel != num_samples // || dst->interleaved != src[i]->interleaved ) { - warning("iamf_audio_block_channels_concat error!"); + warn("iamf_audio_block_channels_concat error!"); return -22; } } diff --git a/code/src/iamf_dec/iamf_database.c b/code/src/iamf_dec/iamf_database.c index c3c821bb..bc1960b4 100755 --- a/code/src/iamf_dec/iamf_database.c +++ b/code/src/iamf_dec/iamf_database.c @@ -485,7 +485,7 @@ static int _iadb_descriptors_codec_config_obu_check_profile( if ((n >= def_max_codec_configs) || (n && !descriptors->num_lpcm_codec && cco->codec_id != ck_iamf_codec_id_lpcm)) { - warning("Too many codec configs or no LPCM codec config."); + warn("Too many codec configs or no LPCM codec config."); ret = def_error; } @@ -567,8 +567,8 @@ static int _iadb_descriptors_mix_presentation_obu_check_profile( def_value_wrap_instance_u32(first_aec->element_id), _iadb_audio_element_obu_find, &v); if (idx < 0) { - warning("Audio element %u not found for Mix Presentation %u.", - first_aec->element_id, mpo->mix_presentation_id); + warn("Audio element %u not found for Mix Presentation %u.", + first_aec->element_id, mpo->mix_presentation_id); } else { iamf_audio_element_obu_t *first_aeo = def_value_wrap_type_ptr(iamf_audio_element_obu_t, &v); @@ -583,8 +583,8 @@ static int _iadb_descriptors_mix_presentation_obu_check_profile( def_value_wrap_instance_u32(aec->element_id), _iadb_audio_element_obu_find, &v); if (idx < 0) { - warning("Audio element %u not found for Mix Presentation %u.", - aec->element_id, mpo->mix_presentation_id); + warn("Audio element %u not found for Mix Presentation %u.", + aec->element_id, mpo->mix_presentation_id); continue; } @@ -628,8 +628,8 @@ static int _iadb_descriptors_mix_presentation_obu_check_profile( def_value_wrap_instance_u32(aec->element_id), _iadb_audio_element_obu_find, &v); if (idx < 0) { - warning("Audio element %u not found for Mix Presentation %u.", - aec->element_id, mpo->mix_presentation_id); + warn("Audio element %u not found for Mix Presentation %u.", + aec->element_id, mpo->mix_presentation_id); continue; } iamf_audio_element_obu_t *aeo = @@ -654,7 +654,7 @@ static int _iadb_descriptors_mix_presentation_obu_check_profile( } if (ret != def_pass) - warning( + warn( "Mix Presentation OBU %u, element flags 0x%x(b01-obj, " "b10-chn), mix count %u", mpo->mix_presentation_id, element_flags, m); @@ -747,8 +747,8 @@ static int _iadb_audio_element_obu_add(iamf_database_t *database, if (vector_find(database->codec_configs, def_value_wrap_instance_u32(obu->codec_config_id), _iadb_codec_config_find, &v) < 0) { - warning("Can not find codec config with id %u for audio element %u", - obu->codec_config_id, obu->audio_element_id); + warn("Can not find codec config with id %u for audio element %u", + obu->codec_config_id, obu->audio_element_id); return IAMF_ERR_BAD_ARG; } cc = v.ptr; @@ -958,7 +958,7 @@ int iamf_database_add_obu(iamf_database_t *database, iamf_obu_t *obu) { database->profile = sho->additional_profile; if (database->descriptors.ia_sequence_header_obu) { - warning("WARNING : Receive IAMF Sequence Header OBU again !!!"); + warn("WARNING : Receive IAMF Sequence Header OBU again !!!"); iamf_sequence_header_obu_free( database->descriptors.ia_sequence_header_obu); } @@ -1287,8 +1287,7 @@ int iamf_database_get_subblocks(iamf_database_t *database, uint32_t pid, // for gaps in delay case. if (pbk->elapsed > 0 && pbk->elapsed + converted_count > pbk->duration) { - warning("required subblocks exceed the duration of parameter block %u.", - pid); + warn("required subblocks exceed the duration of parameter block %u.", pid); return IAMF_ERR_BUFFER_TOO_SMALL; } diff --git a/code/src/iamf_dec/iamf_decoder.c b/code/src/iamf_dec/iamf_decoder.c index a3291fa0..ba038a1a 100755 --- a/code/src/iamf_dec/iamf_decoder.c +++ b/code/src/iamf_dec/iamf_decoder.c @@ -199,10 +199,9 @@ static int iamf_decoder_priv_decode(iamf_decoder_t *self, const uint8_t *data, frame_duration.numerator -= audio_block->second_skip; frame_duration.numerator -= audio_block->second_padding; } else { - warning( - "Trimming values exceed frame size: skip=%u, padding=%u, frame=%u", - audio_block->second_skip, audio_block->second_padding, - frame_duration.numerator); + warn("Trimming values exceed frame size: skip=%u, padding=%u, frame=%u", + audio_block->second_skip, audio_block->second_padding, + frame_duration.numerator); frame_duration.numerator = 0; } iamf_database_time_elapse(&self->ctx.database, frame_duration); @@ -379,7 +378,7 @@ int iamf_decoder_priv_update_frame_info(iamf_decoder_t *self) { audio_element = iamf_database_get_audio_element( database, audio_element_config->element_id); if (!audio_element || !audio_element->codec_config) { - warning( + warn( "Audio element %u or its codec config not found in database, " "skipping.", audio_element_config->element_id); @@ -393,7 +392,7 @@ int iamf_decoder_priv_update_frame_info(iamf_decoder_t *self) { } else if (sample_rate != codec_config->codec_param.sample_rate || num_samples_per_frame != codec_config->codec_param.frame_size) { - warning("Different sample rate or frame size found."); + warn("Different sample rate or frame size found."); ret = IAMF_ERR_UNIMPLEMENTED; } } @@ -457,8 +456,8 @@ int iamf_decoder_priv_configure(iamf_decoder_t *self, const uint8_t *data, if (ctx->configure_flags & def_iamf_decoder_config_mix_presentation) { if (!iamf_database_get_mix_presentation_obu(database, ctx->mix_presentation_id)) { - warning("Invalid mix presentation id %" PRId64 ".", - ctx->mix_presentation_id); + warn("Invalid mix presentation id %" PRId64 ".", + ctx->mix_presentation_id); return IAMF_ERR_INTERNAL; } } @@ -510,7 +509,7 @@ int iamf_decoder_priv_configure(iamf_decoder_t *self, const uint8_t *data, "Applied gain offset %f to element %u in presentation %u", gain_offset, element_id, mpo->mix_presentation_id); } else { - warning( + warn( "Failed to apply gain offset %f to element %u in " "presentation %u: %d", gain_offset, element_id, mpo->mix_presentation_id, ret); @@ -549,10 +548,10 @@ int iamf_decoder_priv_configure(iamf_decoder_t *self, const uint8_t *data, } else { ret = IAMF_ERR_INTERNAL; if (ctx->mix_presentation_id != def_i64_id_none) - warning("Fail to find the mix presentation %u obu.", - ctx->mix_presentation_id); + warn("Fail to find the mix presentation %u obu.", + ctx->mix_presentation_id); else - warning("Fail to find the valid mix presentation obu, try again."); + warn("Fail to find the valid mix presentation obu, try again."); } } @@ -702,7 +701,7 @@ static iamf_parser_state_t iamf_decoder_priv_process_data_obus( iamf_database_time_elapse(&self->ctx.database, frame_duration); } } else { - warning("No audio block available."); + warn("No audio block available."); } } } break; @@ -730,7 +729,7 @@ static iamf_parser_state_t iamf_decoder_priv_process_obus(iamf_obu_t *obu, else if (ctx->status == ck_iamf_decoder_status_parse_2) return iamf_decoder_priv_process_data_obus(self, obu); - warning("Unexpected state %d of decoder.", ctx->status); + warn("Unexpected state %d of decoder.", ctx->status); return ck_iamf_parser_state_stop; } @@ -1129,7 +1128,7 @@ int IAMF_decoder_set_head_rotation(IAMF_DecoderHandle handle, float w, float x, // Validate quaternion (should be approximately unit length) float quaternion_length = sqrtf(w * w + x * x + y * y + z * z); if (quaternion_length < 0.001f) { - warning("Head rotation quaternion is too close to zero, ignoring"); + warn("Head rotation quaternion is too close to zero, ignoring"); return IAMF_ERR_BAD_ARG; } diff --git a/code/src/iamf_dec/iamf_element_reconstructor.c b/code/src/iamf_dec/iamf_element_reconstructor.c index 58d53583..c801569c 100755 --- a/code/src/iamf_dec/iamf_element_reconstructor.c +++ b/code/src/iamf_dec/iamf_element_reconstructor.c @@ -1089,7 +1089,7 @@ int iamf_element_reconstructor_add_element( break; } default: { - warning("Unsupported audio element type %d.", aeo->audio_element_type); + warn("Unsupported audio element type %d.", aeo->audio_element_type); return IAMF_ERR_UNIMPLEMENTED; } } @@ -1134,7 +1134,7 @@ int iamf_element_reconstructor_add_audio_frame_obu( val = hash_map_get(self->reconstructor_map, eid); if (!val) { - warning("Reconstructor not found for audio element ID %u.", eid); + warn("Reconstructor not found for audio element ID %u.", eid); iamf_audio_frame_obu_free(obu); return IAMF_ERR_INTERNAL; } @@ -1142,16 +1142,16 @@ int iamf_element_reconstructor_add_audio_frame_obu( val = hash_map_get(recon->audio_frames_map, obu->audio_substream_id); if (!val) { - warning("Audio frame node not found for substream ID %u in self.", - obu->audio_substream_id); + warn("Audio frame node not found for substream ID %u in self.", + obu->audio_substream_id); iamf_audio_frame_obu_free(obu); return IAMF_ERR_INTERNAL; } afo = def_value_wrap_ptr(val); if (*afo) { - warning("Substream ID %u already has an audio frame OBU.", - obu->audio_substream_id); + warn("Substream ID %u already has an audio frame OBU.", + obu->audio_substream_id); iamf_element_reconstructor_priv_delete_all_audio_frame_obus(self); ret = IAMF_ERR_INVALID_PACKET; } diff --git a/code/src/iamf_dec/iamf_post_processor.c b/code/src/iamf_dec/iamf_post_processor.c index e78f2e41..0fc8d316 100755 --- a/code/src/iamf_dec/iamf_post_processor.c +++ b/code/src/iamf_dec/iamf_post_processor.c @@ -121,7 +121,7 @@ static iamf_audio_block_t *iamf_post_processor_priv_resample( iamf_audio_block_copy(out, resampler->buffer[1], ck_sample_format_f32_planar); } else { - warning("no samples to resample."); + warn("no samples to resample."); } return out; @@ -191,7 +191,7 @@ static iamf_audio_block_t *iamf_post_processor_priv_limit( } if (num_samples < 0) { - warning("limiter process failed: %d", num_samples); + warn("limiter process failed: %d", num_samples); iamf_audio_block_delete(out); return 0; } diff --git a/code/src/iamf_dec/iamf_presentation.c b/code/src/iamf_dec/iamf_presentation.c index c506a911..df5c1ee9 100755 --- a/code/src/iamf_dec/iamf_presentation.c +++ b/code/src/iamf_dec/iamf_presentation.c @@ -182,7 +182,7 @@ static uint32_t iamf_presentation_priv_generate_unique_gain_offset_id( } // If all offsets conflict, use id as fallback - warning("All offsets conflict, using pid as fallback: id=%u", self->id); + warn("All offsets conflict, using pid as fallback: id=%u", self->id); return self->id; } @@ -323,14 +323,14 @@ static iamf_presentation_element_t* iamf_presentation_priv_make_element( debug("make presentation element %u", eid); aeo = iamf_database_get_audio_element_obu(self->database, eid); if (!aeo) { - warning("no audio element found for id %u", eid); + warn("no audio element found for id %u", eid); return 0; } cco = iamf_database_get_codec_config_obu(self->database, aeo->codec_config_id); if (!cco) { - warning("no codec config found for id %u", aeo->codec_config_id); + warn("no codec config found for id %u", aeo->codec_config_id); return 0; } @@ -412,13 +412,13 @@ static iamf_presentation_element_t* iamf_presentation_priv_make_element( } if (element->in.position_id == def_i32_id_none) { - warning( + warn( "No position parameter found in rendering_config for object-based " "element %u", element->element_id); } } else { - warning("unknown scheme %d", element->scheme); + warn("unknown scheme %d", element->scheme); } return element; @@ -449,9 +449,8 @@ static int iamf_presentation_priv_make_elements(iamf_presentation_t* self) { hash_map_put(self->elements, element->element_id, def_value_wrap_instance_ptr(element)) < 0) { def_free(element); - warning( - "Failed to insert element presentation for element_id: %u", - audio_config->element_id); + warn("Failed to insert element presentation for element_id: %u", + audio_config->element_id); return IAMF_ERR_INTERNAL; } } @@ -708,7 +707,7 @@ static int iamf_presentation_priv_sync_audio_blocks(iamf_presentation_t* self) { if (!element->block) { element->block = iamf_audio_block_default_new(element->element_id); if (!element->block) - warning( + warn( "Failed to allocate memory for audio block for element (%u) " "for synchronization.", element->element_id); @@ -790,7 +789,7 @@ static int iamf_presentation_priv_update_element_mix_gain( // Handle second skip if present if (element->block->second_skip > 0) { - animated_float32_t animated_gain = _create_step_animated_gain(1.0f); + animated_float32_t animated_gain = _create_step_animated_gain(0.0f); iamf_renderer_update_element_animated_gain( &self->renderer, element->element_id, element->mix_gain_id, animated_gain, element->block->second_skip); @@ -833,8 +832,7 @@ static int iamf_presentation_priv_update_element_mix_gain( parameter_base_t* param_base = iamf_database_get_parameter_base(self->database, element->mix_gain_id); if (!param_base) - warning("Parameter base not found for mix gain id %u", - element->mix_gain_id); + warn("Parameter base not found for mix gain id %u", element->mix_gain_id); if (param_base && param_base->type == ck_iamf_parameter_type_mix_gain) { mix_gain_parameter_base_t* mix_gain_param = (mix_gain_parameter_base_t*)param_base; @@ -849,7 +847,7 @@ static int iamf_presentation_priv_update_element_mix_gain( } if (element->block->second_padding > 0) { - animated_float32_t animated_gain = _create_step_animated_gain(1.0f); + animated_float32_t animated_gain = _create_step_animated_gain(0.0f); iamf_renderer_update_element_animated_gain( &self->renderer, element->element_id, element->mix_gain_id, animated_gain, element->block->second_padding); @@ -880,9 +878,8 @@ static int iamf_presentation_priv_update_element_positions( iamf_database_get_parameter_base(self->database, element->in.position_id); if (!param_base || !iamf_parameter_type_is_coordinate(param_base->type)) { - warning( - "Invalid or non-coordinate position parameter %u for element_id: %u", - element->in.position_id, element->element_id); + warn("Invalid or non-coordinate position parameter %u for element_id: %u", + element->in.position_id, element->element_id); return IAMF_OK; } @@ -1088,7 +1085,7 @@ static int iamf_presentation_priv_update_output_mix_gain( // Handle second skip if present if (block->second_skip > 0) { - animated_float32_t animated_gain = _create_step_animated_gain(1.0f); + animated_float32_t animated_gain = _create_step_animated_gain(0.0f); iamf_renderer_update_animated_gain(&self->renderer, pid, g, animated_gain, block->second_skip); } @@ -1130,7 +1127,7 @@ static int iamf_presentation_priv_update_output_mix_gain( } if (block->second_padding > 0) { - animated_float32_t animated_gain = _create_step_animated_gain(1.0f); + animated_float32_t animated_gain = _create_step_animated_gain(0.0f); iamf_renderer_update_animated_gain(&self->renderer, pid, g, animated_gain, block->second_padding); } @@ -1163,7 +1160,7 @@ static float _sub_mix_get_best_loudness(iamf_mix_presentation_obu_t* obj, sub = def_value_wrap_optional_ptr(array_at(obj->sub_mixes, sub_mix_index)); if (!sub) { - warning("Sub_mix at index %d is NULL", sub_mix_index); + warn("Sub_mix at index %d is NULL", sub_mix_index); return loudness_lkfs; } @@ -1394,7 +1391,7 @@ int iamf_presentation_set_element_gain_offset(iamf_presentation_t* self, // Check if gain offset is enabled for this element if (!element->enable_gain_offset) { - warning("Gain offset is not enabled for element ID %u", eid); + warn("Gain offset is not enabled for element ID %u", eid); return IAMF_ERR_BAD_ARG; } @@ -1440,7 +1437,7 @@ int iamf_presentation_get_element_gain_offset(iamf_presentation_t* self, // Check if gain offset is enabled for this element if (!element->enable_gain_offset) { - warning("Gain offset is not enabled for element ID %u", eid); + warn("Gain offset is not enabled for element ID %u", eid); return IAMF_ERR_BAD_ARG; } @@ -1535,7 +1532,7 @@ int iamf_presentation_add_audio_block(iamf_presentation_t* self, if (element->block) { ret = IAMF_ERR_INVALID_PACKET; - warning("Audio block already exists for element ID %u", eid); + warn("Audio block already exists for element ID %u", eid); iamf_presentation_priv_delete_all_audio_blocks(self); } @@ -1560,7 +1557,7 @@ iamf_audio_block_t* iamf_presentation_process(iamf_presentation_t* self) { // Check if all audio blocks are present before starting processing. if (self->num_audio_blocks != hash_map_size(self->elements)) { - warning( + warn( "Not all audio blocks received for presentation %u. Received %u, " "expected %u.", self->id, self->num_audio_blocks, hash_map_size(self->elements)); @@ -1568,7 +1565,7 @@ iamf_audio_block_t* iamf_presentation_process(iamf_presentation_t* self) { ret = iamf_presentation_priv_sync_audio_blocks(self); if (ret != IAMF_OK) - warning("Failed to sync audio blocks for presentation %u", self->id); + warn("Failed to sync audio blocks for presentation %u", self->id); hash_map_iterator_t* iter = hash_map_iterator_new(self->elements); if (!iter) { @@ -1648,7 +1645,7 @@ int iamf_presentation_set_head_rotation(iamf_presentation_t* self, if (!self || !quaternion) return IAMF_ERR_BAD_ARG; if (self->layout.type != ck_iamf_layout_type_binaural) { - warning( + warn( "Head rotation is only effective for binaural output layout. " "Current layout type: %d. Head rotation will be stored but not " "applied.", @@ -1667,7 +1664,7 @@ int iamf_presentation_enable_head_tracking(iamf_presentation_t* self, if (!self) return IAMF_ERR_BAD_ARG; if (self->layout.type != ck_iamf_layout_type_binaural) { - warning( + warn( "Head tracking is only effective for binaural output layout. " "Current layout type: %d. Head tracking setting will be stored but not " "applied.", diff --git a/code/src/iamf_dec/iamf_synchronizer.c b/code/src/iamf_dec/iamf_synchronizer.c index b4690b9f..9cd1da82 100755 --- a/code/src/iamf_dec/iamf_synchronizer.c +++ b/code/src/iamf_dec/iamf_synchronizer.c @@ -105,7 +105,7 @@ static int audio_block_cache_required_data(audio_blocks_cache_t* cache, uint32_t _offset; if (!cblock) { - warning("Failed to get audio block from cache for ID %u", cache->id); + warn("Failed to get audio block from cache for ID %u", cache->id); ret = IAMF_ERR_INTERNAL; value_wrap_t v; queue_pop(cache->audio_blocks, &v); @@ -339,7 +339,7 @@ int iamf_synchronizer_sync_audio_blocks(iamf_synchronizer_t* synchronizer, iamf_audio_block_samples_info_copy(&required_block, &default_block); if (audio_block_cache_required_data(cache, &required_block) != IAMF_OK) { - warning("Failed to get required data from cache for ID %u", block->id); + warn("Failed to get required data from cache for ID %u", block->id); def_free(required_block.data); continue; } diff --git a/code/src/iamf_dec/obu/audio_element_obu.c b/code/src/iamf_dec/obu/audio_element_obu.c index e352f247..2e9512d8 100755 --- a/code/src/iamf_dec/obu/audio_element_obu.c +++ b/code/src/iamf_dec/obu/audio_element_obu.c @@ -73,7 +73,7 @@ iamf_audio_element_obu_t *iamf_audio_element_obu_new(io_context_t *ior) { object_based_audio_element_obu_t *oae = _obu_ae_object_based_new(val, ior); if (oae) obu = def_audio_element_obu_ptr(oae); } else { - warning("Unsupported type %u of audio element %u", type, val); + warn("Unsupported type %u of audio element %u", type, val); return 0; } @@ -104,7 +104,7 @@ void iamf_audio_element_obu_free(iamf_audio_element_obu_t *obu) { } else if (obu->audio_element_type == ck_audio_element_type_object_based) { _obu_ae_object_based_free(def_object_based_audio_element_obu_ptr(obu)); } else { - warning("Unknown audio element type %u", obu->audio_element_type); + warn("Unknown audio element type %u", obu->audio_element_type); _obu_ae_common_clear(obu); } } @@ -183,8 +183,8 @@ int _obu_ae_common_init(iamf_audio_element_obu_t *obu, uint32_t id, type = ior_leb128_u32(r); if (type != ck_iamf_parameter_type_demixing && type != ck_iamf_parameter_type_recon_gain) { - warning("Don't support parameter type(%u) in Audio Element OBU(%u), ", - type, obu->audio_element_id); + warn("Don't support parameter type(%u) in Audio Element OBU(%u), ", type, + obu->audio_element_id); if (type >= (uint32_t)ck_iamf_parameter_type_count) { uint32_t size = ior_leb128_u32(r); ior_skip(r, size); @@ -369,7 +369,7 @@ static int _obu_ae_scene_based_init(scene_based_audio_element_obu_t *sae, sae->substream_count + sae->coupled_substream_count, sae->mapping_size); } else { - warning("Invalid ambisonics mode(%u)", sae->ambisonics_mode); + warn("Invalid ambisonics mode(%u)", sae->ambisonics_mode); ret = IAMF_ERR_BAD_ARG; } return ret; @@ -440,16 +440,16 @@ void _obu_ae_object_based_free(object_based_audio_element_obu_t *oae) { static int _obu_ae_channel_based_check(channel_based_audio_element_obu_t *cae) { if (array_size(cae->base.parameters) > 2) - warning("Channle based audio element(%u) has more than two parameters.", - cae->base.audio_element_id); + warn("Channel based audio element(%u) has more than two parameters.", + cae->base.audio_element_id); cae->max_valid_layers = 0; if (cae->channel_audio_layer_configs) { uint32_t channels = 0; int n = array_size(cae->channel_audio_layer_configs); if (!n) { - warning("Element (%u) doesn't have valid layer.", - cae->base.audio_element_id); + warn("Element (%u) doesn't have valid layer.", + cae->base.audio_element_id); return def_error; } @@ -458,8 +458,8 @@ static int _obu_ae_channel_based_check(channel_based_audio_element_obu_t *cae) { array_at(cae->channel_audio_layer_configs, i)); if (!layer_config) { - warning("Element (%u) Layer %d: layer config is NULL, skip.", - cae->base.audio_element_id, i); + warn("Element (%u) Layer %d: layer config is NULL, skip.", + cae->base.audio_element_id, i); continue; } @@ -479,14 +479,13 @@ static int _obu_ae_channel_based_check(channel_based_audio_element_obu_t *cae) { layer_config->expanded_loudspeaker_layout)) { cae->max_valid_layers = 1; } else { - warning("Layer[%d] info : invalid expanded layout %d", i, - cae->max_valid_layers); + warn("Layer[%d] info : invalid expanded layout %d", i, + cae->max_valid_layers); } } else if (i || layer_config->loudspeaker_layout != def_iamf_loudspeaker_layout_expanded) { - warning("Element (%u) Layer %d: Invalid loudspeaker layout %u", - cae->base.audio_element_id, i, - layer_config->loudspeaker_layout); + warn("Element (%u) Layer %d: Invalid loudspeaker layout %u", + cae->base.audio_element_id, i, layer_config->loudspeaker_layout); break; } } @@ -505,9 +504,9 @@ int _obu_ae_channel_based_check_profile(channel_based_audio_element_obu_t *cae, def_value_wrap_optional_ptr(array_at(configs, 0)); if (layer_config && !iamf_audio_layer_base_layout_check(layer_config->loudspeaker_layout)) { - warning("Element (%u) doesn't support layout %u in profile %u.", - cae->base.audio_element_id, layer_config->loudspeaker_layout, - profile); + warn("Element (%u) doesn't support layout %u in profile %u.", + cae->base.audio_element_id, layer_config->loudspeaker_layout, + profile); return def_error; } } @@ -518,12 +517,12 @@ static int _obu_ae_scene_based_check(scene_based_audio_element_obu_t *sae) { int channels = sae->substream_count + sae->coupled_substream_count; if (array_size(sae->base.parameters) > 0) - warning("Scene based audio element(%u) has parameter.", - sae->base.audio_element_id); + warn("Scene based audio element(%u) has parameter.", + sae->base.audio_element_id); if (iamf_ambisonics_get_order(sae->output_channel_count) < 0 || sae->output_channel_count < channels) { - warning( + warn( "Invalid output channel count %d or invalid input channels %d in " "ambisonics mode", sae->output_channel_count, channels); @@ -534,12 +533,12 @@ static int _obu_ae_scene_based_check(scene_based_audio_element_obu_t *sae) { static int _obu_ae_object_based_check(object_based_audio_element_obu_t *oae) { if (array_size(oae->base.parameters) > 0) - warning("Object based audio element(%u) has parameter.", - oae->base.audio_element_id); + warn("Object based audio element(%u) has parameter.", + oae->base.audio_element_id); if (oae->num_objects <= 0) { - warning("Object based audio element(%u) has no objects.", - oae->base.audio_element_id); + warn("Object based audio element(%u) has no objects.", + oae->base.audio_element_id); return def_error; } return def_pass; @@ -550,8 +549,8 @@ int _obu_ae_scene_based_check_profile(scene_based_audio_element_obu_t *sae, int channels = sae->substream_count + sae->coupled_substream_count; const iamf_profile_info_t *info = iamf_profile_info_get(profile); if (channels > info->max_amb_channels) { - warning("Invalid channels %d in ambisonics mode, it should less than %d", - channels, info->max_amb_channels); + warn("Invalid channels %d in ambisonics mode, it should less than %d", + channels, info->max_amb_channels); return def_error; } return def_pass; diff --git a/code/src/iamf_dec/obu/codec_config_obu.c b/code/src/iamf_dec/obu/codec_config_obu.c index 4f73f433..344addb8 100755 --- a/code/src/iamf_dec/obu/codec_config_obu.c +++ b/code/src/iamf_dec/obu/codec_config_obu.c @@ -114,8 +114,8 @@ static int _obu_cc_codec_id_check(uint32_t codec_id) { static int _obu_cc_decoder_config_check(uint32_t codec, buffer_wrap_t *buffer) { if (iamf_codec_type_get(codec) == ck_iamf_codec_type_opus) { if (buffer && buffer->data && buffer->data[0] > def_opus_version_max) { - warning("Opus config invalid: version %u should less than %u.", - buffer->data[0], def_opus_version_max); + warn("Opus config invalid: version %u should less than %u.", + buffer->data[0], def_opus_version_max); return def_error; } } @@ -125,8 +125,8 @@ static int _obu_cc_decoder_config_check(uint32_t codec, buffer_wrap_t *buffer) { int _obu_cc_check(iamf_codec_config_obu_t *obu) { if (_obu_cc_codec_id_check(obu->codec_id) != def_pass) { - warning("Codec config id(%u), invalid codec(%.4s)", obu->codec_config_id, - (char *)&obu->codec_id); + warn("Codec config id(%u), invalid codec(%.4s)", obu->codec_config_id, + (char *)&obu->codec_id); return def_error; } @@ -139,8 +139,8 @@ int _obu_cc_check(iamf_codec_config_obu_t *obu) { if (_obu_cc_decoder_config_check(obu->codec_id, obu->decoder_config) != def_pass) { - warning("Codec config id(%u), codec(%.4s), decoder config is invalid, ", - obu->codec_config_id, (char *)&obu->codec_id); + warn("Codec config id(%u), codec(%.4s), decoder config is invalid, ", + obu->codec_config_id, (char *)&obu->codec_id); return def_error; } diff --git a/code/src/iamf_dec/obu/iamf_obu.c b/code/src/iamf_dec/obu/iamf_obu.c index 526a2cc4..8368b860 100755 --- a/code/src/iamf_dec/obu/iamf_obu.c +++ b/code/src/iamf_dec/obu/iamf_obu.c @@ -128,7 +128,7 @@ static int _iamf_obu_raw_parse_body(io_context_t *ior, header->obu_type <= ck_iamf_obu_audio_frame_id17) { *obu = (iamf_obu_t *)iamf_audio_frame_obu_new(ior, header); } else { - warning("Reserved OBU type %u", header->obu_type); + warn("Reserved OBU type %u", header->obu_type); } break; } diff --git a/code/src/iamf_dec/obu/metadata_obu.c b/code/src/iamf_dec/obu/metadata_obu.c index 9ea08fe5..88c5ba2b 100755 --- a/code/src/iamf_dec/obu/metadata_obu.c +++ b/code/src/iamf_dec/obu/metadata_obu.c @@ -165,7 +165,7 @@ iamf_metadata_obu_t *iamf_metadata_obu_new(io_context_t *ior) { } default: - warning("Unsupport metadata type: %u", metadata_type); + warn("Unsupport metadata type: %u", metadata_type); return 0; } diff --git a/code/src/iamf_dec/obu/mix_presentation_obu.c b/code/src/iamf_dec/obu/mix_presentation_obu.c index e10f2d7e..4a2c7416 100755 --- a/code/src/iamf_dec/obu/mix_presentation_obu.c +++ b/code/src/iamf_dec/obu/mix_presentation_obu.c @@ -191,7 +191,7 @@ int iamf_mix_presentation_obu_check_profile(iamf_mix_presentation_obu_t *obu, n = array_size(obu->sub_mixes); if (n > info->max_sub_mixes) { - warning( + warn( "Too many sub mixes %u (should be <= %u) in mix presentation %u for " "%s(%u", n, info->max_sub_mixes, obu->mix_presentation_id, @@ -206,7 +206,7 @@ int iamf_mix_presentation_obu_check_profile(iamf_mix_presentation_obu_t *obu, elements += num; if (elements > info->max_elements) { - warning( + warn( "Too many elements %u (should be <= %u) in mix presentation %u for " "%s(%u)", elements, info->max_elements, obu->mix_presentation_id, @@ -220,14 +220,14 @@ int iamf_mix_presentation_obu_check_profile(iamf_mix_presentation_obu_t *obu, if (vector_find(audio_element_obus, def_value_wrap_instance_u32(aelem_config->element_id), _obu_mp_find_audio_element, &v) < 0) { - warning("Invalid element %u in mix presentation %u", - aelem_config->element_id, obu->mix_presentation_id); + warn("Invalid element %u in mix presentation %u", + aelem_config->element_id, obu->mix_presentation_id); return def_error; } if (aelem_config->rendering_config.headphones_rendering_mode > info->max_available_headphone_rendering_mode) { - warning( + warn( "Invalid headphones rendering mode %d in element %u of mix " "presentation %u for profile %s(%u).", aelem_config->rendering_config.headphones_rendering_mode, @@ -262,8 +262,8 @@ int iamf_mix_presentation_obu_check_profile(iamf_mix_presentation_obu_t *obu, } if (channels > info->max_channels) { - warning("Id (%u) has %d channels, more than %u", - obu->mix_presentation_id, channels, info->max_channels); + warn("Id (%u) has %d channels, more than %u", obu->mix_presentation_id, + channels, info->max_channels); return def_error; } } @@ -691,8 +691,8 @@ int _obu_mp_check(iamf_mix_presentation_obu_t *obu) { int num = array_size(obu->sub_mixes); if (num > def_max_sub_mixes) { - warning("id(%u): num_sub_mixes should be <= %d.", obu->mix_presentation_id, - def_max_sub_mixes); + warn("id(%u): num_sub_mixes should be <= %d.", obu->mix_presentation_id, + def_max_sub_mixes); return def_error; } @@ -701,15 +701,15 @@ int _obu_mp_check(iamf_mix_presentation_obu_t *obu) { obu_sub_mix_t *sub = def_value_wrap_optional_ptr(array_at(obu->sub_mixes, i)); if (!sub) { - warning("id(%u): sub mix (%d) should not be null.", - obu->mix_presentation_id, i); + warn("id(%u): sub mix (%d) should not be null.", obu->mix_presentation_id, + i); return def_error; } n = array_size(sub->audio_element_configs); if (!n) { - warning("id(%u): num_audio_elements should not be set to 0.", - obu->mix_presentation_id); + warn("id(%u): num_audio_elements should not be set to 0.", + obu->mix_presentation_id); return def_error; } @@ -719,7 +719,7 @@ int _obu_mp_check(iamf_mix_presentation_obu_t *obu) { if (aelem_config->rendering_config.headphones_rendering_mode > HEADPHONES_RENDERING_MODE_HEAD_LOCKED) { - warning( + warn( "Invalid headphones rendering mode %d in element %u of mix " "presentation %u", aelem_config->rendering_config.headphones_rendering_mode, @@ -734,8 +734,8 @@ int _obu_mp_check(iamf_mix_presentation_obu_t *obu) { def_value_wrap_optional_ptr(array_at(sub->loudness_layouts, j)); if (layout->type == ck_iamf_layout_type_loudspeakers_ss_convention && !iamf_sound_system_check(layout->sound_system)) { - warning("Find unsupported sound system %d in mix presentation %u.", - layout->sound_system, obu->mix_presentation_id); + warn("Find unsupported sound system %d in mix presentation %u.", + layout->sound_system, obu->mix_presentation_id); } } } @@ -745,7 +745,7 @@ int _obu_mp_check(iamf_mix_presentation_obu_t *obu) { iamf_tag_t *tag = def_value_wrap_optional_ptr(array_at(obu->mix_presentation_tags, i)); if (_obu_mp_tag_check(tag->name, tag->value) != def_pass) - warning("Invalid tag name %s or value %s.", tag->name, tag->value); + warn("Invalid tag name %s or value %s.", tag->name, tag->value); } return def_pass; } diff --git a/code/src/iamf_dec/obu/parameter_block_obu.c b/code/src/iamf_dec/obu/parameter_block_obu.c index b415a02a..c6dca30c 100755 --- a/code/src/iamf_dec/obu/parameter_block_obu.c +++ b/code/src/iamf_dec/obu/parameter_block_obu.c @@ -56,8 +56,8 @@ iamf_parameter_block_obu_t *iamf_parameter_block_obu_new( uint32_t num_subblocks = 0; if (!interfaces || !interfaces->get_parameter_base) { - warning("invalid input parameters: interfaces(%p), get base(%p)", - interfaces, interfaces ? interfaces->get_parameter_base : 0); + warn("invalid input parameters: interfaces(%p), get base(%p)", interfaces, + interfaces ? interfaces->get_parameter_base : 0); return 0; } @@ -306,7 +306,7 @@ _obu_pb_recon_gain_info_parameter_subblock_new( int size = 0; if (!interfaces || !interfaces->get_recon_gain_present_flags) { - warning( + warn( "Invalid input parameters: interfaces(%p) or " "get_recon_gain_present_flags(%p)", interfaces, interfaces ? interfaces->get_recon_gain_present_flags : 0);