VCM:frame_buffer - removing unused code and refactor

Review URL: http://webrtc-codereview.appspot.com/77001

git-svn-id: http://webrtc.googlecode.com/svn/trunk@235 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
mikhal@google.com 2011-07-19 23:24:37 +00:00
parent b3916d54b0
commit 0ef0377836
2 changed files with 28 additions and 32 deletions

View File

@ -67,17 +67,6 @@ VCMFrameBuffer::GetLowSeqNum()
return _sessionInfo.GetLowSeqNum();
}
// Get highest sequence number for complete sessions
WebRtc_Word32
VCMFrameBuffer::GetHighSeqNumComplete()
{
if (_sessionInfo.IsSessionComplete())
{
return _sessionInfo.GetHighSeqNum();
}
return -1;
}
WebRtc_Word32
VCMFrameBuffer::GetHighSeqNum()
{
@ -101,7 +90,7 @@ VCMFrameBuffer::InsertPacket(const VCMPacket& packet, WebRtc_Word64 timeInMs)
}
// Sanity to check if the frame has been freed. (Too old for example)
if(_state == kStateFree)
if (_state == kStateFree)
{
return kStateError;
}
@ -179,7 +168,7 @@ VCMFrameBuffer::InsertPacket(const VCMPacket& packet, WebRtc_Word64 timeInMs)
_latestPacketTimeMs = timeInMs;
if(_sessionInfo.IsSessionComplete())
if (_sessionInfo.IsSessionComplete())
{
return kCompleteSession;
}
@ -196,15 +185,18 @@ VCMFrameBuffer::InsertPacket(const VCMPacket& packet, WebRtc_Word64 timeInMs)
return kIncomplete;
}
WebRtc_Word64 VCMFrameBuffer::LatestPacketTimeMs()
WebRtc_Word64
VCMFrameBuffer::LatestPacketTimeMs()
{
return _latestPacketTimeMs;
}
// Zero out all entries in list up to and including the (first) entry equal to _lowSeqNum
WebRtc_Word32 VCMFrameBuffer::ZeroOutSeqNum(WebRtc_Word32* list, WebRtc_Word32 num)
// Zero out all entries in list up to and including the (first)
// entry equal to _lowSeqNum
WebRtc_Word32
VCMFrameBuffer::ZeroOutSeqNum(WebRtc_Word32* list, WebRtc_Word32 num)
{
if(_sessionInfo.ZeroOutSeqNum(list, num) != 0)
if (_sessionInfo.ZeroOutSeqNum(list, num) != 0)
{
return -1;
}
@ -215,24 +207,28 @@ WebRtc_Word32 VCMFrameBuffer::ZeroOutSeqNum(WebRtc_Word32* list, WebRtc_Word32 n
// _lowSeqNum. Hybrid mode: 1. Don't NACK FEC packets 2. Make a smart decision
// on whether to NACK or not
WebRtc_Word32 VCMFrameBuffer::ZeroOutSeqNumHybrid(WebRtc_Word32* list,
WebRtc_Word32 num,
float rttScore)
WebRtc_Word32
VCMFrameBuffer::ZeroOutSeqNumHybrid(WebRtc_Word32* list,
WebRtc_Word32 num,
float rttScore)
{
return _sessionInfo.ZeroOutSeqNumHybrid(list, num, rttScore);
}
void VCMFrameBuffer::IncrementNackCount()
void
VCMFrameBuffer::IncrementNackCount()
{
_nackCount++;
}
WebRtc_Word16 VCMFrameBuffer::GetNackCount() const
WebRtc_Word16
VCMFrameBuffer::GetNackCount() const
{
return _nackCount;
}
bool VCMFrameBuffer::HaveLastPacket()
bool
VCMFrameBuffer::HaveLastPacket()
{
return _sessionInfo.HaveLastPacket();
}
@ -244,7 +240,8 @@ VCMFrameBuffer::ForceSetHaveLastPacket()
return _sessionInfo.IsSessionComplete();
}
void VCMFrameBuffer::Reset()
void
VCMFrameBuffer::Reset()
{
_length = 0;
_timeStamp = 0;
@ -270,7 +267,7 @@ VCMFrameBuffer::MakeSessionDecodable()
void
VCMFrameBuffer::SetState(VCMFrameBufferStateEnum state)
{
if(_state == state)
if (_state == state)
{
return;
}
@ -309,7 +306,8 @@ VCMFrameBuffer::SetState(VCMFrameBufferStateEnum state)
// we can go to this state from state kStateComplete kStateIncomplete
assert(_state == kStateComplete || _state == kStateIncomplete ||
_state == kStateDecodable);
// Transfer frame information to EncodedFrame and create any codec specific information
// Transfer frame information to EncodedFrame and create any codec
// specific information
RestructureFrameInformation();
break;

View File

@ -32,7 +32,8 @@ public:
virtual void Reset();
VCMFrameBufferEnum InsertPacket(const VCMPacket& packet, WebRtc_Word64 timeInMs);
VCMFrameBufferEnum InsertPacket(const VCMPacket& packet,
WebRtc_Word64 timeInMs);
// State
// Get current state of frame
@ -54,15 +55,12 @@ public:
// Get highest packet sequence number in frame
WebRtc_Word32 GetHighSeqNum();
// Get highest sequence number of complete session
WebRtc_Word32 GetHighSeqNumComplete();
// Set counted status (as counted by JB or not)
void SetCountedFrame(bool frameCounted);
bool GetCountedFrame();
// NACK
// Zero out all entries in list up to and including the entry equal to _lowSeqNum
// Zero out all entries in list up to and including _lowSeqNum
WebRtc_Word32 ZeroOutSeqNum(WebRtc_Word32* list, WebRtc_Word32 num);
// Hybrid extension: only NACK important packets, discard FEC packets
WebRtc_Word32 ZeroOutSeqNumHybrid(WebRtc_Word32* list,
@ -84,7 +82,7 @@ protected:
private:
VCMFrameBufferStateEnum _state; // Current state of the frame
bool _frameCounted; // If this frame has been counted by JB
bool _frameCounted; // Was this frame counted by JB?
VCMSessionInfo _sessionInfo;
WebRtc_UWord16 _nackCount;
WebRtc_Word64 _latestPacketTimeMs;