- Timestamp:
- 08/13/10 21:05:31 (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/applications/applestreamingclient/src/clientcontext.cpp
r56 r74 151 151 } 152 152 153 vector<double> ClientContext::GetAvailableBandwidths() { 154 vector<double> result; 155 156 FOR_MAP(_childPlaylists, uint32_t, Playlist *, i) { 157 ADD_VECTOR_END(result, MAP_KEY(i)); 158 } 159 return result; 160 } 161 162 double ClientContext::GetDetectedBandwidth() { 163 return (uint32_t) _pSpeedComputer->GetMeanSpeed()*8.0; 164 } 165 166 double ClientContext::GetSelectedBandwidth() { 167 return _optimalBw; 168 } 169 170 uint32_t ClientContext::GetBufferLevel() { 171 return GETAVAILABLEBYTESCOUNT(_avData); 172 } 173 174 uint32_t ClientContext::GetMaxBufferLevel() { 175 return _maxAVBufferSize; 176 } 177 178 double ClientContext::GetBufferLevelPercent() { 179 return ((double) GetBufferLevel() / (double) GetMaxBufferLevel())*100.00; 180 } 181 153 182 bool ClientContext::StartProcessing() { 154 183 //1. Parse the connecting string and split it into usable pieces … … 255 284 256 285 //4. Get the inbound TS stream 286 if (_pStreamsManager == NULL) { 287 WARN("No stream manager yet"); 288 return true; 289 } 257 290 InNetTSStream *pStream = (InNetTSStream *) _pStreamsManager->FindByUniqueId( 258 291 _streamId); … … 425 458 } 426 459 427 static int aaa = 0;428 429 460 bool ClientContext::SignalSpeedDetected(double instantAmount, double instantTime) { 430 461 // FINEST("instantAmount: %.2f; instantTime: %.8f; Speed: %.2f KB/s", … … 435 466 uint32_t before = _optimalBw; 436 467 meanSpeed *= 8.0; 437 if (((aaa++) % 200) == 0) {438 double ms = meanSpeed / 1024.00 / 8;439 string um = "KB/s";440 if (ms > 1024) {441 ms = ms / 1024.00;442 um = "MB/s";443 }444 //FINEST("Speed: %.2f %s", ms, STR(um));445 }468 // if (((aaa++) % 200) == 0) { 469 // double ms = meanSpeed / 1024.00 / 8; 470 // string um = "KB/s"; 471 // if (ms > 1024) { 472 // ms = ms / 1024.00; 473 // um = "MB/s"; 474 // } 475 // //FINEST("Speed: %.2f %s", ms, STR(um)); 476 // } 446 477 447 478 _optimalBw = MAP_KEY(_childPlaylists.begin());
Note: See TracChangeset
for help on using the changeset viewer.
