src/atsc3_mmtp_parser.c
mmtp_payload_fragments_union_t* mmtp_packet_create(block_t * raw_packet,
												uint8_t mmtp_packet_version,
												uint8_t mmtp_payload_type,
												uint16_t mmtp_packet_id,
												uint32_t packet_sequence_number,
												uint32_t packet_counter,
												uint32_t mmtp_timestamp) {
	mmtp_payload_fragments_union_t *entry = NULL;

	//pick the larger of the timed vs. non-timed fragment struct sizes
	entry = calloc(1, sizeof(mmtp_payload_fragments_union_t));

	if(!entry) {
		abort();
	}

	entry->mmtp_packet_header.raw_packet = raw_packet;
	entry->mmtp_packet_header.mmtp_packet_version = mmtp_packet_version;
	entry->mmtp_packet_header.mmtp_payload_type = mmtp_payload_type;
	entry->mmtp_packet_header.mmtp_packet_id = mmtp_packet_id;
	entry->mmtp_packet_header.packet_sequence_number = packet_sequence_number;
	entry->mmtp_packet_header.packet_counter = packet_counter;
	entry->mmtp_packet_header.mmtp_timestamp = mmtp_timestamp;

	return entry;
}
//think of this as castable to the base fields as they are the same size layouts
think of this as castable to the base fields as they are the same size layouts
think of this as castable to the base fields as they are the same size layouts
mmtp_payload_fragments_union_t* mmtp_packet_create(block_t * raw_packet,
												uint8_t mmtp_packet_version,
												uint8_t mmtp_payload_type,
												uint16_t mmtp_packet_id,
												uint32_t packet_sequence_number,
												uint32_t packet_counter,
												uint32_t mmtp_timestamp) {
	mmtp_payload_fragments_union_t *entry = NULL;
	entry = calloc(1, sizeof(mmtp_payload_fragments_union_t));
	if(!entry) {
		abort();
	}
	entry->mmtp_packet_header.raw_packet = raw_packet;
	entry->mmtp_packet_header.mmtp_packet_version = mmtp_packet_version;
	entry->mmtp_packet_header.mmtp_payload_type = mmtp_payload_type;
	entry->mmtp_packet_header.mmtp_packet_id = mmtp_packet_id;
	entry->mmtp_packet_header.packet_sequence_number = packet_sequence_number;
	entry->mmtp_packet_header.packet_counter = packet_counter;
	entry->mmtp_packet_header.mmtp_timestamp = mmtp_timestamp;
	return entry;
}
mmtp_payload_fragments_union_t * mmtp_packet_create ( block_t * raw_packet , uint8_t mmtp_packet_version , uint8_t mmtp_payload_type , uint16_t mmtp_packet_id , uint32_t packet_sequence_number , uint32_t packet_counter , uint32_t mmtp_timestamp ) { mmtp_payload_fragments_union_t * entry = NULL ; entry = calloc ( 1 , sizeof ( mmtp_payload_fragments_union_t ) ) ; if ( ! entry ) { abort ( ) ; } entry -> mmtp_packet_header . raw_packet = raw_packet ; entry -> mmtp_packet_header . mmtp_packet_version = mmtp_packet_version ; entry -> mmtp_packet_header . mmtp_payload_type = mmtp_payload_type ; entry -> mmtp_packet_header . mmtp_packet_id = mmtp_packet_id ; entry -> mmtp_packet_header . packet_sequence_number = packet_sequence_number ; entry -> mmtp_packet_header . packet_counter = packet_counter ; entry -> mmtp_packet_header . mmtp_timestamp = mmtp_timestamp ; return entry ; }
think of this as castable to the base fields as they are the same size layouts
think of this as castable to the base fields as they are the same size layouts
//pick the larger of the timed vs. non-timed fragment struct sizes