Revision 59e008ed

View differences:

chunker_player/Makefile
7 7
endif
8 8

  
9 9
ifeq ($(IO), httpevent)
10
#TODO add: or equals httpmhd
10 11
CPPFLAGS += -DHTTPIO
11 12
endif
12 13

  
......
56 57
LOCAL_CONFUSE_CPPFLAGS = -I$(LOCAL_CONFUSE)/include
57 58
LOCAL_CONFUSE_LDLIBS = $(LOCAL_CONFUSE)/lib/libconfuse.a
58 59

  
59
#LOCAL_PSNR_LDLIBS = ../../../NAPA-BASELIBS/rep/librep.a ../../../NAPA-BASELIBS/dclog/libdclog.a ../../../NAPA-BASELIBS/common/libcommon.a ../../../NAPA-BASELIBS/ml/libml.a
60
LOCAL_PSNR_LDLIBS = $(NAPA)/rep/librep.a $(NAPA)/dclog/libdclog.a $(NAPA)/common/libcommon.a $(NAPA)/ml/libml.a $(LIBEVENT_DIR)/lib/libevent.a
60 61

  
61 62
#put them in the correct order
62 63
CPPFLAGS += $(LOCAL_SDLTTF_CPPFLAGS) $(LOCAL_SDLIMAGE_CPPFLAGS) $(LOCAL_SDL_CPPFLAGS)
......
70 71
LDLIBS += $(LOCAL_SDLTTF_LDLIBS) $(LOCAL_SDLIMAGE_LDLIBS) $(LOCAL_SDL_LDLIBS)
71 72
LDLIBS += $(LOCAL_MHD_LDLIBS) $(LOCAL_CONFUSE_LDLIBS) $(LOCAL_FREETYPE_LDLIBS)
72 73
LDLIBS += $(LOCAL_FFMPEG_LDLIBS) $(LOCAL_COMMON_LDLIBS)
73
#LDLIBS += $(LOCAL_PSNR_LDLIBS)
74
LDLIBS += $(LOCAL_PSNR_LDLIBS)
74 75

  
75 76
ifdef WINDOWS
76 77
LDLIBS += $(DYNAMIC_LDLIBS) -lmingw32 $(LOCAL_ABS_SDL)/lib/libSDLmain.a $(LOCAL_ABS_SDL)/lib/libSDL.dll.a -lwinmm -lgdi32
77 78
else
78
LDLIBS += $(DYNAMIC_LDLIBS)
79
LDLIBS += $(DYNAMIC_LDLIBS) -lrt
79 80
endif
80 81

  
81 82
LINKER = $(CC)
......
84 85

  
85 86
OBJS = ../chunk_transcoding/external_chunk_transcoding.o
86 87
ifeq ($(IO), httpevent)
88
#TODO add: or equals httpmhd
87 89
OBJS += http_chunk_puller.o
88 90
endif
89 91

  
chunker_player/chunker_player.c
48 48
    return -1;
49 49
}
50 50

  
51
void CheckForRepoAddress(char* Param)
51
int CheckForRepoAddress(char* Param)
52 52
{
53
	int result = 0;
54
/*
53 55
    char* pch;
54 56
    if(strncasecmp(Param,"repo_address=",13)==0)
55 57
    {
56 58
        pch=strtok(Param+13,",");
57 59
        strncpy(RepoAddress,pch,2048);
58 60
    }
61
*/
62
//strcpy(RepoAddress,"repo-wut.napa-wine.eu:9832");
63
strcpy(RepoAddress,"repository.disi.unitn.it:9832");
64
result = 1;
65

  
66
	return result;
59 67
}
60 68

  
61 69
void sigproc()
......
94 102
	repoclient=NULL;
95 103
	LastTimeRepoPublish.tv_sec=0;
96 104
	LastTimeRepoPublish.tv_usec=0;
105
	eventbase = event_base_new();
97 106
	napaInitLog(LOG_DEBUG, NULL, NULL);
98 107
	repInit("");
99 108
#endif
......
397 406
	if(ScheduledChunkLosses)
398 407
		free(ScheduledChunkLosses);
399 408
#endif
409

  
410
#ifdef PSNR_PUBLICATION
411
	repClose(repoclient);
412
	event_base_free(eventbase);
413
#endif
400 414
	return 0;
401 415
}
402 416

  
......
591 605
		// printf ("\tpch=%s\n",pch);
592 606
		parameters_vector[par_count] = (char*) malloc(sizeof(char)*(strlen(pch)+1));
593 607
		strcpy(parameters_vector[par_count], pch);
594
		// Find repo_address
