GF_Err chnl_box_dump(GF_Box *a, FILE * trace)
{
	GF_ChannelLayoutBox *p = (GF_ChannelLayoutBox *) a;
	gf_isom_box_dump_start(a, "ChannelLayoutBox", trace);
	gf_fprintf(trace, " stream_structure=\"%d\"", p->layout.stream_structure);
	if (p->layout.stream_structure & 2)
		gf_fprintf(trace, " object_count=\"%d\"", p->layout.object_count);

	if (p->layout.stream_structure & 1) {
		gf_fprintf(trace, " definedLayout=\"%d\"", p->layout.definedLayout);
		if (p->layout.definedLayout!=0) {
			gf_fprintf(trace, " omittedChannelsMap=\""LLU"\"", p->layout.omittedChannelsMap);
		}
	}

	gf_fprintf(trace, ">\n");
	if ((p->layout.stream_structure & 1) && (p->layout.definedLayout==0)) {
		u32 i;
		for (i=0; i<p->layout.channels_count; i++) {
			gf_fprintf(trace, "<Speaker position=\"%d\"", p->layout.layouts[i].position);
			if (p->layout.layouts[i].position==126) {
				gf_fprintf(trace, " azimuth=\"%d\" elevation=\"%d\"", p->layout.layouts[i].azimuth, p->layout.layouts[i].elevation);
			}
			gf_fprintf(trace, "/>\n");
		}
	}

	gf_isom_box_dump_done("ChannelLayoutBox", a, trace);
	return GF_OK;
}
GF_Err chnl_box_dump(GF_Box *a, FILE * trace)
{
	GF_ChannelLayoutBox *p = (GF_ChannelLayoutBox *) a;
	gf_isom_box_dump_start(a, "ChannelLayoutBox", trace);
	gf_fprintf(trace, " stream_structure=\"%d\"", p->layout.stream_structure);
	if (p->layout.stream_structure & 2)
		gf_fprintf(trace, " object_count=\"%d\"", p->layout.object_count);

	if (p->layout.stream_structure & 1) {
		gf_fprintf(trace, " definedLayout=\"%d\"", p->layout.definedLayout);
		if (p->layout.definedLayout!=0) {
			gf_fprintf(trace, " omittedChannelsMap=\""LLU"\"", p->layout.omittedChannelsMap);
		}
	}

	gf_fprintf(trace, ">\n");
	if ((p->layout.stream_structure & 1) && (p->layout.definedLayout==0)) {
		u32 i;
		for (i=0; i<p->layout.channels_count; i++) {
			gf_fprintf(trace, "<Speaker position=\"%d\"", p->layout.layouts[i].position);
			if (p->layout.layouts[i].position==126) {
				gf_fprintf(trace, " azimuth=\"%d\" elevation=\"%d\"", p->layout.layouts[i].azimuth, p->layout.layouts[i].elevation);
			}
			gf_fprintf(trace, "/>\n");
		}
	}

	gf_isom_box_dump_done("ChannelLayoutBox", a, trace);
	return GF_OK;
}