webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Functions | Variables
plotReceiveTrace.m File Reference

Functions

 ExtrapolateLocalTime (1870967878)
 
while ischar (line)% line ~
 
 plot (x, packetTime(:, 3) - firstTime - slope, 'b.')
 
 plot (x, firstPacketTime(:, 2) - firstTime - slope, 'b.')
 
end % Plot the frame complete time if prod (size(completeTime)) > 0 x
 
end plot (x, completeTime(:, 3) - firstTime - slope, 'ks')
 
end % Plot the time the decode starts if prod (size(decodeTime)) > 0 x
 
end plot (x, decodeTime(:, 2) - firstTime - slope, 'r.')
 
end % Plot the decode complete time if prod (size(decodeCompleteTime)) > 0 x
 
end plot (x, decodeCompleteTime(:, 4) - firstTime - slope, 'g.')
 
end if prod (size(renderTime)) > 0 % Plot the wanted render time in ms x
 
end plot (x, renderTime(:, 2) - firstTime - slope, 'c-')
 
end plot (x, renderTime(:, 2) - firstTime - slope - renderTime(:, 3) - renderTime(:, 5), 'c--')
 
end plot (x, renderTime(:, 2) - firstTime - slope - renderTime(:, 3) - renderTime(:, 5), 'b-')
 
endplot (x, 90 *x, 'r-')
 
 xlabel ('RTP timestamp(in ms)')
 
 ylabel ('Time(ms)')
 
 legend ('Packet arrives', 'Frame complete', 'Decode', 'Decode complete', 'Time to render', 'Only jitter', 'Must decode')
 
subplot (312)
 
% % plot (completeTs(completeIdx), completeTime(completeIdx, 3) - estimatedArrivalTime(arrivalIdx, 2))
 
plot (completeTs(completeIdx) - completeTs(completeIdx(1)), devFromAvgCompleteTime)
 
plot (completeTime(:, 1) - completeTime(1, 1), completeTime(:, 4), 'r')
 
plot (decodeCompleteTime(:, 1) - decodeCompleteTime(1, 1), decodeCompleteTime(:, 2), 'g')
 
plot (decodeCompleteTime(:, 1) - decodeCompleteTime(1, 1), decodeCompleteTime(:, 3), 'k')
 
xlabel ('RTP timestamp')
 
legend ('Complete time - Estimated arrival time', 'Desired jitter buffer level', 'Actual decode time', 'Max decode time', 0)
 
 plot (renderTime(:, 1) - firstTime, renderTime(:, 3), 'r-')
 
 plot (renderTime(:, 1) - firstTime, renderTime(:, 4), 'b-')
 
 plot (renderTime(:, 1) - firstTime, renderTime(:, 5), 'g-')
 
 plot (renderTime(:, 1) - firstTime, renderTime(:, 6), 'k-')
 
 plot (renderTime(:, 1) - firstTime, targetDelay, 'c-')
 
 legend ('Render delay', 'Jitter delay', 'Decode delay', 'Extra delay', 'Min total delay')
 

Variables

 function [t, TS]
 
DEBUG
 
 __pad0__
 
 __pad1__
 
 __pad2__
 
 __pad3__
 
Frame decoded
 
 __pad4__
 
Received complete frame timestamp frame type frame size at time
 
 __pad5__
 
end line = fgetl(fid)
 
 estimatedArrivalTime = []
 
 packetTime = []
 
 firstPacketTime = []
 
 decodeTime = []
 
 decodeCompleteTime = []
 
 renderTime = []
 
 completeTime = []
 
 continue
 
end % Parse the trace line header [tempres, count] = sscanf(line, 'DEBUG ; (%u:%u:%u:%u |%*lu)%13c:')
 
