Skip to content

Commit a62db5d

Browse files
committed
updates for consul
1 parent 79d9602 commit a62db5d

File tree

6 files changed

+75
-41
lines changed

6 files changed

+75
-41
lines changed

P2Pconsul/NodeUrl.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func (n *NodeUrl) RegisterNode() {
149149
}
150150

151151
//Search search network for a given url
152-
func (n *NodeUrl) Search(url string, segmentDuration int, addSegDuration bool) string {
152+
func (n *NodeUrl) Search(url string, segmentDuration int, addSegDuration bool, dashProfile string) string {
153153
//start timer of search fucntion
154154
start := time.Now()
155155
n.DebugPrint("in consul search url :" + url)
@@ -160,7 +160,7 @@ func (n *NodeUrl) Search(url string, segmentDuration int, addSegDuration bool) s
160160
//location := l[len(l)-1]
161161
var location string
162162
if addSegDuration {
163-
location = strconv.Itoa(segmentDuration) + "sec_" + l[len(l)-1]
163+
location = strconv.Itoa(segmentDuration) + "sec_" + dashProfile + "_" + l[len(l)-1]
164164
} else {
165165
location = l[len(l)-1]
166166
}

evaluate/config/configure.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"expRatio" : 0.2,
1616
"quic" : "off",
1717
"useTestbed" : "off",
18-
"url" : "[http://cs1dev.ucc.ie/misl/4K_non_copyright_dataset/2_sec/x264/bbb/DASH_Files/full/bbb_enc_x264_dash.mpd]",
18+
"url" : "[http://cs1dev.ucc.ie/misl/4K_non_copyright_dataset/2_sec/x264/bbb/DASH_Files/full_byte_range/bbb_enc_x264_dash.mpd]",
1919
"QoE" : "on",
2020
"serveraddr" : "on"
2121
}

http/mpdParsing.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ type StreamStruct struct {
7373
AudioContent bool
7474
RepRate int
7575
BandwithList []int
76+
Profile string
7677
}
7778

7879
// MPD structure

http/urlParsing.go

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ func JoinURL(baseURL string, append string, debugLog bool) string {
504504
*/
505505
func GetFile(currentURL string, fileBaseURL string, fileLocation string, isByteRangeMPD bool, startRange int, endRange int,
506506
segmentNumber int, segmentDuration int, addSegDuration bool, quicBool bool, debugFile string, debugLog bool,
507-
useTestbedBool bool, repRate int, saveFilesBool bool, AudioByteRange bool) (time.Duration, int, string, string, float64) {
507+
useTestbedBool bool, repRate int, saveFilesBool bool, AudioByteRange bool, profile string) (time.Duration, int, string, string, float64) {
508508

509509
// create the string where we want to save this file
510510
var createFile string
@@ -522,14 +522,17 @@ func GetFile(currentURL string, fileBaseURL string, fileLocation string, isByteR
522522
base := path.Base(fileBaseURL)
523523

524524
// we need to create a file to save for the byte-range content
525-
if isByteRangeMPD && !AudioByteRange {
525+
// but only for the video byte range and not audio byte range
526+
// if isByteRangeMPD && !AudioByteRange {
527+
// for now, lets just save each segment
528+
if isByteRangeMPD {
526529
s := strings.Split(base, ".")
527530
base = s[0] + "_segment" + strconv.Itoa(segmentNumber) + ".m4s"
528531
}
529532

530533
// create the new file location, or not
531-
if addSegDuration || AudioByteRange {
532-
createFile = fileLocation + "/" + strconv.Itoa(segmentDuration) + "sec_" + base
534+
if !strings.Contains(base, profile) && (addSegDuration || AudioByteRange) {
535+
createFile = fileLocation + "/" + strconv.Itoa(segmentDuration) + "sec_" + profile + "_" + base
533536
} else {
534537
createFile = fileLocation + "/" + base
535538
}
@@ -629,7 +632,7 @@ func GetFile(currentURL string, fileBaseURL string, fileLocation string, isByteR
629632
* get the provided file from the online HTTP server and save to folder
630633
* get a 1-second piece of each file
631634
*/
632-
func GetFileProgressively(currentURL string, fileBaseURL string, fileLocation string, isByteRangeMPD bool, startRange int, endRange int, segmentNumber int, segmentDuration int, addSegDuration bool, debugLog bool, AudioByteRange bool) (time.Duration, int) {
635+
func GetFileProgressively(currentURL string, fileBaseURL string, fileLocation string, isByteRangeMPD bool, startRange int, endRange int, segmentNumber int, segmentDuration int, addSegDuration bool, debugLog bool, AudioByteRange bool, profile string) (time.Duration, int) {
633636

634637
// create the string where we want to save this file
635638
var createFile string
@@ -646,14 +649,16 @@ func GetFileProgressively(currentURL string, fileBaseURL string, fileLocation st
646649
base := path.Base(fileBaseURL)
647650

648651
// we need to create a file to save for the byte-range content
649-
if isByteRangeMPD && !AudioByteRange {
652+
// if isByteRangeMPD && !AudioByteRange {
653+
if isByteRangeMPD {
654+
// for now, lets just save each segment
650655
s := strings.Split(base, ".")
651656
base = s[0] + "_segment" + strconv.Itoa(segmentNumber) + ".m4s"
652657
}
653658

654659
// create the new file location, or not
655-
if addSegDuration {
656-
createFile = fileLocation + "/" + strconv.Itoa(segmentDuration) + "sec_" + base
660+
if addSegDuration && !strings.Contains(base, profile) {
661+
createFile = fileLocation + "/" + strconv.Itoa(segmentDuration) + "sec_" + profile + "_" + base
657662
} else {
658663
createFile = fileLocation + "/" + base
659664
}

logging/debug.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ type SegPrintLogInformation struct {
8080
SumRateChange float64
8181
RateChange []float64
8282
MimeType string
83+
Profile string
8384
}
8485

8586
// headers for the print log

0 commit comments

Comments
 (0)