Alex Bikfalvi
SimStream Documentation
StreamBufferPull.h
00001 #pragma once 00002 00003 #include "StreamBufferSegment.h" 00004 00005 class CStreamBufferPull 00006 { 00007 private: 00008 __uint32 size; 00009 __uint32 sizeSegment; 00010 __uint32 sizeHistory; 00011 __uint32 sizePlay; 00012 00013 __uint32 ptrFirst; 00014 __uint32 ptrLast; 00015 00016 __uint32 currentIndex; 00017 __uint32 currentSegment; 00018 00019 CStreamBufferSegment** buffer; 00020 00021 public: 00022 CStreamBufferPull( 00023 __uint32 size, 00024 __uint32 sizeSegment, 00025 __uint32 sizeHistory 00026 ); 00027 virtual ~CStreamBufferPull(); 00028 00029 void Reset(__uint32 frame); 00030 bool Add(CStreamSegmentFrame frame); 00031 void Shift(); 00032 00033 inline bool HasCurrentIndex() { return this->buffer[this->ptrFirst]->Has(this->currentIndex); } 00034 inline __uint32 CurrentIndex() { return this->currentIndex; } 00035 inline __uint32 CurrentSegment() { return this->currentSegment; } 00036 inline CStreamSegmentFrame* CurrentFrame() { return this->buffer[this->ptrFirst]->Frame(this->currentIndex); } 00037 00038 bool IsCurrentDecodable(); 00039 inline bool IsCurrentComplete() { return this->buffer[this->ptrFirst]->IsComplete(); } 00040 bool IsDecodable(__uint32 frame); 00041 bool IsComplete(__uint32 segment); 00042 00043 void Log(); 00044 };
Last updated: February 8, 2011