GF_Err sdtp_box_dump(GF_Box *a, FILE * trace)
{
	GF_SampleDependencyTypeBox *p;
	u32 i;

	if (dump_skip_samples)
		return GF_OK;

	p = (GF_SampleDependencyTypeBox*)a;
	gf_isom_box_dump_start(a, "SampleDependencyTypeBox", trace);
	gf_fprintf(trace, "SampleCount=\"%d\">\n", p->sampleCount);

	if (!p->sample_info) {
		gf_fprintf(trace, "<!--Warning: No sample dependencies indications-->\n");
	} else {
		for (i=0; i<p->sampleCount; i++) {
			const char *type;
			u8 flag = p->sample_info[i];
			gf_fprintf(trace, "<SampleDependencyEntry ");
			switch ( (flag >> 6) & 3) {
			case 1: type="openGOP"; break;
			case 2: type="no"; break;
			case 3: type="SAP2"; break;
			default:
			case 0: type="unknown"; break;
			}
			gf_fprintf(trace, "isLeading=\"%s\" ", type);

			switch ( (flag >> 4) & 3) {
			case 1: type="yes"; break;
			case 2: type="no"; break;
			case 3: type="RESERVED"; break;
			default:
			case 0: type="unknown"; break;
			}
			gf_fprintf(trace, "dependsOnOther=\"%s\" ", type);

			switch ( (flag >> 2) & 3) {
			case 1: type="yes"; break;
			case 2: type="no"; break;
			case 3: type="RESERVED"; break;
			default:
			case 0: type="unknown"; break;
			}
			gf_fprintf(trace, "dependedOn=\"%s\" ", type);

			switch ( flag & 3) {
			case 1: type="yes"; break;
			case 2: type="no"; break;
			case 3: type="RESERVED"; break;
			default:
			case 0: type="unknown"; break;
			}
			gf_fprintf(trace, "hasRedundancy=\"%s\"/>\n", type);
		}
	}
	if (!p->size) {
		gf_fprintf(trace, "<SampleDependencyEntry dependsOnOther=\"unknown|yes|no|RESERVED\" dependedOn=\"unknown|yes|no|RESERVED\" hasRedundancy=\"unknown|yes|no|RESERVED\"/>\n");
	}
	gf_isom_box_dump_done("SampleDependencyTypeBox", a, trace);
	return GF_OK;
}
GF_Err sdtp_box_dump(GF_Box *a, FILE * trace)
{
	GF_SampleDependencyTypeBox *p;
	u32 i;

	if (dump_skip_samples)
		return GF_OK;

	p = (GF_SampleDependencyTypeBox*)a;
	gf_isom_box_dump_start(a, "SampleDependencyTypeBox", trace);
	gf_fprintf(trace, "SampleCount=\"%d\">\n", p->sampleCount);

	if (!p->sample_info) {
		gf_fprintf(trace, "<!--Warning: No sample dependencies indications-->\n");
	} else {
		for (i=0; i<p->sampleCount; i++) {
			const char *type;
			u8 flag = p->sample_info[i];
			gf_fprintf(trace, "<SampleDependencyEntry ");
			switch ( (flag >> 6) & 3) {
			case 1: type="openGOP"; break;
			case 2: type="no"; break;
			case 3: type="SAP2"; break;
			default:
			case 0: type="unknown"; break;
			}
			gf_fprintf(trace, "isLeading=\"%s\" ", type);

			switch ( (flag >> 4) & 3) {
			case 1: type="yes"; break;
			case 2: type="no"; break;
			case 3: type="RESERVED"; break;
			default:
			case 0: type="unknown"; break;
			}
			gf_fprintf(trace, "dependsOnOther=\"%s\" ", type);

			switch ( (flag >> 2) & 3) {
			case 1: type="yes"; break;
			case 2: type="no"; break;
			case 3: type="RESERVED"; break;
			default:
			case 0: type="unknown"; break;
			}
			gf_fprintf(trace, "dependedOn=\"%s\" ", type);

			switch ( flag & 3) {
			case 1: type="yes"; break;
			case 2: type="no"; break;
			case 3: type="RESERVED"; break;
			default:
			case 0: type="unknown"; break;
			}
			gf_fprintf(trace, "hasRedundancy=\"%s\"/>\n", type);
		}
	}
	if (!p->size) {
		gf_fprintf(trace, "<SampleDependencyEntry dependsOnOther=\"unknown|yes|no|RESERVED\" dependedOn=\"unknown|yes|no|RESERVED\" hasRedundancy=\"unknown|yes|no|RESERVED\"/>\n");
	}
	gf_isom_box_dump_done("SampleDependencyTypeBox", a, trace);
	return GF_OK;
}