[FFmpeg-devel] [PATCH 2/2] ffprobe: print some basic information about avframe side data
Clément Bœsch
u at pkh.me
Wed Jul 30 10:35:20 CEST 2014
On Wed, Jul 30, 2014 at 02:18:48AM +0200, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> ---
> ffprobe.c | 22 +++++++++++++++++++++-
> 1 file changed, 21 insertions(+), 1 deletion(-)
>
I believe this is missing doc/ffprobe.xsd updates.
> diff --git a/ffprobe.c b/ffprobe.c
> index 1329466..114da50 100644
> --- a/ffprobe.c
> +++ b/ffprobe.c
> @@ -123,6 +123,8 @@ typedef enum {
> SECTION_ID_FRAME,
> SECTION_ID_FRAMES,
> SECTION_ID_FRAME_TAGS,
> + SECTION_ID_FRAME_SIDEDATA_LIST,
> + SECTION_ID_FRAME_SIDEDATA,
> SECTION_ID_LIBRARY_VERSION,
> SECTION_ID_LIBRARY_VERSIONS,
> SECTION_ID_PACKET,
> @@ -152,8 +154,10 @@ static struct section sections[] = {
> [SECTION_ID_FORMAT] = { SECTION_ID_FORMAT, "format", 0, { SECTION_ID_FORMAT_TAGS, -1 } },
> [SECTION_ID_FORMAT_TAGS] = { SECTION_ID_FORMAT_TAGS, "tags", SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", .unique_name = "format_tags" },
> [SECTION_ID_FRAMES] = { SECTION_ID_FRAMES, "frames", SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME, SECTION_ID_SUBTITLE, -1 } },
> - [SECTION_ID_FRAME] = { SECTION_ID_FRAME, "frame", 0, { SECTION_ID_FRAME_TAGS, -1 } },
> + [SECTION_ID_FRAME] = { SECTION_ID_FRAME, "frame", 0, { SECTION_ID_FRAME_TAGS, SECTION_ID_FRAME_SIDEDATA_LIST, -1 } },
> [SECTION_ID_FRAME_TAGS] = { SECTION_ID_FRAME_TAGS, "tags", SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", .unique_name = "frame_tags" },
> + [SECTION_ID_FRAME_SIDEDATA_LIST] ={ SECTION_ID_FRAME_SIDEDATA_LIST, "sidedata_list", SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME_SIDEDATA, -1 } },
> + [SECTION_ID_FRAME_SIDEDATA] = { SECTION_ID_FRAME_SIDEDATA, "sidedata", 0, { -1 } },
> [SECTION_ID_LIBRARY_VERSIONS] = { SECTION_ID_LIBRARY_VERSIONS, "library_versions", SECTION_FLAG_IS_ARRAY, { SECTION_ID_LIBRARY_VERSION, -1 } },
> [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} },
> @@ -1722,6 +1726,7 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
> {
> AVBPrint pbuf;
> const char *s;
> + int i;
>
> av_bprint_init(&pbuf, 1, AV_BPRINT_SIZE_UNLIMITED);
>
> @@ -1765,6 +1770,21 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
> print_int("interlaced_frame", frame->interlaced_frame);
> print_int("top_field_first", frame->top_field_first);
> print_int("repeat_pict", frame->repeat_pict);
> + if (frame->nb_side_data) {
> + writer_print_section_header(w, SECTION_ID_FRAME_SIDEDATA_LIST);
> + for (i = 0; i < frame->nb_side_data; i++) {
> + AVFrameSideData *sd = frame->side_data[i];
> + const char *name;
> +
> + writer_print_section_header(w, SECTION_ID_FRAME_SIDEDATA);
> + name = av_frame_side_data_name(sd->type);
> + print_str("side_data_type", name ? name : "unknown");
> + print_int("side_data_size", sd->size);
> + writer_print_section_footer(w);
> + }
> + writer_print_section_footer(w);
> + }
> +
> break;
>
> case AVMEDIA_TYPE_AUDIO:
Should be fine if tested with different writers
[...]
--
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140730/a541dcb1/attachment.asc>
More information about the ffmpeg-devel
mailing list