public bool ReadFrame(BinaryReader reader) { mThreadID = reader.ReadInt32(); mFrameNumber = reader.ReadUInt64(); mNumSamples = reader.ReadUInt32(); mStartTime = reader.ReadDouble(); int len = reader.ReadInt32(); mBuffer = new BDynamicCoderBuf((int)len); reader.ReadBytes((int)len).CopyTo(mBuffer.getBuf(), 0); return(true); }
public bool DecompressFrame(BTimelineSampleCodec decomp, ref BRetiredProfileSample[] decodedSamplesBuffer) { BProfileSection[] sections = mSections; if (mCompressedFrame == null) { return(false); } ICoderBuffer buffer = mCompressedFrame.GetBuffer(); decomp.resetModel(); buffer.setPos(0); BitPacker bitPacker = new BitPacker(buffer); bool success = bitPacker.decodeStart(); BRetiredProfileSample decodedSample; int i; try { for (i = 0; i < mNumSamples; i++) { decodedSample = decodedSamplesBuffer[i]; success = decomp.decodeSample(bitPacker, ref decodedSample, sections); if (success == false) { ErrorHandler.Error(String.Format("Error decompressing sample {0} from frame# {1}", i, this.mFrameNumber)); // return false; } ProcessSample(decodedSample, i); } mDutyCycle.BuildDutyCycle(ref decodedSamplesBuffer, mNumSamples, false); mDutyCycle.mStartTime = mStartTime; if (this.mbHasGPUSamples == true) { mGpuDutyCycle.BuildDutyCycle(ref decodedSamplesBuffer, mNumSamples, true); mGpuDutyCycle.mStartTime = mStartTime; } mSamples = decodedSamplesBuffer; } catch (System.Exception ex) { ErrorHandler.Error(ex.ToString()); return(false); } return(true); }
public void SetBuffer(ICoderBuffer buffer) { mBuffer = buffer; }
public BitPacker(/*ref*/ ICoderBuffer pBuf) : base(pBuf) { }
public void setBuffer(/*ref*/ ICoderBuffer pBuf) { mpBuf = pBuf; }
public BBitPacker(/*ref*/ ICoderBuffer pBuf) { mBitBuf = 0; mNumBufBits = 0; mpBuf = pBuf; }