595
		CheckForRepoAddress(parameters_vector[par_count]);
596 608
		pch = strtok (NULL, " ");
597 609
		par_count++;
598 610
	}
......
678 690
	}
679 691
#endif
680 692

  
681
	for(i=1; i<par_count; i++)
682
		free(parameters_vector[i]);
683

  
684 693
#ifdef PSNR_PUBLICATION
694
	// Find repo_address
695
	if(CheckForRepoAddress(parameters_vector[par_count])) {
696

  
685 697
	// Open Repository
686 698
	if(repoclient)
687 699
		repClose(repoclient);
......
689 701

  
690 702
	repoclient = repOpen(RepoAddress,0);
691 703
	if (repoclient == NULL)
692
		fatal("Unable to initialize PSNR publication in repoclient %s", RepoAddress);
704
		printf("Unable to initialize PSNR publication in repoclient %s\n", RepoAddress);
705
	}
706
	else {
707
		printf("Repository address not present in streames launch string. Publication disabled\n");
708
	}
693 709
#endif
694 710

  
711
	for(i=1; i<par_count; i++)
712
		free(parameters_vector[i]);
713

  
695 714
	// Read the Network ID
696 715
	int Error=true;
697 716
	char Line1[255], Line2[255];
chunker_player/chunker_player.h
100 100
#endif
101 101
#endif
102 102

  
103
int CheckForRepoAddress(char* Param);
103 104
void ZapDown();
104 105
void ZapUp();
105 106
int ParseConf();
chunker_player/player_core.c
1467 1467
#ifdef PSNR_PUBLICATION
1468 1468
					// Publish measure into repository
1469 1469
					MeasurementRecord r;
1470
	                strcpy(r.originator,NetworkID);
1471
	                strcpy(r.targetA,NetworkID);
1472
	                strcpy(r.targetB,"");
1473
	                strcpy(r.published_name,"PSNR");
1470
	                r.originator = NetworkID;
1471
	                r.targetA = NetworkID;
1472
	                r.targetB = "";
1473
	                r.published_name = "PSNR_MEAN";
1474 1474
	                r.value = qoe;
1475 1475
	                r.string_value = NULL;
1476
	                strcpy(r.channel,Channels[SelectedChannel].Title);
1476
	                r.channel = Channels[SelectedChannel].Title;
1477 1477
	                gettimeofday(&(r.timestamp), NULL);
1478 1478
	                // One update every REPO_UPDATE_INTERVALL seconds
1479 1479
	                struct timeval ElapsedTime;
......
1482 1482
                    {
1483 1483
                        LastTimeRepoPublish=r.timestamp;
1484 1484
                        if(repPublish(repoclient,NULL,NULL,&r)!=NULL)
1485
                            printf("VALORE PUBBLICATO: %s  %e  %s\n",r.originator,qoe,r.channel);
1485
#ifdef DEBUG_PSNR
1486
                            printf("PSNR publish: %s  %e  %s\n",r.originator,qoe,r.channel);
1487
#endif
1486 1488
                    }
1487 1489
#endif
1488 1490
				}
chunker_player/player_defines.h
94 94
//#define DEBUG_STATS_DEEP
95 95
//#define DEBUG_AUDIO_BUFFER
96 96
//#define DEBUG_CHUNKER
97
#define DEBUG_PSNR
97 98
//#define EMULATE_CHUNK_LOSS
98 99

  
99 100
#define VIDEO_DEINTERLACE
100 101

  
101
//#define PSNR_PUBLICATION
102
#define PSNR_PUBLICATION
102 103
// seconds
103 104
#define PSNR_REPO_UPDATE_INTERVALL   10
104 105

  
common.mak
13 13
CFLAGS = -pthread -g -O0 -Wall
14 14
LDFLAGS += -pthread
15 15
DYNAMIC_LDLIBS += -lm
16
#DYNAMIC_LDLIBS += -lm -lrt
17 16
endif
18 17

  
18
NAPA ?= ../../../NAPA-BASELIBS
19

  
19 20
CFLAGS += -DHAVE_OPENGL -Wl,--warn-common -Wl,--as-needed -Wl,-Bsymbolic
20
#CPPFLAGS += -I../chunk_transcoding -I../ -I../../../NAPA-BASELIBS/include
21
CPPFLAGS += -I../chunk_transcoding -I../
21
CPPFLAGS += -I../chunk_transcoding -I../ -I$(NAPA)/include
22 22

  
23 23
#default fmmpeg here
24 24
LOCAL_FFMPEG_CPPFLAGS = -I$(LOCAL_FFMPEG)/include

Also available in: Unified diff