On date Saturday 2015-10-24 22:42:12 +0200, Marton Balint encoded: > ffprobe.xsd already contains the tag element. > > Signed-off-by: Marton Balint <c...@passwd.hu> > --- > ffprobe.c | 16 +++++++++++++++- > 1 file changed, 15 insertions(+), 1 deletion(-) > > diff --git a/ffprobe.c b/ffprobe.c > index ac03689..f5930ae 100644 > --- a/ffprobe.c > +++ b/ffprobe.c > @@ -77,6 +77,7 @@ static int do_show_format_tags = 0; > static int do_show_frame_tags = 0; > static int do_show_program_tags = 0; > static int do_show_stream_tags = 0; > +static int do_show_packet_tags = 0; > > static int show_value_unit = 0; > static int use_value_prefix = 0; > @@ -135,6 +136,7 @@ typedef enum { > SECTION_ID_LIBRARY_VERSION, > SECTION_ID_LIBRARY_VERSIONS, > SECTION_ID_PACKET, > + SECTION_ID_PACKET_TAGS, > SECTION_ID_PACKETS, > SECTION_ID_PACKETS_AND_FRAMES, > SECTION_ID_PACKET_SIDE_DATA_LIST, > @@ -178,7 +180,8 @@ static struct section sections[] = { > [SECTION_ID_LIBRARY_VERSION] = { SECTION_ID_LIBRARY_VERSION, > "library_version", 0, { -1 } }, > [SECTION_ID_PACKETS] = { SECTION_ID_PACKETS, "packets", > SECTION_FLAG_IS_ARRAY, { SECTION_ID_PACKET, -1} }, > [SECTION_ID_PACKETS_AND_FRAMES] = { SECTION_ID_PACKETS_AND_FRAMES, > "packets_and_frames", SECTION_FLAG_IS_ARRAY, { SECTION_ID_PACKET, -1} }, > - [SECTION_ID_PACKET] = { SECTION_ID_PACKET, "packet", 0, { > SECTION_ID_PACKET_SIDE_DATA_LIST, -1 } }, > + [SECTION_ID_PACKET] = { SECTION_ID_PACKET, "packet", 0, { > SECTION_ID_PACKET_TAGS, SECTION_ID_PACKET_SIDE_DATA_LIST, -1 } }, > + [SECTION_ID_PACKET_TAGS] = { SECTION_ID_PACKET_TAGS, "tags", > SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", .unique_name > = "packet_tags" }, > [SECTION_ID_PACKET_SIDE_DATA_LIST] ={ SECTION_ID_PACKET_SIDE_DATA_LIST, > "side_data_list", SECTION_FLAG_IS_ARRAY, { SECTION_ID_PACKET_SIDE_DATA, -1 } > }, > [SECTION_ID_PACKET_SIDE_DATA] = { SECTION_ID_PACKET_SIDE_DATA, > "side_data", 0, { -1 } }, > [SECTION_ID_PIXEL_FORMATS] = { SECTION_ID_PIXEL_FORMATS, > "pixel_formats", SECTION_FLAG_IS_ARRAY, { SECTION_ID_PIXEL_FORMAT, -1 } }, > @@ -1762,6 +1765,16 @@ static void show_packet(WriterContext *w, > AVFormatContext *fmt_ctx, AVPacket *pk > > if (pkt->side_data_elems) { > int i; > + int size; > + const uint8_t *side_metadata; > + > + side_metadata = av_packet_get_side_data(pkt, > AV_PKT_DATA_STRINGS_METADATA, &size); > + if (side_metadata && size && do_show_packet_tags) { > + AVDictionary *dict = NULL; > + if (av_packet_unpack_dictionary(side_metadata, size, &dict) >= 0) > + show_tags(w, dict, SECTION_ID_PACKET_TAGS); > + av_dict_free(&dict); > + } > writer_print_section_header(w, SECTION_ID_PACKET_SIDE_DATA_LIST); > for (i = 0; i < pkt->side_data_elems; i++) { > AVPacketSideData *sd = &pkt->side_data[i]; > @@ -3178,6 +3191,7 @@ int main(int argc, char **argv) > SET_DO_SHOW(FRAME_TAGS, frame_tags); > SET_DO_SHOW(PROGRAM_TAGS, program_tags); > SET_DO_SHOW(STREAM_TAGS, stream_tags); > + SET_DO_SHOW(PACKET_TAGS, packet_tags);
LGTM, thanks. -- FFmpeg = Freak and Fundamental Merciful Ponderous Eretic Guru _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel