示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
 public void SetBuffer(ICoderBuffer buffer)
 {
     mBuffer = buffer;
 }
示例#4
0
 public BitPacker(/*ref*/ ICoderBuffer pBuf) : base(pBuf)
 {
 }
示例#5
0
 public void setBuffer(/*ref*/ ICoderBuffer pBuf)
 {
     mpBuf = pBuf;
 }
示例#6
0
 public BBitPacker(/*ref*/ ICoderBuffer pBuf)
 {
     mBitBuf     = 0;
     mNumBufBits = 0;
     mpBuf       = pBuf;
 }