[FFmpeg-devel] [PATCH] ffprobe: generalize nesting model for the XML writer

Stefano Sabatini stefasab at gmail.com
Sun Sep 30 12:26:55 CEST 2012


On date Saturday 2012-09-29 10:40:18 +0200, Stefano Sabatini encoded:
> On date Saturday 2012-09-29 00:00:08 +0200, Clément Bœsch encoded:
[...]
> > > @@ -105,10 +106,10 @@ typedef enum {
> > >  static const struct section sections[] = {
> > >      [SECTION_ID_ERROR] = { SECTION_ID_ERROR, "error", 0 },
> > >      [SECTION_ID_FORMAT] = { SECTION_ID_FORMAT, "format", 0 },
> > > -    [SECTION_ID_FORMAT_TAGS] = { SECTION_ID_FORMAT_TAGS, "tags", 0, .element_name = "tag" },
> > > +    [SECTION_ID_FORMAT_TAGS] = { SECTION_ID_FORMAT_TAGS, "tags", SECTION_FLAG_HAS_VARIABLE_FIELDS, .element_name = "tag" },
> > >      [SECTION_ID_FRAME] = { SECTION_ID_FRAME, "frame", 0 },
> > >      [SECTION_ID_FRAMES] = { SECTION_ID_FRAMES, "frames", SECTION_FLAG_IS_ARRAY },
> > > -    [SECTION_ID_FRAME_TAGS] = { SECTION_ID_FRAME_TAGS, "tags", 0, .element_name = "tag" },
> > > +    [SECTION_ID_FRAME_TAGS] = { SECTION_ID_FRAME_TAGS, "tags", SECTION_FLAG_HAS_VARIABLE_FIELDS, .element_name = "tag" },
> > >      [SECTION_ID_LIBRARY_VERSION] = { SECTION_ID_LIBRARY_VERSION, "library_version", 0 },
> > >      [SECTION_ID_LIBRARY_VERSIONS] = { SECTION_ID_LIBRARY_VERSIONS, "library_versions", SECTION_FLAG_IS_ARRAY },
> > >      [SECTION_ID_PACKET] = { SECTION_ID_PACKET, "packet", 0 },
> > > @@ -118,7 +119,7 @@ static const struct section sections[] = {
> > >      [SECTION_ID_ROOT] = { SECTION_ID_ROOT, "root", SECTION_FLAG_IS_WRAPPER },
> > >      [SECTION_ID_STREAM] = { SECTION_ID_STREAM, "stream", 0 },
> > >      [SECTION_ID_STREAMS] = { SECTION_ID_STREAMS, "streams", SECTION_FLAG_IS_ARRAY },
> > > -    [SECTION_ID_STREAM_TAGS] = { SECTION_ID_STREAM_TAGS, "tags", 0, .element_name = "tag" },
> > > +    [SECTION_ID_STREAM_TAGS] = { SECTION_ID_STREAM_TAGS, "tags", SECTION_FLAG_HAS_VARIABLE_FIELDS, .element_name = "tag" },
> > 
> > Isn't this just related to the presence of element_name field? (At least
> > the flag seems to imply the presence of element_name). If so, wouldn't it
> > make sense to simply check for section->element_name?
> 
> No they are two logical entitities, even if related. A section may
> have an element_name (which is used by the default/compact writers),
> but not being with variable fields (for example it could have been
> dispositions->disposition).

Extendend the docs for the new flag, and applied.
-- 
FFmpeg = Fast & Fancy Monstrous Political Ermetic Gladiator


More information about the ffmpeg-devel mailing list