if count< 5 line=fgetl(fid);continue;end hr=tempres(1);mn=tempres(2);sec=tempres(3);ms=tempres(4);timeInMs=hr *60 *60 *1000+mn *60 *1000+sec *1000+ms;label=tempres(5:end);I=find(label ~=32);label=label(I(1):end);% remove white spaces if ~strncmp(char(label), 'VIDEO', 5) &~strncmp(char(label), 'VIDEO CODING', 12) line=fgetl(fid);continue;end message=line(72:end);% Parse message [p, count]=sscanf(message, 'ExtrapolateLocalTime(% lu)=% lu ms');if count==2 estimatedArrivalTime=[estimatedArrivalTime;p'];line=fgetl(fid);continue;end [p, count]=sscanf(message, 'Packet seqNo % u of frame % lu at % lu');if count==3 packetTime=[packetTime;p'];line=fgetl(fid);continue;end [p, count]=sscanf(message, 'First packet of frame % lu at % lu');if count==2 firstPacketTime=[firstPacketTime;p'];line=fgetl(fid);continue;end [p, count]=sscanf(message, 'Decoding timestamp % lu at % lu');if count==2 decodeTime=[decodeTime;p'];line=fgetl(fid);continue;end [p, count]=sscanf(message, 'Render frame % lu at % lu. Render delay % lu, required delay % lu, max decode time % lu, min total delay % lu');if count==6 renderTime=[renderTime;p'];line=fgetl(fid);continue;end [p, count]=sscanf(message, 'Frame decoded:timeStamp=% lu decTime=% d maxDecTime=% lu, at % lu');if count==4 decodeCompleteTime=[decodeCompleteTime;p'];line=fgetl(fid);continue;end [p, count]=sscanf(message, 'Received complete frame timestamp % lu frame type % u frame size % *u at time % lu, jitter estimate was % lu');if count==4 completeTime=[completeTime;p'];line=fgetl(fid);continue;end line=fgetl(fid);endfclose(fid);t=completeTime(:, 3);TS=completeTime(:, 1);figure;subplot(211);hold on;slope=0;if sum(size(packetTime)) > % Plot the time when each packet arrives firstTimeStamp = packetTime(1,2)
 
 x = (packetTime(:,2) - firstTimeStamp)/90
 
if flat slope = x
 
end firstTime = packetTime(1,3)
 
% hold on
 
completeTs = completeTime(:, 1)
 
arrivalTs = estimatedArrivalTime(:, 1)
 
 % [c, completeIdx, arrivalIdx] = intersect(completeTs, arrivalTs)
 
timeUntilComplete = completeTime(completeIdx, 3) - estimatedArrivalTime(arrivalIdx, 2)
 
devFromAvgCompleteTime = timeUntilComplete - mean(timeUntilComplete)
 
 targetDelay = max(renderTime(:, 3) + renderTime(:, 4) + renderTime(:, 5), renderTime(:, 6))
 

Function Documentation

◆ ExtrapolateLocalTime()

ExtrapolateLocalTime ( 1870967878  )

◆ ischar()

while ischar ( line  )

◆ legend() [1/3]

legend ( 'Packet arrives'  ,
'Frame complete'  ,
'Decode'  ,
'Decode complete'  ,
'Time to render'  ,
'Only jitter ,
'Must decode  
)

◆ legend() [2/3]

% legend ( 'Complete time - Estimated arrival time ,
'Desired jitter buffer level ,
'Actual decode time ,
'Max decode time ,
 
)

◆ legend() [3/3]

legend ( 'Render delay'  ,
'Jitter delay'  ,
'Decode delay'  ,
'Extra delay'  ,
'Min total delay'   
)

◆ plot() [1/19]

plot ( x  ,
packetTime(:, 3) - firstTime slope,
'b.'   
)

◆ plot() [2/19]

plot ( x  ,
firstPacketTime(:, 2) - firstTime slope,
'b.'   
)

◆ plot() [3/19]

end plot ( x  ,
completeTime(:, 3) - firstTime slope,
'ks'   
)

◆ plot() [4/19]

end plot ( x  ,
decodeTime(:, 2) - firstTime slope,
'r.'   
)

◆ plot() [5/19]

end plot ( x  ,
decodeCompleteTime(:, 4) - firstTime slope,
'g.'   
)

◆ plot() [6/19]

end plot ( x  ,
renderTime(:, 2) - firstTime slope,
'c-'   
)

◆ plot() [7/19]

end plot ( x  ,
renderTime(:, 2) - firstTime - slope - renderTime(:, 3) - renderTime(:, 5)  ,
'c--'   
)

◆ plot() [8/19]

end plot ( x  ,
renderTime(:, 2) - firstTime - slope - renderTime(:, 3) - renderTime(:, 5)  ,
'b-'   
)

◆ plot() [9/19]

end % plot ( x  ,
90 *  x,
'r-'   
)

◆ plot() [10/19]

% % plot ( completeTs(completeIdx)  ,
completeTime(completeIdx, 3) - estimatedArrivalTime(arrivalIdx, 2)   
)

◆ plot() [11/19]

% plot ( completeTs(completeIdx) - completeTs(completeIdx(1))  ,
devFromAvgCompleteTime   
)

◆ plot() [12/19]

% plot ( completeTime(:, 1) - completeTime(1, 1)  ,
completeTime(:, 4)  ,
'r  
)

◆ plot() [13/19]

% plot ( decodeCompleteTime(:, 1) - decodeCompleteTime(1, 1)  ,
decodeCompleteTime(:, 2)  ,
'g  
)

◆ plot() [14/19]

% plot ( decodeCompleteTime(:, 1) - decodeCompleteTime(1, 1)  ,
decodeCompleteTime(:, 3)  ,
'k  
)

◆ plot() [15/19]

plot ( renderTime(:, 1) -  firstTime,
renderTime(:, 3)  ,
'r-'   
)

◆ plot() [16/19]

plot ( renderTime(:, 1) -  firstTime,
renderTime(:, 4)  ,
'b-'   
)

◆ plot() [17/19]

plot ( renderTime(:, 1) -  firstTime,
renderTime(:, 5)  ,
'g-'   
)

◆ plot() [18/19]

plot ( renderTime(:, 1) -  firstTime,
renderTime(:, 6)  ,
'k-'   
)

◆ plot() [19/19]

plot ( renderTime(:, 1) -  firstTime,
targetDelay  ,
'c-'   
)

◆ prod() [1/4]

end % Plot the frame complete time if prod ( size(completeTime )

◆ prod() [2/4]

end % Plot the time the decode starts if prod ( size(decodeTime )

◆ prod() [3/4]

end % Plot the decode complete time if prod ( size(decodeCompleteTime )

◆ prod() [4/4]

if prod ( size(renderTime )

◆ subplot()

% subplot ( 312  )

◆ xlabel() [1/2]

xlabel ( 'RTP timestamp(in ms)'  )

◆ xlabel() [2/2]

xlabel ( 'RTP timestamp )

◆ ylabel()

ylabel ( 'Time(ms)'  )

Variable Documentation

◆ %

%[c, completeIdx, arrivalIdx] = intersect(completeTs, arrivalTs)

◆ __pad0__

__pad0__

◆ __pad1__

__pad1__

◆ __pad2__

__pad2__

◆ __pad3__

__pad3__

◆ __pad4__

__pad4__

◆ __pad5__

__pad5__

◆ arrivalTs

% arrivalTs = estimatedArrivalTime(:, 1)

◆ completeTime

completeTime = []

◆ completeTs

% completeTs = completeTime(:, 1)

◆ continue

continue

◆ DEBUG

Stochastic test DEBUG

◆ decodeCompleteTime

decodeCompleteTime = []

◆ decoded

Frame decoded

◆ decodeTime

decodeTime = []

◆ devFromAvgCompleteTime

% devFromAvgCompleteTime = timeUntilComplete - mean(timeUntilComplete)

◆ estimatedArrivalTime

estimatedArrivalTime = []

◆ firstPacketTime

firstPacketTime = []

◆ firstTime

end firstTime = packetTime(1,3)

◆ firstTimeStamp

else Plot the time when the first packet of a frame arrives firstTimeStamp = packetTime(1,2)

◆ function

function[t, TS]
Initial value:
= plotReceiveTrace(filename, flat)
fid=fopen(filename)
if fid
Definition: parse_delay_file.m:4
USVString filename
Definition: ErrorEvent.idl:46

◆ header

end % Parse the trace line header[tempres, count] = sscanf(line, 'DEBUG ; (%u:%u:%u:%u |%*lu)%13c:')

◆ line

end line = fgetl(fid)

◆ on

hold on

◆ packetTime

packetTime = []

◆ renderTime

renderTime = []

◆ slope

if flat slope = x

◆ targetDelay

targetDelay = max(renderTime(:, 3) + renderTime(:, 4) + renderTime(:, 5), renderTime(:, 6))

◆ time

Received complete frame timestamp frame type frame size at time

◆ timeUntilComplete

% timeUntilComplete = completeTime(completeIdx, 3) - estimatedArrivalTime(arrivalIdx, 2)

◆ x

% Plot the render time if there were no render delay x = (packetTime(:,2) - firstTimeStamp)/90