Line data Source code
1 : /*
2 : * GPAC - Multimedia Framework C SDK
3 : *
4 : * Authors: Jean Le Feuvre
5 : * Copyright (c) Telecom ParisTech 2000-2012
6 : * All rights reserved
7 : *
8 : * This file is part of GPAC / MPEG-4 ObjectDescriptor sub-project
9 : *
10 : * GPAC is free software; you can redistribute it and/or modify
11 : * it under the terms of the GNU Lesser General Public License as published by
12 : * the Free Software Foundation; either version 2, or (at your option)
13 : * any later version.
14 : *
15 : * GPAC is distributed in the hope that it will be useful,
16 : * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 : * GNU Lesser General Public License for more details.
19 : *
20 : * You should have received a copy of the GNU Lesser General Public
21 : * License along with this library; see the file COPYING. If not, write to
22 : * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
23 : *
24 : */
25 :
26 : #include <gpac/internal/odf_dev.h>
27 : #include <gpac/constants.h>
28 : /*for import flags*/
29 : #include <gpac/media_tools.h>
30 : #include <gpac/network.h>
31 :
32 : #ifndef GPAC_DISABLE_OD_DUMP
33 :
34 : #define OD_MAX_TREE 100
35 :
36 : #define OD_FORMAT_INDENT( ind_buf, indent ) \
37 : { \
38 : u32 z; \
39 : assert(OD_MAX_TREE>indent); \
40 : for (z=0; z<indent; z++) ind_buf[z] = ' '; \
41 : ind_buf[z] = 0; \
42 : } \
43 :
44 : GF_EXPORT
45 45 : GF_Err gf_odf_dump_com(GF_ODCom *com, FILE *trace, u32 indent, Bool XMTDump)
46 : {
47 45 : switch (com->tag) {
48 24 : case GF_ODF_OD_UPDATE_TAG:
49 24 : return gf_odf_dump_od_update((GF_ODUpdate *)com, trace, indent, XMTDump);
50 9 : case GF_ODF_OD_REMOVE_TAG:
51 9 : return gf_odf_dump_od_remove((GF_ODRemove *)com, trace, indent, XMTDump);
52 3 : case GF_ODF_ESD_UPDATE_TAG:
53 3 : return gf_odf_dump_esd_update((GF_ESDUpdate *)com, trace, indent, XMTDump);
54 9 : case GF_ODF_ESD_REMOVE_TAG:
55 9 : return gf_odf_dump_esd_remove((GF_ESDRemove *)com, trace, indent, XMTDump);
56 : #ifndef GPAC_MINIMAL_ODF
57 : case GF_ODF_IPMP_UPDATE_TAG:
58 : return gf_odf_dump_ipmp_update((GF_IPMPUpdate *)com, trace, indent, XMTDump);
59 : case GF_ODF_IPMP_REMOVE_TAG:
60 : return gf_odf_dump_ipmp_remove((GF_IPMPRemove *)com, trace, indent, XMTDump);
61 : default:
62 : return gf_odf_dump_base_command((GF_BaseODCom *) com, trace, indent, XMTDump);
63 : #else
64 : default:
65 : return GF_NOT_SUPPORTED;
66 : #endif
67 : }
68 : }
69 :
70 : //unused
71 : #if 0
72 : GF_Err gf_odf_dump_au(char *data, u32 dataLength, FILE *trace, u32 indent, Bool XMTDump)
73 : {
74 : GF_ODCom *com;
75 : GF_ODCodec *odread = gf_odf_codec_new();
76 : gf_odf_codec_set_au(odread, data, dataLength);
77 : gf_odf_codec_decode(odread);
78 :
79 : while (1) {
80 : com = gf_odf_codec_get_com(odread);
81 : if (!com) break;
82 :
83 : gf_odf_dump_com(com, trace, indent, XMTDump);
84 : gf_odf_com_del(&com);
85 : }
86 : gf_odf_codec_del(odread);
87 : return GF_OK;
88 : }
89 : #endif
90 :
91 : GF_EXPORT
92 45 : GF_Err gf_odf_dump_com_list(GF_List *commandList, FILE *trace, u32 indent, Bool XMTDump)
93 : {
94 : GF_ODCom *com;
95 : u32 i;
96 45 : i=0;
97 135 : while ((com = (GF_ODCom *)gf_list_enum(commandList, &i))) {
98 45 : gf_odf_dump_com(com, trace, indent, XMTDump);
99 : }
100 45 : return GF_OK;
101 : }
102 :
103 :
104 : GF_EXPORT
105 504 : GF_Err gf_odf_dump_desc(GF_Descriptor *desc, FILE *trace, u32 indent, Bool XMTDump)
106 : {
107 504 : switch (desc->tag) {
108 13 : case GF_ODF_IOD_TAG :
109 13 : return gf_odf_dump_iod((GF_InitialObjectDescriptor *)desc, trace, indent, XMTDump);
110 109 : case GF_ODF_ESD_TAG :
111 109 : return gf_odf_dump_esd((GF_ESD *)desc, trace, indent, XMTDump);
112 101 : case GF_ODF_DCD_TAG :
113 101 : return gf_odf_dump_dcd((GF_DecoderConfig *)desc, trace, indent, XMTDump);
114 90 : case GF_ODF_SLC_TAG:
115 90 : return gf_odf_dump_slc((GF_SLConfig *)desc, trace, indent, XMTDump);
116 43 : case GF_ODF_ISOM_IOD_TAG:
117 43 : return gf_odf_dump_isom_iod((GF_IsomInitialObjectDescriptor *)desc, trace, indent, XMTDump);
118 1 : case GF_ODF_ISOM_OD_TAG:
119 1 : return gf_odf_dump_isom_od((GF_IsomObjectDescriptor *)desc, trace, indent, XMTDump);
120 43 : case GF_ODF_OD_TAG:
121 43 : return gf_odf_dump_od((GF_ObjectDescriptor *)desc, trace, indent, XMTDump);
122 4 : case GF_ODF_ESD_INC_TAG:
123 4 : return gf_odf_dump_esd_inc((GF_ES_ID_Inc *)desc, trace, indent, XMTDump);
124 1 : case GF_ODF_ESD_REF_TAG:
125 1 : return gf_odf_dump_esd_ref((GF_ES_ID_Ref *)desc, trace, indent, XMTDump);
126 : #ifndef GPAC_MINIMAL_ODF
127 : case GF_ODF_CC_TAG:
128 : return gf_odf_dump_cc((GF_CCDescriptor *)desc, trace, indent, XMTDump);
129 : case GF_ODF_CC_DATE_TAG:
130 : return gf_odf_dump_cc_date((GF_CC_Date *)desc, trace, indent, XMTDump);
131 : case GF_ODF_CC_NAME_TAG:
132 : return gf_odf_dump_cc_name((GF_CC_Name *)desc, trace, indent, XMTDump);
133 : case GF_ODF_CI_TAG:
134 : return gf_odf_dump_ci((GF_CIDesc *)desc, trace, indent, XMTDump);
135 : case GF_ODF_TEXT_TAG:
136 : return gf_odf_dump_exp_text((GF_ExpandedTextual *)desc, trace, indent, XMTDump);
137 : case GF_ODF_EXT_PL_TAG:
138 : return gf_odf_dump_pl_ext((GF_PLExt *)desc, trace, indent, XMTDump);
139 : case GF_ODF_IPI_PTR_TAG:
140 : case GF_ODF_ISOM_IPI_PTR_TAG:
141 : return gf_odf_dump_ipi_ptr((GF_IPIPtr *)desc, trace, indent, XMTDump);
142 : case GF_ODF_IPMP_TAG:
143 : return gf_odf_dump_ipmp((GF_IPMP_Descriptor *)desc, trace, indent, XMTDump);
144 : case GF_ODF_IPMP_PTR_TAG:
145 : return gf_odf_dump_ipmp_ptr((GF_IPMPPtr *)desc, trace, indent, XMTDump);
146 : case GF_ODF_KW_TAG:
147 : return gf_odf_dump_kw((GF_KeyWord *)desc, trace, indent, XMTDump);
148 : case GF_ODF_LANG_TAG:
149 : case GF_ODF_GPAC_LANG:
150 : return gf_odf_dump_lang((GF_Language *)desc, trace, indent, XMTDump);
151 : case GF_ODF_OCI_DATE_TAG:
152 : return gf_odf_dump_oci_date((GF_OCI_Data *)desc, trace, indent, XMTDump);
153 : case GF_ODF_OCI_NAME_TAG:
154 : return gf_odf_dump_oci_name((GF_OCICreators *)desc, trace, indent, XMTDump);
155 : case GF_ODF_PL_IDX_TAG:
156 : return gf_odf_dump_pl_idx((GF_PL_IDX *)desc, trace, indent, XMTDump);
157 : case GF_ODF_QOS_TAG:
158 : return gf_odf_dump_qos((GF_QoS_Descriptor *)desc, trace, indent, XMTDump);
159 : case GF_ODF_RATING_TAG:
160 : return gf_odf_dump_rating((GF_Rating *)desc, trace, indent, XMTDump);
161 : case GF_ODF_REG_TAG:
162 : return gf_odf_dump_reg((GF_Registration *)desc, trace, indent, XMTDump);
163 : case GF_ODF_SHORT_TEXT_TAG:
164 : return gf_odf_dump_short_text((GF_ShortTextual *)desc, trace, indent, XMTDump);
165 : case GF_ODF_SMPTE_TAG:
166 : return gf_odf_dump_smpte_camera((GF_SMPTECamera *)desc, trace, indent, XMTDump);
167 : case GF_ODF_SCI_TAG:
168 : return gf_odf_dump_sup_cid((GF_SCIDesc *)desc, trace, indent, XMTDump);
169 : case GF_ODF_SEGMENT_TAG:
170 : return gf_odf_dump_segment((GF_Segment *)desc, trace, indent, XMTDump);
171 : case GF_ODF_MEDIATIME_TAG:
172 : return gf_odf_dump_mediatime((GF_MediaTime *)desc, trace, indent, XMTDump);
173 : case GF_ODF_IPMP_TL_TAG:
174 : return gf_odf_dump_ipmp_tool_list((GF_IPMP_ToolList*)desc, trace, indent, XMTDump);
175 : case GF_ODF_IPMP_TOOL_TAG:
176 : return gf_odf_dump_ipmp_tool((GF_IPMP_Tool*)desc, trace, indent, XMTDump);
177 : #endif //GPAC_MINIMAL_ODF
178 0 : case GF_ODF_TEXT_CFG_TAG:
179 0 : return gf_odf_dump_txtcfg((GF_TextConfig *)desc, trace, indent, XMTDump);
180 39 : case GF_ODF_MUXINFO_TAG:
181 39 : return gf_odf_dump_muxinfo((GF_MuxInfo *)desc, trace, indent, XMTDump);
182 5 : case GF_ODF_BIFS_CFG_TAG:
183 5 : return gf_odf_dump_bifs_cfg((GF_BIFSConfig *)desc, trace, indent, XMTDump);
184 2 : case GF_ODF_LASER_CFG_TAG:
185 2 : return gf_odf_dump_laser_cfg((GF_LASERConfig *)desc, trace, indent, XMTDump);
186 6 : case GF_ODF_UI_CFG_TAG:
187 6 : return gf_odf_dump_ui_cfg((GF_UIConfig *)desc, trace, indent, XMTDump);
188 4 : case GF_ODF_AUX_VIDEO_DATA:
189 4 : return gf_odf_dump_aux_vid((GF_AuxVideoDescriptor *)desc, trace, indent, XMTDump);
190 43 : default:
191 43 : return gf_odf_dump_default((GF_DefaultDescriptor *)desc, trace, indent, XMTDump);
192 : }
193 : return GF_OK;
194 : }
195 :
196 :
197 :
198 585 : static void StartDescDump(FILE *trace, const char *descName, u32 indent, Bool XMTDump)
199 : {
200 : char ind_buf[OD_MAX_TREE];
201 585 : OD_FORMAT_INDENT(ind_buf, indent);
202 :
203 585 : if (!XMTDump) {
204 176 : gf_fprintf(trace, "%s {\n", descName);
205 : } else {
206 428 : gf_fprintf(trace, "%s<%s ", ind_buf, descName);
207 : }
208 585 : }
209 :
210 481 : static void EndDescDump(FILE *trace, const char *descName, u32 indent, Bool XMTDump)
211 : {
212 : char ind_buf[OD_MAX_TREE];
213 629 : OD_FORMAT_INDENT(ind_buf, indent);
214 :
215 481 : if (!XMTDump) {
216 175 : gf_fprintf(trace, "%s}\n", ind_buf);
217 : } else {
218 329 : gf_fprintf(trace, "%s</%s>\n", ind_buf, descName);
219 : }
220 481 : }
221 :
222 : /*special element open for XML only, appends "<eltName " - used because XMT-A OD representations use lots of
223 : subdescs not present in BT*/
224 : static void StartSubElement(FILE *trace, const char *eltName, u32 indent, Bool XMTDump)
225 : {
226 49 : if (XMTDump) {
227 : char ind_buf[OD_MAX_TREE];
228 579 : OD_FORMAT_INDENT(ind_buf, indent);
229 143 : gf_fprintf(trace, "%s<%s ", ind_buf, eltName);
230 : }
231 : }
232 : /*special close for XML only, appends "/>" - used because XMT-A OD representations use lots of
233 : subdescs not present in BT*/
234 : static void EndSubElement(FILE *trace, u32 indent, Bool XMTDump)
235 : {
236 173 : if (XMTDump) gf_fprintf(trace, "/>\n");
237 : }
238 :
239 : static void EndAttributes(FILE *trace, u32 indent, Bool XMTDump)
240 : {
241 582 : if (XMTDump) gf_fprintf(trace, ">\n");
242 : }
243 :
244 462 : static void StartElement(FILE *trace, const char *attName, u32 indent, Bool XMTDump, Bool IsList)
245 : {
246 : char ind_buf[OD_MAX_TREE];
247 462 : OD_FORMAT_INDENT(ind_buf, indent);
248 462 : if (!XMTDump) {
249 150 : if (IsList)
250 43 : gf_fprintf(trace, "%s%s [\n", ind_buf, attName);
251 : else
252 107 : gf_fprintf(trace, "%s%s ", ind_buf, attName);
253 : } else {
254 312 : gf_fprintf(trace, "%s<%s>\n", ind_buf, attName);
255 : }
256 462 : }
257 :
258 501 : static void EndElement(FILE *trace, const char *attName, u32 indent, Bool XMTDump, Bool IsList)
259 : {
260 : char ind_buf[OD_MAX_TREE];
261 657 : OD_FORMAT_INDENT(ind_buf, indent);
262 501 : if (!XMTDump) {
263 131 : if (IsList) gf_fprintf(trace, "%s]\n", ind_buf);
264 : } else {
265 390 : gf_fprintf(trace, "%s</%s>\n", ind_buf, attName);
266 : }
267 501 : }
268 :
269 1549 : static void StartAttribute(FILE *trace, const char *attName, u32 indent, Bool XMTDump)
270 : {
271 : char ind_buf[OD_MAX_TREE];
272 1549 : OD_FORMAT_INDENT(ind_buf, indent);
273 1549 : if (!XMTDump) {
274 476 : gf_fprintf(trace, "%s%s ", ind_buf, attName);
275 : } else {
276 1073 : gf_fprintf(trace, "%s=\"", attName);
277 : }
278 1549 : }
279 1549 : static void EndAttribute(FILE *trace, u32 indent, Bool XMTDump)
280 : {
281 1549 : if (!XMTDump) {
282 476 : gf_fprintf(trace, "\n");
283 : } else {
284 1073 : gf_fprintf(trace, "\" ");
285 : }
286 1549 : }
287 :
288 1691 : static void DumpInt(FILE *trace, const char *attName, u32 val, u32 indent, Bool XMTDump)
289 : {
290 1691 : if (!val) return;
291 888 : StartAttribute(trace, attName, indent, XMTDump);
292 888 : gf_fprintf(trace, "%d", val);
293 888 : EndAttribute(trace, indent, XMTDump);
294 : }
295 :
296 101 : static void DumpIntForce(FILE *trace, const char *attName, u32 val, u32 indent, Bool XMTDump)
297 : {
298 101 : StartAttribute(trace, attName, indent, XMTDump);
299 101 : gf_fprintf(trace, "%d", val);
300 101 : EndAttribute(trace, indent, XMTDump);
301 101 : }
302 :
303 4 : static void DumpIntHex(FILE *trace, const char *attName, u32 val, u32 indent, Bool XMTDump, Bool single_byte)
304 : {
305 4 : StartAttribute(trace, attName, indent, XMTDump);
306 4 : if (single_byte) {
307 4 : gf_fprintf(trace, "0x%02X", val);
308 : } else {
309 0 : gf_fprintf(trace, "0x%08X", val);
310 : }
311 4 : EndAttribute(trace, indent, XMTDump);
312 4 : }
313 :
314 : #ifndef GPAC_MINIMAL_ODF
315 : static void DumpFloat(FILE *trace, const char *attName, Float val, u32 indent, Bool XMTDump)
316 : {
317 : StartAttribute(trace, attName, indent, XMTDump);
318 : gf_fprintf(trace, "%g", val);
319 : EndAttribute(trace, indent, XMTDump);
320 : }
321 :
322 : static void DumpDouble(FILE *trace, const char *attName, Double val, u32 indent, Bool XMTDump)
323 : {
324 : StartAttribute(trace, attName, indent, XMTDump);
325 : gf_fprintf(trace, "%g", val);
326 : EndAttribute(trace, indent, XMTDump);
327 : }
328 : static void DumpBin128(FILE *trace, const char *name, char *data, u32 indent, Bool XMTDump)
329 : {
330 : u32 i;
331 : if (!name ||!data) return;
332 : StartAttribute(trace, name, indent, XMTDump);
333 : gf_fprintf(trace, "0x");
334 : i=0;
335 : while (!data[i] && (i<16)) i++;
336 : if (i==16) {
337 : gf_fprintf(trace, "00");
338 : } else {
339 : for (; i<16; i++) gf_fprintf(trace, "%02X", (unsigned char) data[i]);
340 : }
341 : EndAttribute(trace, indent, XMTDump);
342 : }
343 :
344 : #endif
345 :
346 426 : static void DumpBool(FILE *trace, const char *attName, u32 val, u32 indent, Bool XMTDump)
347 : {
348 426 : if (!val) return;
349 :
350 168 : StartAttribute(trace, attName, indent, XMTDump);
351 168 : gf_fprintf(trace, "%s", "true");
352 168 : EndAttribute(trace, indent, XMTDump);
353 : }
354 :
355 106 : static void DumpString(FILE *trace, const char *attName, char *val, u32 indent, Bool XMTDump)
356 : {
357 106 : if (!val) return;
358 106 : StartAttribute(trace, attName, indent, XMTDump);
359 106 : if (!XMTDump) gf_fprintf(trace, "\"");
360 106 : gf_fprintf(trace, "%s", val);
361 106 : if (!XMTDump) gf_fprintf(trace, "\"");
362 106 : EndAttribute(trace, indent, XMTDump);
363 : }
364 :
365 43 : static void DumpData(FILE *trace, const char *name, char *data, u64 dataLength, u32 indent, Bool XMTDump)
366 : {
367 : u64 i;
368 43 : if (!name ||!data) return;
369 38 : StartAttribute(trace, name, indent, XMTDump);
370 38 : if (XMTDump) gf_fprintf(trace, "data:application/octet-string,");
371 6934 : for (i=0; i<dataLength; i++) {
372 6934 : gf_fprintf(trace, "%%");
373 6934 : gf_fprintf(trace, "%02X", (unsigned char) data[i]);
374 : }
375 38 : EndAttribute(trace, indent, XMTDump);
376 : }
377 :
378 755 : GF_Err DumpDescList(GF_List *list, FILE *trace, u32 indent, const char *ListName, Bool XMTDump, Bool no_skip_empty)
379 : {
380 : u32 i, count;
381 : char ind_buf[OD_MAX_TREE];
382 755 : if (!list) return GF_OK;
383 755 : count = gf_list_count(list);
384 755 : if (!no_skip_empty && !count) return GF_OK;
385 89 : StartElement(trace, ListName, indent, XMTDump, GF_TRUE);
386 89 : indent++;
387 89 : OD_FORMAT_INDENT(ind_buf, indent);
388 217 : for (i=0; i<count; i++) {
389 128 : GF_Descriptor *desc = (GF_Descriptor *)gf_list_get(list, i);
390 : //add offset if not XMT
391 128 : if (!XMTDump) gf_fprintf(trace, "%s", ind_buf);
392 128 : gf_odf_dump_desc(desc, trace, indent, XMTDump);
393 : }
394 : indent--;
395 89 : EndElement(trace, ListName, indent, XMTDump, GF_TRUE);
396 89 : return GF_OK;
397 : }
398 :
399 :
400 200 : GF_Err DumpDescListFilter(GF_List *list, FILE *trace, u32 indent, const char *ListName, Bool XMTDump, u8 tag_only)
401 : {
402 : u32 i, count, num_desc;
403 : GF_Descriptor *desc;
404 : char ind_buf[OD_MAX_TREE];
405 200 : if (!list) return GF_OK;
406 :
407 200 : count = gf_list_count(list);
408 : num_desc = 0;
409 200 : for (i=0; i<count; i++) {
410 0 : desc = (GF_Descriptor *)gf_list_get(list, i);
411 0 : if (desc->tag == tag_only) num_desc++;
412 : }
413 200 : if (!num_desc) return GF_OK;
414 :
415 0 : StartElement(trace, ListName, indent, XMTDump, GF_TRUE);
416 0 : indent++;
417 0 : OD_FORMAT_INDENT(ind_buf, indent);
418 0 : for (i=0; i<count; i++) {
419 0 : desc = (GF_Descriptor *)gf_list_get(list, i);
420 0 : if (desc->tag == tag_only) {
421 : //add offset if not XMT
422 0 : if (!XMTDump) gf_fprintf(trace, "%s", ind_buf);
423 0 : gf_odf_dump_desc(desc, trace, indent, XMTDump);
424 : }
425 : }
426 : indent--;
427 0 : EndElement(trace, ListName, indent, XMTDump, GF_TRUE);
428 0 : return GF_OK;
429 : }
430 :
431 13 : GF_Err gf_odf_dump_iod(GF_InitialObjectDescriptor *iod, FILE *trace, u32 indent, Bool XMTDump)
432 : {
433 13 : StartDescDump(trace, "InitialObjectDescriptor", indent, XMTDump);
434 13 : indent++;
435 :
436 13 : StartAttribute(trace, "objectDescriptorID", indent, XMTDump);
437 13 : if (XMTDump) {
438 6 : gf_fprintf(trace, "od%d", iod->objectDescriptorID);
439 6 : EndAttribute(trace, indent, XMTDump);
440 6 : DumpInt(trace, "binaryID", iod->objectDescriptorID, indent, XMTDump);
441 : } else {
442 7 : gf_fprintf(trace, "%d", iod->objectDescriptorID);
443 7 : EndAttribute(trace, indent, XMTDump);
444 : }
445 :
446 : EndAttributes(trace, indent, XMTDump);
447 :
448 : StartSubElement(trace, "Profiles", indent, XMTDump);
449 :
450 13 : DumpInt(trace, "audioProfileLevelIndication", iod->audio_profileAndLevel, indent, XMTDump);
451 13 : DumpInt(trace, "visualProfileLevelIndication", iod->visual_profileAndLevel, indent, XMTDump);
452 13 : DumpInt(trace, "sceneProfileLevelIndication", iod->scene_profileAndLevel, indent, XMTDump);
453 13 : DumpInt(trace, "graphicsProfileLevelIndication", iod->graphics_profileAndLevel, indent, XMTDump);
454 13 : DumpInt(trace, "ODProfileLevelIndication", iod->OD_profileAndLevel, indent, XMTDump);
455 13 : DumpBool(trace, "includeInlineProfileLevelFlag", iod->inlineProfileFlag, indent, XMTDump);
456 :
457 : EndSubElement(trace, indent, XMTDump);
458 :
459 13 : if (iod->URLString) {
460 : StartSubElement(trace, "URL", indent, XMTDump);
461 0 : DumpString(trace, "URLstring", iod->URLString, indent, XMTDump);
462 : EndSubElement(trace, indent, XMTDump);
463 : }
464 :
465 13 : if (XMTDump) {
466 6 : StartElement(trace, "Descr", indent, XMTDump, GF_TRUE);
467 6 : indent++;
468 : }
469 : //ESDescr
470 13 : DumpDescList(iod->ESDescriptors, trace, indent, "esDescr", XMTDump, GF_FALSE);
471 13 : DumpDescList(iod->OCIDescriptors, trace, indent, "ociDescr", XMTDump, GF_FALSE);
472 13 : DumpDescListFilter(iod->IPMP_Descriptors, trace, indent, "ipmpDescrPtr", XMTDump, GF_ODF_IPMP_PTR_TAG);
473 13 : DumpDescListFilter(iod->IPMP_Descriptors, trace, indent, "ipmpDescr", XMTDump, GF_ODF_IPMP_TAG);
474 :
475 13 : DumpDescList(iod->extensionDescriptors, trace, indent, "extDescr", XMTDump, GF_FALSE);
476 :
477 13 : if (iod->IPMPToolList) {
478 0 : StartElement(trace, "toolListDescr" , indent, XMTDump, GF_FALSE);
479 0 : gf_odf_dump_desc((GF_Descriptor*)iod->IPMPToolList, trace, indent + (XMTDump ? 1 : 0), XMTDump);
480 0 : EndElement(trace, "toolListDescr" , indent, XMTDump, GF_FALSE);
481 : }
482 :
483 13 : if (XMTDump) {
484 6 : indent--;
485 6 : EndElement(trace, "Descr", indent, XMTDump, GF_TRUE);
486 : }
487 13 : indent--;
488 13 : EndDescDump(trace, "InitialObjectDescriptor", indent, XMTDump);
489 13 : return GF_OK;
490 : }
491 :
492 109 : GF_Err gf_odf_dump_esd(GF_ESD *esd, FILE *trace, u32 indent, Bool XMTDump)
493 : {
494 : GF_MuxInfo *mi;
495 : u32 i;
496 109 : StartDescDump(trace, "ES_Descriptor", indent, XMTDump);
497 109 : indent++;
498 :
499 109 : StartAttribute(trace, "ES_ID", indent, XMTDump);
500 109 : if (XMTDump) {
501 74 : gf_fprintf(trace, "es%d", esd->ESID);
502 74 : EndAttribute(trace, indent, XMTDump);
503 74 : DumpInt(trace, "binaryID", esd->ESID, indent, XMTDump);
504 : } else {
505 35 : gf_fprintf(trace, "%d", esd->ESID);
506 35 : EndAttribute(trace, indent, XMTDump);
507 : }
508 109 : DumpInt(trace, "streamPriority", esd->streamPriority, indent, XMTDump);
509 :
510 109 : if (XMTDump) {
511 74 : if (esd->dependsOnESID) {
512 0 : StartAttribute(trace, "dependsOn_ES_ID", indent, XMTDump);
513 0 : gf_fprintf(trace, "es%d", esd->dependsOnESID);
514 0 : EndAttribute(trace, indent, XMTDump);
515 : }
516 :
517 74 : if (esd->OCRESID) {
518 18 : StartAttribute(trace, "OCR_ES_ID", indent, XMTDump);
519 18 : gf_fprintf(trace, "es%d", esd->OCRESID);
520 18 : EndAttribute(trace, indent, XMTDump);
521 : }
522 : } else {
523 35 : if (esd->dependsOnESID) DumpInt(trace, "dependsOn_ES_ID", esd->dependsOnESID, indent, XMTDump);
524 35 : if (esd->OCRESID) DumpInt(trace, "OCR_ES_ID", esd->OCRESID, indent, XMTDump);
525 : }
526 :
527 : EndAttributes(trace, indent, XMTDump);
528 :
529 109 : if (esd->URLString) {
530 : StartSubElement(trace, "URL", indent, XMTDump);
531 0 : DumpString(trace, "URLstring", esd->URLString, indent, XMTDump);
532 : EndSubElement(trace, indent, XMTDump);
533 : }
534 109 : if (esd->decoderConfig) {
535 101 : StartElement(trace, "decConfigDescr" , indent, XMTDump, GF_FALSE);
536 101 : gf_odf_dump_desc((GF_Descriptor*)esd->decoderConfig, trace, indent + (XMTDump ? 1 : 0), XMTDump);
537 101 : EndElement(trace, "decConfigDescr" , indent, XMTDump, GF_FALSE);
538 : }
539 109 : if (esd->slConfig) {
540 90 : StartElement(trace, "slConfigDescr" , indent, XMTDump, GF_FALSE);
541 90 : gf_odf_dump_desc((GF_Descriptor*)esd->slConfig, trace, indent + (XMTDump ? 1 : 0), XMTDump);
542 90 : EndElement(trace, "slConfigDescr" , indent, XMTDump, GF_FALSE);
543 : } else {
544 19 : StartElement(trace, "slConfigDescr" , indent, XMTDump, GF_FALSE);
545 19 : StartDescDump(trace, "SLConfigDescriptor", indent, XMTDump);
546 : EndAttributes(trace, indent, XMTDump);
547 19 : EndDescDump(trace, "SLConfigDescriptor", indent, XMTDump);
548 19 : EndElement(trace, "slConfigDescr" , indent, XMTDump, GF_FALSE);
549 : }
550 109 : if (esd->ipiPtr) {
551 0 : StartElement(trace, "ipiPtr" , indent, XMTDump, GF_FALSE);
552 0 : gf_odf_dump_desc((GF_Descriptor*)esd->ipiPtr, trace, indent + (XMTDump ? 1 : 0), XMTDump);
553 0 : EndElement(trace, "ipiPtr" , indent, XMTDump, GF_FALSE);
554 : }
555 :
556 109 : DumpDescList(esd->IPIDataSet, trace, indent, "ipIDS", XMTDump, GF_FALSE);
557 109 : DumpDescList(esd->IPMPDescriptorPointers, trace, indent, "ipmpDescrPtr", XMTDump, GF_FALSE);
558 :
559 109 : if (esd->qos) {
560 0 : StartElement(trace, "qosDescr" , indent, XMTDump, GF_FALSE);
561 0 : gf_odf_dump_desc((GF_Descriptor*)esd->qos, trace, indent + (XMTDump ? 1 : 0), XMTDump);
562 0 : EndElement(trace, "qosDescr" , indent, XMTDump, GF_FALSE);
563 : }
564 109 : if (esd->langDesc) {
565 1 : StartElement(trace, "langDescr" , indent, XMTDump, GF_FALSE);
566 1 : gf_odf_dump_desc((GF_Descriptor*)esd->langDesc, trace, indent + (XMTDump ? 1 : 0), XMTDump);
567 1 : EndElement(trace, "langDescr" , indent, XMTDump, GF_FALSE);
568 : }
569 :
570 109 : if (esd->RegDescriptor) {
571 0 : StartElement(trace, "regDescr" , indent, XMTDump, GF_FALSE);
572 0 : gf_odf_dump_desc((GF_Descriptor*)esd->RegDescriptor, trace, indent + (XMTDump ? 1 : 0), XMTDump);
573 0 : EndElement(trace, "regDescr" , indent, XMTDump, GF_FALSE);
574 : }
575 :
576 : mi = NULL;
577 109 : i=0;
578 225 : while ((mi = (GF_MuxInfo *)gf_list_enum(esd->extensionDescriptors, &i))) {
579 46 : if (mi->tag == GF_ODF_MUXINFO_TAG) {
580 39 : gf_list_rem(esd->extensionDescriptors, i-1);
581 39 : break;
582 : }
583 : mi = NULL;
584 : }
585 :
586 109 : DumpDescList(esd->extensionDescriptors, trace, indent, "extDescr", XMTDump, GF_FALSE);
587 :
588 109 : if (mi) {
589 39 : gf_list_insert(esd->extensionDescriptors, mi, i);
590 39 : if (XMTDump) {
591 20 : gf_odf_dump_desc((GF_Descriptor*)mi, trace, indent, GF_TRUE);
592 : } else {
593 19 : StartElement(trace, "muxInfo", indent, GF_FALSE, GF_FALSE);
594 19 : gf_odf_dump_desc((GF_Descriptor*)mi, trace, indent, GF_FALSE);
595 : EndElement(trace, "muxInfo", indent, GF_FALSE, GF_FALSE);
596 : }
597 : }
598 :
599 : indent--;
600 109 : EndDescDump(trace, "ES_Descriptor", indent, XMTDump);
601 109 : return GF_OK;
602 : }
603 :
604 5 : GF_Err gf_odf_dump_bifs_cfg(GF_BIFSConfig *dsi, FILE *trace, u32 indent, Bool XMTDump)
605 : {
606 : u32 i, count;
607 5 : StartDescDump(trace, (dsi->version==1) ? "BIFSConfig" : "BIFSv2Config", indent, XMTDump);
608 5 : indent++;
609 :
610 : if (dsi->version==2) {
611 : DumpBool(trace, "use3DMeshCoding", 0, indent, XMTDump);
612 : DumpBool(trace, "usePredictiveMFField", 0, indent, XMTDump);
613 : }
614 5 : DumpInt(trace, "nodeIDbits", dsi->nodeIDbits, indent, XMTDump);
615 5 : DumpInt(trace, "routeIDbits", dsi->routeIDbits, indent, XMTDump);
616 5 : if (dsi->version==2) DumpInt(trace, "protoIDbits", dsi->protoIDbits, indent, XMTDump);
617 :
618 5 : count = gf_list_count(dsi->elementaryMasks);
619 5 : if (count) {
620 : EndAttributes(trace, indent, XMTDump);
621 :
622 : /*TODO check XMT-A syntax for anim mask*/
623 0 : StartDescDump(trace, "AnimationMask" , indent, XMTDump);
624 0 : DumpBool(trace, "randomAccess", dsi->randomAccess, indent, XMTDump);
625 : EndAttributes(trace, indent, XMTDump);
626 0 : for (i=0; i<count; i++) {
627 0 : GF_ElementaryMask *em = (GF_ElementaryMask *)gf_list_get(dsi->elementaryMasks, i);
628 0 : StartDescDump(trace, "ElementaryMask" , indent, XMTDump);
629 0 : if (em->node_id) DumpInt(trace, "atNode", em->node_id, indent, XMTDump);
630 0 : else if (em->node_name) DumpString(trace, "atNode", em->node_name, indent, XMTDump);
631 : EndAttributes(trace, indent, XMTDump);
632 0 : if (XMTDump) EndDescDump(trace, "ElementaryMask", indent, GF_TRUE);
633 : else EndDescDump(trace, "ElementaryMask", indent, GF_FALSE);
634 : }
635 0 : EndDescDump(trace, "AnimationMask", indent, XMTDump);
636 : indent--;
637 0 : EndDescDump(trace, (dsi->version==1) ? "BIFSConfig" : "BIFSv2Config", indent, XMTDump);
638 0 : return GF_OK;
639 : }
640 5 : if (XMTDump) {
641 : EndAttributes(trace, indent, XMTDump);
642 3 : indent++;
643 3 : StartDescDump(trace, "commandStream" , indent, XMTDump);
644 3 : DumpBool(trace, "pixelMetric", dsi->pixelMetrics, indent, XMTDump);
645 : EndAttributes(trace, indent, XMTDump);
646 : } else {
647 2 : DumpBool(trace, "isCommandStream", 1, indent, XMTDump);
648 2 : DumpBool(trace, "pixelMetric", dsi->pixelMetrics, indent, XMTDump);
649 : }
650 5 : if (dsi->pixelWidth && dsi->pixelHeight) {
651 5 : if (XMTDump) {
652 3 : indent++;
653 3 : StartDescDump(trace, "size" , indent, XMTDump);
654 : }
655 :
656 5 : DumpInt(trace, "pixelWidth", dsi->pixelWidth, indent, XMTDump);
657 5 : DumpInt(trace, "pixelHeight", dsi->pixelHeight, indent, XMTDump);
658 5 : if (XMTDump) {
659 : EndSubElement(trace, indent, XMTDump);
660 3 : indent--;
661 : }
662 : }
663 :
664 5 : if (XMTDump) {
665 3 : EndDescDump(trace, "commandStream", indent, XMTDump);
666 3 : indent--;
667 : }
668 5 : indent--;
669 5 : EndDescDump(trace, (dsi->version==1) ? "BIFSConfig" : "BIFSv2Config", indent, XMTDump);
670 5 : return GF_OK;
671 : }
672 :
673 11 : GF_Err DumpRawBIFSConfig(GF_DefaultDescriptor *dsi, FILE *trace, u32 indent, Bool XMTDump, u32 oti)
674 : {
675 : GF_BitStream *bs;
676 : u32 flag;
677 :
678 11 : bs = gf_bs_new(dsi->data, dsi->dataLength, GF_BITSTREAM_READ);
679 :
680 11 : StartDescDump(trace, (oti==1) ? "BIFSConfig" : "BIFSv2Config", indent, XMTDump);
681 11 : indent++;
682 :
683 11 : if (oti==2) {
684 6 : DumpBool(trace, "use3DMeshCoding", gf_bs_read_int(bs, 1), indent, XMTDump);
685 6 : DumpBool(trace, "usePredictiveMFField", gf_bs_read_int(bs, 1), indent, XMTDump);
686 : }
687 11 : DumpInt(trace, "nodeIDbits", gf_bs_read_int(bs, 5), indent, XMTDump);
688 11 : DumpInt(trace, "routeIDbits", gf_bs_read_int(bs, 5), indent, XMTDump);
689 :
690 11 : if (oti==2)
691 6 : DumpInt(trace, "protoIDbits", gf_bs_read_int(bs, 5), indent, XMTDump);
692 :
693 11 : flag = gf_bs_read_int(bs, 1);
694 11 : if (!flag) {
695 0 : gf_bs_del(bs);
696 0 : return GF_NOT_SUPPORTED;
697 : }
698 :
699 11 : if (XMTDump) {
700 : EndAttributes(trace, indent, XMTDump);
701 5 : indent++;
702 5 : StartDescDump(trace, "commandStream" , indent, XMTDump);
703 5 : DumpBool(trace, "pixelMetric", gf_bs_read_int(bs, 1), indent, XMTDump);
704 : EndAttributes(trace, indent, XMTDump);
705 : } else {
706 6 : DumpBool(trace, "isCommandStream", 1, indent, XMTDump);
707 6 : DumpBool(trace, "pixelMetric", gf_bs_read_int(bs, 1), indent, XMTDump);
708 : }
709 :
710 11 : if (gf_bs_read_int(bs, 1)) {
711 :
712 11 : if (XMTDump) {
713 5 : indent++;
714 5 : StartDescDump(trace, "size" , indent, XMTDump);
715 : }
716 :
717 11 : DumpInt(trace, "pixelWidth", gf_bs_read_int(bs, 16), indent, XMTDump);
718 11 : DumpInt(trace, "pixelHeight", gf_bs_read_int(bs, 16), indent, XMTDump);
719 11 : if (XMTDump) {
720 : EndSubElement(trace, indent, XMTDump);
721 5 : indent--;
722 : }
723 :
724 : }
725 :
726 11 : if (XMTDump) {
727 5 : EndDescDump(trace, "commandStream", indent, XMTDump);
728 5 : indent--;
729 : }
730 11 : indent--;
731 11 : EndDescDump(trace, (oti==1) ? "BIFSConfig" : "BIFSv2Config", indent, XMTDump);
732 :
733 11 : gf_bs_del(bs);
734 11 : return GF_OK;
735 : }
736 :
737 2 : GF_Err gf_odf_dump_laser_cfg(GF_LASERConfig *dsi, FILE *trace, u32 indent, Bool XMTDump)
738 : {
739 4 : gf_fprintf(trace, "<lsr:LASeRHeader profile=\"%s\" pointsCodec=\"%s\"",
740 2 : dsi->profile ? "mini" : "full",
741 2 : dsi->pointsCodec ? "Unknown" : "ExpGolombPointsCodec");
742 :
743 2 : if (dsi->colorComponentBits) gf_fprintf(trace, " colorComponentBits=\"%d\"", dsi->colorComponentBits);
744 2 : if (dsi->newSceneIndicator) gf_fprintf(trace, " newSceneIndicator=\"true\"");
745 2 : if (dsi->coord_bits) gf_fprintf(trace, " coordBits=\"%d\"", dsi->coord_bits);
746 2 : if (dsi->fullRequestHost) gf_fprintf(trace, " useFullRequestHost=\"true\"");
747 2 : if (dsi->pathComponents) gf_fprintf(trace, " pathComponents=\"%d\"", dsi->pathComponents);
748 2 : if (dsi->time_resolution && (dsi->time_resolution!=1000) ) gf_fprintf(trace, " timeResolution=\"%d\"", dsi->time_resolution);
749 2 : if (dsi->resolution) gf_fprintf(trace, " resolution=\"%d\"", dsi->resolution);
750 2 : if (dsi->scale_bits_minus_coord_bits) gf_fprintf(trace, " scaleBits_minus_coordBits=\"%d\"", dsi->scale_bits_minus_coord_bits);
751 2 : gf_fprintf(trace, "/>\n");
752 2 : return GF_OK;
753 : }
754 :
755 :
756 : GF_EXPORT
757 1 : GF_Err gf_odf_dump_txtcfg(GF_TextConfig *desc, FILE *trace, u32 indent, Bool XMTDump)
758 : {
759 : u32 i, count;
760 : char ind_buf[OD_MAX_TREE];
761 1 : if (!trace || !desc) return GF_BAD_PARAM;
762 0 : StartDescDump(trace, "TextConfig", indent, XMTDump);
763 0 : indent++;
764 0 : DumpIntHex(trace, "3GPPBaseFormat", desc->Base3GPPFormat, indent, XMTDump, GF_TRUE);
765 0 : DumpIntHex(trace, "MPEGExtendedFormat", desc->MPEGExtendedFormat, indent, XMTDump, GF_TRUE);
766 0 : DumpIntHex(trace, "profileLevel", desc->profileLevel, indent, XMTDump, GF_TRUE);
767 0 : DumpInt(trace, "durationClock", desc->timescale, indent, XMTDump);
768 0 : DumpInt(trace, "layer", desc->layer, indent, XMTDump);
769 0 : DumpInt(trace, "text_width", desc->text_width, indent, XMTDump);
770 0 : DumpInt(trace, "text_height", desc->text_height, indent, XMTDump);
771 0 : if (desc->video_width) DumpInt(trace, "video_width", desc->video_width, indent, XMTDump);
772 0 : if (desc->video_height) DumpInt(trace, "video_height", desc->video_height, indent, XMTDump);
773 0 : if (desc->horiz_offset) DumpInt(trace, "horizontal_offset", desc->horiz_offset, indent, XMTDump);
774 0 : if (desc->vert_offset) DumpInt(trace, "vertical_offset", desc->vert_offset, indent, XMTDump);
775 :
776 0 : StartElement(trace, "SampleDescriptions", indent, XMTDump, GF_TRUE);
777 0 : indent++;
778 0 : OD_FORMAT_INDENT(ind_buf, indent);
779 :
780 0 : count = gf_list_count(desc->sample_descriptions);
781 0 : for (i=0; i<count; i++) {
782 : char szStyles[1024];
783 : u32 j;
784 0 : GF_TextSampleDescriptor *sd = (GF_TextSampleDescriptor *)gf_list_get(desc->sample_descriptions, i);
785 0 : if (!XMTDump) gf_fprintf(trace, "%s", ind_buf);
786 0 : StartDescDump(trace, "TextSampleDescriptor", indent, XMTDump);
787 0 : indent++;
788 0 : DumpIntHex(trace, "displayFlags", sd->displayFlags, indent, XMTDump, GF_FALSE);
789 0 : DumpInt(trace, "horiz_justif", sd->horiz_justif, indent, XMTDump);
790 0 : DumpInt(trace, "vert_justif", sd->vert_justif, indent, XMTDump);
791 0 : DumpIntHex(trace, "back_color", sd->back_color, indent, XMTDump, GF_FALSE);
792 0 : DumpInt(trace, "top", sd->default_pos.top, indent, XMTDump);
793 0 : DumpInt(trace, "bottom", sd->default_pos.bottom, indent, XMTDump);
794 0 : DumpInt(trace, "left", sd->default_pos.left, indent, XMTDump);
795 0 : DumpInt(trace, "right", sd->default_pos.right, indent, XMTDump);
796 0 : DumpInt(trace, "style_font_ID", sd->default_style.fontID, indent, XMTDump);
797 0 : DumpInt(trace, "style_font_size", sd->default_style.font_size, indent, XMTDump);
798 0 : DumpIntHex(trace, "style_text_color", sd->default_style.text_color, indent, XMTDump, GF_FALSE);
799 : strcpy(szStyles, "");
800 0 : if (sd->default_style.style_flags & GF_TXT_STYLE_BOLD) strcat(szStyles, "bold ");
801 0 : if (sd->default_style.style_flags & GF_TXT_STYLE_ITALIC) strcat(szStyles, "italic ");
802 0 : if (sd->default_style.style_flags & GF_TXT_STYLE_UNDERLINED) strcat(szStyles, "underlined ");
803 0 : if (sd->default_style.style_flags & GF_TXT_STYLE_STRIKETHROUGH) strcat(szStyles, "strikethrough ");
804 0 : if (strlen(szStyles)) DumpString(trace, "style_flag", szStyles, indent, XMTDump);
805 :
806 0 : for (j=0; j<sd->font_count; j++) {
807 0 : DumpInt(trace, "fontID", sd->fonts[j].fontID, indent, XMTDump);
808 0 : DumpString(trace, "fontName", sd->fonts[i].fontName, indent, XMTDump);
809 : }
810 :
811 : indent--;
812 0 : EndDescDump(trace, "TextSampleDescriptor", indent, XMTDump);
813 : }
814 :
815 : indent--;
816 0 : EndElement(trace, "SampleDescriptions", indent, XMTDump, GF_TRUE);
817 :
818 : indent--;
819 0 : EndDescDump(trace, "TextConfig", indent, XMTDump);
820 0 : return GF_OK;
821 : }
822 :
823 6 : GF_Err gf_odf_dump_ui_cfg(GF_UIConfig *uid, FILE *trace, u32 indent, Bool XMTDump)
824 : {
825 : char devName[255];
826 : u32 i;
827 :
828 6 : StartDescDump(trace, "UIConfig" , indent, XMTDump);
829 6 : indent++;
830 6 : DumpString(trace, "deviceName", uid->deviceName, indent, XMTDump);
831 :
832 6 : if (!stricmp(devName, "StringSensor") && uid->termChar) {
833 0 : devName[0] = uid->termChar;
834 0 : devName[1] = 0;
835 0 : DumpString(trace, "termChar", devName, indent, XMTDump);
836 0 : devName[0] = uid->delChar;
837 0 : DumpString(trace, "delChar", devName, indent, XMTDump);
838 : }
839 6 : if (uid->ui_data_length) {
840 0 : if (!stricmp(uid->deviceName, "HTKSensor")) {
841 : u32 nb_word, nbPhone, c, j;
842 0 : GF_BitStream *bs = gf_bs_new(uid->ui_data, uid->ui_data_length, GF_BITSTREAM_READ);
843 : char szPh[3];
844 0 : StartAttribute(trace, "uiData", indent, XMTDump);
845 0 : if (!XMTDump) gf_fprintf(trace, "\"");
846 0 : gf_fprintf(trace, "HTK:");
847 0 : szPh[2] = 0;
848 0 : nb_word = gf_bs_read_int(bs, 8);
849 0 : for (i=0; i<nb_word; i++) {
850 0 : nbPhone = gf_bs_read_int(bs, 8);
851 0 : if (i) gf_fprintf(trace, ";");
852 0 : while ((c=gf_bs_read_int(bs, 8))) gf_fprintf(trace, "%c", c);
853 0 : gf_fprintf(trace, " ");
854 0 : for (j=0; j<nbPhone; j++) {
855 0 : gf_bs_read_data(bs, szPh, 2);
856 0 : if (j) gf_fprintf(trace, " ");
857 0 : if (!stricmp(szPh, "vc")) gf_fprintf(trace, "vcl");
858 0 : else gf_fprintf(trace, "%s", szPh);
859 : }
860 : }
861 0 : if (!XMTDump) gf_fprintf(trace, "\"");
862 0 : EndAttribute(trace, indent, XMTDump);
863 0 : gf_bs_del(bs);
864 : } else {
865 0 : DumpData(trace, "uiData", uid->ui_data, uid->ui_data_length, indent, XMTDump);
866 : }
867 : }
868 :
869 : indent--;
870 : EndAttributes(trace, indent, XMTDump);
871 6 : EndDescDump(trace, "UIConfig", indent, XMTDump);
872 6 : return GF_OK;
873 : }
874 :
875 12 : GF_Err DumpRawUIConfig(GF_DefaultDescriptor *dsi, FILE *trace, u32 indent, Bool XMTDump, u32 oti)
876 : {
877 : char devName[256];
878 : u32 i;
879 : u64 len;
880 : GF_BitStream *bs;
881 :
882 12 : bs = gf_bs_new(dsi->data, dsi->dataLength, GF_BITSTREAM_READ);
883 :
884 12 : StartDescDump(trace, "UIConfig" , indent, XMTDump);
885 12 : indent++;
886 12 : len = gf_bs_read_int(bs, 8);
887 12 : for (i=0; i<len; i++) devName[i] = gf_bs_read_int(bs, 8);
888 12 : devName[i] = 0;
889 12 : DumpString(trace, "deviceName", devName, indent, XMTDump);
890 :
891 12 : if (!stricmp(devName, "StringSensor") && gf_bs_available(bs)) {
892 0 : devName[0] = gf_bs_read_int(bs, 8);
893 0 : devName[1] = 0;
894 0 : DumpString(trace, "termChar", devName, indent, XMTDump);
895 0 : devName[0] = gf_bs_read_int(bs, 8);
896 0 : DumpString(trace, "delChar", devName, indent, XMTDump);
897 : }
898 12 : len = gf_bs_available(bs);
899 12 : if (len) {
900 0 : if (!stricmp(devName, "HTKSensor")) {
901 : u32 nb_word, nbPhone, c, j;
902 : char szPh[3];
903 0 : StartAttribute(trace, "uiData", indent, XMTDump);
904 0 : if (!XMTDump) gf_fprintf(trace, "\"");
905 0 : gf_fprintf(trace, "HTK:");
906 0 : szPh[2] = 0;
907 0 : nb_word = gf_bs_read_int(bs, 8);
908 0 : for (i=0; i<nb_word; i++) {
909 0 : nbPhone = gf_bs_read_int(bs, 8);
910 0 : if (i) gf_fprintf(trace, ";");
911 0 : while ((c=gf_bs_read_int(bs, 8))) gf_fprintf(trace, "%c", c);
912 0 : gf_fprintf(trace, " ");
913 0 : for (j=0; j<nbPhone; j++) {
914 0 : gf_bs_read_data(bs, szPh, 2);
915 0 : if (j) gf_fprintf(trace, " ");
916 0 : if (!stricmp(szPh, "vc")) gf_fprintf(trace, "vcl");
917 0 : else gf_fprintf(trace, "%s", szPh);
918 : }
919 : }
920 0 : if (!XMTDump) gf_fprintf(trace, "\"");
921 0 : EndAttribute(trace, indent, XMTDump);
922 : } else {
923 0 : char *data = dsi->data;
924 0 : data += gf_bs_get_position(bs);
925 0 : DumpData(trace, "uiData", data, len, indent, XMTDump);
926 : }
927 : }
928 :
929 : indent--;
930 : EndAttributes(trace, indent, XMTDump);
931 12 : EndDescDump(trace, "UIConfig", indent, XMTDump);
932 12 : gf_bs_del(bs);
933 12 : return GF_OK;
934 : }
935 :
936 61 : GF_Err OD_DumpDSI(GF_DefaultDescriptor *dsi, FILE *trace, u32 indent, Bool XMTDump, u32 streamType, u32 oti)
937 : {
938 61 : switch (streamType) {
939 11 : case GF_STREAM_SCENE:
940 11 : if (oti<=2) return DumpRawBIFSConfig(dsi, trace, indent, XMTDump, oti);
941 : break;
942 12 : case GF_STREAM_INTERACT:
943 12 : return DumpRawUIConfig(dsi, trace, indent, XMTDump, oti);
944 1 : case GF_STREAM_TEXT:
945 1 : if (oti==0x08) {
946 1 : GF_TextConfig *cfg = (GF_TextConfig *) gf_odf_desc_new(GF_ODF_TEXT_CFG_TAG);
947 1 : GF_Err e = gf_odf_get_text_config(dsi->data, dsi->dataLength, (u8) oti, cfg);
948 1 : if (!e) gf_odf_dump_desc((GF_Descriptor*)cfg, trace, indent, XMTDump);
949 1 : gf_odf_desc_del((GF_Descriptor *) cfg);
950 : }
951 : break;
952 : default:
953 : break;
954 : }
955 38 : return gf_odf_dump_desc((GF_Descriptor*)dsi, trace, indent, XMTDump);
956 : }
957 :
958 101 : GF_Err gf_odf_dump_dcd(GF_DecoderConfig *dcd, FILE *trace, u32 indent, Bool XMTDump)
959 : {
960 101 : StartDescDump(trace, "DecoderConfigDescriptor", indent, XMTDump);
961 101 : indent++;
962 :
963 101 : DumpIntForce(trace, "objectTypeIndication", dcd->objectTypeIndication, indent, XMTDump);
964 101 : DumpInt(trace, "streamType", dcd->streamType, indent, XMTDump);
965 101 : DumpInt(trace, "upStream", dcd->upstream, indent, XMTDump);
966 101 : DumpInt(trace, "bufferSizeDB", dcd->bufferSizeDB, indent, XMTDump);
967 101 : DumpInt(trace, "maxBitrate", dcd->maxBitrate, indent, XMTDump);
968 101 : DumpInt(trace, "avgBitrate", dcd->avgBitrate, indent, XMTDump);
969 : EndAttributes(trace, indent, XMTDump);
970 :
971 101 : if (dcd->decoderSpecificInfo) {
972 86 : if (dcd->decoderSpecificInfo->tag==GF_ODF_DSI_TAG) {
973 75 : if (dcd->decoderSpecificInfo->dataLength) {
974 61 : StartElement(trace, "decSpecificInfo" , indent, XMTDump, GF_FALSE);
975 61 : OD_DumpDSI(dcd->decoderSpecificInfo, trace, indent + (XMTDump ? 1 : 0), XMTDump, dcd->streamType, dcd->objectTypeIndication);
976 61 : EndElement(trace, "decSpecificInfo" , indent, XMTDump, GF_FALSE);
977 : }
978 : } else {
979 11 : StartElement(trace, "decSpecificInfo" , indent, XMTDump, GF_FALSE);
980 11 : gf_odf_dump_desc((GF_Descriptor*)dcd->decoderSpecificInfo, trace, indent + (XMTDump ? 1 : 0), XMTDump);
981 11 : EndElement(trace, "decSpecificInfo" , indent, XMTDump, GF_FALSE);
982 : }
983 : }
984 101 : DumpDescList(dcd->profileLevelIndicationIndexDescriptor, trace, indent, "profileLevelIndicationIndexDescr", XMTDump, GF_FALSE);
985 : indent--;
986 101 : EndDescDump(trace, "DecoderConfigDescriptor", indent, XMTDump);
987 :
988 101 : return GF_OK;
989 : }
990 :
991 90 : GF_Err gf_odf_dump_slc(GF_SLConfig *sl, FILE *trace, u32 indent, Bool XMTDump)
992 : {
993 :
994 90 : StartDescDump(trace, "SLConfigDescriptor", indent, XMTDump);
995 : EndAttributes(trace, indent, XMTDump);
996 90 : indent++;
997 :
998 90 : if (sl->predefined) {
999 : StartSubElement(trace, "predefined" , indent, XMTDump);
1000 36 : DumpInt(trace, XMTDump ? "value" : "predefined", sl->predefined, indent, XMTDump);
1001 : EndSubElement(trace, indent, XMTDump);
1002 : }
1003 90 : if (XMTDump) StartSubElement(trace, "custom" , indent, XMTDump);
1004 :
1005 90 : if (!sl->predefined) {
1006 54 : DumpBool(trace, "useAccessUnitStartFlag", sl->useAccessUnitStartFlag, indent, XMTDump);
1007 54 : DumpBool(trace, "useAccessUnitEndFlag", sl->useAccessUnitEndFlag, indent, XMTDump);
1008 54 : DumpBool(trace, "useRandomAccessPointFlag", sl->useRandomAccessPointFlag, indent, XMTDump);
1009 54 : DumpBool(trace, "usePaddingFlag", sl->usePaddingFlag, indent, XMTDump);
1010 54 : if (!XMTDump) DumpBool(trace, "useTimeStampsFlag", sl->useTimestampsFlag, indent, XMTDump);
1011 54 : DumpBool(trace, "useIdleFlag", sl->useIdleFlag, indent, XMTDump);
1012 54 : if (!XMTDump) DumpBool(trace, "durationFlag", sl->durationFlag, indent, XMTDump);
1013 54 : DumpInt(trace, "timeStampResolution", sl->timestampResolution, indent, XMTDump);
1014 54 : DumpInt(trace, "OCRResolution", sl->OCRResolution, indent, XMTDump);
1015 54 : DumpInt(trace, "timeStampLength", sl->timestampLength, indent, XMTDump);
1016 54 : DumpInt(trace, "OCRLength", sl->OCRLength, indent, XMTDump);
1017 54 : DumpInt(trace, "AU_Length", sl->AULength, indent, XMTDump);
1018 54 : DumpInt(trace, "instantBitrateLength", sl->instantBitrateLength, indent, XMTDump);
1019 54 : DumpInt(trace, "degradationPriorityLength", sl->degradationPriorityLength, indent, XMTDump);
1020 54 : DumpInt(trace, "AU_SeqNumLength", sl->AUSeqNumLength, indent, XMTDump);
1021 54 : DumpInt(trace, "packetSeqNumLength", sl->packetSeqNumLength, indent, XMTDump);
1022 : }
1023 : EndAttributes(trace, indent, XMTDump);
1024 :
1025 90 : indent++;
1026 90 : if (sl->durationFlag) {
1027 : StartSubElement(trace, "Duration" , indent, XMTDump);
1028 0 : DumpInt(trace, "timescale", sl->timeScale, indent, XMTDump);
1029 0 : DumpInt(trace, "accessUnitDuration", sl->AUDuration, indent, XMTDump);
1030 0 : DumpInt(trace, "compositionUnitDuration", sl->CUDuration, indent, XMTDump);
1031 : EndSubElement(trace, indent, XMTDump);
1032 : }
1033 90 : if (! sl->useTimestampsFlag) {
1034 : StartSubElement(trace, "noUseTimeStamps" , indent, XMTDump);
1035 0 : DumpInt(trace, "startDecodingTimeStamp", (u32) sl->startDTS, indent, XMTDump);
1036 0 : DumpInt(trace, "startCompositionTimeStamp", (u32) sl->startCTS, indent, XMTDump);
1037 : EndSubElement(trace, indent, XMTDump);
1038 : }
1039 : indent--;
1040 90 : if (XMTDump) EndElement(trace, "custom" , indent, XMTDump, GF_TRUE);
1041 :
1042 : indent--;
1043 90 : EndDescDump(trace, "SLConfigDescriptor", indent, XMTDump);
1044 90 : return GF_OK;
1045 : }
1046 :
1047 43 : GF_Err gf_odf_dump_default(GF_DefaultDescriptor *dd, FILE *trace, u32 indent, Bool XMTDump)
1048 : {
1049 43 : if (dd->tag == GF_ODF_DSI_TAG) {
1050 38 : StartDescDump(trace, "DecoderSpecificInfo", indent, XMTDump);
1051 38 : indent++;
1052 38 : if (XMTDump) {
1053 34 : DumpString(trace, "type", "auto", indent, XMTDump);
1054 34 : DumpData(trace, "src", dd->data, dd->dataLength, indent, XMTDump);
1055 : } else {
1056 4 : DumpData(trace, "info", dd->data, dd->dataLength, indent, XMTDump);
1057 : }
1058 : indent--;
1059 38 : if (XMTDump) {
1060 : EndSubElement(trace, indent, GF_TRUE);
1061 : } else {
1062 : EndDescDump(trace, "", indent, GF_FALSE);
1063 : }
1064 : } else {
1065 5 : StartDescDump(trace, "DefaultDescriptor", indent, XMTDump);
1066 5 : indent++;
1067 5 : DumpData(trace, "data", dd->data, dd->dataLength, indent, XMTDump);
1068 : indent--;
1069 : EndSubElement(trace, indent, XMTDump);
1070 : }
1071 43 : return GF_OK;
1072 : }
1073 :
1074 :
1075 4 : GF_Err gf_odf_dump_esd_inc(GF_ES_ID_Inc *esd_inc, FILE *trace, u32 indent, Bool XMTDump)
1076 : {
1077 4 : StartDescDump(trace, "ES_ID_Inc", indent, XMTDump);
1078 4 : indent++;
1079 4 : DumpInt(trace, "trackID", esd_inc->trackID, indent, XMTDump);
1080 : indent--;
1081 : EndAttributes(trace, indent, XMTDump);
1082 4 : EndDescDump(trace, "ES_ID_Inc", indent, XMTDump);
1083 4 : return GF_OK;
1084 : }
1085 :
1086 1 : GF_Err gf_odf_dump_esd_ref(GF_ES_ID_Ref *esd_ref, FILE *trace, u32 indent, Bool XMTDump)
1087 : {
1088 1 : StartDescDump(trace, "ES_ID_Ref", indent, XMTDump);
1089 1 : indent++;
1090 1 : DumpInt(trace, "trackRef", esd_ref->trackRef, indent, XMTDump);
1091 : indent--;
1092 : EndAttributes(trace, indent, XMTDump);
1093 1 : EndDescDump(trace, "ES_ID_Ref", indent, XMTDump);
1094 1 : return GF_OK;
1095 : }
1096 :
1097 : #ifndef GPAC_MINIMAL_ODF
1098 :
1099 : GF_Err gf_odf_dump_cc(GF_CCDescriptor *ccd, FILE *trace, u32 indent, Bool XMTDump)
1100 : {
1101 : StartDescDump(trace, "ContentClassificationDescriptor", indent, XMTDump);
1102 : DumpInt(trace, "classificationEntity", ccd->classificationEntity, indent, XMTDump);
1103 : DumpInt(trace, "classificationTable", ccd->classificationTable, indent, XMTDump);
1104 : DumpData(trace, "ccd->contentClassificationData", ccd->contentClassificationData, ccd->dataLength, indent, XMTDump);
1105 : EndAttributes(trace, indent, XMTDump);
1106 : EndDescDump(trace, "ContentClassificationDescriptor", indent, XMTDump);
1107 : return GF_OK;
1108 : }
1109 :
1110 : GF_Err gf_odf_dump_cc_date(GF_CC_Date *cdd, FILE *trace, u32 indent, Bool XMTDump)
1111 : {
1112 : StartDescDump(trace, "ContentClassificationDescriptor", indent, XMTDump);
1113 : DumpString(trace, "creationDate", cdd->contentCreationDate, indent, XMTDump);
1114 : EndAttributes(trace, indent, XMTDump);
1115 : EndDescDump(trace, "ContentClassificationDescriptor", indent, XMTDump);
1116 : return GF_OK;
1117 : }
1118 :
1119 : GF_Err gf_odf_dump_cc_name(GF_CC_Name *cnd, FILE *trace, u32 indent, Bool XMTDump)
1120 : {
1121 : u32 i;
1122 : GF_ContentCreatorInfo *p;
1123 :
1124 : StartDescDump(trace, "ContentCreatorNameDescriptor", indent, XMTDump);
1125 : EndAttributes(trace, indent, XMTDump);
1126 : indent++;
1127 : i=0;
1128 : while ((p = (GF_ContentCreatorInfo *)gf_list_enum(cnd->ContentCreators, &i))) {
1129 : StartSubElement(trace, "Creator", indent, XMTDump);
1130 : DumpInt(trace, "languageCode", p->langCode, indent, XMTDump);
1131 : DumpBool(trace, "isUTF8", p->isUTF8, indent, XMTDump);
1132 : DumpString(trace, "Name", p->contentCreatorName, indent, XMTDump);
1133 : EndSubElement(trace, indent, XMTDump);
1134 : }
1135 : indent--;
1136 : EndDescDump(trace, "ContentCreatorNameDescriptor", indent, XMTDump);
1137 : return GF_OK;
1138 : }
1139 :
1140 : GF_Err gf_odf_dump_ci(GF_CIDesc *cid, FILE *trace, u32 indent, Bool XMTDump)
1141 : {
1142 : StartDescDump(trace, "ContentIdentificationDescriptor", indent, XMTDump);
1143 : DumpBool(trace, "protectedContent", cid->protectedContent, indent, XMTDump);
1144 : EndAttributes(trace, indent, XMTDump);
1145 : indent++;
1146 : if (cid->contentTypeFlag) {
1147 : StartSubElement(trace, "contentType", indent, XMTDump);
1148 : DumpInt(trace, "contentType", cid->contentType, indent, XMTDump);
1149 : EndSubElement(trace, indent, XMTDump);
1150 : }
1151 : if (cid->contentIdentifierFlag) {
1152 : StartSubElement(trace, "contentIdentifierType", indent, XMTDump);
1153 : DumpInt(trace, "contentIdentifierType", cid->contentIdentifierType, indent, XMTDump);
1154 : DumpString(trace, "contentIdentifier", cid->contentIdentifier, indent, XMTDump);
1155 : EndSubElement(trace, indent, XMTDump);
1156 : }
1157 :
1158 : indent--;
1159 : EndDescDump(trace, "ContentIdentificationDescriptor", indent, XMTDump);
1160 : return GF_OK;
1161 : }
1162 :
1163 :
1164 : GF_Err gf_odf_dump_exp_text(GF_ExpandedTextual *etd, FILE *trace, u32 indent, Bool XMTDump)
1165 : {
1166 : u32 i, count;
1167 :
1168 : StartDescDump(trace, "ExpandedTextualDescriptor", indent, XMTDump);
1169 : indent++;
1170 : DumpInt(trace, "languageCode", etd->langCode, indent, XMTDump);
1171 : DumpBool(trace, "isUTF8", etd->isUTF8, indent, XMTDump);
1172 : DumpString(trace, "nonItemText", etd->NonItemText, indent, XMTDump);
1173 : EndAttributes(trace, indent, XMTDump);
1174 :
1175 : count = gf_list_count(etd->itemDescriptionList);
1176 : for (i=0; i<count; i++) {
1177 : GF_ETD_ItemText *it1 = (GF_ETD_ItemText *)gf_list_get(etd->itemDescriptionList, i);
1178 : GF_ETD_ItemText *it2 = (GF_ETD_ItemText *)gf_list_get(etd->itemTextList, i);
1179 : if (!it1 || !it2) break;
1180 : StartSubElement(trace, "item", indent, XMTDump);
1181 : DumpString(trace, "description", it1->text, indent, XMTDump);
1182 : DumpString(trace, "text", it2->text, indent, XMTDump);
1183 : EndSubElement(trace, indent, XMTDump);
1184 : }
1185 : indent--;
1186 : EndDescDump(trace, "ExpandedTextualDescriptor", indent, XMTDump);
1187 : return GF_OK;
1188 : }
1189 :
1190 : GF_Err gf_odf_dump_pl_ext(GF_PLExt *pld, FILE *trace, u32 indent, Bool XMTDump)
1191 : {
1192 : StartDescDump(trace, "ExtensionProfileLevelDescriptor", indent, XMTDump);
1193 : indent++;
1194 : DumpInt(trace, "profileLevelIndicationIndex", pld->profileLevelIndicationIndex, indent, XMTDump);
1195 : DumpInt(trace, "ODProfileLevelIndication", pld->ODProfileLevelIndication, indent, XMTDump);
1196 : DumpInt(trace, "sceneProfileLevelIndication", pld->SceneProfileLevelIndication, indent, XMTDump);
1197 : DumpInt(trace, "audioProfileLevelIndication", pld->AudioProfileLevelIndication, indent, XMTDump);
1198 : DumpInt(trace, "visualProfileLevelIndication", pld->VisualProfileLevelIndication, indent, XMTDump);
1199 : DumpInt(trace, "graphicsProfileLevelIndication", pld->GraphicsProfileLevelIndication, indent, XMTDump);
1200 : DumpInt(trace, "MPEGJProfileLevelIndication", pld->MPEGJProfileLevelIndication, indent, XMTDump);
1201 : indent--;
1202 : EndSubElement(trace, indent, XMTDump);
1203 : return GF_OK;
1204 : }
1205 :
1206 : GF_Err gf_odf_dump_ipi_ptr(GF_IPIPtr *ipid, FILE *trace, u32 indent, Bool XMTDump)
1207 : {
1208 : StartDescDump(trace, "IPI_DescrPointer", indent, XMTDump);
1209 : indent++;
1210 : DumpInt(trace, "IPI_ES_Id", ipid->IPI_ES_Id, indent, XMTDump);
1211 : indent--;
1212 : EndSubElement(trace, indent, XMTDump);
1213 : return GF_OK;
1214 : }
1215 :
1216 : GF_Err gf_odf_dump_ipmp(GF_IPMP_Descriptor *ipmp, FILE *trace, u32 indent, Bool XMTDump)
1217 : {
1218 : u32 i, count;
1219 : StartDescDump(trace, "IPMP_Descriptor", indent, XMTDump);
1220 : indent++;
1221 :
1222 : DumpIntHex(trace, "IPMP_DescriptorID", ipmp->IPMP_DescriptorID, indent, XMTDump, GF_TRUE);
1223 : DumpIntHex(trace, "IPMPS_Type", ipmp->IPMPS_Type, indent, XMTDump, GF_FALSE);
1224 :
1225 :
1226 : if ((ipmp->IPMP_DescriptorID==0xFF) && (ipmp->IPMPS_Type==0xFFFF)) {
1227 : DumpIntHex(trace, "IPMP_DescriptorIDEx", ipmp->IPMP_DescriptorIDEx, indent, XMTDump, GF_FALSE);
1228 : /*how the heck do we represent toolID??*/
1229 : DumpBin128(trace, "IPMP_ToolID", (char*)ipmp->IPMP_ToolID, indent, XMTDump);
1230 : DumpInt(trace, "controlPointCode", ipmp->control_point, indent, XMTDump);
1231 : if (ipmp->control_point) DumpInt(trace, "sequenceCode", ipmp->cp_sequence_code, indent, XMTDump);
1232 : EndAttributes(trace, indent, XMTDump);
1233 : #ifndef GPAC_MINIMAL_ODF
1234 : /*parse IPMPX data*/
1235 : StartElement(trace, "IPMPX_Data", indent, XMTDump, GF_TRUE);
1236 : indent++;
1237 : count = gf_list_count(ipmp->ipmpx_data);
1238 : for (i=0; i<count; i++) {
1239 : GF_IPMPX_Data *p = (GF_IPMPX_Data *)gf_list_get(ipmp->ipmpx_data, i);
1240 : gf_ipmpx_dump_data(p, trace, indent, XMTDump);
1241 : }
1242 : indent--;
1243 : EndElement(trace, "IPMPX_Data", indent, XMTDump, GF_TRUE);
1244 : #endif
1245 : }
1246 : else if (!ipmp->IPMPS_Type) {
1247 : DumpString(trace, "URLString", ipmp->opaque_data, indent, XMTDump);
1248 : } else {
1249 : DumpData(trace, "IPMP_data", ipmp->opaque_data, ipmp->opaque_data_size, indent, XMTDump);
1250 : }
1251 : indent--;
1252 : EndDescDump(trace, "IPMP_Descriptor", indent, XMTDump);
1253 : return GF_OK;
1254 : }
1255 :
1256 : GF_Err gf_odf_dump_ipmp_ptr(GF_IPMPPtr *ipmpd, FILE *trace, u32 indent, Bool XMTDump)
1257 : {
1258 : StartDescDump(trace, "IPMP_DescriptorPointer", indent, XMTDump);
1259 : indent++;
1260 : if (ipmpd->IPMP_DescriptorID == 0xFF) {
1261 : DumpInt(trace, "IPMP_DescriptorID", 0xFF, indent, XMTDump);
1262 : DumpInt(trace, "IPMP_DescriptorIDEx", ipmpd->IPMP_DescriptorIDEx, indent, XMTDump);
1263 : DumpInt(trace, "IPMP_ES_ID", ipmpd->IPMP_ES_ID, indent, XMTDump);
1264 : } else {
1265 : DumpInt(trace, "IPMP_DescriptorID", ipmpd->IPMP_DescriptorID, indent, XMTDump);
1266 : }
1267 : indent--;
1268 : if (XMTDump)
1269 : EndSubElement(trace, indent, XMTDump);
1270 : else
1271 : EndDescDump(trace, "IPMP_DescriptorPointer", indent, XMTDump);
1272 : return GF_OK;
1273 : }
1274 :
1275 : GF_Err gf_odf_dump_kw(GF_KeyWord *kwd, FILE *trace, u32 indent, Bool XMTDump)
1276 : {
1277 : GF_KeyWordItem *p;
1278 : u32 i;
1279 :
1280 : StartDescDump(trace, "KeyWordDescriptor", indent, XMTDump);
1281 : indent++;
1282 : DumpInt(trace, "languageCode", kwd->languageCode, indent, XMTDump);
1283 : DumpBool(trace, "isUTF8", kwd->isUTF8, indent, XMTDump);
1284 : EndAttributes(trace, indent, XMTDump);
1285 :
1286 : i=0;
1287 : while ((p = (GF_KeyWordItem *)gf_list_enum(kwd->keyWordsList, &i))) {
1288 : StartSubElement(trace, "keyWord", indent, XMTDump);
1289 : DumpString(trace, "value", p->keyWord, indent, XMTDump);
1290 : EndSubElement(trace, indent, XMTDump);
1291 : }
1292 : indent--;
1293 : EndDescDump(trace, "KeyWordDescriptor", indent, XMTDump);
1294 : return GF_OK;
1295 : }
1296 :
1297 : GF_Err gf_odf_dump_lang(GF_Language *ld, FILE *trace, u32 indent, Bool XMTDump)
1298 : {
1299 : char sLan[4];
1300 : StartDescDump(trace, "LanguageDescriptor", indent, XMTDump);
1301 : indent++;
1302 : sLan[0] = (ld->langCode>>16)&0xFF;
1303 : sLan[1] = (ld->langCode>>8)&0xFF;
1304 : sLan[2] = (ld->langCode)&0xFF;
1305 : sLan[3] = 0;
1306 : DumpString(trace, "languageCode", sLan, indent, XMTDump);
1307 : indent--;
1308 : EndSubElement(trace, indent, XMTDump);
1309 : if (!XMTDump) EndDescDump(trace, "LanguageDescriptor", indent, XMTDump);
1310 : return GF_OK;
1311 : }
1312 : #endif// GPAC_MINIMAL_ODF
1313 :
1314 4 : GF_Err gf_odf_dump_aux_vid(GF_AuxVideoDescriptor *ld, FILE *trace, u32 indent, Bool XMTDump)
1315 : {
1316 4 : StartDescDump(trace, "AuxiliaryVideoData", indent, XMTDump);
1317 4 : indent++;
1318 :
1319 4 : DumpIntHex(trace, "aux_video_type", ld->aux_video_type, indent, XMTDump, GF_TRUE);
1320 4 : DumpInt(trace, "position_offset_h", ld->position_offset_h, indent, XMTDump);
1321 4 : DumpInt(trace, "position_offset_v", ld->position_offset_v, indent, XMTDump);
1322 4 : DumpInt(trace, "knear", ld->knear, indent, XMTDump);
1323 4 : DumpInt(trace, "kfar", ld->kfar, indent, XMTDump);
1324 4 : DumpInt(trace, "parallax_zero", ld->parallax_zero, indent, XMTDump);
1325 4 : DumpInt(trace, "parallax_scale", ld->parallax_scale, indent, XMTDump);
1326 4 : DumpInt(trace, "dref", ld->dref, indent, XMTDump);
1327 4 : DumpInt(trace, "wref", ld->wref, indent, XMTDump);
1328 : indent--;
1329 : EndSubElement(trace, indent, XMTDump);
1330 4 : if (!XMTDump) EndDescDump(trace, "AuxiliaryVideoData", indent, XMTDump);
1331 4 : return GF_OK;
1332 : }
1333 :
1334 43 : GF_Err gf_odf_dump_isom_iod(GF_IsomInitialObjectDescriptor *iod, FILE *trace, u32 indent, Bool XMTDump)
1335 : {
1336 :
1337 :
1338 43 : StartDescDump(trace, "MP4InitialObjectDescriptor", indent, XMTDump);
1339 43 : indent++;
1340 :
1341 43 : StartAttribute(trace, "objectDescriptorID", indent, XMTDump);
1342 :
1343 :
1344 43 : if (XMTDump) {
1345 42 : gf_fprintf(trace, "od%d", iod->objectDescriptorID);
1346 42 : EndAttribute(trace, indent, XMTDump);
1347 42 : DumpInt(trace, "binaryID", iod->objectDescriptorID, indent, XMTDump);
1348 : } else {
1349 1 : gf_fprintf(trace, "%d", iod->objectDescriptorID);
1350 1 : EndAttribute(trace, indent, XMTDump);
1351 : }
1352 :
1353 : EndAttributes(trace, indent, XMTDump);
1354 :
1355 :
1356 : StartSubElement(trace, "Profile", indent, GF_TRUE);
1357 :
1358 43 : DumpInt(trace, "audioProfileLevelIndication", iod->audio_profileAndLevel, indent, XMTDump);
1359 43 : DumpInt(trace, "visualProfileLevelIndication", iod->visual_profileAndLevel, indent, XMTDump);
1360 43 : DumpInt(trace, "sceneProfileLevelIndication", iod->scene_profileAndLevel, indent, XMTDump);
1361 43 : DumpInt(trace, "graphicsProfileLevelIndication", iod->graphics_profileAndLevel, indent, XMTDump);
1362 43 : DumpInt(trace, "ODProfileLevelIndication", iod->OD_profileAndLevel, indent, XMTDump);
1363 43 : DumpBool(trace, "includeInlineProfileLevelFlag", iod->inlineProfileFlag, indent, XMTDump);
1364 :
1365 : EndSubElement(trace, indent, XMTDump);
1366 :
1367 43 : if (iod->URLString) {
1368 : StartSubElement(trace, "URL", indent, XMTDump);
1369 0 : DumpString(trace, "URLstring", iod->URLString, indent, XMTDump);
1370 : EndSubElement(trace, indent, XMTDump);
1371 : }
1372 :
1373 43 : if (XMTDump) {
1374 42 : StartElement(trace, "Descr", indent, XMTDump, GF_TRUE);
1375 42 : indent++;
1376 : }
1377 : //ESDescr
1378 43 : if (gf_list_count(iod->ES_ID_IncDescriptors)) {
1379 2 : DumpDescList(iod->ES_ID_IncDescriptors, trace, indent, "esDescrInc", XMTDump, GF_FALSE);
1380 : } else {
1381 41 : DumpDescList(iod->ES_ID_RefDescriptors, trace, indent, "esDescrRef", XMTDump, GF_FALSE);
1382 : }
1383 43 : DumpDescList(iod->OCIDescriptors, trace, indent, "ociDescr", XMTDump, GF_FALSE);
1384 43 : DumpDescListFilter(iod->IPMP_Descriptors, trace, indent, "ipmpDescrPtr", XMTDump, GF_ODF_IPMP_PTR_TAG);
1385 43 : DumpDescListFilter(iod->IPMP_Descriptors, trace, indent, "ipmpDescr", XMTDump, GF_ODF_IPMP_TAG);
1386 :
1387 43 : DumpDescList(iod->extensionDescriptors, trace, indent, "extDescr", XMTDump, GF_FALSE);
1388 :
1389 43 : if (iod->IPMPToolList) {
1390 0 : StartElement(trace, "toolListDescr" , indent, XMTDump, GF_FALSE);
1391 0 : gf_odf_dump_desc((GF_Descriptor*)iod->IPMPToolList, trace, indent + (XMTDump ? 1 : 0), XMTDump);
1392 0 : EndElement(trace, "toolListDescr" , indent, XMTDump, GF_FALSE);
1393 : }
1394 :
1395 43 : if (XMTDump) {
1396 42 : indent--;
1397 42 : EndElement(trace, "Descr", indent, XMTDump, GF_TRUE);
1398 : }
1399 43 : indent--;
1400 43 : EndDescDump(trace, "MP4InitialObjectDescriptor", indent, XMTDump);
1401 43 : return GF_OK;
1402 : }
1403 :
1404 43 : GF_Err gf_odf_dump_od(GF_ObjectDescriptor *od, FILE *trace, u32 indent, Bool XMTDump)
1405 : {
1406 43 : StartDescDump(trace, "ObjectDescriptor", indent, XMTDump);
1407 43 : indent++;
1408 43 : StartAttribute(trace, "objectDescriptorID", indent, XMTDump);
1409 43 : if (XMTDump) {
1410 23 : gf_fprintf(trace, "od%d", od->objectDescriptorID);
1411 23 : EndAttribute(trace, indent, XMTDump);
1412 23 : DumpInt(trace, "binaryID", od->objectDescriptorID, indent, XMTDump);
1413 : } else {
1414 20 : gf_fprintf(trace, "%d", od->objectDescriptorID);
1415 20 : EndAttribute(trace, indent, XMTDump);
1416 : }
1417 : EndAttributes(trace, indent, XMTDump);
1418 43 : if (od->URLString) {
1419 : StartSubElement(trace, "URL", indent, XMTDump);
1420 0 : DumpString(trace, "URLstring", od->URLString, indent, XMTDump);
1421 : EndSubElement(trace, indent, XMTDump);
1422 : }
1423 :
1424 43 : if (XMTDump) {
1425 23 : StartElement(trace, "Descr", indent, XMTDump, GF_TRUE);
1426 23 : indent++;
1427 : }
1428 : //ESDescr
1429 43 : DumpDescList(od->ESDescriptors, trace, indent, "esDescr", XMTDump, GF_FALSE);
1430 43 : DumpDescList(od->OCIDescriptors, trace, indent, "ociDescr", XMTDump, GF_FALSE);
1431 43 : DumpDescListFilter(od->IPMP_Descriptors, trace, indent, "ipmpDescrPtr", XMTDump, GF_ODF_IPMP_PTR_TAG);
1432 43 : DumpDescListFilter(od->IPMP_Descriptors, trace, indent, "ipmpDescr", XMTDump, GF_ODF_IPMP_TAG);
1433 :
1434 43 : DumpDescList(od->extensionDescriptors, trace, indent, "extDescr", XMTDump, GF_FALSE);
1435 :
1436 43 : if (XMTDump) {
1437 23 : indent--;
1438 23 : EndElement(trace, "Descr", indent, XMTDump, GF_TRUE);
1439 : }
1440 43 : indent--;
1441 43 : EndDescDump(trace, "ObjectDescriptor", indent, XMTDump);
1442 43 : return GF_OK;
1443 : }
1444 :
1445 1 : GF_Err gf_odf_dump_isom_od(GF_IsomObjectDescriptor *od, FILE *trace, u32 indent, Bool XMTDump)
1446 : {
1447 1 : StartDescDump(trace, "MP4ObjectDescriptor", indent, XMTDump);
1448 1 : indent++;
1449 1 : StartAttribute(trace, "objectDescriptorID", indent, XMTDump);
1450 1 : if (XMTDump) {
1451 0 : gf_fprintf(trace, "od%d", od->objectDescriptorID);
1452 0 : EndAttribute(trace, indent, XMTDump);
1453 0 : DumpInt(trace, "binaryID", od->objectDescriptorID, indent, XMTDump);
1454 : } else {
1455 1 : gf_fprintf(trace, "%d", od->objectDescriptorID);
1456 1 : EndAttribute(trace, indent, XMTDump);
1457 : }
1458 : EndAttributes(trace, indent, XMTDump);
1459 1 : if (od->URLString) {
1460 : StartSubElement(trace, "URL", indent, XMTDump);
1461 0 : DumpString(trace, "URLstring", od->URLString, indent, XMTDump);
1462 : EndSubElement(trace, indent, XMTDump);
1463 : }
1464 :
1465 1 : if (XMTDump) {
1466 0 : StartElement(trace, "Descr", indent, XMTDump, GF_TRUE);
1467 0 : indent++;
1468 : }
1469 : //ESDescr
1470 1 : if (gf_list_count(od->ES_ID_IncDescriptors)) {
1471 0 : DumpDescList(od->ES_ID_IncDescriptors, trace, indent, "esDescrInc", XMTDump, GF_FALSE);
1472 : } else {
1473 1 : DumpDescList(od->ES_ID_RefDescriptors, trace, indent, "esDescrRef", XMTDump, GF_FALSE);
1474 : }
1475 1 : DumpDescList(od->OCIDescriptors, trace, indent, "ociDescr", XMTDump, GF_FALSE);
1476 1 : DumpDescListFilter(od->IPMP_Descriptors, trace, indent, "ipmpDescrPtr", XMTDump, GF_ODF_IPMP_PTR_TAG);
1477 1 : DumpDescListFilter(od->IPMP_Descriptors, trace, indent, "ipmpDescr", XMTDump, GF_ODF_IPMP_TAG);
1478 1 : DumpDescList(od->extensionDescriptors, trace, indent, "extDescr", XMTDump, GF_FALSE);
1479 :
1480 1 : if (XMTDump) {
1481 0 : indent--;
1482 0 : EndElement(trace, "Descr", indent, XMTDump, GF_TRUE);
1483 : }
1484 1 : indent--;
1485 1 : EndDescDump(trace, "MP4ObjectDescriptor", indent, XMTDump);
1486 1 : return GF_OK;
1487 : }
1488 :
1489 : #ifndef GPAC_MINIMAL_ODF
1490 : GF_Err gf_odf_dump_oci_date(GF_OCI_Data *ocd, FILE *trace, u32 indent, Bool XMTDump)
1491 : {
1492 : StartDescDump(trace, "OCICreationDateDescriptor", indent, XMTDump);
1493 : indent++;
1494 : DumpString(trace, "OCICreationDate", ocd->OCICreationDate, indent, XMTDump);
1495 : indent--;
1496 : EndSubElement(trace, indent, XMTDump);
1497 : return GF_OK;
1498 : }
1499 :
1500 : GF_Err gf_odf_dump_oci_name(GF_OCICreators *ocn, FILE *trace, u32 indent, Bool XMTDump)
1501 : {
1502 : GF_OCICreator_item *p;
1503 : u32 i;
1504 :
1505 : StartDescDump(trace, "OCICreatorNameDescriptor", indent, XMTDump);
1506 : indent++;
1507 : i=0;
1508 : while ((p = (GF_OCICreator_item *)gf_list_enum(ocn->OCICreators, &i))) {
1509 : StartSubElement(trace, "Creator", indent, XMTDump);
1510 : DumpInt(trace, "languageCode", p->langCode, indent, XMTDump);
1511 : DumpBool(trace, "isUTF8", p->isUTF8, indent, XMTDump);
1512 : DumpString(trace, "name", p->OCICreatorName, indent, XMTDump);
1513 : EndSubElement(trace, indent, XMTDump);
1514 : }
1515 : indent--;
1516 : EndDescDump(trace, "OCICreatorNameDescriptor", indent, XMTDump);
1517 : return GF_OK;
1518 : }
1519 :
1520 : GF_Err gf_odf_dump_pl_idx(GF_PL_IDX *plid, FILE *trace, u32 indent, Bool XMTDump)
1521 : {
1522 : StartDescDump(trace, "ProfileLevelIndicationIndexDescriptor", indent, XMTDump);
1523 : indent++;
1524 : DumpInt(trace, "profileLevelIndicationIndex", plid->profileLevelIndicationIndex, indent, XMTDump);
1525 : indent--;
1526 : EndSubElement(trace, indent, XMTDump);
1527 : return GF_OK;
1528 : }
1529 :
1530 : GF_Err gf_odf_dump_qos(GF_QoS_Descriptor *qos, FILE *trace, u32 indent, Bool XMTDump)
1531 : {
1532 : StartDescDump(trace, "QoS_Descriptor", indent, XMTDump);
1533 : indent++;
1534 :
1535 : if (qos->predefined) {
1536 : StartSubElement(trace, "predefined", indent, XMTDump);
1537 : DumpInt(trace, "value", qos->predefined, indent, XMTDump);
1538 : EndSubElement(trace, indent, XMTDump);
1539 : } else {
1540 : u32 i=0;
1541 : GF_QoS_Default *p;
1542 : while ((p = (GF_QoS_Default *)gf_list_enum(qos->QoS_Qualifiers, &i))) {
1543 : switch (p->tag) {
1544 : case QoSMaxDelayTag:
1545 : StartSubElement(trace, "QoSMaxDelay", indent, XMTDump);
1546 : DumpInt(trace, "value", ((GF_QoS_MaxDelay *)p)->MaxDelay, indent, XMTDump);
1547 : EndSubElement(trace, indent, XMTDump);
1548 : break;
1549 : case QoSPrefMaxDelayTag:
1550 : StartSubElement(trace, "QoSPrefMaxDelay", indent, XMTDump);
1551 : DumpInt(trace, "value", ((GF_QoS_PrefMaxDelay *)p)->PrefMaxDelay, indent, XMTDump);
1552 : EndSubElement(trace, indent, XMTDump);
1553 : break;
1554 : case QoSLossProbTag:
1555 : StartSubElement(trace, "QoSLossProb", indent, XMTDump);
1556 : DumpFloat(trace, "value", ((GF_QoS_LossProb *)p)->LossProb, indent, XMTDump);
1557 : EndSubElement(trace, indent, XMTDump);
1558 : break;
1559 : case QoSMaxGapLossTag:
1560 : StartSubElement(trace, "QoSMaxGapLoss", indent, XMTDump);
1561 : DumpInt(trace, "value", ((GF_QoS_MaxGapLoss *)p)->MaxGapLoss, indent, XMTDump);
1562 : EndSubElement(trace, indent, XMTDump);
1563 : break;
1564 : case QoSMaxAUSizeTag:
1565 : StartSubElement(trace, "QoSMaxAUSize", indent, XMTDump);
1566 : DumpInt(trace, "value", ((GF_QoS_MaxAUSize *)p)->MaxAUSize, indent, XMTDump);
1567 : EndSubElement(trace, indent, XMTDump);
1568 : break;
1569 : case QoSAvgAUSizeTag:
1570 : StartSubElement(trace, "QoSAvgAUSize", indent, XMTDump);
1571 : DumpInt(trace, "value", ((GF_QoS_AvgAUSize *)p)->AvgAUSize, indent, XMTDump);
1572 : EndSubElement(trace, indent, XMTDump);
1573 : break;
1574 : case QoSMaxAURateTag:
1575 : StartSubElement(trace, "QoSMaxAURate", indent, XMTDump);
1576 : DumpInt(trace, "value", ((GF_QoS_MaxAURate *)p)->MaxAURate, indent, XMTDump);
1577 : EndSubElement(trace, indent, XMTDump);
1578 : break;
1579 : default:
1580 : StartSubElement(trace, "QoSCustom", indent, XMTDump);
1581 : DumpInt(trace, "tag", p->tag, indent, XMTDump);
1582 : DumpData(trace, "customData", ((GF_QoS_Private *)p)->Data, ((GF_QoS_Private *)p)->DataLength, indent, XMTDump);
1583 : EndSubElement(trace, indent, XMTDump);
1584 : break;
1585 : }
1586 : }
1587 : }
1588 : indent--;
1589 : EndDescDump(trace, "QoS_Descriptor", indent, XMTDump);
1590 : return GF_OK;
1591 : }
1592 :
1593 : GF_Err gf_odf_dump_rating(GF_Rating *rd, FILE *trace, u32 indent, Bool XMTDump)
1594 : {
1595 : StartDescDump(trace, "RatingDescriptor", indent, XMTDump);
1596 : indent++;
1597 : DumpInt(trace, "ratingEntity", rd->ratingEntity, indent, XMTDump);
1598 : DumpInt(trace, "ratingCriteria", rd->ratingCriteria, indent, XMTDump);
1599 : DumpData(trace, "ratingInfo", rd->ratingInfo, rd->infoLength, indent, XMTDump);
1600 : indent--;
1601 : EndSubElement(trace, indent, XMTDump);
1602 : return GF_OK;
1603 : }
1604 :
1605 : GF_Err gf_odf_dump_reg(GF_Registration *reg, FILE *trace, u32 indent, Bool XMTDump)
1606 : {
1607 : StartDescDump(trace, "RegistrationDescriptor", indent, XMTDump);
1608 : indent++;
1609 : DumpInt(trace, "formatIdentifier", reg->formatIdentifier, indent, XMTDump);
1610 : DumpData(trace, "additionalIdentificationInfo", reg->additionalIdentificationInfo, reg->dataLength, indent, XMTDump);
1611 : indent--;
1612 : EndSubElement(trace, indent, XMTDump);
1613 : return GF_OK;
1614 : }
1615 :
1616 : GF_Err gf_odf_dump_short_text(GF_ShortTextual *std, FILE *trace, u32 indent, Bool XMTDump)
1617 : {
1618 : StartDescDump(trace, "ShortTextualDescriptor", indent, XMTDump);
1619 : indent++;
1620 : DumpInt(trace, "languageCode", std->langCode, indent, XMTDump);
1621 : DumpBool(trace, "isUTF8", std->isUTF8, indent, XMTDump);
1622 : EndAttributes(trace, indent, XMTDump);
1623 : StartSubElement(trace, "event", indent, XMTDump);
1624 : DumpString(trace, "name", std->eventName, indent, XMTDump);
1625 : DumpString(trace, "text", std->eventText, indent, XMTDump);
1626 : EndSubElement(trace, indent, XMTDump);
1627 : indent--;
1628 : EndDescDump(trace, "ShortTextualDescriptor", indent, XMTDump);
1629 : return GF_OK;
1630 : }
1631 :
1632 : GF_Err gf_odf_dump_smpte_camera(GF_SMPTECamera *cpd, FILE *trace, u32 indent, Bool XMTDump)
1633 : {
1634 : GF_SmpteParam *p;
1635 : u32 i;
1636 :
1637 : StartDescDump(trace, "SMPTECameraPositionDescriptor", indent, XMTDump);
1638 : indent++;
1639 : DumpInt(trace, "cameraID", cpd->cameraID, indent, XMTDump);
1640 : EndAttributes(trace, indent, XMTDump);
1641 :
1642 : i=0;
1643 : while ((p = (GF_SmpteParam *)gf_list_enum(cpd->ParamList, &i))) {
1644 : StartSubElement(trace, "parameter", indent, XMTDump);
1645 : DumpInt(trace, "id", p->paramID, indent, XMTDump);
1646 : DumpInt(trace, "value", p->param, indent, XMTDump);
1647 : EndSubElement(trace, indent, XMTDump);
1648 : }
1649 : indent--;
1650 : EndDescDump(trace, "SMPTECameraPositionDescriptor", indent, XMTDump);
1651 : return GF_OK;
1652 : }
1653 :
1654 : GF_Err gf_odf_dump_sup_cid(GF_SCIDesc *scid, FILE *trace, u32 indent, Bool XMTDump)
1655 : {
1656 : StartDescDump(trace, "SupplementaryContentIdentification", indent, XMTDump);
1657 : indent++;
1658 : DumpInt(trace, "languageCode", scid->languageCode, indent, XMTDump);
1659 : DumpString(trace, "supplContentIdentiferTitle", scid->supplContentIdentifierTitle, indent, XMTDump);
1660 : DumpString(trace, "supplContentIdentiferValue", scid->supplContentIdentifierValue, indent, XMTDump);
1661 : indent--;
1662 : EndSubElement(trace, indent, XMTDump);
1663 : return GF_OK;
1664 : }
1665 :
1666 :
1667 : GF_Err gf_odf_dump_segment(GF_Segment *sd, FILE *trace, u32 indent, Bool XMTDump)
1668 : {
1669 : StartDescDump(trace, "SegmentDescriptor", indent, XMTDump);
1670 : indent++;
1671 : DumpDouble(trace, "startTime", sd->startTime, indent, XMTDump);
1672 : DumpDouble(trace, "duration", sd->Duration, indent, XMTDump);
1673 : DumpString(trace, "name", sd->SegmentName, indent, XMTDump);
1674 : indent--;
1675 : if (XMTDump)
1676 : EndSubElement(trace, indent, XMTDump);
1677 : else
1678 : EndDescDump(trace, "SegmentDescriptor", indent, XMTDump);
1679 : return GF_OK;
1680 : }
1681 :
1682 : GF_Err gf_odf_dump_mediatime(GF_MediaTime *mt, FILE *trace, u32 indent, Bool XMTDump)
1683 : {
1684 : StartDescDump(trace, "MediaTimeDescriptor", indent, XMTDump);
1685 : indent++;
1686 : DumpDouble(trace, "mediaTimestamp ", mt->mediaTimeStamp, indent, XMTDump);
1687 : indent--;
1688 : EndSubElement(trace, indent, XMTDump);
1689 : return GF_OK;
1690 : }
1691 :
1692 : #endif //GPAC_MINIMAL_ODF
1693 :
1694 39 : GF_Err gf_odf_dump_muxinfo(GF_MuxInfo *mi, FILE *trace, u32 indent, Bool XMTDump)
1695 : {
1696 39 : char *full_path = gf_url_get_absolute_path( mi->file_name, mi->src_url );
1697 :
1698 39 : if (!XMTDump) {
1699 : StartDescDump(trace, "MuxInfo", indent, GF_FALSE);
1700 19 : indent++;
1701 19 : if (full_path) {
1702 18 : DumpString(trace, "fileName", full_path, indent, GF_FALSE);
1703 18 : gf_free(full_path);
1704 1 : } else if (mi->file_name) {
1705 0 : DumpString(trace, "fileName", mi->file_name, indent, GF_FALSE);
1706 : }
1707 19 : if (mi->streamFormat) DumpString(trace, "streamFormat", mi->streamFormat, indent, GF_FALSE);
1708 19 : if (mi->GroupID) DumpInt(trace, "GroupID", mi->GroupID, indent, GF_FALSE);
1709 19 : if (mi->startTime) DumpInt(trace, "startTime", mi->startTime, indent, GF_FALSE);
1710 19 : if (mi->duration) DumpInt(trace, "duration", mi->duration, indent, GF_FALSE);
1711 : #if 0
1712 : if (mi->import_flags & GF_IMPORT_USE_DATAREF) DumpBool(trace, "useDataReference", 1, indent, GF_FALSE);
1713 : if (mi->import_flags & GF_IMPORT_NO_FRAME_DROP) DumpBool(trace, "noFrameDrop", 1, indent, GF_FALSE);
1714 : if (mi->import_flags & GF_IMPORT_SBR_IMPLICIT) DumpString(trace, "SBR_Type", "implicit", indent, GF_FALSE);
1715 : else if (mi->import_flags & GF_IMPORT_SBR_EXPLICIT) DumpString(trace, "SBR_Type", "explicit", indent, GF_FALSE);
1716 : #endif
1717 :
1718 19 : if (mi->textNode) DumpString(trace, "textNode", mi->textNode, indent, GF_FALSE);
1719 19 : if (mi->fontNode) DumpString(trace, "fontNode", mi->fontNode, indent, GF_FALSE);
1720 :
1721 : indent--;
1722 : EndDescDump(trace, "MuxInfo", indent, GF_FALSE);
1723 19 : return GF_OK;
1724 : }
1725 :
1726 20 : StartDescDump(trace, "StreamSource", indent, GF_TRUE);
1727 20 : indent++;
1728 20 : if (full_path) {
1729 20 : DumpString(trace, "url", full_path, indent, GF_TRUE);
1730 20 : gf_free(full_path);
1731 0 : } else if (mi->file_name) {
1732 0 : DumpString(trace, "url", mi->file_name, indent, GF_TRUE);
1733 : }
1734 : EndAttributes(trace, indent, GF_TRUE);
1735 :
1736 20 : StartDescDump(trace, "MP4MuxHints", indent, GF_TRUE);
1737 20 : if (mi->GroupID) DumpInt(trace, "GroupID", mi->GroupID, indent, GF_TRUE);
1738 20 : if (mi->startTime) DumpInt(trace, "startTime", mi->startTime, indent, GF_TRUE);
1739 20 : if (mi->duration) DumpInt(trace, "duration", mi->duration, indent, GF_TRUE);
1740 : #ifndef GPAC_DISABLE_MEDIA_IMPORT
1741 20 : if (mi->import_flags & GF_IMPORT_USE_DATAREF) DumpBool(trace, "useDataReference", 1, indent, GF_TRUE);
1742 20 : if (mi->import_flags & GF_IMPORT_NO_FRAME_DROP) DumpBool(trace, "noFrameDrop", 1, indent, GF_TRUE);
1743 20 : if (mi->import_flags & GF_IMPORT_SBR_IMPLICIT) DumpString(trace, "SBR_Type", "implicit", indent, GF_TRUE);
1744 20 : else if (mi->import_flags & GF_IMPORT_SBR_EXPLICIT) DumpString(trace, "SBR_Type", "explicit", indent, GF_TRUE);
1745 : #endif /*GPAC_DISABLE_MEDIA_IMPORT*/
1746 :
1747 20 : if (mi->textNode) DumpString(trace, "textNode", mi->textNode, indent, GF_TRUE);
1748 20 : if (mi->fontNode) DumpString(trace, "fontNode", mi->fontNode, indent, GF_TRUE);
1749 : EndSubElement(trace, indent, GF_TRUE);
1750 :
1751 : indent--;
1752 : EndElement(trace, "StreamSource" , indent, GF_TRUE, GF_TRUE);
1753 20 : return GF_OK;
1754 : }
1755 :
1756 : #ifndef GPAC_MINIMAL_ODF
1757 : GF_Err gf_odf_dump_ipmp_tool_list(GF_IPMP_ToolList *tl, FILE *trace, u32 indent, Bool XMTDump)
1758 : {
1759 : StartDescDump(trace, "IPMP_ToolListDescriptor", indent, XMTDump);
1760 : EndAttributes(trace, indent, XMTDump);
1761 : indent++;
1762 : DumpDescList(tl->ipmp_tools, trace, indent, "ipmpTool", XMTDump, GF_FALSE);
1763 : indent--;
1764 : EndDescDump(trace, "IPMP_ToolListDescriptor", indent, XMTDump);
1765 : return GF_OK;
1766 : }
1767 :
1768 : GF_Err gf_odf_dump_ipmp_tool(GF_IPMP_Tool*t, FILE *trace, u32 indent, Bool XMTDump)
1769 : {
1770 : StartDescDump(trace, "IPMP_Tool", indent, XMTDump);
1771 : indent++;
1772 : DumpBin128(trace, "IPMP_ToolID", (char*)t->IPMP_ToolID, indent, XMTDump);
1773 : if (t->tool_url) DumpString(trace, "ToolURL", t->tool_url, indent, XMTDump);
1774 : if (t->toolParamDesc) {
1775 : StartElement(trace, "toolParamDesc" , indent, XMTDump, GF_FALSE);
1776 : #ifndef GPAC_MINIMAL_ODF
1777 : gf_ipmpx_dump_data((GF_IPMPX_Data *)t->toolParamDesc, trace, indent + (XMTDump ? 1 : 0), XMTDump);
1778 : #endif
1779 : EndElement(trace, "toolParamDesc" , indent, XMTDump, GF_FALSE);
1780 : }
1781 : EndAttributes(trace, indent, XMTDump);
1782 : indent--;
1783 : EndDescDump(trace, "IPMP_Tool", indent, XMTDump);
1784 : return GF_OK;
1785 : }
1786 : #endif //GPAC_MINIMAL_ODF
1787 :
1788 :
1789 24 : GF_Err gf_odf_dump_od_update(GF_ODUpdate *com, FILE *trace, u32 indent, Bool XMTDump)
1790 : {
1791 24 : if (XMTDump) {
1792 12 : StartDescDump(trace, "ObjectDescriptorUpdate", indent, XMTDump);
1793 : EndAttributes(trace, indent, XMTDump);
1794 : indent++;
1795 12 : DumpDescList(com->objectDescriptors, trace, indent+1, "OD", XMTDump, GF_FALSE);
1796 : indent--;
1797 12 : EndDescDump(trace, "ObjectDescriptorUpdate", indent, XMTDump);
1798 : } else {
1799 12 : DumpDescList(com->objectDescriptors, trace, indent, "UPDATE OD", XMTDump, GF_TRUE);
1800 : }
1801 24 : return GF_OK;
1802 : }
1803 :
1804 9 : GF_Err gf_odf_dump_od_remove(GF_ODRemove *com, FILE *trace, u32 indent, Bool XMTDump)
1805 : {
1806 : u32 i;
1807 :
1808 9 : if (XMTDump) {
1809 5 : StartDescDump(trace, "ObjectDescriptorRemove", indent, XMTDump);
1810 5 : indent++;
1811 5 : StartAttribute(trace, "objectDescriptorId", indent, XMTDump);
1812 : } else {
1813 : char ind_buf[OD_MAX_TREE];
1814 12 : OD_FORMAT_INDENT(ind_buf, indent);
1815 4 : gf_fprintf(trace, "%sREMOVE OD [", ind_buf);
1816 : }
1817 18 : for (i=0; i<com->NbODs; i++) {
1818 9 : if (i) gf_fprintf(trace, " ");
1819 9 : gf_fprintf(trace, "%s%d", XMTDump ? "od" : "", com->OD_ID[i]);
1820 : }
1821 9 : if (XMTDump) {
1822 5 : EndAttribute(trace, indent, XMTDump);
1823 : indent--;
1824 : EndSubElement(trace, indent, XMTDump);
1825 : } else {
1826 4 : gf_fprintf(trace, "]\n");
1827 : }
1828 9 : return GF_OK;
1829 : }
1830 :
1831 3 : GF_Err gf_odf_dump_esd_update(GF_ESDUpdate *com, FILE *trace, u32 indent, Bool XMTDump)
1832 : {
1833 3 : if (XMTDump) {
1834 2 : StartDescDump(trace, "ES_DescriptorUpdate", indent, XMTDump);
1835 2 : StartAttribute(trace, "objectDescriptorId", indent, XMTDump);
1836 2 : gf_fprintf(trace, "od%d", com->ODID);
1837 2 : EndAttribute(trace, indent, XMTDump);
1838 : EndAttributes(trace, indent, XMTDump);
1839 : } else {
1840 : char ind_buf[OD_MAX_TREE];
1841 3 : OD_FORMAT_INDENT(ind_buf, indent);
1842 1 : gf_fprintf(trace, "%sUPDATE ESD in %d\n", ind_buf, com->ODID);
1843 : }
1844 : indent++;
1845 3 : DumpDescList(com->ESDescriptors, trace, indent+1, "esDescr", XMTDump, GF_TRUE);
1846 : indent--;
1847 3 : if (XMTDump) {
1848 2 : EndDescDump(trace, "ES_DescriptorUpdate", indent, XMTDump);
1849 : } else {
1850 1 : gf_fprintf(trace, "\n");
1851 : }
1852 3 : return GF_OK;
1853 : }
1854 :
1855 9 : GF_Err gf_odf_dump_esd_remove(GF_ESDRemove *com, FILE *trace, u32 indent, Bool XMTDump)
1856 : {
1857 : u32 i;
1858 :
1859 9 : if (XMTDump) {
1860 5 : StartDescDump(trace, "ES_DescriptorRemove", indent, XMTDump);
1861 5 : StartAttribute(trace, "objectDescriptorId", indent, XMTDump);
1862 5 : gf_fprintf(trace, "od%d", com->ODID);
1863 5 : EndAttribute(trace, indent, XMTDump);
1864 5 : StartAttribute(trace, "ES_ID", indent, XMTDump);
1865 : } else {
1866 : char ind_buf[OD_MAX_TREE];
1867 12 : OD_FORMAT_INDENT(ind_buf, indent);
1868 4 : gf_fprintf(trace, "%sREMOVE ESD FROM %d [", ind_buf, com->ODID);
1869 : }
1870 9 : for (i=0; i<com->NbESDs; i++) {
1871 9 : if (i) gf_fprintf(trace, " ");
1872 9 : if (XMTDump) gf_fprintf(trace, "es");
1873 9 : gf_fprintf(trace, "%d", com->ES_ID[i]);
1874 : }
1875 9 : if (XMTDump) {
1876 5 : EndAttribute(trace, indent, XMTDump);
1877 : indent--;
1878 : EndSubElement(trace, indent, XMTDump);
1879 : } else {
1880 4 : gf_fprintf(trace, "]\n");
1881 : }
1882 9 : return GF_OK;
1883 : }
1884 :
1885 : #ifndef GPAC_MINIMAL_ODF
1886 : GF_Err gf_odf_dump_ipmp_update(GF_IPMPUpdate *com, FILE *trace, u32 indent, Bool XMTDump)
1887 : {
1888 : if (XMTDump) {
1889 : StartDescDump(trace, "IPMP_DescriptorUpdate", indent, XMTDump);
1890 : EndAttributes(trace, indent, XMTDump);
1891 : indent++;
1892 : DumpDescList(com->IPMPDescList, trace, indent+1, "ipmpDesc", XMTDump, GF_FALSE);
1893 : indent--;
1894 : EndDescDump(trace, "IPMP_DescriptorUpdate", indent, XMTDump);
1895 : } else {
1896 : DumpDescList(com->IPMPDescList, trace, indent, "UPDATE IPMPD", XMTDump, GF_TRUE);
1897 : }
1898 : return GF_OK;
1899 : }
1900 :
1901 : GF_Err gf_odf_dump_ipmp_remove(GF_IPMPRemove *com, FILE *trace, u32 indent, Bool XMTDump)
1902 : {
1903 : u32 i;
1904 :
1905 : StartDescDump(trace, "IPMP_DescriptorRemove", indent, XMTDump);
1906 : indent++;
1907 :
1908 : StartAttribute(trace, "IPMP_DescriptorID", indent, XMTDump);
1909 : for (i=0; i<com->NbIPMPDs; i++) {
1910 : if (i) gf_fprintf(trace, " ");
1911 : gf_fprintf(trace, "%d", com->IPMPDescID[i]);
1912 : }
1913 : EndAttribute(trace, indent, XMTDump);
1914 : indent--;
1915 : EndSubElement(trace, indent, XMTDump);
1916 : return GF_OK;
1917 : }
1918 :
1919 : GF_Err gf_odf_dump_base_command(GF_BaseODCom *com, FILE *trace, u32 indent, Bool XMTDump)
1920 : {
1921 : StartDescDump(trace, "BaseODCommand", indent, XMTDump);
1922 : indent++;
1923 :
1924 : DumpData(trace, "custom", com->data, com->dataSize, indent, XMTDump);
1925 : indent--;
1926 : EndSubElement(trace, indent, XMTDump);
1927 : return GF_OK;
1928 : }
1929 :
1930 :
1931 : GF_EXPORT
1932 : GF_Err gf_oci_dump_event(OCIEvent *ev, FILE *trace, u32 indent, Bool XMTDump)
1933 : {
1934 : u8 H, M, S, hS, rien;
1935 : u16 evID;
1936 : u32 i;
1937 :
1938 : StartDescDump(trace, "OCI_Event", indent, XMTDump);
1939 : indent++;
1940 : gf_oci_event_get_id(ev, &evID);
1941 : DumpInt(trace, "eventID", evID, indent, XMTDump);
1942 :
1943 : gf_oci_event_get_start_time(ev, &H, &M, &S, &hS, &rien);
1944 : DumpBool(trace, "absoluteTimeFlag", rien, indent, XMTDump);
1945 : StartAttribute(trace, "startingTime", indent, XMTDump);
1946 : gf_fprintf(trace, "%d:%d:%d:%d", H, M, S, hS);
1947 : EndAttribute(trace, indent, XMTDump);
1948 :
1949 : gf_oci_event_get_duration(ev, &H, &M, &S, &hS);
1950 : StartAttribute(trace, "duration", indent, XMTDump);
1951 : gf_fprintf(trace, "%d:%d:%d:%d", H, M, S, hS);
1952 : EndAttribute(trace, indent, XMTDump);
1953 :
1954 : StartElement(trace, "OCIDescr", indent, XMTDump, GF_TRUE);
1955 : for (i=0; i<gf_oci_event_get_desc_count(ev); i++) {
1956 : GF_Descriptor *desc = gf_oci_event_get_desc(ev, i);
1957 : gf_odf_dump_desc(desc, trace, indent+1, XMTDump);
1958 : }
1959 : EndElement(trace, "OCIDescr", indent, XMTDump, GF_TRUE);
1960 : indent--;
1961 : EndDescDump(trace, "OCI_Event", indent, XMTDump);
1962 :
1963 : return GF_OK;
1964 : }
1965 :
1966 :
1967 : GF_EXPORT
1968 : GF_Err gf_oci_dump_au(u8 version, u8 *au, u32 au_length, FILE *trace, u32 indent, Bool XMTDump)
1969 : {
1970 : GF_Err e;
1971 : OCICodec *codec = gf_oci_codec_new(0, version);
1972 : if (!codec) return GF_BAD_PARAM;
1973 :
1974 : e = gf_oci_codec_decode(codec, au, au_length);
1975 :
1976 : if (!e) {
1977 : while (1) {
1978 : OCIEvent *ev = gf_oci_codec_get_event(codec);
1979 : if (!ev) break;
1980 : gf_oci_dump_event(ev, trace, indent, XMTDump);
1981 : }
1982 : }
1983 : gf_oci_codec_del(codec);
1984 : return e;
1985 : }
1986 :
1987 : #endif /*GPAC_MINIMAL_ODF*/
1988 :
1989 : #endif /*GPAC_DISABLE_OD_DUMP*/
|