Revision e3503a45 chunker_streamer/chunker_streamer.c

View differences:

chunker_streamer/chunker_streamer.c
788 788
					}
789 789

  
790 790
					if(chunkFilled(chunk, VIDEO_CHUNK)) { // is chunk filled using current strategy?
791
						//calculate priority
792
						chunk->priority /= chunk->frames_num;
793

  
791 794
						//SAVE ON FILE
792 795
						//saveChunkOnFile(chunk);
793 796
						//Send the chunk to an external transport/player
794 797
						sendChunk(chunk);
795 798
#ifdef DEBUG_CHUNKER
796
						fprintf(stderr, "VIDEO: sent chunk video %d\n", chunk->seq);
799
						fprintf(stderr, "VIDEO: sent chunk video %d, prio:%f\n", chunk->seq, chunk->priority);
797 800
#endif
798 801
						chunk->seq = 0; //signal that we need an increase
799 802
						//initChunk(chunk, &seq_current_chunk);
......
1141 1144
	if(chunk->seq == 0) {
1142 1145
		initChunk(chunk, &seq_current_chunk);
1143 1146
	}
1147
	//add frame priority to chunk priority (to be normalized later on)
1148
	chunk->priority += frame->type + 1; // I:2, P:3, B:4
1149

  
1144 1150
	//HINT on malloc
1145 1151
	chunk->data = (uint8_t *)realloc(chunk->data, sizeof(uint8_t)*(chunk->payload_len + frame->size + sizeFrameHeader));
1146 1152
	if(!chunk->data)  {

Also available in: Unified diff