[FFmpeg-devel] [PATCH 2/2] fftools/ffprobe: export IAMF Stream Group parameters

James Almer jamrial at gmail.com
Thu Mar 7 19:49:05 EET 2024


On 3/7/2024 1:45 PM, Stefano Sabatini wrote:
> On date Wednesday 2024-03-06 21:49:52 -0300, James Almer wrote:
>> Signed-off-by: James Almer <jamrial at gmail.com>
>> ---
>>   fftools/ffprobe.c                       | 157 +++++++++++++++++++++++-
>>   tests/fate/iamf.mak                     |   8 +-
>>   tests/fate/mov.mak                      |   8 +-
>>   tests/ref/fate/iamf-5_1_4               |  92 ++++++++++++++
>>   tests/ref/fate/iamf-7_1_4               |  92 ++++++++++++++
>>   tests/ref/fate/iamf-ambisonic_1         |  39 ++++++
>>   tests/ref/fate/iamf-stereo              |  67 ++++++++++
>>   tests/ref/fate/mov-mp4-iamf-5_1_4       |  92 ++++++++++++++
>>   tests/ref/fate/mov-mp4-iamf-7_1_4       |  92 ++++++++++++++
>>   tests/ref/fate/mov-mp4-iamf-ambisonic_1 |  39 ++++++
>>   tests/ref/fate/mov-mp4-iamf-stereo      |  67 ++++++++++
>>   11 files changed, 741 insertions(+), 12 deletions(-)
>>
>> diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
>> index c2ed8336f9..393f8d2a99 100644
>> --- a/fftools/ffprobe.c
>> +++ b/fftools/ffprobe.c
>> @@ -41,6 +41,7 @@
>>   #include "libavutil/display.h"
>>   #include "libavutil/hash.h"
>>   #include "libavutil/hdr_dynamic_metadata.h"
>> +#include "libavutil/iamf.h"
>>   #include "libavutil/mastering_display_metadata.h"
>>   #include "libavutil/hdr_dynamic_vivid_metadata.h"
>>   #include "libavutil/dovi_meta.h"
>> @@ -214,6 +215,12 @@ typedef enum {
>>       SECTION_ID_STREAM_GROUP_COMPONENT,
>>       SECTION_ID_STREAM_GROUP_SUB_COMPONENTS,
>>       SECTION_ID_STREAM_GROUP_SUB_COMPONENT,
>> +    SECTION_ID_STREAM_GROUP_PIECES,
>> +    SECTION_ID_STREAM_GROUP_PIECE,
>> +    SECTION_ID_STREAM_GROUP_SUB_PIECES,
>> +    SECTION_ID_STREAM_GROUP_SUB_PIECE,
>> +    SECTION_ID_STREAM_GROUP_BLOCKS,
>> +    SECTION_ID_STREAM_GROUP_BLOCK,
>>       SECTION_ID_STREAM_GROUP_STREAMS,
>>       SECTION_ID_STREAM_GROUP_STREAM,
>>       SECTION_ID_STREAM_GROUP_DISPOSITION,
>> @@ -287,8 +294,8 @@ static struct section sections[] = {
>>       [SECTION_ID_FRAME_SIDE_DATA_TIMECODE] =       { SECTION_ID_FRAME_SIDE_DATA_TIMECODE, "timecode", 0, { -1 } },
>>       [SECTION_ID_FRAME_SIDE_DATA_COMPONENT_LIST] = { SECTION_ID_FRAME_SIDE_DATA_COMPONENT_LIST, "components", SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME_SIDE_DATA_COMPONENT, -1 }, .element_name = "component", .unique_name = "frame_side_data_components" },
>>       [SECTION_ID_FRAME_SIDE_DATA_COMPONENT] =      { SECTION_ID_FRAME_SIDE_DATA_COMPONENT, "component", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { SECTION_ID_FRAME_SIDE_DATA_PIECE_LIST, -1 }, .unique_name = "frame_side_data_component", .element_name = "component_entry", .get_type = get_raw_string_type },
>> -    [SECTION_ID_FRAME_SIDE_DATA_PIECE_LIST] =   { SECTION_ID_FRAME_SIDE_DATA_PIECE_LIST, "pieces", SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME_SIDE_DATA_PIECE, -1 }, .element_name = "piece" },
>> -    [SECTION_ID_FRAME_SIDE_DATA_PIECE] =        { SECTION_ID_FRAME_SIDE_DATA_PIECE, "piece", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { -1 }, .element_name = "piece_entry", .get_type = get_raw_string_type },
>> +    [SECTION_ID_FRAME_SIDE_DATA_PIECE_LIST] =   { SECTION_ID_FRAME_SIDE_DATA_PIECE_LIST, "pieces", SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME_SIDE_DATA_PIECE, -1 }, .element_name = "piece", .unique_name = "frame_side_data_pieces" },
>> +    [SECTION_ID_FRAME_SIDE_DATA_PIECE] =        { SECTION_ID_FRAME_SIDE_DATA_PIECE, "piece", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { -1 }, .element_name = "piece_entry", .unique_name = "frame_side_data_piece", .get_type = get_raw_string_type },
>>       [SECTION_ID_FRAME_LOGS] =         { SECTION_ID_FRAME_LOGS, "logs", SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME_LOG, -1 } },
>>       [SECTION_ID_FRAME_LOG] =          { SECTION_ID_FRAME_LOG, "log", 0, { -1 },  },
>>       [SECTION_ID_LIBRARY_VERSIONS] =   { SECTION_ID_LIBRARY_VERSIONS, "library_versions", SECTION_FLAG_IS_ARRAY, { SECTION_ID_LIBRARY_VERSION, -1 } },
>> @@ -318,7 +325,13 @@ static struct section sections[] = {
>>       [SECTION_ID_STREAM_GROUP_COMPONENTS] =         { SECTION_ID_STREAM_GROUP_COMPONENTS, "components", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_COMPONENT, -1 }, .element_name = "component", .unique_name = "stream_group_components" },
>>       [SECTION_ID_STREAM_GROUP_COMPONENT] =          { SECTION_ID_STREAM_GROUP_COMPONENT, "component", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { SECTION_ID_STREAM_GROUP_SUB_COMPONENTS, -1 }, .unique_name = "stream_group_component", .element_name = "component_entry", .get_type = get_stream_group_type },
>>       [SECTION_ID_STREAM_GROUP_SUB_COMPONENTS] =     { SECTION_ID_STREAM_GROUP_SUB_COMPONENTS, "subcomponents", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_SUB_COMPONENT, -1 }, .element_name = "component" },
>> -    [SECTION_ID_STREAM_GROUP_SUB_COMPONENT] =      { SECTION_ID_STREAM_GROUP_SUB_COMPONENT, "subcomponent", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { -1 }, .element_name = "sub_component_entry", .get_type = get_raw_string_type },
> 
>> +    [SECTION_ID_STREAM_GROUP_SUB_COMPONENT] =      { SECTION_ID_STREAM_GROUP_SUB_COMPONENT, "subcomponent", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { SECTION_ID_STREAM_GROUP_PIECES, -1 }, .element_name = "subcomponent_entry", .get_type = get_raw_string_type },
>> +    [SECTION_ID_STREAM_GROUP_PIECES] =             { SECTION_ID_STREAM_GROUP_PIECES, "pieces", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_PIECE, -1 }, .element_name = "piece", .unique_name = "stream_group_pieces" },
>> +    [SECTION_ID_STREAM_GROUP_PIECE] =              { SECTION_ID_STREAM_GROUP_PIECE, "piece", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { SECTION_ID_STREAM_GROUP_SUB_PIECES, -1 }, .unique_name = "stream_group_piece", .element_name = "piece_entry", .get_type = get_raw_string_type },
>> +    [SECTION_ID_STREAM_GROUP_SUB_PIECES] =         { SECTION_ID_STREAM_GROUP_SUB_PIECES, "subpieces", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_SUB_PIECE, -1 }, .element_name = "subpiece" },
>> +    [SECTION_ID_STREAM_GROUP_SUB_PIECE] =          { SECTION_ID_STREAM_GROUP_SUB_PIECE, "subpiece", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { SECTION_ID_STREAM_GROUP_BLOCKS, -1 }, .element_name = "subpiece_entry", .get_type = get_raw_string_type },
> 
> consistencty: I'd go with SUBPIECE/subpiece everywhere, also missing
> doc/ffprobe.xsd update
> 
>> +    [SECTION_ID_STREAM_GROUP_BLOCKS] =             { SECTION_ID_STREAM_GROUP_BLOCKS, "blocks", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM_GROUP_BLOCK, -1 }, .element_name = "block" },
>> +    [SECTION_ID_STREAM_GROUP_BLOCK] =              { SECTION_ID_STREAM_GROUP_BLOCK, "block", SECTION_FLAG_HAS_VARIABLE_FIELDS|SECTION_FLAG_HAS_TYPE, { -1 }, .element_name = "block_entry", .get_type = get_raw_string_type },
> 
> where are these used?

In print_iamf_param_definition(), where sections[] is checked for the 
child section of the input section_id, they'd be used when called by 
print_iamf_submix_params().
Can add a comment so it doesn't look like they are unused, because the 
tests currently doesn't cover it.


More information about the ffmpeg-devel mailing list