Exemplo n.º 1
0
GF_Err gf_ipmpx_dump_WatermarkingInit(GF_IPMPX_Data *_p, FILE *trace, u32 indent, Bool XMTDump)
{
	GF_IPMPX_WatermarkingInit*p = (GF_IPMPX_WatermarkingInit*)_p;
	StartElement(trace, (char*) (_p->tag==GF_IPMPX_AUDIO_WM_INIT_TAG) ? "IPMP_AudioWatermarkingInit" : "IPMP_VideoWatermarkingInit", indent, XMTDump);
	indent++;
	DumpInt(trace, "inputFormat", p->inputFormat, indent, XMTDump);
	DumpInt(trace, "requiredOp", p->requiredOp, indent, XMTDump);
	if (p->inputFormat==0x01) {
		if (_p->tag==GF_IPMPX_AUDIO_WM_INIT_TAG) {
			DumpInt(trace, "nChannels", p->nChannels, indent, XMTDump);
			DumpInt(trace, "bitPerSample", p->bitPerSample, indent, XMTDump);
			DumpInt(trace, "frequency", p->frequency, indent, XMTDump);
		} else {
			DumpInt(trace, "frame_horizontal_size", p->frame_horizontal_size, indent, XMTDump);
			DumpInt(trace, "frame_vertical_size", p->frame_vertical_size, indent, XMTDump);
			DumpInt(trace, "chroma_format", p->chroma_format, indent, XMTDump);
		}
	}
	switch (p->requiredOp) {
	case GF_IPMPX_WM_INSERT:
	case GF_IPMPX_WM_REMARK:
		DumpData(trace, "wmPayload", p->wmPayload, p->wmPayloadLen, indent, XMTDump);
		break;
	case GF_IPMPX_WM_EXTRACT:
	case GF_IPMPX_WM_DETECT_COMPRESSION:
		DumpInt(trace, "wmRecipientId", p->wmRecipientId, indent, XMTDump);
		break;
	}
	if (p->opaqueData) DumpData(trace, "opaqueData", p->opaqueData, p->opaqueDataSize, indent, XMTDump);

	EndAttributes(trace, XMTDump, 1);
	gf_ipmpx_dump_BaseData(_p, trace, indent, XMTDump);
	indent--;
	EndElement(trace, (char*) (_p->tag==GF_IPMPX_AUDIO_WM_INIT_TAG) ? "IPMP_AudioWatermarkingInit" : "IPMP_VideoWatermarkingInit", indent, XMTDump);
	return GF_OK;
}
Exemplo n.º 2
0
GF_Err gf_ipmpx_dump_SelectiveDecryptionInit(GF_IPMPX_Data *_p, FILE *trace, u32 indent, Bool XMTDump)
{
	u32 i, count;
	GF_IPMPX_SelectiveDecryptionInit*p = (GF_IPMPX_SelectiveDecryptionInit*)_p;
	StartElement(trace, "IPMP_SelectiveDecryptionInit", indent, XMTDump);
	indent++;
	DumpInt(trace, "mediaTypeExtension", p->mediaTypeExtension, indent, XMTDump);
	DumpInt(trace, "mediaTypeIndication", p->mediaTypeIndication, indent, XMTDump);
	DumpInt(trace, "profileLevelIndication", p->profileLevelIndication, indent, XMTDump);
	DumpInt(trace, "compliance", p->compliance, indent, XMTDump);
	if (p->RLE_Data) DumpData_16(trace, "RLE_Data", p->RLE_Data, p->RLE_DataLength, indent, XMTDump);
	EndAttributes(trace, XMTDump, GF_TRUE);
	gf_ipmpx_dump_BaseData(_p, trace, indent, XMTDump);

	count = gf_list_count(p->SelEncBuffer);
	if (count) {
		StartList(trace, "SelectiveBuffers", indent, XMTDump);
		indent++;
		for (i=0; i<count; i++) {
			GF_IPMPX_SelEncBuffer *sb = (GF_IPMPX_SelEncBuffer *)gf_list_get(p->SelEncBuffer, i);
			StartElement(trace, "IPMP_SelectiveBuffer", indent, XMTDump);
			indent++;
			DumpBin128(trace, "cipher_Id", (char*)sb->cipher_Id, indent, XMTDump);
			DumpInt(trace, "syncBoundary", sb->syncBoundary, indent, XMTDump);
			if (!sb->Stream_Cipher_Specific_Init_Info) {
				DumpInt(trace, "mode", sb->mode, indent, XMTDump);
				DumpInt(trace, "blockSize", sb->blockSize, indent, XMTDump);
				DumpInt(trace, "keySize", sb->keySize, indent, XMTDump);
			}
			EndAttributes(trace, XMTDump, GF_TRUE);
			if (sb->Stream_Cipher_Specific_Init_Info)
				gf_ipmpx_dump_ByteArray(sb->Stream_Cipher_Specific_Init_Info, "StreamCipher", trace, indent, XMTDump);

			indent--;
			EndElement(trace, "IPMP_SelectiveBuffer", indent, XMTDump);
		}
		indent--;
		EndList(trace, "SelectiveBuffers", indent, XMTDump);
	}

	count = gf_list_count(p->SelEncFields);
	if (!p->RLE_Data && count) {
		StartList(trace, "SelectiveFields", indent, XMTDump);
		indent++;
		for (i=0; i<count; i++) {
			GF_IPMPX_SelEncField *sf = (GF_IPMPX_SelEncField *)gf_list_get(p->SelEncFields, i);
			StartElement(trace, "IPMP_SelectiveField", indent, XMTDump);
			indent++;
			DumpInt(trace, "field_Id", sf->field_Id, indent, XMTDump);
			DumpInt(trace, "field_Scope", sf->field_Scope, indent, XMTDump);
			DumpInt(trace, "buf", sf->buf, indent, XMTDump);
			if (sf->mappingTable) DumpData_16(trace, "mappingTable", sf->mappingTable, sf->mappingTableSize, indent, XMTDump);
			EndAttributes(trace, XMTDump, GF_TRUE);
			if (sf->shuffleSpecificInfo)
				gf_ipmpx_dump_ByteArray(sf->shuffleSpecificInfo, "shuffleSpecificInfo", trace, indent, XMTDump);

			indent--;
			EndElement(trace, "IPMP_SelectiveField", indent, XMTDump);
		}
		indent--;
		EndList(trace, "SelectiveFields", indent, XMTDump);
	}

	indent--;
	EndElement(trace, "IPMP_SelectiveDecryptionInit", indent, XMTDump);
	return GF_OK;
}
Exemplo n.º 3
0
GF_Err gf_ipmpx_dump_MutualAuthentication(GF_IPMPX_Data *_p, FILE *trace, u32 indent, Bool XMTDump)
{
	u32 i, count;
	GF_IPMPX_MutualAuthentication *p = (GF_IPMPX_MutualAuthentication*)_p;
	StartElement(trace, "IPMP_MutualAuthentication", indent, XMTDump);
	indent++;
	DumpBool(trace, "failedNegotiation", p->failedNegotiation, indent, XMTDump);
	if (gf_list_count(p->certificates)) DumpInt(trace, "certType", p->certType, indent, XMTDump);

	EndAttributes(trace, XMTDump, GF_TRUE);
	gf_ipmpx_dump_BaseData(_p, trace, indent, XMTDump);

	StartList(trace, "candidateAlgorithms", indent, XMTDump);
	count = gf_list_count(p->candidateAlgorithms);
	indent++;
	for (i=0; i<count; i++) {
		GF_IPMPX_Authentication *ip_auth = (GF_IPMPX_Authentication *)gf_list_get(p->candidateAlgorithms, i);
		gf_ipmpx_dump_AUTH(ip_auth, trace, indent, XMTDump);
	}
	indent--;
	EndList(trace, "candidateAlgorithms", indent, XMTDump);

	StartList(trace, "agreedAlgorithms", indent, XMTDump);
	count = gf_list_count(p->agreedAlgorithms);
	indent++;
	for (i=0; i<count; i++) {
		GF_IPMPX_Authentication *ip_auth = (GF_IPMPX_Authentication *)gf_list_get(p->agreedAlgorithms, i);
		gf_ipmpx_dump_AUTH(ip_auth, trace, indent, XMTDump);
	}
	indent--;
	EndList(trace, "agreedAlgorithms", indent, XMTDump);

	if (p->AuthenticationData) gf_ipmpx_dump_ByteArray(p->AuthenticationData, "AuthenticationData", trace, indent, XMTDump);

	count = gf_list_count(p->certificates);
	if (count || p->opaque || p->publicKey) {
		/*type 1*/
		if (count) {
			StartList(trace, "certificates", indent, XMTDump);
			for (i=0; i<count; i++) {
				GF_IPMPX_ByteArray *ipd = (GF_IPMPX_ByteArray *)gf_list_get(p->certificates, i);
				if (XMTDump) {
					gf_ipmpx_dump_ByteArray(ipd, NULL, trace, indent, XMTDump);
				} else {
					StartAttribute(trace, "", indent, GF_FALSE);
					DumpData(trace, NULL, ipd->data, ipd->length, indent, GF_FALSE);
					if (i+1<count) fprintf(trace, ",");
					fprintf(trace, "\n");
				}
			}
			EndList(trace, "certificates", indent, XMTDump);
		}
		/*type 2*/
		else if (p->publicKey) {
			gf_ipmpx_dump_AUTH((GF_IPMPX_Authentication *) p->publicKey, trace, indent, XMTDump);
		}
		/*type 0xFE*/
		else if (p->opaque) {
			gf_ipmpx_dump_ByteArray(p->opaque, "opaque", trace, indent, XMTDump);
		}
		if (!XMTDump) StartAttribute(trace, "trustData", indent, GF_FALSE);
		else {
			StartElement(trace, "trustData", indent, XMTDump);
			EndAttributes(trace, XMTDump, GF_TRUE);
		}
		gf_ipmpx_dump_data((GF_IPMPX_Data *)p->trustData, trace, indent, XMTDump);
		if (XMTDump) EndElement(trace, "trustData", indent, XMTDump);
		gf_ipmpx_dump_ByteArray(p->authCodes, "authCodes", trace, indent, XMTDump);
	}

	indent--;
	EndElement(trace, "IPMP_MutualAuthentication", indent, XMTDump);
	return GF_OK;
}