Ignore:
Timestamp:
08/13/10 21:05:31 (22 months ago)
Author:
shiretu
Message:

-- work on apple streaming

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/applications/applestreamingclient/src/clientcontext.cpp

    r56 r74  
    151151} 
    152152 
     153vector<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 
     162double ClientContext::GetDetectedBandwidth() { 
     163        return (uint32_t) _pSpeedComputer->GetMeanSpeed()*8.0; 
     164} 
     165 
     166double ClientContext::GetSelectedBandwidth() { 
     167        return _optimalBw; 
     168} 
     169 
     170uint32_t ClientContext::GetBufferLevel() { 
     171        return GETAVAILABLEBYTESCOUNT(_avData); 
     172} 
     173 
     174uint32_t ClientContext::GetMaxBufferLevel() { 
     175        return _maxAVBufferSize; 
     176} 
     177 
     178double ClientContext::GetBufferLevelPercent() { 
     179        return ((double) GetBufferLevel() / (double) GetMaxBufferLevel())*100.00; 
     180} 
     181 
    153182bool ClientContext::StartProcessing() { 
    154183        //1. Parse the connecting string and split it into usable pieces 
     
    255284 
    256285        //4. Get the inbound TS stream 
     286        if (_pStreamsManager == NULL) { 
     287                WARN("No stream manager yet"); 
     288                return true; 
     289        } 
    257290        InNetTSStream *pStream = (InNetTSStream *) _pStreamsManager->FindByUniqueId( 
    258291                        _streamId); 
     
    425458} 
    426459 
    427 static int aaa = 0; 
    428  
    429460bool ClientContext::SignalSpeedDetected(double instantAmount, double instantTime) { 
    430461        //      FINEST("instantAmount: %.2f; instantTime: %.8f; Speed: %.2f KB/s", 
     
    435466        uint32_t before = _optimalBw; 
    436467        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        //      } 
    446477 
    447478        _optimalBw = MAP_KEY(_childPlaylists.begin()); 
Note: See TracChangeset for help on using the changeset viewer.