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

-- android related stuff

File:
1 edited

Legend:

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

    r87 r88  
    4444        _currentItemIndex = 0; 
    4545        _optimalBw = 0; 
     46        _lastUsedBw = 0; 
    4647        _pSpeedComputer = NULL; 
    4748        _tsId = 0; 
     
    5253        _pStreamsManager = NULL; 
    5354        _lastWallClock = 0; 
    54         _lastStreamClock = 0; 
    5555        _avData.EnsureSize(_maxAVBufferSize * 3); 
    5656        INFO("Context created: %d (%p)", _id, this); 
     
    103103                pResult = new ClientContext(); 
    104104                pResult->_applicationId = applicationId; 
    105                 pResult->_pEventSink = BaseEventSink::GetInstance(masterProtocolType); 
     105                pResult->_pEventSink = BaseEventSink::GetInstance(masterProtocolType, 
     106                                pResult->_id); 
    106107                contextId = pResult->_id; 
    107108                _contexts[pResult->_id] = pResult; 
     
    579580        customParameters["itemUri"] = itemUri; 
    580581        customParameters["bw"] = bw; 
     582        //replace(keyUri, "http://www.mlb.com", "https://qa.mlb.com"); 
    581583        return FetchURI(keyUri, "key", customParameters); 
    582584} 
    583585 
    584586bool ClientContext::FetchTS(string uri, uint32_t bw, string key, uint64_t iv) { 
     587        //1. Prepare custom parameters 
    585588        Variant customParameters; 
    586589        if (key == "") { 
     
    602605        customParameters["iv"] = iv; 
    603606        customParameters["bw"] = bw; 
     607 
     608        //2. setup last bw used 
     609        if (_lastUsedBw == 0) 
     610                _lastUsedBw = bw; 
     611 
     612        if (_lastUsedBw != bw) { 
     613                if (_pEventSink->GetType() == EVENT_SYNC_VARIANT) { 
     614                        _avData.IgnoreAll(); 
     615                } 
     616                if (_lastUsedBw < bw) { 
     617                        _pEventSink->SignalUpgradeBandwidth(_lastUsedBw, bw); 
     618                } else { 
     619                        _pEventSink->SignalDowngradeBandwidth(_lastUsedBw, bw); 
     620                } 
     621        } 
     622 
     623        _lastUsedBw = bw; 
     624 
     625 
    604626        return FetchURI(uri, "ts", customParameters); 
    605627} 
Note: See TracChangeset for help on using the changeset viewer.