Alex Bikfalvi
SimStream Documentation
StreamBufferLayer.h
00001 #pragma once 00002 00003 #include "StreamFrame.h" 00004 00005 class CStreamBufferLayer 00006 { 00007 private: 00008 __uint32 size; 00009 __uint32 sizeHistory; 00010 __uint32 sizePlay; 00011 00012 __uint32 ptrFirst; 00013 __uint32 ptrLast; 00014 00015 __uint32 currentIndex; 00016 00017 __uint32 count; 00018 __uint32 numHistory; 00019 __uint32 numPlay; 00020 00021 CStreamFrame* buffer; 00022 bool* bitmap; 00023 bool* coder; 00024 00025 public: 00026 CStreamBufferLayer( 00027 __uint32 size, 00028 __uint32 sizeHistory 00029 ); 00030 ~CStreamBufferLayer(); 00031 00032 void Reset(__uint32 index); 00033 bool Add(CStreamFrame frame, __uint32 layerIndex); 00034 00035 inline __uint32 Size() { return this->size; } 00036 inline __uint32 SizePlay() { return this->sizePlay; } 00037 inline __uint32 SizeHistory() { return this->sizeHistory; } 00038 00039 inline __uint32 Count() { return this->count; } 00040 inline __uint32 NumPlay() { return this->numPlay; } 00041 inline __uint32 NumHistory() { return this->numHistory; } 00042 00043 void Shift(); 00044 00045 bool Has(__uint32 index); 00046 inline bool HasCurrentIndex() { return this->bitmap[this->ptrFirst]; } 00047 00048 inline __uint32 CurrentIndex() { return this->currentIndex; } 00049 inline CStreamFrame* CurrentFrame() { return &this->buffer[this->ptrFirst]; } 00050 CStreamFrame* Frame(__uint32 index); 00051 00052 bool IsCurrentDecodable(); 00053 bool IsDecodable(__uint32 index); 00054 void SetCurrentDecodable(); 00055 void SetDecodable(__uint32 index); 00056 inline bool IsCurrentIndependent() { return this->bitmap[this->ptrFirst] && (this->buffer[this->ptrFirst].AnchorP() == 0) && (this->buffer[this->ptrFirst].AnchorB() == 0); } 00057 };
Last updated: February 8, 2011