Alex Bikfalvi
SimStream Documentation
StreamBufferSegment.h
00001 #pragma once 00002 00003 #include "StreamSegment.h" 00004 00005 class CStreamBufferSegment 00006 { 00007 private: 00008 __uint32 size; 00009 __uint32 sizeHistory; 00010 __uint32 sizePlay; 00011 __uint32 sizeSegment; 00012 00013 __uint32 ptrFirst; 00014 __uint32 ptrLast; 00015 00016 __uint32 currentIndexSegment; 00017 __uint32 currentIndexFrame; 00018 00019 __uint32 stream; 00020 00021 CStreamSegment** buffer; 00022 00023 public: 00024 CStreamBufferSegment( 00025 __uint32 size, 00026 __uint32 sizeHistory, 00027 __uint32 sizeSegment 00028 ); 00029 virtual ~CStreamBufferSegment(); 00030 00031 void Reset(__uint32 stream, __uint32 indexSegment); 00032 bool Add(CStreamFrame frame); 00033 00034 inline __uint32 Size() { return this->size; } 00035 inline __uint32 SizePlay() { return this->sizePlay; } 00036 inline __uint32 SizeHistory() { return this->sizeHistory; } 00037 00038 inline __uint32 Stream() { return this->stream; } 00039 00040 void ShiftFrame(); 00041 void ShiftSegment(); 00042 00043 inline __uint32 CurrentIndexSegment() { return this->currentIndexSegment; } 00044 inline __uint32 CurrentIndexFrame() { return this->currentIndexSegment * this->sizeSegment + this->currentIndexFrame; } 00045 00046 bool HasSegment(__uint32 index); 00047 inline bool HasCurrentSegment() { return this->buffer[this->ptrFirst] != NULL; } 00048 00049 bool IsSegmentReceiving(__uint32 index); 00050 bool IsSegmentComplete(__uint32 index); 00051 00052 void SegmentReceiving(__uint32 index, bool receiving); 00053 00054 bool HasFrame(__uint32 index); 00055 bool HasCurrentFrame(); 00056 00057 bool IsCurrentFrameDecodable(); 00058 bool IsFrameDecodable(__uint32 index); 00059 00060 CStreamSegment* GetSegment(__uint32 index); 00061 00062 CStreamFrame CurrentFrame(); 00063 };
Last updated: February 8, 2011