Revision e11386c0 chunker_streamer/chunker_metadata.c

View differences:

chunker_streamer/chunker_metadata.c
22 22
	cfg_opt_t opts[] =
23 23
	{
24 24
		CFG_STR("strategyType", "frames", CFGF_NONE), //"frames" or "size"
25
		CFG_INT("strategyValue", 10, CFGF_NONE),
25
		CFG_INT("audioFramesPerChunk", 1, CFGF_NONE),
26
		CFG_INT("videoFramesPerChunk", 1, CFGF_NONE),
27
		CFG_INT("targetChunkSize", 1024, CFGF_NONE),
26 28
		CFG_STR("chunkID", "sequence", CFGF_NONE), //"sequence" or "starttime" or "monotonic"
27 29
		CFG_STR("outsideWorldUrl", "http://localhost:5557/externalplayer", CFGF_NONE),
28 30
		CFG_END()
......
42 44
		exit(-1);
43 45
	}
44 46

  
45
	cmeta->val_strategy = cfg_getint(cfg, "strategyValue");
46

  
47 47
	if(!(strcmp(cfg_getstr(cfg, "strategyType"), "frames"))) {
48 48
		// a fixed number of frames inside every chunk
49 49
		cmeta->strategy = 0;
50
		fprintf(stdout, "CONFIG: Will pack %d FRAMES in each chunk\n", cmeta->val_strategy);
50
		cmeta->framesPerChunk[0] = cfg_getint(cfg, "audioFramesPerChunk");
51
		cmeta->framesPerChunk[1] = cfg_getint(cfg, "videoFramesPerChunk");
52
		fprintf(stdout, "CONFIG: Will pack %d AUDIO FRAMES or %d VIDEO FRAMES in each chunk\n", cmeta->framesPerChunk[0], cmeta->framesPerChunk[1]);
51 53
	}
52 54
	else if(!(strcmp(cfg_getstr(cfg, "strategyType"), "size"))) {
53 55
		// each chunk of approx same size of bytes
54 56
		cmeta->strategy = 1;
55
		fprintf(stdout, "CONFIG: Will pack %d BYTES in each chunk\n", cmeta->val_strategy);
57
		cmeta->targetChunkSize = cfg_getint(cfg, "targetChunkSize");
58
		fprintf(stdout, "CONFIG: Will pack %d BYTES in each chunk\n", cmeta->targetChunkSize);
56 59
	}
57 60
	else {
58 61
		fprintf(stdout, "CONFIG: Unknown strategyType in config file chunker.conf. Exiting.\n");

Also available in: Unified diff