- Timestamp:
- 08/24/10 07:51:02 (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/applications/applestreamingclient/src/clientcontext.cpp
r95 r96 33 33 #include "streaming/streamsmanager.h" 34 34 #include "protocols/ts/innettsstream.h" 35 #include "applestreamingclientapplication.h" 36 #include "protocols/timer/finetimer.h" 35 37 36 38 uint32_t ClientContext::_idGenerator = 0; … … 86 88 _pEventSink = NULL; 87 89 } 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 */ 88 99 } 89 100 … … 227 238 228 239 //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 229 253 Variant job; 230 254 job["type"] = "consumeAVBuffer"; 231 255 pScheduleTimer->AddJob(job, true); 256 #endif /* HAS_MS_TIMER */ 232 257 233 258 // job["type"] = "testJNICallback"; … … 339 364 } 340 365 341 //5. Does it have any registered consumers AND sps/pps? Return if not366 //5. Does it have any registered consumers? 342 367 if (pStream->GetOutStreams().size() <= 0) { 343 368 WARN("No registered consumers or stream capabilities not yet known. Take a break..."); … … 349 374 350 375 //6. Feed 351 while ((wallClockDelta + 2000 > pStream->GetFeedTime()) && 376 // FINEST("BEFORE: wallClockDelta: %.2f; GetFeedTime: %.2f", 377 // wallClockDelta, pStream->GetFeedTime()); 378 while ((wallClockDelta > (pStream->GetFeedTime())) && 352 379 (GETAVAILABLEBYTESCOUNT(_avData) > 8192)) { 353 380 if (!pTS->SignalInputData(_avData)) { … … 356 383 } 357 384 } 385 // FINEST(" AFTER: wallClockDelta: %.2f; GetFeedTime: %.2f", 386 // wallClockDelta, pStream->GetFeedTime()); 358 387 359 388 //7. Done … … 462 491 bool ClientContext::SignalChildPlaylistAvailable(uint32_t bw) { 463 492 _parsedChildPlaylistsCount++; 493 return StartFeeding(); 494 } 495 496 bool 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); 464 503 return StartFeeding(); 465 504 } … … 614 653 if (_pEventSink->GetType() == EVENT_SYNC_VARIANT) { 615 654 _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); 616 664 } 617 665 if (_lastUsedBw < bw) {
Note: See TracChangeset
for help on using the changeset viewer.
