Ignore:
Timestamp:
08/24/10 07:51:02 (21 months ago)
Author:
shiretu
Message:

-- android related

File:
1 edited

Legend:

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

    r95 r96  
    3333#include "streaming/streamsmanager.h" 
    3434#include "protocols/ts/innettsstream.h" 
     35#include "applestreamingclientapplication.h" 
     36#include "protocols/timer/finetimer.h" 
    3537 
    3638uint32_t ClientContext::_idGenerator = 0; 
     
    8688                _pEventSink = NULL; 
    8789        } 
     90#ifdef HAS_MS_TIMER 
     91        AppleStreamingClientApplication *pApp = GetApplication(); 
     92        if (pApp != NULL) { 
     93                FineTimer *pFineTimer = pApp->GetFineTimer(); 
     94                if (pFineTimer != NULL) { 
     95                        pFineTimer->UnRegisterContextId(_id); 
     96                } 
     97        } 
     98#endif /* HAS_MS_TIMER */ 
    8899} 
    89100 
     
    227238 
    228239        //5. Add the recurring job for consuming the A/V data buffer 
     240#ifdef HAS_MS_TIMER 
     241        AppleStreamingClientApplication *pApp = GetApplication(); 
     242        if (pApp != NULL) { 
     243                FineTimer *pFineTimer = pApp->GetFineTimer(); 
     244                if (pFineTimer != NULL) { 
     245                        pFineTimer->RegisterContextId(_id); 
     246                } else { 
     247                        ASSERT("Unable to find fine timer"); 
     248                } 
     249        } else { 
     250                ASSERT("Unable to find application"); 
     251        } 
     252#else 
    229253        Variant job; 
    230254        job["type"] = "consumeAVBuffer"; 
    231255        pScheduleTimer->AddJob(job, true); 
     256#endif /* HAS_MS_TIMER */ 
    232257 
    233258        //      job["type"] = "testJNICallback"; 
     
    339364        } 
    340365 
    341         //5. Does it have any registered consumers AND sps/pps? Return if not 
     366        //5. Does it have any registered consumers? 
    342367        if (pStream->GetOutStreams().size() <= 0) { 
    343368                WARN("No registered consumers or stream capabilities not yet known. Take a break..."); 
     
    349374 
    350375        //6. Feed 
    351         while ((wallClockDelta + 2000 > pStream->GetFeedTime()) && 
     376        //      FINEST("BEFORE: wallClockDelta: %.2f; GetFeedTime: %.2f", 
     377        //                      wallClockDelta, pStream->GetFeedTime()); 
     378        while ((wallClockDelta > (pStream->GetFeedTime())) && 
    352379                        (GETAVAILABLEBYTESCOUNT(_avData) > 8192)) { 
    353380                if (!pTS->SignalInputData(_avData)) { 
     
    356383                } 
    357384        } 
     385        //      FINEST(" AFTER: wallClockDelta: %.2f; GetFeedTime: %.2f", 
     386        //                      wallClockDelta, pStream->GetFeedTime()); 
    358387 
    359388        //7. Done 
     
    462491bool ClientContext::SignalChildPlaylistAvailable(uint32_t bw) { 
    463492        _parsedChildPlaylistsCount++; 
     493        return StartFeeding(); 
     494} 
     495 
     496bool ClientContext::SignalChildPlaylistNotAvailable(uint32_t bw) { 
     497        if (!MAP_HAS1(_childPlaylists, bw)) 
     498                return true; 
     499        Playlist *pPl = _childPlaylists[bw]; 
     500        delete pPl; 
     501        _childPlaylists.erase(bw); 
     502        WARN("bw %d removed", bw); 
    464503        return StartFeeding(); 
    465504} 
     
    614653                if (_pEventSink->GetType() == EVENT_SYNC_VARIANT) { 
    615654                        _avData.IgnoreAll(); 
     655                        InNetTSStream *pStream = (InNetTSStream *) _pStreamsManager->FindByUniqueId( 
     656                                        _streamId); 
     657                        if (pStream == NULL) { 
     658                                FATAL("Unable to get the inbound stream"); 
     659                                return false; 
     660                        } 
     661                        StreamCapabilities *pSC = pStream->GetCapabilities(); 
     662                        pSC->Clear(); 
     663                        _pEventSink->SignalStreamUnRegistered(_streamName); 
    616664                } 
    617665                if (_lastUsedBw < bw) { 
Note: See TracChangeset for help on using the changeset viewer.