Lines Matching defs:section

152 /* section structure definition */
156 struct section {
157 int id; ///< unique id identifying a section
160 #define SECTION_FLAG_IS_WRAPPER 1 ///< the section only contains other sections, but has no data at its own level
161 #define SECTION_FLAG_IS_ARRAY 2 ///< the section contains an array of elements of the same type
162 #define SECTION_FLAG_HAS_VARIABLE_FIELDS 4 ///< the section may contain a variable number of fields with variable keys.
165 int children_ids[SECTION_MAX_NB_CHILDREN+1]; ///< list of children section IDS, terminated by -1
167 const char *unique_name; ///< unique section name, in case the name is ambiguous
224 static struct section sections[] = {
241 [SECTION_ID_FRAME_SIDE_DATA_PIECE] = { SECTION_ID_FRAME_SIDE_DATA_PIECE, "section", 0, { -1 } },
489 const struct section *sections; ///< array containing all sections
494 /** number of the item printed in the given section, starting from 0 */
497 /** section per each level */
498 const struct section *section[SECTION_MAX_NB_LEVELS];
499 AVBPrint section_pbuf[SECTION_MAX_NB_LEVELS]; ///< generic print buffer dedicated to each section,
502 unsigned int nb_section_packet; ///< number of the packet section in case we are in "packets_and_frames" section
503 unsigned int nb_section_frame; ///< number of the frame section in case we are in "packets_and_frames" section
619 const struct section *sections, int nb_sections, const char *output)
727 (wctx->section[wctx->level-1])->id : SECTION_ID_NONE;
730 wctx->section[wctx->level] = &wctx->sections[section_id];
746 int section_id = wctx->section[wctx->level]->id;
748 wctx->section[wctx->level-1]->id : SECTION_ID_NONE;
764 const struct section *section = wctx->section[wctx->level];
766 if (section->show_all_entries || av_dict_get(section->entries_to_show, key, NULL, 0)) {
833 const struct section *section = wctx->section[wctx->level];
842 if (section->show_all_entries || av_dict_get(section->entries_to_show, key, NULL, 0)) {
853 "Invalid key=value string combination %s=%s in section %s\n",
854 key, val, section->unique_name);
1052 const struct section *section = wctx->section[wctx->level];
1053 const struct section *parent_section = wctx->level ?
1054 wctx->section[wctx->level-1] : NULL;
1063 av_x_if_null(section->element_name, section->name)));
1069 if (!(section->flags & (SECTION_FLAG_IS_WRAPPER|SECTION_FLAG_IS_ARRAY)))
1070 writer_printf(wctx, "[%s]\n", upcase_string(buf, sizeof(buf), section->name));
1076 const struct section *section = wctx->section[wctx->level];
1082 if (!(section->flags & (SECTION_FLAG_IS_WRAPPER|SECTION_FLAG_IS_ARRAY)))
1083 writer_printf(wctx, "[/%s]\n", upcase_string(buf, sizeof(buf), section->name));
1189 {"print_section", "print section name", OFFSET(print_section), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
1190 {"p", "print section name", OFFSET(print_section), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
1221 const struct section *section = wctx->section[wctx->level];
1222 const struct section *parent_section = wctx->level ?
1223 wctx->section[wctx->level-1] : NULL;
1228 if (!(section->flags & SECTION_FLAG_IS_ARRAY) && parent_section &&
1234 (char *)av_x_if_null(section->element_name, section->name));
1238 (section->flags & SECTION_FLAG_IS_ARRAY)) {
1245 !(section->flags & (SECTION_FLAG_IS_WRAPPER|SECTION_FLAG_IS_ARRAY)))
1246 writer_printf(wctx, "%s%c", section->name, compact->item_sep);
1256 !(wctx->section[wctx->level]->flags & (SECTION_FLAG_IS_WRAPPER|SECTION_FLAG_IS_ARRAY)))
1307 {"print_section", "print section name", OFFSET(print_section), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
1308 {"p", "print section name", OFFSET(print_section), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
1341 {"hierarchical", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
1342 {"h", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
1399 const struct section *section = wctx->section[wctx->level];
1400 const struct section *parent_section = wctx->level ?
1401 wctx->section[wctx->level-1] : NULL;
1403 /* build section header */
1410 !(section->flags & (SECTION_FLAG_IS_ARRAY|SECTION_FLAG_IS_WRAPPER))) {
1411 av_bprintf(buf, "%s%s", wctx->section[wctx->level]->name, flat->sep_str);
1461 {"hierarchical", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
1462 {"h", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
1499 const struct section *section = wctx->section[wctx->level];
1500 const struct section *parent_section = wctx->level ?
1501 wctx->section[wctx->level-1] : NULL;
1514 !(section->flags & (SECTION_FLAG_IS_ARRAY|SECTION_FLAG_IS_WRAPPER))) {
1515 av_bprintf(buf, "%s%s", buf->str[0] ? "." : "", wctx->section[wctx->level]->name);
1524 if (!(section->flags & (SECTION_FLAG_IS_ARRAY|SECTION_FLAG_IS_WRAPPER)))
1610 const struct section *section = wctx->section[wctx->level];
1611 const struct section *parent_section = wctx->level ?
1612 wctx->section[wctx->level-1] : NULL;
1617 if (section->flags & SECTION_FLAG_IS_WRAPPER) {
1622 json_escape_str(&buf, section->name, wctx);
1626 if (section->flags & SECTION_FLAG_IS_ARRAY) {
1637 writer_printf(wctx, "\"type\": \"%s\"", section->name);
1648 const struct section *section = wctx->section[wctx->level];
1653 } else if (section->flags & SECTION_FLAG_IS_ARRAY) {
1682 const struct section *parent_section = wctx->level ?
1683 wctx->section[wctx->level-1] : NULL;
1695 const struct section *parent_section = wctx->level ?
1696 wctx->section[wctx->level-1] : NULL;
1770 const struct section *section = wctx->section[wctx->level];
1771 const struct section *parent_section = wctx->level ?
1772 wctx->section[wctx->level-1] : NULL;
1790 if (section->flags & SECTION_FLAG_HAS_VARIABLE_FIELDS) {
1798 if (section->flags & SECTION_FLAG_IS_ARRAY) {
1799 XML_INDENT(); writer_printf(wctx, "<%s>\n", section->name);
1801 XML_INDENT(); writer_printf(wctx, "<%s ", section->name);
1810 const struct section *section = wctx->section[wctx->level];
1818 } else if (section->flags & SECTION_FLAG_HAS_VARIABLE_FIELDS) {
1821 XML_INDENT(); writer_printf(wctx, "</%s>\n", section->name);
1830 const struct section *section = wctx->section[wctx->level];
1834 if (section->flags & SECTION_FLAG_HAS_VARIABLE_FIELDS) {
1839 section->element_name, buf.str);
3618 struct section *section = &sections[section_id];
3620 section->show_all_entries = show_all_entries;
3623 for (id = section->children_ids; *id != -1; id++)
3626 av_dict_copy(&section->entries_to_show, entries, 0);
3636 const struct section *section = &sections[i];
3637 if (!strcmp(section_name, section->name) ||
3638 (section->unique_name && !strcmp(section_name, section->unique_name))) {
3640 "'%s' matches section with unique name '%s'\n", section_name,
3641 (char *)av_x_if_null(section->unique_name, section->name));
3643 mark_section_show_entries(section->id, show_all_entries, entries);
3661 "Missing section name for option '%s'\n", opt);
3672 "Adding '%s' to the entries to show in section '%s'\n",
3684 av_log(NULL, AV_LOG_ERROR, "No match for section '%s'\n", section_name);
3906 const struct section *section = &sections[id];
3908 section->flags & SECTION_FLAG_IS_WRAPPER ? 'W' : '.',
3909 section->flags & SECTION_FLAG_IS_ARRAY ? 'A' : '.',
3910 section->flags & SECTION_FLAG_HAS_VARIABLE_FIELDS ? 'V' : '.');
3911 printf("%*c %s", level * 4, ' ', section->name);
3912 if (section->unique_name)
3913 printf("/%s", section->unique_name);
3916 for (pid = section->children_ids; *pid != -1; pid++)
3939 #define DEFINE_OPT_SHOW_SECTION(section, target_section_id) \
3940 static int opt_show_##section(void *optctx, const char *opt, const char *arg) \
3972 { "sections", OPT_EXIT, {.func_arg = opt_sections}, "print sections structure and section information, and exit" },
4009 struct section *section = &sections[section_id];
4012 for (id = section->children_ids; *id != -1; id++)